From 9e1f4896506f2ec38f91a45503902389569a5fa9 Mon Sep 17 00:00:00 2001 From: shamoo53 Date: Sun, 22 Feb 2026 16:58:37 +0100 Subject: [PATCH 1/2] Add-Asset-Documents-UI-to-Asset-Detail-Page Add-Asset-Documents-UI-to-Asset-Detail-Page --- frontend/app/(dashboard)/assets/[id]/page.tsx | 95 +- node_modules/.package-lock.json | 43 + node_modules/@tanstack/query-core/LICENSE | 21 + .../query-core/build/legacy/chunk-PXG64RU4.js | 25 + .../build/legacy/chunk-PXG64RU4.js.map | 1 + .../query-core/build/legacy/focusManager.cjs | 108 ++ .../build/legacy/focusManager.cjs.map | 1 + .../build/legacy/focusManager.d.cts | 17 + .../query-core/build/legacy/focusManager.d.ts | 17 + .../query-core/build/legacy/focusManager.js | 81 + .../build/legacy/focusManager.js.map | 1 + .../build/legacy/hydration-BlEVG2Lp.d.ts | 1384 ++++++++++++++++ .../build/legacy/hydration-uphG6M-i.d.cts | 1384 ++++++++++++++++ .../query-core/build/legacy/hydration.cjs | 178 +++ .../query-core/build/legacy/hydration.cjs.map | 1 + .../query-core/build/legacy/hydration.d.cts | 3 + .../query-core/build/legacy/hydration.d.ts | 3 + .../query-core/build/legacy/hydration.js | 152 ++ .../query-core/build/legacy/hydration.js.map | 1 + .../query-core/build/legacy/index.cjs | 110 ++ .../query-core/build/legacy/index.cjs.map | 1 + .../query-core/build/legacy/index.d.cts | 10 + .../query-core/build/legacy/index.d.ts | 10 + .../query-core/build/legacy/index.js | 73 + .../query-core/build/legacy/index.js.map | 1 + .../build/legacy/infiniteQueryBehavior.cjs | 146 ++ .../legacy/infiniteQueryBehavior.cjs.map | 1 + .../build/legacy/infiniteQueryBehavior.d.cts | 15 + .../build/legacy/infiniteQueryBehavior.d.ts | 15 + .../build/legacy/infiniteQueryBehavior.js | 126 ++ .../build/legacy/infiniteQueryBehavior.js.map | 1 + .../build/legacy/infiniteQueryObserver.cjs | 93 ++ .../legacy/infiniteQueryObserver.cjs.map | 1 + .../build/legacy/infiniteQueryObserver.d.cts | 20 + .../build/legacy/infiniteQueryObserver.d.ts | 20 + .../build/legacy/infiniteQueryObserver.js | 74 + .../build/legacy/infiniteQueryObserver.js.map | 1 + .../query-core/build/legacy/mutation.cjs | 333 ++++ .../query-core/build/legacy/mutation.cjs.map | 1 + .../query-core/build/legacy/mutation.d.cts | 3 + .../query-core/build/legacy/mutation.d.ts | 3 + .../query-core/build/legacy/mutation.js | 306 ++++ .../query-core/build/legacy/mutation.js.map | 1 + .../query-core/build/legacy/mutationCache.cjs | 170 ++ .../build/legacy/mutationCache.cjs.map | 1 + .../build/legacy/mutationCache.d.cts | 3 + .../build/legacy/mutationCache.d.ts | 3 + .../query-core/build/legacy/mutationCache.js | 137 ++ .../build/legacy/mutationCache.js.map | 1 + .../build/legacy/mutationObserver.cjs | 190 +++ .../build/legacy/mutationObserver.cjs.map | 1 + .../build/legacy/mutationObserver.d.cts | 3 + .../build/legacy/mutationObserver.d.ts | 3 + .../build/legacy/mutationObserver.js | 164 ++ .../build/legacy/mutationObserver.js.map | 1 + .../query-core/build/legacy/notifyManager.cjs | 113 ++ .../build/legacy/notifyManager.cjs.map | 1 + .../build/legacy/notifyManager.d.cts | 46 + .../build/legacy/notifyManager.d.ts | 46 + .../query-core/build/legacy/notifyManager.js | 88 ++ .../build/legacy/notifyManager.js.map | 1 + .../query-core/build/legacy/onlineManager.cjs | 97 ++ .../build/legacy/onlineManager.cjs.map | 1 + .../build/legacy/onlineManager.d.cts | 16 + .../build/legacy/onlineManager.d.ts | 16 + .../query-core/build/legacy/onlineManager.js | 70 + .../build/legacy/onlineManager.js.map | 1 + .../build/legacy/queriesObserver.cjs | 260 +++ .../build/legacy/queriesObserver.cjs.map | 1 + .../build/legacy/queriesObserver.d.cts | 27 + .../build/legacy/queriesObserver.d.ts | 27 + .../build/legacy/queriesObserver.js | 234 +++ .../build/legacy/queriesObserver.js.map | 1 + .../query-core/build/legacy/query.cjs | 478 ++++++ .../query-core/build/legacy/query.cjs.map | 1 + .../query-core/build/legacy/query.d.cts | 3 + .../query-core/build/legacy/query.d.ts | 3 + .../query-core/build/legacy/query.js | 459 ++++++ .../query-core/build/legacy/query.js.map | 1 + .../query-core/build/legacy/queryCache.cjs | 131 ++ .../build/legacy/queryCache.cjs.map | 1 + .../query-core/build/legacy/queryCache.d.cts | 3 + .../query-core/build/legacy/queryCache.d.ts | 3 + .../query-core/build/legacy/queryCache.js | 105 ++ .../query-core/build/legacy/queryCache.js.map | 1 + .../query-core/build/legacy/queryClient.cjs | 349 +++++ .../build/legacy/queryClient.cjs.map | 1 + .../query-core/build/legacy/queryClient.d.cts | 3 + .../query-core/build/legacy/queryClient.d.ts | 3 + .../query-core/build/legacy/queryClient.js | 324 ++++ .../build/legacy/queryClient.js.map | 1 + .../query-core/build/legacy/queryObserver.cjs | 515 ++++++ .../build/legacy/queryObserver.cjs.map | 1 + .../build/legacy/queryObserver.d.cts | 3 + .../build/legacy/queryObserver.d.ts | 3 + .../query-core/build/legacy/queryObserver.js | 498 ++++++ .../build/legacy/queryObserver.js.map | 1 + .../query-core/build/legacy/removable.cjs | 69 + .../query-core/build/legacy/removable.cjs.map | 1 + .../query-core/build/legacy/removable.d.cts | 11 + .../query-core/build/legacy/removable.d.ts | 11 + .../query-core/build/legacy/removable.js | 43 + .../query-core/build/legacy/removable.js.map | 1 + .../query-core/build/legacy/retryer.cjs | 165 ++ .../query-core/build/legacy/retryer.cjs.map | 1 + .../query-core/build/legacy/retryer.d.cts | 3 + .../query-core/build/legacy/retryer.d.ts | 3 + .../query-core/build/legacy/retryer.js | 139 ++ .../query-core/build/legacy/retryer.js.map | 1 + .../query-core/build/legacy/streamedQuery.cjs | 82 + .../build/legacy/streamedQuery.cjs.map | 1 + .../build/legacy/streamedQuery.d.cts | 34 + .../build/legacy/streamedQuery.d.ts | 34 + .../query-core/build/legacy/streamedQuery.js | 59 + .../build/legacy/streamedQuery.js.map | 1 + .../query-core/build/legacy/subscribable.cjs | 51 + .../build/legacy/subscribable.cjs.map | 1 + .../build/legacy/subscribable.d.cts | 10 + .../query-core/build/legacy/subscribable.d.ts | 10 + .../query-core/build/legacy/subscribable.js | 28 + .../build/legacy/subscribable.js.map | 1 + .../query-core/build/legacy/thenable.cjs | 76 + .../query-core/build/legacy/thenable.cjs.map | 1 + .../query-core/build/legacy/thenable.d.cts | 47 + .../query-core/build/legacy/thenable.d.ts | 47 + .../query-core/build/legacy/thenable.js | 52 + .../query-core/build/legacy/thenable.js.map | 1 + .../build/legacy/timeoutManager.cjs | 110 ++ .../build/legacy/timeoutManager.cjs.map | 1 + .../build/legacy/timeoutManager.d.cts | 58 + .../build/legacy/timeoutManager.d.ts | 58 + .../query-core/build/legacy/timeoutManager.js | 81 + .../build/legacy/timeoutManager.js.map | 1 + .../query-core/build/legacy/types.cjs | 37 + .../query-core/build/legacy/types.cjs.map | 1 + .../query-core/build/legacy/types.d.cts | 3 + .../query-core/build/legacy/types.d.ts | 3 + .../query-core/build/legacy/types.js | 12 + .../query-core/build/legacy/types.js.map | 1 + .../query-core/build/legacy/utils.cjs | 330 ++++ .../query-core/build/legacy/utils.cjs.map | 1 + .../query-core/build/legacy/utils.d.cts | 3 + .../query-core/build/legacy/utils.d.ts | 3 + .../query-core/build/legacy/utils.js | 283 ++++ .../query-core/build/legacy/utils.js.map | 1 + .../query-core/build/modern/focusManager.cjs | 94 ++ .../build/modern/focusManager.cjs.map | 1 + .../build/modern/focusManager.d.cts | 17 + .../query-core/build/modern/focusManager.d.ts | 17 + .../query-core/build/modern/focusManager.js | 68 + .../build/modern/focusManager.js.map | 1 + .../build/modern/hydration-BlEVG2Lp.d.ts | 1384 ++++++++++++++++ .../build/modern/hydration-uphG6M-i.d.cts | 1384 ++++++++++++++++ .../query-core/build/modern/hydration.cjs | 173 ++ .../query-core/build/modern/hydration.cjs.map | 1 + .../query-core/build/modern/hydration.d.cts | 3 + .../query-core/build/modern/hydration.d.ts | 3 + .../query-core/build/modern/hydration.js | 145 ++ .../query-core/build/modern/hydration.js.map | 1 + .../query-core/build/modern/index.cjs | 110 ++ .../query-core/build/modern/index.cjs.map | 1 + .../query-core/build/modern/index.d.cts | 10 + .../query-core/build/modern/index.d.ts | 10 + .../query-core/build/modern/index.js | 71 + .../query-core/build/modern/index.js.map | 1 + .../build/modern/infiniteQueryBehavior.cjs | 142 ++ .../modern/infiniteQueryBehavior.cjs.map | 1 + .../build/modern/infiniteQueryBehavior.d.cts | 15 + .../build/modern/infiniteQueryBehavior.d.ts | 15 + .../build/modern/infiniteQueryBehavior.js | 120 ++ .../build/modern/infiniteQueryBehavior.js.map | 1 + .../build/modern/infiniteQueryObserver.cjs | 92 ++ .../modern/infiniteQueryObserver.cjs.map | 1 + .../build/modern/infiniteQueryObserver.d.cts | 20 + .../build/modern/infiniteQueryObserver.d.ts | 20 + .../build/modern/infiniteQueryObserver.js | 71 + .../build/modern/infiniteQueryObserver.js.map | 1 + .../query-core/build/modern/mutation.cjs | 307 ++++ .../query-core/build/modern/mutation.cjs.map | 1 + .../query-core/build/modern/mutation.d.cts | 3 + .../query-core/build/modern/mutation.d.ts | 3 + .../query-core/build/modern/mutation.js | 281 ++++ .../query-core/build/modern/mutation.js.map | 1 + .../query-core/build/modern/mutationCache.cjs | 149 ++ .../build/modern/mutationCache.cjs.map | 1 + .../build/modern/mutationCache.d.cts | 3 + .../build/modern/mutationCache.d.ts | 3 + .../query-core/build/modern/mutationCache.js | 124 ++ .../build/modern/mutationCache.js.map | 1 + .../build/modern/mutationObserver.cjs | 165 ++ .../build/modern/mutationObserver.cjs.map | 1 + .../build/modern/mutationObserver.d.cts | 3 + .../build/modern/mutationObserver.d.ts | 3 + .../build/modern/mutationObserver.js | 140 ++ .../build/modern/mutationObserver.js.map | 1 + .../query-core/build/modern/notifyManager.cjs | 113 ++ .../build/modern/notifyManager.cjs.map | 1 + .../build/modern/notifyManager.d.cts | 46 + .../build/modern/notifyManager.d.ts | 46 + .../query-core/build/modern/notifyManager.js | 86 + .../build/modern/notifyManager.js.map | 1 + .../query-core/build/modern/onlineManager.cjs | 84 + .../build/modern/onlineManager.cjs.map | 1 + .../build/modern/onlineManager.d.cts | 16 + .../build/modern/onlineManager.d.ts | 16 + .../query-core/build/modern/onlineManager.js | 58 + .../build/modern/onlineManager.js.map | 1 + .../build/modern/queriesObserver.cjs | 237 +++ .../build/modern/queriesObserver.cjs.map | 1 + .../build/modern/queriesObserver.d.cts | 27 + .../build/modern/queriesObserver.d.ts | 27 + .../build/modern/queriesObserver.js | 212 +++ .../build/modern/queriesObserver.js.map | 1 + .../query-core/build/modern/query.cjs | 452 ++++++ .../query-core/build/modern/query.cjs.map | 1 + .../query-core/build/modern/query.d.cts | 3 + .../query-core/build/modern/query.d.ts | 3 + .../query-core/build/modern/query.js | 434 +++++ .../query-core/build/modern/query.js.map | 1 + .../query-core/build/modern/queryCache.cjs | 122 ++ .../build/modern/queryCache.cjs.map | 1 + .../query-core/build/modern/queryCache.d.cts | 3 + .../query-core/build/modern/queryCache.d.ts | 3 + .../query-core/build/modern/queryCache.js | 97 ++ .../query-core/build/modern/queryCache.js.map | 1 + .../query-core/build/modern/queryClient.cjs | 322 ++++ .../build/modern/queryClient.cjs.map | 1 + .../query-core/build/modern/queryClient.d.cts | 3 + .../query-core/build/modern/queryClient.d.ts | 3 + .../query-core/build/modern/queryClient.js | 305 ++++ .../build/modern/queryClient.js.map | 1 + .../query-core/build/modern/queryObserver.cjs | 488 ++++++ .../build/modern/queryObserver.cjs.map | 1 + .../build/modern/queryObserver.d.cts | 3 + .../build/modern/queryObserver.d.ts | 3 + .../query-core/build/modern/queryObserver.js | 472 ++++++ .../build/modern/queryObserver.js.map | 1 + .../query-core/build/modern/removable.cjs | 58 + .../query-core/build/modern/removable.cjs.map | 1 + .../query-core/build/modern/removable.d.cts | 11 + .../query-core/build/modern/removable.d.ts | 11 + .../query-core/build/modern/removable.js | 33 + .../query-core/build/modern/removable.js.map | 1 + .../query-core/build/modern/retryer.cjs | 161 ++ .../query-core/build/modern/retryer.cjs.map | 1 + .../query-core/build/modern/retryer.d.cts | 3 + .../query-core/build/modern/retryer.d.ts | 3 + .../query-core/build/modern/retryer.js | 133 ++ .../query-core/build/modern/retryer.js.map | 1 + .../query-core/build/modern/streamedQuery.cjs | 82 + .../build/modern/streamedQuery.cjs.map | 1 + .../build/modern/streamedQuery.d.cts | 34 + .../build/modern/streamedQuery.d.ts | 34 + .../query-core/build/modern/streamedQuery.js | 57 + .../build/modern/streamedQuery.js.map | 1 + .../query-core/build/modern/subscribable.cjs | 51 + .../build/modern/subscribable.cjs.map | 1 + .../build/modern/subscribable.d.cts | 10 + .../query-core/build/modern/subscribable.d.ts | 10 + .../query-core/build/modern/subscribable.js | 26 + .../build/modern/subscribable.js.map | 1 + .../query-core/build/modern/thenable.cjs | 75 + .../query-core/build/modern/thenable.cjs.map | 1 + .../query-core/build/modern/thenable.d.cts | 47 + .../query-core/build/modern/thenable.d.ts | 47 + .../query-core/build/modern/thenable.js | 49 + .../query-core/build/modern/thenable.js.map | 1 + .../build/modern/timeoutManager.cjs | 98 ++ .../build/modern/timeoutManager.cjs.map | 1 + .../build/modern/timeoutManager.d.cts | 58 + .../build/modern/timeoutManager.d.ts | 58 + .../query-core/build/modern/timeoutManager.js | 70 + .../build/modern/timeoutManager.js.map | 1 + .../query-core/build/modern/types.cjs | 37 + .../query-core/build/modern/types.cjs.map | 1 + .../query-core/build/modern/types.d.cts | 3 + .../query-core/build/modern/types.d.ts | 3 + .../query-core/build/modern/types.js | 10 + .../query-core/build/modern/types.js.map | 1 + .../query-core/build/modern/utils.cjs | 330 ++++ .../query-core/build/modern/utils.cjs.map | 1 + .../query-core/build/modern/utils.d.cts | 3 + .../query-core/build/modern/utils.d.ts | 3 + .../query-core/build/modern/utils.js | 281 ++++ .../query-core/build/modern/utils.js.map | 1 + .../@tanstack/query-core/package.json | 65 + .../@tanstack/query-core/src/focusManager.ts | 86 + .../@tanstack/query-core/src/hydration.ts | 285 ++++ .../@tanstack/query-core/src/index.ts | 55 + .../query-core/src/infiniteQueryBehavior.ts | 176 +++ .../query-core/src/infiniteQueryObserver.ts | 190 +++ .../@tanstack/query-core/src/mutation.ts | 419 +++++ .../@tanstack/query-core/src/mutationCache.ts | 244 +++ .../query-core/src/mutationObserver.ts | 227 +++ .../@tanstack/query-core/src/notifyManager.ts | 99 ++ .../@tanstack/query-core/src/onlineManager.ts | 71 + .../query-core/src/queriesObserver.ts | 315 ++++ .../@tanstack/query-core/src/query.ts | 756 +++++++++ .../@tanstack/query-core/src/queryCache.ts | 223 +++ .../@tanstack/query-core/src/queryClient.ts | 648 ++++++++ .../@tanstack/query-core/src/queryObserver.ts | 828 ++++++++++ .../@tanstack/query-core/src/removable.ts | 39 + .../@tanstack/query-core/src/retryer.ts | 228 +++ .../@tanstack/query-core/src/streamedQuery.ts | 122 ++ .../@tanstack/query-core/src/subscribable.ts | 30 + .../@tanstack/query-core/src/thenable.ts | 111 ++ .../query-core/src/timeoutManager.ts | 135 ++ .../@tanstack/query-core/src/types.ts | 1391 +++++++++++++++++ .../@tanstack/query-core/src/utils.ts | 499 ++++++ node_modules/@tanstack/react-query/LICENSE | 21 + node_modules/@tanstack/react-query/README.md | 48 + .../build/codemods/src/utils/index.cjs | 208 +++ .../transformers/query-cache-transformer.cjs | 124 ++ .../transformers/query-client-transformer.cjs | 53 + .../use-query-like-transformer.cjs | 38 + .../codemods/src/v4/key-transformation.cjs | 181 +++ .../src/v4/replace-import-specifier.cjs | 25 + .../src/v4/utils/replacers/key-replacer.cjs | 164 ++ .../codemods/src/v5/is-loading/is-loading.cjs | 244 +++ .../src/v5/keep-previous-data/README.md | 32 + .../keep-previous-data/keep-previous-data.cjs | 271 ++++ .../already-has-placeholder-data-property.cjs | 26 + .../v5/remove-overloads/remove-overloads.cjs | 58 + .../filter-aware-usage-transformer.cjs | 271 ++++ .../query-fn-aware-usage-transformer.cjs | 185 +++ .../src/v5/remove-overloads/utils/index.cjs | 123 ++ .../utils/unknown-usage-error.cjs | 27 + .../src/v5/rename-hydrate/rename-hydrate.cjs | 55 + .../rename-properties/rename-properties.cjs | 41 + .../build/legacy/HydrationBoundary.cjs | 91 ++ .../build/legacy/HydrationBoundary.cjs.map | 1 + .../build/legacy/HydrationBoundary.d.cts | 14 + .../build/legacy/HydrationBoundary.d.ts | 14 + .../build/legacy/HydrationBoundary.js | 57 + .../build/legacy/HydrationBoundary.js.map | 1 + .../build/legacy/IsRestoringProvider.cjs | 47 + .../build/legacy/IsRestoringProvider.cjs.map | 1 + .../build/legacy/IsRestoringProvider.d.cts | 6 + .../build/legacy/IsRestoringProvider.d.ts | 6 + .../build/legacy/IsRestoringProvider.js | 12 + .../build/legacy/IsRestoringProvider.js.map | 1 + .../build/legacy/QueryClientProvider.cjs | 72 + .../build/legacy/QueryClientProvider.cjs.map | 1 + .../build/legacy/QueryClientProvider.d.cts | 12 + .../build/legacy/QueryClientProvider.d.ts | 12 + .../build/legacy/QueryClientProvider.js | 36 + .../build/legacy/QueryClientProvider.js.map | 1 + .../build/legacy/QueryErrorResetBoundary.cjs | 67 + .../legacy/QueryErrorResetBoundary.cjs.map | 1 + .../legacy/QueryErrorResetBoundary.d.cts | 19 + .../build/legacy/QueryErrorResetBoundary.d.ts | 19 + .../build/legacy/QueryErrorResetBoundary.js | 32 + .../legacy/QueryErrorResetBoundary.js.map | 1 + .../build/legacy/errorBoundaryUtils.cjs | 69 + .../build/legacy/errorBoundaryUtils.cjs.map | 1 + .../build/legacy/errorBoundaryUtils.d.cts | 16 + .../build/legacy/errorBoundaryUtils.d.ts | 16 + .../build/legacy/errorBoundaryUtils.js | 33 + .../build/legacy/errorBoundaryUtils.js.map | 1 + .../react-query/build/legacy/index.cjs | 97 ++ .../react-query/build/legacy/index.cjs.map | 1 + .../react-query/build/legacy/index.d.cts | 22 + .../react-query/build/legacy/index.d.ts | 22 + .../react-query/build/legacy/index.js | 54 + .../react-query/build/legacy/index.js.map | 1 + .../build/legacy/infiniteQueryOptions.cjs | 33 + .../build/legacy/infiniteQueryOptions.cjs.map | 1 + .../build/legacy/infiniteQueryOptions.d.cts | 23 + .../build/legacy/infiniteQueryOptions.d.ts | 23 + .../build/legacy/infiniteQueryOptions.js | 8 + .../build/legacy/infiniteQueryOptions.js.map | 1 + .../build/legacy/mutationOptions.cjs | 33 + .../build/legacy/mutationOptions.cjs.map | 1 + .../build/legacy/mutationOptions.d.cts | 7 + .../build/legacy/mutationOptions.d.ts | 7 + .../build/legacy/mutationOptions.js | 8 + .../build/legacy/mutationOptions.js.map | 1 + .../react-query/build/legacy/queryOptions.cjs | 33 + .../build/legacy/queryOptions.cjs.map | 1 + .../build/legacy/queryOptions.d.cts | 24 + .../build/legacy/queryOptions.d.ts | 24 + .../react-query/build/legacy/queryOptions.js | 8 + .../build/legacy/queryOptions.js.map | 1 + .../react-query/build/legacy/suspense.cjs | 58 + .../react-query/build/legacy/suspense.cjs.map | 1 + .../react-query/build/legacy/suspense.d.cts | 12 + .../react-query/build/legacy/suspense.d.ts | 12 + .../react-query/build/legacy/suspense.js | 29 + .../react-query/build/legacy/suspense.js.map | 1 + .../react-query/build/legacy/types.cjs | 19 + .../react-query/build/legacy/types.cjs.map | 1 + .../react-query/build/legacy/types.d.cts | 52 + .../react-query/build/legacy/types.d.ts | 52 + .../react-query/build/legacy/types.js | 1 + .../react-query/build/legacy/types.js.map | 1 + .../react-query/build/legacy/useBaseQuery.cjs | 133 ++ .../build/legacy/useBaseQuery.cjs.map | 1 + .../build/legacy/useBaseQuery.d.cts | 6 + .../build/legacy/useBaseQuery.d.ts | 6 + .../react-query/build/legacy/useBaseQuery.js | 108 ++ .../build/legacy/useBaseQuery.js.map | 1 + .../build/legacy/useInfiniteQuery.cjs | 40 + .../build/legacy/useInfiniteQuery.cjs.map | 1 + .../build/legacy/useInfiniteQuery.d.cts | 9 + .../build/legacy/useInfiniteQuery.d.ts | 9 + .../build/legacy/useInfiniteQuery.js | 16 + .../build/legacy/useInfiniteQuery.js.map | 1 + .../build/legacy/useIsFetching.cjs | 56 + .../build/legacy/useIsFetching.cjs.map | 1 + .../build/legacy/useIsFetching.d.cts | 5 + .../build/legacy/useIsFetching.d.ts | 5 + .../react-query/build/legacy/useIsFetching.js | 22 + .../build/legacy/useIsFetching.js.map | 1 + .../react-query/build/legacy/useMutation.cjs | 74 + .../build/legacy/useMutation.cjs.map | 1 + .../build/legacy/useMutation.d.cts | 6 + .../react-query/build/legacy/useMutation.d.ts | 6 + .../react-query/build/legacy/useMutation.js | 45 + .../build/legacy/useMutation.js.map | 1 + .../build/legacy/useMutationState.cjs | 86 + .../build/legacy/useMutationState.cjs.map | 1 + .../build/legacy/useMutationState.d.cts | 10 + .../build/legacy/useMutationState.d.ts | 10 + .../build/legacy/useMutationState.js | 51 + .../build/legacy/useMutationState.js.map | 1 + .../build/legacy/usePrefetchInfiniteQuery.cjs | 37 + .../legacy/usePrefetchInfiniteQuery.cjs.map | 1 + .../legacy/usePrefetchInfiniteQuery.d.cts | 5 + .../legacy/usePrefetchInfiniteQuery.d.ts | 5 + .../build/legacy/usePrefetchInfiniteQuery.js | 12 + .../legacy/usePrefetchInfiniteQuery.js.map | 1 + .../build/legacy/usePrefetchQuery.cjs | 37 + .../build/legacy/usePrefetchQuery.cjs.map | 1 + .../build/legacy/usePrefetchQuery.d.cts | 6 + .../build/legacy/usePrefetchQuery.d.ts | 6 + .../build/legacy/usePrefetchQuery.js | 12 + .../build/legacy/usePrefetchQuery.js.map | 1 + .../react-query/build/legacy/useQueries.cjs | 128 ++ .../build/legacy/useQueries.cjs.map | 1 + .../react-query/build/legacy/useQueries.d.cts | 76 + .../react-query/build/legacy/useQueries.d.ts | 76 + .../react-query/build/legacy/useQueries.js | 107 ++ .../build/legacy/useQueries.js.map | 1 + .../react-query/build/legacy/useQuery.cjs | 36 + .../react-query/build/legacy/useQuery.cjs.map | 1 + .../react-query/build/legacy/useQuery.d.cts | 9 + .../react-query/build/legacy/useQuery.d.ts | 9 + .../react-query/build/legacy/useQuery.js | 12 + .../react-query/build/legacy/useQuery.js.map | 1 + .../build/legacy/useSuspenseInfiniteQuery.cjs | 51 + .../legacy/useSuspenseInfiniteQuery.cjs.map | 1 + .../legacy/useSuspenseInfiniteQuery.d.cts | 6 + .../legacy/useSuspenseInfiniteQuery.d.ts | 6 + .../build/legacy/useSuspenseInfiniteQuery.js | 27 + .../legacy/useSuspenseInfiniteQuery.js.map | 1 + .../build/legacy/useSuspenseQueries.cjs | 56 + .../build/legacy/useSuspenseQueries.cjs.map | 1 + .../build/legacy/useSuspenseQueries.d.cts | 79 + .../build/legacy/useSuspenseQueries.d.ts | 79 + .../build/legacy/useSuspenseQueries.js | 32 + .../build/legacy/useSuspenseQueries.js.map | 1 + .../build/legacy/useSuspenseQuery.cjs | 52 + .../build/legacy/useSuspenseQuery.cjs.map | 1 + .../build/legacy/useSuspenseQuery.d.cts | 6 + .../build/legacy/useSuspenseQuery.d.ts | 6 + .../build/legacy/useSuspenseQuery.js | 28 + .../build/legacy/useSuspenseQuery.js.map | 1 + .../build/modern/HydrationBoundary.cjs | 91 ++ .../build/modern/HydrationBoundary.cjs.map | 1 + .../build/modern/HydrationBoundary.d.cts | 14 + .../build/modern/HydrationBoundary.d.ts | 14 + .../build/modern/HydrationBoundary.js | 57 + .../build/modern/HydrationBoundary.js.map | 1 + .../build/modern/IsRestoringProvider.cjs | 47 + .../build/modern/IsRestoringProvider.cjs.map | 1 + .../build/modern/IsRestoringProvider.d.cts | 6 + .../build/modern/IsRestoringProvider.d.ts | 6 + .../build/modern/IsRestoringProvider.js | 12 + .../build/modern/IsRestoringProvider.js.map | 1 + .../build/modern/QueryClientProvider.cjs | 72 + .../build/modern/QueryClientProvider.cjs.map | 1 + .../build/modern/QueryClientProvider.d.cts | 12 + .../build/modern/QueryClientProvider.d.ts | 12 + .../build/modern/QueryClientProvider.js | 36 + .../build/modern/QueryClientProvider.js.map | 1 + .../build/modern/QueryErrorResetBoundary.cjs | 67 + .../modern/QueryErrorResetBoundary.cjs.map | 1 + .../modern/QueryErrorResetBoundary.d.cts | 19 + .../build/modern/QueryErrorResetBoundary.d.ts | 19 + .../build/modern/QueryErrorResetBoundary.js | 32 + .../modern/QueryErrorResetBoundary.js.map | 1 + .../build/modern/errorBoundaryUtils.cjs | 69 + .../build/modern/errorBoundaryUtils.cjs.map | 1 + .../build/modern/errorBoundaryUtils.d.cts | 16 + .../build/modern/errorBoundaryUtils.d.ts | 16 + .../build/modern/errorBoundaryUtils.js | 33 + .../build/modern/errorBoundaryUtils.js.map | 1 + .../react-query/build/modern/index.cjs | 97 ++ .../react-query/build/modern/index.cjs.map | 1 + .../react-query/build/modern/index.d.cts | 22 + .../react-query/build/modern/index.d.ts | 22 + .../react-query/build/modern/index.js | 54 + .../react-query/build/modern/index.js.map | 1 + .../build/modern/infiniteQueryOptions.cjs | 33 + .../build/modern/infiniteQueryOptions.cjs.map | 1 + .../build/modern/infiniteQueryOptions.d.cts | 23 + .../build/modern/infiniteQueryOptions.d.ts | 23 + .../build/modern/infiniteQueryOptions.js | 8 + .../build/modern/infiniteQueryOptions.js.map | 1 + .../build/modern/mutationOptions.cjs | 33 + .../build/modern/mutationOptions.cjs.map | 1 + .../build/modern/mutationOptions.d.cts | 7 + .../build/modern/mutationOptions.d.ts | 7 + .../build/modern/mutationOptions.js | 8 + .../build/modern/mutationOptions.js.map | 1 + .../react-query/build/modern/queryOptions.cjs | 33 + .../build/modern/queryOptions.cjs.map | 1 + .../build/modern/queryOptions.d.cts | 24 + .../build/modern/queryOptions.d.ts | 24 + .../react-query/build/modern/queryOptions.js | 8 + .../build/modern/queryOptions.js.map | 1 + .../react-query/build/modern/suspense.cjs | 58 + .../react-query/build/modern/suspense.cjs.map | 1 + .../react-query/build/modern/suspense.d.cts | 12 + .../react-query/build/modern/suspense.d.ts | 12 + .../react-query/build/modern/suspense.js | 29 + .../react-query/build/modern/suspense.js.map | 1 + .../react-query/build/modern/types.cjs | 19 + .../react-query/build/modern/types.cjs.map | 1 + .../react-query/build/modern/types.d.cts | 52 + .../react-query/build/modern/types.d.ts | 52 + .../react-query/build/modern/types.js | 1 + .../react-query/build/modern/types.js.map | 1 + .../react-query/build/modern/useBaseQuery.cjs | 130 ++ .../build/modern/useBaseQuery.cjs.map | 1 + .../build/modern/useBaseQuery.d.cts | 6 + .../build/modern/useBaseQuery.d.ts | 6 + .../react-query/build/modern/useBaseQuery.js | 105 ++ .../build/modern/useBaseQuery.js.map | 1 + .../build/modern/useInfiniteQuery.cjs | 40 + .../build/modern/useInfiniteQuery.cjs.map | 1 + .../build/modern/useInfiniteQuery.d.cts | 9 + .../build/modern/useInfiniteQuery.d.ts | 9 + .../build/modern/useInfiniteQuery.js | 16 + .../build/modern/useInfiniteQuery.js.map | 1 + .../build/modern/useIsFetching.cjs | 56 + .../build/modern/useIsFetching.cjs.map | 1 + .../build/modern/useIsFetching.d.cts | 5 + .../build/modern/useIsFetching.d.ts | 5 + .../react-query/build/modern/useIsFetching.js | 22 + .../build/modern/useIsFetching.js.map | 1 + .../react-query/build/modern/useMutation.cjs | 74 + .../build/modern/useMutation.cjs.map | 1 + .../build/modern/useMutation.d.cts | 6 + .../react-query/build/modern/useMutation.d.ts | 6 + .../react-query/build/modern/useMutation.js | 45 + .../build/modern/useMutation.js.map | 1 + .../build/modern/useMutationState.cjs | 86 + .../build/modern/useMutationState.cjs.map | 1 + .../build/modern/useMutationState.d.cts | 10 + .../build/modern/useMutationState.d.ts | 10 + .../build/modern/useMutationState.js | 51 + .../build/modern/useMutationState.js.map | 1 + .../build/modern/usePrefetchInfiniteQuery.cjs | 37 + .../modern/usePrefetchInfiniteQuery.cjs.map | 1 + .../modern/usePrefetchInfiniteQuery.d.cts | 5 + .../modern/usePrefetchInfiniteQuery.d.ts | 5 + .../build/modern/usePrefetchInfiniteQuery.js | 12 + .../modern/usePrefetchInfiniteQuery.js.map | 1 + .../build/modern/usePrefetchQuery.cjs | 37 + .../build/modern/usePrefetchQuery.cjs.map | 1 + .../build/modern/usePrefetchQuery.d.cts | 6 + .../build/modern/usePrefetchQuery.d.ts | 6 + .../build/modern/usePrefetchQuery.js | 12 + .../build/modern/usePrefetchQuery.js.map | 1 + .../react-query/build/modern/useQueries.cjs | 128 ++ .../build/modern/useQueries.cjs.map | 1 + .../react-query/build/modern/useQueries.d.cts | 76 + .../react-query/build/modern/useQueries.d.ts | 76 + .../react-query/build/modern/useQueries.js | 107 ++ .../build/modern/useQueries.js.map | 1 + .../react-query/build/modern/useQuery.cjs | 36 + .../react-query/build/modern/useQuery.cjs.map | 1 + .../react-query/build/modern/useQuery.d.cts | 9 + .../react-query/build/modern/useQuery.d.ts | 9 + .../react-query/build/modern/useQuery.js | 12 + .../react-query/build/modern/useQuery.js.map | 1 + .../build/modern/useSuspenseInfiniteQuery.cjs | 51 + .../modern/useSuspenseInfiniteQuery.cjs.map | 1 + .../modern/useSuspenseInfiniteQuery.d.cts | 6 + .../modern/useSuspenseInfiniteQuery.d.ts | 6 + .../build/modern/useSuspenseInfiniteQuery.js | 27 + .../modern/useSuspenseInfiniteQuery.js.map | 1 + .../build/modern/useSuspenseQueries.cjs | 56 + .../build/modern/useSuspenseQueries.cjs.map | 1 + .../build/modern/useSuspenseQueries.d.cts | 79 + .../build/modern/useSuspenseQueries.d.ts | 79 + .../build/modern/useSuspenseQueries.js | 32 + .../build/modern/useSuspenseQueries.js.map | 1 + .../build/modern/useSuspenseQuery.cjs | 52 + .../build/modern/useSuspenseQuery.cjs.map | 1 + .../build/modern/useSuspenseQuery.d.cts | 6 + .../build/modern/useSuspenseQuery.d.ts | 6 + .../build/modern/useSuspenseQuery.js | 28 + .../build/modern/useSuspenseQuery.js.map | 1 + .../build/query-codemods/eslint.config.js | 18 + .../build/query-codemods/package.json | 38 + .../query-codemods/root.eslint.config.js | 64 + .../build/query-codemods/tsconfig.json | 8 + .../build/query-codemods/vite.config.ts | 30 + .../@tanstack/react-query/package.json | 87 ++ .../react-query/src/HydrationBoundary.tsx | 111 ++ .../react-query/src/IsRestoringProvider.ts | 7 + .../react-query/src/QueryClientProvider.tsx | 45 + .../src/QueryErrorResetBoundary.tsx | 56 + .../react-query/src/errorBoundaryUtils.ts | 82 + .../@tanstack/react-query/src/index.ts | 56 + .../react-query/src/infiniteQueryOptions.ts | 149 ++ .../react-query/src/mutationOptions.ts | 41 + .../@tanstack/react-query/src/queryOptions.ts | 87 ++ .../@tanstack/react-query/src/suspense.ts | 80 + .../@tanstack/react-query/src/types.ts | 242 +++ .../@tanstack/react-query/src/useBaseQuery.ts | 170 ++ .../react-query/src/useInfiniteQuery.ts | 81 + .../react-query/src/useIsFetching.ts | 24 + .../@tanstack/react-query/src/useMutation.ts | 69 + .../react-query/src/useMutationState.ts | 75 + .../src/usePrefetchInfiniteQuery.tsx | 30 + .../react-query/src/usePrefetchQuery.tsx | 19 + .../@tanstack/react-query/src/useQueries.ts | 328 ++++ .../@tanstack/react-query/src/useQuery.ts | 52 + .../src/useSuspenseInfiniteQuery.ts | 50 + .../react-query/src/useSuspenseQueries.ts | 211 +++ .../react-query/src/useSuspenseQuery.ts | 34 + node_modules/react/LICENSE | 21 + node_modules/react/README.md | 37 + .../cjs/react-compiler-runtime.development.js | 24 + .../cjs/react-compiler-runtime.production.js | 16 + .../cjs/react-compiler-runtime.profiling.js | 16 + .../cjs/react-jsx-dev-runtime.development.js | 338 ++++ .../cjs/react-jsx-dev-runtime.production.js | 14 + .../cjs/react-jsx-dev-runtime.profiling.js | 14 + ...sx-dev-runtime.react-server.development.js | 370 +++++ ...jsx-dev-runtime.react-server.production.js | 40 + .../cjs/react-jsx-runtime.development.js | 352 +++++ .../react/cjs/react-jsx-runtime.production.js | 34 + .../react/cjs/react-jsx-runtime.profiling.js | 34 + ...ct-jsx-runtime.react-server.development.js | 370 +++++ ...act-jsx-runtime.react-server.production.js | 40 + node_modules/react/cjs/react.development.js | 1284 +++++++++++++++ node_modules/react/cjs/react.production.js | 542 +++++++ .../cjs/react.react-server.development.js | 848 ++++++++++ .../cjs/react.react-server.production.js | 423 +++++ node_modules/react/compiler-runtime.js | 14 + node_modules/react/index.js | 7 + node_modules/react/jsx-dev-runtime.js | 7 + .../react/jsx-dev-runtime.react-server.js | 7 + node_modules/react/jsx-runtime.js | 7 + .../react/jsx-runtime.react-server.js | 7 + node_modules/react/package.json | 51 + node_modules/react/react.react-server.js | 7 + package-lock.json | 48 + package.json | 5 + 663 files changed, 45126 insertions(+), 1 deletion(-) create mode 100644 node_modules/.package-lock.json create mode 100644 node_modules/@tanstack/query-core/LICENSE create mode 100644 node_modules/@tanstack/query-core/build/legacy/chunk-PXG64RU4.js create mode 100644 node_modules/@tanstack/query-core/build/legacy/chunk-PXG64RU4.js.map create mode 100644 node_modules/@tanstack/query-core/build/legacy/focusManager.cjs create mode 100644 node_modules/@tanstack/query-core/build/legacy/focusManager.cjs.map create mode 100644 node_modules/@tanstack/query-core/build/legacy/focusManager.d.cts create mode 100644 node_modules/@tanstack/query-core/build/legacy/focusManager.d.ts create mode 100644 node_modules/@tanstack/query-core/build/legacy/focusManager.js create mode 100644 node_modules/@tanstack/query-core/build/legacy/focusManager.js.map create mode 100644 node_modules/@tanstack/query-core/build/legacy/hydration-BlEVG2Lp.d.ts create mode 100644 node_modules/@tanstack/query-core/build/legacy/hydration-uphG6M-i.d.cts create mode 100644 node_modules/@tanstack/query-core/build/legacy/hydration.cjs create mode 100644 node_modules/@tanstack/query-core/build/legacy/hydration.cjs.map create mode 100644 node_modules/@tanstack/query-core/build/legacy/hydration.d.cts create mode 100644 node_modules/@tanstack/query-core/build/legacy/hydration.d.ts create mode 100644 node_modules/@tanstack/query-core/build/legacy/hydration.js create mode 100644 node_modules/@tanstack/query-core/build/legacy/hydration.js.map create mode 100644 node_modules/@tanstack/query-core/build/legacy/index.cjs create mode 100644 node_modules/@tanstack/query-core/build/legacy/index.cjs.map create mode 100644 node_modules/@tanstack/query-core/build/legacy/index.d.cts create mode 100644 node_modules/@tanstack/query-core/build/legacy/index.d.ts create mode 100644 node_modules/@tanstack/query-core/build/legacy/index.js create mode 100644 node_modules/@tanstack/query-core/build/legacy/index.js.map create mode 100644 node_modules/@tanstack/query-core/build/legacy/infiniteQueryBehavior.cjs create mode 100644 node_modules/@tanstack/query-core/build/legacy/infiniteQueryBehavior.cjs.map create mode 100644 node_modules/@tanstack/query-core/build/legacy/infiniteQueryBehavior.d.cts create mode 100644 node_modules/@tanstack/query-core/build/legacy/infiniteQueryBehavior.d.ts create mode 100644 node_modules/@tanstack/query-core/build/legacy/infiniteQueryBehavior.js create mode 100644 node_modules/@tanstack/query-core/build/legacy/infiniteQueryBehavior.js.map create mode 100644 node_modules/@tanstack/query-core/build/legacy/infiniteQueryObserver.cjs create mode 100644 node_modules/@tanstack/query-core/build/legacy/infiniteQueryObserver.cjs.map create mode 100644 node_modules/@tanstack/query-core/build/legacy/infiniteQueryObserver.d.cts create mode 100644 node_modules/@tanstack/query-core/build/legacy/infiniteQueryObserver.d.ts create mode 100644 node_modules/@tanstack/query-core/build/legacy/infiniteQueryObserver.js create mode 100644 node_modules/@tanstack/query-core/build/legacy/infiniteQueryObserver.js.map create mode 100644 node_modules/@tanstack/query-core/build/legacy/mutation.cjs create mode 100644 node_modules/@tanstack/query-core/build/legacy/mutation.cjs.map create mode 100644 node_modules/@tanstack/query-core/build/legacy/mutation.d.cts create mode 100644 node_modules/@tanstack/query-core/build/legacy/mutation.d.ts create mode 100644 node_modules/@tanstack/query-core/build/legacy/mutation.js create mode 100644 node_modules/@tanstack/query-core/build/legacy/mutation.js.map create mode 100644 node_modules/@tanstack/query-core/build/legacy/mutationCache.cjs create mode 100644 node_modules/@tanstack/query-core/build/legacy/mutationCache.cjs.map create mode 100644 node_modules/@tanstack/query-core/build/legacy/mutationCache.d.cts create mode 100644 node_modules/@tanstack/query-core/build/legacy/mutationCache.d.ts create mode 100644 node_modules/@tanstack/query-core/build/legacy/mutationCache.js create mode 100644 node_modules/@tanstack/query-core/build/legacy/mutationCache.js.map create mode 100644 node_modules/@tanstack/query-core/build/legacy/mutationObserver.cjs create mode 100644 node_modules/@tanstack/query-core/build/legacy/mutationObserver.cjs.map create mode 100644 node_modules/@tanstack/query-core/build/legacy/mutationObserver.d.cts create mode 100644 node_modules/@tanstack/query-core/build/legacy/mutationObserver.d.ts create mode 100644 node_modules/@tanstack/query-core/build/legacy/mutationObserver.js create mode 100644 node_modules/@tanstack/query-core/build/legacy/mutationObserver.js.map create mode 100644 node_modules/@tanstack/query-core/build/legacy/notifyManager.cjs create mode 100644 node_modules/@tanstack/query-core/build/legacy/notifyManager.cjs.map create mode 100644 node_modules/@tanstack/query-core/build/legacy/notifyManager.d.cts create mode 100644 node_modules/@tanstack/query-core/build/legacy/notifyManager.d.ts create mode 100644 node_modules/@tanstack/query-core/build/legacy/notifyManager.js create mode 100644 node_modules/@tanstack/query-core/build/legacy/notifyManager.js.map create mode 100644 node_modules/@tanstack/query-core/build/legacy/onlineManager.cjs create mode 100644 node_modules/@tanstack/query-core/build/legacy/onlineManager.cjs.map create mode 100644 node_modules/@tanstack/query-core/build/legacy/onlineManager.d.cts create mode 100644 node_modules/@tanstack/query-core/build/legacy/onlineManager.d.ts create mode 100644 node_modules/@tanstack/query-core/build/legacy/onlineManager.js create mode 100644 node_modules/@tanstack/query-core/build/legacy/onlineManager.js.map create mode 100644 node_modules/@tanstack/query-core/build/legacy/queriesObserver.cjs create mode 100644 node_modules/@tanstack/query-core/build/legacy/queriesObserver.cjs.map create mode 100644 node_modules/@tanstack/query-core/build/legacy/queriesObserver.d.cts create mode 100644 node_modules/@tanstack/query-core/build/legacy/queriesObserver.d.ts create mode 100644 node_modules/@tanstack/query-core/build/legacy/queriesObserver.js create mode 100644 node_modules/@tanstack/query-core/build/legacy/queriesObserver.js.map create mode 100644 node_modules/@tanstack/query-core/build/legacy/query.cjs create mode 100644 node_modules/@tanstack/query-core/build/legacy/query.cjs.map create mode 100644 node_modules/@tanstack/query-core/build/legacy/query.d.cts create mode 100644 node_modules/@tanstack/query-core/build/legacy/query.d.ts create mode 100644 node_modules/@tanstack/query-core/build/legacy/query.js create mode 100644 node_modules/@tanstack/query-core/build/legacy/query.js.map create mode 100644 node_modules/@tanstack/query-core/build/legacy/queryCache.cjs create mode 100644 node_modules/@tanstack/query-core/build/legacy/queryCache.cjs.map create mode 100644 node_modules/@tanstack/query-core/build/legacy/queryCache.d.cts create mode 100644 node_modules/@tanstack/query-core/build/legacy/queryCache.d.ts create mode 100644 node_modules/@tanstack/query-core/build/legacy/queryCache.js create mode 100644 node_modules/@tanstack/query-core/build/legacy/queryCache.js.map create mode 100644 node_modules/@tanstack/query-core/build/legacy/queryClient.cjs create mode 100644 node_modules/@tanstack/query-core/build/legacy/queryClient.cjs.map create mode 100644 node_modules/@tanstack/query-core/build/legacy/queryClient.d.cts create mode 100644 node_modules/@tanstack/query-core/build/legacy/queryClient.d.ts create mode 100644 node_modules/@tanstack/query-core/build/legacy/queryClient.js create mode 100644 node_modules/@tanstack/query-core/build/legacy/queryClient.js.map create mode 100644 node_modules/@tanstack/query-core/build/legacy/queryObserver.cjs create mode 100644 node_modules/@tanstack/query-core/build/legacy/queryObserver.cjs.map create mode 100644 node_modules/@tanstack/query-core/build/legacy/queryObserver.d.cts create mode 100644 node_modules/@tanstack/query-core/build/legacy/queryObserver.d.ts create mode 100644 node_modules/@tanstack/query-core/build/legacy/queryObserver.js create mode 100644 node_modules/@tanstack/query-core/build/legacy/queryObserver.js.map create mode 100644 node_modules/@tanstack/query-core/build/legacy/removable.cjs create mode 100644 node_modules/@tanstack/query-core/build/legacy/removable.cjs.map create mode 100644 node_modules/@tanstack/query-core/build/legacy/removable.d.cts create mode 100644 node_modules/@tanstack/query-core/build/legacy/removable.d.ts create mode 100644 node_modules/@tanstack/query-core/build/legacy/removable.js create mode 100644 node_modules/@tanstack/query-core/build/legacy/removable.js.map create mode 100644 node_modules/@tanstack/query-core/build/legacy/retryer.cjs create mode 100644 node_modules/@tanstack/query-core/build/legacy/retryer.cjs.map create mode 100644 node_modules/@tanstack/query-core/build/legacy/retryer.d.cts create mode 100644 node_modules/@tanstack/query-core/build/legacy/retryer.d.ts create mode 100644 node_modules/@tanstack/query-core/build/legacy/retryer.js create mode 100644 node_modules/@tanstack/query-core/build/legacy/retryer.js.map create mode 100644 node_modules/@tanstack/query-core/build/legacy/streamedQuery.cjs create mode 100644 node_modules/@tanstack/query-core/build/legacy/streamedQuery.cjs.map create mode 100644 node_modules/@tanstack/query-core/build/legacy/streamedQuery.d.cts create mode 100644 node_modules/@tanstack/query-core/build/legacy/streamedQuery.d.ts create mode 100644 node_modules/@tanstack/query-core/build/legacy/streamedQuery.js create mode 100644 node_modules/@tanstack/query-core/build/legacy/streamedQuery.js.map create mode 100644 node_modules/@tanstack/query-core/build/legacy/subscribable.cjs create mode 100644 node_modules/@tanstack/query-core/build/legacy/subscribable.cjs.map create mode 100644 node_modules/@tanstack/query-core/build/legacy/subscribable.d.cts create mode 100644 node_modules/@tanstack/query-core/build/legacy/subscribable.d.ts create mode 100644 node_modules/@tanstack/query-core/build/legacy/subscribable.js create mode 100644 node_modules/@tanstack/query-core/build/legacy/subscribable.js.map create mode 100644 node_modules/@tanstack/query-core/build/legacy/thenable.cjs create mode 100644 node_modules/@tanstack/query-core/build/legacy/thenable.cjs.map create mode 100644 node_modules/@tanstack/query-core/build/legacy/thenable.d.cts create mode 100644 node_modules/@tanstack/query-core/build/legacy/thenable.d.ts create mode 100644 node_modules/@tanstack/query-core/build/legacy/thenable.js create mode 100644 node_modules/@tanstack/query-core/build/legacy/thenable.js.map create mode 100644 node_modules/@tanstack/query-core/build/legacy/timeoutManager.cjs create mode 100644 node_modules/@tanstack/query-core/build/legacy/timeoutManager.cjs.map create mode 100644 node_modules/@tanstack/query-core/build/legacy/timeoutManager.d.cts create mode 100644 node_modules/@tanstack/query-core/build/legacy/timeoutManager.d.ts create mode 100644 node_modules/@tanstack/query-core/build/legacy/timeoutManager.js create mode 100644 node_modules/@tanstack/query-core/build/legacy/timeoutManager.js.map create mode 100644 node_modules/@tanstack/query-core/build/legacy/types.cjs create mode 100644 node_modules/@tanstack/query-core/build/legacy/types.cjs.map create mode 100644 node_modules/@tanstack/query-core/build/legacy/types.d.cts create mode 100644 node_modules/@tanstack/query-core/build/legacy/types.d.ts create mode 100644 node_modules/@tanstack/query-core/build/legacy/types.js create mode 100644 node_modules/@tanstack/query-core/build/legacy/types.js.map create mode 100644 node_modules/@tanstack/query-core/build/legacy/utils.cjs create mode 100644 node_modules/@tanstack/query-core/build/legacy/utils.cjs.map create mode 100644 node_modules/@tanstack/query-core/build/legacy/utils.d.cts create mode 100644 node_modules/@tanstack/query-core/build/legacy/utils.d.ts create mode 100644 node_modules/@tanstack/query-core/build/legacy/utils.js create mode 100644 node_modules/@tanstack/query-core/build/legacy/utils.js.map create mode 100644 node_modules/@tanstack/query-core/build/modern/focusManager.cjs create mode 100644 node_modules/@tanstack/query-core/build/modern/focusManager.cjs.map create mode 100644 node_modules/@tanstack/query-core/build/modern/focusManager.d.cts create mode 100644 node_modules/@tanstack/query-core/build/modern/focusManager.d.ts create mode 100644 node_modules/@tanstack/query-core/build/modern/focusManager.js create mode 100644 node_modules/@tanstack/query-core/build/modern/focusManager.js.map create mode 100644 node_modules/@tanstack/query-core/build/modern/hydration-BlEVG2Lp.d.ts create mode 100644 node_modules/@tanstack/query-core/build/modern/hydration-uphG6M-i.d.cts create mode 100644 node_modules/@tanstack/query-core/build/modern/hydration.cjs create mode 100644 node_modules/@tanstack/query-core/build/modern/hydration.cjs.map create mode 100644 node_modules/@tanstack/query-core/build/modern/hydration.d.cts create mode 100644 node_modules/@tanstack/query-core/build/modern/hydration.d.ts create mode 100644 node_modules/@tanstack/query-core/build/modern/hydration.js create mode 100644 node_modules/@tanstack/query-core/build/modern/hydration.js.map create mode 100644 node_modules/@tanstack/query-core/build/modern/index.cjs create mode 100644 node_modules/@tanstack/query-core/build/modern/index.cjs.map create mode 100644 node_modules/@tanstack/query-core/build/modern/index.d.cts create mode 100644 node_modules/@tanstack/query-core/build/modern/index.d.ts create mode 100644 node_modules/@tanstack/query-core/build/modern/index.js create mode 100644 node_modules/@tanstack/query-core/build/modern/index.js.map create mode 100644 node_modules/@tanstack/query-core/build/modern/infiniteQueryBehavior.cjs create mode 100644 node_modules/@tanstack/query-core/build/modern/infiniteQueryBehavior.cjs.map create mode 100644 node_modules/@tanstack/query-core/build/modern/infiniteQueryBehavior.d.cts create mode 100644 node_modules/@tanstack/query-core/build/modern/infiniteQueryBehavior.d.ts create mode 100644 node_modules/@tanstack/query-core/build/modern/infiniteQueryBehavior.js create mode 100644 node_modules/@tanstack/query-core/build/modern/infiniteQueryBehavior.js.map create mode 100644 node_modules/@tanstack/query-core/build/modern/infiniteQueryObserver.cjs create mode 100644 node_modules/@tanstack/query-core/build/modern/infiniteQueryObserver.cjs.map create mode 100644 node_modules/@tanstack/query-core/build/modern/infiniteQueryObserver.d.cts create mode 100644 node_modules/@tanstack/query-core/build/modern/infiniteQueryObserver.d.ts create mode 100644 node_modules/@tanstack/query-core/build/modern/infiniteQueryObserver.js create mode 100644 node_modules/@tanstack/query-core/build/modern/infiniteQueryObserver.js.map create mode 100644 node_modules/@tanstack/query-core/build/modern/mutation.cjs create mode 100644 node_modules/@tanstack/query-core/build/modern/mutation.cjs.map create mode 100644 node_modules/@tanstack/query-core/build/modern/mutation.d.cts create mode 100644 node_modules/@tanstack/query-core/build/modern/mutation.d.ts create mode 100644 node_modules/@tanstack/query-core/build/modern/mutation.js create mode 100644 node_modules/@tanstack/query-core/build/modern/mutation.js.map create mode 100644 node_modules/@tanstack/query-core/build/modern/mutationCache.cjs create mode 100644 node_modules/@tanstack/query-core/build/modern/mutationCache.cjs.map create mode 100644 node_modules/@tanstack/query-core/build/modern/mutationCache.d.cts create mode 100644 node_modules/@tanstack/query-core/build/modern/mutationCache.d.ts create mode 100644 node_modules/@tanstack/query-core/build/modern/mutationCache.js create mode 100644 node_modules/@tanstack/query-core/build/modern/mutationCache.js.map create mode 100644 node_modules/@tanstack/query-core/build/modern/mutationObserver.cjs create mode 100644 node_modules/@tanstack/query-core/build/modern/mutationObserver.cjs.map create mode 100644 node_modules/@tanstack/query-core/build/modern/mutationObserver.d.cts create mode 100644 node_modules/@tanstack/query-core/build/modern/mutationObserver.d.ts create mode 100644 node_modules/@tanstack/query-core/build/modern/mutationObserver.js create mode 100644 node_modules/@tanstack/query-core/build/modern/mutationObserver.js.map create mode 100644 node_modules/@tanstack/query-core/build/modern/notifyManager.cjs create mode 100644 node_modules/@tanstack/query-core/build/modern/notifyManager.cjs.map create mode 100644 node_modules/@tanstack/query-core/build/modern/notifyManager.d.cts create mode 100644 node_modules/@tanstack/query-core/build/modern/notifyManager.d.ts create mode 100644 node_modules/@tanstack/query-core/build/modern/notifyManager.js create mode 100644 node_modules/@tanstack/query-core/build/modern/notifyManager.js.map create mode 100644 node_modules/@tanstack/query-core/build/modern/onlineManager.cjs create mode 100644 node_modules/@tanstack/query-core/build/modern/onlineManager.cjs.map create mode 100644 node_modules/@tanstack/query-core/build/modern/onlineManager.d.cts create mode 100644 node_modules/@tanstack/query-core/build/modern/onlineManager.d.ts create mode 100644 node_modules/@tanstack/query-core/build/modern/onlineManager.js create mode 100644 node_modules/@tanstack/query-core/build/modern/onlineManager.js.map create mode 100644 node_modules/@tanstack/query-core/build/modern/queriesObserver.cjs create mode 100644 node_modules/@tanstack/query-core/build/modern/queriesObserver.cjs.map create mode 100644 node_modules/@tanstack/query-core/build/modern/queriesObserver.d.cts create mode 100644 node_modules/@tanstack/query-core/build/modern/queriesObserver.d.ts create mode 100644 node_modules/@tanstack/query-core/build/modern/queriesObserver.js create mode 100644 node_modules/@tanstack/query-core/build/modern/queriesObserver.js.map create mode 100644 node_modules/@tanstack/query-core/build/modern/query.cjs create mode 100644 node_modules/@tanstack/query-core/build/modern/query.cjs.map create mode 100644 node_modules/@tanstack/query-core/build/modern/query.d.cts create mode 100644 node_modules/@tanstack/query-core/build/modern/query.d.ts create mode 100644 node_modules/@tanstack/query-core/build/modern/query.js create mode 100644 node_modules/@tanstack/query-core/build/modern/query.js.map create mode 100644 node_modules/@tanstack/query-core/build/modern/queryCache.cjs create mode 100644 node_modules/@tanstack/query-core/build/modern/queryCache.cjs.map create mode 100644 node_modules/@tanstack/query-core/build/modern/queryCache.d.cts create mode 100644 node_modules/@tanstack/query-core/build/modern/queryCache.d.ts create mode 100644 node_modules/@tanstack/query-core/build/modern/queryCache.js create mode 100644 node_modules/@tanstack/query-core/build/modern/queryCache.js.map create mode 100644 node_modules/@tanstack/query-core/build/modern/queryClient.cjs create mode 100644 node_modules/@tanstack/query-core/build/modern/queryClient.cjs.map create mode 100644 node_modules/@tanstack/query-core/build/modern/queryClient.d.cts create mode 100644 node_modules/@tanstack/query-core/build/modern/queryClient.d.ts create mode 100644 node_modules/@tanstack/query-core/build/modern/queryClient.js create mode 100644 node_modules/@tanstack/query-core/build/modern/queryClient.js.map create mode 100644 node_modules/@tanstack/query-core/build/modern/queryObserver.cjs create mode 100644 node_modules/@tanstack/query-core/build/modern/queryObserver.cjs.map create mode 100644 node_modules/@tanstack/query-core/build/modern/queryObserver.d.cts create mode 100644 node_modules/@tanstack/query-core/build/modern/queryObserver.d.ts create mode 100644 node_modules/@tanstack/query-core/build/modern/queryObserver.js create mode 100644 node_modules/@tanstack/query-core/build/modern/queryObserver.js.map create mode 100644 node_modules/@tanstack/query-core/build/modern/removable.cjs create mode 100644 node_modules/@tanstack/query-core/build/modern/removable.cjs.map create mode 100644 node_modules/@tanstack/query-core/build/modern/removable.d.cts create mode 100644 node_modules/@tanstack/query-core/build/modern/removable.d.ts create mode 100644 node_modules/@tanstack/query-core/build/modern/removable.js create mode 100644 node_modules/@tanstack/query-core/build/modern/removable.js.map create mode 100644 node_modules/@tanstack/query-core/build/modern/retryer.cjs create mode 100644 node_modules/@tanstack/query-core/build/modern/retryer.cjs.map create mode 100644 node_modules/@tanstack/query-core/build/modern/retryer.d.cts create mode 100644 node_modules/@tanstack/query-core/build/modern/retryer.d.ts create mode 100644 node_modules/@tanstack/query-core/build/modern/retryer.js create mode 100644 node_modules/@tanstack/query-core/build/modern/retryer.js.map create mode 100644 node_modules/@tanstack/query-core/build/modern/streamedQuery.cjs create mode 100644 node_modules/@tanstack/query-core/build/modern/streamedQuery.cjs.map create mode 100644 node_modules/@tanstack/query-core/build/modern/streamedQuery.d.cts create mode 100644 node_modules/@tanstack/query-core/build/modern/streamedQuery.d.ts create mode 100644 node_modules/@tanstack/query-core/build/modern/streamedQuery.js create mode 100644 node_modules/@tanstack/query-core/build/modern/streamedQuery.js.map create mode 100644 node_modules/@tanstack/query-core/build/modern/subscribable.cjs create mode 100644 node_modules/@tanstack/query-core/build/modern/subscribable.cjs.map create mode 100644 node_modules/@tanstack/query-core/build/modern/subscribable.d.cts create mode 100644 node_modules/@tanstack/query-core/build/modern/subscribable.d.ts create mode 100644 node_modules/@tanstack/query-core/build/modern/subscribable.js create mode 100644 node_modules/@tanstack/query-core/build/modern/subscribable.js.map create mode 100644 node_modules/@tanstack/query-core/build/modern/thenable.cjs create mode 100644 node_modules/@tanstack/query-core/build/modern/thenable.cjs.map create mode 100644 node_modules/@tanstack/query-core/build/modern/thenable.d.cts create mode 100644 node_modules/@tanstack/query-core/build/modern/thenable.d.ts create mode 100644 node_modules/@tanstack/query-core/build/modern/thenable.js create mode 100644 node_modules/@tanstack/query-core/build/modern/thenable.js.map create mode 100644 node_modules/@tanstack/query-core/build/modern/timeoutManager.cjs create mode 100644 node_modules/@tanstack/query-core/build/modern/timeoutManager.cjs.map create mode 100644 node_modules/@tanstack/query-core/build/modern/timeoutManager.d.cts create mode 100644 node_modules/@tanstack/query-core/build/modern/timeoutManager.d.ts create mode 100644 node_modules/@tanstack/query-core/build/modern/timeoutManager.js create mode 100644 node_modules/@tanstack/query-core/build/modern/timeoutManager.js.map create mode 100644 node_modules/@tanstack/query-core/build/modern/types.cjs create mode 100644 node_modules/@tanstack/query-core/build/modern/types.cjs.map create mode 100644 node_modules/@tanstack/query-core/build/modern/types.d.cts create mode 100644 node_modules/@tanstack/query-core/build/modern/types.d.ts create mode 100644 node_modules/@tanstack/query-core/build/modern/types.js create mode 100644 node_modules/@tanstack/query-core/build/modern/types.js.map create mode 100644 node_modules/@tanstack/query-core/build/modern/utils.cjs create mode 100644 node_modules/@tanstack/query-core/build/modern/utils.cjs.map create mode 100644 node_modules/@tanstack/query-core/build/modern/utils.d.cts create mode 100644 node_modules/@tanstack/query-core/build/modern/utils.d.ts create mode 100644 node_modules/@tanstack/query-core/build/modern/utils.js create mode 100644 node_modules/@tanstack/query-core/build/modern/utils.js.map create mode 100644 node_modules/@tanstack/query-core/package.json create mode 100644 node_modules/@tanstack/query-core/src/focusManager.ts create mode 100644 node_modules/@tanstack/query-core/src/hydration.ts create mode 100644 node_modules/@tanstack/query-core/src/index.ts create mode 100644 node_modules/@tanstack/query-core/src/infiniteQueryBehavior.ts create mode 100644 node_modules/@tanstack/query-core/src/infiniteQueryObserver.ts create mode 100644 node_modules/@tanstack/query-core/src/mutation.ts create mode 100644 node_modules/@tanstack/query-core/src/mutationCache.ts create mode 100644 node_modules/@tanstack/query-core/src/mutationObserver.ts create mode 100644 node_modules/@tanstack/query-core/src/notifyManager.ts create mode 100644 node_modules/@tanstack/query-core/src/onlineManager.ts create mode 100644 node_modules/@tanstack/query-core/src/queriesObserver.ts create mode 100644 node_modules/@tanstack/query-core/src/query.ts create mode 100644 node_modules/@tanstack/query-core/src/queryCache.ts create mode 100644 node_modules/@tanstack/query-core/src/queryClient.ts create mode 100644 node_modules/@tanstack/query-core/src/queryObserver.ts create mode 100644 node_modules/@tanstack/query-core/src/removable.ts create mode 100644 node_modules/@tanstack/query-core/src/retryer.ts create mode 100644 node_modules/@tanstack/query-core/src/streamedQuery.ts create mode 100644 node_modules/@tanstack/query-core/src/subscribable.ts create mode 100644 node_modules/@tanstack/query-core/src/thenable.ts create mode 100644 node_modules/@tanstack/query-core/src/timeoutManager.ts create mode 100644 node_modules/@tanstack/query-core/src/types.ts create mode 100644 node_modules/@tanstack/query-core/src/utils.ts create mode 100644 node_modules/@tanstack/react-query/LICENSE create mode 100644 node_modules/@tanstack/react-query/README.md create mode 100644 node_modules/@tanstack/react-query/build/codemods/src/utils/index.cjs create mode 100644 node_modules/@tanstack/react-query/build/codemods/src/utils/transformers/query-cache-transformer.cjs create mode 100644 node_modules/@tanstack/react-query/build/codemods/src/utils/transformers/query-client-transformer.cjs create mode 100644 node_modules/@tanstack/react-query/build/codemods/src/utils/transformers/use-query-like-transformer.cjs create mode 100644 node_modules/@tanstack/react-query/build/codemods/src/v4/key-transformation.cjs create mode 100644 node_modules/@tanstack/react-query/build/codemods/src/v4/replace-import-specifier.cjs create mode 100644 node_modules/@tanstack/react-query/build/codemods/src/v4/utils/replacers/key-replacer.cjs create mode 100644 node_modules/@tanstack/react-query/build/codemods/src/v5/is-loading/is-loading.cjs create mode 100644 node_modules/@tanstack/react-query/build/codemods/src/v5/keep-previous-data/README.md create mode 100644 node_modules/@tanstack/react-query/build/codemods/src/v5/keep-previous-data/keep-previous-data.cjs create mode 100644 node_modules/@tanstack/react-query/build/codemods/src/v5/keep-previous-data/utils/already-has-placeholder-data-property.cjs create mode 100644 node_modules/@tanstack/react-query/build/codemods/src/v5/remove-overloads/remove-overloads.cjs create mode 100644 node_modules/@tanstack/react-query/build/codemods/src/v5/remove-overloads/transformers/filter-aware-usage-transformer.cjs create mode 100644 node_modules/@tanstack/react-query/build/codemods/src/v5/remove-overloads/transformers/query-fn-aware-usage-transformer.cjs create mode 100644 node_modules/@tanstack/react-query/build/codemods/src/v5/remove-overloads/utils/index.cjs create mode 100644 node_modules/@tanstack/react-query/build/codemods/src/v5/remove-overloads/utils/unknown-usage-error.cjs create mode 100644 node_modules/@tanstack/react-query/build/codemods/src/v5/rename-hydrate/rename-hydrate.cjs create mode 100644 node_modules/@tanstack/react-query/build/codemods/src/v5/rename-properties/rename-properties.cjs create mode 100644 node_modules/@tanstack/react-query/build/legacy/HydrationBoundary.cjs create mode 100644 node_modules/@tanstack/react-query/build/legacy/HydrationBoundary.cjs.map create mode 100644 node_modules/@tanstack/react-query/build/legacy/HydrationBoundary.d.cts create mode 100644 node_modules/@tanstack/react-query/build/legacy/HydrationBoundary.d.ts create mode 100644 node_modules/@tanstack/react-query/build/legacy/HydrationBoundary.js create mode 100644 node_modules/@tanstack/react-query/build/legacy/HydrationBoundary.js.map create mode 100644 node_modules/@tanstack/react-query/build/legacy/IsRestoringProvider.cjs create mode 100644 node_modules/@tanstack/react-query/build/legacy/IsRestoringProvider.cjs.map create mode 100644 node_modules/@tanstack/react-query/build/legacy/IsRestoringProvider.d.cts create mode 100644 node_modules/@tanstack/react-query/build/legacy/IsRestoringProvider.d.ts create mode 100644 node_modules/@tanstack/react-query/build/legacy/IsRestoringProvider.js create mode 100644 node_modules/@tanstack/react-query/build/legacy/IsRestoringProvider.js.map create mode 100644 node_modules/@tanstack/react-query/build/legacy/QueryClientProvider.cjs create mode 100644 node_modules/@tanstack/react-query/build/legacy/QueryClientProvider.cjs.map create mode 100644 node_modules/@tanstack/react-query/build/legacy/QueryClientProvider.d.cts create mode 100644 node_modules/@tanstack/react-query/build/legacy/QueryClientProvider.d.ts create mode 100644 node_modules/@tanstack/react-query/build/legacy/QueryClientProvider.js create mode 100644 node_modules/@tanstack/react-query/build/legacy/QueryClientProvider.js.map create mode 100644 node_modules/@tanstack/react-query/build/legacy/QueryErrorResetBoundary.cjs create mode 100644 node_modules/@tanstack/react-query/build/legacy/QueryErrorResetBoundary.cjs.map create mode 100644 node_modules/@tanstack/react-query/build/legacy/QueryErrorResetBoundary.d.cts create mode 100644 node_modules/@tanstack/react-query/build/legacy/QueryErrorResetBoundary.d.ts create mode 100644 node_modules/@tanstack/react-query/build/legacy/QueryErrorResetBoundary.js create mode 100644 node_modules/@tanstack/react-query/build/legacy/QueryErrorResetBoundary.js.map create mode 100644 node_modules/@tanstack/react-query/build/legacy/errorBoundaryUtils.cjs create mode 100644 node_modules/@tanstack/react-query/build/legacy/errorBoundaryUtils.cjs.map create mode 100644 node_modules/@tanstack/react-query/build/legacy/errorBoundaryUtils.d.cts create mode 100644 node_modules/@tanstack/react-query/build/legacy/errorBoundaryUtils.d.ts create mode 100644 node_modules/@tanstack/react-query/build/legacy/errorBoundaryUtils.js create mode 100644 node_modules/@tanstack/react-query/build/legacy/errorBoundaryUtils.js.map create mode 100644 node_modules/@tanstack/react-query/build/legacy/index.cjs create mode 100644 node_modules/@tanstack/react-query/build/legacy/index.cjs.map create mode 100644 node_modules/@tanstack/react-query/build/legacy/index.d.cts create mode 100644 node_modules/@tanstack/react-query/build/legacy/index.d.ts create mode 100644 node_modules/@tanstack/react-query/build/legacy/index.js create mode 100644 node_modules/@tanstack/react-query/build/legacy/index.js.map create mode 100644 node_modules/@tanstack/react-query/build/legacy/infiniteQueryOptions.cjs create mode 100644 node_modules/@tanstack/react-query/build/legacy/infiniteQueryOptions.cjs.map create mode 100644 node_modules/@tanstack/react-query/build/legacy/infiniteQueryOptions.d.cts create mode 100644 node_modules/@tanstack/react-query/build/legacy/infiniteQueryOptions.d.ts create mode 100644 node_modules/@tanstack/react-query/build/legacy/infiniteQueryOptions.js create mode 100644 node_modules/@tanstack/react-query/build/legacy/infiniteQueryOptions.js.map create mode 100644 node_modules/@tanstack/react-query/build/legacy/mutationOptions.cjs create mode 100644 node_modules/@tanstack/react-query/build/legacy/mutationOptions.cjs.map create mode 100644 node_modules/@tanstack/react-query/build/legacy/mutationOptions.d.cts create mode 100644 node_modules/@tanstack/react-query/build/legacy/mutationOptions.d.ts create mode 100644 node_modules/@tanstack/react-query/build/legacy/mutationOptions.js create mode 100644 node_modules/@tanstack/react-query/build/legacy/mutationOptions.js.map create mode 100644 node_modules/@tanstack/react-query/build/legacy/queryOptions.cjs create mode 100644 node_modules/@tanstack/react-query/build/legacy/queryOptions.cjs.map create mode 100644 node_modules/@tanstack/react-query/build/legacy/queryOptions.d.cts create mode 100644 node_modules/@tanstack/react-query/build/legacy/queryOptions.d.ts create mode 100644 node_modules/@tanstack/react-query/build/legacy/queryOptions.js create mode 100644 node_modules/@tanstack/react-query/build/legacy/queryOptions.js.map create mode 100644 node_modules/@tanstack/react-query/build/legacy/suspense.cjs create mode 100644 node_modules/@tanstack/react-query/build/legacy/suspense.cjs.map create mode 100644 node_modules/@tanstack/react-query/build/legacy/suspense.d.cts create mode 100644 node_modules/@tanstack/react-query/build/legacy/suspense.d.ts create mode 100644 node_modules/@tanstack/react-query/build/legacy/suspense.js create mode 100644 node_modules/@tanstack/react-query/build/legacy/suspense.js.map create mode 100644 node_modules/@tanstack/react-query/build/legacy/types.cjs create mode 100644 node_modules/@tanstack/react-query/build/legacy/types.cjs.map create mode 100644 node_modules/@tanstack/react-query/build/legacy/types.d.cts create mode 100644 node_modules/@tanstack/react-query/build/legacy/types.d.ts create mode 100644 node_modules/@tanstack/react-query/build/legacy/types.js create mode 100644 node_modules/@tanstack/react-query/build/legacy/types.js.map create mode 100644 node_modules/@tanstack/react-query/build/legacy/useBaseQuery.cjs create mode 100644 node_modules/@tanstack/react-query/build/legacy/useBaseQuery.cjs.map create mode 100644 node_modules/@tanstack/react-query/build/legacy/useBaseQuery.d.cts create mode 100644 node_modules/@tanstack/react-query/build/legacy/useBaseQuery.d.ts create mode 100644 node_modules/@tanstack/react-query/build/legacy/useBaseQuery.js create mode 100644 node_modules/@tanstack/react-query/build/legacy/useBaseQuery.js.map create mode 100644 node_modules/@tanstack/react-query/build/legacy/useInfiniteQuery.cjs create mode 100644 node_modules/@tanstack/react-query/build/legacy/useInfiniteQuery.cjs.map create mode 100644 node_modules/@tanstack/react-query/build/legacy/useInfiniteQuery.d.cts create mode 100644 node_modules/@tanstack/react-query/build/legacy/useInfiniteQuery.d.ts create mode 100644 node_modules/@tanstack/react-query/build/legacy/useInfiniteQuery.js create mode 100644 node_modules/@tanstack/react-query/build/legacy/useInfiniteQuery.js.map create mode 100644 node_modules/@tanstack/react-query/build/legacy/useIsFetching.cjs create mode 100644 node_modules/@tanstack/react-query/build/legacy/useIsFetching.cjs.map create mode 100644 node_modules/@tanstack/react-query/build/legacy/useIsFetching.d.cts create mode 100644 node_modules/@tanstack/react-query/build/legacy/useIsFetching.d.ts create mode 100644 node_modules/@tanstack/react-query/build/legacy/useIsFetching.js create mode 100644 node_modules/@tanstack/react-query/build/legacy/useIsFetching.js.map create mode 100644 node_modules/@tanstack/react-query/build/legacy/useMutation.cjs create mode 100644 node_modules/@tanstack/react-query/build/legacy/useMutation.cjs.map create mode 100644 node_modules/@tanstack/react-query/build/legacy/useMutation.d.cts create mode 100644 node_modules/@tanstack/react-query/build/legacy/useMutation.d.ts create mode 100644 node_modules/@tanstack/react-query/build/legacy/useMutation.js create mode 100644 node_modules/@tanstack/react-query/build/legacy/useMutation.js.map create mode 100644 node_modules/@tanstack/react-query/build/legacy/useMutationState.cjs create mode 100644 node_modules/@tanstack/react-query/build/legacy/useMutationState.cjs.map create mode 100644 node_modules/@tanstack/react-query/build/legacy/useMutationState.d.cts create mode 100644 node_modules/@tanstack/react-query/build/legacy/useMutationState.d.ts create mode 100644 node_modules/@tanstack/react-query/build/legacy/useMutationState.js create mode 100644 node_modules/@tanstack/react-query/build/legacy/useMutationState.js.map create mode 100644 node_modules/@tanstack/react-query/build/legacy/usePrefetchInfiniteQuery.cjs create mode 100644 node_modules/@tanstack/react-query/build/legacy/usePrefetchInfiniteQuery.cjs.map create mode 100644 node_modules/@tanstack/react-query/build/legacy/usePrefetchInfiniteQuery.d.cts create mode 100644 node_modules/@tanstack/react-query/build/legacy/usePrefetchInfiniteQuery.d.ts create mode 100644 node_modules/@tanstack/react-query/build/legacy/usePrefetchInfiniteQuery.js create mode 100644 node_modules/@tanstack/react-query/build/legacy/usePrefetchInfiniteQuery.js.map create mode 100644 node_modules/@tanstack/react-query/build/legacy/usePrefetchQuery.cjs create mode 100644 node_modules/@tanstack/react-query/build/legacy/usePrefetchQuery.cjs.map create mode 100644 node_modules/@tanstack/react-query/build/legacy/usePrefetchQuery.d.cts create mode 100644 node_modules/@tanstack/react-query/build/legacy/usePrefetchQuery.d.ts create mode 100644 node_modules/@tanstack/react-query/build/legacy/usePrefetchQuery.js create mode 100644 node_modules/@tanstack/react-query/build/legacy/usePrefetchQuery.js.map create mode 100644 node_modules/@tanstack/react-query/build/legacy/useQueries.cjs create mode 100644 node_modules/@tanstack/react-query/build/legacy/useQueries.cjs.map create mode 100644 node_modules/@tanstack/react-query/build/legacy/useQueries.d.cts create mode 100644 node_modules/@tanstack/react-query/build/legacy/useQueries.d.ts create mode 100644 node_modules/@tanstack/react-query/build/legacy/useQueries.js create mode 100644 node_modules/@tanstack/react-query/build/legacy/useQueries.js.map create mode 100644 node_modules/@tanstack/react-query/build/legacy/useQuery.cjs create mode 100644 node_modules/@tanstack/react-query/build/legacy/useQuery.cjs.map create mode 100644 node_modules/@tanstack/react-query/build/legacy/useQuery.d.cts create mode 100644 node_modules/@tanstack/react-query/build/legacy/useQuery.d.ts create mode 100644 node_modules/@tanstack/react-query/build/legacy/useQuery.js create mode 100644 node_modules/@tanstack/react-query/build/legacy/useQuery.js.map create mode 100644 node_modules/@tanstack/react-query/build/legacy/useSuspenseInfiniteQuery.cjs create mode 100644 node_modules/@tanstack/react-query/build/legacy/useSuspenseInfiniteQuery.cjs.map create mode 100644 node_modules/@tanstack/react-query/build/legacy/useSuspenseInfiniteQuery.d.cts create mode 100644 node_modules/@tanstack/react-query/build/legacy/useSuspenseInfiniteQuery.d.ts create mode 100644 node_modules/@tanstack/react-query/build/legacy/useSuspenseInfiniteQuery.js create mode 100644 node_modules/@tanstack/react-query/build/legacy/useSuspenseInfiniteQuery.js.map create mode 100644 node_modules/@tanstack/react-query/build/legacy/useSuspenseQueries.cjs create mode 100644 node_modules/@tanstack/react-query/build/legacy/useSuspenseQueries.cjs.map create mode 100644 node_modules/@tanstack/react-query/build/legacy/useSuspenseQueries.d.cts create mode 100644 node_modules/@tanstack/react-query/build/legacy/useSuspenseQueries.d.ts create mode 100644 node_modules/@tanstack/react-query/build/legacy/useSuspenseQueries.js create mode 100644 node_modules/@tanstack/react-query/build/legacy/useSuspenseQueries.js.map create mode 100644 node_modules/@tanstack/react-query/build/legacy/useSuspenseQuery.cjs create mode 100644 node_modules/@tanstack/react-query/build/legacy/useSuspenseQuery.cjs.map create mode 100644 node_modules/@tanstack/react-query/build/legacy/useSuspenseQuery.d.cts create mode 100644 node_modules/@tanstack/react-query/build/legacy/useSuspenseQuery.d.ts create mode 100644 node_modules/@tanstack/react-query/build/legacy/useSuspenseQuery.js create mode 100644 node_modules/@tanstack/react-query/build/legacy/useSuspenseQuery.js.map create mode 100644 node_modules/@tanstack/react-query/build/modern/HydrationBoundary.cjs create mode 100644 node_modules/@tanstack/react-query/build/modern/HydrationBoundary.cjs.map create mode 100644 node_modules/@tanstack/react-query/build/modern/HydrationBoundary.d.cts create mode 100644 node_modules/@tanstack/react-query/build/modern/HydrationBoundary.d.ts create mode 100644 node_modules/@tanstack/react-query/build/modern/HydrationBoundary.js create mode 100644 node_modules/@tanstack/react-query/build/modern/HydrationBoundary.js.map create mode 100644 node_modules/@tanstack/react-query/build/modern/IsRestoringProvider.cjs create mode 100644 node_modules/@tanstack/react-query/build/modern/IsRestoringProvider.cjs.map create mode 100644 node_modules/@tanstack/react-query/build/modern/IsRestoringProvider.d.cts create mode 100644 node_modules/@tanstack/react-query/build/modern/IsRestoringProvider.d.ts create mode 100644 node_modules/@tanstack/react-query/build/modern/IsRestoringProvider.js create mode 100644 node_modules/@tanstack/react-query/build/modern/IsRestoringProvider.js.map create mode 100644 node_modules/@tanstack/react-query/build/modern/QueryClientProvider.cjs create mode 100644 node_modules/@tanstack/react-query/build/modern/QueryClientProvider.cjs.map create mode 100644 node_modules/@tanstack/react-query/build/modern/QueryClientProvider.d.cts create mode 100644 node_modules/@tanstack/react-query/build/modern/QueryClientProvider.d.ts create mode 100644 node_modules/@tanstack/react-query/build/modern/QueryClientProvider.js create mode 100644 node_modules/@tanstack/react-query/build/modern/QueryClientProvider.js.map create mode 100644 node_modules/@tanstack/react-query/build/modern/QueryErrorResetBoundary.cjs create mode 100644 node_modules/@tanstack/react-query/build/modern/QueryErrorResetBoundary.cjs.map create mode 100644 node_modules/@tanstack/react-query/build/modern/QueryErrorResetBoundary.d.cts create mode 100644 node_modules/@tanstack/react-query/build/modern/QueryErrorResetBoundary.d.ts create mode 100644 node_modules/@tanstack/react-query/build/modern/QueryErrorResetBoundary.js create mode 100644 node_modules/@tanstack/react-query/build/modern/QueryErrorResetBoundary.js.map create mode 100644 node_modules/@tanstack/react-query/build/modern/errorBoundaryUtils.cjs create mode 100644 node_modules/@tanstack/react-query/build/modern/errorBoundaryUtils.cjs.map create mode 100644 node_modules/@tanstack/react-query/build/modern/errorBoundaryUtils.d.cts create mode 100644 node_modules/@tanstack/react-query/build/modern/errorBoundaryUtils.d.ts create mode 100644 node_modules/@tanstack/react-query/build/modern/errorBoundaryUtils.js create mode 100644 node_modules/@tanstack/react-query/build/modern/errorBoundaryUtils.js.map create mode 100644 node_modules/@tanstack/react-query/build/modern/index.cjs create mode 100644 node_modules/@tanstack/react-query/build/modern/index.cjs.map create mode 100644 node_modules/@tanstack/react-query/build/modern/index.d.cts create mode 100644 node_modules/@tanstack/react-query/build/modern/index.d.ts create mode 100644 node_modules/@tanstack/react-query/build/modern/index.js create mode 100644 node_modules/@tanstack/react-query/build/modern/index.js.map create mode 100644 node_modules/@tanstack/react-query/build/modern/infiniteQueryOptions.cjs create mode 100644 node_modules/@tanstack/react-query/build/modern/infiniteQueryOptions.cjs.map create mode 100644 node_modules/@tanstack/react-query/build/modern/infiniteQueryOptions.d.cts create mode 100644 node_modules/@tanstack/react-query/build/modern/infiniteQueryOptions.d.ts create mode 100644 node_modules/@tanstack/react-query/build/modern/infiniteQueryOptions.js create mode 100644 node_modules/@tanstack/react-query/build/modern/infiniteQueryOptions.js.map create mode 100644 node_modules/@tanstack/react-query/build/modern/mutationOptions.cjs create mode 100644 node_modules/@tanstack/react-query/build/modern/mutationOptions.cjs.map create mode 100644 node_modules/@tanstack/react-query/build/modern/mutationOptions.d.cts create mode 100644 node_modules/@tanstack/react-query/build/modern/mutationOptions.d.ts create mode 100644 node_modules/@tanstack/react-query/build/modern/mutationOptions.js create mode 100644 node_modules/@tanstack/react-query/build/modern/mutationOptions.js.map create mode 100644 node_modules/@tanstack/react-query/build/modern/queryOptions.cjs create mode 100644 node_modules/@tanstack/react-query/build/modern/queryOptions.cjs.map create mode 100644 node_modules/@tanstack/react-query/build/modern/queryOptions.d.cts create mode 100644 node_modules/@tanstack/react-query/build/modern/queryOptions.d.ts create mode 100644 node_modules/@tanstack/react-query/build/modern/queryOptions.js create mode 100644 node_modules/@tanstack/react-query/build/modern/queryOptions.js.map create mode 100644 node_modules/@tanstack/react-query/build/modern/suspense.cjs create mode 100644 node_modules/@tanstack/react-query/build/modern/suspense.cjs.map create mode 100644 node_modules/@tanstack/react-query/build/modern/suspense.d.cts create mode 100644 node_modules/@tanstack/react-query/build/modern/suspense.d.ts create mode 100644 node_modules/@tanstack/react-query/build/modern/suspense.js create mode 100644 node_modules/@tanstack/react-query/build/modern/suspense.js.map create mode 100644 node_modules/@tanstack/react-query/build/modern/types.cjs create mode 100644 node_modules/@tanstack/react-query/build/modern/types.cjs.map create mode 100644 node_modules/@tanstack/react-query/build/modern/types.d.cts create mode 100644 node_modules/@tanstack/react-query/build/modern/types.d.ts create mode 100644 node_modules/@tanstack/react-query/build/modern/types.js create mode 100644 node_modules/@tanstack/react-query/build/modern/types.js.map create mode 100644 node_modules/@tanstack/react-query/build/modern/useBaseQuery.cjs create mode 100644 node_modules/@tanstack/react-query/build/modern/useBaseQuery.cjs.map create mode 100644 node_modules/@tanstack/react-query/build/modern/useBaseQuery.d.cts create mode 100644 node_modules/@tanstack/react-query/build/modern/useBaseQuery.d.ts create mode 100644 node_modules/@tanstack/react-query/build/modern/useBaseQuery.js create mode 100644 node_modules/@tanstack/react-query/build/modern/useBaseQuery.js.map create mode 100644 node_modules/@tanstack/react-query/build/modern/useInfiniteQuery.cjs create mode 100644 node_modules/@tanstack/react-query/build/modern/useInfiniteQuery.cjs.map create mode 100644 node_modules/@tanstack/react-query/build/modern/useInfiniteQuery.d.cts create mode 100644 node_modules/@tanstack/react-query/build/modern/useInfiniteQuery.d.ts create mode 100644 node_modules/@tanstack/react-query/build/modern/useInfiniteQuery.js create mode 100644 node_modules/@tanstack/react-query/build/modern/useInfiniteQuery.js.map create mode 100644 node_modules/@tanstack/react-query/build/modern/useIsFetching.cjs create mode 100644 node_modules/@tanstack/react-query/build/modern/useIsFetching.cjs.map create mode 100644 node_modules/@tanstack/react-query/build/modern/useIsFetching.d.cts create mode 100644 node_modules/@tanstack/react-query/build/modern/useIsFetching.d.ts create mode 100644 node_modules/@tanstack/react-query/build/modern/useIsFetching.js create mode 100644 node_modules/@tanstack/react-query/build/modern/useIsFetching.js.map create mode 100644 node_modules/@tanstack/react-query/build/modern/useMutation.cjs create mode 100644 node_modules/@tanstack/react-query/build/modern/useMutation.cjs.map create mode 100644 node_modules/@tanstack/react-query/build/modern/useMutation.d.cts create mode 100644 node_modules/@tanstack/react-query/build/modern/useMutation.d.ts create mode 100644 node_modules/@tanstack/react-query/build/modern/useMutation.js create mode 100644 node_modules/@tanstack/react-query/build/modern/useMutation.js.map create mode 100644 node_modules/@tanstack/react-query/build/modern/useMutationState.cjs create mode 100644 node_modules/@tanstack/react-query/build/modern/useMutationState.cjs.map create mode 100644 node_modules/@tanstack/react-query/build/modern/useMutationState.d.cts create mode 100644 node_modules/@tanstack/react-query/build/modern/useMutationState.d.ts create mode 100644 node_modules/@tanstack/react-query/build/modern/useMutationState.js create mode 100644 node_modules/@tanstack/react-query/build/modern/useMutationState.js.map create mode 100644 node_modules/@tanstack/react-query/build/modern/usePrefetchInfiniteQuery.cjs create mode 100644 node_modules/@tanstack/react-query/build/modern/usePrefetchInfiniteQuery.cjs.map create mode 100644 node_modules/@tanstack/react-query/build/modern/usePrefetchInfiniteQuery.d.cts create mode 100644 node_modules/@tanstack/react-query/build/modern/usePrefetchInfiniteQuery.d.ts create mode 100644 node_modules/@tanstack/react-query/build/modern/usePrefetchInfiniteQuery.js create mode 100644 node_modules/@tanstack/react-query/build/modern/usePrefetchInfiniteQuery.js.map create mode 100644 node_modules/@tanstack/react-query/build/modern/usePrefetchQuery.cjs create mode 100644 node_modules/@tanstack/react-query/build/modern/usePrefetchQuery.cjs.map create mode 100644 node_modules/@tanstack/react-query/build/modern/usePrefetchQuery.d.cts create mode 100644 node_modules/@tanstack/react-query/build/modern/usePrefetchQuery.d.ts create mode 100644 node_modules/@tanstack/react-query/build/modern/usePrefetchQuery.js create mode 100644 node_modules/@tanstack/react-query/build/modern/usePrefetchQuery.js.map create mode 100644 node_modules/@tanstack/react-query/build/modern/useQueries.cjs create mode 100644 node_modules/@tanstack/react-query/build/modern/useQueries.cjs.map create mode 100644 node_modules/@tanstack/react-query/build/modern/useQueries.d.cts create mode 100644 node_modules/@tanstack/react-query/build/modern/useQueries.d.ts create mode 100644 node_modules/@tanstack/react-query/build/modern/useQueries.js create mode 100644 node_modules/@tanstack/react-query/build/modern/useQueries.js.map create mode 100644 node_modules/@tanstack/react-query/build/modern/useQuery.cjs create mode 100644 node_modules/@tanstack/react-query/build/modern/useQuery.cjs.map create mode 100644 node_modules/@tanstack/react-query/build/modern/useQuery.d.cts create mode 100644 node_modules/@tanstack/react-query/build/modern/useQuery.d.ts create mode 100644 node_modules/@tanstack/react-query/build/modern/useQuery.js create mode 100644 node_modules/@tanstack/react-query/build/modern/useQuery.js.map create mode 100644 node_modules/@tanstack/react-query/build/modern/useSuspenseInfiniteQuery.cjs create mode 100644 node_modules/@tanstack/react-query/build/modern/useSuspenseInfiniteQuery.cjs.map create mode 100644 node_modules/@tanstack/react-query/build/modern/useSuspenseInfiniteQuery.d.cts create mode 100644 node_modules/@tanstack/react-query/build/modern/useSuspenseInfiniteQuery.d.ts create mode 100644 node_modules/@tanstack/react-query/build/modern/useSuspenseInfiniteQuery.js create mode 100644 node_modules/@tanstack/react-query/build/modern/useSuspenseInfiniteQuery.js.map create mode 100644 node_modules/@tanstack/react-query/build/modern/useSuspenseQueries.cjs create mode 100644 node_modules/@tanstack/react-query/build/modern/useSuspenseQueries.cjs.map create mode 100644 node_modules/@tanstack/react-query/build/modern/useSuspenseQueries.d.cts create mode 100644 node_modules/@tanstack/react-query/build/modern/useSuspenseQueries.d.ts create mode 100644 node_modules/@tanstack/react-query/build/modern/useSuspenseQueries.js create mode 100644 node_modules/@tanstack/react-query/build/modern/useSuspenseQueries.js.map create mode 100644 node_modules/@tanstack/react-query/build/modern/useSuspenseQuery.cjs create mode 100644 node_modules/@tanstack/react-query/build/modern/useSuspenseQuery.cjs.map create mode 100644 node_modules/@tanstack/react-query/build/modern/useSuspenseQuery.d.cts create mode 100644 node_modules/@tanstack/react-query/build/modern/useSuspenseQuery.d.ts create mode 100644 node_modules/@tanstack/react-query/build/modern/useSuspenseQuery.js create mode 100644 node_modules/@tanstack/react-query/build/modern/useSuspenseQuery.js.map create mode 100644 node_modules/@tanstack/react-query/build/query-codemods/eslint.config.js create mode 100644 node_modules/@tanstack/react-query/build/query-codemods/package.json create mode 100644 node_modules/@tanstack/react-query/build/query-codemods/root.eslint.config.js create mode 100644 node_modules/@tanstack/react-query/build/query-codemods/tsconfig.json create mode 100644 node_modules/@tanstack/react-query/build/query-codemods/vite.config.ts create mode 100644 node_modules/@tanstack/react-query/package.json create mode 100644 node_modules/@tanstack/react-query/src/HydrationBoundary.tsx create mode 100644 node_modules/@tanstack/react-query/src/IsRestoringProvider.ts create mode 100644 node_modules/@tanstack/react-query/src/QueryClientProvider.tsx create mode 100644 node_modules/@tanstack/react-query/src/QueryErrorResetBoundary.tsx create mode 100644 node_modules/@tanstack/react-query/src/errorBoundaryUtils.ts create mode 100644 node_modules/@tanstack/react-query/src/index.ts create mode 100644 node_modules/@tanstack/react-query/src/infiniteQueryOptions.ts create mode 100644 node_modules/@tanstack/react-query/src/mutationOptions.ts create mode 100644 node_modules/@tanstack/react-query/src/queryOptions.ts create mode 100644 node_modules/@tanstack/react-query/src/suspense.ts create mode 100644 node_modules/@tanstack/react-query/src/types.ts create mode 100644 node_modules/@tanstack/react-query/src/useBaseQuery.ts create mode 100644 node_modules/@tanstack/react-query/src/useInfiniteQuery.ts create mode 100644 node_modules/@tanstack/react-query/src/useIsFetching.ts create mode 100644 node_modules/@tanstack/react-query/src/useMutation.ts create mode 100644 node_modules/@tanstack/react-query/src/useMutationState.ts create mode 100644 node_modules/@tanstack/react-query/src/usePrefetchInfiniteQuery.tsx create mode 100644 node_modules/@tanstack/react-query/src/usePrefetchQuery.tsx create mode 100644 node_modules/@tanstack/react-query/src/useQueries.ts create mode 100644 node_modules/@tanstack/react-query/src/useQuery.ts create mode 100644 node_modules/@tanstack/react-query/src/useSuspenseInfiniteQuery.ts create mode 100644 node_modules/@tanstack/react-query/src/useSuspenseQueries.ts create mode 100644 node_modules/@tanstack/react-query/src/useSuspenseQuery.ts create mode 100644 node_modules/react/LICENSE create mode 100644 node_modules/react/README.md create mode 100644 node_modules/react/cjs/react-compiler-runtime.development.js create mode 100644 node_modules/react/cjs/react-compiler-runtime.production.js create mode 100644 node_modules/react/cjs/react-compiler-runtime.profiling.js create mode 100644 node_modules/react/cjs/react-jsx-dev-runtime.development.js create mode 100644 node_modules/react/cjs/react-jsx-dev-runtime.production.js create mode 100644 node_modules/react/cjs/react-jsx-dev-runtime.profiling.js create mode 100644 node_modules/react/cjs/react-jsx-dev-runtime.react-server.development.js create mode 100644 node_modules/react/cjs/react-jsx-dev-runtime.react-server.production.js create mode 100644 node_modules/react/cjs/react-jsx-runtime.development.js create mode 100644 node_modules/react/cjs/react-jsx-runtime.production.js create mode 100644 node_modules/react/cjs/react-jsx-runtime.profiling.js create mode 100644 node_modules/react/cjs/react-jsx-runtime.react-server.development.js create mode 100644 node_modules/react/cjs/react-jsx-runtime.react-server.production.js create mode 100644 node_modules/react/cjs/react.development.js create mode 100644 node_modules/react/cjs/react.production.js create mode 100644 node_modules/react/cjs/react.react-server.development.js create mode 100644 node_modules/react/cjs/react.react-server.production.js create mode 100644 node_modules/react/compiler-runtime.js create mode 100644 node_modules/react/index.js create mode 100644 node_modules/react/jsx-dev-runtime.js create mode 100644 node_modules/react/jsx-dev-runtime.react-server.js create mode 100644 node_modules/react/jsx-runtime.js create mode 100644 node_modules/react/jsx-runtime.react-server.js create mode 100644 node_modules/react/package.json create mode 100644 node_modules/react/react.react-server.js create mode 100644 package-lock.json create mode 100644 package.json diff --git a/frontend/app/(dashboard)/assets/[id]/page.tsx b/frontend/app/(dashboard)/assets/[id]/page.tsx index 84415e8..3de4971 100644 --- a/frontend/app/(dashboard)/assets/[id]/page.tsx +++ b/frontend/app/(dashboard)/assets/[id]/page.tsx @@ -9,7 +9,7 @@ import { StatusBadge } from "@/components/assets/status-badge"; import { ConditionBadge } from "@/components/assets/condition-badge"; import { useAsset, useAssetHistory } from "@/lib/query/hooks/useAsset"; -type Tab = "overview" | "history"; +type Tab = "overview" | "history" | "documents"; export default function AssetDetailPage() { const { id } = useParams<{ id: string }>(); @@ -41,6 +41,7 @@ export default function AssetDetailPage() { const tabs: { key: Tab; label: string; icon: React.ReactNode }[] = [ { key: "overview", label: "Overview", icon: }, { key: "history", label: "History", icon: }, + { key: "documents", label: "Documents", icon: }, ]; return ( @@ -232,6 +233,98 @@ export default function AssetDetailPage() { )} )} + + {tab === "documents" && } + + ); +} + +// Asset Documents Section +import { + useAssetDocuments, + useUploadDocument, + useDeleteDocument, +} from "@/lib/query/hooks/useAsset"; + +function AssetDocumentsSection({ assetId }: { assetId: string }) { + const { data: documents = [], isLoading } = useAssetDocuments(assetId); + const uploadMutation = useUploadDocument(assetId); + const deleteMutation = useDeleteDocument(assetId); + const [file, setFile] = useState(null); + const [name, setName] = useState(""); + + const handleUpload = (e: React.FormEvent) => { + e.preventDefault(); + if (file) { + uploadMutation.mutate({ file, name: name || file.name }); + setFile(null); + setName(""); + } + }; + + return ( +
+

+ Asset Documents +

+
+ setFile(e.target.files?.[0] || null)} + className="border rounded px-2 py-1 text-sm" + /> + setName(e.target.value)} + className="border rounded px-2 py-1 text-sm" + /> + +
+ {isLoading ? ( +
Loading documents...
+ ) : documents.length === 0 ? ( +
No documents uploaded yet.
+ ) : ( +
    + {documents.map((doc) => ( +
  • +
    + + {doc.name} + + {doc.type} + + {(doc.size / 1024).toFixed(1)} KB + + + Uploaded by {doc.uploadedBy?.firstName}{" "} + {doc.uploadedBy?.lastName} + + + {format(new Date(doc.createdAt), "MMM d, yyyy")} + +
    + +
  • + ))} +
+ )}
); } diff --git a/node_modules/.package-lock.json b/node_modules/.package-lock.json new file mode 100644 index 0000000..7ec269b --- /dev/null +++ b/node_modules/.package-lock.json @@ -0,0 +1,43 @@ +{ + "name": "ManageAssets", + "lockfileVersion": 3, + "requires": true, + "packages": { + "node_modules/@tanstack/query-core": { + "version": "5.90.20", + "resolved": "https://registry.npmjs.org/@tanstack/query-core/-/query-core-5.90.20.tgz", + "integrity": "sha512-OMD2HLpNouXEfZJWcKeVKUgQ5n+n3A2JFmBaScpNDUqSrQSjiveC7dKMe53uJUg1nDG16ttFPz2xfilz6i2uVg==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/tannerlinsley" + } + }, + "node_modules/@tanstack/react-query": { + "version": "5.90.21", + "resolved": "https://registry.npmjs.org/@tanstack/react-query/-/react-query-5.90.21.tgz", + "integrity": "sha512-0Lu6y5t+tvlTJMTO7oh5NSpJfpg/5D41LlThfepTixPYkJ0sE2Jj0m0f6yYqujBwIXlId87e234+MxG3D3g7kg==", + "license": "MIT", + "dependencies": { + "@tanstack/query-core": "5.90.20" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/tannerlinsley" + }, + "peerDependencies": { + "react": "^18 || ^19" + } + }, + "node_modules/react": { + "version": "19.2.4", + "resolved": "https://registry.npmjs.org/react/-/react-19.2.4.tgz", + "integrity": "sha512-9nfp2hYpCwOjAN+8TZFGhtWEwgvWHXqESH8qT89AT/lWklpLON22Lc8pEtnpsZz7VmawabSU0gCjnj8aC0euHQ==", + "license": "MIT", + "peer": true, + "engines": { + "node": ">=0.10.0" + } + } + } +} diff --git a/node_modules/@tanstack/query-core/LICENSE b/node_modules/@tanstack/query-core/LICENSE new file mode 100644 index 0000000..1869e21 --- /dev/null +++ b/node_modules/@tanstack/query-core/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2021-present Tanner Linsley + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/@tanstack/query-core/build/legacy/chunk-PXG64RU4.js b/node_modules/@tanstack/query-core/build/legacy/chunk-PXG64RU4.js new file mode 100644 index 0000000..62f76a2 --- /dev/null +++ b/node_modules/@tanstack/query-core/build/legacy/chunk-PXG64RU4.js @@ -0,0 +1,25 @@ +var __typeError = (msg) => { + throw TypeError(msg); +}; +var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg); +var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj)); +var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value); +var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value); +var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method); +var __privateWrapper = (obj, member, setter, getter) => ({ + set _(value) { + __privateSet(obj, member, value, setter); + }, + get _() { + return __privateGet(obj, member, getter); + } +}); + +export { + __privateGet, + __privateAdd, + __privateSet, + __privateMethod, + __privateWrapper +}; +//# sourceMappingURL=chunk-PXG64RU4.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/chunk-PXG64RU4.js.map b/node_modules/@tanstack/query-core/build/legacy/chunk-PXG64RU4.js.map new file mode 100644 index 0000000..84c51b2 --- /dev/null +++ b/node_modules/@tanstack/query-core/build/legacy/chunk-PXG64RU4.js.map @@ -0,0 +1 @@ +{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/focusManager.cjs b/node_modules/@tanstack/query-core/build/legacy/focusManager.cjs new file mode 100644 index 0000000..c2ae467 --- /dev/null +++ b/node_modules/@tanstack/query-core/build/legacy/focusManager.cjs @@ -0,0 +1,108 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __typeError = (msg) => { + throw TypeError(msg); +}; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg); +var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj)); +var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value); +var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value); + +// src/focusManager.ts +var focusManager_exports = {}; +__export(focusManager_exports, { + FocusManager: () => FocusManager, + focusManager: () => focusManager +}); +module.exports = __toCommonJS(focusManager_exports); +var import_subscribable = require("./subscribable.cjs"); +var import_utils = require("./utils.cjs"); +var _focused, _cleanup, _setup; +var FocusManager = class extends import_subscribable.Subscribable { + constructor() { + super(); + __privateAdd(this, _focused); + __privateAdd(this, _cleanup); + __privateAdd(this, _setup); + __privateSet(this, _setup, (onFocus) => { + if (!import_utils.isServer && window.addEventListener) { + const listener = () => onFocus(); + window.addEventListener("visibilitychange", listener, false); + return () => { + window.removeEventListener("visibilitychange", listener); + }; + } + return; + }); + } + onSubscribe() { + if (!__privateGet(this, _cleanup)) { + this.setEventListener(__privateGet(this, _setup)); + } + } + onUnsubscribe() { + var _a; + if (!this.hasListeners()) { + (_a = __privateGet(this, _cleanup)) == null ? void 0 : _a.call(this); + __privateSet(this, _cleanup, void 0); + } + } + setEventListener(setup) { + var _a; + __privateSet(this, _setup, setup); + (_a = __privateGet(this, _cleanup)) == null ? void 0 : _a.call(this); + __privateSet(this, _cleanup, setup((focused) => { + if (typeof focused === "boolean") { + this.setFocused(focused); + } else { + this.onFocus(); + } + })); + } + setFocused(focused) { + const changed = __privateGet(this, _focused) !== focused; + if (changed) { + __privateSet(this, _focused, focused); + this.onFocus(); + } + } + onFocus() { + const isFocused = this.isFocused(); + this.listeners.forEach((listener) => { + listener(isFocused); + }); + } + isFocused() { + var _a; + if (typeof __privateGet(this, _focused) === "boolean") { + return __privateGet(this, _focused); + } + return ((_a = globalThis.document) == null ? void 0 : _a.visibilityState) !== "hidden"; + } +}; +_focused = new WeakMap(); +_cleanup = new WeakMap(); +_setup = new WeakMap(); +var focusManager = new FocusManager(); +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + FocusManager, + focusManager +}); +//# sourceMappingURL=focusManager.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/focusManager.cjs.map b/node_modules/@tanstack/query-core/build/legacy/focusManager.cjs.map new file mode 100644 index 0000000..81db698 --- /dev/null +++ b/node_modules/@tanstack/query-core/build/legacy/focusManager.cjs.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/focusManager.ts"],"sourcesContent":["import { Subscribable } from './subscribable'\nimport { isServer } from './utils'\n\ntype Listener = (focused: boolean) => void\n\ntype SetupFn = (\n setFocused: (focused?: boolean) => void,\n) => (() => void) | undefined\n\nexport class FocusManager extends Subscribable {\n #focused?: boolean\n #cleanup?: () => void\n\n #setup: SetupFn\n\n constructor() {\n super()\n this.#setup = (onFocus) => {\n // addEventListener does not exist in React Native, but window does\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n if (!isServer && window.addEventListener) {\n const listener = () => onFocus()\n // Listen to visibilitychange\n window.addEventListener('visibilitychange', listener, false)\n\n return () => {\n // Be sure to unsubscribe if a new handler is set\n window.removeEventListener('visibilitychange', listener)\n }\n }\n return\n }\n }\n\n protected onSubscribe(): void {\n if (!this.#cleanup) {\n this.setEventListener(this.#setup)\n }\n }\n\n protected onUnsubscribe() {\n if (!this.hasListeners()) {\n this.#cleanup?.()\n this.#cleanup = undefined\n }\n }\n\n setEventListener(setup: SetupFn): void {\n this.#setup = setup\n this.#cleanup?.()\n this.#cleanup = setup((focused) => {\n if (typeof focused === 'boolean') {\n this.setFocused(focused)\n } else {\n this.onFocus()\n }\n })\n }\n\n setFocused(focused?: boolean): void {\n const changed = this.#focused !== focused\n if (changed) {\n this.#focused = focused\n this.onFocus()\n }\n }\n\n onFocus(): void {\n const isFocused = this.isFocused()\n this.listeners.forEach((listener) => {\n listener(isFocused)\n })\n }\n\n isFocused(): boolean {\n if (typeof this.#focused === 'boolean') {\n return this.#focused\n }\n\n // document global can be unavailable in react native\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n return globalThis.document?.visibilityState !== 'hidden'\n }\n}\n\nexport const focusManager = new FocusManager()\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,0BAA6B;AAC7B,mBAAyB;AADzB;AASO,IAAM,eAAN,cAA2B,iCAAuB;AAAA,EAMvD,cAAc;AACZ,UAAM;AANR;AACA;AAEA;AAIE,uBAAK,QAAS,CAAC,YAAY;AAGzB,UAAI,CAAC,yBAAY,OAAO,kBAAkB;AACxC,cAAM,WAAW,MAAM,QAAQ;AAE/B,eAAO,iBAAiB,oBAAoB,UAAU,KAAK;AAE3D,eAAO,MAAM;AAEX,iBAAO,oBAAoB,oBAAoB,QAAQ;AAAA,QACzD;AAAA,MACF;AACA;AAAA,IACF;AAAA,EACF;AAAA,EAEU,cAAoB;AAC5B,QAAI,CAAC,mBAAK,WAAU;AAClB,WAAK,iBAAiB,mBAAK,OAAM;AAAA,IACnC;AAAA,EACF;AAAA,EAEU,gBAAgB;AAxC5B;AAyCI,QAAI,CAAC,KAAK,aAAa,GAAG;AACxB,+BAAK,cAAL;AACA,yBAAK,UAAW;AAAA,IAClB;AAAA,EACF;AAAA,EAEA,iBAAiB,OAAsB;AA/CzC;AAgDI,uBAAK,QAAS;AACd,6BAAK,cAAL;AACA,uBAAK,UAAW,MAAM,CAAC,YAAY;AACjC,UAAI,OAAO,YAAY,WAAW;AAChC,aAAK,WAAW,OAAO;AAAA,MACzB,OAAO;AACL,aAAK,QAAQ;AAAA,MACf;AAAA,IACF,CAAC;AAAA,EACH;AAAA,EAEA,WAAW,SAAyB;AAClC,UAAM,UAAU,mBAAK,cAAa;AAClC,QAAI,SAAS;AACX,yBAAK,UAAW;AAChB,WAAK,QAAQ;AAAA,IACf;AAAA,EACF;AAAA,EAEA,UAAgB;AACd,UAAM,YAAY,KAAK,UAAU;AACjC,SAAK,UAAU,QAAQ,CAAC,aAAa;AACnC,eAAS,SAAS;AAAA,IACpB,CAAC;AAAA,EACH;AAAA,EAEA,YAAqB;AA1EvB;AA2EI,QAAI,OAAO,mBAAK,cAAa,WAAW;AACtC,aAAO,mBAAK;AAAA,IACd;AAIA,aAAO,gBAAW,aAAX,mBAAqB,qBAAoB;AAAA,EAClD;AACF;AAzEE;AACA;AAEA;AAwEK,IAAM,eAAe,IAAI,aAAa;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/focusManager.d.cts b/node_modules/@tanstack/query-core/build/legacy/focusManager.d.cts new file mode 100644 index 0000000..c0f57ac --- /dev/null +++ b/node_modules/@tanstack/query-core/build/legacy/focusManager.d.cts @@ -0,0 +1,17 @@ +import { Subscribable } from './subscribable.cjs'; + +type Listener = (focused: boolean) => void; +type SetupFn = (setFocused: (focused?: boolean) => void) => (() => void) | undefined; +declare class FocusManager extends Subscribable { + #private; + constructor(); + protected onSubscribe(): void; + protected onUnsubscribe(): void; + setEventListener(setup: SetupFn): void; + setFocused(focused?: boolean): void; + onFocus(): void; + isFocused(): boolean; +} +declare const focusManager: FocusManager; + +export { FocusManager, focusManager }; diff --git a/node_modules/@tanstack/query-core/build/legacy/focusManager.d.ts b/node_modules/@tanstack/query-core/build/legacy/focusManager.d.ts new file mode 100644 index 0000000..da33a8b --- /dev/null +++ b/node_modules/@tanstack/query-core/build/legacy/focusManager.d.ts @@ -0,0 +1,17 @@ +import { Subscribable } from './subscribable.js'; + +type Listener = (focused: boolean) => void; +type SetupFn = (setFocused: (focused?: boolean) => void) => (() => void) | undefined; +declare class FocusManager extends Subscribable { + #private; + constructor(); + protected onSubscribe(): void; + protected onUnsubscribe(): void; + setEventListener(setup: SetupFn): void; + setFocused(focused?: boolean): void; + onFocus(): void; + isFocused(): boolean; +} +declare const focusManager: FocusManager; + +export { FocusManager, focusManager }; diff --git a/node_modules/@tanstack/query-core/build/legacy/focusManager.js b/node_modules/@tanstack/query-core/build/legacy/focusManager.js new file mode 100644 index 0000000..515ffbe --- /dev/null +++ b/node_modules/@tanstack/query-core/build/legacy/focusManager.js @@ -0,0 +1,81 @@ +import { + __privateAdd, + __privateGet, + __privateSet +} from "./chunk-PXG64RU4.js"; + +// src/focusManager.ts +import { Subscribable } from "./subscribable.js"; +import { isServer } from "./utils.js"; +var _focused, _cleanup, _setup; +var FocusManager = class extends Subscribable { + constructor() { + super(); + __privateAdd(this, _focused); + __privateAdd(this, _cleanup); + __privateAdd(this, _setup); + __privateSet(this, _setup, (onFocus) => { + if (!isServer && window.addEventListener) { + const listener = () => onFocus(); + window.addEventListener("visibilitychange", listener, false); + return () => { + window.removeEventListener("visibilitychange", listener); + }; + } + return; + }); + } + onSubscribe() { + if (!__privateGet(this, _cleanup)) { + this.setEventListener(__privateGet(this, _setup)); + } + } + onUnsubscribe() { + var _a; + if (!this.hasListeners()) { + (_a = __privateGet(this, _cleanup)) == null ? void 0 : _a.call(this); + __privateSet(this, _cleanup, void 0); + } + } + setEventListener(setup) { + var _a; + __privateSet(this, _setup, setup); + (_a = __privateGet(this, _cleanup)) == null ? void 0 : _a.call(this); + __privateSet(this, _cleanup, setup((focused) => { + if (typeof focused === "boolean") { + this.setFocused(focused); + } else { + this.onFocus(); + } + })); + } + setFocused(focused) { + const changed = __privateGet(this, _focused) !== focused; + if (changed) { + __privateSet(this, _focused, focused); + this.onFocus(); + } + } + onFocus() { + const isFocused = this.isFocused(); + this.listeners.forEach((listener) => { + listener(isFocused); + }); + } + isFocused() { + var _a; + if (typeof __privateGet(this, _focused) === "boolean") { + return __privateGet(this, _focused); + } + return ((_a = globalThis.document) == null ? void 0 : _a.visibilityState) !== "hidden"; + } +}; +_focused = new WeakMap(); +_cleanup = new WeakMap(); +_setup = new WeakMap(); +var focusManager = new FocusManager(); +export { + FocusManager, + focusManager +}; +//# sourceMappingURL=focusManager.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/focusManager.js.map b/node_modules/@tanstack/query-core/build/legacy/focusManager.js.map new file mode 100644 index 0000000..9de77ce --- /dev/null +++ b/node_modules/@tanstack/query-core/build/legacy/focusManager.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/focusManager.ts"],"sourcesContent":["import { Subscribable } from './subscribable'\nimport { isServer } from './utils'\n\ntype Listener = (focused: boolean) => void\n\ntype SetupFn = (\n setFocused: (focused?: boolean) => void,\n) => (() => void) | undefined\n\nexport class FocusManager extends Subscribable {\n #focused?: boolean\n #cleanup?: () => void\n\n #setup: SetupFn\n\n constructor() {\n super()\n this.#setup = (onFocus) => {\n // addEventListener does not exist in React Native, but window does\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n if (!isServer && window.addEventListener) {\n const listener = () => onFocus()\n // Listen to visibilitychange\n window.addEventListener('visibilitychange', listener, false)\n\n return () => {\n // Be sure to unsubscribe if a new handler is set\n window.removeEventListener('visibilitychange', listener)\n }\n }\n return\n }\n }\n\n protected onSubscribe(): void {\n if (!this.#cleanup) {\n this.setEventListener(this.#setup)\n }\n }\n\n protected onUnsubscribe() {\n if (!this.hasListeners()) {\n this.#cleanup?.()\n this.#cleanup = undefined\n }\n }\n\n setEventListener(setup: SetupFn): void {\n this.#setup = setup\n this.#cleanup?.()\n this.#cleanup = setup((focused) => {\n if (typeof focused === 'boolean') {\n this.setFocused(focused)\n } else {\n this.onFocus()\n }\n })\n }\n\n setFocused(focused?: boolean): void {\n const changed = this.#focused !== focused\n if (changed) {\n this.#focused = focused\n this.onFocus()\n }\n }\n\n onFocus(): void {\n const isFocused = this.isFocused()\n this.listeners.forEach((listener) => {\n listener(isFocused)\n })\n }\n\n isFocused(): boolean {\n if (typeof this.#focused === 'boolean') {\n return this.#focused\n }\n\n // document global can be unavailable in react native\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n return globalThis.document?.visibilityState !== 'hidden'\n }\n}\n\nexport const focusManager = new FocusManager()\n"],"mappings":";;;;;;;AAAA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,mBAAqB,qBAAoB;AAAA,EAClD;AACF;AAzEE;AACA;AAEA;AAwEK,IAAM,eAAe,IAAI,aAAa;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/hydration-BlEVG2Lp.d.ts b/node_modules/@tanstack/query-core/build/legacy/hydration-BlEVG2Lp.d.ts new file mode 100644 index 0000000..8d5a8e3 --- /dev/null +++ b/node_modules/@tanstack/query-core/build/legacy/hydration-BlEVG2Lp.d.ts @@ -0,0 +1,1384 @@ +import { Removable } from './removable.js'; +import { Subscribable } from './subscribable.js'; + +type QueryObserverListener = (result: QueryObserverResult) => void; +interface ObserverFetchOptions extends FetchOptions { + throwOnError?: boolean; +} +declare class QueryObserver extends Subscribable> { + #private; + options: QueryObserverOptions; + constructor(client: QueryClient, options: QueryObserverOptions); + protected bindMethods(): void; + protected onSubscribe(): void; + protected onUnsubscribe(): void; + shouldFetchOnReconnect(): boolean; + shouldFetchOnWindowFocus(): boolean; + destroy(): void; + setOptions(options: QueryObserverOptions): void; + getOptimisticResult(options: DefaultedQueryObserverOptions): QueryObserverResult; + getCurrentResult(): QueryObserverResult; + trackResult(result: QueryObserverResult, onPropTracked?: (key: keyof QueryObserverResult) => void): QueryObserverResult; + trackProp(key: keyof QueryObserverResult): void; + getCurrentQuery(): Query; + refetch({ ...options }?: RefetchOptions): Promise>; + fetchOptimistic(options: QueryObserverOptions): Promise>; + protected fetch(fetchOptions: ObserverFetchOptions): Promise>; + protected createResult(query: Query, options: QueryObserverOptions): QueryObserverResult; + updateResult(): void; + onQueryUpdate(): void; +} + +interface QueryConfig { + client: QueryClient; + queryKey: TQueryKey; + queryHash: string; + options?: QueryOptions; + defaultOptions?: QueryOptions; + state?: QueryState; +} +interface QueryState { + data: TData | undefined; + dataUpdateCount: number; + dataUpdatedAt: number; + error: TError | null; + errorUpdateCount: number; + errorUpdatedAt: number; + fetchFailureCount: number; + fetchFailureReason: TError | null; + fetchMeta: FetchMeta | null; + isInvalidated: boolean; + status: QueryStatus; + fetchStatus: FetchStatus; +} +interface FetchContext { + fetchFn: () => unknown | Promise; + fetchOptions?: FetchOptions; + signal: AbortSignal; + options: QueryOptions; + client: QueryClient; + queryKey: TQueryKey; + state: QueryState; +} +interface QueryBehavior { + onFetch: (context: FetchContext, query: Query) => void; +} +type FetchDirection = 'forward' | 'backward'; +interface FetchMeta { + fetchMore?: { + direction: FetchDirection; + }; +} +interface FetchOptions { + cancelRefetch?: boolean; + meta?: FetchMeta; + initialPromise?: Promise; +} +interface FailedAction$1 { + type: 'failed'; + failureCount: number; + error: TError; +} +interface FetchAction { + type: 'fetch'; + meta?: FetchMeta; +} +interface SuccessAction$1 { + data: TData | undefined; + type: 'success'; + dataUpdatedAt?: number; + manual?: boolean; +} +interface ErrorAction$1 { + type: 'error'; + error: TError; +} +interface InvalidateAction { + type: 'invalidate'; +} +interface PauseAction$1 { + type: 'pause'; +} +interface ContinueAction$1 { + type: 'continue'; +} +interface SetStateAction { + type: 'setState'; + state: Partial>; + setStateOptions?: SetStateOptions; +} +type Action$1 = ContinueAction$1 | ErrorAction$1 | FailedAction$1 | FetchAction | InvalidateAction | PauseAction$1 | SetStateAction | SuccessAction$1; +interface SetStateOptions { + meta?: any; +} +declare class Query extends Removable { + #private; + queryKey: TQueryKey; + queryHash: string; + options: QueryOptions; + state: QueryState; + observers: Array>; + constructor(config: QueryConfig); + get meta(): QueryMeta | undefined; + get promise(): Promise | undefined; + setOptions(options?: QueryOptions): void; + protected optionalRemove(): void; + setData(newData: TData, options?: SetDataOptions & { + manual: boolean; + }): TData; + setState(state: Partial>, setStateOptions?: SetStateOptions): void; + cancel(options?: CancelOptions): Promise; + destroy(): void; + reset(): void; + isActive(): boolean; + isDisabled(): boolean; + isStatic(): boolean; + isStale(): boolean; + isStaleByTime(staleTime?: StaleTime): boolean; + onFocus(): void; + onOnline(): void; + addObserver(observer: QueryObserver): void; + removeObserver(observer: QueryObserver): void; + getObserversCount(): number; + invalidate(): void; + fetch(options?: QueryOptions, fetchOptions?: FetchOptions): Promise; +} +declare function fetchState(data: TData | undefined, options: QueryOptions): { + readonly error?: null | undefined; + readonly status?: "pending" | undefined; + readonly fetchFailureCount: 0; + readonly fetchFailureReason: null; + readonly fetchStatus: "fetching" | "paused"; +}; + +type MutationObserverListener = (result: MutationObserverResult) => void; +declare class MutationObserver extends Subscribable> { + #private; + options: MutationObserverOptions; + constructor(client: QueryClient, options: MutationObserverOptions); + protected bindMethods(): void; + setOptions(options: MutationObserverOptions): void; + protected onUnsubscribe(): void; + onMutationUpdate(action: Action): void; + getCurrentResult(): MutationObserverResult; + reset(): void; + mutate(variables: TVariables, options?: MutateOptions): Promise; +} + +interface MutationCacheConfig { + onError?: (error: DefaultError, variables: unknown, onMutateResult: unknown, mutation: Mutation, context: MutationFunctionContext) => Promise | unknown; + onSuccess?: (data: unknown, variables: unknown, onMutateResult: unknown, mutation: Mutation, context: MutationFunctionContext) => Promise | unknown; + onMutate?: (variables: unknown, mutation: Mutation, context: MutationFunctionContext) => Promise | unknown; + onSettled?: (data: unknown | undefined, error: DefaultError | null, variables: unknown, onMutateResult: unknown, mutation: Mutation, context: MutationFunctionContext) => Promise | unknown; +} +interface NotifyEventMutationAdded extends NotifyEvent { + type: 'added'; + mutation: Mutation; +} +interface NotifyEventMutationRemoved extends NotifyEvent { + type: 'removed'; + mutation: Mutation; +} +interface NotifyEventMutationObserverAdded extends NotifyEvent { + type: 'observerAdded'; + mutation: Mutation; + observer: MutationObserver; +} +interface NotifyEventMutationObserverRemoved extends NotifyEvent { + type: 'observerRemoved'; + mutation: Mutation; + observer: MutationObserver; +} +interface NotifyEventMutationObserverOptionsUpdated extends NotifyEvent { + type: 'observerOptionsUpdated'; + mutation?: Mutation; + observer: MutationObserver; +} +interface NotifyEventMutationUpdated extends NotifyEvent { + type: 'updated'; + mutation: Mutation; + action: Action; +} +type MutationCacheNotifyEvent = NotifyEventMutationAdded | NotifyEventMutationRemoved | NotifyEventMutationObserverAdded | NotifyEventMutationObserverRemoved | NotifyEventMutationObserverOptionsUpdated | NotifyEventMutationUpdated; +type MutationCacheListener = (event: MutationCacheNotifyEvent) => void; +declare class MutationCache extends Subscribable { + #private; + config: MutationCacheConfig; + constructor(config?: MutationCacheConfig); + build(client: QueryClient, options: MutationOptions, state?: MutationState): Mutation; + add(mutation: Mutation): void; + remove(mutation: Mutation): void; + canRun(mutation: Mutation): boolean; + runNext(mutation: Mutation): Promise; + clear(): void; + getAll(): Array; + find(filters: MutationFilters): Mutation | undefined; + findAll(filters?: MutationFilters): Array; + notify(event: MutationCacheNotifyEvent): void; + resumePausedMutations(): Promise; +} + +interface MutationConfig { + client: QueryClient; + mutationId: number; + mutationCache: MutationCache; + options: MutationOptions; + state?: MutationState; +} +interface MutationState { + context: TOnMutateResult | undefined; + data: TData | undefined; + error: TError | null; + failureCount: number; + failureReason: TError | null; + isPaused: boolean; + status: MutationStatus; + variables: TVariables | undefined; + submittedAt: number; +} +interface FailedAction { + type: 'failed'; + failureCount: number; + error: TError | null; +} +interface PendingAction { + type: 'pending'; + isPaused: boolean; + variables?: TVariables; + context?: TOnMutateResult; +} +interface SuccessAction { + type: 'success'; + data: TData; +} +interface ErrorAction { + type: 'error'; + error: TError; +} +interface PauseAction { + type: 'pause'; +} +interface ContinueAction { + type: 'continue'; +} +type Action = ContinueAction | ErrorAction | FailedAction | PendingAction | PauseAction | SuccessAction; +declare class Mutation extends Removable { + #private; + state: MutationState; + options: MutationOptions; + readonly mutationId: number; + constructor(config: MutationConfig); + setOptions(options: MutationOptions): void; + get meta(): MutationMeta | undefined; + addObserver(observer: MutationObserver): void; + removeObserver(observer: MutationObserver): void; + protected optionalRemove(): void; + continue(): Promise; + execute(variables: TVariables): Promise; +} +declare function getDefaultState(): MutationState; + +type DropLast> = T extends readonly [ + ...infer R, + unknown +] ? readonly [...R] : never; +type TuplePrefixes> = T extends readonly [] ? readonly [] : TuplePrefixes> | T; +interface QueryFilters { + /** + * Filter to active queries, inactive queries or all queries + */ + type?: QueryTypeFilter; + /** + * Match query key exactly + */ + exact?: boolean; + /** + * Include queries matching this predicate function + */ + predicate?: (query: Query) => boolean; + /** + * Include queries matching this query key + */ + queryKey?: TQueryKey | TuplePrefixes; + /** + * Include or exclude stale queries + */ + stale?: boolean; + /** + * Include queries matching their fetchStatus + */ + fetchStatus?: FetchStatus; +} +interface MutationFilters { + /** + * Match mutation key exactly + */ + exact?: boolean; + /** + * Include mutations matching this predicate function + */ + predicate?: (mutation: Mutation) => boolean; + /** + * Include mutations matching this mutation key + */ + mutationKey?: TuplePrefixes; + /** + * Filter by mutation status + */ + status?: MutationStatus; +} +type Updater = TOutput | ((input: TInput) => TOutput); +type QueryTypeFilter = 'all' | 'active' | 'inactive'; +declare const isServer: boolean; +declare function noop(): void; +declare function noop(): undefined; +declare function functionalUpdate(updater: Updater, input: TInput): TOutput; +declare function isValidTimeout(value: unknown): value is number; +declare function timeUntilStale(updatedAt: number, staleTime?: number): number; +declare function resolveStaleTime(staleTime: undefined | StaleTimeFunction, query: Query): StaleTime | undefined; +declare function resolveEnabled(enabled: undefined | Enabled, query: Query): boolean | undefined; +declare function matchQuery(filters: QueryFilters, query: Query): boolean; +declare function matchMutation(filters: MutationFilters, mutation: Mutation): boolean; +declare function hashQueryKeyByOptions(queryKey: TQueryKey, options?: Pick, 'queryKeyHashFn'>): string; +/** + * Default query & mutation keys hash function. + * Hashes the value into a stable hash. + */ +declare function hashKey(queryKey: QueryKey | MutationKey): string; +/** + * Checks if key `b` partially matches with key `a`. + */ +declare function partialMatchKey(a: QueryKey, b: QueryKey): boolean; +/** + * This function returns `a` if `b` is deeply equal. + * If not, it will replace any deeply equal children of `b` with those of `a`. + * This can be used for structural sharing between JSON values for example. + */ +declare function replaceEqualDeep(a: unknown, b: T, depth?: number): T; +/** + * Shallow compare objects. + */ +declare function shallowEqualObjects>(a: T, b: T | undefined): boolean; +declare function isPlainArray(value: unknown): value is Array; +declare function isPlainObject(o: any): o is Record; +declare function sleep(timeout: number): Promise; +declare function replaceData>(prevData: TData | undefined, data: TData, options: TOptions): TData; +declare function keepPreviousData(previousData: T | undefined): T | undefined; +declare function addToEnd(items: Array, item: T, max?: number): Array; +declare function addToStart(items: Array, item: T, max?: number): Array; +declare const skipToken: unique symbol; +type SkipToken = typeof skipToken; +declare function ensureQueryFn(options: { + queryFn?: QueryFunction | SkipToken; + queryHash?: string; +}, fetchOptions?: FetchOptions): QueryFunction; +declare function shouldThrowError) => boolean>(throwOnError: boolean | T | undefined, params: Parameters): boolean; +declare function addConsumeAwareSignal(object: T, getSignal: () => AbortSignal, onCancelled: VoidFunction): T & { + signal: AbortSignal; +}; + +interface QueryCacheConfig { + onError?: (error: DefaultError, query: Query) => void; + onSuccess?: (data: unknown, query: Query) => void; + onSettled?: (data: unknown | undefined, error: DefaultError | null, query: Query) => void; +} +interface NotifyEventQueryAdded extends NotifyEvent { + type: 'added'; + query: Query; +} +interface NotifyEventQueryRemoved extends NotifyEvent { + type: 'removed'; + query: Query; +} +interface NotifyEventQueryUpdated extends NotifyEvent { + type: 'updated'; + query: Query; + action: Action$1; +} +interface NotifyEventQueryObserverAdded extends NotifyEvent { + type: 'observerAdded'; + query: Query; + observer: QueryObserver; +} +interface NotifyEventQueryObserverRemoved extends NotifyEvent { + type: 'observerRemoved'; + query: Query; + observer: QueryObserver; +} +interface NotifyEventQueryObserverResultsUpdated extends NotifyEvent { + type: 'observerResultsUpdated'; + query: Query; +} +interface NotifyEventQueryObserverOptionsUpdated extends NotifyEvent { + type: 'observerOptionsUpdated'; + query: Query; + observer: QueryObserver; +} +type QueryCacheNotifyEvent = NotifyEventQueryAdded | NotifyEventQueryRemoved | NotifyEventQueryUpdated | NotifyEventQueryObserverAdded | NotifyEventQueryObserverRemoved | NotifyEventQueryObserverResultsUpdated | NotifyEventQueryObserverOptionsUpdated; +type QueryCacheListener = (event: QueryCacheNotifyEvent) => void; +interface QueryStore { + has: (queryHash: string) => boolean; + set: (queryHash: string, query: Query) => void; + get: (queryHash: string) => Query | undefined; + delete: (queryHash: string) => void; + values: () => IterableIterator; +} +declare class QueryCache extends Subscribable { + #private; + config: QueryCacheConfig; + constructor(config?: QueryCacheConfig); + build(client: QueryClient, options: WithRequired, 'queryKey'>, state?: QueryState): Query; + add(query: Query): void; + remove(query: Query): void; + clear(): void; + get(queryHash: string): Query | undefined; + getAll(): Array; + find(filters: WithRequired): Query | undefined; + findAll(filters?: QueryFilters): Array; + notify(event: QueryCacheNotifyEvent): void; + onFocus(): void; + onOnline(): void; +} + +declare class QueryClient { + #private; + constructor(config?: QueryClientConfig); + mount(): void; + unmount(): void; + isFetching = QueryFilters>(filters?: TQueryFilters): number; + isMutating = MutationFilters>(filters?: TMutationFilters): number; + /** + * Imperative (non-reactive) way to retrieve data for a QueryKey. + * Should only be used in callbacks or functions where reading the latest data is necessary, e.g. for optimistic updates. + * + * Hint: Do not use this function inside a component, because it won't receive updates. + * Use `useQuery` to create a `QueryObserver` that subscribes to changes. + */ + getQueryData>(queryKey: TTaggedQueryKey): TInferredQueryFnData | undefined; + ensureQueryData(options: EnsureQueryDataOptions): Promise; + getQueriesData = QueryFilters>(filters: TQueryFilters): Array<[QueryKey, TQueryFnData | undefined]>; + setQueryData>(queryKey: TTaggedQueryKey, updater: Updater | undefined, NoInfer | undefined>, options?: SetDataOptions): NoInfer | undefined; + setQueriesData = QueryFilters>(filters: TQueryFilters, updater: Updater | undefined, NoInfer | undefined>, options?: SetDataOptions): Array<[QueryKey, TQueryFnData | undefined]>; + getQueryState, TInferredError = InferErrorFromTag>(queryKey: TTaggedQueryKey): QueryState | undefined; + removeQueries(filters?: QueryFilters): void; + resetQueries(filters?: QueryFilters, options?: ResetOptions): Promise; + cancelQueries(filters?: QueryFilters, cancelOptions?: CancelOptions): Promise; + invalidateQueries(filters?: InvalidateQueryFilters, options?: InvalidateOptions): Promise; + refetchQueries(filters?: RefetchQueryFilters, options?: RefetchOptions): Promise; + fetchQuery(options: FetchQueryOptions): Promise; + prefetchQuery(options: FetchQueryOptions): Promise; + fetchInfiniteQuery(options: FetchInfiniteQueryOptions): Promise>; + prefetchInfiniteQuery(options: FetchInfiniteQueryOptions): Promise; + ensureInfiniteQueryData(options: EnsureInfiniteQueryDataOptions): Promise>; + resumePausedMutations(): Promise; + getQueryCache(): QueryCache; + getMutationCache(): MutationCache; + getDefaultOptions(): DefaultOptions; + setDefaultOptions(options: DefaultOptions): void; + setQueryDefaults(queryKey: QueryKey, options: Partial, 'queryKey'>>): void; + getQueryDefaults(queryKey: QueryKey): OmitKeyof, 'queryKey'>; + setMutationDefaults(mutationKey: MutationKey, options: OmitKeyof, 'mutationKey'>): void; + getMutationDefaults(mutationKey: MutationKey): OmitKeyof, 'mutationKey'>; + defaultQueryOptions(options: QueryObserverOptions | DefaultedQueryObserverOptions): DefaultedQueryObserverOptions; + defaultMutationOptions>(options?: T): T; + clear(): void; +} + +interface RetryerConfig { + fn: () => TData | Promise; + initialPromise?: Promise; + onCancel?: (error: TError) => void; + onFail?: (failureCount: number, error: TError) => void; + onPause?: () => void; + onContinue?: () => void; + retry?: RetryValue; + retryDelay?: RetryDelayValue; + networkMode: NetworkMode | undefined; + canRun: () => boolean; +} +interface Retryer { + promise: Promise; + cancel: (cancelOptions?: CancelOptions) => void; + continue: () => Promise; + cancelRetry: () => void; + continueRetry: () => void; + canStart: () => boolean; + start: () => Promise; + status: () => 'pending' | 'resolved' | 'rejected'; +} +type RetryValue = boolean | number | ShouldRetryFunction; +type ShouldRetryFunction = (failureCount: number, error: TError) => boolean; +type RetryDelayValue = number | RetryDelayFunction; +type RetryDelayFunction = (failureCount: number, error: TError) => number; +declare function canFetch(networkMode: NetworkMode | undefined): boolean; +declare class CancelledError extends Error { + revert?: boolean; + silent?: boolean; + constructor(options?: CancelOptions); +} +/** + * @deprecated Use instanceof `CancelledError` instead. + */ +declare function isCancelledError(value: any): value is CancelledError; +declare function createRetryer(config: RetryerConfig): Retryer; + +type NonUndefinedGuard = T extends undefined ? never : T; +type DistributiveOmit = TObject extends any ? Omit : never; +type OmitKeyof) | (number & Record) | (symbol & Record) : keyof TObject, TStrictly extends 'strictly' | 'safely' = 'strictly'> = Omit; +type Override = { + [AKey in keyof TTargetA]: AKey extends keyof TTargetB ? TTargetB[AKey] : TTargetA[AKey]; +}; +type NoInfer = [T][T extends any ? 0 : never]; +interface Register { +} +type DefaultError = Register extends { + defaultError: infer TError; +} ? TError : Error; +type QueryKey = Register extends { + queryKey: infer TQueryKey; +} ? TQueryKey extends ReadonlyArray ? TQueryKey : TQueryKey extends Array ? TQueryKey : ReadonlyArray : ReadonlyArray; +declare const dataTagSymbol: unique symbol; +type dataTagSymbol = typeof dataTagSymbol; +declare const dataTagErrorSymbol: unique symbol; +type dataTagErrorSymbol = typeof dataTagErrorSymbol; +declare const unsetMarker: unique symbol; +type UnsetMarker = typeof unsetMarker; +type AnyDataTag = { + [dataTagSymbol]: any; + [dataTagErrorSymbol]: any; +}; +type DataTag = TType extends AnyDataTag ? TType : TType & { + [dataTagSymbol]: TValue; + [dataTagErrorSymbol]: TError; +}; +type InferDataFromTag = TTaggedQueryKey extends DataTag ? TaggedValue : TQueryFnData; +type InferErrorFromTag = TTaggedQueryKey extends DataTag ? TaggedError extends UnsetMarker ? TError : TaggedError : TError; +type QueryFunction = (context: QueryFunctionContext) => T | Promise; +type StaleTime = number | 'static'; +type StaleTimeFunction = StaleTime | ((query: Query) => StaleTime); +type Enabled = boolean | ((query: Query) => boolean); +type QueryPersister = [TPageParam] extends [never] ? (queryFn: QueryFunction, context: QueryFunctionContext, query: Query) => T | Promise : (queryFn: QueryFunction, context: QueryFunctionContext, query: Query) => T | Promise; +type QueryFunctionContext = [TPageParam] extends [never] ? { + client: QueryClient; + queryKey: TQueryKey; + signal: AbortSignal; + meta: QueryMeta | undefined; + pageParam?: unknown; + /** + * @deprecated + * if you want access to the direction, you can add it to the pageParam + */ + direction?: unknown; +} : { + client: QueryClient; + queryKey: TQueryKey; + signal: AbortSignal; + pageParam: TPageParam; + /** + * @deprecated + * if you want access to the direction, you can add it to the pageParam + */ + direction: FetchDirection; + meta: QueryMeta | undefined; +}; +type InitialDataFunction = () => T | undefined; +type NonFunctionGuard = T extends Function ? never : T; +type PlaceholderDataFunction = (previousData: TQueryData | undefined, previousQuery: Query | undefined) => TQueryData | undefined; +type QueriesPlaceholderDataFunction = (previousData: undefined, previousQuery: undefined) => TQueryData | undefined; +type QueryKeyHashFunction = (queryKey: TQueryKey) => string; +type GetPreviousPageParamFunction = (firstPage: TQueryFnData, allPages: Array, firstPageParam: TPageParam, allPageParams: Array) => TPageParam | undefined | null; +type GetNextPageParamFunction = (lastPage: TQueryFnData, allPages: Array, lastPageParam: TPageParam, allPageParams: Array) => TPageParam | undefined | null; +interface InfiniteData { + pages: Array; + pageParams: Array; +} +type QueryMeta = Register extends { + queryMeta: infer TQueryMeta; +} ? TQueryMeta extends Record ? TQueryMeta : Record : Record; +type NetworkMode = 'online' | 'always' | 'offlineFirst'; +type NotifyOnChangeProps = Array | 'all' | undefined | (() => Array | 'all' | undefined); +interface QueryOptions { + /** + * If `false`, failed queries will not retry by default. + * If `true`, failed queries will retry infinitely., failureCount: num + * If set to an integer number, e.g. 3, failed queries will retry until the failed query count meets that number. + * If set to a function `(failureCount, error) => boolean` failed queries will retry until the function returns false. + */ + retry?: RetryValue; + retryDelay?: RetryDelayValue; + networkMode?: NetworkMode; + /** + * The time in milliseconds that unused/inactive cache data remains in memory. + * When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration. + * When different garbage collection times are specified, the longest one will be used. + * Setting it to `Infinity` will disable garbage collection. + */ + gcTime?: number; + queryFn?: QueryFunction | SkipToken; + persister?: QueryPersister, NoInfer, NoInfer>; + queryHash?: string; + queryKey?: TQueryKey; + queryKeyHashFn?: QueryKeyHashFunction; + initialData?: TData | InitialDataFunction; + initialDataUpdatedAt?: number | (() => number | undefined); + behavior?: QueryBehavior; + /** + * Set this to `false` to disable structural sharing between query results. + * Set this to a function which accepts the old and new data and returns resolved data of the same type to implement custom structural sharing logic. + * Defaults to `true`. + */ + structuralSharing?: boolean | ((oldData: unknown | undefined, newData: unknown) => unknown); + _defaulted?: boolean; + /** + * Additional payload to be stored on each query. + * Use this property to pass information that can be used in other places. + */ + meta?: QueryMeta; + /** + * Maximum number of pages to store in the data of an infinite query. + */ + maxPages?: number; +} +interface InitialPageParam { + initialPageParam: TPageParam; +} +interface InfiniteQueryPageParamsOptions extends InitialPageParam { + /** + * This function can be set to automatically get the previous cursor for infinite queries. + * The result will also be used to determine the value of `hasPreviousPage`. + */ + getPreviousPageParam?: GetPreviousPageParamFunction; + /** + * This function can be set to automatically get the next cursor for infinite queries. + * The result will also be used to determine the value of `hasNextPage`. + */ + getNextPageParam: GetNextPageParamFunction; +} +type ThrowOnError = boolean | ((error: TError, query: Query) => boolean); +interface QueryObserverOptions extends WithRequired, 'queryKey'> { + /** + * Set this to `false` or a function that returns `false` to disable automatic refetching when the query mounts or changes query keys. + * To refetch the query, use the `refetch` method returned from the `useQuery` instance. + * Accepts a boolean or function that returns a boolean. + * Defaults to `true`. + */ + enabled?: Enabled; + /** + * The time in milliseconds after data is considered stale. + * If set to `Infinity`, the data will never be considered stale. + * If set to a function, the function will be executed with the query to compute a `staleTime`. + * Defaults to `0`. + */ + staleTime?: StaleTimeFunction; + /** + * If set to a number, the query will continuously refetch at this frequency in milliseconds. + * If set to a function, the function will be executed with the latest data and query to compute a frequency + * Defaults to `false`. + */ + refetchInterval?: number | false | ((query: Query) => number | false | undefined); + /** + * If set to `true`, the query will continue to refetch while their tab/window is in the background. + * Defaults to `false`. + */ + refetchIntervalInBackground?: boolean; + /** + * If set to `true`, the query will refetch on window focus if the data is stale. + * If set to `false`, the query will not refetch on window focus. + * If set to `'always'`, the query will always refetch on window focus. + * If set to a function, the function will be executed with the latest data and query to compute the value. + * Defaults to `true`. + */ + refetchOnWindowFocus?: boolean | 'always' | ((query: Query) => boolean | 'always'); + /** + * If set to `true`, the query will refetch on reconnect if the data is stale. + * If set to `false`, the query will not refetch on reconnect. + * If set to `'always'`, the query will always refetch on reconnect. + * If set to a function, the function will be executed with the latest data and query to compute the value. + * Defaults to the value of `networkOnline` (`true`) + */ + refetchOnReconnect?: boolean | 'always' | ((query: Query) => boolean | 'always'); + /** + * If set to `true`, the query will refetch on mount if the data is stale. + * If set to `false`, will disable additional instances of a query to trigger background refetch. + * If set to `'always'`, the query will always refetch on mount. + * If set to a function, the function will be executed with the latest data and query to compute the value + * Defaults to `true`. + */ + refetchOnMount?: boolean | 'always' | ((query: Query) => boolean | 'always'); + /** + * If set to `false`, the query will not be retried on mount if it contains an error. + * Defaults to `true`. + */ + retryOnMount?: boolean; + /** + * If set, the component will only re-render if any of the listed properties change. + * When set to `['data', 'error']`, the component will only re-render when the `data` or `error` properties change. + * When set to `'all'`, the component will re-render whenever a query is updated. + * When set to a function, the function will be executed to compute the list of properties. + * By default, access to properties will be tracked, and the component will only re-render when one of the tracked properties change. + */ + notifyOnChangeProps?: NotifyOnChangeProps; + /** + * Whether errors should be thrown instead of setting the `error` property. + * If set to `true` or `suspense` is `true`, all errors will be thrown to the error boundary. + * If set to `false` and `suspense` is `false`, errors are returned as state. + * If set to a function, it will be passed the error and the query, and it should return a boolean indicating whether to show the error in an error boundary (`true`) or return the error as state (`false`). + * Defaults to `false`. + */ + throwOnError?: ThrowOnError; + /** + * This option can be used to transform or select a part of the data returned by the query function. + */ + select?: (data: TQueryData) => TData; + /** + * If set to `true`, the query will suspend when `status === 'pending'` + * and throw errors when `status === 'error'`. + * Defaults to `false`. + */ + suspense?: boolean; + /** + * If set, this value will be used as the placeholder data for this particular query observer while the query is still in the `loading` data and no initialData has been provided. + */ + placeholderData?: NonFunctionGuard | PlaceholderDataFunction, TError, NonFunctionGuard, TQueryKey>; + _optimisticResults?: 'optimistic' | 'isRestoring'; + /** + * Enable prefetching during rendering + */ + experimental_prefetchInRender?: boolean; +} +type WithRequired = TTarget & { + [_ in TKey]: {}; +}; +type DefaultedQueryObserverOptions = WithRequired, 'throwOnError' | 'refetchOnReconnect' | 'queryHash'>; +interface InfiniteQueryObserverOptions extends QueryObserverOptions, TQueryKey, TPageParam>, InfiniteQueryPageParamsOptions { +} +type DefaultedInfiniteQueryObserverOptions = WithRequired, 'throwOnError' | 'refetchOnReconnect' | 'queryHash'>; +interface FetchQueryOptions extends WithRequired, 'queryKey'> { + initialPageParam?: never; + /** + * The time in milliseconds after data is considered stale. + * If the data is fresh it will be returned from the cache. + */ + staleTime?: StaleTimeFunction; +} +interface EnsureQueryDataOptions extends FetchQueryOptions { + revalidateIfStale?: boolean; +} +type EnsureInfiniteQueryDataOptions = FetchInfiniteQueryOptions & { + revalidateIfStale?: boolean; +}; +type FetchInfiniteQueryPages = { + pages?: never; +} | { + pages: number; + getNextPageParam: GetNextPageParamFunction; +}; +type FetchInfiniteQueryOptions = Omit, TQueryKey, TPageParam>, 'initialPageParam'> & InitialPageParam & FetchInfiniteQueryPages; +interface ResultOptions { + throwOnError?: boolean; +} +interface RefetchOptions extends ResultOptions { + /** + * If set to `true`, a currently running request will be cancelled before a new request is made + * + * If set to `false`, no refetch will be made if there is already a request running. + * + * Defaults to `true`. + */ + cancelRefetch?: boolean; +} +interface InvalidateQueryFilters extends QueryFilters { + refetchType?: QueryTypeFilter | 'none'; +} +interface RefetchQueryFilters extends QueryFilters { +} +interface InvalidateOptions extends RefetchOptions { +} +interface ResetOptions extends RefetchOptions { +} +interface FetchNextPageOptions extends ResultOptions { + /** + * If set to `true`, calling `fetchNextPage` repeatedly will invoke `queryFn` every time, + * whether the previous invocation has resolved or not. Also, the result from previous invocations will be ignored. + * + * If set to `false`, calling `fetchNextPage` repeatedly won't have any effect until the first invocation has resolved. + * + * Defaults to `true`. + */ + cancelRefetch?: boolean; +} +interface FetchPreviousPageOptions extends ResultOptions { + /** + * If set to `true`, calling `fetchPreviousPage` repeatedly will invoke `queryFn` every time, + * whether the previous invocation has resolved or not. Also, the result from previous invocations will be ignored. + * + * If set to `false`, calling `fetchPreviousPage` repeatedly won't have any effect until the first invocation has resolved. + * + * Defaults to `true`. + */ + cancelRefetch?: boolean; +} +type QueryStatus = 'pending' | 'error' | 'success'; +type FetchStatus = 'fetching' | 'paused' | 'idle'; +interface QueryObserverBaseResult { + /** + * The last successfully resolved data for the query. + */ + data: TData | undefined; + /** + * The timestamp for when the query most recently returned the `status` as `"success"`. + */ + dataUpdatedAt: number; + /** + * The error object for the query, if an error was thrown. + * - Defaults to `null`. + */ + error: TError | null; + /** + * The timestamp for when the query most recently returned the `status` as `"error"`. + */ + errorUpdatedAt: number; + /** + * The failure count for the query. + * - Incremented every time the query fails. + * - Reset to `0` when the query succeeds. + */ + failureCount: number; + /** + * The failure reason for the query retry. + * - Reset to `null` when the query succeeds. + */ + failureReason: TError | null; + /** + * The sum of all errors. + */ + errorUpdateCount: number; + /** + * A derived boolean from the `status` variable, provided for convenience. + * - `true` if the query attempt resulted in an error. + */ + isError: boolean; + /** + * Will be `true` if the query has been fetched. + */ + isFetched: boolean; + /** + * Will be `true` if the query has been fetched after the component mounted. + * - This property can be used to not show any previously cached data. + */ + isFetchedAfterMount: boolean; + /** + * A derived boolean from the `fetchStatus` variable, provided for convenience. + * - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. + */ + isFetching: boolean; + /** + * Is `true` whenever the first fetch for a query is in-flight. + * - Is the same as `isFetching && isPending`. + */ + isLoading: boolean; + /** + * Will be `pending` if there's no cached data and no query attempt was finished yet. + */ + isPending: boolean; + /** + * Will be `true` if the query failed while fetching for the first time. + */ + isLoadingError: boolean; + /** + * @deprecated `isInitialLoading` is being deprecated in favor of `isLoading` + * and will be removed in the next major version. + */ + isInitialLoading: boolean; + /** + * A derived boolean from the `fetchStatus` variable, provided for convenience. + * - The query wanted to fetch, but has been `paused`. + */ + isPaused: boolean; + /** + * Will be `true` if the data shown is the placeholder data. + */ + isPlaceholderData: boolean; + /** + * Will be `true` if the query failed while refetching. + */ + isRefetchError: boolean; + /** + * Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. + * - Is the same as `isFetching && !isPending`. + */ + isRefetching: boolean; + /** + * Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. + */ + isStale: boolean; + /** + * A derived boolean from the `status` variable, provided for convenience. + * - `true` if the query has received a response with no errors and is ready to display its data. + */ + isSuccess: boolean; + /** + * `true` if this observer is enabled, `false` otherwise. + */ + isEnabled: boolean; + /** + * A function to manually refetch the query. + */ + refetch: (options?: RefetchOptions) => Promise>; + /** + * The status of the query. + * - Will be: + * - `pending` if there's no cached data and no query attempt was finished yet. + * - `error` if the query attempt resulted in an error. + * - `success` if the query has received a response with no errors and is ready to display its data. + */ + status: QueryStatus; + /** + * The fetch status of the query. + * - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. + * - `paused`: The query wanted to fetch, but has been `paused`. + * - `idle`: The query is not fetching. + * - See [Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information. + */ + fetchStatus: FetchStatus; + /** + * A stable promise that will be resolved with the data of the query. + * Requires the `experimental_prefetchInRender` feature flag to be enabled. + * @example + * + * ### Enabling the feature flag + * ```ts + * const client = new QueryClient({ + * defaultOptions: { + * queries: { + * experimental_prefetchInRender: true, + * }, + * }, + * }) + * ``` + * + * ### Usage + * ```tsx + * import { useQuery } from '@tanstack/react-query' + * import React from 'react' + * import { fetchTodos, type Todo } from './api' + * + * function TodoList({ query }: { query: UseQueryResult }) { + * const data = React.use(query.promise) + * + * return ( + *
    + * {data.map(todo => ( + *
  • {todo.title}
  • + * ))} + *
+ * ) + * } + * + * export function App() { + * const query = useQuery({ queryKey: ['todos'], queryFn: fetchTodos }) + * + * return ( + * <> + *

Todos

+ * Loading...}> + * + * + * + * ) + * } + * ``` + */ + promise: Promise; +} +interface QueryObserverPendingResult extends QueryObserverBaseResult { + data: undefined; + error: null; + isError: false; + isPending: true; + isLoadingError: false; + isRefetchError: false; + isSuccess: false; + isPlaceholderData: false; + status: 'pending'; +} +interface QueryObserverLoadingResult extends QueryObserverBaseResult { + data: undefined; + error: null; + isError: false; + isPending: true; + isLoading: true; + isLoadingError: false; + isRefetchError: false; + isSuccess: false; + isPlaceholderData: false; + status: 'pending'; +} +interface QueryObserverLoadingErrorResult extends QueryObserverBaseResult { + data: undefined; + error: TError; + isError: true; + isPending: false; + isLoading: false; + isLoadingError: true; + isRefetchError: false; + isSuccess: false; + isPlaceholderData: false; + status: 'error'; +} +interface QueryObserverRefetchErrorResult extends QueryObserverBaseResult { + data: TData; + error: TError; + isError: true; + isPending: false; + isLoading: false; + isLoadingError: false; + isRefetchError: true; + isSuccess: false; + isPlaceholderData: false; + status: 'error'; +} +interface QueryObserverSuccessResult extends QueryObserverBaseResult { + data: TData; + error: null; + isError: false; + isPending: false; + isLoading: false; + isLoadingError: false; + isRefetchError: false; + isSuccess: true; + isPlaceholderData: false; + status: 'success'; +} +interface QueryObserverPlaceholderResult extends QueryObserverBaseResult { + data: TData; + isError: false; + error: null; + isPending: false; + isLoading: false; + isLoadingError: false; + isRefetchError: false; + isSuccess: true; + isPlaceholderData: true; + status: 'success'; +} +type DefinedQueryObserverResult = QueryObserverRefetchErrorResult | QueryObserverSuccessResult; +type QueryObserverResult = DefinedQueryObserverResult | QueryObserverLoadingErrorResult | QueryObserverLoadingResult | QueryObserverPendingResult | QueryObserverPlaceholderResult; +interface InfiniteQueryObserverBaseResult extends QueryObserverBaseResult { + /** + * This function allows you to fetch the next "page" of results. + */ + fetchNextPage: (options?: FetchNextPageOptions) => Promise>; + /** + * This function allows you to fetch the previous "page" of results. + */ + fetchPreviousPage: (options?: FetchPreviousPageOptions) => Promise>; + /** + * Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). + */ + hasNextPage: boolean; + /** + * Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). + */ + hasPreviousPage: boolean; + /** + * Will be `true` if the query failed while fetching the next page. + */ + isFetchNextPageError: boolean; + /** + * Will be `true` while fetching the next page with `fetchNextPage`. + */ + isFetchingNextPage: boolean; + /** + * Will be `true` if the query failed while fetching the previous page. + */ + isFetchPreviousPageError: boolean; + /** + * Will be `true` while fetching the previous page with `fetchPreviousPage`. + */ + isFetchingPreviousPage: boolean; +} +interface InfiniteQueryObserverPendingResult extends InfiniteQueryObserverBaseResult { + data: undefined; + error: null; + isError: false; + isPending: true; + isLoadingError: false; + isRefetchError: false; + isFetchNextPageError: false; + isFetchPreviousPageError: false; + isSuccess: false; + isPlaceholderData: false; + status: 'pending'; +} +interface InfiniteQueryObserverLoadingResult extends InfiniteQueryObserverBaseResult { + data: undefined; + error: null; + isError: false; + isPending: true; + isLoading: true; + isLoadingError: false; + isRefetchError: false; + isFetchNextPageError: false; + isFetchPreviousPageError: false; + isSuccess: false; + isPlaceholderData: false; + status: 'pending'; +} +interface InfiniteQueryObserverLoadingErrorResult extends InfiniteQueryObserverBaseResult { + data: undefined; + error: TError; + isError: true; + isPending: false; + isLoading: false; + isLoadingError: true; + isRefetchError: false; + isFetchNextPageError: false; + isFetchPreviousPageError: false; + isSuccess: false; + isPlaceholderData: false; + status: 'error'; +} +interface InfiniteQueryObserverRefetchErrorResult extends InfiniteQueryObserverBaseResult { + data: TData; + error: TError; + isError: true; + isPending: false; + isLoading: false; + isLoadingError: false; + isRefetchError: true; + isSuccess: false; + isPlaceholderData: false; + status: 'error'; +} +interface InfiniteQueryObserverSuccessResult extends InfiniteQueryObserverBaseResult { + data: TData; + error: null; + isError: false; + isPending: false; + isLoading: false; + isLoadingError: false; + isRefetchError: false; + isFetchNextPageError: false; + isFetchPreviousPageError: false; + isSuccess: true; + isPlaceholderData: false; + status: 'success'; +} +interface InfiniteQueryObserverPlaceholderResult extends InfiniteQueryObserverBaseResult { + data: TData; + isError: false; + error: null; + isPending: false; + isLoading: false; + isLoadingError: false; + isRefetchError: false; + isSuccess: true; + isPlaceholderData: true; + isFetchNextPageError: false; + isFetchPreviousPageError: false; + status: 'success'; +} +type DefinedInfiniteQueryObserverResult = InfiniteQueryObserverRefetchErrorResult | InfiniteQueryObserverSuccessResult; +type InfiniteQueryObserverResult = DefinedInfiniteQueryObserverResult | InfiniteQueryObserverLoadingErrorResult | InfiniteQueryObserverLoadingResult | InfiniteQueryObserverPendingResult | InfiniteQueryObserverPlaceholderResult; +type MutationKey = Register extends { + mutationKey: infer TMutationKey; +} ? TMutationKey extends ReadonlyArray ? TMutationKey : TMutationKey extends Array ? TMutationKey : ReadonlyArray : ReadonlyArray; +type MutationStatus = 'idle' | 'pending' | 'success' | 'error'; +type MutationScope = { + id: string; +}; +type MutationMeta = Register extends { + mutationMeta: infer TMutationMeta; +} ? TMutationMeta extends Record ? TMutationMeta : Record : Record; +type MutationFunctionContext = { + client: QueryClient; + meta: MutationMeta | undefined; + mutationKey?: MutationKey; +}; +type MutationFunction = (variables: TVariables, context: MutationFunctionContext) => Promise; +interface MutationOptions { + mutationFn?: MutationFunction; + mutationKey?: MutationKey; + onMutate?: (variables: TVariables, context: MutationFunctionContext) => Promise | TOnMutateResult; + onSuccess?: (data: TData, variables: TVariables, onMutateResult: TOnMutateResult, context: MutationFunctionContext) => Promise | unknown; + onError?: (error: TError, variables: TVariables, onMutateResult: TOnMutateResult | undefined, context: MutationFunctionContext) => Promise | unknown; + onSettled?: (data: TData | undefined, error: TError | null, variables: TVariables, onMutateResult: TOnMutateResult | undefined, context: MutationFunctionContext) => Promise | unknown; + retry?: RetryValue; + retryDelay?: RetryDelayValue; + networkMode?: NetworkMode; + gcTime?: number; + _defaulted?: boolean; + meta?: MutationMeta; + scope?: MutationScope; +} +interface MutationObserverOptions extends MutationOptions { + throwOnError?: boolean | ((error: TError) => boolean); +} +interface MutateOptions { + onSuccess?: (data: TData, variables: TVariables, onMutateResult: TOnMutateResult | undefined, context: MutationFunctionContext) => void; + onError?: (error: TError, variables: TVariables, onMutateResult: TOnMutateResult | undefined, context: MutationFunctionContext) => void; + onSettled?: (data: TData | undefined, error: TError | null, variables: TVariables, onMutateResult: TOnMutateResult | undefined, context: MutationFunctionContext) => void; +} +type MutateFunction = (variables: TVariables, options?: MutateOptions) => Promise; +interface MutationObserverBaseResult extends MutationState { + /** + * The last successfully resolved data for the mutation. + */ + data: TData | undefined; + /** + * The variables object passed to the `mutationFn`. + */ + variables: TVariables | undefined; + /** + * The error object for the mutation, if an error was encountered. + * - Defaults to `null`. + */ + error: TError | null; + /** + * A boolean variable derived from `status`. + * - `true` if the last mutation attempt resulted in an error. + */ + isError: boolean; + /** + * A boolean variable derived from `status`. + * - `true` if the mutation is in its initial state prior to executing. + */ + isIdle: boolean; + /** + * A boolean variable derived from `status`. + * - `true` if the mutation is currently executing. + */ + isPending: boolean; + /** + * A boolean variable derived from `status`. + * - `true` if the last mutation attempt was successful. + */ + isSuccess: boolean; + /** + * The status of the mutation. + * - Will be: + * - `idle` initial status prior to the mutation function executing. + * - `pending` if the mutation is currently executing. + * - `error` if the last mutation attempt resulted in an error. + * - `success` if the last mutation attempt was successful. + */ + status: MutationStatus; + /** + * The mutation function you can call with variables to trigger the mutation and optionally hooks on additional callback options. + * @param variables - The variables object to pass to the `mutationFn`. + * @param options.onSuccess - This function will fire when the mutation is successful and will be passed the mutation's result. + * @param options.onError - This function will fire if the mutation encounters an error and will be passed the error. + * @param options.onSettled - This function will fire when the mutation is either successfully fetched or encounters an error and be passed either the data or error. + * @remarks + * - If you make multiple requests, `onSuccess` will fire only after the latest call you've made. + * - All the callback functions (`onSuccess`, `onError`, `onSettled`) are void functions, and the returned value will be ignored. + */ + mutate: MutateFunction; + /** + * A function to clean the mutation internal state (i.e., it resets the mutation to its initial state). + */ + reset: () => void; +} +interface MutationObserverIdleResult extends MutationObserverBaseResult { + data: undefined; + variables: undefined; + error: null; + isError: false; + isIdle: true; + isPending: false; + isSuccess: false; + status: 'idle'; +} +interface MutationObserverLoadingResult extends MutationObserverBaseResult { + data: undefined; + variables: TVariables; + error: null; + isError: false; + isIdle: false; + isPending: true; + isSuccess: false; + status: 'pending'; +} +interface MutationObserverErrorResult extends MutationObserverBaseResult { + data: undefined; + error: TError; + variables: TVariables; + isError: true; + isIdle: false; + isPending: false; + isSuccess: false; + status: 'error'; +} +interface MutationObserverSuccessResult extends MutationObserverBaseResult { + data: TData; + error: null; + variables: TVariables; + isError: false; + isIdle: false; + isPending: false; + isSuccess: true; + status: 'success'; +} +type MutationObserverResult = MutationObserverIdleResult | MutationObserverLoadingResult | MutationObserverErrorResult | MutationObserverSuccessResult; +interface QueryClientConfig { + queryCache?: QueryCache; + mutationCache?: MutationCache; + defaultOptions?: DefaultOptions; +} +interface DefaultOptions { + queries?: OmitKeyof, 'suspense' | 'queryKey'>; + mutations?: MutationObserverOptions; + hydrate?: HydrateOptions['defaultOptions']; + dehydrate?: DehydrateOptions; +} +interface CancelOptions { + revert?: boolean; + silent?: boolean; +} +interface SetDataOptions { + updatedAt?: number; +} +type NotifyEventType = 'added' | 'removed' | 'updated' | 'observerAdded' | 'observerRemoved' | 'observerResultsUpdated' | 'observerOptionsUpdated'; +interface NotifyEvent { + type: NotifyEventType; +} + +type TransformerFn = (data: any) => any; +interface DehydrateOptions { + serializeData?: TransformerFn; + shouldDehydrateMutation?: (mutation: Mutation) => boolean; + shouldDehydrateQuery?: (query: Query) => boolean; + shouldRedactErrors?: (error: unknown) => boolean; +} +interface HydrateOptions { + defaultOptions?: { + deserializeData?: TransformerFn; + queries?: QueryOptions; + mutations?: MutationOptions; + }; +} +interface DehydratedMutation { + mutationKey?: MutationKey; + state: MutationState; + meta?: MutationMeta; + scope?: MutationScope; +} +interface DehydratedQuery { + queryHash: string; + queryKey: QueryKey; + state: QueryState; + promise?: Promise; + meta?: QueryMeta; + dehydratedAt?: number; +} +interface DehydratedState { + mutations: Array; + queries: Array; +} +declare function defaultShouldDehydrateMutation(mutation: Mutation): boolean; +declare function defaultShouldDehydrateQuery(query: Query): boolean; +declare function dehydrate(client: QueryClient, options?: DehydrateOptions): DehydratedState; +declare function hydrate(client: QueryClient, dehydratedState: unknown, options?: HydrateOptions): void; + +export { type Enabled as $, type QueryState as A, type DistributiveOmit as B, CancelledError as C, type DehydratedState as D, type Override as E, type NoInfer as F, type DefaultError as G, type HydrateOptions as H, type QueryKey as I, dataTagSymbol as J, dataTagErrorSymbol as K, unsetMarker as L, MutationCache as M, type NonUndefinedGuard as N, type OmitKeyof as O, type UnsetMarker as P, QueryCache as Q, type Register as R, type SkipToken as S, type AnyDataTag as T, type Updater as U, type DataTag as V, type InferDataFromTag as W, type InferErrorFromTag as X, type QueryFunction as Y, type StaleTime as Z, type StaleTimeFunction as _, defaultShouldDehydrateQuery as a, type MutationObserverBaseResult as a$, type QueryPersister as a0, type QueryFunctionContext as a1, type InitialDataFunction as a2, type PlaceholderDataFunction as a3, type QueriesPlaceholderDataFunction as a4, type QueryKeyHashFunction as a5, type GetPreviousPageParamFunction as a6, type GetNextPageParamFunction as a7, type InfiniteData as a8, type QueryMeta as a9, type QueryObserverPendingResult as aA, type QueryObserverLoadingResult as aB, type QueryObserverLoadingErrorResult as aC, type QueryObserverRefetchErrorResult as aD, type QueryObserverSuccessResult as aE, type QueryObserverPlaceholderResult as aF, type DefinedQueryObserverResult as aG, type QueryObserverResult as aH, type InfiniteQueryObserverBaseResult as aI, type InfiniteQueryObserverPendingResult as aJ, type InfiniteQueryObserverLoadingResult as aK, type InfiniteQueryObserverLoadingErrorResult as aL, type InfiniteQueryObserverRefetchErrorResult as aM, type InfiniteQueryObserverSuccessResult as aN, type InfiniteQueryObserverPlaceholderResult as aO, type DefinedInfiniteQueryObserverResult as aP, type InfiniteQueryObserverResult as aQ, type MutationKey as aR, type MutationStatus as aS, type MutationScope as aT, type MutationMeta as aU, type MutationFunctionContext as aV, type MutationFunction as aW, type MutationOptions as aX, type MutationObserverOptions as aY, type MutateOptions as aZ, type MutateFunction as a_, type NetworkMode as aa, type NotifyOnChangeProps as ab, type QueryOptions as ac, type InitialPageParam as ad, type InfiniteQueryPageParamsOptions as ae, type ThrowOnError as af, type QueryObserverOptions as ag, type WithRequired as ah, type DefaultedQueryObserverOptions as ai, type InfiniteQueryObserverOptions as aj, type DefaultedInfiniteQueryObserverOptions as ak, type FetchQueryOptions as al, type EnsureQueryDataOptions as am, type EnsureInfiniteQueryDataOptions as an, type FetchInfiniteQueryOptions as ao, type ResultOptions as ap, type RefetchOptions as aq, type InvalidateQueryFilters as ar, type RefetchQueryFilters as as, type InvalidateOptions as at, type ResetOptions as au, type FetchNextPageOptions as av, type FetchPreviousPageOptions as aw, type QueryStatus as ax, type FetchStatus as ay, type QueryObserverBaseResult as az, dehydrate as b, type MutationObserverIdleResult as b0, type MutationObserverLoadingResult as b1, type MutationObserverErrorResult as b2, type MutationObserverSuccessResult as b3, type MutationObserverResult as b4, type QueryClientConfig as b5, type DefaultOptions as b6, type CancelOptions as b7, type SetDataOptions as b8, type NotifyEventType as b9, addConsumeAwareSignal as bA, type QueryStore as bB, type Retryer as bC, type RetryValue as bD, type RetryDelayValue as bE, canFetch as bF, createRetryer as bG, type NotifyEvent as ba, type QueryBehavior as bb, type FetchContext as bc, type FetchDirection as bd, type FetchMeta as be, type FetchOptions as bf, type Action$1 as bg, type SetStateOptions as bh, fetchState as bi, type Action as bj, getDefaultState as bk, type QueryTypeFilter as bl, functionalUpdate as bm, isValidTimeout as bn, timeUntilStale as bo, resolveStaleTime as bp, resolveEnabled as bq, hashQueryKeyByOptions as br, shallowEqualObjects as bs, isPlainArray as bt, isPlainObject as bu, sleep as bv, replaceData as bw, addToEnd as bx, addToStart as by, ensureQueryFn as bz, type MutationCacheNotifyEvent as c, defaultShouldDehydrateMutation as d, MutationObserver as e, type QueryCacheNotifyEvent as f, QueryClient as g, hydrate as h, QueryObserver as i, isCancelledError as j, hashKey as k, isServer as l, keepPreviousData as m, matchMutation as n, matchQuery as o, noop as p, partialMatchKey as q, replaceEqualDeep as r, shouldThrowError as s, skipToken as t, type MutationFilters as u, type QueryFilters as v, type DehydrateOptions as w, Mutation as x, type MutationState as y, Query as z }; diff --git a/node_modules/@tanstack/query-core/build/legacy/hydration-uphG6M-i.d.cts b/node_modules/@tanstack/query-core/build/legacy/hydration-uphG6M-i.d.cts new file mode 100644 index 0000000..fdea1ed --- /dev/null +++ b/node_modules/@tanstack/query-core/build/legacy/hydration-uphG6M-i.d.cts @@ -0,0 +1,1384 @@ +import { Removable } from './removable.cjs'; +import { Subscribable } from './subscribable.cjs'; + +type QueryObserverListener = (result: QueryObserverResult) => void; +interface ObserverFetchOptions extends FetchOptions { + throwOnError?: boolean; +} +declare class QueryObserver extends Subscribable> { + #private; + options: QueryObserverOptions; + constructor(client: QueryClient, options: QueryObserverOptions); + protected bindMethods(): void; + protected onSubscribe(): void; + protected onUnsubscribe(): void; + shouldFetchOnReconnect(): boolean; + shouldFetchOnWindowFocus(): boolean; + destroy(): void; + setOptions(options: QueryObserverOptions): void; + getOptimisticResult(options: DefaultedQueryObserverOptions): QueryObserverResult; + getCurrentResult(): QueryObserverResult; + trackResult(result: QueryObserverResult, onPropTracked?: (key: keyof QueryObserverResult) => void): QueryObserverResult; + trackProp(key: keyof QueryObserverResult): void; + getCurrentQuery(): Query; + refetch({ ...options }?: RefetchOptions): Promise>; + fetchOptimistic(options: QueryObserverOptions): Promise>; + protected fetch(fetchOptions: ObserverFetchOptions): Promise>; + protected createResult(query: Query, options: QueryObserverOptions): QueryObserverResult; + updateResult(): void; + onQueryUpdate(): void; +} + +interface QueryConfig { + client: QueryClient; + queryKey: TQueryKey; + queryHash: string; + options?: QueryOptions; + defaultOptions?: QueryOptions; + state?: QueryState; +} +interface QueryState { + data: TData | undefined; + dataUpdateCount: number; + dataUpdatedAt: number; + error: TError | null; + errorUpdateCount: number; + errorUpdatedAt: number; + fetchFailureCount: number; + fetchFailureReason: TError | null; + fetchMeta: FetchMeta | null; + isInvalidated: boolean; + status: QueryStatus; + fetchStatus: FetchStatus; +} +interface FetchContext { + fetchFn: () => unknown | Promise; + fetchOptions?: FetchOptions; + signal: AbortSignal; + options: QueryOptions; + client: QueryClient; + queryKey: TQueryKey; + state: QueryState; +} +interface QueryBehavior { + onFetch: (context: FetchContext, query: Query) => void; +} +type FetchDirection = 'forward' | 'backward'; +interface FetchMeta { + fetchMore?: { + direction: FetchDirection; + }; +} +interface FetchOptions { + cancelRefetch?: boolean; + meta?: FetchMeta; + initialPromise?: Promise; +} +interface FailedAction$1 { + type: 'failed'; + failureCount: number; + error: TError; +} +interface FetchAction { + type: 'fetch'; + meta?: FetchMeta; +} +interface SuccessAction$1 { + data: TData | undefined; + type: 'success'; + dataUpdatedAt?: number; + manual?: boolean; +} +interface ErrorAction$1 { + type: 'error'; + error: TError; +} +interface InvalidateAction { + type: 'invalidate'; +} +interface PauseAction$1 { + type: 'pause'; +} +interface ContinueAction$1 { + type: 'continue'; +} +interface SetStateAction { + type: 'setState'; + state: Partial>; + setStateOptions?: SetStateOptions; +} +type Action$1 = ContinueAction$1 | ErrorAction$1 | FailedAction$1 | FetchAction | InvalidateAction | PauseAction$1 | SetStateAction | SuccessAction$1; +interface SetStateOptions { + meta?: any; +} +declare class Query extends Removable { + #private; + queryKey: TQueryKey; + queryHash: string; + options: QueryOptions; + state: QueryState; + observers: Array>; + constructor(config: QueryConfig); + get meta(): QueryMeta | undefined; + get promise(): Promise | undefined; + setOptions(options?: QueryOptions): void; + protected optionalRemove(): void; + setData(newData: TData, options?: SetDataOptions & { + manual: boolean; + }): TData; + setState(state: Partial>, setStateOptions?: SetStateOptions): void; + cancel(options?: CancelOptions): Promise; + destroy(): void; + reset(): void; + isActive(): boolean; + isDisabled(): boolean; + isStatic(): boolean; + isStale(): boolean; + isStaleByTime(staleTime?: StaleTime): boolean; + onFocus(): void; + onOnline(): void; + addObserver(observer: QueryObserver): void; + removeObserver(observer: QueryObserver): void; + getObserversCount(): number; + invalidate(): void; + fetch(options?: QueryOptions, fetchOptions?: FetchOptions): Promise; +} +declare function fetchState(data: TData | undefined, options: QueryOptions): { + readonly error?: null | undefined; + readonly status?: "pending" | undefined; + readonly fetchFailureCount: 0; + readonly fetchFailureReason: null; + readonly fetchStatus: "fetching" | "paused"; +}; + +type MutationObserverListener = (result: MutationObserverResult) => void; +declare class MutationObserver extends Subscribable> { + #private; + options: MutationObserverOptions; + constructor(client: QueryClient, options: MutationObserverOptions); + protected bindMethods(): void; + setOptions(options: MutationObserverOptions): void; + protected onUnsubscribe(): void; + onMutationUpdate(action: Action): void; + getCurrentResult(): MutationObserverResult; + reset(): void; + mutate(variables: TVariables, options?: MutateOptions): Promise; +} + +interface MutationCacheConfig { + onError?: (error: DefaultError, variables: unknown, onMutateResult: unknown, mutation: Mutation, context: MutationFunctionContext) => Promise | unknown; + onSuccess?: (data: unknown, variables: unknown, onMutateResult: unknown, mutation: Mutation, context: MutationFunctionContext) => Promise | unknown; + onMutate?: (variables: unknown, mutation: Mutation, context: MutationFunctionContext) => Promise | unknown; + onSettled?: (data: unknown | undefined, error: DefaultError | null, variables: unknown, onMutateResult: unknown, mutation: Mutation, context: MutationFunctionContext) => Promise | unknown; +} +interface NotifyEventMutationAdded extends NotifyEvent { + type: 'added'; + mutation: Mutation; +} +interface NotifyEventMutationRemoved extends NotifyEvent { + type: 'removed'; + mutation: Mutation; +} +interface NotifyEventMutationObserverAdded extends NotifyEvent { + type: 'observerAdded'; + mutation: Mutation; + observer: MutationObserver; +} +interface NotifyEventMutationObserverRemoved extends NotifyEvent { + type: 'observerRemoved'; + mutation: Mutation; + observer: MutationObserver; +} +interface NotifyEventMutationObserverOptionsUpdated extends NotifyEvent { + type: 'observerOptionsUpdated'; + mutation?: Mutation; + observer: MutationObserver; +} +interface NotifyEventMutationUpdated extends NotifyEvent { + type: 'updated'; + mutation: Mutation; + action: Action; +} +type MutationCacheNotifyEvent = NotifyEventMutationAdded | NotifyEventMutationRemoved | NotifyEventMutationObserverAdded | NotifyEventMutationObserverRemoved | NotifyEventMutationObserverOptionsUpdated | NotifyEventMutationUpdated; +type MutationCacheListener = (event: MutationCacheNotifyEvent) => void; +declare class MutationCache extends Subscribable { + #private; + config: MutationCacheConfig; + constructor(config?: MutationCacheConfig); + build(client: QueryClient, options: MutationOptions, state?: MutationState): Mutation; + add(mutation: Mutation): void; + remove(mutation: Mutation): void; + canRun(mutation: Mutation): boolean; + runNext(mutation: Mutation): Promise; + clear(): void; + getAll(): Array; + find(filters: MutationFilters): Mutation | undefined; + findAll(filters?: MutationFilters): Array; + notify(event: MutationCacheNotifyEvent): void; + resumePausedMutations(): Promise; +} + +interface MutationConfig { + client: QueryClient; + mutationId: number; + mutationCache: MutationCache; + options: MutationOptions; + state?: MutationState; +} +interface MutationState { + context: TOnMutateResult | undefined; + data: TData | undefined; + error: TError | null; + failureCount: number; + failureReason: TError | null; + isPaused: boolean; + status: MutationStatus; + variables: TVariables | undefined; + submittedAt: number; +} +interface FailedAction { + type: 'failed'; + failureCount: number; + error: TError | null; +} +interface PendingAction { + type: 'pending'; + isPaused: boolean; + variables?: TVariables; + context?: TOnMutateResult; +} +interface SuccessAction { + type: 'success'; + data: TData; +} +interface ErrorAction { + type: 'error'; + error: TError; +} +interface PauseAction { + type: 'pause'; +} +interface ContinueAction { + type: 'continue'; +} +type Action = ContinueAction | ErrorAction | FailedAction | PendingAction | PauseAction | SuccessAction; +declare class Mutation extends Removable { + #private; + state: MutationState; + options: MutationOptions; + readonly mutationId: number; + constructor(config: MutationConfig); + setOptions(options: MutationOptions): void; + get meta(): MutationMeta | undefined; + addObserver(observer: MutationObserver): void; + removeObserver(observer: MutationObserver): void; + protected optionalRemove(): void; + continue(): Promise; + execute(variables: TVariables): Promise; +} +declare function getDefaultState(): MutationState; + +type DropLast> = T extends readonly [ + ...infer R, + unknown +] ? readonly [...R] : never; +type TuplePrefixes> = T extends readonly [] ? readonly [] : TuplePrefixes> | T; +interface QueryFilters { + /** + * Filter to active queries, inactive queries or all queries + */ + type?: QueryTypeFilter; + /** + * Match query key exactly + */ + exact?: boolean; + /** + * Include queries matching this predicate function + */ + predicate?: (query: Query) => boolean; + /** + * Include queries matching this query key + */ + queryKey?: TQueryKey | TuplePrefixes; + /** + * Include or exclude stale queries + */ + stale?: boolean; + /** + * Include queries matching their fetchStatus + */ + fetchStatus?: FetchStatus; +} +interface MutationFilters { + /** + * Match mutation key exactly + */ + exact?: boolean; + /** + * Include mutations matching this predicate function + */ + predicate?: (mutation: Mutation) => boolean; + /** + * Include mutations matching this mutation key + */ + mutationKey?: TuplePrefixes; + /** + * Filter by mutation status + */ + status?: MutationStatus; +} +type Updater = TOutput | ((input: TInput) => TOutput); +type QueryTypeFilter = 'all' | 'active' | 'inactive'; +declare const isServer: boolean; +declare function noop(): void; +declare function noop(): undefined; +declare function functionalUpdate(updater: Updater, input: TInput): TOutput; +declare function isValidTimeout(value: unknown): value is number; +declare function timeUntilStale(updatedAt: number, staleTime?: number): number; +declare function resolveStaleTime(staleTime: undefined | StaleTimeFunction, query: Query): StaleTime | undefined; +declare function resolveEnabled(enabled: undefined | Enabled, query: Query): boolean | undefined; +declare function matchQuery(filters: QueryFilters, query: Query): boolean; +declare function matchMutation(filters: MutationFilters, mutation: Mutation): boolean; +declare function hashQueryKeyByOptions(queryKey: TQueryKey, options?: Pick, 'queryKeyHashFn'>): string; +/** + * Default query & mutation keys hash function. + * Hashes the value into a stable hash. + */ +declare function hashKey(queryKey: QueryKey | MutationKey): string; +/** + * Checks if key `b` partially matches with key `a`. + */ +declare function partialMatchKey(a: QueryKey, b: QueryKey): boolean; +/** + * This function returns `a` if `b` is deeply equal. + * If not, it will replace any deeply equal children of `b` with those of `a`. + * This can be used for structural sharing between JSON values for example. + */ +declare function replaceEqualDeep(a: unknown, b: T, depth?: number): T; +/** + * Shallow compare objects. + */ +declare function shallowEqualObjects>(a: T, b: T | undefined): boolean; +declare function isPlainArray(value: unknown): value is Array; +declare function isPlainObject(o: any): o is Record; +declare function sleep(timeout: number): Promise; +declare function replaceData>(prevData: TData | undefined, data: TData, options: TOptions): TData; +declare function keepPreviousData(previousData: T | undefined): T | undefined; +declare function addToEnd(items: Array, item: T, max?: number): Array; +declare function addToStart(items: Array, item: T, max?: number): Array; +declare const skipToken: unique symbol; +type SkipToken = typeof skipToken; +declare function ensureQueryFn(options: { + queryFn?: QueryFunction | SkipToken; + queryHash?: string; +}, fetchOptions?: FetchOptions): QueryFunction; +declare function shouldThrowError) => boolean>(throwOnError: boolean | T | undefined, params: Parameters): boolean; +declare function addConsumeAwareSignal(object: T, getSignal: () => AbortSignal, onCancelled: VoidFunction): T & { + signal: AbortSignal; +}; + +interface QueryCacheConfig { + onError?: (error: DefaultError, query: Query) => void; + onSuccess?: (data: unknown, query: Query) => void; + onSettled?: (data: unknown | undefined, error: DefaultError | null, query: Query) => void; +} +interface NotifyEventQueryAdded extends NotifyEvent { + type: 'added'; + query: Query; +} +interface NotifyEventQueryRemoved extends NotifyEvent { + type: 'removed'; + query: Query; +} +interface NotifyEventQueryUpdated extends NotifyEvent { + type: 'updated'; + query: Query; + action: Action$1; +} +interface NotifyEventQueryObserverAdded extends NotifyEvent { + type: 'observerAdded'; + query: Query; + observer: QueryObserver; +} +interface NotifyEventQueryObserverRemoved extends NotifyEvent { + type: 'observerRemoved'; + query: Query; + observer: QueryObserver; +} +interface NotifyEventQueryObserverResultsUpdated extends NotifyEvent { + type: 'observerResultsUpdated'; + query: Query; +} +interface NotifyEventQueryObserverOptionsUpdated extends NotifyEvent { + type: 'observerOptionsUpdated'; + query: Query; + observer: QueryObserver; +} +type QueryCacheNotifyEvent = NotifyEventQueryAdded | NotifyEventQueryRemoved | NotifyEventQueryUpdated | NotifyEventQueryObserverAdded | NotifyEventQueryObserverRemoved | NotifyEventQueryObserverResultsUpdated | NotifyEventQueryObserverOptionsUpdated; +type QueryCacheListener = (event: QueryCacheNotifyEvent) => void; +interface QueryStore { + has: (queryHash: string) => boolean; + set: (queryHash: string, query: Query) => void; + get: (queryHash: string) => Query | undefined; + delete: (queryHash: string) => void; + values: () => IterableIterator; +} +declare class QueryCache extends Subscribable { + #private; + config: QueryCacheConfig; + constructor(config?: QueryCacheConfig); + build(client: QueryClient, options: WithRequired, 'queryKey'>, state?: QueryState): Query; + add(query: Query): void; + remove(query: Query): void; + clear(): void; + get(queryHash: string): Query | undefined; + getAll(): Array; + find(filters: WithRequired): Query | undefined; + findAll(filters?: QueryFilters): Array; + notify(event: QueryCacheNotifyEvent): void; + onFocus(): void; + onOnline(): void; +} + +declare class QueryClient { + #private; + constructor(config?: QueryClientConfig); + mount(): void; + unmount(): void; + isFetching = QueryFilters>(filters?: TQueryFilters): number; + isMutating = MutationFilters>(filters?: TMutationFilters): number; + /** + * Imperative (non-reactive) way to retrieve data for a QueryKey. + * Should only be used in callbacks or functions where reading the latest data is necessary, e.g. for optimistic updates. + * + * Hint: Do not use this function inside a component, because it won't receive updates. + * Use `useQuery` to create a `QueryObserver` that subscribes to changes. + */ + getQueryData>(queryKey: TTaggedQueryKey): TInferredQueryFnData | undefined; + ensureQueryData(options: EnsureQueryDataOptions): Promise; + getQueriesData = QueryFilters>(filters: TQueryFilters): Array<[QueryKey, TQueryFnData | undefined]>; + setQueryData>(queryKey: TTaggedQueryKey, updater: Updater | undefined, NoInfer | undefined>, options?: SetDataOptions): NoInfer | undefined; + setQueriesData = QueryFilters>(filters: TQueryFilters, updater: Updater | undefined, NoInfer | undefined>, options?: SetDataOptions): Array<[QueryKey, TQueryFnData | undefined]>; + getQueryState, TInferredError = InferErrorFromTag>(queryKey: TTaggedQueryKey): QueryState | undefined; + removeQueries(filters?: QueryFilters): void; + resetQueries(filters?: QueryFilters, options?: ResetOptions): Promise; + cancelQueries(filters?: QueryFilters, cancelOptions?: CancelOptions): Promise; + invalidateQueries(filters?: InvalidateQueryFilters, options?: InvalidateOptions): Promise; + refetchQueries(filters?: RefetchQueryFilters, options?: RefetchOptions): Promise; + fetchQuery(options: FetchQueryOptions): Promise; + prefetchQuery(options: FetchQueryOptions): Promise; + fetchInfiniteQuery(options: FetchInfiniteQueryOptions): Promise>; + prefetchInfiniteQuery(options: FetchInfiniteQueryOptions): Promise; + ensureInfiniteQueryData(options: EnsureInfiniteQueryDataOptions): Promise>; + resumePausedMutations(): Promise; + getQueryCache(): QueryCache; + getMutationCache(): MutationCache; + getDefaultOptions(): DefaultOptions; + setDefaultOptions(options: DefaultOptions): void; + setQueryDefaults(queryKey: QueryKey, options: Partial, 'queryKey'>>): void; + getQueryDefaults(queryKey: QueryKey): OmitKeyof, 'queryKey'>; + setMutationDefaults(mutationKey: MutationKey, options: OmitKeyof, 'mutationKey'>): void; + getMutationDefaults(mutationKey: MutationKey): OmitKeyof, 'mutationKey'>; + defaultQueryOptions(options: QueryObserverOptions | DefaultedQueryObserverOptions): DefaultedQueryObserverOptions; + defaultMutationOptions>(options?: T): T; + clear(): void; +} + +interface RetryerConfig { + fn: () => TData | Promise; + initialPromise?: Promise; + onCancel?: (error: TError) => void; + onFail?: (failureCount: number, error: TError) => void; + onPause?: () => void; + onContinue?: () => void; + retry?: RetryValue; + retryDelay?: RetryDelayValue; + networkMode: NetworkMode | undefined; + canRun: () => boolean; +} +interface Retryer { + promise: Promise; + cancel: (cancelOptions?: CancelOptions) => void; + continue: () => Promise; + cancelRetry: () => void; + continueRetry: () => void; + canStart: () => boolean; + start: () => Promise; + status: () => 'pending' | 'resolved' | 'rejected'; +} +type RetryValue = boolean | number | ShouldRetryFunction; +type ShouldRetryFunction = (failureCount: number, error: TError) => boolean; +type RetryDelayValue = number | RetryDelayFunction; +type RetryDelayFunction = (failureCount: number, error: TError) => number; +declare function canFetch(networkMode: NetworkMode | undefined): boolean; +declare class CancelledError extends Error { + revert?: boolean; + silent?: boolean; + constructor(options?: CancelOptions); +} +/** + * @deprecated Use instanceof `CancelledError` instead. + */ +declare function isCancelledError(value: any): value is CancelledError; +declare function createRetryer(config: RetryerConfig): Retryer; + +type NonUndefinedGuard = T extends undefined ? never : T; +type DistributiveOmit = TObject extends any ? Omit : never; +type OmitKeyof) | (number & Record) | (symbol & Record) : keyof TObject, TStrictly extends 'strictly' | 'safely' = 'strictly'> = Omit; +type Override = { + [AKey in keyof TTargetA]: AKey extends keyof TTargetB ? TTargetB[AKey] : TTargetA[AKey]; +}; +type NoInfer = [T][T extends any ? 0 : never]; +interface Register { +} +type DefaultError = Register extends { + defaultError: infer TError; +} ? TError : Error; +type QueryKey = Register extends { + queryKey: infer TQueryKey; +} ? TQueryKey extends ReadonlyArray ? TQueryKey : TQueryKey extends Array ? TQueryKey : ReadonlyArray : ReadonlyArray; +declare const dataTagSymbol: unique symbol; +type dataTagSymbol = typeof dataTagSymbol; +declare const dataTagErrorSymbol: unique symbol; +type dataTagErrorSymbol = typeof dataTagErrorSymbol; +declare const unsetMarker: unique symbol; +type UnsetMarker = typeof unsetMarker; +type AnyDataTag = { + [dataTagSymbol]: any; + [dataTagErrorSymbol]: any; +}; +type DataTag = TType extends AnyDataTag ? TType : TType & { + [dataTagSymbol]: TValue; + [dataTagErrorSymbol]: TError; +}; +type InferDataFromTag = TTaggedQueryKey extends DataTag ? TaggedValue : TQueryFnData; +type InferErrorFromTag = TTaggedQueryKey extends DataTag ? TaggedError extends UnsetMarker ? TError : TaggedError : TError; +type QueryFunction = (context: QueryFunctionContext) => T | Promise; +type StaleTime = number | 'static'; +type StaleTimeFunction = StaleTime | ((query: Query) => StaleTime); +type Enabled = boolean | ((query: Query) => boolean); +type QueryPersister = [TPageParam] extends [never] ? (queryFn: QueryFunction, context: QueryFunctionContext, query: Query) => T | Promise : (queryFn: QueryFunction, context: QueryFunctionContext, query: Query) => T | Promise; +type QueryFunctionContext = [TPageParam] extends [never] ? { + client: QueryClient; + queryKey: TQueryKey; + signal: AbortSignal; + meta: QueryMeta | undefined; + pageParam?: unknown; + /** + * @deprecated + * if you want access to the direction, you can add it to the pageParam + */ + direction?: unknown; +} : { + client: QueryClient; + queryKey: TQueryKey; + signal: AbortSignal; + pageParam: TPageParam; + /** + * @deprecated + * if you want access to the direction, you can add it to the pageParam + */ + direction: FetchDirection; + meta: QueryMeta | undefined; +}; +type InitialDataFunction = () => T | undefined; +type NonFunctionGuard = T extends Function ? never : T; +type PlaceholderDataFunction = (previousData: TQueryData | undefined, previousQuery: Query | undefined) => TQueryData | undefined; +type QueriesPlaceholderDataFunction = (previousData: undefined, previousQuery: undefined) => TQueryData | undefined; +type QueryKeyHashFunction = (queryKey: TQueryKey) => string; +type GetPreviousPageParamFunction = (firstPage: TQueryFnData, allPages: Array, firstPageParam: TPageParam, allPageParams: Array) => TPageParam | undefined | null; +type GetNextPageParamFunction = (lastPage: TQueryFnData, allPages: Array, lastPageParam: TPageParam, allPageParams: Array) => TPageParam | undefined | null; +interface InfiniteData { + pages: Array; + pageParams: Array; +} +type QueryMeta = Register extends { + queryMeta: infer TQueryMeta; +} ? TQueryMeta extends Record ? TQueryMeta : Record : Record; +type NetworkMode = 'online' | 'always' | 'offlineFirst'; +type NotifyOnChangeProps = Array | 'all' | undefined | (() => Array | 'all' | undefined); +interface QueryOptions { + /** + * If `false`, failed queries will not retry by default. + * If `true`, failed queries will retry infinitely., failureCount: num + * If set to an integer number, e.g. 3, failed queries will retry until the failed query count meets that number. + * If set to a function `(failureCount, error) => boolean` failed queries will retry until the function returns false. + */ + retry?: RetryValue; + retryDelay?: RetryDelayValue; + networkMode?: NetworkMode; + /** + * The time in milliseconds that unused/inactive cache data remains in memory. + * When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration. + * When different garbage collection times are specified, the longest one will be used. + * Setting it to `Infinity` will disable garbage collection. + */ + gcTime?: number; + queryFn?: QueryFunction | SkipToken; + persister?: QueryPersister, NoInfer, NoInfer>; + queryHash?: string; + queryKey?: TQueryKey; + queryKeyHashFn?: QueryKeyHashFunction; + initialData?: TData | InitialDataFunction; + initialDataUpdatedAt?: number | (() => number | undefined); + behavior?: QueryBehavior; + /** + * Set this to `false` to disable structural sharing between query results. + * Set this to a function which accepts the old and new data and returns resolved data of the same type to implement custom structural sharing logic. + * Defaults to `true`. + */ + structuralSharing?: boolean | ((oldData: unknown | undefined, newData: unknown) => unknown); + _defaulted?: boolean; + /** + * Additional payload to be stored on each query. + * Use this property to pass information that can be used in other places. + */ + meta?: QueryMeta; + /** + * Maximum number of pages to store in the data of an infinite query. + */ + maxPages?: number; +} +interface InitialPageParam { + initialPageParam: TPageParam; +} +interface InfiniteQueryPageParamsOptions extends InitialPageParam { + /** + * This function can be set to automatically get the previous cursor for infinite queries. + * The result will also be used to determine the value of `hasPreviousPage`. + */ + getPreviousPageParam?: GetPreviousPageParamFunction; + /** + * This function can be set to automatically get the next cursor for infinite queries. + * The result will also be used to determine the value of `hasNextPage`. + */ + getNextPageParam: GetNextPageParamFunction; +} +type ThrowOnError = boolean | ((error: TError, query: Query) => boolean); +interface QueryObserverOptions extends WithRequired, 'queryKey'> { + /** + * Set this to `false` or a function that returns `false` to disable automatic refetching when the query mounts or changes query keys. + * To refetch the query, use the `refetch` method returned from the `useQuery` instance. + * Accepts a boolean or function that returns a boolean. + * Defaults to `true`. + */ + enabled?: Enabled; + /** + * The time in milliseconds after data is considered stale. + * If set to `Infinity`, the data will never be considered stale. + * If set to a function, the function will be executed with the query to compute a `staleTime`. + * Defaults to `0`. + */ + staleTime?: StaleTimeFunction; + /** + * If set to a number, the query will continuously refetch at this frequency in milliseconds. + * If set to a function, the function will be executed with the latest data and query to compute a frequency + * Defaults to `false`. + */ + refetchInterval?: number | false | ((query: Query) => number | false | undefined); + /** + * If set to `true`, the query will continue to refetch while their tab/window is in the background. + * Defaults to `false`. + */ + refetchIntervalInBackground?: boolean; + /** + * If set to `true`, the query will refetch on window focus if the data is stale. + * If set to `false`, the query will not refetch on window focus. + * If set to `'always'`, the query will always refetch on window focus. + * If set to a function, the function will be executed with the latest data and query to compute the value. + * Defaults to `true`. + */ + refetchOnWindowFocus?: boolean | 'always' | ((query: Query) => boolean | 'always'); + /** + * If set to `true`, the query will refetch on reconnect if the data is stale. + * If set to `false`, the query will not refetch on reconnect. + * If set to `'always'`, the query will always refetch on reconnect. + * If set to a function, the function will be executed with the latest data and query to compute the value. + * Defaults to the value of `networkOnline` (`true`) + */ + refetchOnReconnect?: boolean | 'always' | ((query: Query) => boolean | 'always'); + /** + * If set to `true`, the query will refetch on mount if the data is stale. + * If set to `false`, will disable additional instances of a query to trigger background refetch. + * If set to `'always'`, the query will always refetch on mount. + * If set to a function, the function will be executed with the latest data and query to compute the value + * Defaults to `true`. + */ + refetchOnMount?: boolean | 'always' | ((query: Query) => boolean | 'always'); + /** + * If set to `false`, the query will not be retried on mount if it contains an error. + * Defaults to `true`. + */ + retryOnMount?: boolean; + /** + * If set, the component will only re-render if any of the listed properties change. + * When set to `['data', 'error']`, the component will only re-render when the `data` or `error` properties change. + * When set to `'all'`, the component will re-render whenever a query is updated. + * When set to a function, the function will be executed to compute the list of properties. + * By default, access to properties will be tracked, and the component will only re-render when one of the tracked properties change. + */ + notifyOnChangeProps?: NotifyOnChangeProps; + /** + * Whether errors should be thrown instead of setting the `error` property. + * If set to `true` or `suspense` is `true`, all errors will be thrown to the error boundary. + * If set to `false` and `suspense` is `false`, errors are returned as state. + * If set to a function, it will be passed the error and the query, and it should return a boolean indicating whether to show the error in an error boundary (`true`) or return the error as state (`false`). + * Defaults to `false`. + */ + throwOnError?: ThrowOnError; + /** + * This option can be used to transform or select a part of the data returned by the query function. + */ + select?: (data: TQueryData) => TData; + /** + * If set to `true`, the query will suspend when `status === 'pending'` + * and throw errors when `status === 'error'`. + * Defaults to `false`. + */ + suspense?: boolean; + /** + * If set, this value will be used as the placeholder data for this particular query observer while the query is still in the `loading` data and no initialData has been provided. + */ + placeholderData?: NonFunctionGuard | PlaceholderDataFunction, TError, NonFunctionGuard, TQueryKey>; + _optimisticResults?: 'optimistic' | 'isRestoring'; + /** + * Enable prefetching during rendering + */ + experimental_prefetchInRender?: boolean; +} +type WithRequired = TTarget & { + [_ in TKey]: {}; +}; +type DefaultedQueryObserverOptions = WithRequired, 'throwOnError' | 'refetchOnReconnect' | 'queryHash'>; +interface InfiniteQueryObserverOptions extends QueryObserverOptions, TQueryKey, TPageParam>, InfiniteQueryPageParamsOptions { +} +type DefaultedInfiniteQueryObserverOptions = WithRequired, 'throwOnError' | 'refetchOnReconnect' | 'queryHash'>; +interface FetchQueryOptions extends WithRequired, 'queryKey'> { + initialPageParam?: never; + /** + * The time in milliseconds after data is considered stale. + * If the data is fresh it will be returned from the cache. + */ + staleTime?: StaleTimeFunction; +} +interface EnsureQueryDataOptions extends FetchQueryOptions { + revalidateIfStale?: boolean; +} +type EnsureInfiniteQueryDataOptions = FetchInfiniteQueryOptions & { + revalidateIfStale?: boolean; +}; +type FetchInfiniteQueryPages = { + pages?: never; +} | { + pages: number; + getNextPageParam: GetNextPageParamFunction; +}; +type FetchInfiniteQueryOptions = Omit, TQueryKey, TPageParam>, 'initialPageParam'> & InitialPageParam & FetchInfiniteQueryPages; +interface ResultOptions { + throwOnError?: boolean; +} +interface RefetchOptions extends ResultOptions { + /** + * If set to `true`, a currently running request will be cancelled before a new request is made + * + * If set to `false`, no refetch will be made if there is already a request running. + * + * Defaults to `true`. + */ + cancelRefetch?: boolean; +} +interface InvalidateQueryFilters extends QueryFilters { + refetchType?: QueryTypeFilter | 'none'; +} +interface RefetchQueryFilters extends QueryFilters { +} +interface InvalidateOptions extends RefetchOptions { +} +interface ResetOptions extends RefetchOptions { +} +interface FetchNextPageOptions extends ResultOptions { + /** + * If set to `true`, calling `fetchNextPage` repeatedly will invoke `queryFn` every time, + * whether the previous invocation has resolved or not. Also, the result from previous invocations will be ignored. + * + * If set to `false`, calling `fetchNextPage` repeatedly won't have any effect until the first invocation has resolved. + * + * Defaults to `true`. + */ + cancelRefetch?: boolean; +} +interface FetchPreviousPageOptions extends ResultOptions { + /** + * If set to `true`, calling `fetchPreviousPage` repeatedly will invoke `queryFn` every time, + * whether the previous invocation has resolved or not. Also, the result from previous invocations will be ignored. + * + * If set to `false`, calling `fetchPreviousPage` repeatedly won't have any effect until the first invocation has resolved. + * + * Defaults to `true`. + */ + cancelRefetch?: boolean; +} +type QueryStatus = 'pending' | 'error' | 'success'; +type FetchStatus = 'fetching' | 'paused' | 'idle'; +interface QueryObserverBaseResult { + /** + * The last successfully resolved data for the query. + */ + data: TData | undefined; + /** + * The timestamp for when the query most recently returned the `status` as `"success"`. + */ + dataUpdatedAt: number; + /** + * The error object for the query, if an error was thrown. + * - Defaults to `null`. + */ + error: TError | null; + /** + * The timestamp for when the query most recently returned the `status` as `"error"`. + */ + errorUpdatedAt: number; + /** + * The failure count for the query. + * - Incremented every time the query fails. + * - Reset to `0` when the query succeeds. + */ + failureCount: number; + /** + * The failure reason for the query retry. + * - Reset to `null` when the query succeeds. + */ + failureReason: TError | null; + /** + * The sum of all errors. + */ + errorUpdateCount: number; + /** + * A derived boolean from the `status` variable, provided for convenience. + * - `true` if the query attempt resulted in an error. + */ + isError: boolean; + /** + * Will be `true` if the query has been fetched. + */ + isFetched: boolean; + /** + * Will be `true` if the query has been fetched after the component mounted. + * - This property can be used to not show any previously cached data. + */ + isFetchedAfterMount: boolean; + /** + * A derived boolean from the `fetchStatus` variable, provided for convenience. + * - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. + */ + isFetching: boolean; + /** + * Is `true` whenever the first fetch for a query is in-flight. + * - Is the same as `isFetching && isPending`. + */ + isLoading: boolean; + /** + * Will be `pending` if there's no cached data and no query attempt was finished yet. + */ + isPending: boolean; + /** + * Will be `true` if the query failed while fetching for the first time. + */ + isLoadingError: boolean; + /** + * @deprecated `isInitialLoading` is being deprecated in favor of `isLoading` + * and will be removed in the next major version. + */ + isInitialLoading: boolean; + /** + * A derived boolean from the `fetchStatus` variable, provided for convenience. + * - The query wanted to fetch, but has been `paused`. + */ + isPaused: boolean; + /** + * Will be `true` if the data shown is the placeholder data. + */ + isPlaceholderData: boolean; + /** + * Will be `true` if the query failed while refetching. + */ + isRefetchError: boolean; + /** + * Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. + * - Is the same as `isFetching && !isPending`. + */ + isRefetching: boolean; + /** + * Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. + */ + isStale: boolean; + /** + * A derived boolean from the `status` variable, provided for convenience. + * - `true` if the query has received a response with no errors and is ready to display its data. + */ + isSuccess: boolean; + /** + * `true` if this observer is enabled, `false` otherwise. + */ + isEnabled: boolean; + /** + * A function to manually refetch the query. + */ + refetch: (options?: RefetchOptions) => Promise>; + /** + * The status of the query. + * - Will be: + * - `pending` if there's no cached data and no query attempt was finished yet. + * - `error` if the query attempt resulted in an error. + * - `success` if the query has received a response with no errors and is ready to display its data. + */ + status: QueryStatus; + /** + * The fetch status of the query. + * - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. + * - `paused`: The query wanted to fetch, but has been `paused`. + * - `idle`: The query is not fetching. + * - See [Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information. + */ + fetchStatus: FetchStatus; + /** + * A stable promise that will be resolved with the data of the query. + * Requires the `experimental_prefetchInRender` feature flag to be enabled. + * @example + * + * ### Enabling the feature flag + * ```ts + * const client = new QueryClient({ + * defaultOptions: { + * queries: { + * experimental_prefetchInRender: true, + * }, + * }, + * }) + * ``` + * + * ### Usage + * ```tsx + * import { useQuery } from '@tanstack/react-query' + * import React from 'react' + * import { fetchTodos, type Todo } from './api' + * + * function TodoList({ query }: { query: UseQueryResult }) { + * const data = React.use(query.promise) + * + * return ( + *
    + * {data.map(todo => ( + *
  • {todo.title}
  • + * ))} + *
+ * ) + * } + * + * export function App() { + * const query = useQuery({ queryKey: ['todos'], queryFn: fetchTodos }) + * + * return ( + * <> + *

Todos

+ * Loading...}> + * + * + * + * ) + * } + * ``` + */ + promise: Promise; +} +interface QueryObserverPendingResult extends QueryObserverBaseResult { + data: undefined; + error: null; + isError: false; + isPending: true; + isLoadingError: false; + isRefetchError: false; + isSuccess: false; + isPlaceholderData: false; + status: 'pending'; +} +interface QueryObserverLoadingResult extends QueryObserverBaseResult { + data: undefined; + error: null; + isError: false; + isPending: true; + isLoading: true; + isLoadingError: false; + isRefetchError: false; + isSuccess: false; + isPlaceholderData: false; + status: 'pending'; +} +interface QueryObserverLoadingErrorResult extends QueryObserverBaseResult { + data: undefined; + error: TError; + isError: true; + isPending: false; + isLoading: false; + isLoadingError: true; + isRefetchError: false; + isSuccess: false; + isPlaceholderData: false; + status: 'error'; +} +interface QueryObserverRefetchErrorResult extends QueryObserverBaseResult { + data: TData; + error: TError; + isError: true; + isPending: false; + isLoading: false; + isLoadingError: false; + isRefetchError: true; + isSuccess: false; + isPlaceholderData: false; + status: 'error'; +} +interface QueryObserverSuccessResult extends QueryObserverBaseResult { + data: TData; + error: null; + isError: false; + isPending: false; + isLoading: false; + isLoadingError: false; + isRefetchError: false; + isSuccess: true; + isPlaceholderData: false; + status: 'success'; +} +interface QueryObserverPlaceholderResult extends QueryObserverBaseResult { + data: TData; + isError: false; + error: null; + isPending: false; + isLoading: false; + isLoadingError: false; + isRefetchError: false; + isSuccess: true; + isPlaceholderData: true; + status: 'success'; +} +type DefinedQueryObserverResult = QueryObserverRefetchErrorResult | QueryObserverSuccessResult; +type QueryObserverResult = DefinedQueryObserverResult | QueryObserverLoadingErrorResult | QueryObserverLoadingResult | QueryObserverPendingResult | QueryObserverPlaceholderResult; +interface InfiniteQueryObserverBaseResult extends QueryObserverBaseResult { + /** + * This function allows you to fetch the next "page" of results. + */ + fetchNextPage: (options?: FetchNextPageOptions) => Promise>; + /** + * This function allows you to fetch the previous "page" of results. + */ + fetchPreviousPage: (options?: FetchPreviousPageOptions) => Promise>; + /** + * Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). + */ + hasNextPage: boolean; + /** + * Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). + */ + hasPreviousPage: boolean; + /** + * Will be `true` if the query failed while fetching the next page. + */ + isFetchNextPageError: boolean; + /** + * Will be `true` while fetching the next page with `fetchNextPage`. + */ + isFetchingNextPage: boolean; + /** + * Will be `true` if the query failed while fetching the previous page. + */ + isFetchPreviousPageError: boolean; + /** + * Will be `true` while fetching the previous page with `fetchPreviousPage`. + */ + isFetchingPreviousPage: boolean; +} +interface InfiniteQueryObserverPendingResult extends InfiniteQueryObserverBaseResult { + data: undefined; + error: null; + isError: false; + isPending: true; + isLoadingError: false; + isRefetchError: false; + isFetchNextPageError: false; + isFetchPreviousPageError: false; + isSuccess: false; + isPlaceholderData: false; + status: 'pending'; +} +interface InfiniteQueryObserverLoadingResult extends InfiniteQueryObserverBaseResult { + data: undefined; + error: null; + isError: false; + isPending: true; + isLoading: true; + isLoadingError: false; + isRefetchError: false; + isFetchNextPageError: false; + isFetchPreviousPageError: false; + isSuccess: false; + isPlaceholderData: false; + status: 'pending'; +} +interface InfiniteQueryObserverLoadingErrorResult extends InfiniteQueryObserverBaseResult { + data: undefined; + error: TError; + isError: true; + isPending: false; + isLoading: false; + isLoadingError: true; + isRefetchError: false; + isFetchNextPageError: false; + isFetchPreviousPageError: false; + isSuccess: false; + isPlaceholderData: false; + status: 'error'; +} +interface InfiniteQueryObserverRefetchErrorResult extends InfiniteQueryObserverBaseResult { + data: TData; + error: TError; + isError: true; + isPending: false; + isLoading: false; + isLoadingError: false; + isRefetchError: true; + isSuccess: false; + isPlaceholderData: false; + status: 'error'; +} +interface InfiniteQueryObserverSuccessResult extends InfiniteQueryObserverBaseResult { + data: TData; + error: null; + isError: false; + isPending: false; + isLoading: false; + isLoadingError: false; + isRefetchError: false; + isFetchNextPageError: false; + isFetchPreviousPageError: false; + isSuccess: true; + isPlaceholderData: false; + status: 'success'; +} +interface InfiniteQueryObserverPlaceholderResult extends InfiniteQueryObserverBaseResult { + data: TData; + isError: false; + error: null; + isPending: false; + isLoading: false; + isLoadingError: false; + isRefetchError: false; + isSuccess: true; + isPlaceholderData: true; + isFetchNextPageError: false; + isFetchPreviousPageError: false; + status: 'success'; +} +type DefinedInfiniteQueryObserverResult = InfiniteQueryObserverRefetchErrorResult | InfiniteQueryObserverSuccessResult; +type InfiniteQueryObserverResult = DefinedInfiniteQueryObserverResult | InfiniteQueryObserverLoadingErrorResult | InfiniteQueryObserverLoadingResult | InfiniteQueryObserverPendingResult | InfiniteQueryObserverPlaceholderResult; +type MutationKey = Register extends { + mutationKey: infer TMutationKey; +} ? TMutationKey extends ReadonlyArray ? TMutationKey : TMutationKey extends Array ? TMutationKey : ReadonlyArray : ReadonlyArray; +type MutationStatus = 'idle' | 'pending' | 'success' | 'error'; +type MutationScope = { + id: string; +}; +type MutationMeta = Register extends { + mutationMeta: infer TMutationMeta; +} ? TMutationMeta extends Record ? TMutationMeta : Record : Record; +type MutationFunctionContext = { + client: QueryClient; + meta: MutationMeta | undefined; + mutationKey?: MutationKey; +}; +type MutationFunction = (variables: TVariables, context: MutationFunctionContext) => Promise; +interface MutationOptions { + mutationFn?: MutationFunction; + mutationKey?: MutationKey; + onMutate?: (variables: TVariables, context: MutationFunctionContext) => Promise | TOnMutateResult; + onSuccess?: (data: TData, variables: TVariables, onMutateResult: TOnMutateResult, context: MutationFunctionContext) => Promise | unknown; + onError?: (error: TError, variables: TVariables, onMutateResult: TOnMutateResult | undefined, context: MutationFunctionContext) => Promise | unknown; + onSettled?: (data: TData | undefined, error: TError | null, variables: TVariables, onMutateResult: TOnMutateResult | undefined, context: MutationFunctionContext) => Promise | unknown; + retry?: RetryValue; + retryDelay?: RetryDelayValue; + networkMode?: NetworkMode; + gcTime?: number; + _defaulted?: boolean; + meta?: MutationMeta; + scope?: MutationScope; +} +interface MutationObserverOptions extends MutationOptions { + throwOnError?: boolean | ((error: TError) => boolean); +} +interface MutateOptions { + onSuccess?: (data: TData, variables: TVariables, onMutateResult: TOnMutateResult | undefined, context: MutationFunctionContext) => void; + onError?: (error: TError, variables: TVariables, onMutateResult: TOnMutateResult | undefined, context: MutationFunctionContext) => void; + onSettled?: (data: TData | undefined, error: TError | null, variables: TVariables, onMutateResult: TOnMutateResult | undefined, context: MutationFunctionContext) => void; +} +type MutateFunction = (variables: TVariables, options?: MutateOptions) => Promise; +interface MutationObserverBaseResult extends MutationState { + /** + * The last successfully resolved data for the mutation. + */ + data: TData | undefined; + /** + * The variables object passed to the `mutationFn`. + */ + variables: TVariables | undefined; + /** + * The error object for the mutation, if an error was encountered. + * - Defaults to `null`. + */ + error: TError | null; + /** + * A boolean variable derived from `status`. + * - `true` if the last mutation attempt resulted in an error. + */ + isError: boolean; + /** + * A boolean variable derived from `status`. + * - `true` if the mutation is in its initial state prior to executing. + */ + isIdle: boolean; + /** + * A boolean variable derived from `status`. + * - `true` if the mutation is currently executing. + */ + isPending: boolean; + /** + * A boolean variable derived from `status`. + * - `true` if the last mutation attempt was successful. + */ + isSuccess: boolean; + /** + * The status of the mutation. + * - Will be: + * - `idle` initial status prior to the mutation function executing. + * - `pending` if the mutation is currently executing. + * - `error` if the last mutation attempt resulted in an error. + * - `success` if the last mutation attempt was successful. + */ + status: MutationStatus; + /** + * The mutation function you can call with variables to trigger the mutation and optionally hooks on additional callback options. + * @param variables - The variables object to pass to the `mutationFn`. + * @param options.onSuccess - This function will fire when the mutation is successful and will be passed the mutation's result. + * @param options.onError - This function will fire if the mutation encounters an error and will be passed the error. + * @param options.onSettled - This function will fire when the mutation is either successfully fetched or encounters an error and be passed either the data or error. + * @remarks + * - If you make multiple requests, `onSuccess` will fire only after the latest call you've made. + * - All the callback functions (`onSuccess`, `onError`, `onSettled`) are void functions, and the returned value will be ignored. + */ + mutate: MutateFunction; + /** + * A function to clean the mutation internal state (i.e., it resets the mutation to its initial state). + */ + reset: () => void; +} +interface MutationObserverIdleResult extends MutationObserverBaseResult { + data: undefined; + variables: undefined; + error: null; + isError: false; + isIdle: true; + isPending: false; + isSuccess: false; + status: 'idle'; +} +interface MutationObserverLoadingResult extends MutationObserverBaseResult { + data: undefined; + variables: TVariables; + error: null; + isError: false; + isIdle: false; + isPending: true; + isSuccess: false; + status: 'pending'; +} +interface MutationObserverErrorResult extends MutationObserverBaseResult { + data: undefined; + error: TError; + variables: TVariables; + isError: true; + isIdle: false; + isPending: false; + isSuccess: false; + status: 'error'; +} +interface MutationObserverSuccessResult extends MutationObserverBaseResult { + data: TData; + error: null; + variables: TVariables; + isError: false; + isIdle: false; + isPending: false; + isSuccess: true; + status: 'success'; +} +type MutationObserverResult = MutationObserverIdleResult | MutationObserverLoadingResult | MutationObserverErrorResult | MutationObserverSuccessResult; +interface QueryClientConfig { + queryCache?: QueryCache; + mutationCache?: MutationCache; + defaultOptions?: DefaultOptions; +} +interface DefaultOptions { + queries?: OmitKeyof, 'suspense' | 'queryKey'>; + mutations?: MutationObserverOptions; + hydrate?: HydrateOptions['defaultOptions']; + dehydrate?: DehydrateOptions; +} +interface CancelOptions { + revert?: boolean; + silent?: boolean; +} +interface SetDataOptions { + updatedAt?: number; +} +type NotifyEventType = 'added' | 'removed' | 'updated' | 'observerAdded' | 'observerRemoved' | 'observerResultsUpdated' | 'observerOptionsUpdated'; +interface NotifyEvent { + type: NotifyEventType; +} + +type TransformerFn = (data: any) => any; +interface DehydrateOptions { + serializeData?: TransformerFn; + shouldDehydrateMutation?: (mutation: Mutation) => boolean; + shouldDehydrateQuery?: (query: Query) => boolean; + shouldRedactErrors?: (error: unknown) => boolean; +} +interface HydrateOptions { + defaultOptions?: { + deserializeData?: TransformerFn; + queries?: QueryOptions; + mutations?: MutationOptions; + }; +} +interface DehydratedMutation { + mutationKey?: MutationKey; + state: MutationState; + meta?: MutationMeta; + scope?: MutationScope; +} +interface DehydratedQuery { + queryHash: string; + queryKey: QueryKey; + state: QueryState; + promise?: Promise; + meta?: QueryMeta; + dehydratedAt?: number; +} +interface DehydratedState { + mutations: Array; + queries: Array; +} +declare function defaultShouldDehydrateMutation(mutation: Mutation): boolean; +declare function defaultShouldDehydrateQuery(query: Query): boolean; +declare function dehydrate(client: QueryClient, options?: DehydrateOptions): DehydratedState; +declare function hydrate(client: QueryClient, dehydratedState: unknown, options?: HydrateOptions): void; + +export { type Enabled as $, type QueryState as A, type DistributiveOmit as B, CancelledError as C, type DehydratedState as D, type Override as E, type NoInfer as F, type DefaultError as G, type HydrateOptions as H, type QueryKey as I, dataTagSymbol as J, dataTagErrorSymbol as K, unsetMarker as L, MutationCache as M, type NonUndefinedGuard as N, type OmitKeyof as O, type UnsetMarker as P, QueryCache as Q, type Register as R, type SkipToken as S, type AnyDataTag as T, type Updater as U, type DataTag as V, type InferDataFromTag as W, type InferErrorFromTag as X, type QueryFunction as Y, type StaleTime as Z, type StaleTimeFunction as _, defaultShouldDehydrateQuery as a, type MutationObserverBaseResult as a$, type QueryPersister as a0, type QueryFunctionContext as a1, type InitialDataFunction as a2, type PlaceholderDataFunction as a3, type QueriesPlaceholderDataFunction as a4, type QueryKeyHashFunction as a5, type GetPreviousPageParamFunction as a6, type GetNextPageParamFunction as a7, type InfiniteData as a8, type QueryMeta as a9, type QueryObserverPendingResult as aA, type QueryObserverLoadingResult as aB, type QueryObserverLoadingErrorResult as aC, type QueryObserverRefetchErrorResult as aD, type QueryObserverSuccessResult as aE, type QueryObserverPlaceholderResult as aF, type DefinedQueryObserverResult as aG, type QueryObserverResult as aH, type InfiniteQueryObserverBaseResult as aI, type InfiniteQueryObserverPendingResult as aJ, type InfiniteQueryObserverLoadingResult as aK, type InfiniteQueryObserverLoadingErrorResult as aL, type InfiniteQueryObserverRefetchErrorResult as aM, type InfiniteQueryObserverSuccessResult as aN, type InfiniteQueryObserverPlaceholderResult as aO, type DefinedInfiniteQueryObserverResult as aP, type InfiniteQueryObserverResult as aQ, type MutationKey as aR, type MutationStatus as aS, type MutationScope as aT, type MutationMeta as aU, type MutationFunctionContext as aV, type MutationFunction as aW, type MutationOptions as aX, type MutationObserverOptions as aY, type MutateOptions as aZ, type MutateFunction as a_, type NetworkMode as aa, type NotifyOnChangeProps as ab, type QueryOptions as ac, type InitialPageParam as ad, type InfiniteQueryPageParamsOptions as ae, type ThrowOnError as af, type QueryObserverOptions as ag, type WithRequired as ah, type DefaultedQueryObserverOptions as ai, type InfiniteQueryObserverOptions as aj, type DefaultedInfiniteQueryObserverOptions as ak, type FetchQueryOptions as al, type EnsureQueryDataOptions as am, type EnsureInfiniteQueryDataOptions as an, type FetchInfiniteQueryOptions as ao, type ResultOptions as ap, type RefetchOptions as aq, type InvalidateQueryFilters as ar, type RefetchQueryFilters as as, type InvalidateOptions as at, type ResetOptions as au, type FetchNextPageOptions as av, type FetchPreviousPageOptions as aw, type QueryStatus as ax, type FetchStatus as ay, type QueryObserverBaseResult as az, dehydrate as b, type MutationObserverIdleResult as b0, type MutationObserverLoadingResult as b1, type MutationObserverErrorResult as b2, type MutationObserverSuccessResult as b3, type MutationObserverResult as b4, type QueryClientConfig as b5, type DefaultOptions as b6, type CancelOptions as b7, type SetDataOptions as b8, type NotifyEventType as b9, addConsumeAwareSignal as bA, type QueryStore as bB, type Retryer as bC, type RetryValue as bD, type RetryDelayValue as bE, canFetch as bF, createRetryer as bG, type NotifyEvent as ba, type QueryBehavior as bb, type FetchContext as bc, type FetchDirection as bd, type FetchMeta as be, type FetchOptions as bf, type Action$1 as bg, type SetStateOptions as bh, fetchState as bi, type Action as bj, getDefaultState as bk, type QueryTypeFilter as bl, functionalUpdate as bm, isValidTimeout as bn, timeUntilStale as bo, resolveStaleTime as bp, resolveEnabled as bq, hashQueryKeyByOptions as br, shallowEqualObjects as bs, isPlainArray as bt, isPlainObject as bu, sleep as bv, replaceData as bw, addToEnd as bx, addToStart as by, ensureQueryFn as bz, type MutationCacheNotifyEvent as c, defaultShouldDehydrateMutation as d, MutationObserver as e, type QueryCacheNotifyEvent as f, QueryClient as g, hydrate as h, QueryObserver as i, isCancelledError as j, hashKey as k, isServer as l, keepPreviousData as m, matchMutation as n, matchQuery as o, noop as p, partialMatchKey as q, replaceEqualDeep as r, shouldThrowError as s, skipToken as t, type MutationFilters as u, type QueryFilters as v, type DehydrateOptions as w, Mutation as x, type MutationState as y, Query as z }; diff --git a/node_modules/@tanstack/query-core/build/legacy/hydration.cjs b/node_modules/@tanstack/query-core/build/legacy/hydration.cjs new file mode 100644 index 0000000..0b89027 --- /dev/null +++ b/node_modules/@tanstack/query-core/build/legacy/hydration.cjs @@ -0,0 +1,178 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/hydration.ts +var hydration_exports = {}; +__export(hydration_exports, { + defaultShouldDehydrateMutation: () => defaultShouldDehydrateMutation, + defaultShouldDehydrateQuery: () => defaultShouldDehydrateQuery, + dehydrate: () => dehydrate, + hydrate: () => hydrate +}); +module.exports = __toCommonJS(hydration_exports); +var import_thenable = require("./thenable.cjs"); +var import_utils = require("./utils.cjs"); +function defaultTransformerFn(data) { + return data; +} +function dehydrateMutation(mutation) { + return { + mutationKey: mutation.options.mutationKey, + state: mutation.state, + ...mutation.options.scope && { scope: mutation.options.scope }, + ...mutation.meta && { meta: mutation.meta } + }; +} +function dehydrateQuery(query, serializeData, shouldRedactErrors) { + const dehydratePromise = () => { + var _a; + const promise = (_a = query.promise) == null ? void 0 : _a.then(serializeData).catch((error) => { + if (!shouldRedactErrors(error)) { + return Promise.reject(error); + } + if (process.env.NODE_ENV !== "production") { + console.error( + `A query that was dehydrated as pending ended up rejecting. [${query.queryHash}]: ${error}; The error will be redacted in production builds` + ); + } + return Promise.reject(new Error("redacted")); + }); + promise == null ? void 0 : promise.catch(import_utils.noop); + return promise; + }; + return { + dehydratedAt: Date.now(), + state: { + ...query.state, + ...query.state.data !== void 0 && { + data: serializeData(query.state.data) + } + }, + queryKey: query.queryKey, + queryHash: query.queryHash, + ...query.state.status === "pending" && { + promise: dehydratePromise() + }, + ...query.meta && { meta: query.meta } + }; +} +function defaultShouldDehydrateMutation(mutation) { + return mutation.state.isPaused; +} +function defaultShouldDehydrateQuery(query) { + return query.state.status === "success"; +} +function defaultShouldRedactErrors(_) { + return true; +} +function dehydrate(client, options = {}) { + var _a, _b, _c, _d; + const filterMutation = options.shouldDehydrateMutation ?? ((_a = client.getDefaultOptions().dehydrate) == null ? void 0 : _a.shouldDehydrateMutation) ?? defaultShouldDehydrateMutation; + const mutations = client.getMutationCache().getAll().flatMap( + (mutation) => filterMutation(mutation) ? [dehydrateMutation(mutation)] : [] + ); + const filterQuery = options.shouldDehydrateQuery ?? ((_b = client.getDefaultOptions().dehydrate) == null ? void 0 : _b.shouldDehydrateQuery) ?? defaultShouldDehydrateQuery; + const shouldRedactErrors = options.shouldRedactErrors ?? ((_c = client.getDefaultOptions().dehydrate) == null ? void 0 : _c.shouldRedactErrors) ?? defaultShouldRedactErrors; + const serializeData = options.serializeData ?? ((_d = client.getDefaultOptions().dehydrate) == null ? void 0 : _d.serializeData) ?? defaultTransformerFn; + const queries = client.getQueryCache().getAll().flatMap( + (query) => filterQuery(query) ? [dehydrateQuery(query, serializeData, shouldRedactErrors)] : [] + ); + return { mutations, queries }; +} +function hydrate(client, dehydratedState, options) { + var _a, _b; + if (typeof dehydratedState !== "object" || dehydratedState === null) { + return; + } + const mutationCache = client.getMutationCache(); + const queryCache = client.getQueryCache(); + const deserializeData = ((_a = options == null ? void 0 : options.defaultOptions) == null ? void 0 : _a.deserializeData) ?? ((_b = client.getDefaultOptions().hydrate) == null ? void 0 : _b.deserializeData) ?? defaultTransformerFn; + const mutations = dehydratedState.mutations || []; + const queries = dehydratedState.queries || []; + mutations.forEach(({ state, ...mutationOptions }) => { + var _a2, _b2; + mutationCache.build( + client, + { + ...(_a2 = client.getDefaultOptions().hydrate) == null ? void 0 : _a2.mutations, + ...(_b2 = options == null ? void 0 : options.defaultOptions) == null ? void 0 : _b2.mutations, + ...mutationOptions + }, + state + ); + }); + queries.forEach( + ({ queryKey, state, queryHash, meta, promise, dehydratedAt }) => { + var _a2, _b2; + const syncData = promise ? (0, import_thenable.tryResolveSync)(promise) : void 0; + const rawData = state.data === void 0 ? syncData == null ? void 0 : syncData.data : state.data; + const data = rawData === void 0 ? rawData : deserializeData(rawData); + let query = queryCache.get(queryHash); + const existingQueryIsPending = (query == null ? void 0 : query.state.status) === "pending"; + const existingQueryIsFetching = (query == null ? void 0 : query.state.fetchStatus) === "fetching"; + if (query) { + const hasNewerSyncData = syncData && // We only need this undefined check to handle older dehydration + // payloads that might not have dehydratedAt + dehydratedAt !== void 0 && dehydratedAt > query.state.dataUpdatedAt; + if (state.dataUpdatedAt > query.state.dataUpdatedAt || hasNewerSyncData) { + const { fetchStatus: _ignored, ...serializedState } = state; + query.setState({ + ...serializedState, + data + }); + } + } else { + query = queryCache.build( + client, + { + ...(_a2 = client.getDefaultOptions().hydrate) == null ? void 0 : _a2.queries, + ...(_b2 = options == null ? void 0 : options.defaultOptions) == null ? void 0 : _b2.queries, + queryKey, + queryHash, + meta + }, + // Reset fetch status to idle to avoid + // query being stuck in fetching state upon hydration + { + ...state, + data, + fetchStatus: "idle", + status: data !== void 0 ? "success" : state.status + } + ); + } + if (promise && !existingQueryIsPending && !existingQueryIsFetching && // Only hydrate if dehydration is newer than any existing data, + // this is always true for new queries + (dehydratedAt === void 0 || dehydratedAt > query.state.dataUpdatedAt)) { + query.fetch(void 0, { + // RSC transformed promises are not thenable + initialPromise: Promise.resolve(promise).then(deserializeData) + }).catch(import_utils.noop); + } + } + ); +} +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + defaultShouldDehydrateMutation, + defaultShouldDehydrateQuery, + dehydrate, + hydrate +}); +//# sourceMappingURL=hydration.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/hydration.cjs.map b/node_modules/@tanstack/query-core/build/legacy/hydration.cjs.map new file mode 100644 index 0000000..9e429d3 --- /dev/null +++ b/node_modules/@tanstack/query-core/build/legacy/hydration.cjs.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/hydration.ts"],"sourcesContent":["import { tryResolveSync } from './thenable'\nimport { noop } from './utils'\nimport type {\n DefaultError,\n MutationKey,\n MutationMeta,\n MutationOptions,\n MutationScope,\n QueryKey,\n QueryMeta,\n QueryOptions,\n} from './types'\nimport type { QueryClient } from './queryClient'\nimport type { Query, QueryState } from './query'\nimport type { Mutation, MutationState } from './mutation'\n\n// TYPES\ntype TransformerFn = (data: any) => any\nfunction defaultTransformerFn(data: any): any {\n return data\n}\n\nexport interface DehydrateOptions {\n serializeData?: TransformerFn\n shouldDehydrateMutation?: (mutation: Mutation) => boolean\n shouldDehydrateQuery?: (query: Query) => boolean\n shouldRedactErrors?: (error: unknown) => boolean\n}\n\nexport interface HydrateOptions {\n defaultOptions?: {\n deserializeData?: TransformerFn\n queries?: QueryOptions\n mutations?: MutationOptions\n }\n}\n\ninterface DehydratedMutation {\n mutationKey?: MutationKey\n state: MutationState\n meta?: MutationMeta\n scope?: MutationScope\n}\n\ninterface DehydratedQuery {\n queryHash: string\n queryKey: QueryKey\n state: QueryState\n promise?: Promise\n meta?: QueryMeta\n // This is only optional because older versions of Query might have dehydrated\n // without it which we need to handle for backwards compatibility.\n // This should be changed to required in the future.\n dehydratedAt?: number\n}\n\nexport interface DehydratedState {\n mutations: Array\n queries: Array\n}\n\n// FUNCTIONS\n\nfunction dehydrateMutation(mutation: Mutation): DehydratedMutation {\n return {\n mutationKey: mutation.options.mutationKey,\n state: mutation.state,\n ...(mutation.options.scope && { scope: mutation.options.scope }),\n ...(mutation.meta && { meta: mutation.meta }),\n }\n}\n\n// Most config is not dehydrated but instead meant to configure again when\n// consuming the de/rehydrated data, typically with useQuery on the client.\n// Sometimes it might make sense to prefetch data on the server and include\n// in the html-payload, but not consume it on the initial render.\nfunction dehydrateQuery(\n query: Query,\n serializeData: TransformerFn,\n shouldRedactErrors: (error: unknown) => boolean,\n): DehydratedQuery {\n const dehydratePromise = () => {\n const promise = query.promise?.then(serializeData).catch((error) => {\n if (!shouldRedactErrors(error)) {\n // Reject original error if it should not be redacted\n return Promise.reject(error)\n }\n // If not in production, log original error before rejecting redacted error\n if (process.env.NODE_ENV !== 'production') {\n console.error(\n `A query that was dehydrated as pending ended up rejecting. [${query.queryHash}]: ${error}; The error will be redacted in production builds`,\n )\n }\n return Promise.reject(new Error('redacted'))\n })\n\n // Avoid unhandled promise rejections\n // We need the promise we dehydrate to reject to get the correct result into\n // the query cache, but we also want to avoid unhandled promise rejections\n // in whatever environment the prefetches are happening in.\n promise?.catch(noop)\n\n return promise\n }\n\n return {\n dehydratedAt: Date.now(),\n state: {\n ...query.state,\n ...(query.state.data !== undefined && {\n data: serializeData(query.state.data),\n }),\n },\n queryKey: query.queryKey,\n queryHash: query.queryHash,\n ...(query.state.status === 'pending' && {\n promise: dehydratePromise(),\n }),\n ...(query.meta && { meta: query.meta }),\n }\n}\n\nexport function defaultShouldDehydrateMutation(mutation: Mutation) {\n return mutation.state.isPaused\n}\n\nexport function defaultShouldDehydrateQuery(query: Query) {\n return query.state.status === 'success'\n}\n\nfunction defaultShouldRedactErrors(_: unknown) {\n return true\n}\n\nexport function dehydrate(\n client: QueryClient,\n options: DehydrateOptions = {},\n): DehydratedState {\n const filterMutation =\n options.shouldDehydrateMutation ??\n client.getDefaultOptions().dehydrate?.shouldDehydrateMutation ??\n defaultShouldDehydrateMutation\n\n const mutations = client\n .getMutationCache()\n .getAll()\n .flatMap((mutation) =>\n filterMutation(mutation) ? [dehydrateMutation(mutation)] : [],\n )\n\n const filterQuery =\n options.shouldDehydrateQuery ??\n client.getDefaultOptions().dehydrate?.shouldDehydrateQuery ??\n defaultShouldDehydrateQuery\n\n const shouldRedactErrors =\n options.shouldRedactErrors ??\n client.getDefaultOptions().dehydrate?.shouldRedactErrors ??\n defaultShouldRedactErrors\n\n const serializeData =\n options.serializeData ??\n client.getDefaultOptions().dehydrate?.serializeData ??\n defaultTransformerFn\n\n const queries = client\n .getQueryCache()\n .getAll()\n .flatMap((query) =>\n filterQuery(query)\n ? [dehydrateQuery(query, serializeData, shouldRedactErrors)]\n : [],\n )\n\n return { mutations, queries }\n}\n\nexport function hydrate(\n client: QueryClient,\n dehydratedState: unknown,\n options?: HydrateOptions,\n): void {\n if (typeof dehydratedState !== 'object' || dehydratedState === null) {\n return\n }\n\n const mutationCache = client.getMutationCache()\n const queryCache = client.getQueryCache()\n const deserializeData =\n options?.defaultOptions?.deserializeData ??\n client.getDefaultOptions().hydrate?.deserializeData ??\n defaultTransformerFn\n\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n const mutations = (dehydratedState as DehydratedState).mutations || []\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n const queries = (dehydratedState as DehydratedState).queries || []\n\n mutations.forEach(({ state, ...mutationOptions }) => {\n mutationCache.build(\n client,\n {\n ...client.getDefaultOptions().hydrate?.mutations,\n ...options?.defaultOptions?.mutations,\n ...mutationOptions,\n },\n state,\n )\n })\n\n queries.forEach(\n ({ queryKey, state, queryHash, meta, promise, dehydratedAt }) => {\n const syncData = promise ? tryResolveSync(promise) : undefined\n const rawData = state.data === undefined ? syncData?.data : state.data\n const data = rawData === undefined ? rawData : deserializeData(rawData)\n\n let query = queryCache.get(queryHash)\n const existingQueryIsPending = query?.state.status === 'pending'\n const existingQueryIsFetching = query?.state.fetchStatus === 'fetching'\n\n // Do not hydrate if an existing query exists with newer data\n if (query) {\n const hasNewerSyncData =\n syncData &&\n // We only need this undefined check to handle older dehydration\n // payloads that might not have dehydratedAt\n dehydratedAt !== undefined &&\n dehydratedAt > query.state.dataUpdatedAt\n if (\n state.dataUpdatedAt > query.state.dataUpdatedAt ||\n hasNewerSyncData\n ) {\n // omit fetchStatus from dehydrated state\n // so that query stays in its current fetchStatus\n const { fetchStatus: _ignored, ...serializedState } = state\n query.setState({\n ...serializedState,\n data,\n })\n }\n } else {\n // Restore query\n query = queryCache.build(\n client,\n {\n ...client.getDefaultOptions().hydrate?.queries,\n ...options?.defaultOptions?.queries,\n queryKey,\n queryHash,\n meta,\n },\n // Reset fetch status to idle to avoid\n // query being stuck in fetching state upon hydration\n {\n ...state,\n data,\n fetchStatus: 'idle',\n status: data !== undefined ? 'success' : state.status,\n },\n )\n }\n\n if (\n promise &&\n !existingQueryIsPending &&\n !existingQueryIsFetching &&\n // Only hydrate if dehydration is newer than any existing data,\n // this is always true for new queries\n (dehydratedAt === undefined || dehydratedAt > query.state.dataUpdatedAt)\n ) {\n // This doesn't actually fetch - it just creates a retryer\n // which will re-use the passed `initialPromise`\n // Note that we need to call these even when data was synchronously\n // available, as we still need to set up the retryer\n query\n .fetch(undefined, {\n // RSC transformed promises are not thenable\n initialPromise: Promise.resolve(promise).then(deserializeData),\n })\n // Avoid unhandled promise rejections\n .catch(noop)\n }\n },\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,sBAA+B;AAC/B,mBAAqB;AAiBrB,SAAS,qBAAqB,MAAgB;AAC5C,SAAO;AACT;AA2CA,SAAS,kBAAkB,UAAwC;AACjE,SAAO;AAAA,IACL,aAAa,SAAS,QAAQ;AAAA,IAC9B,OAAO,SAAS;AAAA,IAChB,GAAI,SAAS,QAAQ,SAAS,EAAE,OAAO,SAAS,QAAQ,MAAM;AAAA,IAC9D,GAAI,SAAS,QAAQ,EAAE,MAAM,SAAS,KAAK;AAAA,EAC7C;AACF;AAMA,SAAS,eACP,OACA,eACA,oBACiB;AACjB,QAAM,mBAAmB,MAAM;AAjFjC;AAkFI,UAAM,WAAU,WAAM,YAAN,mBAAe,KAAK,eAAe,MAAM,CAAC,UAAU;AAClE,UAAI,CAAC,mBAAmB,KAAK,GAAG;AAE9B,eAAO,QAAQ,OAAO,KAAK;AAAA,MAC7B;AAEA,UAAI,QAAQ,IAAI,aAAa,cAAc;AACzC,gBAAQ;AAAA,UACN,+DAA+D,MAAM,SAAS,MAAM,KAAK;AAAA,QAC3F;AAAA,MACF;AACA,aAAO,QAAQ,OAAO,IAAI,MAAM,UAAU,CAAC;AAAA,IAC7C;AAMA,uCAAS,MAAM;AAEf,WAAO;AAA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,SAAS;AAAA,YACb,GAAG;AAAA,YACH;AAAA,UACF,CAAC;AAAA,QACH;AAAA,MACF,OAAO;AAEL,gBAAQ,WAAW;AAAA,UACjB;AAAA,UACA;AAAA,YACE,IAAGD,MAAA,OAAO,kBAAkB,EAAE,YAA3B,gBAAAA,IAAoC;AAAA,YACvC,IAAGC,MAAA,mCAAS,mBAAT,gBAAAA,IAAyB;AAAA,YAC5B;AAAA,YACA;AAAA,YACA;AAAA,UACF;AAAA;AAAA;AAAA,UAGA;AAAA,YACE,GAAG;AAAA,YACH;AAAA,YACA,aAAa;AAAA,YACb,QAAQ,SAAS,SAAY,YAAY,MAAM;AAAA,UACjD;AAAA,QACF;AAAA,MACF;AAEA,UACE,WACA,CAAC,0BACD,CAAC;AAAA;AAAA,OAGA,iBAAiB,UAAa,eAAe,MAAM,MAAM,gBAC1D;AAKA,cACG,MAAM,QAAW;AAAA;AAAA,UAEhB,gBAAgB,QAAQ,QAAQ,OAAO,EAAE,KAAK,eAAe;AAAA,QAC/D,CAAC,EAEA,MAAM,iBAAI;AAAA,MACf;AAAA,IACF;AAAA,EACF;AACF;","names":["_a","_b"]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/hydration.d.cts b/node_modules/@tanstack/query-core/build/legacy/hydration.d.cts new file mode 100644 index 0000000..1681473 --- /dev/null +++ b/node_modules/@tanstack/query-core/build/legacy/hydration.d.cts @@ -0,0 +1,3 @@ +export { w as DehydrateOptions, D as DehydratedState, H as HydrateOptions, d as defaultShouldDehydrateMutation, a as defaultShouldDehydrateQuery, b as dehydrate, h as hydrate } from './hydration-uphG6M-i.cjs'; +import './removable.cjs'; +import './subscribable.cjs'; diff --git a/node_modules/@tanstack/query-core/build/legacy/hydration.d.ts b/node_modules/@tanstack/query-core/build/legacy/hydration.d.ts new file mode 100644 index 0000000..e507d39 --- /dev/null +++ b/node_modules/@tanstack/query-core/build/legacy/hydration.d.ts @@ -0,0 +1,3 @@ +export { w as DehydrateOptions, D as DehydratedState, H as HydrateOptions, d as defaultShouldDehydrateMutation, a as defaultShouldDehydrateQuery, b as dehydrate, h as hydrate } from './hydration-BlEVG2Lp.js'; +import './removable.js'; +import './subscribable.js'; diff --git a/node_modules/@tanstack/query-core/build/legacy/hydration.js b/node_modules/@tanstack/query-core/build/legacy/hydration.js new file mode 100644 index 0000000..97cebe7 --- /dev/null +++ b/node_modules/@tanstack/query-core/build/legacy/hydration.js @@ -0,0 +1,152 @@ +import "./chunk-PXG64RU4.js"; + +// src/hydration.ts +import { tryResolveSync } from "./thenable.js"; +import { noop } from "./utils.js"; +function defaultTransformerFn(data) { + return data; +} +function dehydrateMutation(mutation) { + return { + mutationKey: mutation.options.mutationKey, + state: mutation.state, + ...mutation.options.scope && { scope: mutation.options.scope }, + ...mutation.meta && { meta: mutation.meta } + }; +} +function dehydrateQuery(query, serializeData, shouldRedactErrors) { + const dehydratePromise = () => { + var _a; + const promise = (_a = query.promise) == null ? void 0 : _a.then(serializeData).catch((error) => { + if (!shouldRedactErrors(error)) { + return Promise.reject(error); + } + if (process.env.NODE_ENV !== "production") { + console.error( + `A query that was dehydrated as pending ended up rejecting. [${query.queryHash}]: ${error}; The error will be redacted in production builds` + ); + } + return Promise.reject(new Error("redacted")); + }); + promise == null ? void 0 : promise.catch(noop); + return promise; + }; + return { + dehydratedAt: Date.now(), + state: { + ...query.state, + ...query.state.data !== void 0 && { + data: serializeData(query.state.data) + } + }, + queryKey: query.queryKey, + queryHash: query.queryHash, + ...query.state.status === "pending" && { + promise: dehydratePromise() + }, + ...query.meta && { meta: query.meta } + }; +} +function defaultShouldDehydrateMutation(mutation) { + return mutation.state.isPaused; +} +function defaultShouldDehydrateQuery(query) { + return query.state.status === "success"; +} +function defaultShouldRedactErrors(_) { + return true; +} +function dehydrate(client, options = {}) { + var _a, _b, _c, _d; + const filterMutation = options.shouldDehydrateMutation ?? ((_a = client.getDefaultOptions().dehydrate) == null ? void 0 : _a.shouldDehydrateMutation) ?? defaultShouldDehydrateMutation; + const mutations = client.getMutationCache().getAll().flatMap( + (mutation) => filterMutation(mutation) ? [dehydrateMutation(mutation)] : [] + ); + const filterQuery = options.shouldDehydrateQuery ?? ((_b = client.getDefaultOptions().dehydrate) == null ? void 0 : _b.shouldDehydrateQuery) ?? defaultShouldDehydrateQuery; + const shouldRedactErrors = options.shouldRedactErrors ?? ((_c = client.getDefaultOptions().dehydrate) == null ? void 0 : _c.shouldRedactErrors) ?? defaultShouldRedactErrors; + const serializeData = options.serializeData ?? ((_d = client.getDefaultOptions().dehydrate) == null ? void 0 : _d.serializeData) ?? defaultTransformerFn; + const queries = client.getQueryCache().getAll().flatMap( + (query) => filterQuery(query) ? [dehydrateQuery(query, serializeData, shouldRedactErrors)] : [] + ); + return { mutations, queries }; +} +function hydrate(client, dehydratedState, options) { + var _a, _b; + if (typeof dehydratedState !== "object" || dehydratedState === null) { + return; + } + const mutationCache = client.getMutationCache(); + const queryCache = client.getQueryCache(); + const deserializeData = ((_a = options == null ? void 0 : options.defaultOptions) == null ? void 0 : _a.deserializeData) ?? ((_b = client.getDefaultOptions().hydrate) == null ? void 0 : _b.deserializeData) ?? defaultTransformerFn; + const mutations = dehydratedState.mutations || []; + const queries = dehydratedState.queries || []; + mutations.forEach(({ state, ...mutationOptions }) => { + var _a2, _b2; + mutationCache.build( + client, + { + ...(_a2 = client.getDefaultOptions().hydrate) == null ? void 0 : _a2.mutations, + ...(_b2 = options == null ? void 0 : options.defaultOptions) == null ? void 0 : _b2.mutations, + ...mutationOptions + }, + state + ); + }); + queries.forEach( + ({ queryKey, state, queryHash, meta, promise, dehydratedAt }) => { + var _a2, _b2; + const syncData = promise ? tryResolveSync(promise) : void 0; + const rawData = state.data === void 0 ? syncData == null ? void 0 : syncData.data : state.data; + const data = rawData === void 0 ? rawData : deserializeData(rawData); + let query = queryCache.get(queryHash); + const existingQueryIsPending = (query == null ? void 0 : query.state.status) === "pending"; + const existingQueryIsFetching = (query == null ? void 0 : query.state.fetchStatus) === "fetching"; + if (query) { + const hasNewerSyncData = syncData && // We only need this undefined check to handle older dehydration + // payloads that might not have dehydratedAt + dehydratedAt !== void 0 && dehydratedAt > query.state.dataUpdatedAt; + if (state.dataUpdatedAt > query.state.dataUpdatedAt || hasNewerSyncData) { + const { fetchStatus: _ignored, ...serializedState } = state; + query.setState({ + ...serializedState, + data + }); + } + } else { + query = queryCache.build( + client, + { + ...(_a2 = client.getDefaultOptions().hydrate) == null ? void 0 : _a2.queries, + ...(_b2 = options == null ? void 0 : options.defaultOptions) == null ? void 0 : _b2.queries, + queryKey, + queryHash, + meta + }, + // Reset fetch status to idle to avoid + // query being stuck in fetching state upon hydration + { + ...state, + data, + fetchStatus: "idle", + status: data !== void 0 ? "success" : state.status + } + ); + } + if (promise && !existingQueryIsPending && !existingQueryIsFetching && // Only hydrate if dehydration is newer than any existing data, + // this is always true for new queries + (dehydratedAt === void 0 || dehydratedAt > query.state.dataUpdatedAt)) { + query.fetch(void 0, { + // RSC transformed promises are not thenable + initialPromise: Promise.resolve(promise).then(deserializeData) + }).catch(noop); + } + } + ); +} +export { + defaultShouldDehydrateMutation, + defaultShouldDehydrateQuery, + dehydrate, + hydrate +}; +//# sourceMappingURL=hydration.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/hydration.js.map b/node_modules/@tanstack/query-core/build/legacy/hydration.js.map new file mode 100644 index 0000000..c3c8a89 --- /dev/null +++ b/node_modules/@tanstack/query-core/build/legacy/hydration.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/hydration.ts"],"sourcesContent":["import { tryResolveSync } from './thenable'\nimport { noop } from './utils'\nimport type {\n DefaultError,\n MutationKey,\n MutationMeta,\n MutationOptions,\n MutationScope,\n QueryKey,\n QueryMeta,\n QueryOptions,\n} from './types'\nimport type { QueryClient } from './queryClient'\nimport type { Query, QueryState } from './query'\nimport type { Mutation, MutationState } from './mutation'\n\n// TYPES\ntype TransformerFn = (data: any) => any\nfunction defaultTransformerFn(data: any): any {\n return data\n}\n\nexport interface DehydrateOptions {\n serializeData?: TransformerFn\n shouldDehydrateMutation?: (mutation: Mutation) => boolean\n shouldDehydrateQuery?: (query: Query) => boolean\n shouldRedactErrors?: (error: unknown) => boolean\n}\n\nexport interface HydrateOptions {\n defaultOptions?: {\n deserializeData?: TransformerFn\n queries?: QueryOptions\n mutations?: MutationOptions\n }\n}\n\ninterface DehydratedMutation {\n mutationKey?: MutationKey\n state: MutationState\n meta?: MutationMeta\n scope?: MutationScope\n}\n\ninterface DehydratedQuery {\n queryHash: string\n queryKey: QueryKey\n state: QueryState\n promise?: Promise\n meta?: QueryMeta\n // This is only optional because older versions of Query might have dehydrated\n // without it which we need to handle for backwards compatibility.\n // This should be changed to required in the future.\n dehydratedAt?: number\n}\n\nexport interface DehydratedState {\n mutations: Array\n queries: Array\n}\n\n// FUNCTIONS\n\nfunction dehydrateMutation(mutation: Mutation): DehydratedMutation {\n return {\n mutationKey: mutation.options.mutationKey,\n state: mutation.state,\n ...(mutation.options.scope && { scope: mutation.options.scope }),\n ...(mutation.meta && { meta: mutation.meta }),\n }\n}\n\n// Most config is not dehydrated but instead meant to configure again when\n// consuming the de/rehydrated data, typically with useQuery on the client.\n// Sometimes it might make sense to prefetch data on the server and include\n// in the html-payload, but not consume it on the initial render.\nfunction dehydrateQuery(\n query: Query,\n serializeData: TransformerFn,\n shouldRedactErrors: (error: unknown) => boolean,\n): DehydratedQuery {\n const dehydratePromise = () => {\n const promise = query.promise?.then(serializeData).catch((error) => {\n if (!shouldRedactErrors(error)) {\n // Reject original error if it should not be redacted\n return Promise.reject(error)\n }\n // If not in production, log original error before rejecting redacted error\n if (process.env.NODE_ENV !== 'production') {\n console.error(\n `A query that was dehydrated as pending ended up rejecting. [${query.queryHash}]: ${error}; The error will be redacted in production builds`,\n )\n }\n return Promise.reject(new Error('redacted'))\n })\n\n // Avoid unhandled promise rejections\n // We need the promise we dehydrate to reject to get the correct result into\n // the query cache, but we also want to avoid unhandled promise rejections\n // in whatever environment the prefetches are happening in.\n promise?.catch(noop)\n\n return promise\n }\n\n return {\n dehydratedAt: Date.now(),\n state: {\n ...query.state,\n ...(query.state.data !== undefined && {\n data: serializeData(query.state.data),\n }),\n },\n queryKey: query.queryKey,\n queryHash: query.queryHash,\n ...(query.state.status === 'pending' && {\n promise: dehydratePromise(),\n }),\n ...(query.meta && { meta: query.meta }),\n }\n}\n\nexport function defaultShouldDehydrateMutation(mutation: Mutation) {\n return mutation.state.isPaused\n}\n\nexport function defaultShouldDehydrateQuery(query: Query) {\n return query.state.status === 'success'\n}\n\nfunction defaultShouldRedactErrors(_: unknown) {\n return true\n}\n\nexport function dehydrate(\n client: QueryClient,\n options: DehydrateOptions = {},\n): DehydratedState {\n const filterMutation =\n options.shouldDehydrateMutation ??\n client.getDefaultOptions().dehydrate?.shouldDehydrateMutation ??\n defaultShouldDehydrateMutation\n\n const mutations = client\n .getMutationCache()\n .getAll()\n .flatMap((mutation) =>\n filterMutation(mutation) ? [dehydrateMutation(mutation)] : [],\n )\n\n const filterQuery =\n options.shouldDehydrateQuery ??\n client.getDefaultOptions().dehydrate?.shouldDehydrateQuery ??\n defaultShouldDehydrateQuery\n\n const shouldRedactErrors =\n options.shouldRedactErrors ??\n client.getDefaultOptions().dehydrate?.shouldRedactErrors ??\n defaultShouldRedactErrors\n\n const serializeData =\n options.serializeData ??\n client.getDefaultOptions().dehydrate?.serializeData ??\n defaultTransformerFn\n\n const queries = client\n .getQueryCache()\n .getAll()\n .flatMap((query) =>\n filterQuery(query)\n ? [dehydrateQuery(query, serializeData, shouldRedactErrors)]\n : [],\n )\n\n return { mutations, queries }\n}\n\nexport function hydrate(\n client: QueryClient,\n dehydratedState: unknown,\n options?: HydrateOptions,\n): void {\n if (typeof dehydratedState !== 'object' || dehydratedState === null) {\n return\n }\n\n const mutationCache = client.getMutationCache()\n const queryCache = client.getQueryCache()\n const deserializeData =\n options?.defaultOptions?.deserializeData ??\n client.getDefaultOptions().hydrate?.deserializeData ??\n defaultTransformerFn\n\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n const mutations = (dehydratedState as DehydratedState).mutations || []\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n const queries = (dehydratedState as DehydratedState).queries || []\n\n mutations.forEach(({ state, ...mutationOptions }) => {\n mutationCache.build(\n client,\n {\n ...client.getDefaultOptions().hydrate?.mutations,\n ...options?.defaultOptions?.mutations,\n ...mutationOptions,\n },\n state,\n )\n })\n\n queries.forEach(\n ({ queryKey, state, queryHash, meta, promise, dehydratedAt }) => {\n const syncData = promise ? tryResolveSync(promise) : undefined\n const rawData = state.data === undefined ? syncData?.data : state.data\n const data = rawData === undefined ? rawData : deserializeData(rawData)\n\n let query = queryCache.get(queryHash)\n const existingQueryIsPending = query?.state.status === 'pending'\n const existingQueryIsFetching = query?.state.fetchStatus === 'fetching'\n\n // Do not hydrate if an existing query exists with newer data\n if (query) {\n const hasNewerSyncData =\n syncData &&\n // We only need this undefined check to handle older dehydration\n // payloads that might not have dehydratedAt\n dehydratedAt !== undefined &&\n dehydratedAt > query.state.dataUpdatedAt\n if (\n state.dataUpdatedAt > query.state.dataUpdatedAt ||\n hasNewerSyncData\n ) {\n // omit fetchStatus from dehydrated state\n // so that query stays in its current fetchStatus\n const { fetchStatus: _ignored, ...serializedState } = state\n query.setState({\n ...serializedState,\n data,\n })\n }\n } else {\n // Restore query\n query = queryCache.build(\n client,\n {\n ...client.getDefaultOptions().hydrate?.queries,\n ...options?.defaultOptions?.queries,\n queryKey,\n queryHash,\n meta,\n },\n // Reset fetch status to idle to avoid\n // query being stuck in fetching state upon hydration\n {\n ...state,\n data,\n fetchStatus: 'idle',\n status: data !== undefined ? 'success' : state.status,\n },\n )\n }\n\n if (\n promise &&\n !existingQueryIsPending &&\n !existingQueryIsFetching &&\n // Only hydrate if dehydration is newer than any existing data,\n // this is always true for new queries\n (dehydratedAt === undefined || dehydratedAt > query.state.dataUpdatedAt)\n ) {\n // This doesn't actually fetch - it just creates a retryer\n // which will re-use the passed `initialPromise`\n // Note that we need to call these even when data was synchronously\n // available, as we still need to set up the retryer\n query\n .fetch(undefined, {\n // RSC transformed promises are not thenable\n initialPromise: Promise.resolve(promise).then(deserializeData),\n })\n // Avoid unhandled promise rejections\n .catch(noop)\n }\n },\n )\n}\n"],"mappings":";;;AAAA,SAAS,sBAAsB;AAC/B,SAAS,YAAY;AAiBrB,SAAS,qBAAqB,MAAgB;AAC5C,SAAO;AACT;AA2CA,SAAS,kBAAkB,UAAwC;AACjE,SAAO;AAAA,IACL,aAAa,SAAS,QAAQ;AAAA,IAC9B,OAAO,SAAS;AAAA,IAChB,GAAI,SAAS,QAAQ,SAAS,EAAE,OAAO,SAAS,QAAQ,MAAM;AAAA,IAC9D,GAAI,SAAS,QAAQ,EAAE,MAAM,SAAS,KAAK;AAAA,EAC7C;AACF;AAMA,SAAS,eACP,OACA,eACA,oBACiB;AACjB,QAAM,mBAAmB,MAAM;AAjFjC;AAkFI,UAAM,WAAU,WAAM,YAAN,mBAAe,KAAK,eAAe,MAAM,CAAC,UAAU;AAClE,UAAI,CAAC,mBAAmB,KAAK,GAAG;AAE9B,eAAO,QAAQ,OAAO,KAAK;AAAA,MAC7B;AAEA,UAAI,QAAQ,IAAI,aAAa,cAAc;AACzC,gBAAQ;AAAA,UACN,+DAA+D,MAAM,SAAS,MAAM,KAAK;AAAA,QAC3F;AAAA,MACF;AACA,aAAO,QAAQ,OAAO,IAAI,MAAM,UAAU,CAAC;AAAA,IAC7C;AAMA,uCAAS,MAAM;AAEf,WAAO;AAAA,EACT;AAEA,SAAO;AAAA,IACL,cAAc,KAAK,IAAI;AAAA,IACvB,OAAO;AAAA,MACL,GAAG,MAAM;AAAA,MACT,GAAI,MAAM,MAAM,SAAS,UAAa;AAAA,QACpC,MAAM,cAAc,MAAM,MAAM,IAAI;AAAA,MACtC;AAAA,IACF;AAAA,IACA,UAAU,MAAM;AAAA,IAChB,WAAW,MAAM;AAAA,IACjB,GAAI,MAAM,MAAM,WAAW,aAAa;AA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ACF;AAAA;AAAA;AAAA,UAGA;AAAA,YACE,GAAG;AAAA,YACH;AAAA,YACA,aAAa;AAAA,YACb,QAAQ,SAAS,SAAY,YAAY,MAAM;AAAA,UACjD;AAAA,QACF;AAAA,MACF;AAEA,UACE,WACA,CAAC,0BACD,CAAC;AAAA;AAAA,OAGA,iBAAiB,UAAa,eAAe,MAAM,MAAM,gBAC1D;AAKA,cACG,MAAM,QAAW;AAAA;AAAA,UAEhB,gBAAgB,QAAQ,QAAQ,OAAO,EAAE,KAAK,eAAe;AAAA,QAC/D,CAAC,EAEA,MAAM,IAAI;AAAA,MACf;AAAA,IACF;AAAA,EACF;AACF;","names":["_a","_b"]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/index.cjs b/node_modules/@tanstack/query-core/build/legacy/index.cjs new file mode 100644 index 0000000..cac316e --- /dev/null +++ b/node_modules/@tanstack/query-core/build/legacy/index.cjs @@ -0,0 +1,110 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default")); +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/index.ts +var index_exports = {}; +__export(index_exports, { + CancelledError: () => import_retryer.CancelledError, + InfiniteQueryObserver: () => import_infiniteQueryObserver.InfiniteQueryObserver, + Mutation: () => import_mutation.Mutation, + MutationCache: () => import_mutationCache.MutationCache, + MutationObserver: () => import_mutationObserver.MutationObserver, + QueriesObserver: () => import_queriesObserver.QueriesObserver, + Query: () => import_query.Query, + QueryCache: () => import_queryCache.QueryCache, + QueryClient: () => import_queryClient.QueryClient, + QueryObserver: () => import_queryObserver.QueryObserver, + defaultScheduler: () => import_notifyManager.defaultScheduler, + defaultShouldDehydrateMutation: () => import_hydration.defaultShouldDehydrateMutation, + defaultShouldDehydrateQuery: () => import_hydration.defaultShouldDehydrateQuery, + dehydrate: () => import_hydration.dehydrate, + experimental_streamedQuery: () => import_streamedQuery.streamedQuery, + focusManager: () => import_focusManager.focusManager, + hashKey: () => import_utils.hashKey, + hydrate: () => import_hydration.hydrate, + isCancelledError: () => import_retryer.isCancelledError, + isServer: () => import_utils.isServer, + keepPreviousData: () => import_utils.keepPreviousData, + matchMutation: () => import_utils.matchMutation, + matchQuery: () => import_utils.matchQuery, + noop: () => import_utils.noop, + notifyManager: () => import_notifyManager.notifyManager, + onlineManager: () => import_onlineManager.onlineManager, + partialMatchKey: () => import_utils.partialMatchKey, + replaceEqualDeep: () => import_utils.replaceEqualDeep, + shouldThrowError: () => import_utils.shouldThrowError, + skipToken: () => import_utils.skipToken, + timeoutManager: () => import_timeoutManager.timeoutManager +}); +module.exports = __toCommonJS(index_exports); +var import_focusManager = require("./focusManager.cjs"); +var import_hydration = require("./hydration.cjs"); +var import_infiniteQueryObserver = require("./infiniteQueryObserver.cjs"); +var import_mutationCache = require("./mutationCache.cjs"); +var import_mutationObserver = require("./mutationObserver.cjs"); +var import_notifyManager = require("./notifyManager.cjs"); +var import_onlineManager = require("./onlineManager.cjs"); +var import_queriesObserver = require("./queriesObserver.cjs"); +var import_queryCache = require("./queryCache.cjs"); +var import_queryClient = require("./queryClient.cjs"); +var import_queryObserver = require("./queryObserver.cjs"); +var import_retryer = require("./retryer.cjs"); +var import_timeoutManager = require("./timeoutManager.cjs"); +var import_utils = require("./utils.cjs"); +var import_streamedQuery = require("./streamedQuery.cjs"); +var import_mutation = require("./mutation.cjs"); +var import_query = require("./query.cjs"); +__reExport(index_exports, require("./types.cjs"), module.exports); +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + CancelledError, + InfiniteQueryObserver, + Mutation, + MutationCache, + MutationObserver, + QueriesObserver, + Query, + QueryCache, + QueryClient, + QueryObserver, + defaultScheduler, + defaultShouldDehydrateMutation, + defaultShouldDehydrateQuery, + dehydrate, + experimental_streamedQuery, + focusManager, + hashKey, + hydrate, + isCancelledError, + isServer, + keepPreviousData, + matchMutation, + matchQuery, + noop, + notifyManager, + onlineManager, + partialMatchKey, + replaceEqualDeep, + shouldThrowError, + skipToken, + timeoutManager, + ...require("./types.cjs") +}); +//# sourceMappingURL=index.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/index.cjs.map b/node_modules/@tanstack/query-core/build/legacy/index.cjs.map new file mode 100644 index 0000000..239bda0 --- /dev/null +++ b/node_modules/@tanstack/query-core/build/legacy/index.cjs.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/index.ts"],"sourcesContent":["/* istanbul ignore file */\n\nexport { focusManager } from './focusManager'\nexport {\n defaultShouldDehydrateMutation,\n defaultShouldDehydrateQuery,\n dehydrate,\n hydrate,\n} from './hydration'\nexport { InfiniteQueryObserver } from './infiniteQueryObserver'\nexport { MutationCache } from './mutationCache'\nexport type { MutationCacheNotifyEvent } from './mutationCache'\nexport { MutationObserver } from './mutationObserver'\nexport { defaultScheduler, notifyManager } from './notifyManager'\nexport { onlineManager } from './onlineManager'\nexport { QueriesObserver } from './queriesObserver'\nexport { QueryCache } from './queryCache'\nexport type { QueryCacheNotifyEvent } from './queryCache'\nexport { QueryClient } from './queryClient'\nexport { QueryObserver } from './queryObserver'\nexport { CancelledError, isCancelledError } from './retryer'\nexport {\n timeoutManager,\n type ManagedTimerId,\n type TimeoutCallback,\n type TimeoutProvider,\n} from './timeoutManager'\nexport {\n hashKey,\n isServer,\n keepPreviousData,\n matchMutation,\n matchQuery,\n noop,\n partialMatchKey,\n replaceEqualDeep,\n shouldThrowError,\n skipToken,\n} from './utils'\nexport type { MutationFilters, QueryFilters, SkipToken, Updater } from './utils'\n\nexport { streamedQuery as experimental_streamedQuery } from './streamedQuery'\n\n// Types\nexport type {\n DehydratedState,\n DehydrateOptions,\n HydrateOptions,\n} from './hydration'\nexport { Mutation } from './mutation'\nexport type { MutationState } from './mutation'\nexport type { QueriesObserverOptions } from './queriesObserver'\nexport { Query } from './query'\nexport type { QueryState } from './query'\nexport * from './types'\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,0BAA6B;AAC7B,uBAKO;AACP,mCAAsC;AACtC,2BAA8B;AAE9B,8BAAiC;AACjC,2BAAgD;AAChD,2BAA8B;AAC9B,6BAAgC;AAChC,wBAA2B;AAE3B,yBAA4B;AAC5B,2BAA8B;AAC9B,qBAAiD;AACjD,4BAKO;AACP,mBAWO;AAGP,2BAA4D;AAQ5D,sBAAyB;AAGzB,mBAAsB;AAEtB,0BAAc,wBAtDd;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/index.d.cts b/node_modules/@tanstack/query-core/build/legacy/index.d.cts new file mode 100644 index 0000000..9d894bb --- /dev/null +++ b/node_modules/@tanstack/query-core/build/legacy/index.d.cts @@ -0,0 +1,10 @@ +export { focusManager } from './focusManager.cjs'; +export { T as AnyDataTag, b7 as CancelOptions, C as CancelledError, V as DataTag, G as DefaultError, b6 as DefaultOptions, ak as DefaultedInfiniteQueryObserverOptions, ai as DefaultedQueryObserverOptions, aP as DefinedInfiniteQueryObserverResult, aG as DefinedQueryObserverResult, w as DehydrateOptions, D as DehydratedState, B as DistributiveOmit, $ as Enabled, an as EnsureInfiniteQueryDataOptions, am as EnsureQueryDataOptions, ao as FetchInfiniteQueryOptions, av as FetchNextPageOptions, aw as FetchPreviousPageOptions, al as FetchQueryOptions, ay as FetchStatus, a7 as GetNextPageParamFunction, a6 as GetPreviousPageParamFunction, H as HydrateOptions, W as InferDataFromTag, X as InferErrorFromTag, a8 as InfiniteData, aI as InfiniteQueryObserverBaseResult, aL as InfiniteQueryObserverLoadingErrorResult, aK as InfiniteQueryObserverLoadingResult, aj as InfiniteQueryObserverOptions, aJ as InfiniteQueryObserverPendingResult, aO as InfiniteQueryObserverPlaceholderResult, aM as InfiniteQueryObserverRefetchErrorResult, aQ as InfiniteQueryObserverResult, aN as InfiniteQueryObserverSuccessResult, ae as InfiniteQueryPageParamsOptions, a2 as InitialDataFunction, ad as InitialPageParam, at as InvalidateOptions, ar as InvalidateQueryFilters, a_ as MutateFunction, aZ as MutateOptions, x as Mutation, M as MutationCache, c as MutationCacheNotifyEvent, u as MutationFilters, aW as MutationFunction, aV as MutationFunctionContext, aR as MutationKey, aU as MutationMeta, e as MutationObserver, a$ as MutationObserverBaseResult, b2 as MutationObserverErrorResult, b0 as MutationObserverIdleResult, b1 as MutationObserverLoadingResult, aY as MutationObserverOptions, b4 as MutationObserverResult, b3 as MutationObserverSuccessResult, aX as MutationOptions, aT as MutationScope, y as MutationState, aS as MutationStatus, aa as NetworkMode, F as NoInfer, N as NonUndefinedGuard, ba as NotifyEvent, b9 as NotifyEventType, ab as NotifyOnChangeProps, O as OmitKeyof, E as Override, a3 as PlaceholderDataFunction, a4 as QueriesPlaceholderDataFunction, z as Query, Q as QueryCache, f as QueryCacheNotifyEvent, g as QueryClient, b5 as QueryClientConfig, v as QueryFilters, Y as QueryFunction, a1 as QueryFunctionContext, I as QueryKey, a5 as QueryKeyHashFunction, a9 as QueryMeta, i as QueryObserver, az as QueryObserverBaseResult, aC as QueryObserverLoadingErrorResult, aB as QueryObserverLoadingResult, ag as QueryObserverOptions, aA as QueryObserverPendingResult, aF as QueryObserverPlaceholderResult, aD as QueryObserverRefetchErrorResult, aH as QueryObserverResult, aE as QueryObserverSuccessResult, ac as QueryOptions, a0 as QueryPersister, A as QueryState, ax as QueryStatus, aq as RefetchOptions, as as RefetchQueryFilters, R as Register, au as ResetOptions, ap as ResultOptions, b8 as SetDataOptions, S as SkipToken, Z as StaleTime, _ as StaleTimeFunction, af as ThrowOnError, P as UnsetMarker, U as Updater, ah as WithRequired, K as dataTagErrorSymbol, J as dataTagSymbol, d as defaultShouldDehydrateMutation, a as defaultShouldDehydrateQuery, b as dehydrate, k as hashKey, h as hydrate, j as isCancelledError, l as isServer, m as keepPreviousData, n as matchMutation, o as matchQuery, p as noop, q as partialMatchKey, r as replaceEqualDeep, s as shouldThrowError, t as skipToken, L as unsetMarker } from './hydration-uphG6M-i.cjs'; +export { InfiniteQueryObserver } from './infiniteQueryObserver.cjs'; +export { defaultScheduler, notifyManager } from './notifyManager.cjs'; +export { onlineManager } from './onlineManager.cjs'; +export { QueriesObserver, QueriesObserverOptions } from './queriesObserver.cjs'; +export { ManagedTimerId, TimeoutCallback, TimeoutProvider, timeoutManager } from './timeoutManager.cjs'; +export { streamedQuery as experimental_streamedQuery } from './streamedQuery.cjs'; +import './subscribable.cjs'; +import './removable.cjs'; diff --git a/node_modules/@tanstack/query-core/build/legacy/index.d.ts b/node_modules/@tanstack/query-core/build/legacy/index.d.ts new file mode 100644 index 0000000..54af14c --- /dev/null +++ b/node_modules/@tanstack/query-core/build/legacy/index.d.ts @@ -0,0 +1,10 @@ +export { focusManager } from './focusManager.js'; +export { T as AnyDataTag, b7 as CancelOptions, C as CancelledError, V as DataTag, G as DefaultError, b6 as DefaultOptions, ak as DefaultedInfiniteQueryObserverOptions, ai as DefaultedQueryObserverOptions, aP as DefinedInfiniteQueryObserverResult, aG as DefinedQueryObserverResult, w as DehydrateOptions, D as DehydratedState, B as DistributiveOmit, $ as Enabled, an as EnsureInfiniteQueryDataOptions, am as EnsureQueryDataOptions, ao as FetchInfiniteQueryOptions, av as FetchNextPageOptions, aw as FetchPreviousPageOptions, al as FetchQueryOptions, ay as FetchStatus, a7 as GetNextPageParamFunction, a6 as GetPreviousPageParamFunction, H as HydrateOptions, W as InferDataFromTag, X as InferErrorFromTag, a8 as InfiniteData, aI as InfiniteQueryObserverBaseResult, aL as InfiniteQueryObserverLoadingErrorResult, aK as InfiniteQueryObserverLoadingResult, aj as InfiniteQueryObserverOptions, aJ as InfiniteQueryObserverPendingResult, aO as InfiniteQueryObserverPlaceholderResult, aM as InfiniteQueryObserverRefetchErrorResult, aQ as InfiniteQueryObserverResult, aN as InfiniteQueryObserverSuccessResult, ae as InfiniteQueryPageParamsOptions, a2 as InitialDataFunction, ad as InitialPageParam, at as InvalidateOptions, ar as InvalidateQueryFilters, a_ as MutateFunction, aZ as MutateOptions, x as Mutation, M as MutationCache, c as MutationCacheNotifyEvent, u as MutationFilters, aW as MutationFunction, aV as MutationFunctionContext, aR as MutationKey, aU as MutationMeta, e as MutationObserver, a$ as MutationObserverBaseResult, b2 as MutationObserverErrorResult, b0 as MutationObserverIdleResult, b1 as MutationObserverLoadingResult, aY as MutationObserverOptions, b4 as MutationObserverResult, b3 as MutationObserverSuccessResult, aX as MutationOptions, aT as MutationScope, y as MutationState, aS as MutationStatus, aa as NetworkMode, F as NoInfer, N as NonUndefinedGuard, ba as NotifyEvent, b9 as NotifyEventType, ab as NotifyOnChangeProps, O as OmitKeyof, E as Override, a3 as PlaceholderDataFunction, a4 as QueriesPlaceholderDataFunction, z as Query, Q as QueryCache, f as QueryCacheNotifyEvent, g as QueryClient, b5 as QueryClientConfig, v as QueryFilters, Y as QueryFunction, a1 as QueryFunctionContext, I as QueryKey, a5 as QueryKeyHashFunction, a9 as QueryMeta, i as QueryObserver, az as QueryObserverBaseResult, aC as QueryObserverLoadingErrorResult, aB as QueryObserverLoadingResult, ag as QueryObserverOptions, aA as QueryObserverPendingResult, aF as QueryObserverPlaceholderResult, aD as QueryObserverRefetchErrorResult, aH as QueryObserverResult, aE as QueryObserverSuccessResult, ac as QueryOptions, a0 as QueryPersister, A as QueryState, ax as QueryStatus, aq as RefetchOptions, as as RefetchQueryFilters, R as Register, au as ResetOptions, ap as ResultOptions, b8 as SetDataOptions, S as SkipToken, Z as StaleTime, _ as StaleTimeFunction, af as ThrowOnError, P as UnsetMarker, U as Updater, ah as WithRequired, K as dataTagErrorSymbol, J as dataTagSymbol, d as defaultShouldDehydrateMutation, a as defaultShouldDehydrateQuery, b as dehydrate, k as hashKey, h as hydrate, j as isCancelledError, l as isServer, m as keepPreviousData, n as matchMutation, o as matchQuery, p as noop, q as partialMatchKey, r as replaceEqualDeep, s as shouldThrowError, t as skipToken, L as unsetMarker } from './hydration-BlEVG2Lp.js'; +export { InfiniteQueryObserver } from './infiniteQueryObserver.js'; +export { defaultScheduler, notifyManager } from './notifyManager.js'; +export { onlineManager } from './onlineManager.js'; +export { QueriesObserver, QueriesObserverOptions } from './queriesObserver.js'; +export { ManagedTimerId, TimeoutCallback, TimeoutProvider, timeoutManager } from './timeoutManager.js'; +export { streamedQuery as experimental_streamedQuery } from './streamedQuery.js'; +import './subscribable.js'; +import './removable.js'; diff --git a/node_modules/@tanstack/query-core/build/legacy/index.js b/node_modules/@tanstack/query-core/build/legacy/index.js new file mode 100644 index 0000000..04a50d1 --- /dev/null +++ b/node_modules/@tanstack/query-core/build/legacy/index.js @@ -0,0 +1,73 @@ +import "./chunk-PXG64RU4.js"; + +// src/index.ts +import { focusManager } from "./focusManager.js"; +import { + defaultShouldDehydrateMutation, + defaultShouldDehydrateQuery, + dehydrate, + hydrate +} from "./hydration.js"; +import { InfiniteQueryObserver } from "./infiniteQueryObserver.js"; +import { MutationCache } from "./mutationCache.js"; +import { MutationObserver } from "./mutationObserver.js"; +import { defaultScheduler, notifyManager } from "./notifyManager.js"; +import { onlineManager } from "./onlineManager.js"; +import { QueriesObserver } from "./queriesObserver.js"; +import { QueryCache } from "./queryCache.js"; +import { QueryClient } from "./queryClient.js"; +import { QueryObserver } from "./queryObserver.js"; +import { CancelledError, isCancelledError } from "./retryer.js"; +import { + timeoutManager +} from "./timeoutManager.js"; +import { + hashKey, + isServer, + keepPreviousData, + matchMutation, + matchQuery, + noop, + partialMatchKey, + replaceEqualDeep, + shouldThrowError, + skipToken +} from "./utils.js"; +import { streamedQuery } from "./streamedQuery.js"; +import { Mutation } from "./mutation.js"; +import { Query } from "./query.js"; +export * from "./types.js"; +export { + CancelledError, + InfiniteQueryObserver, + Mutation, + MutationCache, + MutationObserver, + QueriesObserver, + Query, + QueryCache, + QueryClient, + QueryObserver, + defaultScheduler, + defaultShouldDehydrateMutation, + defaultShouldDehydrateQuery, + dehydrate, + streamedQuery as experimental_streamedQuery, + focusManager, + hashKey, + hydrate, + isCancelledError, + isServer, + keepPreviousData, + matchMutation, + matchQuery, + noop, + notifyManager, + onlineManager, + partialMatchKey, + replaceEqualDeep, + shouldThrowError, + skipToken, + timeoutManager +}; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/index.js.map b/node_modules/@tanstack/query-core/build/legacy/index.js.map new file mode 100644 index 0000000..737d579 --- /dev/null +++ b/node_modules/@tanstack/query-core/build/legacy/index.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/index.ts"],"sourcesContent":["/* istanbul ignore file */\n\nexport { focusManager } from './focusManager'\nexport {\n defaultShouldDehydrateMutation,\n defaultShouldDehydrateQuery,\n dehydrate,\n hydrate,\n} from './hydration'\nexport { InfiniteQueryObserver } from './infiniteQueryObserver'\nexport { MutationCache } from './mutationCache'\nexport type { MutationCacheNotifyEvent } from './mutationCache'\nexport { MutationObserver } from './mutationObserver'\nexport { defaultScheduler, notifyManager } from './notifyManager'\nexport { onlineManager } from './onlineManager'\nexport { QueriesObserver } from './queriesObserver'\nexport { QueryCache } from './queryCache'\nexport type { QueryCacheNotifyEvent } from './queryCache'\nexport { QueryClient } from './queryClient'\nexport { QueryObserver } from './queryObserver'\nexport { CancelledError, isCancelledError } from './retryer'\nexport {\n timeoutManager,\n type ManagedTimerId,\n type TimeoutCallback,\n type TimeoutProvider,\n} from './timeoutManager'\nexport {\n hashKey,\n isServer,\n keepPreviousData,\n matchMutation,\n matchQuery,\n noop,\n partialMatchKey,\n replaceEqualDeep,\n shouldThrowError,\n skipToken,\n} from './utils'\nexport type { MutationFilters, QueryFilters, SkipToken, Updater } from './utils'\n\nexport { streamedQuery as experimental_streamedQuery } from './streamedQuery'\n\n// Types\nexport type {\n DehydratedState,\n DehydrateOptions,\n HydrateOptions,\n} from './hydration'\nexport { Mutation } from './mutation'\nexport type { MutationState } from './mutation'\nexport type { QueriesObserverOptions } from './queriesObserver'\nexport { Query } from './query'\nexport type { QueryState } from './query'\nexport * from './types'\n"],"mappings":";;;AAEA,SAAS,oBAAoB;AAC7B;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,6BAA6B;AACtC,SAAS,qBAAqB;AAE9B,SAAS,wBAAwB;AACjC,SAAS,kBAAkB,qBAAqB;AAChD,SAAS,qBAAqB;AAC9B,SAAS,uBAAuB;AAChC,SAAS,kBAAkB;AAE3B,SAAS,mBAAmB;AAC5B,SAAS,qBAAqB;AAC9B,SAAS,gBAAgB,wBAAwB;AACjD;AAAA,EACE;AAAA,OAIK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAGP,SAA0B,qBAAkC;AAQ5D,SAAS,gBAAgB;AAGzB,SAAS,aAAa;AAEtB,cAAc;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/infiniteQueryBehavior.cjs b/node_modules/@tanstack/query-core/build/legacy/infiniteQueryBehavior.cjs new file mode 100644 index 0000000..c130091 --- /dev/null +++ b/node_modules/@tanstack/query-core/build/legacy/infiniteQueryBehavior.cjs @@ -0,0 +1,146 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/infiniteQueryBehavior.ts +var infiniteQueryBehavior_exports = {}; +__export(infiniteQueryBehavior_exports, { + hasNextPage: () => hasNextPage, + hasPreviousPage: () => hasPreviousPage, + infiniteQueryBehavior: () => infiniteQueryBehavior +}); +module.exports = __toCommonJS(infiniteQueryBehavior_exports); +var import_utils = require("./utils.cjs"); +function infiniteQueryBehavior(pages) { + return { + onFetch: (context, query) => { + var _a, _b, _c, _d, _e; + const options = context.options; + const direction = (_c = (_b = (_a = context.fetchOptions) == null ? void 0 : _a.meta) == null ? void 0 : _b.fetchMore) == null ? void 0 : _c.direction; + const oldPages = ((_d = context.state.data) == null ? void 0 : _d.pages) || []; + const oldPageParams = ((_e = context.state.data) == null ? void 0 : _e.pageParams) || []; + let result = { pages: [], pageParams: [] }; + let currentPage = 0; + const fetchFn = async () => { + let cancelled = false; + const addSignalProperty = (object) => { + (0, import_utils.addConsumeAwareSignal)( + object, + () => context.signal, + () => cancelled = true + ); + }; + const queryFn = (0, import_utils.ensureQueryFn)(context.options, context.fetchOptions); + const fetchPage = async (data, param, previous) => { + if (cancelled) { + return Promise.reject(); + } + if (param == null && data.pages.length) { + return Promise.resolve(data); + } + const createQueryFnContext = () => { + const queryFnContext2 = { + client: context.client, + queryKey: context.queryKey, + pageParam: param, + direction: previous ? "backward" : "forward", + meta: context.options.meta + }; + addSignalProperty(queryFnContext2); + return queryFnContext2; + }; + const queryFnContext = createQueryFnContext(); + const page = await queryFn(queryFnContext); + const { maxPages } = context.options; + const addTo = previous ? import_utils.addToStart : import_utils.addToEnd; + return { + pages: addTo(data.pages, page, maxPages), + pageParams: addTo(data.pageParams, param, maxPages) + }; + }; + if (direction && oldPages.length) { + const previous = direction === "backward"; + const pageParamFn = previous ? getPreviousPageParam : getNextPageParam; + const oldData = { + pages: oldPages, + pageParams: oldPageParams + }; + const param = pageParamFn(options, oldData); + result = await fetchPage(oldData, param, previous); + } else { + const remainingPages = pages ?? oldPages.length; + do { + const param = currentPage === 0 ? oldPageParams[0] ?? options.initialPageParam : getNextPageParam(options, result); + if (currentPage > 0 && param == null) { + break; + } + result = await fetchPage(result, param); + currentPage++; + } while (currentPage < remainingPages); + } + return result; + }; + if (context.options.persister) { + context.fetchFn = () => { + var _a2, _b2; + return (_b2 = (_a2 = context.options).persister) == null ? void 0 : _b2.call( + _a2, + fetchFn, + { + client: context.client, + queryKey: context.queryKey, + meta: context.options.meta, + signal: context.signal + }, + query + ); + }; + } else { + context.fetchFn = fetchFn; + } + } + }; +} +function getNextPageParam(options, { pages, pageParams }) { + const lastIndex = pages.length - 1; + return pages.length > 0 ? options.getNextPageParam( + pages[lastIndex], + pages, + pageParams[lastIndex], + pageParams + ) : void 0; +} +function getPreviousPageParam(options, { pages, pageParams }) { + var _a; + return pages.length > 0 ? (_a = options.getPreviousPageParam) == null ? void 0 : _a.call(options, pages[0], pages, pageParams[0], pageParams) : void 0; +} +function hasNextPage(options, data) { + if (!data) return false; + return getNextPageParam(options, data) != null; +} +function hasPreviousPage(options, data) { + if (!data || !options.getPreviousPageParam) return false; + return getPreviousPageParam(options, data) != null; +} +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + hasNextPage, + hasPreviousPage, + infiniteQueryBehavior +}); +//# sourceMappingURL=infiniteQueryBehavior.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/infiniteQueryBehavior.cjs.map b/node_modules/@tanstack/query-core/build/legacy/infiniteQueryBehavior.cjs.map new file mode 100644 index 0000000..d76f30f --- /dev/null +++ b/node_modules/@tanstack/query-core/build/legacy/infiniteQueryBehavior.cjs.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/infiniteQueryBehavior.ts"],"sourcesContent":["import {\n addConsumeAwareSignal,\n addToEnd,\n addToStart,\n ensureQueryFn,\n} from './utils'\nimport type { QueryBehavior } from './query'\nimport type {\n InfiniteData,\n InfiniteQueryPageParamsOptions,\n OmitKeyof,\n QueryFunctionContext,\n QueryKey,\n} from './types'\n\nexport function infiniteQueryBehavior(\n pages?: number,\n): QueryBehavior> {\n return {\n onFetch: (context, query) => {\n const options = context.options as InfiniteQueryPageParamsOptions\n const direction = context.fetchOptions?.meta?.fetchMore?.direction\n const oldPages = context.state.data?.pages || []\n const oldPageParams = context.state.data?.pageParams || []\n let result: InfiniteData = { pages: [], pageParams: [] }\n let currentPage = 0\n\n const fetchFn = async () => {\n let cancelled = false\n const addSignalProperty = (object: unknown) => {\n addConsumeAwareSignal(\n object,\n () => context.signal,\n () => (cancelled = true),\n )\n }\n\n const queryFn = ensureQueryFn(context.options, context.fetchOptions)\n\n // Create function to fetch a page\n const fetchPage = async (\n data: InfiniteData,\n param: unknown,\n previous?: boolean,\n ): Promise> => {\n if (cancelled) {\n return Promise.reject()\n }\n\n if (param == null && data.pages.length) {\n return Promise.resolve(data)\n }\n\n const createQueryFnContext = () => {\n const queryFnContext: OmitKeyof<\n QueryFunctionContext,\n 'signal'\n > = {\n client: context.client,\n queryKey: context.queryKey,\n pageParam: param,\n direction: previous ? 'backward' : 'forward',\n meta: context.options.meta,\n }\n addSignalProperty(queryFnContext)\n return queryFnContext as QueryFunctionContext\n }\n\n const queryFnContext = createQueryFnContext()\n\n const page = await queryFn(queryFnContext)\n\n const { maxPages } = context.options\n const addTo = previous ? addToStart : addToEnd\n\n return {\n pages: addTo(data.pages, page, maxPages),\n pageParams: addTo(data.pageParams, param, maxPages),\n }\n }\n\n // fetch next / previous page?\n if (direction && oldPages.length) {\n const previous = direction === 'backward'\n const pageParamFn = previous ? getPreviousPageParam : getNextPageParam\n const oldData = {\n pages: oldPages,\n pageParams: oldPageParams,\n }\n const param = pageParamFn(options, oldData)\n\n result = await fetchPage(oldData, param, previous)\n } else {\n const remainingPages = pages ?? oldPages.length\n\n // Fetch all pages\n do {\n const param =\n currentPage === 0\n ? (oldPageParams[0] ?? options.initialPageParam)\n : getNextPageParam(options, result)\n if (currentPage > 0 && param == null) {\n break\n }\n result = await fetchPage(result, param)\n currentPage++\n } while (currentPage < remainingPages)\n }\n\n return result\n }\n if (context.options.persister) {\n context.fetchFn = () => {\n return context.options.persister?.(\n fetchFn as any,\n {\n client: context.client,\n queryKey: context.queryKey,\n meta: context.options.meta,\n signal: context.signal,\n },\n query,\n )\n }\n } else {\n context.fetchFn = fetchFn\n }\n },\n }\n}\n\nfunction getNextPageParam(\n options: InfiniteQueryPageParamsOptions,\n { pages, pageParams }: InfiniteData,\n): unknown | undefined {\n const lastIndex = pages.length - 1\n return pages.length > 0\n ? options.getNextPageParam(\n pages[lastIndex],\n pages,\n pageParams[lastIndex],\n pageParams,\n )\n : undefined\n}\n\nfunction getPreviousPageParam(\n options: InfiniteQueryPageParamsOptions,\n { pages, pageParams }: InfiniteData,\n): unknown | undefined {\n return pages.length > 0\n ? options.getPreviousPageParam?.(pages[0], pages, pageParams[0], pageParams)\n : undefined\n}\n\n/**\n * Checks if there is a next page.\n */\nexport function hasNextPage(\n options: InfiniteQueryPageParamsOptions,\n data?: InfiniteData,\n): boolean {\n if (!data) return false\n return getNextPageParam(options, data) != null\n}\n\n/**\n * Checks if there is a previous page.\n */\nexport function hasPreviousPage(\n options: InfiniteQueryPageParamsOptions,\n data?: InfiniteData,\n): boolean {\n if (!data || !options.getPreviousPageParam) return false\n return getPreviousPageParam(options, data) != null\n}\n"],"mapp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S;AAAA,IACf;AAAA,IACA,WAAW,SAAS;AAAA,IACpB;AAAA,EACF,IACA;AACN;AAEA,SAAS,qBACP,SACA,EAAE,OAAO,WAAW,GACC;AArJvB;AAsJE,SAAO,MAAM,SAAS,KAClB,aAAQ,yBAAR,iCAA+B,MAAM,CAAC,GAAG,OAAO,WAAW,CAAC,GAAG,cAC/D;AACN;AAKO,SAAS,YACd,SACA,MACS;AACT,MAAI,CAAC,KAAM,QAAO;AAClB,SAAO,iBAAiB,SAAS,IAAI,KAAK;AAC5C;AAKO,SAAS,gBACd,SACA,MACS;AACT,MAAI,CAAC,QAAQ,CAAC,QAAQ,qBAAsB,QAAO;AACnD,SAAO,qBAAqB,SAAS,IAAI,KAAK;AAChD;","names":["queryFnContext","_a","_b"]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/infiniteQueryBehavior.d.cts b/node_modules/@tanstack/query-core/build/legacy/infiniteQueryBehavior.d.cts new file mode 100644 index 0000000..8a7fd8a --- /dev/null +++ b/node_modules/@tanstack/query-core/build/legacy/infiniteQueryBehavior.d.cts @@ -0,0 +1,15 @@ +import { bb as QueryBehavior, a8 as InfiniteData, ae as InfiniteQueryPageParamsOptions } from './hydration-uphG6M-i.cjs'; +import './removable.cjs'; +import './subscribable.cjs'; + +declare function infiniteQueryBehavior(pages?: number): QueryBehavior>; +/** + * Checks if there is a next page. + */ +declare function hasNextPage(options: InfiniteQueryPageParamsOptions, data?: InfiniteData): boolean; +/** + * Checks if there is a previous page. + */ +declare function hasPreviousPage(options: InfiniteQueryPageParamsOptions, data?: InfiniteData): boolean; + +export { hasNextPage, hasPreviousPage, infiniteQueryBehavior }; diff --git a/node_modules/@tanstack/query-core/build/legacy/infiniteQueryBehavior.d.ts b/node_modules/@tanstack/query-core/build/legacy/infiniteQueryBehavior.d.ts new file mode 100644 index 0000000..a9a90e2 --- /dev/null +++ b/node_modules/@tanstack/query-core/build/legacy/infiniteQueryBehavior.d.ts @@ -0,0 +1,15 @@ +import { bb as QueryBehavior, a8 as InfiniteData, ae as InfiniteQueryPageParamsOptions } from './hydration-BlEVG2Lp.js'; +import './removable.js'; +import './subscribable.js'; + +declare function infiniteQueryBehavior(pages?: number): QueryBehavior>; +/** + * Checks if there is a next page. + */ +declare function hasNextPage(options: InfiniteQueryPageParamsOptions, data?: InfiniteData): boolean; +/** + * Checks if there is a previous page. + */ +declare function hasPreviousPage(options: InfiniteQueryPageParamsOptions, data?: InfiniteData): boolean; + +export { hasNextPage, hasPreviousPage, infiniteQueryBehavior }; diff --git a/node_modules/@tanstack/query-core/build/legacy/infiniteQueryBehavior.js b/node_modules/@tanstack/query-core/build/legacy/infiniteQueryBehavior.js new file mode 100644 index 0000000..d115b5e --- /dev/null +++ b/node_modules/@tanstack/query-core/build/legacy/infiniteQueryBehavior.js @@ -0,0 +1,126 @@ +import "./chunk-PXG64RU4.js"; + +// src/infiniteQueryBehavior.ts +import { + addConsumeAwareSignal, + addToEnd, + addToStart, + ensureQueryFn +} from "./utils.js"; +function infiniteQueryBehavior(pages) { + return { + onFetch: (context, query) => { + var _a, _b, _c, _d, _e; + const options = context.options; + const direction = (_c = (_b = (_a = context.fetchOptions) == null ? void 0 : _a.meta) == null ? void 0 : _b.fetchMore) == null ? void 0 : _c.direction; + const oldPages = ((_d = context.state.data) == null ? void 0 : _d.pages) || []; + const oldPageParams = ((_e = context.state.data) == null ? void 0 : _e.pageParams) || []; + let result = { pages: [], pageParams: [] }; + let currentPage = 0; + const fetchFn = async () => { + let cancelled = false; + const addSignalProperty = (object) => { + addConsumeAwareSignal( + object, + () => context.signal, + () => cancelled = true + ); + }; + const queryFn = ensureQueryFn(context.options, context.fetchOptions); + const fetchPage = async (data, param, previous) => { + if (cancelled) { + return Promise.reject(); + } + if (param == null && data.pages.length) { + return Promise.resolve(data); + } + const createQueryFnContext = () => { + const queryFnContext2 = { + client: context.client, + queryKey: context.queryKey, + pageParam: param, + direction: previous ? "backward" : "forward", + meta: context.options.meta + }; + addSignalProperty(queryFnContext2); + return queryFnContext2; + }; + const queryFnContext = createQueryFnContext(); + const page = await queryFn(queryFnContext); + const { maxPages } = context.options; + const addTo = previous ? addToStart : addToEnd; + return { + pages: addTo(data.pages, page, maxPages), + pageParams: addTo(data.pageParams, param, maxPages) + }; + }; + if (direction && oldPages.length) { + const previous = direction === "backward"; + const pageParamFn = previous ? getPreviousPageParam : getNextPageParam; + const oldData = { + pages: oldPages, + pageParams: oldPageParams + }; + const param = pageParamFn(options, oldData); + result = await fetchPage(oldData, param, previous); + } else { + const remainingPages = pages ?? oldPages.length; + do { + const param = currentPage === 0 ? oldPageParams[0] ?? options.initialPageParam : getNextPageParam(options, result); + if (currentPage > 0 && param == null) { + break; + } + result = await fetchPage(result, param); + currentPage++; + } while (currentPage < remainingPages); + } + return result; + }; + if (context.options.persister) { + context.fetchFn = () => { + var _a2, _b2; + return (_b2 = (_a2 = context.options).persister) == null ? void 0 : _b2.call( + _a2, + fetchFn, + { + client: context.client, + queryKey: context.queryKey, + meta: context.options.meta, + signal: context.signal + }, + query + ); + }; + } else { + context.fetchFn = fetchFn; + } + } + }; +} +function getNextPageParam(options, { pages, pageParams }) { + const lastIndex = pages.length - 1; + return pages.length > 0 ? options.getNextPageParam( + pages[lastIndex], + pages, + pageParams[lastIndex], + pageParams + ) : void 0; +} +function getPreviousPageParam(options, { pages, pageParams }) { + var _a; + return pages.length > 0 ? (_a = options.getPreviousPageParam) == null ? void 0 : _a.call(options, pages[0], pages, pageParams[0], pageParams) : void 0; +} +function hasNextPage(options, data) { + if (!data) return false; + return getNextPageParam(options, data) != null; +} +function hasPreviousPage(options, data) { + if (!data || !options.getPreviousPageParam) return false; + return getPreviousPageParam(options, data) != null; +} +export { + hasNextPage, + hasPreviousPage, + infiniteQueryBehavior +}; +//# sourceMappingURL=infiniteQueryBehavior.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/infiniteQueryBehavior.js.map b/node_modules/@tanstack/query-core/build/legacy/infiniteQueryBehavior.js.map new file mode 100644 index 0000000..5b77d0c --- /dev/null +++ b/node_modules/@tanstack/query-core/build/legacy/infiniteQueryBehavior.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/infiniteQueryBehavior.ts"],"sourcesContent":["import {\n addConsumeAwareSignal,\n addToEnd,\n addToStart,\n ensureQueryFn,\n} from './utils'\nimport type { QueryBehavior } from './query'\nimport type {\n InfiniteData,\n InfiniteQueryPageParamsOptions,\n OmitKeyof,\n QueryFunctionContext,\n QueryKey,\n} from './types'\n\nexport function infiniteQueryBehavior(\n pages?: number,\n): QueryBehavior> {\n return {\n onFetch: (context, query) => {\n const options = context.options as InfiniteQueryPageParamsOptions\n const direction = context.fetchOptions?.meta?.fetchMore?.direction\n const oldPages = context.state.data?.pages || []\n const oldPageParams = context.state.data?.pageParams || []\n let result: InfiniteData = { pages: [], pageParams: [] }\n let currentPage = 0\n\n const fetchFn = async () => {\n let cancelled = false\n const addSignalProperty = (object: unknown) => {\n addConsumeAwareSignal(\n object,\n () => context.signal,\n () => (cancelled = true),\n )\n }\n\n const queryFn = ensureQueryFn(context.options, context.fetchOptions)\n\n // Create function to fetch a page\n const fetchPage = async (\n data: InfiniteData,\n param: unknown,\n previous?: boolean,\n ): Promise> => {\n if (cancelled) {\n return Promise.reject()\n }\n\n if (param == null && data.pages.length) {\n return Promise.resolve(data)\n }\n\n const createQueryFnContext = () => {\n const queryFnContext: OmitKeyof<\n QueryFunctionContext,\n 'signal'\n > = {\n client: context.client,\n queryKey: context.queryKey,\n pageParam: param,\n direction: previous ? 'backward' : 'forward',\n meta: context.options.meta,\n }\n addSignalProperty(queryFnContext)\n return queryFnContext as QueryFunctionContext\n }\n\n const queryFnContext = createQueryFnContext()\n\n const page = await queryFn(queryFnContext)\n\n const { maxPages } = context.options\n const addTo = previous ? addToStart : addToEnd\n\n return {\n pages: addTo(data.pages, page, maxPages),\n pageParams: addTo(data.pageParams, param, maxPages),\n }\n }\n\n // fetch next / previous page?\n if (direction && oldPages.length) {\n const previous = direction === 'backward'\n const pageParamFn = previous ? getPreviousPageParam : getNextPageParam\n const oldData = {\n pages: oldPages,\n pageParams: oldPageParams,\n }\n const param = pageParamFn(options, oldData)\n\n result = await fetchPage(oldData, param, previous)\n } else {\n const remainingPages = pages ?? oldPages.length\n\n // Fetch all pages\n do {\n const param =\n currentPage === 0\n ? (oldPageParams[0] ?? options.initialPageParam)\n : getNextPageParam(options, result)\n if (currentPage > 0 && param == null) {\n break\n }\n result = await fetchPage(result, param)\n currentPage++\n } while (currentPage < remainingPages)\n }\n\n return result\n }\n if (context.options.persister) {\n context.fetchFn = () => {\n return context.options.persister?.(\n fetchFn as any,\n {\n client: context.client,\n queryKey: context.queryKey,\n meta: context.options.meta,\n signal: context.signal,\n },\n query,\n )\n }\n } else {\n context.fetchFn = fetchFn\n }\n },\n }\n}\n\nfunction getNextPageParam(\n options: InfiniteQueryPageParamsOptions,\n { pages, pageParams }: InfiniteData,\n): unknown | undefined {\n const lastIndex = pages.length - 1\n return pages.length > 0\n ? options.getNextPageParam(\n pages[lastIndex],\n pages,\n pageParams[lastIndex],\n pageParams,\n )\n : undefined\n}\n\nfunction getPreviousPageParam(\n options: InfiniteQueryPageParamsOptions,\n { pages, pageParams }: InfiniteData,\n): unknown | undefined {\n return pages.length > 0\n ? options.getPreviousPageParam?.(pages[0], pages, pageParams[0], pageParams)\n : undefined\n}\n\n/**\n * Checks if there is a next page.\n */\nexport function hasNextPage(\n options: InfiniteQueryPageParamsOptions,\n data?: InfiniteData,\n): boolean {\n if (!data) return false\n return getNextPageParam(options, data) != null\n}\n\n/**\n * Checks if there is a previous page.\n */\nexport function hasPreviousPage(\n options: InfiniteQueryPageParamsOptions,\n data?: InfiniteData,\n): boolean {\n if (!data || !options.getPreviousPageParam) return false\n return getPreviousPageParam(options, data) != null\n}\n"],"mappings":";;;AAAA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAUA,SAAS,sBACd,OACsE;AACtE,SAAO;AA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AsJE,SAAO,MAAM,SAAS,KAClB,aAAQ,yBAAR,iCAA+B,MAAM,CAAC,GAAG,OAAO,WAAW,CAAC,GAAG,cAC/D;AACN;AAKO,SAAS,YACd,SACA,MACS;AACT,MAAI,CAAC,KAAM,QAAO;AAClB,SAAO,iBAAiB,SAAS,IAAI,KAAK;AAC5C;AAKO,SAAS,gBACd,SACA,MACS;AACT,MAAI,CAAC,QAAQ,CAAC,QAAQ,qBAAsB,QAAO;AACnD,SAAO,qBAAqB,SAAS,IAAI,KAAK;AAChD;","names":["queryFnContext","_a","_b"]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/infiniteQueryObserver.cjs b/node_modules/@tanstack/query-core/build/legacy/infiniteQueryObserver.cjs new file mode 100644 index 0000000..1b4de6d --- /dev/null +++ b/node_modules/@tanstack/query-core/build/legacy/infiniteQueryObserver.cjs @@ -0,0 +1,93 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/infiniteQueryObserver.ts +var infiniteQueryObserver_exports = {}; +__export(infiniteQueryObserver_exports, { + InfiniteQueryObserver: () => InfiniteQueryObserver +}); +module.exports = __toCommonJS(infiniteQueryObserver_exports); +var import_queryObserver = require("./queryObserver.cjs"); +var import_infiniteQueryBehavior = require("./infiniteQueryBehavior.cjs"); +var InfiniteQueryObserver = class extends import_queryObserver.QueryObserver { + constructor(client, options) { + super(client, options); + } + bindMethods() { + super.bindMethods(); + this.fetchNextPage = this.fetchNextPage.bind(this); + this.fetchPreviousPage = this.fetchPreviousPage.bind(this); + } + setOptions(options) { + super.setOptions({ + ...options, + behavior: (0, import_infiniteQueryBehavior.infiniteQueryBehavior)() + }); + } + getOptimisticResult(options) { + options.behavior = (0, import_infiniteQueryBehavior.infiniteQueryBehavior)(); + return super.getOptimisticResult(options); + } + fetchNextPage(options) { + return this.fetch({ + ...options, + meta: { + fetchMore: { direction: "forward" } + } + }); + } + fetchPreviousPage(options) { + return this.fetch({ + ...options, + meta: { + fetchMore: { direction: "backward" } + } + }); + } + createResult(query, options) { + var _a, _b; + const { state } = query; + const parentResult = super.createResult(query, options); + const { isFetching, isRefetching, isError, isRefetchError } = parentResult; + const fetchDirection = (_b = (_a = state.fetchMeta) == null ? void 0 : _a.fetchMore) == null ? void 0 : _b.direction; + const isFetchNextPageError = isError && fetchDirection === "forward"; + const isFetchingNextPage = isFetching && fetchDirection === "forward"; + const isFetchPreviousPageError = isError && fetchDirection === "backward"; + const isFetchingPreviousPage = isFetching && fetchDirection === "backward"; + const result = { + ...parentResult, + fetchNextPage: this.fetchNextPage, + fetchPreviousPage: this.fetchPreviousPage, + hasNextPage: (0, import_infiniteQueryBehavior.hasNextPage)(options, state.data), + hasPreviousPage: (0, import_infiniteQueryBehavior.hasPreviousPage)(options, state.data), + isFetchNextPageError, + isFetchingNextPage, + isFetchPreviousPageError, + isFetchingPreviousPage, + isRefetchError: isRefetchError && !isFetchNextPageError && !isFetchPreviousPageError, + isRefetching: isRefetching && !isFetchingNextPage && !isFetchingPreviousPage + }; + return result; + } +}; +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + InfiniteQueryObserver +}); +//# sourceMappingURL=infiniteQueryObserver.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/infiniteQueryObserver.cjs.map b/node_modules/@tanstack/query-core/build/legacy/infiniteQueryObserver.cjs.map new file mode 100644 index 0000000..a4a85d8 --- /dev/null +++ b/node_modules/@tanstack/query-core/build/legacy/infiniteQueryObserver.cjs.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/infiniteQueryObserver.ts"],"sourcesContent":["import { QueryObserver } from './queryObserver'\nimport {\n hasNextPage,\n hasPreviousPage,\n infiniteQueryBehavior,\n} from './infiniteQueryBehavior'\nimport type { Subscribable } from './subscribable'\nimport type {\n DefaultError,\n DefaultedInfiniteQueryObserverOptions,\n FetchNextPageOptions,\n FetchPreviousPageOptions,\n InfiniteData,\n InfiniteQueryObserverBaseResult,\n InfiniteQueryObserverOptions,\n InfiniteQueryObserverResult,\n QueryKey,\n} from './types'\nimport type { QueryClient } from './queryClient'\nimport type { Query } from './query'\n\ntype InfiniteQueryObserverListener = (\n result: InfiniteQueryObserverResult,\n) => void\n\nexport class InfiniteQueryObserver<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = InfiniteData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n> extends QueryObserver<\n TQueryFnData,\n TError,\n TData,\n InfiniteData,\n TQueryKey\n> {\n // Type override\n subscribe!: Subscribable<\n InfiniteQueryObserverListener\n >['subscribe']\n\n // Type override\n getCurrentResult!: ReplaceReturnType<\n QueryObserver<\n TQueryFnData,\n TError,\n TData,\n InfiniteData,\n TQueryKey\n >['getCurrentResult'],\n InfiniteQueryObserverResult\n >\n\n // Type override\n protected fetch!: ReplaceReturnType<\n QueryObserver<\n TQueryFnData,\n TError,\n TData,\n InfiniteData,\n TQueryKey\n >['fetch'],\n Promise>\n >\n\n constructor(\n client: QueryClient,\n options: InfiniteQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n ) {\n super(client, options)\n }\n\n protected bindMethods(): void {\n super.bindMethods()\n this.fetchNextPage = this.fetchNextPage.bind(this)\n this.fetchPreviousPage = this.fetchPreviousPage.bind(this)\n }\n\n setOptions(\n options: InfiniteQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n ): void {\n super.setOptions({\n ...options,\n behavior: infiniteQueryBehavior(),\n })\n }\n\n getOptimisticResult(\n options: DefaultedInfiniteQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n ): InfiniteQueryObserverResult {\n options.behavior = infiniteQueryBehavior()\n return super.getOptimisticResult(options) as InfiniteQueryObserverResult<\n TData,\n TError\n >\n }\n\n fetchNextPage(\n options?: FetchNextPageOptions,\n ): Promise> {\n return this.fetch({\n ...options,\n meta: {\n fetchMore: { direction: 'forward' },\n },\n })\n }\n\n fetchPreviousPage(\n options?: FetchPreviousPageOptions,\n ): Promise> {\n return this.fetch({\n ...options,\n meta: {\n fetchMore: { direction: 'backward' },\n },\n })\n }\n\n protected createResult(\n query: Query<\n TQueryFnData,\n TError,\n InfiniteData,\n TQueryKey\n >,\n options: InfiniteQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n ): InfiniteQueryObserverResult {\n const { state } = query\n const parentResult = super.createResult(query, options)\n\n const { isFetching, isRefetching, isError, isRefetchError } = parentResult\n const fetchDirection = state.fetchMeta?.fetchMore?.direction\n\n const isFetchNextPageError = isError && fetchDirection === 'forward'\n const isFetchingNextPage = isFetching && fetchDirection === 'forward'\n\n const isFetchPreviousPageError = isError && fetchDirection === 'backward'\n const isFetchingPreviousPage = isFetching && fetchDirection === 'backward'\n\n const result: InfiniteQueryObserverBaseResult = {\n ...parentResult,\n fetchNextPage: this.fetchNextPage,\n fetchPreviousPage: this.fetchPreviousPage,\n hasNextPage: hasNextPage(options, state.data),\n hasPreviousPage: hasPreviousPage(options, state.data),\n isFetchNextPageError,\n isFetchingNextPage,\n isFetchPreviousPageError,\n isFetchingPreviousPage,\n isRefetchError:\n isRefetchError && !isFetchNextPageError && !isFetchPreviousPageError,\n isRefetching:\n isRefetching && !isFetchingNextPage && !isFetchingPreviousPage,\n }\n\n return result as InfiniteQueryObserverResult\n }\n}\n\ntype ReplaceReturnType<\n TFunction extends (...args: Array) => unknown,\n TReturn,\n> = (...args: Parameters) => TReturn\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,2BAA8B;AAC9B,mCAIO;AAoBA,IAAM,wBAAN,cAMG,mCAMR;AAAA,EA8BA,YACE,QACA,SAOA;AACA,UAAM,QAAQ,OAAO;AAAA,EACvB;AAAA,EAEU,cAAoB;AAC5B,UAAM,YAAY;AAClB,SAAK,gBAAgB,KAAK,cAAc,KAAK,IAAI;AACjD,SAAK,oBAAoB,KAAK,kBAAkB,KAAK,IAAI;AAAA,EAC3D;AAAA,EAEA,WACE,SAOM;AACN,UAAM,WAAW;AAAA,MACf,GAAG;AAAA,MACH,cAAU,oDAAsB;AAAA,IAClC,CAAC;AAAA,EACH;AAAA,EAEA,oBACE,SAO4C;AAC5C,YAAQ,eAAW,oDAAsB;AACzC,WAAO,MAAM,oBAAoB,OAAO;AAAA,EAI1C;AAAA,EAEA,cACE,SACqD;AACrD,WAAO,KAAK,MAAM;AAAA,MAChB,GAAG;AAAA,MACH,MAAM;AAAA,QACJ,WAAW,EAAE,WAAW,UAAU;AAAA,MACpC;AAAA,IACF,CAAC;AAAA,EACH;AAAA,EAEA,kBACE,SACqD;AACrD,WAAO,KAAK,MAAM;AAAA,MAChB,GAAG;AAAA,MACH,MAAM;AAAA,QACJ,WAAW,EAAE,WAAW,WAAW;AAAA,MACrC;AAAA,IACF,CAAC;AAAA,EACH;AAAA,EAEU,aACR,OAMA,SAO4C;AAzJhD;AA0JI,UAAM,EAAE,MAAM,IAAI;AAClB,UAAM,eAAe,MAAM,aAAa,OAAO,OAAO;AAEtD,UAAM,EAAE,YAAY,cAAc,SAAS,eAAe,IAAI;AAC9D,UAAM,kBAAiB,iBAAM,cAAN,mBAAiB,cAAjB,mBAA4B;AAEnD,UAAM,uBAAuB,WAAW,mBAAmB;AAC3D,UAAM,qBAAqB,cAAc,mBAAmB;AAE5D,UAAM,2BAA2B,WAAW,mBAAmB;AAC/D,UAAM,yBAAyB,cAAc,mBAAmB;AAEhE,UAAM,SAAyD;AAAA,MAC7D,GAAG;AAAA,MACH,eAAe,KAAK;AAAA,MACpB,mBAAmB,KAAK;AAAA,MACxB,iBAAa,0CAAY,SAAS,MAAM,IAAI;AAAA,MAC5C,qBAAiB,8CAAgB,SAAS,MAAM,IAAI;AAAA,MACpD;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,gBACE,kBAAkB,CAAC,wBAAwB,CAAC;AAAA,MAC9C,cACE,gBAAgB,CAAC,sBAAsB,CAAC;AAAA,IAC5C;AAEA,WAAO;AAAA,EACT;AACF;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/infiniteQueryObserver.d.cts b/node_modules/@tanstack/query-core/build/legacy/infiniteQueryObserver.d.cts new file mode 100644 index 0000000..296a938 --- /dev/null +++ b/node_modules/@tanstack/query-core/build/legacy/infiniteQueryObserver.d.cts @@ -0,0 +1,20 @@ +import { G as DefaultError, a8 as InfiniteData, I as QueryKey, i as QueryObserver, aQ as InfiniteQueryObserverResult, g as QueryClient, aj as InfiniteQueryObserverOptions, ak as DefaultedInfiniteQueryObserverOptions, av as FetchNextPageOptions, aw as FetchPreviousPageOptions, z as Query } from './hydration-uphG6M-i.cjs'; +import { Subscribable } from './subscribable.cjs'; +import './removable.cjs'; + +type InfiniteQueryObserverListener = (result: InfiniteQueryObserverResult) => void; +declare class InfiniteQueryObserver, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown> extends QueryObserver, TQueryKey> { + subscribe: Subscribable>['subscribe']; + getCurrentResult: ReplaceReturnType, TQueryKey>['getCurrentResult'], InfiniteQueryObserverResult>; + protected fetch: ReplaceReturnType, TQueryKey>['fetch'], Promise>>; + constructor(client: QueryClient, options: InfiniteQueryObserverOptions); + protected bindMethods(): void; + setOptions(options: InfiniteQueryObserverOptions): void; + getOptimisticResult(options: DefaultedInfiniteQueryObserverOptions): InfiniteQueryObserverResult; + fetchNextPage(options?: FetchNextPageOptions): Promise>; + fetchPreviousPage(options?: FetchPreviousPageOptions): Promise>; + protected createResult(query: Query, TQueryKey>, options: InfiniteQueryObserverOptions): InfiniteQueryObserverResult; +} +type ReplaceReturnType) => unknown, TReturn> = (...args: Parameters) => TReturn; + +export { InfiniteQueryObserver }; diff --git a/node_modules/@tanstack/query-core/build/legacy/infiniteQueryObserver.d.ts b/node_modules/@tanstack/query-core/build/legacy/infiniteQueryObserver.d.ts new file mode 100644 index 0000000..96dca65 --- /dev/null +++ b/node_modules/@tanstack/query-core/build/legacy/infiniteQueryObserver.d.ts @@ -0,0 +1,20 @@ +import { G as DefaultError, a8 as InfiniteData, I as QueryKey, i as QueryObserver, aQ as InfiniteQueryObserverResult, g as QueryClient, aj as InfiniteQueryObserverOptions, ak as DefaultedInfiniteQueryObserverOptions, av as FetchNextPageOptions, aw as FetchPreviousPageOptions, z as Query } from './hydration-BlEVG2Lp.js'; +import { Subscribable } from './subscribable.js'; +import './removable.js'; + +type InfiniteQueryObserverListener = (result: InfiniteQueryObserverResult) => void; +declare class InfiniteQueryObserver, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown> extends QueryObserver, TQueryKey> { + subscribe: Subscribable>['subscribe']; + getCurrentResult: ReplaceReturnType, TQueryKey>['getCurrentResult'], InfiniteQueryObserverResult>; + protected fetch: ReplaceReturnType, TQueryKey>['fetch'], Promise>>; + constructor(client: QueryClient, options: InfiniteQueryObserverOptions); + protected bindMethods(): void; + setOptions(options: InfiniteQueryObserverOptions): void; + getOptimisticResult(options: DefaultedInfiniteQueryObserverOptions): InfiniteQueryObserverResult; + fetchNextPage(options?: FetchNextPageOptions): Promise>; + fetchPreviousPage(options?: FetchPreviousPageOptions): Promise>; + protected createResult(query: Query, TQueryKey>, options: InfiniteQueryObserverOptions): InfiniteQueryObserverResult; +} +type ReplaceReturnType) => unknown, TReturn> = (...args: Parameters) => TReturn; + +export { InfiniteQueryObserver }; diff --git a/node_modules/@tanstack/query-core/build/legacy/infiniteQueryObserver.js b/node_modules/@tanstack/query-core/build/legacy/infiniteQueryObserver.js new file mode 100644 index 0000000..101797f --- /dev/null +++ b/node_modules/@tanstack/query-core/build/legacy/infiniteQueryObserver.js @@ -0,0 +1,74 @@ +import "./chunk-PXG64RU4.js"; + +// src/infiniteQueryObserver.ts +import { QueryObserver } from "./queryObserver.js"; +import { + hasNextPage, + hasPreviousPage, + infiniteQueryBehavior +} from "./infiniteQueryBehavior.js"; +var InfiniteQueryObserver = class extends QueryObserver { + constructor(client, options) { + super(client, options); + } + bindMethods() { + super.bindMethods(); + this.fetchNextPage = this.fetchNextPage.bind(this); + this.fetchPreviousPage = this.fetchPreviousPage.bind(this); + } + setOptions(options) { + super.setOptions({ + ...options, + behavior: infiniteQueryBehavior() + }); + } + getOptimisticResult(options) { + options.behavior = infiniteQueryBehavior(); + return super.getOptimisticResult(options); + } + fetchNextPage(options) { + return this.fetch({ + ...options, + meta: { + fetchMore: { direction: "forward" } + } + }); + } + fetchPreviousPage(options) { + return this.fetch({ + ...options, + meta: { + fetchMore: { direction: "backward" } + } + }); + } + createResult(query, options) { + var _a, _b; + const { state } = query; + const parentResult = super.createResult(query, options); + const { isFetching, isRefetching, isError, isRefetchError } = parentResult; + const fetchDirection = (_b = (_a = state.fetchMeta) == null ? void 0 : _a.fetchMore) == null ? void 0 : _b.direction; + const isFetchNextPageError = isError && fetchDirection === "forward"; + const isFetchingNextPage = isFetching && fetchDirection === "forward"; + const isFetchPreviousPageError = isError && fetchDirection === "backward"; + const isFetchingPreviousPage = isFetching && fetchDirection === "backward"; + const result = { + ...parentResult, + fetchNextPage: this.fetchNextPage, + fetchPreviousPage: this.fetchPreviousPage, + hasNextPage: hasNextPage(options, state.data), + hasPreviousPage: hasPreviousPage(options, state.data), + isFetchNextPageError, + isFetchingNextPage, + isFetchPreviousPageError, + isFetchingPreviousPage, + isRefetchError: isRefetchError && !isFetchNextPageError && !isFetchPreviousPageError, + isRefetching: isRefetching && !isFetchingNextPage && !isFetchingPreviousPage + }; + return result; + } +}; +export { + InfiniteQueryObserver +}; +//# sourceMappingURL=infiniteQueryObserver.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/infiniteQueryObserver.js.map b/node_modules/@tanstack/query-core/build/legacy/infiniteQueryObserver.js.map new file mode 100644 index 0000000..6893b34 --- /dev/null +++ b/node_modules/@tanstack/query-core/build/legacy/infiniteQueryObserver.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/infiniteQueryObserver.ts"],"sourcesContent":["import { QueryObserver } from './queryObserver'\nimport {\n hasNextPage,\n hasPreviousPage,\n infiniteQueryBehavior,\n} from './infiniteQueryBehavior'\nimport type { Subscribable } from './subscribable'\nimport type {\n DefaultError,\n DefaultedInfiniteQueryObserverOptions,\n FetchNextPageOptions,\n FetchPreviousPageOptions,\n InfiniteData,\n InfiniteQueryObserverBaseResult,\n InfiniteQueryObserverOptions,\n InfiniteQueryObserverResult,\n QueryKey,\n} from './types'\nimport type { QueryClient } from './queryClient'\nimport type { Query } from './query'\n\ntype InfiniteQueryObserverListener = (\n result: InfiniteQueryObserverResult,\n) => void\n\nexport class InfiniteQueryObserver<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = InfiniteData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n> extends QueryObserver<\n TQueryFnData,\n TError,\n TData,\n InfiniteData,\n TQueryKey\n> {\n // Type override\n subscribe!: Subscribable<\n InfiniteQueryObserverListener\n >['subscribe']\n\n // Type override\n getCurrentResult!: ReplaceReturnType<\n QueryObserver<\n TQueryFnData,\n TError,\n TData,\n InfiniteData,\n TQueryKey\n >['getCurrentResult'],\n InfiniteQueryObserverResult\n >\n\n // Type override\n protected fetch!: ReplaceReturnType<\n QueryObserver<\n TQueryFnData,\n TError,\n TData,\n InfiniteData,\n TQueryKey\n >['fetch'],\n Promise>\n >\n\n constructor(\n client: QueryClient,\n options: InfiniteQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n ) {\n super(client, options)\n }\n\n protected bindMethods(): void {\n super.bindMethods()\n this.fetchNextPage = this.fetchNextPage.bind(this)\n this.fetchPreviousPage = this.fetchPreviousPage.bind(this)\n }\n\n setOptions(\n options: InfiniteQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n ): void {\n super.setOptions({\n ...options,\n behavior: infiniteQueryBehavior(),\n })\n }\n\n getOptimisticResult(\n options: DefaultedInfiniteQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n ): InfiniteQueryObserverResult {\n options.behavior = infiniteQueryBehavior()\n return super.getOptimisticResult(options) as InfiniteQueryObserverResult<\n TData,\n TError\n >\n }\n\n fetchNextPage(\n options?: FetchNextPageOptions,\n ): Promise> {\n return this.fetch({\n ...options,\n meta: {\n fetchMore: { direction: 'forward' },\n },\n })\n }\n\n fetchPreviousPage(\n options?: FetchPreviousPageOptions,\n ): Promise> {\n return this.fetch({\n ...options,\n meta: {\n fetchMore: { direction: 'backward' },\n },\n })\n }\n\n protected createResult(\n query: Query<\n TQueryFnData,\n TError,\n InfiniteData,\n TQueryKey\n >,\n options: InfiniteQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n ): InfiniteQueryObserverResult {\n const { state } = query\n const parentResult = super.createResult(query, options)\n\n const { isFetching, isRefetching, isError, isRefetchError } = parentResult\n const fetchDirection = state.fetchMeta?.fetchMore?.direction\n\n const isFetchNextPageError = isError && fetchDirection === 'forward'\n const isFetchingNextPage = isFetching && fetchDirection === 'forward'\n\n const isFetchPreviousPageError = isError && fetchDirection === 'backward'\n const isFetchingPreviousPage = isFetching && fetchDirection === 'backward'\n\n const result: InfiniteQueryObserverBaseResult = {\n ...parentResult,\n fetchNextPage: this.fetchNextPage,\n fetchPreviousPage: this.fetchPreviousPage,\n hasNextPage: hasNextPage(options, state.data),\n hasPreviousPage: hasPreviousPage(options, state.data),\n isFetchNextPageError,\n isFetchingNextPage,\n isFetchPreviousPageError,\n isFetchingPreviousPage,\n isRefetchError:\n isRefetchError && !isFetchNextPageError && !isFetchPreviousPageError,\n isRefetching:\n isRefetching && !isFetchingNextPage && !isFetchingPreviousPage,\n }\n\n return result as InfiniteQueryObserverResult\n }\n}\n\ntype ReplaceReturnType<\n TFunction extends (...args: Array) => unknown,\n TReturn,\n> = (...args: Parameters) => TReturn\n"],"mappings":";;;AAAA,SAAS,qBAAqB;AAC9B;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAoBA,IAAM,wBAAN,cAMG,cAMR;AAAA,EA8BA,YACE,QACA,SAOA;AACA,UAAM,QAAQ,OAAO;AAAA,EACvB;AAAA,EAEU,cAAoB;AAC5B,UAAM,YAAY;AAClB,SAAK,gBAAgB,KAAK,cAAc,KAAK,IAAI;AACjD,SAAK,oBAAoB,KAAK,kBAAkB,KAAK,IAAI;AAAA,EAC3D;AAAA,EAEA,WACE,SAOM;AACN,UAAM,WAAW;AAAA,MACf,GAAG;AAAA,MACH,UAAU,sBAAsB;AAAA,IAClC,CAAC;AAAA,EACH;AAAA,EAEA,oBACE,SAO4C;AAC5C,YAAQ,WAAW,sBAAsB;AACzC,WAAO,MAAM,oBAAoB,OAAO;AAAA,EAI1C;AAAA,EAEA,cACE,SACqD;AACrD,WAAO,KAAK,MAAM;AAAA,MAChB,GAAG;AAAA,MACH,MAAM;AAAA,QACJ,WAAW,EAAE,WAAW,UAAU;AAAA,MACpC;AAAA,IACF,CAAC;AAAA,EACH;AAAA,EAEA,kBACE,SACqD;AACrD,WAAO,KAAK,MAAM;AAAA,MAChB,GAAG;AAAA,MACH,MAAM;AAAA,QACJ,WAAW,EAAE,WAAW,WAAW;AAAA,MACrC;AAAA,IACF,CAAC;AAAA,EACH;AAAA,EAEU,aACR,OAMA,SAO4C;AAzJhD;AA0JI,UAAM,EAAE,MAAM,IAAI;AAClB,UAAM,eAAe,MAAM,aAAa,OAAO,OAAO;AAEtD,UAAM,EAAE,YAAY,cAAc,SAAS,eAAe,IAAI;AAC9D,UAAM,kBAAiB,iBAAM,cAAN,mBAAiB,cAAjB,mBAA4B;AAEnD,UAAM,uBAAuB,WAAW,mBAAmB;AAC3D,UAAM,qBAAqB,cAAc,mBAAmB;AAE5D,UAAM,2BAA2B,WAAW,mBAAmB;AAC/D,UAAM,yBAAyB,cAAc,mBAAmB;AAEhE,UAAM,SAAyD;AAAA,MAC7D,GAAG;AAAA,MACH,eAAe,KAAK;AAAA,MACpB,mBAAmB,KAAK;AAAA,MACxB,aAAa,YAAY,SAAS,MAAM,IAAI;AAAA,MAC5C,iBAAiB,gBAAgB,SAAS,MAAM,IAAI;AAAA,MACpD;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,gBACE,kBAAkB,CAAC,wBAAwB,CAAC;AAAA,MAC9C,cACE,gBAAgB,CAAC,sBAAsB,CAAC;AAAA,IAC5C;AAEA,WAAO;AAAA,EACT;AACF;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/mutation.cjs b/node_modules/@tanstack/query-core/build/legacy/mutation.cjs new file mode 100644 index 0000000..145965c --- /dev/null +++ b/node_modules/@tanstack/query-core/build/legacy/mutation.cjs @@ -0,0 +1,333 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __typeError = (msg) => { + throw TypeError(msg); +}; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg); +var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj)); +var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value); +var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value); +var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method); + +// src/mutation.ts +var mutation_exports = {}; +__export(mutation_exports, { + Mutation: () => Mutation, + getDefaultState: () => getDefaultState +}); +module.exports = __toCommonJS(mutation_exports); +var import_notifyManager = require("./notifyManager.cjs"); +var import_removable = require("./removable.cjs"); +var import_retryer = require("./retryer.cjs"); +var _client, _observers, _mutationCache, _retryer, _Mutation_instances, dispatch_fn; +var Mutation = class extends import_removable.Removable { + constructor(config) { + super(); + __privateAdd(this, _Mutation_instances); + __privateAdd(this, _client); + __privateAdd(this, _observers); + __privateAdd(this, _mutationCache); + __privateAdd(this, _retryer); + __privateSet(this, _client, config.client); + this.mutationId = config.mutationId; + __privateSet(this, _mutationCache, config.mutationCache); + __privateSet(this, _observers, []); + this.state = config.state || getDefaultState(); + this.setOptions(config.options); + this.scheduleGc(); + } + setOptions(options) { + this.options = options; + this.updateGcTime(this.options.gcTime); + } + get meta() { + return this.options.meta; + } + addObserver(observer) { + if (!__privateGet(this, _observers).includes(observer)) { + __privateGet(this, _observers).push(observer); + this.clearGcTimeout(); + __privateGet(this, _mutationCache).notify({ + type: "observerAdded", + mutation: this, + observer + }); + } + } + removeObserver(observer) { + __privateSet(this, _observers, __privateGet(this, _observers).filter((x) => x !== observer)); + this.scheduleGc(); + __privateGet(this, _mutationCache).notify({ + type: "observerRemoved", + mutation: this, + observer + }); + } + optionalRemove() { + if (!__privateGet(this, _observers).length) { + if (this.state.status === "pending") { + this.scheduleGc(); + } else { + __privateGet(this, _mutationCache).remove(this); + } + } + } + continue() { + var _a; + return ((_a = __privateGet(this, _retryer)) == null ? void 0 : _a.continue()) ?? // continuing a mutation assumes that variables are set, mutation must have been dehydrated before + this.execute(this.state.variables); + } + async execute(variables) { + var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r; + const onContinue = () => { + __privateMethod(this, _Mutation_instances, dispatch_fn).call(this, { type: "continue" }); + }; + const mutationFnContext = { + client: __privateGet(this, _client), + meta: this.options.meta, + mutationKey: this.options.mutationKey + }; + __privateSet(this, _retryer, (0, import_retryer.createRetryer)({ + fn: () => { + if (!this.options.mutationFn) { + return Promise.reject(new Error("No mutationFn found")); + } + return this.options.mutationFn(variables, mutationFnContext); + }, + onFail: (failureCount, error) => { + __privateMethod(this, _Mutation_instances, dispatch_fn).call(this, { type: "failed", failureCount, error }); + }, + onPause: () => { + __privateMethod(this, _Mutation_instances, dispatch_fn).call(this, { type: "pause" }); + }, + onContinue, + retry: this.options.retry ?? 0, + retryDelay: this.options.retryDelay, + networkMode: this.options.networkMode, + canRun: () => __privateGet(this, _mutationCache).canRun(this) + })); + const restored = this.state.status === "pending"; + const isPaused = !__privateGet(this, _retryer).canStart(); + try { + if (restored) { + onContinue(); + } else { + __privateMethod(this, _Mutation_instances, dispatch_fn).call(this, { type: "pending", variables, isPaused }); + if (__privateGet(this, _mutationCache).config.onMutate) { + await __privateGet(this, _mutationCache).config.onMutate( + variables, + this, + mutationFnContext + ); + } + const context = await ((_b = (_a = this.options).onMutate) == null ? void 0 : _b.call( + _a, + variables, + mutationFnContext + )); + if (context !== this.state.context) { + __privateMethod(this, _Mutation_instances, dispatch_fn).call(this, { + type: "pending", + context, + variables, + isPaused + }); + } + } + const data = await __privateGet(this, _retryer).start(); + await ((_d = (_c = __privateGet(this, _mutationCache).config).onSuccess) == null ? void 0 : _d.call( + _c, + data, + variables, + this.state.context, + this, + mutationFnContext + )); + await ((_f = (_e = this.options).onSuccess) == null ? void 0 : _f.call( + _e, + data, + variables, + this.state.context, + mutationFnContext + )); + await ((_h = (_g = __privateGet(this, _mutationCache).config).onSettled) == null ? void 0 : _h.call( + _g, + data, + null, + this.state.variables, + this.state.context, + this, + mutationFnContext + )); + await ((_j = (_i = this.options).onSettled) == null ? void 0 : _j.call( + _i, + data, + null, + variables, + this.state.context, + mutationFnContext + )); + __privateMethod(this, _Mutation_instances, dispatch_fn).call(this, { type: "success", data }); + return data; + } catch (error) { + try { + await ((_l = (_k = __privateGet(this, _mutationCache).config).onError) == null ? void 0 : _l.call( + _k, + error, + variables, + this.state.context, + this, + mutationFnContext + )); + } catch (e) { + void Promise.reject(e); + } + try { + await ((_n = (_m = this.options).onError) == null ? void 0 : _n.call( + _m, + error, + variables, + this.state.context, + mutationFnContext + )); + } catch (e) { + void Promise.reject(e); + } + try { + await ((_p = (_o = __privateGet(this, _mutationCache).config).onSettled) == null ? void 0 : _p.call( + _o, + void 0, + error, + this.state.variables, + this.state.context, + this, + mutationFnContext + )); + } catch (e) { + void Promise.reject(e); + } + try { + await ((_r = (_q = this.options).onSettled) == null ? void 0 : _r.call( + _q, + void 0, + error, + variables, + this.state.context, + mutationFnContext + )); + } catch (e) { + void Promise.reject(e); + } + __privateMethod(this, _Mutation_instances, dispatch_fn).call(this, { type: "error", error }); + throw error; + } finally { + __privateGet(this, _mutationCache).runNext(this); + } + } +}; +_client = new WeakMap(); +_observers = new WeakMap(); +_mutationCache = new WeakMap(); +_retryer = new WeakMap(); +_Mutation_instances = new WeakSet(); +dispatch_fn = function(action) { + const reducer = (state) => { + switch (action.type) { + case "failed": + return { + ...state, + failureCount: action.failureCount, + failureReason: action.error + }; + case "pause": + return { + ...state, + isPaused: true + }; + case "continue": + return { + ...state, + isPaused: false + }; + case "pending": + return { + ...state, + context: action.context, + data: void 0, + failureCount: 0, + failureReason: null, + error: null, + isPaused: action.isPaused, + status: "pending", + variables: action.variables, + submittedAt: Date.now() + }; + case "success": + return { + ...state, + data: action.data, + failureCount: 0, + failureReason: null, + error: null, + status: "success", + isPaused: false + }; + case "error": + return { + ...state, + data: void 0, + error: action.error, + failureCount: state.failureCount + 1, + failureReason: action.error, + isPaused: false, + status: "error" + }; + } + }; + this.state = reducer(this.state); + import_notifyManager.notifyManager.batch(() => { + __privateGet(this, _observers).forEach((observer) => { + observer.onMutationUpdate(action); + }); + __privateGet(this, _mutationCache).notify({ + mutation: this, + type: "updated", + action + }); + }); +}; +function getDefaultState() { + return { + context: void 0, + data: void 0, + error: null, + failureCount: 0, + failureReason: null, + isPaused: false, + status: "idle", + variables: void 0, + submittedAt: 0 + }; +} +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + Mutation, + getDefaultState +}); +//# sourceMappingURL=mutation.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/mutation.cjs.map b/node_modules/@tanstack/query-core/build/legacy/mutation.cjs.map new file mode 100644 index 0000000..6ddca83 --- /dev/null +++ b/node_modules/@tanstack/query-core/build/legacy/mutation.cjs.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/mutation.ts"],"sourcesContent":["import { notifyManager } from './notifyManager'\nimport { Removable } from './removable'\nimport { createRetryer } from './retryer'\nimport type {\n DefaultError,\n MutationFunctionContext,\n MutationMeta,\n MutationOptions,\n MutationStatus,\n} from './types'\nimport type { MutationCache } from './mutationCache'\nimport type { MutationObserver } from './mutationObserver'\nimport type { Retryer } from './retryer'\nimport type { QueryClient } from './queryClient'\n\n// TYPES\n\ninterface MutationConfig {\n client: QueryClient\n mutationId: number\n mutationCache: MutationCache\n options: MutationOptions\n state?: MutationState\n}\n\nexport interface MutationState<\n TData = unknown,\n TError = DefaultError,\n TVariables = unknown,\n TOnMutateResult = unknown,\n> {\n context: TOnMutateResult | undefined\n data: TData | undefined\n error: TError | null\n failureCount: number\n failureReason: TError | null\n isPaused: boolean\n status: MutationStatus\n variables: TVariables | undefined\n submittedAt: number\n}\n\ninterface FailedAction {\n type: 'failed'\n failureCount: number\n error: TError | null\n}\n\ninterface PendingAction {\n type: 'pending'\n isPaused: boolean\n variables?: TVariables\n context?: TOnMutateResult\n}\n\ninterface SuccessAction {\n type: 'success'\n data: TData\n}\n\ninterface ErrorAction {\n type: 'error'\n error: TError\n}\n\ninterface PauseAction {\n type: 'pause'\n}\n\ninterface ContinueAction {\n type: 'continue'\n}\n\nexport type Action =\n | ContinueAction\n | ErrorAction\n | FailedAction\n | PendingAction\n | PauseAction\n | SuccessAction\n\n// CLASS\n\nexport class Mutation<\n TData = unknown,\n TError = DefaultError,\n TVariables = unknown,\n TOnMutateResult = unknown,\n> extends Removable {\n state: MutationState\n options!: MutationOptions\n readonly mutationId: number\n\n #client: QueryClient\n #observers: Array<\n MutationObserver\n >\n #mutationCache: MutationCache\n #retryer?: Retryer\n\n constructor(\n config: MutationConfig,\n ) {\n super()\n\n this.#client = config.client\n this.mutationId = config.mutationId\n this.#mutationCache = config.mutationCache\n this.#observers = []\n this.state = config.state || getDefaultState()\n\n this.setOptions(config.options)\n this.scheduleGc()\n }\n\n setOptions(\n options: MutationOptions,\n ): void {\n this.options = options\n\n this.updateGcTime(this.options.gcTime)\n }\n\n get meta(): MutationMeta | undefined {\n return this.options.meta\n }\n\n addObserver(observer: MutationObserver): void {\n if (!this.#observers.includes(observer)) {\n this.#observers.push(observer)\n\n // Stop the mutation from being garbage collected\n this.clearGcTimeout()\n\n this.#mutationCache.notify({\n type: 'observerAdded',\n mutation: this,\n observer,\n })\n }\n }\n\n removeObserver(observer: MutationObserver): void {\n this.#observers = this.#observers.filter((x) => x !== observer)\n\n this.scheduleGc()\n\n this.#mutationCache.notify({\n type: 'observerRemoved',\n mutation: this,\n observer,\n })\n }\n\n protected optionalRemove() {\n if (!this.#observers.length) {\n if (this.state.status === 'pending') {\n this.scheduleGc()\n } else {\n this.#mutationCache.remove(this)\n }\n }\n }\n\n continue(): Promise {\n return (\n this.#retryer?.continue() ??\n // continuing a mutation assumes that variables are set, mutation must have been dehydrated before\n this.execute(this.state.variables!)\n )\n }\n\n async execute(variables: TVariables): Promise {\n const onContinue = () => {\n this.#dispatch({ type: 'continue' })\n }\n\n const mutationFnContext = {\n client: this.#client,\n meta: this.options.meta,\n mutationKey: this.options.mutationKey,\n } satisfies MutationFunctionContext\n\n this.#retryer = createRetryer({\n fn: () => {\n if (!this.options.mutationFn) {\n return Promise.reject(new Error('No mutationFn found'))\n }\n\n return this.options.mutationFn(variables, mutationFnContext)\n },\n onFail: (failureCount, error) => {\n this.#dispatch({ type: 'failed', failureCount, error })\n },\n onPause: () => {\n this.#dispatch({ type: 'pause' })\n },\n onContinue,\n retry: this.options.retry ?? 0,\n retryDelay: this.options.retryDelay,\n networkMode: this.options.networkMode,\n canRun: () => this.#mutationCache.canRun(this),\n })\n\n const restored = this.state.status === 'pending'\n const isPaused = !this.#retryer.canStart()\n\n try {\n if (restored) {\n // Dispatch continue action to unpause restored mutation\n onContinue()\n } else {\n this.#dispatch({ type: 'pending', variables, isPaused })\n // Notify cache callback\n if (this.#mutationCache.config.onMutate) {\n await this.#mutationCache.config.onMutate(\n variables,\n this as Mutation,\n mutationFnContext,\n )\n }\n const context = await this.options.onMutate?.(\n variables,\n mutationFnContext,\n )\n if (context !== this.state.context) {\n this.#dispatch({\n type: 'pending',\n context,\n variables,\n isPaused,\n })\n }\n }\n const data = await this.#retryer.start()\n\n // Notify cache callback\n await this.#mutationCache.config.onSuccess?.(\n data,\n variables,\n this.state.context,\n this as Mutation,\n mutationFnContext,\n )\n\n await this.options.onSuccess?.(\n data,\n variables,\n this.state.context!,\n mutationFnContext,\n )\n\n // Notify cache callback\n await this.#mutationCache.config.onSettled?.(\n data,\n null,\n this.state.variables,\n this.state.context,\n this as Mutation,\n mutationFnContext,\n )\n\n await this.options.onSettled?.(\n data,\n null,\n variables,\n this.state.context,\n mutationFnContext,\n )\n\n this.#dispatch({ type: 'success', data })\n return data\n } catch (error) {\n try {\n // Notify cache callback\n await this.#mutationCache.config.onError?.(\n error as any,\n variables,\n this.state.context,\n this as Mutation,\n mutationFnContext,\n )\n } catch (e) {\n void Promise.reject(e)\n }\n\n try {\n await this.options.onError?.(\n error as TError,\n variables,\n this.state.context,\n mutationFnContext,\n )\n } catch (e) {\n void Promise.reject(e)\n }\n\n try {\n // Notify cache callback\n await this.#mutationCache.config.onSettled?.(\n undefined,\n error as any,\n this.state.variables,\n this.state.context,\n this as Mutation,\n mutationFnContext,\n )\n } catch (e) {\n void Promise.reject(e)\n }\n\n try {\n await this.options.onSettled?.(\n undefined,\n error as TError,\n variables,\n this.state.context,\n mutationFnContext,\n )\n } catch (e) {\n void Promise.reject(e)\n }\n\n this.#dispatch({ type: 'error', error: error as TError })\n throw error\n } finally {\n this.#mutationCache.runNext(this)\n }\n }\n\n #dispatch(action: Action): void {\n const reducer = (\n state: MutationState,\n ): MutationState => {\n switch (action.type) {\n case 'failed':\n return {\n ...state,\n failureCount: action.failureCount,\n failureReason: action.error,\n }\n case 'pause':\n return {\n ...state,\n isPaused: true,\n }\n case 'continue':\n return {\n ...state,\n isPaused: false,\n }\n case 'pending':\n return {\n ...state,\n context: action.context,\n data: undefined,\n failureCount: 0,\n failureReason: null,\n error: null,\n isPaused: action.isPaused,\n status: 'pending',\n variables: action.variables,\n submittedAt: Date.now(),\n }\n case 'success':\n return {\n ...state,\n data: action.data,\n failureCount: 0,\n failureReason: null,\n error: null,\n status: 'success',\n isPaused: false,\n }\n case 'error':\n return {\n ...state,\n data: undefined,\n error: action.error,\n failureCount: state.failureCount + 1,\n failureReason: action.error,\n isPaused: false,\n status: 'error',\n }\n }\n }\n this.state = reducer(this.state)\n\n notifyManager.batch(() => {\n this.#observers.forEach((observer) => {\n observer.onMutationUpdate(action)\n })\n this.#mutationCache.notify({\n mutation: this,\n type: 'updated',\n action,\n })\n })\n }\n}\n\nexport function getDefaultState<\n TData,\n TError,\n TVariables,\n TOnMutateResult,\n>(): MutationState {\n return {\n context: undefined,\n data: undefined,\n error: null,\n failureCount: 0,\n failureReason: null,\n isPaused: false,\n status: 'idle',\n variables: undefined,\n submittedAt: 0,\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,2BAA8B;AAC9B,uBAA0B;AAC1B,qBAA8B;AAF9B;AAmFO,IAAM,WAAN,cAKG,2BAAU;AAAA,EAYlB,YACE,QACA;AACA,UAAM;AApBH;AAUL;AACA;AAGA;AACA;AAOE,uBAAK,SAAU,OAAO;AACtB,SAAK,aAAa,OAAO;AACzB,uBAAK,gBAAiB,OAAO;AAC7B,uBAAK,YAAa,CAAC;AACnB,SAAK,QAAQ,OAAO,SAAS,gBAAgB;AAE7C,SAAK,WAAW,OAAO,OAAO;AAC9B,SAAK,WAAW;AAAA,EAClB;AAAA,EAEA,WACE,SACM;AACN,SAAK,UAAU;AAEf,SAAK,aAAa,KAAK,QAAQ,MAAM;AAAA,EACvC;AAAA,EAEA,IAAI,OAAiC;AACnC,WAAO,KAAK,QAAQ;AAAA,EACtB;AAAA,EAEA,YAAY,UAAsD;AAChE,QAAI,CAAC,mBAAK,YAAW,SAAS,QAAQ,GAAG;AACvC,yBAAK,YAAW,KAAK,QAAQ;AAG7B,WAAK,eAAe;AAEpB,yBAAK,gBAAe,OAAO;AAAA,QACzB,MAAM;AAAA,QACN,UAAU;AAAA,QACV;AAAA,MACF,CAAC;AAAA,IACH;AAAA,EACF;AAAA,EAEA,eAAe,UAAsD;AACnE,uBAAK,YAAa,mBAAK,YAAW,OAAO,CAAC,MAAM,MAAM,QAAQ;AAE9D,SAAK,WAAW;AAEhB,uBAAK,gBAAe,OAAO;AAAA,MACzB,MAAM;AAAA,MACN,UAAU;AAAA,MACV;AAAA,IACF,CAAC;AAAA,EACH;AAAA,EAEU,iBAAiB;AACzB,QAAI,CAAC,mBAAK,YAAW,QAAQ;AAC3B,UAAI,KAAK,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ACR,WAAW,OAAO;AAAA,UAClB,aAAa,KAAK,IAAI;AAAA,QACxB;AAAA,MACF,KAAK;AACH,eAAO;AAAA,UACL,GAAG;AAAA,UACH,MAAM,OAAO;AAAA,UACb,cAAc;AAAA,UACd,eAAe;AAAA,UACf,OAAO;AAAA,UACP,QAAQ;AAAA,UACR,UAAU;AAAA,QACZ;AAAA,MACF,KAAK;AACH,eAAO;AAAA,UACL,GAAG;AAAA,UACH,MAAM;AAAA,UACN,OAAO,OAAO;AAAA,UACd,cAAc,MAAM,eAAe;AAAA,UACnC,eAAe,OAAO;AAAA,UACtB,UAAU;AAAA,UACV,QAAQ;AAAA,QACV;AAAA,IACJ;AAAA,EACF;AACA,OAAK,QAAQ,QAAQ,KAAK,KAAK;AAE/B,qCAAc,MAAM,MAAM;AACxB,uBAAK,YAAW,QAAQ,CAAC,aAAa;AACpC,eAAS,iBAAiB,MAAM;AAAA,IAClC,CAAC;AACD,uBAAK,gBAAe,OAAO;AAAA,MACzB,UAAU;AAAA,MACV,MAAM;AAAA,MACN;AAAA,IACF,CAAC;AAAA,EACH,CAAC;AACH;AAGK,SAAS,kBAK+C;AAC7D,SAAO;AAAA,IACL,SAAS;AAAA,IACT,MAAM;AAAA,IACN,OAAO;AAAA,IACP,cAAc;AAAA,IACd,eAAe;AAAA,IACf,UAAU;AAAA,IACV,QAAQ;AAAA,IACR,WAAW;AAAA,IACX,aAAa;AAAA,EACf;AACF;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/mutation.d.cts b/node_modules/@tanstack/query-core/build/legacy/mutation.d.cts new file mode 100644 index 0000000..6d5c5fa --- /dev/null +++ b/node_modules/@tanstack/query-core/build/legacy/mutation.d.cts @@ -0,0 +1,3 @@ +import './removable.cjs'; +export { bj as Action, x as Mutation, y as MutationState, bk as getDefaultState } from './hydration-uphG6M-i.cjs'; +import './subscribable.cjs'; diff --git a/node_modules/@tanstack/query-core/build/legacy/mutation.d.ts b/node_modules/@tanstack/query-core/build/legacy/mutation.d.ts new file mode 100644 index 0000000..61bcecc --- /dev/null +++ b/node_modules/@tanstack/query-core/build/legacy/mutation.d.ts @@ -0,0 +1,3 @@ +import './removable.js'; +export { bj as Action, x as Mutation, y as MutationState, bk as getDefaultState } from './hydration-BlEVG2Lp.js'; +import './subscribable.js'; diff --git a/node_modules/@tanstack/query-core/build/legacy/mutation.js b/node_modules/@tanstack/query-core/build/legacy/mutation.js new file mode 100644 index 0000000..c686ebd --- /dev/null +++ b/node_modules/@tanstack/query-core/build/legacy/mutation.js @@ -0,0 +1,306 @@ +import { + __privateAdd, + __privateGet, + __privateMethod, + __privateSet +} from "./chunk-PXG64RU4.js"; + +// src/mutation.ts +import { notifyManager } from "./notifyManager.js"; +import { Removable } from "./removable.js"; +import { createRetryer } from "./retryer.js"; +var _client, _observers, _mutationCache, _retryer, _Mutation_instances, dispatch_fn; +var Mutation = class extends Removable { + constructor(config) { + super(); + __privateAdd(this, _Mutation_instances); + __privateAdd(this, _client); + __privateAdd(this, _observers); + __privateAdd(this, _mutationCache); + __privateAdd(this, _retryer); + __privateSet(this, _client, config.client); + this.mutationId = config.mutationId; + __privateSet(this, _mutationCache, config.mutationCache); + __privateSet(this, _observers, []); + this.state = config.state || getDefaultState(); + this.setOptions(config.options); + this.scheduleGc(); + } + setOptions(options) { + this.options = options; + this.updateGcTime(this.options.gcTime); + } + get meta() { + return this.options.meta; + } + addObserver(observer) { + if (!__privateGet(this, _observers).includes(observer)) { + __privateGet(this, _observers).push(observer); + this.clearGcTimeout(); + __privateGet(this, _mutationCache).notify({ + type: "observerAdded", + mutation: this, + observer + }); + } + } + removeObserver(observer) { + __privateSet(this, _observers, __privateGet(this, _observers).filter((x) => x !== observer)); + this.scheduleGc(); + __privateGet(this, _mutationCache).notify({ + type: "observerRemoved", + mutation: this, + observer + }); + } + optionalRemove() { + if (!__privateGet(this, _observers).length) { + if (this.state.status === "pending") { + this.scheduleGc(); + } else { + __privateGet(this, _mutationCache).remove(this); + } + } + } + continue() { + var _a; + return ((_a = __privateGet(this, _retryer)) == null ? void 0 : _a.continue()) ?? // continuing a mutation assumes that variables are set, mutation must have been dehydrated before + this.execute(this.state.variables); + } + async execute(variables) { + var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r; + const onContinue = () => { + __privateMethod(this, _Mutation_instances, dispatch_fn).call(this, { type: "continue" }); + }; + const mutationFnContext = { + client: __privateGet(this, _client), + meta: this.options.meta, + mutationKey: this.options.mutationKey + }; + __privateSet(this, _retryer, createRetryer({ + fn: () => { + if (!this.options.mutationFn) { + return Promise.reject(new Error("No mutationFn found")); + } + return this.options.mutationFn(variables, mutationFnContext); + }, + onFail: (failureCount, error) => { + __privateMethod(this, _Mutation_instances, dispatch_fn).call(this, { type: "failed", failureCount, error }); + }, + onPause: () => { + __privateMethod(this, _Mutation_instances, dispatch_fn).call(this, { type: "pause" }); + }, + onContinue, + retry: this.options.retry ?? 0, + retryDelay: this.options.retryDelay, + networkMode: this.options.networkMode, + canRun: () => __privateGet(this, _mutationCache).canRun(this) + })); + const restored = this.state.status === "pending"; + const isPaused = !__privateGet(this, _retryer).canStart(); + try { + if (restored) { + onContinue(); + } else { + __privateMethod(this, _Mutation_instances, dispatch_fn).call(this, { type: "pending", variables, isPaused }); + if (__privateGet(this, _mutationCache).config.onMutate) { + await __privateGet(this, _mutationCache).config.onMutate( + variables, + this, + mutationFnContext + ); + } + const context = await ((_b = (_a = this.options).onMutate) == null ? void 0 : _b.call( + _a, + variables, + mutationFnContext + )); + if (context !== this.state.context) { + __privateMethod(this, _Mutation_instances, dispatch_fn).call(this, { + type: "pending", + context, + variables, + isPaused + }); + } + } + const data = await __privateGet(this, _retryer).start(); + await ((_d = (_c = __privateGet(this, _mutationCache).config).onSuccess) == null ? void 0 : _d.call( + _c, + data, + variables, + this.state.context, + this, + mutationFnContext + )); + await ((_f = (_e = this.options).onSuccess) == null ? void 0 : _f.call( + _e, + data, + variables, + this.state.context, + mutationFnContext + )); + await ((_h = (_g = __privateGet(this, _mutationCache).config).onSettled) == null ? void 0 : _h.call( + _g, + data, + null, + this.state.variables, + this.state.context, + this, + mutationFnContext + )); + await ((_j = (_i = this.options).onSettled) == null ? void 0 : _j.call( + _i, + data, + null, + variables, + this.state.context, + mutationFnContext + )); + __privateMethod(this, _Mutation_instances, dispatch_fn).call(this, { type: "success", data }); + return data; + } catch (error) { + try { + await ((_l = (_k = __privateGet(this, _mutationCache).config).onError) == null ? void 0 : _l.call( + _k, + error, + variables, + this.state.context, + this, + mutationFnContext + )); + } catch (e) { + void Promise.reject(e); + } + try { + await ((_n = (_m = this.options).onError) == null ? void 0 : _n.call( + _m, + error, + variables, + this.state.context, + mutationFnContext + )); + } catch (e) { + void Promise.reject(e); + } + try { + await ((_p = (_o = __privateGet(this, _mutationCache).config).onSettled) == null ? void 0 : _p.call( + _o, + void 0, + error, + this.state.variables, + this.state.context, + this, + mutationFnContext + )); + } catch (e) { + void Promise.reject(e); + } + try { + await ((_r = (_q = this.options).onSettled) == null ? void 0 : _r.call( + _q, + void 0, + error, + variables, + this.state.context, + mutationFnContext + )); + } catch (e) { + void Promise.reject(e); + } + __privateMethod(this, _Mutation_instances, dispatch_fn).call(this, { type: "error", error }); + throw error; + } finally { + __privateGet(this, _mutationCache).runNext(this); + } + } +}; +_client = new WeakMap(); +_observers = new WeakMap(); +_mutationCache = new WeakMap(); +_retryer = new WeakMap(); +_Mutation_instances = new WeakSet(); +dispatch_fn = function(action) { + const reducer = (state) => { + switch (action.type) { + case "failed": + return { + ...state, + failureCount: action.failureCount, + failureReason: action.error + }; + case "pause": + return { + ...state, + isPaused: true + }; + case "continue": + return { + ...state, + isPaused: false + }; + case "pending": + return { + ...state, + context: action.context, + data: void 0, + failureCount: 0, + failureReason: null, + error: null, + isPaused: action.isPaused, + status: "pending", + variables: action.variables, + submittedAt: Date.now() + }; + case "success": + return { + ...state, + data: action.data, + failureCount: 0, + failureReason: null, + error: null, + status: "success", + isPaused: false + }; + case "error": + return { + ...state, + data: void 0, + error: action.error, + failureCount: state.failureCount + 1, + failureReason: action.error, + isPaused: false, + status: "error" + }; + } + }; + this.state = reducer(this.state); + notifyManager.batch(() => { + __privateGet(this, _observers).forEach((observer) => { + observer.onMutationUpdate(action); + }); + __privateGet(this, _mutationCache).notify({ + mutation: this, + type: "updated", + action + }); + }); +}; +function getDefaultState() { + return { + context: void 0, + data: void 0, + error: null, + failureCount: 0, + failureReason: null, + isPaused: false, + status: "idle", + variables: void 0, + submittedAt: 0 + }; +} +export { + Mutation, + getDefaultState +}; +//# sourceMappingURL=mutation.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/mutation.js.map b/node_modules/@tanstack/query-core/build/legacy/mutation.js.map new file mode 100644 index 0000000..0748406 --- /dev/null +++ b/node_modules/@tanstack/query-core/build/legacy/mutation.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/mutation.ts"],"sourcesContent":["import { notifyManager } from './notifyManager'\nimport { Removable } from './removable'\nimport { createRetryer } from './retryer'\nimport type {\n DefaultError,\n MutationFunctionContext,\n MutationMeta,\n MutationOptions,\n MutationStatus,\n} from './types'\nimport type { MutationCache } from './mutationCache'\nimport type { MutationObserver } from './mutationObserver'\nimport type { Retryer } from './retryer'\nimport type { QueryClient } from './queryClient'\n\n// TYPES\n\ninterface MutationConfig {\n client: QueryClient\n mutationId: number\n mutationCache: MutationCache\n options: MutationOptions\n state?: MutationState\n}\n\nexport interface MutationState<\n TData = unknown,\n TError = DefaultError,\n TVariables = unknown,\n TOnMutateResult = unknown,\n> {\n context: TOnMutateResult | undefined\n data: TData | undefined\n error: TError | null\n failureCount: number\n failureReason: TError | null\n isPaused: boolean\n status: MutationStatus\n variables: TVariables | undefined\n submittedAt: number\n}\n\ninterface FailedAction {\n type: 'failed'\n failureCount: number\n error: TError | null\n}\n\ninterface PendingAction {\n type: 'pending'\n isPaused: boolean\n variables?: TVariables\n context?: TOnMutateResult\n}\n\ninterface SuccessAction {\n type: 'success'\n data: TData\n}\n\ninterface ErrorAction {\n type: 'error'\n error: TError\n}\n\ninterface PauseAction {\n type: 'pause'\n}\n\ninterface ContinueAction {\n type: 'continue'\n}\n\nexport type Action =\n | ContinueAction\n | ErrorAction\n | FailedAction\n | PendingAction\n | PauseAction\n | SuccessAction\n\n// CLASS\n\nexport class Mutation<\n TData = unknown,\n TError = DefaultError,\n TVariables = unknown,\n TOnMutateResult = unknown,\n> extends Removable {\n state: MutationState\n options!: MutationOptions\n readonly mutationId: number\n\n #client: QueryClient\n #observers: Array<\n MutationObserver\n >\n #mutationCache: MutationCache\n #retryer?: Retryer\n\n constructor(\n config: MutationConfig,\n ) {\n super()\n\n this.#client = config.client\n this.mutationId = config.mutationId\n this.#mutationCache = config.mutationCache\n this.#observers = []\n this.state = config.state || getDefaultState()\n\n this.setOptions(config.options)\n this.scheduleGc()\n }\n\n setOptions(\n options: MutationOptions,\n ): void {\n this.options = options\n\n this.updateGcTime(this.options.gcTime)\n }\n\n get meta(): MutationMeta | undefined {\n return this.options.meta\n }\n\n addObserver(observer: MutationObserver): void {\n if (!this.#observers.includes(observer)) {\n this.#observers.push(observer)\n\n // Stop the mutation from being garbage collected\n this.clearGcTimeout()\n\n this.#mutationCache.notify({\n type: 'observerAdded',\n mutation: this,\n observer,\n })\n }\n }\n\n removeObserver(observer: MutationObserver): void {\n this.#observers = this.#observers.filter((x) => x !== observer)\n\n this.scheduleGc()\n\n this.#mutationCache.notify({\n type: 'observerRemoved',\n mutation: this,\n observer,\n })\n }\n\n protected optionalRemove() {\n if (!this.#observers.length) {\n if (this.state.status === 'pending') {\n this.scheduleGc()\n } else {\n this.#mutationCache.remove(this)\n }\n }\n }\n\n continue(): Promise {\n return (\n this.#retryer?.continue() ??\n // continuing a mutation assumes that variables are set, mutation must have been dehydrated before\n this.execute(this.state.variables!)\n )\n }\n\n async execute(variables: TVariables): Promise {\n const onContinue = () => {\n this.#dispatch({ type: 'continue' })\n }\n\n const mutationFnContext = {\n client: this.#client,\n meta: this.options.meta,\n mutationKey: this.options.mutationKey,\n } satisfies MutationFunctionContext\n\n this.#retryer = createRetryer({\n fn: () => {\n if (!this.options.mutationFn) {\n return Promise.reject(new Error('No mutationFn found'))\n }\n\n return this.options.mutationFn(variables, mutationFnContext)\n },\n onFail: (failureCount, error) => {\n this.#dispatch({ type: 'failed', failureCount, error })\n },\n onPause: () => {\n this.#dispatch({ type: 'pause' })\n },\n onContinue,\n retry: this.options.retry ?? 0,\n retryDelay: this.options.retryDelay,\n networkMode: this.options.networkMode,\n canRun: () => this.#mutationCache.canRun(this),\n })\n\n const restored = this.state.status === 'pending'\n const isPaused = !this.#retryer.canStart()\n\n try {\n if (restored) {\n // Dispatch continue action to unpause restored mutation\n onContinue()\n } else {\n this.#dispatch({ type: 'pending', variables, isPaused })\n // Notify cache callback\n if (this.#mutationCache.config.onMutate) {\n await this.#mutationCache.config.onMutate(\n variables,\n this as Mutation,\n mutationFnContext,\n )\n }\n const context = await this.options.onMutate?.(\n variables,\n mutationFnContext,\n )\n if (context !== this.state.context) {\n this.#dispatch({\n type: 'pending',\n context,\n variables,\n isPaused,\n })\n }\n }\n const data = await this.#retryer.start()\n\n // Notify cache callback\n await this.#mutationCache.config.onSuccess?.(\n data,\n variables,\n this.state.context,\n this as Mutation,\n mutationFnContext,\n )\n\n await this.options.onSuccess?.(\n data,\n variables,\n this.state.context!,\n mutationFnContext,\n )\n\n // Notify cache callback\n await this.#mutationCache.config.onSettled?.(\n data,\n null,\n this.state.variables,\n this.state.context,\n this as Mutation,\n mutationFnContext,\n )\n\n await this.options.onSettled?.(\n data,\n null,\n variables,\n this.state.context,\n mutationFnContext,\n )\n\n this.#dispatch({ type: 'success', data })\n return data\n } catch (error) {\n try {\n // Notify cache callback\n await this.#mutationCache.config.onError?.(\n error as any,\n variables,\n this.state.context,\n this as Mutation,\n mutationFnContext,\n )\n } catch (e) {\n void Promise.reject(e)\n }\n\n try {\n await this.options.onError?.(\n error as TError,\n variables,\n this.state.context,\n mutationFnContext,\n )\n } catch (e) {\n void Promise.reject(e)\n }\n\n try {\n // Notify cache callback\n await this.#mutationCache.config.onSettled?.(\n undefined,\n error as any,\n this.state.variables,\n this.state.context,\n this as Mutation,\n mutationFnContext,\n )\n } catch (e) {\n void Promise.reject(e)\n }\n\n try {\n await this.options.onSettled?.(\n undefined,\n error as TError,\n variables,\n this.state.context,\n mutationFnContext,\n )\n } catch (e) {\n void Promise.reject(e)\n }\n\n this.#dispatch({ type: 'error', error: error as TError })\n throw error\n } finally {\n this.#mutationCache.runNext(this)\n }\n }\n\n #dispatch(action: Action): void {\n const reducer = (\n state: MutationState,\n ): MutationState => {\n switch (action.type) {\n case 'failed':\n return {\n ...state,\n failureCount: action.failureCount,\n failureReason: action.error,\n }\n case 'pause':\n return {\n ...state,\n isPaused: true,\n }\n case 'continue':\n return {\n ...state,\n isPaused: false,\n }\n case 'pending':\n return {\n ...state,\n context: action.context,\n data: undefined,\n failureCount: 0,\n failureReason: null,\n error: null,\n isPaused: action.isPaused,\n status: 'pending',\n variables: action.variables,\n submittedAt: Date.now(),\n }\n case 'success':\n return {\n ...state,\n data: action.data,\n failureCount: 0,\n failureReason: null,\n error: null,\n status: 'success',\n isPaused: false,\n }\n case 'error':\n return {\n ...state,\n data: undefined,\n error: action.error,\n failureCount: state.failureCount + 1,\n failureReason: action.error,\n isPaused: false,\n status: 'error',\n }\n }\n }\n this.state = reducer(this.state)\n\n notifyManager.batch(() => {\n this.#observers.forEach((observer) => {\n observer.onMutationUpdate(action)\n })\n this.#mutationCache.notify({\n mutation: this,\n type: 'updated',\n action,\n })\n })\n }\n}\n\nexport function getDefaultState<\n TData,\n TError,\n TVariables,\n TOnMutateResult,\n>(): MutationState {\n return {\n context: undefined,\n data: undefined,\n error: null,\n failureCount: 0,\n failureReason: null,\n isPaused: false,\n status: 'idle',\n variables: undefined,\n submittedAt: 0,\n }\n}\n"],"mappings":";;;;;;;;AAAA,SAAS,qBAAqB;AAC9B,SAAS,i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;AAAA,MACF,KAAK;AACH,eAAO;AAAA,UACL,GAAG;AAAA,UACH,MAAM;AAAA,UACN,OAAO,OAAO;AAAA,UACd,cAAc,MAAM,eAAe;AAAA,UACnC,eAAe,OAAO;AAAA,UACtB,UAAU;AAAA,UACV,QAAQ;AAAA,QACV;AAAA,IACJ;AAAA,EACF;AACA,OAAK,QAAQ,QAAQ,KAAK,KAAK;AAE/B,gBAAc,MAAM,MAAM;AACxB,uBAAK,YAAW,QAAQ,CAAC,aAAa;AACpC,eAAS,iBAAiB,MAAM;AAAA,IAClC,CAAC;AACD,uBAAK,gBAAe,OAAO;AAAA,MACzB,UAAU;AAAA,MACV,MAAM;AAAA,MACN;AAAA,IACF,CAAC;AAAA,EACH,CAAC;AACH;AAGK,SAAS,kBAK+C;AAC7D,SAAO;AAAA,IACL,SAAS;AAAA,IACT,MAAM;AAAA,IACN,OAAO;AAAA,IACP,cAAc;AAAA,IACd,eAAe;AAAA,IACf,UAAU;AAAA,IACV,QAAQ;AAAA,IACR,WAAW;AAAA,IACX,aAAa;AAAA,EACf;AACF;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/mutationCache.cjs b/node_modules/@tanstack/query-core/build/legacy/mutationCache.cjs new file mode 100644 index 0000000..1c62401 --- /dev/null +++ b/node_modules/@tanstack/query-core/build/legacy/mutationCache.cjs @@ -0,0 +1,170 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __typeError = (msg) => { + throw TypeError(msg); +}; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg); +var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj)); +var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value); +var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value); +var __privateWrapper = (obj, member, setter, getter) => ({ + set _(value) { + __privateSet(obj, member, value, setter); + }, + get _() { + return __privateGet(obj, member, getter); + } +}); + +// src/mutationCache.ts +var mutationCache_exports = {}; +__export(mutationCache_exports, { + MutationCache: () => MutationCache +}); +module.exports = __toCommonJS(mutationCache_exports); +var import_notifyManager = require("./notifyManager.cjs"); +var import_mutation = require("./mutation.cjs"); +var import_utils = require("./utils.cjs"); +var import_subscribable = require("./subscribable.cjs"); +var _mutations, _scopes, _mutationId; +var MutationCache = class extends import_subscribable.Subscribable { + constructor(config = {}) { + super(); + this.config = config; + __privateAdd(this, _mutations); + __privateAdd(this, _scopes); + __privateAdd(this, _mutationId); + __privateSet(this, _mutations, /* @__PURE__ */ new Set()); + __privateSet(this, _scopes, /* @__PURE__ */ new Map()); + __privateSet(this, _mutationId, 0); + } + build(client, options, state) { + const mutation = new import_mutation.Mutation({ + client, + mutationCache: this, + mutationId: ++__privateWrapper(this, _mutationId)._, + options: client.defaultMutationOptions(options), + state + }); + this.add(mutation); + return mutation; + } + add(mutation) { + __privateGet(this, _mutations).add(mutation); + const scope = scopeFor(mutation); + if (typeof scope === "string") { + const scopedMutations = __privateGet(this, _scopes).get(scope); + if (scopedMutations) { + scopedMutations.push(mutation); + } else { + __privateGet(this, _scopes).set(scope, [mutation]); + } + } + this.notify({ type: "added", mutation }); + } + remove(mutation) { + if (__privateGet(this, _mutations).delete(mutation)) { + const scope = scopeFor(mutation); + if (typeof scope === "string") { + const scopedMutations = __privateGet(this, _scopes).get(scope); + if (scopedMutations) { + if (scopedMutations.length > 1) { + const index = scopedMutations.indexOf(mutation); + if (index !== -1) { + scopedMutations.splice(index, 1); + } + } else if (scopedMutations[0] === mutation) { + __privateGet(this, _scopes).delete(scope); + } + } + } + } + this.notify({ type: "removed", mutation }); + } + canRun(mutation) { + const scope = scopeFor(mutation); + if (typeof scope === "string") { + const mutationsWithSameScope = __privateGet(this, _scopes).get(scope); + const firstPendingMutation = mutationsWithSameScope == null ? void 0 : mutationsWithSameScope.find( + (m) => m.state.status === "pending" + ); + return !firstPendingMutation || firstPendingMutation === mutation; + } else { + return true; + } + } + runNext(mutation) { + var _a; + const scope = scopeFor(mutation); + if (typeof scope === "string") { + const foundMutation = (_a = __privateGet(this, _scopes).get(scope)) == null ? void 0 : _a.find((m) => m !== mutation && m.state.isPaused); + return (foundMutation == null ? void 0 : foundMutation.continue()) ?? Promise.resolve(); + } else { + return Promise.resolve(); + } + } + clear() { + import_notifyManager.notifyManager.batch(() => { + __privateGet(this, _mutations).forEach((mutation) => { + this.notify({ type: "removed", mutation }); + }); + __privateGet(this, _mutations).clear(); + __privateGet(this, _scopes).clear(); + }); + } + getAll() { + return Array.from(__privateGet(this, _mutations)); + } + find(filters) { + const defaultedFilters = { exact: true, ...filters }; + return this.getAll().find( + (mutation) => (0, import_utils.matchMutation)(defaultedFilters, mutation) + ); + } + findAll(filters = {}) { + return this.getAll().filter((mutation) => (0, import_utils.matchMutation)(filters, mutation)); + } + notify(event) { + import_notifyManager.notifyManager.batch(() => { + this.listeners.forEach((listener) => { + listener(event); + }); + }); + } + resumePausedMutations() { + const pausedMutations = this.getAll().filter((x) => x.state.isPaused); + return import_notifyManager.notifyManager.batch( + () => Promise.all( + pausedMutations.map((mutation) => mutation.continue().catch(import_utils.noop)) + ) + ); + } +}; +_mutations = new WeakMap(); +_scopes = new WeakMap(); +_mutationId = new WeakMap(); +function scopeFor(mutation) { + var _a; + return (_a = mutation.options.scope) == null ? void 0 : _a.id; +} +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + MutationCache +}); +//# sourceMappingURL=mutationCache.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/mutationCache.cjs.map b/node_modules/@tanstack/query-core/build/legacy/mutationCache.cjs.map new file mode 100644 index 0000000..7451f5f --- /dev/null +++ b/node_modules/@tanstack/query-core/build/legacy/mutationCache.cjs.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/mutationCache.ts"],"sourcesContent":["import { notifyManager } from './notifyManager'\nimport { Mutation } from './mutation'\nimport { matchMutation, noop } from './utils'\nimport { Subscribable } from './subscribable'\nimport type { MutationObserver } from './mutationObserver'\nimport type {\n DefaultError,\n MutationFunctionContext,\n MutationOptions,\n NotifyEvent,\n} from './types'\nimport type { QueryClient } from './queryClient'\nimport type { Action, MutationState } from './mutation'\nimport type { MutationFilters } from './utils'\n\n// TYPES\n\ninterface MutationCacheConfig {\n onError?: (\n error: DefaultError,\n variables: unknown,\n onMutateResult: unknown,\n mutation: Mutation,\n context: MutationFunctionContext,\n ) => Promise | unknown\n onSuccess?: (\n data: unknown,\n variables: unknown,\n onMutateResult: unknown,\n mutation: Mutation,\n context: MutationFunctionContext,\n ) => Promise | unknown\n onMutate?: (\n variables: unknown,\n mutation: Mutation,\n context: MutationFunctionContext,\n ) => Promise | unknown\n onSettled?: (\n data: unknown | undefined,\n error: DefaultError | null,\n variables: unknown,\n onMutateResult: unknown,\n mutation: Mutation,\n context: MutationFunctionContext,\n ) => Promise | unknown\n}\n\ninterface NotifyEventMutationAdded extends NotifyEvent {\n type: 'added'\n mutation: Mutation\n}\ninterface NotifyEventMutationRemoved extends NotifyEvent {\n type: 'removed'\n mutation: Mutation\n}\n\ninterface NotifyEventMutationObserverAdded extends NotifyEvent {\n type: 'observerAdded'\n mutation: Mutation\n observer: MutationObserver\n}\n\ninterface NotifyEventMutationObserverRemoved extends NotifyEvent {\n type: 'observerRemoved'\n mutation: Mutation\n observer: MutationObserver\n}\n\ninterface NotifyEventMutationObserverOptionsUpdated extends NotifyEvent {\n type: 'observerOptionsUpdated'\n mutation?: Mutation\n observer: MutationObserver\n}\n\ninterface NotifyEventMutationUpdated extends NotifyEvent {\n type: 'updated'\n mutation: Mutation\n action: Action\n}\n\nexport type MutationCacheNotifyEvent =\n | NotifyEventMutationAdded\n | NotifyEventMutationRemoved\n | NotifyEventMutationObserverAdded\n | NotifyEventMutationObserverRemoved\n | NotifyEventMutationObserverOptionsUpdated\n | NotifyEventMutationUpdated\n\ntype MutationCacheListener = (event: MutationCacheNotifyEvent) => void\n\n// CLASS\n\nexport class MutationCache extends Subscribable {\n #mutations: Set>\n #scopes: Map>>\n #mutationId: number\n\n constructor(public config: MutationCacheConfig = {}) {\n super()\n this.#mutations = new Set()\n this.#scopes = new Map()\n this.#mutationId = 0\n }\n\n build(\n client: QueryClient,\n options: MutationOptions,\n state?: MutationState,\n ): Mutation {\n const mutation = new Mutation({\n client,\n mutationCache: this,\n mutationId: ++this.#mutationId,\n options: client.defaultMutationOptions(options),\n state,\n })\n\n this.add(mutation)\n\n return mutation\n }\n\n add(mutation: Mutation): void {\n this.#mutations.add(mutation)\n const scope = scopeFor(mutation)\n if (typeof scope === 'string') {\n const scopedMutations = this.#scopes.get(scope)\n if (scopedMutations) {\n scopedMutations.push(mutation)\n } else {\n this.#scopes.set(scope, [mutation])\n }\n }\n this.notify({ type: 'added', mutation })\n }\n\n remove(mutation: Mutation): void {\n if (this.#mutations.delete(mutation)) {\n const scope = scopeFor(mutation)\n if (typeof scope === 'string') {\n const scopedMutations = this.#scopes.get(scope)\n if (scopedMutations) {\n if (scopedMutations.length > 1) {\n const index = scopedMutations.indexOf(mutation)\n if (index !== -1) {\n scopedMutations.splice(index, 1)\n }\n } else if (scopedMutations[0] === mutation) {\n this.#scopes.delete(scope)\n }\n }\n }\n }\n\n // Currently we notify the removal even if the mutation was already removed.\n // Consider making this an error or not notifying of the removal depending on the desired semantics.\n this.notify({ type: 'removed', mutation })\n }\n\n canRun(mutation: Mutation): boolean {\n const scope = scopeFor(mutation)\n if (typeof scope === 'string') {\n const mutationsWithSameScope = this.#scopes.get(scope)\n const firstPendingMutation = mutationsWithSameScope?.find(\n (m) => m.state.status === 'pending',\n )\n // we can run if there is no current pending mutation (start use-case)\n // or if WE are the first pending mutation (continue use-case)\n return !firstPendingMutation || firstPendingMutation === mutation\n } else {\n // For unscoped mutations there are never any pending mutations in front of the\n // current mutation\n return true\n }\n }\n\n runNext(mutation: Mutation): Promise {\n const scope = scopeFor(mutation)\n if (typeof scope === 'string') {\n const foundMutation = this.#scopes\n .get(scope)\n ?.find((m) => m !== mutation && m.state.isPaused)\n\n return foundMutation?.continue() ?? Promise.resolve()\n } else {\n return Promise.resolve()\n }\n }\n\n clear(): void {\n notifyManager.batch(() => {\n this.#mutations.forEach((mutation) => {\n this.notify({ type: 'removed', mutation })\n })\n this.#mutations.clear()\n this.#scopes.clear()\n })\n }\n\n getAll(): Array {\n return Array.from(this.#mutations)\n }\n\n find<\n TData = unknown,\n TError = DefaultError,\n TVariables = any,\n TOnMutateResult = unknown,\n >(\n filters: MutationFilters,\n ): Mutation | undefined {\n const defaultedFilters = { exact: true, ...filters }\n\n return this.getAll().find((mutation) =>\n matchMutation(defaultedFilters, mutation),\n ) as Mutation | undefined\n }\n\n findAll(filters: MutationFilters = {}): Array {\n return this.getAll().filter((mutation) => matchMutation(filters, mutation))\n }\n\n notify(event: MutationCacheNotifyEvent) {\n notifyManager.batch(() => {\n this.listeners.forEach((listener) => {\n listener(event)\n })\n })\n }\n\n resumePausedMutations(): Promise {\n const pausedMutations = this.getAll().filter((x) => x.state.isPaused)\n\n return notifyManager.batch(() =>\n Promise.all(\n pausedMutations.map((mutation) => mutation.continue().catch(noop)),\n ),\n )\n }\n}\n\nfunction scopeFor(mutation: Mutation) {\n return mutation.options.scope?.id\n}\n"],"mappings":";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AM,GAAG,QAAQ;AAEnD,WAAO,KAAK,OAAO,EAAE;AAAA,MAAK,CAAC,iBACzB,4BAAc,kBAAkB,QAAQ;AAAA,IAC1C;AAAA,EACF;AAAA,EAEA,QAAQ,UAA2B,CAAC,GAAoB;AACtD,WAAO,KAAK,OAAO,EAAE,OAAO,CAAC,iBAAa,4BAAc,SAAS,QAAQ,CAAC;AAAA,EAC5E;AAAA,EAEA,OAAO,OAAiC;AACtC,uCAAc,MAAM,MAAM;AACxB,WAAK,UAAU,QAAQ,CAAC,aAAa;AACnC,iBAAS,KAAK;AAAA,MAChB,CAAC;AAAA,IACH,CAAC;AAAA,EACH;AAAA,EAEA,wBAA0C;AACxC,UAAM,kBAAkB,KAAK,OAAO,EAAE,OAAO,CAAC,MAAM,EAAE,MAAM,QAAQ;AAEpE,WAAO,mCAAc;AAAA,MAAM,MACzB,QAAQ;AAAA,QACN,gBAAgB,IAAI,CAAC,aAAa,SAAS,SAAS,EAAE,MAAM,iBAAI,CAAC;AAAA,MACnE;AAAA,IACF;AAAA,EACF;AACF;AAlJE;AACA;AACA;AAkJF,SAAS,SAAS,UAAwC;AAjP1D;AAkPE,UAAO,cAAS,QAAQ,UAAjB,mBAAwB;AACjC;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/mutationCache.d.cts b/node_modules/@tanstack/query-core/build/legacy/mutationCache.d.cts new file mode 100644 index 0000000..ce18321 --- /dev/null +++ b/node_modules/@tanstack/query-core/build/legacy/mutationCache.d.cts @@ -0,0 +1,3 @@ +export { M as MutationCache, c as MutationCacheNotifyEvent } from './hydration-uphG6M-i.cjs'; +import './subscribable.cjs'; +import './removable.cjs'; diff --git a/node_modules/@tanstack/query-core/build/legacy/mutationCache.d.ts b/node_modules/@tanstack/query-core/build/legacy/mutationCache.d.ts new file mode 100644 index 0000000..67f1bfe --- /dev/null +++ b/node_modules/@tanstack/query-core/build/legacy/mutationCache.d.ts @@ -0,0 +1,3 @@ +export { M as MutationCache, c as MutationCacheNotifyEvent } from './hydration-BlEVG2Lp.js'; +import './subscribable.js'; +import './removable.js'; diff --git a/node_modules/@tanstack/query-core/build/legacy/mutationCache.js b/node_modules/@tanstack/query-core/build/legacy/mutationCache.js new file mode 100644 index 0000000..1ec509b --- /dev/null +++ b/node_modules/@tanstack/query-core/build/legacy/mutationCache.js @@ -0,0 +1,137 @@ +import { + __privateAdd, + __privateGet, + __privateSet, + __privateWrapper +} from "./chunk-PXG64RU4.js"; + +// src/mutationCache.ts +import { notifyManager } from "./notifyManager.js"; +import { Mutation } from "./mutation.js"; +import { matchMutation, noop } from "./utils.js"; +import { Subscribable } from "./subscribable.js"; +var _mutations, _scopes, _mutationId; +var MutationCache = class extends Subscribable { + constructor(config = {}) { + super(); + this.config = config; + __privateAdd(this, _mutations); + __privateAdd(this, _scopes); + __privateAdd(this, _mutationId); + __privateSet(this, _mutations, /* @__PURE__ */ new Set()); + __privateSet(this, _scopes, /* @__PURE__ */ new Map()); + __privateSet(this, _mutationId, 0); + } + build(client, options, state) { + const mutation = new Mutation({ + client, + mutationCache: this, + mutationId: ++__privateWrapper(this, _mutationId)._, + options: client.defaultMutationOptions(options), + state + }); + this.add(mutation); + return mutation; + } + add(mutation) { + __privateGet(this, _mutations).add(mutation); + const scope = scopeFor(mutation); + if (typeof scope === "string") { + const scopedMutations = __privateGet(this, _scopes).get(scope); + if (scopedMutations) { + scopedMutations.push(mutation); + } else { + __privateGet(this, _scopes).set(scope, [mutation]); + } + } + this.notify({ type: "added", mutation }); + } + remove(mutation) { + if (__privateGet(this, _mutations).delete(mutation)) { + const scope = scopeFor(mutation); + if (typeof scope === "string") { + const scopedMutations = __privateGet(this, _scopes).get(scope); + if (scopedMutations) { + if (scopedMutations.length > 1) { + const index = scopedMutations.indexOf(mutation); + if (index !== -1) { + scopedMutations.splice(index, 1); + } + } else if (scopedMutations[0] === mutation) { + __privateGet(this, _scopes).delete(scope); + } + } + } + } + this.notify({ type: "removed", mutation }); + } + canRun(mutation) { + const scope = scopeFor(mutation); + if (typeof scope === "string") { + const mutationsWithSameScope = __privateGet(this, _scopes).get(scope); + const firstPendingMutation = mutationsWithSameScope == null ? void 0 : mutationsWithSameScope.find( + (m) => m.state.status === "pending" + ); + return !firstPendingMutation || firstPendingMutation === mutation; + } else { + return true; + } + } + runNext(mutation) { + var _a; + const scope = scopeFor(mutation); + if (typeof scope === "string") { + const foundMutation = (_a = __privateGet(this, _scopes).get(scope)) == null ? void 0 : _a.find((m) => m !== mutation && m.state.isPaused); + return (foundMutation == null ? void 0 : foundMutation.continue()) ?? Promise.resolve(); + } else { + return Promise.resolve(); + } + } + clear() { + notifyManager.batch(() => { + __privateGet(this, _mutations).forEach((mutation) => { + this.notify({ type: "removed", mutation }); + }); + __privateGet(this, _mutations).clear(); + __privateGet(this, _scopes).clear(); + }); + } + getAll() { + return Array.from(__privateGet(this, _mutations)); + } + find(filters) { + const defaultedFilters = { exact: true, ...filters }; + return this.getAll().find( + (mutation) => matchMutation(defaultedFilters, mutation) + ); + } + findAll(filters = {}) { + return this.getAll().filter((mutation) => matchMutation(filters, mutation)); + } + notify(event) { + notifyManager.batch(() => { + this.listeners.forEach((listener) => { + listener(event); + }); + }); + } + resumePausedMutations() { + const pausedMutations = this.getAll().filter((x) => x.state.isPaused); + return notifyManager.batch( + () => Promise.all( + pausedMutations.map((mutation) => mutation.continue().catch(noop)) + ) + ); + } +}; +_mutations = new WeakMap(); +_scopes = new WeakMap(); +_mutationId = new WeakMap(); +function scopeFor(mutation) { + var _a; + return (_a = mutation.options.scope) == null ? void 0 : _a.id; +} +export { + MutationCache +}; +//# sourceMappingURL=mutationCache.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/mutationCache.js.map b/node_modules/@tanstack/query-core/build/legacy/mutationCache.js.map new file mode 100644 index 0000000..baf4014 --- /dev/null +++ b/node_modules/@tanstack/query-core/build/legacy/mutationCache.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/mutationCache.ts"],"sourcesContent":["import { notifyManager } from './notifyManager'\nimport { Mutation } from './mutation'\nimport { matchMutation, noop } from './utils'\nimport { Subscribable } from './subscribable'\nimport type { MutationObserver } from './mutationObserver'\nimport type {\n DefaultError,\n MutationFunctionContext,\n MutationOptions,\n NotifyEvent,\n} from './types'\nimport type { QueryClient } from './queryClient'\nimport type { Action, MutationState } from './mutation'\nimport type { MutationFilters } from './utils'\n\n// TYPES\n\ninterface MutationCacheConfig {\n onError?: (\n error: DefaultError,\n variables: unknown,\n onMutateResult: unknown,\n mutation: Mutation,\n context: MutationFunctionContext,\n ) => Promise | unknown\n onSuccess?: (\n data: unknown,\n variables: unknown,\n onMutateResult: unknown,\n mutation: Mutation,\n context: MutationFunctionContext,\n ) => Promise | unknown\n onMutate?: (\n variables: unknown,\n mutation: Mutation,\n context: MutationFunctionContext,\n ) => Promise | unknown\n onSettled?: (\n data: unknown | undefined,\n error: DefaultError | null,\n variables: unknown,\n onMutateResult: unknown,\n mutation: Mutation,\n context: MutationFunctionContext,\n ) => Promise | unknown\n}\n\ninterface NotifyEventMutationAdded extends NotifyEvent {\n type: 'added'\n mutation: Mutation\n}\ninterface NotifyEventMutationRemoved extends NotifyEvent {\n type: 'removed'\n mutation: Mutation\n}\n\ninterface NotifyEventMutationObserverAdded extends NotifyEvent {\n type: 'observerAdded'\n mutation: Mutation\n observer: MutationObserver\n}\n\ninterface NotifyEventMutationObserverRemoved extends NotifyEvent {\n type: 'observerRemoved'\n mutation: Mutation\n observer: MutationObserver\n}\n\ninterface NotifyEventMutationObserverOptionsUpdated extends NotifyEvent {\n type: 'observerOptionsUpdated'\n mutation?: Mutation\n observer: MutationObserver\n}\n\ninterface NotifyEventMutationUpdated extends NotifyEvent {\n type: 'updated'\n mutation: Mutation\n action: Action\n}\n\nexport type MutationCacheNotifyEvent =\n | NotifyEventMutationAdded\n | NotifyEventMutationRemoved\n | NotifyEventMutationObserverAdded\n | NotifyEventMutationObserverRemoved\n | NotifyEventMutationObserverOptionsUpdated\n | NotifyEventMutationUpdated\n\ntype MutationCacheListener = (event: MutationCacheNotifyEvent) => void\n\n// CLASS\n\nexport class MutationCache extends Subscribable {\n #mutations: Set>\n #scopes: Map>>\n #mutationId: number\n\n constructor(public config: MutationCacheConfig = {}) {\n super()\n this.#mutations = new Set()\n this.#scopes = new Map()\n this.#mutationId = 0\n }\n\n build(\n client: QueryClient,\n options: MutationOptions,\n state?: MutationState,\n ): Mutation {\n const mutation = new Mutation({\n client,\n mutationCache: this,\n mutationId: ++this.#mutationId,\n options: client.defaultMutationOptions(options),\n state,\n })\n\n this.add(mutation)\n\n return mutation\n }\n\n add(mutation: Mutation): void {\n this.#mutations.add(mutation)\n const scope = scopeFor(mutation)\n if (typeof scope === 'string') {\n const scopedMutations = this.#scopes.get(scope)\n if (scopedMutations) {\n scopedMutations.push(mutation)\n } else {\n this.#scopes.set(scope, [mutation])\n }\n }\n this.notify({ type: 'added', mutation })\n }\n\n remove(mutation: Mutation): void {\n if (this.#mutations.delete(mutation)) {\n const scope = scopeFor(mutation)\n if (typeof scope === 'string') {\n const scopedMutations = this.#scopes.get(scope)\n if (scopedMutations) {\n if (scopedMutations.length > 1) {\n const index = scopedMutations.indexOf(mutation)\n if (index !== -1) {\n scopedMutations.splice(index, 1)\n }\n } else if (scopedMutations[0] === mutation) {\n this.#scopes.delete(scope)\n }\n }\n }\n }\n\n // Currently we notify the removal even if the mutation was already removed.\n // Consider making this an error or not notifying of the removal depending on the desired semantics.\n this.notify({ type: 'removed', mutation })\n }\n\n canRun(mutation: Mutation): boolean {\n const scope = scopeFor(mutation)\n if (typeof scope === 'string') {\n const mutationsWithSameScope = this.#scopes.get(scope)\n const firstPendingMutation = mutationsWithSameScope?.find(\n (m) => m.state.status === 'pending',\n )\n // we can run if there is no current pending mutation (start use-case)\n // or if WE are the first pending mutation (continue use-case)\n return !firstPendingMutation || firstPendingMutation === mutation\n } else {\n // For unscoped mutations there are never any pending mutations in front of the\n // current mutation\n return true\n }\n }\n\n runNext(mutation: Mutation): Promise {\n const scope = scopeFor(mutation)\n if (typeof scope === 'string') {\n const foundMutation = this.#scopes\n .get(scope)\n ?.find((m) => m !== mutation && m.state.isPaused)\n\n return foundMutation?.continue() ?? Promise.resolve()\n } else {\n return Promise.resolve()\n }\n }\n\n clear(): void {\n notifyManager.batch(() => {\n this.#mutations.forEach((mutation) => {\n this.notify({ type: 'removed', mutation })\n })\n this.#mutations.clear()\n this.#scopes.clear()\n })\n }\n\n getAll(): Array {\n return Array.from(this.#mutations)\n }\n\n find<\n TData = unknown,\n TError = DefaultError,\n TVariables = any,\n TOnMutateResult = unknown,\n >(\n filters: MutationFilters,\n ): Mutation | undefined {\n const defaultedFilters = { exact: true, ...filters }\n\n return this.getAll().find((mutation) =>\n matchMutation(defaultedFilters, mutation),\n ) as Mutation | undefined\n }\n\n findAll(filters: MutationFilters = {}): Array {\n return this.getAll().filter((mutation) => matchMutation(filters, mutation))\n }\n\n notify(event: MutationCacheNotifyEvent) {\n notifyManager.batch(() => {\n this.listeners.forEach((listener) => {\n listener(event)\n })\n })\n }\n\n resumePausedMutations(): Promise {\n const pausedMutations = this.getAll().filter((x) => x.state.isPaused)\n\n return notifyManager.batch(() =>\n Promise.all(\n pausedMutations.map((mutation) => mutation.continue().catch(noop)),\n ),\n )\n }\n}\n\nfunction scopeFor(mutation: Mutation) {\n return mutation.options.scope?.id\n}\n"],"mappings":";;;;;;;;AAAA,SAAS,qBAAqB;AAC9B,SAAS,gBAAgB;AACzB,SAAS,eAAe,YAAY;AACpC,SAAS,oBAAoB;AAH7B;AA4FO,IAAM,gBAAN,cAA4B,aAAoC;AAAA,EAKrE,YAAmB,SAA8B,CAAC,GAAG;AACnD,UAAM;AADW;AAJnB;AACA;AACA;AAIE,uBAAK,YAAa,oBAAI,IAAI;AAC1B,uBAAK,SAAU,oBAAI,IAAI;AACvB,uBAAK,aAAc;AAAA,EACrB;AAAA,EAEA,MACE,QACA,SACA,OACsD;AACtD,UAAM,WAAW,IAAI,SAAS;AA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BAA0C;AACxC,UAAM,kBAAkB,KAAK,OAAO,EAAE,OAAO,CAAC,MAAM,EAAE,MAAM,QAAQ;AAEpE,WAAO,cAAc;AAAA,MAAM,MACzB,QAAQ;AAAA,QACN,gBAAgB,IAAI,CAAC,aAAa,SAAS,SAAS,EAAE,MAAM,IAAI,CAAC;AAAA,MACnE;AAAA,IACF;AAAA,EACF;AACF;AAlJE;AACA;AACA;AAkJF,SAAS,SAAS,UAAwC;AAjP1D;AAkPE,UAAO,cAAS,QAAQ,UAAjB,mBAAwB;AACjC;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/mutationObserver.cjs b/node_modules/@tanstack/query-core/build/legacy/mutationObserver.cjs new file mode 100644 index 0000000..b0f8183 --- /dev/null +++ b/node_modules/@tanstack/query-core/build/legacy/mutationObserver.cjs @@ -0,0 +1,190 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __typeError = (msg) => { + throw TypeError(msg); +}; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg); +var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj)); +var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value); +var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value); +var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method); + +// src/mutationObserver.ts +var mutationObserver_exports = {}; +__export(mutationObserver_exports, { + MutationObserver: () => MutationObserver +}); +module.exports = __toCommonJS(mutationObserver_exports); +var import_mutation = require("./mutation.cjs"); +var import_notifyManager = require("./notifyManager.cjs"); +var import_subscribable = require("./subscribable.cjs"); +var import_utils = require("./utils.cjs"); +var _client, _currentResult, _currentMutation, _mutateOptions, _MutationObserver_instances, updateResult_fn, notify_fn; +var MutationObserver = class extends import_subscribable.Subscribable { + constructor(client, options) { + super(); + __privateAdd(this, _MutationObserver_instances); + __privateAdd(this, _client); + __privateAdd(this, _currentResult); + __privateAdd(this, _currentMutation); + __privateAdd(this, _mutateOptions); + __privateSet(this, _client, client); + this.setOptions(options); + this.bindMethods(); + __privateMethod(this, _MutationObserver_instances, updateResult_fn).call(this); + } + bindMethods() { + this.mutate = this.mutate.bind(this); + this.reset = this.reset.bind(this); + } + setOptions(options) { + var _a; + const prevOptions = this.options; + this.options = __privateGet(this, _client).defaultMutationOptions(options); + if (!(0, import_utils.shallowEqualObjects)(this.options, prevOptions)) { + __privateGet(this, _client).getMutationCache().notify({ + type: "observerOptionsUpdated", + mutation: __privateGet(this, _currentMutation), + observer: this + }); + } + if ((prevOptions == null ? void 0 : prevOptions.mutationKey) && this.options.mutationKey && (0, import_utils.hashKey)(prevOptions.mutationKey) !== (0, import_utils.hashKey)(this.options.mutationKey)) { + this.reset(); + } else if (((_a = __privateGet(this, _currentMutation)) == null ? void 0 : _a.state.status) === "pending") { + __privateGet(this, _currentMutation).setOptions(this.options); + } + } + onUnsubscribe() { + var _a; + if (!this.hasListeners()) { + (_a = __privateGet(this, _currentMutation)) == null ? void 0 : _a.removeObserver(this); + } + } + onMutationUpdate(action) { + __privateMethod(this, _MutationObserver_instances, updateResult_fn).call(this); + __privateMethod(this, _MutationObserver_instances, notify_fn).call(this, action); + } + getCurrentResult() { + return __privateGet(this, _currentResult); + } + reset() { + var _a; + (_a = __privateGet(this, _currentMutation)) == null ? void 0 : _a.removeObserver(this); + __privateSet(this, _currentMutation, void 0); + __privateMethod(this, _MutationObserver_instances, updateResult_fn).call(this); + __privateMethod(this, _MutationObserver_instances, notify_fn).call(this); + } + mutate(variables, options) { + var _a; + __privateSet(this, _mutateOptions, options); + (_a = __privateGet(this, _currentMutation)) == null ? void 0 : _a.removeObserver(this); + __privateSet(this, _currentMutation, __privateGet(this, _client).getMutationCache().build(__privateGet(this, _client), this.options)); + __privateGet(this, _currentMutation).addObserver(this); + return __privateGet(this, _currentMutation).execute(variables); + } +}; +_client = new WeakMap(); +_currentResult = new WeakMap(); +_currentMutation = new WeakMap(); +_mutateOptions = new WeakMap(); +_MutationObserver_instances = new WeakSet(); +updateResult_fn = function() { + var _a; + const state = ((_a = __privateGet(this, _currentMutation)) == null ? void 0 : _a.state) ?? (0, import_mutation.getDefaultState)(); + __privateSet(this, _currentResult, { + ...state, + isPending: state.status === "pending", + isSuccess: state.status === "success", + isError: state.status === "error", + isIdle: state.status === "idle", + mutate: this.mutate, + reset: this.reset + }); +}; +notify_fn = function(action) { + import_notifyManager.notifyManager.batch(() => { + var _a, _b, _c, _d, _e, _f, _g, _h; + if (__privateGet(this, _mutateOptions) && this.hasListeners()) { + const variables = __privateGet(this, _currentResult).variables; + const onMutateResult = __privateGet(this, _currentResult).context; + const context = { + client: __privateGet(this, _client), + meta: this.options.meta, + mutationKey: this.options.mutationKey + }; + if ((action == null ? void 0 : action.type) === "success") { + try { + (_b = (_a = __privateGet(this, _mutateOptions)).onSuccess) == null ? void 0 : _b.call( + _a, + action.data, + variables, + onMutateResult, + context + ); + } catch (e) { + void Promise.reject(e); + } + try { + (_d = (_c = __privateGet(this, _mutateOptions)).onSettled) == null ? void 0 : _d.call( + _c, + action.data, + null, + variables, + onMutateResult, + context + ); + } catch (e) { + void Promise.reject(e); + } + } else if ((action == null ? void 0 : action.type) === "error") { + try { + (_f = (_e = __privateGet(this, _mutateOptions)).onError) == null ? void 0 : _f.call( + _e, + action.error, + variables, + onMutateResult, + context + ); + } catch (e) { + void Promise.reject(e); + } + try { + (_h = (_g = __privateGet(this, _mutateOptions)).onSettled) == null ? void 0 : _h.call( + _g, + void 0, + action.error, + variables, + onMutateResult, + context + ); + } catch (e) { + void Promise.reject(e); + } + } + } + this.listeners.forEach((listener) => { + listener(__privateGet(this, _currentResult)); + }); + }); +}; +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + MutationObserver +}); +//# sourceMappingURL=mutationObserver.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/mutationObserver.cjs.map b/node_modules/@tanstack/query-core/build/legacy/mutationObserver.cjs.map new file mode 100644 index 0000000..c5f2f62 --- /dev/null +++ b/node_modules/@tanstack/query-core/build/legacy/mutationObserver.cjs.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/mutationObserver.ts"],"sourcesContent":["import { getDefaultState } from './mutation'\nimport { notifyManager } from './notifyManager'\nimport { Subscribable } from './subscribable'\nimport { hashKey, shallowEqualObjects } from './utils'\nimport type { QueryClient } from './queryClient'\nimport type {\n DefaultError,\n MutateOptions,\n MutationFunctionContext,\n MutationObserverOptions,\n MutationObserverResult,\n} from './types'\nimport type { Action, Mutation } from './mutation'\n\n// TYPES\n\ntype MutationObserverListener = (\n result: MutationObserverResult,\n) => void\n\n// CLASS\n\nexport class MutationObserver<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n> extends Subscribable<\n MutationObserverListener\n> {\n options!: MutationObserverOptions\n\n #client: QueryClient\n #currentResult: MutationObserverResult<\n TData,\n TError,\n TVariables,\n TOnMutateResult\n > = undefined!\n #currentMutation?: Mutation\n #mutateOptions?: MutateOptions\n\n constructor(\n client: QueryClient,\n options: MutationObserverOptions<\n TData,\n TError,\n TVariables,\n TOnMutateResult\n >,\n ) {\n super()\n\n this.#client = client\n this.setOptions(options)\n this.bindMethods()\n this.#updateResult()\n }\n\n protected bindMethods(): void {\n this.mutate = this.mutate.bind(this)\n this.reset = this.reset.bind(this)\n }\n\n setOptions(\n options: MutationObserverOptions<\n TData,\n TError,\n TVariables,\n TOnMutateResult\n >,\n ) {\n const prevOptions = this.options as\n | MutationObserverOptions\n | undefined\n this.options = this.#client.defaultMutationOptions(options)\n if (!shallowEqualObjects(this.options, prevOptions)) {\n this.#client.getMutationCache().notify({\n type: 'observerOptionsUpdated',\n mutation: this.#currentMutation,\n observer: this,\n })\n }\n\n if (\n prevOptions?.mutationKey &&\n this.options.mutationKey &&\n hashKey(prevOptions.mutationKey) !== hashKey(this.options.mutationKey)\n ) {\n this.reset()\n } else if (this.#currentMutation?.state.status === 'pending') {\n this.#currentMutation.setOptions(this.options)\n }\n }\n\n protected onUnsubscribe(): void {\n if (!this.hasListeners()) {\n this.#currentMutation?.removeObserver(this)\n }\n }\n\n onMutationUpdate(\n action: Action,\n ): void {\n this.#updateResult()\n\n this.#notify(action)\n }\n\n getCurrentResult(): MutationObserverResult<\n TData,\n TError,\n TVariables,\n TOnMutateResult\n > {\n return this.#currentResult\n }\n\n reset(): void {\n // reset needs to remove the observer from the mutation because there is no way to \"get it back\"\n // another mutate call will yield a new mutation!\n this.#currentMutation?.removeObserver(this)\n this.#currentMutation = undefined\n this.#updateResult()\n this.#notify()\n }\n\n mutate(\n variables: TVariables,\n options?: MutateOptions,\n ): Promise {\n this.#mutateOptions = options\n\n this.#currentMutation?.removeObserver(this)\n\n this.#currentMutation = this.#client\n .getMutationCache()\n .build(this.#client, this.options)\n\n this.#currentMutation.addObserver(this)\n\n return this.#currentMutation.execute(variables)\n }\n\n #updateResult(): void {\n const state =\n this.#currentMutation?.state ??\n getDefaultState()\n\n this.#currentResult = {\n ...state,\n isPending: state.status === 'pending',\n isSuccess: state.status === 'success',\n isError: state.status === 'error',\n isIdle: state.status === 'idle',\n mutate: this.mutate,\n reset: this.reset,\n } as MutationObserverResult\n }\n\n #notify(action?: Action): void {\n notifyManager.batch(() => {\n // First trigger the mutate callbacks\n if (this.#mutateOptions && this.hasListeners()) {\n const variables = this.#currentResult.variables!\n const onMutateResult = this.#currentResult.context\n\n const context = {\n client: this.#client,\n meta: this.options.meta,\n mutationKey: this.options.mutationKey,\n } satisfies MutationFunctionContext\n\n if (action?.type === 'success') {\n try {\n this.#mutateOptions.onSuccess?.(\n action.data,\n variables,\n onMutateResult,\n context,\n )\n } catch (e) {\n void Promise.reject(e)\n }\n try {\n this.#mutateOptions.onSettled?.(\n action.data,\n null,\n variables,\n onMutateResult,\n context,\n )\n } catch (e) {\n void Promise.reject(e)\n }\n } else if (action?.type === 'error') {\n try {\n this.#mutateOptions.onError?.(\n action.error,\n variables,\n onMutateResult,\n context,\n )\n } catch (e) {\n void Promise.reject(e)\n }\n try {\n this.#mutateOptions.onSettled?.(\n undefined,\n action.error,\n variables,\n onMutateResult,\n context,\n )\n } catch (e) {\n void Promise.reject(e)\n }\n }\n }\n\n // Then trigger the listeners\n this.listeners.forEach((listener) => {\n listener(this.#currentResult)\n })\n })\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,sBAAgC;AAChC,2BAA8B;AAC9B,0BAA6B;AAC7B,mBAA6C;AAH7C;AAsBO,IAAM,mBAAN,cAKG,iCAER;AAAA,EAaA,YACE,QACA,SAMA;AACA,UAAM;AA7BH;AAUL;AACA;AAMA;AACA;AAaE,uBAAK,SAAU;AACf,SAAK,WAAW,OAAO;AACvB,SAAK,YAAY;AACjB,0BAAK,8CAAL;AAAA,EACF;AAAA,EAEU,cAAoB;AAC5B,SAAK,SAAS,KAAK,OAAO,KAAK,IAAI;AACnC,SAAK,QAAQ,KAAK,MAAM,KAAK,IAAI;AAAA,EACnC;AAAA,EAEA,WACE,SAMA;AAvEJ;AAwEI,UAAM,cAAc,KAAK;AAGzB,SAAK,UAAU,mBAAK,SAAQ,uBAAuB,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AC;AAAA,QACvB;AAAA,MACF;AAAA,IACF;AAGA,SAAK,UAAU,QAAQ,CAAC,aAAa;AACnC,eAAS,mBAAK,eAAc;AAAA,IAC9B,CAAC;AAAA,EACH,CAAC;AACH;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/mutationObserver.d.cts b/node_modules/@tanstack/query-core/build/legacy/mutationObserver.d.cts new file mode 100644 index 0000000..04a9d2d --- /dev/null +++ b/node_modules/@tanstack/query-core/build/legacy/mutationObserver.d.cts @@ -0,0 +1,3 @@ +import './subscribable.cjs'; +export { e as MutationObserver } from './hydration-uphG6M-i.cjs'; +import './removable.cjs'; diff --git a/node_modules/@tanstack/query-core/build/legacy/mutationObserver.d.ts b/node_modules/@tanstack/query-core/build/legacy/mutationObserver.d.ts new file mode 100644 index 0000000..1700476 --- /dev/null +++ b/node_modules/@tanstack/query-core/build/legacy/mutationObserver.d.ts @@ -0,0 +1,3 @@ +import './subscribable.js'; +export { e as MutationObserver } from './hydration-BlEVG2Lp.js'; +import './removable.js'; diff --git a/node_modules/@tanstack/query-core/build/legacy/mutationObserver.js b/node_modules/@tanstack/query-core/build/legacy/mutationObserver.js new file mode 100644 index 0000000..c3817fa --- /dev/null +++ b/node_modules/@tanstack/query-core/build/legacy/mutationObserver.js @@ -0,0 +1,164 @@ +import { + __privateAdd, + __privateGet, + __privateMethod, + __privateSet +} from "./chunk-PXG64RU4.js"; + +// src/mutationObserver.ts +import { getDefaultState } from "./mutation.js"; +import { notifyManager } from "./notifyManager.js"; +import { Subscribable } from "./subscribable.js"; +import { hashKey, shallowEqualObjects } from "./utils.js"; +var _client, _currentResult, _currentMutation, _mutateOptions, _MutationObserver_instances, updateResult_fn, notify_fn; +var MutationObserver = class extends Subscribable { + constructor(client, options) { + super(); + __privateAdd(this, _MutationObserver_instances); + __privateAdd(this, _client); + __privateAdd(this, _currentResult); + __privateAdd(this, _currentMutation); + __privateAdd(this, _mutateOptions); + __privateSet(this, _client, client); + this.setOptions(options); + this.bindMethods(); + __privateMethod(this, _MutationObserver_instances, updateResult_fn).call(this); + } + bindMethods() { + this.mutate = this.mutate.bind(this); + this.reset = this.reset.bind(this); + } + setOptions(options) { + var _a; + const prevOptions = this.options; + this.options = __privateGet(this, _client).defaultMutationOptions(options); + if (!shallowEqualObjects(this.options, prevOptions)) { + __privateGet(this, _client).getMutationCache().notify({ + type: "observerOptionsUpdated", + mutation: __privateGet(this, _currentMutation), + observer: this + }); + } + if ((prevOptions == null ? void 0 : prevOptions.mutationKey) && this.options.mutationKey && hashKey(prevOptions.mutationKey) !== hashKey(this.options.mutationKey)) { + this.reset(); + } else if (((_a = __privateGet(this, _currentMutation)) == null ? void 0 : _a.state.status) === "pending") { + __privateGet(this, _currentMutation).setOptions(this.options); + } + } + onUnsubscribe() { + var _a; + if (!this.hasListeners()) { + (_a = __privateGet(this, _currentMutation)) == null ? void 0 : _a.removeObserver(this); + } + } + onMutationUpdate(action) { + __privateMethod(this, _MutationObserver_instances, updateResult_fn).call(this); + __privateMethod(this, _MutationObserver_instances, notify_fn).call(this, action); + } + getCurrentResult() { + return __privateGet(this, _currentResult); + } + reset() { + var _a; + (_a = __privateGet(this, _currentMutation)) == null ? void 0 : _a.removeObserver(this); + __privateSet(this, _currentMutation, void 0); + __privateMethod(this, _MutationObserver_instances, updateResult_fn).call(this); + __privateMethod(this, _MutationObserver_instances, notify_fn).call(this); + } + mutate(variables, options) { + var _a; + __privateSet(this, _mutateOptions, options); + (_a = __privateGet(this, _currentMutation)) == null ? void 0 : _a.removeObserver(this); + __privateSet(this, _currentMutation, __privateGet(this, _client).getMutationCache().build(__privateGet(this, _client), this.options)); + __privateGet(this, _currentMutation).addObserver(this); + return __privateGet(this, _currentMutation).execute(variables); + } +}; +_client = new WeakMap(); +_currentResult = new WeakMap(); +_currentMutation = new WeakMap(); +_mutateOptions = new WeakMap(); +_MutationObserver_instances = new WeakSet(); +updateResult_fn = function() { + var _a; + const state = ((_a = __privateGet(this, _currentMutation)) == null ? void 0 : _a.state) ?? getDefaultState(); + __privateSet(this, _currentResult, { + ...state, + isPending: state.status === "pending", + isSuccess: state.status === "success", + isError: state.status === "error", + isIdle: state.status === "idle", + mutate: this.mutate, + reset: this.reset + }); +}; +notify_fn = function(action) { + notifyManager.batch(() => { + var _a, _b, _c, _d, _e, _f, _g, _h; + if (__privateGet(this, _mutateOptions) && this.hasListeners()) { + const variables = __privateGet(this, _currentResult).variables; + const onMutateResult = __privateGet(this, _currentResult).context; + const context = { + client: __privateGet(this, _client), + meta: this.options.meta, + mutationKey: this.options.mutationKey + }; + if ((action == null ? void 0 : action.type) === "success") { + try { + (_b = (_a = __privateGet(this, _mutateOptions)).onSuccess) == null ? void 0 : _b.call( + _a, + action.data, + variables, + onMutateResult, + context + ); + } catch (e) { + void Promise.reject(e); + } + try { + (_d = (_c = __privateGet(this, _mutateOptions)).onSettled) == null ? void 0 : _d.call( + _c, + action.data, + null, + variables, + onMutateResult, + context + ); + } catch (e) { + void Promise.reject(e); + } + } else if ((action == null ? void 0 : action.type) === "error") { + try { + (_f = (_e = __privateGet(this, _mutateOptions)).onError) == null ? void 0 : _f.call( + _e, + action.error, + variables, + onMutateResult, + context + ); + } catch (e) { + void Promise.reject(e); + } + try { + (_h = (_g = __privateGet(this, _mutateOptions)).onSettled) == null ? void 0 : _h.call( + _g, + void 0, + action.error, + variables, + onMutateResult, + context + ); + } catch (e) { + void Promise.reject(e); + } + } + } + this.listeners.forEach((listener) => { + listener(__privateGet(this, _currentResult)); + }); + }); +}; +export { + MutationObserver +}; +//# sourceMappingURL=mutationObserver.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/mutationObserver.js.map b/node_modules/@tanstack/query-core/build/legacy/mutationObserver.js.map new file mode 100644 index 0000000..7d6566e --- /dev/null +++ b/node_modules/@tanstack/query-core/build/legacy/mutationObserver.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/mutationObserver.ts"],"sourcesContent":["import { getDefaultState } from './mutation'\nimport { notifyManager } from './notifyManager'\nimport { Subscribable } from './subscribable'\nimport { hashKey, shallowEqualObjects } from './utils'\nimport type { QueryClient } from './queryClient'\nimport type {\n DefaultError,\n MutateOptions,\n MutationFunctionContext,\n MutationObserverOptions,\n MutationObserverResult,\n} from './types'\nimport type { Action, Mutation } from './mutation'\n\n// TYPES\n\ntype MutationObserverListener = (\n result: MutationObserverResult,\n) => void\n\n// CLASS\n\nexport class MutationObserver<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n> extends Subscribable<\n MutationObserverListener\n> {\n options!: MutationObserverOptions\n\n #client: QueryClient\n #currentResult: MutationObserverResult<\n TData,\n TError,\n TVariables,\n TOnMutateResult\n > = undefined!\n #currentMutation?: Mutation\n #mutateOptions?: MutateOptions\n\n constructor(\n client: QueryClient,\n options: MutationObserverOptions<\n TData,\n TError,\n TVariables,\n TOnMutateResult\n >,\n ) {\n super()\n\n this.#client = client\n this.setOptions(options)\n this.bindMethods()\n this.#updateResult()\n }\n\n protected bindMethods(): void {\n this.mutate = this.mutate.bind(this)\n this.reset = this.reset.bind(this)\n }\n\n setOptions(\n options: MutationObserverOptions<\n TData,\n TError,\n TVariables,\n TOnMutateResult\n >,\n ) {\n const prevOptions = this.options as\n | MutationObserverOptions\n | undefined\n this.options = this.#client.defaultMutationOptions(options)\n if (!shallowEqualObjects(this.options, prevOptions)) {\n this.#client.getMutationCache().notify({\n type: 'observerOptionsUpdated',\n mutation: this.#currentMutation,\n observer: this,\n })\n }\n\n if (\n prevOptions?.mutationKey &&\n this.options.mutationKey &&\n hashKey(prevOptions.mutationKey) !== hashKey(this.options.mutationKey)\n ) {\n this.reset()\n } else if (this.#currentMutation?.state.status === 'pending') {\n this.#currentMutation.setOptions(this.options)\n }\n }\n\n protected onUnsubscribe(): void {\n if (!this.hasListeners()) {\n this.#currentMutation?.removeObserver(this)\n }\n }\n\n onMutationUpdate(\n action: Action,\n ): void {\n this.#updateResult()\n\n this.#notify(action)\n }\n\n getCurrentResult(): MutationObserverResult<\n TData,\n TError,\n TVariables,\n TOnMutateResult\n > {\n return this.#currentResult\n }\n\n reset(): void {\n // reset needs to remove the observer from the mutation because there is no way to \"get it back\"\n // another mutate call will yield a new mutation!\n this.#currentMutation?.removeObserver(this)\n this.#currentMutation = undefined\n this.#updateResult()\n this.#notify()\n }\n\n mutate(\n variables: TVariables,\n options?: MutateOptions,\n ): Promise {\n this.#mutateOptions = options\n\n this.#currentMutation?.removeObserver(this)\n\n this.#currentMutation = this.#client\n .getMutationCache()\n .build(this.#client, this.options)\n\n this.#currentMutation.addObserver(this)\n\n return this.#currentMutation.execute(variables)\n }\n\n #updateResult(): void {\n const state =\n this.#currentMutation?.state ??\n getDefaultState()\n\n this.#currentResult = {\n ...state,\n isPending: state.status === 'pending',\n isSuccess: state.status === 'success',\n isError: state.status === 'error',\n isIdle: state.status === 'idle',\n mutate: this.mutate,\n reset: this.reset,\n } as MutationObserverResult\n }\n\n #notify(action?: Action): void {\n notifyManager.batch(() => {\n // First trigger the mutate callbacks\n if (this.#mutateOptions && this.hasListeners()) {\n const variables = this.#currentResult.variables!\n const onMutateResult = this.#currentResult.context\n\n const context = {\n client: this.#client,\n meta: this.options.meta,\n mutationKey: this.options.mutationKey,\n } satisfies MutationFunctionContext\n\n if (action?.type === 'success') {\n try {\n this.#mutateOptions.onSuccess?.(\n action.data,\n variables,\n onMutateResult,\n context,\n )\n } catch (e) {\n void Promise.reject(e)\n }\n try {\n this.#mutateOptions.onSettled?.(\n action.data,\n null,\n variables,\n onMutateResult,\n context,\n )\n } catch (e) {\n void Promise.reject(e)\n }\n } else if (action?.type === 'error') {\n try {\n this.#mutateOptions.onError?.(\n action.error,\n variables,\n onMutateResult,\n context,\n )\n } catch (e) {\n void Promise.reject(e)\n }\n try {\n this.#mutateOptions.onSettled?.(\n undefined,\n action.error,\n variables,\n onMutateResult,\n context,\n )\n } catch (e) {\n void Promise.reject(e)\n }\n }\n }\n\n // Then trigger the listeners\n this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AQ,OAAO,CAAC;AAAA,QACvB;AACA,YAAI;AACF,yCAAK,iBAAe,cAApB;AAAA;AAAA,YACE,OAAO;AAAA,YACP;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA;AAAA,QAEJ,SAAS,GAAG;AACV,eAAK,QAAQ,OAAO,CAAC;AAAA,QACvB;AAAA,MACF,YAAW,iCAAQ,UAAS,SAAS;AACnC,YAAI;AACF,yCAAK,iBAAe,YAApB;AAAA;AAAA,YACE,OAAO;AAAA,YACP;AAAA,YACA;AAAA,YACA;AAAA;AAAA,QAEJ,SAAS,GAAG;AACV,eAAK,QAAQ,OAAO,CAAC;AAAA,QACvB;AACA,YAAI;AACF,yCAAK,iBAAe,cAApB;AAAA;AAAA,YACE;AAAA,YACA,OAAO;AAAA,YACP;AAAA,YACA;AAAA,YACA;AAAA;AAAA,QAEJ,SAAS,GAAG;AACV,eAAK,QAAQ,OAAO,CAAC;AAAA,QACvB;AAAA,MACF;AAAA,IACF;AAGA,SAAK,UAAU,QAAQ,CAAC,aAAa;AACnC,eAAS,mBAAK,eAAc;AAAA,IAC9B,CAAC;AAAA,EACH,CAAC;AACH;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/notifyManager.cjs b/node_modules/@tanstack/query-core/build/legacy/notifyManager.cjs new file mode 100644 index 0000000..355a2c1 --- /dev/null +++ b/node_modules/@tanstack/query-core/build/legacy/notifyManager.cjs @@ -0,0 +1,113 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/notifyManager.ts +var notifyManager_exports = {}; +__export(notifyManager_exports, { + createNotifyManager: () => createNotifyManager, + defaultScheduler: () => defaultScheduler, + notifyManager: () => notifyManager +}); +module.exports = __toCommonJS(notifyManager_exports); +var import_timeoutManager = require("./timeoutManager.cjs"); +var defaultScheduler = import_timeoutManager.systemSetTimeoutZero; +function createNotifyManager() { + let queue = []; + let transactions = 0; + let notifyFn = (callback) => { + callback(); + }; + let batchNotifyFn = (callback) => { + callback(); + }; + let scheduleFn = defaultScheduler; + const schedule = (callback) => { + if (transactions) { + queue.push(callback); + } else { + scheduleFn(() => { + notifyFn(callback); + }); + } + }; + const flush = () => { + const originalQueue = queue; + queue = []; + if (originalQueue.length) { + scheduleFn(() => { + batchNotifyFn(() => { + originalQueue.forEach((callback) => { + notifyFn(callback); + }); + }); + }); + } + }; + return { + batch: (callback) => { + let result; + transactions++; + try { + result = callback(); + } finally { + transactions--; + if (!transactions) { + flush(); + } + } + return result; + }, + /** + * All calls to the wrapped function will be batched. + */ + batchCalls: (callback) => { + return (...args) => { + schedule(() => { + callback(...args); + }); + }; + }, + schedule, + /** + * Use this method to set a custom notify function. + * This can be used to for example wrap notifications with `React.act` while running tests. + */ + setNotifyFunction: (fn) => { + notifyFn = fn; + }, + /** + * Use this method to set a custom function to batch notifications together into a single tick. + * By default React Query will use the batch function provided by ReactDOM or React Native. + */ + setBatchNotifyFunction: (fn) => { + batchNotifyFn = fn; + }, + setScheduler: (fn) => { + scheduleFn = fn; + } + }; +} +var notifyManager = createNotifyManager(); +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + createNotifyManager, + defaultScheduler, + notifyManager +}); +//# sourceMappingURL=notifyManager.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/notifyManager.cjs.map b/node_modules/@tanstack/query-core/build/legacy/notifyManager.cjs.map new file mode 100644 index 0000000..1756c4b --- /dev/null +++ b/node_modules/@tanstack/query-core/build/legacy/notifyManager.cjs.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/notifyManager.ts"],"sourcesContent":["// TYPES\n\nimport { systemSetTimeoutZero } from './timeoutManager'\n\ntype NotifyCallback = () => void\n\ntype NotifyFunction = (callback: () => void) => void\n\ntype BatchNotifyFunction = (callback: () => void) => void\n\ntype BatchCallsCallback> = (...args: T) => void\n\ntype ScheduleFunction = (callback: () => void) => void\n\nexport const defaultScheduler: ScheduleFunction = systemSetTimeoutZero\n\nexport function createNotifyManager() {\n let queue: Array = []\n let transactions = 0\n let notifyFn: NotifyFunction = (callback) => {\n callback()\n }\n let batchNotifyFn: BatchNotifyFunction = (callback: () => void) => {\n callback()\n }\n let scheduleFn = defaultScheduler\n\n const schedule = (callback: NotifyCallback): void => {\n if (transactions) {\n queue.push(callback)\n } else {\n scheduleFn(() => {\n notifyFn(callback)\n })\n }\n }\n const flush = (): void => {\n const originalQueue = queue\n queue = []\n if (originalQueue.length) {\n scheduleFn(() => {\n batchNotifyFn(() => {\n originalQueue.forEach((callback) => {\n notifyFn(callback)\n })\n })\n })\n }\n }\n\n return {\n batch: (callback: () => T): T => {\n let result\n transactions++\n try {\n result = callback()\n } finally {\n transactions--\n if (!transactions) {\n flush()\n }\n }\n return result\n },\n /**\n * All calls to the wrapped function will be batched.\n */\n batchCalls: >(\n callback: BatchCallsCallback,\n ): BatchCallsCallback => {\n return (...args) => {\n schedule(() => {\n callback(...args)\n })\n }\n },\n schedule,\n /**\n * Use this method to set a custom notify function.\n * This can be used to for example wrap notifications with `React.act` while running tests.\n */\n setNotifyFunction: (fn: NotifyFunction) => {\n notifyFn = fn\n },\n /**\n * Use this method to set a custom function to batch notifications together into a single tick.\n * By default React Query will use the batch function provided by ReactDOM or React Native.\n */\n setBatchNotifyFunction: (fn: BatchNotifyFunction) => {\n batchNotifyFn = fn\n },\n setScheduler: (fn: ScheduleFunction) => {\n scheduleFn = fn\n },\n } as const\n}\n\n// SINGLETON\nexport const notifyManager = createNotifyManager()\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,4BAAqC;AAY9B,IAAM,mBAAqC;AAE3C,SAAS,sBAAsB;AACpC,MAAI,QAA+B,CAAC;AACpC,MAAI,eAAe;AACnB,MAAI,WAA2B,CAAC,aAAa;AAC3C,aAAS;AAAA,EACX;AACA,MAAI,gBAAqC,CAAC,aAAyB;AACjE,aAAS;AAAA,EACX;AACA,MAAI,aAAa;AAEjB,QAAM,WAAW,CAAC,aAAmC;AACnD,QAAI,cAAc;AAChB,YAAM,KAAK,QAAQ;AAAA,IACrB,OAAO;AACL,iBAAW,MAAM;AACf,iBAAS,QAAQ;AAAA,MACnB,CAAC;AAAA,IACH;AAAA,EACF;AACA,QAAM,QAAQ,MAAY;AACxB,UAAM,gBAAgB;AACtB,YAAQ,CAAC;AACT,QAAI,cAAc,QAAQ;AACxB,iBAAW,MAAM;AACf,sBAAc,MAAM;AAClB,wBAAc,QAAQ,CAAC,aAAa;AAClC,qBAAS,QAAQ;AAAA,UACnB,CAAC;AAAA,QACH,CAAC;AAAA,MACH,CAAC;AAAA,IACH;AAAA,EACF;AAEA,SAAO;AAAA,IACL,OAAO,CAAI,aAAyB;AAClC,UAAI;AACJ;AACA,UAAI;AACF,iBAAS,SAAS;AAAA,MACpB,UAAE;AACA;AACA,YAAI,CAAC,cAAc;AACjB,gBAAM;AAAA,QACR;AAAA,MACF;AACA,aAAO;AAAA,IACT;AAAA;AAAA;AAAA;AAAA,IAIA,YAAY,CACV,aAC0B;AAC1B,aAAO,IAAI,SAAS;AAClB,iBAAS,MAAM;AACb,mBAAS,GAAG,IAAI;AAAA,QAClB,CAAC;AAAA,MACH;AAAA,IACF;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA,IAKA,mBAAmB,CAAC,OAAuB;AACzC,iBAAW;AAAA,IACb;AAAA;AAAA;AAAA;AAAA;AAAA,IAKA,wBAAwB,CAAC,OAA4B;AACnD,sBAAgB;AAAA,IAClB;AAAA,IACA,cAAc,CAAC,OAAyB;AACtC,mBAAa;AAAA,IACf;AAAA,EACF;AACF;AAGO,IAAM,gBAAgB,oBAAoB;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/notifyManager.d.cts b/node_modules/@tanstack/query-core/build/legacy/notifyManager.d.cts new file mode 100644 index 0000000..bd4a370 --- /dev/null +++ b/node_modules/@tanstack/query-core/build/legacy/notifyManager.d.cts @@ -0,0 +1,46 @@ +type NotifyCallback = () => void; +type NotifyFunction = (callback: () => void) => void; +type BatchNotifyFunction = (callback: () => void) => void; +type BatchCallsCallback> = (...args: T) => void; +type ScheduleFunction = (callback: () => void) => void; +declare const defaultScheduler: ScheduleFunction; +declare function createNotifyManager(): { + readonly batch: (callback: () => T) => T; + /** + * All calls to the wrapped function will be batched. + */ + readonly batchCalls: >(callback: BatchCallsCallback) => BatchCallsCallback; + readonly schedule: (callback: NotifyCallback) => void; + /** + * Use this method to set a custom notify function. + * This can be used to for example wrap notifications with `React.act` while running tests. + */ + readonly setNotifyFunction: (fn: NotifyFunction) => void; + /** + * Use this method to set a custom function to batch notifications together into a single tick. + * By default React Query will use the batch function provided by ReactDOM or React Native. + */ + readonly setBatchNotifyFunction: (fn: BatchNotifyFunction) => void; + readonly setScheduler: (fn: ScheduleFunction) => void; +}; +declare const notifyManager: { + readonly batch: (callback: () => T) => T; + /** + * All calls to the wrapped function will be batched. + */ + readonly batchCalls: >(callback: BatchCallsCallback) => BatchCallsCallback; + readonly schedule: (callback: NotifyCallback) => void; + /** + * Use this method to set a custom notify function. + * This can be used to for example wrap notifications with `React.act` while running tests. + */ + readonly setNotifyFunction: (fn: NotifyFunction) => void; + /** + * Use this method to set a custom function to batch notifications together into a single tick. + * By default React Query will use the batch function provided by ReactDOM or React Native. + */ + readonly setBatchNotifyFunction: (fn: BatchNotifyFunction) => void; + readonly setScheduler: (fn: ScheduleFunction) => void; +}; + +export { createNotifyManager, defaultScheduler, notifyManager }; diff --git a/node_modules/@tanstack/query-core/build/legacy/notifyManager.d.ts b/node_modules/@tanstack/query-core/build/legacy/notifyManager.d.ts new file mode 100644 index 0000000..bd4a370 --- /dev/null +++ b/node_modules/@tanstack/query-core/build/legacy/notifyManager.d.ts @@ -0,0 +1,46 @@ +type NotifyCallback = () => void; +type NotifyFunction = (callback: () => void) => void; +type BatchNotifyFunction = (callback: () => void) => void; +type BatchCallsCallback> = (...args: T) => void; +type ScheduleFunction = (callback: () => void) => void; +declare const defaultScheduler: ScheduleFunction; +declare function createNotifyManager(): { + readonly batch: (callback: () => T) => T; + /** + * All calls to the wrapped function will be batched. + */ + readonly batchCalls: >(callback: BatchCallsCallback) => BatchCallsCallback; + readonly schedule: (callback: NotifyCallback) => void; + /** + * Use this method to set a custom notify function. + * This can be used to for example wrap notifications with `React.act` while running tests. + */ + readonly setNotifyFunction: (fn: NotifyFunction) => void; + /** + * Use this method to set a custom function to batch notifications together into a single tick. + * By default React Query will use the batch function provided by ReactDOM or React Native. + */ + readonly setBatchNotifyFunction: (fn: BatchNotifyFunction) => void; + readonly setScheduler: (fn: ScheduleFunction) => void; +}; +declare const notifyManager: { + readonly batch: (callback: () => T) => T; + /** + * All calls to the wrapped function will be batched. + */ + readonly batchCalls: >(callback: BatchCallsCallback) => BatchCallsCallback; + readonly schedule: (callback: NotifyCallback) => void; + /** + * Use this method to set a custom notify function. + * This can be used to for example wrap notifications with `React.act` while running tests. + */ + readonly setNotifyFunction: (fn: NotifyFunction) => void; + /** + * Use this method to set a custom function to batch notifications together into a single tick. + * By default React Query will use the batch function provided by ReactDOM or React Native. + */ + readonly setBatchNotifyFunction: (fn: BatchNotifyFunction) => void; + readonly setScheduler: (fn: ScheduleFunction) => void; +}; + +export { createNotifyManager, defaultScheduler, notifyManager }; diff --git a/node_modules/@tanstack/query-core/build/legacy/notifyManager.js b/node_modules/@tanstack/query-core/build/legacy/notifyManager.js new file mode 100644 index 0000000..6d95cab --- /dev/null +++ b/node_modules/@tanstack/query-core/build/legacy/notifyManager.js @@ -0,0 +1,88 @@ +import "./chunk-PXG64RU4.js"; + +// src/notifyManager.ts +import { systemSetTimeoutZero } from "./timeoutManager.js"; +var defaultScheduler = systemSetTimeoutZero; +function createNotifyManager() { + let queue = []; + let transactions = 0; + let notifyFn = (callback) => { + callback(); + }; + let batchNotifyFn = (callback) => { + callback(); + }; + let scheduleFn = defaultScheduler; + const schedule = (callback) => { + if (transactions) { + queue.push(callback); + } else { + scheduleFn(() => { + notifyFn(callback); + }); + } + }; + const flush = () => { + const originalQueue = queue; + queue = []; + if (originalQueue.length) { + scheduleFn(() => { + batchNotifyFn(() => { + originalQueue.forEach((callback) => { + notifyFn(callback); + }); + }); + }); + } + }; + return { + batch: (callback) => { + let result; + transactions++; + try { + result = callback(); + } finally { + transactions--; + if (!transactions) { + flush(); + } + } + return result; + }, + /** + * All calls to the wrapped function will be batched. + */ + batchCalls: (callback) => { + return (...args) => { + schedule(() => { + callback(...args); + }); + }; + }, + schedule, + /** + * Use this method to set a custom notify function. + * This can be used to for example wrap notifications with `React.act` while running tests. + */ + setNotifyFunction: (fn) => { + notifyFn = fn; + }, + /** + * Use this method to set a custom function to batch notifications together into a single tick. + * By default React Query will use the batch function provided by ReactDOM or React Native. + */ + setBatchNotifyFunction: (fn) => { + batchNotifyFn = fn; + }, + setScheduler: (fn) => { + scheduleFn = fn; + } + }; +} +var notifyManager = createNotifyManager(); +export { + createNotifyManager, + defaultScheduler, + notifyManager +}; +//# sourceMappingURL=notifyManager.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/notifyManager.js.map b/node_modules/@tanstack/query-core/build/legacy/notifyManager.js.map new file mode 100644 index 0000000..b7d2523 --- /dev/null +++ b/node_modules/@tanstack/query-core/build/legacy/notifyManager.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/notifyManager.ts"],"sourcesContent":["// TYPES\n\nimport { systemSetTimeoutZero } from './timeoutManager'\n\ntype NotifyCallback = () => void\n\ntype NotifyFunction = (callback: () => void) => void\n\ntype BatchNotifyFunction = (callback: () => void) => void\n\ntype BatchCallsCallback> = (...args: T) => void\n\ntype ScheduleFunction = (callback: () => void) => void\n\nexport const defaultScheduler: ScheduleFunction = systemSetTimeoutZero\n\nexport function createNotifyManager() {\n let queue: Array = []\n let transactions = 0\n let notifyFn: NotifyFunction = (callback) => {\n callback()\n }\n let batchNotifyFn: BatchNotifyFunction = (callback: () => void) => {\n callback()\n }\n let scheduleFn = defaultScheduler\n\n const schedule = (callback: NotifyCallback): void => {\n if (transactions) {\n queue.push(callback)\n } else {\n scheduleFn(() => {\n notifyFn(callback)\n })\n }\n }\n const flush = (): void => {\n const originalQueue = queue\n queue = []\n if (originalQueue.length) {\n scheduleFn(() => {\n batchNotifyFn(() => {\n originalQueue.forEach((callback) => {\n notifyFn(callback)\n })\n })\n })\n }\n }\n\n return {\n batch: (callback: () => T): T => {\n let result\n transactions++\n try {\n result = callback()\n } finally {\n transactions--\n if (!transactions) {\n flush()\n }\n }\n return result\n },\n /**\n * All calls to the wrapped function will be batched.\n */\n batchCalls: >(\n callback: BatchCallsCallback,\n ): BatchCallsCallback => {\n return (...args) => {\n schedule(() => {\n callback(...args)\n })\n }\n },\n schedule,\n /**\n * Use this method to set a custom notify function.\n * This can be used to for example wrap notifications with `React.act` while running tests.\n */\n setNotifyFunction: (fn: NotifyFunction) => {\n notifyFn = fn\n },\n /**\n * Use this method to set a custom function to batch notifications together into a single tick.\n * By default React Query will use the batch function provided by ReactDOM or React Native.\n */\n setBatchNotifyFunction: (fn: BatchNotifyFunction) => {\n batchNotifyFn = fn\n },\n setScheduler: (fn: ScheduleFunction) => {\n scheduleFn = fn\n },\n } as const\n}\n\n// SINGLETON\nexport const notifyManager = createNotifyManager()\n"],"mappings":";;;AAEA,SAAS,4BAA4B;AAY9B,IAAM,mBAAqC;AAE3C,SAAS,sBAAsB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end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/onlineManager.cjs b/node_modules/@tanstack/query-core/build/legacy/onlineManager.cjs new file mode 100644 index 0000000..ebbff3d --- /dev/null +++ b/node_modules/@tanstack/query-core/build/legacy/onlineManager.cjs @@ -0,0 +1,97 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __typeError = (msg) => { + throw TypeError(msg); +}; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg); +var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj)); +var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value); +var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value); + +// src/onlineManager.ts +var onlineManager_exports = {}; +__export(onlineManager_exports, { + OnlineManager: () => OnlineManager, + onlineManager: () => onlineManager +}); +module.exports = __toCommonJS(onlineManager_exports); +var import_subscribable = require("./subscribable.cjs"); +var import_utils = require("./utils.cjs"); +var _online, _cleanup, _setup; +var OnlineManager = class extends import_subscribable.Subscribable { + constructor() { + super(); + __privateAdd(this, _online, true); + __privateAdd(this, _cleanup); + __privateAdd(this, _setup); + __privateSet(this, _setup, (onOnline) => { + if (!import_utils.isServer && window.addEventListener) { + const onlineListener = () => onOnline(true); + const offlineListener = () => onOnline(false); + window.addEventListener("online", onlineListener, false); + window.addEventListener("offline", offlineListener, false); + return () => { + window.removeEventListener("online", onlineListener); + window.removeEventListener("offline", offlineListener); + }; + } + return; + }); + } + onSubscribe() { + if (!__privateGet(this, _cleanup)) { + this.setEventListener(__privateGet(this, _setup)); + } + } + onUnsubscribe() { + var _a; + if (!this.hasListeners()) { + (_a = __privateGet(this, _cleanup)) == null ? void 0 : _a.call(this); + __privateSet(this, _cleanup, void 0); + } + } + setEventListener(setup) { + var _a; + __privateSet(this, _setup, setup); + (_a = __privateGet(this, _cleanup)) == null ? void 0 : _a.call(this); + __privateSet(this, _cleanup, setup(this.setOnline.bind(this))); + } + setOnline(online) { + const changed = __privateGet(this, _online) !== online; + if (changed) { + __privateSet(this, _online, online); + this.listeners.forEach((listener) => { + listener(online); + }); + } + } + isOnline() { + return __privateGet(this, _online); + } +}; +_online = new WeakMap(); +_cleanup = new WeakMap(); +_setup = new WeakMap(); +var onlineManager = new OnlineManager(); +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + OnlineManager, + onlineManager +}); +//# sourceMappingURL=onlineManager.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/onlineManager.cjs.map b/node_modules/@tanstack/query-core/build/legacy/onlineManager.cjs.map new file mode 100644 index 0000000..808ee31 --- /dev/null +++ b/node_modules/@tanstack/query-core/build/legacy/onlineManager.cjs.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/onlineManager.ts"],"sourcesContent":["import { Subscribable } from './subscribable'\nimport { isServer } from './utils'\n\ntype Listener = (online: boolean) => void\ntype SetupFn = (setOnline: Listener) => (() => void) | undefined\n\nexport class OnlineManager extends Subscribable {\n #online = true\n #cleanup?: () => void\n\n #setup: SetupFn\n\n constructor() {\n super()\n this.#setup = (onOnline) => {\n // addEventListener does not exist in React Native, but window does\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n if (!isServer && window.addEventListener) {\n const onlineListener = () => onOnline(true)\n const offlineListener = () => onOnline(false)\n // Listen to online\n window.addEventListener('online', onlineListener, false)\n window.addEventListener('offline', offlineListener, false)\n\n return () => {\n // Be sure to unsubscribe if a new handler is set\n window.removeEventListener('online', onlineListener)\n window.removeEventListener('offline', offlineListener)\n }\n }\n\n return\n }\n }\n\n protected onSubscribe(): void {\n if (!this.#cleanup) {\n this.setEventListener(this.#setup)\n }\n }\n\n protected onUnsubscribe() {\n if (!this.hasListeners()) {\n this.#cleanup?.()\n this.#cleanup = undefined\n }\n }\n\n setEventListener(setup: SetupFn): void {\n this.#setup = setup\n this.#cleanup?.()\n this.#cleanup = setup(this.setOnline.bind(this))\n }\n\n setOnline(online: boolean): void {\n const changed = this.#online !== online\n\n if (changed) {\n this.#online = online\n this.listeners.forEach((listener) => {\n listener(online)\n })\n }\n }\n\n isOnline(): boolean {\n return this.#online\n }\n}\n\nexport const onlineManager = new OnlineManager()\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,0BAA6B;AAC7B,mBAAyB;AADzB;AAMO,IAAM,gBAAN,cAA4B,iCAAuB;AAAA,EAMxD,cAAc;AACZ,UAAM;AANR,gCAAU;AACV;AAEA;AAIE,uBAAK,QAAS,CAAC,aAAa;AAG1B,UAAI,CAAC,yBAAY,OAAO,kBAAkB;AACxC,cAAM,iBAAiB,MAAM,SAAS,IAAI;AAC1C,cAAM,kBAAkB,MAAM,SAAS,KAAK;AAE5C,eAAO,iBAAiB,UAAU,gBAAgB,KAAK;AACvD,eAAO,iBAAiB,WAAW,iBAAiB,KAAK;AAEzD,eAAO,MAAM;AAEX,iBAAO,oBAAoB,UAAU,cAAc;AACnD,iBAAO,oBAAoB,WAAW,eAAe;AAAA,QACvD;AAAA,MACF;AAEA;AAAA,IACF;AAAA,EACF;AAAA,EAEU,cAAoB;AAC5B,QAAI,CAAC,mBAAK,WAAU;AAClB,WAAK,iBAAiB,mBAAK,OAAM;AAAA,IACnC;AAAA,EACF;AAAA,EAEU,gBAAgB;AAzC5B;AA0CI,QAAI,CAAC,KAAK,aAAa,GAAG;AACxB,+BAAK,cAAL;AACA,yBAAK,UAAW;AAAA,IAClB;AAAA,EACF;AAAA,EAEA,iBAAiB,OAAsB;AAhDzC;AAiDI,uBAAK,QAAS;AACd,6BAAK,cAAL;AACA,uBAAK,UAAW,MAAM,KAAK,UAAU,KAAK,IAAI,CAAC;AAAA,EACjD;AAAA,EAEA,UAAU,QAAuB;AAC/B,UAAM,UAAU,mBAAK,aAAY;AAEjC,QAAI,SAAS;AACX,yBAAK,SAAU;AACf,WAAK,UAAU,QAAQ,CAAC,aAAa;AACnC,iBAAS,MAAM;AAAA,MACjB,CAAC;AAAA,IACH;AAAA,EACF;AAAA,EAEA,WAAoB;AAClB,WAAO,mBAAK;AAAA,EACd;AACF;AA7DE;AACA;AAEA;AA4DK,IAAM,gBAAgB,IAAI,cAAc;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/onlineManager.d.cts b/node_modules/@tanstack/query-core/build/legacy/onlineManager.d.cts new file mode 100644 index 0000000..dde932b --- /dev/null +++ b/node_modules/@tanstack/query-core/build/legacy/onlineManager.d.cts @@ -0,0 +1,16 @@ +import { Subscribable } from './subscribable.cjs'; + +type Listener = (online: boolean) => void; +type SetupFn = (setOnline: Listener) => (() => void) | undefined; +declare class OnlineManager extends Subscribable { + #private; + constructor(); + protected onSubscribe(): void; + protected onUnsubscribe(): void; + setEventListener(setup: SetupFn): void; + setOnline(online: boolean): void; + isOnline(): boolean; +} +declare const onlineManager: OnlineManager; + +export { OnlineManager, onlineManager }; diff --git a/node_modules/@tanstack/query-core/build/legacy/onlineManager.d.ts b/node_modules/@tanstack/query-core/build/legacy/onlineManager.d.ts new file mode 100644 index 0000000..4362a5c --- /dev/null +++ b/node_modules/@tanstack/query-core/build/legacy/onlineManager.d.ts @@ -0,0 +1,16 @@ +import { Subscribable } from './subscribable.js'; + +type Listener = (online: boolean) => void; +type SetupFn = (setOnline: Listener) => (() => void) | undefined; +declare class OnlineManager extends Subscribable { + #private; + constructor(); + protected onSubscribe(): void; + protected onUnsubscribe(): void; + setEventListener(setup: SetupFn): void; + setOnline(online: boolean): void; + isOnline(): boolean; +} +declare const onlineManager: OnlineManager; + +export { OnlineManager, onlineManager }; diff --git a/node_modules/@tanstack/query-core/build/legacy/onlineManager.js b/node_modules/@tanstack/query-core/build/legacy/onlineManager.js new file mode 100644 index 0000000..97c49dc --- /dev/null +++ b/node_modules/@tanstack/query-core/build/legacy/onlineManager.js @@ -0,0 +1,70 @@ +import { + __privateAdd, + __privateGet, + __privateSet +} from "./chunk-PXG64RU4.js"; + +// src/onlineManager.ts +import { Subscribable } from "./subscribable.js"; +import { isServer } from "./utils.js"; +var _online, _cleanup, _setup; +var OnlineManager = class extends Subscribable { + constructor() { + super(); + __privateAdd(this, _online, true); + __privateAdd(this, _cleanup); + __privateAdd(this, _setup); + __privateSet(this, _setup, (onOnline) => { + if (!isServer && window.addEventListener) { + const onlineListener = () => onOnline(true); + const offlineListener = () => onOnline(false); + window.addEventListener("online", onlineListener, false); + window.addEventListener("offline", offlineListener, false); + return () => { + window.removeEventListener("online", onlineListener); + window.removeEventListener("offline", offlineListener); + }; + } + return; + }); + } + onSubscribe() { + if (!__privateGet(this, _cleanup)) { + this.setEventListener(__privateGet(this, _setup)); + } + } + onUnsubscribe() { + var _a; + if (!this.hasListeners()) { + (_a = __privateGet(this, _cleanup)) == null ? void 0 : _a.call(this); + __privateSet(this, _cleanup, void 0); + } + } + setEventListener(setup) { + var _a; + __privateSet(this, _setup, setup); + (_a = __privateGet(this, _cleanup)) == null ? void 0 : _a.call(this); + __privateSet(this, _cleanup, setup(this.setOnline.bind(this))); + } + setOnline(online) { + const changed = __privateGet(this, _online) !== online; + if (changed) { + __privateSet(this, _online, online); + this.listeners.forEach((listener) => { + listener(online); + }); + } + } + isOnline() { + return __privateGet(this, _online); + } +}; +_online = new WeakMap(); +_cleanup = new WeakMap(); +_setup = new WeakMap(); +var onlineManager = new OnlineManager(); +export { + OnlineManager, + onlineManager +}; +//# sourceMappingURL=onlineManager.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/onlineManager.js.map b/node_modules/@tanstack/query-core/build/legacy/onlineManager.js.map new file mode 100644 index 0000000..92e725d --- /dev/null +++ b/node_modules/@tanstack/query-core/build/legacy/onlineManager.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/onlineManager.ts"],"sourcesContent":["import { Subscribable } from './subscribable'\nimport { isServer } from './utils'\n\ntype Listener = (online: boolean) => void\ntype SetupFn = (setOnline: Listener) => (() => void) | undefined\n\nexport class OnlineManager extends Subscribable {\n #online = true\n #cleanup?: () => void\n\n #setup: SetupFn\n\n constructor() {\n super()\n this.#setup = (onOnline) => {\n // addEventListener does not exist in React Native, but window does\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n if (!isServer && window.addEventListener) {\n const onlineListener = () => onOnline(true)\n const offlineListener = () => onOnline(false)\n // Listen to online\n window.addEventListener('online', onlineListener, false)\n window.addEventListener('offline', offlineListener, false)\n\n return () => {\n // Be sure to unsubscribe if a new handler is set\n window.removeEventListener('online', onlineListener)\n window.removeEventListener('offline', offlineListener)\n }\n }\n\n return\n }\n }\n\n protected onSubscribe(): void {\n if (!this.#cleanup) {\n this.setEventListener(this.#setup)\n }\n }\n\n protected onUnsubscribe() {\n if (!this.hasListeners()) {\n this.#cleanup?.()\n this.#cleanup = undefined\n }\n }\n\n setEventListener(setup: SetupFn): void {\n this.#setup = setup\n this.#cleanup?.()\n this.#cleanup = setup(this.setOnline.bind(this))\n }\n\n setOnline(online: boolean): void {\n const changed = this.#online !== online\n\n if (changed) {\n this.#online = online\n this.listeners.forEach((listener) => {\n listener(online)\n })\n }\n }\n\n isOnline(): boolean {\n return this.#online\n }\n}\n\nexport const onlineManager = new OnlineManager()\n"],"mappings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legacy/queriesObserver.cjs b/node_modules/@tanstack/query-core/build/legacy/queriesObserver.cjs new file mode 100644 index 0000000..e3a3584 --- /dev/null +++ b/node_modules/@tanstack/query-core/build/legacy/queriesObserver.cjs @@ -0,0 +1,260 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __typeError = (msg) => { + throw TypeError(msg); +}; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg); +var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj)); +var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value); +var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value); +var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method); + +// src/queriesObserver.ts +var queriesObserver_exports = {}; +__export(queriesObserver_exports, { + QueriesObserver: () => QueriesObserver +}); +module.exports = __toCommonJS(queriesObserver_exports); +var import_notifyManager = require("./notifyManager.cjs"); +var import_queryObserver = require("./queryObserver.cjs"); +var import_subscribable = require("./subscribable.cjs"); +var import_utils = require("./utils.cjs"); +function difference(array1, array2) { + const excludeSet = new Set(array2); + return array1.filter((x) => !excludeSet.has(x)); +} +function replaceAt(array, index, value) { + const copy = array.slice(0); + copy[index] = value; + return copy; +} +var _client, _result, _queries, _options, _observers, _combinedResult, _lastCombine, _lastResult, _lastQueryHashes, _observerMatches, _QueriesObserver_instances, trackResult_fn, combineResult_fn, findMatchingObservers_fn, onUpdate_fn, notify_fn; +var QueriesObserver = class extends import_subscribable.Subscribable { + constructor(client, queries, options) { + super(); + __privateAdd(this, _QueriesObserver_instances); + __privateAdd(this, _client); + __privateAdd(this, _result); + __privateAdd(this, _queries); + __privateAdd(this, _options); + __privateAdd(this, _observers); + __privateAdd(this, _combinedResult); + __privateAdd(this, _lastCombine); + __privateAdd(this, _lastResult); + __privateAdd(this, _lastQueryHashes); + __privateAdd(this, _observerMatches, []); + __privateSet(this, _client, client); + __privateSet(this, _options, options); + __privateSet(this, _queries, []); + __privateSet(this, _observers, []); + __privateSet(this, _result, []); + this.setQueries(queries); + } + onSubscribe() { + if (this.listeners.size === 1) { + __privateGet(this, _observers).forEach((observer) => { + observer.subscribe((result) => { + __privateMethod(this, _QueriesObserver_instances, onUpdate_fn).call(this, observer, result); + }); + }); + } + } + onUnsubscribe() { + if (!this.listeners.size) { + this.destroy(); + } + } + destroy() { + this.listeners = /* @__PURE__ */ new Set(); + __privateGet(this, _observers).forEach((observer) => { + observer.destroy(); + }); + } + setQueries(queries, options) { + __privateSet(this, _queries, queries); + __privateSet(this, _options, options); + if (process.env.NODE_ENV !== "production") { + const queryHashes = queries.map( + (query) => __privateGet(this, _client).defaultQueryOptions(query).queryHash + ); + if (new Set(queryHashes).size !== queryHashes.length) { + console.warn( + "[QueriesObserver]: Duplicate Queries found. This might result in unexpected behavior." + ); + } + } + import_notifyManager.notifyManager.batch(() => { + const prevObservers = __privateGet(this, _observers); + const newObserverMatches = __privateMethod(this, _QueriesObserver_instances, findMatchingObservers_fn).call(this, __privateGet(this, _queries)); + newObserverMatches.forEach( + (match) => match.observer.setOptions(match.defaultedQueryOptions) + ); + const newObservers = newObserverMatches.map((match) => match.observer); + const newResult = newObservers.map( + (observer) => observer.getCurrentResult() + ); + const hasLengthChange = prevObservers.length !== newObservers.length; + const hasIndexChange = newObservers.some( + (observer, index) => observer !== prevObservers[index] + ); + const hasStructuralChange = hasLengthChange || hasIndexChange; + const hasResultChange = hasStructuralChange ? true : newResult.some((result, index) => { + const prev = __privateGet(this, _result)[index]; + return !prev || !(0, import_utils.shallowEqualObjects)(result, prev); + }); + if (!hasStructuralChange && !hasResultChange) return; + if (hasStructuralChange) { + __privateSet(this, _observerMatches, newObserverMatches); + __privateSet(this, _observers, newObservers); + } + __privateSet(this, _result, newResult); + if (!this.hasListeners()) return; + if (hasStructuralChange) { + difference(prevObservers, newObservers).forEach((observer) => { + observer.destroy(); + }); + difference(newObservers, prevObservers).forEach((observer) => { + observer.subscribe((result) => { + __privateMethod(this, _QueriesObserver_instances, onUpdate_fn).call(this, observer, result); + }); + }); + } + __privateMethod(this, _QueriesObserver_instances, notify_fn).call(this); + }); + } + getCurrentResult() { + return __privateGet(this, _result); + } + getQueries() { + return __privateGet(this, _observers).map((observer) => observer.getCurrentQuery()); + } + getObservers() { + return __privateGet(this, _observers); + } + getOptimisticResult(queries, combine) { + const matches = __privateMethod(this, _QueriesObserver_instances, findMatchingObservers_fn).call(this, queries); + const result = matches.map( + (match) => match.observer.getOptimisticResult(match.defaultedQueryOptions) + ); + const queryHashes = matches.map( + (match) => match.defaultedQueryOptions.queryHash + ); + return [ + result, + (r) => { + return __privateMethod(this, _QueriesObserver_instances, combineResult_fn).call(this, r ?? result, combine, queryHashes); + }, + () => { + return __privateMethod(this, _QueriesObserver_instances, trackResult_fn).call(this, result, matches); + } + ]; + } +}; +_client = new WeakMap(); +_result = new WeakMap(); +_queries = new WeakMap(); +_options = new WeakMap(); +_observers = new WeakMap(); +_combinedResult = new WeakMap(); +_lastCombine = new WeakMap(); +_lastResult = new WeakMap(); +_lastQueryHashes = new WeakMap(); +_observerMatches = new WeakMap(); +_QueriesObserver_instances = new WeakSet(); +trackResult_fn = function(result, matches) { + return matches.map((match, index) => { + const observerResult = result[index]; + return !match.defaultedQueryOptions.notifyOnChangeProps ? match.observer.trackResult(observerResult, (accessedProp) => { + matches.forEach((m) => { + m.observer.trackProp(accessedProp); + }); + }) : observerResult; + }); +}; +combineResult_fn = function(input, combine, queryHashes) { + if (combine) { + const lastHashes = __privateGet(this, _lastQueryHashes); + const queryHashesChanged = queryHashes !== void 0 && lastHashes !== void 0 && (lastHashes.length !== queryHashes.length || queryHashes.some((hash, i) => hash !== lastHashes[i])); + if (!__privateGet(this, _combinedResult) || __privateGet(this, _result) !== __privateGet(this, _lastResult) || queryHashesChanged || combine !== __privateGet(this, _lastCombine)) { + __privateSet(this, _lastCombine, combine); + __privateSet(this, _lastResult, __privateGet(this, _result)); + if (queryHashes !== void 0) { + __privateSet(this, _lastQueryHashes, queryHashes); + } + __privateSet(this, _combinedResult, (0, import_utils.replaceEqualDeep)( + __privateGet(this, _combinedResult), + combine(input) + )); + } + return __privateGet(this, _combinedResult); + } + return input; +}; +findMatchingObservers_fn = function(queries) { + const prevObserversMap = /* @__PURE__ */ new Map(); + __privateGet(this, _observers).forEach((observer) => { + const key = observer.options.queryHash; + if (!key) return; + const previousObservers = prevObserversMap.get(key); + if (previousObservers) { + previousObservers.push(observer); + } else { + prevObserversMap.set(key, [observer]); + } + }); + const observers = []; + queries.forEach((options) => { + var _a; + const defaultedOptions = __privateGet(this, _client).defaultQueryOptions(options); + const match = (_a = prevObserversMap.get(defaultedOptions.queryHash)) == null ? void 0 : _a.shift(); + const observer = match ?? new import_queryObserver.QueryObserver(__privateGet(this, _client), defaultedOptions); + observers.push({ + defaultedQueryOptions: defaultedOptions, + observer + }); + }); + return observers; +}; +onUpdate_fn = function(observer, result) { + const index = __privateGet(this, _observers).indexOf(observer); + if (index !== -1) { + __privateSet(this, _result, replaceAt(__privateGet(this, _result), index, result)); + __privateMethod(this, _QueriesObserver_instances, notify_fn).call(this); + } +}; +notify_fn = function() { + var _a; + if (this.hasListeners()) { + const previousResult = __privateGet(this, _combinedResult); + const newTracked = __privateMethod(this, _QueriesObserver_instances, trackResult_fn).call(this, __privateGet(this, _result), __privateGet(this, _observerMatches)); + const newResult = __privateMethod(this, _QueriesObserver_instances, combineResult_fn).call(this, newTracked, (_a = __privateGet(this, _options)) == null ? void 0 : _a.combine); + if (previousResult !== newResult) { + import_notifyManager.notifyManager.batch(() => { + this.listeners.forEach((listener) => { + listener(__privateGet(this, _result)); + }); + }); + } + } +}; +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + QueriesObserver +}); +//# sourceMappingURL=queriesObserver.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/queriesObserver.cjs.map b/node_modules/@tanstack/query-core/build/legacy/queriesObserver.cjs.map new file mode 100644 index 0000000..da13e46 --- /dev/null +++ b/node_modules/@tanstack/query-core/build/legacy/queriesObserver.cjs.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/queriesObserver.ts"],"sourcesContent":["import { notifyManager } from './notifyManager'\nimport { QueryObserver } from './queryObserver'\nimport { Subscribable } from './subscribable'\nimport { replaceEqualDeep, shallowEqualObjects } from './utils'\nimport type {\n DefaultedQueryObserverOptions,\n QueryObserverOptions,\n QueryObserverResult,\n} from './types'\nimport type { QueryClient } from './queryClient'\n\nfunction difference(array1: Array, array2: Array): Array {\n const excludeSet = new Set(array2)\n return array1.filter((x) => !excludeSet.has(x))\n}\n\nfunction replaceAt(array: Array, index: number, value: T): Array {\n const copy = array.slice(0)\n copy[index] = value\n return copy\n}\n\ntype QueriesObserverListener = (result: Array) => void\n\ntype CombineFn = (\n result: Array,\n) => TCombinedResult\n\nexport interface QueriesObserverOptions<\n TCombinedResult = Array,\n> {\n combine?: CombineFn\n}\n\nexport class QueriesObserver<\n TCombinedResult = Array,\n> extends Subscribable {\n #client: QueryClient\n #result!: Array\n #queries: Array\n #options?: QueriesObserverOptions\n #observers: Array\n #combinedResult?: TCombinedResult\n #lastCombine?: CombineFn\n #lastResult?: Array\n #lastQueryHashes?: Array\n #observerMatches: Array = []\n\n constructor(\n client: QueryClient,\n queries: Array>,\n options?: QueriesObserverOptions,\n ) {\n super()\n\n this.#client = client\n this.#options = options\n this.#queries = []\n this.#observers = []\n this.#result = []\n\n this.setQueries(queries)\n }\n\n protected onSubscribe(): void {\n if (this.listeners.size === 1) {\n this.#observers.forEach((observer) => {\n observer.subscribe((result) => {\n this.#onUpdate(observer, result)\n })\n })\n }\n }\n\n protected onUnsubscribe(): void {\n if (!this.listeners.size) {\n this.destroy()\n }\n }\n\n destroy(): void {\n this.listeners = new Set()\n this.#observers.forEach((observer) => {\n observer.destroy()\n })\n }\n\n setQueries(\n queries: Array,\n options?: QueriesObserverOptions,\n ): void {\n this.#queries = queries\n this.#options = options\n\n if (process.env.NODE_ENV !== 'production') {\n const queryHashes = queries.map(\n (query) => this.#client.defaultQueryOptions(query).queryHash,\n )\n if (new Set(queryHashes).size !== queryHashes.length) {\n console.warn(\n '[QueriesObserver]: Duplicate Queries found. This might result in unexpected behavior.',\n )\n }\n }\n\n notifyManager.batch(() => {\n const prevObservers = this.#observers\n\n const newObserverMatches = this.#findMatchingObservers(this.#queries)\n\n // set options for the new observers to notify of changes\n newObserverMatches.forEach((match) =>\n match.observer.setOptions(match.defaultedQueryOptions),\n )\n\n const newObservers = newObserverMatches.map((match) => match.observer)\n const newResult = newObservers.map((observer) =>\n observer.getCurrentResult(),\n )\n\n const hasLengthChange = prevObservers.length !== newObservers.length\n const hasIndexChange = newObservers.some(\n (observer, index) => observer !== prevObservers[index],\n )\n const hasStructuralChange = hasLengthChange || hasIndexChange\n\n const hasResultChange = hasStructuralChange\n ? true\n : newResult.some((result, index) => {\n const prev = this.#result[index]\n return !prev || !shallowEqualObjects(result, prev)\n })\n\n if (!hasStructuralChange && !hasResultChange) return\n\n if (hasStructuralChange) {\n this.#observerMatches = newObserverMatches\n this.#observers = newObservers\n }\n\n this.#result = newResult\n\n if (!this.hasListeners()) return\n\n if (hasStructuralChange) {\n difference(prevObservers, newObservers).forEach((observer) => {\n observer.destroy()\n })\n difference(newObservers, prevObservers).forEach((observer) => {\n observer.subscribe((result) => {\n this.#onUpdate(observer, result)\n })\n })\n }\n\n this.#notify()\n })\n }\n\n getCurrentResult(): Array {\n return this.#result\n }\n\n getQueries() {\n return this.#observers.map((observer) => observer.getCurrentQuery())\n }\n\n getObservers() {\n return this.#observers\n }\n\n getOptimisticResult(\n queries: Array,\n combine: CombineFn | undefined,\n ): [\n rawResult: Array,\n combineResult: (r?: Array) => TCombinedResult,\n trackResult: () => Array,\n ] {\n const matches = this.#findMatchingObservers(queries)\n const result = matches.map((match) =>\n match.observer.getOptimisticResult(match.defaultedQueryOptions),\n )\n const queryHashes = matches.map(\n (match) => match.defaultedQueryOptions.queryHash,\n )\n\n return [\n result,\n (r?: Array) => {\n return this.#combineResult(r ?? result, combine, queryHashes)\n },\n () => {\n return this.#trackResult(result, matches)\n },\n ]\n }\n\n #trackResult(\n result: Array,\n matches: Array,\n ) {\n return matches.map((match, index) => {\n const observerResult = result[index]!\n return !match.defaultedQueryOptions.notifyOnChangeProps\n ? match.observer.trackResult(observerResult, (accessedProp) => {\n // track property on all observers to ensure proper (synchronized) tracking (#7000)\n matches.forEach((m) => {\n m.observer.trackProp(accessedProp)\n })\n })\n : observerResult\n })\n }\n\n #combineResult(\n input: Array,\n combine: CombineFn | undefined,\n queryHashes?: Array,\n ): TCombinedResult {\n if (combine) {\n const lastHashes = this.#lastQueryHashes\n const queryHashesChanged =\n queryHashes !== undefined &&\n lastHashes !== undefined &&\n (lastHashes.length !== queryHashes.length ||\n queryHashes.some((hash, i) => hash !== lastHashes[i]))\n\n if (\n !this.#combinedResult ||\n this.#result !== this.#lastResult ||\n queryHashesChanged ||\n combine !== this.#lastCombine\n ) {\n this.#lastCombine = combine\n this.#lastResult = this.#result\n\n if (queryHashes !== undefined) {\n this.#lastQueryHashes = queryHashes\n }\n this.#combinedResult = replaceEqualDeep(\n this.#combinedResult,\n combine(input),\n )\n }\n\n return this.#combinedResult\n }\n return input as any\n }\n\n #findMatchingObservers(\n queries: Array,\n ): Array {\n const prevObserversMap = new Map>()\n\n this.#observers.forEach((observer) => {\n const key = observer.options.queryHash\n if (!key) return\n\n const previousObservers = prevObserversMap.get(key)\n\n if (previousObservers) {\n previousObservers.push(observer)\n } else {\n prevObserversMap.set(key, [observer])\n }\n })\n\n const observers: Array = []\n\n queries.forEach((options) => {\n const defaultedOptions = this.#client.defaultQueryOptions(options)\n const match = prevObserversMap.get(defaultedOptions.queryHash)?.shift()\n const observer =\n match ?? new QueryObserver(this.#client, defaultedOptions)\n\n observers.push({\n defaultedQueryOptions: defaultedOptions,\n observer,\n })\n })\n\n return observers\n }\n\n #onUpdate(observer: QueryObserver, result: QueryObserverResult): void {\n const index = this.#observers.indexOf(observer)\n if (index !== -1) {\n this.#result = replaceAt(this.#result, index, result)\n this.#notify()\n }\n }\n\n #notify(): void {\n if (this.hasListeners()) {\n const previousResult = this.#combinedResult\n const newTracked = this.#trackResult(this.#result, this.#observerMatches)\n const newResult = this.#combineResult(newTracked, this.#options?.combine)\n\n if (previousResult !== newResult) {\n notifyManager.batch(() => {\n this.listeners.forEach((listener) => {\n listener(this.#result)\n })\n })\n }\n }\n }\n}\n\ntype QueryObserverMatch = {\n defaultedQueryOptions: DefaultedQueryObserverOptions\n observer: QueryObserver\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,2BAA8B;AAC9B,2BAA8B;AAC9B,0BAA6B;AAC7B,mBAAsD;AAQtD,SAAS,WAAc,QAAkB,QAA4B;AACnE,QAAM,aAAa,IAAI,IAAI,MAAM;AACjC,SAAO,OAAO,OAAO,CAAC,MAAM,CAAC,WAAW,IAAI,CAAC,CAAC;AAChD;AAEA,SAAS,UAAa,OAAiB,OAAe,OAAoB;AACxE,QAAM,OAAO,MAAM,MAAM,CAAC;AAC1B,OAAK,KAAK,IAAI;AACd,SAAO;AACT;AApBA;AAkCO,IA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QAAO;AAAA,QACvB,CAAC;AAAA,MACH,CAAC;AAAA,IACH;AAAA,EACF;AACF;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/queriesObserver.d.cts b/node_modules/@tanstack/query-core/build/legacy/queriesObserver.d.cts new file mode 100644 index 0000000..cc16e52 --- /dev/null +++ b/node_modules/@tanstack/query-core/build/legacy/queriesObserver.d.cts @@ -0,0 +1,27 @@ +import { aH as QueryObserverResult, g as QueryClient, ag as QueryObserverOptions, z as Query, i as QueryObserver } from './hydration-uphG6M-i.cjs'; +import { Subscribable } from './subscribable.cjs'; +import './removable.cjs'; + +type QueriesObserverListener = (result: Array) => void; +type CombineFn = (result: Array) => TCombinedResult; +interface QueriesObserverOptions> { + combine?: CombineFn; +} +declare class QueriesObserver> extends Subscribable { + #private; + constructor(client: QueryClient, queries: Array>, options?: QueriesObserverOptions); + protected onSubscribe(): void; + protected onUnsubscribe(): void; + destroy(): void; + setQueries(queries: Array, options?: QueriesObserverOptions): void; + getCurrentResult(): Array; + getQueries(): Query[]; + getObservers(): QueryObserver[]; + getOptimisticResult(queries: Array, combine: CombineFn | undefined): [ + rawResult: Array, + combineResult: (r?: Array) => TCombinedResult, + trackResult: () => Array + ]; +} + +export { QueriesObserver, type QueriesObserverOptions }; diff --git a/node_modules/@tanstack/query-core/build/legacy/queriesObserver.d.ts b/node_modules/@tanstack/query-core/build/legacy/queriesObserver.d.ts new file mode 100644 index 0000000..82a6b8f --- /dev/null +++ b/node_modules/@tanstack/query-core/build/legacy/queriesObserver.d.ts @@ -0,0 +1,27 @@ +import { aH as QueryObserverResult, g as QueryClient, ag as QueryObserverOptions, z as Query, i as QueryObserver } from './hydration-BlEVG2Lp.js'; +import { Subscribable } from './subscribable.js'; +import './removable.js'; + +type QueriesObserverListener = (result: Array) => void; +type CombineFn = (result: Array) => TCombinedResult; +interface QueriesObserverOptions> { + combine?: CombineFn; +} +declare class QueriesObserver> extends Subscribable { + #private; + constructor(client: QueryClient, queries: Array>, options?: QueriesObserverOptions); + protected onSubscribe(): void; + protected onUnsubscribe(): void; + destroy(): void; + setQueries(queries: Array, options?: QueriesObserverOptions): void; + getCurrentResult(): Array; + getQueries(): Query[]; + getObservers(): QueryObserver[]; + getOptimisticResult(queries: Array, combine: CombineFn | undefined): [ + rawResult: Array, + combineResult: (r?: Array) => TCombinedResult, + trackResult: () => Array + ]; +} + +export { QueriesObserver, type QueriesObserverOptions }; diff --git a/node_modules/@tanstack/query-core/build/legacy/queriesObserver.js b/node_modules/@tanstack/query-core/build/legacy/queriesObserver.js new file mode 100644 index 0000000..38026fe --- /dev/null +++ b/node_modules/@tanstack/query-core/build/legacy/queriesObserver.js @@ -0,0 +1,234 @@ +import { + __privateAdd, + __privateGet, + __privateMethod, + __privateSet +} from "./chunk-PXG64RU4.js"; + +// src/queriesObserver.ts +import { notifyManager } from "./notifyManager.js"; +import { QueryObserver } from "./queryObserver.js"; +import { Subscribable } from "./subscribable.js"; +import { replaceEqualDeep, shallowEqualObjects } from "./utils.js"; +function difference(array1, array2) { + const excludeSet = new Set(array2); + return array1.filter((x) => !excludeSet.has(x)); +} +function replaceAt(array, index, value) { + const copy = array.slice(0); + copy[index] = value; + return copy; +} +var _client, _result, _queries, _options, _observers, _combinedResult, _lastCombine, _lastResult, _lastQueryHashes, _observerMatches, _QueriesObserver_instances, trackResult_fn, combineResult_fn, findMatchingObservers_fn, onUpdate_fn, notify_fn; +var QueriesObserver = class extends Subscribable { + constructor(client, queries, options) { + super(); + __privateAdd(this, _QueriesObserver_instances); + __privateAdd(this, _client); + __privateAdd(this, _result); + __privateAdd(this, _queries); + __privateAdd(this, _options); + __privateAdd(this, _observers); + __privateAdd(this, _combinedResult); + __privateAdd(this, _lastCombine); + __privateAdd(this, _lastResult); + __privateAdd(this, _lastQueryHashes); + __privateAdd(this, _observerMatches, []); + __privateSet(this, _client, client); + __privateSet(this, _options, options); + __privateSet(this, _queries, []); + __privateSet(this, _observers, []); + __privateSet(this, _result, []); + this.setQueries(queries); + } + onSubscribe() { + if (this.listeners.size === 1) { + __privateGet(this, _observers).forEach((observer) => { + observer.subscribe((result) => { + __privateMethod(this, _QueriesObserver_instances, onUpdate_fn).call(this, observer, result); + }); + }); + } + } + onUnsubscribe() { + if (!this.listeners.size) { + this.destroy(); + } + } + destroy() { + this.listeners = /* @__PURE__ */ new Set(); + __privateGet(this, _observers).forEach((observer) => { + observer.destroy(); + }); + } + setQueries(queries, options) { + __privateSet(this, _queries, queries); + __privateSet(this, _options, options); + if (process.env.NODE_ENV !== "production") { + const queryHashes = queries.map( + (query) => __privateGet(this, _client).defaultQueryOptions(query).queryHash + ); + if (new Set(queryHashes).size !== queryHashes.length) { + console.warn( + "[QueriesObserver]: Duplicate Queries found. This might result in unexpected behavior." + ); + } + } + notifyManager.batch(() => { + const prevObservers = __privateGet(this, _observers); + const newObserverMatches = __privateMethod(this, _QueriesObserver_instances, findMatchingObservers_fn).call(this, __privateGet(this, _queries)); + newObserverMatches.forEach( + (match) => match.observer.setOptions(match.defaultedQueryOptions) + ); + const newObservers = newObserverMatches.map((match) => match.observer); + const newResult = newObservers.map( + (observer) => observer.getCurrentResult() + ); + const hasLengthChange = prevObservers.length !== newObservers.length; + const hasIndexChange = newObservers.some( + (observer, index) => observer !== prevObservers[index] + ); + const hasStructuralChange = hasLengthChange || hasIndexChange; + const hasResultChange = hasStructuralChange ? true : newResult.some((result, index) => { + const prev = __privateGet(this, _result)[index]; + return !prev || !shallowEqualObjects(result, prev); + }); + if (!hasStructuralChange && !hasResultChange) return; + if (hasStructuralChange) { + __privateSet(this, _observerMatches, newObserverMatches); + __privateSet(this, _observers, newObservers); + } + __privateSet(this, _result, newResult); + if (!this.hasListeners()) return; + if (hasStructuralChange) { + difference(prevObservers, newObservers).forEach((observer) => { + observer.destroy(); + }); + difference(newObservers, prevObservers).forEach((observer) => { + observer.subscribe((result) => { + __privateMethod(this, _QueriesObserver_instances, onUpdate_fn).call(this, observer, result); + }); + }); + } + __privateMethod(this, _QueriesObserver_instances, notify_fn).call(this); + }); + } + getCurrentResult() { + return __privateGet(this, _result); + } + getQueries() { + return __privateGet(this, _observers).map((observer) => observer.getCurrentQuery()); + } + getObservers() { + return __privateGet(this, _observers); + } + getOptimisticResult(queries, combine) { + const matches = __privateMethod(this, _QueriesObserver_instances, findMatchingObservers_fn).call(this, queries); + const result = matches.map( + (match) => match.observer.getOptimisticResult(match.defaultedQueryOptions) + ); + const queryHashes = matches.map( + (match) => match.defaultedQueryOptions.queryHash + ); + return [ + result, + (r) => { + return __privateMethod(this, _QueriesObserver_instances, combineResult_fn).call(this, r ?? result, combine, queryHashes); + }, + () => { + return __privateMethod(this, _QueriesObserver_instances, trackResult_fn).call(this, result, matches); + } + ]; + } +}; +_client = new WeakMap(); +_result = new WeakMap(); +_queries = new WeakMap(); +_options = new WeakMap(); +_observers = new WeakMap(); +_combinedResult = new WeakMap(); +_lastCombine = new WeakMap(); +_lastResult = new WeakMap(); +_lastQueryHashes = new WeakMap(); +_observerMatches = new WeakMap(); +_QueriesObserver_instances = new WeakSet(); +trackResult_fn = function(result, matches) { + return matches.map((match, index) => { + const observerResult = result[index]; + return !match.defaultedQueryOptions.notifyOnChangeProps ? match.observer.trackResult(observerResult, (accessedProp) => { + matches.forEach((m) => { + m.observer.trackProp(accessedProp); + }); + }) : observerResult; + }); +}; +combineResult_fn = function(input, combine, queryHashes) { + if (combine) { + const lastHashes = __privateGet(this, _lastQueryHashes); + const queryHashesChanged = queryHashes !== void 0 && lastHashes !== void 0 && (lastHashes.length !== queryHashes.length || queryHashes.some((hash, i) => hash !== lastHashes[i])); + if (!__privateGet(this, _combinedResult) || __privateGet(this, _result) !== __privateGet(this, _lastResult) || queryHashesChanged || combine !== __privateGet(this, _lastCombine)) { + __privateSet(this, _lastCombine, combine); + __privateSet(this, _lastResult, __privateGet(this, _result)); + if (queryHashes !== void 0) { + __privateSet(this, _lastQueryHashes, queryHashes); + } + __privateSet(this, _combinedResult, replaceEqualDeep( + __privateGet(this, _combinedResult), + combine(input) + )); + } + return __privateGet(this, _combinedResult); + } + return input; +}; +findMatchingObservers_fn = function(queries) { + const prevObserversMap = /* @__PURE__ */ new Map(); + __privateGet(this, _observers).forEach((observer) => { + const key = observer.options.queryHash; + if (!key) return; + const previousObservers = prevObserversMap.get(key); + if (previousObservers) { + previousObservers.push(observer); + } else { + prevObserversMap.set(key, [observer]); + } + }); + const observers = []; + queries.forEach((options) => { + var _a; + const defaultedOptions = __privateGet(this, _client).defaultQueryOptions(options); + const match = (_a = prevObserversMap.get(defaultedOptions.queryHash)) == null ? void 0 : _a.shift(); + const observer = match ?? new QueryObserver(__privateGet(this, _client), defaultedOptions); + observers.push({ + defaultedQueryOptions: defaultedOptions, + observer + }); + }); + return observers; +}; +onUpdate_fn = function(observer, result) { + const index = __privateGet(this, _observers).indexOf(observer); + if (index !== -1) { + __privateSet(this, _result, replaceAt(__privateGet(this, _result), index, result)); + __privateMethod(this, _QueriesObserver_instances, notify_fn).call(this); + } +}; +notify_fn = function() { + var _a; + if (this.hasListeners()) { + const previousResult = __privateGet(this, _combinedResult); + const newTracked = __privateMethod(this, _QueriesObserver_instances, trackResult_fn).call(this, __privateGet(this, _result), __privateGet(this, _observerMatches)); + const newResult = __privateMethod(this, _QueriesObserver_instances, combineResult_fn).call(this, newTracked, (_a = __privateGet(this, _options)) == null ? void 0 : _a.combine); + if (previousResult !== newResult) { + notifyManager.batch(() => { + this.listeners.forEach((listener) => { + listener(__privateGet(this, _result)); + }); + }); + } + } +}; +export { + QueriesObserver +}; +//# sourceMappingURL=queriesObserver.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/queriesObserver.js.map b/node_modules/@tanstack/query-core/build/legacy/queriesObserver.js.map new file mode 100644 index 0000000..7ca9b2f --- /dev/null +++ b/node_modules/@tanstack/query-core/build/legacy/queriesObserver.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/queriesObserver.ts"],"sourcesContent":["import { notifyManager } from './notifyManager'\nimport { QueryObserver } from './queryObserver'\nimport { Subscribable } from './subscribable'\nimport { replaceEqualDeep, shallowEqualObjects } from './utils'\nimport type {\n DefaultedQueryObserverOptions,\n QueryObserverOptions,\n QueryObserverResult,\n} from './types'\nimport type { QueryClient } from './queryClient'\n\nfunction difference(array1: Array, array2: Array): Array {\n const excludeSet = new Set(array2)\n return array1.filter((x) => !excludeSet.has(x))\n}\n\nfunction replaceAt(array: Array, index: number, value: T): Array {\n const copy = array.slice(0)\n copy[index] = value\n return copy\n}\n\ntype QueriesObserverListener = (result: Array) => void\n\ntype CombineFn = (\n result: Array,\n) => TCombinedResult\n\nexport interface QueriesObserverOptions<\n TCombinedResult = Array,\n> {\n combine?: CombineFn\n}\n\nexport class QueriesObserver<\n TCombinedResult = Array,\n> extends Subscribable {\n #client: QueryClient\n #result!: Array\n #queries: Array\n #options?: QueriesObserverOptions\n #observers: Array\n #combinedResult?: TCombinedResult\n #lastCombine?: CombineFn\n #lastResult?: Array\n #lastQueryHashes?: Array\n #observerMatches: Array = []\n\n constructor(\n client: QueryClient,\n queries: Array>,\n options?: QueriesObserverOptions,\n ) {\n super()\n\n this.#client = client\n this.#options = options\n this.#queries = []\n this.#observers = []\n this.#result = []\n\n this.setQueries(queries)\n }\n\n protected onSubscribe(): void {\n if (this.listeners.size === 1) {\n this.#observers.forEach((observer) => {\n observer.subscribe((result) => {\n this.#onUpdate(observer, result)\n })\n })\n }\n }\n\n protected onUnsubscribe(): void {\n if (!this.listeners.size) {\n this.destroy()\n }\n }\n\n destroy(): void {\n this.listeners = new Set()\n this.#observers.forEach((observer) => {\n observer.destroy()\n })\n }\n\n setQueries(\n queries: Array,\n options?: QueriesObserverOptions,\n ): void {\n this.#queries = queries\n this.#options = options\n\n if (process.env.NODE_ENV !== 'production') {\n const queryHashes = queries.map(\n (query) => this.#client.defaultQueryOptions(query).queryHash,\n )\n if (new Set(queryHashes).size !== queryHashes.length) {\n console.warn(\n '[QueriesObserver]: Duplicate Queries found. This might result in unexpected behavior.',\n )\n }\n }\n\n notifyManager.batch(() => {\n const prevObservers = this.#observers\n\n const newObserverMatches = this.#findMatchingObservers(this.#queries)\n\n // set options for the new observers to notify of changes\n newObserverMatches.forEach((match) =>\n match.observer.setOptions(match.defaultedQueryOptions),\n )\n\n const newObservers = newObserverMatches.map((match) => match.observer)\n const newResult = newObservers.map((observer) =>\n observer.getCurrentResult(),\n )\n\n const hasLengthChange = prevObservers.length !== newObservers.length\n const hasIndexChange = newObservers.some(\n (observer, index) => observer !== prevObservers[index],\n )\n const hasStructuralChange = hasLengthChange || hasIndexChange\n\n const hasResultChange = hasStructuralChange\n ? true\n : newResult.some((result, index) => {\n const prev = this.#result[index]\n return !prev || !shallowEqualObjects(result, prev)\n })\n\n if (!hasStructuralChange && !hasResultChange) return\n\n if (hasStructuralChange) {\n this.#observerMatches = newObserverMatches\n this.#observers = newObservers\n }\n\n this.#result = newResult\n\n if (!this.hasListeners()) return\n\n if (hasStructuralChange) {\n difference(prevObservers, newObservers).forEach((observer) => {\n observer.destroy()\n })\n difference(newObservers, prevObservers).forEach((observer) => {\n observer.subscribe((result) => {\n this.#onUpdate(observer, result)\n })\n })\n }\n\n this.#notify()\n })\n }\n\n getCurrentResult(): Array {\n return this.#result\n }\n\n getQueries() {\n return this.#observers.map((observer) => observer.getCurrentQuery())\n }\n\n getObservers() {\n return this.#observers\n }\n\n getOptimisticResult(\n queries: Array,\n combine: CombineFn | undefined,\n ): [\n rawResult: Array,\n combineResult: (r?: Array) => TCombinedResult,\n trackResult: () => Array,\n ] {\n const matches = this.#findMatchingObservers(queries)\n const result = matches.map((match) =>\n match.observer.getOptimisticResult(match.defaultedQueryOptions),\n )\n const queryHashes = matches.map(\n (match) => match.defaultedQueryOptions.queryHash,\n )\n\n return [\n result,\n (r?: Array) => {\n return this.#combineResult(r ?? result, combine, queryHashes)\n },\n () => {\n return this.#trackResult(result, matches)\n },\n ]\n }\n\n #trackResult(\n result: Array,\n matches: Array,\n ) {\n return matches.map((match, index) => {\n const observerResult = result[index]!\n return !match.defaultedQueryOptions.notifyOnChangeProps\n ? match.observer.trackResult(observerResult, (accessedProp) => {\n // track property on all observers to ensure proper (synchronized) tracking (#7000)\n matches.forEach((m) => {\n m.observer.trackProp(accessedProp)\n })\n })\n : observerResult\n })\n }\n\n #combineResult(\n input: Array,\n combine: CombineFn | undefined,\n queryHashes?: Array,\n ): TCombinedResult {\n if (combine) {\n const lastHashes = this.#lastQueryHashes\n const queryHashesChanged =\n queryHashes !== undefined &&\n lastHashes !== undefined &&\n (lastHashes.length !== queryHashes.length ||\n queryHashes.some((hash, i) => hash !== lastHashes[i]))\n\n if (\n !this.#combinedResult ||\n this.#result !== this.#lastResult ||\n queryHashesChanged ||\n combine !== this.#lastCombine\n ) {\n this.#lastCombine = combine\n this.#lastResult = this.#result\n\n if (queryHashes !== undefined) {\n this.#lastQueryHashes = queryHashes\n }\n this.#combinedResult = replaceEqualDeep(\n this.#combinedResult,\n combine(input),\n )\n }\n\n return this.#combinedResult\n }\n return input as any\n }\n\n #findMatchingObservers(\n queries: Array,\n ): Array {\n const prevObserversMap = new Map>()\n\n this.#observers.forEach((observer) => {\n const key = observer.options.queryHash\n if (!key) return\n\n const previousObservers = prevObserversMap.get(key)\n\n if (previousObservers) {\n previousObservers.push(observer)\n } else {\n prevObserversMap.set(key, [observer])\n }\n })\n\n const observers: Array = []\n\n queries.forEach((options) => {\n const defaultedOptions = this.#client.defaultQueryOptions(options)\n const match = prevObserversMap.get(defaultedOptions.queryHash)?.shift()\n const observer =\n match ?? new QueryObserver(this.#client, defaultedOptions)\n\n observers.push({\n defaultedQueryOptions: defaultedOptions,\n observer,\n })\n })\n\n return observers\n }\n\n #onUpdate(observer: QueryObserver, result: QueryObserverResult): void {\n const index = this.#observers.indexOf(observer)\n if (index !== -1) {\n this.#result = replaceAt(this.#result, index, result)\n this.#notify()\n }\n }\n\n #notify(): void {\n if (this.hasListeners()) {\n const previousResult = this.#combinedResult\n const newTracked = this.#trackResult(this.#result, this.#observerMatches)\n const newResult = this.#combineResult(newTracked, this.#options?.combine)\n\n if (previousResult !== newResult) {\n notifyManager.batch(() => {\n this.listeners.forEach((listener) => {\n listener(this.#result)\n })\n })\n }\n }\n }\n}\n\ntype QueryObserverMatch = {\n defaultedQueryOptions: DefaultedQueryObserverOptions\n observer: QueryObserver\n}\n"],"mappings":";;;;;;;;AAAA,SAAS,qBAAqB;AAC9B,SAAS,qBAAqB;AAC9B,SAAS,oBAAoB;AAC7B,SAAS,kBAAkB,2BAA2B;AAQtD,SAAS,WAAc,QAAkB,QAA4B;AACnE,QAAM,aAAa,IAAI,IAAI,MAAM;AACjC,SAAO,OAAO,OAAO,CAAC,MAAM,CAAC,WAAW,IAAI,CAAC,CAAC;AAChD;AAEA,SAAS,UAAa,OAAiB,OAAe,OAAoB;AACxE,QAAM,OAAO,MAAM,MAAM,CAAC;AAC1B,OAAK,KAAK,IAAI;AACd,SAAO;AACT;AApBA;AAkCO,IAAM,kBAAN,cAEG,aAAsC;AAAA,EAY9C,YACE,QACA,SACA,SACA;AACA,UAAM;AAnBH;AAGL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yCAA8C,CAAC;AAS7C,uBAAK,SAAU;AACf,uBAAK,UAAW;AAChB,uBAAK,UAAW,CAAC;AACjB,uBAAK,YAAa,CAAC;AACnB,uBAAK,SAAU,CAAC;AAEhB,SAAK,WAAW,OAAO;AAAA,EACzB;AAAA,EAEU,cAAoB;AAC5B,QAAI,KAAK,UAAU,SAAS,GAAG;AAC7B,yBAAK,YAAW,QAAQ,CAAC,aAAa;AACpC,iBAAS,UAAU,CAAC,WAAW;AAC7B,gCAAK,yCAAL,WAAe,UAAU;AAAA,QAC3B,CAAC;AAAA,MACH,CAAC;AAAA,IACH;AAAA,EACF;AAAA,EAEU,gBAAsB;AAC9B,QAAI,CAAC,KAAK,UAAU,MAAM;AACxB,WAAK,QAAQ;AAAA,IACf;AAAA,EACF;AAAA,EAEA,UAAgB;AACd,SAAK,YA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MACb,uBAAuB;AAAA,MACvB;AAAA,IACF,CAAC;AAAA,EACH,CAAC;AAED,SAAO;AACT;AAEA,cAAS,SAAC,UAAyB,QAAmC;AACpE,QAAM,QAAQ,mBAAK,YAAW,QAAQ,QAAQ;AAC9C,MAAI,UAAU,IAAI;AAChB,uBAAK,SAAU,UAAU,mBAAK,UAAS,OAAO,MAAM;AACpD,0BAAK,uCAAL;AAAA,EACF;AACF;AAEA,YAAO,WAAS;AAtSlB;AAuSI,MAAI,KAAK,aAAa,GAAG;AACvB,UAAM,iBAAiB,mBAAK;AAC5B,UAAM,aAAa,sBAAK,4CAAL,WAAkB,mBAAK,UAAS,mBAAK;AACxD,UAAM,YAAY,sBAAK,8CAAL,WAAoB,aAAY,wBAAK,cAAL,mBAAe;AAEjE,QAAI,mBAAmB,WAAW;AAChC,oBAAc,MAAM,MAAM;AACxB,aAAK,UAAU,QAAQ,CAAC,aAAa;AACnC,mBAAS,mBAAK,QAAO;AAAA,QACvB,CAAC;AAAA,MACH,CAAC;AAAA,IACH;AAAA,EACF;AACF;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/query.cjs b/node_modules/@tanstack/query-core/build/legacy/query.cjs new file mode 100644 index 0000000..6033f4e --- /dev/null +++ b/node_modules/@tanstack/query-core/build/legacy/query.cjs @@ -0,0 +1,478 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __typeError = (msg) => { + throw TypeError(msg); +}; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg); +var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj)); +var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value); +var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value); +var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method); + +// src/query.ts +var query_exports = {}; +__export(query_exports, { + Query: () => Query, + fetchState: () => fetchState +}); +module.exports = __toCommonJS(query_exports); +var import_utils = require("./utils.cjs"); +var import_notifyManager = require("./notifyManager.cjs"); +var import_retryer = require("./retryer.cjs"); +var import_removable = require("./removable.cjs"); +var _initialState, _revertState, _cache, _client, _retryer, _defaultOptions, _abortSignalConsumed, _Query_instances, dispatch_fn; +var Query = class extends import_removable.Removable { + constructor(config) { + super(); + __privateAdd(this, _Query_instances); + __privateAdd(this, _initialState); + __privateAdd(this, _revertState); + __privateAdd(this, _cache); + __privateAdd(this, _client); + __privateAdd(this, _retryer); + __privateAdd(this, _defaultOptions); + __privateAdd(this, _abortSignalConsumed); + __privateSet(this, _abortSignalConsumed, false); + __privateSet(this, _defaultOptions, config.defaultOptions); + this.setOptions(config.options); + this.observers = []; + __privateSet(this, _client, config.client); + __privateSet(this, _cache, __privateGet(this, _client).getQueryCache()); + this.queryKey = config.queryKey; + this.queryHash = config.queryHash; + __privateSet(this, _initialState, getDefaultState(this.options)); + this.state = config.state ?? __privateGet(this, _initialState); + this.scheduleGc(); + } + get meta() { + return this.options.meta; + } + get promise() { + var _a; + return (_a = __privateGet(this, _retryer)) == null ? void 0 : _a.promise; + } + setOptions(options) { + this.options = { ...__privateGet(this, _defaultOptions), ...options }; + this.updateGcTime(this.options.gcTime); + if (this.state && this.state.data === void 0) { + const defaultState = getDefaultState(this.options); + if (defaultState.data !== void 0) { + this.setState( + successState(defaultState.data, defaultState.dataUpdatedAt) + ); + __privateSet(this, _initialState, defaultState); + } + } + } + optionalRemove() { + if (!this.observers.length && this.state.fetchStatus === "idle") { + __privateGet(this, _cache).remove(this); + } + } + setData(newData, options) { + const data = (0, import_utils.replaceData)(this.state.data, newData, this.options); + __privateMethod(this, _Query_instances, dispatch_fn).call(this, { + data, + type: "success", + dataUpdatedAt: options == null ? void 0 : options.updatedAt, + manual: options == null ? void 0 : options.manual + }); + return data; + } + setState(state, setStateOptions) { + __privateMethod(this, _Query_instances, dispatch_fn).call(this, { type: "setState", state, setStateOptions }); + } + cancel(options) { + var _a, _b; + const promise = (_a = __privateGet(this, _retryer)) == null ? void 0 : _a.promise; + (_b = __privateGet(this, _retryer)) == null ? void 0 : _b.cancel(options); + return promise ? promise.then(import_utils.noop).catch(import_utils.noop) : Promise.resolve(); + } + destroy() { + super.destroy(); + this.cancel({ silent: true }); + } + reset() { + this.destroy(); + this.setState(__privateGet(this, _initialState)); + } + isActive() { + return this.observers.some( + (observer) => (0, import_utils.resolveEnabled)(observer.options.enabled, this) !== false + ); + } + isDisabled() { + if (this.getObserversCount() > 0) { + return !this.isActive(); + } + return this.options.queryFn === import_utils.skipToken || this.state.dataUpdateCount + this.state.errorUpdateCount === 0; + } + isStatic() { + if (this.getObserversCount() > 0) { + return this.observers.some( + (observer) => (0, import_utils.resolveStaleTime)(observer.options.staleTime, this) === "static" + ); + } + return false; + } + isStale() { + if (this.getObserversCount() > 0) { + return this.observers.some( + (observer) => observer.getCurrentResult().isStale + ); + } + return this.state.data === void 0 || this.state.isInvalidated; + } + isStaleByTime(staleTime = 0) { + if (this.state.data === void 0) { + return true; + } + if (staleTime === "static") { + return false; + } + if (this.state.isInvalidated) { + return true; + } + return !(0, import_utils.timeUntilStale)(this.state.dataUpdatedAt, staleTime); + } + onFocus() { + var _a; + const observer = this.observers.find((x) => x.shouldFetchOnWindowFocus()); + observer == null ? void 0 : observer.refetch({ cancelRefetch: false }); + (_a = __privateGet(this, _retryer)) == null ? void 0 : _a.continue(); + } + onOnline() { + var _a; + const observer = this.observers.find((x) => x.shouldFetchOnReconnect()); + observer == null ? void 0 : observer.refetch({ cancelRefetch: false }); + (_a = __privateGet(this, _retryer)) == null ? void 0 : _a.continue(); + } + addObserver(observer) { + if (!this.observers.includes(observer)) { + this.observers.push(observer); + this.clearGcTimeout(); + __privateGet(this, _cache).notify({ type: "observerAdded", query: this, observer }); + } + } + removeObserver(observer) { + if (this.observers.includes(observer)) { + this.observers = this.observers.filter((x) => x !== observer); + if (!this.observers.length) { + if (__privateGet(this, _retryer)) { + if (__privateGet(this, _abortSignalConsumed)) { + __privateGet(this, _retryer).cancel({ revert: true }); + } else { + __privateGet(this, _retryer).cancelRetry(); + } + } + this.scheduleGc(); + } + __privateGet(this, _cache).notify({ type: "observerRemoved", query: this, observer }); + } + } + getObserversCount() { + return this.observers.length; + } + invalidate() { + if (!this.state.isInvalidated) { + __privateMethod(this, _Query_instances, dispatch_fn).call(this, { type: "invalidate" }); + } + } + async fetch(options, fetchOptions) { + var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l; + if (this.state.fetchStatus !== "idle" && // If the promise in the retryer is already rejected, we have to definitely + // re-start the fetch; there is a chance that the query is still in a + // pending state when that happens + ((_a = __privateGet(this, _retryer)) == null ? void 0 : _a.status()) !== "rejected") { + if (this.state.data !== void 0 && (fetchOptions == null ? void 0 : fetchOptions.cancelRefetch)) { + this.cancel({ silent: true }); + } else if (__privateGet(this, _retryer)) { + __privateGet(this, _retryer).continueRetry(); + return __privateGet(this, _retryer).promise; + } + } + if (options) { + this.setOptions(options); + } + if (!this.options.queryFn) { + const observer = this.observers.find((x) => x.options.queryFn); + if (observer) { + this.setOptions(observer.options); + } + } + if (process.env.NODE_ENV !== "production") { + if (!Array.isArray(this.options.queryKey)) { + console.error( + `As of v4, queryKey needs to be an Array. If you are using a string like 'repoData', please change it to an Array, e.g. ['repoData']` + ); + } + } + const abortController = new AbortController(); + const addSignalProperty = (object) => { + Object.defineProperty(object, "signal", { + enumerable: true, + get: () => { + __privateSet(this, _abortSignalConsumed, true); + return abortController.signal; + } + }); + }; + const fetchFn = () => { + const queryFn = (0, import_utils.ensureQueryFn)(this.options, fetchOptions); + const createQueryFnContext = () => { + const queryFnContext2 = { + client: __privateGet(this, _client), + queryKey: this.queryKey, + meta: this.meta + }; + addSignalProperty(queryFnContext2); + return queryFnContext2; + }; + const queryFnContext = createQueryFnContext(); + __privateSet(this, _abortSignalConsumed, false); + if (this.options.persister) { + return this.options.persister( + queryFn, + queryFnContext, + this + ); + } + return queryFn(queryFnContext); + }; + const createFetchContext = () => { + const context2 = { + fetchOptions, + options: this.options, + queryKey: this.queryKey, + client: __privateGet(this, _client), + state: this.state, + fetchFn + }; + addSignalProperty(context2); + return context2; + }; + const context = createFetchContext(); + (_b = this.options.behavior) == null ? void 0 : _b.onFetch(context, this); + __privateSet(this, _revertState, this.state); + if (this.state.fetchStatus === "idle" || this.state.fetchMeta !== ((_c = context.fetchOptions) == null ? void 0 : _c.meta)) { + __privateMethod(this, _Query_instances, dispatch_fn).call(this, { type: "fetch", meta: (_d = context.fetchOptions) == null ? void 0 : _d.meta }); + } + __privateSet(this, _retryer, (0, import_retryer.createRetryer)({ + initialPromise: fetchOptions == null ? void 0 : fetchOptions.initialPromise, + fn: context.fetchFn, + onCancel: (error) => { + if (error instanceof import_retryer.CancelledError && error.revert) { + this.setState({ + ...__privateGet(this, _revertState), + fetchStatus: "idle" + }); + } + abortController.abort(); + }, + onFail: (failureCount, error) => { + __privateMethod(this, _Query_instances, dispatch_fn).call(this, { type: "failed", failureCount, error }); + }, + onPause: () => { + __privateMethod(this, _Query_instances, dispatch_fn).call(this, { type: "pause" }); + }, + onContinue: () => { + __privateMethod(this, _Query_instances, dispatch_fn).call(this, { type: "continue" }); + }, + retry: context.options.retry, + retryDelay: context.options.retryDelay, + networkMode: context.options.networkMode, + canRun: () => true + })); + try { + const data = await __privateGet(this, _retryer).start(); + if (data === void 0) { + if (process.env.NODE_ENV !== "production") { + console.error( + `Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}` + ); + } + throw new Error(`${this.queryHash} data is undefined`); + } + this.setData(data); + (_f = (_e = __privateGet(this, _cache).config).onSuccess) == null ? void 0 : _f.call(_e, data, this); + (_h = (_g = __privateGet(this, _cache).config).onSettled) == null ? void 0 : _h.call( + _g, + data, + this.state.error, + this + ); + return data; + } catch (error) { + if (error instanceof import_retryer.CancelledError) { + if (error.silent) { + return __privateGet(this, _retryer).promise; + } else if (error.revert) { + if (this.state.data === void 0) { + throw error; + } + return this.state.data; + } + } + __privateMethod(this, _Query_instances, dispatch_fn).call(this, { + type: "error", + error + }); + (_j = (_i = __privateGet(this, _cache).config).onError) == null ? void 0 : _j.call( + _i, + error, + this + ); + (_l = (_k = __privateGet(this, _cache).config).onSettled) == null ? void 0 : _l.call( + _k, + this.state.data, + error, + this + ); + throw error; + } finally { + this.scheduleGc(); + } + } +}; +_initialState = new WeakMap(); +_revertState = new WeakMap(); +_cache = new WeakMap(); +_client = new WeakMap(); +_retryer = new WeakMap(); +_defaultOptions = new WeakMap(); +_abortSignalConsumed = new WeakMap(); +_Query_instances = new WeakSet(); +dispatch_fn = function(action) { + const reducer = (state) => { + switch (action.type) { + case "failed": + return { + ...state, + fetchFailureCount: action.failureCount, + fetchFailureReason: action.error + }; + case "pause": + return { + ...state, + fetchStatus: "paused" + }; + case "continue": + return { + ...state, + fetchStatus: "fetching" + }; + case "fetch": + return { + ...state, + ...fetchState(state.data, this.options), + fetchMeta: action.meta ?? null + }; + case "success": + const newState = { + ...state, + ...successState(action.data, action.dataUpdatedAt), + dataUpdateCount: state.dataUpdateCount + 1, + ...!action.manual && { + fetchStatus: "idle", + fetchFailureCount: 0, + fetchFailureReason: null + } + }; + __privateSet(this, _revertState, action.manual ? newState : void 0); + return newState; + case "error": + const error = action.error; + return { + ...state, + error, + errorUpdateCount: state.errorUpdateCount + 1, + errorUpdatedAt: Date.now(), + fetchFailureCount: state.fetchFailureCount + 1, + fetchFailureReason: error, + fetchStatus: "idle", + status: "error", + // flag existing data as invalidated if we get a background error + // note that "no data" always means stale so we can set unconditionally here + isInvalidated: true + }; + case "invalidate": + return { + ...state, + isInvalidated: true + }; + case "setState": + return { + ...state, + ...action.state + }; + } + }; + this.state = reducer(this.state); + import_notifyManager.notifyManager.batch(() => { + this.observers.forEach((observer) => { + observer.onQueryUpdate(); + }); + __privateGet(this, _cache).notify({ query: this, type: "updated", action }); + }); +}; +function fetchState(data, options) { + return { + fetchFailureCount: 0, + fetchFailureReason: null, + fetchStatus: (0, import_retryer.canFetch)(options.networkMode) ? "fetching" : "paused", + ...data === void 0 && { + error: null, + status: "pending" + } + }; +} +function successState(data, dataUpdatedAt) { + return { + data, + dataUpdatedAt: dataUpdatedAt ?? Date.now(), + error: null, + isInvalidated: false, + status: "success" + }; +} +function getDefaultState(options) { + const data = typeof options.initialData === "function" ? options.initialData() : options.initialData; + const hasData = data !== void 0; + const initialDataUpdatedAt = hasData ? typeof options.initialDataUpdatedAt === "function" ? options.initialDataUpdatedAt() : options.initialDataUpdatedAt : 0; + return { + data, + dataUpdateCount: 0, + dataUpdatedAt: hasData ? initialDataUpdatedAt ?? Date.now() : 0, + error: null, + errorUpdateCount: 0, + errorUpdatedAt: 0, + fetchFailureCount: 0, + fetchFailureReason: null, + fetchMeta: null, + isInvalidated: false, + status: hasData ? "success" : "pending", + fetchStatus: "idle" + }; +} +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + Query, + fetchState +}); +//# sourceMappingURL=query.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/query.cjs.map b/node_modules/@tanstack/query-core/build/legacy/query.cjs.map new file mode 100644 index 0000000..5784850 --- /dev/null +++ b/node_modules/@tanstack/query-core/build/legacy/query.cjs.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/query.ts"],"sourcesContent":["import {\n ensureQueryFn,\n noop,\n replaceData,\n resolveEnabled,\n resolveStaleTime,\n skipToken,\n timeUntilStale,\n} from './utils'\nimport { notifyManager } from './notifyManager'\nimport { CancelledError, canFetch, createRetryer } from './retryer'\nimport { Removable } from './removable'\nimport type { QueryCache } from './queryCache'\nimport type { QueryClient } from './queryClient'\nimport type {\n CancelOptions,\n DefaultError,\n FetchStatus,\n InitialDataFunction,\n OmitKeyof,\n QueryFunctionContext,\n QueryKey,\n QueryMeta,\n QueryOptions,\n QueryStatus,\n SetDataOptions,\n StaleTime,\n} from './types'\nimport type { QueryObserver } from './queryObserver'\nimport type { Retryer } from './retryer'\n\n// TYPES\n\ninterface QueryConfig<\n TQueryFnData,\n TError,\n TData,\n TQueryKey extends QueryKey = QueryKey,\n> {\n client: QueryClient\n queryKey: TQueryKey\n queryHash: string\n options?: QueryOptions\n defaultOptions?: QueryOptions\n state?: QueryState\n}\n\nexport interface QueryState {\n data: TData | undefined\n dataUpdateCount: number\n dataUpdatedAt: number\n error: TError | null\n errorUpdateCount: number\n errorUpdatedAt: number\n fetchFailureCount: number\n fetchFailureReason: TError | null\n fetchMeta: FetchMeta | null\n isInvalidated: boolean\n status: QueryStatus\n fetchStatus: FetchStatus\n}\n\nexport interface FetchContext<\n TQueryFnData,\n TError,\n TData,\n TQueryKey extends QueryKey = QueryKey,\n> {\n fetchFn: () => unknown | Promise\n fetchOptions?: FetchOptions\n signal: AbortSignal\n options: QueryOptions\n client: QueryClient\n queryKey: TQueryKey\n state: QueryState\n}\n\nexport interface QueryBehavior<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> {\n onFetch: (\n context: FetchContext,\n query: Query,\n ) => void\n}\n\nexport type FetchDirection = 'forward' | 'backward'\n\nexport interface FetchMeta {\n fetchMore?: { direction: FetchDirection }\n}\n\nexport interface FetchOptions {\n cancelRefetch?: boolean\n meta?: FetchMeta\n initialPromise?: Promise\n}\n\ninterface FailedAction {\n type: 'failed'\n failureCount: number\n error: TError\n}\n\ninterface FetchAction {\n type: 'fetch'\n meta?: FetchMeta\n}\n\ninterface SuccessAction {\n data: TData | undefined\n type: 'success'\n dataUpdatedAt?: number\n manual?: boolean\n}\n\ninterface ErrorAction {\n type: 'error'\n error: TError\n}\n\ninterface InvalidateAction {\n type: 'invalidate'\n}\n\ninterface PauseAction {\n type: 'pause'\n}\n\ninterface ContinueAction {\n type: 'continue'\n}\n\ninterface SetStateAction {\n type: 'setState'\n state: Partial>\n setStateOptions?: SetStateOptions\n}\n\nexport type Action =\n | ContinueAction\n | ErrorAction\n | FailedAction\n | FetchAction\n | InvalidateAction\n | PauseAction\n | SetStateAction\n | SuccessAction\n\nexport interface SetStateOptions {\n meta?: any\n}\n\n// CLASS\n\nexport class Query<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> extends Removable {\n queryKey: TQueryKey\n queryHash: string\n options!: QueryOptions\n state: QueryState\n\n #initialState: QueryState\n #revertState?: QueryState\n #cache: QueryCache\n #client: QueryClient\n #retryer?: Retryer\n observers: Array>\n #defaultOptions?: QueryOptions\n #abortSignalConsumed: boolean\n\n constructor(config: QueryConfig) {\n super()\n\n this.#abortSignalConsumed = false\n this.#defaultOptions = config.defaultOptions\n this.setOptions(config.options)\n this.observers = []\n this.#client = config.client\n this.#cache = this.#client.getQueryCache()\n this.queryKey = config.queryKey\n this.queryHash = config.queryHash\n this.#initialState = getDefaultState(this.options)\n this.state = config.state ?? this.#initialState\n this.scheduleGc()\n }\n get meta(): QueryMeta | undefined {\n return this.options.meta\n }\n\n get promise(): Promise | undefined {\n return this.#retryer?.promise\n }\n\n setOptions(\n options?: QueryOptions,\n ): void {\n this.options = { ...this.#defaultOptions, ...options }\n\n this.updateGcTime(this.options.gcTime)\n\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n if (this.state && this.state.data === undefined) {\n const defaultState = getDefaultState(this.options)\n if (defaultState.data !== undefined) {\n this.setState(\n successState(defaultState.data, defaultState.dataUpdatedAt),\n )\n this.#initialState = defaultState\n }\n }\n }\n\n protected optionalRemove() {\n if (!this.observers.length && this.state.fetchStatus === 'idle') {\n this.#cache.remove(this)\n }\n }\n\n setData(\n newData: TData,\n options?: SetDataOptions & { manual: boolean },\n ): TData {\n const data = replaceData(this.state.data, newData, this.options)\n\n // Set data and mark it as cached\n this.#dispatch({\n data,\n type: 'success',\n dataUpdatedAt: options?.updatedAt,\n manual: options?.manual,\n })\n\n return data\n }\n\n setState(\n state: Partial>,\n setStateOptions?: SetStateOptions,\n ): void {\n this.#dispatch({ type: 'setState', state, setStateOptions })\n }\n\n cancel(options?: CancelOptions): Promise {\n const promise = this.#retryer?.promise\n this.#retryer?.cancel(options)\n return promise ? promise.then(noop).catch(noop) : Promise.resolve()\n }\n\n destroy(): void {\n super.destroy()\n\n this.cancel({ silent: true })\n }\n\n reset(): void {\n this.destroy()\n this.setState(this.#initialState)\n }\n\n isActive(): boolean {\n return this.observers.some(\n (observer) => resolveEnabled(observer.options.enabled, this) !== false,\n )\n }\n\n isDisabled(): boolean {\n if (this.getObserversCount() > 0) {\n return !this.isActive()\n }\n // if a query has no observers, it should still be considered disabled if it never attempted a fetch\n return (\n this.options.queryFn === skipToken ||\n this.state.dataUpdateCount + this.state.errorUpdateCount === 0\n )\n }\n\n isStatic(): boolean {\n if (this.getObserversCount() > 0) {\n return this.observers.some(\n (observer) =>\n resolveStaleTime(observer.options.staleTime, this) === 'static',\n )\n }\n\n return false\n }\n\n isStale(): boolean {\n // check observers first, their `isStale` has the source of truth\n // calculated with `isStaleByTime` and it takes `enabled` into account\n if (this.getObserversCount() > 0) {\n return this.observers.some(\n (observer) => observer.getCurrentResult().isStale,\n )\n }\n\n return this.state.data === undefined || this.state.isInvalidated\n }\n\n isStaleByTime(staleTime: StaleTime = 0): boolean {\n // no data is always stale\n if (this.state.data === undefined) {\n return true\n }\n // static is never stale\n if (staleTime === 'static') {\n return false\n }\n // if the query is invalidated, it is stale\n if (this.state.isInvalidated) {\n return true\n }\n\n return !timeUntilStale(this.state.dataUpdatedAt, staleTime)\n }\n\n onFocus(): void {\n const observer = this.observers.find((x) => x.shouldFetchOnWindowFocus())\n\n observer?.refetch({ cancelRefetch: false })\n\n // Continue fetch if currently paused\n this.#retryer?.continue()\n }\n\n onOnline(): void {\n const observer = this.observers.find((x) => x.shouldFetchOnReconnect())\n\n observer?.refetch({ cancelRefetch: false })\n\n // Continue fetch if currently paused\n this.#retryer?.continue()\n }\n\n addObserver(observer: QueryObserver): void {\n if (!this.observers.includes(observer)) {\n this.observers.push(observer)\n\n // Stop the query from being garbage collected\n this.clearGcTimeout()\n\n this.#cache.notify({ type: 'observerAdded', query: this, observer })\n }\n }\n\n removeObserver(observer: QueryObserver): void {\n if (this.observers.includes(observer)) {\n this.observers = this.observers.filter((x) => x !== observer)\n\n if (!this.observers.length) {\n // If the transport layer does not support cancellation\n // we'll let the query continue so the result can be cached\n if (this.#retryer) {\n if (this.#abortSignalConsumed) {\n this.#retryer.cancel({ revert: true })\n } else {\n this.#retryer.cancelRetry()\n }\n }\n\n this.scheduleGc()\n }\n\n this.#cache.notify({ type: 'observerRemoved', query: this, observer })\n }\n }\n\n getObserversCount(): number {\n return this.observers.length\n }\n\n invalidate(): void {\n if (!this.state.isInvalidated) {\n this.#dispatch({ type: 'invalidate' })\n }\n }\n\n async fetch(\n options?: QueryOptions,\n fetchOptions?: FetchOptions,\n ): Promise {\n if (\n this.state.fetchStatus !== 'idle' &&\n // If the promise in the retryer is already rejected, we have to definitely\n // re-start the fetch; there is a chance that the query is still in a\n // pending state when that happens\n this.#retryer?.status() !== 'rejected'\n ) {\n if (this.state.data !== undefined && fetchOptions?.cancelRefetch) {\n // Silently cancel current fetch if the user wants to cancel refetch\n this.cancel({ silent: true })\n } else if (this.#retryer) {\n // make sure that retries that were potentially cancelled due to unmounts can continue\n this.#retryer.continueRetry()\n // Return current promise if we are already fetching\n return this.#retryer.promise\n }\n }\n\n // Update config if passed, otherwise the config from the last execution is used\n if (options) {\n this.setOptions(options)\n }\n\n // Use the options from the first observer with a query function if no function is found.\n // This can happen when the query is hydrated or created with setQueryData.\n if (!this.options.queryFn) {\n const observer = this.observers.find((x) => x.options.queryFn)\n if (observer) {\n this.setOptions(observer.options)\n }\n }\n\n if (process.env.NODE_ENV !== 'production') {\n if (!Array.isArray(this.options.queryKey)) {\n console.error(\n `As of v4, queryKey needs to be an Array. If you are using a string like 'repoData', please change it to an Array, e.g. ['repoData']`,\n )\n }\n }\n\n const abortController = new AbortController()\n\n // Adds an enumerable signal property to the object that\n // which sets abortSignalConsumed to true when the signal\n // is read.\n const addSignalProperty = (object: unknown) => {\n Object.defineProperty(object, 'signal', {\n enumerable: true,\n get: () => {\n this.#abortSignalConsumed = true\n return abortController.signal\n },\n })\n }\n\n // Create fetch function\n const fetchFn = () => {\n const queryFn = ensureQueryFn(this.options, fetchOptions)\n\n // Create query function context\n const createQueryFnContext = (): QueryFunctionContext => {\n const queryFnContext: OmitKeyof<\n QueryFunctionContext,\n 'signal'\n > = {\n client: this.#client,\n queryKey: this.queryKey,\n meta: this.meta,\n }\n addSignalProperty(queryFnContext)\n return queryFnContext as QueryFunctionContext\n }\n\n const queryFnContext = createQueryFnContext()\n\n this.#abortSignalConsumed = false\n if (this.options.persister) {\n return this.options.persister(\n queryFn,\n queryFnContext,\n this as unknown as Query,\n )\n }\n\n return queryFn(queryFnContext)\n }\n\n // Trigger behavior hook\n const createFetchContext = (): FetchContext<\n TQueryFnData,\n TError,\n TData,\n TQueryKey\n > => {\n const context: OmitKeyof<\n FetchContext,\n 'signal'\n > = {\n fetchOptions,\n options: this.options,\n queryKey: this.queryKey,\n client: this.#client,\n state: this.state,\n fetchFn,\n }\n\n addSignalProperty(context)\n return context as FetchContext\n }\n\n const context = createFetchContext()\n\n this.options.behavior?.onFetch(context, this as unknown as Query)\n\n // Store state in case the current fetch needs to be reverted\n this.#revertState = this.state\n\n // Set to fetching state if not already in it\n if (\n this.state.fetchStatus === 'idle' ||\n this.state.fetchMeta !== context.fetchOptions?.meta\n ) {\n this.#dispatch({ type: 'fetch', meta: context.fetchOptions?.meta })\n }\n\n // Try to fetch the data\n this.#retryer = createRetryer({\n initialPromise: fetchOptions?.initialPromise as\n | Promise\n | undefined,\n fn: context.fetchFn as () => Promise,\n onCancel: (error) => {\n if (error instanceof CancelledError && error.revert) {\n this.setState({\n ...this.#revertState,\n fetchStatus: 'idle' as const,\n })\n }\n abortController.abort()\n },\n onFail: (failureCount, error) => {\n this.#dispatch({ type: 'failed', failureCount, error })\n },\n onPause: () => {\n this.#dispatch({ type: 'pause' })\n },\n onContinue: () => {\n this.#dispatch({ type: 'continue' })\n },\n retry: context.options.retry,\n retryDelay: context.options.retryDelay,\n networkMode: context.options.networkMode,\n canRun: () => true,\n })\n\n try {\n const data = await this.#retryer.start()\n // this is more of a runtime guard\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n if (data === undefined) {\n if (process.env.NODE_ENV !== 'production') {\n console.error(\n `Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}`,\n )\n }\n throw new Error(`${this.queryHash} data is undefined`)\n }\n\n this.setData(data)\n\n // Notify cache callback\n this.#cache.config.onSuccess?.(data, this as Query)\n this.#cache.config.onSettled?.(\n data,\n this.state.error as any,\n this as Query,\n )\n return data\n } catch (error) {\n if (error instanceof CancelledError) {\n if (error.silent) {\n // silent cancellation implies a new fetch is going to be started,\n // so we piggyback onto that promise\n return this.#retryer.promise\n } else if (error.revert) {\n // transform error into reverted state data\n // if the initial fetch was cancelled, we have no data, so we have\n // to get reject with a CancelledError\n if (this.state.data === undefined) {\n throw error\n }\n return this.state.data\n }\n }\n this.#dispatch({\n type: 'error',\n error: error as TError,\n })\n\n // Notify cache callback\n this.#cache.config.onError?.(\n error as any,\n this as Query,\n )\n this.#cache.config.onSettled?.(\n this.state.data,\n error as any,\n this as Query,\n )\n\n throw error // rethrow the error for further handling\n } finally {\n // Schedule query gc after fetching\n this.scheduleGc()\n }\n }\n\n #dispatch(action: Action): void {\n const reducer = (\n state: QueryState,\n ): QueryState => {\n switch (action.type) {\n case 'failed':\n return {\n ...state,\n fetchFailureCount: action.failureCount,\n fetchFailureReason: action.error,\n }\n case 'pause':\n return {\n ...state,\n fetchStatus: 'paused',\n }\n case 'continue':\n return {\n ...state,\n fetchStatus: 'fetching',\n }\n case 'fetch':\n return {\n ...state,\n ...fetchState(state.data, this.options),\n fetchMeta: action.meta ?? null,\n }\n case 'success':\n const newState = {\n ...state,\n ...successState(action.data, action.dataUpdatedAt),\n dataUpdateCount: state.dataUpdateCount + 1,\n ...(!action.manual && {\n fetchStatus: 'idle' as const,\n fetchFailureCount: 0,\n fetchFailureReason: null,\n }),\n }\n // If fetching ends successfully, we don't need revertState as a fallback anymore.\n // For manual updates, capture the state to revert to it in case of a cancellation.\n this.#revertState = action.manual ? newState : undefined\n\n return newState\n case 'error':\n const error = action.error\n return {\n ...state,\n error,\n errorUpdateCount: state.errorUpdateCount + 1,\n errorUpdatedAt: Date.now(),\n fetchFailureCount: state.fetchFailureCount + 1,\n fetchFailureReason: error,\n fetchStatus: 'idle',\n status: 'error',\n // flag existing data as invalidated if we get a background error\n // note that \"no data\" always means stale so we can set unconditionally here\n isInvalidated: true,\n }\n case 'invalidate':\n return {\n ...state,\n isInvalidated: true,\n }\n case 'setState':\n return {\n ...state,\n ...action.state,\n }\n }\n }\n\n this.state = reducer(this.state)\n\n notifyManager.batch(() => {\n this.observers.forEach((observer) => {\n observer.onQueryUpdate()\n })\n\n this.#cache.notify({ query: this, type: 'updated', action })\n })\n }\n}\n\nexport function fetchState<\n TQueryFnData,\n TError,\n TData,\n TQueryKey extends QueryKey,\n>(\n data: TData | undefined,\n options: QueryOptions,\n) {\n return {\n fetchFailureCount: 0,\n fetchFailureReason: null,\n fetchStatus: canFetch(options.networkMode) ? 'fetching' : 'paused',\n ...(data === undefined &&\n ({\n error: null,\n status: 'pending',\n } as const)),\n } as const\n}\n\nfunction successState(data: TData | undefined, dataUpdatedAt?: number) {\n return {\n data,\n dataUpdatedAt: dataUpdatedAt ?? Date.now(),\n error: null,\n isInvalidated: false,\n status: 'success' as const,\n }\n}\n\nfunction getDefaultState<\n TQueryFnData,\n TError,\n TData,\n TQueryKey extends QueryKey,\n>(\n options: QueryOptions,\n): QueryState {\n const data =\n typeof options.initialData === 'function'\n ? (options.initialData as InitialDataFunction)()\n : options.initialData\n\n const hasData = data !== undefined\n\n const initialDataUpdatedAt = hasData\n ? typeof options.initialDataUpdatedAt === 'function'\n ? options.initialDataUpdatedAt()\n : options.initialDataUpdatedAt\n : 0\n\n return {\n data,\n dataUpdateCount: 0,\n dataUpdatedAt: hasData ? (initialDataUpdatedAt ?? Date.now()) : 0,\n error: null,\n errorUpdateCount: 0,\n errorUpdatedAt: 0,\n fetchFailureCount: 0,\n fetchFailureReason: null,\n fetchMeta: null,\n isInvalidated: false,\n status: hasData ? 'success' : 'pending',\n fetchStatus: 'idle',\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAQO;AACP,2BAA8B;AAC9B,qBAAwD;AACxD,uBAA0B;AAX1B;AA8JO,IAAM,QAAN,cAKG,2BAAU;AAAA,EAelB,YAAY,QAA6D;AACvE,UAAM;AArBH;AAWL;AACA;AACA;AACA;AACA;AAEA;AACA;AAKE,uBAAK,sBAAuB;AAC5B,uBAAK,iBAAkB,OAAO;AAC9B,SAAK,WAAW,OAAO,OAAO;AAC9B,SAAK,YAAY,CAAC;AAClB,uBAAK,SAAU,OAAO;AACtB,uBAAK,QAAS,mBAAK,SAAQ,cAAc;AACzC,SAAK,WAAW,OAAO;AACvB,SAAK,YAAY,OAAO;AACxB,uBAAK,eAAgB,gBAAgB,KAAK,OAAO;AACjD,SAAK,QAAQ,OAAO,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AMd,MACA,SACA;AACA,SAAO;AAAA,IACL,mBAAmB;AAAA,IACnB,oBAAoB;AAAA,IACpB,iBAAa,yBAAS,QAAQ,WAAW,IAAI,aAAa;AAAA,IAC1D,GAAI,SAAS,UACV;AAAA,MACC,OAAO;AAAA,MACP,QAAQ;AAAA,IACV;AAAA,EACJ;AACF;AAEA,SAAS,aAAoB,MAAyB,eAAwB;AAC5E,SAAO;AAAA,IACL;AAAA,IACA,eAAe,iBAAiB,KAAK,IAAI;AAAA,IACzC,OAAO;AAAA,IACP,eAAe;AAAA,IACf,QAAQ;AAAA,EACV;AACF;AAEA,SAAS,gBAMP,SAC2B;AAC3B,QAAM,OACJ,OAAO,QAAQ,gBAAgB,aAC1B,QAAQ,YAA2C,IACpD,QAAQ;AAEd,QAAM,UAAU,SAAS;AAEzB,QAAM,uBAAuB,UACzB,OAAO,QAAQ,yBAAyB,aACtC,QAAQ,qBAAqB,IAC7B,QAAQ,uBACV;AAEJ,SAAO;AAAA,IACL;AAAA,IACA,iBAAiB;AAAA,IACjB,eAAe,UAAW,wBAAwB,KAAK,IAAI,IAAK;AAAA,IAChE,OAAO;AAAA,IACP,kBAAkB;AAAA,IAClB,gBAAgB;AAAA,IAChB,mBAAmB;AAAA,IACnB,oBAAoB;AAAA,IACpB,WAAW;AAAA,IACX,eAAe;AAAA,IACf,QAAQ,UAAU,YAAY;AAAA,IAC9B,aAAa;AAAA,EACf;AACF;","names":["queryFnContext","context"]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/query.d.cts b/node_modules/@tanstack/query-core/build/legacy/query.d.cts new file mode 100644 index 0000000..c5cd428 --- /dev/null +++ b/node_modules/@tanstack/query-core/build/legacy/query.d.cts @@ -0,0 +1,3 @@ +import './removable.cjs'; +export { bg as Action, bc as FetchContext, bd as FetchDirection, be as FetchMeta, bf as FetchOptions, z as Query, bb as QueryBehavior, A as QueryState, bh as SetStateOptions, bi as fetchState } from './hydration-uphG6M-i.cjs'; +import './subscribable.cjs'; diff --git a/node_modules/@tanstack/query-core/build/legacy/query.d.ts b/node_modules/@tanstack/query-core/build/legacy/query.d.ts new file mode 100644 index 0000000..2a8a1e0 --- /dev/null +++ b/node_modules/@tanstack/query-core/build/legacy/query.d.ts @@ -0,0 +1,3 @@ +import './removable.js'; +export { bg as Action, bc as FetchContext, bd as FetchDirection, be as FetchMeta, bf as FetchOptions, z as Query, bb as QueryBehavior, A as QueryState, bh as SetStateOptions, bi as fetchState } from './hydration-BlEVG2Lp.js'; +import './subscribable.js'; diff --git a/node_modules/@tanstack/query-core/build/legacy/query.js b/node_modules/@tanstack/query-core/build/legacy/query.js new file mode 100644 index 0000000..66fe122 --- /dev/null +++ b/node_modules/@tanstack/query-core/build/legacy/query.js @@ -0,0 +1,459 @@ +import { + __privateAdd, + __privateGet, + __privateMethod, + __privateSet +} from "./chunk-PXG64RU4.js"; + +// src/query.ts +import { + ensureQueryFn, + noop, + replaceData, + resolveEnabled, + resolveStaleTime, + skipToken, + timeUntilStale +} from "./utils.js"; +import { notifyManager } from "./notifyManager.js"; +import { CancelledError, canFetch, createRetryer } from "./retryer.js"; +import { Removable } from "./removable.js"; +var _initialState, _revertState, _cache, _client, _retryer, _defaultOptions, _abortSignalConsumed, _Query_instances, dispatch_fn; +var Query = class extends Removable { + constructor(config) { + super(); + __privateAdd(this, _Query_instances); + __privateAdd(this, _initialState); + __privateAdd(this, _revertState); + __privateAdd(this, _cache); + __privateAdd(this, _client); + __privateAdd(this, _retryer); + __privateAdd(this, _defaultOptions); + __privateAdd(this, _abortSignalConsumed); + __privateSet(this, _abortSignalConsumed, false); + __privateSet(this, _defaultOptions, config.defaultOptions); + this.setOptions(config.options); + this.observers = []; + __privateSet(this, _client, config.client); + __privateSet(this, _cache, __privateGet(this, _client).getQueryCache()); + this.queryKey = config.queryKey; + this.queryHash = config.queryHash; + __privateSet(this, _initialState, getDefaultState(this.options)); + this.state = config.state ?? __privateGet(this, _initialState); + this.scheduleGc(); + } + get meta() { + return this.options.meta; + } + get promise() { + var _a; + return (_a = __privateGet(this, _retryer)) == null ? void 0 : _a.promise; + } + setOptions(options) { + this.options = { ...__privateGet(this, _defaultOptions), ...options }; + this.updateGcTime(this.options.gcTime); + if (this.state && this.state.data === void 0) { + const defaultState = getDefaultState(this.options); + if (defaultState.data !== void 0) { + this.setState( + successState(defaultState.data, defaultState.dataUpdatedAt) + ); + __privateSet(this, _initialState, defaultState); + } + } + } + optionalRemove() { + if (!this.observers.length && this.state.fetchStatus === "idle") { + __privateGet(this, _cache).remove(this); + } + } + setData(newData, options) { + const data = replaceData(this.state.data, newData, this.options); + __privateMethod(this, _Query_instances, dispatch_fn).call(this, { + data, + type: "success", + dataUpdatedAt: options == null ? void 0 : options.updatedAt, + manual: options == null ? void 0 : options.manual + }); + return data; + } + setState(state, setStateOptions) { + __privateMethod(this, _Query_instances, dispatch_fn).call(this, { type: "setState", state, setStateOptions }); + } + cancel(options) { + var _a, _b; + const promise = (_a = __privateGet(this, _retryer)) == null ? void 0 : _a.promise; + (_b = __privateGet(this, _retryer)) == null ? void 0 : _b.cancel(options); + return promise ? promise.then(noop).catch(noop) : Promise.resolve(); + } + destroy() { + super.destroy(); + this.cancel({ silent: true }); + } + reset() { + this.destroy(); + this.setState(__privateGet(this, _initialState)); + } + isActive() { + return this.observers.some( + (observer) => resolveEnabled(observer.options.enabled, this) !== false + ); + } + isDisabled() { + if (this.getObserversCount() > 0) { + return !this.isActive(); + } + return this.options.queryFn === skipToken || this.state.dataUpdateCount + this.state.errorUpdateCount === 0; + } + isStatic() { + if (this.getObserversCount() > 0) { + return this.observers.some( + (observer) => resolveStaleTime(observer.options.staleTime, this) === "static" + ); + } + return false; + } + isStale() { + if (this.getObserversCount() > 0) { + return this.observers.some( + (observer) => observer.getCurrentResult().isStale + ); + } + return this.state.data === void 0 || this.state.isInvalidated; + } + isStaleByTime(staleTime = 0) { + if (this.state.data === void 0) { + return true; + } + if (staleTime === "static") { + return false; + } + if (this.state.isInvalidated) { + return true; + } + return !timeUntilStale(this.state.dataUpdatedAt, staleTime); + } + onFocus() { + var _a; + const observer = this.observers.find((x) => x.shouldFetchOnWindowFocus()); + observer == null ? void 0 : observer.refetch({ cancelRefetch: false }); + (_a = __privateGet(this, _retryer)) == null ? void 0 : _a.continue(); + } + onOnline() { + var _a; + const observer = this.observers.find((x) => x.shouldFetchOnReconnect()); + observer == null ? void 0 : observer.refetch({ cancelRefetch: false }); + (_a = __privateGet(this, _retryer)) == null ? void 0 : _a.continue(); + } + addObserver(observer) { + if (!this.observers.includes(observer)) { + this.observers.push(observer); + this.clearGcTimeout(); + __privateGet(this, _cache).notify({ type: "observerAdded", query: this, observer }); + } + } + removeObserver(observer) { + if (this.observers.includes(observer)) { + this.observers = this.observers.filter((x) => x !== observer); + if (!this.observers.length) { + if (__privateGet(this, _retryer)) { + if (__privateGet(this, _abortSignalConsumed)) { + __privateGet(this, _retryer).cancel({ revert: true }); + } else { + __privateGet(this, _retryer).cancelRetry(); + } + } + this.scheduleGc(); + } + __privateGet(this, _cache).notify({ type: "observerRemoved", query: this, observer }); + } + } + getObserversCount() { + return this.observers.length; + } + invalidate() { + if (!this.state.isInvalidated) { + __privateMethod(this, _Query_instances, dispatch_fn).call(this, { type: "invalidate" }); + } + } + async fetch(options, fetchOptions) { + var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l; + if (this.state.fetchStatus !== "idle" && // If the promise in the retryer is already rejected, we have to definitely + // re-start the fetch; there is a chance that the query is still in a + // pending state when that happens + ((_a = __privateGet(this, _retryer)) == null ? void 0 : _a.status()) !== "rejected") { + if (this.state.data !== void 0 && (fetchOptions == null ? void 0 : fetchOptions.cancelRefetch)) { + this.cancel({ silent: true }); + } else if (__privateGet(this, _retryer)) { + __privateGet(this, _retryer).continueRetry(); + return __privateGet(this, _retryer).promise; + } + } + if (options) { + this.setOptions(options); + } + if (!this.options.queryFn) { + const observer = this.observers.find((x) => x.options.queryFn); + if (observer) { + this.setOptions(observer.options); + } + } + if (process.env.NODE_ENV !== "production") { + if (!Array.isArray(this.options.queryKey)) { + console.error( + `As of v4, queryKey needs to be an Array. If you are using a string like 'repoData', please change it to an Array, e.g. ['repoData']` + ); + } + } + const abortController = new AbortController(); + const addSignalProperty = (object) => { + Object.defineProperty(object, "signal", { + enumerable: true, + get: () => { + __privateSet(this, _abortSignalConsumed, true); + return abortController.signal; + } + }); + }; + const fetchFn = () => { + const queryFn = ensureQueryFn(this.options, fetchOptions); + const createQueryFnContext = () => { + const queryFnContext2 = { + client: __privateGet(this, _client), + queryKey: this.queryKey, + meta: this.meta + }; + addSignalProperty(queryFnContext2); + return queryFnContext2; + }; + const queryFnContext = createQueryFnContext(); + __privateSet(this, _abortSignalConsumed, false); + if (this.options.persister) { + return this.options.persister( + queryFn, + queryFnContext, + this + ); + } + return queryFn(queryFnContext); + }; + const createFetchContext = () => { + const context2 = { + fetchOptions, + options: this.options, + queryKey: this.queryKey, + client: __privateGet(this, _client), + state: this.state, + fetchFn + }; + addSignalProperty(context2); + return context2; + }; + const context = createFetchContext(); + (_b = this.options.behavior) == null ? void 0 : _b.onFetch(context, this); + __privateSet(this, _revertState, this.state); + if (this.state.fetchStatus === "idle" || this.state.fetchMeta !== ((_c = context.fetchOptions) == null ? void 0 : _c.meta)) { + __privateMethod(this, _Query_instances, dispatch_fn).call(this, { type: "fetch", meta: (_d = context.fetchOptions) == null ? void 0 : _d.meta }); + } + __privateSet(this, _retryer, createRetryer({ + initialPromise: fetchOptions == null ? void 0 : fetchOptions.initialPromise, + fn: context.fetchFn, + onCancel: (error) => { + if (error instanceof CancelledError && error.revert) { + this.setState({ + ...__privateGet(this, _revertState), + fetchStatus: "idle" + }); + } + abortController.abort(); + }, + onFail: (failureCount, error) => { + __privateMethod(this, _Query_instances, dispatch_fn).call(this, { type: "failed", failureCount, error }); + }, + onPause: () => { + __privateMethod(this, _Query_instances, dispatch_fn).call(this, { type: "pause" }); + }, + onContinue: () => { + __privateMethod(this, _Query_instances, dispatch_fn).call(this, { type: "continue" }); + }, + retry: context.options.retry, + retryDelay: context.options.retryDelay, + networkMode: context.options.networkMode, + canRun: () => true + })); + try { + const data = await __privateGet(this, _retryer).start(); + if (data === void 0) { + if (process.env.NODE_ENV !== "production") { + console.error( + `Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}` + ); + } + throw new Error(`${this.queryHash} data is undefined`); + } + this.setData(data); + (_f = (_e = __privateGet(this, _cache).config).onSuccess) == null ? void 0 : _f.call(_e, data, this); + (_h = (_g = __privateGet(this, _cache).config).onSettled) == null ? void 0 : _h.call( + _g, + data, + this.state.error, + this + ); + return data; + } catch (error) { + if (error instanceof CancelledError) { + if (error.silent) { + return __privateGet(this, _retryer).promise; + } else if (error.revert) { + if (this.state.data === void 0) { + throw error; + } + return this.state.data; + } + } + __privateMethod(this, _Query_instances, dispatch_fn).call(this, { + type: "error", + error + }); + (_j = (_i = __privateGet(this, _cache).config).onError) == null ? void 0 : _j.call( + _i, + error, + this + ); + (_l = (_k = __privateGet(this, _cache).config).onSettled) == null ? void 0 : _l.call( + _k, + this.state.data, + error, + this + ); + throw error; + } finally { + this.scheduleGc(); + } + } +}; +_initialState = new WeakMap(); +_revertState = new WeakMap(); +_cache = new WeakMap(); +_client = new WeakMap(); +_retryer = new WeakMap(); +_defaultOptions = new WeakMap(); +_abortSignalConsumed = new WeakMap(); +_Query_instances = new WeakSet(); +dispatch_fn = function(action) { + const reducer = (state) => { + switch (action.type) { + case "failed": + return { + ...state, + fetchFailureCount: action.failureCount, + fetchFailureReason: action.error + }; + case "pause": + return { + ...state, + fetchStatus: "paused" + }; + case "continue": + return { + ...state, + fetchStatus: "fetching" + }; + case "fetch": + return { + ...state, + ...fetchState(state.data, this.options), + fetchMeta: action.meta ?? null + }; + case "success": + const newState = { + ...state, + ...successState(action.data, action.dataUpdatedAt), + dataUpdateCount: state.dataUpdateCount + 1, + ...!action.manual && { + fetchStatus: "idle", + fetchFailureCount: 0, + fetchFailureReason: null + } + }; + __privateSet(this, _revertState, action.manual ? newState : void 0); + return newState; + case "error": + const error = action.error; + return { + ...state, + error, + errorUpdateCount: state.errorUpdateCount + 1, + errorUpdatedAt: Date.now(), + fetchFailureCount: state.fetchFailureCount + 1, + fetchFailureReason: error, + fetchStatus: "idle", + status: "error", + // flag existing data as invalidated if we get a background error + // note that "no data" always means stale so we can set unconditionally here + isInvalidated: true + }; + case "invalidate": + return { + ...state, + isInvalidated: true + }; + case "setState": + return { + ...state, + ...action.state + }; + } + }; + this.state = reducer(this.state); + notifyManager.batch(() => { + this.observers.forEach((observer) => { + observer.onQueryUpdate(); + }); + __privateGet(this, _cache).notify({ query: this, type: "updated", action }); + }); +}; +function fetchState(data, options) { + return { + fetchFailureCount: 0, + fetchFailureReason: null, + fetchStatus: canFetch(options.networkMode) ? "fetching" : "paused", + ...data === void 0 && { + error: null, + status: "pending" + } + }; +} +function successState(data, dataUpdatedAt) { + return { + data, + dataUpdatedAt: dataUpdatedAt ?? Date.now(), + error: null, + isInvalidated: false, + status: "success" + }; +} +function getDefaultState(options) { + const data = typeof options.initialData === "function" ? options.initialData() : options.initialData; + const hasData = data !== void 0; + const initialDataUpdatedAt = hasData ? typeof options.initialDataUpdatedAt === "function" ? options.initialDataUpdatedAt() : options.initialDataUpdatedAt : 0; + return { + data, + dataUpdateCount: 0, + dataUpdatedAt: hasData ? initialDataUpdatedAt ?? Date.now() : 0, + error: null, + errorUpdateCount: 0, + errorUpdatedAt: 0, + fetchFailureCount: 0, + fetchFailureReason: null, + fetchMeta: null, + isInvalidated: false, + status: hasData ? "success" : "pending", + fetchStatus: "idle" + }; +} +export { + Query, + fetchState +}; +//# sourceMappingURL=query.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/query.js.map b/node_modules/@tanstack/query-core/build/legacy/query.js.map new file mode 100644 index 0000000..11e670b --- /dev/null +++ b/node_modules/@tanstack/query-core/build/legacy/query.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/query.ts"],"sourcesContent":["import {\n ensureQueryFn,\n noop,\n replaceData,\n resolveEnabled,\n resolveStaleTime,\n skipToken,\n timeUntilStale,\n} from './utils'\nimport { notifyManager } from './notifyManager'\nimport { CancelledError, canFetch, createRetryer } from './retryer'\nimport { Removable } from './removable'\nimport type { QueryCache } from './queryCache'\nimport type { QueryClient } from './queryClient'\nimport type {\n CancelOptions,\n DefaultError,\n FetchStatus,\n InitialDataFunction,\n OmitKeyof,\n QueryFunctionContext,\n QueryKey,\n QueryMeta,\n QueryOptions,\n QueryStatus,\n SetDataOptions,\n StaleTime,\n} from './types'\nimport type { QueryObserver } from './queryObserver'\nimport type { Retryer } from './retryer'\n\n// TYPES\n\ninterface QueryConfig<\n TQueryFnData,\n TError,\n TData,\n TQueryKey extends QueryKey = QueryKey,\n> {\n client: QueryClient\n queryKey: TQueryKey\n queryHash: string\n options?: QueryOptions\n defaultOptions?: QueryOptions\n state?: QueryState\n}\n\nexport interface QueryState {\n data: TData | undefined\n dataUpdateCount: number\n dataUpdatedAt: number\n error: TError | null\n errorUpdateCount: number\n errorUpdatedAt: number\n fetchFailureCount: number\n fetchFailureReason: TError | null\n fetchMeta: FetchMeta | null\n isInvalidated: boolean\n status: QueryStatus\n fetchStatus: FetchStatus\n}\n\nexport interface FetchContext<\n TQueryFnData,\n TError,\n TData,\n TQueryKey extends QueryKey = QueryKey,\n> {\n fetchFn: () => unknown | Promise\n fetchOptions?: FetchOptions\n signal: AbortSignal\n options: QueryOptions\n client: QueryClient\n queryKey: TQueryKey\n state: QueryState\n}\n\nexport interface QueryBehavior<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> {\n onFetch: (\n context: FetchContext,\n query: Query,\n ) => void\n}\n\nexport type FetchDirection = 'forward' | 'backward'\n\nexport interface FetchMeta {\n fetchMore?: { direction: FetchDirection }\n}\n\nexport interface FetchOptions {\n cancelRefetch?: boolean\n meta?: FetchMeta\n initialPromise?: Promise\n}\n\ninterface FailedAction {\n type: 'failed'\n failureCount: number\n error: TError\n}\n\ninterface FetchAction {\n type: 'fetch'\n meta?: FetchMeta\n}\n\ninterface SuccessAction {\n data: TData | undefined\n type: 'success'\n dataUpdatedAt?: number\n manual?: boolean\n}\n\ninterface ErrorAction {\n type: 'error'\n error: TError\n}\n\ninterface InvalidateAction {\n type: 'invalidate'\n}\n\ninterface PauseAction {\n type: 'pause'\n}\n\ninterface ContinueAction {\n type: 'continue'\n}\n\ninterface SetStateAction {\n type: 'setState'\n state: Partial>\n setStateOptions?: SetStateOptions\n}\n\nexport type Action =\n | ContinueAction\n | ErrorAction\n | FailedAction\n | FetchAction\n | InvalidateAction\n | PauseAction\n | SetStateAction\n | SuccessAction\n\nexport interface SetStateOptions {\n meta?: any\n}\n\n// CLASS\n\nexport class Query<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> extends Removable {\n queryKey: TQueryKey\n queryHash: string\n options!: QueryOptions\n state: QueryState\n\n #initialState: QueryState\n #revertState?: QueryState\n #cache: QueryCache\n #client: QueryClient\n #retryer?: Retryer\n observers: Array>\n #defaultOptions?: QueryOptions\n #abortSignalConsumed: boolean\n\n constructor(config: QueryConfig) {\n super()\n\n this.#abortSignalConsumed = false\n this.#defaultOptions = config.defaultOptions\n this.setOptions(config.options)\n this.observers = []\n this.#client = config.client\n this.#cache = this.#client.getQueryCache()\n this.queryKey = config.queryKey\n this.queryHash = config.queryHash\n this.#initialState = getDefaultState(this.options)\n this.state = config.state ?? this.#initialState\n this.scheduleGc()\n }\n get meta(): QueryMeta | undefined {\n return this.options.meta\n }\n\n get promise(): Promise | undefined {\n return this.#retryer?.promise\n }\n\n setOptions(\n options?: QueryOptions,\n ): void {\n this.options = { ...this.#defaultOptions, ...options }\n\n this.updateGcTime(this.options.gcTime)\n\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n if (this.state && this.state.data === undefined) {\n const defaultState = getDefaultState(this.options)\n if (defaultState.data !== undefined) {\n this.setState(\n successState(defaultState.data, defaultState.dataUpdatedAt),\n )\n this.#initialState = defaultState\n }\n }\n }\n\n protected optionalRemove() {\n if (!this.observers.length && this.state.fetchStatus === 'idle') {\n this.#cache.remove(this)\n }\n }\n\n setData(\n newData: TData,\n options?: SetDataOptions & { manual: boolean },\n ): TData {\n const data = replaceData(this.state.data, newData, this.options)\n\n // Set data and mark it as cached\n this.#dispatch({\n data,\n type: 'success',\n dataUpdatedAt: options?.updatedAt,\n manual: options?.manual,\n })\n\n return data\n }\n\n setState(\n state: Partial>,\n setStateOptions?: SetStateOptions,\n ): void {\n this.#dispatch({ type: 'setState', state, setStateOptions })\n }\n\n cancel(options?: CancelOptions): Promise {\n const promise = this.#retryer?.promise\n this.#retryer?.cancel(options)\n return promise ? promise.then(noop).catch(noop) : Promise.resolve()\n }\n\n destroy(): void {\n super.destroy()\n\n this.cancel({ silent: true })\n }\n\n reset(): void {\n this.destroy()\n this.setState(this.#initialState)\n }\n\n isActive(): boolean {\n return this.observers.some(\n (observer) => resolveEnabled(observer.options.enabled, this) !== false,\n )\n }\n\n isDisabled(): boolean {\n if (this.getObserversCount() > 0) {\n return !this.isActive()\n }\n // if a query has no observers, it should still be considered disabled if it never attempted a fetch\n return (\n this.options.queryFn === skipToken ||\n this.state.dataUpdateCount + this.state.errorUpdateCount === 0\n )\n }\n\n isStatic(): boolean {\n if (this.getObserversCount() > 0) {\n return this.observers.some(\n (observer) =>\n resolveStaleTime(observer.options.staleTime, this) === 'static',\n )\n }\n\n return false\n }\n\n isStale(): boolean {\n // check observers first, their `isStale` has the source of truth\n // calculated with `isStaleByTime` and it takes `enabled` into account\n if (this.getObserversCount() > 0) {\n return this.observers.some(\n (observer) => observer.getCurrentResult().isStale,\n )\n }\n\n return this.state.data === undefined || this.state.isInvalidated\n }\n\n isStaleByTime(staleTime: StaleTime = 0): boolean {\n // no data is always stale\n if (this.state.data === undefined) {\n return true\n }\n // static is never stale\n if (staleTime === 'static') {\n return false\n }\n // if the query is invalidated, it is stale\n if (this.state.isInvalidated) {\n return true\n }\n\n return !timeUntilStale(this.state.dataUpdatedAt, staleTime)\n }\n\n onFocus(): void {\n const observer = this.observers.find((x) => x.shouldFetchOnWindowFocus())\n\n observer?.refetch({ cancelRefetch: false })\n\n // Continue fetch if currently paused\n this.#retryer?.continue()\n }\n\n onOnline(): void {\n const observer = this.observers.find((x) => x.shouldFetchOnReconnect())\n\n observer?.refetch({ cancelRefetch: false })\n\n // Continue fetch if currently paused\n this.#retryer?.continue()\n }\n\n addObserver(observer: QueryObserver): void {\n if (!this.observers.includes(observer)) {\n this.observers.push(observer)\n\n // Stop the query from being garbage collected\n this.clearGcTimeout()\n\n this.#cache.notify({ type: 'observerAdded', query: this, observer })\n }\n }\n\n removeObserver(observer: QueryObserver): void {\n if (this.observers.includes(observer)) {\n this.observers = this.observers.filter((x) => x !== observer)\n\n if (!this.observers.length) {\n // If the transport layer does not support cancellation\n // we'll let the query continue so the result can be cached\n if (this.#retryer) {\n if (this.#abortSignalConsumed) {\n this.#retryer.cancel({ revert: true })\n } else {\n this.#retryer.cancelRetry()\n }\n }\n\n this.scheduleGc()\n }\n\n this.#cache.notify({ type: 'observerRemoved', query: this, observer })\n }\n }\n\n getObserversCount(): number {\n return this.observers.length\n }\n\n invalidate(): void {\n if (!this.state.isInvalidated) {\n this.#dispatch({ type: 'invalidate' })\n }\n }\n\n async fetch(\n options?: QueryOptions,\n fetchOptions?: FetchOptions,\n ): Promise {\n if (\n this.state.fetchStatus !== 'idle' &&\n // If the promise in the retryer is already rejected, we have to definitely\n // re-start the fetch; there is a chance that the query is still in a\n // pending state when that happens\n this.#retryer?.status() !== 'rejected'\n ) {\n if (this.state.data !== undefined && fetchOptions?.cancelRefetch) {\n // Silently cancel current fetch if the user wants to cancel refetch\n this.cancel({ silent: true })\n } else if (this.#retryer) {\n // make sure that retries that were potentially cancelled due to unmounts can continue\n this.#retryer.continueRetry()\n // Return current promise if we are already fetching\n return this.#retryer.promise\n }\n }\n\n // Update config if passed, otherwise the config from the last execution is used\n if (options) {\n this.setOptions(options)\n }\n\n // Use the options from the first observer with a query function if no function is found.\n // This can happen when the query is hydrated or created with setQueryData.\n if (!this.options.queryFn) {\n const observer = this.observers.find((x) => x.options.queryFn)\n if (observer) {\n this.setOptions(observer.options)\n }\n }\n\n if (process.env.NODE_ENV !== 'production') {\n if (!Array.isArray(this.options.queryKey)) {\n console.error(\n `As of v4, queryKey needs to be an Array. If you are using a string like 'repoData', please change it to an Array, e.g. ['repoData']`,\n )\n }\n }\n\n const abortController = new AbortController()\n\n // Adds an enumerable signal property to the object that\n // which sets abortSignalConsumed to true when the signal\n // is read.\n const addSignalProperty = (object: unknown) => {\n Object.defineProperty(object, 'signal', {\n enumerable: true,\n get: () => {\n this.#abortSignalConsumed = true\n return abortController.signal\n },\n })\n }\n\n // Create fetch function\n const fetchFn = () => {\n const queryFn = ensureQueryFn(this.options, fetchOptions)\n\n // Create query function context\n const createQueryFnContext = (): QueryFunctionContext => {\n const queryFnContext: OmitKeyof<\n QueryFunctionContext,\n 'signal'\n > = {\n client: this.#client,\n queryKey: this.queryKey,\n meta: this.meta,\n }\n addSignalProperty(queryFnContext)\n return queryFnContext as QueryFunctionContext\n }\n\n const queryFnContext = createQueryFnContext()\n\n this.#abortSignalConsumed = false\n if (this.options.persister) {\n return this.options.persister(\n queryFn,\n queryFnContext,\n this as unknown as Query,\n )\n }\n\n return queryFn(queryFnContext)\n }\n\n // Trigger behavior hook\n const createFetchContext = (): FetchContext<\n TQueryFnData,\n TError,\n TData,\n TQueryKey\n > => {\n const context: OmitKeyof<\n FetchContext,\n 'signal'\n > = {\n fetchOptions,\n options: this.options,\n queryKey: this.queryKey,\n client: this.#client,\n state: this.state,\n fetchFn,\n }\n\n addSignalProperty(context)\n return context as FetchContext\n }\n\n const context = createFetchContext()\n\n this.options.behavior?.onFetch(context, this as unknown as Query)\n\n // Store state in case the current fetch needs to be reverted\n this.#revertState = this.state\n\n // Set to fetching state if not already in it\n if (\n this.state.fetchStatus === 'idle' ||\n this.state.fetchMeta !== context.fetchOptions?.meta\n ) {\n this.#dispatch({ type: 'fetch', meta: context.fetchOptions?.meta })\n }\n\n // Try to fetch the data\n this.#retryer = createRetryer({\n initialPromise: fetchOptions?.initialPromise as\n | Promise\n | undefined,\n fn: context.fetchFn as () => Promise,\n onCancel: (error) => {\n if (error instanceof CancelledError && error.revert) {\n this.setState({\n ...this.#revertState,\n fetchStatus: 'idle' as const,\n })\n }\n abortController.abort()\n },\n onFail: (failureCount, error) => {\n this.#dispatch({ type: 'failed', failureCount, error })\n },\n onPause: () => {\n this.#dispatch({ type: 'pause' })\n },\n onContinue: () => {\n this.#dispatch({ type: 'continue' })\n },\n retry: context.options.retry,\n retryDelay: context.options.retryDelay,\n networkMode: context.options.networkMode,\n canRun: () => true,\n })\n\n try {\n const data = await this.#retryer.start()\n // this is more of a runtime guard\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n if (data === undefined) {\n if (process.env.NODE_ENV !== 'production') {\n console.error(\n `Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}`,\n )\n }\n throw new Error(`${this.queryHash} data is undefined`)\n }\n\n this.setData(data)\n\n // Notify cache callback\n this.#cache.config.onSuccess?.(data, this as Query)\n this.#cache.config.onSettled?.(\n data,\n this.state.error as any,\n this as Query,\n )\n return data\n } catch (error) {\n if (error instanceof CancelledError) {\n if (error.silent) {\n // silent cancellation implies a new fetch is going to be started,\n // so we piggyback onto that promise\n return this.#retryer.promise\n } else if (error.revert) {\n // transform error into reverted state data\n // if the initial fetch was cancelled, we have no data, so we have\n // to get reject with a CancelledError\n if (this.state.data === undefined) {\n throw error\n }\n return this.state.data\n }\n }\n this.#dispatch({\n type: 'error',\n error: error as TError,\n })\n\n // Notify cache callback\n this.#cache.config.onError?.(\n error as any,\n this as Query,\n )\n this.#cache.config.onSettled?.(\n this.state.data,\n error as any,\n this as Query,\n )\n\n throw error // rethrow the error for further handling\n } finally {\n // Schedule query gc after fetching\n this.scheduleGc()\n }\n }\n\n #dispatch(action: Action): void {\n const reducer = (\n state: QueryState,\n ): QueryState => {\n switch (action.type) {\n case 'failed':\n return {\n ...state,\n fetchFailureCount: action.failureCount,\n fetchFailureReason: action.error,\n }\n case 'pause':\n return {\n ...state,\n fetchStatus: 'paused',\n }\n case 'continue':\n return {\n ...state,\n fetchStatus: 'fetching',\n }\n case 'fetch':\n return {\n ...state,\n ...fetchState(state.data, this.options),\n fetchMeta: action.meta ?? null,\n }\n case 'success':\n const newState = {\n ...state,\n ...successState(action.data, action.dataUpdatedAt),\n dataUpdateCount: state.dataUpdateCount + 1,\n ...(!action.manual && {\n fetchStatus: 'idle' as const,\n fetchFailureCount: 0,\n fetchFailureReason: null,\n }),\n }\n // If fetching ends successfully, we don't need revertState as a fallback anymore.\n // For manual updates, capture the state to revert to it in case of a cancellation.\n this.#revertState = action.manual ? newState : undefined\n\n return newState\n case 'error':\n const error = action.error\n return {\n ...state,\n error,\n errorUpdateCount: state.errorUpdateCount + 1,\n errorUpdatedAt: Date.now(),\n fetchFailureCount: state.fetchFailureCount + 1,\n fetchFailureReason: error,\n fetchStatus: 'idle',\n status: 'error',\n // flag existing data as invalidated if we get a background error\n // note that \"no data\" always means stale so we can set unconditionally here\n isInvalidated: true,\n }\n case 'invalidate':\n return {\n ...state,\n isInvalidated: true,\n }\n case 'setState':\n return {\n ...state,\n ...action.state,\n }\n }\n }\n\n this.state = reducer(this.state)\n\n notifyManager.batch(() => {\n this.observers.forEach((observer) => {\n observer.onQueryUpdate()\n })\n\n this.#cache.notify({ query: this, type: 'updated', action })\n })\n }\n}\n\nexport function fetchState<\n TQueryFnData,\n TError,\n TData,\n TQueryKey extends QueryKey,\n>(\n data: TData | undefined,\n options: QueryOptions,\n) {\n return {\n fetchFailureCount: 0,\n fetchFailureReason: null,\n fetchStatus: canFetch(options.networkMode) ? 'fetching' : 'paused',\n ...(data === undefined &&\n ({\n error: null,\n status: 'pending',\n } as const)),\n } as const\n}\n\nfunction successState(data: TData | undefined, dataUpdatedAt?: number) {\n return {\n data,\n dataUpdatedAt: dataUpdatedAt ?? Date.now(),\n error: null,\n isInvalidated: false,\n status: 'success' as const,\n }\n}\n\nfunction getDefaultState<\n TQueryFnData,\n TError,\n TData,\n TQueryKey extends QueryKey,\n>(\n options: QueryOptions,\n): QueryState {\n const data =\n typeof options.initialData === 'function'\n ? (options.initialData as InitialDataFunction)()\n : options.initialData\n\n const hasData = data !== undefined\n\n const initialDataUpdatedAt = hasData\n ? typeof options.initialDataUpdatedAt === 'function'\n ? options.initialDataUpdatedAt()\n : options.initialDataUpdatedAt\n : 0\n\n return {\n data,\n dataUpdateCount: 0,\n dataUpdatedAt: hasData ? (initialDataUpdatedAt ?? Date.now()) : 0,\n error: null,\n errorUpdateCount: 0,\n errorUpdatedAt: 0,\n fetchFailureCount: 0,\n fetchFailureReason: null,\n fetchMeta: null,\n isInvalidated: false,\n status: hasData ? 'success' : 'pending',\n fetchStatus: 'idle',\n }\n}\n"],"mappings":";;;;;;;;AAAA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,qBAAqB;AAC9B,SAAS,gBAAgB,UAAU,qBAAqB;AACxD,SAAS,iBAAiB;AAX1B;AA8JO,IAAM,QAAN,cAKG,UAAU;AAAA,EAelB,YAAY,QAA6D;AACvE,UAAM;AArBH;AAWL;AACA;AACA;AACA;AACA;AAEA;AACA;AAKE,uBAAK,sBAAuB;AAC5B,uBAAK,iBAAkB,OAAO;AAC9B,SAAK,WAAW,OAAO,OAAO;AAC9B,SAAK,YAAY,CAAC;AAClB,uBAAK,SAAU,OAAO;AACtB,uBAAK,QAAS,mBAAK,SAAQ,cAAc;AACzC,SAAK,WAAW,OAAO;AACvB,SAAK,YAAY,OAAO;AACxB,uBAAK,eAAgB,gBAAgB,KAAK,OAAO;AACjD,SA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AS,WAMd,MACA,SACA;AACA,SAAO;AAAA,IACL,mBAAmB;AAAA,IACnB,oBAAoB;AAAA,IACpB,aAAa,SAAS,QAAQ,WAAW,IAAI,aAAa;AAAA,IAC1D,GAAI,SAAS,UACV;AAAA,MACC,OAAO;AAAA,MACP,QAAQ;AAAA,IACV;AAAA,EACJ;AACF;AAEA,SAAS,aAAoB,MAAyB,eAAwB;AAC5E,SAAO;AAAA,IACL;AAAA,IACA,eAAe,iBAAiB,KAAK,IAAI;AAAA,IACzC,OAAO;AAAA,IACP,eAAe;AAAA,IACf,QAAQ;AAAA,EACV;AACF;AAEA,SAAS,gBAMP,SAC2B;AAC3B,QAAM,OACJ,OAAO,QAAQ,gBAAgB,aAC1B,QAAQ,YAA2C,IACpD,QAAQ;AAEd,QAAM,UAAU,SAAS;AAEzB,QAAM,uBAAuB,UACzB,OAAO,QAAQ,yBAAyB,aACtC,QAAQ,qBAAqB,IAC7B,QAAQ,uBACV;AAEJ,SAAO;AAAA,IACL;AAAA,IACA,iBAAiB;AAAA,IACjB,eAAe,UAAW,wBAAwB,KAAK,IAAI,IAAK;AAAA,IAChE,OAAO;AAAA,IACP,kBAAkB;AAAA,IAClB,gBAAgB;AAAA,IAChB,mBAAmB;AAAA,IACnB,oBAAoB;AAAA,IACpB,WAAW;AAAA,IACX,eAAe;AAAA,IACf,QAAQ,UAAU,YAAY;AAAA,IAC9B,aAAa;AAAA,EACf;AACF;","names":["queryFnContext","context"]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/queryCache.cjs b/node_modules/@tanstack/query-core/build/legacy/queryCache.cjs new file mode 100644 index 0000000..69cac78 --- /dev/null +++ b/node_modules/@tanstack/query-core/build/legacy/queryCache.cjs @@ -0,0 +1,131 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __typeError = (msg) => { + throw TypeError(msg); +}; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg); +var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj)); +var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value); +var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value); + +// src/queryCache.ts +var queryCache_exports = {}; +__export(queryCache_exports, { + QueryCache: () => QueryCache +}); +module.exports = __toCommonJS(queryCache_exports); +var import_utils = require("./utils.cjs"); +var import_query = require("./query.cjs"); +var import_notifyManager = require("./notifyManager.cjs"); +var import_subscribable = require("./subscribable.cjs"); +var _queries; +var QueryCache = class extends import_subscribable.Subscribable { + constructor(config = {}) { + super(); + this.config = config; + __privateAdd(this, _queries); + __privateSet(this, _queries, /* @__PURE__ */ new Map()); + } + build(client, options, state) { + const queryKey = options.queryKey; + const queryHash = options.queryHash ?? (0, import_utils.hashQueryKeyByOptions)(queryKey, options); + let query = this.get(queryHash); + if (!query) { + query = new import_query.Query({ + client, + queryKey, + queryHash, + options: client.defaultQueryOptions(options), + state, + defaultOptions: client.getQueryDefaults(queryKey) + }); + this.add(query); + } + return query; + } + add(query) { + if (!__privateGet(this, _queries).has(query.queryHash)) { + __privateGet(this, _queries).set(query.queryHash, query); + this.notify({ + type: "added", + query + }); + } + } + remove(query) { + const queryInMap = __privateGet(this, _queries).get(query.queryHash); + if (queryInMap) { + query.destroy(); + if (queryInMap === query) { + __privateGet(this, _queries).delete(query.queryHash); + } + this.notify({ type: "removed", query }); + } + } + clear() { + import_notifyManager.notifyManager.batch(() => { + this.getAll().forEach((query) => { + this.remove(query); + }); + }); + } + get(queryHash) { + return __privateGet(this, _queries).get(queryHash); + } + getAll() { + return [...__privateGet(this, _queries).values()]; + } + find(filters) { + const defaultedFilters = { exact: true, ...filters }; + return this.getAll().find( + (query) => (0, import_utils.matchQuery)(defaultedFilters, query) + ); + } + findAll(filters = {}) { + const queries = this.getAll(); + return Object.keys(filters).length > 0 ? queries.filter((query) => (0, import_utils.matchQuery)(filters, query)) : queries; + } + notify(event) { + import_notifyManager.notifyManager.batch(() => { + this.listeners.forEach((listener) => { + listener(event); + }); + }); + } + onFocus() { + import_notifyManager.notifyManager.batch(() => { + this.getAll().forEach((query) => { + query.onFocus(); + }); + }); + } + onOnline() { + import_notifyManager.notifyManager.batch(() => { + this.getAll().forEach((query) => { + query.onOnline(); + }); + }); + } +}; +_queries = new WeakMap(); +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + QueryCache +}); +//# sourceMappingURL=queryCache.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/queryCache.cjs.map b/node_modules/@tanstack/query-core/build/legacy/queryCache.cjs.map new file mode 100644 index 0000000..1e85002 --- /dev/null +++ b/node_modules/@tanstack/query-core/build/legacy/queryCache.cjs.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/queryCache.ts"],"sourcesContent":["import { hashQueryKeyByOptions, matchQuery } from './utils'\nimport { Query } from './query'\nimport { notifyManager } from './notifyManager'\nimport { Subscribable } from './subscribable'\nimport type { QueryFilters } from './utils'\nimport type { Action, QueryState } from './query'\nimport type {\n DefaultError,\n NotifyEvent,\n QueryKey,\n QueryOptions,\n WithRequired,\n} from './types'\nimport type { QueryClient } from './queryClient'\nimport type { QueryObserver } from './queryObserver'\n\n// TYPES\n\ninterface QueryCacheConfig {\n onError?: (\n error: DefaultError,\n query: Query,\n ) => void\n onSuccess?: (data: unknown, query: Query) => void\n onSettled?: (\n data: unknown | undefined,\n error: DefaultError | null,\n query: Query,\n ) => void\n}\n\ninterface NotifyEventQueryAdded extends NotifyEvent {\n type: 'added'\n query: Query\n}\n\ninterface NotifyEventQueryRemoved extends NotifyEvent {\n type: 'removed'\n query: Query\n}\n\ninterface NotifyEventQueryUpdated extends NotifyEvent {\n type: 'updated'\n query: Query\n action: Action\n}\n\ninterface NotifyEventQueryObserverAdded extends NotifyEvent {\n type: 'observerAdded'\n query: Query\n observer: QueryObserver\n}\n\ninterface NotifyEventQueryObserverRemoved extends NotifyEvent {\n type: 'observerRemoved'\n query: Query\n observer: QueryObserver\n}\n\ninterface NotifyEventQueryObserverResultsUpdated extends NotifyEvent {\n type: 'observerResultsUpdated'\n query: Query\n}\n\ninterface NotifyEventQueryObserverOptionsUpdated extends NotifyEvent {\n type: 'observerOptionsUpdated'\n query: Query\n observer: QueryObserver\n}\n\nexport type QueryCacheNotifyEvent =\n | NotifyEventQueryAdded\n | NotifyEventQueryRemoved\n | NotifyEventQueryUpdated\n | NotifyEventQueryObserverAdded\n | NotifyEventQueryObserverRemoved\n | NotifyEventQueryObserverResultsUpdated\n | NotifyEventQueryObserverOptionsUpdated\n\ntype QueryCacheListener = (event: QueryCacheNotifyEvent) => void\n\nexport interface QueryStore {\n has: (queryHash: string) => boolean\n set: (queryHash: string, query: Query) => void\n get: (queryHash: string) => Query | undefined\n delete: (queryHash: string) => void\n values: () => IterableIterator\n}\n\n// CLASS\n\nexport class QueryCache extends Subscribable {\n #queries: QueryStore\n\n constructor(public config: QueryCacheConfig = {}) {\n super()\n this.#queries = new Map()\n }\n\n build<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n >(\n client: QueryClient,\n options: WithRequired<\n QueryOptions,\n 'queryKey'\n >,\n state?: QueryState,\n ): Query {\n const queryKey = options.queryKey\n const queryHash =\n options.queryHash ?? hashQueryKeyByOptions(queryKey, options)\n let query = this.get(queryHash)\n\n if (!query) {\n query = new Query({\n client,\n queryKey,\n queryHash,\n options: client.defaultQueryOptions(options),\n state,\n defaultOptions: client.getQueryDefaults(queryKey),\n })\n this.add(query)\n }\n\n return query\n }\n\n add(query: Query): void {\n if (!this.#queries.has(query.queryHash)) {\n this.#queries.set(query.queryHash, query)\n\n this.notify({\n type: 'added',\n query,\n })\n }\n }\n\n remove(query: Query): void {\n const queryInMap = this.#queries.get(query.queryHash)\n\n if (queryInMap) {\n query.destroy()\n\n if (queryInMap === query) {\n this.#queries.delete(query.queryHash)\n }\n\n this.notify({ type: 'removed', query })\n }\n }\n\n clear(): void {\n notifyManager.batch(() => {\n this.getAll().forEach((query) => {\n this.remove(query)\n })\n })\n }\n\n get<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n >(\n queryHash: string,\n ): Query | undefined {\n return this.#queries.get(queryHash) as\n | Query\n | undefined\n }\n\n getAll(): Array {\n return [...this.#queries.values()]\n }\n\n find(\n filters: WithRequired,\n ): Query | undefined {\n const defaultedFilters = { exact: true, ...filters }\n\n return this.getAll().find((query) =>\n matchQuery(defaultedFilters, query),\n ) as Query | undefined\n }\n\n findAll(filters: QueryFilters = {}): Array {\n const queries = this.getAll()\n return Object.keys(filters).length > 0\n ? queries.filter((query) => matchQuery(filters, query))\n : queries\n }\n\n notify(event: QueryCacheNotifyEvent): void {\n notifyManager.batch(() => {\n this.listeners.forEach((listener) => {\n listener(event)\n })\n })\n }\n\n onFocus(): void {\n notifyManager.batch(() => {\n this.getAll().forEach((query) => {\n query.onFocus()\n })\n })\n }\n\n onOnline(): void {\n notifyManager.batch(() => {\n this.getAll().forEach((query) => {\n query.onOnline()\n })\n })\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AA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;AAAA,EACH;AAAA,EAEA,IAME,WAC2D;AAC3D,WAAO,mBAAK,UAAS,IAAI,SAAS;AAAA,EAGpC;AAAA,EAEA,SAAuB;AACrB,WAAO,CAAC,GAAG,mBAAK,UAAS,OAAO,CAAC;AAAA,EACnC;AAAA,EAEA,KACE,SACgD;AAChD,UAAM,mBAAmB,EAAE,OAAO,MAAM,GAAG,QAAQ;AAEnD,WAAO,KAAK,OAAO,EAAE;AAAA,MAAK,CAAC,cACzB,yBAAW,kBAAkB,KAAK;AAAA,IACpC;AAAA,EACF;AAAA,EAEA,QAAQ,UAA6B,CAAC,GAAiB;AACrD,UAAM,UAAU,KAAK,OAAO;AAC5B,WAAO,OAAO,KAAK,OAAO,EAAE,SAAS,IACjC,QAAQ,OAAO,CAAC,cAAU,yBAAW,SAAS,KAAK,CAAC,IACpD;AAAA,EACN;AAAA,EAEA,OAAO,OAAoC;AACzC,uCAAc,MAAM,MAAM;AACxB,WAAK,UAAU,QAAQ,CAAC,aAAa;AACnC,iBAAS,KAAK;AAAA,MAChB,CAAC;AAAA,IACH,CAAC;AAAA,EACH;AAAA,EAEA,UAAgB;AACd,uCAAc,MAAM,MAAM;AACxB,WAAK,OAAO,EAAE,QAAQ,CAAC,UAAU;AAC/B,cAAM,QAAQ;AAAA,MAChB,CAAC;AAAA,IACH,CAAC;AAAA,EACH;AAAA,EAEA,WAAiB;AACf,uCAAc,MAAM,MAAM;AACxB,WAAK,OAAO,EAAE,QAAQ,CAAC,UAAU;AAC/B,cAAM,SAAS;AAAA,MACjB,CAAC;AAAA,IACH,CAAC;AAAA,EACH;AACF;AAlIE;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/queryCache.d.cts b/node_modules/@tanstack/query-core/build/legacy/queryCache.d.cts new file mode 100644 index 0000000..7c0bfb5 --- /dev/null +++ b/node_modules/@tanstack/query-core/build/legacy/queryCache.d.cts @@ -0,0 +1,3 @@ +export { Q as QueryCache, f as QueryCacheNotifyEvent, bB as QueryStore } from './hydration-uphG6M-i.cjs'; +import './subscribable.cjs'; +import './removable.cjs'; diff --git a/node_modules/@tanstack/query-core/build/legacy/queryCache.d.ts b/node_modules/@tanstack/query-core/build/legacy/queryCache.d.ts new file mode 100644 index 0000000..3e9dd5f --- /dev/null +++ b/node_modules/@tanstack/query-core/build/legacy/queryCache.d.ts @@ -0,0 +1,3 @@ +export { Q as QueryCache, f as QueryCacheNotifyEvent, bB as QueryStore } from './hydration-BlEVG2Lp.js'; +import './subscribable.js'; +import './removable.js'; diff --git a/node_modules/@tanstack/query-core/build/legacy/queryCache.js b/node_modules/@tanstack/query-core/build/legacy/queryCache.js new file mode 100644 index 0000000..eade2d6 --- /dev/null +++ b/node_modules/@tanstack/query-core/build/legacy/queryCache.js @@ -0,0 +1,105 @@ +import { + __privateAdd, + __privateGet, + __privateSet +} from "./chunk-PXG64RU4.js"; + +// src/queryCache.ts +import { hashQueryKeyByOptions, matchQuery } from "./utils.js"; +import { Query } from "./query.js"; +import { notifyManager } from "./notifyManager.js"; +import { Subscribable } from "./subscribable.js"; +var _queries; +var QueryCache = class extends Subscribable { + constructor(config = {}) { + super(); + this.config = config; + __privateAdd(this, _queries); + __privateSet(this, _queries, /* @__PURE__ */ new Map()); + } + build(client, options, state) { + const queryKey = options.queryKey; + const queryHash = options.queryHash ?? hashQueryKeyByOptions(queryKey, options); + let query = this.get(queryHash); + if (!query) { + query = new Query({ + client, + queryKey, + queryHash, + options: client.defaultQueryOptions(options), + state, + defaultOptions: client.getQueryDefaults(queryKey) + }); + this.add(query); + } + return query; + } + add(query) { + if (!__privateGet(this, _queries).has(query.queryHash)) { + __privateGet(this, _queries).set(query.queryHash, query); + this.notify({ + type: "added", + query + }); + } + } + remove(query) { + const queryInMap = __privateGet(this, _queries).get(query.queryHash); + if (queryInMap) { + query.destroy(); + if (queryInMap === query) { + __privateGet(this, _queries).delete(query.queryHash); + } + this.notify({ type: "removed", query }); + } + } + clear() { + notifyManager.batch(() => { + this.getAll().forEach((query) => { + this.remove(query); + }); + }); + } + get(queryHash) { + return __privateGet(this, _queries).get(queryHash); + } + getAll() { + return [...__privateGet(this, _queries).values()]; + } + find(filters) { + const defaultedFilters = { exact: true, ...filters }; + return this.getAll().find( + (query) => matchQuery(defaultedFilters, query) + ); + } + findAll(filters = {}) { + const queries = this.getAll(); + return Object.keys(filters).length > 0 ? queries.filter((query) => matchQuery(filters, query)) : queries; + } + notify(event) { + notifyManager.batch(() => { + this.listeners.forEach((listener) => { + listener(event); + }); + }); + } + onFocus() { + notifyManager.batch(() => { + this.getAll().forEach((query) => { + query.onFocus(); + }); + }); + } + onOnline() { + notifyManager.batch(() => { + this.getAll().forEach((query) => { + query.onOnline(); + }); + }); + } +}; +_queries = new WeakMap(); +export { + QueryCache +}; +//# sourceMappingURL=queryCache.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/queryCache.js.map b/node_modules/@tanstack/query-core/build/legacy/queryCache.js.map new file mode 100644 index 0000000..49cb764 --- /dev/null +++ b/node_modules/@tanstack/query-core/build/legacy/queryCache.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/queryCache.ts"],"sourcesContent":["import { hashQueryKeyByOptions, matchQuery } from './utils'\nimport { Query } from './query'\nimport { notifyManager } from './notifyManager'\nimport { Subscribable } from './subscribable'\nimport type { QueryFilters } from './utils'\nimport type { Action, QueryState } from './query'\nimport type {\n DefaultError,\n NotifyEvent,\n QueryKey,\n QueryOptions,\n WithRequired,\n} from './types'\nimport type { QueryClient } from './queryClient'\nimport type { QueryObserver } from './queryObserver'\n\n// TYPES\n\ninterface QueryCacheConfig {\n onError?: (\n error: DefaultError,\n query: Query,\n ) => void\n onSuccess?: (data: unknown, query: Query) => void\n onSettled?: (\n data: unknown | undefined,\n error: DefaultError | null,\n query: Query,\n ) => void\n}\n\ninterface NotifyEventQueryAdded extends NotifyEvent {\n type: 'added'\n query: Query\n}\n\ninterface NotifyEventQueryRemoved extends NotifyEvent {\n type: 'removed'\n query: Query\n}\n\ninterface NotifyEventQueryUpdated extends NotifyEvent {\n type: 'updated'\n query: Query\n action: Action\n}\n\ninterface NotifyEventQueryObserverAdded extends NotifyEvent {\n type: 'observerAdded'\n query: Query\n observer: QueryObserver\n}\n\ninterface NotifyEventQueryObserverRemoved extends NotifyEvent {\n type: 'observerRemoved'\n query: Query\n observer: QueryObserver\n}\n\ninterface NotifyEventQueryObserverResultsUpdated extends NotifyEvent {\n type: 'observerResultsUpdated'\n query: Query\n}\n\ninterface NotifyEventQueryObserverOptionsUpdated extends NotifyEvent {\n type: 'observerOptionsUpdated'\n query: Query\n observer: QueryObserver\n}\n\nexport type QueryCacheNotifyEvent =\n | NotifyEventQueryAdded\n | NotifyEventQueryRemoved\n | NotifyEventQueryUpdated\n | NotifyEventQueryObserverAdded\n | NotifyEventQueryObserverRemoved\n | NotifyEventQueryObserverResultsUpdated\n | NotifyEventQueryObserverOptionsUpdated\n\ntype QueryCacheListener = (event: QueryCacheNotifyEvent) => void\n\nexport interface QueryStore {\n has: (queryHash: string) => boolean\n set: (queryHash: string, query: Query) => void\n get: (queryHash: string) => Query | undefined\n delete: (queryHash: string) => void\n values: () => IterableIterator\n}\n\n// CLASS\n\nexport class QueryCache extends Subscribable {\n #queries: QueryStore\n\n constructor(public config: QueryCacheConfig = {}) {\n super()\n this.#queries = new Map()\n }\n\n build<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n >(\n client: QueryClient,\n options: WithRequired<\n QueryOptions,\n 'queryKey'\n >,\n state?: QueryState,\n ): Query {\n const queryKey = options.queryKey\n const queryHash =\n options.queryHash ?? hashQueryKeyByOptions(queryKey, options)\n let query = this.get(queryHash)\n\n if (!query) {\n query = new Query({\n client,\n queryKey,\n queryHash,\n options: client.defaultQueryOptions(options),\n state,\n defaultOptions: client.getQueryDefaults(queryKey),\n })\n this.add(query)\n }\n\n return query\n }\n\n add(query: Query): void {\n if (!this.#queries.has(query.queryHash)) {\n this.#queries.set(query.queryHash, query)\n\n this.notify({\n type: 'added',\n query,\n })\n }\n }\n\n remove(query: Query): void {\n const queryInMap = this.#queries.get(query.queryHash)\n\n if (queryInMap) {\n query.destroy()\n\n if (queryInMap === query) {\n this.#queries.delete(query.queryHash)\n }\n\n this.notify({ type: 'removed', query })\n }\n }\n\n clear(): void {\n notifyManager.batch(() => {\n this.getAll().forEach((query) => {\n this.remove(query)\n })\n })\n }\n\n get<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n >(\n queryHash: string,\n ): Query | undefined {\n return this.#queries.get(queryHash) as\n | Query\n | undefined\n }\n\n getAll(): Array {\n return [...this.#queries.values()]\n }\n\n find(\n filters: WithRequired,\n ): Query | undefined {\n const defaultedFilters = { exact: true, ...filters }\n\n return this.getAll().find((query) =>\n matchQuery(defaultedFilters, query),\n ) as Query | undefined\n }\n\n findAll(filters: QueryFilters = {}): Array {\n const queries = this.getAll()\n return Object.keys(filters).length > 0\n ? queries.filter((query) => matchQuery(filters, query))\n : queries\n }\n\n notify(event: QueryCacheNotifyEvent): void {\n notifyManager.batch(() => {\n this.listeners.forEach((listener) => {\n listener(event)\n })\n })\n }\n\n onFocus(): void {\n notifyManager.batch(() => {\n this.getAll().forEach((query) => {\n query.onFocus()\n })\n })\n }\n\n onOnline(): void {\n notifyManager.batch(() => {\n this.getAll().forEach((query) => {\n query.onOnline()\n })\n })\n }\n}\n"],"mappings":";;;;;;;AAAA,SAAS,uBAAuB,kBAAkB;AAClD,SAAS,aAAa;AACtB,SAAS,qBAAqB;AAC9B,SAAS,oBAAoB;AAH7B;AA2FO,IAAM,aAAN,cAAyB,aAAiC;AAAA,EAG/D,YAAmB,SAA2B,CAAC,GAAG;AAChD,UAAM;AADW;AAFnB;AAIE,uBAAK,UAAW,oBAAI,IAAmB;AAAA,EACzC;AAAA,EAEA,MAME,QACA,SAIA,OAC+C;AAC/C,UAAM,WAAW,QAAQ;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A,MAAK,CAAC,UACzB,WAAW,kBAAkB,KAAK;AAAA,IACpC;AAAA,EACF;AAAA,EAEA,QAAQ,UAA6B,CAAC,GAAiB;AACrD,UAAM,UAAU,KAAK,OAAO;AAC5B,WAAO,OAAO,KAAK,OAAO,EAAE,SAAS,IACjC,QAAQ,OAAO,CAAC,UAAU,WAAW,SAAS,KAAK,CAAC,IACpD;AAAA,EACN;AAAA,EAEA,OAAO,OAAoC;AACzC,kBAAc,MAAM,MAAM;AACxB,WAAK,UAAU,QAAQ,CAAC,aAAa;AACnC,iBAAS,KAAK;AAAA,MAChB,CAAC;AAAA,IACH,CAAC;AAAA,EACH;AAAA,EAEA,UAAgB;AACd,kBAAc,MAAM,MAAM;AACxB,WAAK,OAAO,EAAE,QAAQ,CAAC,UAAU;AAC/B,cAAM,QAAQ;AAAA,MAChB,CAAC;AAAA,IACH,CAAC;AAAA,EACH;AAAA,EAEA,WAAiB;AACf,kBAAc,MAAM,MAAM;AACxB,WAAK,OAAO,EAAE,QAAQ,CAAC,UAAU;AAC/B,cAAM,SAAS;AAAA,MACjB,CAAC;AAAA,IACH,CAAC;AAAA,EACH;AACF;AAlIE;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/queryClient.cjs b/node_modules/@tanstack/query-core/build/legacy/queryClient.cjs new file mode 100644 index 0000000..b3d749e --- /dev/null +++ b/node_modules/@tanstack/query-core/build/legacy/queryClient.cjs @@ -0,0 +1,349 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __typeError = (msg) => { + throw TypeError(msg); +}; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg); +var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj)); +var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value); +var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value); +var __privateWrapper = (obj, member, setter, getter) => ({ + set _(value) { + __privateSet(obj, member, value, setter); + }, + get _() { + return __privateGet(obj, member, getter); + } +}); + +// src/queryClient.ts +var queryClient_exports = {}; +__export(queryClient_exports, { + QueryClient: () => QueryClient +}); +module.exports = __toCommonJS(queryClient_exports); +var import_utils = require("./utils.cjs"); +var import_queryCache = require("./queryCache.cjs"); +var import_mutationCache = require("./mutationCache.cjs"); +var import_focusManager = require("./focusManager.cjs"); +var import_onlineManager = require("./onlineManager.cjs"); +var import_notifyManager = require("./notifyManager.cjs"); +var import_infiniteQueryBehavior = require("./infiniteQueryBehavior.cjs"); +var _queryCache, _mutationCache, _defaultOptions, _queryDefaults, _mutationDefaults, _mountCount, _unsubscribeFocus, _unsubscribeOnline; +var QueryClient = class { + constructor(config = {}) { + __privateAdd(this, _queryCache); + __privateAdd(this, _mutationCache); + __privateAdd(this, _defaultOptions); + __privateAdd(this, _queryDefaults); + __privateAdd(this, _mutationDefaults); + __privateAdd(this, _mountCount); + __privateAdd(this, _unsubscribeFocus); + __privateAdd(this, _unsubscribeOnline); + __privateSet(this, _queryCache, config.queryCache || new import_queryCache.QueryCache()); + __privateSet(this, _mutationCache, config.mutationCache || new import_mutationCache.MutationCache()); + __privateSet(this, _defaultOptions, config.defaultOptions || {}); + __privateSet(this, _queryDefaults, /* @__PURE__ */ new Map()); + __privateSet(this, _mutationDefaults, /* @__PURE__ */ new Map()); + __privateSet(this, _mountCount, 0); + } + mount() { + __privateWrapper(this, _mountCount)._++; + if (__privateGet(this, _mountCount) !== 1) return; + __privateSet(this, _unsubscribeFocus, import_focusManager.focusManager.subscribe(async (focused) => { + if (focused) { + await this.resumePausedMutations(); + __privateGet(this, _queryCache).onFocus(); + } + })); + __privateSet(this, _unsubscribeOnline, import_onlineManager.onlineManager.subscribe(async (online) => { + if (online) { + await this.resumePausedMutations(); + __privateGet(this, _queryCache).onOnline(); + } + })); + } + unmount() { + var _a, _b; + __privateWrapper(this, _mountCount)._--; + if (__privateGet(this, _mountCount) !== 0) return; + (_a = __privateGet(this, _unsubscribeFocus)) == null ? void 0 : _a.call(this); + __privateSet(this, _unsubscribeFocus, void 0); + (_b = __privateGet(this, _unsubscribeOnline)) == null ? void 0 : _b.call(this); + __privateSet(this, _unsubscribeOnline, void 0); + } + isFetching(filters) { + return __privateGet(this, _queryCache).findAll({ ...filters, fetchStatus: "fetching" }).length; + } + isMutating(filters) { + return __privateGet(this, _mutationCache).findAll({ ...filters, status: "pending" }).length; + } + /** + * Imperative (non-reactive) way to retrieve data for a QueryKey. + * Should only be used in callbacks or functions where reading the latest data is necessary, e.g. for optimistic updates. + * + * Hint: Do not use this function inside a component, because it won't receive updates. + * Use `useQuery` to create a `QueryObserver` that subscribes to changes. + */ + getQueryData(queryKey) { + var _a; + const options = this.defaultQueryOptions({ queryKey }); + return (_a = __privateGet(this, _queryCache).get(options.queryHash)) == null ? void 0 : _a.state.data; + } + ensureQueryData(options) { + const defaultedOptions = this.defaultQueryOptions(options); + const query = __privateGet(this, _queryCache).build(this, defaultedOptions); + const cachedData = query.state.data; + if (cachedData === void 0) { + return this.fetchQuery(options); + } + if (options.revalidateIfStale && query.isStaleByTime((0, import_utils.resolveStaleTime)(defaultedOptions.staleTime, query))) { + void this.prefetchQuery(defaultedOptions); + } + return Promise.resolve(cachedData); + } + getQueriesData(filters) { + return __privateGet(this, _queryCache).findAll(filters).map(({ queryKey, state }) => { + const data = state.data; + return [queryKey, data]; + }); + } + setQueryData(queryKey, updater, options) { + const defaultedOptions = this.defaultQueryOptions({ queryKey }); + const query = __privateGet(this, _queryCache).get( + defaultedOptions.queryHash + ); + const prevData = query == null ? void 0 : query.state.data; + const data = (0, import_utils.functionalUpdate)(updater, prevData); + if (data === void 0) { + return void 0; + } + return __privateGet(this, _queryCache).build(this, defaultedOptions).setData(data, { ...options, manual: true }); + } + setQueriesData(filters, updater, options) { + return import_notifyManager.notifyManager.batch( + () => __privateGet(this, _queryCache).findAll(filters).map(({ queryKey }) => [ + queryKey, + this.setQueryData(queryKey, updater, options) + ]) + ); + } + getQueryState(queryKey) { + var _a; + const options = this.defaultQueryOptions({ queryKey }); + return (_a = __privateGet(this, _queryCache).get( + options.queryHash + )) == null ? void 0 : _a.state; + } + removeQueries(filters) { + const queryCache = __privateGet(this, _queryCache); + import_notifyManager.notifyManager.batch(() => { + queryCache.findAll(filters).forEach((query) => { + queryCache.remove(query); + }); + }); + } + resetQueries(filters, options) { + const queryCache = __privateGet(this, _queryCache); + return import_notifyManager.notifyManager.batch(() => { + queryCache.findAll(filters).forEach((query) => { + query.reset(); + }); + return this.refetchQueries( + { + type: "active", + ...filters + }, + options + ); + }); + } + cancelQueries(filters, cancelOptions = {}) { + const defaultedCancelOptions = { revert: true, ...cancelOptions }; + const promises = import_notifyManager.notifyManager.batch( + () => __privateGet(this, _queryCache).findAll(filters).map((query) => query.cancel(defaultedCancelOptions)) + ); + return Promise.all(promises).then(import_utils.noop).catch(import_utils.noop); + } + invalidateQueries(filters, options = {}) { + return import_notifyManager.notifyManager.batch(() => { + __privateGet(this, _queryCache).findAll(filters).forEach((query) => { + query.invalidate(); + }); + if ((filters == null ? void 0 : filters.refetchType) === "none") { + return Promise.resolve(); + } + return this.refetchQueries( + { + ...filters, + type: (filters == null ? void 0 : filters.refetchType) ?? (filters == null ? void 0 : filters.type) ?? "active" + }, + options + ); + }); + } + refetchQueries(filters, options = {}) { + const fetchOptions = { + ...options, + cancelRefetch: options.cancelRefetch ?? true + }; + const promises = import_notifyManager.notifyManager.batch( + () => __privateGet(this, _queryCache).findAll(filters).filter((query) => !query.isDisabled() && !query.isStatic()).map((query) => { + let promise = query.fetch(void 0, fetchOptions); + if (!fetchOptions.throwOnError) { + promise = promise.catch(import_utils.noop); + } + return query.state.fetchStatus === "paused" ? Promise.resolve() : promise; + }) + ); + return Promise.all(promises).then(import_utils.noop); + } + fetchQuery(options) { + const defaultedOptions = this.defaultQueryOptions(options); + if (defaultedOptions.retry === void 0) { + defaultedOptions.retry = false; + } + const query = __privateGet(this, _queryCache).build(this, defaultedOptions); + return query.isStaleByTime( + (0, import_utils.resolveStaleTime)(defaultedOptions.staleTime, query) + ) ? query.fetch(defaultedOptions) : Promise.resolve(query.state.data); + } + prefetchQuery(options) { + return this.fetchQuery(options).then(import_utils.noop).catch(import_utils.noop); + } + fetchInfiniteQuery(options) { + options.behavior = (0, import_infiniteQueryBehavior.infiniteQueryBehavior)(options.pages); + return this.fetchQuery(options); + } + prefetchInfiniteQuery(options) { + return this.fetchInfiniteQuery(options).then(import_utils.noop).catch(import_utils.noop); + } + ensureInfiniteQueryData(options) { + options.behavior = (0, import_infiniteQueryBehavior.infiniteQueryBehavior)(options.pages); + return this.ensureQueryData(options); + } + resumePausedMutations() { + if (import_onlineManager.onlineManager.isOnline()) { + return __privateGet(this, _mutationCache).resumePausedMutations(); + } + return Promise.resolve(); + } + getQueryCache() { + return __privateGet(this, _queryCache); + } + getMutationCache() { + return __privateGet(this, _mutationCache); + } + getDefaultOptions() { + return __privateGet(this, _defaultOptions); + } + setDefaultOptions(options) { + __privateSet(this, _defaultOptions, options); + } + setQueryDefaults(queryKey, options) { + __privateGet(this, _queryDefaults).set((0, import_utils.hashKey)(queryKey), { + queryKey, + defaultOptions: options + }); + } + getQueryDefaults(queryKey) { + const defaults = [...__privateGet(this, _queryDefaults).values()]; + const result = {}; + defaults.forEach((queryDefault) => { + if ((0, import_utils.partialMatchKey)(queryKey, queryDefault.queryKey)) { + Object.assign(result, queryDefault.defaultOptions); + } + }); + return result; + } + setMutationDefaults(mutationKey, options) { + __privateGet(this, _mutationDefaults).set((0, import_utils.hashKey)(mutationKey), { + mutationKey, + defaultOptions: options + }); + } + getMutationDefaults(mutationKey) { + const defaults = [...__privateGet(this, _mutationDefaults).values()]; + const result = {}; + defaults.forEach((queryDefault) => { + if ((0, import_utils.partialMatchKey)(mutationKey, queryDefault.mutationKey)) { + Object.assign(result, queryDefault.defaultOptions); + } + }); + return result; + } + defaultQueryOptions(options) { + if (options._defaulted) { + return options; + } + const defaultedOptions = { + ...__privateGet(this, _defaultOptions).queries, + ...this.getQueryDefaults(options.queryKey), + ...options, + _defaulted: true + }; + if (!defaultedOptions.queryHash) { + defaultedOptions.queryHash = (0, import_utils.hashQueryKeyByOptions)( + defaultedOptions.queryKey, + defaultedOptions + ); + } + if (defaultedOptions.refetchOnReconnect === void 0) { + defaultedOptions.refetchOnReconnect = defaultedOptions.networkMode !== "always"; + } + if (defaultedOptions.throwOnError === void 0) { + defaultedOptions.throwOnError = !!defaultedOptions.suspense; + } + if (!defaultedOptions.networkMode && defaultedOptions.persister) { + defaultedOptions.networkMode = "offlineFirst"; + } + if (defaultedOptions.queryFn === import_utils.skipToken) { + defaultedOptions.enabled = false; + } + return defaultedOptions; + } + defaultMutationOptions(options) { + if (options == null ? void 0 : options._defaulted) { + return options; + } + return { + ...__privateGet(this, _defaultOptions).mutations, + ...(options == null ? void 0 : options.mutationKey) && this.getMutationDefaults(options.mutationKey), + ...options, + _defaulted: true + }; + } + clear() { + __privateGet(this, _queryCache).clear(); + __privateGet(this, _mutationCache).clear(); + } +}; +_queryCache = new WeakMap(); +_mutationCache = new WeakMap(); +_defaultOptions = new WeakMap(); +_queryDefaults = new WeakMap(); +_mutationDefaults = new WeakMap(); +_mountCount = new WeakMap(); +_unsubscribeFocus = new WeakMap(); +_unsubscribeOnline = new WeakMap(); +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + QueryClient +}); +//# sourceMappingURL=queryClient.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/queryClient.cjs.map b/node_modules/@tanstack/query-core/build/legacy/queryClient.cjs.map new file mode 100644 index 0000000..1b49836 --- /dev/null +++ b/node_modules/@tanstack/query-core/build/legacy/queryClient.cjs.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/queryClient.ts"],"sourcesContent":["import {\n functionalUpdate,\n hashKey,\n hashQueryKeyByOptions,\n noop,\n partialMatchKey,\n resolveStaleTime,\n skipToken,\n} from './utils'\nimport { QueryCache } from './queryCache'\nimport { MutationCache } from './mutationCache'\nimport { focusManager } from './focusManager'\nimport { onlineManager } from './onlineManager'\nimport { notifyManager } from './notifyManager'\nimport { infiniteQueryBehavior } from './infiniteQueryBehavior'\nimport type {\n CancelOptions,\n DefaultError,\n DefaultOptions,\n DefaultedQueryObserverOptions,\n EnsureInfiniteQueryDataOptions,\n EnsureQueryDataOptions,\n FetchInfiniteQueryOptions,\n FetchQueryOptions,\n InferDataFromTag,\n InferErrorFromTag,\n InfiniteData,\n InvalidateOptions,\n InvalidateQueryFilters,\n MutationKey,\n MutationObserverOptions,\n MutationOptions,\n NoInfer,\n OmitKeyof,\n QueryClientConfig,\n QueryKey,\n QueryObserverOptions,\n QueryOptions,\n RefetchOptions,\n RefetchQueryFilters,\n ResetOptions,\n SetDataOptions,\n} from './types'\nimport type { QueryState } from './query'\nimport type { MutationFilters, QueryFilters, Updater } from './utils'\n\n// TYPES\n\ninterface QueryDefaults {\n queryKey: QueryKey\n defaultOptions: OmitKeyof, 'queryKey'>\n}\n\ninterface MutationDefaults {\n mutationKey: MutationKey\n defaultOptions: MutationOptions\n}\n\n// CLASS\n\nexport class QueryClient {\n #queryCache: QueryCache\n #mutationCache: MutationCache\n #defaultOptions: DefaultOptions\n #queryDefaults: Map\n #mutationDefaults: Map\n #mountCount: number\n #unsubscribeFocus?: () => void\n #unsubscribeOnline?: () => void\n\n constructor(config: QueryClientConfig = {}) {\n this.#queryCache = config.queryCache || new QueryCache()\n this.#mutationCache = config.mutationCache || new MutationCache()\n this.#defaultOptions = config.defaultOptions || {}\n this.#queryDefaults = new Map()\n this.#mutationDefaults = new Map()\n this.#mountCount = 0\n }\n\n mount(): void {\n this.#mountCount++\n if (this.#mountCount !== 1) return\n\n this.#unsubscribeFocus = focusManager.subscribe(async (focused) => {\n if (focused) {\n await this.resumePausedMutations()\n this.#queryCache.onFocus()\n }\n })\n this.#unsubscribeOnline = onlineManager.subscribe(async (online) => {\n if (online) {\n await this.resumePausedMutations()\n this.#queryCache.onOnline()\n }\n })\n }\n\n unmount(): void {\n this.#mountCount--\n if (this.#mountCount !== 0) return\n\n this.#unsubscribeFocus?.()\n this.#unsubscribeFocus = undefined\n\n this.#unsubscribeOnline?.()\n this.#unsubscribeOnline = undefined\n }\n\n isFetching = QueryFilters>(\n filters?: TQueryFilters,\n ): number {\n return this.#queryCache.findAll({ ...filters, fetchStatus: 'fetching' })\n .length\n }\n\n isMutating<\n TMutationFilters extends MutationFilters = MutationFilters,\n >(filters?: TMutationFilters): number {\n return this.#mutationCache.findAll({ ...filters, status: 'pending' }).length\n }\n\n /**\n * Imperative (non-reactive) way to retrieve data for a QueryKey.\n * Should only be used in callbacks or functions where reading the latest data is necessary, e.g. for optimistic updates.\n *\n * Hint: Do not use this function inside a component, because it won't receive updates.\n * Use `useQuery` to create a `QueryObserver` that subscribes to changes.\n */\n getQueryData<\n TQueryFnData = unknown,\n TTaggedQueryKey extends QueryKey = QueryKey,\n TInferredQueryFnData = InferDataFromTag,\n >(queryKey: TTaggedQueryKey): TInferredQueryFnData | undefined {\n const options = this.defaultQueryOptions({ queryKey })\n\n return this.#queryCache.get(options.queryHash)?.state\n .data\n }\n\n ensureQueryData<\n TQueryFnData,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n >(\n options: EnsureQueryDataOptions,\n ): Promise {\n const defaultedOptions = this.defaultQueryOptions(options)\n const query = this.#queryCache.build(this, defaultedOptions)\n const cachedData = query.state.data\n\n if (cachedData === undefined) {\n return this.fetchQuery(options)\n }\n\n if (\n options.revalidateIfStale &&\n query.isStaleByTime(resolveStaleTime(defaultedOptions.staleTime, query))\n ) {\n void this.prefetchQuery(defaultedOptions)\n }\n\n return Promise.resolve(cachedData)\n }\n\n getQueriesData<\n TQueryFnData = unknown,\n TQueryFilters extends QueryFilters = QueryFilters,\n >(filters: TQueryFilters): Array<[QueryKey, TQueryFnData | undefined]> {\n return this.#queryCache.findAll(filters).map(({ queryKey, state }) => {\n const data = state.data as TQueryFnData | undefined\n return [queryKey, data]\n })\n }\n\n setQueryData<\n TQueryFnData = unknown,\n TTaggedQueryKey extends QueryKey = QueryKey,\n TInferredQueryFnData = InferDataFromTag,\n >(\n queryKey: TTaggedQueryKey,\n updater: Updater<\n NoInfer | undefined,\n NoInfer | undefined\n >,\n options?: SetDataOptions,\n ): NoInfer | undefined {\n const defaultedOptions = this.defaultQueryOptions<\n any,\n any,\n unknown,\n any,\n QueryKey\n >({ queryKey })\n\n const query = this.#queryCache.get(\n defaultedOptions.queryHash,\n )\n const prevData = query?.state.data\n const data = functionalUpdate(updater, prevData)\n\n if (data === undefined) {\n return undefined\n }\n\n return this.#queryCache\n .build(this, defaultedOptions)\n .setData(data, { ...options, manual: true })\n }\n\n setQueriesData<\n TQueryFnData,\n TQueryFilters extends QueryFilters = QueryFilters,\n >(\n filters: TQueryFilters,\n updater: Updater<\n NoInfer | undefined,\n NoInfer | undefined\n >,\n options?: SetDataOptions,\n ): Array<[QueryKey, TQueryFnData | undefined]> {\n return notifyManager.batch(() =>\n this.#queryCache\n .findAll(filters)\n .map(({ queryKey }) => [\n queryKey,\n this.setQueryData(queryKey, updater, options),\n ]),\n )\n }\n\n getQueryState<\n TQueryFnData = unknown,\n TError = DefaultError,\n TTaggedQueryKey extends QueryKey = QueryKey,\n TInferredQueryFnData = InferDataFromTag,\n TInferredError = InferErrorFromTag,\n >(\n queryKey: TTaggedQueryKey,\n ): QueryState | undefined {\n const options = this.defaultQueryOptions({ queryKey })\n return this.#queryCache.get(\n options.queryHash,\n )?.state\n }\n\n removeQueries(\n filters?: QueryFilters,\n ): void {\n const queryCache = this.#queryCache\n notifyManager.batch(() => {\n queryCache.findAll(filters).forEach((query) => {\n queryCache.remove(query)\n })\n })\n }\n\n resetQueries(\n filters?: QueryFilters,\n options?: ResetOptions,\n ): Promise {\n const queryCache = this.#queryCache\n\n return notifyManager.batch(() => {\n queryCache.findAll(filters).forEach((query) => {\n query.reset()\n })\n return this.refetchQueries(\n {\n type: 'active',\n ...filters,\n },\n options,\n )\n })\n }\n\n cancelQueries(\n filters?: QueryFilters,\n cancelOptions: CancelOptions = {},\n ): Promise {\n const defaultedCancelOptions = { revert: true, ...cancelOptions }\n\n const promises = notifyManager.batch(() =>\n this.#queryCache\n .findAll(filters)\n .map((query) => query.cancel(defaultedCancelOptions)),\n )\n\n return Promise.all(promises).then(noop).catch(noop)\n }\n\n invalidateQueries(\n filters?: InvalidateQueryFilters,\n options: InvalidateOptions = {},\n ): Promise {\n return notifyManager.batch(() => {\n this.#queryCache.findAll(filters).forEach((query) => {\n query.invalidate()\n })\n\n if (filters?.refetchType === 'none') {\n return Promise.resolve()\n }\n return this.refetchQueries(\n {\n ...filters,\n type: filters?.refetchType ?? filters?.type ?? 'active',\n },\n options,\n )\n })\n }\n\n refetchQueries(\n filters?: RefetchQueryFilters,\n options: RefetchOptions = {},\n ): Promise {\n const fetchOptions = {\n ...options,\n cancelRefetch: options.cancelRefetch ?? true,\n }\n const promises = notifyManager.batch(() =>\n this.#queryCache\n .findAll(filters)\n .filter((query) => !query.isDisabled() && !query.isStatic())\n .map((query) => {\n let promise = query.fetch(undefined, fetchOptions)\n if (!fetchOptions.throwOnError) {\n promise = promise.catch(noop)\n }\n return query.state.fetchStatus === 'paused'\n ? Promise.resolve()\n : promise\n }),\n )\n\n return Promise.all(promises).then(noop)\n }\n\n fetchQuery<\n TQueryFnData,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = never,\n >(\n options: FetchQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n ): Promise {\n const defaultedOptions = this.defaultQueryOptions(options)\n\n // https://github.com/tannerlinsley/react-query/issues/652\n if (defaultedOptions.retry === undefined) {\n defaultedOptions.retry = false\n }\n\n const query = this.#queryCache.build(this, defaultedOptions)\n\n return query.isStaleByTime(\n resolveStaleTime(defaultedOptions.staleTime, query),\n )\n ? query.fetch(defaultedOptions)\n : Promise.resolve(query.state.data as TData)\n }\n\n prefetchQuery<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n >(\n options: FetchQueryOptions,\n ): Promise {\n return this.fetchQuery(options).then(noop).catch(noop)\n }\n\n fetchInfiniteQuery<\n TQueryFnData,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n >(\n options: FetchInfiniteQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n ): Promise> {\n options.behavior = infiniteQueryBehavior<\n TQueryFnData,\n TError,\n TData,\n TPageParam\n >(options.pages)\n return this.fetchQuery(options as any)\n }\n\n prefetchInfiniteQuery<\n TQueryFnData,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n >(\n options: FetchInfiniteQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n ): Promise {\n return this.fetchInfiniteQuery(options).then(noop).catch(noop)\n }\n\n ensureInfiniteQueryData<\n TQueryFnData,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n >(\n options: EnsureInfiniteQueryDataOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n ): Promise> {\n options.behavior = infiniteQueryBehavior<\n TQueryFnData,\n TError,\n TData,\n TPageParam\n >(options.pages)\n\n return this.ensureQueryData(options as any)\n }\n\n resumePausedMutations(): Promise {\n if (onlineManager.isOnline()) {\n return this.#mutationCache.resumePausedMutations()\n }\n return Promise.resolve()\n }\n\n getQueryCache(): QueryCache {\n return this.#queryCache\n }\n\n getMutationCache(): MutationCache {\n return this.#mutationCache\n }\n\n getDefaultOptions(): DefaultOptions {\n return this.#defaultOptions\n }\n\n setDefaultOptions(options: DefaultOptions): void {\n this.#defaultOptions = options\n }\n\n setQueryDefaults<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryData = TQueryFnData,\n >(\n queryKey: QueryKey,\n options: Partial<\n OmitKeyof<\n QueryObserverOptions,\n 'queryKey'\n >\n >,\n ): void {\n this.#queryDefaults.set(hashKey(queryKey), {\n queryKey,\n defaultOptions: options,\n })\n }\n\n getQueryDefaults(\n queryKey: QueryKey,\n ): OmitKeyof, 'queryKey'> {\n const defaults = [...this.#queryDefaults.values()]\n\n const result: OmitKeyof<\n QueryObserverOptions,\n 'queryKey'\n > = {}\n\n defaults.forEach((queryDefault) => {\n if (partialMatchKey(queryKey, queryDefault.queryKey)) {\n Object.assign(result, queryDefault.defaultOptions)\n }\n })\n return result\n }\n\n setMutationDefaults<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n >(\n mutationKey: MutationKey,\n options: OmitKeyof<\n MutationObserverOptions,\n 'mutationKey'\n >,\n ): void {\n this.#mutationDefaults.set(hashKey(mutationKey), {\n mutationKey,\n defaultOptions: options,\n })\n }\n\n getMutationDefaults(\n mutationKey: MutationKey,\n ): OmitKeyof, 'mutationKey'> {\n const defaults = [...this.#mutationDefaults.values()]\n\n const result: OmitKeyof<\n MutationObserverOptions,\n 'mutationKey'\n > = {}\n\n defaults.forEach((queryDefault) => {\n if (partialMatchKey(mutationKey, queryDefault.mutationKey)) {\n Object.assign(result, queryDefault.defaultOptions)\n }\n })\n\n return result\n }\n\n defaultQueryOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = never,\n >(\n options:\n | QueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey,\n TPageParam\n >\n | DefaultedQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >,\n ): DefaultedQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n > {\n if (options._defaulted) {\n return options as DefaultedQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >\n }\n\n const defaultedOptions = {\n ...this.#defaultOptions.queries,\n ...this.getQueryDefaults(options.queryKey),\n ...options,\n _defaulted: true,\n }\n\n if (!defaultedOptions.queryHash) {\n defaultedOptions.queryHash = hashQueryKeyByOptions(\n defaultedOptions.queryKey,\n defaultedOptions,\n )\n }\n\n // dependent default values\n if (defaultedOptions.refetchOnReconnect === undefined) {\n defaultedOptions.refetchOnReconnect =\n defaultedOptions.networkMode !== 'always'\n }\n if (defaultedOptions.throwOnError === undefined) {\n defaultedOptions.throwOnError = !!defaultedOptions.suspense\n }\n\n if (!defaultedOptions.networkMode && defaultedOptions.persister) {\n defaultedOptions.networkMode = 'offlineFirst'\n }\n\n if (defaultedOptions.queryFn === skipToken) {\n defaultedOptions.enabled = false\n }\n\n return defaultedOptions as DefaultedQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >\n }\n\n defaultMutationOptions>(\n options?: T,\n ): T {\n if (options?._defaulted) {\n return options\n }\n return {\n ...this.#defaultOptions.mutations,\n ...(options?.mutationKey &&\n this.getMutationDefaults(options.mutationKey)),\n ...options,\n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MACL,GAAG,mBAAK,iBAAgB;AAAA,MACxB,IAAI,mCAAS,gBACX,KAAK,oBAAoB,QAAQ,WAAW;AAAA,MAC9C,GAAG;AAAA,MACH,YAAY;AAAA,IACd;AAAA,EACF;AAAA,EAEA,QAAc;AACZ,uBAAK,aAAY,MAAM;AACvB,uBAAK,gBAAe,MAAM;AAAA,EAC5B;AACF;AA1kBE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/queryClient.d.cts b/node_modules/@tanstack/query-core/build/legacy/queryClient.d.cts new file mode 100644 index 0000000..bd14fb2 --- /dev/null +++ b/node_modules/@tanstack/query-core/build/legacy/queryClient.d.cts @@ -0,0 +1,3 @@ +export { g as QueryClient } from './hydration-uphG6M-i.cjs'; +import './removable.cjs'; +import './subscribable.cjs'; diff --git a/node_modules/@tanstack/query-core/build/legacy/queryClient.d.ts b/node_modules/@tanstack/query-core/build/legacy/queryClient.d.ts new file mode 100644 index 0000000..73366c7 --- /dev/null +++ b/node_modules/@tanstack/query-core/build/legacy/queryClient.d.ts @@ -0,0 +1,3 @@ +export { g as QueryClient } from './hydration-BlEVG2Lp.js'; +import './removable.js'; +import './subscribable.js'; diff --git a/node_modules/@tanstack/query-core/build/legacy/queryClient.js b/node_modules/@tanstack/query-core/build/legacy/queryClient.js new file mode 100644 index 0000000..f816889 --- /dev/null +++ b/node_modules/@tanstack/query-core/build/legacy/queryClient.js @@ -0,0 +1,324 @@ +import { + __privateAdd, + __privateGet, + __privateSet, + __privateWrapper +} from "./chunk-PXG64RU4.js"; + +// src/queryClient.ts +import { + functionalUpdate, + hashKey, + hashQueryKeyByOptions, + noop, + partialMatchKey, + resolveStaleTime, + skipToken +} from "./utils.js"; +import { QueryCache } from "./queryCache.js"; +import { MutationCache } from "./mutationCache.js"; +import { focusManager } from "./focusManager.js"; +import { onlineManager } from "./onlineManager.js"; +import { notifyManager } from "./notifyManager.js"; +import { infiniteQueryBehavior } from "./infiniteQueryBehavior.js"; +var _queryCache, _mutationCache, _defaultOptions, _queryDefaults, _mutationDefaults, _mountCount, _unsubscribeFocus, _unsubscribeOnline; +var QueryClient = class { + constructor(config = {}) { + __privateAdd(this, _queryCache); + __privateAdd(this, _mutationCache); + __privateAdd(this, _defaultOptions); + __privateAdd(this, _queryDefaults); + __privateAdd(this, _mutationDefaults); + __privateAdd(this, _mountCount); + __privateAdd(this, _unsubscribeFocus); + __privateAdd(this, _unsubscribeOnline); + __privateSet(this, _queryCache, config.queryCache || new QueryCache()); + __privateSet(this, _mutationCache, config.mutationCache || new MutationCache()); + __privateSet(this, _defaultOptions, config.defaultOptions || {}); + __privateSet(this, _queryDefaults, /* @__PURE__ */ new Map()); + __privateSet(this, _mutationDefaults, /* @__PURE__ */ new Map()); + __privateSet(this, _mountCount, 0); + } + mount() { + __privateWrapper(this, _mountCount)._++; + if (__privateGet(this, _mountCount) !== 1) return; + __privateSet(this, _unsubscribeFocus, focusManager.subscribe(async (focused) => { + if (focused) { + await this.resumePausedMutations(); + __privateGet(this, _queryCache).onFocus(); + } + })); + __privateSet(this, _unsubscribeOnline, onlineManager.subscribe(async (online) => { + if (online) { + await this.resumePausedMutations(); + __privateGet(this, _queryCache).onOnline(); + } + })); + } + unmount() { + var _a, _b; + __privateWrapper(this, _mountCount)._--; + if (__privateGet(this, _mountCount) !== 0) return; + (_a = __privateGet(this, _unsubscribeFocus)) == null ? void 0 : _a.call(this); + __privateSet(this, _unsubscribeFocus, void 0); + (_b = __privateGet(this, _unsubscribeOnline)) == null ? void 0 : _b.call(this); + __privateSet(this, _unsubscribeOnline, void 0); + } + isFetching(filters) { + return __privateGet(this, _queryCache).findAll({ ...filters, fetchStatus: "fetching" }).length; + } + isMutating(filters) { + return __privateGet(this, _mutationCache).findAll({ ...filters, status: "pending" }).length; + } + /** + * Imperative (non-reactive) way to retrieve data for a QueryKey. + * Should only be used in callbacks or functions where reading the latest data is necessary, e.g. for optimistic updates. + * + * Hint: Do not use this function inside a component, because it won't receive updates. + * Use `useQuery` to create a `QueryObserver` that subscribes to changes. + */ + getQueryData(queryKey) { + var _a; + const options = this.defaultQueryOptions({ queryKey }); + return (_a = __privateGet(this, _queryCache).get(options.queryHash)) == null ? void 0 : _a.state.data; + } + ensureQueryData(options) { + const defaultedOptions = this.defaultQueryOptions(options); + const query = __privateGet(this, _queryCache).build(this, defaultedOptions); + const cachedData = query.state.data; + if (cachedData === void 0) { + return this.fetchQuery(options); + } + if (options.revalidateIfStale && query.isStaleByTime(resolveStaleTime(defaultedOptions.staleTime, query))) { + void this.prefetchQuery(defaultedOptions); + } + return Promise.resolve(cachedData); + } + getQueriesData(filters) { + return __privateGet(this, _queryCache).findAll(filters).map(({ queryKey, state }) => { + const data = state.data; + return [queryKey, data]; + }); + } + setQueryData(queryKey, updater, options) { + const defaultedOptions = this.defaultQueryOptions({ queryKey }); + const query = __privateGet(this, _queryCache).get( + defaultedOptions.queryHash + ); + const prevData = query == null ? void 0 : query.state.data; + const data = functionalUpdate(updater, prevData); + if (data === void 0) { + return void 0; + } + return __privateGet(this, _queryCache).build(this, defaultedOptions).setData(data, { ...options, manual: true }); + } + setQueriesData(filters, updater, options) { + return notifyManager.batch( + () => __privateGet(this, _queryCache).findAll(filters).map(({ queryKey }) => [ + queryKey, + this.setQueryData(queryKey, updater, options) + ]) + ); + } + getQueryState(queryKey) { + var _a; + const options = this.defaultQueryOptions({ queryKey }); + return (_a = __privateGet(this, _queryCache).get( + options.queryHash + )) == null ? void 0 : _a.state; + } + removeQueries(filters) { + const queryCache = __privateGet(this, _queryCache); + notifyManager.batch(() => { + queryCache.findAll(filters).forEach((query) => { + queryCache.remove(query); + }); + }); + } + resetQueries(filters, options) { + const queryCache = __privateGet(this, _queryCache); + return notifyManager.batch(() => { + queryCache.findAll(filters).forEach((query) => { + query.reset(); + }); + return this.refetchQueries( + { + type: "active", + ...filters + }, + options + ); + }); + } + cancelQueries(filters, cancelOptions = {}) { + const defaultedCancelOptions = { revert: true, ...cancelOptions }; + const promises = notifyManager.batch( + () => __privateGet(this, _queryCache).findAll(filters).map((query) => query.cancel(defaultedCancelOptions)) + ); + return Promise.all(promises).then(noop).catch(noop); + } + invalidateQueries(filters, options = {}) { + return notifyManager.batch(() => { + __privateGet(this, _queryCache).findAll(filters).forEach((query) => { + query.invalidate(); + }); + if ((filters == null ? void 0 : filters.refetchType) === "none") { + return Promise.resolve(); + } + return this.refetchQueries( + { + ...filters, + type: (filters == null ? void 0 : filters.refetchType) ?? (filters == null ? void 0 : filters.type) ?? "active" + }, + options + ); + }); + } + refetchQueries(filters, options = {}) { + const fetchOptions = { + ...options, + cancelRefetch: options.cancelRefetch ?? true + }; + const promises = notifyManager.batch( + () => __privateGet(this, _queryCache).findAll(filters).filter((query) => !query.isDisabled() && !query.isStatic()).map((query) => { + let promise = query.fetch(void 0, fetchOptions); + if (!fetchOptions.throwOnError) { + promise = promise.catch(noop); + } + return query.state.fetchStatus === "paused" ? Promise.resolve() : promise; + }) + ); + return Promise.all(promises).then(noop); + } + fetchQuery(options) { + const defaultedOptions = this.defaultQueryOptions(options); + if (defaultedOptions.retry === void 0) { + defaultedOptions.retry = false; + } + const query = __privateGet(this, _queryCache).build(this, defaultedOptions); + return query.isStaleByTime( + resolveStaleTime(defaultedOptions.staleTime, query) + ) ? query.fetch(defaultedOptions) : Promise.resolve(query.state.data); + } + prefetchQuery(options) { + return this.fetchQuery(options).then(noop).catch(noop); + } + fetchInfiniteQuery(options) { + options.behavior = infiniteQueryBehavior(options.pages); + return this.fetchQuery(options); + } + prefetchInfiniteQuery(options) { + return this.fetchInfiniteQuery(options).then(noop).catch(noop); + } + ensureInfiniteQueryData(options) { + options.behavior = infiniteQueryBehavior(options.pages); + return this.ensureQueryData(options); + } + resumePausedMutations() { + if (onlineManager.isOnline()) { + return __privateGet(this, _mutationCache).resumePausedMutations(); + } + return Promise.resolve(); + } + getQueryCache() { + return __privateGet(this, _queryCache); + } + getMutationCache() { + return __privateGet(this, _mutationCache); + } + getDefaultOptions() { + return __privateGet(this, _defaultOptions); + } + setDefaultOptions(options) { + __privateSet(this, _defaultOptions, options); + } + setQueryDefaults(queryKey, options) { + __privateGet(this, _queryDefaults).set(hashKey(queryKey), { + queryKey, + defaultOptions: options + }); + } + getQueryDefaults(queryKey) { + const defaults = [...__privateGet(this, _queryDefaults).values()]; + const result = {}; + defaults.forEach((queryDefault) => { + if (partialMatchKey(queryKey, queryDefault.queryKey)) { + Object.assign(result, queryDefault.defaultOptions); + } + }); + return result; + } + setMutationDefaults(mutationKey, options) { + __privateGet(this, _mutationDefaults).set(hashKey(mutationKey), { + mutationKey, + defaultOptions: options + }); + } + getMutationDefaults(mutationKey) { + const defaults = [...__privateGet(this, _mutationDefaults).values()]; + const result = {}; + defaults.forEach((queryDefault) => { + if (partialMatchKey(mutationKey, queryDefault.mutationKey)) { + Object.assign(result, queryDefault.defaultOptions); + } + }); + return result; + } + defaultQueryOptions(options) { + if (options._defaulted) { + return options; + } + const defaultedOptions = { + ...__privateGet(this, _defaultOptions).queries, + ...this.getQueryDefaults(options.queryKey), + ...options, + _defaulted: true + }; + if (!defaultedOptions.queryHash) { + defaultedOptions.queryHash = hashQueryKeyByOptions( + defaultedOptions.queryKey, + defaultedOptions + ); + } + if (defaultedOptions.refetchOnReconnect === void 0) { + defaultedOptions.refetchOnReconnect = defaultedOptions.networkMode !== "always"; + } + if (defaultedOptions.throwOnError === void 0) { + defaultedOptions.throwOnError = !!defaultedOptions.suspense; + } + if (!defaultedOptions.networkMode && defaultedOptions.persister) { + defaultedOptions.networkMode = "offlineFirst"; + } + if (defaultedOptions.queryFn === skipToken) { + defaultedOptions.enabled = false; + } + return defaultedOptions; + } + defaultMutationOptions(options) { + if (options == null ? void 0 : options._defaulted) { + return options; + } + return { + ...__privateGet(this, _defaultOptions).mutations, + ...(options == null ? void 0 : options.mutationKey) && this.getMutationDefaults(options.mutationKey), + ...options, + _defaulted: true + }; + } + clear() { + __privateGet(this, _queryCache).clear(); + __privateGet(this, _mutationCache).clear(); + } +}; +_queryCache = new WeakMap(); +_mutationCache = new WeakMap(); +_defaultOptions = new WeakMap(); +_queryDefaults = new WeakMap(); +_mutationDefaults = new WeakMap(); +_mountCount = new WeakMap(); +_unsubscribeFocus = new WeakMap(); +_unsubscribeOnline = new WeakMap(); +export { + QueryClient +}; +//# sourceMappingURL=queryClient.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/queryClient.js.map b/node_modules/@tanstack/query-core/build/legacy/queryClient.js.map new file mode 100644 index 0000000..d72ccf5 --- /dev/null +++ b/node_modules/@tanstack/query-core/build/legacy/queryClient.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/queryClient.ts"],"sourcesContent":["import {\n functionalUpdate,\n hashKey,\n hashQueryKeyByOptions,\n noop,\n partialMatchKey,\n resolveStaleTime,\n skipToken,\n} from './utils'\nimport { QueryCache } from './queryCache'\nimport { MutationCache } from './mutationCache'\nimport { focusManager } from './focusManager'\nimport { onlineManager } from './onlineManager'\nimport { notifyManager } from './notifyManager'\nimport { infiniteQueryBehavior } from './infiniteQueryBehavior'\nimport type {\n CancelOptions,\n DefaultError,\n DefaultOptions,\n DefaultedQueryObserverOptions,\n EnsureInfiniteQueryDataOptions,\n EnsureQueryDataOptions,\n FetchInfiniteQueryOptions,\n FetchQueryOptions,\n InferDataFromTag,\n InferErrorFromTag,\n InfiniteData,\n InvalidateOptions,\n InvalidateQueryFilters,\n MutationKey,\n MutationObserverOptions,\n MutationOptions,\n NoInfer,\n OmitKeyof,\n QueryClientConfig,\n QueryKey,\n QueryObserverOptions,\n QueryOptions,\n RefetchOptions,\n RefetchQueryFilters,\n ResetOptions,\n SetDataOptions,\n} from './types'\nimport type { QueryState } from './query'\nimport type { MutationFilters, QueryFilters, Updater } from './utils'\n\n// TYPES\n\ninterface QueryDefaults {\n queryKey: QueryKey\n defaultOptions: OmitKeyof, 'queryKey'>\n}\n\ninterface MutationDefaults {\n mutationKey: MutationKey\n defaultOptions: MutationOptions\n}\n\n// CLASS\n\nexport class QueryClient {\n #queryCache: QueryCache\n #mutationCache: MutationCache\n #defaultOptions: DefaultOptions\n #queryDefaults: Map\n #mutationDefaults: Map\n #mountCount: number\n #unsubscribeFocus?: () => void\n #unsubscribeOnline?: () => void\n\n constructor(config: QueryClientConfig = {}) {\n this.#queryCache = config.queryCache || new QueryCache()\n this.#mutationCache = config.mutationCache || new MutationCache()\n this.#defaultOptions = config.defaultOptions || {}\n this.#queryDefaults = new Map()\n this.#mutationDefaults = new Map()\n this.#mountCount = 0\n }\n\n mount(): void {\n this.#mountCount++\n if (this.#mountCount !== 1) return\n\n this.#unsubscribeFocus = focusManager.subscribe(async (focused) => {\n if (focused) {\n await this.resumePausedMutations()\n this.#queryCache.onFocus()\n }\n })\n this.#unsubscribeOnline = onlineManager.subscribe(async (online) => {\n if (online) {\n await this.resumePausedMutations()\n this.#queryCache.onOnline()\n }\n })\n }\n\n unmount(): void {\n this.#mountCount--\n if (this.#mountCount !== 0) return\n\n this.#unsubscribeFocus?.()\n this.#unsubscribeFocus = undefined\n\n this.#unsubscribeOnline?.()\n this.#unsubscribeOnline = undefined\n }\n\n isFetching = QueryFilters>(\n filters?: TQueryFilters,\n ): number {\n return this.#queryCache.findAll({ ...filters, fetchStatus: 'fetching' })\n .length\n }\n\n isMutating<\n TMutationFilters extends MutationFilters = MutationFilters,\n >(filters?: TMutationFilters): number {\n return this.#mutationCache.findAll({ ...filters, status: 'pending' }).length\n }\n\n /**\n * Imperative (non-reactive) way to retrieve data for a QueryKey.\n * Should only be used in callbacks or functions where reading the latest data is necessary, e.g. for optimistic updates.\n *\n * Hint: Do not use this function inside a component, because it won't receive updates.\n * Use `useQuery` to create a `QueryObserver` that subscribes to changes.\n */\n getQueryData<\n TQueryFnData = unknown,\n TTaggedQueryKey extends QueryKey = QueryKey,\n TInferredQueryFnData = InferDataFromTag,\n >(queryKey: TTaggedQueryKey): TInferredQueryFnData | undefined {\n const options = this.defaultQueryOptions({ queryKey })\n\n return this.#queryCache.get(options.queryHash)?.state\n .data\n }\n\n ensureQueryData<\n TQueryFnData,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n >(\n options: EnsureQueryDataOptions,\n ): Promise {\n const defaultedOptions = this.defaultQueryOptions(options)\n const query = this.#queryCache.build(this, defaultedOptions)\n const cachedData = query.state.data\n\n if (cachedData === undefined) {\n return this.fetchQuery(options)\n }\n\n if (\n options.revalidateIfStale &&\n query.isStaleByTime(resolveStaleTime(defaultedOptions.staleTime, query))\n ) {\n void this.prefetchQuery(defaultedOptions)\n }\n\n return Promise.resolve(cachedData)\n }\n\n getQueriesData<\n TQueryFnData = unknown,\n TQueryFilters extends QueryFilters = QueryFilters,\n >(filters: TQueryFilters): Array<[QueryKey, TQueryFnData | undefined]> {\n return this.#queryCache.findAll(filters).map(({ queryKey, state }) => {\n const data = state.data as TQueryFnData | undefined\n return [queryKey, data]\n })\n }\n\n setQueryData<\n TQueryFnData = unknown,\n TTaggedQueryKey extends QueryKey = QueryKey,\n TInferredQueryFnData = InferDataFromTag,\n >(\n queryKey: TTaggedQueryKey,\n updater: Updater<\n NoInfer | undefined,\n NoInfer | undefined\n >,\n options?: SetDataOptions,\n ): NoInfer | undefined {\n const defaultedOptions = this.defaultQueryOptions<\n any,\n any,\n unknown,\n any,\n QueryKey\n >({ queryKey })\n\n const query = this.#queryCache.get(\n defaultedOptions.queryHash,\n )\n const prevData = query?.state.data\n const data = functionalUpdate(updater, prevData)\n\n if (data === undefined) {\n return undefined\n }\n\n return this.#queryCache\n .build(this, defaultedOptions)\n .setData(data, { ...options, manual: true })\n }\n\n setQueriesData<\n TQueryFnData,\n TQueryFilters extends QueryFilters = QueryFilters,\n >(\n filters: TQueryFilters,\n updater: Updater<\n NoInfer | undefined,\n NoInfer | undefined\n >,\n options?: SetDataOptions,\n ): Array<[QueryKey, TQueryFnData | undefined]> {\n return notifyManager.batch(() =>\n this.#queryCache\n .findAll(filters)\n .map(({ queryKey }) => [\n queryKey,\n this.setQueryData(queryKey, updater, options),\n ]),\n )\n }\n\n getQueryState<\n TQueryFnData = unknown,\n TError = DefaultError,\n TTaggedQueryKey extends QueryKey = QueryKey,\n TInferredQueryFnData = InferDataFromTag,\n TInferredError = InferErrorFromTag,\n >(\n queryKey: TTaggedQueryKey,\n ): QueryState | undefined {\n const options = this.defaultQueryOptions({ queryKey })\n return this.#queryCache.get(\n options.queryHash,\n )?.state\n }\n\n removeQueries(\n filters?: QueryFilters,\n ): void {\n const queryCache = this.#queryCache\n notifyManager.batch(() => {\n queryCache.findAll(filters).forEach((query) => {\n queryCache.remove(query)\n })\n })\n }\n\n resetQueries(\n filters?: QueryFilters,\n options?: ResetOptions,\n ): Promise {\n const queryCache = this.#queryCache\n\n return notifyManager.batch(() => {\n queryCache.findAll(filters).forEach((query) => {\n query.reset()\n })\n return this.refetchQueries(\n {\n type: 'active',\n ...filters,\n },\n options,\n )\n })\n }\n\n cancelQueries(\n filters?: QueryFilters,\n cancelOptions: CancelOptions = {},\n ): Promise {\n const defaultedCancelOptions = { revert: true, ...cancelOptions }\n\n const promises = notifyManager.batch(() =>\n this.#queryCache\n .findAll(filters)\n .map((query) => query.cancel(defaultedCancelOptions)),\n )\n\n return Promise.all(promises).then(noop).catch(noop)\n }\n\n invalidateQueries(\n filters?: InvalidateQueryFilters,\n options: InvalidateOptions = {},\n ): Promise {\n return notifyManager.batch(() => {\n this.#queryCache.findAll(filters).forEach((query) => {\n query.invalidate()\n })\n\n if (filters?.refetchType === 'none') {\n return Promise.resolve()\n }\n return this.refetchQueries(\n {\n ...filters,\n type: filters?.refetchType ?? filters?.type ?? 'active',\n },\n options,\n )\n })\n }\n\n refetchQueries(\n filters?: RefetchQueryFilters,\n options: RefetchOptions = {},\n ): Promise {\n const fetchOptions = {\n ...options,\n cancelRefetch: options.cancelRefetch ?? true,\n }\n const promises = notifyManager.batch(() =>\n this.#queryCache\n .findAll(filters)\n .filter((query) => !query.isDisabled() && !query.isStatic())\n .map((query) => {\n let promise = query.fetch(undefined, fetchOptions)\n if (!fetchOptions.throwOnError) {\n promise = promise.catch(noop)\n }\n return query.state.fetchStatus === 'paused'\n ? Promise.resolve()\n : promise\n }),\n )\n\n return Promise.all(promises).then(noop)\n }\n\n fetchQuery<\n TQueryFnData,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = never,\n >(\n options: FetchQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n ): Promise {\n const defaultedOptions = this.defaultQueryOptions(options)\n\n // https://github.com/tannerlinsley/react-query/issues/652\n if (defaultedOptions.retry === undefined) {\n defaultedOptions.retry = false\n }\n\n const query = this.#queryCache.build(this, defaultedOptions)\n\n return query.isStaleByTime(\n resolveStaleTime(defaultedOptions.staleTime, query),\n )\n ? query.fetch(defaultedOptions)\n : Promise.resolve(query.state.data as TData)\n }\n\n prefetchQuery<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n >(\n options: FetchQueryOptions,\n ): Promise {\n return this.fetchQuery(options).then(noop).catch(noop)\n }\n\n fetchInfiniteQuery<\n TQueryFnData,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n >(\n options: FetchInfiniteQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n ): Promise> {\n options.behavior = infiniteQueryBehavior<\n TQueryFnData,\n TError,\n TData,\n TPageParam\n >(options.pages)\n return this.fetchQuery(options as any)\n }\n\n prefetchInfiniteQuery<\n TQueryFnData,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n >(\n options: FetchInfiniteQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n ): Promise {\n return this.fetchInfiniteQuery(options).then(noop).catch(noop)\n }\n\n ensureInfiniteQueryData<\n TQueryFnData,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n >(\n options: EnsureInfiniteQueryDataOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n ): Promise> {\n options.behavior = infiniteQueryBehavior<\n TQueryFnData,\n TError,\n TData,\n TPageParam\n >(options.pages)\n\n return this.ensureQueryData(options as any)\n }\n\n resumePausedMutations(): Promise {\n if (onlineManager.isOnline()) {\n return this.#mutationCache.resumePausedMutations()\n }\n return Promise.resolve()\n }\n\n getQueryCache(): QueryCache {\n return this.#queryCache\n }\n\n getMutationCache(): MutationCache {\n return this.#mutationCache\n }\n\n getDefaultOptions(): DefaultOptions {\n return this.#defaultOptions\n }\n\n setDefaultOptions(options: DefaultOptions): void {\n this.#defaultOptions = options\n }\n\n setQueryDefaults<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryData = TQueryFnData,\n >(\n queryKey: QueryKey,\n options: Partial<\n OmitKeyof<\n QueryObserverOptions,\n 'queryKey'\n >\n >,\n ): void {\n this.#queryDefaults.set(hashKey(queryKey), {\n queryKey,\n defaultOptions: options,\n })\n }\n\n getQueryDefaults(\n queryKey: QueryKey,\n ): OmitKeyof, 'queryKey'> {\n const defaults = [...this.#queryDefaults.values()]\n\n const result: OmitKeyof<\n QueryObserverOptions,\n 'queryKey'\n > = {}\n\n defaults.forEach((queryDefault) => {\n if (partialMatchKey(queryKey, queryDefault.queryKey)) {\n Object.assign(result, queryDefault.defaultOptions)\n }\n })\n return result\n }\n\n setMutationDefaults<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n >(\n mutationKey: MutationKey,\n options: OmitKeyof<\n MutationObserverOptions,\n 'mutationKey'\n >,\n ): void {\n this.#mutationDefaults.set(hashKey(mutationKey), {\n mutationKey,\n defaultOptions: options,\n })\n }\n\n getMutationDefaults(\n mutationKey: MutationKey,\n ): OmitKeyof, 'mutationKey'> {\n const defaults = [...this.#mutationDefaults.values()]\n\n const result: OmitKeyof<\n MutationObserverOptions,\n 'mutationKey'\n > = {}\n\n defaults.forEach((queryDefault) => {\n if (partialMatchKey(mutationKey, queryDefault.mutationKey)) {\n Object.assign(result, queryDefault.defaultOptions)\n }\n })\n\n return result\n }\n\n defaultQueryOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = never,\n >(\n options:\n | QueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey,\n TPageParam\n >\n | DefaultedQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >,\n ): DefaultedQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n > {\n if (options._defaulted) {\n return options as DefaultedQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >\n }\n\n const defaultedOptions = {\n ...this.#defaultOptions.queries,\n ...this.getQueryDefaults(options.queryKey),\n ...options,\n _defaulted: true,\n }\n\n if (!defaultedOptions.queryHash) {\n defaultedOptions.queryHash = hashQueryKeyByOptions(\n defaultedOptions.queryKey,\n defaultedOptions,\n )\n }\n\n // dependent default values\n if (defaultedOptions.refetchOnReconnect === undefined) {\n defaultedOptions.refetchOnReconnect =\n defaultedOptions.networkMode !== 'always'\n }\n if (defaultedOptions.throwOnError === undefined) {\n defaultedOptions.throwOnError = !!defaultedOptions.suspense\n }\n\n if (!defaultedOptions.networkMode && defaultedOptions.persister) {\n defaultedOptions.networkMode = 'offlineFirst'\n }\n\n if (defaultedOptions.queryFn === skipToken) {\n defaultedOptions.enabled = false\n }\n\n return defaultedOptions as DefaultedQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >\n }\n\n defaultMutationOptions>(\n options?: T,\n ): T {\n if (options?._defaulted) {\n return options\n }\n return {\n ...this.#defaultOptions.mutations,\n ...(options?.mutationKey &&\n this.getMutationDefaults(options.mutationKey)),\n ...options,\n _defaulted: true,\n } as T\n }\n\n clear(): void {\n this.#queryCache.clear()\n this.#mutationCache.clear()\n }\n}\n"],"mappings":";;;;;;;;AAAA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,kBAAkB;AAC3B,SAAS,qBAAqB;AAC9B,SAAS,oBAAoB;AAC7B,SAAS,qBAAqB;AAC9B,SAAS,qBAAqB;AAC9B,SAAS,6BAA6B;AAdtC;AA4DO,IAAM,cAAN,MAAkB;AAAA,EAUvB,YAAY,SAA4B,CAAC,GAAG;AAT5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGE,uBAAK,aAAc,OAAO,cAAc,IAAI,WAAW;AACvD,uBAAK,gBAAiB,OAAO,iBAAiB,IAAI,cAAc;AAChE,uBAAK,iBAAkB,OAAO,kBAAkB,CAAC;AACjD,uBAAK,gBAAiB,oBAAI,IAAI;AAC9B,uBAAK,mBAAoB,oBAAI,IAAI;AACjC,uBAAK,aAAc;AAAA,EACrB;AAAA,EAEA,QAAc;AACZ,2BAAK,aAAL;AACA,QAAI,mBAAK,iBAAgB,EAAG;AAE5B,uBAAK,mBAAoB,aAAa,UAAU,OAAO,YAAY;AACjE,UAAI,SAAS;AACX,cAAM,KAAK,sBAAsB;AACjC,2BAAK,aAAY,QAAQ;AAAA,MAC3B;AAAA,IACF,CAAC;AACD,uBAAK,oBAAqB,cAAc,UAAU,OAAO,WAAW;AAClE,UAAI,QAAQ;AACV,cAAM,KAAK,sBAAsB;AACjC,2BAAK,aAAY,SAAS;AAAA,MAC5B;AAAA,IACF,CAAC;AAAA,EACH;AAAA,EAEA,UAAgB;AAjGlB;AAkGI,2BAAK,aAAL;AACA,QAAI,mBAAK,iBAAgB,EAAG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AAC1C,uBAAiB,UAAU;AAAA,IAC7B;AAEA,WAAO;AAAA,EAOT;AAAA,EAEA,uBACE,SACG;AACH,QAAI,mCAAS,YAAY;AACvB,aAAO;AAAA,IACT;AACA,WAAO;AAAA,MACL,GAAG,mBAAK,iBAAgB;AAAA,MACxB,IAAI,mCAAS,gBACX,KAAK,oBAAoB,QAAQ,WAAW;AAAA,MAC9C,GAAG;AAAA,MACH,YAAY;AAAA,IACd;AAAA,EACF;AAAA,EAEA,QAAc;AACZ,uBAAK,aAAY,MAAM;AACvB,uBAAK,gBAAe,MAAM;AAAA,EAC5B;AACF;AA1kBE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/queryObserver.cjs b/node_modules/@tanstack/query-core/build/legacy/queryObserver.cjs new file mode 100644 index 0000000..ac652b7 --- /dev/null +++ b/node_modules/@tanstack/query-core/build/legacy/queryObserver.cjs @@ -0,0 +1,515 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __typeError = (msg) => { + throw TypeError(msg); +}; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg); +var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj)); +var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value); +var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value); +var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method); + +// src/queryObserver.ts +var queryObserver_exports = {}; +__export(queryObserver_exports, { + QueryObserver: () => QueryObserver +}); +module.exports = __toCommonJS(queryObserver_exports); +var import_focusManager = require("./focusManager.cjs"); +var import_notifyManager = require("./notifyManager.cjs"); +var import_query = require("./query.cjs"); +var import_subscribable = require("./subscribable.cjs"); +var import_thenable = require("./thenable.cjs"); +var import_utils = require("./utils.cjs"); +var import_timeoutManager = require("./timeoutManager.cjs"); +var _client, _currentQuery, _currentQueryInitialState, _currentResult, _currentResultState, _currentResultOptions, _currentThenable, _selectError, _selectFn, _selectResult, _lastQueryWithDefinedData, _staleTimeoutId, _refetchIntervalId, _currentRefetchInterval, _trackedProps, _QueryObserver_instances, executeFetch_fn, updateStaleTimeout_fn, computeRefetchInterval_fn, updateRefetchInterval_fn, updateTimers_fn, clearStaleTimeout_fn, clearRefetchInterval_fn, updateQuery_fn, notify_fn; +var QueryObserver = class extends import_subscribable.Subscribable { + constructor(client, options) { + super(); + this.options = options; + __privateAdd(this, _QueryObserver_instances); + __privateAdd(this, _client); + __privateAdd(this, _currentQuery); + __privateAdd(this, _currentQueryInitialState); + __privateAdd(this, _currentResult); + __privateAdd(this, _currentResultState); + __privateAdd(this, _currentResultOptions); + __privateAdd(this, _currentThenable); + __privateAdd(this, _selectError); + __privateAdd(this, _selectFn); + __privateAdd(this, _selectResult); + // This property keeps track of the last query with defined data. + // It will be used to pass the previous data and query to the placeholder function between renders. + __privateAdd(this, _lastQueryWithDefinedData); + __privateAdd(this, _staleTimeoutId); + __privateAdd(this, _refetchIntervalId); + __privateAdd(this, _currentRefetchInterval); + __privateAdd(this, _trackedProps, /* @__PURE__ */ new Set()); + __privateSet(this, _client, client); + __privateSet(this, _selectError, null); + __privateSet(this, _currentThenable, (0, import_thenable.pendingThenable)()); + this.bindMethods(); + this.setOptions(options); + } + bindMethods() { + this.refetch = this.refetch.bind(this); + } + onSubscribe() { + if (this.listeners.size === 1) { + __privateGet(this, _currentQuery).addObserver(this); + if (shouldFetchOnMount(__privateGet(this, _currentQuery), this.options)) { + __privateMethod(this, _QueryObserver_instances, executeFetch_fn).call(this); + } else { + this.updateResult(); + } + __privateMethod(this, _QueryObserver_instances, updateTimers_fn).call(this); + } + } + onUnsubscribe() { + if (!this.hasListeners()) { + this.destroy(); + } + } + shouldFetchOnReconnect() { + return shouldFetchOn( + __privateGet(this, _currentQuery), + this.options, + this.options.refetchOnReconnect + ); + } + shouldFetchOnWindowFocus() { + return shouldFetchOn( + __privateGet(this, _currentQuery), + this.options, + this.options.refetchOnWindowFocus + ); + } + destroy() { + this.listeners = /* @__PURE__ */ new Set(); + __privateMethod(this, _QueryObserver_instances, clearStaleTimeout_fn).call(this); + __privateMethod(this, _QueryObserver_instances, clearRefetchInterval_fn).call(this); + __privateGet(this, _currentQuery).removeObserver(this); + } + setOptions(options) { + const prevOptions = this.options; + const prevQuery = __privateGet(this, _currentQuery); + this.options = __privateGet(this, _client).defaultQueryOptions(options); + if (this.options.enabled !== void 0 && typeof this.options.enabled !== "boolean" && typeof this.options.enabled !== "function" && typeof (0, import_utils.resolveEnabled)(this.options.enabled, __privateGet(this, _currentQuery)) !== "boolean") { + throw new Error( + "Expected enabled to be a boolean or a callback that returns a boolean" + ); + } + __privateMethod(this, _QueryObserver_instances, updateQuery_fn).call(this); + __privateGet(this, _currentQuery).setOptions(this.options); + if (prevOptions._defaulted && !(0, import_utils.shallowEqualObjects)(this.options, prevOptions)) { + __privateGet(this, _client).getQueryCache().notify({ + type: "observerOptionsUpdated", + query: __privateGet(this, _currentQuery), + observer: this + }); + } + const mounted = this.hasListeners(); + if (mounted && shouldFetchOptionally( + __privateGet(this, _currentQuery), + prevQuery, + this.options, + prevOptions + )) { + __privateMethod(this, _QueryObserver_instances, executeFetch_fn).call(this); + } + this.updateResult(); + if (mounted && (__privateGet(this, _currentQuery) !== prevQuery || (0, import_utils.resolveEnabled)(this.options.enabled, __privateGet(this, _currentQuery)) !== (0, import_utils.resolveEnabled)(prevOptions.enabled, __privateGet(this, _currentQuery)) || (0, import_utils.resolveStaleTime)(this.options.staleTime, __privateGet(this, _currentQuery)) !== (0, import_utils.resolveStaleTime)(prevOptions.staleTime, __privateGet(this, _currentQuery)))) { + __privateMethod(this, _QueryObserver_instances, updateStaleTimeout_fn).call(this); + } + const nextRefetchInterval = __privateMethod(this, _QueryObserver_instances, computeRefetchInterval_fn).call(this); + if (mounted && (__privateGet(this, _currentQuery) !== prevQuery || (0, import_utils.resolveEnabled)(this.options.enabled, __privateGet(this, _currentQuery)) !== (0, import_utils.resolveEnabled)(prevOptions.enabled, __privateGet(this, _currentQuery)) || nextRefetchInterval !== __privateGet(this, _currentRefetchInterval))) { + __privateMethod(this, _QueryObserver_instances, updateRefetchInterval_fn).call(this, nextRefetchInterval); + } + } + getOptimisticResult(options) { + const query = __privateGet(this, _client).getQueryCache().build(__privateGet(this, _client), options); + const result = this.createResult(query, options); + if (shouldAssignObserverCurrentProperties(this, result)) { + __privateSet(this, _currentResult, result); + __privateSet(this, _currentResultOptions, this.options); + __privateSet(this, _currentResultState, __privateGet(this, _currentQuery).state); + } + return result; + } + getCurrentResult() { + return __privateGet(this, _currentResult); + } + trackResult(result, onPropTracked) { + return new Proxy(result, { + get: (target, key) => { + this.trackProp(key); + onPropTracked == null ? void 0 : onPropTracked(key); + if (key === "promise") { + this.trackProp("data"); + if (!this.options.experimental_prefetchInRender && __privateGet(this, _currentThenable).status === "pending") { + __privateGet(this, _currentThenable).reject( + new Error( + "experimental_prefetchInRender feature flag is not enabled" + ) + ); + } + } + return Reflect.get(target, key); + } + }); + } + trackProp(key) { + __privateGet(this, _trackedProps).add(key); + } + getCurrentQuery() { + return __privateGet(this, _currentQuery); + } + refetch({ ...options } = {}) { + return this.fetch({ + ...options + }); + } + fetchOptimistic(options) { + const defaultedOptions = __privateGet(this, _client).defaultQueryOptions(options); + const query = __privateGet(this, _client).getQueryCache().build(__privateGet(this, _client), defaultedOptions); + return query.fetch().then(() => this.createResult(query, defaultedOptions)); + } + fetch(fetchOptions) { + return __privateMethod(this, _QueryObserver_instances, executeFetch_fn).call(this, { + ...fetchOptions, + cancelRefetch: fetchOptions.cancelRefetch ?? true + }).then(() => { + this.updateResult(); + return __privateGet(this, _currentResult); + }); + } + createResult(query, options) { + var _a; + const prevQuery = __privateGet(this, _currentQuery); + const prevOptions = this.options; + const prevResult = __privateGet(this, _currentResult); + const prevResultState = __privateGet(this, _currentResultState); + const prevResultOptions = __privateGet(this, _currentResultOptions); + const queryChange = query !== prevQuery; + const queryInitialState = queryChange ? query.state : __privateGet(this, _currentQueryInitialState); + const { state } = query; + let newState = { ...state }; + let isPlaceholderData = false; + let data; + if (options._optimisticResults) { + const mounted = this.hasListeners(); + const fetchOnMount = !mounted && shouldFetchOnMount(query, options); + const fetchOptionally = mounted && shouldFetchOptionally(query, prevQuery, options, prevOptions); + if (fetchOnMount || fetchOptionally) { + newState = { + ...newState, + ...(0, import_query.fetchState)(state.data, query.options) + }; + } + if (options._optimisticResults === "isRestoring") { + newState.fetchStatus = "idle"; + } + } + let { error, errorUpdatedAt, status } = newState; + data = newState.data; + let skipSelect = false; + if (options.placeholderData !== void 0 && data === void 0 && status === "pending") { + let placeholderData; + if ((prevResult == null ? void 0 : prevResult.isPlaceholderData) && options.placeholderData === (prevResultOptions == null ? void 0 : prevResultOptions.placeholderData)) { + placeholderData = prevResult.data; + skipSelect = true; + } else { + placeholderData = typeof options.placeholderData === "function" ? options.placeholderData( + (_a = __privateGet(this, _lastQueryWithDefinedData)) == null ? void 0 : _a.state.data, + __privateGet(this, _lastQueryWithDefinedData) + ) : options.placeholderData; + } + if (placeholderData !== void 0) { + status = "success"; + data = (0, import_utils.replaceData)( + prevResult == null ? void 0 : prevResult.data, + placeholderData, + options + ); + isPlaceholderData = true; + } + } + if (options.select && data !== void 0 && !skipSelect) { + if (prevResult && data === (prevResultState == null ? void 0 : prevResultState.data) && options.select === __privateGet(this, _selectFn)) { + data = __privateGet(this, _selectResult); + } else { + try { + __privateSet(this, _selectFn, options.select); + data = options.select(data); + data = (0, import_utils.replaceData)(prevResult == null ? void 0 : prevResult.data, data, options); + __privateSet(this, _selectResult, data); + __privateSet(this, _selectError, null); + } catch (selectError) { + __privateSet(this, _selectError, selectError); + } + } + } + if (__privateGet(this, _selectError)) { + error = __privateGet(this, _selectError); + data = __privateGet(this, _selectResult); + errorUpdatedAt = Date.now(); + status = "error"; + } + const isFetching = newState.fetchStatus === "fetching"; + const isPending = status === "pending"; + const isError = status === "error"; + const isLoading = isPending && isFetching; + const hasData = data !== void 0; + const result = { + status, + fetchStatus: newState.fetchStatus, + isPending, + isSuccess: status === "success", + isError, + isInitialLoading: isLoading, + isLoading, + data, + dataUpdatedAt: newState.dataUpdatedAt, + error, + errorUpdatedAt, + failureCount: newState.fetchFailureCount, + failureReason: newState.fetchFailureReason, + errorUpdateCount: newState.errorUpdateCount, + isFetched: newState.dataUpdateCount > 0 || newState.errorUpdateCount > 0, + isFetchedAfterMount: newState.dataUpdateCount > queryInitialState.dataUpdateCount || newState.errorUpdateCount > queryInitialState.errorUpdateCount, + isFetching, + isRefetching: isFetching && !isPending, + isLoadingError: isError && !hasData, + isPaused: newState.fetchStatus === "paused", + isPlaceholderData, + isRefetchError: isError && hasData, + isStale: isStale(query, options), + refetch: this.refetch, + promise: __privateGet(this, _currentThenable), + isEnabled: (0, import_utils.resolveEnabled)(options.enabled, query) !== false + }; + const nextResult = result; + if (this.options.experimental_prefetchInRender) { + const hasResultData = nextResult.data !== void 0; + const isErrorWithoutData = nextResult.status === "error" && !hasResultData; + const finalizeThenableIfPossible = (thenable) => { + if (isErrorWithoutData) { + thenable.reject(nextResult.error); + } else if (hasResultData) { + thenable.resolve(nextResult.data); + } + }; + const recreateThenable = () => { + const pending = __privateSet(this, _currentThenable, nextResult.promise = (0, import_thenable.pendingThenable)()); + finalizeThenableIfPossible(pending); + }; + const prevThenable = __privateGet(this, _currentThenable); + switch (prevThenable.status) { + case "pending": + if (query.queryHash === prevQuery.queryHash) { + finalizeThenableIfPossible(prevThenable); + } + break; + case "fulfilled": + if (isErrorWithoutData || nextResult.data !== prevThenable.value) { + recreateThenable(); + } + break; + case "rejected": + if (!isErrorWithoutData || nextResult.error !== prevThenable.reason) { + recreateThenable(); + } + break; + } + } + return nextResult; + } + updateResult() { + const prevResult = __privateGet(this, _currentResult); + const nextResult = this.createResult(__privateGet(this, _currentQuery), this.options); + __privateSet(this, _currentResultState, __privateGet(this, _currentQuery).state); + __privateSet(this, _currentResultOptions, this.options); + if (__privateGet(this, _currentResultState).data !== void 0) { + __privateSet(this, _lastQueryWithDefinedData, __privateGet(this, _currentQuery)); + } + if ((0, import_utils.shallowEqualObjects)(nextResult, prevResult)) { + return; + } + __privateSet(this, _currentResult, nextResult); + const shouldNotifyListeners = () => { + if (!prevResult) { + return true; + } + const { notifyOnChangeProps } = this.options; + const notifyOnChangePropsValue = typeof notifyOnChangeProps === "function" ? notifyOnChangeProps() : notifyOnChangeProps; + if (notifyOnChangePropsValue === "all" || !notifyOnChangePropsValue && !__privateGet(this, _trackedProps).size) { + return true; + } + const includedProps = new Set( + notifyOnChangePropsValue ?? __privateGet(this, _trackedProps) + ); + if (this.options.throwOnError) { + includedProps.add("error"); + } + return Object.keys(__privateGet(this, _currentResult)).some((key) => { + const typedKey = key; + const changed = __privateGet(this, _currentResult)[typedKey] !== prevResult[typedKey]; + return changed && includedProps.has(typedKey); + }); + }; + __privateMethod(this, _QueryObserver_instances, notify_fn).call(this, { listeners: shouldNotifyListeners() }); + } + onQueryUpdate() { + this.updateResult(); + if (this.hasListeners()) { + __privateMethod(this, _QueryObserver_instances, updateTimers_fn).call(this); + } + } +}; +_client = new WeakMap(); +_currentQuery = new WeakMap(); +_currentQueryInitialState = new WeakMap(); +_currentResult = new WeakMap(); +_currentResultState = new WeakMap(); +_currentResultOptions = new WeakMap(); +_currentThenable = new WeakMap(); +_selectError = new WeakMap(); +_selectFn = new WeakMap(); +_selectResult = new WeakMap(); +_lastQueryWithDefinedData = new WeakMap(); +_staleTimeoutId = new WeakMap(); +_refetchIntervalId = new WeakMap(); +_currentRefetchInterval = new WeakMap(); +_trackedProps = new WeakMap(); +_QueryObserver_instances = new WeakSet(); +executeFetch_fn = function(fetchOptions) { + __privateMethod(this, _QueryObserver_instances, updateQuery_fn).call(this); + let promise = __privateGet(this, _currentQuery).fetch( + this.options, + fetchOptions + ); + if (!(fetchOptions == null ? void 0 : fetchOptions.throwOnError)) { + promise = promise.catch(import_utils.noop); + } + return promise; +}; +updateStaleTimeout_fn = function() { + __privateMethod(this, _QueryObserver_instances, clearStaleTimeout_fn).call(this); + const staleTime = (0, import_utils.resolveStaleTime)( + this.options.staleTime, + __privateGet(this, _currentQuery) + ); + if (import_utils.isServer || __privateGet(this, _currentResult).isStale || !(0, import_utils.isValidTimeout)(staleTime)) { + return; + } + const time = (0, import_utils.timeUntilStale)(__privateGet(this, _currentResult).dataUpdatedAt, staleTime); + const timeout = time + 1; + __privateSet(this, _staleTimeoutId, import_timeoutManager.timeoutManager.setTimeout(() => { + if (!__privateGet(this, _currentResult).isStale) { + this.updateResult(); + } + }, timeout)); +}; +computeRefetchInterval_fn = function() { + return (typeof this.options.refetchInterval === "function" ? this.options.refetchInterval(__privateGet(this, _currentQuery)) : this.options.refetchInterval) ?? false; +}; +updateRefetchInterval_fn = function(nextInterval) { + __privateMethod(this, _QueryObserver_instances, clearRefetchInterval_fn).call(this); + __privateSet(this, _currentRefetchInterval, nextInterval); + if (import_utils.isServer || (0, import_utils.resolveEnabled)(this.options.enabled, __privateGet(this, _currentQuery)) === false || !(0, import_utils.isValidTimeout)(__privateGet(this, _currentRefetchInterval)) || __privateGet(this, _currentRefetchInterval) === 0) { + return; + } + __privateSet(this, _refetchIntervalId, import_timeoutManager.timeoutManager.setInterval(() => { + if (this.options.refetchIntervalInBackground || import_focusManager.focusManager.isFocused()) { + __privateMethod(this, _QueryObserver_instances, executeFetch_fn).call(this); + } + }, __privateGet(this, _currentRefetchInterval))); +}; +updateTimers_fn = function() { + __privateMethod(this, _QueryObserver_instances, updateStaleTimeout_fn).call(this); + __privateMethod(this, _QueryObserver_instances, updateRefetchInterval_fn).call(this, __privateMethod(this, _QueryObserver_instances, computeRefetchInterval_fn).call(this)); +}; +clearStaleTimeout_fn = function() { + if (__privateGet(this, _staleTimeoutId)) { + import_timeoutManager.timeoutManager.clearTimeout(__privateGet(this, _staleTimeoutId)); + __privateSet(this, _staleTimeoutId, void 0); + } +}; +clearRefetchInterval_fn = function() { + if (__privateGet(this, _refetchIntervalId)) { + import_timeoutManager.timeoutManager.clearInterval(__privateGet(this, _refetchIntervalId)); + __privateSet(this, _refetchIntervalId, void 0); + } +}; +updateQuery_fn = function() { + const query = __privateGet(this, _client).getQueryCache().build(__privateGet(this, _client), this.options); + if (query === __privateGet(this, _currentQuery)) { + return; + } + const prevQuery = __privateGet(this, _currentQuery); + __privateSet(this, _currentQuery, query); + __privateSet(this, _currentQueryInitialState, query.state); + if (this.hasListeners()) { + prevQuery == null ? void 0 : prevQuery.removeObserver(this); + query.addObserver(this); + } +}; +notify_fn = function(notifyOptions) { + import_notifyManager.notifyManager.batch(() => { + if (notifyOptions.listeners) { + this.listeners.forEach((listener) => { + listener(__privateGet(this, _currentResult)); + }); + } + __privateGet(this, _client).getQueryCache().notify({ + query: __privateGet(this, _currentQuery), + type: "observerResultsUpdated" + }); + }); +}; +function shouldLoadOnMount(query, options) { + return (0, import_utils.resolveEnabled)(options.enabled, query) !== false && query.state.data === void 0 && !(query.state.status === "error" && options.retryOnMount === false); +} +function shouldFetchOnMount(query, options) { + return shouldLoadOnMount(query, options) || query.state.data !== void 0 && shouldFetchOn(query, options, options.refetchOnMount); +} +function shouldFetchOn(query, options, field) { + if ((0, import_utils.resolveEnabled)(options.enabled, query) !== false && (0, import_utils.resolveStaleTime)(options.staleTime, query) !== "static") { + const value = typeof field === "function" ? field(query) : field; + return value === "always" || value !== false && isStale(query, options); + } + return false; +} +function shouldFetchOptionally(query, prevQuery, options, prevOptions) { + return (query !== prevQuery || (0, import_utils.resolveEnabled)(prevOptions.enabled, query) === false) && (!options.suspense || query.state.status !== "error") && isStale(query, options); +} +function isStale(query, options) { + return (0, import_utils.resolveEnabled)(options.enabled, query) !== false && query.isStaleByTime((0, import_utils.resolveStaleTime)(options.staleTime, query)); +} +function shouldAssignObserverCurrentProperties(observer, optimisticResult) { + if (!(0, import_utils.shallowEqualObjects)(observer.getCurrentResult(), optimisticResult)) { + return true; + } + return false; +} +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + QueryObserver +}); +//# sourceMappingURL=queryObserver.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/queryObserver.cjs.map b/node_modules/@tanstack/query-core/build/legacy/queryObserver.cjs.map new file mode 100644 index 0000000..3c03c8c --- /dev/null +++ b/node_modules/@tanstack/query-core/build/legacy/queryObserver.cjs.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/queryObserver.ts"],"sourcesContent":["import { focusManager } from './focusManager'\nimport { notifyManager } from './notifyManager'\nimport { fetchState } from './query'\nimport { Subscribable } from './subscribable'\nimport { pendingThenable } from './thenable'\nimport {\n isServer,\n isValidTimeout,\n noop,\n replaceData,\n resolveEnabled,\n resolveStaleTime,\n shallowEqualObjects,\n timeUntilStale,\n} from './utils'\nimport { timeoutManager } from './timeoutManager'\nimport type { ManagedTimerId } from './timeoutManager'\nimport type { FetchOptions, Query, QueryState } from './query'\nimport type { QueryClient } from './queryClient'\nimport type { PendingThenable, Thenable } from './thenable'\nimport type {\n DefaultError,\n DefaultedQueryObserverOptions,\n PlaceholderDataFunction,\n QueryKey,\n QueryObserverBaseResult,\n QueryObserverOptions,\n QueryObserverResult,\n RefetchOptions,\n} from './types'\n\ntype QueryObserverListener = (\n result: QueryObserverResult,\n) => void\n\ninterface ObserverFetchOptions extends FetchOptions {\n throwOnError?: boolean\n}\n\nexport class QueryObserver<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> extends Subscribable> {\n #client: QueryClient\n #currentQuery: Query = undefined!\n #currentQueryInitialState: QueryState = undefined!\n #currentResult: QueryObserverResult = undefined!\n #currentResultState?: QueryState\n #currentResultOptions?: QueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >\n #currentThenable: Thenable\n #selectError: TError | null\n #selectFn?: (data: TQueryData) => TData\n #selectResult?: TData\n // This property keeps track of the last query with defined data.\n // It will be used to pass the previous data and query to the placeholder function between renders.\n #lastQueryWithDefinedData?: Query\n #staleTimeoutId?: ManagedTimerId\n #refetchIntervalId?: ManagedTimerId\n #currentRefetchInterval?: number | false\n #trackedProps = new Set()\n\n constructor(\n client: QueryClient,\n public options: QueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >,\n ) {\n super()\n\n this.#client = client\n this.#selectError = null\n this.#currentThenable = pendingThenable()\n\n this.bindMethods()\n this.setOptions(options)\n }\n\n protected bindMethods(): void {\n this.refetch = this.refetch.bind(this)\n }\n\n protected onSubscribe(): void {\n if (this.listeners.size === 1) {\n this.#currentQuery.addObserver(this)\n\n if (shouldFetchOnMount(this.#currentQuery, this.options)) {\n this.#executeFetch()\n } else {\n this.updateResult()\n }\n\n this.#updateTimers()\n }\n }\n\n protected onUnsubscribe(): void {\n if (!this.hasListeners()) {\n this.destroy()\n }\n }\n\n shouldFetchOnReconnect(): boolean {\n return shouldFetchOn(\n this.#currentQuery,\n this.options,\n this.options.refetchOnReconnect,\n )\n }\n\n shouldFetchOnWindowFocus(): boolean {\n return shouldFetchOn(\n this.#currentQuery,\n this.options,\n this.options.refetchOnWindowFocus,\n )\n }\n\n destroy(): void {\n this.listeners = new Set()\n this.#clearStaleTimeout()\n this.#clearRefetchInterval()\n this.#currentQuery.removeObserver(this)\n }\n\n setOptions(\n options: QueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >,\n ): void {\n const prevOptions = this.options\n const prevQuery = this.#currentQuery\n\n this.options = this.#client.defaultQueryOptions(options)\n\n if (\n this.options.enabled !== undefined &&\n typeof this.options.enabled !== 'boolean' &&\n typeof this.options.enabled !== 'function' &&\n typeof resolveEnabled(this.options.enabled, this.#currentQuery) !==\n 'boolean'\n ) {\n throw new Error(\n 'Expected enabled to be a boolean or a callback that returns a boolean',\n )\n }\n\n this.#updateQuery()\n this.#currentQuery.setOptions(this.options)\n\n if (\n prevOptions._defaulted &&\n !shallowEqualObjects(this.options, prevOptions)\n ) {\n this.#client.getQueryCache().notify({\n type: 'observerOptionsUpdated',\n query: this.#currentQuery,\n observer: this,\n })\n }\n\n const mounted = this.hasListeners()\n\n // Fetch if there are subscribers\n if (\n mounted &&\n shouldFetchOptionally(\n this.#currentQuery,\n prevQuery,\n this.options,\n prevOptions,\n )\n ) {\n this.#executeFetch()\n }\n\n // Update result\n this.updateResult()\n\n // Update stale interval if needed\n if (\n mounted &&\n (this.#currentQuery !== prevQuery ||\n resolveEnabled(this.options.enabled, this.#currentQuery) !==\n resolveEnabled(prevOptions.enabled, this.#currentQuery) ||\n resolveStaleTime(this.options.staleTime, this.#currentQuery) !==\n resolveStaleTime(prevOptions.staleTime, this.#currentQuery))\n ) {\n this.#updateStaleTimeout()\n }\n\n const nextRefetchInterval = this.#computeRefetchInterval()\n\n // Update refetch interval if needed\n if (\n mounted &&\n (this.#currentQuery !== prevQuery ||\n resolveEnabled(this.options.enabled, this.#currentQuery) !==\n resolveEnabled(prevOptions.enabled, this.#currentQuery) ||\n nextRefetchInterval !== this.#currentRefetchInterval)\n ) {\n this.#updateRefetchInterval(nextRefetchInterval)\n }\n }\n\n getOptimisticResult(\n options: DefaultedQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >,\n ): QueryObserverResult {\n const query = this.#client.getQueryCache().build(this.#client, options)\n\n const result = this.createResult(query, options)\n\n if (shouldAssignObserverCurrentProperties(this, result)) {\n // this assigns the optimistic result to the current Observer\n // because if the query function changes, useQuery will be performing\n // an effect where it would fetch again.\n // When the fetch finishes, we perform a deep data cloning in order\n // to reuse objects references. This deep data clone is performed against\n // the `observer.currentResult.data` property\n // When QueryKey changes, we refresh the query and get new `optimistic`\n // result, while we leave the `observer.currentResult`, so when new data\n // arrives, it finds the old `observer.currentResult` which is related\n // to the old QueryKey. Which means that currentResult and selectData are\n // out of sync already.\n // To solve this, we move the cursor of the currentResult every time\n // an observer reads an optimistic value.\n\n // When keeping the previous data, the result doesn't change until new\n // data arrives.\n this.#currentResult = result\n this.#currentResultOptions = this.options\n this.#currentResultState = this.#currentQuery.state\n }\n return result\n }\n\n getCurrentResult(): QueryObserverResult {\n return this.#currentResult\n }\n\n trackResult(\n result: QueryObserverResult,\n onPropTracked?: (key: keyof QueryObserverResult) => void,\n ): QueryObserverResult {\n return new Proxy(result, {\n get: (target, key) => {\n this.trackProp(key as keyof QueryObserverResult)\n onPropTracked?.(key as keyof QueryObserverResult)\n if (key === 'promise') {\n this.trackProp('data')\n if (\n !this.options.experimental_prefetchInRender &&\n this.#currentThenable.status === 'pending'\n ) {\n this.#currentThenable.reject(\n new Error(\n 'experimental_prefetchInRender feature flag is not enabled',\n ),\n )\n }\n }\n return Reflect.get(target, key)\n },\n })\n }\n\n trackProp(key: keyof QueryObserverResult) {\n this.#trackedProps.add(key)\n }\n\n getCurrentQuery(): Query {\n return this.#currentQuery\n }\n\n refetch({ ...options }: RefetchOptions = {}): Promise<\n QueryObserverResult\n > {\n return this.fetch({\n ...options,\n })\n }\n\n fetchOptimistic(\n options: QueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >,\n ): Promise> {\n const defaultedOptions = this.#client.defaultQueryOptions(options)\n\n const query = this.#client\n .getQueryCache()\n .build(this.#client, defaultedOptions)\n\n return query.fetch().then(() => this.createResult(query, defaultedOptions))\n }\n\n protected fetch(\n fetchOptions: ObserverFetchOptions,\n ): Promise> {\n return this.#executeFetch({\n ...fetchOptions,\n cancelRefetch: fetchOptions.cancelRefetch ?? true,\n }).then(() => {\n this.updateResult()\n return this.#currentResult\n })\n }\n\n #executeFetch(\n fetchOptions?: Omit,\n ): Promise {\n // Make sure we reference the latest query as the current one might have been removed\n this.#updateQuery()\n\n // Fetch\n let promise: Promise = this.#currentQuery.fetch(\n this.options,\n fetchOptions,\n )\n\n if (!fetchOptions?.throwOnError) {\n promise = promise.catch(noop)\n }\n\n return promise\n }\n\n #updateStaleTimeout(): void {\n this.#clearStaleTimeout()\n const staleTime = resolveStaleTime(\n this.options.staleTime,\n this.#currentQuery,\n )\n\n if (isServer || this.#currentResult.isStale || !isValidTimeout(staleTime)) {\n return\n }\n\n const time = timeUntilStale(this.#currentResult.dataUpdatedAt, staleTime)\n\n // The timeout is sometimes triggered 1 ms before the stale time expiration.\n // To mitigate this issue we always add 1 ms to the timeout.\n const timeout = time + 1\n\n this.#staleTimeoutId = timeoutManager.setTimeout(() => {\n if (!this.#currentResult.isStale) {\n this.updateResult()\n }\n }, timeout)\n }\n\n #computeRefetchInterval() {\n return (\n (typeof this.options.refetchInterval === 'function'\n ? this.options.refetchInterval(this.#currentQuery)\n : this.options.refetchInterval) ?? false\n )\n }\n\n #updateRefetchInterval(nextInterval: number | false): void {\n this.#clearRefetchInterval()\n\n this.#currentRefetchInterval = nextInterval\n\n if (\n isServer ||\n resolveEnabled(this.options.enabled, this.#currentQuery) === false ||\n !isValidTimeout(this.#currentRefetchInterval) ||\n this.#currentRefetchInterval === 0\n ) {\n return\n }\n\n this.#refetchIntervalId = timeoutManager.setInterval(() => {\n if (\n this.options.refetchIntervalInBackground ||\n focusManager.isFocused()\n ) {\n this.#executeFetch()\n }\n }, this.#currentRefetchInterval)\n }\n\n #updateTimers(): void {\n this.#updateStaleTimeout()\n this.#updateRefetchInterval(this.#computeRefetchInterval())\n }\n\n #clearStaleTimeout(): void {\n if (this.#staleTimeoutId) {\n timeoutManager.clearTimeout(this.#staleTimeoutId)\n this.#staleTimeoutId = undefined\n }\n }\n\n #clearRefetchInterval(): void {\n if (this.#refetchIntervalId) {\n timeoutManager.clearInterval(this.#refetchIntervalId)\n this.#refetchIntervalId = undefined\n }\n }\n\n protected createResult(\n query: Query,\n options: QueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >,\n ): QueryObserverResult {\n const prevQuery = this.#currentQuery\n const prevOptions = this.options\n const prevResult = this.#currentResult as\n | QueryObserverResult\n | undefined\n const prevResultState = this.#currentResultState\n const prevResultOptions = this.#currentResultOptions\n const queryChange = query !== prevQuery\n const queryInitialState = queryChange\n ? query.state\n : this.#currentQueryInitialState\n\n const { state } = query\n let newState = { ...state }\n let isPlaceholderData = false\n let data: TData | undefined\n\n // Optimistically set result in fetching state if needed\n if (options._optimisticResults) {\n const mounted = this.hasListeners()\n\n const fetchOnMount = !mounted && shouldFetchOnMount(query, options)\n\n const fetchOptionally =\n mounted && shouldFetchOptionally(query, prevQuery, options, prevOptions)\n\n if (fetchOnMount || fetchOptionally) {\n newState = {\n ...newState,\n ...fetchState(state.data, query.options),\n }\n }\n if (options._optimisticResults === 'isRestoring') {\n newState.fetchStatus = 'idle'\n }\n }\n\n let { error, errorUpdatedAt, status } = newState\n\n // Per default, use query data\n data = newState.data as unknown as TData\n let skipSelect = false\n\n // use placeholderData if needed\n if (\n options.placeholderData !== undefined &&\n data === undefined &&\n status === 'pending'\n ) {\n let placeholderData\n\n // Memoize placeholder data\n if (\n prevResult?.isPlaceholderData &&\n options.placeholderData === prevResultOptions?.placeholderData\n ) {\n placeholderData = prevResult.data\n // we have to skip select when reading this memoization\n // because prevResult.data is already \"selected\"\n skipSelect = true\n } else {\n // compute placeholderData\n placeholderData =\n typeof options.placeholderData === 'function'\n ? (\n options.placeholderData as unknown as PlaceholderDataFunction\n )(\n this.#lastQueryWithDefinedData?.state.data,\n this.#lastQueryWithDefinedData as any,\n )\n : options.placeholderData\n }\n\n if (placeholderData !== undefined) {\n status = 'success'\n data = replaceData(\n prevResult?.data,\n placeholderData as unknown,\n options,\n ) as TData\n isPlaceholderData = true\n }\n }\n\n // Select data if needed\n // this also runs placeholderData through the select function\n if (options.select && data !== undefined && !skipSelect) {\n // Memoize select result\n if (\n prevResult &&\n data === prevResultState?.data &&\n options.select === this.#selectFn\n ) {\n data = this.#selectResult\n } else {\n try {\n this.#selectFn = options.select\n data = options.select(data as any)\n data = replaceData(prevResult?.data, data, options)\n this.#selectResult = data\n this.#selectError = null\n } catch (selectError) {\n this.#selectError = selectError as TError\n }\n }\n }\n\n if (this.#selectError) {\n error = this.#selectError\n data = this.#selectResult\n errorUpdatedAt = Date.now()\n status = 'error'\n }\n\n const isFetching = newState.fetchStatus === 'fetching'\n const isPending = status === 'pending'\n const isError = status === 'error'\n\n const isLoading = isPending && isFetching\n const hasData = data !== undefined\n\n const result: QueryObserverBaseResult = {\n status,\n fetchStatus: newState.fetchStatus,\n isPending,\n isSuccess: status === 'success',\n isError,\n isInitialLoading: isLoading,\n isLoading,\n data,\n dataUpdatedAt: newState.dataUpdatedAt,\n error,\n errorUpdatedAt,\n failureCount: newState.fetchFailureCount,\n failureReason: newState.fetchFailureReason,\n errorUpdateCount: newState.errorUpdateCount,\n isFetched: newState.dataUpdateCount > 0 || newState.errorUpdateCount > 0,\n isFetchedAfterMount:\n newState.dataUpdateCount > queryInitialState.dataUpdateCount ||\n newState.errorUpdateCount > queryInitialState.errorUpdateCount,\n isFetching,\n isRefetching: isFetching && !isPending,\n isLoadingError: isError && !hasData,\n isPaused: newState.fetchStatus === 'paused',\n isPlaceholderData,\n isRefetchError: isError && hasData,\n isStale: isStale(query, options),\n refetch: this.refetch,\n promise: this.#currentThenable,\n isEnabled: resolveEnabled(options.enabled, query) !== false,\n }\n\n const nextResult = result as QueryObserverResult\n\n if (this.options.experimental_prefetchInRender) {\n const hasResultData = nextResult.data !== undefined\n const isErrorWithoutData = nextResult.status === 'error' && !hasResultData\n const finalizeThenableIfPossible = (thenable: PendingThenable) => {\n if (isErrorWithoutData) {\n thenable.reject(nextResult.error)\n } else if (hasResultData) {\n thenable.resolve(nextResult.data as TData)\n }\n }\n\n /**\n * Create a new thenable and result promise when the results have changed\n */\n const recreateThenable = () => {\n const pending =\n (this.#currentThenable =\n nextResult.promise =\n pendingThenable())\n\n finalizeThenableIfPossible(pending)\n }\n\n const prevThenable = this.#currentThenable\n switch (prevThenable.status) {\n case 'pending':\n // Finalize the previous thenable if it was pending\n // and we are still observing the same query\n if (query.queryHash === prevQuery.queryHash) {\n finalizeThenableIfPossible(prevThenable)\n }\n break\n case 'fulfilled':\n if (isErrorWithoutData || nextResult.data !== prevThenable.value) {\n recreateThenable()\n }\n break\n case 'rejected':\n if (!isErrorWithoutData || nextResult.error !== prevThenable.reason) {\n recreateThenable()\n }\n break\n }\n }\n\n return nextResult\n }\n\n updateResult(): void {\n const prevResult = this.#currentResult as\n | QueryObserverResult\n | undefined\n\n const nextResult = this.createResult(this.#currentQuery, this.options)\n\n this.#currentResultState = this.#currentQuery.state\n this.#currentResultOptions = this.options\n\n if (this.#currentResultState.data !== undefined) {\n this.#lastQueryWithDefinedData = this.#currentQuery\n }\n\n // Only notify and update result if something has changed\n if (shallowEqualObjects(nextResult, prevResult)) {\n return\n }\n\n this.#currentResult = nextResult\n\n const shouldNotifyListeners = (): boolean => {\n if (!prevResult) {\n return true\n }\n\n const { notifyOnChangeProps } = this.options\n const notifyOnChangePropsValue =\n typeof notifyOnChangeProps === 'function'\n ? notifyOnChangeProps()\n : notifyOnChangeProps\n\n if (\n notifyOnChangePropsValue === 'all' ||\n (!notifyOnChangePropsValue && !this.#trackedProps.size)\n ) {\n return true\n }\n\n const includedProps = new Set(\n notifyOnChangePropsValue ?? this.#trackedProps,\n )\n\n if (this.options.throwOnError) {\n includedProps.add('error')\n }\n\n return Object.keys(this.#currentResult).some((key) => {\n const typedKey = key as keyof QueryObserverResult\n const changed = this.#currentResult[typedKey] !== prevResult[typedKey]\n\n return changed && includedProps.has(typedKey)\n })\n }\n\n this.#notify({ listeners: shouldNotifyListeners() })\n }\n\n #updateQuery(): void {\n const query = this.#client.getQueryCache().build(this.#client, this.options)\n\n if (query === this.#currentQuery) {\n return\n }\n\n const prevQuery = this.#currentQuery as\n | Query\n | undefined\n this.#currentQuery = query\n this.#currentQueryInitialState = query.state\n\n if (this.hasListeners()) {\n prevQuery?.removeObserver(this)\n query.addObserver(this)\n }\n }\n\n onQueryUpdate(): void {\n this.updateResult()\n\n if (this.hasListeners()) {\n this.#updateTimers()\n }\n }\n\n #notify(notifyOptions: { listeners: boolean }): void {\n notifyManager.batch(() => {\n // First, trigger the listeners\n if (notifyOptions.listeners) {\n this.listeners.forEach((listener) => {\n listener(this.#currentResult)\n })\n }\n\n // Then the cache listeners\n this.#client.getQueryCache().notify({\n query: this.#currentQuery,\n type: 'observerResultsUpdated',\n })\n })\n }\n}\n\nfunction shouldLoadOnMount(\n query: Query,\n options: QueryObserverOptions,\n): boolean {\n return (\n resolveEnabled(options.enabled, query) !== false &&\n query.state.data === undefined &&\n !(query.state.status === 'error' && options.retryOnMount === false)\n )\n}\n\nfunction shouldFetchOnMount(\n query: Query,\n options: QueryObserverOptions,\n): boolean {\n return (\n shouldLoadOnMount(query, options) ||\n (query.state.data !== undefined &&\n shouldFetchOn(query, options, options.refetchOnMount))\n )\n}\n\nfunction shouldFetchOn(\n query: Query,\n options: QueryObserverOptions,\n field: (typeof options)['refetchOnMount'] &\n (typeof options)['refetchOnWindowFocus'] &\n (typeof options)['refetchOnReconnect'],\n) {\n if (\n resolveEnabled(options.enabled, query) !== false &&\n resolveStaleTime(options.staleTime, query) !== 'static'\n ) {\n const value = typeof field === 'function' ? field(query) : field\n\n return value === 'always' || (value !== false && isStale(query, options))\n }\n return false\n}\n\nfunction shouldFetchOptionally(\n query: Query,\n prevQuery: Query,\n options: QueryObserverOptions,\n prevOptions: QueryObserverOptions,\n): boolean {\n return (\n (query !== prevQuery ||\n resolveEnabled(prevOptions.enabled, query) === false) &&\n (!options.suspense || query.state.status !== 'error') &&\n isStale(query, options)\n )\n}\n\nfunction isStale(\n query: Query,\n options: QueryObserverOptions,\n): boolean {\n return (\n resolveEnabled(options.enabled, query) !== false &&\n query.isStaleByTime(resolveStaleTime(options.staleTime, query))\n )\n}\n\n// this function would decide if we will update the observer's 'current'\n// properties after an optimistic reading via getOptimisticResult\nfunction shouldAssignObserverCurrentProperties<\n TQueryFnData = unknown,\n TError = unknown,\n TData = TQueryFnData,\n TQueryData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n observer: QueryObserver,\n optimisticResult: QueryObserverResult,\n) {\n // if the newly created result isn't what the observer is holding as current,\n // then we'll need to update the properties as well\n if (!shallowEqualObjects(observer.getCurrentResult(), optimisticResult)) {\n return true\n }\n\n // basically, just keep previous properties if nothing changed\n return false\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,0BAA6B;AAC7B,2BAA8B;AAC9B,mBAA2B;AAC3B,0BAA6B;AAC7B,sBAAgC;AAChC,mBASO;AACP,4BAA+B;AAf/B;AAuCO,IAAM,gBAAN,cAMG,iCAAmD;AAAA,EAyB3D,YACE,QACO,SAOP;AACA,UAAM;AARC;AAjCJ;AAOL;AACA;AACA;AACA;AACA;AACA;AAOA;AACA;AACA;AACA;AAGA;AAAA;AAAA;AACA;AACA;AACA;AACA,sCAAgB,oBAAI,IAA+B;AAcjD,uBAAK,SAAU;AACf,uBAAK,cAAe;AACpB,uBAAK,sBAAmB,iCAAgB;AAExC,SAAK,YAAY;AACjB,SAAK,WAAW,OAAO;AAAA,EACzB;AAAA,EAEU,cAAoB;AAC5B,SAAK,UAAU,KAAK,QAAQ,KAAK,IAAI;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BAAS,mBAAK,eAAc;AAAA,MAC9B,CAAC;AAAA,IACH;AAGA,uBAAK,SAAQ,cAAc,EAAE,OAAO;AAAA,MAClC,OAAO,mBAAK;AAAA,MACZ,MAAM;AAAA,IACR,CAAC;AAAA,EACH,CAAC;AACH;AAGF,SAAS,kBACP,OACA,SACS;AACT,aACE,6BAAe,QAAQ,SAAS,KAAK,MAAM,SAC3C,MAAM,MAAM,SAAS,UACrB,EAAE,MAAM,MAAM,WAAW,WAAW,QAAQ,iBAAiB;AAEjE;AAEA,SAAS,mBACP,OACA,SACS;AACT,SACE,kBAAkB,OAAO,OAAO,KAC/B,MAAM,MAAM,SAAS,UACpB,cAAc,OAAO,SAAS,QAAQ,cAAc;AAE1D;AAEA,SAAS,cACP,OACA,SACA,OAGA;AACA,UACE,6BAAe,QAAQ,SAAS,KAAK,MAAM,aAC3C,+BAAiB,QAAQ,WAAW,KAAK,MAAM,UAC/C;AACA,UAAM,QAAQ,OAAO,UAAU,aAAa,MAAM,KAAK,IAAI;AAE3D,WAAO,UAAU,YAAa,UAAU,SAAS,QAAQ,OAAO,OAAO;AAAA,EACzE;AACA,SAAO;AACT;AAEA,SAAS,sBACP,OACA,WACA,SACA,aACS;AACT,UACG,UAAU,iBACT,6BAAe,YAAY,SAAS,KAAK,MAAM,WAChD,CAAC,QAAQ,YAAY,MAAM,MAAM,WAAW,YAC7C,QAAQ,OAAO,OAAO;AAE1B;AAEA,SAAS,QACP,OACA,SACS;AACT,aACE,6BAAe,QAAQ,SAAS,KAAK,MAAM,SAC3C,MAAM,kBAAc,+BAAiB,QAAQ,WAAW,KAAK,CAAC;AAElE;AAIA,SAAS,sCAOP,UACA,kBACA;AAGA,MAAI,KAAC,kCAAoB,SAAS,iBAAiB,GAAG,gBAAgB,GAAG;AACvE,WAAO;AAAA,EACT;AAGA,SAAO;AACT;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/queryObserver.d.cts b/node_modules/@tanstack/query-core/build/legacy/queryObserver.d.cts new file mode 100644 index 0000000..36ba2bd --- /dev/null +++ b/node_modules/@tanstack/query-core/build/legacy/queryObserver.d.cts @@ -0,0 +1,3 @@ +import './subscribable.cjs'; +export { i as QueryObserver } from './hydration-uphG6M-i.cjs'; +import './removable.cjs'; diff --git a/node_modules/@tanstack/query-core/build/legacy/queryObserver.d.ts b/node_modules/@tanstack/query-core/build/legacy/queryObserver.d.ts new file mode 100644 index 0000000..ae279c2 --- /dev/null +++ b/node_modules/@tanstack/query-core/build/legacy/queryObserver.d.ts @@ -0,0 +1,3 @@ +import './subscribable.js'; +export { i as QueryObserver } from './hydration-BlEVG2Lp.js'; +import './removable.js'; diff --git a/node_modules/@tanstack/query-core/build/legacy/queryObserver.js b/node_modules/@tanstack/query-core/build/legacy/queryObserver.js new file mode 100644 index 0000000..b6a9574 --- /dev/null +++ b/node_modules/@tanstack/query-core/build/legacy/queryObserver.js @@ -0,0 +1,498 @@ +import { + __privateAdd, + __privateGet, + __privateMethod, + __privateSet +} from "./chunk-PXG64RU4.js"; + +// src/queryObserver.ts +import { focusManager } from "./focusManager.js"; +import { notifyManager } from "./notifyManager.js"; +import { fetchState } from "./query.js"; +import { Subscribable } from "./subscribable.js"; +import { pendingThenable } from "./thenable.js"; +import { + isServer, + isValidTimeout, + noop, + replaceData, + resolveEnabled, + resolveStaleTime, + shallowEqualObjects, + timeUntilStale +} from "./utils.js"; +import { timeoutManager } from "./timeoutManager.js"; +var _client, _currentQuery, _currentQueryInitialState, _currentResult, _currentResultState, _currentResultOptions, _currentThenable, _selectError, _selectFn, _selectResult, _lastQueryWithDefinedData, _staleTimeoutId, _refetchIntervalId, _currentRefetchInterval, _trackedProps, _QueryObserver_instances, executeFetch_fn, updateStaleTimeout_fn, computeRefetchInterval_fn, updateRefetchInterval_fn, updateTimers_fn, clearStaleTimeout_fn, clearRefetchInterval_fn, updateQuery_fn, notify_fn; +var QueryObserver = class extends Subscribable { + constructor(client, options) { + super(); + this.options = options; + __privateAdd(this, _QueryObserver_instances); + __privateAdd(this, _client); + __privateAdd(this, _currentQuery); + __privateAdd(this, _currentQueryInitialState); + __privateAdd(this, _currentResult); + __privateAdd(this, _currentResultState); + __privateAdd(this, _currentResultOptions); + __privateAdd(this, _currentThenable); + __privateAdd(this, _selectError); + __privateAdd(this, _selectFn); + __privateAdd(this, _selectResult); + // This property keeps track of the last query with defined data. + // It will be used to pass the previous data and query to the placeholder function between renders. + __privateAdd(this, _lastQueryWithDefinedData); + __privateAdd(this, _staleTimeoutId); + __privateAdd(this, _refetchIntervalId); + __privateAdd(this, _currentRefetchInterval); + __privateAdd(this, _trackedProps, /* @__PURE__ */ new Set()); + __privateSet(this, _client, client); + __privateSet(this, _selectError, null); + __privateSet(this, _currentThenable, pendingThenable()); + this.bindMethods(); + this.setOptions(options); + } + bindMethods() { + this.refetch = this.refetch.bind(this); + } + onSubscribe() { + if (this.listeners.size === 1) { + __privateGet(this, _currentQuery).addObserver(this); + if (shouldFetchOnMount(__privateGet(this, _currentQuery), this.options)) { + __privateMethod(this, _QueryObserver_instances, executeFetch_fn).call(this); + } else { + this.updateResult(); + } + __privateMethod(this, _QueryObserver_instances, updateTimers_fn).call(this); + } + } + onUnsubscribe() { + if (!this.hasListeners()) { + this.destroy(); + } + } + shouldFetchOnReconnect() { + return shouldFetchOn( + __privateGet(this, _currentQuery), + this.options, + this.options.refetchOnReconnect + ); + } + shouldFetchOnWindowFocus() { + return shouldFetchOn( + __privateGet(this, _currentQuery), + this.options, + this.options.refetchOnWindowFocus + ); + } + destroy() { + this.listeners = /* @__PURE__ */ new Set(); + __privateMethod(this, _QueryObserver_instances, clearStaleTimeout_fn).call(this); + __privateMethod(this, _QueryObserver_instances, clearRefetchInterval_fn).call(this); + __privateGet(this, _currentQuery).removeObserver(this); + } + setOptions(options) { + const prevOptions = this.options; + const prevQuery = __privateGet(this, _currentQuery); + this.options = __privateGet(this, _client).defaultQueryOptions(options); + if (this.options.enabled !== void 0 && typeof this.options.enabled !== "boolean" && typeof this.options.enabled !== "function" && typeof resolveEnabled(this.options.enabled, __privateGet(this, _currentQuery)) !== "boolean") { + throw new Error( + "Expected enabled to be a boolean or a callback that returns a boolean" + ); + } + __privateMethod(this, _QueryObserver_instances, updateQuery_fn).call(this); + __privateGet(this, _currentQuery).setOptions(this.options); + if (prevOptions._defaulted && !shallowEqualObjects(this.options, prevOptions)) { + __privateGet(this, _client).getQueryCache().notify({ + type: "observerOptionsUpdated", + query: __privateGet(this, _currentQuery), + observer: this + }); + } + const mounted = this.hasListeners(); + if (mounted && shouldFetchOptionally( + __privateGet(this, _currentQuery), + prevQuery, + this.options, + prevOptions + )) { + __privateMethod(this, _QueryObserver_instances, executeFetch_fn).call(this); + } + this.updateResult(); + if (mounted && (__privateGet(this, _currentQuery) !== prevQuery || resolveEnabled(this.options.enabled, __privateGet(this, _currentQuery)) !== resolveEnabled(prevOptions.enabled, __privateGet(this, _currentQuery)) || resolveStaleTime(this.options.staleTime, __privateGet(this, _currentQuery)) !== resolveStaleTime(prevOptions.staleTime, __privateGet(this, _currentQuery)))) { + __privateMethod(this, _QueryObserver_instances, updateStaleTimeout_fn).call(this); + } + const nextRefetchInterval = __privateMethod(this, _QueryObserver_instances, computeRefetchInterval_fn).call(this); + if (mounted && (__privateGet(this, _currentQuery) !== prevQuery || resolveEnabled(this.options.enabled, __privateGet(this, _currentQuery)) !== resolveEnabled(prevOptions.enabled, __privateGet(this, _currentQuery)) || nextRefetchInterval !== __privateGet(this, _currentRefetchInterval))) { + __privateMethod(this, _QueryObserver_instances, updateRefetchInterval_fn).call(this, nextRefetchInterval); + } + } + getOptimisticResult(options) { + const query = __privateGet(this, _client).getQueryCache().build(__privateGet(this, _client), options); + const result = this.createResult(query, options); + if (shouldAssignObserverCurrentProperties(this, result)) { + __privateSet(this, _currentResult, result); + __privateSet(this, _currentResultOptions, this.options); + __privateSet(this, _currentResultState, __privateGet(this, _currentQuery).state); + } + return result; + } + getCurrentResult() { + return __privateGet(this, _currentResult); + } + trackResult(result, onPropTracked) { + return new Proxy(result, { + get: (target, key) => { + this.trackProp(key); + onPropTracked == null ? void 0 : onPropTracked(key); + if (key === "promise") { + this.trackProp("data"); + if (!this.options.experimental_prefetchInRender && __privateGet(this, _currentThenable).status === "pending") { + __privateGet(this, _currentThenable).reject( + new Error( + "experimental_prefetchInRender feature flag is not enabled" + ) + ); + } + } + return Reflect.get(target, key); + } + }); + } + trackProp(key) { + __privateGet(this, _trackedProps).add(key); + } + getCurrentQuery() { + return __privateGet(this, _currentQuery); + } + refetch({ ...options } = {}) { + return this.fetch({ + ...options + }); + } + fetchOptimistic(options) { + const defaultedOptions = __privateGet(this, _client).defaultQueryOptions(options); + const query = __privateGet(this, _client).getQueryCache().build(__privateGet(this, _client), defaultedOptions); + return query.fetch().then(() => this.createResult(query, defaultedOptions)); + } + fetch(fetchOptions) { + return __privateMethod(this, _QueryObserver_instances, executeFetch_fn).call(this, { + ...fetchOptions, + cancelRefetch: fetchOptions.cancelRefetch ?? true + }).then(() => { + this.updateResult(); + return __privateGet(this, _currentResult); + }); + } + createResult(query, options) { + var _a; + const prevQuery = __privateGet(this, _currentQuery); + const prevOptions = this.options; + const prevResult = __privateGet(this, _currentResult); + const prevResultState = __privateGet(this, _currentResultState); + const prevResultOptions = __privateGet(this, _currentResultOptions); + const queryChange = query !== prevQuery; + const queryInitialState = queryChange ? query.state : __privateGet(this, _currentQueryInitialState); + const { state } = query; + let newState = { ...state }; + let isPlaceholderData = false; + let data; + if (options._optimisticResults) { + const mounted = this.hasListeners(); + const fetchOnMount = !mounted && shouldFetchOnMount(query, options); + const fetchOptionally = mounted && shouldFetchOptionally(query, prevQuery, options, prevOptions); + if (fetchOnMount || fetchOptionally) { + newState = { + ...newState, + ...fetchState(state.data, query.options) + }; + } + if (options._optimisticResults === "isRestoring") { + newState.fetchStatus = "idle"; + } + } + let { error, errorUpdatedAt, status } = newState; + data = newState.data; + let skipSelect = false; + if (options.placeholderData !== void 0 && data === void 0 && status === "pending") { + let placeholderData; + if ((prevResult == null ? void 0 : prevResult.isPlaceholderData) && options.placeholderData === (prevResultOptions == null ? void 0 : prevResultOptions.placeholderData)) { + placeholderData = prevResult.data; + skipSelect = true; + } else { + placeholderData = typeof options.placeholderData === "function" ? options.placeholderData( + (_a = __privateGet(this, _lastQueryWithDefinedData)) == null ? void 0 : _a.state.data, + __privateGet(this, _lastQueryWithDefinedData) + ) : options.placeholderData; + } + if (placeholderData !== void 0) { + status = "success"; + data = replaceData( + prevResult == null ? void 0 : prevResult.data, + placeholderData, + options + ); + isPlaceholderData = true; + } + } + if (options.select && data !== void 0 && !skipSelect) { + if (prevResult && data === (prevResultState == null ? void 0 : prevResultState.data) && options.select === __privateGet(this, _selectFn)) { + data = __privateGet(this, _selectResult); + } else { + try { + __privateSet(this, _selectFn, options.select); + data = options.select(data); + data = replaceData(prevResult == null ? void 0 : prevResult.data, data, options); + __privateSet(this, _selectResult, data); + __privateSet(this, _selectError, null); + } catch (selectError) { + __privateSet(this, _selectError, selectError); + } + } + } + if (__privateGet(this, _selectError)) { + error = __privateGet(this, _selectError); + data = __privateGet(this, _selectResult); + errorUpdatedAt = Date.now(); + status = "error"; + } + const isFetching = newState.fetchStatus === "fetching"; + const isPending = status === "pending"; + const isError = status === "error"; + const isLoading = isPending && isFetching; + const hasData = data !== void 0; + const result = { + status, + fetchStatus: newState.fetchStatus, + isPending, + isSuccess: status === "success", + isError, + isInitialLoading: isLoading, + isLoading, + data, + dataUpdatedAt: newState.dataUpdatedAt, + error, + errorUpdatedAt, + failureCount: newState.fetchFailureCount, + failureReason: newState.fetchFailureReason, + errorUpdateCount: newState.errorUpdateCount, + isFetched: newState.dataUpdateCount > 0 || newState.errorUpdateCount > 0, + isFetchedAfterMount: newState.dataUpdateCount > queryInitialState.dataUpdateCount || newState.errorUpdateCount > queryInitialState.errorUpdateCount, + isFetching, + isRefetching: isFetching && !isPending, + isLoadingError: isError && !hasData, + isPaused: newState.fetchStatus === "paused", + isPlaceholderData, + isRefetchError: isError && hasData, + isStale: isStale(query, options), + refetch: this.refetch, + promise: __privateGet(this, _currentThenable), + isEnabled: resolveEnabled(options.enabled, query) !== false + }; + const nextResult = result; + if (this.options.experimental_prefetchInRender) { + const hasResultData = nextResult.data !== void 0; + const isErrorWithoutData = nextResult.status === "error" && !hasResultData; + const finalizeThenableIfPossible = (thenable) => { + if (isErrorWithoutData) { + thenable.reject(nextResult.error); + } else if (hasResultData) { + thenable.resolve(nextResult.data); + } + }; + const recreateThenable = () => { + const pending = __privateSet(this, _currentThenable, nextResult.promise = pendingThenable()); + finalizeThenableIfPossible(pending); + }; + const prevThenable = __privateGet(this, _currentThenable); + switch (prevThenable.status) { + case "pending": + if (query.queryHash === prevQuery.queryHash) { + finalizeThenableIfPossible(prevThenable); + } + break; + case "fulfilled": + if (isErrorWithoutData || nextResult.data !== prevThenable.value) { + recreateThenable(); + } + break; + case "rejected": + if (!isErrorWithoutData || nextResult.error !== prevThenable.reason) { + recreateThenable(); + } + break; + } + } + return nextResult; + } + updateResult() { + const prevResult = __privateGet(this, _currentResult); + const nextResult = this.createResult(__privateGet(this, _currentQuery), this.options); + __privateSet(this, _currentResultState, __privateGet(this, _currentQuery).state); + __privateSet(this, _currentResultOptions, this.options); + if (__privateGet(this, _currentResultState).data !== void 0) { + __privateSet(this, _lastQueryWithDefinedData, __privateGet(this, _currentQuery)); + } + if (shallowEqualObjects(nextResult, prevResult)) { + return; + } + __privateSet(this, _currentResult, nextResult); + const shouldNotifyListeners = () => { + if (!prevResult) { + return true; + } + const { notifyOnChangeProps } = this.options; + const notifyOnChangePropsValue = typeof notifyOnChangeProps === "function" ? notifyOnChangeProps() : notifyOnChangeProps; + if (notifyOnChangePropsValue === "all" || !notifyOnChangePropsValue && !__privateGet(this, _trackedProps).size) { + return true; + } + const includedProps = new Set( + notifyOnChangePropsValue ?? __privateGet(this, _trackedProps) + ); + if (this.options.throwOnError) { + includedProps.add("error"); + } + return Object.keys(__privateGet(this, _currentResult)).some((key) => { + const typedKey = key; + const changed = __privateGet(this, _currentResult)[typedKey] !== prevResult[typedKey]; + return changed && includedProps.has(typedKey); + }); + }; + __privateMethod(this, _QueryObserver_instances, notify_fn).call(this, { listeners: shouldNotifyListeners() }); + } + onQueryUpdate() { + this.updateResult(); + if (this.hasListeners()) { + __privateMethod(this, _QueryObserver_instances, updateTimers_fn).call(this); + } + } +}; +_client = new WeakMap(); +_currentQuery = new WeakMap(); +_currentQueryInitialState = new WeakMap(); +_currentResult = new WeakMap(); +_currentResultState = new WeakMap(); +_currentResultOptions = new WeakMap(); +_currentThenable = new WeakMap(); +_selectError = new WeakMap(); +_selectFn = new WeakMap(); +_selectResult = new WeakMap(); +_lastQueryWithDefinedData = new WeakMap(); +_staleTimeoutId = new WeakMap(); +_refetchIntervalId = new WeakMap(); +_currentRefetchInterval = new WeakMap(); +_trackedProps = new WeakMap(); +_QueryObserver_instances = new WeakSet(); +executeFetch_fn = function(fetchOptions) { + __privateMethod(this, _QueryObserver_instances, updateQuery_fn).call(this); + let promise = __privateGet(this, _currentQuery).fetch( + this.options, + fetchOptions + ); + if (!(fetchOptions == null ? void 0 : fetchOptions.throwOnError)) { + promise = promise.catch(noop); + } + return promise; +}; +updateStaleTimeout_fn = function() { + __privateMethod(this, _QueryObserver_instances, clearStaleTimeout_fn).call(this); + const staleTime = resolveStaleTime( + this.options.staleTime, + __privateGet(this, _currentQuery) + ); + if (isServer || __privateGet(this, _currentResult).isStale || !isValidTimeout(staleTime)) { + return; + } + const time = timeUntilStale(__privateGet(this, _currentResult).dataUpdatedAt, staleTime); + const timeout = time + 1; + __privateSet(this, _staleTimeoutId, timeoutManager.setTimeout(() => { + if (!__privateGet(this, _currentResult).isStale) { + this.updateResult(); + } + }, timeout)); +}; +computeRefetchInterval_fn = function() { + return (typeof this.options.refetchInterval === "function" ? this.options.refetchInterval(__privateGet(this, _currentQuery)) : this.options.refetchInterval) ?? false; +}; +updateRefetchInterval_fn = function(nextInterval) { + __privateMethod(this, _QueryObserver_instances, clearRefetchInterval_fn).call(this); + __privateSet(this, _currentRefetchInterval, nextInterval); + if (isServer || resolveEnabled(this.options.enabled, __privateGet(this, _currentQuery)) === false || !isValidTimeout(__privateGet(this, _currentRefetchInterval)) || __privateGet(this, _currentRefetchInterval) === 0) { + return; + } + __privateSet(this, _refetchIntervalId, timeoutManager.setInterval(() => { + if (this.options.refetchIntervalInBackground || focusManager.isFocused()) { + __privateMethod(this, _QueryObserver_instances, executeFetch_fn).call(this); + } + }, __privateGet(this, _currentRefetchInterval))); +}; +updateTimers_fn = function() { + __privateMethod(this, _QueryObserver_instances, updateStaleTimeout_fn).call(this); + __privateMethod(this, _QueryObserver_instances, updateRefetchInterval_fn).call(this, __privateMethod(this, _QueryObserver_instances, computeRefetchInterval_fn).call(this)); +}; +clearStaleTimeout_fn = function() { + if (__privateGet(this, _staleTimeoutId)) { + timeoutManager.clearTimeout(__privateGet(this, _staleTimeoutId)); + __privateSet(this, _staleTimeoutId, void 0); + } +}; +clearRefetchInterval_fn = function() { + if (__privateGet(this, _refetchIntervalId)) { + timeoutManager.clearInterval(__privateGet(this, _refetchIntervalId)); + __privateSet(this, _refetchIntervalId, void 0); + } +}; +updateQuery_fn = function() { + const query = __privateGet(this, _client).getQueryCache().build(__privateGet(this, _client), this.options); + if (query === __privateGet(this, _currentQuery)) { + return; + } + const prevQuery = __privateGet(this, _currentQuery); + __privateSet(this, _currentQuery, query); + __privateSet(this, _currentQueryInitialState, query.state); + if (this.hasListeners()) { + prevQuery == null ? void 0 : prevQuery.removeObserver(this); + query.addObserver(this); + } +}; +notify_fn = function(notifyOptions) { + notifyManager.batch(() => { + if (notifyOptions.listeners) { + this.listeners.forEach((listener) => { + listener(__privateGet(this, _currentResult)); + }); + } + __privateGet(this, _client).getQueryCache().notify({ + query: __privateGet(this, _currentQuery), + type: "observerResultsUpdated" + }); + }); +}; +function shouldLoadOnMount(query, options) { + return resolveEnabled(options.enabled, query) !== false && query.state.data === void 0 && !(query.state.status === "error" && options.retryOnMount === false); +} +function shouldFetchOnMount(query, options) { + return shouldLoadOnMount(query, options) || query.state.data !== void 0 && shouldFetchOn(query, options, options.refetchOnMount); +} +function shouldFetchOn(query, options, field) { + if (resolveEnabled(options.enabled, query) !== false && resolveStaleTime(options.staleTime, query) !== "static") { + const value = typeof field === "function" ? field(query) : field; + return value === "always" || value !== false && isStale(query, options); + } + return false; +} +function shouldFetchOptionally(query, prevQuery, options, prevOptions) { + return (query !== prevQuery || resolveEnabled(prevOptions.enabled, query) === false) && (!options.suspense || query.state.status !== "error") && isStale(query, options); +} +function isStale(query, options) { + return resolveEnabled(options.enabled, query) !== false && query.isStaleByTime(resolveStaleTime(options.staleTime, query)); +} +function shouldAssignObserverCurrentProperties(observer, optimisticResult) { + if (!shallowEqualObjects(observer.getCurrentResult(), optimisticResult)) { + return true; + } + return false; +} +export { + QueryObserver +}; +//# sourceMappingURL=queryObserver.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/queryObserver.js.map b/node_modules/@tanstack/query-core/build/legacy/queryObserver.js.map new file mode 100644 index 0000000..df93f52 --- /dev/null +++ b/node_modules/@tanstack/query-core/build/legacy/queryObserver.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/queryObserver.ts"],"sourcesContent":["import { focusManager } from './focusManager'\nimport { notifyManager } from './notifyManager'\nimport { fetchState } from './query'\nimport { Subscribable } from './subscribable'\nimport { pendingThenable } from './thenable'\nimport {\n isServer,\n isValidTimeout,\n noop,\n replaceData,\n resolveEnabled,\n resolveStaleTime,\n shallowEqualObjects,\n timeUntilStale,\n} from './utils'\nimport { timeoutManager } from './timeoutManager'\nimport type { ManagedTimerId } from './timeoutManager'\nimport type { FetchOptions, Query, QueryState } from './query'\nimport type { QueryClient } from './queryClient'\nimport type { PendingThenable, Thenable } from './thenable'\nimport type {\n DefaultError,\n DefaultedQueryObserverOptions,\n PlaceholderDataFunction,\n QueryKey,\n QueryObserverBaseResult,\n QueryObserverOptions,\n QueryObserverResult,\n RefetchOptions,\n} from './types'\n\ntype QueryObserverListener = (\n result: QueryObserverResult,\n) => void\n\ninterface ObserverFetchOptions extends FetchOptions {\n throwOnError?: boolean\n}\n\nexport class QueryObserver<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> extends Subscribable> {\n #client: QueryClient\n #currentQuery: Query = undefined!\n #currentQueryInitialState: QueryState = undefined!\n #currentResult: QueryObserverResult = undefined!\n #currentResultState?: QueryState\n #currentResultOptions?: QueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >\n #currentThenable: Thenable\n #selectError: TError | null\n #selectFn?: (data: TQueryData) => TData\n #selectResult?: TData\n // This property keeps track of the last query with defined data.\n // It will be used to pass the previous data and query to the placeholder function between renders.\n #lastQueryWithDefinedData?: Query\n #staleTimeoutId?: ManagedTimerId\n #refetchIntervalId?: ManagedTimerId\n #currentRefetchInterval?: number | false\n #trackedProps = new Set()\n\n constructor(\n client: QueryClient,\n public options: QueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >,\n ) {\n super()\n\n this.#client = client\n this.#selectError = null\n this.#currentThenable = pendingThenable()\n\n this.bindMethods()\n this.setOptions(options)\n }\n\n protected bindMethods(): void {\n this.refetch = this.refetch.bind(this)\n }\n\n protected onSubscribe(): void {\n if (this.listeners.size === 1) {\n this.#currentQuery.addObserver(this)\n\n if (shouldFetchOnMount(this.#currentQuery, this.options)) {\n this.#executeFetch()\n } else {\n this.updateResult()\n }\n\n this.#updateTimers()\n }\n }\n\n protected onUnsubscribe(): void {\n if (!this.hasListeners()) {\n this.destroy()\n }\n }\n\n shouldFetchOnReconnect(): boolean {\n return shouldFetchOn(\n this.#currentQuery,\n this.options,\n this.options.refetchOnReconnect,\n )\n }\n\n shouldFetchOnWindowFocus(): boolean {\n return shouldFetchOn(\n this.#currentQuery,\n this.options,\n this.options.refetchOnWindowFocus,\n )\n }\n\n destroy(): void {\n this.listeners = new Set()\n this.#clearStaleTimeout()\n this.#clearRefetchInterval()\n this.#currentQuery.removeObserver(this)\n }\n\n setOptions(\n options: QueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >,\n ): void {\n const prevOptions = this.options\n const prevQuery = this.#currentQuery\n\n this.options = this.#client.defaultQueryOptions(options)\n\n if (\n this.options.enabled !== undefined &&\n typeof this.options.enabled !== 'boolean' &&\n typeof this.options.enabled !== 'function' &&\n typeof resolveEnabled(this.options.enabled, this.#currentQuery) !==\n 'boolean'\n ) {\n throw new Error(\n 'Expected enabled to be a boolean or a callback that returns a boolean',\n )\n }\n\n this.#updateQuery()\n this.#currentQuery.setOptions(this.options)\n\n if (\n prevOptions._defaulted &&\n !shallowEqualObjects(this.options, prevOptions)\n ) {\n this.#client.getQueryCache().notify({\n type: 'observerOptionsUpdated',\n query: this.#currentQuery,\n observer: this,\n })\n }\n\n const mounted = this.hasListeners()\n\n // Fetch if there are subscribers\n if (\n mounted &&\n shouldFetchOptionally(\n this.#currentQuery,\n prevQuery,\n this.options,\n prevOptions,\n )\n ) {\n this.#executeFetch()\n }\n\n // Update result\n this.updateResult()\n\n // Update stale interval if needed\n if (\n mounted &&\n (this.#currentQuery !== prevQuery ||\n resolveEnabled(this.options.enabled, this.#currentQuery) !==\n resolveEnabled(prevOptions.enabled, this.#currentQuery) ||\n resolveStaleTime(this.options.staleTime, this.#currentQuery) !==\n resolveStaleTime(prevOptions.staleTime, this.#currentQuery))\n ) {\n this.#updateStaleTimeout()\n }\n\n const nextRefetchInterval = this.#computeRefetchInterval()\n\n // Update refetch interval if needed\n if (\n mounted &&\n (this.#currentQuery !== prevQuery ||\n resolveEnabled(this.options.enabled, this.#currentQuery) !==\n resolveEnabled(prevOptions.enabled, this.#currentQuery) ||\n nextRefetchInterval !== this.#currentRefetchInterval)\n ) {\n this.#updateRefetchInterval(nextRefetchInterval)\n }\n }\n\n getOptimisticResult(\n options: DefaultedQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >,\n ): QueryObserverResult {\n const query = this.#client.getQueryCache().build(this.#client, options)\n\n const result = this.createResult(query, options)\n\n if (shouldAssignObserverCurrentProperties(this, result)) {\n // this assigns the optimistic result to the current Observer\n // because if the query function changes, useQuery will be performing\n // an effect where it would fetch again.\n // When the fetch finishes, we perform a deep data cloning in order\n // to reuse objects references. This deep data clone is performed against\n // the `observer.currentResult.data` property\n // When QueryKey changes, we refresh the query and get new `optimistic`\n // result, while we leave the `observer.currentResult`, so when new data\n // arrives, it finds the old `observer.currentResult` which is related\n // to the old QueryKey. Which means that currentResult and selectData are\n // out of sync already.\n // To solve this, we move the cursor of the currentResult every time\n // an observer reads an optimistic value.\n\n // When keeping the previous data, the result doesn't change until new\n // data arrives.\n this.#currentResult = result\n this.#currentResultOptions = this.options\n this.#currentResultState = this.#currentQuery.state\n }\n return result\n }\n\n getCurrentResult(): QueryObserverResult {\n return this.#currentResult\n }\n\n trackResult(\n result: QueryObserverResult,\n onPropTracked?: (key: keyof QueryObserverResult) => void,\n ): QueryObserverResult {\n return new Proxy(result, {\n get: (target, key) => {\n this.trackProp(key as keyof QueryObserverResult)\n onPropTracked?.(key as keyof QueryObserverResult)\n if (key === 'promise') {\n this.trackProp('data')\n if (\n !this.options.experimental_prefetchInRender &&\n this.#currentThenable.status === 'pending'\n ) {\n this.#currentThenable.reject(\n new Error(\n 'experimental_prefetchInRender feature flag is not enabled',\n ),\n )\n }\n }\n return Reflect.get(target, key)\n },\n })\n }\n\n trackProp(key: keyof QueryObserverResult) {\n this.#trackedProps.add(key)\n }\n\n getCurrentQuery(): Query {\n return this.#currentQuery\n }\n\n refetch({ ...options }: RefetchOptions = {}): Promise<\n QueryObserverResult\n > {\n return this.fetch({\n ...options,\n })\n }\n\n fetchOptimistic(\n options: QueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >,\n ): Promise> {\n const defaultedOptions = this.#client.defaultQueryOptions(options)\n\n const query = this.#client\n .getQueryCache()\n .build(this.#client, defaultedOptions)\n\n return query.fetch().then(() => this.createResult(query, defaultedOptions))\n }\n\n protected fetch(\n fetchOptions: ObserverFetchOptions,\n ): Promise> {\n return this.#executeFetch({\n ...fetchOptions,\n cancelRefetch: fetchOptions.cancelRefetch ?? true,\n }).then(() => {\n this.updateResult()\n return this.#currentResult\n })\n }\n\n #executeFetch(\n fetchOptions?: Omit,\n ): Promise {\n // Make sure we reference the latest query as the current one might have been removed\n this.#updateQuery()\n\n // Fetch\n let promise: Promise = this.#currentQuery.fetch(\n this.options,\n fetchOptions,\n )\n\n if (!fetchOptions?.throwOnError) {\n promise = promise.catch(noop)\n }\n\n return promise\n }\n\n #updateStaleTimeout(): void {\n this.#clearStaleTimeout()\n const staleTime = resolveStaleTime(\n this.options.staleTime,\n this.#currentQuery,\n )\n\n if (isServer || this.#currentResult.isStale || !isValidTimeout(staleTime)) {\n return\n }\n\n const time = timeUntilStale(this.#currentResult.dataUpdatedAt, staleTime)\n\n // The timeout is sometimes triggered 1 ms before the stale time expiration.\n // To mitigate this issue we always add 1 ms to the timeout.\n const timeout = time + 1\n\n this.#staleTimeoutId = timeoutManager.setTimeout(() => {\n if (!this.#currentResult.isStale) {\n this.updateResult()\n }\n }, timeout)\n }\n\n #computeRefetchInterval() {\n return (\n (typeof this.options.refetchInterval === 'function'\n ? this.options.refetchInterval(this.#currentQuery)\n : this.options.refetchInterval) ?? false\n )\n }\n\n #updateRefetchInterval(nextInterval: number | false): void {\n this.#clearRefetchInterval()\n\n this.#currentRefetchInterval = nextInterval\n\n if (\n isServer ||\n resolveEnabled(this.options.enabled, this.#currentQuery) === false ||\n !isValidTimeout(this.#currentRefetchInterval) ||\n this.#currentRefetchInterval === 0\n ) {\n return\n }\n\n this.#refetchIntervalId = timeoutManager.setInterval(() => {\n if (\n this.options.refetchIntervalInBackground ||\n focusManager.isFocused()\n ) {\n this.#executeFetch()\n }\n }, this.#currentRefetchInterval)\n }\n\n #updateTimers(): void {\n this.#updateStaleTimeout()\n this.#updateRefetchInterval(this.#computeRefetchInterval())\n }\n\n #clearStaleTimeout(): void {\n if (this.#staleTimeoutId) {\n timeoutManager.clearTimeout(this.#staleTimeoutId)\n this.#staleTimeoutId = undefined\n }\n }\n\n #clearRefetchInterval(): void {\n if (this.#refetchIntervalId) {\n timeoutManager.clearInterval(this.#refetchIntervalId)\n this.#refetchIntervalId = undefined\n }\n }\n\n protected createResult(\n query: Query,\n options: QueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >,\n ): QueryObserverResult {\n const prevQuery = this.#currentQuery\n const prevOptions = this.options\n const prevResult = this.#currentResult as\n | QueryObserverResult\n | undefined\n const prevResultState = this.#currentResultState\n const prevResultOptions = this.#currentResultOptions\n const queryChange = query !== prevQuery\n const queryInitialState = queryChange\n ? query.state\n : this.#currentQueryInitialState\n\n const { state } = query\n let newState = { ...state }\n let isPlaceholderData = false\n let data: TData | undefined\n\n // Optimistically set result in fetching state if needed\n if (options._optimisticResults) {\n const mounted = this.hasListeners()\n\n const fetchOnMount = !mounted && shouldFetchOnMount(query, options)\n\n const fetchOptionally =\n mounted && shouldFetchOptionally(query, prevQuery, options, prevOptions)\n\n if (fetchOnMount || fetchOptionally) {\n newState = {\n ...newState,\n ...fetchState(state.data, query.options),\n }\n }\n if (options._optimisticResults === 'isRestoring') {\n newState.fetchStatus = 'idle'\n }\n }\n\n let { error, errorUpdatedAt, status } = newState\n\n // Per default, use query data\n data = newState.data as unknown as TData\n let skipSelect = false\n\n // use placeholderData if needed\n if (\n options.placeholderData !== undefined &&\n data === undefined &&\n status === 'pending'\n ) {\n let placeholderData\n\n // Memoize placeholder data\n if (\n prevResult?.isPlaceholderData &&\n options.placeholderData === prevResultOptions?.placeholderData\n ) {\n placeholderData = prevResult.data\n // we have to skip select when reading this memoization\n // because prevResult.data is already \"selected\"\n skipSelect = true\n } else {\n // compute placeholderData\n placeholderData =\n typeof options.placeholderData === 'function'\n ? (\n options.placeholderData as unknown as PlaceholderDataFunction\n )(\n this.#lastQueryWithDefinedData?.state.data,\n this.#lastQueryWithDefinedData as any,\n )\n : options.placeholderData\n }\n\n if (placeholderData !== undefined) {\n status = 'success'\n data = replaceData(\n prevResult?.data,\n placeholderData as unknown,\n options,\n ) as TData\n isPlaceholderData = true\n }\n }\n\n // Select data if needed\n // this also runs placeholderData through the select function\n if (options.select && data !== undefined && !skipSelect) {\n // Memoize select result\n if (\n prevResult &&\n data === prevResultState?.data &&\n options.select === this.#selectFn\n ) {\n data = this.#selectResult\n } else {\n try {\n this.#selectFn = options.select\n data = options.select(data as any)\n data = replaceData(prevResult?.data, data, options)\n this.#selectResult = data\n this.#selectError = null\n } catch (selectError) {\n this.#selectError = selectError as TError\n }\n }\n }\n\n if (this.#selectError) {\n error = this.#selectError\n data = this.#selectResult\n errorUpdatedAt = Date.now()\n status = 'error'\n }\n\n const isFetching = newState.fetchStatus === 'fetching'\n const isPending = status === 'pending'\n const isError = status === 'error'\n\n const isLoading = isPending && isFetching\n const hasData = data !== undefined\n\n const result: QueryObserverBaseResult = {\n status,\n fetchStatus: newState.fetchStatus,\n isPending,\n isSuccess: status === 'success',\n isError,\n isInitialLoading: isLoading,\n isLoading,\n data,\n dataUpdatedAt: newState.dataUpdatedAt,\n error,\n errorUpdatedAt,\n failureCount: newState.fetchFailureCount,\n failureReason: newState.fetchFailureReason,\n errorUpdateCount: newState.errorUpdateCount,\n isFetched: newState.dataUpdateCount > 0 || newState.errorUpdateCount > 0,\n isFetchedAfterMount:\n newState.dataUpdateCount > queryInitialState.dataUpdateCount ||\n newState.errorUpdateCount > queryInitialState.errorUpdateCount,\n isFetching,\n isRefetching: isFetching && !isPending,\n isLoadingError: isError && !hasData,\n isPaused: newState.fetchStatus === 'paused',\n isPlaceholderData,\n isRefetchError: isError && hasData,\n isStale: isStale(query, options),\n refetch: this.refetch,\n promise: this.#currentThenable,\n isEnabled: resolveEnabled(options.enabled, query) !== false,\n }\n\n const nextResult = result as QueryObserverResult\n\n if (this.options.experimental_prefetchInRender) {\n const hasResultData = nextResult.data !== undefined\n const isErrorWithoutData = nextResult.status === 'error' && !hasResultData\n const finalizeThenableIfPossible = (thenable: PendingThenable) => {\n if (isErrorWithoutData) {\n thenable.reject(nextResult.error)\n } else if (hasResultData) {\n thenable.resolve(nextResult.data as TData)\n }\n }\n\n /**\n * Create a new thenable and result promise when the results have changed\n */\n const recreateThenable = () => {\n const pending =\n (this.#currentThenable =\n nextResult.promise =\n pendingThenable())\n\n finalizeThenableIfPossible(pending)\n }\n\n const prevThenable = this.#currentThenable\n switch (prevThenable.status) {\n case 'pending':\n // Finalize the previous thenable if it was pending\n // and we are still observing the same query\n if (query.queryHash === prevQuery.queryHash) {\n finalizeThenableIfPossible(prevThenable)\n }\n break\n case 'fulfilled':\n if (isErrorWithoutData || nextResult.data !== prevThenable.value) {\n recreateThenable()\n }\n break\n case 'rejected':\n if (!isErrorWithoutData || nextResult.error !== prevThenable.reason) {\n recreateThenable()\n }\n break\n }\n }\n\n return nextResult\n }\n\n updateResult(): void {\n const prevResult = this.#currentResult as\n | QueryObserverResult\n | undefined\n\n const nextResult = this.createResult(this.#currentQuery, this.options)\n\n this.#currentResultState = this.#currentQuery.state\n this.#currentResultOptions = this.options\n\n if (this.#currentResultState.data !== undefined) {\n this.#lastQueryWithDefinedData = this.#currentQuery\n }\n\n // Only notify and update result if something has changed\n if (shallowEqualObjects(nextResult, prevResult)) {\n return\n }\n\n this.#currentResult = nextResult\n\n const shouldNotifyListeners = (): boolean => {\n if (!prevResult) {\n return true\n }\n\n const { notifyOnChangeProps } = this.options\n const notifyOnChangePropsValue =\n typeof notifyOnChangeProps === 'function'\n ? notifyOnChangeProps()\n : notifyOnChangeProps\n\n if (\n notifyOnChangePropsValue === 'all' ||\n (!notifyOnChangePropsValue && !this.#trackedProps.size)\n ) {\n return true\n }\n\n const includedProps = new Set(\n notifyOnChangePropsValue ?? this.#trackedProps,\n )\n\n if (this.options.throwOnError) {\n includedProps.add('error')\n }\n\n return Object.keys(this.#currentResult).some((key) => {\n const typedKey = key as keyof QueryObserverResult\n const changed = this.#currentResult[typedKey] !== prevResult[typedKey]\n\n return changed && includedProps.has(typedKey)\n })\n }\n\n this.#notify({ listeners: shouldNotifyListeners() })\n }\n\n #updateQuery(): void {\n const query = this.#client.getQueryCache().build(this.#client, this.options)\n\n if (query === this.#currentQuery) {\n return\n }\n\n const prevQuery = this.#currentQuery as\n | Query\n | undefined\n this.#currentQuery = query\n this.#currentQueryInitialState = query.state\n\n if (this.hasListeners()) {\n prevQuery?.removeObserver(this)\n query.addObserver(this)\n }\n }\n\n onQueryUpdate(): void {\n this.updateResult()\n\n if (this.hasListeners()) {\n this.#updateTimers()\n }\n }\n\n #notify(notifyOptions: { listeners: boolean }): void {\n notifyManager.batch(() => {\n // First, trigger the listeners\n if (notifyOptions.listeners) {\n this.listeners.forEach((listener) => {\n listener(this.#currentResult)\n })\n }\n\n // Then the cache listeners\n this.#client.getQueryCache().notify({\n query: this.#currentQuery,\n type: 'observerResultsUpdated',\n })\n })\n }\n}\n\nfunction shouldLoadOnMount(\n query: Query,\n options: QueryObserverOptions,\n): boolean {\n return (\n resolveEnabled(options.enabled, query) !== false &&\n query.state.data === undefined &&\n !(query.state.status === 'error' && options.retryOnMount === false)\n )\n}\n\nfunction shouldFetchOnMount(\n query: Query,\n options: QueryObserverOptions,\n): boolean {\n return (\n shouldLoadOnMount(query, options) ||\n (query.state.data !== undefined &&\n shouldFetchOn(query, options, options.refetchOnMount))\n )\n}\n\nfunction shouldFetchOn(\n query: Query,\n options: QueryObserverOptions,\n field: (typeof options)['refetchOnMount'] &\n (typeof options)['refetchOnWindowFocus'] &\n (typeof options)['refetchOnReconnect'],\n) {\n if (\n resolveEnabled(options.enabled, query) !== false &&\n resolveStaleTime(options.staleTime, query) !== 'static'\n ) {\n const value = typeof field === 'function' ? field(query) : field\n\n return value === 'always' || (value !== false && isStale(query, options))\n }\n return false\n}\n\nfunction shouldFetchOptionally(\n query: Query,\n prevQuery: Query,\n options: QueryObserverOptions,\n prevOptions: QueryObserverOptions,\n): boolean {\n return (\n (query !== prevQuery ||\n resolveEnabled(prevOptions.enabled, query) === false) &&\n (!options.suspense || query.state.status !== 'error') &&\n isStale(query, options)\n )\n}\n\nfunction isStale(\n query: Query,\n options: QueryObserverOptions,\n): boolean {\n return (\n resolveEnabled(options.enabled, query) !== false &&\n query.isStaleByTime(resolveStaleTime(options.staleTime, query))\n )\n}\n\n// this function would decide if we will update the observer's 'current'\n// properties after an optimistic reading via getOptimisticResult\nfunction shouldAssignObserverCurrentProperties<\n TQueryFnData = unknown,\n TError = unknown,\n TData = TQueryFnData,\n TQueryData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n observer: QueryObserver,\n optimisticResult: QueryObserverResult,\n) {\n // if the newly created result isn't what the observer is holding as current,\n // then we'll need to update the properties as well\n if (!shallowEqualObjects(observer.getCurrentResult(), optimisticResult)) {\n return true\n }\n\n // basically, just keep previous properties if nothing changed\n return false\n}\n"],"mappings":";;;;;;;;AAAA,SAAS,oBAAoB;AAC7B,SAAS,qBAAqB;AAC9B,SAAS,kBAAkB;AAC3B,SAAS,oBAAoB;AAC7B,SAAS,uBAAuB;AAChC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,sBAAsB;AAf/B;AAuCO,IAAM,gBAAN,cAMG,aAAmD;AAAA,EAyB3D,YACE,QACO,SAOP;AACA,UAAM;AARC;AAjCJ;AAOL;AACA;AACA;AACA;AACA;AACA;AAOA;AACA;AACA;AACA;AAGA;AAAA;AAAA;AACA;AACA;AACA;AACA,sCAAgB,oBAAI,IAA+B;AAcjD,uBAAK,SAAU;AACf,uBAAK,cAAe;AACpB,uBAAK,kBAAmB,gBAAgB;AAExC,SAAK,YAAY;AACjB,SA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stack/query-core/build/legacy/removable.cjs b/node_modules/@tanstack/query-core/build/legacy/removable.cjs new file mode 100644 index 0000000..92cc203 --- /dev/null +++ b/node_modules/@tanstack/query-core/build/legacy/removable.cjs @@ -0,0 +1,69 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __typeError = (msg) => { + throw TypeError(msg); +}; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg); +var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj)); +var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value); +var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value); + +// src/removable.ts +var removable_exports = {}; +__export(removable_exports, { + Removable: () => Removable +}); +module.exports = __toCommonJS(removable_exports); +var import_timeoutManager = require("./timeoutManager.cjs"); +var import_utils = require("./utils.cjs"); +var _gcTimeout; +var Removable = class { + constructor() { + __privateAdd(this, _gcTimeout); + } + destroy() { + this.clearGcTimeout(); + } + scheduleGc() { + this.clearGcTimeout(); + if ((0, import_utils.isValidTimeout)(this.gcTime)) { + __privateSet(this, _gcTimeout, import_timeoutManager.timeoutManager.setTimeout(() => { + this.optionalRemove(); + }, this.gcTime)); + } + } + updateGcTime(newGcTime) { + this.gcTime = Math.max( + this.gcTime || 0, + newGcTime ?? (import_utils.isServer ? Infinity : 5 * 60 * 1e3) + ); + } + clearGcTimeout() { + if (__privateGet(this, _gcTimeout)) { + import_timeoutManager.timeoutManager.clearTimeout(__privateGet(this, _gcTimeout)); + __privateSet(this, _gcTimeout, void 0); + } + } +}; +_gcTimeout = new WeakMap(); +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + Removable +}); +//# sourceMappingURL=removable.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/removable.cjs.map b/node_modules/@tanstack/query-core/build/legacy/removable.cjs.map new file mode 100644 index 0000000..c67604a --- /dev/null +++ b/node_modules/@tanstack/query-core/build/legacy/removable.cjs.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/removable.ts"],"sourcesContent":["import { timeoutManager } from './timeoutManager'\nimport { isServer, isValidTimeout } from './utils'\nimport type { ManagedTimerId } from './timeoutManager'\n\nexport abstract class Removable {\n gcTime!: number\n #gcTimeout?: ManagedTimerId\n\n destroy(): void {\n this.clearGcTimeout()\n }\n\n protected scheduleGc(): void {\n this.clearGcTimeout()\n\n if (isValidTimeout(this.gcTime)) {\n this.#gcTimeout = timeoutManager.setTimeout(() => {\n this.optionalRemove()\n }, this.gcTime)\n }\n }\n\n protected updateGcTime(newGcTime: number | undefined): void {\n // Default to 5 minutes (Infinity for server-side) if no gcTime is set\n this.gcTime = Math.max(\n this.gcTime || 0,\n newGcTime ?? (isServer ? Infinity : 5 * 60 * 1000),\n )\n }\n\n protected clearGcTimeout() {\n if (this.#gcTimeout) {\n timeoutManager.clearTimeout(this.#gcTimeout)\n this.#gcTimeout = undefined\n }\n }\n\n protected abstract optionalRemove(): void\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,4BAA+B;AAC/B,mBAAyC;AADzC;AAIO,IAAe,YAAf,MAAyB;AAAA,EAAzB;AAEL;AAAA;AAAA,EAEA,UAAgB;AACd,SAAK,eAAe;AAAA,EACtB;AAAA,EAEU,aAAmB;AAC3B,SAAK,eAAe;AAEpB,YAAI,6BAAe,KAAK,MAAM,GAAG;AAC/B,yBAAK,YAAa,qCAAe,WAAW,MAAM;AAChD,aAAK,eAAe;AAAA,MACtB,GAAG,KAAK,MAAM;AAAA,IAChB;AAAA,EACF;AAAA,EAEU,aAAa,WAAqC;AAE1D,SAAK,SAAS,KAAK;AAAA,MACjB,KAAK,UAAU;AAAA,MACf,cAAc,wBAAW,WAAW,IAAI,KAAK;AAAA,IAC/C;AAAA,EACF;AAAA,EAEU,iBAAiB;AACzB,QAAI,mBAAK,aAAY;AACnB,2CAAe,aAAa,mBAAK,WAAU;AAC3C,yBAAK,YAAa;AAAA,IACpB;AAAA,EACF;AAGF;AAhCE;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/removable.d.cts b/node_modules/@tanstack/query-core/build/legacy/removable.d.cts new file mode 100644 index 0000000..7b82525 --- /dev/null +++ b/node_modules/@tanstack/query-core/build/legacy/removable.d.cts @@ -0,0 +1,11 @@ +declare abstract class Removable { + #private; + gcTime: number; + destroy(): void; + protected scheduleGc(): void; + protected updateGcTime(newGcTime: number | undefined): void; + protected clearGcTimeout(): void; + protected abstract optionalRemove(): void; +} + +export { Removable }; diff --git a/node_modules/@tanstack/query-core/build/legacy/removable.d.ts b/node_modules/@tanstack/query-core/build/legacy/removable.d.ts new file mode 100644 index 0000000..7b82525 --- /dev/null +++ b/node_modules/@tanstack/query-core/build/legacy/removable.d.ts @@ -0,0 +1,11 @@ +declare abstract class Removable { + #private; + gcTime: number; + destroy(): void; + protected scheduleGc(): void; + protected updateGcTime(newGcTime: number | undefined): void; + protected clearGcTimeout(): void; + protected abstract optionalRemove(): void; +} + +export { Removable }; diff --git a/node_modules/@tanstack/query-core/build/legacy/removable.js b/node_modules/@tanstack/query-core/build/legacy/removable.js new file mode 100644 index 0000000..e110bdf --- /dev/null +++ b/node_modules/@tanstack/query-core/build/legacy/removable.js @@ -0,0 +1,43 @@ +import { + __privateAdd, + __privateGet, + __privateSet +} from "./chunk-PXG64RU4.js"; + +// src/removable.ts +import { timeoutManager } from "./timeoutManager.js"; +import { isServer, isValidTimeout } from "./utils.js"; +var _gcTimeout; +var Removable = class { + constructor() { + __privateAdd(this, _gcTimeout); + } + destroy() { + this.clearGcTimeout(); + } + scheduleGc() { + this.clearGcTimeout(); + if (isValidTimeout(this.gcTime)) { + __privateSet(this, _gcTimeout, timeoutManager.setTimeout(() => { + this.optionalRemove(); + }, this.gcTime)); + } + } + updateGcTime(newGcTime) { + this.gcTime = Math.max( + this.gcTime || 0, + newGcTime ?? (isServer ? Infinity : 5 * 60 * 1e3) + ); + } + clearGcTimeout() { + if (__privateGet(this, _gcTimeout)) { + timeoutManager.clearTimeout(__privateGet(this, _gcTimeout)); + __privateSet(this, _gcTimeout, void 0); + } + } +}; +_gcTimeout = new WeakMap(); +export { + Removable +}; +//# sourceMappingURL=removable.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/removable.js.map b/node_modules/@tanstack/query-core/build/legacy/removable.js.map new file mode 100644 index 0000000..9eb36ce --- /dev/null +++ b/node_modules/@tanstack/query-core/build/legacy/removable.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/removable.ts"],"sourcesContent":["import { timeoutManager } from './timeoutManager'\nimport { isServer, isValidTimeout } from './utils'\nimport type { ManagedTimerId } from './timeoutManager'\n\nexport abstract class Removable {\n gcTime!: number\n #gcTimeout?: ManagedTimerId\n\n destroy(): void {\n this.clearGcTimeout()\n }\n\n protected scheduleGc(): void {\n this.clearGcTimeout()\n\n if (isValidTimeout(this.gcTime)) {\n this.#gcTimeout = timeoutManager.setTimeout(() => {\n this.optionalRemove()\n }, this.gcTime)\n }\n }\n\n protected updateGcTime(newGcTime: number | undefined): void {\n // Default to 5 minutes (Infinity for server-side) if no gcTime is set\n this.gcTime = Math.max(\n this.gcTime || 0,\n newGcTime ?? (isServer ? Infinity : 5 * 60 * 1000),\n )\n }\n\n protected clearGcTimeout() {\n if (this.#gcTimeout) {\n timeoutManager.clearTimeout(this.#gcTimeout)\n this.#gcTimeout = undefined\n }\n }\n\n protected abstract optionalRemove(): void\n}\n"],"mappings":";;;;;;;AAAA,SAAS,sBAAsB;AAC/B,SAAS,UAAU,sBAAsB;AADzC;AAIO,IAAe,YAAf,MAAyB;AAAA,EAAzB;AAEL;AAAA;AAAA,EAEA,UAAgB;AACd,SAAK,eAAe;AAAA,EACtB;AAAA,EAEU,aAAmB;AAC3B,SAAK,eAAe;AAEpB,QAAI,eAAe,KAAK,MAAM,GAAG;AAC/B,yBAAK,YAAa,eAAe,WAAW,MAAM;AAChD,aAAK,eAAe;AAAA,MACtB,GAAG,KAAK,MAAM;AAAA,IAChB;AAAA,EACF;AAAA,EAEU,aAAa,WAAqC;AAE1D,SAAK,SAAS,KAAK;AAAA,MACjB,KAAK,UAAU;AAAA,MACf,cAAc,WAAW,WAAW,IAAI,KAAK;AAAA,IAC/C;AAAA,EACF;AAAA,EAEU,iBAAiB;AACzB,QAAI,mBAAK,aAAY;AACnB,qBAAe,aAAa,mBAAK,WAAU;AAC3C,yBAAK,YAAa;AAAA,IACpB;AAAA,EACF;AAGF;AAhCE;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/retryer.cjs b/node_modules/@tanstack/query-core/build/legacy/retryer.cjs new file mode 100644 index 0000000..4efcc15 --- /dev/null +++ b/node_modules/@tanstack/query-core/build/legacy/retryer.cjs @@ -0,0 +1,165 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/retryer.ts +var retryer_exports = {}; +__export(retryer_exports, { + CancelledError: () => CancelledError, + canFetch: () => canFetch, + createRetryer: () => createRetryer, + isCancelledError: () => isCancelledError +}); +module.exports = __toCommonJS(retryer_exports); +var import_focusManager = require("./focusManager.cjs"); +var import_onlineManager = require("./onlineManager.cjs"); +var import_thenable = require("./thenable.cjs"); +var import_utils = require("./utils.cjs"); +function defaultRetryDelay(failureCount) { + return Math.min(1e3 * 2 ** failureCount, 3e4); +} +function canFetch(networkMode) { + return (networkMode ?? "online") === "online" ? import_onlineManager.onlineManager.isOnline() : true; +} +var CancelledError = class extends Error { + constructor(options) { + super("CancelledError"); + this.revert = options == null ? void 0 : options.revert; + this.silent = options == null ? void 0 : options.silent; + } +}; +function isCancelledError(value) { + return value instanceof CancelledError; +} +function createRetryer(config) { + let isRetryCancelled = false; + let failureCount = 0; + let continueFn; + const thenable = (0, import_thenable.pendingThenable)(); + const isResolved = () => thenable.status !== "pending"; + const cancel = (cancelOptions) => { + var _a; + if (!isResolved()) { + const error = new CancelledError(cancelOptions); + reject(error); + (_a = config.onCancel) == null ? void 0 : _a.call(config, error); + } + }; + const cancelRetry = () => { + isRetryCancelled = true; + }; + const continueRetry = () => { + isRetryCancelled = false; + }; + const canContinue = () => import_focusManager.focusManager.isFocused() && (config.networkMode === "always" || import_onlineManager.onlineManager.isOnline()) && config.canRun(); + const canStart = () => canFetch(config.networkMode) && config.canRun(); + const resolve = (value) => { + if (!isResolved()) { + continueFn == null ? void 0 : continueFn(); + thenable.resolve(value); + } + }; + const reject = (value) => { + if (!isResolved()) { + continueFn == null ? void 0 : continueFn(); + thenable.reject(value); + } + }; + const pause = () => { + return new Promise((continueResolve) => { + var _a; + continueFn = (value) => { + if (isResolved() || canContinue()) { + continueResolve(value); + } + }; + (_a = config.onPause) == null ? void 0 : _a.call(config); + }).then(() => { + var _a; + continueFn = void 0; + if (!isResolved()) { + (_a = config.onContinue) == null ? void 0 : _a.call(config); + } + }); + }; + const run = () => { + if (isResolved()) { + return; + } + let promiseOrValue; + const initialPromise = failureCount === 0 ? config.initialPromise : void 0; + try { + promiseOrValue = initialPromise ?? config.fn(); + } catch (error) { + promiseOrValue = Promise.reject(error); + } + Promise.resolve(promiseOrValue).then(resolve).catch((error) => { + var _a; + if (isResolved()) { + return; + } + const retry = config.retry ?? (import_utils.isServer ? 0 : 3); + const retryDelay = config.retryDelay ?? defaultRetryDelay; + const delay = typeof retryDelay === "function" ? retryDelay(failureCount, error) : retryDelay; + const shouldRetry = retry === true || typeof retry === "number" && failureCount < retry || typeof retry === "function" && retry(failureCount, error); + if (isRetryCancelled || !shouldRetry) { + reject(error); + return; + } + failureCount++; + (_a = config.onFail) == null ? void 0 : _a.call(config, failureCount, error); + (0, import_utils.sleep)(delay).then(() => { + return canContinue() ? void 0 : pause(); + }).then(() => { + if (isRetryCancelled) { + reject(error); + } else { + run(); + } + }); + }); + }; + return { + promise: thenable, + status: () => thenable.status, + cancel, + continue: () => { + continueFn == null ? void 0 : continueFn(); + return thenable; + }, + cancelRetry, + continueRetry, + canStart, + start: () => { + if (canStart()) { + run(); + } else { + pause().then(run); + } + return thenable; + } + }; +} +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + CancelledError, + canFetch, + createRetryer, + isCancelledError +}); +//# sourceMappingURL=retryer.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/retryer.cjs.map b/node_modules/@tanstack/query-core/build/legacy/retryer.cjs.map new file mode 100644 index 0000000..c935efd --- /dev/null +++ b/node_modules/@tanstack/query-core/build/legacy/retryer.cjs.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/retryer.ts"],"sourcesContent":["import { focusManager } from './focusManager'\nimport { onlineManager } from './onlineManager'\nimport { pendingThenable } from './thenable'\nimport { isServer, sleep } from './utils'\nimport type { Thenable } from './thenable'\nimport type { CancelOptions, DefaultError, NetworkMode } from './types'\n\n// TYPES\n\ninterface RetryerConfig {\n fn: () => TData | Promise\n initialPromise?: Promise\n onCancel?: (error: TError) => void\n onFail?: (failureCount: number, error: TError) => void\n onPause?: () => void\n onContinue?: () => void\n retry?: RetryValue\n retryDelay?: RetryDelayValue\n networkMode: NetworkMode | undefined\n canRun: () => boolean\n}\n\nexport interface Retryer {\n promise: Promise\n cancel: (cancelOptions?: CancelOptions) => void\n continue: () => Promise\n cancelRetry: () => void\n continueRetry: () => void\n canStart: () => boolean\n start: () => Promise\n status: () => 'pending' | 'resolved' | 'rejected'\n}\n\nexport type RetryValue = boolean | number | ShouldRetryFunction\n\ntype ShouldRetryFunction = (\n failureCount: number,\n error: TError,\n) => boolean\n\nexport type RetryDelayValue = number | RetryDelayFunction\n\ntype RetryDelayFunction = (\n failureCount: number,\n error: TError,\n) => number\n\nfunction defaultRetryDelay(failureCount: number) {\n return Math.min(1000 * 2 ** failureCount, 30000)\n}\n\nexport function canFetch(networkMode: NetworkMode | undefined): boolean {\n return (networkMode ?? 'online') === 'online'\n ? onlineManager.isOnline()\n : true\n}\n\nexport class CancelledError extends Error {\n revert?: boolean\n silent?: boolean\n constructor(options?: CancelOptions) {\n super('CancelledError')\n this.revert = options?.revert\n this.silent = options?.silent\n }\n}\n\n/**\n * @deprecated Use instanceof `CancelledError` instead.\n */\nexport function isCancelledError(value: any): value is CancelledError {\n return value instanceof CancelledError\n}\n\nexport function createRetryer(\n config: RetryerConfig,\n): Retryer {\n let isRetryCancelled = false\n let failureCount = 0\n let continueFn: ((value?: unknown) => void) | undefined\n\n const thenable = pendingThenable()\n\n const isResolved = () =>\n (thenable.status as Thenable['status']) !== 'pending'\n\n const cancel = (cancelOptions?: CancelOptions): void => {\n if (!isResolved()) {\n const error = new CancelledError(cancelOptions) as TError\n reject(error)\n\n config.onCancel?.(error)\n }\n }\n const cancelRetry = () => {\n isRetryCancelled = true\n }\n\n const continueRetry = () => {\n isRetryCancelled = false\n }\n\n const canContinue = () =>\n focusManager.isFocused() &&\n (config.networkMode === 'always' || onlineManager.isOnline()) &&\n config.canRun()\n\n const canStart = () => canFetch(config.networkMode) && config.canRun()\n\n const resolve = (value: any) => {\n if (!isResolved()) {\n continueFn?.()\n thenable.resolve(value)\n }\n }\n\n const reject = (value: any) => {\n if (!isResolved()) {\n continueFn?.()\n thenable.reject(value)\n }\n }\n\n const pause = () => {\n return new Promise((continueResolve) => {\n continueFn = (value) => {\n if (isResolved() || canContinue()) {\n continueResolve(value)\n }\n }\n config.onPause?.()\n }).then(() => {\n continueFn = undefined\n if (!isResolved()) {\n config.onContinue?.()\n }\n })\n }\n\n // Create loop function\n const run = () => {\n // Do nothing if already resolved\n if (isResolved()) {\n return\n }\n\n let promiseOrValue: any\n\n // we can re-use config.initialPromise on the first call of run()\n const initialPromise =\n failureCount === 0 ? config.initialPromise : undefined\n\n // Execute query\n try {\n promiseOrValue = initialPromise ?? config.fn()\n } catch (error) {\n promiseOrValue = Promise.reject(error)\n }\n\n Promise.resolve(promiseOrValue)\n .then(resolve)\n .catch((error) => {\n // Stop if the fetch is already resolved\n if (isResolved()) {\n return\n }\n\n // Do we need to retry the request?\n const retry = config.retry ?? (isServer ? 0 : 3)\n const retryDelay = config.retryDelay ?? defaultRetryDelay\n const delay =\n typeof retryDelay === 'function'\n ? retryDelay(failureCount, error)\n : retryDelay\n const shouldRetry =\n retry === true ||\n (typeof retry === 'number' && failureCount < retry) ||\n (typeof retry === 'function' && retry(failureCount, error))\n\n if (isRetryCancelled || !shouldRetry) {\n // We are done if the query does not need to be retried\n reject(error)\n return\n }\n\n failureCount++\n\n // Notify on fail\n config.onFail?.(failureCount, error)\n\n // Delay\n sleep(delay)\n // Pause if the document is not visible or when the device is offline\n .then(() => {\n return canContinue() ? undefined : pause()\n })\n .then(() => {\n if (isRetryCancelled) {\n reject(error)\n } else {\n run()\n }\n })\n })\n }\n\n return {\n promise: thenable,\n status: () => thenable.status,\n cancel,\n continue: () => {\n continueFn?.()\n return thenable\n },\n cancelRetry,\n continueRetry,\n canStart,\n start: () => {\n // Start loop\n if (canStart()) {\n run()\n } else {\n pause().then(run)\n }\n return thenable\n },\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,0BAA6B;AAC7B,2BAA8B;AAC9B,sBAAgC;AAChC,mBAAgC;AA4ChC,SAAS,kBAAkB,cAAsB;AAC/C,SAAO,KAAK,IAAI,MAAO,KAAK,cAAc,GAAK;AACjD;AAEO,SAAS,SAAS,aAA+C;AACtE,UAAQ,eAAe,cAAc,WACjC,mCAAc,SAAS,IACvB;AACN;AAEO,IAAM,iBAAN,cAA6B,MAAM;AAAA,EAGxC,YAAY,SAAyB;AACnC,UAAM,gBAAgB;AACtB,SAAK,SAAS,mCAAS;AACvB,SAAK,SAAS,mCAAS;AAAA,EACzB;AACF;AAKO,SAAS,iBAAiB,OAAqC;AACpE,SAAO,iBAAiB;AAC1B;AAEO,SAAS,cACd,QACgB;AAChB,MAAI,mBAAmB;AACvB,MAAI,eAAe;AACnB,MAAI;AAEJ,QAAM,eAAW,iCAAuB;AAExC,QAAM,aAAa,MAChB,SAAS,WAAyC;AAErD,QAAM,SAAS,CAAC,kBAAwC;AAtF1D;AAuFI,QAAI,CAAC,WAAW,GAAG;AACjB,YAAM,QAAQ,IAAI,eAAe,aAAa;AAC9C,aAAO,KAAK;AAEZ,mBAAO,aAAP,gCAAkB;AAAA,IACpB;AAAA,EACF;AACA,QAAM,cAAc,MAAM;AACxB,uBAAmB;AAAA,EACrB;AAEA,QAAM,gBAAgB,MAAM;AAC1B,uBAAmB;AAAA,EACrB;AAEA,QAAM,cAAc,MAClB,iCAAa,UAAU,MACtB,OAAO,gBAAgB,YAAY,mCAAc,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Ac,MAAM,cAAc,KAAK;AAE3D,UAAI,oBAAoB,CAAC,aAAa;AAEpC,eAAO,KAAK;AACZ;AAAA,MACF;AAEA;AAGA,mBAAO,WAAP,gCAAgB,cAAc;AAG9B,8BAAM,KAAK,EAER,KAAK,MAAM;AACV,eAAO,YAAY,IAAI,SAAY,MAAM;AAAA,MAC3C,CAAC,EACA,KAAK,MAAM;AACV,YAAI,kBAAkB;AACpB,iBAAO,KAAK;AAAA,QACd,OAAO;AACL,cAAI;AAAA,QACN;AAAA,MACF,CAAC;AAAA,IACL,CAAC;AAAA,EACL;AAEA,SAAO;AAAA,IACL,SAAS;AAAA,IACT,QAAQ,MAAM,SAAS;AAAA,IACvB;AAAA,IACA,UAAU,MAAM;AACd;AACA,aAAO;AAAA,IACT;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,OAAO,MAAM;AAEX,UAAI,SAAS,GAAG;AACd,YAAI;AAAA,MACN,OAAO;AACL,cAAM,EAAE,KAAK,GAAG;AAAA,MAClB;AACA,aAAO;AAAA,IACT;AAAA,EACF;AACF;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/retryer.d.cts b/node_modules/@tanstack/query-core/build/legacy/retryer.d.cts new file mode 100644 index 0000000..d348311 --- /dev/null +++ b/node_modules/@tanstack/query-core/build/legacy/retryer.d.cts @@ -0,0 +1,3 @@ +export { C as CancelledError, bE as RetryDelayValue, bD as RetryValue, bC as Retryer, bF as canFetch, bG as createRetryer, j as isCancelledError } from './hydration-uphG6M-i.cjs'; +import './removable.cjs'; +import './subscribable.cjs'; diff --git a/node_modules/@tanstack/query-core/build/legacy/retryer.d.ts b/node_modules/@tanstack/query-core/build/legacy/retryer.d.ts new file mode 100644 index 0000000..87ee12a --- /dev/null +++ b/node_modules/@tanstack/query-core/build/legacy/retryer.d.ts @@ -0,0 +1,3 @@ +export { C as CancelledError, bE as RetryDelayValue, bD as RetryValue, bC as Retryer, bF as canFetch, bG as createRetryer, j as isCancelledError } from './hydration-BlEVG2Lp.js'; +import './removable.js'; +import './subscribable.js'; diff --git a/node_modules/@tanstack/query-core/build/legacy/retryer.js b/node_modules/@tanstack/query-core/build/legacy/retryer.js new file mode 100644 index 0000000..ae8322b --- /dev/null +++ b/node_modules/@tanstack/query-core/build/legacy/retryer.js @@ -0,0 +1,139 @@ +import "./chunk-PXG64RU4.js"; + +// src/retryer.ts +import { focusManager } from "./focusManager.js"; +import { onlineManager } from "./onlineManager.js"; +import { pendingThenable } from "./thenable.js"; +import { isServer, sleep } from "./utils.js"; +function defaultRetryDelay(failureCount) { + return Math.min(1e3 * 2 ** failureCount, 3e4); +} +function canFetch(networkMode) { + return (networkMode ?? "online") === "online" ? onlineManager.isOnline() : true; +} +var CancelledError = class extends Error { + constructor(options) { + super("CancelledError"); + this.revert = options == null ? void 0 : options.revert; + this.silent = options == null ? void 0 : options.silent; + } +}; +function isCancelledError(value) { + return value instanceof CancelledError; +} +function createRetryer(config) { + let isRetryCancelled = false; + let failureCount = 0; + let continueFn; + const thenable = pendingThenable(); + const isResolved = () => thenable.status !== "pending"; + const cancel = (cancelOptions) => { + var _a; + if (!isResolved()) { + const error = new CancelledError(cancelOptions); + reject(error); + (_a = config.onCancel) == null ? void 0 : _a.call(config, error); + } + }; + const cancelRetry = () => { + isRetryCancelled = true; + }; + const continueRetry = () => { + isRetryCancelled = false; + }; + const canContinue = () => focusManager.isFocused() && (config.networkMode === "always" || onlineManager.isOnline()) && config.canRun(); + const canStart = () => canFetch(config.networkMode) && config.canRun(); + const resolve = (value) => { + if (!isResolved()) { + continueFn == null ? void 0 : continueFn(); + thenable.resolve(value); + } + }; + const reject = (value) => { + if (!isResolved()) { + continueFn == null ? void 0 : continueFn(); + thenable.reject(value); + } + }; + const pause = () => { + return new Promise((continueResolve) => { + var _a; + continueFn = (value) => { + if (isResolved() || canContinue()) { + continueResolve(value); + } + }; + (_a = config.onPause) == null ? void 0 : _a.call(config); + }).then(() => { + var _a; + continueFn = void 0; + if (!isResolved()) { + (_a = config.onContinue) == null ? void 0 : _a.call(config); + } + }); + }; + const run = () => { + if (isResolved()) { + return; + } + let promiseOrValue; + const initialPromise = failureCount === 0 ? config.initialPromise : void 0; + try { + promiseOrValue = initialPromise ?? config.fn(); + } catch (error) { + promiseOrValue = Promise.reject(error); + } + Promise.resolve(promiseOrValue).then(resolve).catch((error) => { + var _a; + if (isResolved()) { + return; + } + const retry = config.retry ?? (isServer ? 0 : 3); + const retryDelay = config.retryDelay ?? defaultRetryDelay; + const delay = typeof retryDelay === "function" ? retryDelay(failureCount, error) : retryDelay; + const shouldRetry = retry === true || typeof retry === "number" && failureCount < retry || typeof retry === "function" && retry(failureCount, error); + if (isRetryCancelled || !shouldRetry) { + reject(error); + return; + } + failureCount++; + (_a = config.onFail) == null ? void 0 : _a.call(config, failureCount, error); + sleep(delay).then(() => { + return canContinue() ? void 0 : pause(); + }).then(() => { + if (isRetryCancelled) { + reject(error); + } else { + run(); + } + }); + }); + }; + return { + promise: thenable, + status: () => thenable.status, + cancel, + continue: () => { + continueFn == null ? void 0 : continueFn(); + return thenable; + }, + cancelRetry, + continueRetry, + canStart, + start: () => { + if (canStart()) { + run(); + } else { + pause().then(run); + } + return thenable; + } + }; +} +export { + CancelledError, + canFetch, + createRetryer, + isCancelledError +}; +//# sourceMappingURL=retryer.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/retryer.js.map b/node_modules/@tanstack/query-core/build/legacy/retryer.js.map new file mode 100644 index 0000000..152827d --- /dev/null +++ b/node_modules/@tanstack/query-core/build/legacy/retryer.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/retryer.ts"],"sourcesContent":["import { focusManager } from './focusManager'\nimport { onlineManager } from './onlineManager'\nimport { pendingThenable } from './thenable'\nimport { isServer, sleep } from './utils'\nimport type { Thenable } from './thenable'\nimport type { CancelOptions, DefaultError, NetworkMode } from './types'\n\n// TYPES\n\ninterface RetryerConfig {\n fn: () => TData | Promise\n initialPromise?: Promise\n onCancel?: (error: TError) => void\n onFail?: (failureCount: number, error: TError) => void\n onPause?: () => void\n onContinue?: () => void\n retry?: RetryValue\n retryDelay?: RetryDelayValue\n networkMode: NetworkMode | undefined\n canRun: () => boolean\n}\n\nexport interface Retryer {\n promise: Promise\n cancel: (cancelOptions?: CancelOptions) => void\n continue: () => Promise\n cancelRetry: () => void\n continueRetry: () => void\n canStart: () => boolean\n start: () => Promise\n status: () => 'pending' | 'resolved' | 'rejected'\n}\n\nexport type RetryValue = boolean | number | ShouldRetryFunction\n\ntype ShouldRetryFunction = (\n failureCount: number,\n error: TError,\n) => boolean\n\nexport type RetryDelayValue = number | RetryDelayFunction\n\ntype RetryDelayFunction = (\n failureCount: number,\n error: TError,\n) => number\n\nfunction defaultRetryDelay(failureCount: number) {\n return Math.min(1000 * 2 ** failureCount, 30000)\n}\n\nexport function canFetch(networkMode: NetworkMode | undefined): boolean {\n return (networkMode ?? 'online') === 'online'\n ? onlineManager.isOnline()\n : true\n}\n\nexport class CancelledError extends Error {\n revert?: boolean\n silent?: boolean\n constructor(options?: CancelOptions) {\n super('CancelledError')\n this.revert = options?.revert\n this.silent = options?.silent\n }\n}\n\n/**\n * @deprecated Use instanceof `CancelledError` instead.\n */\nexport function isCancelledError(value: any): value is CancelledError {\n return value instanceof CancelledError\n}\n\nexport function createRetryer(\n config: RetryerConfig,\n): Retryer {\n let isRetryCancelled = false\n let failureCount = 0\n let continueFn: ((value?: unknown) => void) | undefined\n\n const thenable = pendingThenable()\n\n const isResolved = () =>\n (thenable.status as Thenable['status']) !== 'pending'\n\n const cancel = (cancelOptions?: CancelOptions): void => {\n if (!isResolved()) {\n const error = new CancelledError(cancelOptions) as TError\n reject(error)\n\n config.onCancel?.(error)\n }\n }\n const cancelRetry = () => {\n isRetryCancelled = true\n }\n\n const continueRetry = () => {\n isRetryCancelled = false\n }\n\n const canContinue = () =>\n focusManager.isFocused() &&\n (config.networkMode === 'always' || onlineManager.isOnline()) &&\n config.canRun()\n\n const canStart = () => canFetch(config.networkMode) && config.canRun()\n\n const resolve = (value: any) => {\n if (!isResolved()) {\n continueFn?.()\n thenable.resolve(value)\n }\n }\n\n const reject = (value: any) => {\n if (!isResolved()) {\n continueFn?.()\n thenable.reject(value)\n }\n }\n\n const pause = () => {\n return new Promise((continueResolve) => {\n continueFn = (value) => {\n if (isResolved() || canContinue()) {\n continueResolve(value)\n }\n }\n config.onPause?.()\n }).then(() => {\n continueFn = undefined\n if (!isResolved()) {\n config.onContinue?.()\n }\n })\n }\n\n // Create loop function\n const run = () => {\n // Do nothing if already resolved\n if (isResolved()) {\n return\n }\n\n let promiseOrValue: any\n\n // we can re-use config.initialPromise on the first call of run()\n const initialPromise =\n failureCount === 0 ? config.initialPromise : undefined\n\n // Execute query\n try {\n promiseOrValue = initialPromise ?? config.fn()\n } catch (error) {\n promiseOrValue = Promise.reject(error)\n }\n\n Promise.resolve(promiseOrValue)\n .then(resolve)\n .catch((error) => {\n // Stop if the fetch is already resolved\n if (isResolved()) {\n return\n }\n\n // Do we need to retry the request?\n const retry = config.retry ?? (isServer ? 0 : 3)\n const retryDelay = config.retryDelay ?? defaultRetryDelay\n const delay =\n typeof retryDelay === 'function'\n ? retryDelay(failureCount, error)\n : retryDelay\n const shouldRetry =\n retry === true ||\n (typeof retry === 'number' && failureCount < retry) ||\n (typeof retry === 'function' && retry(failureCount, error))\n\n if (isRetryCancelled || !shouldRetry) {\n // We are done if the query does not need to be retried\n reject(error)\n return\n }\n\n failureCount++\n\n // Notify on fail\n config.onFail?.(failureCount, error)\n\n // Delay\n sleep(delay)\n // Pause if the document is not visible or when the device is offline\n .then(() => {\n return canContinue() ? undefined : pause()\n })\n .then(() => {\n if (isRetryCancelled) {\n reject(error)\n } else {\n run()\n }\n })\n })\n }\n\n return {\n promise: thenable,\n status: () => thenable.status,\n cancel,\n continue: () => {\n continueFn?.()\n return thenable\n },\n cancelRetry,\n continueRetry,\n canStart,\n start: () => {\n // Start loop\n if (canStart()) {\n run()\n } else {\n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YAAI,kBAAkB;AACpB,iBAAO,KAAK;AAAA,QACd,OAAO;AACL,cAAI;AAAA,QACN;AAAA,MACF,CAAC;AAAA,IACL,CAAC;AAAA,EACL;AAEA,SAAO;AAAA,IACL,SAAS;AAAA,IACT,QAAQ,MAAM,SAAS;AAAA,IACvB;AAAA,IACA,UAAU,MAAM;AACd;AACA,aAAO;AAAA,IACT;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,OAAO,MAAM;AAEX,UAAI,SAAS,GAAG;AACd,YAAI;AAAA,MACN,OAAO;AACL,cAAM,EAAE,KAAK,GAAG;AAAA,MAClB;AACA,aAAO;AAAA,IACT;AAAA,EACF;AACF;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/streamedQuery.cjs b/node_modules/@tanstack/query-core/build/legacy/streamedQuery.cjs new file mode 100644 index 0000000..5752fe9 --- /dev/null +++ b/node_modules/@tanstack/query-core/build/legacy/streamedQuery.cjs @@ -0,0 +1,82 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/streamedQuery.ts +var streamedQuery_exports = {}; +__export(streamedQuery_exports, { + streamedQuery: () => streamedQuery +}); +module.exports = __toCommonJS(streamedQuery_exports); +var import_utils = require("./utils.cjs"); +function streamedQuery({ + streamFn, + refetchMode = "reset", + reducer = (items, chunk) => (0, import_utils.addToEnd)(items, chunk), + initialValue = [] +}) { + return async (context) => { + const query = context.client.getQueryCache().find({ queryKey: context.queryKey, exact: true }); + const isRefetch = !!query && query.state.data !== void 0; + if (isRefetch && refetchMode === "reset") { + query.setState({ + status: "pending", + data: void 0, + error: null, + fetchStatus: "fetching" + }); + } + let result = initialValue; + let cancelled = false; + const streamFnContext = (0, import_utils.addConsumeAwareSignal)( + { + client: context.client, + meta: context.meta, + queryKey: context.queryKey, + pageParam: context.pageParam, + direction: context.direction + }, + () => context.signal, + () => cancelled = true + ); + const stream = await streamFn(streamFnContext); + const isReplaceRefetch = isRefetch && refetchMode === "replace"; + for await (const chunk of stream) { + if (cancelled) { + break; + } + if (isReplaceRefetch) { + result = reducer(result, chunk); + } else { + context.client.setQueryData( + context.queryKey, + (prev) => reducer(prev === void 0 ? initialValue : prev, chunk) + ); + } + } + if (isReplaceRefetch && !cancelled) { + context.client.setQueryData(context.queryKey, result); + } + return context.client.getQueryData(context.queryKey) ?? initialValue; + }; +} +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + streamedQuery +}); +//# sourceMappingURL=streamedQuery.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/streamedQuery.cjs.map b/node_modules/@tanstack/query-core/build/legacy/streamedQuery.cjs.map new file mode 100644 index 0000000..37ef7ac --- /dev/null +++ b/node_modules/@tanstack/query-core/build/legacy/streamedQuery.cjs.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/streamedQuery.ts"],"sourcesContent":["import { addConsumeAwareSignal, addToEnd } from './utils'\nimport type {\n OmitKeyof,\n QueryFunction,\n QueryFunctionContext,\n QueryKey,\n} from './types'\n\ntype BaseStreamedQueryParams = {\n streamFn: (\n context: QueryFunctionContext,\n ) => AsyncIterable | Promise>\n refetchMode?: 'append' | 'reset' | 'replace'\n}\n\ntype SimpleStreamedQueryParams<\n TQueryFnData,\n TQueryKey extends QueryKey,\n> = BaseStreamedQueryParams & {\n reducer?: never\n initialValue?: never\n}\n\ntype ReducibleStreamedQueryParams<\n TQueryFnData,\n TData,\n TQueryKey extends QueryKey,\n> = BaseStreamedQueryParams & {\n reducer: (acc: TData, chunk: TQueryFnData) => TData\n initialValue: TData\n}\n\ntype StreamedQueryParams =\n | SimpleStreamedQueryParams\n | ReducibleStreamedQueryParams\n\n/**\n * This is a helper function to create a query function that streams data from an AsyncIterable.\n * Data will be an Array of all the chunks received.\n * The query will be in a 'pending' state until the first chunk of data is received, but will go to 'success' after that.\n * The query will stay in fetchStatus 'fetching' until the stream ends.\n * @param queryFn - The function that returns an AsyncIterable to stream data from.\n * @param refetchMode - Defines how re-fetches are handled.\n * Defaults to `'reset'`, erases all data and puts the query back into `pending` state.\n * Set to `'append'` to append new data to the existing data.\n * Set to `'replace'` to write all data to the cache once the stream ends.\n * @param reducer - A function to reduce the streamed chunks into the final data.\n * Defaults to a function that appends chunks to the end of the array.\n * @param initialValue - Initial value to be used while the first chunk is being fetched, and returned if the stream yields no values.\n */\nexport function streamedQuery<\n TQueryFnData = unknown,\n TData = Array,\n TQueryKey extends QueryKey = QueryKey,\n>({\n streamFn,\n refetchMode = 'reset',\n reducer = (items, chunk) =>\n addToEnd(items as Array, chunk) as TData,\n initialValue = [] as TData,\n}: StreamedQueryParams): QueryFunction<\n TData,\n TQueryKey\n> {\n return async (context) => {\n const query = context.client\n .getQueryCache()\n .find({ queryKey: context.queryKey, exact: true })\n const isRefetch = !!query && query.state.data !== undefined\n if (isRefetch && refetchMode === 'reset') {\n query.setState({\n status: 'pending',\n data: undefined,\n error: null,\n fetchStatus: 'fetching',\n })\n }\n\n let result = initialValue\n\n let cancelled: boolean = false as boolean\n const streamFnContext = addConsumeAwareSignal<\n OmitKeyof\n >(\n {\n client: context.client,\n meta: context.meta,\n queryKey: context.queryKey,\n pageParam: context.pageParam,\n direction: context.direction,\n },\n () => context.signal,\n () => (cancelled = true),\n )\n\n const stream = await streamFn(streamFnContext)\n\n const isReplaceRefetch = isRefetch && refetchMode === 'replace'\n\n for await (const chunk of stream) {\n if (cancelled) {\n break\n }\n\n if (isReplaceRefetch) {\n // don't append to the cache directly when replace-refetching\n result = reducer(result, chunk)\n } else {\n context.client.setQueryData(context.queryKey, (prev) =>\n reducer(prev === undefined ? initialValue : prev, chunk),\n )\n }\n }\n\n // finalize result: replace-refetching needs to write to the cache\n if (isReplaceRefetch && !cancelled) {\n context.client.setQueryData(context.queryKey, result)\n }\n\n return context.client.getQueryData(context.queryKey) ?? initialValue\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAgD;AAkDzC,SAAS,cAId;AAAA,EACA;AAAA,EACA,cAAc;AAAA,EACd,UAAU,CAAC,OAAO,cAChB,uBAAS,OAA8B,KAAK;AAAA,EAC9C,eAAe,CAAC;AAClB,GAGE;AACA,SAAO,OAAO,YAAY;AACxB,UAAM,QAAQ,QAAQ,OACnB,cAAc,EACd,KAAK,EAAE,UAAU,QAAQ,UAAU,OAAO,KAAK,CAAC;AACnD,UAAM,YAAY,CAAC,CAAC,SAAS,MAAM,MAAM,SAAS;AAClD,QAAI,aAAa,gBAAgB,SAAS;AACxC,YAAM,SAAS;AAAA,QACb,QAAQ;AAAA,QACR,MAAM;AAAA,QACN,OAAO;AAAA,QACP,aAAa;AAAA,MACf,CAAC;AAAA,IACH;AAEA,QAAI,SAAS;AAEb,QAAI,YAAqB;AACzB,UAAM,sBAAkB;AAAA,MAGtB;AAAA,QACE,QAAQ,QAAQ;AAAA,QAChB,MAAM,QAAQ;AAAA,QACd,UAAU,QAAQ;AAAA,QAClB,WAAW,QAAQ;AAAA,QACnB,WAAW,QAAQ;AAAA,MACrB;AAAA,MACA,MAAM,QAAQ;AAAA,MACd,MAAO,YAAY;AAAA,IACrB;AAEA,UAAM,SAAS,MAAM,SAAS,eAAe;AAE7C,UAAM,mBAAmB,aAAa,gBAAgB;AAEtD,qBAAiB,SAAS,QAAQ;AAChC,UAAI,WAAW;AACb;AAAA,MACF;AAEA,UAAI,kBAAkB;AAEpB,iBAAS,QAAQ,QAAQ,KAAK;AAAA,MAChC,OAAO;AACL,gBAAQ,OAAO;AAAA,UAAoB,QAAQ;AAAA,UAAU,CAAC,SACpD,QAAQ,SAAS,SAAY,eAAe,MAAM,KAAK;AAAA,QACzD;AAAA,MACF;AAAA,IACF;AAGA,QAAI,oBAAoB,CAAC,WAAW;AAClC,cAAQ,OAAO,aAAoB,QAAQ,UAAU,MAAM;AAAA,IAC7D;AAEA,WAAO,QAAQ,OAAO,aAAa,QAAQ,QAAQ,KAAK;AAAA,EAC1D;AACF;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/streamedQuery.d.cts b/node_modules/@tanstack/query-core/build/legacy/streamedQuery.d.cts new file mode 100644 index 0000000..c133466 --- /dev/null +++ b/node_modules/@tanstack/query-core/build/legacy/streamedQuery.d.cts @@ -0,0 +1,34 @@ +import { I as QueryKey, a1 as QueryFunctionContext, Y as QueryFunction } from './hydration-uphG6M-i.cjs'; +import './removable.cjs'; +import './subscribable.cjs'; + +type BaseStreamedQueryParams = { + streamFn: (context: QueryFunctionContext) => AsyncIterable | Promise>; + refetchMode?: 'append' | 'reset' | 'replace'; +}; +type SimpleStreamedQueryParams = BaseStreamedQueryParams & { + reducer?: never; + initialValue?: never; +}; +type ReducibleStreamedQueryParams = BaseStreamedQueryParams & { + reducer: (acc: TData, chunk: TQueryFnData) => TData; + initialValue: TData; +}; +type StreamedQueryParams = SimpleStreamedQueryParams | ReducibleStreamedQueryParams; +/** + * This is a helper function to create a query function that streams data from an AsyncIterable. + * Data will be an Array of all the chunks received. + * The query will be in a 'pending' state until the first chunk of data is received, but will go to 'success' after that. + * The query will stay in fetchStatus 'fetching' until the stream ends. + * @param queryFn - The function that returns an AsyncIterable to stream data from. + * @param refetchMode - Defines how re-fetches are handled. + * Defaults to `'reset'`, erases all data and puts the query back into `pending` state. + * Set to `'append'` to append new data to the existing data. + * Set to `'replace'` to write all data to the cache once the stream ends. + * @param reducer - A function to reduce the streamed chunks into the final data. + * Defaults to a function that appends chunks to the end of the array. + * @param initialValue - Initial value to be used while the first chunk is being fetched, and returned if the stream yields no values. + */ +declare function streamedQuery, TQueryKey extends QueryKey = QueryKey>({ streamFn, refetchMode, reducer, initialValue, }: StreamedQueryParams): QueryFunction; + +export { streamedQuery }; diff --git a/node_modules/@tanstack/query-core/build/legacy/streamedQuery.d.ts b/node_modules/@tanstack/query-core/build/legacy/streamedQuery.d.ts new file mode 100644 index 0000000..44d3ec4 --- /dev/null +++ b/node_modules/@tanstack/query-core/build/legacy/streamedQuery.d.ts @@ -0,0 +1,34 @@ +import { I as QueryKey, a1 as QueryFunctionContext, Y as QueryFunction } from './hydration-BlEVG2Lp.js'; +import './removable.js'; +import './subscribable.js'; + +type BaseStreamedQueryParams = { + streamFn: (context: QueryFunctionContext) => AsyncIterable | Promise>; + refetchMode?: 'append' | 'reset' | 'replace'; +}; +type SimpleStreamedQueryParams = BaseStreamedQueryParams & { + reducer?: never; + initialValue?: never; +}; +type ReducibleStreamedQueryParams = BaseStreamedQueryParams & { + reducer: (acc: TData, chunk: TQueryFnData) => TData; + initialValue: TData; +}; +type StreamedQueryParams = SimpleStreamedQueryParams | ReducibleStreamedQueryParams; +/** + * This is a helper function to create a query function that streams data from an AsyncIterable. + * Data will be an Array of all the chunks received. + * The query will be in a 'pending' state until the first chunk of data is received, but will go to 'success' after that. + * The query will stay in fetchStatus 'fetching' until the stream ends. + * @param queryFn - The function that returns an AsyncIterable to stream data from. + * @param refetchMode - Defines how re-fetches are handled. + * Defaults to `'reset'`, erases all data and puts the query back into `pending` state. + * Set to `'append'` to append new data to the existing data. + * Set to `'replace'` to write all data to the cache once the stream ends. + * @param reducer - A function to reduce the streamed chunks into the final data. + * Defaults to a function that appends chunks to the end of the array. + * @param initialValue - Initial value to be used while the first chunk is being fetched, and returned if the stream yields no values. + */ +declare function streamedQuery, TQueryKey extends QueryKey = QueryKey>({ streamFn, refetchMode, reducer, initialValue, }: StreamedQueryParams): QueryFunction; + +export { streamedQuery }; diff --git a/node_modules/@tanstack/query-core/build/legacy/streamedQuery.js b/node_modules/@tanstack/query-core/build/legacy/streamedQuery.js new file mode 100644 index 0000000..0c273aa --- /dev/null +++ b/node_modules/@tanstack/query-core/build/legacy/streamedQuery.js @@ -0,0 +1,59 @@ +import "./chunk-PXG64RU4.js"; + +// src/streamedQuery.ts +import { addConsumeAwareSignal, addToEnd } from "./utils.js"; +function streamedQuery({ + streamFn, + refetchMode = "reset", + reducer = (items, chunk) => addToEnd(items, chunk), + initialValue = [] +}) { + return async (context) => { + const query = context.client.getQueryCache().find({ queryKey: context.queryKey, exact: true }); + const isRefetch = !!query && query.state.data !== void 0; + if (isRefetch && refetchMode === "reset") { + query.setState({ + status: "pending", + data: void 0, + error: null, + fetchStatus: "fetching" + }); + } + let result = initialValue; + let cancelled = false; + const streamFnContext = addConsumeAwareSignal( + { + client: context.client, + meta: context.meta, + queryKey: context.queryKey, + pageParam: context.pageParam, + direction: context.direction + }, + () => context.signal, + () => cancelled = true + ); + const stream = await streamFn(streamFnContext); + const isReplaceRefetch = isRefetch && refetchMode === "replace"; + for await (const chunk of stream) { + if (cancelled) { + break; + } + if (isReplaceRefetch) { + result = reducer(result, chunk); + } else { + context.client.setQueryData( + context.queryKey, + (prev) => reducer(prev === void 0 ? initialValue : prev, chunk) + ); + } + } + if (isReplaceRefetch && !cancelled) { + context.client.setQueryData(context.queryKey, result); + } + return context.client.getQueryData(context.queryKey) ?? initialValue; + }; +} +export { + streamedQuery +}; +//# sourceMappingURL=streamedQuery.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/streamedQuery.js.map b/node_modules/@tanstack/query-core/build/legacy/streamedQuery.js.map new file mode 100644 index 0000000..6fd1c35 --- /dev/null +++ b/node_modules/@tanstack/query-core/build/legacy/streamedQuery.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/streamedQuery.ts"],"sourcesContent":["import { addConsumeAwareSignal, addToEnd } from './utils'\nimport type {\n OmitKeyof,\n QueryFunction,\n QueryFunctionContext,\n QueryKey,\n} from './types'\n\ntype BaseStreamedQueryParams = {\n streamFn: (\n context: QueryFunctionContext,\n ) => AsyncIterable | Promise>\n refetchMode?: 'append' | 'reset' | 'replace'\n}\n\ntype SimpleStreamedQueryParams<\n TQueryFnData,\n TQueryKey extends QueryKey,\n> = BaseStreamedQueryParams & {\n reducer?: never\n initialValue?: never\n}\n\ntype ReducibleStreamedQueryParams<\n TQueryFnData,\n TData,\n TQueryKey extends QueryKey,\n> = BaseStreamedQueryParams & {\n reducer: (acc: TData, chunk: TQueryFnData) => TData\n initialValue: TData\n}\n\ntype StreamedQueryParams =\n | SimpleStreamedQueryParams\n | ReducibleStreamedQueryParams\n\n/**\n * This is a helper function to create a query function that streams data from an AsyncIterable.\n * Data will be an Array of all the chunks received.\n * The query will be in a 'pending' state until the first chunk of data is received, but will go to 'success' after that.\n * The query will stay in fetchStatus 'fetching' until the stream ends.\n * @param queryFn - The function that returns an AsyncIterable to stream data from.\n * @param refetchMode - Defines how re-fetches are handled.\n * Defaults to `'reset'`, erases all data and puts the query back into `pending` state.\n * Set to `'append'` to append new data to the existing data.\n * Set to `'replace'` to write all data to the cache once the stream ends.\n * @param reducer - A function to reduce the streamed chunks into the final data.\n * Defaults to a function that appends chunks to the end of the array.\n * @param initialValue - Initial value to be used while the first chunk is being fetched, and returned if the stream yields no values.\n */\nexport function streamedQuery<\n TQueryFnData = unknown,\n TData = Array,\n TQueryKey extends QueryKey = QueryKey,\n>({\n streamFn,\n refetchMode = 'reset',\n reducer = (items, chunk) =>\n addToEnd(items as Array, chunk) as TData,\n initialValue = [] as TData,\n}: StreamedQueryParams): QueryFunction<\n TData,\n TQueryKey\n> {\n return async (context) => {\n const query = context.client\n .getQueryCache()\n .find({ queryKey: context.queryKey, exact: true })\n const isRefetch = !!query && query.state.data !== undefined\n if (isRefetch && refetchMode === 'reset') {\n query.setState({\n status: 'pending',\n data: undefined,\n error: null,\n fetchStatus: 'fetching',\n })\n }\n\n let result = initialValue\n\n let cancelled: boolean = false as boolean\n const streamFnContext = addConsumeAwareSignal<\n OmitKeyof\n >(\n {\n client: context.client,\n meta: context.meta,\n queryKey: context.queryKey,\n pageParam: context.pageParam,\n direction: context.direction,\n },\n () => context.signal,\n () => (cancelled = true),\n )\n\n const stream = await streamFn(streamFnContext)\n\n const isReplaceRefetch = isRefetch && refetchMode === 'replace'\n\n for await (const chunk of stream) {\n if (cancelled) {\n break\n }\n\n if (isReplaceRefetch) {\n // don't append to the cache directly when replace-refetching\n result = reducer(result, chunk)\n } else {\n context.client.setQueryData(context.queryKey, (prev) =>\n reducer(prev === undefined ? initialValue : prev, chunk),\n )\n }\n }\n\n // finalize result: replace-refetching needs to write to the cache\n if (isReplaceRefetch && !cancelled) {\n context.client.setQueryData(context.queryKey, result)\n }\n\n return context.client.getQueryData(context.queryKey) ?? initialValue\n }\n}\n"],"mappings":";;;AAAA,SAAS,uBAAuB,gBAAgB;AAkDzC,SAAS,cAId;AAAA,EACA;AAAA,EACA,cAAc;AAAA,EACd,UAAU,CAAC,OAAO,UAChB,SAAS,OAA8B,KAAK;AAAA,EAC9C,eAAe,CAAC;AAClB,GAGE;AACA,SAAO,OAAO,YAAY;AACxB,UAAM,QAAQ,QAAQ,OACnB,cAAc,EACd,KAAK,EAAE,UAAU,QAAQ,UAAU,OAAO,KAAK,CAAC;AACnD,UAAM,YAAY,CAAC,CAAC,SAAS,MAAM,MAAM,SAAS;AAClD,QAAI,aAAa,gBAAgB,SAAS;AACxC,YAAM,SAAS;AAAA,QACb,QAAQ;AAAA,QACR,MAAM;AAAA,QACN,OAAO;AAAA,QACP,aAAa;AAAA,MACf,CAAC;AAAA,IACH;AAEA,QAAI,SAAS;AAEb,QAAI,YAAqB;AACzB,UAAM,kBAAkB;AAAA,MAGtB;AAAA,QACE,QAAQ,QAAQ;AAAA,QAChB,MAAM,QAAQ;AAAA,QACd,UAAU,QAAQ;AAAA,QAClB,WAAW,QAAQ;AAAA,QACnB,WAAW,QAAQ;AAAA,MACrB;AAAA,MACA,MAAM,QAAQ;AAAA,MACd,MAAO,YAAY;AAAA,IACrB;AAEA,UAAM,SAAS,MAAM,SAAS,eAAe;AAE7C,UAAM,mBAAmB,aAAa,gBAAgB;AAEtD,qBAAiB,SAAS,QAAQ;AAChC,UAAI,WAAW;AACb;AAAA,MACF;AAEA,UAAI,kBAAkB;AAEpB,iBAAS,QAAQ,QAAQ,KAAK;AAAA,MAChC,OAAO;AACL,gBAAQ,OAAO;AAAA,UAAoB,QAAQ;AAAA,UAAU,CAAC,SACpD,QAAQ,SAAS,SAAY,eAAe,MAAM,KAAK;AAAA,QACzD;AAAA,MACF;AAAA,IACF;AAGA,QAAI,oBAAoB,CAAC,WAAW;AAClC,cAAQ,OAAO,aAAoB,QAAQ,UAAU,MAAM;AAAA,IAC7D;AAEA,WAAO,QAAQ,OAAO,aAAa,QAAQ,QAAQ,KAAK;AAAA,EAC1D;AACF;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/subscribable.cjs b/node_modules/@tanstack/query-core/build/legacy/subscribable.cjs new file mode 100644 index 0000000..c402602 --- /dev/null +++ b/node_modules/@tanstack/query-core/build/legacy/subscribable.cjs @@ -0,0 +1,51 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/subscribable.ts +var subscribable_exports = {}; +__export(subscribable_exports, { + Subscribable: () => Subscribable +}); +module.exports = __toCommonJS(subscribable_exports); +var Subscribable = class { + constructor() { + this.listeners = /* @__PURE__ */ new Set(); + this.subscribe = this.subscribe.bind(this); + } + subscribe(listener) { + this.listeners.add(listener); + this.onSubscribe(); + return () => { + this.listeners.delete(listener); + this.onUnsubscribe(); + }; + } + hasListeners() { + return this.listeners.size > 0; + } + onSubscribe() { + } + onUnsubscribe() { + } +}; +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + Subscribable +}); +//# sourceMappingURL=subscribable.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/subscribable.cjs.map b/node_modules/@tanstack/query-core/build/legacy/subscribable.cjs.map new file mode 100644 index 0000000..43f8336 --- /dev/null +++ b/node_modules/@tanstack/query-core/build/legacy/subscribable.cjs.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/subscribable.ts"],"sourcesContent":["export class Subscribable {\n protected listeners = new Set()\n\n constructor() {\n this.subscribe = this.subscribe.bind(this)\n }\n\n subscribe(listener: TListener): () => void {\n this.listeners.add(listener)\n\n this.onSubscribe()\n\n return () => {\n this.listeners.delete(listener)\n this.onUnsubscribe()\n }\n }\n\n hasListeners(): boolean {\n return this.listeners.size > 0\n }\n\n protected onSubscribe(): void {\n // Do nothing\n }\n\n protected onUnsubscribe(): void {\n // Do nothing\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAO,IAAM,eAAN,MAA+C;AAAA,EAGpD,cAAc;AAFd,SAAU,YAAY,oBAAI,IAAe;AAGvC,SAAK,YAAY,KAAK,UAAU,KAAK,IAAI;AAAA,EAC3C;AAAA,EAEA,UAAU,UAAiC;AACzC,SAAK,UAAU,IAAI,QAAQ;AAE3B,SAAK,YAAY;AAEjB,WAAO,MAAM;AACX,WAAK,UAAU,OAAO,QAAQ;AAC9B,WAAK,cAAc;AAAA,IACrB;AAAA,EACF;AAAA,EAEA,eAAwB;AACtB,WAAO,KAAK,UAAU,OAAO;AAAA,EAC/B;AAAA,EAEU,cAAoB;AAAA,EAE9B;AAAA,EAEU,gBAAsB;AAAA,EAEhC;AACF;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/subscribable.d.cts b/node_modules/@tanstack/query-core/build/legacy/subscribable.d.cts new file mode 100644 index 0000000..5ac4d3d --- /dev/null +++ b/node_modules/@tanstack/query-core/build/legacy/subscribable.d.cts @@ -0,0 +1,10 @@ +declare class Subscribable { + protected listeners: Set; + constructor(); + subscribe(listener: TListener): () => void; + hasListeners(): boolean; + protected onSubscribe(): void; + protected onUnsubscribe(): void; +} + +export { Subscribable }; diff --git a/node_modules/@tanstack/query-core/build/legacy/subscribable.d.ts b/node_modules/@tanstack/query-core/build/legacy/subscribable.d.ts new file mode 100644 index 0000000..5ac4d3d --- /dev/null +++ b/node_modules/@tanstack/query-core/build/legacy/subscribable.d.ts @@ -0,0 +1,10 @@ +declare class Subscribable { + protected listeners: Set; + constructor(); + subscribe(listener: TListener): () => void; + hasListeners(): boolean; + protected onSubscribe(): void; + protected onUnsubscribe(): void; +} + +export { Subscribable }; diff --git a/node_modules/@tanstack/query-core/build/legacy/subscribable.js b/node_modules/@tanstack/query-core/build/legacy/subscribable.js new file mode 100644 index 0000000..d701fe9 --- /dev/null +++ b/node_modules/@tanstack/query-core/build/legacy/subscribable.js @@ -0,0 +1,28 @@ +import "./chunk-PXG64RU4.js"; + +// src/subscribable.ts +var Subscribable = class { + constructor() { + this.listeners = /* @__PURE__ */ new Set(); + this.subscribe = this.subscribe.bind(this); + } + subscribe(listener) { + this.listeners.add(listener); + this.onSubscribe(); + return () => { + this.listeners.delete(listener); + this.onUnsubscribe(); + }; + } + hasListeners() { + return this.listeners.size > 0; + } + onSubscribe() { + } + onUnsubscribe() { + } +}; +export { + Subscribable +}; +//# sourceMappingURL=subscribable.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/subscribable.js.map b/node_modules/@tanstack/query-core/build/legacy/subscribable.js.map new file mode 100644 index 0000000..ae0fe0d --- /dev/null +++ b/node_modules/@tanstack/query-core/build/legacy/subscribable.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/subscribable.ts"],"sourcesContent":["export class Subscribable {\n protected listeners = new Set()\n\n constructor() {\n this.subscribe = this.subscribe.bind(this)\n }\n\n subscribe(listener: TListener): () => void {\n this.listeners.add(listener)\n\n this.onSubscribe()\n\n return () => {\n this.listeners.delete(listener)\n this.onUnsubscribe()\n }\n }\n\n hasListeners(): boolean {\n return this.listeners.size > 0\n }\n\n protected onSubscribe(): void {\n // Do nothing\n }\n\n protected onUnsubscribe(): void {\n // Do nothing\n }\n}\n"],"mappings":";;;AAAO,IAAM,eAAN,MAA+C;AAAA,EAGpD,cAAc;AAFd,SAAU,YAAY,oBAAI,IAAe;AAGvC,SAAK,YAAY,KAAK,UAAU,KAAK,IAAI;AAAA,EAC3C;AAAA,EAEA,UAAU,UAAiC;AACzC,SAAK,UAAU,IAAI,QAAQ;AAE3B,SAAK,YAAY;AAEjB,WAAO,MAAM;AACX,WAAK,UAAU,OAAO,QAAQ;AAC9B,WAAK,cAAc;AAAA,IACrB;AAAA,EACF;AAAA,EAEA,eAAwB;AACtB,WAAO,KAAK,UAAU,OAAO;AAAA,EAC/B;AAAA,EAEU,cAAoB;AAAA,EAE9B;AAAA,EAEU,gBAAsB;AAAA,EAEhC;AACF;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/thenable.cjs b/node_modules/@tanstack/query-core/build/legacy/thenable.cjs new file mode 100644 index 0000000..21e4d9b --- /dev/null +++ b/node_modules/@tanstack/query-core/build/legacy/thenable.cjs @@ -0,0 +1,76 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/thenable.ts +var thenable_exports = {}; +__export(thenable_exports, { + pendingThenable: () => pendingThenable, + tryResolveSync: () => tryResolveSync +}); +module.exports = __toCommonJS(thenable_exports); +var import_utils = require("./utils.cjs"); +function pendingThenable() { + let resolve; + let reject; + const thenable = new Promise((_resolve, _reject) => { + resolve = _resolve; + reject = _reject; + }); + thenable.status = "pending"; + thenable.catch(() => { + }); + function finalize(data) { + Object.assign(thenable, data); + delete thenable.resolve; + delete thenable.reject; + } + thenable.resolve = (value) => { + finalize({ + status: "fulfilled", + value + }); + resolve(value); + }; + thenable.reject = (reason) => { + finalize({ + status: "rejected", + reason + }); + reject(reason); + }; + return thenable; +} +function tryResolveSync(promise) { + var _a; + let data; + (_a = promise.then((result) => { + data = result; + return result; + }, import_utils.noop)) == null ? void 0 : _a.catch(import_utils.noop); + if (data !== void 0) { + return { data }; + } + return void 0; +} +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + pendingThenable, + tryResolveSync +}); +//# sourceMappingURL=thenable.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/thenable.cjs.map b/node_modules/@tanstack/query-core/build/legacy/thenable.cjs.map new file mode 100644 index 0000000..ba93a14 --- /dev/null +++ b/node_modules/@tanstack/query-core/build/legacy/thenable.cjs.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/thenable.ts"],"sourcesContent":["/**\n * Thenable types which matches React's types for promises\n *\n * React seemingly uses `.status`, `.value` and `.reason` properties on a promises to optimistically unwrap data from promises\n *\n * @see https://github.com/facebook/react/blob/main/packages/shared/ReactTypes.js#L112-L138\n * @see https://github.com/facebook/react/blob/4f604941569d2e8947ce1460a0b2997e835f37b9/packages/react-debug-tools/src/ReactDebugHooks.js#L224-L227\n */\n\nimport { noop } from './utils'\n\ninterface Fulfilled {\n status: 'fulfilled'\n value: T\n}\ninterface Rejected {\n status: 'rejected'\n reason: unknown\n}\ninterface Pending {\n status: 'pending'\n\n /**\n * Resolve the promise with a value.\n * Will remove the `resolve` and `reject` properties from the promise.\n */\n resolve: (value: T) => void\n /**\n * Reject the promise with a reason.\n * Will remove the `resolve` and `reject` properties from the promise.\n */\n reject: (reason: unknown) => void\n}\n\nexport type FulfilledThenable = Promise & Fulfilled\nexport type RejectedThenable = Promise & Rejected\nexport type PendingThenable = Promise & Pending\n\nexport type Thenable =\n | FulfilledThenable\n | RejectedThenable\n | PendingThenable\n\nexport function pendingThenable(): PendingThenable {\n let resolve: Pending['resolve']\n let reject: Pending['reject']\n // this could use `Promise.withResolvers()` in the future\n const thenable = new Promise((_resolve, _reject) => {\n resolve = _resolve\n reject = _reject\n }) as PendingThenable\n\n thenable.status = 'pending'\n thenable.catch(() => {\n // prevent unhandled rejection errors\n })\n\n function finalize(data: Fulfilled | Rejected) {\n Object.assign(thenable, data)\n\n // clear pending props props to avoid calling them twice\n delete (thenable as Partial>).resolve\n delete (thenable as Partial>).reject\n }\n\n thenable.resolve = (value) => {\n finalize({\n status: 'fulfilled',\n value,\n })\n\n resolve(value)\n }\n thenable.reject = (reason) => {\n finalize({\n status: 'rejected',\n reason,\n })\n\n reject(reason)\n }\n\n return thenable\n}\n\n/**\n * This function takes a Promise-like input and detects whether the data\n * is synchronously available or not.\n *\n * It does not inspect .status, .value or .reason properties of the promise,\n * as those are not always available, and the .status of React's promises\n * should not be considered part of the public API.\n */\nexport function tryResolveSync(promise: Promise | Thenable) {\n let data: unknown\n\n promise\n .then((result) => {\n data = result\n return result\n }, noop)\n // .catch can be unavailable on certain kinds of thenable's\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n ?.catch(noop)\n\n if (data !== undefined) {\n return { data }\n }\n\n return undefined\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASA,mBAAqB;AAkCd,SAAS,kBAAyC;AACvD,MAAI;AACJ,MAAI;AAEJ,QAAM,WAAW,IAAI,QAAQ,CAAC,UAAU,YAAY;AAClD,cAAU;AACV,aAAS;AAAA,EACX,CAAC;AAED,WAAS,SAAS;AAClB,WAAS,MAAM,MAAM;AAAA,EAErB,CAAC;AAED,WAAS,SAAS,MAA+B;AAC/C,WAAO,OAAO,UAAU,IAAI;AAG5B,WAAQ,SAAyC;AACjD,WAAQ,SAAyC;AAAA,EACnD;AAEA,WAAS,UAAU,CAAC,UAAU;AAC5B,aAAS;AAAA,MACP,QAAQ;AAAA,MACR;AAAA,IACF,CAAC;AAED,YAAQ,KAAK;AAAA,EACf;AACA,WAAS,SAAS,CAAC,WAAW;AAC5B,aAAS;AAAA,MACP,QAAQ;AAAA,MACR;AAAA,IACF,CAAC;AAED,WAAO,MAAM;AAAA,EACf;AAEA,SAAO;AACT;AAUO,SAAS,eAAe,SAA+C;AA7F9E;AA8FE,MAAI;AAEJ,gBACG,KAAK,CAAC,WAAW;AAChB,WAAO;AACP,WAAO;AAAA,EACT,GAAG,iBAAI,MAJT,mBAOI,MAAM;AAEV,MAAI,SAAS,QAAW;AACtB,WAAO,EAAE,KAAK;AAAA,EAChB;AAEA,SAAO;AACT;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/thenable.d.cts b/node_modules/@tanstack/query-core/build/legacy/thenable.d.cts new file mode 100644 index 0000000..2378593 --- /dev/null +++ b/node_modules/@tanstack/query-core/build/legacy/thenable.d.cts @@ -0,0 +1,47 @@ +/** + * Thenable types which matches React's types for promises + * + * React seemingly uses `.status`, `.value` and `.reason` properties on a promises to optimistically unwrap data from promises + * + * @see https://github.com/facebook/react/blob/main/packages/shared/ReactTypes.js#L112-L138 + * @see https://github.com/facebook/react/blob/4f604941569d2e8947ce1460a0b2997e835f37b9/packages/react-debug-tools/src/ReactDebugHooks.js#L224-L227 + */ +interface Fulfilled { + status: 'fulfilled'; + value: T; +} +interface Rejected { + status: 'rejected'; + reason: unknown; +} +interface Pending { + status: 'pending'; + /** + * Resolve the promise with a value. + * Will remove the `resolve` and `reject` properties from the promise. + */ + resolve: (value: T) => void; + /** + * Reject the promise with a reason. + * Will remove the `resolve` and `reject` properties from the promise. + */ + reject: (reason: unknown) => void; +} +type FulfilledThenable = Promise & Fulfilled; +type RejectedThenable = Promise & Rejected; +type PendingThenable = Promise & Pending; +type Thenable = FulfilledThenable | RejectedThenable | PendingThenable; +declare function pendingThenable(): PendingThenable; +/** + * This function takes a Promise-like input and detects whether the data + * is synchronously available or not. + * + * It does not inspect .status, .value or .reason properties of the promise, + * as those are not always available, and the .status of React's promises + * should not be considered part of the public API. + */ +declare function tryResolveSync(promise: Promise | Thenable): { + data: {} | null; +} | undefined; + +export { type FulfilledThenable, type PendingThenable, type RejectedThenable, type Thenable, pendingThenable, tryResolveSync }; diff --git a/node_modules/@tanstack/query-core/build/legacy/thenable.d.ts b/node_modules/@tanstack/query-core/build/legacy/thenable.d.ts new file mode 100644 index 0000000..2378593 --- /dev/null +++ b/node_modules/@tanstack/query-core/build/legacy/thenable.d.ts @@ -0,0 +1,47 @@ +/** + * Thenable types which matches React's types for promises + * + * React seemingly uses `.status`, `.value` and `.reason` properties on a promises to optimistically unwrap data from promises + * + * @see https://github.com/facebook/react/blob/main/packages/shared/ReactTypes.js#L112-L138 + * @see https://github.com/facebook/react/blob/4f604941569d2e8947ce1460a0b2997e835f37b9/packages/react-debug-tools/src/ReactDebugHooks.js#L224-L227 + */ +interface Fulfilled { + status: 'fulfilled'; + value: T; +} +interface Rejected { + status: 'rejected'; + reason: unknown; +} +interface Pending { + status: 'pending'; + /** + * Resolve the promise with a value. + * Will remove the `resolve` and `reject` properties from the promise. + */ + resolve: (value: T) => void; + /** + * Reject the promise with a reason. + * Will remove the `resolve` and `reject` properties from the promise. + */ + reject: (reason: unknown) => void; +} +type FulfilledThenable = Promise & Fulfilled; +type RejectedThenable = Promise & Rejected; +type PendingThenable = Promise & Pending; +type Thenable = FulfilledThenable | RejectedThenable | PendingThenable; +declare function pendingThenable(): PendingThenable; +/** + * This function takes a Promise-like input and detects whether the data + * is synchronously available or not. + * + * It does not inspect .status, .value or .reason properties of the promise, + * as those are not always available, and the .status of React's promises + * should not be considered part of the public API. + */ +declare function tryResolveSync(promise: Promise | Thenable): { + data: {} | null; +} | undefined; + +export { type FulfilledThenable, type PendingThenable, type RejectedThenable, type Thenable, pendingThenable, tryResolveSync }; diff --git a/node_modules/@tanstack/query-core/build/legacy/thenable.js b/node_modules/@tanstack/query-core/build/legacy/thenable.js new file mode 100644 index 0000000..4307dae --- /dev/null +++ b/node_modules/@tanstack/query-core/build/legacy/thenable.js @@ -0,0 +1,52 @@ +import "./chunk-PXG64RU4.js"; + +// src/thenable.ts +import { noop } from "./utils.js"; +function pendingThenable() { + let resolve; + let reject; + const thenable = new Promise((_resolve, _reject) => { + resolve = _resolve; + reject = _reject; + }); + thenable.status = "pending"; + thenable.catch(() => { + }); + function finalize(data) { + Object.assign(thenable, data); + delete thenable.resolve; + delete thenable.reject; + } + thenable.resolve = (value) => { + finalize({ + status: "fulfilled", + value + }); + resolve(value); + }; + thenable.reject = (reason) => { + finalize({ + status: "rejected", + reason + }); + reject(reason); + }; + return thenable; +} +function tryResolveSync(promise) { + var _a; + let data; + (_a = promise.then((result) => { + data = result; + return result; + }, noop)) == null ? void 0 : _a.catch(noop); + if (data !== void 0) { + return { data }; + } + return void 0; +} +export { + pendingThenable, + tryResolveSync +}; +//# sourceMappingURL=thenable.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/thenable.js.map b/node_modules/@tanstack/query-core/build/legacy/thenable.js.map new file mode 100644 index 0000000..acc7747 --- /dev/null +++ b/node_modules/@tanstack/query-core/build/legacy/thenable.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/thenable.ts"],"sourcesContent":["/**\n * Thenable types which matches React's types for promises\n *\n * React seemingly uses `.status`, `.value` and `.reason` properties on a promises to optimistically unwrap data from promises\n *\n * @see https://github.com/facebook/react/blob/main/packages/shared/ReactTypes.js#L112-L138\n * @see https://github.com/facebook/react/blob/4f604941569d2e8947ce1460a0b2997e835f37b9/packages/react-debug-tools/src/ReactDebugHooks.js#L224-L227\n */\n\nimport { noop } from './utils'\n\ninterface Fulfilled {\n status: 'fulfilled'\n value: T\n}\ninterface Rejected {\n status: 'rejected'\n reason: unknown\n}\ninterface Pending {\n status: 'pending'\n\n /**\n * Resolve the promise with a value.\n * Will remove the `resolve` and `reject` properties from the promise.\n */\n resolve: (value: T) => void\n /**\n * Reject the promise with a reason.\n * Will remove the `resolve` and `reject` properties from the promise.\n */\n reject: (reason: unknown) => void\n}\n\nexport type FulfilledThenable = Promise & Fulfilled\nexport type RejectedThenable = Promise & Rejected\nexport type PendingThenable = Promise & Pending\n\nexport type Thenable =\n | FulfilledThenable\n | RejectedThenable\n | PendingThenable\n\nexport function pendingThenable(): PendingThenable {\n let resolve: Pending['resolve']\n let reject: Pending['reject']\n // this could use `Promise.withResolvers()` in the future\n const thenable = new Promise((_resolve, _reject) => {\n resolve = _resolve\n reject = _reject\n }) as PendingThenable\n\n thenable.status = 'pending'\n thenable.catch(() => {\n // prevent unhandled rejection errors\n })\n\n function finalize(data: Fulfilled | Rejected) {\n Object.assign(thenable, data)\n\n // clear pending props props to avoid calling them twice\n delete (thenable as Partial>).resolve\n delete (thenable as Partial>).reject\n }\n\n thenable.resolve = (value) => {\n finalize({\n status: 'fulfilled',\n value,\n })\n\n resolve(value)\n }\n thenable.reject = (reason) => {\n finalize({\n status: 'rejected',\n reason,\n })\n\n reject(reason)\n }\n\n return thenable\n}\n\n/**\n * This function takes a Promise-like input and detects whether the data\n * is synchronously available or not.\n *\n * It does not inspect .status, .value or .reason properties of the promise,\n * as those are not always available, and the .status of React's promises\n * should not be considered part of the public API.\n */\nexport function tryResolveSync(promise: Promise | Thenable) {\n let data: unknown\n\n promise\n .then((result) => {\n data = result\n return result\n }, noop)\n // .catch can be unavailable on certain kinds of thenable's\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n ?.catch(noop)\n\n if (data !== undefined) {\n return { data }\n }\n\n return undefined\n}\n"],"mappings":";;;AASA,SAAS,YAAY;AAkCd,SAAS,kBAAyC;AACvD,MAAI;AACJ,MAAI;AAEJ,QAAM,WAAW,IAAI,QAAQ,CAAC,UAAU,YAAY;AAClD,cAAU;AACV,aAAS;AAAA,EACX,CAAC;AAED,WAAS,SAAS;AAClB,WAAS,MAAM,MAAM;AAAA,EAErB,CAAC;AAED,WAAS,SAAS,MAA+B;AAC/C,WAAO,OAAO,UAAU,IAAI;AAG5B,WAAQ,SAAyC;AACjD,WAAQ,SAAyC;AAAA,EACnD;AAEA,WAAS,UAAU,CAAC,UAAU;AAC5B,aAAS;AAAA,MACP,QAAQ;AAAA,MACR;AAAA,IACF,CAAC;AAED,YAAQ,KAAK;AAAA,EACf;AACA,WAAS,SAAS,CAAC,WAAW;AAC5B,aAAS;AAAA,MACP,QAAQ;AAAA,MACR;AAAA,IACF,CAAC;AAED,WAAO,MAAM;AAAA,EACf;AAEA,SAAO;AACT;AAUO,SAAS,eAAe,SAA+C;AA7F9E;AA8FE,MAAI;AAEJ,gBACG,KAAK,CAAC,WAAW;AAChB,WAAO;AACP,WAAO;AAAA,EACT,GAAG,IAAI,MAJT,mBAOI,MAAM;AAEV,MAAI,SAAS,QAAW;AACtB,WAAO,EAAE,KAAK;AAAA,EAChB;AAEA,SAAO;AACT;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/timeoutManager.cjs b/node_modules/@tanstack/query-core/build/legacy/timeoutManager.cjs new file mode 100644 index 0000000..d66648d --- /dev/null +++ b/node_modules/@tanstack/query-core/build/legacy/timeoutManager.cjs @@ -0,0 +1,110 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __typeError = (msg) => { + throw TypeError(msg); +}; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg); +var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj)); +var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value); +var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value); + +// src/timeoutManager.ts +var timeoutManager_exports = {}; +__export(timeoutManager_exports, { + TimeoutManager: () => TimeoutManager, + defaultTimeoutProvider: () => defaultTimeoutProvider, + systemSetTimeoutZero: () => systemSetTimeoutZero, + timeoutManager: () => timeoutManager +}); +module.exports = __toCommonJS(timeoutManager_exports); +var defaultTimeoutProvider = { + // We need the wrapper function syntax below instead of direct references to + // global setTimeout etc. + // + // BAD: `setTimeout: setTimeout` + // GOOD: `setTimeout: (cb, delay) => setTimeout(cb, delay)` + // + // If we use direct references here, then anything that wants to spy on or + // replace the global setTimeout (like tests) won't work since we'll already + // have a hard reference to the original implementation at the time when this + // file was imported. + setTimeout: (callback, delay) => setTimeout(callback, delay), + clearTimeout: (timeoutId) => clearTimeout(timeoutId), + setInterval: (callback, delay) => setInterval(callback, delay), + clearInterval: (intervalId) => clearInterval(intervalId) +}; +var _provider, _providerCalled; +var TimeoutManager = class { + constructor() { + // We cannot have TimeoutManager as we must instantiate it with a concrete + // type at app boot; and if we leave that type, then any new timer provider + // would need to support ReturnType, which is infeasible. + // + // We settle for type safety for the TimeoutProvider type, and accept that + // this class is unsafe internally to allow for extension. + __privateAdd(this, _provider, defaultTimeoutProvider); + __privateAdd(this, _providerCalled, false); + } + setTimeoutProvider(provider) { + if (process.env.NODE_ENV !== "production") { + if (__privateGet(this, _providerCalled) && provider !== __privateGet(this, _provider)) { + console.error( + `[timeoutManager]: Switching provider after calls to previous provider might result in unexpected behavior.`, + { previous: __privateGet(this, _provider), provider } + ); + } + } + __privateSet(this, _provider, provider); + if (process.env.NODE_ENV !== "production") { + __privateSet(this, _providerCalled, false); + } + } + setTimeout(callback, delay) { + if (process.env.NODE_ENV !== "production") { + __privateSet(this, _providerCalled, true); + } + return __privateGet(this, _provider).setTimeout(callback, delay); + } + clearTimeout(timeoutId) { + __privateGet(this, _provider).clearTimeout(timeoutId); + } + setInterval(callback, delay) { + if (process.env.NODE_ENV !== "production") { + __privateSet(this, _providerCalled, true); + } + return __privateGet(this, _provider).setInterval(callback, delay); + } + clearInterval(intervalId) { + __privateGet(this, _provider).clearInterval(intervalId); + } +}; +_provider = new WeakMap(); +_providerCalled = new WeakMap(); +var timeoutManager = new TimeoutManager(); +function systemSetTimeoutZero(callback) { + setTimeout(callback, 0); +} +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + TimeoutManager, + defaultTimeoutProvider, + systemSetTimeoutZero, + timeoutManager +}); +//# sourceMappingURL=timeoutManager.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/timeoutManager.cjs.map b/node_modules/@tanstack/query-core/build/legacy/timeoutManager.cjs.map new file mode 100644 index 0000000..bca77c2 --- /dev/null +++ b/node_modules/@tanstack/query-core/build/legacy/timeoutManager.cjs.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/timeoutManager.ts"],"sourcesContent":["/**\n * {@link TimeoutManager} does not support passing arguments to the callback.\n *\n * `(_: void)` is the argument type inferred by TypeScript's default typings for\n * `setTimeout(cb, number)`.\n * If we don't accept a single void argument, then\n * `new Promise(resolve => timeoutManager.setTimeout(resolve, N))` is a type error.\n */\nexport type TimeoutCallback = (_: void) => void\n\n/**\n * Wrapping `setTimeout` is awkward from a typing perspective because platform\n * typings may extend the return type of `setTimeout`. For example, NodeJS\n * typings add `NodeJS.Timeout`; but a non-default `timeoutManager` may not be\n * able to return such a type.\n */\nexport type ManagedTimerId = number | { [Symbol.toPrimitive]: () => number }\n\n/**\n * Backend for timer functions.\n */\nexport type TimeoutProvider =\n {\n readonly setTimeout: (callback: TimeoutCallback, delay: number) => TTimerId\n readonly clearTimeout: (timeoutId: TTimerId | undefined) => void\n\n readonly setInterval: (callback: TimeoutCallback, delay: number) => TTimerId\n readonly clearInterval: (intervalId: TTimerId | undefined) => void\n }\n\nexport const defaultTimeoutProvider: TimeoutProvider<\n ReturnType\n> = {\n // We need the wrapper function syntax below instead of direct references to\n // global setTimeout etc.\n //\n // BAD: `setTimeout: setTimeout`\n // GOOD: `setTimeout: (cb, delay) => setTimeout(cb, delay)`\n //\n // If we use direct references here, then anything that wants to spy on or\n // replace the global setTimeout (like tests) won't work since we'll already\n // have a hard reference to the original implementation at the time when this\n // file was imported.\n setTimeout: (callback, delay) => setTimeout(callback, delay),\n clearTimeout: (timeoutId) => clearTimeout(timeoutId),\n\n setInterval: (callback, delay) => setInterval(callback, delay),\n clearInterval: (intervalId) => clearInterval(intervalId),\n}\n\n/**\n * Allows customization of how timeouts are created.\n *\n * @tanstack/query-core makes liberal use of timeouts to implement `staleTime`\n * and `gcTime`. The default TimeoutManager provider uses the platform's global\n * `setTimeout` implementation, which is known to have scalability issues with\n * thousands of timeouts on the event loop.\n *\n * If you hit this limitation, consider providing a custom TimeoutProvider that\n * coalesces timeouts.\n */\nexport class TimeoutManager implements Omit {\n // We cannot have TimeoutManager as we must instantiate it with a concrete\n // type at app boot; and if we leave that type, then any new timer provider\n // would need to support ReturnType, which is infeasible.\n //\n // We settle for type safety for the TimeoutProvider type, and accept that\n // this class is unsafe internally to allow for extension.\n #provider: TimeoutProvider = defaultTimeoutProvider\n #providerCalled = false\n\n setTimeoutProvider(\n provider: TimeoutProvider,\n ): void {\n if (process.env.NODE_ENV !== 'production') {\n if (this.#providerCalled && provider !== this.#provider) {\n // After changing providers, `clearTimeout` will not work as expected for\n // timeouts from the previous provider.\n //\n // Since they may allocate the same timeout ID, clearTimeout may cancel an\n // arbitrary different timeout, or unexpected no-op.\n //\n // We could protect against this by mixing the timeout ID bits\n // deterministically with some per-provider bits.\n //\n // We could internally queue `setTimeout` calls to `TimeoutManager` until\n // some API call to set the initial provider.\n console.error(\n `[timeoutManager]: Switching provider after calls to previous provider might result in unexpected behavior.`,\n { previous: this.#provider, provider },\n )\n }\n }\n\n this.#provider = provider\n if (process.env.NODE_ENV !== 'production') {\n this.#providerCalled = false\n }\n }\n\n setTimeout(callback: TimeoutCallback, delay: number): ManagedTimerId {\n if (process.env.NODE_ENV !== 'production') {\n this.#providerCalled = true\n }\n return this.#provider.setTimeout(callback, delay)\n }\n\n clearTimeout(timeoutId: ManagedTimerId | undefined): void {\n this.#provider.clearTimeout(timeoutId)\n }\n\n setInterval(callback: TimeoutCallback, delay: number): ManagedTimerId {\n if (process.env.NODE_ENV !== 'production') {\n this.#providerCalled = true\n }\n return this.#provider.setInterval(callback, delay)\n }\n\n clearInterval(intervalId: ManagedTimerId | undefined): void {\n this.#provider.clearInterval(intervalId)\n }\n}\n\nexport const timeoutManager = new TimeoutManager()\n\n/**\n * In many cases code wants to delay to the next event loop tick; this is not\n * mediated by {@link timeoutManager}.\n *\n * This function is provided to make auditing the `tanstack/query-core` for\n * incorrect use of system `setTimeout` easier.\n */\nexport function systemSetTimeoutZero(callback: Time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,YAA8C;AAC1D,uBAAK,WAAU,cAAc,UAAU;AAAA,EACzC;AACF;AArDE;AACA;AAsDK,IAAM,iBAAiB,IAAI,eAAe;AAS1C,SAAS,qBAAqB,UAAiC;AACpE,aAAW,UAAU,CAAC;AACxB;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/timeoutManager.d.cts b/node_modules/@tanstack/query-core/build/legacy/timeoutManager.d.cts new file mode 100644 index 0000000..f85f6f9 --- /dev/null +++ b/node_modules/@tanstack/query-core/build/legacy/timeoutManager.d.cts @@ -0,0 +1,58 @@ +/** + * {@link TimeoutManager} does not support passing arguments to the callback. + * + * `(_: void)` is the argument type inferred by TypeScript's default typings for + * `setTimeout(cb, number)`. + * If we don't accept a single void argument, then + * `new Promise(resolve => timeoutManager.setTimeout(resolve, N))` is a type error. + */ +type TimeoutCallback = (_: void) => void; +/** + * Wrapping `setTimeout` is awkward from a typing perspective because platform + * typings may extend the return type of `setTimeout`. For example, NodeJS + * typings add `NodeJS.Timeout`; but a non-default `timeoutManager` may not be + * able to return such a type. + */ +type ManagedTimerId = number | { + [Symbol.toPrimitive]: () => number; +}; +/** + * Backend for timer functions. + */ +type TimeoutProvider = { + readonly setTimeout: (callback: TimeoutCallback, delay: number) => TTimerId; + readonly clearTimeout: (timeoutId: TTimerId | undefined) => void; + readonly setInterval: (callback: TimeoutCallback, delay: number) => TTimerId; + readonly clearInterval: (intervalId: TTimerId | undefined) => void; +}; +declare const defaultTimeoutProvider: TimeoutProvider>; +/** + * Allows customization of how timeouts are created. + * + * @tanstack/query-core makes liberal use of timeouts to implement `staleTime` + * and `gcTime`. The default TimeoutManager provider uses the platform's global + * `setTimeout` implementation, which is known to have scalability issues with + * thousands of timeouts on the event loop. + * + * If you hit this limitation, consider providing a custom TimeoutProvider that + * coalesces timeouts. + */ +declare class TimeoutManager implements Omit { + #private; + setTimeoutProvider(provider: TimeoutProvider): void; + setTimeout(callback: TimeoutCallback, delay: number): ManagedTimerId; + clearTimeout(timeoutId: ManagedTimerId | undefined): void; + setInterval(callback: TimeoutCallback, delay: number): ManagedTimerId; + clearInterval(intervalId: ManagedTimerId | undefined): void; +} +declare const timeoutManager: TimeoutManager; +/** + * In many cases code wants to delay to the next event loop tick; this is not + * mediated by {@link timeoutManager}. + * + * This function is provided to make auditing the `tanstack/query-core` for + * incorrect use of system `setTimeout` easier. + */ +declare function systemSetTimeoutZero(callback: TimeoutCallback): void; + +export { type ManagedTimerId, type TimeoutCallback, TimeoutManager, type TimeoutProvider, defaultTimeoutProvider, systemSetTimeoutZero, timeoutManager }; diff --git a/node_modules/@tanstack/query-core/build/legacy/timeoutManager.d.ts b/node_modules/@tanstack/query-core/build/legacy/timeoutManager.d.ts new file mode 100644 index 0000000..f85f6f9 --- /dev/null +++ b/node_modules/@tanstack/query-core/build/legacy/timeoutManager.d.ts @@ -0,0 +1,58 @@ +/** + * {@link TimeoutManager} does not support passing arguments to the callback. + * + * `(_: void)` is the argument type inferred by TypeScript's default typings for + * `setTimeout(cb, number)`. + * If we don't accept a single void argument, then + * `new Promise(resolve => timeoutManager.setTimeout(resolve, N))` is a type error. + */ +type TimeoutCallback = (_: void) => void; +/** + * Wrapping `setTimeout` is awkward from a typing perspective because platform + * typings may extend the return type of `setTimeout`. For example, NodeJS + * typings add `NodeJS.Timeout`; but a non-default `timeoutManager` may not be + * able to return such a type. + */ +type ManagedTimerId = number | { + [Symbol.toPrimitive]: () => number; +}; +/** + * Backend for timer functions. + */ +type TimeoutProvider = { + readonly setTimeout: (callback: TimeoutCallback, delay: number) => TTimerId; + readonly clearTimeout: (timeoutId: TTimerId | undefined) => void; + readonly setInterval: (callback: TimeoutCallback, delay: number) => TTimerId; + readonly clearInterval: (intervalId: TTimerId | undefined) => void; +}; +declare const defaultTimeoutProvider: TimeoutProvider>; +/** + * Allows customization of how timeouts are created. + * + * @tanstack/query-core makes liberal use of timeouts to implement `staleTime` + * and `gcTime`. The default TimeoutManager provider uses the platform's global + * `setTimeout` implementation, which is known to have scalability issues with + * thousands of timeouts on the event loop. + * + * If you hit this limitation, consider providing a custom TimeoutProvider that + * coalesces timeouts. + */ +declare class TimeoutManager implements Omit { + #private; + setTimeoutProvider(provider: TimeoutProvider): void; + setTimeout(callback: TimeoutCallback, delay: number): ManagedTimerId; + clearTimeout(timeoutId: ManagedTimerId | undefined): void; + setInterval(callback: TimeoutCallback, delay: number): ManagedTimerId; + clearInterval(intervalId: ManagedTimerId | undefined): void; +} +declare const timeoutManager: TimeoutManager; +/** + * In many cases code wants to delay to the next event loop tick; this is not + * mediated by {@link timeoutManager}. + * + * This function is provided to make auditing the `tanstack/query-core` for + * incorrect use of system `setTimeout` easier. + */ +declare function systemSetTimeoutZero(callback: TimeoutCallback): void; + +export { type ManagedTimerId, type TimeoutCallback, TimeoutManager, type TimeoutProvider, defaultTimeoutProvider, systemSetTimeoutZero, timeoutManager }; diff --git a/node_modules/@tanstack/query-core/build/legacy/timeoutManager.js b/node_modules/@tanstack/query-core/build/legacy/timeoutManager.js new file mode 100644 index 0000000..4df6d36 --- /dev/null +++ b/node_modules/@tanstack/query-core/build/legacy/timeoutManager.js @@ -0,0 +1,81 @@ +import { + __privateAdd, + __privateGet, + __privateSet +} from "./chunk-PXG64RU4.js"; + +// src/timeoutManager.ts +var defaultTimeoutProvider = { + // We need the wrapper function syntax below instead of direct references to + // global setTimeout etc. + // + // BAD: `setTimeout: setTimeout` + // GOOD: `setTimeout: (cb, delay) => setTimeout(cb, delay)` + // + // If we use direct references here, then anything that wants to spy on or + // replace the global setTimeout (like tests) won't work since we'll already + // have a hard reference to the original implementation at the time when this + // file was imported. + setTimeout: (callback, delay) => setTimeout(callback, delay), + clearTimeout: (timeoutId) => clearTimeout(timeoutId), + setInterval: (callback, delay) => setInterval(callback, delay), + clearInterval: (intervalId) => clearInterval(intervalId) +}; +var _provider, _providerCalled; +var TimeoutManager = class { + constructor() { + // We cannot have TimeoutManager as we must instantiate it with a concrete + // type at app boot; and if we leave that type, then any new timer provider + // would need to support ReturnType, which is infeasible. + // + // We settle for type safety for the TimeoutProvider type, and accept that + // this class is unsafe internally to allow for extension. + __privateAdd(this, _provider, defaultTimeoutProvider); + __privateAdd(this, _providerCalled, false); + } + setTimeoutProvider(provider) { + if (process.env.NODE_ENV !== "production") { + if (__privateGet(this, _providerCalled) && provider !== __privateGet(this, _provider)) { + console.error( + `[timeoutManager]: Switching provider after calls to previous provider might result in unexpected behavior.`, + { previous: __privateGet(this, _provider), provider } + ); + } + } + __privateSet(this, _provider, provider); + if (process.env.NODE_ENV !== "production") { + __privateSet(this, _providerCalled, false); + } + } + setTimeout(callback, delay) { + if (process.env.NODE_ENV !== "production") { + __privateSet(this, _providerCalled, true); + } + return __privateGet(this, _provider).setTimeout(callback, delay); + } + clearTimeout(timeoutId) { + __privateGet(this, _provider).clearTimeout(timeoutId); + } + setInterval(callback, delay) { + if (process.env.NODE_ENV !== "production") { + __privateSet(this, _providerCalled, true); + } + return __privateGet(this, _provider).setInterval(callback, delay); + } + clearInterval(intervalId) { + __privateGet(this, _provider).clearInterval(intervalId); + } +}; +_provider = new WeakMap(); +_providerCalled = new WeakMap(); +var timeoutManager = new TimeoutManager(); +function systemSetTimeoutZero(callback) { + setTimeout(callback, 0); +} +export { + TimeoutManager, + defaultTimeoutProvider, + systemSetTimeoutZero, + timeoutManager +}; +//# sourceMappingURL=timeoutManager.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/timeoutManager.js.map b/node_modules/@tanstack/query-core/build/legacy/timeoutManager.js.map new file mode 100644 index 0000000..3e11048 --- /dev/null +++ b/node_modules/@tanstack/query-core/build/legacy/timeoutManager.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/timeoutManager.ts"],"sourcesContent":["/**\n * {@link TimeoutManager} does not support passing arguments to the callback.\n *\n * `(_: void)` is the argument type inferred by TypeScript's default typings for\n * `setTimeout(cb, number)`.\n * If we don't accept a single void argument, then\n * `new Promise(resolve => timeoutManager.setTimeout(resolve, N))` is a type error.\n */\nexport type TimeoutCallback = (_: void) => void\n\n/**\n * Wrapping `setTimeout` is awkward from a typing perspective because platform\n * typings may extend the return type of `setTimeout`. For example, NodeJS\n * typings add `NodeJS.Timeout`; but a non-default `timeoutManager` may not be\n * able to return such a type.\n */\nexport type ManagedTimerId = number | { [Symbol.toPrimitive]: () => number }\n\n/**\n * Backend for timer functions.\n */\nexport type TimeoutProvider =\n {\n readonly setTimeout: (callback: TimeoutCallback, delay: number) => TTimerId\n readonly clearTimeout: (timeoutId: TTimerId | undefined) => void\n\n readonly setInterval: (callback: TimeoutCallback, delay: number) => TTimerId\n readonly clearInterval: (intervalId: TTimerId | undefined) => void\n }\n\nexport const defaultTimeoutProvider: TimeoutProvider<\n ReturnType\n> = {\n // We need the wrapper function syntax below instead of direct references to\n // global setTimeout etc.\n //\n // BAD: `setTimeout: setTimeout`\n // GOOD: `setTimeout: (cb, delay) => setTimeout(cb, delay)`\n //\n // If we use direct references here, then anything that wants to spy on or\n // replace the global setTimeout (like tests) won't work since we'll already\n // have a hard reference to the original implementation at the time when this\n // file was imported.\n setTimeout: (callback, delay) => setTimeout(callback, delay),\n clearTimeout: (timeoutId) => clearTimeout(timeoutId),\n\n setInterval: (callback, delay) => setInterval(callback, delay),\n clearInterval: (intervalId) => clearInterval(intervalId),\n}\n\n/**\n * Allows customization of how timeouts are created.\n *\n * @tanstack/query-core makes liberal use of timeouts to implement `staleTime`\n * and `gcTime`. The default TimeoutManager provider uses the platform's global\n * `setTimeout` implementation, which is known to have scalability issues with\n * thousands of timeouts on the event loop.\n *\n * If you hit this limitation, consider providing a custom TimeoutProvider that\n * coalesces timeouts.\n */\nexport class TimeoutManager implements Omit {\n // We cannot have TimeoutManager as we must instantiate it with a concrete\n // type at app boot; and if we leave that type, then any new timer provider\n // would need to support ReturnType, which is infeasible.\n //\n // We settle for type safety for the TimeoutProvider type, and accept that\n // this class is unsafe internally to allow for extension.\n #provider: TimeoutProvider = defaultTimeoutProvider\n #providerCalled = false\n\n setTimeoutProvider(\n provider: TimeoutProvider,\n ): void {\n if (process.env.NODE_ENV !== 'production') {\n if (this.#providerCalled && provider !== this.#provider) {\n // After changing providers, `clearTimeout` will not work as expected for\n // timeouts from the previous provider.\n //\n // Since they may allocate the same timeout ID, clearTimeout may cancel an\n // arbitrary different timeout, or unexpected no-op.\n //\n // We could protect against this by mixing the timeout ID bits\n // deterministically with some per-provider bits.\n //\n // We could internally queue `setTimeout` calls to `TimeoutManager` until\n // some API call to set the initial provider.\n console.error(\n `[timeoutManager]: Switching provider after calls to previous provider might result in unexpected behavior.`,\n { previous: this.#provider, provider },\n )\n }\n }\n\n this.#provider = provider\n if (process.env.NODE_ENV !== 'production') {\n this.#providerCalled = false\n }\n }\n\n setTimeout(callback: TimeoutCallback, delay: number): ManagedTimerId {\n if (process.env.NODE_ENV !== 'production') {\n this.#providerCalled = true\n }\n return this.#provider.setTimeout(callback, delay)\n }\n\n clearTimeout(timeoutId: ManagedTimerId | undefined): void {\n this.#provider.clearTimeout(timeoutId)\n }\n\n setInterval(callback: TimeoutCallback, delay: number): ManagedTimerId {\n if (process.env.NODE_ENV !== 'production') {\n this.#providerCalled = true\n }\n return this.#provider.setInterval(callback, delay)\n }\n\n clearInterval(intervalId: ManagedTimerId | undefined): void {\n this.#provider.clearInterval(intervalId)\n }\n}\n\nexport const timeoutManager = new TimeoutManager()\n\n/**\n * In many cases code wants to delay to the next event loop tick; this is not\n * mediated by {@link timeoutManager}.\n *\n * This function is provided to make auditing the `tanstack/query-core` for\n * incorrect use of system `setTimeout` easier.\n */\nexport function systemSetTimeoutZero(callback: TimeoutCallback): void {\n setTimeout(callback, 0)\n}\n"],"mappings":";;;;;;;AA8BO,IAAM,yBAET;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAWF,YAAY,CAAC,UAAU,UAAU,WAAW,UAAU,KAAK;AAAA,EAC3D,cAAc,CAAC,cAAc,aAAa,SAAS;AAAA,EAEnD,aAAa,CAAC,UAAU,UAAU,YAAY,UAAU,KAAK;AAAA,EAC7D,eAAe,CAAC,eAAe,cAAc,UAAU;AACzD;AAhDA;AA6DO,IAAM,iBAAN,MAA8D;AAAA,EAA9D;AAOL;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kCAAkC;AAClC,wCAAkB;AAAA;AAAA,EAElB,mBACE,UACM;AACN,QAAI,QAAQ,IAAI,aAAa,cAAc;AACzC,UAAI,mBAAK,oBAAmB,aAAa,mBAAK,YAAW;AAYvD,gBAAQ;AAAA,UACN;AAAA,UACA,EAAE,UAAU,mBAAK,YAAW,SAAS;AAAA,QACvC;AAAA,MACF;AAAA,IACF;AAEA,uBAAK,WAAY;AACjB,QAAI,QAAQ,IAAI,aAAa,cAAc;AACzC,yBAAK,iBAAkB;AAAA,IACzB;AAAA,EACF;AAAA,EAEA,WAAW,UAA2B,OAA+B;AACnE,QAAI,QAAQ,IAAI,aAAa,cAAc;AACzC,yBAAK,iBAAkB;AAAA,IACzB;AACA,WAAO,mBAAK,WAAU,WAAW,UAAU,KAAK;AAAA,EAClD;AAAA,EAEA,aAAa,WAA6C;AACxD,uBAAK,WAAU,aAAa,SAAS;AAAA,EACvC;AAAA,EAEA,YAAY,UAA2B,OAA+B;AACpE,QAAI,QAAQ,IAAI,aAAa,cAAc;AACzC,yBAAK,iBAAkB;AAAA,IACzB;AACA,WAAO,mBAAK,WAAU,YAAY,UAAU,KAAK;AAAA,EACnD;AAAA,EAEA,cAAc,YAA8C;AAC1D,uBAAK,WAAU,cAAc,UAAU;AAAA,EACzC;AACF;AArDE;AACA;AAsDK,IAAM,iBAAiB,IAAI,eAAe;AAS1C,SAAS,qBAAqB,UAAiC;AACpE,aAAW,UAAU,CAAC;AACxB;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/types.cjs b/node_modules/@tanstack/query-core/build/legacy/types.cjs new file mode 100644 index 0000000..b948e7c --- /dev/null +++ b/node_modules/@tanstack/query-core/build/legacy/types.cjs @@ -0,0 +1,37 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/types.ts +var types_exports = {}; +__export(types_exports, { + dataTagErrorSymbol: () => dataTagErrorSymbol, + dataTagSymbol: () => dataTagSymbol, + unsetMarker: () => unsetMarker +}); +module.exports = __toCommonJS(types_exports); +var dataTagSymbol = /* @__PURE__ */ Symbol("dataTagSymbol"); +var dataTagErrorSymbol = /* @__PURE__ */ Symbol("dataTagErrorSymbol"); +var unsetMarker = /* @__PURE__ */ Symbol("unsetMarker"); +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + dataTagErrorSymbol, + dataTagSymbol, + unsetMarker +}); +//# sourceMappingURL=types.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/types.cjs.map b/node_modules/@tanstack/query-core/build/legacy/types.cjs.map new file mode 100644 index 0000000..21fe50b --- /dev/null +++ b/node_modules/@tanstack/query-core/build/legacy/types.cjs.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/types.ts"],"sourcesContent":["/* istanbul ignore file */\n\nimport type { QueryClient } from './queryClient'\nimport type { DehydrateOptions, HydrateOptions } from './hydration'\nimport type { MutationState } from './mutation'\nimport type { FetchDirection, Query, QueryBehavior } from './query'\nimport type { RetryDelayValue, RetryValue } from './retryer'\nimport type { QueryFilters, QueryTypeFilter, SkipToken } from './utils'\nimport type { QueryCache } from './queryCache'\nimport type { MutationCache } from './mutationCache'\n\nexport type NonUndefinedGuard = T extends undefined ? never : T\n\nexport type DistributiveOmit<\n TObject,\n TKey extends keyof TObject,\n> = TObject extends any ? Omit : never\n\nexport type OmitKeyof<\n TObject,\n TKey extends TStrictly extends 'safely'\n ?\n | keyof TObject\n | (string & Record)\n | (number & Record)\n | (symbol & Record)\n : keyof TObject,\n TStrictly extends 'strictly' | 'safely' = 'strictly',\n> = Omit\n\nexport type Override = {\n [AKey in keyof TTargetA]: AKey extends keyof TTargetB\n ? TTargetB[AKey]\n : TTargetA[AKey]\n}\n\nexport type NoInfer = [T][T extends any ? 0 : never]\n\nexport interface Register {\n // defaultError: Error\n // queryMeta: Record\n // mutationMeta: Record\n // queryKey: ReadonlyArray\n // mutationKey: ReadonlyArray\n}\n\nexport type DefaultError = Register extends {\n defaultError: infer TError\n}\n ? TError\n : Error\n\nexport type QueryKey = Register extends {\n queryKey: infer TQueryKey\n}\n ? TQueryKey extends ReadonlyArray\n ? TQueryKey\n : TQueryKey extends Array\n ? TQueryKey\n : ReadonlyArray\n : ReadonlyArray\n\nexport const dataTagSymbol = Symbol('dataTagSymbol')\nexport type dataTagSymbol = typeof dataTagSymbol\nexport const dataTagErrorSymbol = Symbol('dataTagErrorSymbol')\nexport type dataTagErrorSymbol = typeof dataTagErrorSymbol\nexport const unsetMarker = Symbol('unsetMarker')\nexport type UnsetMarker = typeof unsetMarker\nexport type AnyDataTag = {\n [dataTagSymbol]: any\n [dataTagErrorSymbol]: any\n}\nexport type DataTag<\n TType,\n TValue,\n TError = UnsetMarker,\n> = TType extends AnyDataTag\n ? TType\n : TType & {\n [dataTagSymbol]: TValue\n [dataTagErrorSymbol]: TError\n }\n\nexport type InferDataFromTag =\n TTaggedQueryKey extends DataTag\n ? TaggedValue\n : TQueryFnData\n\nexport type InferErrorFromTag =\n TTaggedQueryKey extends DataTag\n ? TaggedError extends UnsetMarker\n ? TError\n : TaggedError\n : TError\n\nexport type QueryFunction<\n T = unknown,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = never,\n> = (context: QueryFunctionContext) => T | Promise\n\nexport type StaleTime = number | 'static'\n\nexport type StaleTimeFunction<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> =\n | StaleTime\n | ((query: Query) => StaleTime)\n\nexport type Enabled<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> =\n | boolean\n | ((query: Query) => boolean)\n\nexport type QueryPersister<\n T = unknown,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = never,\n> = [TPageParam] extends [never]\n ? (\n queryFn: QueryFunction,\n context: QueryFunctionContext,\n query: Query,\n ) => T | Promise\n : (\n queryFn: QueryFunction,\n context: QueryFunctionContext,\n query: Query,\n ) => T | Promise\n\nexport type QueryFunctionContext<\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = never,\n> = [TPageParam] extends [never]\n ? {\n client: QueryClient\n queryKey: TQueryKey\n signal: AbortSignal\n meta: QueryMeta | undefined\n pageParam?: unknown\n /**\n * @deprecated\n * if you want access to the direction, you can add it to the pageParam\n */\n direction?: unknown\n }\n : {\n client: QueryClient\n queryKey: TQueryKey\n signal: AbortSignal\n pageParam: TPageParam\n /**\n * @deprecated\n * if you want access to the direction, you can add it to the pageParam\n */\n direction: FetchDirection\n meta: QueryMeta | undefined\n }\n\nexport type InitialDataFunction = () => T | undefined\n\ntype NonFunctionGuard = T extends Function ? never : T\n\nexport type PlaceholderDataFunction<\n TQueryFnData = unknown,\n TError = DefaultError,\n TQueryData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> = (\n previousData: TQueryData | undefined,\n previousQuery: Query | undefined,\n) => TQueryData | undefined\n\nexport type QueriesPlaceholderDataFunction = (\n previousData: undefined,\n previousQuery: undefined,\n) => TQueryData | undefined\n\nexport type QueryKeyHashFunction = (\n queryKey: TQueryKey,\n) => string\n\nexport type GetPreviousPageParamFunction = (\n firstPage: TQueryFnData,\n allPages: Array,\n firstPageParam: TPageParam,\n allPageParams: Array,\n) => TPageParam | undefined | null\n\nexport type GetNextPageParamFunction = (\n lastPage: TQueryFnData,\n allPages: Array,\n lastPageParam: TPageParam,\n allPageParams: Array,\n) => TPageParam | undefined | null\n\nexport interface InfiniteData {\n pages: Array\n pageParams: Array\n}\n\nexport type QueryMeta = Register extends {\n queryMeta: infer TQueryMeta\n}\n ? TQueryMeta extends Record\n ? TQueryMeta\n : Record\n : Record\n\nexport type NetworkMode = 'online' | 'always' | 'offlineFirst'\n\nexport type NotifyOnChangeProps =\n | Array\n | 'all'\n | undefined\n | (() => Array | 'all' | undefined)\n\nexport interface QueryOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = never,\n> {\n /**\n * If `false`, failed queries will not retry by default.\n * If `true`, failed queries will retry infinitely., failureCount: num\n * If set to an integer number, e.g. 3, failed queries will retry until the failed query count meets that number.\n * If set to a function `(failureCount, error) => boolean` failed queries will retry until the function returns false.\n */\n retry?: RetryValue\n retryDelay?: RetryDelayValue\n networkMode?: NetworkMode\n /**\n * The time in milliseconds that unused/inactive cache data remains in memory.\n * When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration.\n * When different garbage collection times are specified, the longest one will be used.\n * Setting it to `Infinity` will disable garbage collection.\n */\n gcTime?: number\n queryFn?: QueryFunction | SkipToken\n persister?: QueryPersister<\n NoInfer,\n NoInfer,\n NoInfer\n >\n queryHash?: string\n queryKey?: TQueryKey\n queryKeyHashFn?: QueryKeyHashFunction\n initialData?: TData | InitialDataFunction\n initialDataUpdatedAt?: number | (() => number | undefined)\n behavior?: QueryBehavior\n /**\n * Set this to `false` to disable structural sharing between query results.\n * Set this to a function which accepts the old and new data and returns resolved data of the same type to implement custom structural sharing logic.\n * Defaults to `true`.\n */\n structuralSharing?:\n | boolean\n | ((oldData: unknown | undefined, newData: unknown) => unknown)\n _defaulted?: boolean\n /**\n * Additional payload to be stored on each query.\n * Use this property to pass information that can be used in other places.\n */\n meta?: QueryMeta\n /**\n * Maximum number of pages to store in the data of an infinite query.\n */\n maxPages?: number\n}\n\nexport interface InitialPageParam {\n initialPageParam: TPageParam\n}\n\nexport interface InfiniteQueryPageParamsOptions<\n TQueryFnData = unknown,\n TPageParam = unknown,\n> extends InitialPageParam {\n /**\n * This function can be set to automatically get the previous cursor for infinite queries.\n * The result will also be used to determine the value of `hasPreviousPage`.\n */\n getPreviousPageParam?: GetPreviousPageParamFunction\n /**\n * This function can be set to automatically get the next cursor for infinite queries.\n * The result will also be used to determine the value of `hasNextPage`.\n */\n getNextPageParam: GetNextPageParamFunction\n}\n\nexport type ThrowOnError<\n TQueryFnData,\n TError,\n TQueryData,\n TQueryKey extends QueryKey,\n> =\n | boolean\n | ((\n error: TError,\n query: Query,\n ) => boolean)\n\nexport interface QueryObserverOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = never,\n> extends WithRequired<\n QueryOptions,\n 'queryKey'\n> {\n /**\n * Set this to `false` or a function that returns `false` to disable automatic refetching when the query mounts or changes query keys.\n * To refetch the query, use the `refetch` method returned from the `useQuery` instance.\n * Accepts a boolean or function that returns a boolean.\n * Defaults to `true`.\n */\n enabled?: Enabled\n /**\n * The time in milliseconds after data is considered stale.\n * If set to `Infinity`, the data will never be considered stale.\n * If set to a function, the function will be executed with the query to compute a `staleTime`.\n * Defaults to `0`.\n */\n staleTime?: StaleTimeFunction\n /**\n * If set to a number, the query will continuously refetch at this frequency in milliseconds.\n * If set to a function, the function will be executed with the latest data and query to compute a frequency\n * Defaults to `false`.\n */\n refetchInterval?:\n | number\n | false\n | ((\n query: Query,\n ) => number | false | undefined)\n /**\n * If set to `true`, the query will continue to refetch while their tab/window is in the background.\n * Defaults to `false`.\n */\n refetchIntervalInBackground?: boolean\n /**\n * If set to `true`, the query will refetch on window focus if the data is stale.\n * If set to `false`, the query will not refetch on window focus.\n * If set to `'always'`, the query will always refetch on window focus.\n * If set to a function, the function will be executed with the latest data and query to compute the value.\n * Defaults to `true`.\n */\n refetchOnWindowFocus?:\n | boolean\n | 'always'\n | ((\n query: Query,\n ) => boolean | 'always')\n /**\n * If set to `true`, the query will refetch on reconnect if the data is stale.\n * If set to `false`, the query will not refetch on reconnect.\n * If set to `'always'`, the query will always refetch on reconnect.\n * If set to a function, the function will be executed with the latest data and query to compute the value.\n * Defaults to the value of `networkOnline` (`true`)\n */\n refetchOnReconnect?:\n | boolean\n | 'always'\n | ((\n query: Query,\n ) => boolean | 'always')\n /**\n * If set to `true`, the query will refetch on mount if the data is stale.\n * If set to `false`, will disable additional instances of a query to trigger background refetch.\n * If set to `'always'`, the query will always refetch on mount.\n * If set to a function, the function will be executed with the latest data and query to compute the value\n * Defaults to `true`.\n */\n refetchOnMount?:\n | boolean\n | 'always'\n | ((\n query: Query,\n ) => boolean | 'always')\n /**\n * If set to `false`, the query will not be retried on mount if it contains an error.\n * Defaults to `true`.\n */\n retryOnMount?: boolean\n /**\n * If set, the component will only re-render if any of the listed properties change.\n * When set to `['data', 'error']`, the component will only re-render when the `data` or `error` properties change.\n * When set to `'all'`, the component will re-render whenever a query is updated.\n * When set to a function, the function will be executed to compute the list of properties.\n * By default, access to properties will be tracked, and the component will only re-render when one of the tracked properties change.\n */\n notifyOnChangeProps?: NotifyOnChangeProps\n /**\n * Whether errors should be thrown instead of setting the `error` property.\n * If set to `true` or `suspense` is `true`, all errors will be thrown to the error boundary.\n * If set to `false` and `suspense` is `false`, errors are returned as state.\n * If set to a function, it will be passed the error and the query, and it should return a boolean indicating whether to show the error in an error boundary (`true`) or return the error as state (`false`).\n * Defaults to `false`.\n */\n throwOnError?: ThrowOnError\n /**\n * This option can be used to transform or select a part of the data returned by the query function.\n */\n select?: (data: TQueryData) => TData\n /**\n * If set to `true`, the query will suspend when `status === 'pending'`\n * and throw errors when `status === 'error'`.\n * Defaults to `false`.\n */\n suspense?: boolean\n /**\n * If set, this value will be used as the placeholder data for this particular query observer while the query is still in the `loading` data and no initialData has been provided.\n */\n placeholderData?:\n | NonFunctionGuard\n | PlaceholderDataFunction<\n NonFunctionGuard,\n TError,\n NonFunctionGuard,\n TQueryKey\n >\n\n _optimisticResults?: 'optimistic' | 'isRestoring'\n\n /**\n * Enable prefetching during rendering\n */\n experimental_prefetchInRender?: boolean\n}\n\nexport type WithRequired = TTarget & {\n [_ in TKey]: {}\n}\n\nexport type DefaultedQueryObserverOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> = WithRequired<\n QueryObserverOptions,\n 'throwOnError' | 'refetchOnReconnect' | 'queryHash'\n>\n\nexport interface InfiniteQueryObserverOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n>\n extends\n QueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n InfiniteData,\n TQueryKey,\n TPageParam\n >,\n InfiniteQueryPageParamsOptions {}\n\nexport type DefaultedInfiniteQueryObserverOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n> = WithRequired<\n InfiniteQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n 'throwOnError' | 'refetchOnReconnect' | 'queryHash'\n>\n\nexport interface FetchQueryOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = never,\n> extends WithRequired<\n QueryOptions,\n 'queryKey'\n> {\n initialPageParam?: never\n /**\n * The time in milliseconds after data is considered stale.\n * If the data is fresh it will be returned from the cache.\n */\n staleTime?: StaleTimeFunction\n}\n\nexport interface EnsureQueryDataOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = never,\n> extends FetchQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n> {\n revalidateIfStale?: boolean\n}\n\nexport type EnsureInfiniteQueryDataOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n> = FetchInfiniteQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n> & {\n revalidateIfStale?: boolean\n}\n\ntype FetchInfiniteQueryPages =\n | { pages?: never }\n | {\n pages: number\n getNextPageParam: GetNextPageParamFunction\n }\n\nexport type FetchInfiniteQueryOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n> = Omit<\n FetchQueryOptions<\n TQueryFnData,\n TError,\n InfiniteData,\n TQueryKey,\n TPageParam\n >,\n 'initialPageParam'\n> &\n InitialPageParam &\n FetchInfiniteQueryPages\n\nexport interface ResultOptions {\n throwOnError?: boolean\n}\n\nexport interface RefetchOptions extends ResultOptions {\n /**\n * If set to `true`, a currently running request will be cancelled before a new request is made\n *\n * If set to `false`, no refetch will be made if there is already a request running.\n *\n * Defaults to `true`.\n */\n cancelRefetch?: boolean\n}\n\nexport interface InvalidateQueryFilters<\n TQueryKey extends QueryKey = QueryKey,\n> extends QueryFilters {\n refetchType?: QueryTypeFilter | 'none'\n}\n\nexport interface RefetchQueryFilters<\n TQueryKey extends QueryKey = QueryKey,\n> extends QueryFilters {}\n\nexport interface InvalidateOptions extends RefetchOptions {}\nexport interface ResetOptions extends RefetchOptions {}\n\nexport interface FetchNextPageOptions extends ResultOptions {\n /**\n * If set to `true`, calling `fetchNextPage` repeatedly will invoke `queryFn` every time,\n * whether the previous invocation has resolved or not. Also, the result from previous invocations will be ignored.\n *\n * If set to `false`, calling `fetchNextPage` repeatedly won't have any effect until the first invocation has resolved.\n *\n * Defaults to `true`.\n */\n cancelRefetch?: boolean\n}\n\nexport interface FetchPreviousPageOptions extends ResultOptions {\n /**\n * If set to `true`, calling `fetchPreviousPage` repeatedly will invoke `queryFn` every time,\n * whether the previous invocation has resolved or not. Also, the result from previous invocations will be ignored.\n *\n * If set to `false`, calling `fetchPreviousPage` repeatedly won't have any effect until the first invocation has resolved.\n *\n * Defaults to `true`.\n */\n cancelRefetch?: boolean\n}\n\nexport type QueryStatus = 'pending' | 'error' | 'success'\nexport type FetchStatus = 'fetching' | 'paused' | 'idle'\n\nexport interface QueryObserverBaseResult<\n TData = unknown,\n TError = DefaultError,\n> {\n /**\n * The last successfully resolved data for the query.\n */\n data: TData | undefined\n /**\n * The timestamp for when the query most recently returned the `status` as `\"success\"`.\n */\n dataUpdatedAt: number\n /**\n * The error object for the query, if an error was thrown.\n * - Defaults to `null`.\n */\n error: TError | null\n /**\n * The timestamp for when the query most recently returned the `status` as `\"error\"`.\n */\n errorUpdatedAt: number\n /**\n * The failure count for the query.\n * - Incremented every time the query fails.\n * - Reset to `0` when the query succeeds.\n */\n failureCount: number\n /**\n * The failure reason for the query retry.\n * - Reset to `null` when the query succeeds.\n */\n failureReason: TError | null\n /**\n * The sum of all errors.\n */\n errorUpdateCount: number\n /**\n * A derived boolean from the `status` variable, provided for convenience.\n * - `true` if the query attempt resulted in an error.\n */\n isError: boolean\n /**\n * Will be `true` if the query has been fetched.\n */\n isFetched: boolean\n /**\n * Will be `true` if the query has been fetched after the component mounted.\n * - This property can be used to not show any previously cached data.\n */\n isFetchedAfterMount: boolean\n /**\n * A derived boolean from the `fetchStatus` variable, provided for convenience.\n * - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch.\n */\n isFetching: boolean\n /**\n * Is `true` whenever the first fetch for a query is in-flight.\n * - Is the same as `isFetching && isPending`.\n */\n isLoading: boolean\n /**\n * Will be `pending` if there's no cached data and no query attempt was finished yet.\n */\n isPending: boolean\n /**\n * Will be `true` if the query failed while fetching for the first time.\n */\n isLoadingError: boolean\n /**\n * @deprecated `isInitialLoading` is being deprecated in favor of `isLoading`\n * and will be removed in the next major version.\n */\n isInitialLoading: boolean\n /**\n * A derived boolean from the `fetchStatus` variable, provided for convenience.\n * - The query wanted to fetch, but has been `paused`.\n */\n isPaused: boolean\n /**\n * Will be `true` if the data shown is the placeholder data.\n */\n isPlaceholderData: boolean\n /**\n * Will be `true` if the query failed while refetching.\n */\n isRefetchError: boolean\n /**\n * Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`.\n * - Is the same as `isFetching && !isPending`.\n */\n isRefetching: boolean\n /**\n * Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`.\n */\n isStale: boolean\n /**\n * A derived boolean from the `status` variable, provided for convenience.\n * - `true` if the query has received a response with no errors and is ready to display its data.\n */\n isSuccess: boolean\n /**\n * `true` if this observer is enabled, `false` otherwise.\n */\n isEnabled: boolean\n /**\n * A function to manually refetch the query.\n */\n refetch: (\n options?: RefetchOptions,\n ) => Promise>\n /**\n * The status of the query.\n * - Will be:\n * - `pending` if there's no cached data and no query attempt was finished yet.\n * - `error` if the query attempt resulted in an error.\n * - `success` if the query has received a response with no errors and is ready to display its data.\n */\n status: QueryStatus\n /**\n * The fetch status of the query.\n * - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch.\n * - `paused`: The query wanted to fetch, but has been `paused`.\n * - `idle`: The query is not fetching.\n * - See [Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information.\n */\n fetchStatus: FetchStatus\n /**\n * A stable promise that will be resolved with the data of the query.\n * Requires the `experimental_prefetchInRender` feature flag to be enabled.\n * @example\n *\n * ### Enabling the feature flag\n * ```ts\n * const client = new QueryClient({\n * defaultOptions: {\n * queries: {\n * experimental_prefetchInRender: true,\n * },\n * },\n * })\n * ```\n *\n * ### Usage\n * ```tsx\n * import { useQuery } from '@tanstack/react-query'\n * import React from 'react'\n * import { fetchTodos, type Todo } from './api'\n *\n * function TodoList({ query }: { query: UseQueryResult }) {\n * const data = React.use(query.promise)\n *\n * return (\n *
    \n * {data.map(todo => (\n *
  • {todo.title}
  • \n * ))}\n *
\n * )\n * }\n *\n * export function App() {\n * const query = useQuery({ queryKey: ['todos'], queryFn: fetchTodos })\n *\n * return (\n * <>\n *

Todos

\n * Loading...}>\n * \n * \n * \n * )\n * }\n * ```\n */\n promise: Promise\n}\n\nexport interface QueryObserverPendingResult<\n TData = unknown,\n TError = DefaultError,\n> extends QueryObserverBaseResult {\n data: undefined\n error: null\n isError: false\n isPending: true\n isLoadingError: false\n isRefetchError: false\n isSuccess: false\n isPlaceholderData: false\n status: 'pending'\n}\n\nexport interface QueryObserverLoadingResult<\n TData = unknown,\n TError = DefaultError,\n> extends QueryObserverBaseResult {\n data: undefined\n error: null\n isError: false\n isPending: true\n isLoading: true\n isLoadingError: false\n isRefetchError: false\n isSuccess: false\n isPlaceholderData: false\n status: 'pending'\n}\n\nexport interface QueryObserverLoadingErrorResult<\n TData = unknown,\n TError = DefaultError,\n> extends QueryObserverBaseResult {\n data: undefined\n error: TError\n isError: true\n isPending: false\n isLoading: false\n isLoadingError: true\n isRefetchError: false\n isSuccess: false\n isPlaceholderData: false\n status: 'error'\n}\n\nexport interface QueryObserverRefetchErrorResult<\n TData = unknown,\n TError = DefaultError,\n> extends QueryObserverBaseResult {\n data: TData\n error: TError\n isError: true\n isPending: false\n isLoading: false\n isLoadingError: false\n isRefetchError: true\n isSuccess: false\n isPlaceholderData: false\n status: 'error'\n}\n\nexport interface QueryObserverSuccessResult<\n TData = unknown,\n TError = DefaultError,\n> extends QueryObserverBaseResult {\n data: TData\n error: null\n isError: false\n isPending: false\n isLoading: false\n isLoadingError: false\n isRefetchError: false\n isSuccess: true\n isPlaceholderData: false\n status: 'success'\n}\n\nexport interface QueryObserverPlaceholderResult<\n TData = unknown,\n TError = DefaultError,\n> extends QueryObserverBaseResult {\n data: TData\n isError: false\n error: null\n isPending: false\n isLoading: false\n isLoadingError: false\n isRefetchError: false\n isSuccess: true\n isPlaceholderData: true\n status: 'success'\n}\n\nexport type DefinedQueryObserverResult<\n TData = unknown,\n TError = DefaultError,\n> =\n | QueryObserverRefetchErrorResult\n | QueryObserverSuccessResult\n\nexport type QueryObserverResult =\n | DefinedQueryObserverResult\n | QueryObserverLoadingErrorResult\n | QueryObserverLoadingResult\n | QueryObserverPendingResult\n | QueryObserverPlaceholderResult\n\nexport interface InfiniteQueryObserverBaseResult<\n TData = unknown,\n TError = DefaultError,\n> extends QueryObserverBaseResult {\n /**\n * This function allows you to fetch the next \"page\" of results.\n */\n fetchNextPage: (\n options?: FetchNextPageOptions,\n ) => Promise>\n /**\n * This function allows you to fetch the previous \"page\" of results.\n */\n fetchPreviousPage: (\n options?: FetchPreviousPageOptions,\n ) => Promise>\n /**\n * Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option).\n */\n hasNextPage: boolean\n /**\n * Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option).\n */\n hasPreviousPage: boolean\n /**\n * Will be `true` if the query failed while fetching the next page.\n */\n isFetchNextPageError: boolean\n /**\n * Will be `true` while fetching the next page with `fetchNextPage`.\n */\n isFetchingNextPage: boolean\n /**\n * Will be `true` if the query failed while fetching the previous page.\n */\n isFetchPreviousPageError: boolean\n /**\n * Will be `true` while fetching the previous page with `fetchPreviousPage`.\n */\n isFetchingPreviousPage: boolean\n}\n\nexport interface InfiniteQueryObserverPendingResult<\n TData = unknown,\n TError = DefaultError,\n> extends InfiniteQueryObserverBaseResult {\n data: undefined\n error: null\n isError: false\n isPending: true\n isLoadingError: false\n isRefetchError: false\n isFetchNextPageError: false\n isFetchPreviousPageError: false\n isSuccess: false\n isPlaceholderData: false\n status: 'pending'\n}\n\nexport interface InfiniteQueryObserverLoadingResult<\n TData = unknown,\n TError = DefaultError,\n> extends InfiniteQueryObserverBaseResult {\n data: undefined\n error: null\n isError: false\n isPending: true\n isLoading: true\n isLoadingError: false\n isRefetchError: false\n isFetchNextPageError: false\n isFetchPreviousPageError: false\n isSuccess: false\n isPlaceholderData: false\n status: 'pending'\n}\n\nexport interface InfiniteQueryObserverLoadingErrorResult<\n TData = unknown,\n TError = DefaultError,\n> extends InfiniteQueryObserverBaseResult {\n data: undefined\n error: TError\n isError: true\n isPending: false\n isLoading: false\n isLoadingError: true\n isRefetchError: false\n isFetchNextPageError: false\n isFetchPreviousPageError: false\n isSuccess: false\n isPlaceholderData: false\n status: 'error'\n}\n\nexport interface InfiniteQueryObserverRefetchErrorResult<\n TData = unknown,\n TError = DefaultError,\n> extends InfiniteQueryObserverBaseResult {\n data: TData\n error: TError\n isError: true\n isPending: false\n isLoading: false\n isLoadingError: false\n isRefetchError: true\n isSuccess: false\n isPlaceholderData: false\n status: 'error'\n}\n\nexport interface InfiniteQueryObserverSuccessResult<\n TData = unknown,\n TError = DefaultError,\n> extends InfiniteQueryObserverBaseResult {\n data: TData\n error: null\n isError: false\n isPending: false\n isLoading: false\n isLoadingError: false\n isRefetchError: false\n isFetchNextPageError: false\n isFetchPreviousPageError: false\n isSuccess: true\n isPlaceholderData: false\n status: 'success'\n}\n\nexport interface InfiniteQueryObserverPlaceholderResult<\n TData = unknown,\n TError = DefaultError,\n> extends InfiniteQueryObserverBaseResult {\n data: TData\n isError: false\n error: null\n isPending: false\n isLoading: false\n isLoadingError: false\n isRefetchError: false\n isSuccess: true\n isPlaceholderData: true\n isFetchNextPageError: false\n isFetchPreviousPageError: false\n status: 'success'\n}\n\nexport type DefinedInfiniteQueryObserverResult<\n TData = unknown,\n TError = DefaultError,\n> =\n | InfiniteQueryObserverRefetchErrorResult\n | InfiniteQueryObserverSuccessResult\n\nexport type InfiniteQueryObserverResult<\n TData = unknown,\n TError = DefaultError,\n> =\n | DefinedInfiniteQueryObserverResult\n | InfiniteQueryObserverLoadingErrorResult\n | InfiniteQueryObserverLoadingResult\n | InfiniteQueryObserverPendingResult\n | InfiniteQueryObserverPlaceholderResult\n\nexport type MutationKey = Register extends {\n mutationKey: infer TMutationKey\n}\n ? TMutationKey extends ReadonlyArray\n ? TMutationKey\n : TMutationKey extends Array\n ? TMutationKey\n : ReadonlyArray\n : ReadonlyArray\n\nexport type MutationStatus = 'idle' | 'pending' | 'success' | 'error'\n\nexport type MutationScope = {\n id: string\n}\n\nexport type MutationMeta = Register extends {\n mutationMeta: infer TMutationMeta\n}\n ? TMutationMeta extends Record\n ? TMutationMeta\n : Record\n : Record\n\nexport type MutationFunctionContext = {\n client: QueryClient\n meta: MutationMeta | undefined\n mutationKey?: MutationKey\n}\n\nexport type MutationFunction = (\n variables: TVariables,\n context: MutationFunctionContext,\n) => Promise\n\nexport interface MutationOptions<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n> {\n mutationFn?: MutationFunction\n mutationKey?: MutationKey\n onMutate?: (\n variables: TVariables,\n context: MutationFunctionContext,\n ) => Promise | TOnMutateResult\n onSuccess?: (\n data: TData,\n variables: TVariables,\n onMutateResult: TOnMutateResult,\n context: MutationFunctionContext,\n ) => Promise | unknown\n onError?: (\n error: TError,\n variables: TVariables,\n onMutateResult: TOnMutateResult | undefined,\n context: MutationFunctionContext,\n ) => Promise | unknown\n onSettled?: (\n data: TData | undefined,\n error: TError | null,\n variables: TVariables,\n onMutateResult: TOnMutateResult | undefined,\n context: MutationFunctionContext,\n ) => Promise | unknown\n retry?: RetryValue\n retryDelay?: RetryDelayValue\n networkMode?: NetworkMode\n gcTime?: number\n _defaulted?: boolean\n meta?: MutationMeta\n scope?: MutationScope\n}\n\nexport interface MutationObserverOptions<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n> extends MutationOptions {\n throwOnError?: boolean | ((error: TError) => boolean)\n}\n\nexport interface MutateOptions<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n> {\n onSuccess?: (\n data: TData,\n variables: TVariables,\n onMutateResult: TOnMutateResult | undefined,\n context: MutationFunctionContext,\n ) => void\n onError?: (\n error: TError,\n variables: TVariables,\n onMutateResult: TOnMutateResult | undefined,\n context: MutationFunctionContext,\n ) => void\n onSettled?: (\n data: TData | undefined,\n error: TError | null,\n variables: TVariables,\n onMutateResult: TOnMutateResult | undefined,\n context: MutationFunctionContext,\n ) => void\n}\n\nexport type MutateFunction<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n> = (\n variables: TVariables,\n options?: MutateOptions,\n) => Promise\n\nexport interface MutationObserverBaseResult<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n> extends MutationState {\n /**\n * The last successfully resolved data for the mutation.\n */\n data: TData | undefined\n /**\n * The variables object passed to the `mutationFn`.\n */\n variables: TVariables | undefined\n /**\n * The error object for the mutation, if an error was encountered.\n * - Defaults to `null`.\n */\n error: TError | null\n /**\n * A boolean variable derived from `status`.\n * - `true` if the last mutation attempt resulted in an error.\n */\n isError: boolean\n /**\n * A boolean variable derived from `status`.\n * - `true` if the mutation is in its initial state prior to executing.\n */\n isIdle: boolean\n /**\n * A boolean variable derived from `status`.\n * - `true` if the mutation is currently executing.\n */\n isPending: boolean\n /**\n * A boolean variable derived from `status`.\n * - `true` if the last mutation attempt was successful.\n */\n isSuccess: boolean\n /**\n * The status of the mutation.\n * - Will be:\n * - `idle` initial status prior to the mutation function executing.\n * - `pending` if the mutation is currently executing.\n * - `error` if the last mutation attempt resulted in an error.\n * - `success` if the last mutation attempt was successful.\n */\n status: MutationStatus\n /**\n * The mutation function you can call with variables to trigger the mutation and optionally hooks on additional callback options.\n * @param variables - The variables object to pass to the `mutationFn`.\n * @param options.onSuccess - This function will fire when the mutation is successful and will be passed the mutation's result.\n * @param options.onError - This function will fire if the mutation encounters an error and will be passed the error.\n * @param options.onSettled - This function will fire when the mutation is either successfully fetched or encounters an error and be passed either the data or error.\n * @remarks\n * - If you make multiple requests, `onSuccess` will fire only after the latest call you've made.\n * - All the callback functions (`onSuccess`, `onError`, `onSettled`) are void functions, and the returned value will be ignored.\n */\n mutate: MutateFunction\n /**\n * A function to clean the mutation internal state (i.e., it resets the mutation to its initial state).\n */\n reset: () => void\n}\n\nexport interface MutationObserverIdleResult<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n> extends MutationObserverBaseResult<\n TData,\n TError,\n TVariables,\n TOnMutateResult\n> {\n data: undefined\n variables: undefined\n error: null\n isError: false\n isIdle: true\n isPending: false\n isSuccess: false\n status: 'idle'\n}\n\nexport interface MutationObserverLoadingResult<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n> extends MutationObserverBaseResult<\n TData,\n TError,\n TVariables,\n TOnMutateResult\n> {\n data: undefined\n variables: TVariables\n error: null\n isError: false\n isIdle: false\n isPending: true\n isSuccess: false\n status: 'pending'\n}\n\nexport interface MutationObserverErrorResult<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n> extends MutationObserverBaseResult<\n TData,\n TError,\n TVariables,\n TOnMutateResult\n> {\n data: undefined\n error: TError\n variables: TVariables\n isError: true\n isIdle: false\n isPending: false\n isSuccess: false\n status: 'error'\n}\n\nexport interface MutationObserverSuccessResult<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n> extends MutationObserverBaseResult<\n TData,\n TError,\n TVariables,\n TOnMutateResult\n> {\n data: TData\n error: null\n variables: TVariables\n isError: false\n isIdle: false\n isPending: false\n isSuccess: true\n status: 'success'\n}\n\nexport type MutationObserverResult<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n> =\n | MutationObserverIdleResult\n | MutationObserverLoadingResult\n | MutationObserverErrorResult\n | MutationObserverSuccessResult\n\nexport interface QueryClientConfig {\n queryCache?: QueryCache\n mutationCache?: MutationCache\n defaultOptions?: DefaultOptions\n}\n\nexport interface DefaultOptions {\n queries?: OmitKeyof<\n QueryObserverOptions,\n 'suspense' | 'queryKey'\n >\n mutations?: MutationObserverOptions\n hydrate?: HydrateOptions['defaultOptions']\n dehydrate?: DehydrateOptions\n}\n\nexport interface CancelOptions {\n revert?: boolean\n silent?: boolean\n}\n\nexport interface SetDataOptions {\n updatedAt?: number\n}\n\nexport type NotifyEventType =\n | 'added'\n | 'removed'\n | 'updated'\n | 'observerAdded'\n | 'observerRemoved'\n | 'observerResultsUpdated'\n | 'observerOptionsUpdated'\n\nexport interface NotifyEvent {\n type: NotifyEventType\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA8DO,IAAM,gBAAgB,uBAAO,eAAe;AAE5C,IAAM,qBAAqB,uBAAO,oBAAoB;AAEtD,IAAM,cAAc,uBAAO,aAAa;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/types.d.cts b/node_modules/@tanstack/query-core/build/legacy/types.d.cts new file mode 100644 index 0000000..c613caa --- /dev/null +++ b/node_modules/@tanstack/query-core/build/legacy/types.d.cts @@ -0,0 +1,3 @@ +export { T as AnyDataTag, b7 as CancelOptions, V as DataTag, G as DefaultError, b6 as DefaultOptions, ak as DefaultedInfiniteQueryObserverOptions, ai as DefaultedQueryObserverOptions, aP as DefinedInfiniteQueryObserverResult, aG as DefinedQueryObserverResult, B as DistributiveOmit, $ as Enabled, an as EnsureInfiniteQueryDataOptions, am as EnsureQueryDataOptions, ao as FetchInfiniteQueryOptions, av as FetchNextPageOptions, aw as FetchPreviousPageOptions, al as FetchQueryOptions, ay as FetchStatus, a7 as GetNextPageParamFunction, a6 as GetPreviousPageParamFunction, W as InferDataFromTag, X as InferErrorFromTag, a8 as InfiniteData, aI as InfiniteQueryObserverBaseResult, aL as InfiniteQueryObserverLoadingErrorResult, aK as InfiniteQueryObserverLoadingResult, aj as InfiniteQueryObserverOptions, aJ as InfiniteQueryObserverPendingResult, aO as InfiniteQueryObserverPlaceholderResult, aM as InfiniteQueryObserverRefetchErrorResult, aQ as InfiniteQueryObserverResult, aN as InfiniteQueryObserverSuccessResult, ae as InfiniteQueryPageParamsOptions, a2 as InitialDataFunction, ad as InitialPageParam, at as InvalidateOptions, ar as InvalidateQueryFilters, a_ as MutateFunction, aZ as MutateOptions, aW as MutationFunction, aV as MutationFunctionContext, aR as MutationKey, aU as MutationMeta, a$ as MutationObserverBaseResult, b2 as MutationObserverErrorResult, b0 as MutationObserverIdleResult, b1 as MutationObserverLoadingResult, aY as MutationObserverOptions, b4 as MutationObserverResult, b3 as MutationObserverSuccessResult, aX as MutationOptions, aT as MutationScope, aS as MutationStatus, aa as NetworkMode, F as NoInfer, N as NonUndefinedGuard, ba as NotifyEvent, b9 as NotifyEventType, ab as NotifyOnChangeProps, O as OmitKeyof, E as Override, a3 as PlaceholderDataFunction, a4 as QueriesPlaceholderDataFunction, b5 as QueryClientConfig, Y as QueryFunction, a1 as QueryFunctionContext, I as QueryKey, a5 as QueryKeyHashFunction, a9 as QueryMeta, az as QueryObserverBaseResult, aC as QueryObserverLoadingErrorResult, aB as QueryObserverLoadingResult, ag as QueryObserverOptions, aA as QueryObserverPendingResult, aF as QueryObserverPlaceholderResult, aD as QueryObserverRefetchErrorResult, aH as QueryObserverResult, aE as QueryObserverSuccessResult, ac as QueryOptions, a0 as QueryPersister, ax as QueryStatus, aq as RefetchOptions, as as RefetchQueryFilters, R as Register, au as ResetOptions, ap as ResultOptions, b8 as SetDataOptions, Z as StaleTime, _ as StaleTimeFunction, af as ThrowOnError, P as UnsetMarker, ah as WithRequired, K as dataTagErrorSymbol, J as dataTagSymbol, L as unsetMarker } from './hydration-uphG6M-i.cjs'; +import './removable.cjs'; +import './subscribable.cjs'; diff --git a/node_modules/@tanstack/query-core/build/legacy/types.d.ts b/node_modules/@tanstack/query-core/build/legacy/types.d.ts new file mode 100644 index 0000000..f951ea6 --- /dev/null +++ b/node_modules/@tanstack/query-core/build/legacy/types.d.ts @@ -0,0 +1,3 @@ +export { T as AnyDataTag, b7 as CancelOptions, V as DataTag, G as DefaultError, b6 as DefaultOptions, ak as DefaultedInfiniteQueryObserverOptions, ai as DefaultedQueryObserverOptions, aP as DefinedInfiniteQueryObserverResult, aG as DefinedQueryObserverResult, B as DistributiveOmit, $ as Enabled, an as EnsureInfiniteQueryDataOptions, am as EnsureQueryDataOptions, ao as FetchInfiniteQueryOptions, av as FetchNextPageOptions, aw as FetchPreviousPageOptions, al as FetchQueryOptions, ay as FetchStatus, a7 as GetNextPageParamFunction, a6 as GetPreviousPageParamFunction, W as InferDataFromTag, X as InferErrorFromTag, a8 as InfiniteData, aI as InfiniteQueryObserverBaseResult, aL as InfiniteQueryObserverLoadingErrorResult, aK as InfiniteQueryObserverLoadingResult, aj as InfiniteQueryObserverOptions, aJ as InfiniteQueryObserverPendingResult, aO as InfiniteQueryObserverPlaceholderResult, aM as InfiniteQueryObserverRefetchErrorResult, aQ as InfiniteQueryObserverResult, aN as InfiniteQueryObserverSuccessResult, ae as InfiniteQueryPageParamsOptions, a2 as InitialDataFunction, ad as InitialPageParam, at as InvalidateOptions, ar as InvalidateQueryFilters, a_ as MutateFunction, aZ as MutateOptions, aW as MutationFunction, aV as MutationFunctionContext, aR as MutationKey, aU as MutationMeta, a$ as MutationObserverBaseResult, b2 as MutationObserverErrorResult, b0 as MutationObserverIdleResult, b1 as MutationObserverLoadingResult, aY as MutationObserverOptions, b4 as MutationObserverResult, b3 as MutationObserverSuccessResult, aX as MutationOptions, aT as MutationScope, aS as MutationStatus, aa as NetworkMode, F as NoInfer, N as NonUndefinedGuard, ba as NotifyEvent, b9 as NotifyEventType, ab as NotifyOnChangeProps, O as OmitKeyof, E as Override, a3 as PlaceholderDataFunction, a4 as QueriesPlaceholderDataFunction, b5 as QueryClientConfig, Y as QueryFunction, a1 as QueryFunctionContext, I as QueryKey, a5 as QueryKeyHashFunction, a9 as QueryMeta, az as QueryObserverBaseResult, aC as QueryObserverLoadingErrorResult, aB as QueryObserverLoadingResult, ag as QueryObserverOptions, aA as QueryObserverPendingResult, aF as QueryObserverPlaceholderResult, aD as QueryObserverRefetchErrorResult, aH as QueryObserverResult, aE as QueryObserverSuccessResult, ac as QueryOptions, a0 as QueryPersister, ax as QueryStatus, aq as RefetchOptions, as as RefetchQueryFilters, R as Register, au as ResetOptions, ap as ResultOptions, b8 as SetDataOptions, Z as StaleTime, _ as StaleTimeFunction, af as ThrowOnError, P as UnsetMarker, ah as WithRequired, K as dataTagErrorSymbol, J as dataTagSymbol, L as unsetMarker } from './hydration-BlEVG2Lp.js'; +import './removable.js'; +import './subscribable.js'; diff --git a/node_modules/@tanstack/query-core/build/legacy/types.js b/node_modules/@tanstack/query-core/build/legacy/types.js new file mode 100644 index 0000000..e52a8fc --- /dev/null +++ b/node_modules/@tanstack/query-core/build/legacy/types.js @@ -0,0 +1,12 @@ +import "./chunk-PXG64RU4.js"; + +// src/types.ts +var dataTagSymbol = /* @__PURE__ */ Symbol("dataTagSymbol"); +var dataTagErrorSymbol = /* @__PURE__ */ Symbol("dataTagErrorSymbol"); +var unsetMarker = /* @__PURE__ */ Symbol("unsetMarker"); +export { + dataTagErrorSymbol, + dataTagSymbol, + unsetMarker +}; +//# sourceMappingURL=types.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/types.js.map b/node_modules/@tanstack/query-core/build/legacy/types.js.map new file mode 100644 index 0000000..da7b523 --- /dev/null +++ b/node_modules/@tanstack/query-core/build/legacy/types.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/types.ts"],"sourcesContent":["/* istanbul ignore file */\n\nimport type { QueryClient } from './queryClient'\nimport type { DehydrateOptions, HydrateOptions } from './hydration'\nimport type { MutationState } from './mutation'\nimport type { FetchDirection, Query, QueryBehavior } from './query'\nimport type { RetryDelayValue, RetryValue } from './retryer'\nimport type { QueryFilters, QueryTypeFilter, SkipToken } from './utils'\nimport type { QueryCache } from './queryCache'\nimport type { MutationCache } from './mutationCache'\n\nexport type NonUndefinedGuard = T extends undefined ? never : T\n\nexport type DistributiveOmit<\n TObject,\n TKey extends keyof TObject,\n> = TObject extends any ? Omit : never\n\nexport type OmitKeyof<\n TObject,\n TKey extends TStrictly extends 'safely'\n ?\n | keyof TObject\n | (string & Record)\n | (number & Record)\n | (symbol & Record)\n : keyof TObject,\n TStrictly extends 'strictly' | 'safely' = 'strictly',\n> = Omit\n\nexport type Override = {\n [AKey in keyof TTargetA]: AKey extends keyof TTargetB\n ? TTargetB[AKey]\n : TTargetA[AKey]\n}\n\nexport type NoInfer = [T][T extends any ? 0 : never]\n\nexport interface Register {\n // defaultError: Error\n // queryMeta: Record\n // mutationMeta: Record\n // queryKey: ReadonlyArray\n // mutationKey: ReadonlyArray\n}\n\nexport type DefaultError = Register extends {\n defaultError: infer TError\n}\n ? TError\n : Error\n\nexport type QueryKey = Register extends {\n queryKey: infer TQueryKey\n}\n ? TQueryKey extends ReadonlyArray\n ? TQueryKey\n : TQueryKey extends Array\n ? TQueryKey\n : ReadonlyArray\n : ReadonlyArray\n\nexport const dataTagSymbol = Symbol('dataTagSymbol')\nexport type dataTagSymbol = typeof dataTagSymbol\nexport const dataTagErrorSymbol = Symbol('dataTagErrorSymbol')\nexport type dataTagErrorSymbol = typeof dataTagErrorSymbol\nexport const unsetMarker = Symbol('unsetMarker')\nexport type UnsetMarker = typeof unsetMarker\nexport type AnyDataTag = {\n [dataTagSymbol]: any\n [dataTagErrorSymbol]: any\n}\nexport type DataTag<\n TType,\n TValue,\n TError = UnsetMarker,\n> = TType extends AnyDataTag\n ? TType\n : TType & {\n [dataTagSymbol]: TValue\n [dataTagErrorSymbol]: TError\n }\n\nexport type InferDataFromTag =\n TTaggedQueryKey extends DataTag\n ? TaggedValue\n : TQueryFnData\n\nexport type InferErrorFromTag =\n TTaggedQueryKey extends DataTag\n ? TaggedError extends UnsetMarker\n ? TError\n : TaggedError\n : TError\n\nexport type QueryFunction<\n T = unknown,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = never,\n> = (context: QueryFunctionContext) => T | Promise\n\nexport type StaleTime = number | 'static'\n\nexport type StaleTimeFunction<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> =\n | StaleTime\n | ((query: Query) => StaleTime)\n\nexport type Enabled<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> =\n | boolean\n | ((query: Query) => boolean)\n\nexport type QueryPersister<\n T = unknown,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = never,\n> = [TPageParam] extends [never]\n ? (\n queryFn: QueryFunction,\n context: QueryFunctionContext,\n query: Query,\n ) => T | Promise\n : (\n queryFn: QueryFunction,\n context: QueryFunctionContext,\n query: Query,\n ) => T | Promise\n\nexport type QueryFunctionContext<\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = never,\n> = [TPageParam] extends [never]\n ? {\n client: QueryClient\n queryKey: TQueryKey\n signal: AbortSignal\n meta: QueryMeta | undefined\n pageParam?: unknown\n /**\n * @deprecated\n * if you want access to the direction, you can add it to the pageParam\n */\n direction?: unknown\n }\n : {\n client: QueryClient\n queryKey: TQueryKey\n signal: AbortSignal\n pageParam: TPageParam\n /**\n * @deprecated\n * if you want access to the direction, you can add it to the pageParam\n */\n direction: FetchDirection\n meta: QueryMeta | undefined\n }\n\nexport type InitialDataFunction = () => T | undefined\n\ntype NonFunctionGuard = T extends Function ? never : T\n\nexport type PlaceholderDataFunction<\n TQueryFnData = unknown,\n TError = DefaultError,\n TQueryData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> = (\n previousData: TQueryData | undefined,\n previousQuery: Query | undefined,\n) => TQueryData | undefined\n\nexport type QueriesPlaceholderDataFunction = (\n previousData: undefined,\n previousQuery: undefined,\n) => TQueryData | undefined\n\nexport type QueryKeyHashFunction = (\n queryKey: TQueryKey,\n) => string\n\nexport type GetPreviousPageParamFunction = (\n firstPage: TQueryFnData,\n allPages: Array,\n firstPageParam: TPageParam,\n allPageParams: Array,\n) => TPageParam | undefined | null\n\nexport type GetNextPageParamFunction = (\n lastPage: TQueryFnData,\n allPages: Array,\n lastPageParam: TPageParam,\n allPageParams: Array,\n) => TPageParam | undefined | null\n\nexport interface InfiniteData {\n pages: Array\n pageParams: Array\n}\n\nexport type QueryMeta = Register extends {\n queryMeta: infer TQueryMeta\n}\n ? TQueryMeta extends Record\n ? TQueryMeta\n : Record\n : Record\n\nexport type NetworkMode = 'online' | 'always' | 'offlineFirst'\n\nexport type NotifyOnChangeProps =\n | Array\n | 'all'\n | undefined\n | (() => Array | 'all' | undefined)\n\nexport interface QueryOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = never,\n> {\n /**\n * If `false`, failed queries will not retry by default.\n * If `true`, failed queries will retry infinitely., failureCount: num\n * If set to an integer number, e.g. 3, failed queries will retry until the failed query count meets that number.\n * If set to a function `(failureCount, error) => boolean` failed queries will retry until the function returns false.\n */\n retry?: RetryValue\n retryDelay?: RetryDelayValue\n networkMode?: NetworkMode\n /**\n * The time in milliseconds that unused/inactive cache data remains in memory.\n * When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration.\n * When different garbage collection times are specified, the longest one will be used.\n * Setting it to `Infinity` will disable garbage collection.\n */\n gcTime?: number\n queryFn?: QueryFunction | SkipToken\n persister?: QueryPersister<\n NoInfer,\n NoInfer,\n NoInfer\n >\n queryHash?: string\n queryKey?: TQueryKey\n queryKeyHashFn?: QueryKeyHashFunction\n initialData?: TData | InitialDataFunction\n initialDataUpdatedAt?: number | (() => number | undefined)\n behavior?: QueryBehavior\n /**\n * Set this to `false` to disable structural sharing between query results.\n * Set this to a function which accepts the old and new data and returns resolved data of the same type to implement custom structural sharing logic.\n * Defaults to `true`.\n */\n structuralSharing?:\n | boolean\n | ((oldData: unknown | undefined, newData: unknown) => unknown)\n _defaulted?: boolean\n /**\n * Additional payload to be stored on each query.\n * Use this property to pass information that can be used in other places.\n */\n meta?: QueryMeta\n /**\n * Maximum number of pages to store in the data of an infinite query.\n */\n maxPages?: number\n}\n\nexport interface InitialPageParam {\n initialPageParam: TPageParam\n}\n\nexport interface InfiniteQueryPageParamsOptions<\n TQueryFnData = unknown,\n TPageParam = unknown,\n> extends InitialPageParam {\n /**\n * This function can be set to automatically get the previous cursor for infinite queries.\n * The result will also be used to determine the value of `hasPreviousPage`.\n */\n getPreviousPageParam?: GetPreviousPageParamFunction\n /**\n * This function can be set to automatically get the next cursor for infinite queries.\n * The result will also be used to determine the value of `hasNextPage`.\n */\n getNextPageParam: GetNextPageParamFunction\n}\n\nexport type ThrowOnError<\n TQueryFnData,\n TError,\n TQueryData,\n TQueryKey extends QueryKey,\n> =\n | boolean\n | ((\n error: TError,\n query: Query,\n ) => boolean)\n\nexport interface QueryObserverOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = never,\n> extends WithRequired<\n QueryOptions,\n 'queryKey'\n> {\n /**\n * Set this to `false` or a function that returns `false` to disable automatic refetching when the query mounts or changes query keys.\n * To refetch the query, use the `refetch` method returned from the `useQuery` instance.\n * Accepts a boolean or function that returns a boolean.\n * Defaults to `true`.\n */\n enabled?: Enabled\n /**\n * The time in milliseconds after data is considered stale.\n * If set to `Infinity`, the data will never be considered stale.\n * If set to a function, the function will be executed with the query to compute a `staleTime`.\n * Defaults to `0`.\n */\n staleTime?: StaleTimeFunction\n /**\n * If set to a number, the query will continuously refetch at this frequency in milliseconds.\n * If set to a function, the function will be executed with the latest data and query to compute a frequency\n * Defaults to `false`.\n */\n refetchInterval?:\n | number\n | false\n | ((\n query: Query,\n ) => number | false | undefined)\n /**\n * If set to `true`, the query will continue to refetch while their tab/window is in the background.\n * Defaults to `false`.\n */\n refetchIntervalInBackground?: boolean\n /**\n * If set to `true`, the query will refetch on window focus if the data is stale.\n * If set to `false`, the query will not refetch on window focus.\n * If set to `'always'`, the query will always refetch on window focus.\n * If set to a function, the function will be executed with the latest data and query to compute the value.\n * Defaults to `true`.\n */\n refetchOnWindowFocus?:\n | boolean\n | 'always'\n | ((\n query: Query,\n ) => boolean | 'always')\n /**\n * If set to `true`, the query will refetch on reconnect if the data is stale.\n * If set to `false`, the query will not refetch on reconnect.\n * If set to `'always'`, the query will always refetch on reconnect.\n * If set to a function, the function will be executed with the latest data and query to compute the value.\n * Defaults to the value of `networkOnline` (`true`)\n */\n refetchOnReconnect?:\n | boolean\n | 'always'\n | ((\n query: Query,\n ) => boolean | 'always')\n /**\n * If set to `true`, the query will refetch on mount if the data is stale.\n * If set to `false`, will disable additional instances of a query to trigger background refetch.\n * If set to `'always'`, the query will always refetch on mount.\n * If set to a function, the function will be executed with the latest data and query to compute the value\n * Defaults to `true`.\n */\n refetchOnMount?:\n | boolean\n | 'always'\n | ((\n query: Query,\n ) => boolean | 'always')\n /**\n * If set to `false`, the query will not be retried on mount if it contains an error.\n * Defaults to `true`.\n */\n retryOnMount?: boolean\n /**\n * If set, the component will only re-render if any of the listed properties change.\n * When set to `['data', 'error']`, the component will only re-render when the `data` or `error` properties change.\n * When set to `'all'`, the component will re-render whenever a query is updated.\n * When set to a function, the function will be executed to compute the list of properties.\n * By default, access to properties will be tracked, and the component will only re-render when one of the tracked properties change.\n */\n notifyOnChangeProps?: NotifyOnChangeProps\n /**\n * Whether errors should be thrown instead of setting the `error` property.\n * If set to `true` or `suspense` is `true`, all errors will be thrown to the error boundary.\n * If set to `false` and `suspense` is `false`, errors are returned as state.\n * If set to a function, it will be passed the error and the query, and it should return a boolean indicating whether to show the error in an error boundary (`true`) or return the error as state (`false`).\n * Defaults to `false`.\n */\n throwOnError?: ThrowOnError\n /**\n * This option can be used to transform or select a part of the data returned by the query function.\n */\n select?: (data: TQueryData) => TData\n /**\n * If set to `true`, the query will suspend when `status === 'pending'`\n * and throw errors when `status === 'error'`.\n * Defaults to `false`.\n */\n suspense?: boolean\n /**\n * If set, this value will be used as the placeholder data for this particular query observer while the query is still in the `loading` data and no initialData has been provided.\n */\n placeholderData?:\n | NonFunctionGuard\n | PlaceholderDataFunction<\n NonFunctionGuard,\n TError,\n NonFunctionGuard,\n TQueryKey\n >\n\n _optimisticResults?: 'optimistic' | 'isRestoring'\n\n /**\n * Enable prefetching during rendering\n */\n experimental_prefetchInRender?: boolean\n}\n\nexport type WithRequired = TTarget & {\n [_ in TKey]: {}\n}\n\nexport type DefaultedQueryObserverOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> = WithRequired<\n QueryObserverOptions,\n 'throwOnError' | 'refetchOnReconnect' | 'queryHash'\n>\n\nexport interface InfiniteQueryObserverOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n>\n extends\n QueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n InfiniteData,\n TQueryKey,\n TPageParam\n >,\n InfiniteQueryPageParamsOptions {}\n\nexport type DefaultedInfiniteQueryObserverOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n> = WithRequired<\n InfiniteQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n 'throwOnError' | 'refetchOnReconnect' | 'queryHash'\n>\n\nexport interface FetchQueryOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = never,\n> extends WithRequired<\n QueryOptions,\n 'queryKey'\n> {\n initialPageParam?: never\n /**\n * The time in milliseconds after data is considered stale.\n * If the data is fresh it will be returned from the cache.\n */\n staleTime?: StaleTimeFunction\n}\n\nexport interface EnsureQueryDataOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = never,\n> extends FetchQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n> {\n revalidateIfStale?: boolean\n}\n\nexport type EnsureInfiniteQueryDataOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n> = FetchInfiniteQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n> & {\n revalidateIfStale?: boolean\n}\n\ntype FetchInfiniteQueryPages =\n | { pages?: never }\n | {\n pages: number\n getNextPageParam: GetNextPageParamFunction\n }\n\nexport type FetchInfiniteQueryOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n> = Omit<\n FetchQueryOptions<\n TQueryFnData,\n TError,\n InfiniteData,\n TQueryKey,\n TPageParam\n >,\n 'initialPageParam'\n> &\n InitialPageParam &\n FetchInfiniteQueryPages\n\nexport interface ResultOptions {\n throwOnError?: boolean\n}\n\nexport interface RefetchOptions extends ResultOptions {\n /**\n * If set to `true`, a currently running request will be cancelled before a new request is made\n *\n * If set to `false`, no refetch will be made if there is already a request running.\n *\n * Defaults to `true`.\n */\n cancelRefetch?: boolean\n}\n\nexport interface InvalidateQueryFilters<\n TQueryKey extends QueryKey = QueryKey,\n> extends QueryFilters {\n refetchType?: QueryTypeFilter | 'none'\n}\n\nexport interface RefetchQueryFilters<\n TQueryKey extends QueryKey = QueryKey,\n> extends QueryFilters {}\n\nexport interface InvalidateOptions extends RefetchOptions {}\nexport interface ResetOptions extends RefetchOptions {}\n\nexport interface FetchNextPageOptions extends ResultOptions {\n /**\n * If set to `true`, calling `fetchNextPage` repeatedly will invoke `queryFn` every time,\n * whether the previous invocation has resolved or not. Also, the result from previous invocations will be ignored.\n *\n * If set to `false`, calling `fetchNextPage` repeatedly won't have any effect until the first invocation has resolved.\n *\n * Defaults to `true`.\n */\n cancelRefetch?: boolean\n}\n\nexport interface FetchPreviousPageOptions extends ResultOptions {\n /**\n * If set to `true`, calling `fetchPreviousPage` repeatedly will invoke `queryFn` every time,\n * whether the previous invocation has resolved or not. Also, the result from previous invocations will be ignored.\n *\n * If set to `false`, calling `fetchPreviousPage` repeatedly won't have any effect until the first invocation has resolved.\n *\n * Defaults to `true`.\n */\n cancelRefetch?: boolean\n}\n\nexport type QueryStatus = 'pending' | 'error' | 'success'\nexport type FetchStatus = 'fetching' | 'paused' | 'idle'\n\nexport interface QueryObserverBaseResult<\n TData = unknown,\n TError = DefaultError,\n> {\n /**\n * The last successfully resolved data for the query.\n */\n data: TData | undefined\n /**\n * The timestamp for when the query most recently returned the `status` as `\"success\"`.\n */\n dataUpdatedAt: number\n /**\n * The error object for the query, if an error was thrown.\n * - Defaults to `null`.\n */\n error: TError | null\n /**\n * The timestamp for when the query most recently returned the `status` as `\"error\"`.\n */\n errorUpdatedAt: number\n /**\n * The failure count for the query.\n * - Incremented every time the query fails.\n * - Reset to `0` when the query succeeds.\n */\n failureCount: number\n /**\n * The failure reason for the query retry.\n * - Reset to `null` when the query succeeds.\n */\n failureReason: TError | null\n /**\n * The sum of all errors.\n */\n errorUpdateCount: number\n /**\n * A derived boolean from the `status` variable, provided for convenience.\n * - `true` if the query attempt resulted in an error.\n */\n isError: boolean\n /**\n * Will be `true` if the query has been fetched.\n */\n isFetched: boolean\n /**\n * Will be `true` if the query has been fetched after the component mounted.\n * - This property can be used to not show any previously cached data.\n */\n isFetchedAfterMount: boolean\n /**\n * A derived boolean from the `fetchStatus` variable, provided for convenience.\n * - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch.\n */\n isFetching: boolean\n /**\n * Is `true` whenever the first fetch for a query is in-flight.\n * - Is the same as `isFetching && isPending`.\n */\n isLoading: boolean\n /**\n * Will be `pending` if there's no cached data and no query attempt was finished yet.\n */\n isPending: boolean\n /**\n * Will be `true` if the query failed while fetching for the first time.\n */\n isLoadingError: boolean\n /**\n * @deprecated `isInitialLoading` is being deprecated in favor of `isLoading`\n * and will be removed in the next major version.\n */\n isInitialLoading: boolean\n /**\n * A derived boolean from the `fetchStatus` variable, provided for convenience.\n * - The query wanted to fetch, but has been `paused`.\n */\n isPaused: boolean\n /**\n * Will be `true` if the data shown is the placeholder data.\n */\n isPlaceholderData: boolean\n /**\n * Will be `true` if the query failed while refetching.\n */\n isRefetchError: boolean\n /**\n * Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`.\n * - Is the same as `isFetching && !isPending`.\n */\n isRefetching: boolean\n /**\n * Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`.\n */\n isStale: boolean\n /**\n * A derived boolean from the `status` variable, provided for convenience.\n * - `true` if the query has received a response with no errors and is ready to display its data.\n */\n isSuccess: boolean\n /**\n * `true` if this observer is enabled, `false` otherwise.\n */\n isEnabled: boolean\n /**\n * A function to manually refetch the query.\n */\n refetch: (\n options?: RefetchOptions,\n ) => Promise>\n /**\n * The status of the query.\n * - Will be:\n * - `pending` if there's no cached data and no query attempt was finished yet.\n * - `error` if the query attempt resulted in an error.\n * - `success` if the query has received a response with no errors and is ready to display its data.\n */\n status: QueryStatus\n /**\n * The fetch status of the query.\n * - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch.\n * - `paused`: The query wanted to fetch, but has been `paused`.\n * - `idle`: The query is not fetching.\n * - See [Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information.\n */\n fetchStatus: FetchStatus\n /**\n * A stable promise that will be resolved with the data of the query.\n * Requires the `experimental_prefetchInRender` feature flag to be enabled.\n * @example\n *\n * ### Enabling the feature flag\n * ```ts\n * const client = new QueryClient({\n * defaultOptions: {\n * queries: {\n * experimental_prefetchInRender: true,\n * },\n * },\n * })\n * ```\n *\n * ### Usage\n * ```tsx\n * import { useQuery } from '@tanstack/react-query'\n * import React from 'react'\n * import { fetchTodos, type Todo } from './api'\n *\n * function TodoList({ query }: { query: UseQueryResult }) {\n * const data = React.use(query.promise)\n *\n * return (\n *
    \n * {data.map(todo => (\n *
  • {todo.title}
  • \n * ))}\n *
\n * )\n * }\n *\n * export function App() {\n * const query = useQuery({ queryKey: ['todos'], queryFn: fetchTodos })\n *\n * return (\n * <>\n *

Todos

\n * Loading...}>\n * \n * \n * \n * )\n * }\n * ```\n */\n promise: Promise\n}\n\nexport interface QueryObserverPendingResult<\n TData = unknown,\n TError = DefaultError,\n> extends QueryObserverBaseResult {\n data: undefined\n error: null\n isError: false\n isPending: true\n isLoadingError: false\n isRefetchError: false\n isSuccess: false\n isPlaceholderData: false\n status: 'pending'\n}\n\nexport interface QueryObserverLoadingResult<\n TData = unknown,\n TError = DefaultError,\n> extends QueryObserverBaseResult {\n data: undefined\n error: null\n isError: false\n isPending: true\n isLoading: true\n isLoadingError: false\n isRefetchError: false\n isSuccess: false\n isPlaceholderData: false\n status: 'pending'\n}\n\nexport interface QueryObserverLoadingErrorResult<\n TData = unknown,\n TError = DefaultError,\n> extends QueryObserverBaseResult {\n data: undefined\n error: TError\n isError: true\n isPending: false\n isLoading: false\n isLoadingError: true\n isRefetchError: false\n isSuccess: false\n isPlaceholderData: false\n status: 'error'\n}\n\nexport interface QueryObserverRefetchErrorResult<\n TData = unknown,\n TError = DefaultError,\n> extends QueryObserverBaseResult {\n data: TData\n error: TError\n isError: true\n isPending: false\n isLoading: false\n isLoadingError: false\n isRefetchError: true\n isSuccess: false\n isPlaceholderData: false\n status: 'error'\n}\n\nexport interface QueryObserverSuccessResult<\n TData = unknown,\n TError = DefaultError,\n> extends QueryObserverBaseResult {\n data: TData\n error: null\n isError: false\n isPending: false\n isLoading: false\n isLoadingError: false\n isRefetchError: false\n isSuccess: true\n isPlaceholderData: false\n status: 'success'\n}\n\nexport interface QueryObserverPlaceholderResult<\n TData = unknown,\n TError = DefaultError,\n> extends QueryObserverBaseResult {\n data: TData\n isError: false\n error: null\n isPending: false\n isLoading: false\n isLoadingError: false\n isRefetchError: false\n isSuccess: true\n isPlaceholderData: true\n status: 'success'\n}\n\nexport type DefinedQueryObserverResult<\n TData = unknown,\n TError = DefaultError,\n> =\n | QueryObserverRefetchErrorResult\n | QueryObserverSuccessResult\n\nexport type QueryObserverResult =\n | DefinedQueryObserverResult\n | QueryObserverLoadingErrorResult\n | QueryObserverLoadingResult\n | QueryObserverPendingResult\n | QueryObserverPlaceholderResult\n\nexport interface InfiniteQueryObserverBaseResult<\n TData = unknown,\n TError = DefaultError,\n> extends QueryObserverBaseResult {\n /**\n * This function allows you to fetch the next \"page\" of results.\n */\n fetchNextPage: (\n options?: FetchNextPageOptions,\n ) => Promise>\n /**\n * This function allows you to fetch the previous \"page\" of results.\n */\n fetchPreviousPage: (\n options?: FetchPreviousPageOptions,\n ) => Promise>\n /**\n * Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option).\n */\n hasNextPage: boolean\n /**\n * Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option).\n */\n hasPreviousPage: boolean\n /**\n * Will be `true` if the query failed while fetching the next page.\n */\n isFetchNextPageError: boolean\n /**\n * Will be `true` while fetching the next page with `fetchNextPage`.\n */\n isFetchingNextPage: boolean\n /**\n * Will be `true` if the query failed while fetching the previous page.\n */\n isFetchPreviousPageError: boolean\n /**\n * Will be `true` while fetching the previous page with `fetchPreviousPage`.\n */\n isFetchingPreviousPage: boolean\n}\n\nexport interface InfiniteQueryObserverPendingResult<\n TData = unknown,\n TError = DefaultError,\n> extends InfiniteQueryObserverBaseResult {\n data: undefined\n error: null\n isError: false\n isPending: true\n isLoadingError: false\n isRefetchError: false\n isFetchNextPageError: false\n isFetchPreviousPageError: false\n isSuccess: false\n isPlaceholderData: false\n status: 'pending'\n}\n\nexport interface InfiniteQueryObserverLoadingResult<\n TData = unknown,\n TError = DefaultError,\n> extends InfiniteQueryObserverBaseResult {\n data: undefined\n error: null\n isError: false\n isPending: true\n isLoading: true\n isLoadingError: false\n isRefetchError: false\n isFetchNextPageError: false\n isFetchPreviousPageError: false\n isSuccess: false\n isPlaceholderData: false\n status: 'pending'\n}\n\nexport interface InfiniteQueryObserverLoadingErrorResult<\n TData = unknown,\n TError = DefaultError,\n> extends InfiniteQueryObserverBaseResult {\n data: undefined\n error: TError\n isError: true\n isPending: false\n isLoading: false\n isLoadingError: true\n isRefetchError: false\n isFetchNextPageError: false\n isFetchPreviousPageError: false\n isSuccess: false\n isPlaceholderData: false\n status: 'error'\n}\n\nexport interface InfiniteQueryObserverRefetchErrorResult<\n TData = unknown,\n TError = DefaultError,\n> extends InfiniteQueryObserverBaseResult {\n data: TData\n error: TError\n isError: true\n isPending: false\n isLoading: false\n isLoadingError: false\n isRefetchError: true\n isSuccess: false\n isPlaceholderData: false\n status: 'error'\n}\n\nexport interface InfiniteQueryObserverSuccessResult<\n TData = unknown,\n TError = DefaultError,\n> extends InfiniteQueryObserverBaseResult {\n data: TData\n error: null\n isError: false\n isPending: false\n isLoading: false\n isLoadingError: false\n isRefetchError: false\n isFetchNextPageError: false\n isFetchPreviousPageError: false\n isSuccess: true\n isPlaceholderData: false\n status: 'success'\n}\n\nexport interface InfiniteQueryObserverPlaceholderResult<\n TData = unknown,\n TError = DefaultError,\n> extends InfiniteQueryObserverBaseResult {\n data: TData\n isError: false\n error: null\n isPending: false\n isLoading: false\n isLoadingError: false\n isRefetchError: false\n isSuccess: true\n isPlaceholderData: true\n isFetchNextPageError: false\n isFetchPreviousPageError: false\n status: 'success'\n}\n\nexport type DefinedInfiniteQueryObserverResult<\n TData = unknown,\n TError = DefaultError,\n> =\n | InfiniteQueryObserverRefetchErrorResult\n | InfiniteQueryObserverSuccessResult\n\nexport type InfiniteQueryObserverResult<\n TData = unknown,\n TError = DefaultError,\n> =\n | DefinedInfiniteQueryObserverResult\n | InfiniteQueryObserverLoadingErrorResult\n | InfiniteQueryObserverLoadingResult\n | InfiniteQueryObserverPendingResult\n | InfiniteQueryObserverPlaceholderResult\n\nexport type MutationKey = Register extends {\n mutationKey: infer TMutationKey\n}\n ? TMutationKey extends ReadonlyArray\n ? TMutationKey\n : TMutationKey extends Array\n ? TMutationKey\n : ReadonlyArray\n : ReadonlyArray\n\nexport type MutationStatus = 'idle' | 'pending' | 'success' | 'error'\n\nexport type MutationScope = {\n id: string\n}\n\nexport type MutationMeta = Register extends {\n mutationMeta: infer TMutationMeta\n}\n ? TMutationMeta extends Record\n ? TMutationMeta\n : Record\n : Record\n\nexport type MutationFunctionContext = {\n client: QueryClient\n meta: MutationMeta | undefined\n mutationKey?: MutationKey\n}\n\nexport type MutationFunction = (\n variables: TVariables,\n context: MutationFunctionContext,\n) => Promise\n\nexport interface MutationOptions<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n> {\n mutationFn?: MutationFunction\n mutationKey?: MutationKey\n onMutate?: (\n variables: TVariables,\n context: MutationFunctionContext,\n ) => Promise | TOnMutateResult\n onSuccess?: (\n data: TData,\n variables: TVariables,\n onMutateResult: TOnMutateResult,\n context: MutationFunctionContext,\n ) => Promise | unknown\n onError?: (\n error: TError,\n variables: TVariables,\n onMutateResult: TOnMutateResult | undefined,\n context: MutationFunctionContext,\n ) => Promise | unknown\n onSettled?: (\n data: TData | undefined,\n error: TError | null,\n variables: TVariables,\n onMutateResult: TOnMutateResult | undefined,\n context: MutationFunctionContext,\n ) => Promise | unknown\n retry?: RetryValue\n retryDelay?: RetryDelayValue\n networkMode?: NetworkMode\n gcTime?: number\n _defaulted?: boolean\n meta?: MutationMeta\n scope?: MutationScope\n}\n\nexport interface MutationObserverOptions<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n> extends MutationOptions {\n throwOnError?: boolean | ((error: TError) => boolean)\n}\n\nexport interface MutateOptions<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n> {\n onSuccess?: (\n data: TData,\n variables: TVariables,\n onMutateResult: TOnMutateResult | undefined,\n context: MutationFunctionContext,\n ) => void\n onError?: (\n error: TError,\n variables: TVariables,\n onMutateResult: TOnMutateResult | undefined,\n context: MutationFunctionContext,\n ) => void\n onSettled?: (\n data: TData | undefined,\n error: TError | null,\n variables: TVariables,\n onMutateResult: TOnMutateResult | undefined,\n context: MutationFunctionContext,\n ) => void\n}\n\nexport type MutateFunction<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n> = (\n variables: TVariables,\n options?: MutateOptions,\n) => Promise\n\nexport interface MutationObserverBaseResult<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n> extends MutationState {\n /**\n * The last successfully resolved data for the mutation.\n */\n data: TData | undefined\n /**\n * The variables object passed to the `mutationFn`.\n */\n variables: TVariables | undefined\n /**\n * The error object for the mutation, if an error was encountered.\n * - Defaults to `null`.\n */\n error: TError | null\n /**\n * A boolean variable derived from `status`.\n * - `true` if the last mutation attempt resulted in an error.\n */\n isError: boolean\n /**\n * A boolean variable derived from `status`.\n * - `true` if the mutation is in its initial state prior to executing.\n */\n isIdle: boolean\n /**\n * A boolean variable derived from `status`.\n * - `true` if the mutation is currently executing.\n */\n isPending: boolean\n /**\n * A boolean variable derived from `status`.\n * - `true` if the last mutation attempt was successful.\n */\n isSuccess: boolean\n /**\n * The status of the mutation.\n * - Will be:\n * - `idle` initial status prior to the mutation function executing.\n * - `pending` if the mutation is currently executing.\n * - `error` if the last mutation attempt resulted in an error.\n * - `success` if the last mutation attempt was successful.\n */\n status: MutationStatus\n /**\n * The mutation function you can call with variables to trigger the mutation and optionally hooks on additional callback options.\n * @param variables - The variables object to pass to the `mutationFn`.\n * @param options.onSuccess - This function will fire when the mutation is successful and will be passed the mutation's result.\n * @param options.onError - This function will fire if the mutation encounters an error and will be passed the error.\n * @param options.onSettled - This function will fire when the mutation is either successfully fetched or encounters an error and be passed either the data or error.\n * @remarks\n * - If you make multiple requests, `onSuccess` will fire only after the latest call you've made.\n * - All the callback functions (`onSuccess`, `onError`, `onSettled`) are void functions, and the returned value will be ignored.\n */\n mutate: MutateFunction\n /**\n * A function to clean the mutation internal state (i.e., it resets the mutation to its initial state).\n */\n reset: () => void\n}\n\nexport interface MutationObserverIdleResult<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n> extends MutationObserverBaseResult<\n TData,\n TError,\n TVariables,\n TOnMutateResult\n> {\n data: undefined\n variables: undefined\n error: null\n isError: false\n isIdle: true\n isPending: false\n isSuccess: false\n status: 'idle'\n}\n\nexport interface MutationObserverLoadingResult<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n> extends MutationObserverBaseResult<\n TData,\n TError,\n TVariables,\n TOnMutateResult\n> {\n data: undefined\n variables: TVariables\n error: null\n isError: false\n isIdle: false\n isPending: true\n isSuccess: false\n status: 'pending'\n}\n\nexport interface MutationObserverErrorResult<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n> extends MutationObserverBaseResult<\n TData,\n TError,\n TVariables,\n TOnMutateResult\n> {\n data: undefined\n error: TError\n variables: TVariables\n isError: true\n isIdle: false\n isPending: false\n isSuccess: false\n status: 'error'\n}\n\nexport interface MutationObserverSuccessResult<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n> extends MutationObserverBaseResult<\n TData,\n TError,\n TVariables,\n TOnMutateResult\n> {\n data: TData\n error: null\n variables: TVariables\n isError: false\n isIdle: false\n isPending: false\n isSuccess: true\n status: 'success'\n}\n\nexport type MutationObserverResult<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n> =\n | MutationObserverIdleResult\n | MutationObserverLoadingResult\n | MutationObserverErrorResult\n | MutationObserverSuccessResult\n\nexport interface QueryClientConfig {\n queryCache?: QueryCache\n mutationCache?: MutationCache\n defaultOptions?: DefaultOptions\n}\n\nexport interface DefaultOptions {\n queries?: OmitKeyof<\n QueryObserverOptions,\n 'suspense' | 'queryKey'\n >\n mutations?: MutationObserverOptions\n hydrate?: HydrateOptions['defaultOptions']\n dehydrate?: DehydrateOptions\n}\n\nexport interface CancelOptions {\n revert?: boolean\n silent?: boolean\n}\n\nexport interface SetDataOptions {\n updatedAt?: number\n}\n\nexport type NotifyEventType =\n | 'added'\n | 'removed'\n | 'updated'\n | 'observerAdded'\n | 'observerRemoved'\n | 'observerResultsUpdated'\n | 'observerOptionsUpdated'\n\nexport interface NotifyEvent {\n type: NotifyEventType\n}\n"],"mappings":";;;AA8DO,IAAM,gBAAgB,uBAAO,eAAe;AAE5C,IAAM,qBAAqB,uBAAO,oBAAoB;AAEtD,IAAM,cAAc,uBAAO,aAAa;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/utils.cjs b/node_modules/@tanstack/query-core/build/legacy/utils.cjs new file mode 100644 index 0000000..70b2c69 --- /dev/null +++ b/node_modules/@tanstack/query-core/build/legacy/utils.cjs @@ -0,0 +1,330 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/utils.ts +var utils_exports = {}; +__export(utils_exports, { + addConsumeAwareSignal: () => addConsumeAwareSignal, + addToEnd: () => addToEnd, + addToStart: () => addToStart, + ensureQueryFn: () => ensureQueryFn, + functionalUpdate: () => functionalUpdate, + hashKey: () => hashKey, + hashQueryKeyByOptions: () => hashQueryKeyByOptions, + isPlainArray: () => isPlainArray, + isPlainObject: () => isPlainObject, + isServer: () => isServer, + isValidTimeout: () => isValidTimeout, + keepPreviousData: () => keepPreviousData, + matchMutation: () => matchMutation, + matchQuery: () => matchQuery, + noop: () => noop, + partialMatchKey: () => partialMatchKey, + replaceData: () => replaceData, + replaceEqualDeep: () => replaceEqualDeep, + resolveEnabled: () => resolveEnabled, + resolveStaleTime: () => resolveStaleTime, + shallowEqualObjects: () => shallowEqualObjects, + shouldThrowError: () => shouldThrowError, + skipToken: () => skipToken, + sleep: () => sleep, + timeUntilStale: () => timeUntilStale +}); +module.exports = __toCommonJS(utils_exports); +var import_timeoutManager = require("./timeoutManager.cjs"); +var isServer = typeof window === "undefined" || "Deno" in globalThis; +function noop() { +} +function functionalUpdate(updater, input) { + return typeof updater === "function" ? updater(input) : updater; +} +function isValidTimeout(value) { + return typeof value === "number" && value >= 0 && value !== Infinity; +} +function timeUntilStale(updatedAt, staleTime) { + return Math.max(updatedAt + (staleTime || 0) - Date.now(), 0); +} +function resolveStaleTime(staleTime, query) { + return typeof staleTime === "function" ? staleTime(query) : staleTime; +} +function resolveEnabled(enabled, query) { + return typeof enabled === "function" ? enabled(query) : enabled; +} +function matchQuery(filters, query) { + const { + type = "all", + exact, + fetchStatus, + predicate, + queryKey, + stale + } = filters; + if (queryKey) { + if (exact) { + if (query.queryHash !== hashQueryKeyByOptions(queryKey, query.options)) { + return false; + } + } else if (!partialMatchKey(query.queryKey, queryKey)) { + return false; + } + } + if (type !== "all") { + const isActive = query.isActive(); + if (type === "active" && !isActive) { + return false; + } + if (type === "inactive" && isActive) { + return false; + } + } + if (typeof stale === "boolean" && query.isStale() !== stale) { + return false; + } + if (fetchStatus && fetchStatus !== query.state.fetchStatus) { + return false; + } + if (predicate && !predicate(query)) { + return false; + } + return true; +} +function matchMutation(filters, mutation) { + const { exact, status, predicate, mutationKey } = filters; + if (mutationKey) { + if (!mutation.options.mutationKey) { + return false; + } + if (exact) { + if (hashKey(mutation.options.mutationKey) !== hashKey(mutationKey)) { + return false; + } + } else if (!partialMatchKey(mutation.options.mutationKey, mutationKey)) { + return false; + } + } + if (status && mutation.state.status !== status) { + return false; + } + if (predicate && !predicate(mutation)) { + return false; + } + return true; +} +function hashQueryKeyByOptions(queryKey, options) { + const hashFn = (options == null ? void 0 : options.queryKeyHashFn) || hashKey; + return hashFn(queryKey); +} +function hashKey(queryKey) { + return JSON.stringify( + queryKey, + (_, val) => isPlainObject(val) ? Object.keys(val).sort().reduce((result, key) => { + result[key] = val[key]; + return result; + }, {}) : val + ); +} +function partialMatchKey(a, b) { + if (a === b) { + return true; + } + if (typeof a !== typeof b) { + return false; + } + if (a && b && typeof a === "object" && typeof b === "object") { + return Object.keys(b).every((key) => partialMatchKey(a[key], b[key])); + } + return false; +} +var hasOwn = Object.prototype.hasOwnProperty; +function replaceEqualDeep(a, b, depth = 0) { + if (a === b) { + return a; + } + if (depth > 500) return b; + const array = isPlainArray(a) && isPlainArray(b); + if (!array && !(isPlainObject(a) && isPlainObject(b))) return b; + const aItems = array ? a : Object.keys(a); + const aSize = aItems.length; + const bItems = array ? b : Object.keys(b); + const bSize = bItems.length; + const copy = array ? new Array(bSize) : {}; + let equalItems = 0; + for (let i = 0; i < bSize; i++) { + const key = array ? i : bItems[i]; + const aItem = a[key]; + const bItem = b[key]; + if (aItem === bItem) { + copy[key] = aItem; + if (array ? i < aSize : hasOwn.call(a, key)) equalItems++; + continue; + } + if (aItem === null || bItem === null || typeof aItem !== "object" || typeof bItem !== "object") { + copy[key] = bItem; + continue; + } + const v = replaceEqualDeep(aItem, bItem, depth + 1); + copy[key] = v; + if (v === aItem) equalItems++; + } + return aSize === bSize && equalItems === aSize ? a : copy; +} +function shallowEqualObjects(a, b) { + if (!b || Object.keys(a).length !== Object.keys(b).length) { + return false; + } + for (const key in a) { + if (a[key] !== b[key]) { + return false; + } + } + return true; +} +function isPlainArray(value) { + return Array.isArray(value) && value.length === Object.keys(value).length; +} +function isPlainObject(o) { + if (!hasObjectPrototype(o)) { + return false; + } + const ctor = o.constructor; + if (ctor === void 0) { + return true; + } + const prot = ctor.prototype; + if (!hasObjectPrototype(prot)) { + return false; + } + if (!prot.hasOwnProperty("isPrototypeOf")) { + return false; + } + if (Object.getPrototypeOf(o) !== Object.prototype) { + return false; + } + return true; +} +function hasObjectPrototype(o) { + return Object.prototype.toString.call(o) === "[object Object]"; +} +function sleep(timeout) { + return new Promise((resolve) => { + import_timeoutManager.timeoutManager.setTimeout(resolve, timeout); + }); +} +function replaceData(prevData, data, options) { + if (typeof options.structuralSharing === "function") { + return options.structuralSharing(prevData, data); + } else if (options.structuralSharing !== false) { + if (process.env.NODE_ENV !== "production") { + try { + return replaceEqualDeep(prevData, data); + } catch (error) { + console.error( + `Structural sharing requires data to be JSON serializable. To fix this, turn off structuralSharing or return JSON-serializable data from your queryFn. [${options.queryHash}]: ${error}` + ); + throw error; + } + } + return replaceEqualDeep(prevData, data); + } + return data; +} +function keepPreviousData(previousData) { + return previousData; +} +function addToEnd(items, item, max = 0) { + const newItems = [...items, item]; + return max && newItems.length > max ? newItems.slice(1) : newItems; +} +function addToStart(items, item, max = 0) { + const newItems = [item, ...items]; + return max && newItems.length > max ? newItems.slice(0, -1) : newItems; +} +var skipToken = /* @__PURE__ */ Symbol(); +function ensureQueryFn(options, fetchOptions) { + if (process.env.NODE_ENV !== "production") { + if (options.queryFn === skipToken) { + console.error( + `Attempted to invoke queryFn when set to skipToken. This is likely a configuration error. Query hash: '${options.queryHash}'` + ); + } + } + if (!options.queryFn && (fetchOptions == null ? void 0 : fetchOptions.initialPromise)) { + return () => fetchOptions.initialPromise; + } + if (!options.queryFn || options.queryFn === skipToken) { + return () => Promise.reject(new Error(`Missing queryFn: '${options.queryHash}'`)); + } + return options.queryFn; +} +function shouldThrowError(throwOnError, params) { + if (typeof throwOnError === "function") { + return throwOnError(...params); + } + return !!throwOnError; +} +function addConsumeAwareSignal(object, getSignal, onCancelled) { + let consumed = false; + let signal; + Object.defineProperty(object, "signal", { + enumerable: true, + get: () => { + signal ?? (signal = getSignal()); + if (consumed) { + return signal; + } + consumed = true; + if (signal.aborted) { + onCancelled(); + } else { + signal.addEventListener("abort", onCancelled, { once: true }); + } + return signal; + } + }); + return object; +} +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + addConsumeAwareSignal, + addToEnd, + addToStart, + ensureQueryFn, + functionalUpdate, + hashKey, + hashQueryKeyByOptions, + isPlainArray, + isPlainObject, + isServer, + isValidTimeout, + keepPreviousData, + matchMutation, + matchQuery, + noop, + partialMatchKey, + replaceData, + replaceEqualDeep, + resolveEnabled, + resolveStaleTime, + shallowEqualObjects, + shouldThrowError, + skipToken, + sleep, + timeUntilStale +}); +//# sourceMappingURL=utils.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/utils.cjs.map b/node_modules/@tanstack/query-core/build/legacy/utils.cjs.map new file mode 100644 index 0000000..fbfc03e --- /dev/null +++ b/node_modules/@tanstack/query-core/build/legacy/utils.cjs.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/utils.ts"],"sourcesContent":["import { timeoutManager } from './timeoutManager'\nimport type {\n DefaultError,\n Enabled,\n FetchStatus,\n MutationKey,\n MutationStatus,\n QueryFunction,\n QueryKey,\n QueryOptions,\n StaleTime,\n StaleTimeFunction,\n} from './types'\nimport type { Mutation } from './mutation'\nimport type { FetchOptions, Query } from './query'\n\n// TYPES\n\ntype DropLast> = T extends readonly [\n ...infer R,\n unknown,\n]\n ? readonly [...R]\n : never\n\ntype TuplePrefixes> = T extends readonly []\n ? readonly []\n : TuplePrefixes> | T\n\nexport interface QueryFilters {\n /**\n * Filter to active queries, inactive queries or all queries\n */\n type?: QueryTypeFilter\n /**\n * Match query key exactly\n */\n exact?: boolean\n /**\n * Include queries matching this predicate function\n */\n predicate?: (query: Query) => boolean\n /**\n * Include queries matching this query key\n */\n queryKey?: TQueryKey | TuplePrefixes\n /**\n * Include or exclude stale queries\n */\n stale?: boolean\n /**\n * Include queries matching their fetchStatus\n */\n fetchStatus?: FetchStatus\n}\n\nexport interface MutationFilters<\n TData = unknown,\n TError = DefaultError,\n TVariables = unknown,\n TOnMutateResult = unknown,\n> {\n /**\n * Match mutation key exactly\n */\n exact?: boolean\n /**\n * Include mutations matching this predicate function\n */\n predicate?: (\n mutation: Mutation,\n ) => boolean\n /**\n * Include mutations matching this mutation key\n */\n mutationKey?: TuplePrefixes\n /**\n * Filter by mutation status\n */\n status?: MutationStatus\n}\n\nexport type Updater = TOutput | ((input: TInput) => TOutput)\n\nexport type QueryTypeFilter = 'all' | 'active' | 'inactive'\n\n// UTILS\n\nexport const isServer = typeof window === 'undefined' || 'Deno' in globalThis\n\nexport function noop(): void\nexport function noop(): undefined\nexport function noop() {}\n\nexport function functionalUpdate(\n updater: Updater,\n input: TInput,\n): TOutput {\n return typeof updater === 'function'\n ? (updater as (_: TInput) => TOutput)(input)\n : updater\n}\n\nexport function isValidTimeout(value: unknown): value is number {\n return typeof value === 'number' && value >= 0 && value !== Infinity\n}\n\nexport function timeUntilStale(updatedAt: number, staleTime?: number): number {\n return Math.max(updatedAt + (staleTime || 0) - Date.now(), 0)\n}\n\nexport function resolveStaleTime<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n staleTime:\n | undefined\n | StaleTimeFunction,\n query: Query,\n): StaleTime | undefined {\n return typeof staleTime === 'function' ? staleTime(query) : staleTime\n}\n\nexport function resolveEnabled<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n enabled: undefined | Enabled,\n query: Query,\n): boolean | undefined {\n return typeof enabled === 'function' ? enabled(query) : enabled\n}\n\nexport function matchQuery(\n filters: QueryFilters,\n query: Query,\n): boolean {\n const {\n type = 'all',\n exact,\n fetchStatus,\n predicate,\n queryKey,\n stale,\n } = filters\n\n if (queryKey) {\n if (exact) {\n if (query.queryHash !== hashQueryKeyByOptions(queryKey, query.options)) {\n return false\n }\n } else if (!partialMatchKey(query.queryKey, queryKey)) {\n return false\n }\n }\n\n if (type !== 'all') {\n const isActive = query.isActive()\n if (type === 'active' && !isActive) {\n return false\n }\n if (type === 'inactive' && isActive) {\n return false\n }\n }\n\n if (typeof stale === 'boolean' && query.isStale() !== stale) {\n return false\n }\n\n if (fetchStatus && fetchStatus !== query.state.fetchStatus) {\n return false\n }\n\n if (predicate && !predicate(query)) {\n return false\n }\n\n return true\n}\n\nexport function matchMutation(\n filters: MutationFilters,\n mutation: Mutation,\n): boolean {\n const { exact, status, predicate, mutationKey } = filters\n if (mutationKey) {\n if (!mutation.options.mutationKey) {\n return false\n }\n if (exact) {\n if (hashKey(mutation.options.mutationKey) !== hashKey(mutationKey)) {\n return false\n }\n } else if (!partialMatchKey(mutation.options.mutationKey, mutationKey)) {\n return false\n }\n }\n\n if (status && mutation.state.status !== status) {\n return false\n }\n\n if (predicate && !predicate(mutation)) {\n return false\n }\n\n return true\n}\n\nexport function hashQueryKeyByOptions(\n queryKey: TQueryKey,\n options?: Pick, 'queryKeyHashFn'>,\n): string {\n const hashFn = options?.queryKeyHashFn || hashKey\n return hashFn(queryKey)\n}\n\n/**\n * Default query & mutation keys hash function.\n * Hashes the value into a stable hash.\n */\nexport function hashKey(queryKey: QueryKey | MutationKey): string {\n return JSON.stringify(queryKey, (_, val) =>\n isPlainObject(val)\n ? Object.keys(val)\n .sort()\n .reduce((result, key) => {\n result[key] = val[key]\n return result\n }, {} as any)\n : val,\n )\n}\n\n/**\n * Checks if key `b` partially matches with key `a`.\n */\nexport function partialMatchKey(a: QueryKey, b: QueryKey): boolean\nexport function partialMatchKey(a: any, b: any): boolean {\n if (a === b) {\n return true\n }\n\n if (typeof a !== typeof b) {\n return false\n }\n\n if (a && b && typeof a === 'object' && typeof b === 'object') {\n return Object.keys(b).every((key) => partialMatchKey(a[key], b[key]))\n }\n\n return false\n}\n\nconst hasOwn = Object.prototype.hasOwnProperty\n\n/**\n * This function returns `a` if `b` is deeply equal.\n * If not, it will replace any deeply equal children of `b` with those of `a`.\n * This can be used for structural sharing between JSON values for example.\n */\nexport function replaceEqualDeep(a: unknown, b: T, depth?: number): T\nexport function replaceEqualDeep(a: any, b: any, depth = 0): any {\n if (a === b) {\n return a\n }\n\n if (depth > 500) return b\n\n const array = isPlainArray(a) && isPlainArray(b)\n\n if (!array && !(isPlainObject(a) && isPlainObject(b))) return b\n\n const aItems = array ? a : Object.keys(a)\n const aSize = aItems.length\n const bItems = array ? b : Object.keys(b)\n const bSize = bItems.length\n const copy: any = array ? new Array(bSize) : {}\n\n let equalItems = 0\n\n for (let i = 0; i < bSize; i++) {\n const key: any = array ? i : bItems[i]\n const aItem = a[key]\n const bItem = b[key]\n\n if (aItem === bItem) {\n copy[key] = aItem\n if (array ? i < aSize : hasOwn.call(a, key)) equalItems++\n continue\n }\n\n if (\n aItem === null ||\n bItem === null ||\n typeof aItem !== 'object' ||\n typeof bItem !== 'object'\n ) {\n copy[key] = bItem\n continue\n }\n\n const v = replaceEqualDeep(aItem, bItem, depth + 1)\n copy[key] = v\n if (v === aItem) equalItems++\n }\n\n return aSize === bSize && equalItems === aSize ? a : copy\n}\n\n/**\n * Shallow compare objects.\n */\nexport function shallowEqualObjects>(\n a: T,\n b: T | undefined,\n): boolean {\n if (!b || Object.keys(a).length !== Object.keys(b).length) {\n return false\n }\n\n for (const key in a) {\n if (a[key] !== b[key]) {\n return false\n }\n }\n\n return true\n}\n\nexport function isPlainArray(value: unknown): value is Array {\n return Array.isArray(value) && value.length === Object.keys(value).length\n}\n\n// Copied from: https://github.com/jonschlinkert/is-plain-object\nexport function isPlainObject(o: any): o is Record {\n if (!hasObjectPrototype(o)) {\n return false\n }\n\n // If has no constructor\n const ctor = o.constructor\n if (ctor === undefined) {\n return true\n }\n\n // If has modified prototype\n const prot = ctor.prototype\n if (!hasObjectPrototype(prot)) {\n return false\n }\n\n // If constructor does not have an Object-specific method\n if (!prot.hasOwnProperty('isPrototypeOf')) {\n return false\n }\n\n // Handles Objects created by Object.create()\n if (Object.getPrototypeOf(o) !== Object.prototype) {\n return false\n }\n\n // Most likely a plain Object\n return true\n}\n\nfunction hasObjectPrototype(o: any): boolean {\n return Object.prototype.toString.call(o) === '[object Object]'\n}\n\nexport function sleep(timeout: number): Promise {\n return new Promise((resolve) => {\n timeoutManager.setTimeout(resolve, timeout)\n })\n}\n\nexport function replaceData<\n TData,\n TOptions extends QueryOptions,\n>(prevData: TData | undefined, data: TData, options: TOptions): TData {\n if (typeof options.structuralSharing === 'function') {\n return options.structuralSharing(prevData, data) as TData\n } else if (options.structuralSharing !== false) {\n if (process.env.NODE_ENV !== 'production') {\n try {\n return replaceEqualDeep(prevData, data)\n } catch (error) {\n console.error(\n `Structural sharing requires data to be JSON serializable. To fix this, turn off structuralSharing or return JSON-serializable data from your queryFn. [${options.queryHash}]: ${error}`,\n )\n\n // Prevent the replaceEqualDeep from being called again down below.\n throw error\n }\n }\n // Structurally share data between prev and new data if needed\n return replaceEqualDeep(prevData, data)\n }\n return data\n}\n\nexport function keepPreviousData(\n previousData: T | undefined,\n): T | undefined {\n return previousData\n}\n\nexport function addToEnd(items: Array, item: T, max = 0): Array {\n const newItems = [...items, item]\n return max && newItems.length > max ? newItems.slice(1) : newItems\n}\n\nexport function addToStart(items: Array, item: T, max = 0): Array {\n const newItems = [item, ...items]\n return max && newItems.length > max ? newItems.slice(0, -1) : newItems\n}\n\nexport const skipToken = Symbol()\nexport type SkipToken = typeof skipToken\n\nexport function ensureQueryFn<\n TQueryFnData = unknown,\n TQueryKey extends QueryKey = QueryKey,\n>(\n options: {\n queryFn?: QueryFunction | SkipToken\n queryHash?: string\n },\n fetchOptions?: FetchOptions,\n): QueryFunction {\n if (process.env.NODE_ENV !== 'production') {\n if (options.queryFn === skipToken) {\n console.error(\n `Attempted to invoke queryFn when set to skipToken. This is likely a configuration error. Query hash: '${options.queryHash}'`,\n )\n }\n }\n\n // if we attempt to retry a fetch that was triggered from an initialPromise\n // when we don't have a queryFn yet, we can't retry, so we just return the already rejected initialPromise\n // if an observer has already mounted, we will be able to retry with that queryFn\n if (!options.queryFn && fetchOptions?.initialPromise) {\n return () => fetchOptions.initialPromise!\n }\n\n if (!options.queryFn || options.queryFn === skipToken) {\n return () =>\n Promise.reject(new Error(`Missing queryFn: '${options.queryHash}'`))\n }\n\n return options.queryFn\n}\n\nexport function shouldThrowError) => boolean>(\n throwOnError: boolean | T | undefined,\n params: Parameters,\n): boolean {\n // Allow throwOnError function to override throwing behavior on a per-error basis\n if (typeof throwOnError === 'function') {\n return throwOnError(...params)\n }\n\n return !!throwOnError\n}\n\nexport function addConsumeAwareSignal(\n object: T,\n getSignal: () => AbortSignal,\n onCancelled: VoidFunction,\n): T & { signal: AbortSignal } {\n let consumed = false\n let signal: AbortSignal | undefined\n\n Object.defineProperty(object, 'signal', {\n enumerable: true,\n get: () => {\n signal ??= getSignal()\n if (consumed) {\n return signal\n }\n\n consumed = true\n if (signal.aborted) {\n onCancelled()\n } else {\n signal.addEventListener('abort', onCancelled, { once: true })\n }\n\n return signal\n },\n })\n\n return object as T & { signal: AbortSignal }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,4BAA+B;AAwFxB,IAAM,WAAW,OAAO,WAAW,eAAe,UAAU;AAI5D,SAAS,OAAO;AAAC;AAEjB,SAAS,iBACd,SACA,OACS;AACT,SAAO,OAAO,YAAY,aACrB,QAAmC,KAAK,IACzC;AACN;AAEO,SAAS,eAAe,OAAiC;AAC9D,SAAO,OAAO,UAAU,YAAY,SAAS,KAAK,UAAU;AAC9D;A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AK;AAChC,SAAO,OAAO,SAAS,SAAS,MAAM,SAAS,MAAM,GAAG,EAAE,IAAI;AAChE;AAEO,IAAM,YAAY,uBAAO;AAGzB,SAAS,cAId,SAIA,cACwC;AACxC,MAAI,QAAQ,IAAI,aAAa,cAAc;AACzC,QAAI,QAAQ,YAAY,WAAW;AACjC,cAAQ;AAAA,QACN,yGAAyG,QAAQ,SAAS;AAAA,MAC5H;AAAA,IACF;AAAA,EACF;AAKA,MAAI,CAAC,QAAQ,YAAW,6CAAc,iBAAgB;AACpD,WAAO,MAAM,aAAa;AAAA,EAC5B;AAEA,MAAI,CAAC,QAAQ,WAAW,QAAQ,YAAY,WAAW;AACrD,WAAO,MACL,QAAQ,OAAO,IAAI,MAAM,qBAAqB,QAAQ,SAAS,GAAG,CAAC;AAAA,EACvE;AAEA,SAAO,QAAQ;AACjB;AAEO,SAAS,iBACd,cACA,QACS;AAET,MAAI,OAAO,iBAAiB,YAAY;AACtC,WAAO,aAAa,GAAG,MAAM;AAAA,EAC/B;AAEA,SAAO,CAAC,CAAC;AACX;AAEO,SAAS,sBACd,QACA,WACA,aAC6B;AAC7B,MAAI,WAAW;AACf,MAAI;AAEJ,SAAO,eAAe,QAAQ,UAAU;AAAA,IACtC,YAAY;AAAA,IACZ,KAAK,MAAM;AACT,0BAAW,UAAU;AACrB,UAAI,UAAU;AACZ,eAAO;AAAA,MACT;AAEA,iBAAW;AACX,UAAI,OAAO,SAAS;AAClB,oBAAY;AAAA,MACd,OAAO;AACL,eAAO,iBAAiB,SAAS,aAAa,EAAE,MAAM,KAAK,CAAC;AAAA,MAC9D;AAEA,aAAO;AAAA,IACT;AAAA,EACF,CAAC;AAED,SAAO;AACT;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/utils.d.cts b/node_modules/@tanstack/query-core/build/legacy/utils.d.cts new file mode 100644 index 0000000..502420e --- /dev/null +++ b/node_modules/@tanstack/query-core/build/legacy/utils.d.cts @@ -0,0 +1,3 @@ +export { u as MutationFilters, v as QueryFilters, bl as QueryTypeFilter, S as SkipToken, U as Updater, bA as addConsumeAwareSignal, bx as addToEnd, by as addToStart, bz as ensureQueryFn, bm as functionalUpdate, k as hashKey, br as hashQueryKeyByOptions, bt as isPlainArray, bu as isPlainObject, l as isServer, bn as isValidTimeout, m as keepPreviousData, n as matchMutation, o as matchQuery, p as noop, q as partialMatchKey, bw as replaceData, r as replaceEqualDeep, bq as resolveEnabled, bp as resolveStaleTime, bs as shallowEqualObjects, s as shouldThrowError, t as skipToken, bv as sleep, bo as timeUntilStale } from './hydration-uphG6M-i.cjs'; +import './removable.cjs'; +import './subscribable.cjs'; diff --git a/node_modules/@tanstack/query-core/build/legacy/utils.d.ts b/node_modules/@tanstack/query-core/build/legacy/utils.d.ts new file mode 100644 index 0000000..77dcd04 --- /dev/null +++ b/node_modules/@tanstack/query-core/build/legacy/utils.d.ts @@ -0,0 +1,3 @@ +export { u as MutationFilters, v as QueryFilters, bl as QueryTypeFilter, S as SkipToken, U as Updater, bA as addConsumeAwareSignal, bx as addToEnd, by as addToStart, bz as ensureQueryFn, bm as functionalUpdate, k as hashKey, br as hashQueryKeyByOptions, bt as isPlainArray, bu as isPlainObject, l as isServer, bn as isValidTimeout, m as keepPreviousData, n as matchMutation, o as matchQuery, p as noop, q as partialMatchKey, bw as replaceData, r as replaceEqualDeep, bq as resolveEnabled, bp as resolveStaleTime, bs as shallowEqualObjects, s as shouldThrowError, t as skipToken, bv as sleep, bo as timeUntilStale } from './hydration-BlEVG2Lp.js'; +import './removable.js'; +import './subscribable.js'; diff --git a/node_modules/@tanstack/query-core/build/legacy/utils.js b/node_modules/@tanstack/query-core/build/legacy/utils.js new file mode 100644 index 0000000..51b9a4c --- /dev/null +++ b/node_modules/@tanstack/query-core/build/legacy/utils.js @@ -0,0 +1,283 @@ +import "./chunk-PXG64RU4.js"; + +// src/utils.ts +import { timeoutManager } from "./timeoutManager.js"; +var isServer = typeof window === "undefined" || "Deno" in globalThis; +function noop() { +} +function functionalUpdate(updater, input) { + return typeof updater === "function" ? updater(input) : updater; +} +function isValidTimeout(value) { + return typeof value === "number" && value >= 0 && value !== Infinity; +} +function timeUntilStale(updatedAt, staleTime) { + return Math.max(updatedAt + (staleTime || 0) - Date.now(), 0); +} +function resolveStaleTime(staleTime, query) { + return typeof staleTime === "function" ? staleTime(query) : staleTime; +} +function resolveEnabled(enabled, query) { + return typeof enabled === "function" ? enabled(query) : enabled; +} +function matchQuery(filters, query) { + const { + type = "all", + exact, + fetchStatus, + predicate, + queryKey, + stale + } = filters; + if (queryKey) { + if (exact) { + if (query.queryHash !== hashQueryKeyByOptions(queryKey, query.options)) { + return false; + } + } else if (!partialMatchKey(query.queryKey, queryKey)) { + return false; + } + } + if (type !== "all") { + const isActive = query.isActive(); + if (type === "active" && !isActive) { + return false; + } + if (type === "inactive" && isActive) { + return false; + } + } + if (typeof stale === "boolean" && query.isStale() !== stale) { + return false; + } + if (fetchStatus && fetchStatus !== query.state.fetchStatus) { + return false; + } + if (predicate && !predicate(query)) { + return false; + } + return true; +} +function matchMutation(filters, mutation) { + const { exact, status, predicate, mutationKey } = filters; + if (mutationKey) { + if (!mutation.options.mutationKey) { + return false; + } + if (exact) { + if (hashKey(mutation.options.mutationKey) !== hashKey(mutationKey)) { + return false; + } + } else if (!partialMatchKey(mutation.options.mutationKey, mutationKey)) { + return false; + } + } + if (status && mutation.state.status !== status) { + return false; + } + if (predicate && !predicate(mutation)) { + return false; + } + return true; +} +function hashQueryKeyByOptions(queryKey, options) { + const hashFn = (options == null ? void 0 : options.queryKeyHashFn) || hashKey; + return hashFn(queryKey); +} +function hashKey(queryKey) { + return JSON.stringify( + queryKey, + (_, val) => isPlainObject(val) ? Object.keys(val).sort().reduce((result, key) => { + result[key] = val[key]; + return result; + }, {}) : val + ); +} +function partialMatchKey(a, b) { + if (a === b) { + return true; + } + if (typeof a !== typeof b) { + return false; + } + if (a && b && typeof a === "object" && typeof b === "object") { + return Object.keys(b).every((key) => partialMatchKey(a[key], b[key])); + } + return false; +} +var hasOwn = Object.prototype.hasOwnProperty; +function replaceEqualDeep(a, b, depth = 0) { + if (a === b) { + return a; + } + if (depth > 500) return b; + const array = isPlainArray(a) && isPlainArray(b); + if (!array && !(isPlainObject(a) && isPlainObject(b))) return b; + const aItems = array ? a : Object.keys(a); + const aSize = aItems.length; + const bItems = array ? b : Object.keys(b); + const bSize = bItems.length; + const copy = array ? new Array(bSize) : {}; + let equalItems = 0; + for (let i = 0; i < bSize; i++) { + const key = array ? i : bItems[i]; + const aItem = a[key]; + const bItem = b[key]; + if (aItem === bItem) { + copy[key] = aItem; + if (array ? i < aSize : hasOwn.call(a, key)) equalItems++; + continue; + } + if (aItem === null || bItem === null || typeof aItem !== "object" || typeof bItem !== "object") { + copy[key] = bItem; + continue; + } + const v = replaceEqualDeep(aItem, bItem, depth + 1); + copy[key] = v; + if (v === aItem) equalItems++; + } + return aSize === bSize && equalItems === aSize ? a : copy; +} +function shallowEqualObjects(a, b) { + if (!b || Object.keys(a).length !== Object.keys(b).length) { + return false; + } + for (const key in a) { + if (a[key] !== b[key]) { + return false; + } + } + return true; +} +function isPlainArray(value) { + return Array.isArray(value) && value.length === Object.keys(value).length; +} +function isPlainObject(o) { + if (!hasObjectPrototype(o)) { + return false; + } + const ctor = o.constructor; + if (ctor === void 0) { + return true; + } + const prot = ctor.prototype; + if (!hasObjectPrototype(prot)) { + return false; + } + if (!prot.hasOwnProperty("isPrototypeOf")) { + return false; + } + if (Object.getPrototypeOf(o) !== Object.prototype) { + return false; + } + return true; +} +function hasObjectPrototype(o) { + return Object.prototype.toString.call(o) === "[object Object]"; +} +function sleep(timeout) { + return new Promise((resolve) => { + timeoutManager.setTimeout(resolve, timeout); + }); +} +function replaceData(prevData, data, options) { + if (typeof options.structuralSharing === "function") { + return options.structuralSharing(prevData, data); + } else if (options.structuralSharing !== false) { + if (process.env.NODE_ENV !== "production") { + try { + return replaceEqualDeep(prevData, data); + } catch (error) { + console.error( + `Structural sharing requires data to be JSON serializable. To fix this, turn off structuralSharing or return JSON-serializable data from your queryFn. [${options.queryHash}]: ${error}` + ); + throw error; + } + } + return replaceEqualDeep(prevData, data); + } + return data; +} +function keepPreviousData(previousData) { + return previousData; +} +function addToEnd(items, item, max = 0) { + const newItems = [...items, item]; + return max && newItems.length > max ? newItems.slice(1) : newItems; +} +function addToStart(items, item, max = 0) { + const newItems = [item, ...items]; + return max && newItems.length > max ? newItems.slice(0, -1) : newItems; +} +var skipToken = /* @__PURE__ */ Symbol(); +function ensureQueryFn(options, fetchOptions) { + if (process.env.NODE_ENV !== "production") { + if (options.queryFn === skipToken) { + console.error( + `Attempted to invoke queryFn when set to skipToken. This is likely a configuration error. Query hash: '${options.queryHash}'` + ); + } + } + if (!options.queryFn && (fetchOptions == null ? void 0 : fetchOptions.initialPromise)) { + return () => fetchOptions.initialPromise; + } + if (!options.queryFn || options.queryFn === skipToken) { + return () => Promise.reject(new Error(`Missing queryFn: '${options.queryHash}'`)); + } + return options.queryFn; +} +function shouldThrowError(throwOnError, params) { + if (typeof throwOnError === "function") { + return throwOnError(...params); + } + return !!throwOnError; +} +function addConsumeAwareSignal(object, getSignal, onCancelled) { + let consumed = false; + let signal; + Object.defineProperty(object, "signal", { + enumerable: true, + get: () => { + signal ?? (signal = getSignal()); + if (consumed) { + return signal; + } + consumed = true; + if (signal.aborted) { + onCancelled(); + } else { + signal.addEventListener("abort", onCancelled, { once: true }); + } + return signal; + } + }); + return object; +} +export { + addConsumeAwareSignal, + addToEnd, + addToStart, + ensureQueryFn, + functionalUpdate, + hashKey, + hashQueryKeyByOptions, + isPlainArray, + isPlainObject, + isServer, + isValidTimeout, + keepPreviousData, + matchMutation, + matchQuery, + noop, + partialMatchKey, + replaceData, + replaceEqualDeep, + resolveEnabled, + resolveStaleTime, + shallowEqualObjects, + shouldThrowError, + skipToken, + sleep, + timeUntilStale +}; +//# sourceMappingURL=utils.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/utils.js.map b/node_modules/@tanstack/query-core/build/legacy/utils.js.map new file mode 100644 index 0000000..95c6207 --- /dev/null +++ b/node_modules/@tanstack/query-core/build/legacy/utils.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/utils.ts"],"sourcesContent":["import { timeoutManager } from './timeoutManager'\nimport type {\n DefaultError,\n Enabled,\n FetchStatus,\n MutationKey,\n MutationStatus,\n QueryFunction,\n QueryKey,\n QueryOptions,\n StaleTime,\n StaleTimeFunction,\n} from './types'\nimport type { Mutation } from './mutation'\nimport type { FetchOptions, Query } from './query'\n\n// TYPES\n\ntype DropLast> = T extends readonly [\n ...infer R,\n unknown,\n]\n ? readonly [...R]\n : never\n\ntype TuplePrefixes> = T extends readonly []\n ? readonly []\n : TuplePrefixes> | T\n\nexport interface QueryFilters {\n /**\n * Filter to active queries, inactive queries or all queries\n */\n type?: QueryTypeFilter\n /**\n * Match query key exactly\n */\n exact?: boolean\n /**\n * Include queries matching this predicate function\n */\n predicate?: (query: Query) => boolean\n /**\n * Include queries matching this query key\n */\n queryKey?: TQueryKey | TuplePrefixes\n /**\n * Include or exclude stale queries\n */\n stale?: boolean\n /**\n * Include queries matching their fetchStatus\n */\n fetchStatus?: FetchStatus\n}\n\nexport interface MutationFilters<\n TData = unknown,\n TError = DefaultError,\n TVariables = unknown,\n TOnMutateResult = unknown,\n> {\n /**\n * Match mutation key exactly\n */\n exact?: boolean\n /**\n * Include mutations matching this predicate function\n */\n predicate?: (\n mutation: Mutation,\n ) => boolean\n /**\n * Include mutations matching this mutation key\n */\n mutationKey?: TuplePrefixes\n /**\n * Filter by mutation status\n */\n status?: MutationStatus\n}\n\nexport type Updater = TOutput | ((input: TInput) => TOutput)\n\nexport type QueryTypeFilter = 'all' | 'active' | 'inactive'\n\n// UTILS\n\nexport const isServer = typeof window === 'undefined' || 'Deno' in globalThis\n\nexport function noop(): void\nexport function noop(): undefined\nexport function noop() {}\n\nexport function functionalUpdate(\n updater: Updater,\n input: TInput,\n): TOutput {\n return typeof updater === 'function'\n ? (updater as (_: TInput) => TOutput)(input)\n : updater\n}\n\nexport function isValidTimeout(value: unknown): value is number {\n return typeof value === 'number' && value >= 0 && value !== Infinity\n}\n\nexport function timeUntilStale(updatedAt: number, staleTime?: number): number {\n return Math.max(updatedAt + (staleTime || 0) - Date.now(), 0)\n}\n\nexport function resolveStaleTime<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n staleTime:\n | undefined\n | StaleTimeFunction,\n query: Query,\n): StaleTime | undefined {\n return typeof staleTime === 'function' ? staleTime(query) : staleTime\n}\n\nexport function resolveEnabled<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n enabled: undefined | Enabled,\n query: Query,\n): boolean | undefined {\n return typeof enabled === 'function' ? enabled(query) : enabled\n}\n\nexport function matchQuery(\n filters: QueryFilters,\n query: Query,\n): boolean {\n const {\n type = 'all',\n exact,\n fetchStatus,\n predicate,\n queryKey,\n stale,\n } = filters\n\n if (queryKey) {\n if (exact) {\n if (query.queryHash !== hashQueryKeyByOptions(queryKey, query.options)) {\n return false\n }\n } else if (!partialMatchKey(query.queryKey, queryKey)) {\n return false\n }\n }\n\n if (type !== 'all') {\n const isActive = query.isActive()\n if (type === 'active' && !isActive) {\n return false\n }\n if (type === 'inactive' && isActive) {\n return false\n }\n }\n\n if (typeof stale === 'boolean' && query.isStale() !== stale) {\n return false\n }\n\n if (fetchStatus && fetchStatus !== query.state.fetchStatus) {\n return false\n }\n\n if (predicate && !predicate(query)) {\n return false\n }\n\n return true\n}\n\nexport function matchMutation(\n filters: MutationFilters,\n mutation: Mutation,\n): boolean {\n const { exact, status, predicate, mutationKey } = filters\n if (mutationKey) {\n if (!mutation.options.mutationKey) {\n return false\n }\n if (exact) {\n if (hashKey(mutation.options.mutationKey) !== hashKey(mutationKey)) {\n return false\n }\n } else if (!partialMatchKey(mutation.options.mutationKey, mutationKey)) {\n return false\n }\n }\n\n if (status && mutation.state.status !== status) {\n return false\n }\n\n if (predicate && !predicate(mutation)) {\n return false\n }\n\n return true\n}\n\nexport function hashQueryKeyByOptions(\n queryKey: TQueryKey,\n options?: Pick, 'queryKeyHashFn'>,\n): string {\n const hashFn = options?.queryKeyHashFn || hashKey\n return hashFn(queryKey)\n}\n\n/**\n * Default query & mutation keys hash function.\n * Hashes the value into a stable hash.\n */\nexport function hashKey(queryKey: QueryKey | MutationKey): string {\n return JSON.stringify(queryKey, (_, val) =>\n isPlainObject(val)\n ? Object.keys(val)\n .sort()\n .reduce((result, key) => {\n result[key] = val[key]\n return result\n }, {} as any)\n : val,\n )\n}\n\n/**\n * Checks if key `b` partially matches with key `a`.\n */\nexport function partialMatchKey(a: QueryKey, b: QueryKey): boolean\nexport function partialMatchKey(a: any, b: any): boolean {\n if (a === b) {\n return true\n }\n\n if (typeof a !== typeof b) {\n return false\n }\n\n if (a && b && typeof a === 'object' && typeof b === 'object') {\n return Object.keys(b).every((key) => partialMatchKey(a[key], b[key]))\n }\n\n return false\n}\n\nconst hasOwn = Object.prototype.hasOwnProperty\n\n/**\n * This function returns `a` if `b` is deeply equal.\n * If not, it will replace any deeply equal children of `b` with those of `a`.\n * This can be used for structural sharing between JSON values for example.\n */\nexport function replaceEqualDeep(a: unknown, b: T, depth?: number): T\nexport function replaceEqualDeep(a: any, b: any, depth = 0): any {\n if (a === b) {\n return a\n }\n\n if (depth > 500) return b\n\n const array = isPlainArray(a) && isPlainArray(b)\n\n if (!array && !(isPlainObject(a) && isPlainObject(b))) return b\n\n const aItems = array ? a : Object.keys(a)\n const aSize = aItems.length\n const bItems = array ? b : Object.keys(b)\n const bSize = bItems.length\n const copy: any = array ? new Array(bSize) : {}\n\n let equalItems = 0\n\n for (let i = 0; i < bSize; i++) {\n const key: any = array ? i : bItems[i]\n const aItem = a[key]\n const bItem = b[key]\n\n if (aItem === bItem) {\n copy[key] = aItem\n if (array ? i < aSize : hasOwn.call(a, key)) equalItems++\n continue\n }\n\n if (\n aItem === null ||\n bItem === null ||\n typeof aItem !== 'object' ||\n typeof bItem !== 'object'\n ) {\n copy[key] = bItem\n continue\n }\n\n const v = replaceEqualDeep(aItem, bItem, depth + 1)\n copy[key] = v\n if (v === aItem) equalItems++\n }\n\n return aSize === bSize && equalItems === aSize ? a : copy\n}\n\n/**\n * Shallow compare objects.\n */\nexport function shallowEqualObjects>(\n a: T,\n b: T | undefined,\n): boolean {\n if (!b || Object.keys(a).length !== Object.keys(b).length) {\n return false\n }\n\n for (const key in a) {\n if (a[key] !== b[key]) {\n return false\n }\n }\n\n return true\n}\n\nexport function isPlainArray(value: unknown): value is Array {\n return Array.isArray(value) && value.length === Object.keys(value).length\n}\n\n// Copied from: https://github.com/jonschlinkert/is-plain-object\nexport function isPlainObject(o: any): o is Record {\n if (!hasObjectPrototype(o)) {\n return false\n }\n\n // If has no constructor\n const ctor = o.constructor\n if (ctor === undefined) {\n return true\n }\n\n // If has modified prototype\n const prot = ctor.prototype\n if (!hasObjectPrototype(prot)) {\n return false\n }\n\n // If constructor does not have an Object-specific method\n if (!prot.hasOwnProperty('isPrototypeOf')) {\n return false\n }\n\n // Handles Objects created by Object.create()\n if (Object.getPrototypeOf(o) !== Object.prototype) {\n return false\n }\n\n // Most likely a plain Object\n return true\n}\n\nfunction hasObjectPrototype(o: any): boolean {\n return Object.prototype.toString.call(o) === '[object Object]'\n}\n\nexport function sleep(timeout: number): Promise {\n return new Promise((resolve) => {\n timeoutManager.setTimeout(resolve, timeout)\n })\n}\n\nexport function replaceData<\n TData,\n TOptions extends QueryOptions,\n>(prevData: TData | undefined, data: TData, options: TOptions): TData {\n if (typeof options.structuralSharing === 'function') {\n return options.structuralSharing(prevData, data) as TData\n } else if (options.structuralSharing !== false) {\n if (process.env.NODE_ENV !== 'production') {\n try {\n return replaceEqualDeep(prevData, data)\n } catch (error) {\n console.error(\n `Structural sharing requires data to be JSON serializable. To fix this, turn off structuralSharing or return JSON-serializable data from your queryFn. [${options.queryHash}]: ${error}`,\n )\n\n // Prevent the replaceEqualDeep from being called again down below.\n throw error\n }\n }\n // Structurally share data between prev and new data if needed\n return replaceEqualDeep(prevData, data)\n }\n return data\n}\n\nexport function keepPreviousData(\n previousData: T | undefined,\n): T | undefined {\n return previousData\n}\n\nexport function addToEnd(items: Array, item: T, max = 0): Array {\n const newItems = [...items, item]\n return max && newItems.length > max ? newItems.slice(1) : newItems\n}\n\nexport function addToStart(items: Array, item: T, max = 0): Array {\n const newItems = [item, ...items]\n return max && newItems.length > max ? newItems.slice(0, -1) : newItems\n}\n\nexport const skipToken = Symbol()\nexport type SkipToken = typeof skipToken\n\nexport function ensureQueryFn<\n TQueryFnData = unknown,\n TQueryKey extends QueryKey = QueryKey,\n>(\n options: {\n queryFn?: QueryFunction | SkipToken\n queryHash?: string\n },\n fetchOptions?: FetchOptions,\n): QueryFunction {\n if (process.env.NODE_ENV !== 'production') {\n if (options.queryFn === skipToken) {\n console.error(\n `Attempted to invoke queryFn when set to skipToken. This is likely a configuration error. Query hash: '${options.queryHash}'`,\n )\n }\n }\n\n // if we attempt to retry a fetch that was triggered from an initialPromise\n // when we don't have a queryFn yet, we can't retry, so we just return the already rejected initialPromise\n // if an observer has already mounted, we will be able to retry with that queryFn\n if (!options.queryFn && fetchOptions?.initialPromise) {\n return () => fetchOptions.initialPromise!\n }\n\n if (!options.queryFn || options.queryFn === skipToken) {\n return () =>\n Promise.reject(new Error(`Missing queryFn: '${options.queryHash}'`))\n }\n\n return options.queryFn\n}\n\nexport function shouldThrowError) => boolean>(\n throwOnError: boolean | T | undefined,\n params: Parameters,\n): boolean {\n // Allow throwOnError function to override throwing behavior on a per-error basis\n if (typeof throwOnError === 'function') {\n return throwOnError(...params)\n }\n\n return !!throwOnError\n}\n\nexport function addConsumeAwareSignal(\n object: T,\n getSignal: () => AbortSignal,\n onCancelled: VoidFunction,\n): T & { signal: AbortSignal } {\n let consumed = false\n let signal: AbortSignal | undefined\n\n Object.defineProperty(object, 'signal', {\n enumerable: true,\n get: () => {\n signal ??= getSignal()\n if (consumed) {\n return signal\n }\n\n consumed = true\n if (signal.aborted) {\n onCancelled()\n } else {\n signal.addEventListener('abort', onCancelled, { once: true })\n }\n\n return signal\n },\n })\n\n return object as T & { signal: AbortSignal }\n}\n"],"mappings":";;;AAAA,SAAS,sBAAsB;AAwFxB,IAAM,WAAW,OAAO,WAAW,eAAe,UAAU;AAI5D,SAAS,OAAO;AAAC;AAEjB,SAAS,iBACd,SACA,OACS;AACT,SAAO,OAAO,YAAY,aACrB,QAAmC,KAAK,IACzC;AACN;AAEO,SAAS,eAAe,OAAiC;AAC9D,SAAO,OAAO,UAAU,YAAY,SAAS,KAAK,UAAU;AAC9D;AAEO,SAAS,eAAe,WAAmB,WAA4B;AAC5E,SAAO,KAAK,IAAI,aAAa,aAAa,KAAK,KAAK,IAAI,GAAG,CAAC;AAC9D;AAEO,SAAS,iBAMd,WAGA,OACuB;AACvB,SAAO,OAAO,cAAc,aAAa,UAAU,KAAK,IAAI;AAC9D;AAEO,SAAS,eAMd,SACA,OACqB;AACrB,SAAO,OAAO,YAAY,aAAa,QAAQ,KAAK,IAAI;AAC1D;AAEO,SAAS,WACd,SACA,OACS;AACT,QAAM;AAAA,IACJ,OAAO;AAAA,IACP;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI;AAEJ,MAAI,UAAU;AACZ,QAAI,OAAO;AACT,UAAI,MAAM,cAAc,sBAAsB,UAAU,MAAM,OAAO,GAAG;AACtE,eAAO;AAAA,MACT;AAAA,IACF,WAAW,CAAC,gBAAgB,MAAM,UAAU,QAAQ,GAAG;AACrD,aAAO;AAAA,IACT;AAAA,EACF;AAEA,MAAI,SAAS,OAAO;AAClB,UAAM,WAAW,MAAM,SAAS;AAChC,QAAI,SAAS,YAAY,CAAC,UAAU;AAClC,aAAO;AAAA,IACT;AACA,QAAI,SAAS,cAAc,UAAU;AACnC,aAAO;AAAA,IACT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;AAAA,IACZ,KAAK,MAAM;AACT,0BAAW,UAAU;AACrB,UAAI,UAAU;AACZ,eAAO;AAAA,MACT;AAEA,iBAAW;AACX,UAAI,OAAO,SAAS;AAClB,oBAAY;AAAA,MACd,OAAO;AACL,eAAO,iBAAiB,SAAS,aAAa,EAAE,MAAM,KAAK,CAAC;AAAA,MAC9D;AAEA,aAAO;AAAA,IACT;AAAA,EACF,CAAC;AAED,SAAO;AACT;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/focusManager.cjs b/node_modules/@tanstack/query-core/build/modern/focusManager.cjs new file mode 100644 index 0000000..7e872d0 --- /dev/null +++ b/node_modules/@tanstack/query-core/build/modern/focusManager.cjs @@ -0,0 +1,94 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/focusManager.ts +var focusManager_exports = {}; +__export(focusManager_exports, { + FocusManager: () => FocusManager, + focusManager: () => focusManager +}); +module.exports = __toCommonJS(focusManager_exports); +var import_subscribable = require("./subscribable.cjs"); +var import_utils = require("./utils.cjs"); +var FocusManager = class extends import_subscribable.Subscribable { + #focused; + #cleanup; + #setup; + constructor() { + super(); + this.#setup = (onFocus) => { + if (!import_utils.isServer && window.addEventListener) { + const listener = () => onFocus(); + window.addEventListener("visibilitychange", listener, false); + return () => { + window.removeEventListener("visibilitychange", listener); + }; + } + return; + }; + } + onSubscribe() { + if (!this.#cleanup) { + this.setEventListener(this.#setup); + } + } + onUnsubscribe() { + if (!this.hasListeners()) { + this.#cleanup?.(); + this.#cleanup = void 0; + } + } + setEventListener(setup) { + this.#setup = setup; + this.#cleanup?.(); + this.#cleanup = setup((focused) => { + if (typeof focused === "boolean") { + this.setFocused(focused); + } else { + this.onFocus(); + } + }); + } + setFocused(focused) { + const changed = this.#focused !== focused; + if (changed) { + this.#focused = focused; + this.onFocus(); + } + } + onFocus() { + const isFocused = this.isFocused(); + this.listeners.forEach((listener) => { + listener(isFocused); + }); + } + isFocused() { + if (typeof this.#focused === "boolean") { + return this.#focused; + } + return globalThis.document?.visibilityState !== "hidden"; + } +}; +var focusManager = new FocusManager(); +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + FocusManager, + focusManager +}); +//# sourceMappingURL=focusManager.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/focusManager.cjs.map b/node_modules/@tanstack/query-core/build/modern/focusManager.cjs.map new file mode 100644 index 0000000..515417b --- /dev/null +++ b/node_modules/@tanstack/query-core/build/modern/focusManager.cjs.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/focusManager.ts"],"sourcesContent":["import { Subscribable } from './subscribable'\nimport { isServer } from './utils'\n\ntype Listener = (focused: boolean) => void\n\ntype SetupFn = (\n setFocused: (focused?: boolean) => void,\n) => (() => void) | undefined\n\nexport class FocusManager extends Subscribable {\n #focused?: boolean\n #cleanup?: () => void\n\n #setup: SetupFn\n\n constructor() {\n super()\n this.#setup = (onFocus) => {\n // addEventListener does not exist in React Native, but window does\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n if (!isServer && window.addEventListener) {\n const listener = () => onFocus()\n // Listen to visibilitychange\n window.addEventListener('visibilitychange', listener, false)\n\n return () => {\n // Be sure to unsubscribe if a new handler is set\n window.removeEventListener('visibilitychange', listener)\n }\n }\n return\n }\n }\n\n protected onSubscribe(): void {\n if (!this.#cleanup) {\n this.setEventListener(this.#setup)\n }\n }\n\n protected onUnsubscribe() {\n if (!this.hasListeners()) {\n this.#cleanup?.()\n this.#cleanup = undefined\n }\n }\n\n setEventListener(setup: SetupFn): void {\n this.#setup = setup\n this.#cleanup?.()\n this.#cleanup = setup((focused) => {\n if (typeof focused === 'boolean') {\n this.setFocused(focused)\n } else {\n this.onFocus()\n }\n })\n }\n\n setFocused(focused?: boolean): void {\n const changed = this.#focused !== focused\n if (changed) {\n this.#focused = focused\n this.onFocus()\n }\n }\n\n onFocus(): void {\n const isFocused = this.isFocused()\n this.listeners.forEach((listener) => {\n listener(isFocused)\n })\n }\n\n isFocused(): boolean {\n if (typeof this.#focused === 'boolean') {\n return this.#focused\n }\n\n // document global can be unavailable in react native\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n return globalThis.document?.visibilityState !== 'hidden'\n }\n}\n\nexport const focusManager = new FocusManager()\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,0BAA6B;AAC7B,mBAAyB;AAQlB,IAAM,eAAN,cAA2B,iCAAuB;AAAA,EACvD;AAAA,EACA;AAAA,EAEA;AAAA,EAEA,cAAc;AACZ,UAAM;AACN,SAAK,SAAS,CAAC,YAAY;AAGzB,UAAI,CAAC,yBAAY,OAAO,kBAAkB;AACxC,cAAM,WAAW,MAAM,QAAQ;AAE/B,eAAO,iBAAiB,oBAAoB,UAAU,KAAK;AAE3D,eAAO,MAAM;AAEX,iBAAO,oBAAoB,oBAAoB,QAAQ;AAAA,QACzD;AAAA,MACF;AACA;AAAA,IACF;AAAA,EACF;AAAA,EAEU,cAAoB;AAC5B,QAAI,CAAC,KAAK,UAAU;AAClB,WAAK,iBAAiB,KAAK,MAAM;AAAA,IACnC;AAAA,EACF;AAAA,EAEU,gBAAgB;AACxB,QAAI,CAAC,KAAK,aAAa,GAAG;AACxB,WAAK,WAAW;AAChB,WAAK,WAAW;AAAA,IAClB;AAAA,EACF;AAAA,EAEA,iBAAiB,OAAsB;AACrC,SAAK,SAAS;AACd,SAAK,WAAW;AAChB,SAAK,WAAW,MAAM,CAAC,YAAY;AACjC,UAAI,OAAO,YAAY,WAAW;AAChC,aAAK,WAAW,OAAO;AAAA,MACzB,OAAO;AACL,aAAK,QAAQ;AAAA,MACf;AAAA,IACF,CAAC;AAAA,EACH;AAAA,EAEA,WAAW,SAAyB;AAClC,UAAM,UAAU,KAAK,aAAa;AAClC,QAAI,SAAS;AACX,WAAK,WAAW;AAChB,WAAK,QAAQ;AAAA,IACf;AAAA,EACF;AAAA,EAEA,UAAgB;AACd,UAAM,YAAY,KAAK,UAAU;AACjC,SAAK,UAAU,QAAQ,CAAC,aAAa;AACnC,eAAS,SAAS;AAAA,IACpB,CAAC;AAAA,EACH;AAAA,EAEA,YAAqB;AACnB,QAAI,OAAO,KAAK,aAAa,WAAW;AACtC,aAAO,KAAK;AAAA,IACd;AAIA,WAAO,WAAW,UAAU,oBAAoB;AAAA,EAClD;AACF;AAEO,IAAM,eAAe,IAAI,aAAa;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/focusManager.d.cts b/node_modules/@tanstack/query-core/build/modern/focusManager.d.cts new file mode 100644 index 0000000..c0f57ac --- /dev/null +++ b/node_modules/@tanstack/query-core/build/modern/focusManager.d.cts @@ -0,0 +1,17 @@ +import { Subscribable } from './subscribable.cjs'; + +type Listener = (focused: boolean) => void; +type SetupFn = (setFocused: (focused?: boolean) => void) => (() => void) | undefined; +declare class FocusManager extends Subscribable { + #private; + constructor(); + protected onSubscribe(): void; + protected onUnsubscribe(): void; + setEventListener(setup: SetupFn): void; + setFocused(focused?: boolean): void; + onFocus(): void; + isFocused(): boolean; +} +declare const focusManager: FocusManager; + +export { FocusManager, focusManager }; diff --git a/node_modules/@tanstack/query-core/build/modern/focusManager.d.ts b/node_modules/@tanstack/query-core/build/modern/focusManager.d.ts new file mode 100644 index 0000000..da33a8b --- /dev/null +++ b/node_modules/@tanstack/query-core/build/modern/focusManager.d.ts @@ -0,0 +1,17 @@ +import { Subscribable } from './subscribable.js'; + +type Listener = (focused: boolean) => void; +type SetupFn = (setFocused: (focused?: boolean) => void) => (() => void) | undefined; +declare class FocusManager extends Subscribable { + #private; + constructor(); + protected onSubscribe(): void; + protected onUnsubscribe(): void; + setEventListener(setup: SetupFn): void; + setFocused(focused?: boolean): void; + onFocus(): void; + isFocused(): boolean; +} +declare const focusManager: FocusManager; + +export { FocusManager, focusManager }; diff --git a/node_modules/@tanstack/query-core/build/modern/focusManager.js b/node_modules/@tanstack/query-core/build/modern/focusManager.js new file mode 100644 index 0000000..ec16206 --- /dev/null +++ b/node_modules/@tanstack/query-core/build/modern/focusManager.js @@ -0,0 +1,68 @@ +// src/focusManager.ts +import { Subscribable } from "./subscribable.js"; +import { isServer } from "./utils.js"; +var FocusManager = class extends Subscribable { + #focused; + #cleanup; + #setup; + constructor() { + super(); + this.#setup = (onFocus) => { + if (!isServer && window.addEventListener) { + const listener = () => onFocus(); + window.addEventListener("visibilitychange", listener, false); + return () => { + window.removeEventListener("visibilitychange", listener); + }; + } + return; + }; + } + onSubscribe() { + if (!this.#cleanup) { + this.setEventListener(this.#setup); + } + } + onUnsubscribe() { + if (!this.hasListeners()) { + this.#cleanup?.(); + this.#cleanup = void 0; + } + } + setEventListener(setup) { + this.#setup = setup; + this.#cleanup?.(); + this.#cleanup = setup((focused) => { + if (typeof focused === "boolean") { + this.setFocused(focused); + } else { + this.onFocus(); + } + }); + } + setFocused(focused) { + const changed = this.#focused !== focused; + if (changed) { + this.#focused = focused; + this.onFocus(); + } + } + onFocus() { + const isFocused = this.isFocused(); + this.listeners.forEach((listener) => { + listener(isFocused); + }); + } + isFocused() { + if (typeof this.#focused === "boolean") { + return this.#focused; + } + return globalThis.document?.visibilityState !== "hidden"; + } +}; +var focusManager = new FocusManager(); +export { + FocusManager, + focusManager +}; +//# sourceMappingURL=focusManager.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/focusManager.js.map b/node_modules/@tanstack/query-core/build/modern/focusManager.js.map new file mode 100644 index 0000000..028bb44 --- /dev/null +++ b/node_modules/@tanstack/query-core/build/modern/focusManager.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/focusManager.ts"],"sourcesContent":["import { Subscribable } from './subscribable'\nimport { isServer } from './utils'\n\ntype Listener = (focused: boolean) => void\n\ntype SetupFn = (\n setFocused: (focused?: boolean) => void,\n) => (() => void) | undefined\n\nexport class FocusManager extends Subscribable {\n #focused?: boolean\n #cleanup?: () => void\n\n #setup: SetupFn\n\n constructor() {\n super()\n this.#setup = (onFocus) => {\n // addEventListener does not exist in React Native, but window does\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n if (!isServer && window.addEventListener) {\n const listener = () => onFocus()\n // Listen to visibilitychange\n window.addEventListener('visibilitychange', listener, false)\n\n return () => {\n // Be sure to unsubscribe if a new handler is set\n window.removeEventListener('visibilitychange', listener)\n }\n }\n return\n }\n }\n\n protected onSubscribe(): void {\n if (!this.#cleanup) {\n this.setEventListener(this.#setup)\n }\n }\n\n protected onUnsubscribe() {\n if (!this.hasListeners()) {\n this.#cleanup?.()\n this.#cleanup = undefined\n }\n }\n\n setEventListener(setup: SetupFn): void {\n this.#setup = setup\n this.#cleanup?.()\n this.#cleanup = setup((focused) => {\n if (typeof focused === 'boolean') {\n this.setFocused(focused)\n } else {\n this.onFocus()\n }\n })\n }\n\n setFocused(focused?: boolean): void {\n const changed = this.#focused !== focused\n if (changed) {\n this.#focused = focused\n this.onFocus()\n }\n }\n\n onFocus(): void {\n const isFocused = this.isFocused()\n this.listeners.forEach((listener) => {\n listener(isFocused)\n })\n }\n\n isFocused(): boolean {\n if (typeof this.#focused === 'boolean') {\n return this.#focused\n }\n\n // document global can be unavailable in react native\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n return globalThis.document?.visibilityState !== 'hidden'\n }\n}\n\nexport const focusManager = new FocusManager()\n"],"mappings":";AAAA,SAAS,o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,eAAe,IAAI,aAAa;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/hydration-BlEVG2Lp.d.ts b/node_modules/@tanstack/query-core/build/modern/hydration-BlEVG2Lp.d.ts new file mode 100644 index 0000000..8d5a8e3 --- /dev/null +++ b/node_modules/@tanstack/query-core/build/modern/hydration-BlEVG2Lp.d.ts @@ -0,0 +1,1384 @@ +import { Removable } from './removable.js'; +import { Subscribable } from './subscribable.js'; + +type QueryObserverListener = (result: QueryObserverResult) => void; +interface ObserverFetchOptions extends FetchOptions { + throwOnError?: boolean; +} +declare class QueryObserver extends Subscribable> { + #private; + options: QueryObserverOptions; + constructor(client: QueryClient, options: QueryObserverOptions); + protected bindMethods(): void; + protected onSubscribe(): void; + protected onUnsubscribe(): void; + shouldFetchOnReconnect(): boolean; + shouldFetchOnWindowFocus(): boolean; + destroy(): void; + setOptions(options: QueryObserverOptions): void; + getOptimisticResult(options: DefaultedQueryObserverOptions): QueryObserverResult; + getCurrentResult(): QueryObserverResult; + trackResult(result: QueryObserverResult, onPropTracked?: (key: keyof QueryObserverResult) => void): QueryObserverResult; + trackProp(key: keyof QueryObserverResult): void; + getCurrentQuery(): Query; + refetch({ ...options }?: RefetchOptions): Promise>; + fetchOptimistic(options: QueryObserverOptions): Promise>; + protected fetch(fetchOptions: ObserverFetchOptions): Promise>; + protected createResult(query: Query, options: QueryObserverOptions): QueryObserverResult; + updateResult(): void; + onQueryUpdate(): void; +} + +interface QueryConfig { + client: QueryClient; + queryKey: TQueryKey; + queryHash: string; + options?: QueryOptions; + defaultOptions?: QueryOptions; + state?: QueryState; +} +interface QueryState { + data: TData | undefined; + dataUpdateCount: number; + dataUpdatedAt: number; + error: TError | null; + errorUpdateCount: number; + errorUpdatedAt: number; + fetchFailureCount: number; + fetchFailureReason: TError | null; + fetchMeta: FetchMeta | null; + isInvalidated: boolean; + status: QueryStatus; + fetchStatus: FetchStatus; +} +interface FetchContext { + fetchFn: () => unknown | Promise; + fetchOptions?: FetchOptions; + signal: AbortSignal; + options: QueryOptions; + client: QueryClient; + queryKey: TQueryKey; + state: QueryState; +} +interface QueryBehavior { + onFetch: (context: FetchContext, query: Query) => void; +} +type FetchDirection = 'forward' | 'backward'; +interface FetchMeta { + fetchMore?: { + direction: FetchDirection; + }; +} +interface FetchOptions { + cancelRefetch?: boolean; + meta?: FetchMeta; + initialPromise?: Promise; +} +interface FailedAction$1 { + type: 'failed'; + failureCount: number; + error: TError; +} +interface FetchAction { + type: 'fetch'; + meta?: FetchMeta; +} +interface SuccessAction$1 { + data: TData | undefined; + type: 'success'; + dataUpdatedAt?: number; + manual?: boolean; +} +interface ErrorAction$1 { + type: 'error'; + error: TError; +} +interface InvalidateAction { + type: 'invalidate'; +} +interface PauseAction$1 { + type: 'pause'; +} +interface ContinueAction$1 { + type: 'continue'; +} +interface SetStateAction { + type: 'setState'; + state: Partial>; + setStateOptions?: SetStateOptions; +} +type Action$1 = ContinueAction$1 | ErrorAction$1 | FailedAction$1 | FetchAction | InvalidateAction | PauseAction$1 | SetStateAction | SuccessAction$1; +interface SetStateOptions { + meta?: any; +} +declare class Query extends Removable { + #private; + queryKey: TQueryKey; + queryHash: string; + options: QueryOptions; + state: QueryState; + observers: Array>; + constructor(config: QueryConfig); + get meta(): QueryMeta | undefined; + get promise(): Promise | undefined; + setOptions(options?: QueryOptions): void; + protected optionalRemove(): void; + setData(newData: TData, options?: SetDataOptions & { + manual: boolean; + }): TData; + setState(state: Partial>, setStateOptions?: SetStateOptions): void; + cancel(options?: CancelOptions): Promise; + destroy(): void; + reset(): void; + isActive(): boolean; + isDisabled(): boolean; + isStatic(): boolean; + isStale(): boolean; + isStaleByTime(staleTime?: StaleTime): boolean; + onFocus(): void; + onOnline(): void; + addObserver(observer: QueryObserver): void; + removeObserver(observer: QueryObserver): void; + getObserversCount(): number; + invalidate(): void; + fetch(options?: QueryOptions, fetchOptions?: FetchOptions): Promise; +} +declare function fetchState(data: TData | undefined, options: QueryOptions): { + readonly error?: null | undefined; + readonly status?: "pending" | undefined; + readonly fetchFailureCount: 0; + readonly fetchFailureReason: null; + readonly fetchStatus: "fetching" | "paused"; +}; + +type MutationObserverListener = (result: MutationObserverResult) => void; +declare class MutationObserver extends Subscribable> { + #private; + options: MutationObserverOptions; + constructor(client: QueryClient, options: MutationObserverOptions); + protected bindMethods(): void; + setOptions(options: MutationObserverOptions): void; + protected onUnsubscribe(): void; + onMutationUpdate(action: Action): void; + getCurrentResult(): MutationObserverResult; + reset(): void; + mutate(variables: TVariables, options?: MutateOptions): Promise; +} + +interface MutationCacheConfig { + onError?: (error: DefaultError, variables: unknown, onMutateResult: unknown, mutation: Mutation, context: MutationFunctionContext) => Promise | unknown; + onSuccess?: (data: unknown, variables: unknown, onMutateResult: unknown, mutation: Mutation, context: MutationFunctionContext) => Promise | unknown; + onMutate?: (variables: unknown, mutation: Mutation, context: MutationFunctionContext) => Promise | unknown; + onSettled?: (data: unknown | undefined, error: DefaultError | null, variables: unknown, onMutateResult: unknown, mutation: Mutation, context: MutationFunctionContext) => Promise | unknown; +} +interface NotifyEventMutationAdded extends NotifyEvent { + type: 'added'; + mutation: Mutation; +} +interface NotifyEventMutationRemoved extends NotifyEvent { + type: 'removed'; + mutation: Mutation; +} +interface NotifyEventMutationObserverAdded extends NotifyEvent { + type: 'observerAdded'; + mutation: Mutation; + observer: MutationObserver; +} +interface NotifyEventMutationObserverRemoved extends NotifyEvent { + type: 'observerRemoved'; + mutation: Mutation; + observer: MutationObserver; +} +interface NotifyEventMutationObserverOptionsUpdated extends NotifyEvent { + type: 'observerOptionsUpdated'; + mutation?: Mutation; + observer: MutationObserver; +} +interface NotifyEventMutationUpdated extends NotifyEvent { + type: 'updated'; + mutation: Mutation; + action: Action; +} +type MutationCacheNotifyEvent = NotifyEventMutationAdded | NotifyEventMutationRemoved | NotifyEventMutationObserverAdded | NotifyEventMutationObserverRemoved | NotifyEventMutationObserverOptionsUpdated | NotifyEventMutationUpdated; +type MutationCacheListener = (event: MutationCacheNotifyEvent) => void; +declare class MutationCache extends Subscribable { + #private; + config: MutationCacheConfig; + constructor(config?: MutationCacheConfig); + build(client: QueryClient, options: MutationOptions, state?: MutationState): Mutation; + add(mutation: Mutation): void; + remove(mutation: Mutation): void; + canRun(mutation: Mutation): boolean; + runNext(mutation: Mutation): Promise; + clear(): void; + getAll(): Array; + find(filters: MutationFilters): Mutation | undefined; + findAll(filters?: MutationFilters): Array; + notify(event: MutationCacheNotifyEvent): void; + resumePausedMutations(): Promise; +} + +interface MutationConfig { + client: QueryClient; + mutationId: number; + mutationCache: MutationCache; + options: MutationOptions; + state?: MutationState; +} +interface MutationState { + context: TOnMutateResult | undefined; + data: TData | undefined; + error: TError | null; + failureCount: number; + failureReason: TError | null; + isPaused: boolean; + status: MutationStatus; + variables: TVariables | undefined; + submittedAt: number; +} +interface FailedAction { + type: 'failed'; + failureCount: number; + error: TError | null; +} +interface PendingAction { + type: 'pending'; + isPaused: boolean; + variables?: TVariables; + context?: TOnMutateResult; +} +interface SuccessAction { + type: 'success'; + data: TData; +} +interface ErrorAction { + type: 'error'; + error: TError; +} +interface PauseAction { + type: 'pause'; +} +interface ContinueAction { + type: 'continue'; +} +type Action = ContinueAction | ErrorAction | FailedAction | PendingAction | PauseAction | SuccessAction; +declare class Mutation extends Removable { + #private; + state: MutationState; + options: MutationOptions; + readonly mutationId: number; + constructor(config: MutationConfig); + setOptions(options: MutationOptions): void; + get meta(): MutationMeta | undefined; + addObserver(observer: MutationObserver): void; + removeObserver(observer: MutationObserver): void; + protected optionalRemove(): void; + continue(): Promise; + execute(variables: TVariables): Promise; +} +declare function getDefaultState(): MutationState; + +type DropLast> = T extends readonly [ + ...infer R, + unknown +] ? readonly [...R] : never; +type TuplePrefixes> = T extends readonly [] ? readonly [] : TuplePrefixes> | T; +interface QueryFilters { + /** + * Filter to active queries, inactive queries or all queries + */ + type?: QueryTypeFilter; + /** + * Match query key exactly + */ + exact?: boolean; + /** + * Include queries matching this predicate function + */ + predicate?: (query: Query) => boolean; + /** + * Include queries matching this query key + */ + queryKey?: TQueryKey | TuplePrefixes; + /** + * Include or exclude stale queries + */ + stale?: boolean; + /** + * Include queries matching their fetchStatus + */ + fetchStatus?: FetchStatus; +} +interface MutationFilters { + /** + * Match mutation key exactly + */ + exact?: boolean; + /** + * Include mutations matching this predicate function + */ + predicate?: (mutation: Mutation) => boolean; + /** + * Include mutations matching this mutation key + */ + mutationKey?: TuplePrefixes; + /** + * Filter by mutation status + */ + status?: MutationStatus; +} +type Updater = TOutput | ((input: TInput) => TOutput); +type QueryTypeFilter = 'all' | 'active' | 'inactive'; +declare const isServer: boolean; +declare function noop(): void; +declare function noop(): undefined; +declare function functionalUpdate(updater: Updater, input: TInput): TOutput; +declare function isValidTimeout(value: unknown): value is number; +declare function timeUntilStale(updatedAt: number, staleTime?: number): number; +declare function resolveStaleTime(staleTime: undefined | StaleTimeFunction, query: Query): StaleTime | undefined; +declare function resolveEnabled(enabled: undefined | Enabled, query: Query): boolean | undefined; +declare function matchQuery(filters: QueryFilters, query: Query): boolean; +declare function matchMutation(filters: MutationFilters, mutation: Mutation): boolean; +declare function hashQueryKeyByOptions(queryKey: TQueryKey, options?: Pick, 'queryKeyHashFn'>): string; +/** + * Default query & mutation keys hash function. + * Hashes the value into a stable hash. + */ +declare function hashKey(queryKey: QueryKey | MutationKey): string; +/** + * Checks if key `b` partially matches with key `a`. + */ +declare function partialMatchKey(a: QueryKey, b: QueryKey): boolean; +/** + * This function returns `a` if `b` is deeply equal. + * If not, it will replace any deeply equal children of `b` with those of `a`. + * This can be used for structural sharing between JSON values for example. + */ +declare function replaceEqualDeep(a: unknown, b: T, depth?: number): T; +/** + * Shallow compare objects. + */ +declare function shallowEqualObjects>(a: T, b: T | undefined): boolean; +declare function isPlainArray(value: unknown): value is Array; +declare function isPlainObject(o: any): o is Record; +declare function sleep(timeout: number): Promise; +declare function replaceData>(prevData: TData | undefined, data: TData, options: TOptions): TData; +declare function keepPreviousData(previousData: T | undefined): T | undefined; +declare function addToEnd(items: Array, item: T, max?: number): Array; +declare function addToStart(items: Array, item: T, max?: number): Array; +declare const skipToken: unique symbol; +type SkipToken = typeof skipToken; +declare function ensureQueryFn(options: { + queryFn?: QueryFunction | SkipToken; + queryHash?: string; +}, fetchOptions?: FetchOptions): QueryFunction; +declare function shouldThrowError) => boolean>(throwOnError: boolean | T | undefined, params: Parameters): boolean; +declare function addConsumeAwareSignal(object: T, getSignal: () => AbortSignal, onCancelled: VoidFunction): T & { + signal: AbortSignal; +}; + +interface QueryCacheConfig { + onError?: (error: DefaultError, query: Query) => void; + onSuccess?: (data: unknown, query: Query) => void; + onSettled?: (data: unknown | undefined, error: DefaultError | null, query: Query) => void; +} +interface NotifyEventQueryAdded extends NotifyEvent { + type: 'added'; + query: Query; +} +interface NotifyEventQueryRemoved extends NotifyEvent { + type: 'removed'; + query: Query; +} +interface NotifyEventQueryUpdated extends NotifyEvent { + type: 'updated'; + query: Query; + action: Action$1; +} +interface NotifyEventQueryObserverAdded extends NotifyEvent { + type: 'observerAdded'; + query: Query; + observer: QueryObserver; +} +interface NotifyEventQueryObserverRemoved extends NotifyEvent { + type: 'observerRemoved'; + query: Query; + observer: QueryObserver; +} +interface NotifyEventQueryObserverResultsUpdated extends NotifyEvent { + type: 'observerResultsUpdated'; + query: Query; +} +interface NotifyEventQueryObserverOptionsUpdated extends NotifyEvent { + type: 'observerOptionsUpdated'; + query: Query; + observer: QueryObserver; +} +type QueryCacheNotifyEvent = NotifyEventQueryAdded | NotifyEventQueryRemoved | NotifyEventQueryUpdated | NotifyEventQueryObserverAdded | NotifyEventQueryObserverRemoved | NotifyEventQueryObserverResultsUpdated | NotifyEventQueryObserverOptionsUpdated; +type QueryCacheListener = (event: QueryCacheNotifyEvent) => void; +interface QueryStore { + has: (queryHash: string) => boolean; + set: (queryHash: string, query: Query) => void; + get: (queryHash: string) => Query | undefined; + delete: (queryHash: string) => void; + values: () => IterableIterator; +} +declare class QueryCache extends Subscribable { + #private; + config: QueryCacheConfig; + constructor(config?: QueryCacheConfig); + build(client: QueryClient, options: WithRequired, 'queryKey'>, state?: QueryState): Query; + add(query: Query): void; + remove(query: Query): void; + clear(): void; + get(queryHash: string): Query | undefined; + getAll(): Array; + find(filters: WithRequired): Query | undefined; + findAll(filters?: QueryFilters): Array; + notify(event: QueryCacheNotifyEvent): void; + onFocus(): void; + onOnline(): void; +} + +declare class QueryClient { + #private; + constructor(config?: QueryClientConfig); + mount(): void; + unmount(): void; + isFetching = QueryFilters>(filters?: TQueryFilters): number; + isMutating = MutationFilters>(filters?: TMutationFilters): number; + /** + * Imperative (non-reactive) way to retrieve data for a QueryKey. + * Should only be used in callbacks or functions where reading the latest data is necessary, e.g. for optimistic updates. + * + * Hint: Do not use this function inside a component, because it won't receive updates. + * Use `useQuery` to create a `QueryObserver` that subscribes to changes. + */ + getQueryData>(queryKey: TTaggedQueryKey): TInferredQueryFnData | undefined; + ensureQueryData(options: EnsureQueryDataOptions): Promise; + getQueriesData = QueryFilters>(filters: TQueryFilters): Array<[QueryKey, TQueryFnData | undefined]>; + setQueryData>(queryKey: TTaggedQueryKey, updater: Updater | undefined, NoInfer | undefined>, options?: SetDataOptions): NoInfer | undefined; + setQueriesData = QueryFilters>(filters: TQueryFilters, updater: Updater | undefined, NoInfer | undefined>, options?: SetDataOptions): Array<[QueryKey, TQueryFnData | undefined]>; + getQueryState, TInferredError = InferErrorFromTag>(queryKey: TTaggedQueryKey): QueryState | undefined; + removeQueries(filters?: QueryFilters): void; + resetQueries(filters?: QueryFilters, options?: ResetOptions): Promise; + cancelQueries(filters?: QueryFilters, cancelOptions?: CancelOptions): Promise; + invalidateQueries(filters?: InvalidateQueryFilters, options?: InvalidateOptions): Promise; + refetchQueries(filters?: RefetchQueryFilters, options?: RefetchOptions): Promise; + fetchQuery(options: FetchQueryOptions): Promise; + prefetchQuery(options: FetchQueryOptions): Promise; + fetchInfiniteQuery(options: FetchInfiniteQueryOptions): Promise>; + prefetchInfiniteQuery(options: FetchInfiniteQueryOptions): Promise; + ensureInfiniteQueryData(options: EnsureInfiniteQueryDataOptions): Promise>; + resumePausedMutations(): Promise; + getQueryCache(): QueryCache; + getMutationCache(): MutationCache; + getDefaultOptions(): DefaultOptions; + setDefaultOptions(options: DefaultOptions): void; + setQueryDefaults(queryKey: QueryKey, options: Partial, 'queryKey'>>): void; + getQueryDefaults(queryKey: QueryKey): OmitKeyof, 'queryKey'>; + setMutationDefaults(mutationKey: MutationKey, options: OmitKeyof, 'mutationKey'>): void; + getMutationDefaults(mutationKey: MutationKey): OmitKeyof, 'mutationKey'>; + defaultQueryOptions(options: QueryObserverOptions | DefaultedQueryObserverOptions): DefaultedQueryObserverOptions; + defaultMutationOptions>(options?: T): T; + clear(): void; +} + +interface RetryerConfig { + fn: () => TData | Promise; + initialPromise?: Promise; + onCancel?: (error: TError) => void; + onFail?: (failureCount: number, error: TError) => void; + onPause?: () => void; + onContinue?: () => void; + retry?: RetryValue; + retryDelay?: RetryDelayValue; + networkMode: NetworkMode | undefined; + canRun: () => boolean; +} +interface Retryer { + promise: Promise; + cancel: (cancelOptions?: CancelOptions) => void; + continue: () => Promise; + cancelRetry: () => void; + continueRetry: () => void; + canStart: () => boolean; + start: () => Promise; + status: () => 'pending' | 'resolved' | 'rejected'; +} +type RetryValue = boolean | number | ShouldRetryFunction; +type ShouldRetryFunction = (failureCount: number, error: TError) => boolean; +type RetryDelayValue = number | RetryDelayFunction; +type RetryDelayFunction = (failureCount: number, error: TError) => number; +declare function canFetch(networkMode: NetworkMode | undefined): boolean; +declare class CancelledError extends Error { + revert?: boolean; + silent?: boolean; + constructor(options?: CancelOptions); +} +/** + * @deprecated Use instanceof `CancelledError` instead. + */ +declare function isCancelledError(value: any): value is CancelledError; +declare function createRetryer(config: RetryerConfig): Retryer; + +type NonUndefinedGuard = T extends undefined ? never : T; +type DistributiveOmit = TObject extends any ? Omit : never; +type OmitKeyof) | (number & Record) | (symbol & Record) : keyof TObject, TStrictly extends 'strictly' | 'safely' = 'strictly'> = Omit; +type Override = { + [AKey in keyof TTargetA]: AKey extends keyof TTargetB ? TTargetB[AKey] : TTargetA[AKey]; +}; +type NoInfer = [T][T extends any ? 0 : never]; +interface Register { +} +type DefaultError = Register extends { + defaultError: infer TError; +} ? TError : Error; +type QueryKey = Register extends { + queryKey: infer TQueryKey; +} ? TQueryKey extends ReadonlyArray ? TQueryKey : TQueryKey extends Array ? TQueryKey : ReadonlyArray : ReadonlyArray; +declare const dataTagSymbol: unique symbol; +type dataTagSymbol = typeof dataTagSymbol; +declare const dataTagErrorSymbol: unique symbol; +type dataTagErrorSymbol = typeof dataTagErrorSymbol; +declare const unsetMarker: unique symbol; +type UnsetMarker = typeof unsetMarker; +type AnyDataTag = { + [dataTagSymbol]: any; + [dataTagErrorSymbol]: any; +}; +type DataTag = TType extends AnyDataTag ? TType : TType & { + [dataTagSymbol]: TValue; + [dataTagErrorSymbol]: TError; +}; +type InferDataFromTag = TTaggedQueryKey extends DataTag ? TaggedValue : TQueryFnData; +type InferErrorFromTag = TTaggedQueryKey extends DataTag ? TaggedError extends UnsetMarker ? TError : TaggedError : TError; +type QueryFunction = (context: QueryFunctionContext) => T | Promise; +type StaleTime = number | 'static'; +type StaleTimeFunction = StaleTime | ((query: Query) => StaleTime); +type Enabled = boolean | ((query: Query) => boolean); +type QueryPersister = [TPageParam] extends [never] ? (queryFn: QueryFunction, context: QueryFunctionContext, query: Query) => T | Promise : (queryFn: QueryFunction, context: QueryFunctionContext, query: Query) => T | Promise; +type QueryFunctionContext = [TPageParam] extends [never] ? { + client: QueryClient; + queryKey: TQueryKey; + signal: AbortSignal; + meta: QueryMeta | undefined; + pageParam?: unknown; + /** + * @deprecated + * if you want access to the direction, you can add it to the pageParam + */ + direction?: unknown; +} : { + client: QueryClient; + queryKey: TQueryKey; + signal: AbortSignal; + pageParam: TPageParam; + /** + * @deprecated + * if you want access to the direction, you can add it to the pageParam + */ + direction: FetchDirection; + meta: QueryMeta | undefined; +}; +type InitialDataFunction = () => T | undefined; +type NonFunctionGuard = T extends Function ? never : T; +type PlaceholderDataFunction = (previousData: TQueryData | undefined, previousQuery: Query | undefined) => TQueryData | undefined; +type QueriesPlaceholderDataFunction = (previousData: undefined, previousQuery: undefined) => TQueryData | undefined; +type QueryKeyHashFunction = (queryKey: TQueryKey) => string; +type GetPreviousPageParamFunction = (firstPage: TQueryFnData, allPages: Array, firstPageParam: TPageParam, allPageParams: Array) => TPageParam | undefined | null; +type GetNextPageParamFunction = (lastPage: TQueryFnData, allPages: Array, lastPageParam: TPageParam, allPageParams: Array) => TPageParam | undefined | null; +interface InfiniteData { + pages: Array; + pageParams: Array; +} +type QueryMeta = Register extends { + queryMeta: infer TQueryMeta; +} ? TQueryMeta extends Record ? TQueryMeta : Record : Record; +type NetworkMode = 'online' | 'always' | 'offlineFirst'; +type NotifyOnChangeProps = Array | 'all' | undefined | (() => Array | 'all' | undefined); +interface QueryOptions { + /** + * If `false`, failed queries will not retry by default. + * If `true`, failed queries will retry infinitely., failureCount: num + * If set to an integer number, e.g. 3, failed queries will retry until the failed query count meets that number. + * If set to a function `(failureCount, error) => boolean` failed queries will retry until the function returns false. + */ + retry?: RetryValue; + retryDelay?: RetryDelayValue; + networkMode?: NetworkMode; + /** + * The time in milliseconds that unused/inactive cache data remains in memory. + * When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration. + * When different garbage collection times are specified, the longest one will be used. + * Setting it to `Infinity` will disable garbage collection. + */ + gcTime?: number; + queryFn?: QueryFunction | SkipToken; + persister?: QueryPersister, NoInfer, NoInfer>; + queryHash?: string; + queryKey?: TQueryKey; + queryKeyHashFn?: QueryKeyHashFunction; + initialData?: TData | InitialDataFunction; + initialDataUpdatedAt?: number | (() => number | undefined); + behavior?: QueryBehavior; + /** + * Set this to `false` to disable structural sharing between query results. + * Set this to a function which accepts the old and new data and returns resolved data of the same type to implement custom structural sharing logic. + * Defaults to `true`. + */ + structuralSharing?: boolean | ((oldData: unknown | undefined, newData: unknown) => unknown); + _defaulted?: boolean; + /** + * Additional payload to be stored on each query. + * Use this property to pass information that can be used in other places. + */ + meta?: QueryMeta; + /** + * Maximum number of pages to store in the data of an infinite query. + */ + maxPages?: number; +} +interface InitialPageParam { + initialPageParam: TPageParam; +} +interface InfiniteQueryPageParamsOptions extends InitialPageParam { + /** + * This function can be set to automatically get the previous cursor for infinite queries. + * The result will also be used to determine the value of `hasPreviousPage`. + */ + getPreviousPageParam?: GetPreviousPageParamFunction; + /** + * This function can be set to automatically get the next cursor for infinite queries. + * The result will also be used to determine the value of `hasNextPage`. + */ + getNextPageParam: GetNextPageParamFunction; +} +type ThrowOnError = boolean | ((error: TError, query: Query) => boolean); +interface QueryObserverOptions extends WithRequired, 'queryKey'> { + /** + * Set this to `false` or a function that returns `false` to disable automatic refetching when the query mounts or changes query keys. + * To refetch the query, use the `refetch` method returned from the `useQuery` instance. + * Accepts a boolean or function that returns a boolean. + * Defaults to `true`. + */ + enabled?: Enabled; + /** + * The time in milliseconds after data is considered stale. + * If set to `Infinity`, the data will never be considered stale. + * If set to a function, the function will be executed with the query to compute a `staleTime`. + * Defaults to `0`. + */ + staleTime?: StaleTimeFunction; + /** + * If set to a number, the query will continuously refetch at this frequency in milliseconds. + * If set to a function, the function will be executed with the latest data and query to compute a frequency + * Defaults to `false`. + */ + refetchInterval?: number | false | ((query: Query) => number | false | undefined); + /** + * If set to `true`, the query will continue to refetch while their tab/window is in the background. + * Defaults to `false`. + */ + refetchIntervalInBackground?: boolean; + /** + * If set to `true`, the query will refetch on window focus if the data is stale. + * If set to `false`, the query will not refetch on window focus. + * If set to `'always'`, the query will always refetch on window focus. + * If set to a function, the function will be executed with the latest data and query to compute the value. + * Defaults to `true`. + */ + refetchOnWindowFocus?: boolean | 'always' | ((query: Query) => boolean | 'always'); + /** + * If set to `true`, the query will refetch on reconnect if the data is stale. + * If set to `false`, the query will not refetch on reconnect. + * If set to `'always'`, the query will always refetch on reconnect. + * If set to a function, the function will be executed with the latest data and query to compute the value. + * Defaults to the value of `networkOnline` (`true`) + */ + refetchOnReconnect?: boolean | 'always' | ((query: Query) => boolean | 'always'); + /** + * If set to `true`, the query will refetch on mount if the data is stale. + * If set to `false`, will disable additional instances of a query to trigger background refetch. + * If set to `'always'`, the query will always refetch on mount. + * If set to a function, the function will be executed with the latest data and query to compute the value + * Defaults to `true`. + */ + refetchOnMount?: boolean | 'always' | ((query: Query) => boolean | 'always'); + /** + * If set to `false`, the query will not be retried on mount if it contains an error. + * Defaults to `true`. + */ + retryOnMount?: boolean; + /** + * If set, the component will only re-render if any of the listed properties change. + * When set to `['data', 'error']`, the component will only re-render when the `data` or `error` properties change. + * When set to `'all'`, the component will re-render whenever a query is updated. + * When set to a function, the function will be executed to compute the list of properties. + * By default, access to properties will be tracked, and the component will only re-render when one of the tracked properties change. + */ + notifyOnChangeProps?: NotifyOnChangeProps; + /** + * Whether errors should be thrown instead of setting the `error` property. + * If set to `true` or `suspense` is `true`, all errors will be thrown to the error boundary. + * If set to `false` and `suspense` is `false`, errors are returned as state. + * If set to a function, it will be passed the error and the query, and it should return a boolean indicating whether to show the error in an error boundary (`true`) or return the error as state (`false`). + * Defaults to `false`. + */ + throwOnError?: ThrowOnError; + /** + * This option can be used to transform or select a part of the data returned by the query function. + */ + select?: (data: TQueryData) => TData; + /** + * If set to `true`, the query will suspend when `status === 'pending'` + * and throw errors when `status === 'error'`. + * Defaults to `false`. + */ + suspense?: boolean; + /** + * If set, this value will be used as the placeholder data for this particular query observer while the query is still in the `loading` data and no initialData has been provided. + */ + placeholderData?: NonFunctionGuard | PlaceholderDataFunction, TError, NonFunctionGuard, TQueryKey>; + _optimisticResults?: 'optimistic' | 'isRestoring'; + /** + * Enable prefetching during rendering + */ + experimental_prefetchInRender?: boolean; +} +type WithRequired = TTarget & { + [_ in TKey]: {}; +}; +type DefaultedQueryObserverOptions = WithRequired, 'throwOnError' | 'refetchOnReconnect' | 'queryHash'>; +interface InfiniteQueryObserverOptions extends QueryObserverOptions, TQueryKey, TPageParam>, InfiniteQueryPageParamsOptions { +} +type DefaultedInfiniteQueryObserverOptions = WithRequired, 'throwOnError' | 'refetchOnReconnect' | 'queryHash'>; +interface FetchQueryOptions extends WithRequired, 'queryKey'> { + initialPageParam?: never; + /** + * The time in milliseconds after data is considered stale. + * If the data is fresh it will be returned from the cache. + */ + staleTime?: StaleTimeFunction; +} +interface EnsureQueryDataOptions extends FetchQueryOptions { + revalidateIfStale?: boolean; +} +type EnsureInfiniteQueryDataOptions = FetchInfiniteQueryOptions & { + revalidateIfStale?: boolean; +}; +type FetchInfiniteQueryPages = { + pages?: never; +} | { + pages: number; + getNextPageParam: GetNextPageParamFunction; +}; +type FetchInfiniteQueryOptions = Omit, TQueryKey, TPageParam>, 'initialPageParam'> & InitialPageParam & FetchInfiniteQueryPages; +interface ResultOptions { + throwOnError?: boolean; +} +interface RefetchOptions extends ResultOptions { + /** + * If set to `true`, a currently running request will be cancelled before a new request is made + * + * If set to `false`, no refetch will be made if there is already a request running. + * + * Defaults to `true`. + */ + cancelRefetch?: boolean; +} +interface InvalidateQueryFilters extends QueryFilters { + refetchType?: QueryTypeFilter | 'none'; +} +interface RefetchQueryFilters extends QueryFilters { +} +interface InvalidateOptions extends RefetchOptions { +} +interface ResetOptions extends RefetchOptions { +} +interface FetchNextPageOptions extends ResultOptions { + /** + * If set to `true`, calling `fetchNextPage` repeatedly will invoke `queryFn` every time, + * whether the previous invocation has resolved or not. Also, the result from previous invocations will be ignored. + * + * If set to `false`, calling `fetchNextPage` repeatedly won't have any effect until the first invocation has resolved. + * + * Defaults to `true`. + */ + cancelRefetch?: boolean; +} +interface FetchPreviousPageOptions extends ResultOptions { + /** + * If set to `true`, calling `fetchPreviousPage` repeatedly will invoke `queryFn` every time, + * whether the previous invocation has resolved or not. Also, the result from previous invocations will be ignored. + * + * If set to `false`, calling `fetchPreviousPage` repeatedly won't have any effect until the first invocation has resolved. + * + * Defaults to `true`. + */ + cancelRefetch?: boolean; +} +type QueryStatus = 'pending' | 'error' | 'success'; +type FetchStatus = 'fetching' | 'paused' | 'idle'; +interface QueryObserverBaseResult { + /** + * The last successfully resolved data for the query. + */ + data: TData | undefined; + /** + * The timestamp for when the query most recently returned the `status` as `"success"`. + */ + dataUpdatedAt: number; + /** + * The error object for the query, if an error was thrown. + * - Defaults to `null`. + */ + error: TError | null; + /** + * The timestamp for when the query most recently returned the `status` as `"error"`. + */ + errorUpdatedAt: number; + /** + * The failure count for the query. + * - Incremented every time the query fails. + * - Reset to `0` when the query succeeds. + */ + failureCount: number; + /** + * The failure reason for the query retry. + * - Reset to `null` when the query succeeds. + */ + failureReason: TError | null; + /** + * The sum of all errors. + */ + errorUpdateCount: number; + /** + * A derived boolean from the `status` variable, provided for convenience. + * - `true` if the query attempt resulted in an error. + */ + isError: boolean; + /** + * Will be `true` if the query has been fetched. + */ + isFetched: boolean; + /** + * Will be `true` if the query has been fetched after the component mounted. + * - This property can be used to not show any previously cached data. + */ + isFetchedAfterMount: boolean; + /** + * A derived boolean from the `fetchStatus` variable, provided for convenience. + * - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. + */ + isFetching: boolean; + /** + * Is `true` whenever the first fetch for a query is in-flight. + * - Is the same as `isFetching && isPending`. + */ + isLoading: boolean; + /** + * Will be `pending` if there's no cached data and no query attempt was finished yet. + */ + isPending: boolean; + /** + * Will be `true` if the query failed while fetching for the first time. + */ + isLoadingError: boolean; + /** + * @deprecated `isInitialLoading` is being deprecated in favor of `isLoading` + * and will be removed in the next major version. + */ + isInitialLoading: boolean; + /** + * A derived boolean from the `fetchStatus` variable, provided for convenience. + * - The query wanted to fetch, but has been `paused`. + */ + isPaused: boolean; + /** + * Will be `true` if the data shown is the placeholder data. + */ + isPlaceholderData: boolean; + /** + * Will be `true` if the query failed while refetching. + */ + isRefetchError: boolean; + /** + * Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. + * - Is the same as `isFetching && !isPending`. + */ + isRefetching: boolean; + /** + * Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. + */ + isStale: boolean; + /** + * A derived boolean from the `status` variable, provided for convenience. + * - `true` if the query has received a response with no errors and is ready to display its data. + */ + isSuccess: boolean; + /** + * `true` if this observer is enabled, `false` otherwise. + */ + isEnabled: boolean; + /** + * A function to manually refetch the query. + */ + refetch: (options?: RefetchOptions) => Promise>; + /** + * The status of the query. + * - Will be: + * - `pending` if there's no cached data and no query attempt was finished yet. + * - `error` if the query attempt resulted in an error. + * - `success` if the query has received a response with no errors and is ready to display its data. + */ + status: QueryStatus; + /** + * The fetch status of the query. + * - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. + * - `paused`: The query wanted to fetch, but has been `paused`. + * - `idle`: The query is not fetching. + * - See [Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information. + */ + fetchStatus: FetchStatus; + /** + * A stable promise that will be resolved with the data of the query. + * Requires the `experimental_prefetchInRender` feature flag to be enabled. + * @example + * + * ### Enabling the feature flag + * ```ts + * const client = new QueryClient({ + * defaultOptions: { + * queries: { + * experimental_prefetchInRender: true, + * }, + * }, + * }) + * ``` + * + * ### Usage + * ```tsx + * import { useQuery } from '@tanstack/react-query' + * import React from 'react' + * import { fetchTodos, type Todo } from './api' + * + * function TodoList({ query }: { query: UseQueryResult }) { + * const data = React.use(query.promise) + * + * return ( + *
    + * {data.map(todo => ( + *
  • {todo.title}
  • + * ))} + *
+ * ) + * } + * + * export function App() { + * const query = useQuery({ queryKey: ['todos'], queryFn: fetchTodos }) + * + * return ( + * <> + *

Todos

+ * Loading...}> + * + * + * + * ) + * } + * ``` + */ + promise: Promise; +} +interface QueryObserverPendingResult extends QueryObserverBaseResult { + data: undefined; + error: null; + isError: false; + isPending: true; + isLoadingError: false; + isRefetchError: false; + isSuccess: false; + isPlaceholderData: false; + status: 'pending'; +} +interface QueryObserverLoadingResult extends QueryObserverBaseResult { + data: undefined; + error: null; + isError: false; + isPending: true; + isLoading: true; + isLoadingError: false; + isRefetchError: false; + isSuccess: false; + isPlaceholderData: false; + status: 'pending'; +} +interface QueryObserverLoadingErrorResult extends QueryObserverBaseResult { + data: undefined; + error: TError; + isError: true; + isPending: false; + isLoading: false; + isLoadingError: true; + isRefetchError: false; + isSuccess: false; + isPlaceholderData: false; + status: 'error'; +} +interface QueryObserverRefetchErrorResult extends QueryObserverBaseResult { + data: TData; + error: TError; + isError: true; + isPending: false; + isLoading: false; + isLoadingError: false; + isRefetchError: true; + isSuccess: false; + isPlaceholderData: false; + status: 'error'; +} +interface QueryObserverSuccessResult extends QueryObserverBaseResult { + data: TData; + error: null; + isError: false; + isPending: false; + isLoading: false; + isLoadingError: false; + isRefetchError: false; + isSuccess: true; + isPlaceholderData: false; + status: 'success'; +} +interface QueryObserverPlaceholderResult extends QueryObserverBaseResult { + data: TData; + isError: false; + error: null; + isPending: false; + isLoading: false; + isLoadingError: false; + isRefetchError: false; + isSuccess: true; + isPlaceholderData: true; + status: 'success'; +} +type DefinedQueryObserverResult = QueryObserverRefetchErrorResult | QueryObserverSuccessResult; +type QueryObserverResult = DefinedQueryObserverResult | QueryObserverLoadingErrorResult | QueryObserverLoadingResult | QueryObserverPendingResult | QueryObserverPlaceholderResult; +interface InfiniteQueryObserverBaseResult extends QueryObserverBaseResult { + /** + * This function allows you to fetch the next "page" of results. + */ + fetchNextPage: (options?: FetchNextPageOptions) => Promise>; + /** + * This function allows you to fetch the previous "page" of results. + */ + fetchPreviousPage: (options?: FetchPreviousPageOptions) => Promise>; + /** + * Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). + */ + hasNextPage: boolean; + /** + * Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). + */ + hasPreviousPage: boolean; + /** + * Will be `true` if the query failed while fetching the next page. + */ + isFetchNextPageError: boolean; + /** + * Will be `true` while fetching the next page with `fetchNextPage`. + */ + isFetchingNextPage: boolean; + /** + * Will be `true` if the query failed while fetching the previous page. + */ + isFetchPreviousPageError: boolean; + /** + * Will be `true` while fetching the previous page with `fetchPreviousPage`. + */ + isFetchingPreviousPage: boolean; +} +interface InfiniteQueryObserverPendingResult extends InfiniteQueryObserverBaseResult { + data: undefined; + error: null; + isError: false; + isPending: true; + isLoadingError: false; + isRefetchError: false; + isFetchNextPageError: false; + isFetchPreviousPageError: false; + isSuccess: false; + isPlaceholderData: false; + status: 'pending'; +} +interface InfiniteQueryObserverLoadingResult extends InfiniteQueryObserverBaseResult { + data: undefined; + error: null; + isError: false; + isPending: true; + isLoading: true; + isLoadingError: false; + isRefetchError: false; + isFetchNextPageError: false; + isFetchPreviousPageError: false; + isSuccess: false; + isPlaceholderData: false; + status: 'pending'; +} +interface InfiniteQueryObserverLoadingErrorResult extends InfiniteQueryObserverBaseResult { + data: undefined; + error: TError; + isError: true; + isPending: false; + isLoading: false; + isLoadingError: true; + isRefetchError: false; + isFetchNextPageError: false; + isFetchPreviousPageError: false; + isSuccess: false; + isPlaceholderData: false; + status: 'error'; +} +interface InfiniteQueryObserverRefetchErrorResult extends InfiniteQueryObserverBaseResult { + data: TData; + error: TError; + isError: true; + isPending: false; + isLoading: false; + isLoadingError: false; + isRefetchError: true; + isSuccess: false; + isPlaceholderData: false; + status: 'error'; +} +interface InfiniteQueryObserverSuccessResult extends InfiniteQueryObserverBaseResult { + data: TData; + error: null; + isError: false; + isPending: false; + isLoading: false; + isLoadingError: false; + isRefetchError: false; + isFetchNextPageError: false; + isFetchPreviousPageError: false; + isSuccess: true; + isPlaceholderData: false; + status: 'success'; +} +interface InfiniteQueryObserverPlaceholderResult extends InfiniteQueryObserverBaseResult { + data: TData; + isError: false; + error: null; + isPending: false; + isLoading: false; + isLoadingError: false; + isRefetchError: false; + isSuccess: true; + isPlaceholderData: true; + isFetchNextPageError: false; + isFetchPreviousPageError: false; + status: 'success'; +} +type DefinedInfiniteQueryObserverResult = InfiniteQueryObserverRefetchErrorResult | InfiniteQueryObserverSuccessResult; +type InfiniteQueryObserverResult = DefinedInfiniteQueryObserverResult | InfiniteQueryObserverLoadingErrorResult | InfiniteQueryObserverLoadingResult | InfiniteQueryObserverPendingResult | InfiniteQueryObserverPlaceholderResult; +type MutationKey = Register extends { + mutationKey: infer TMutationKey; +} ? TMutationKey extends ReadonlyArray ? TMutationKey : TMutationKey extends Array ? TMutationKey : ReadonlyArray : ReadonlyArray; +type MutationStatus = 'idle' | 'pending' | 'success' | 'error'; +type MutationScope = { + id: string; +}; +type MutationMeta = Register extends { + mutationMeta: infer TMutationMeta; +} ? TMutationMeta extends Record ? TMutationMeta : Record : Record; +type MutationFunctionContext = { + client: QueryClient; + meta: MutationMeta | undefined; + mutationKey?: MutationKey; +}; +type MutationFunction = (variables: TVariables, context: MutationFunctionContext) => Promise; +interface MutationOptions { + mutationFn?: MutationFunction; + mutationKey?: MutationKey; + onMutate?: (variables: TVariables, context: MutationFunctionContext) => Promise | TOnMutateResult; + onSuccess?: (data: TData, variables: TVariables, onMutateResult: TOnMutateResult, context: MutationFunctionContext) => Promise | unknown; + onError?: (error: TError, variables: TVariables, onMutateResult: TOnMutateResult | undefined, context: MutationFunctionContext) => Promise | unknown; + onSettled?: (data: TData | undefined, error: TError | null, variables: TVariables, onMutateResult: TOnMutateResult | undefined, context: MutationFunctionContext) => Promise | unknown; + retry?: RetryValue; + retryDelay?: RetryDelayValue; + networkMode?: NetworkMode; + gcTime?: number; + _defaulted?: boolean; + meta?: MutationMeta; + scope?: MutationScope; +} +interface MutationObserverOptions extends MutationOptions { + throwOnError?: boolean | ((error: TError) => boolean); +} +interface MutateOptions { + onSuccess?: (data: TData, variables: TVariables, onMutateResult: TOnMutateResult | undefined, context: MutationFunctionContext) => void; + onError?: (error: TError, variables: TVariables, onMutateResult: TOnMutateResult | undefined, context: MutationFunctionContext) => void; + onSettled?: (data: TData | undefined, error: TError | null, variables: TVariables, onMutateResult: TOnMutateResult | undefined, context: MutationFunctionContext) => void; +} +type MutateFunction = (variables: TVariables, options?: MutateOptions) => Promise; +interface MutationObserverBaseResult extends MutationState { + /** + * The last successfully resolved data for the mutation. + */ + data: TData | undefined; + /** + * The variables object passed to the `mutationFn`. + */ + variables: TVariables | undefined; + /** + * The error object for the mutation, if an error was encountered. + * - Defaults to `null`. + */ + error: TError | null; + /** + * A boolean variable derived from `status`. + * - `true` if the last mutation attempt resulted in an error. + */ + isError: boolean; + /** + * A boolean variable derived from `status`. + * - `true` if the mutation is in its initial state prior to executing. + */ + isIdle: boolean; + /** + * A boolean variable derived from `status`. + * - `true` if the mutation is currently executing. + */ + isPending: boolean; + /** + * A boolean variable derived from `status`. + * - `true` if the last mutation attempt was successful. + */ + isSuccess: boolean; + /** + * The status of the mutation. + * - Will be: + * - `idle` initial status prior to the mutation function executing. + * - `pending` if the mutation is currently executing. + * - `error` if the last mutation attempt resulted in an error. + * - `success` if the last mutation attempt was successful. + */ + status: MutationStatus; + /** + * The mutation function you can call with variables to trigger the mutation and optionally hooks on additional callback options. + * @param variables - The variables object to pass to the `mutationFn`. + * @param options.onSuccess - This function will fire when the mutation is successful and will be passed the mutation's result. + * @param options.onError - This function will fire if the mutation encounters an error and will be passed the error. + * @param options.onSettled - This function will fire when the mutation is either successfully fetched or encounters an error and be passed either the data or error. + * @remarks + * - If you make multiple requests, `onSuccess` will fire only after the latest call you've made. + * - All the callback functions (`onSuccess`, `onError`, `onSettled`) are void functions, and the returned value will be ignored. + */ + mutate: MutateFunction; + /** + * A function to clean the mutation internal state (i.e., it resets the mutation to its initial state). + */ + reset: () => void; +} +interface MutationObserverIdleResult extends MutationObserverBaseResult { + data: undefined; + variables: undefined; + error: null; + isError: false; + isIdle: true; + isPending: false; + isSuccess: false; + status: 'idle'; +} +interface MutationObserverLoadingResult extends MutationObserverBaseResult { + data: undefined; + variables: TVariables; + error: null; + isError: false; + isIdle: false; + isPending: true; + isSuccess: false; + status: 'pending'; +} +interface MutationObserverErrorResult extends MutationObserverBaseResult { + data: undefined; + error: TError; + variables: TVariables; + isError: true; + isIdle: false; + isPending: false; + isSuccess: false; + status: 'error'; +} +interface MutationObserverSuccessResult extends MutationObserverBaseResult { + data: TData; + error: null; + variables: TVariables; + isError: false; + isIdle: false; + isPending: false; + isSuccess: true; + status: 'success'; +} +type MutationObserverResult = MutationObserverIdleResult | MutationObserverLoadingResult | MutationObserverErrorResult | MutationObserverSuccessResult; +interface QueryClientConfig { + queryCache?: QueryCache; + mutationCache?: MutationCache; + defaultOptions?: DefaultOptions; +} +interface DefaultOptions { + queries?: OmitKeyof, 'suspense' | 'queryKey'>; + mutations?: MutationObserverOptions; + hydrate?: HydrateOptions['defaultOptions']; + dehydrate?: DehydrateOptions; +} +interface CancelOptions { + revert?: boolean; + silent?: boolean; +} +interface SetDataOptions { + updatedAt?: number; +} +type NotifyEventType = 'added' | 'removed' | 'updated' | 'observerAdded' | 'observerRemoved' | 'observerResultsUpdated' | 'observerOptionsUpdated'; +interface NotifyEvent { + type: NotifyEventType; +} + +type TransformerFn = (data: any) => any; +interface DehydrateOptions { + serializeData?: TransformerFn; + shouldDehydrateMutation?: (mutation: Mutation) => boolean; + shouldDehydrateQuery?: (query: Query) => boolean; + shouldRedactErrors?: (error: unknown) => boolean; +} +interface HydrateOptions { + defaultOptions?: { + deserializeData?: TransformerFn; + queries?: QueryOptions; + mutations?: MutationOptions; + }; +} +interface DehydratedMutation { + mutationKey?: MutationKey; + state: MutationState; + meta?: MutationMeta; + scope?: MutationScope; +} +interface DehydratedQuery { + queryHash: string; + queryKey: QueryKey; + state: QueryState; + promise?: Promise; + meta?: QueryMeta; + dehydratedAt?: number; +} +interface DehydratedState { + mutations: Array; + queries: Array; +} +declare function defaultShouldDehydrateMutation(mutation: Mutation): boolean; +declare function defaultShouldDehydrateQuery(query: Query): boolean; +declare function dehydrate(client: QueryClient, options?: DehydrateOptions): DehydratedState; +declare function hydrate(client: QueryClient, dehydratedState: unknown, options?: HydrateOptions): void; + +export { type Enabled as $, type QueryState as A, type DistributiveOmit as B, CancelledError as C, type DehydratedState as D, type Override as E, type NoInfer as F, type DefaultError as G, type HydrateOptions as H, type QueryKey as I, dataTagSymbol as J, dataTagErrorSymbol as K, unsetMarker as L, MutationCache as M, type NonUndefinedGuard as N, type OmitKeyof as O, type UnsetMarker as P, QueryCache as Q, type Register as R, type SkipToken as S, type AnyDataTag as T, type Updater as U, type DataTag as V, type InferDataFromTag as W, type InferErrorFromTag as X, type QueryFunction as Y, type StaleTime as Z, type StaleTimeFunction as _, defaultShouldDehydrateQuery as a, type MutationObserverBaseResult as a$, type QueryPersister as a0, type QueryFunctionContext as a1, type InitialDataFunction as a2, type PlaceholderDataFunction as a3, type QueriesPlaceholderDataFunction as a4, type QueryKeyHashFunction as a5, type GetPreviousPageParamFunction as a6, type GetNextPageParamFunction as a7, type InfiniteData as a8, type QueryMeta as a9, type QueryObserverPendingResult as aA, type QueryObserverLoadingResult as aB, type QueryObserverLoadingErrorResult as aC, type QueryObserverRefetchErrorResult as aD, type QueryObserverSuccessResult as aE, type QueryObserverPlaceholderResult as aF, type DefinedQueryObserverResult as aG, type QueryObserverResult as aH, type InfiniteQueryObserverBaseResult as aI, type InfiniteQueryObserverPendingResult as aJ, type InfiniteQueryObserverLoadingResult as aK, type InfiniteQueryObserverLoadingErrorResult as aL, type InfiniteQueryObserverRefetchErrorResult as aM, type InfiniteQueryObserverSuccessResult as aN, type InfiniteQueryObserverPlaceholderResult as aO, type DefinedInfiniteQueryObserverResult as aP, type InfiniteQueryObserverResult as aQ, type MutationKey as aR, type MutationStatus as aS, type MutationScope as aT, type MutationMeta as aU, type MutationFunctionContext as aV, type MutationFunction as aW, type MutationOptions as aX, type MutationObserverOptions as aY, type MutateOptions as aZ, type MutateFunction as a_, type NetworkMode as aa, type NotifyOnChangeProps as ab, type QueryOptions as ac, type InitialPageParam as ad, type InfiniteQueryPageParamsOptions as ae, type ThrowOnError as af, type QueryObserverOptions as ag, type WithRequired as ah, type DefaultedQueryObserverOptions as ai, type InfiniteQueryObserverOptions as aj, type DefaultedInfiniteQueryObserverOptions as ak, type FetchQueryOptions as al, type EnsureQueryDataOptions as am, type EnsureInfiniteQueryDataOptions as an, type FetchInfiniteQueryOptions as ao, type ResultOptions as ap, type RefetchOptions as aq, type InvalidateQueryFilters as ar, type RefetchQueryFilters as as, type InvalidateOptions as at, type ResetOptions as au, type FetchNextPageOptions as av, type FetchPreviousPageOptions as aw, type QueryStatus as ax, type FetchStatus as ay, type QueryObserverBaseResult as az, dehydrate as b, type MutationObserverIdleResult as b0, type MutationObserverLoadingResult as b1, type MutationObserverErrorResult as b2, type MutationObserverSuccessResult as b3, type MutationObserverResult as b4, type QueryClientConfig as b5, type DefaultOptions as b6, type CancelOptions as b7, type SetDataOptions as b8, type NotifyEventType as b9, addConsumeAwareSignal as bA, type QueryStore as bB, type Retryer as bC, type RetryValue as bD, type RetryDelayValue as bE, canFetch as bF, createRetryer as bG, type NotifyEvent as ba, type QueryBehavior as bb, type FetchContext as bc, type FetchDirection as bd, type FetchMeta as be, type FetchOptions as bf, type Action$1 as bg, type SetStateOptions as bh, fetchState as bi, type Action as bj, getDefaultState as bk, type QueryTypeFilter as bl, functionalUpdate as bm, isValidTimeout as bn, timeUntilStale as bo, resolveStaleTime as bp, resolveEnabled as bq, hashQueryKeyByOptions as br, shallowEqualObjects as bs, isPlainArray as bt, isPlainObject as bu, sleep as bv, replaceData as bw, addToEnd as bx, addToStart as by, ensureQueryFn as bz, type MutationCacheNotifyEvent as c, defaultShouldDehydrateMutation as d, MutationObserver as e, type QueryCacheNotifyEvent as f, QueryClient as g, hydrate as h, QueryObserver as i, isCancelledError as j, hashKey as k, isServer as l, keepPreviousData as m, matchMutation as n, matchQuery as o, noop as p, partialMatchKey as q, replaceEqualDeep as r, shouldThrowError as s, skipToken as t, type MutationFilters as u, type QueryFilters as v, type DehydrateOptions as w, Mutation as x, type MutationState as y, Query as z }; diff --git a/node_modules/@tanstack/query-core/build/modern/hydration-uphG6M-i.d.cts b/node_modules/@tanstack/query-core/build/modern/hydration-uphG6M-i.d.cts new file mode 100644 index 0000000..fdea1ed --- /dev/null +++ b/node_modules/@tanstack/query-core/build/modern/hydration-uphG6M-i.d.cts @@ -0,0 +1,1384 @@ +import { Removable } from './removable.cjs'; +import { Subscribable } from './subscribable.cjs'; + +type QueryObserverListener = (result: QueryObserverResult) => void; +interface ObserverFetchOptions extends FetchOptions { + throwOnError?: boolean; +} +declare class QueryObserver extends Subscribable> { + #private; + options: QueryObserverOptions; + constructor(client: QueryClient, options: QueryObserverOptions); + protected bindMethods(): void; + protected onSubscribe(): void; + protected onUnsubscribe(): void; + shouldFetchOnReconnect(): boolean; + shouldFetchOnWindowFocus(): boolean; + destroy(): void; + setOptions(options: QueryObserverOptions): void; + getOptimisticResult(options: DefaultedQueryObserverOptions): QueryObserverResult; + getCurrentResult(): QueryObserverResult; + trackResult(result: QueryObserverResult, onPropTracked?: (key: keyof QueryObserverResult) => void): QueryObserverResult; + trackProp(key: keyof QueryObserverResult): void; + getCurrentQuery(): Query; + refetch({ ...options }?: RefetchOptions): Promise>; + fetchOptimistic(options: QueryObserverOptions): Promise>; + protected fetch(fetchOptions: ObserverFetchOptions): Promise>; + protected createResult(query: Query, options: QueryObserverOptions): QueryObserverResult; + updateResult(): void; + onQueryUpdate(): void; +} + +interface QueryConfig { + client: QueryClient; + queryKey: TQueryKey; + queryHash: string; + options?: QueryOptions; + defaultOptions?: QueryOptions; + state?: QueryState; +} +interface QueryState { + data: TData | undefined; + dataUpdateCount: number; + dataUpdatedAt: number; + error: TError | null; + errorUpdateCount: number; + errorUpdatedAt: number; + fetchFailureCount: number; + fetchFailureReason: TError | null; + fetchMeta: FetchMeta | null; + isInvalidated: boolean; + status: QueryStatus; + fetchStatus: FetchStatus; +} +interface FetchContext { + fetchFn: () => unknown | Promise; + fetchOptions?: FetchOptions; + signal: AbortSignal; + options: QueryOptions; + client: QueryClient; + queryKey: TQueryKey; + state: QueryState; +} +interface QueryBehavior { + onFetch: (context: FetchContext, query: Query) => void; +} +type FetchDirection = 'forward' | 'backward'; +interface FetchMeta { + fetchMore?: { + direction: FetchDirection; + }; +} +interface FetchOptions { + cancelRefetch?: boolean; + meta?: FetchMeta; + initialPromise?: Promise; +} +interface FailedAction$1 { + type: 'failed'; + failureCount: number; + error: TError; +} +interface FetchAction { + type: 'fetch'; + meta?: FetchMeta; +} +interface SuccessAction$1 { + data: TData | undefined; + type: 'success'; + dataUpdatedAt?: number; + manual?: boolean; +} +interface ErrorAction$1 { + type: 'error'; + error: TError; +} +interface InvalidateAction { + type: 'invalidate'; +} +interface PauseAction$1 { + type: 'pause'; +} +interface ContinueAction$1 { + type: 'continue'; +} +interface SetStateAction { + type: 'setState'; + state: Partial>; + setStateOptions?: SetStateOptions; +} +type Action$1 = ContinueAction$1 | ErrorAction$1 | FailedAction$1 | FetchAction | InvalidateAction | PauseAction$1 | SetStateAction | SuccessAction$1; +interface SetStateOptions { + meta?: any; +} +declare class Query extends Removable { + #private; + queryKey: TQueryKey; + queryHash: string; + options: QueryOptions; + state: QueryState; + observers: Array>; + constructor(config: QueryConfig); + get meta(): QueryMeta | undefined; + get promise(): Promise | undefined; + setOptions(options?: QueryOptions): void; + protected optionalRemove(): void; + setData(newData: TData, options?: SetDataOptions & { + manual: boolean; + }): TData; + setState(state: Partial>, setStateOptions?: SetStateOptions): void; + cancel(options?: CancelOptions): Promise; + destroy(): void; + reset(): void; + isActive(): boolean; + isDisabled(): boolean; + isStatic(): boolean; + isStale(): boolean; + isStaleByTime(staleTime?: StaleTime): boolean; + onFocus(): void; + onOnline(): void; + addObserver(observer: QueryObserver): void; + removeObserver(observer: QueryObserver): void; + getObserversCount(): number; + invalidate(): void; + fetch(options?: QueryOptions, fetchOptions?: FetchOptions): Promise; +} +declare function fetchState(data: TData | undefined, options: QueryOptions): { + readonly error?: null | undefined; + readonly status?: "pending" | undefined; + readonly fetchFailureCount: 0; + readonly fetchFailureReason: null; + readonly fetchStatus: "fetching" | "paused"; +}; + +type MutationObserverListener = (result: MutationObserverResult) => void; +declare class MutationObserver extends Subscribable> { + #private; + options: MutationObserverOptions; + constructor(client: QueryClient, options: MutationObserverOptions); + protected bindMethods(): void; + setOptions(options: MutationObserverOptions): void; + protected onUnsubscribe(): void; + onMutationUpdate(action: Action): void; + getCurrentResult(): MutationObserverResult; + reset(): void; + mutate(variables: TVariables, options?: MutateOptions): Promise; +} + +interface MutationCacheConfig { + onError?: (error: DefaultError, variables: unknown, onMutateResult: unknown, mutation: Mutation, context: MutationFunctionContext) => Promise | unknown; + onSuccess?: (data: unknown, variables: unknown, onMutateResult: unknown, mutation: Mutation, context: MutationFunctionContext) => Promise | unknown; + onMutate?: (variables: unknown, mutation: Mutation, context: MutationFunctionContext) => Promise | unknown; + onSettled?: (data: unknown | undefined, error: DefaultError | null, variables: unknown, onMutateResult: unknown, mutation: Mutation, context: MutationFunctionContext) => Promise | unknown; +} +interface NotifyEventMutationAdded extends NotifyEvent { + type: 'added'; + mutation: Mutation; +} +interface NotifyEventMutationRemoved extends NotifyEvent { + type: 'removed'; + mutation: Mutation; +} +interface NotifyEventMutationObserverAdded extends NotifyEvent { + type: 'observerAdded'; + mutation: Mutation; + observer: MutationObserver; +} +interface NotifyEventMutationObserverRemoved extends NotifyEvent { + type: 'observerRemoved'; + mutation: Mutation; + observer: MutationObserver; +} +interface NotifyEventMutationObserverOptionsUpdated extends NotifyEvent { + type: 'observerOptionsUpdated'; + mutation?: Mutation; + observer: MutationObserver; +} +interface NotifyEventMutationUpdated extends NotifyEvent { + type: 'updated'; + mutation: Mutation; + action: Action; +} +type MutationCacheNotifyEvent = NotifyEventMutationAdded | NotifyEventMutationRemoved | NotifyEventMutationObserverAdded | NotifyEventMutationObserverRemoved | NotifyEventMutationObserverOptionsUpdated | NotifyEventMutationUpdated; +type MutationCacheListener = (event: MutationCacheNotifyEvent) => void; +declare class MutationCache extends Subscribable { + #private; + config: MutationCacheConfig; + constructor(config?: MutationCacheConfig); + build(client: QueryClient, options: MutationOptions, state?: MutationState): Mutation; + add(mutation: Mutation): void; + remove(mutation: Mutation): void; + canRun(mutation: Mutation): boolean; + runNext(mutation: Mutation): Promise; + clear(): void; + getAll(): Array; + find(filters: MutationFilters): Mutation | undefined; + findAll(filters?: MutationFilters): Array; + notify(event: MutationCacheNotifyEvent): void; + resumePausedMutations(): Promise; +} + +interface MutationConfig { + client: QueryClient; + mutationId: number; + mutationCache: MutationCache; + options: MutationOptions; + state?: MutationState; +} +interface MutationState { + context: TOnMutateResult | undefined; + data: TData | undefined; + error: TError | null; + failureCount: number; + failureReason: TError | null; + isPaused: boolean; + status: MutationStatus; + variables: TVariables | undefined; + submittedAt: number; +} +interface FailedAction { + type: 'failed'; + failureCount: number; + error: TError | null; +} +interface PendingAction { + type: 'pending'; + isPaused: boolean; + variables?: TVariables; + context?: TOnMutateResult; +} +interface SuccessAction { + type: 'success'; + data: TData; +} +interface ErrorAction { + type: 'error'; + error: TError; +} +interface PauseAction { + type: 'pause'; +} +interface ContinueAction { + type: 'continue'; +} +type Action = ContinueAction | ErrorAction | FailedAction | PendingAction | PauseAction | SuccessAction; +declare class Mutation extends Removable { + #private; + state: MutationState; + options: MutationOptions; + readonly mutationId: number; + constructor(config: MutationConfig); + setOptions(options: MutationOptions): void; + get meta(): MutationMeta | undefined; + addObserver(observer: MutationObserver): void; + removeObserver(observer: MutationObserver): void; + protected optionalRemove(): void; + continue(): Promise; + execute(variables: TVariables): Promise; +} +declare function getDefaultState(): MutationState; + +type DropLast> = T extends readonly [ + ...infer R, + unknown +] ? readonly [...R] : never; +type TuplePrefixes> = T extends readonly [] ? readonly [] : TuplePrefixes> | T; +interface QueryFilters { + /** + * Filter to active queries, inactive queries or all queries + */ + type?: QueryTypeFilter; + /** + * Match query key exactly + */ + exact?: boolean; + /** + * Include queries matching this predicate function + */ + predicate?: (query: Query) => boolean; + /** + * Include queries matching this query key + */ + queryKey?: TQueryKey | TuplePrefixes; + /** + * Include or exclude stale queries + */ + stale?: boolean; + /** + * Include queries matching their fetchStatus + */ + fetchStatus?: FetchStatus; +} +interface MutationFilters { + /** + * Match mutation key exactly + */ + exact?: boolean; + /** + * Include mutations matching this predicate function + */ + predicate?: (mutation: Mutation) => boolean; + /** + * Include mutations matching this mutation key + */ + mutationKey?: TuplePrefixes; + /** + * Filter by mutation status + */ + status?: MutationStatus; +} +type Updater = TOutput | ((input: TInput) => TOutput); +type QueryTypeFilter = 'all' | 'active' | 'inactive'; +declare const isServer: boolean; +declare function noop(): void; +declare function noop(): undefined; +declare function functionalUpdate(updater: Updater, input: TInput): TOutput; +declare function isValidTimeout(value: unknown): value is number; +declare function timeUntilStale(updatedAt: number, staleTime?: number): number; +declare function resolveStaleTime(staleTime: undefined | StaleTimeFunction, query: Query): StaleTime | undefined; +declare function resolveEnabled(enabled: undefined | Enabled, query: Query): boolean | undefined; +declare function matchQuery(filters: QueryFilters, query: Query): boolean; +declare function matchMutation(filters: MutationFilters, mutation: Mutation): boolean; +declare function hashQueryKeyByOptions(queryKey: TQueryKey, options?: Pick, 'queryKeyHashFn'>): string; +/** + * Default query & mutation keys hash function. + * Hashes the value into a stable hash. + */ +declare function hashKey(queryKey: QueryKey | MutationKey): string; +/** + * Checks if key `b` partially matches with key `a`. + */ +declare function partialMatchKey(a: QueryKey, b: QueryKey): boolean; +/** + * This function returns `a` if `b` is deeply equal. + * If not, it will replace any deeply equal children of `b` with those of `a`. + * This can be used for structural sharing between JSON values for example. + */ +declare function replaceEqualDeep(a: unknown, b: T, depth?: number): T; +/** + * Shallow compare objects. + */ +declare function shallowEqualObjects>(a: T, b: T | undefined): boolean; +declare function isPlainArray(value: unknown): value is Array; +declare function isPlainObject(o: any): o is Record; +declare function sleep(timeout: number): Promise; +declare function replaceData>(prevData: TData | undefined, data: TData, options: TOptions): TData; +declare function keepPreviousData(previousData: T | undefined): T | undefined; +declare function addToEnd(items: Array, item: T, max?: number): Array; +declare function addToStart(items: Array, item: T, max?: number): Array; +declare const skipToken: unique symbol; +type SkipToken = typeof skipToken; +declare function ensureQueryFn(options: { + queryFn?: QueryFunction | SkipToken; + queryHash?: string; +}, fetchOptions?: FetchOptions): QueryFunction; +declare function shouldThrowError) => boolean>(throwOnError: boolean | T | undefined, params: Parameters): boolean; +declare function addConsumeAwareSignal(object: T, getSignal: () => AbortSignal, onCancelled: VoidFunction): T & { + signal: AbortSignal; +}; + +interface QueryCacheConfig { + onError?: (error: DefaultError, query: Query) => void; + onSuccess?: (data: unknown, query: Query) => void; + onSettled?: (data: unknown | undefined, error: DefaultError | null, query: Query) => void; +} +interface NotifyEventQueryAdded extends NotifyEvent { + type: 'added'; + query: Query; +} +interface NotifyEventQueryRemoved extends NotifyEvent { + type: 'removed'; + query: Query; +} +interface NotifyEventQueryUpdated extends NotifyEvent { + type: 'updated'; + query: Query; + action: Action$1; +} +interface NotifyEventQueryObserverAdded extends NotifyEvent { + type: 'observerAdded'; + query: Query; + observer: QueryObserver; +} +interface NotifyEventQueryObserverRemoved extends NotifyEvent { + type: 'observerRemoved'; + query: Query; + observer: QueryObserver; +} +interface NotifyEventQueryObserverResultsUpdated extends NotifyEvent { + type: 'observerResultsUpdated'; + query: Query; +} +interface NotifyEventQueryObserverOptionsUpdated extends NotifyEvent { + type: 'observerOptionsUpdated'; + query: Query; + observer: QueryObserver; +} +type QueryCacheNotifyEvent = NotifyEventQueryAdded | NotifyEventQueryRemoved | NotifyEventQueryUpdated | NotifyEventQueryObserverAdded | NotifyEventQueryObserverRemoved | NotifyEventQueryObserverResultsUpdated | NotifyEventQueryObserverOptionsUpdated; +type QueryCacheListener = (event: QueryCacheNotifyEvent) => void; +interface QueryStore { + has: (queryHash: string) => boolean; + set: (queryHash: string, query: Query) => void; + get: (queryHash: string) => Query | undefined; + delete: (queryHash: string) => void; + values: () => IterableIterator; +} +declare class QueryCache extends Subscribable { + #private; + config: QueryCacheConfig; + constructor(config?: QueryCacheConfig); + build(client: QueryClient, options: WithRequired, 'queryKey'>, state?: QueryState): Query; + add(query: Query): void; + remove(query: Query): void; + clear(): void; + get(queryHash: string): Query | undefined; + getAll(): Array; + find(filters: WithRequired): Query | undefined; + findAll(filters?: QueryFilters): Array; + notify(event: QueryCacheNotifyEvent): void; + onFocus(): void; + onOnline(): void; +} + +declare class QueryClient { + #private; + constructor(config?: QueryClientConfig); + mount(): void; + unmount(): void; + isFetching = QueryFilters>(filters?: TQueryFilters): number; + isMutating = MutationFilters>(filters?: TMutationFilters): number; + /** + * Imperative (non-reactive) way to retrieve data for a QueryKey. + * Should only be used in callbacks or functions where reading the latest data is necessary, e.g. for optimistic updates. + * + * Hint: Do not use this function inside a component, because it won't receive updates. + * Use `useQuery` to create a `QueryObserver` that subscribes to changes. + */ + getQueryData>(queryKey: TTaggedQueryKey): TInferredQueryFnData | undefined; + ensureQueryData(options: EnsureQueryDataOptions): Promise; + getQueriesData = QueryFilters>(filters: TQueryFilters): Array<[QueryKey, TQueryFnData | undefined]>; + setQueryData>(queryKey: TTaggedQueryKey, updater: Updater | undefined, NoInfer | undefined>, options?: SetDataOptions): NoInfer | undefined; + setQueriesData = QueryFilters>(filters: TQueryFilters, updater: Updater | undefined, NoInfer | undefined>, options?: SetDataOptions): Array<[QueryKey, TQueryFnData | undefined]>; + getQueryState, TInferredError = InferErrorFromTag>(queryKey: TTaggedQueryKey): QueryState | undefined; + removeQueries(filters?: QueryFilters): void; + resetQueries(filters?: QueryFilters, options?: ResetOptions): Promise; + cancelQueries(filters?: QueryFilters, cancelOptions?: CancelOptions): Promise; + invalidateQueries(filters?: InvalidateQueryFilters, options?: InvalidateOptions): Promise; + refetchQueries(filters?: RefetchQueryFilters, options?: RefetchOptions): Promise; + fetchQuery(options: FetchQueryOptions): Promise; + prefetchQuery(options: FetchQueryOptions): Promise; + fetchInfiniteQuery(options: FetchInfiniteQueryOptions): Promise>; + prefetchInfiniteQuery(options: FetchInfiniteQueryOptions): Promise; + ensureInfiniteQueryData(options: EnsureInfiniteQueryDataOptions): Promise>; + resumePausedMutations(): Promise; + getQueryCache(): QueryCache; + getMutationCache(): MutationCache; + getDefaultOptions(): DefaultOptions; + setDefaultOptions(options: DefaultOptions): void; + setQueryDefaults(queryKey: QueryKey, options: Partial, 'queryKey'>>): void; + getQueryDefaults(queryKey: QueryKey): OmitKeyof, 'queryKey'>; + setMutationDefaults(mutationKey: MutationKey, options: OmitKeyof, 'mutationKey'>): void; + getMutationDefaults(mutationKey: MutationKey): OmitKeyof, 'mutationKey'>; + defaultQueryOptions(options: QueryObserverOptions | DefaultedQueryObserverOptions): DefaultedQueryObserverOptions; + defaultMutationOptions>(options?: T): T; + clear(): void; +} + +interface RetryerConfig { + fn: () => TData | Promise; + initialPromise?: Promise; + onCancel?: (error: TError) => void; + onFail?: (failureCount: number, error: TError) => void; + onPause?: () => void; + onContinue?: () => void; + retry?: RetryValue; + retryDelay?: RetryDelayValue; + networkMode: NetworkMode | undefined; + canRun: () => boolean; +} +interface Retryer { + promise: Promise; + cancel: (cancelOptions?: CancelOptions) => void; + continue: () => Promise; + cancelRetry: () => void; + continueRetry: () => void; + canStart: () => boolean; + start: () => Promise; + status: () => 'pending' | 'resolved' | 'rejected'; +} +type RetryValue = boolean | number | ShouldRetryFunction; +type ShouldRetryFunction = (failureCount: number, error: TError) => boolean; +type RetryDelayValue = number | RetryDelayFunction; +type RetryDelayFunction = (failureCount: number, error: TError) => number; +declare function canFetch(networkMode: NetworkMode | undefined): boolean; +declare class CancelledError extends Error { + revert?: boolean; + silent?: boolean; + constructor(options?: CancelOptions); +} +/** + * @deprecated Use instanceof `CancelledError` instead. + */ +declare function isCancelledError(value: any): value is CancelledError; +declare function createRetryer(config: RetryerConfig): Retryer; + +type NonUndefinedGuard = T extends undefined ? never : T; +type DistributiveOmit = TObject extends any ? Omit : never; +type OmitKeyof) | (number & Record) | (symbol & Record) : keyof TObject, TStrictly extends 'strictly' | 'safely' = 'strictly'> = Omit; +type Override = { + [AKey in keyof TTargetA]: AKey extends keyof TTargetB ? TTargetB[AKey] : TTargetA[AKey]; +}; +type NoInfer = [T][T extends any ? 0 : never]; +interface Register { +} +type DefaultError = Register extends { + defaultError: infer TError; +} ? TError : Error; +type QueryKey = Register extends { + queryKey: infer TQueryKey; +} ? TQueryKey extends ReadonlyArray ? TQueryKey : TQueryKey extends Array ? TQueryKey : ReadonlyArray : ReadonlyArray; +declare const dataTagSymbol: unique symbol; +type dataTagSymbol = typeof dataTagSymbol; +declare const dataTagErrorSymbol: unique symbol; +type dataTagErrorSymbol = typeof dataTagErrorSymbol; +declare const unsetMarker: unique symbol; +type UnsetMarker = typeof unsetMarker; +type AnyDataTag = { + [dataTagSymbol]: any; + [dataTagErrorSymbol]: any; +}; +type DataTag = TType extends AnyDataTag ? TType : TType & { + [dataTagSymbol]: TValue; + [dataTagErrorSymbol]: TError; +}; +type InferDataFromTag = TTaggedQueryKey extends DataTag ? TaggedValue : TQueryFnData; +type InferErrorFromTag = TTaggedQueryKey extends DataTag ? TaggedError extends UnsetMarker ? TError : TaggedError : TError; +type QueryFunction = (context: QueryFunctionContext) => T | Promise; +type StaleTime = number | 'static'; +type StaleTimeFunction = StaleTime | ((query: Query) => StaleTime); +type Enabled = boolean | ((query: Query) => boolean); +type QueryPersister = [TPageParam] extends [never] ? (queryFn: QueryFunction, context: QueryFunctionContext, query: Query) => T | Promise : (queryFn: QueryFunction, context: QueryFunctionContext, query: Query) => T | Promise; +type QueryFunctionContext = [TPageParam] extends [never] ? { + client: QueryClient; + queryKey: TQueryKey; + signal: AbortSignal; + meta: QueryMeta | undefined; + pageParam?: unknown; + /** + * @deprecated + * if you want access to the direction, you can add it to the pageParam + */ + direction?: unknown; +} : { + client: QueryClient; + queryKey: TQueryKey; + signal: AbortSignal; + pageParam: TPageParam; + /** + * @deprecated + * if you want access to the direction, you can add it to the pageParam + */ + direction: FetchDirection; + meta: QueryMeta | undefined; +}; +type InitialDataFunction = () => T | undefined; +type NonFunctionGuard = T extends Function ? never : T; +type PlaceholderDataFunction = (previousData: TQueryData | undefined, previousQuery: Query | undefined) => TQueryData | undefined; +type QueriesPlaceholderDataFunction = (previousData: undefined, previousQuery: undefined) => TQueryData | undefined; +type QueryKeyHashFunction = (queryKey: TQueryKey) => string; +type GetPreviousPageParamFunction = (firstPage: TQueryFnData, allPages: Array, firstPageParam: TPageParam, allPageParams: Array) => TPageParam | undefined | null; +type GetNextPageParamFunction = (lastPage: TQueryFnData, allPages: Array, lastPageParam: TPageParam, allPageParams: Array) => TPageParam | undefined | null; +interface InfiniteData { + pages: Array; + pageParams: Array; +} +type QueryMeta = Register extends { + queryMeta: infer TQueryMeta; +} ? TQueryMeta extends Record ? TQueryMeta : Record : Record; +type NetworkMode = 'online' | 'always' | 'offlineFirst'; +type NotifyOnChangeProps = Array | 'all' | undefined | (() => Array | 'all' | undefined); +interface QueryOptions { + /** + * If `false`, failed queries will not retry by default. + * If `true`, failed queries will retry infinitely., failureCount: num + * If set to an integer number, e.g. 3, failed queries will retry until the failed query count meets that number. + * If set to a function `(failureCount, error) => boolean` failed queries will retry until the function returns false. + */ + retry?: RetryValue; + retryDelay?: RetryDelayValue; + networkMode?: NetworkMode; + /** + * The time in milliseconds that unused/inactive cache data remains in memory. + * When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration. + * When different garbage collection times are specified, the longest one will be used. + * Setting it to `Infinity` will disable garbage collection. + */ + gcTime?: number; + queryFn?: QueryFunction | SkipToken; + persister?: QueryPersister, NoInfer, NoInfer>; + queryHash?: string; + queryKey?: TQueryKey; + queryKeyHashFn?: QueryKeyHashFunction; + initialData?: TData | InitialDataFunction; + initialDataUpdatedAt?: number | (() => number | undefined); + behavior?: QueryBehavior; + /** + * Set this to `false` to disable structural sharing between query results. + * Set this to a function which accepts the old and new data and returns resolved data of the same type to implement custom structural sharing logic. + * Defaults to `true`. + */ + structuralSharing?: boolean | ((oldData: unknown | undefined, newData: unknown) => unknown); + _defaulted?: boolean; + /** + * Additional payload to be stored on each query. + * Use this property to pass information that can be used in other places. + */ + meta?: QueryMeta; + /** + * Maximum number of pages to store in the data of an infinite query. + */ + maxPages?: number; +} +interface InitialPageParam { + initialPageParam: TPageParam; +} +interface InfiniteQueryPageParamsOptions extends InitialPageParam { + /** + * This function can be set to automatically get the previous cursor for infinite queries. + * The result will also be used to determine the value of `hasPreviousPage`. + */ + getPreviousPageParam?: GetPreviousPageParamFunction; + /** + * This function can be set to automatically get the next cursor for infinite queries. + * The result will also be used to determine the value of `hasNextPage`. + */ + getNextPageParam: GetNextPageParamFunction; +} +type ThrowOnError = boolean | ((error: TError, query: Query) => boolean); +interface QueryObserverOptions extends WithRequired, 'queryKey'> { + /** + * Set this to `false` or a function that returns `false` to disable automatic refetching when the query mounts or changes query keys. + * To refetch the query, use the `refetch` method returned from the `useQuery` instance. + * Accepts a boolean or function that returns a boolean. + * Defaults to `true`. + */ + enabled?: Enabled; + /** + * The time in milliseconds after data is considered stale. + * If set to `Infinity`, the data will never be considered stale. + * If set to a function, the function will be executed with the query to compute a `staleTime`. + * Defaults to `0`. + */ + staleTime?: StaleTimeFunction; + /** + * If set to a number, the query will continuously refetch at this frequency in milliseconds. + * If set to a function, the function will be executed with the latest data and query to compute a frequency + * Defaults to `false`. + */ + refetchInterval?: number | false | ((query: Query) => number | false | undefined); + /** + * If set to `true`, the query will continue to refetch while their tab/window is in the background. + * Defaults to `false`. + */ + refetchIntervalInBackground?: boolean; + /** + * If set to `true`, the query will refetch on window focus if the data is stale. + * If set to `false`, the query will not refetch on window focus. + * If set to `'always'`, the query will always refetch on window focus. + * If set to a function, the function will be executed with the latest data and query to compute the value. + * Defaults to `true`. + */ + refetchOnWindowFocus?: boolean | 'always' | ((query: Query) => boolean | 'always'); + /** + * If set to `true`, the query will refetch on reconnect if the data is stale. + * If set to `false`, the query will not refetch on reconnect. + * If set to `'always'`, the query will always refetch on reconnect. + * If set to a function, the function will be executed with the latest data and query to compute the value. + * Defaults to the value of `networkOnline` (`true`) + */ + refetchOnReconnect?: boolean | 'always' | ((query: Query) => boolean | 'always'); + /** + * If set to `true`, the query will refetch on mount if the data is stale. + * If set to `false`, will disable additional instances of a query to trigger background refetch. + * If set to `'always'`, the query will always refetch on mount. + * If set to a function, the function will be executed with the latest data and query to compute the value + * Defaults to `true`. + */ + refetchOnMount?: boolean | 'always' | ((query: Query) => boolean | 'always'); + /** + * If set to `false`, the query will not be retried on mount if it contains an error. + * Defaults to `true`. + */ + retryOnMount?: boolean; + /** + * If set, the component will only re-render if any of the listed properties change. + * When set to `['data', 'error']`, the component will only re-render when the `data` or `error` properties change. + * When set to `'all'`, the component will re-render whenever a query is updated. + * When set to a function, the function will be executed to compute the list of properties. + * By default, access to properties will be tracked, and the component will only re-render when one of the tracked properties change. + */ + notifyOnChangeProps?: NotifyOnChangeProps; + /** + * Whether errors should be thrown instead of setting the `error` property. + * If set to `true` or `suspense` is `true`, all errors will be thrown to the error boundary. + * If set to `false` and `suspense` is `false`, errors are returned as state. + * If set to a function, it will be passed the error and the query, and it should return a boolean indicating whether to show the error in an error boundary (`true`) or return the error as state (`false`). + * Defaults to `false`. + */ + throwOnError?: ThrowOnError; + /** + * This option can be used to transform or select a part of the data returned by the query function. + */ + select?: (data: TQueryData) => TData; + /** + * If set to `true`, the query will suspend when `status === 'pending'` + * and throw errors when `status === 'error'`. + * Defaults to `false`. + */ + suspense?: boolean; + /** + * If set, this value will be used as the placeholder data for this particular query observer while the query is still in the `loading` data and no initialData has been provided. + */ + placeholderData?: NonFunctionGuard | PlaceholderDataFunction, TError, NonFunctionGuard, TQueryKey>; + _optimisticResults?: 'optimistic' | 'isRestoring'; + /** + * Enable prefetching during rendering + */ + experimental_prefetchInRender?: boolean; +} +type WithRequired = TTarget & { + [_ in TKey]: {}; +}; +type DefaultedQueryObserverOptions = WithRequired, 'throwOnError' | 'refetchOnReconnect' | 'queryHash'>; +interface InfiniteQueryObserverOptions extends QueryObserverOptions, TQueryKey, TPageParam>, InfiniteQueryPageParamsOptions { +} +type DefaultedInfiniteQueryObserverOptions = WithRequired, 'throwOnError' | 'refetchOnReconnect' | 'queryHash'>; +interface FetchQueryOptions extends WithRequired, 'queryKey'> { + initialPageParam?: never; + /** + * The time in milliseconds after data is considered stale. + * If the data is fresh it will be returned from the cache. + */ + staleTime?: StaleTimeFunction; +} +interface EnsureQueryDataOptions extends FetchQueryOptions { + revalidateIfStale?: boolean; +} +type EnsureInfiniteQueryDataOptions = FetchInfiniteQueryOptions & { + revalidateIfStale?: boolean; +}; +type FetchInfiniteQueryPages = { + pages?: never; +} | { + pages: number; + getNextPageParam: GetNextPageParamFunction; +}; +type FetchInfiniteQueryOptions = Omit, TQueryKey, TPageParam>, 'initialPageParam'> & InitialPageParam & FetchInfiniteQueryPages; +interface ResultOptions { + throwOnError?: boolean; +} +interface RefetchOptions extends ResultOptions { + /** + * If set to `true`, a currently running request will be cancelled before a new request is made + * + * If set to `false`, no refetch will be made if there is already a request running. + * + * Defaults to `true`. + */ + cancelRefetch?: boolean; +} +interface InvalidateQueryFilters extends QueryFilters { + refetchType?: QueryTypeFilter | 'none'; +} +interface RefetchQueryFilters extends QueryFilters { +} +interface InvalidateOptions extends RefetchOptions { +} +interface ResetOptions extends RefetchOptions { +} +interface FetchNextPageOptions extends ResultOptions { + /** + * If set to `true`, calling `fetchNextPage` repeatedly will invoke `queryFn` every time, + * whether the previous invocation has resolved or not. Also, the result from previous invocations will be ignored. + * + * If set to `false`, calling `fetchNextPage` repeatedly won't have any effect until the first invocation has resolved. + * + * Defaults to `true`. + */ + cancelRefetch?: boolean; +} +interface FetchPreviousPageOptions extends ResultOptions { + /** + * If set to `true`, calling `fetchPreviousPage` repeatedly will invoke `queryFn` every time, + * whether the previous invocation has resolved or not. Also, the result from previous invocations will be ignored. + * + * If set to `false`, calling `fetchPreviousPage` repeatedly won't have any effect until the first invocation has resolved. + * + * Defaults to `true`. + */ + cancelRefetch?: boolean; +} +type QueryStatus = 'pending' | 'error' | 'success'; +type FetchStatus = 'fetching' | 'paused' | 'idle'; +interface QueryObserverBaseResult { + /** + * The last successfully resolved data for the query. + */ + data: TData | undefined; + /** + * The timestamp for when the query most recently returned the `status` as `"success"`. + */ + dataUpdatedAt: number; + /** + * The error object for the query, if an error was thrown. + * - Defaults to `null`. + */ + error: TError | null; + /** + * The timestamp for when the query most recently returned the `status` as `"error"`. + */ + errorUpdatedAt: number; + /** + * The failure count for the query. + * - Incremented every time the query fails. + * - Reset to `0` when the query succeeds. + */ + failureCount: number; + /** + * The failure reason for the query retry. + * - Reset to `null` when the query succeeds. + */ + failureReason: TError | null; + /** + * The sum of all errors. + */ + errorUpdateCount: number; + /** + * A derived boolean from the `status` variable, provided for convenience. + * - `true` if the query attempt resulted in an error. + */ + isError: boolean; + /** + * Will be `true` if the query has been fetched. + */ + isFetched: boolean; + /** + * Will be `true` if the query has been fetched after the component mounted. + * - This property can be used to not show any previously cached data. + */ + isFetchedAfterMount: boolean; + /** + * A derived boolean from the `fetchStatus` variable, provided for convenience. + * - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. + */ + isFetching: boolean; + /** + * Is `true` whenever the first fetch for a query is in-flight. + * - Is the same as `isFetching && isPending`. + */ + isLoading: boolean; + /** + * Will be `pending` if there's no cached data and no query attempt was finished yet. + */ + isPending: boolean; + /** + * Will be `true` if the query failed while fetching for the first time. + */ + isLoadingError: boolean; + /** + * @deprecated `isInitialLoading` is being deprecated in favor of `isLoading` + * and will be removed in the next major version. + */ + isInitialLoading: boolean; + /** + * A derived boolean from the `fetchStatus` variable, provided for convenience. + * - The query wanted to fetch, but has been `paused`. + */ + isPaused: boolean; + /** + * Will be `true` if the data shown is the placeholder data. + */ + isPlaceholderData: boolean; + /** + * Will be `true` if the query failed while refetching. + */ + isRefetchError: boolean; + /** + * Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. + * - Is the same as `isFetching && !isPending`. + */ + isRefetching: boolean; + /** + * Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. + */ + isStale: boolean; + /** + * A derived boolean from the `status` variable, provided for convenience. + * - `true` if the query has received a response with no errors and is ready to display its data. + */ + isSuccess: boolean; + /** + * `true` if this observer is enabled, `false` otherwise. + */ + isEnabled: boolean; + /** + * A function to manually refetch the query. + */ + refetch: (options?: RefetchOptions) => Promise>; + /** + * The status of the query. + * - Will be: + * - `pending` if there's no cached data and no query attempt was finished yet. + * - `error` if the query attempt resulted in an error. + * - `success` if the query has received a response with no errors and is ready to display its data. + */ + status: QueryStatus; + /** + * The fetch status of the query. + * - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. + * - `paused`: The query wanted to fetch, but has been `paused`. + * - `idle`: The query is not fetching. + * - See [Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information. + */ + fetchStatus: FetchStatus; + /** + * A stable promise that will be resolved with the data of the query. + * Requires the `experimental_prefetchInRender` feature flag to be enabled. + * @example + * + * ### Enabling the feature flag + * ```ts + * const client = new QueryClient({ + * defaultOptions: { + * queries: { + * experimental_prefetchInRender: true, + * }, + * }, + * }) + * ``` + * + * ### Usage + * ```tsx + * import { useQuery } from '@tanstack/react-query' + * import React from 'react' + * import { fetchTodos, type Todo } from './api' + * + * function TodoList({ query }: { query: UseQueryResult }) { + * const data = React.use(query.promise) + * + * return ( + *
    + * {data.map(todo => ( + *
  • {todo.title}
  • + * ))} + *
+ * ) + * } + * + * export function App() { + * const query = useQuery({ queryKey: ['todos'], queryFn: fetchTodos }) + * + * return ( + * <> + *

Todos

+ * Loading...}> + * + * + * + * ) + * } + * ``` + */ + promise: Promise; +} +interface QueryObserverPendingResult extends QueryObserverBaseResult { + data: undefined; + error: null; + isError: false; + isPending: true; + isLoadingError: false; + isRefetchError: false; + isSuccess: false; + isPlaceholderData: false; + status: 'pending'; +} +interface QueryObserverLoadingResult extends QueryObserverBaseResult { + data: undefined; + error: null; + isError: false; + isPending: true; + isLoading: true; + isLoadingError: false; + isRefetchError: false; + isSuccess: false; + isPlaceholderData: false; + status: 'pending'; +} +interface QueryObserverLoadingErrorResult extends QueryObserverBaseResult { + data: undefined; + error: TError; + isError: true; + isPending: false; + isLoading: false; + isLoadingError: true; + isRefetchError: false; + isSuccess: false; + isPlaceholderData: false; + status: 'error'; +} +interface QueryObserverRefetchErrorResult extends QueryObserverBaseResult { + data: TData; + error: TError; + isError: true; + isPending: false; + isLoading: false; + isLoadingError: false; + isRefetchError: true; + isSuccess: false; + isPlaceholderData: false; + status: 'error'; +} +interface QueryObserverSuccessResult extends QueryObserverBaseResult { + data: TData; + error: null; + isError: false; + isPending: false; + isLoading: false; + isLoadingError: false; + isRefetchError: false; + isSuccess: true; + isPlaceholderData: false; + status: 'success'; +} +interface QueryObserverPlaceholderResult extends QueryObserverBaseResult { + data: TData; + isError: false; + error: null; + isPending: false; + isLoading: false; + isLoadingError: false; + isRefetchError: false; + isSuccess: true; + isPlaceholderData: true; + status: 'success'; +} +type DefinedQueryObserverResult = QueryObserverRefetchErrorResult | QueryObserverSuccessResult; +type QueryObserverResult = DefinedQueryObserverResult | QueryObserverLoadingErrorResult | QueryObserverLoadingResult | QueryObserverPendingResult | QueryObserverPlaceholderResult; +interface InfiniteQueryObserverBaseResult extends QueryObserverBaseResult { + /** + * This function allows you to fetch the next "page" of results. + */ + fetchNextPage: (options?: FetchNextPageOptions) => Promise>; + /** + * This function allows you to fetch the previous "page" of results. + */ + fetchPreviousPage: (options?: FetchPreviousPageOptions) => Promise>; + /** + * Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). + */ + hasNextPage: boolean; + /** + * Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). + */ + hasPreviousPage: boolean; + /** + * Will be `true` if the query failed while fetching the next page. + */ + isFetchNextPageError: boolean; + /** + * Will be `true` while fetching the next page with `fetchNextPage`. + */ + isFetchingNextPage: boolean; + /** + * Will be `true` if the query failed while fetching the previous page. + */ + isFetchPreviousPageError: boolean; + /** + * Will be `true` while fetching the previous page with `fetchPreviousPage`. + */ + isFetchingPreviousPage: boolean; +} +interface InfiniteQueryObserverPendingResult extends InfiniteQueryObserverBaseResult { + data: undefined; + error: null; + isError: false; + isPending: true; + isLoadingError: false; + isRefetchError: false; + isFetchNextPageError: false; + isFetchPreviousPageError: false; + isSuccess: false; + isPlaceholderData: false; + status: 'pending'; +} +interface InfiniteQueryObserverLoadingResult extends InfiniteQueryObserverBaseResult { + data: undefined; + error: null; + isError: false; + isPending: true; + isLoading: true; + isLoadingError: false; + isRefetchError: false; + isFetchNextPageError: false; + isFetchPreviousPageError: false; + isSuccess: false; + isPlaceholderData: false; + status: 'pending'; +} +interface InfiniteQueryObserverLoadingErrorResult extends InfiniteQueryObserverBaseResult { + data: undefined; + error: TError; + isError: true; + isPending: false; + isLoading: false; + isLoadingError: true; + isRefetchError: false; + isFetchNextPageError: false; + isFetchPreviousPageError: false; + isSuccess: false; + isPlaceholderData: false; + status: 'error'; +} +interface InfiniteQueryObserverRefetchErrorResult extends InfiniteQueryObserverBaseResult { + data: TData; + error: TError; + isError: true; + isPending: false; + isLoading: false; + isLoadingError: false; + isRefetchError: true; + isSuccess: false; + isPlaceholderData: false; + status: 'error'; +} +interface InfiniteQueryObserverSuccessResult extends InfiniteQueryObserverBaseResult { + data: TData; + error: null; + isError: false; + isPending: false; + isLoading: false; + isLoadingError: false; + isRefetchError: false; + isFetchNextPageError: false; + isFetchPreviousPageError: false; + isSuccess: true; + isPlaceholderData: false; + status: 'success'; +} +interface InfiniteQueryObserverPlaceholderResult extends InfiniteQueryObserverBaseResult { + data: TData; + isError: false; + error: null; + isPending: false; + isLoading: false; + isLoadingError: false; + isRefetchError: false; + isSuccess: true; + isPlaceholderData: true; + isFetchNextPageError: false; + isFetchPreviousPageError: false; + status: 'success'; +} +type DefinedInfiniteQueryObserverResult = InfiniteQueryObserverRefetchErrorResult | InfiniteQueryObserverSuccessResult; +type InfiniteQueryObserverResult = DefinedInfiniteQueryObserverResult | InfiniteQueryObserverLoadingErrorResult | InfiniteQueryObserverLoadingResult | InfiniteQueryObserverPendingResult | InfiniteQueryObserverPlaceholderResult; +type MutationKey = Register extends { + mutationKey: infer TMutationKey; +} ? TMutationKey extends ReadonlyArray ? TMutationKey : TMutationKey extends Array ? TMutationKey : ReadonlyArray : ReadonlyArray; +type MutationStatus = 'idle' | 'pending' | 'success' | 'error'; +type MutationScope = { + id: string; +}; +type MutationMeta = Register extends { + mutationMeta: infer TMutationMeta; +} ? TMutationMeta extends Record ? TMutationMeta : Record : Record; +type MutationFunctionContext = { + client: QueryClient; + meta: MutationMeta | undefined; + mutationKey?: MutationKey; +}; +type MutationFunction = (variables: TVariables, context: MutationFunctionContext) => Promise; +interface MutationOptions { + mutationFn?: MutationFunction; + mutationKey?: MutationKey; + onMutate?: (variables: TVariables, context: MutationFunctionContext) => Promise | TOnMutateResult; + onSuccess?: (data: TData, variables: TVariables, onMutateResult: TOnMutateResult, context: MutationFunctionContext) => Promise | unknown; + onError?: (error: TError, variables: TVariables, onMutateResult: TOnMutateResult | undefined, context: MutationFunctionContext) => Promise | unknown; + onSettled?: (data: TData | undefined, error: TError | null, variables: TVariables, onMutateResult: TOnMutateResult | undefined, context: MutationFunctionContext) => Promise | unknown; + retry?: RetryValue; + retryDelay?: RetryDelayValue; + networkMode?: NetworkMode; + gcTime?: number; + _defaulted?: boolean; + meta?: MutationMeta; + scope?: MutationScope; +} +interface MutationObserverOptions extends MutationOptions { + throwOnError?: boolean | ((error: TError) => boolean); +} +interface MutateOptions { + onSuccess?: (data: TData, variables: TVariables, onMutateResult: TOnMutateResult | undefined, context: MutationFunctionContext) => void; + onError?: (error: TError, variables: TVariables, onMutateResult: TOnMutateResult | undefined, context: MutationFunctionContext) => void; + onSettled?: (data: TData | undefined, error: TError | null, variables: TVariables, onMutateResult: TOnMutateResult | undefined, context: MutationFunctionContext) => void; +} +type MutateFunction = (variables: TVariables, options?: MutateOptions) => Promise; +interface MutationObserverBaseResult extends MutationState { + /** + * The last successfully resolved data for the mutation. + */ + data: TData | undefined; + /** + * The variables object passed to the `mutationFn`. + */ + variables: TVariables | undefined; + /** + * The error object for the mutation, if an error was encountered. + * - Defaults to `null`. + */ + error: TError | null; + /** + * A boolean variable derived from `status`. + * - `true` if the last mutation attempt resulted in an error. + */ + isError: boolean; + /** + * A boolean variable derived from `status`. + * - `true` if the mutation is in its initial state prior to executing. + */ + isIdle: boolean; + /** + * A boolean variable derived from `status`. + * - `true` if the mutation is currently executing. + */ + isPending: boolean; + /** + * A boolean variable derived from `status`. + * - `true` if the last mutation attempt was successful. + */ + isSuccess: boolean; + /** + * The status of the mutation. + * - Will be: + * - `idle` initial status prior to the mutation function executing. + * - `pending` if the mutation is currently executing. + * - `error` if the last mutation attempt resulted in an error. + * - `success` if the last mutation attempt was successful. + */ + status: MutationStatus; + /** + * The mutation function you can call with variables to trigger the mutation and optionally hooks on additional callback options. + * @param variables - The variables object to pass to the `mutationFn`. + * @param options.onSuccess - This function will fire when the mutation is successful and will be passed the mutation's result. + * @param options.onError - This function will fire if the mutation encounters an error and will be passed the error. + * @param options.onSettled - This function will fire when the mutation is either successfully fetched or encounters an error and be passed either the data or error. + * @remarks + * - If you make multiple requests, `onSuccess` will fire only after the latest call you've made. + * - All the callback functions (`onSuccess`, `onError`, `onSettled`) are void functions, and the returned value will be ignored. + */ + mutate: MutateFunction; + /** + * A function to clean the mutation internal state (i.e., it resets the mutation to its initial state). + */ + reset: () => void; +} +interface MutationObserverIdleResult extends MutationObserverBaseResult { + data: undefined; + variables: undefined; + error: null; + isError: false; + isIdle: true; + isPending: false; + isSuccess: false; + status: 'idle'; +} +interface MutationObserverLoadingResult extends MutationObserverBaseResult { + data: undefined; + variables: TVariables; + error: null; + isError: false; + isIdle: false; + isPending: true; + isSuccess: false; + status: 'pending'; +} +interface MutationObserverErrorResult extends MutationObserverBaseResult { + data: undefined; + error: TError; + variables: TVariables; + isError: true; + isIdle: false; + isPending: false; + isSuccess: false; + status: 'error'; +} +interface MutationObserverSuccessResult extends MutationObserverBaseResult { + data: TData; + error: null; + variables: TVariables; + isError: false; + isIdle: false; + isPending: false; + isSuccess: true; + status: 'success'; +} +type MutationObserverResult = MutationObserverIdleResult | MutationObserverLoadingResult | MutationObserverErrorResult | MutationObserverSuccessResult; +interface QueryClientConfig { + queryCache?: QueryCache; + mutationCache?: MutationCache; + defaultOptions?: DefaultOptions; +} +interface DefaultOptions { + queries?: OmitKeyof, 'suspense' | 'queryKey'>; + mutations?: MutationObserverOptions; + hydrate?: HydrateOptions['defaultOptions']; + dehydrate?: DehydrateOptions; +} +interface CancelOptions { + revert?: boolean; + silent?: boolean; +} +interface SetDataOptions { + updatedAt?: number; +} +type NotifyEventType = 'added' | 'removed' | 'updated' | 'observerAdded' | 'observerRemoved' | 'observerResultsUpdated' | 'observerOptionsUpdated'; +interface NotifyEvent { + type: NotifyEventType; +} + +type TransformerFn = (data: any) => any; +interface DehydrateOptions { + serializeData?: TransformerFn; + shouldDehydrateMutation?: (mutation: Mutation) => boolean; + shouldDehydrateQuery?: (query: Query) => boolean; + shouldRedactErrors?: (error: unknown) => boolean; +} +interface HydrateOptions { + defaultOptions?: { + deserializeData?: TransformerFn; + queries?: QueryOptions; + mutations?: MutationOptions; + }; +} +interface DehydratedMutation { + mutationKey?: MutationKey; + state: MutationState; + meta?: MutationMeta; + scope?: MutationScope; +} +interface DehydratedQuery { + queryHash: string; + queryKey: QueryKey; + state: QueryState; + promise?: Promise; + meta?: QueryMeta; + dehydratedAt?: number; +} +interface DehydratedState { + mutations: Array; + queries: Array; +} +declare function defaultShouldDehydrateMutation(mutation: Mutation): boolean; +declare function defaultShouldDehydrateQuery(query: Query): boolean; +declare function dehydrate(client: QueryClient, options?: DehydrateOptions): DehydratedState; +declare function hydrate(client: QueryClient, dehydratedState: unknown, options?: HydrateOptions): void; + +export { type Enabled as $, type QueryState as A, type DistributiveOmit as B, CancelledError as C, type DehydratedState as D, type Override as E, type NoInfer as F, type DefaultError as G, type HydrateOptions as H, type QueryKey as I, dataTagSymbol as J, dataTagErrorSymbol as K, unsetMarker as L, MutationCache as M, type NonUndefinedGuard as N, type OmitKeyof as O, type UnsetMarker as P, QueryCache as Q, type Register as R, type SkipToken as S, type AnyDataTag as T, type Updater as U, type DataTag as V, type InferDataFromTag as W, type InferErrorFromTag as X, type QueryFunction as Y, type StaleTime as Z, type StaleTimeFunction as _, defaultShouldDehydrateQuery as a, type MutationObserverBaseResult as a$, type QueryPersister as a0, type QueryFunctionContext as a1, type InitialDataFunction as a2, type PlaceholderDataFunction as a3, type QueriesPlaceholderDataFunction as a4, type QueryKeyHashFunction as a5, type GetPreviousPageParamFunction as a6, type GetNextPageParamFunction as a7, type InfiniteData as a8, type QueryMeta as a9, type QueryObserverPendingResult as aA, type QueryObserverLoadingResult as aB, type QueryObserverLoadingErrorResult as aC, type QueryObserverRefetchErrorResult as aD, type QueryObserverSuccessResult as aE, type QueryObserverPlaceholderResult as aF, type DefinedQueryObserverResult as aG, type QueryObserverResult as aH, type InfiniteQueryObserverBaseResult as aI, type InfiniteQueryObserverPendingResult as aJ, type InfiniteQueryObserverLoadingResult as aK, type InfiniteQueryObserverLoadingErrorResult as aL, type InfiniteQueryObserverRefetchErrorResult as aM, type InfiniteQueryObserverSuccessResult as aN, type InfiniteQueryObserverPlaceholderResult as aO, type DefinedInfiniteQueryObserverResult as aP, type InfiniteQueryObserverResult as aQ, type MutationKey as aR, type MutationStatus as aS, type MutationScope as aT, type MutationMeta as aU, type MutationFunctionContext as aV, type MutationFunction as aW, type MutationOptions as aX, type MutationObserverOptions as aY, type MutateOptions as aZ, type MutateFunction as a_, type NetworkMode as aa, type NotifyOnChangeProps as ab, type QueryOptions as ac, type InitialPageParam as ad, type InfiniteQueryPageParamsOptions as ae, type ThrowOnError as af, type QueryObserverOptions as ag, type WithRequired as ah, type DefaultedQueryObserverOptions as ai, type InfiniteQueryObserverOptions as aj, type DefaultedInfiniteQueryObserverOptions as ak, type FetchQueryOptions as al, type EnsureQueryDataOptions as am, type EnsureInfiniteQueryDataOptions as an, type FetchInfiniteQueryOptions as ao, type ResultOptions as ap, type RefetchOptions as aq, type InvalidateQueryFilters as ar, type RefetchQueryFilters as as, type InvalidateOptions as at, type ResetOptions as au, type FetchNextPageOptions as av, type FetchPreviousPageOptions as aw, type QueryStatus as ax, type FetchStatus as ay, type QueryObserverBaseResult as az, dehydrate as b, type MutationObserverIdleResult as b0, type MutationObserverLoadingResult as b1, type MutationObserverErrorResult as b2, type MutationObserverSuccessResult as b3, type MutationObserverResult as b4, type QueryClientConfig as b5, type DefaultOptions as b6, type CancelOptions as b7, type SetDataOptions as b8, type NotifyEventType as b9, addConsumeAwareSignal as bA, type QueryStore as bB, type Retryer as bC, type RetryValue as bD, type RetryDelayValue as bE, canFetch as bF, createRetryer as bG, type NotifyEvent as ba, type QueryBehavior as bb, type FetchContext as bc, type FetchDirection as bd, type FetchMeta as be, type FetchOptions as bf, type Action$1 as bg, type SetStateOptions as bh, fetchState as bi, type Action as bj, getDefaultState as bk, type QueryTypeFilter as bl, functionalUpdate as bm, isValidTimeout as bn, timeUntilStale as bo, resolveStaleTime as bp, resolveEnabled as bq, hashQueryKeyByOptions as br, shallowEqualObjects as bs, isPlainArray as bt, isPlainObject as bu, sleep as bv, replaceData as bw, addToEnd as bx, addToStart as by, ensureQueryFn as bz, type MutationCacheNotifyEvent as c, defaultShouldDehydrateMutation as d, MutationObserver as e, type QueryCacheNotifyEvent as f, QueryClient as g, hydrate as h, QueryObserver as i, isCancelledError as j, hashKey as k, isServer as l, keepPreviousData as m, matchMutation as n, matchQuery as o, noop as p, partialMatchKey as q, replaceEqualDeep as r, shouldThrowError as s, skipToken as t, type MutationFilters as u, type QueryFilters as v, type DehydrateOptions as w, Mutation as x, type MutationState as y, Query as z }; diff --git a/node_modules/@tanstack/query-core/build/modern/hydration.cjs b/node_modules/@tanstack/query-core/build/modern/hydration.cjs new file mode 100644 index 0000000..f5fd1a2 --- /dev/null +++ b/node_modules/@tanstack/query-core/build/modern/hydration.cjs @@ -0,0 +1,173 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/hydration.ts +var hydration_exports = {}; +__export(hydration_exports, { + defaultShouldDehydrateMutation: () => defaultShouldDehydrateMutation, + defaultShouldDehydrateQuery: () => defaultShouldDehydrateQuery, + dehydrate: () => dehydrate, + hydrate: () => hydrate +}); +module.exports = __toCommonJS(hydration_exports); +var import_thenable = require("./thenable.cjs"); +var import_utils = require("./utils.cjs"); +function defaultTransformerFn(data) { + return data; +} +function dehydrateMutation(mutation) { + return { + mutationKey: mutation.options.mutationKey, + state: mutation.state, + ...mutation.options.scope && { scope: mutation.options.scope }, + ...mutation.meta && { meta: mutation.meta } + }; +} +function dehydrateQuery(query, serializeData, shouldRedactErrors) { + const dehydratePromise = () => { + const promise = query.promise?.then(serializeData).catch((error) => { + if (!shouldRedactErrors(error)) { + return Promise.reject(error); + } + if (process.env.NODE_ENV !== "production") { + console.error( + `A query that was dehydrated as pending ended up rejecting. [${query.queryHash}]: ${error}; The error will be redacted in production builds` + ); + } + return Promise.reject(new Error("redacted")); + }); + promise?.catch(import_utils.noop); + return promise; + }; + return { + dehydratedAt: Date.now(), + state: { + ...query.state, + ...query.state.data !== void 0 && { + data: serializeData(query.state.data) + } + }, + queryKey: query.queryKey, + queryHash: query.queryHash, + ...query.state.status === "pending" && { + promise: dehydratePromise() + }, + ...query.meta && { meta: query.meta } + }; +} +function defaultShouldDehydrateMutation(mutation) { + return mutation.state.isPaused; +} +function defaultShouldDehydrateQuery(query) { + return query.state.status === "success"; +} +function defaultShouldRedactErrors(_) { + return true; +} +function dehydrate(client, options = {}) { + const filterMutation = options.shouldDehydrateMutation ?? client.getDefaultOptions().dehydrate?.shouldDehydrateMutation ?? defaultShouldDehydrateMutation; + const mutations = client.getMutationCache().getAll().flatMap( + (mutation) => filterMutation(mutation) ? [dehydrateMutation(mutation)] : [] + ); + const filterQuery = options.shouldDehydrateQuery ?? client.getDefaultOptions().dehydrate?.shouldDehydrateQuery ?? defaultShouldDehydrateQuery; + const shouldRedactErrors = options.shouldRedactErrors ?? client.getDefaultOptions().dehydrate?.shouldRedactErrors ?? defaultShouldRedactErrors; + const serializeData = options.serializeData ?? client.getDefaultOptions().dehydrate?.serializeData ?? defaultTransformerFn; + const queries = client.getQueryCache().getAll().flatMap( + (query) => filterQuery(query) ? [dehydrateQuery(query, serializeData, shouldRedactErrors)] : [] + ); + return { mutations, queries }; +} +function hydrate(client, dehydratedState, options) { + if (typeof dehydratedState !== "object" || dehydratedState === null) { + return; + } + const mutationCache = client.getMutationCache(); + const queryCache = client.getQueryCache(); + const deserializeData = options?.defaultOptions?.deserializeData ?? client.getDefaultOptions().hydrate?.deserializeData ?? defaultTransformerFn; + const mutations = dehydratedState.mutations || []; + const queries = dehydratedState.queries || []; + mutations.forEach(({ state, ...mutationOptions }) => { + mutationCache.build( + client, + { + ...client.getDefaultOptions().hydrate?.mutations, + ...options?.defaultOptions?.mutations, + ...mutationOptions + }, + state + ); + }); + queries.forEach( + ({ queryKey, state, queryHash, meta, promise, dehydratedAt }) => { + const syncData = promise ? (0, import_thenable.tryResolveSync)(promise) : void 0; + const rawData = state.data === void 0 ? syncData?.data : state.data; + const data = rawData === void 0 ? rawData : deserializeData(rawData); + let query = queryCache.get(queryHash); + const existingQueryIsPending = query?.state.status === "pending"; + const existingQueryIsFetching = query?.state.fetchStatus === "fetching"; + if (query) { + const hasNewerSyncData = syncData && // We only need this undefined check to handle older dehydration + // payloads that might not have dehydratedAt + dehydratedAt !== void 0 && dehydratedAt > query.state.dataUpdatedAt; + if (state.dataUpdatedAt > query.state.dataUpdatedAt || hasNewerSyncData) { + const { fetchStatus: _ignored, ...serializedState } = state; + query.setState({ + ...serializedState, + data + }); + } + } else { + query = queryCache.build( + client, + { + ...client.getDefaultOptions().hydrate?.queries, + ...options?.defaultOptions?.queries, + queryKey, + queryHash, + meta + }, + // Reset fetch status to idle to avoid + // query being stuck in fetching state upon hydration + { + ...state, + data, + fetchStatus: "idle", + status: data !== void 0 ? "success" : state.status + } + ); + } + if (promise && !existingQueryIsPending && !existingQueryIsFetching && // Only hydrate if dehydration is newer than any existing data, + // this is always true for new queries + (dehydratedAt === void 0 || dehydratedAt > query.state.dataUpdatedAt)) { + query.fetch(void 0, { + // RSC transformed promises are not thenable + initialPromise: Promise.resolve(promise).then(deserializeData) + }).catch(import_utils.noop); + } + } + ); +} +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + defaultShouldDehydrateMutation, + defaultShouldDehydrateQuery, + dehydrate, + hydrate +}); +//# sourceMappingURL=hydration.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/hydration.cjs.map b/node_modules/@tanstack/query-core/build/modern/hydration.cjs.map new file mode 100644 index 0000000..ba920cb --- /dev/null +++ b/node_modules/@tanstack/query-core/build/modern/hydration.cjs.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/hydration.ts"],"sourcesContent":["import { tryResolveSync } from './thenable'\nimport { noop } from './utils'\nimport type {\n DefaultError,\n MutationKey,\n MutationMeta,\n MutationOptions,\n MutationScope,\n QueryKey,\n QueryMeta,\n QueryOptions,\n} from './types'\nimport type { QueryClient } from './queryClient'\nimport type { Query, QueryState } from './query'\nimport type { Mutation, MutationState } from './mutation'\n\n// TYPES\ntype TransformerFn = (data: any) => any\nfunction defaultTransformerFn(data: any): any {\n return data\n}\n\nexport interface DehydrateOptions {\n serializeData?: TransformerFn\n shouldDehydrateMutation?: (mutation: Mutation) => boolean\n shouldDehydrateQuery?: (query: Query) => boolean\n shouldRedactErrors?: (error: unknown) => boolean\n}\n\nexport interface HydrateOptions {\n defaultOptions?: {\n deserializeData?: TransformerFn\n queries?: QueryOptions\n mutations?: MutationOptions\n }\n}\n\ninterface DehydratedMutation {\n mutationKey?: MutationKey\n state: MutationState\n meta?: MutationMeta\n scope?: MutationScope\n}\n\ninterface DehydratedQuery {\n queryHash: string\n queryKey: QueryKey\n state: QueryState\n promise?: Promise\n meta?: QueryMeta\n // This is only optional because older versions of Query might have dehydrated\n // without it which we need to handle for backwards compatibility.\n // This should be changed to required in the future.\n dehydratedAt?: number\n}\n\nexport interface DehydratedState {\n mutations: Array\n queries: Array\n}\n\n// FUNCTIONS\n\nfunction dehydrateMutation(mutation: Mutation): DehydratedMutation {\n return {\n mutationKey: mutation.options.mutationKey,\n state: mutation.state,\n ...(mutation.options.scope && { scope: mutation.options.scope }),\n ...(mutation.meta && { meta: mutation.meta }),\n }\n}\n\n// Most config is not dehydrated but instead meant to configure again when\n// consuming the de/rehydrated data, typically with useQuery on the client.\n// Sometimes it might make sense to prefetch data on the server and include\n// in the html-payload, but not consume it on the initial render.\nfunction dehydrateQuery(\n query: Query,\n serializeData: TransformerFn,\n shouldRedactErrors: (error: unknown) => boolean,\n): DehydratedQuery {\n const dehydratePromise = () => {\n const promise = query.promise?.then(serializeData).catch((error) => {\n if (!shouldRedactErrors(error)) {\n // Reject original error if it should not be redacted\n return Promise.reject(error)\n }\n // If not in production, log original error before rejecting redacted error\n if (process.env.NODE_ENV !== 'production') {\n console.error(\n `A query that was dehydrated as pending ended up rejecting. [${query.queryHash}]: ${error}; The error will be redacted in production builds`,\n )\n }\n return Promise.reject(new Error('redacted'))\n })\n\n // Avoid unhandled promise rejections\n // We need the promise we dehydrate to reject to get the correct result into\n // the query cache, but we also want to avoid unhandled promise rejections\n // in whatever environment the prefetches are happening in.\n promise?.catch(noop)\n\n return promise\n }\n\n return {\n dehydratedAt: Date.now(),\n state: {\n ...query.state,\n ...(query.state.data !== undefined && {\n data: serializeData(query.state.data),\n }),\n },\n queryKey: query.queryKey,\n queryHash: query.queryHash,\n ...(query.state.status === 'pending' && {\n promise: dehydratePromise(),\n }),\n ...(query.meta && { meta: query.meta }),\n }\n}\n\nexport function defaultShouldDehydrateMutation(mutation: Mutation) {\n return mutation.state.isPaused\n}\n\nexport function defaultShouldDehydrateQuery(query: Query) {\n return query.state.status === 'success'\n}\n\nfunction defaultShouldRedactErrors(_: unknown) {\n return true\n}\n\nexport function dehydrate(\n client: QueryClient,\n options: DehydrateOptions = {},\n): DehydratedState {\n const filterMutation =\n options.shouldDehydrateMutation ??\n client.getDefaultOptions().dehydrate?.shouldDehydrateMutation ??\n defaultShouldDehydrateMutation\n\n const mutations = client\n .getMutationCache()\n .getAll()\n .flatMap((mutation) =>\n filterMutation(mutation) ? [dehydrateMutation(mutation)] : [],\n )\n\n const filterQuery =\n options.shouldDehydrateQuery ??\n client.getDefaultOptions().dehydrate?.shouldDehydrateQuery ??\n defaultShouldDehydrateQuery\n\n const shouldRedactErrors =\n options.shouldRedactErrors ??\n client.getDefaultOptions().dehydrate?.shouldRedactErrors ??\n defaultShouldRedactErrors\n\n const serializeData =\n options.serializeData ??\n client.getDefaultOptions().dehydrate?.serializeData ??\n defaultTransformerFn\n\n const queries = client\n .getQueryCache()\n .getAll()\n .flatMap((query) =>\n filterQuery(query)\n ? [dehydrateQuery(query, serializeData, shouldRedactErrors)]\n : [],\n )\n\n return { mutations, queries }\n}\n\nexport function hydrate(\n client: QueryClient,\n dehydratedState: unknown,\n options?: HydrateOptions,\n): void {\n if (typeof dehydratedState !== 'object' || dehydratedState === null) {\n return\n }\n\n const mutationCache = client.getMutationCache()\n const queryCache = client.getQueryCache()\n const deserializeData =\n options?.defaultOptions?.deserializeData ??\n client.getDefaultOptions().hydrate?.deserializeData ??\n defaultTransformerFn\n\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n const mutations = (dehydratedState as DehydratedState).mutations || []\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n const queries = (dehydratedState as DehydratedState).queries || []\n\n mutations.forEach(({ state, ...mutationOptions }) => {\n mutationCache.build(\n client,\n {\n ...client.getDefaultOptions().hydrate?.mutations,\n ...options?.defaultOptions?.mutations,\n ...mutationOptions,\n },\n state,\n )\n })\n\n queries.forEach(\n ({ queryKey, state, queryHash, meta, promise, dehydratedAt }) => {\n const syncData = promise ? tryResolveSync(promise) : undefined\n const rawData = state.data === undefined ? syncData?.data : state.data\n const data = rawData === undefined ? rawData : deserializeData(rawData)\n\n let query = queryCache.get(queryHash)\n const existingQueryIsPending = query?.state.status === 'pending'\n const existingQueryIsFetching = query?.state.fetchStatus === 'fetching'\n\n // Do not hydrate if an existing query exists with newer data\n if (query) {\n const hasNewerSyncData =\n syncData &&\n // We only need this undefined check to handle older dehydration\n // payloads that might not have dehydratedAt\n dehydratedAt !== undefined &&\n dehydratedAt > query.state.dataUpdatedAt\n if (\n state.dataUpdatedAt > query.state.dataUpdatedAt ||\n hasNewerSyncData\n ) {\n // omit fetchStatus from dehydrated state\n // so that query stays in its current fetchStatus\n const { fetchStatus: _ignored, ...serializedState } = state\n query.setState({\n ...serializedState,\n data,\n })\n }\n } else {\n // Restore query\n query = queryCache.build(\n client,\n {\n ...client.getDefaultOptions().hydrate?.queries,\n ...options?.defaultOptions?.queries,\n queryKey,\n queryHash,\n meta,\n },\n // Reset fetch status to idle to avoid\n // query being stuck in fetching state upon hydration\n {\n ...state,\n data,\n fetchStatus: 'idle',\n status: data !== undefined ? 'success' : state.status,\n },\n )\n }\n\n if (\n promise &&\n !existingQueryIsPending &&\n !existingQueryIsFetching &&\n // Only hydrate if dehydration is newer than any existing data,\n // this is always true for new queries\n (dehydratedAt === undefined || dehydratedAt > query.state.dataUpdatedAt)\n ) {\n // This doesn't actually fetch - it just creates a retryer\n // which will re-use the passed `initialPromise`\n // Note that we need to call these even when data was synchronously\n // available, as we still need to set up the retryer\n query\n .fetch(undefined, {\n // RSC transformed promises are not thenable\n initialPromise: Promise.resolve(promise).then(deserializeData),\n })\n // Avoid unhandled promise rejections\n .catch(noop)\n }\n },\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAA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A,MACf;AAAA,IACF;AAAA,EACF;AACF;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/hydration.d.cts b/node_modules/@tanstack/query-core/build/modern/hydration.d.cts new file mode 100644 index 0000000..1681473 --- /dev/null +++ b/node_modules/@tanstack/query-core/build/modern/hydration.d.cts @@ -0,0 +1,3 @@ +export { w as DehydrateOptions, D as DehydratedState, H as HydrateOptions, d as defaultShouldDehydrateMutation, a as defaultShouldDehydrateQuery, b as dehydrate, h as hydrate } from './hydration-uphG6M-i.cjs'; +import './removable.cjs'; +import './subscribable.cjs'; diff --git a/node_modules/@tanstack/query-core/build/modern/hydration.d.ts b/node_modules/@tanstack/query-core/build/modern/hydration.d.ts new file mode 100644 index 0000000..e507d39 --- /dev/null +++ b/node_modules/@tanstack/query-core/build/modern/hydration.d.ts @@ -0,0 +1,3 @@ +export { w as DehydrateOptions, D as DehydratedState, H as HydrateOptions, d as defaultShouldDehydrateMutation, a as defaultShouldDehydrateQuery, b as dehydrate, h as hydrate } from './hydration-BlEVG2Lp.js'; +import './removable.js'; +import './subscribable.js'; diff --git a/node_modules/@tanstack/query-core/build/modern/hydration.js b/node_modules/@tanstack/query-core/build/modern/hydration.js new file mode 100644 index 0000000..0e5e5ae --- /dev/null +++ b/node_modules/@tanstack/query-core/build/modern/hydration.js @@ -0,0 +1,145 @@ +// src/hydration.ts +import { tryResolveSync } from "./thenable.js"; +import { noop } from "./utils.js"; +function defaultTransformerFn(data) { + return data; +} +function dehydrateMutation(mutation) { + return { + mutationKey: mutation.options.mutationKey, + state: mutation.state, + ...mutation.options.scope && { scope: mutation.options.scope }, + ...mutation.meta && { meta: mutation.meta } + }; +} +function dehydrateQuery(query, serializeData, shouldRedactErrors) { + const dehydratePromise = () => { + const promise = query.promise?.then(serializeData).catch((error) => { + if (!shouldRedactErrors(error)) { + return Promise.reject(error); + } + if (process.env.NODE_ENV !== "production") { + console.error( + `A query that was dehydrated as pending ended up rejecting. [${query.queryHash}]: ${error}; The error will be redacted in production builds` + ); + } + return Promise.reject(new Error("redacted")); + }); + promise?.catch(noop); + return promise; + }; + return { + dehydratedAt: Date.now(), + state: { + ...query.state, + ...query.state.data !== void 0 && { + data: serializeData(query.state.data) + } + }, + queryKey: query.queryKey, + queryHash: query.queryHash, + ...query.state.status === "pending" && { + promise: dehydratePromise() + }, + ...query.meta && { meta: query.meta } + }; +} +function defaultShouldDehydrateMutation(mutation) { + return mutation.state.isPaused; +} +function defaultShouldDehydrateQuery(query) { + return query.state.status === "success"; +} +function defaultShouldRedactErrors(_) { + return true; +} +function dehydrate(client, options = {}) { + const filterMutation = options.shouldDehydrateMutation ?? client.getDefaultOptions().dehydrate?.shouldDehydrateMutation ?? defaultShouldDehydrateMutation; + const mutations = client.getMutationCache().getAll().flatMap( + (mutation) => filterMutation(mutation) ? [dehydrateMutation(mutation)] : [] + ); + const filterQuery = options.shouldDehydrateQuery ?? client.getDefaultOptions().dehydrate?.shouldDehydrateQuery ?? defaultShouldDehydrateQuery; + const shouldRedactErrors = options.shouldRedactErrors ?? client.getDefaultOptions().dehydrate?.shouldRedactErrors ?? defaultShouldRedactErrors; + const serializeData = options.serializeData ?? client.getDefaultOptions().dehydrate?.serializeData ?? defaultTransformerFn; + const queries = client.getQueryCache().getAll().flatMap( + (query) => filterQuery(query) ? [dehydrateQuery(query, serializeData, shouldRedactErrors)] : [] + ); + return { mutations, queries }; +} +function hydrate(client, dehydratedState, options) { + if (typeof dehydratedState !== "object" || dehydratedState === null) { + return; + } + const mutationCache = client.getMutationCache(); + const queryCache = client.getQueryCache(); + const deserializeData = options?.defaultOptions?.deserializeData ?? client.getDefaultOptions().hydrate?.deserializeData ?? defaultTransformerFn; + const mutations = dehydratedState.mutations || []; + const queries = dehydratedState.queries || []; + mutations.forEach(({ state, ...mutationOptions }) => { + mutationCache.build( + client, + { + ...client.getDefaultOptions().hydrate?.mutations, + ...options?.defaultOptions?.mutations, + ...mutationOptions + }, + state + ); + }); + queries.forEach( + ({ queryKey, state, queryHash, meta, promise, dehydratedAt }) => { + const syncData = promise ? tryResolveSync(promise) : void 0; + const rawData = state.data === void 0 ? syncData?.data : state.data; + const data = rawData === void 0 ? rawData : deserializeData(rawData); + let query = queryCache.get(queryHash); + const existingQueryIsPending = query?.state.status === "pending"; + const existingQueryIsFetching = query?.state.fetchStatus === "fetching"; + if (query) { + const hasNewerSyncData = syncData && // We only need this undefined check to handle older dehydration + // payloads that might not have dehydratedAt + dehydratedAt !== void 0 && dehydratedAt > query.state.dataUpdatedAt; + if (state.dataUpdatedAt > query.state.dataUpdatedAt || hasNewerSyncData) { + const { fetchStatus: _ignored, ...serializedState } = state; + query.setState({ + ...serializedState, + data + }); + } + } else { + query = queryCache.build( + client, + { + ...client.getDefaultOptions().hydrate?.queries, + ...options?.defaultOptions?.queries, + queryKey, + queryHash, + meta + }, + // Reset fetch status to idle to avoid + // query being stuck in fetching state upon hydration + { + ...state, + data, + fetchStatus: "idle", + status: data !== void 0 ? "success" : state.status + } + ); + } + if (promise && !existingQueryIsPending && !existingQueryIsFetching && // Only hydrate if dehydration is newer than any existing data, + // this is always true for new queries + (dehydratedAt === void 0 || dehydratedAt > query.state.dataUpdatedAt)) { + query.fetch(void 0, { + // RSC transformed promises are not thenable + initialPromise: Promise.resolve(promise).then(deserializeData) + }).catch(noop); + } + } + ); +} +export { + defaultShouldDehydrateMutation, + defaultShouldDehydrateQuery, + dehydrate, + hydrate +}; +//# sourceMappingURL=hydration.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/hydration.js.map b/node_modules/@tanstack/query-core/build/modern/hydration.js.map new file mode 100644 index 0000000..98457e7 --- /dev/null +++ b/node_modules/@tanstack/query-core/build/modern/hydration.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/hydration.ts"],"sourcesContent":["import { tryResolveSync } from './thenable'\nimport { noop } from './utils'\nimport type {\n DefaultError,\n MutationKey,\n MutationMeta,\n MutationOptions,\n MutationScope,\n QueryKey,\n QueryMeta,\n QueryOptions,\n} from './types'\nimport type { QueryClient } from './queryClient'\nimport type { Query, QueryState } from './query'\nimport type { Mutation, MutationState } from './mutation'\n\n// TYPES\ntype TransformerFn = (data: any) => any\nfunction defaultTransformerFn(data: any): any {\n return data\n}\n\nexport interface DehydrateOptions {\n serializeData?: TransformerFn\n shouldDehydrateMutation?: (mutation: Mutation) => boolean\n shouldDehydrateQuery?: (query: Query) => boolean\n shouldRedactErrors?: (error: unknown) => boolean\n}\n\nexport interface HydrateOptions {\n defaultOptions?: {\n deserializeData?: TransformerFn\n queries?: QueryOptions\n mutations?: MutationOptions\n }\n}\n\ninterface DehydratedMutation {\n mutationKey?: MutationKey\n state: MutationState\n meta?: MutationMeta\n scope?: MutationScope\n}\n\ninterface DehydratedQuery {\n queryHash: string\n queryKey: QueryKey\n state: QueryState\n promise?: Promise\n meta?: QueryMeta\n // This is only optional because older versions of Query might have dehydrated\n // without it which we need to handle for backwards compatibility.\n // This should be changed to required in the future.\n dehydratedAt?: number\n}\n\nexport interface DehydratedState {\n mutations: Array\n queries: Array\n}\n\n// FUNCTIONS\n\nfunction dehydrateMutation(mutation: Mutation): DehydratedMutation {\n return {\n mutationKey: mutation.options.mutationKey,\n state: mutation.state,\n ...(mutation.options.scope && { scope: mutation.options.scope }),\n ...(mutation.meta && { meta: mutation.meta }),\n }\n}\n\n// Most config is not dehydrated but instead meant to configure again when\n// consuming the de/rehydrated data, typically with useQuery on the client.\n// Sometimes it might make sense to prefetch data on the server and include\n// in the html-payload, but not consume it on the initial render.\nfunction dehydrateQuery(\n query: Query,\n serializeData: TransformerFn,\n shouldRedactErrors: (error: unknown) => boolean,\n): DehydratedQuery {\n const dehydratePromise = () => {\n const promise = query.promise?.then(serializeData).catch((error) => {\n if (!shouldRedactErrors(error)) {\n // Reject original error if it should not be redacted\n return Promise.reject(error)\n }\n // If not in production, log original error before rejecting redacted error\n if (process.env.NODE_ENV !== 'production') {\n console.error(\n `A query that was dehydrated as pending ended up rejecting. [${query.queryHash}]: ${error}; The error will be redacted in production builds`,\n )\n }\n return Promise.reject(new Error('redacted'))\n })\n\n // Avoid unhandled promise rejections\n // We need the promise we dehydrate to reject to get the correct result into\n // the query cache, but we also want to avoid unhandled promise rejections\n // in whatever environment the prefetches are happening in.\n promise?.catch(noop)\n\n return promise\n }\n\n return {\n dehydratedAt: Date.now(),\n state: {\n ...query.state,\n ...(query.state.data !== undefined && {\n data: serializeData(query.state.data),\n }),\n },\n queryKey: query.queryKey,\n queryHash: query.queryHash,\n ...(query.state.status === 'pending' && {\n promise: dehydratePromise(),\n }),\n ...(query.meta && { meta: query.meta }),\n }\n}\n\nexport function defaultShouldDehydrateMutation(mutation: Mutation) {\n return mutation.state.isPaused\n}\n\nexport function defaultShouldDehydrateQuery(query: Query) {\n return query.state.status === 'success'\n}\n\nfunction defaultShouldRedactErrors(_: unknown) {\n return true\n}\n\nexport function dehydrate(\n client: QueryClient,\n options: DehydrateOptions = {},\n): DehydratedState {\n const filterMutation =\n options.shouldDehydrateMutation ??\n client.getDefaultOptions().dehydrate?.shouldDehydrateMutation ??\n defaultShouldDehydrateMutation\n\n const mutations = client\n .getMutationCache()\n .getAll()\n .flatMap((mutation) =>\n filterMutation(mutation) ? [dehydrateMutation(mutation)] : [],\n )\n\n const filterQuery =\n options.shouldDehydrateQuery ??\n client.getDefaultOptions().dehydrate?.shouldDehydrateQuery ??\n defaultShouldDehydrateQuery\n\n const shouldRedactErrors =\n options.shouldRedactErrors ??\n client.getDefaultOptions().dehydrate?.shouldRedactErrors ??\n defaultShouldRedactErrors\n\n const serializeData =\n options.serializeData ??\n client.getDefaultOptions().dehydrate?.serializeData ??\n defaultTransformerFn\n\n const queries = client\n .getQueryCache()\n .getAll()\n .flatMap((query) =>\n filterQuery(query)\n ? [dehydrateQuery(query, serializeData, shouldRedactErrors)]\n : [],\n )\n\n return { mutations, queries }\n}\n\nexport function hydrate(\n client: QueryClient,\n dehydratedState: unknown,\n options?: HydrateOptions,\n): void {\n if (typeof dehydratedState !== 'object' || dehydratedState === null) {\n return\n }\n\n const mutationCache = client.getMutationCache()\n const queryCache = client.getQueryCache()\n const deserializeData =\n options?.defaultOptions?.deserializeData ??\n client.getDefaultOptions().hydrate?.deserializeData ??\n defaultTransformerFn\n\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n const mutations = (dehydratedState as DehydratedState).mutations || []\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n const queries = (dehydratedState as DehydratedState).queries || []\n\n mutations.forEach(({ state, ...mutationOptions }) => {\n mutationCache.build(\n client,\n {\n ...client.getDefaultOptions().hydrate?.mutations,\n ...options?.defaultOptions?.mutations,\n ...mutationOptions,\n },\n state,\n )\n })\n\n queries.forEach(\n ({ queryKey, state, queryHash, meta, promise, dehydratedAt }) => {\n const syncData = promise ? tryResolveSync(promise) : undefined\n const rawData = state.data === undefined ? syncData?.data : state.data\n const data = rawData === undefined ? rawData : deserializeData(rawData)\n\n let query = queryCache.get(queryHash)\n const existingQueryIsPending = query?.state.status === 'pending'\n const existingQueryIsFetching = query?.state.fetchStatus === 'fetching'\n\n // Do not hydrate if an existing query exists with newer data\n if (query) {\n const hasNewerSyncData =\n syncData &&\n // We only need this undefined check to handle older dehydration\n // payloads that might not have dehydratedAt\n dehydratedAt !== undefined &&\n dehydratedAt > query.state.dataUpdatedAt\n if (\n state.dataUpdatedAt > query.state.dataUpdatedAt ||\n hasNewerSyncData\n ) {\n // omit fetchStatus from dehydrated state\n // so that query stays in its current fetchStatus\n const { fetchStatus: _ignored, ...serializedState } = state\n query.setState({\n ...serializedState,\n data,\n })\n }\n } else {\n // Restore query\n query = queryCache.build(\n client,\n {\n ...client.getDefaultOptions().hydrate?.queries,\n ...options?.defaultOptions?.queries,\n queryKey,\n queryHash,\n meta,\n },\n // Reset fetch status to idle to avoid\n // query being stuck in fetching state upon hydration\n {\n ...state,\n data,\n fetchStatus: 'idle',\n status: data !== undefined ? 'success' : state.status,\n },\n )\n }\n\n if (\n promise &&\n !existingQueryIsPending &&\n !existingQueryIsFetching &&\n // Only hydrate if dehydration is newer than any existing data,\n // this is always true for new queries\n (dehydratedAt === undefined || dehydratedAt > query.state.dataUpdatedAt)\n ) {\n // This doesn't actually fetch - it just creates a retryer\n // which will re-use the passed `initialPromise`\n // Note that we need to call these even when data was synchronously\n // available, as we still need to set up the retryer\n query\n .fetch(undefined, {\n // RSC transformed promises are not thenable\n initialPromise: Promise.resolve(promise).then(deserializeData),\n })\n // Avoid unhandled promise rejections\n .catch(noop)\n }\n },\n )\n}\n"],"mappings":";AAAA,SAAS,sBAAsB;AAC/B,SAAS,YAAY;AAiBrB,SAAS,qBAAqB,MAAgB;AAC5C,SAAO;AACT;AA2CA,SAAS,kBAAkB,UAAwC;AACjE,SAAO;AAAA,IACL,aAAa,SAAS,QAAQ;AAAA,IAC9B,OAAO,SAAS;AAAA,IAChB,GAAI,SAAS,QAAQ,SAAS,EAAE,OAAO,SAAS,QAAQ,MAAM;AAAA,IAC9D,GAAI,SAAS,QAAQ,EAAE,MAAM,SAAS,KAAK;AAAA,EAC7C;AACF;AAMA,SAAS,eACP,OACA,eACA,oBACiB;AACjB,QAAM,mBAAmB,MAAM;AAC7B,UAAM,UAAU,MAAM,SAAS,KAAK,aAAa,EAAE,MAAM,CAAC,UAAU;AAClE,UAAI,CAAC,mBAAmB,KAAK,GAAG;AAE9B,eAAO,QAAQ,OAAO,KAAK;AAAA,MAC7B;AAEA,UAAI,QAAQ,IAAI,aAAa,cAAc;AACzC,gBAAQ;AAAA,UACN,+DAA+D,MAAM,SAAS,MAAM,KAAK;AAAA,QAC3F;AAAA,MACF;AACA,aAAO,QAAQ,OAAO,IAAI,MAAM,UAAU,CAAC;AAAA,IAC7C,CAAC;AAMD,aAAS,MAAM,IAAI;AAEnB,WAAO;AAAA,EACT;AAEA,SAAO;AAAA,IACL,cAAc,KAAK,IAAI;AAAA,IACvB,OAAO;AAAA,MACL,GAAG,MAAM;AAAA,MACT,GAAI,MAAM,MAAM,SAAS,UAAa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,YACA,aAAa;AAAA,YACb,QAAQ,SAAS,SAAY,YAAY,MAAM;AAAA,UACjD;AAAA,QACF;AAAA,MACF;AAEA,UACE,WACA,CAAC,0BACD,CAAC;AAAA;AAAA,OAGA,iBAAiB,UAAa,eAAe,MAAM,MAAM,gBAC1D;AAKA,cACG,MAAM,QAAW;AAAA;AAAA,UAEhB,gBAAgB,QAAQ,QAAQ,OAAO,EAAE,KAAK,eAAe;AAAA,QAC/D,CAAC,EAEA,MAAM,IAAI;AAAA,MACf;AAAA,IACF;AAAA,EACF;AACF;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/index.cjs b/node_modules/@tanstack/query-core/build/modern/index.cjs new file mode 100644 index 0000000..cac316e --- /dev/null +++ b/node_modules/@tanstack/query-core/build/modern/index.cjs @@ -0,0 +1,110 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default")); +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/index.ts +var index_exports = {}; +__export(index_exports, { + CancelledError: () => import_retryer.CancelledError, + InfiniteQueryObserver: () => import_infiniteQueryObserver.InfiniteQueryObserver, + Mutation: () => import_mutation.Mutation, + MutationCache: () => import_mutationCache.MutationCache, + MutationObserver: () => import_mutationObserver.MutationObserver, + QueriesObserver: () => import_queriesObserver.QueriesObserver, + Query: () => import_query.Query, + QueryCache: () => import_queryCache.QueryCache, + QueryClient: () => import_queryClient.QueryClient, + QueryObserver: () => import_queryObserver.QueryObserver, + defaultScheduler: () => import_notifyManager.defaultScheduler, + defaultShouldDehydrateMutation: () => import_hydration.defaultShouldDehydrateMutation, + defaultShouldDehydrateQuery: () => import_hydration.defaultShouldDehydrateQuery, + dehydrate: () => import_hydration.dehydrate, + experimental_streamedQuery: () => import_streamedQuery.streamedQuery, + focusManager: () => import_focusManager.focusManager, + hashKey: () => import_utils.hashKey, + hydrate: () => import_hydration.hydrate, + isCancelledError: () => import_retryer.isCancelledError, + isServer: () => import_utils.isServer, + keepPreviousData: () => import_utils.keepPreviousData, + matchMutation: () => import_utils.matchMutation, + matchQuery: () => import_utils.matchQuery, + noop: () => import_utils.noop, + notifyManager: () => import_notifyManager.notifyManager, + onlineManager: () => import_onlineManager.onlineManager, + partialMatchKey: () => import_utils.partialMatchKey, + replaceEqualDeep: () => import_utils.replaceEqualDeep, + shouldThrowError: () => import_utils.shouldThrowError, + skipToken: () => import_utils.skipToken, + timeoutManager: () => import_timeoutManager.timeoutManager +}); +module.exports = __toCommonJS(index_exports); +var import_focusManager = require("./focusManager.cjs"); +var import_hydration = require("./hydration.cjs"); +var import_infiniteQueryObserver = require("./infiniteQueryObserver.cjs"); +var import_mutationCache = require("./mutationCache.cjs"); +var import_mutationObserver = require("./mutationObserver.cjs"); +var import_notifyManager = require("./notifyManager.cjs"); +var import_onlineManager = require("./onlineManager.cjs"); +var import_queriesObserver = require("./queriesObserver.cjs"); +var import_queryCache = require("./queryCache.cjs"); +var import_queryClient = require("./queryClient.cjs"); +var import_queryObserver = require("./queryObserver.cjs"); +var import_retryer = require("./retryer.cjs"); +var import_timeoutManager = require("./timeoutManager.cjs"); +var import_utils = require("./utils.cjs"); +var import_streamedQuery = require("./streamedQuery.cjs"); +var import_mutation = require("./mutation.cjs"); +var import_query = require("./query.cjs"); +__reExport(index_exports, require("./types.cjs"), module.exports); +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + CancelledError, + InfiniteQueryObserver, + Mutation, + MutationCache, + MutationObserver, + QueriesObserver, + Query, + QueryCache, + QueryClient, + QueryObserver, + defaultScheduler, + defaultShouldDehydrateMutation, + defaultShouldDehydrateQuery, + dehydrate, + experimental_streamedQuery, + focusManager, + hashKey, + hydrate, + isCancelledError, + isServer, + keepPreviousData, + matchMutation, + matchQuery, + noop, + notifyManager, + onlineManager, + partialMatchKey, + replaceEqualDeep, + shouldThrowError, + skipToken, + timeoutManager, + ...require("./types.cjs") +}); +//# sourceMappingURL=index.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/index.cjs.map b/node_modules/@tanstack/query-core/build/modern/index.cjs.map new file mode 100644 index 0000000..239bda0 --- /dev/null +++ b/node_modules/@tanstack/query-core/build/modern/index.cjs.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/index.ts"],"sourcesContent":["/* istanbul ignore file */\n\nexport { focusManager } from './focusManager'\nexport {\n defaultShouldDehydrateMutation,\n defaultShouldDehydrateQuery,\n dehydrate,\n hydrate,\n} from './hydration'\nexport { InfiniteQueryObserver } from './infiniteQueryObserver'\nexport { MutationCache } from './mutationCache'\nexport type { MutationCacheNotifyEvent } from './mutationCache'\nexport { MutationObserver } from './mutationObserver'\nexport { defaultScheduler, notifyManager } from './notifyManager'\nexport { onlineManager } from './onlineManager'\nexport { QueriesObserver } from './queriesObserver'\nexport { QueryCache } from './queryCache'\nexport type { QueryCacheNotifyEvent } from './queryCache'\nexport { QueryClient } from './queryClient'\nexport { QueryObserver } from './queryObserver'\nexport { CancelledError, isCancelledError } from './retryer'\nexport {\n timeoutManager,\n type ManagedTimerId,\n type TimeoutCallback,\n type TimeoutProvider,\n} from './timeoutManager'\nexport {\n hashKey,\n isServer,\n keepPreviousData,\n matchMutation,\n matchQuery,\n noop,\n partialMatchKey,\n replaceEqualDeep,\n shouldThrowError,\n skipToken,\n} from './utils'\nexport type { MutationFilters, QueryFilters, SkipToken, Updater } from './utils'\n\nexport { streamedQuery as experimental_streamedQuery } from './streamedQuery'\n\n// Types\nexport type {\n DehydratedState,\n DehydrateOptions,\n HydrateOptions,\n} from './hydration'\nexport { Mutation } from './mutation'\nexport type { MutationState } from './mutation'\nexport type { QueriesObserverOptions } from './queriesObserver'\nexport { Query } from './query'\nexport type { QueryState } from './query'\nexport * from './types'\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,0BAA6B;AAC7B,uBAKO;AACP,mCAAsC;AACtC,2BAA8B;AAE9B,8BAAiC;AACjC,2BAAgD;AAChD,2BAA8B;AAC9B,6BAAgC;AAChC,wBAA2B;AAE3B,yBAA4B;AAC5B,2BAA8B;AAC9B,qBAAiD;AACjD,4BAKO;AACP,mBAWO;AAGP,2BAA4D;AAQ5D,sBAAyB;AAGzB,mBAAsB;AAEtB,0BAAc,wBAtDd;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/index.d.cts b/node_modules/@tanstack/query-core/build/modern/index.d.cts new file mode 100644 index 0000000..9d894bb --- /dev/null +++ b/node_modules/@tanstack/query-core/build/modern/index.d.cts @@ -0,0 +1,10 @@ +export { focusManager } from './focusManager.cjs'; +export { T as AnyDataTag, b7 as CancelOptions, C as CancelledError, V as DataTag, G as DefaultError, b6 as DefaultOptions, ak as DefaultedInfiniteQueryObserverOptions, ai as DefaultedQueryObserverOptions, aP as DefinedInfiniteQueryObserverResult, aG as DefinedQueryObserverResult, w as DehydrateOptions, D as DehydratedState, B as DistributiveOmit, $ as Enabled, an as EnsureInfiniteQueryDataOptions, am as EnsureQueryDataOptions, ao as FetchInfiniteQueryOptions, av as FetchNextPageOptions, aw as FetchPreviousPageOptions, al as FetchQueryOptions, ay as FetchStatus, a7 as GetNextPageParamFunction, a6 as GetPreviousPageParamFunction, H as HydrateOptions, W as InferDataFromTag, X as InferErrorFromTag, a8 as InfiniteData, aI as InfiniteQueryObserverBaseResult, aL as InfiniteQueryObserverLoadingErrorResult, aK as InfiniteQueryObserverLoadingResult, aj as InfiniteQueryObserverOptions, aJ as InfiniteQueryObserverPendingResult, aO as InfiniteQueryObserverPlaceholderResult, aM as InfiniteQueryObserverRefetchErrorResult, aQ as InfiniteQueryObserverResult, aN as InfiniteQueryObserverSuccessResult, ae as InfiniteQueryPageParamsOptions, a2 as InitialDataFunction, ad as InitialPageParam, at as InvalidateOptions, ar as InvalidateQueryFilters, a_ as MutateFunction, aZ as MutateOptions, x as Mutation, M as MutationCache, c as MutationCacheNotifyEvent, u as MutationFilters, aW as MutationFunction, aV as MutationFunctionContext, aR as MutationKey, aU as MutationMeta, e as MutationObserver, a$ as MutationObserverBaseResult, b2 as MutationObserverErrorResult, b0 as MutationObserverIdleResult, b1 as MutationObserverLoadingResult, aY as MutationObserverOptions, b4 as MutationObserverResult, b3 as MutationObserverSuccessResult, aX as MutationOptions, aT as MutationScope, y as MutationState, aS as MutationStatus, aa as NetworkMode, F as NoInfer, N as NonUndefinedGuard, ba as NotifyEvent, b9 as NotifyEventType, ab as NotifyOnChangeProps, O as OmitKeyof, E as Override, a3 as PlaceholderDataFunction, a4 as QueriesPlaceholderDataFunction, z as Query, Q as QueryCache, f as QueryCacheNotifyEvent, g as QueryClient, b5 as QueryClientConfig, v as QueryFilters, Y as QueryFunction, a1 as QueryFunctionContext, I as QueryKey, a5 as QueryKeyHashFunction, a9 as QueryMeta, i as QueryObserver, az as QueryObserverBaseResult, aC as QueryObserverLoadingErrorResult, aB as QueryObserverLoadingResult, ag as QueryObserverOptions, aA as QueryObserverPendingResult, aF as QueryObserverPlaceholderResult, aD as QueryObserverRefetchErrorResult, aH as QueryObserverResult, aE as QueryObserverSuccessResult, ac as QueryOptions, a0 as QueryPersister, A as QueryState, ax as QueryStatus, aq as RefetchOptions, as as RefetchQueryFilters, R as Register, au as ResetOptions, ap as ResultOptions, b8 as SetDataOptions, S as SkipToken, Z as StaleTime, _ as StaleTimeFunction, af as ThrowOnError, P as UnsetMarker, U as Updater, ah as WithRequired, K as dataTagErrorSymbol, J as dataTagSymbol, d as defaultShouldDehydrateMutation, a as defaultShouldDehydrateQuery, b as dehydrate, k as hashKey, h as hydrate, j as isCancelledError, l as isServer, m as keepPreviousData, n as matchMutation, o as matchQuery, p as noop, q as partialMatchKey, r as replaceEqualDeep, s as shouldThrowError, t as skipToken, L as unsetMarker } from './hydration-uphG6M-i.cjs'; +export { InfiniteQueryObserver } from './infiniteQueryObserver.cjs'; +export { defaultScheduler, notifyManager } from './notifyManager.cjs'; +export { onlineManager } from './onlineManager.cjs'; +export { QueriesObserver, QueriesObserverOptions } from './queriesObserver.cjs'; +export { ManagedTimerId, TimeoutCallback, TimeoutProvider, timeoutManager } from './timeoutManager.cjs'; +export { streamedQuery as experimental_streamedQuery } from './streamedQuery.cjs'; +import './subscribable.cjs'; +import './removable.cjs'; diff --git a/node_modules/@tanstack/query-core/build/modern/index.d.ts b/node_modules/@tanstack/query-core/build/modern/index.d.ts new file mode 100644 index 0000000..54af14c --- /dev/null +++ b/node_modules/@tanstack/query-core/build/modern/index.d.ts @@ -0,0 +1,10 @@ +export { focusManager } from './focusManager.js'; +export { T as AnyDataTag, b7 as CancelOptions, C as CancelledError, V as DataTag, G as DefaultError, b6 as DefaultOptions, ak as DefaultedInfiniteQueryObserverOptions, ai as DefaultedQueryObserverOptions, aP as DefinedInfiniteQueryObserverResult, aG as DefinedQueryObserverResult, w as DehydrateOptions, D as DehydratedState, B as DistributiveOmit, $ as Enabled, an as EnsureInfiniteQueryDataOptions, am as EnsureQueryDataOptions, ao as FetchInfiniteQueryOptions, av as FetchNextPageOptions, aw as FetchPreviousPageOptions, al as FetchQueryOptions, ay as FetchStatus, a7 as GetNextPageParamFunction, a6 as GetPreviousPageParamFunction, H as HydrateOptions, W as InferDataFromTag, X as InferErrorFromTag, a8 as InfiniteData, aI as InfiniteQueryObserverBaseResult, aL as InfiniteQueryObserverLoadingErrorResult, aK as InfiniteQueryObserverLoadingResult, aj as InfiniteQueryObserverOptions, aJ as InfiniteQueryObserverPendingResult, aO as InfiniteQueryObserverPlaceholderResult, aM as InfiniteQueryObserverRefetchErrorResult, aQ as InfiniteQueryObserverResult, aN as InfiniteQueryObserverSuccessResult, ae as InfiniteQueryPageParamsOptions, a2 as InitialDataFunction, ad as InitialPageParam, at as InvalidateOptions, ar as InvalidateQueryFilters, a_ as MutateFunction, aZ as MutateOptions, x as Mutation, M as MutationCache, c as MutationCacheNotifyEvent, u as MutationFilters, aW as MutationFunction, aV as MutationFunctionContext, aR as MutationKey, aU as MutationMeta, e as MutationObserver, a$ as MutationObserverBaseResult, b2 as MutationObserverErrorResult, b0 as MutationObserverIdleResult, b1 as MutationObserverLoadingResult, aY as MutationObserverOptions, b4 as MutationObserverResult, b3 as MutationObserverSuccessResult, aX as MutationOptions, aT as MutationScope, y as MutationState, aS as MutationStatus, aa as NetworkMode, F as NoInfer, N as NonUndefinedGuard, ba as NotifyEvent, b9 as NotifyEventType, ab as NotifyOnChangeProps, O as OmitKeyof, E as Override, a3 as PlaceholderDataFunction, a4 as QueriesPlaceholderDataFunction, z as Query, Q as QueryCache, f as QueryCacheNotifyEvent, g as QueryClient, b5 as QueryClientConfig, v as QueryFilters, Y as QueryFunction, a1 as QueryFunctionContext, I as QueryKey, a5 as QueryKeyHashFunction, a9 as QueryMeta, i as QueryObserver, az as QueryObserverBaseResult, aC as QueryObserverLoadingErrorResult, aB as QueryObserverLoadingResult, ag as QueryObserverOptions, aA as QueryObserverPendingResult, aF as QueryObserverPlaceholderResult, aD as QueryObserverRefetchErrorResult, aH as QueryObserverResult, aE as QueryObserverSuccessResult, ac as QueryOptions, a0 as QueryPersister, A as QueryState, ax as QueryStatus, aq as RefetchOptions, as as RefetchQueryFilters, R as Register, au as ResetOptions, ap as ResultOptions, b8 as SetDataOptions, S as SkipToken, Z as StaleTime, _ as StaleTimeFunction, af as ThrowOnError, P as UnsetMarker, U as Updater, ah as WithRequired, K as dataTagErrorSymbol, J as dataTagSymbol, d as defaultShouldDehydrateMutation, a as defaultShouldDehydrateQuery, b as dehydrate, k as hashKey, h as hydrate, j as isCancelledError, l as isServer, m as keepPreviousData, n as matchMutation, o as matchQuery, p as noop, q as partialMatchKey, r as replaceEqualDeep, s as shouldThrowError, t as skipToken, L as unsetMarker } from './hydration-BlEVG2Lp.js'; +export { InfiniteQueryObserver } from './infiniteQueryObserver.js'; +export { defaultScheduler, notifyManager } from './notifyManager.js'; +export { onlineManager } from './onlineManager.js'; +export { QueriesObserver, QueriesObserverOptions } from './queriesObserver.js'; +export { ManagedTimerId, TimeoutCallback, TimeoutProvider, timeoutManager } from './timeoutManager.js'; +export { streamedQuery as experimental_streamedQuery } from './streamedQuery.js'; +import './subscribable.js'; +import './removable.js'; diff --git a/node_modules/@tanstack/query-core/build/modern/index.js b/node_modules/@tanstack/query-core/build/modern/index.js new file mode 100644 index 0000000..f89f776 --- /dev/null +++ b/node_modules/@tanstack/query-core/build/modern/index.js @@ -0,0 +1,71 @@ +// src/index.ts +import { focusManager } from "./focusManager.js"; +import { + defaultShouldDehydrateMutation, + defaultShouldDehydrateQuery, + dehydrate, + hydrate +} from "./hydration.js"; +import { InfiniteQueryObserver } from "./infiniteQueryObserver.js"; +import { MutationCache } from "./mutationCache.js"; +import { MutationObserver } from "./mutationObserver.js"; +import { defaultScheduler, notifyManager } from "./notifyManager.js"; +import { onlineManager } from "./onlineManager.js"; +import { QueriesObserver } from "./queriesObserver.js"; +import { QueryCache } from "./queryCache.js"; +import { QueryClient } from "./queryClient.js"; +import { QueryObserver } from "./queryObserver.js"; +import { CancelledError, isCancelledError } from "./retryer.js"; +import { + timeoutManager +} from "./timeoutManager.js"; +import { + hashKey, + isServer, + keepPreviousData, + matchMutation, + matchQuery, + noop, + partialMatchKey, + replaceEqualDeep, + shouldThrowError, + skipToken +} from "./utils.js"; +import { streamedQuery } from "./streamedQuery.js"; +import { Mutation } from "./mutation.js"; +import { Query } from "./query.js"; +export * from "./types.js"; +export { + CancelledError, + InfiniteQueryObserver, + Mutation, + MutationCache, + MutationObserver, + QueriesObserver, + Query, + QueryCache, + QueryClient, + QueryObserver, + defaultScheduler, + defaultShouldDehydrateMutation, + defaultShouldDehydrateQuery, + dehydrate, + streamedQuery as experimental_streamedQuery, + focusManager, + hashKey, + hydrate, + isCancelledError, + isServer, + keepPreviousData, + matchMutation, + matchQuery, + noop, + notifyManager, + onlineManager, + partialMatchKey, + replaceEqualDeep, + shouldThrowError, + skipToken, + timeoutManager +}; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/index.js.map b/node_modules/@tanstack/query-core/build/modern/index.js.map new file mode 100644 index 0000000..3f4b520 --- /dev/null +++ b/node_modules/@tanstack/query-core/build/modern/index.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/index.ts"],"sourcesContent":["/* istanbul ignore file */\n\nexport { focusManager } from './focusManager'\nexport {\n defaultShouldDehydrateMutation,\n defaultShouldDehydrateQuery,\n dehydrate,\n hydrate,\n} from './hydration'\nexport { InfiniteQueryObserver } from './infiniteQueryObserver'\nexport { MutationCache } from './mutationCache'\nexport type { MutationCacheNotifyEvent } from './mutationCache'\nexport { MutationObserver } from './mutationObserver'\nexport { defaultScheduler, notifyManager } from './notifyManager'\nexport { onlineManager } from './onlineManager'\nexport { QueriesObserver } from './queriesObserver'\nexport { QueryCache } from './queryCache'\nexport type { QueryCacheNotifyEvent } from './queryCache'\nexport { QueryClient } from './queryClient'\nexport { QueryObserver } from './queryObserver'\nexport { CancelledError, isCancelledError } from './retryer'\nexport {\n timeoutManager,\n type ManagedTimerId,\n type TimeoutCallback,\n type TimeoutProvider,\n} from './timeoutManager'\nexport {\n hashKey,\n isServer,\n keepPreviousData,\n matchMutation,\n matchQuery,\n noop,\n partialMatchKey,\n replaceEqualDeep,\n shouldThrowError,\n skipToken,\n} from './utils'\nexport type { MutationFilters, QueryFilters, SkipToken, Updater } from './utils'\n\nexport { streamedQuery as experimental_streamedQuery } from './streamedQuery'\n\n// Types\nexport type {\n DehydratedState,\n DehydrateOptions,\n HydrateOptions,\n} from './hydration'\nexport { Mutation } from './mutation'\nexport type { MutationState } from './mutation'\nexport type { QueriesObserverOptions } from './queriesObserver'\nexport { Query } from './query'\nexport type { QueryState } from './query'\nexport * from './types'\n"],"mappings":";AAEA,SAAS,oBAAoB;AAC7B;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,6BAA6B;AACtC,SAAS,qBAAqB;AAE9B,SAAS,wBAAwB;AACjC,SAAS,kBAAkB,qBAAqB;AAChD,SAAS,qBAAqB;AAC9B,SAAS,uBAAuB;AAChC,SAAS,kBAAkB;AAE3B,SAAS,mBAAmB;AAC5B,SAAS,qBAAqB;AAC9B,SAAS,gBAAgB,wBAAwB;AACjD;AAAA,EACE;AAAA,OAIK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAGP,SAA0B,qBAAkC;AAQ5D,SAAS,gBAAgB;AAGzB,SAAS,aAAa;AAEtB,cAAc;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/infiniteQueryBehavior.cjs b/node_modules/@tanstack/query-core/build/modern/infiniteQueryBehavior.cjs new file mode 100644 index 0000000..5753c45 --- /dev/null +++ b/node_modules/@tanstack/query-core/build/modern/infiniteQueryBehavior.cjs @@ -0,0 +1,142 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/infiniteQueryBehavior.ts +var infiniteQueryBehavior_exports = {}; +__export(infiniteQueryBehavior_exports, { + hasNextPage: () => hasNextPage, + hasPreviousPage: () => hasPreviousPage, + infiniteQueryBehavior: () => infiniteQueryBehavior +}); +module.exports = __toCommonJS(infiniteQueryBehavior_exports); +var import_utils = require("./utils.cjs"); +function infiniteQueryBehavior(pages) { + return { + onFetch: (context, query) => { + const options = context.options; + const direction = context.fetchOptions?.meta?.fetchMore?.direction; + const oldPages = context.state.data?.pages || []; + const oldPageParams = context.state.data?.pageParams || []; + let result = { pages: [], pageParams: [] }; + let currentPage = 0; + const fetchFn = async () => { + let cancelled = false; + const addSignalProperty = (object) => { + (0, import_utils.addConsumeAwareSignal)( + object, + () => context.signal, + () => cancelled = true + ); + }; + const queryFn = (0, import_utils.ensureQueryFn)(context.options, context.fetchOptions); + const fetchPage = async (data, param, previous) => { + if (cancelled) { + return Promise.reject(); + } + if (param == null && data.pages.length) { + return Promise.resolve(data); + } + const createQueryFnContext = () => { + const queryFnContext2 = { + client: context.client, + queryKey: context.queryKey, + pageParam: param, + direction: previous ? "backward" : "forward", + meta: context.options.meta + }; + addSignalProperty(queryFnContext2); + return queryFnContext2; + }; + const queryFnContext = createQueryFnContext(); + const page = await queryFn(queryFnContext); + const { maxPages } = context.options; + const addTo = previous ? import_utils.addToStart : import_utils.addToEnd; + return { + pages: addTo(data.pages, page, maxPages), + pageParams: addTo(data.pageParams, param, maxPages) + }; + }; + if (direction && oldPages.length) { + const previous = direction === "backward"; + const pageParamFn = previous ? getPreviousPageParam : getNextPageParam; + const oldData = { + pages: oldPages, + pageParams: oldPageParams + }; + const param = pageParamFn(options, oldData); + result = await fetchPage(oldData, param, previous); + } else { + const remainingPages = pages ?? oldPages.length; + do { + const param = currentPage === 0 ? oldPageParams[0] ?? options.initialPageParam : getNextPageParam(options, result); + if (currentPage > 0 && param == null) { + break; + } + result = await fetchPage(result, param); + currentPage++; + } while (currentPage < remainingPages); + } + return result; + }; + if (context.options.persister) { + context.fetchFn = () => { + return context.options.persister?.( + fetchFn, + { + client: context.client, + queryKey: context.queryKey, + meta: context.options.meta, + signal: context.signal + }, + query + ); + }; + } else { + context.fetchFn = fetchFn; + } + } + }; +} +function getNextPageParam(options, { pages, pageParams }) { + const lastIndex = pages.length - 1; + return pages.length > 0 ? options.getNextPageParam( + pages[lastIndex], + pages, + pageParams[lastIndex], + pageParams + ) : void 0; +} +function getPreviousPageParam(options, { pages, pageParams }) { + return pages.length > 0 ? options.getPreviousPageParam?.(pages[0], pages, pageParams[0], pageParams) : void 0; +} +function hasNextPage(options, data) { + if (!data) return false; + return getNextPageParam(options, data) != null; +} +function hasPreviousPage(options, data) { + if (!data || !options.getPreviousPageParam) return false; + return getPreviousPageParam(options, data) != null; +} +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + hasNextPage, + hasPreviousPage, + infiniteQueryBehavior +}); +//# sourceMappingURL=infiniteQueryBehavior.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/infiniteQueryBehavior.cjs.map b/node_modules/@tanstack/query-core/build/modern/infiniteQueryBehavior.cjs.map new file mode 100644 index 0000000..7b629ba --- /dev/null +++ b/node_modules/@tanstack/query-core/build/modern/infiniteQueryBehavior.cjs.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/infiniteQueryBehavior.ts"],"sourcesContent":["import {\n addConsumeAwareSignal,\n addToEnd,\n addToStart,\n ensureQueryFn,\n} from './utils'\nimport type { QueryBehavior } from './query'\nimport type {\n InfiniteData,\n InfiniteQueryPageParamsOptions,\n OmitKeyof,\n QueryFunctionContext,\n QueryKey,\n} from './types'\n\nexport function infiniteQueryBehavior(\n pages?: number,\n): QueryBehavior> {\n return {\n onFetch: (context, query) => {\n const options = context.options as InfiniteQueryPageParamsOptions\n const direction = context.fetchOptions?.meta?.fetchMore?.direction\n const oldPages = context.state.data?.pages || []\n const oldPageParams = context.state.data?.pageParams || []\n let result: InfiniteData = { pages: [], pageParams: [] }\n let currentPage = 0\n\n const fetchFn = async () => {\n let cancelled = false\n const addSignalProperty = (object: unknown) => {\n addConsumeAwareSignal(\n object,\n () => context.signal,\n () => (cancelled = true),\n )\n }\n\n const queryFn = ensureQueryFn(context.options, context.fetchOptions)\n\n // Create function to fetch a page\n const fetchPage = async (\n data: InfiniteData,\n param: unknown,\n previous?: boolean,\n ): Promise> => {\n if (cancelled) {\n return Promise.reject()\n }\n\n if (param == null && data.pages.length) {\n return Promise.resolve(data)\n }\n\n const createQueryFnContext = () => {\n const queryFnContext: OmitKeyof<\n QueryFunctionContext,\n 'signal'\n > = {\n client: context.client,\n queryKey: context.queryKey,\n pageParam: param,\n direction: previous ? 'backward' : 'forward',\n meta: context.options.meta,\n }\n addSignalProperty(queryFnContext)\n return queryFnContext as QueryFunctionContext\n }\n\n const queryFnContext = createQueryFnContext()\n\n const page = await queryFn(queryFnContext)\n\n const { maxPages } = context.options\n const addTo = previous ? addToStart : addToEnd\n\n return {\n pages: addTo(data.pages, page, maxPages),\n pageParams: addTo(data.pageParams, param, maxPages),\n }\n }\n\n // fetch next / previous page?\n if (direction && oldPages.length) {\n const previous = direction === 'backward'\n const pageParamFn = previous ? getPreviousPageParam : getNextPageParam\n const oldData = {\n pages: oldPages,\n pageParams: oldPageParams,\n }\n const param = pageParamFn(options, oldData)\n\n result = await fetchPage(oldData, param, previous)\n } else {\n const remainingPages = pages ?? oldPages.length\n\n // Fetch all pages\n do {\n const param =\n currentPage === 0\n ? (oldPageParams[0] ?? options.initialPageParam)\n : getNextPageParam(options, result)\n if (currentPage > 0 && param == null) {\n break\n }\n result = await fetchPage(result, param)\n currentPage++\n } while (currentPage < remainingPages)\n }\n\n return result\n }\n if (context.options.persister) {\n context.fetchFn = () => {\n return context.options.persister?.(\n fetchFn as any,\n {\n client: context.client,\n queryKey: context.queryKey,\n meta: context.options.meta,\n signal: context.signal,\n },\n query,\n )\n }\n } else {\n context.fetchFn = fetchFn\n }\n },\n }\n}\n\nfunction getNextPageParam(\n options: InfiniteQueryPageParamsOptions,\n { pages, pageParams }: InfiniteData,\n): unknown | undefined {\n const lastIndex = pages.length - 1\n return pages.length > 0\n ? options.getNextPageParam(\n pages[lastIndex],\n pages,\n pageParams[lastIndex],\n pageParams,\n )\n : undefined\n}\n\nfunction getPreviousPageParam(\n options: InfiniteQueryPageParamsOptions,\n { pages, pageParams }: InfiniteData,\n): unknown | undefined {\n return pages.length > 0\n ? options.getPreviousPageParam?.(pages[0], pages, pageParams[0], pageParams)\n : undefined\n}\n\n/**\n * Checks if there is a next page.\n */\nexport function hasNextPage(\n options: InfiniteQueryPageParamsOptions,\n data?: InfiniteData,\n): boolean {\n if (!data) return false\n return getNextPageParam(options, data) != null\n}\n\n/**\n * Checks if there is a previous page.\n */\nexport function hasPreviousPage(\n options: InfiniteQueryPageParamsOptions,\n data?: InfiniteData,\n): boolean {\n if (!data || !options.getPreviousPageParam) return false\n return getPreviousPageParam(options, data) != null\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAKO;AAUA,SAAS,sBACd,OACsE;AACtE,SAAO;AAAA,IACL,SAAS,CAAC,SAAS,UAAU;AAC3B,YAAM,UAAU,QAAQ;AACxB,YAAM,YAAY,QAAQ,cAAc,MAAM,WAAW;AACzD,YAAM,WAAW,QAAQ,MAAM,MAAM,SAAS,CAAC;AAC/C,YAAM,gBAAgB,QAAQ,MAAM,MAAM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;AAChD;","names":["queryFnContext"]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/infiniteQueryBehavior.d.cts b/node_modules/@tanstack/query-core/build/modern/infiniteQueryBehavior.d.cts new file mode 100644 index 0000000..8a7fd8a --- /dev/null +++ b/node_modules/@tanstack/query-core/build/modern/infiniteQueryBehavior.d.cts @@ -0,0 +1,15 @@ +import { bb as QueryBehavior, a8 as InfiniteData, ae as InfiniteQueryPageParamsOptions } from './hydration-uphG6M-i.cjs'; +import './removable.cjs'; +import './subscribable.cjs'; + +declare function infiniteQueryBehavior(pages?: number): QueryBehavior>; +/** + * Checks if there is a next page. + */ +declare function hasNextPage(options: InfiniteQueryPageParamsOptions, data?: InfiniteData): boolean; +/** + * Checks if there is a previous page. + */ +declare function hasPreviousPage(options: InfiniteQueryPageParamsOptions, data?: InfiniteData): boolean; + +export { hasNextPage, hasPreviousPage, infiniteQueryBehavior }; diff --git a/node_modules/@tanstack/query-core/build/modern/infiniteQueryBehavior.d.ts b/node_modules/@tanstack/query-core/build/modern/infiniteQueryBehavior.d.ts new file mode 100644 index 0000000..a9a90e2 --- /dev/null +++ b/node_modules/@tanstack/query-core/build/modern/infiniteQueryBehavior.d.ts @@ -0,0 +1,15 @@ +import { bb as QueryBehavior, a8 as InfiniteData, ae as InfiniteQueryPageParamsOptions } from './hydration-BlEVG2Lp.js'; +import './removable.js'; +import './subscribable.js'; + +declare function infiniteQueryBehavior(pages?: number): QueryBehavior>; +/** + * Checks if there is a next page. + */ +declare function hasNextPage(options: InfiniteQueryPageParamsOptions, data?: InfiniteData): boolean; +/** + * Checks if there is a previous page. + */ +declare function hasPreviousPage(options: InfiniteQueryPageParamsOptions, data?: InfiniteData): boolean; + +export { hasNextPage, hasPreviousPage, infiniteQueryBehavior }; diff --git a/node_modules/@tanstack/query-core/build/modern/infiniteQueryBehavior.js b/node_modules/@tanstack/query-core/build/modern/infiniteQueryBehavior.js new file mode 100644 index 0000000..5800419 --- /dev/null +++ b/node_modules/@tanstack/query-core/build/modern/infiniteQueryBehavior.js @@ -0,0 +1,120 @@ +// src/infiniteQueryBehavior.ts +import { + addConsumeAwareSignal, + addToEnd, + addToStart, + ensureQueryFn +} from "./utils.js"; +function infiniteQueryBehavior(pages) { + return { + onFetch: (context, query) => { + const options = context.options; + const direction = context.fetchOptions?.meta?.fetchMore?.direction; + const oldPages = context.state.data?.pages || []; + const oldPageParams = context.state.data?.pageParams || []; + let result = { pages: [], pageParams: [] }; + let currentPage = 0; + const fetchFn = async () => { + let cancelled = false; + const addSignalProperty = (object) => { + addConsumeAwareSignal( + object, + () => context.signal, + () => cancelled = true + ); + }; + const queryFn = ensureQueryFn(context.options, context.fetchOptions); + const fetchPage = async (data, param, previous) => { + if (cancelled) { + return Promise.reject(); + } + if (param == null && data.pages.length) { + return Promise.resolve(data); + } + const createQueryFnContext = () => { + const queryFnContext2 = { + client: context.client, + queryKey: context.queryKey, + pageParam: param, + direction: previous ? "backward" : "forward", + meta: context.options.meta + }; + addSignalProperty(queryFnContext2); + return queryFnContext2; + }; + const queryFnContext = createQueryFnContext(); + const page = await queryFn(queryFnContext); + const { maxPages } = context.options; + const addTo = previous ? addToStart : addToEnd; + return { + pages: addTo(data.pages, page, maxPages), + pageParams: addTo(data.pageParams, param, maxPages) + }; + }; + if (direction && oldPages.length) { + const previous = direction === "backward"; + const pageParamFn = previous ? getPreviousPageParam : getNextPageParam; + const oldData = { + pages: oldPages, + pageParams: oldPageParams + }; + const param = pageParamFn(options, oldData); + result = await fetchPage(oldData, param, previous); + } else { + const remainingPages = pages ?? oldPages.length; + do { + const param = currentPage === 0 ? oldPageParams[0] ?? options.initialPageParam : getNextPageParam(options, result); + if (currentPage > 0 && param == null) { + break; + } + result = await fetchPage(result, param); + currentPage++; + } while (currentPage < remainingPages); + } + return result; + }; + if (context.options.persister) { + context.fetchFn = () => { + return context.options.persister?.( + fetchFn, + { + client: context.client, + queryKey: context.queryKey, + meta: context.options.meta, + signal: context.signal + }, + query + ); + }; + } else { + context.fetchFn = fetchFn; + } + } + }; +} +function getNextPageParam(options, { pages, pageParams }) { + const lastIndex = pages.length - 1; + return pages.length > 0 ? options.getNextPageParam( + pages[lastIndex], + pages, + pageParams[lastIndex], + pageParams + ) : void 0; +} +function getPreviousPageParam(options, { pages, pageParams }) { + return pages.length > 0 ? options.getPreviousPageParam?.(pages[0], pages, pageParams[0], pageParams) : void 0; +} +function hasNextPage(options, data) { + if (!data) return false; + return getNextPageParam(options, data) != null; +} +function hasPreviousPage(options, data) { + if (!data || !options.getPreviousPageParam) return false; + return getPreviousPageParam(options, data) != null; +} +export { + hasNextPage, + hasPreviousPage, + infiniteQueryBehavior +}; +//# sourceMappingURL=infiniteQueryBehavior.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/infiniteQueryBehavior.js.map b/node_modules/@tanstack/query-core/build/modern/infiniteQueryBehavior.js.map new file mode 100644 index 0000000..5eb64f5 --- /dev/null +++ b/node_modules/@tanstack/query-core/build/modern/infiniteQueryBehavior.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/infiniteQueryBehavior.ts"],"sourcesContent":["import {\n addConsumeAwareSignal,\n addToEnd,\n addToStart,\n ensureQueryFn,\n} from './utils'\nimport type { QueryBehavior } from './query'\nimport type {\n InfiniteData,\n InfiniteQueryPageParamsOptions,\n OmitKeyof,\n QueryFunctionContext,\n QueryKey,\n} from './types'\n\nexport function infiniteQueryBehavior(\n pages?: number,\n): QueryBehavior> {\n return {\n onFetch: (context, query) => {\n const options = context.options as InfiniteQueryPageParamsOptions\n const direction = context.fetchOptions?.meta?.fetchMore?.direction\n const oldPages = context.state.data?.pages || []\n const oldPageParams = context.state.data?.pageParams || []\n let result: InfiniteData = { pages: [], pageParams: [] }\n let currentPage = 0\n\n const fetchFn = async () => {\n let cancelled = false\n const addSignalProperty = (object: unknown) => {\n addConsumeAwareSignal(\n object,\n () => context.signal,\n () => (cancelled = true),\n )\n }\n\n const queryFn = ensureQueryFn(context.options, context.fetchOptions)\n\n // Create function to fetch a page\n const fetchPage = async (\n data: InfiniteData,\n param: unknown,\n previous?: boolean,\n ): Promise> => {\n if (cancelled) {\n return Promise.reject()\n }\n\n if (param == null && data.pages.length) {\n return Promise.resolve(data)\n }\n\n const createQueryFnContext = () => {\n const queryFnContext: OmitKeyof<\n QueryFunctionContext,\n 'signal'\n > = {\n client: context.client,\n queryKey: context.queryKey,\n pageParam: param,\n direction: previous ? 'backward' : 'forward',\n meta: context.options.meta,\n }\n addSignalProperty(queryFnContext)\n return queryFnContext as QueryFunctionContext\n }\n\n const queryFnContext = createQueryFnContext()\n\n const page = await queryFn(queryFnContext)\n\n const { maxPages } = context.options\n const addTo = previous ? addToStart : addToEnd\n\n return {\n pages: addTo(data.pages, page, maxPages),\n pageParams: addTo(data.pageParams, param, maxPages),\n }\n }\n\n // fetch next / previous page?\n if (direction && oldPages.length) {\n const previous = direction === 'backward'\n const pageParamFn = previous ? getPreviousPageParam : getNextPageParam\n const oldData = {\n pages: oldPages,\n pageParams: oldPageParams,\n }\n const param = pageParamFn(options, oldData)\n\n result = await fetchPage(oldData, param, previous)\n } else {\n const remainingPages = pages ?? oldPages.length\n\n // Fetch all pages\n do {\n const param =\n currentPage === 0\n ? (oldPageParams[0] ?? options.initialPageParam)\n : getNextPageParam(options, result)\n if (currentPage > 0 && param == null) {\n break\n }\n result = await fetchPage(result, param)\n currentPage++\n } while (currentPage < remainingPages)\n }\n\n return result\n }\n if (context.options.persister) {\n context.fetchFn = () => {\n return context.options.persister?.(\n fetchFn as any,\n {\n client: context.client,\n queryKey: context.queryKey,\n meta: context.options.meta,\n signal: context.signal,\n },\n query,\n )\n }\n } else {\n context.fetchFn = fetchFn\n }\n },\n }\n}\n\nfunction getNextPageParam(\n options: InfiniteQueryPageParamsOptions,\n { pages, pageParams }: InfiniteData,\n): unknown | undefined {\n const lastIndex = pages.length - 1\n return pages.length > 0\n ? options.getNextPageParam(\n pages[lastIndex],\n pages,\n pageParams[lastIndex],\n pageParams,\n )\n : undefined\n}\n\nfunction getPreviousPageParam(\n options: InfiniteQueryPageParamsOptions,\n { pages, pageParams }: InfiniteData,\n): unknown | undefined {\n return pages.length > 0\n ? options.getPreviousPageParam?.(pages[0], pages, pageParams[0], pageParams)\n : undefined\n}\n\n/**\n * Checks if there is a next page.\n */\nexport function hasNextPage(\n options: InfiniteQueryPageParamsOptions,\n data?: InfiniteData,\n): boolean {\n if (!data) return false\n return getNextPageParam(options, data) != null\n}\n\n/**\n * Checks if there is a previous page.\n */\nexport function hasPreviousPage(\n options: InfiniteQueryPageParamsOptions,\n data?: InfiniteData,\n): boolean {\n if (!data || !options.getPreviousPageParam) return false\n return getPreviousPageParam(options, data) != null\n}\n"],"mappings":";AAAA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAUA,SAAS,sBACd,OACsE;AACtE,SAAO;AAAA,IACL,SAAS,CAAC,SAAS,UAAU;AAC3B,YAAM,UAAU,QAAQ;AACxB,YAAM,YAAY,QAAQ,cAAc,MAAM,WAAW;AACzD,YAAM,WAAW,QAAQ,MAAM,MAAM,SAAS,CAAC;AAC/C,YAAM,gBAAgB,QAAQ,MAAM,MAAM,cAAc,CAAC;AACzD,UAAI,SAAgC,EAAE,OAAO,CAAC,GAAG,YAAY,CAAC,EAAE;AAChE,UAAI,cAAc;AAElB,YAAM,UAAU,YAAY;AAC1B,YAAI,YAAY;AAChB,cAAM,oBAAoB,CAAC,WAAoB;AAC7C;AAAA,YACE;AAAA,YACA,MAAM,QAAQ;AAAA,YACd,MAAO,YAAY;AAAA,UACrB;AAAA,QACF;AAEA,cAAM,UAAU,cAAc,QAAQ,SAAS,QAAQ,YAAY;AAGnE,cAAM,YAAY,OAChB,MACA,OACA,aACmC;AACnC,cAAI,WAAW;AACb,mBAAO,QAAQ,OAAO;AAAA,UACxB;AAEA,cAAI,SAAS,QAAQ,KAAK,MAAM,QAAQ;AACtC,mBAAO,QAAQ,QAAQ,IAAI;AAAA,UAC7B;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AM,QAAQ,QAAQ;AAAA,cACtB,QAAQ,QAAQ;AAAA,YAClB;AAAA,YACA;AAAA,UACF;AAAA,QACF;AAAA,MACF,OAAO;AACL,gBAAQ,UAAU;AAAA,MACpB;AAAA,IACF;AAAA,EACF;AACF;AAEA,SAAS,iBACP,SACA,EAAE,OAAO,WAAW,GACC;AACrB,QAAM,YAAY,MAAM,SAAS;AACjC,SAAO,MAAM,SAAS,IAClB,QAAQ;AAAA,IACN,MAAM,SAAS;AAAA,IACf;AAAA,IACA,WAAW,SAAS;AAAA,IACpB;AAAA,EACF,IACA;AACN;AAEA,SAAS,qBACP,SACA,EAAE,OAAO,WAAW,GACC;AACrB,SAAO,MAAM,SAAS,IAClB,QAAQ,uBAAuB,MAAM,CAAC,GAAG,OAAO,WAAW,CAAC,GAAG,UAAU,IACzE;AACN;AAKO,SAAS,YACd,SACA,MACS;AACT,MAAI,CAAC,KAAM,QAAO;AAClB,SAAO,iBAAiB,SAAS,IAAI,KAAK;AAC5C;AAKO,SAAS,gBACd,SACA,MACS;AACT,MAAI,CAAC,QAAQ,CAAC,QAAQ,qBAAsB,QAAO;AACnD,SAAO,qBAAqB,SAAS,IAAI,KAAK;AAChD;","names":["queryFnContext"]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/infiniteQueryObserver.cjs b/node_modules/@tanstack/query-core/build/modern/infiniteQueryObserver.cjs new file mode 100644 index 0000000..3e712e9 --- /dev/null +++ b/node_modules/@tanstack/query-core/build/modern/infiniteQueryObserver.cjs @@ -0,0 +1,92 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/infiniteQueryObserver.ts +var infiniteQueryObserver_exports = {}; +__export(infiniteQueryObserver_exports, { + InfiniteQueryObserver: () => InfiniteQueryObserver +}); +module.exports = __toCommonJS(infiniteQueryObserver_exports); +var import_queryObserver = require("./queryObserver.cjs"); +var import_infiniteQueryBehavior = require("./infiniteQueryBehavior.cjs"); +var InfiniteQueryObserver = class extends import_queryObserver.QueryObserver { + constructor(client, options) { + super(client, options); + } + bindMethods() { + super.bindMethods(); + this.fetchNextPage = this.fetchNextPage.bind(this); + this.fetchPreviousPage = this.fetchPreviousPage.bind(this); + } + setOptions(options) { + super.setOptions({ + ...options, + behavior: (0, import_infiniteQueryBehavior.infiniteQueryBehavior)() + }); + } + getOptimisticResult(options) { + options.behavior = (0, import_infiniteQueryBehavior.infiniteQueryBehavior)(); + return super.getOptimisticResult(options); + } + fetchNextPage(options) { + return this.fetch({ + ...options, + meta: { + fetchMore: { direction: "forward" } + } + }); + } + fetchPreviousPage(options) { + return this.fetch({ + ...options, + meta: { + fetchMore: { direction: "backward" } + } + }); + } + createResult(query, options) { + const { state } = query; + const parentResult = super.createResult(query, options); + const { isFetching, isRefetching, isError, isRefetchError } = parentResult; + const fetchDirection = state.fetchMeta?.fetchMore?.direction; + const isFetchNextPageError = isError && fetchDirection === "forward"; + const isFetchingNextPage = isFetching && fetchDirection === "forward"; + const isFetchPreviousPageError = isError && fetchDirection === "backward"; + const isFetchingPreviousPage = isFetching && fetchDirection === "backward"; + const result = { + ...parentResult, + fetchNextPage: this.fetchNextPage, + fetchPreviousPage: this.fetchPreviousPage, + hasNextPage: (0, import_infiniteQueryBehavior.hasNextPage)(options, state.data), + hasPreviousPage: (0, import_infiniteQueryBehavior.hasPreviousPage)(options, state.data), + isFetchNextPageError, + isFetchingNextPage, + isFetchPreviousPageError, + isFetchingPreviousPage, + isRefetchError: isRefetchError && !isFetchNextPageError && !isFetchPreviousPageError, + isRefetching: isRefetching && !isFetchingNextPage && !isFetchingPreviousPage + }; + return result; + } +}; +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + InfiniteQueryObserver +}); +//# sourceMappingURL=infiniteQueryObserver.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/infiniteQueryObserver.cjs.map b/node_modules/@tanstack/query-core/build/modern/infiniteQueryObserver.cjs.map new file mode 100644 index 0000000..ee42578 --- /dev/null +++ b/node_modules/@tanstack/query-core/build/modern/infiniteQueryObserver.cjs.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/infiniteQueryObserver.ts"],"sourcesContent":["import { QueryObserver } from './queryObserver'\nimport {\n hasNextPage,\n hasPreviousPage,\n infiniteQueryBehavior,\n} from './infiniteQueryBehavior'\nimport type { Subscribable } from './subscribable'\nimport type {\n DefaultError,\n DefaultedInfiniteQueryObserverOptions,\n FetchNextPageOptions,\n FetchPreviousPageOptions,\n InfiniteData,\n InfiniteQueryObserverBaseResult,\n InfiniteQueryObserverOptions,\n InfiniteQueryObserverResult,\n QueryKey,\n} from './types'\nimport type { QueryClient } from './queryClient'\nimport type { Query } from './query'\n\ntype InfiniteQueryObserverListener = (\n result: InfiniteQueryObserverResult,\n) => void\n\nexport class InfiniteQueryObserver<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = InfiniteData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n> extends QueryObserver<\n TQueryFnData,\n TError,\n TData,\n InfiniteData,\n TQueryKey\n> {\n // Type override\n subscribe!: Subscribable<\n InfiniteQueryObserverListener\n >['subscribe']\n\n // Type override\n getCurrentResult!: ReplaceReturnType<\n QueryObserver<\n TQueryFnData,\n TError,\n TData,\n InfiniteData,\n TQueryKey\n >['getCurrentResult'],\n InfiniteQueryObserverResult\n >\n\n // Type override\n protected fetch!: ReplaceReturnType<\n QueryObserver<\n TQueryFnData,\n TError,\n TData,\n InfiniteData,\n TQueryKey\n >['fetch'],\n Promise>\n >\n\n constructor(\n client: QueryClient,\n options: InfiniteQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n ) {\n super(client, options)\n }\n\n protected bindMethods(): void {\n super.bindMethods()\n this.fetchNextPage = this.fetchNextPage.bind(this)\n this.fetchPreviousPage = this.fetchPreviousPage.bind(this)\n }\n\n setOptions(\n options: InfiniteQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n ): void {\n super.setOptions({\n ...options,\n behavior: infiniteQueryBehavior(),\n })\n }\n\n getOptimisticResult(\n options: DefaultedInfiniteQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n ): InfiniteQueryObserverResult {\n options.behavior = infiniteQueryBehavior()\n return super.getOptimisticResult(options) as InfiniteQueryObserverResult<\n TData,\n TError\n >\n }\n\n fetchNextPage(\n options?: FetchNextPageOptions,\n ): Promise> {\n return this.fetch({\n ...options,\n meta: {\n fetchMore: { direction: 'forward' },\n },\n })\n }\n\n fetchPreviousPage(\n options?: FetchPreviousPageOptions,\n ): Promise> {\n return this.fetch({\n ...options,\n meta: {\n fetchMore: { direction: 'backward' },\n },\n })\n }\n\n protected createResult(\n query: Query<\n TQueryFnData,\n TError,\n InfiniteData,\n TQueryKey\n >,\n options: InfiniteQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n ): InfiniteQueryObserverResult {\n const { state } = query\n const parentResult = super.createResult(query, options)\n\n const { isFetching, isRefetching, isError, isRefetchError } = parentResult\n const fetchDirection = state.fetchMeta?.fetchMore?.direction\n\n const isFetchNextPageError = isError && fetchDirection === 'forward'\n const isFetchingNextPage = isFetching && fetchDirection === 'forward'\n\n const isFetchPreviousPageError = isError && fetchDirection === 'backward'\n const isFetchingPreviousPage = isFetching && fetchDirection === 'backward'\n\n const result: InfiniteQueryObserverBaseResult = {\n ...parentResult,\n fetchNextPage: this.fetchNextPage,\n fetchPreviousPage: this.fetchPreviousPage,\n hasNextPage: hasNextPage(options, state.data),\n hasPreviousPage: hasPreviousPage(options, state.data),\n isFetchNextPageError,\n isFetchingNextPage,\n isFetchPreviousPageError,\n isFetchingPreviousPage,\n isRefetchError:\n isRefetchError && !isFetchNextPageError && !isFetchPreviousPageError,\n isRefetching:\n isRefetching && !isFetchingNextPage && !isFetchingPreviousPage,\n }\n\n return result as InfiniteQueryObserverResult\n }\n}\n\ntype ReplaceReturnType<\n TFunction extends (...args: Array) => unknown,\n TReturn,\n> = (...args: Parameters) => TReturn\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,2BAA8B;AAC9B,mCAIO;AAoBA,IAAM,wBAAN,cAMG,mCAMR;AAAA,EA8BA,YACE,QACA,SAOA;AACA,UAAM,QAAQ,OAAO;AAAA,EACvB;AAAA,EAEU,cAAoB;AAC5B,UAAM,YAAY;AAClB,SAAK,gBAAgB,KAAK,cAAc,KAAK,IAAI;AACjD,SAAK,oBAAoB,KAAK,kBAAkB,KAAK,IAAI;AAAA,EAC3D;AAAA,EAEA,WACE,SAOM;AACN,UAAM,WAAW;AAAA,MACf,GAAG;AAAA,MACH,cAAU,oDAAsB;AAAA,IAClC,CAAC;AAAA,EACH;AAAA,EAEA,oBACE,SAO4C;AAC5C,YAAQ,eAAW,oDAAsB;AACzC,WAAO,MAAM,oBAAoB,OAAO;AAAA,EAI1C;AAAA,EAEA,cACE,SACqD;AACrD,WAAO,KAAK,MAAM;AAAA,MAChB,GAAG;AAAA,MACH,MAAM;AAAA,QACJ,WAAW,EAAE,WAAW,UAAU;AAAA,MACpC;AAAA,IACF,CAAC;AAAA,EACH;AAAA,EAEA,kBACE,SACqD;AACrD,WAAO,KAAK,MAAM;AAAA,MAChB,GAAG;AAAA,MACH,MAAM;AAAA,QACJ,WAAW,EAAE,WAAW,WAAW;AAAA,MACrC;AAAA,IACF,CAAC;AAAA,EACH;AAAA,EAEU,aACR,OAMA,SAO4C;AAC5C,UAAM,EAAE,MAAM,IAAI;AAClB,UAAM,eAAe,MAAM,aAAa,OAAO,OAAO;AAEtD,UAAM,EAAE,YAAY,cAAc,SAAS,eAAe,IAAI;AAC9D,UAAM,iBAAiB,MAAM,WAAW,WAAW;AAEnD,UAAM,uBAAuB,WAAW,mBAAmB;AAC3D,UAAM,qBAAqB,cAAc,mBAAmB;AAE5D,UAAM,2BAA2B,WAAW,mBAAmB;AAC/D,UAAM,yBAAyB,cAAc,mBAAmB;AAEhE,UAAM,SAAyD;AAAA,MAC7D,GAAG;AAAA,MACH,eAAe,KAAK;AAAA,MACpB,mBAAmB,KAAK;AAAA,MACxB,iBAAa,0CAAY,SAAS,MAAM,IAAI;AAAA,MAC5C,qBAAiB,8CAAgB,SAAS,MAAM,IAAI;AAAA,MACpD;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,gBACE,kBAAkB,CAAC,wBAAwB,CAAC;AAAA,MAC9C,cACE,gBAAgB,CAAC,sBAAsB,CAAC;AAAA,IAC5C;AAEA,WAAO;AAAA,EACT;AACF;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/infiniteQueryObserver.d.cts b/node_modules/@tanstack/query-core/build/modern/infiniteQueryObserver.d.cts new file mode 100644 index 0000000..296a938 --- /dev/null +++ b/node_modules/@tanstack/query-core/build/modern/infiniteQueryObserver.d.cts @@ -0,0 +1,20 @@ +import { G as DefaultError, a8 as InfiniteData, I as QueryKey, i as QueryObserver, aQ as InfiniteQueryObserverResult, g as QueryClient, aj as InfiniteQueryObserverOptions, ak as DefaultedInfiniteQueryObserverOptions, av as FetchNextPageOptions, aw as FetchPreviousPageOptions, z as Query } from './hydration-uphG6M-i.cjs'; +import { Subscribable } from './subscribable.cjs'; +import './removable.cjs'; + +type InfiniteQueryObserverListener = (result: InfiniteQueryObserverResult) => void; +declare class InfiniteQueryObserver, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown> extends QueryObserver, TQueryKey> { + subscribe: Subscribable>['subscribe']; + getCurrentResult: ReplaceReturnType, TQueryKey>['getCurrentResult'], InfiniteQueryObserverResult>; + protected fetch: ReplaceReturnType, TQueryKey>['fetch'], Promise>>; + constructor(client: QueryClient, options: InfiniteQueryObserverOptions); + protected bindMethods(): void; + setOptions(options: InfiniteQueryObserverOptions): void; + getOptimisticResult(options: DefaultedInfiniteQueryObserverOptions): InfiniteQueryObserverResult; + fetchNextPage(options?: FetchNextPageOptions): Promise>; + fetchPreviousPage(options?: FetchPreviousPageOptions): Promise>; + protected createResult(query: Query, TQueryKey>, options: InfiniteQueryObserverOptions): InfiniteQueryObserverResult; +} +type ReplaceReturnType) => unknown, TReturn> = (...args: Parameters) => TReturn; + +export { InfiniteQueryObserver }; diff --git a/node_modules/@tanstack/query-core/build/modern/infiniteQueryObserver.d.ts b/node_modules/@tanstack/query-core/build/modern/infiniteQueryObserver.d.ts new file mode 100644 index 0000000..96dca65 --- /dev/null +++ b/node_modules/@tanstack/query-core/build/modern/infiniteQueryObserver.d.ts @@ -0,0 +1,20 @@ +import { G as DefaultError, a8 as InfiniteData, I as QueryKey, i as QueryObserver, aQ as InfiniteQueryObserverResult, g as QueryClient, aj as InfiniteQueryObserverOptions, ak as DefaultedInfiniteQueryObserverOptions, av as FetchNextPageOptions, aw as FetchPreviousPageOptions, z as Query } from './hydration-BlEVG2Lp.js'; +import { Subscribable } from './subscribable.js'; +import './removable.js'; + +type InfiniteQueryObserverListener = (result: InfiniteQueryObserverResult) => void; +declare class InfiniteQueryObserver, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown> extends QueryObserver, TQueryKey> { + subscribe: Subscribable>['subscribe']; + getCurrentResult: ReplaceReturnType, TQueryKey>['getCurrentResult'], InfiniteQueryObserverResult>; + protected fetch: ReplaceReturnType, TQueryKey>['fetch'], Promise>>; + constructor(client: QueryClient, options: InfiniteQueryObserverOptions); + protected bindMethods(): void; + setOptions(options: InfiniteQueryObserverOptions): void; + getOptimisticResult(options: DefaultedInfiniteQueryObserverOptions): InfiniteQueryObserverResult; + fetchNextPage(options?: FetchNextPageOptions): Promise>; + fetchPreviousPage(options?: FetchPreviousPageOptions): Promise>; + protected createResult(query: Query, TQueryKey>, options: InfiniteQueryObserverOptions): InfiniteQueryObserverResult; +} +type ReplaceReturnType) => unknown, TReturn> = (...args: Parameters) => TReturn; + +export { InfiniteQueryObserver }; diff --git a/node_modules/@tanstack/query-core/build/modern/infiniteQueryObserver.js b/node_modules/@tanstack/query-core/build/modern/infiniteQueryObserver.js new file mode 100644 index 0000000..409d54a --- /dev/null +++ b/node_modules/@tanstack/query-core/build/modern/infiniteQueryObserver.js @@ -0,0 +1,71 @@ +// src/infiniteQueryObserver.ts +import { QueryObserver } from "./queryObserver.js"; +import { + hasNextPage, + hasPreviousPage, + infiniteQueryBehavior +} from "./infiniteQueryBehavior.js"; +var InfiniteQueryObserver = class extends QueryObserver { + constructor(client, options) { + super(client, options); + } + bindMethods() { + super.bindMethods(); + this.fetchNextPage = this.fetchNextPage.bind(this); + this.fetchPreviousPage = this.fetchPreviousPage.bind(this); + } + setOptions(options) { + super.setOptions({ + ...options, + behavior: infiniteQueryBehavior() + }); + } + getOptimisticResult(options) { + options.behavior = infiniteQueryBehavior(); + return super.getOptimisticResult(options); + } + fetchNextPage(options) { + return this.fetch({ + ...options, + meta: { + fetchMore: { direction: "forward" } + } + }); + } + fetchPreviousPage(options) { + return this.fetch({ + ...options, + meta: { + fetchMore: { direction: "backward" } + } + }); + } + createResult(query, options) { + const { state } = query; + const parentResult = super.createResult(query, options); + const { isFetching, isRefetching, isError, isRefetchError } = parentResult; + const fetchDirection = state.fetchMeta?.fetchMore?.direction; + const isFetchNextPageError = isError && fetchDirection === "forward"; + const isFetchingNextPage = isFetching && fetchDirection === "forward"; + const isFetchPreviousPageError = isError && fetchDirection === "backward"; + const isFetchingPreviousPage = isFetching && fetchDirection === "backward"; + const result = { + ...parentResult, + fetchNextPage: this.fetchNextPage, + fetchPreviousPage: this.fetchPreviousPage, + hasNextPage: hasNextPage(options, state.data), + hasPreviousPage: hasPreviousPage(options, state.data), + isFetchNextPageError, + isFetchingNextPage, + isFetchPreviousPageError, + isFetchingPreviousPage, + isRefetchError: isRefetchError && !isFetchNextPageError && !isFetchPreviousPageError, + isRefetching: isRefetching && !isFetchingNextPage && !isFetchingPreviousPage + }; + return result; + } +}; +export { + InfiniteQueryObserver +}; +//# sourceMappingURL=infiniteQueryObserver.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/infiniteQueryObserver.js.map b/node_modules/@tanstack/query-core/build/modern/infiniteQueryObserver.js.map new file mode 100644 index 0000000..11855cf --- /dev/null +++ b/node_modules/@tanstack/query-core/build/modern/infiniteQueryObserver.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/infiniteQueryObserver.ts"],"sourcesContent":["import { QueryObserver } from './queryObserver'\nimport {\n hasNextPage,\n hasPreviousPage,\n infiniteQueryBehavior,\n} from './infiniteQueryBehavior'\nimport type { Subscribable } from './subscribable'\nimport type {\n DefaultError,\n DefaultedInfiniteQueryObserverOptions,\n FetchNextPageOptions,\n FetchPreviousPageOptions,\n InfiniteData,\n InfiniteQueryObserverBaseResult,\n InfiniteQueryObserverOptions,\n InfiniteQueryObserverResult,\n QueryKey,\n} from './types'\nimport type { QueryClient } from './queryClient'\nimport type { Query } from './query'\n\ntype InfiniteQueryObserverListener = (\n result: InfiniteQueryObserverResult,\n) => void\n\nexport class InfiniteQueryObserver<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = InfiniteData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n> extends QueryObserver<\n TQueryFnData,\n TError,\n TData,\n InfiniteData,\n TQueryKey\n> {\n // Type override\n subscribe!: Subscribable<\n InfiniteQueryObserverListener\n >['subscribe']\n\n // Type override\n getCurrentResult!: ReplaceReturnType<\n QueryObserver<\n TQueryFnData,\n TError,\n TData,\n InfiniteData,\n TQueryKey\n >['getCurrentResult'],\n InfiniteQueryObserverResult\n >\n\n // Type override\n protected fetch!: ReplaceReturnType<\n QueryObserver<\n TQueryFnData,\n TError,\n TData,\n InfiniteData,\n TQueryKey\n >['fetch'],\n Promise>\n >\n\n constructor(\n client: QueryClient,\n options: InfiniteQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n ) {\n super(client, options)\n }\n\n protected bindMethods(): void {\n super.bindMethods()\n this.fetchNextPage = this.fetchNextPage.bind(this)\n this.fetchPreviousPage = this.fetchPreviousPage.bind(this)\n }\n\n setOptions(\n options: InfiniteQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n ): void {\n super.setOptions({\n ...options,\n behavior: infiniteQueryBehavior(),\n })\n }\n\n getOptimisticResult(\n options: DefaultedInfiniteQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n ): InfiniteQueryObserverResult {\n options.behavior = infiniteQueryBehavior()\n return super.getOptimisticResult(options) as InfiniteQueryObserverResult<\n TData,\n TError\n >\n }\n\n fetchNextPage(\n options?: FetchNextPageOptions,\n ): Promise> {\n return this.fetch({\n ...options,\n meta: {\n fetchMore: { direction: 'forward' },\n },\n })\n }\n\n fetchPreviousPage(\n options?: FetchPreviousPageOptions,\n ): Promise> {\n return this.fetch({\n ...options,\n meta: {\n fetchMore: { direction: 'backward' },\n },\n })\n }\n\n protected createResult(\n query: Query<\n TQueryFnData,\n TError,\n InfiniteData,\n TQueryKey\n >,\n options: InfiniteQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n ): InfiniteQueryObserverResult {\n const { state } = query\n const parentResult = super.createResult(query, options)\n\n const { isFetching, isRefetching, isError, isRefetchError } = parentResult\n const fetchDirection = state.fetchMeta?.fetchMore?.direction\n\n const isFetchNextPageError = isError && fetchDirection === 'forward'\n const isFetchingNextPage = isFetching && fetchDirection === 'forward'\n\n const isFetchPreviousPageError = isError && fetchDirection === 'backward'\n const isFetchingPreviousPage = isFetching && fetchDirection === 'backward'\n\n const result: InfiniteQueryObserverBaseResult = {\n ...parentResult,\n fetchNextPage: this.fetchNextPage,\n fetchPreviousPage: this.fetchPreviousPage,\n hasNextPage: hasNextPage(options, state.data),\n hasPreviousPage: hasPreviousPage(options, state.data),\n isFetchNextPageError,\n isFetchingNextPage,\n isFetchPreviousPageError,\n isFetchingPreviousPage,\n isRefetchError:\n isRefetchError && !isFetchNextPageError && !isFetchPreviousPageError,\n isRefetching:\n isRefetching && !isFetchingNextPage && !isFetchingPreviousPage,\n }\n\n return result as InfiniteQueryObserverResult\n }\n}\n\ntype ReplaceReturnType<\n TFunction extends (...args: Array) => unknown,\n TReturn,\n> = (...args: Parameters) => TReturn\n"],"mappings":";AAAA,SAAS,qBAAqB;AAC9B;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAoBA,IAAM,wBAAN,cAMG,cAMR;AAAA,EA8BA,YACE,QACA,SAOA;AACA,UAAM,QAAQ,OAAO;AAAA,EACvB;AAAA,EAEU,cAAoB;AAC5B,UAAM,YAAY;AAClB,SAAK,gBAAgB,KAAK,cAAc,KAAK,IAAI;AACjD,SAAK,oBAAoB,KAAK,kBAAkB,KAAK,IAAI;AAAA,EAC3D;AAAA,EAEA,WACE,SAOM;AACN,UAAM,WAAW;AAAA,MACf,GAAG;AAAA,MACH,UAAU,sBAAsB;AAAA,IAClC,CAAC;AAAA,EACH;AAAA,EAEA,oBACE,SAO4C;AAC5C,YAAQ,WAAW,sBAAsB;AACzC,WAAO,MAAM,oBAAoB,OAAO;AAAA,EAI1C;AAAA,EAEA,cACE,SACqD;AACrD,WAAO,KAAK,MAAM;AAAA,MAChB,GAAG;AAAA,MACH,MAAM;AAAA,QACJ,WAAW,EAAE,WAAW,UAAU;AAAA,MACpC;AAAA,IACF,CAAC;AAAA,EACH;AAAA,EAEA,kBACE,SACqD;AACrD,WAAO,KAAK,MAAM;AAAA,MAChB,GAAG;AAAA,MACH,MAAM;AAAA,QACJ,WAAW,EAAE,WAAW,WAAW;AAAA,MACrC;AAAA,IACF,CAAC;AAAA,EACH;AAAA,EAEU,aACR,OAMA,SAO4C;AAC5C,UAAM,EAAE,MAAM,IAAI;AAClB,UAAM,eAAe,MAAM,aAAa,OAAO,OAAO;AAEtD,UAAM,EAAE,YAAY,cAAc,SAAS,eAAe,IAAI;AAC9D,UAAM,iBAAiB,MAAM,WAAW,WAAW;AAEnD,UAAM,uBAAuB,WAAW,mBAAmB;AAC3D,UAAM,qBAAqB,cAAc,mBAAmB;AAE5D,UAAM,2BAA2B,WAAW,mBAAmB;AAC/D,UAAM,yBAAyB,cAAc,mBAAmB;AAEhE,UAAM,SAAyD;AAAA,MAC7D,GAAG;AAAA,MACH,eAAe,KAAK;AAAA,MACpB,mBAAmB,KAAK;AAAA,MACxB,aAAa,YAAY,SAAS,MAAM,IAAI;AAAA,MAC5C,iBAAiB,gBAAgB,SAAS,MAAM,IAAI;AAAA,MACpD;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,gBACE,kBAAkB,CAAC,wBAAwB,CAAC;AAAA,MAC9C,cACE,gBAAgB,CAAC,sBAAsB,CAAC;AAAA,IAC5C;AAEA,WAAO;AAAA,EACT;AACF;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/mutation.cjs b/node_modules/@tanstack/query-core/build/modern/mutation.cjs new file mode 100644 index 0000000..36b96e6 --- /dev/null +++ b/node_modules/@tanstack/query-core/build/modern/mutation.cjs @@ -0,0 +1,307 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/mutation.ts +var mutation_exports = {}; +__export(mutation_exports, { + Mutation: () => Mutation, + getDefaultState: () => getDefaultState +}); +module.exports = __toCommonJS(mutation_exports); +var import_notifyManager = require("./notifyManager.cjs"); +var import_removable = require("./removable.cjs"); +var import_retryer = require("./retryer.cjs"); +var Mutation = class extends import_removable.Removable { + #client; + #observers; + #mutationCache; + #retryer; + constructor(config) { + super(); + this.#client = config.client; + this.mutationId = config.mutationId; + this.#mutationCache = config.mutationCache; + this.#observers = []; + this.state = config.state || getDefaultState(); + this.setOptions(config.options); + this.scheduleGc(); + } + setOptions(options) { + this.options = options; + this.updateGcTime(this.options.gcTime); + } + get meta() { + return this.options.meta; + } + addObserver(observer) { + if (!this.#observers.includes(observer)) { + this.#observers.push(observer); + this.clearGcTimeout(); + this.#mutationCache.notify({ + type: "observerAdded", + mutation: this, + observer + }); + } + } + removeObserver(observer) { + this.#observers = this.#observers.filter((x) => x !== observer); + this.scheduleGc(); + this.#mutationCache.notify({ + type: "observerRemoved", + mutation: this, + observer + }); + } + optionalRemove() { + if (!this.#observers.length) { + if (this.state.status === "pending") { + this.scheduleGc(); + } else { + this.#mutationCache.remove(this); + } + } + } + continue() { + return this.#retryer?.continue() ?? // continuing a mutation assumes that variables are set, mutation must have been dehydrated before + this.execute(this.state.variables); + } + async execute(variables) { + const onContinue = () => { + this.#dispatch({ type: "continue" }); + }; + const mutationFnContext = { + client: this.#client, + meta: this.options.meta, + mutationKey: this.options.mutationKey + }; + this.#retryer = (0, import_retryer.createRetryer)({ + fn: () => { + if (!this.options.mutationFn) { + return Promise.reject(new Error("No mutationFn found")); + } + return this.options.mutationFn(variables, mutationFnContext); + }, + onFail: (failureCount, error) => { + this.#dispatch({ type: "failed", failureCount, error }); + }, + onPause: () => { + this.#dispatch({ type: "pause" }); + }, + onContinue, + retry: this.options.retry ?? 0, + retryDelay: this.options.retryDelay, + networkMode: this.options.networkMode, + canRun: () => this.#mutationCache.canRun(this) + }); + const restored = this.state.status === "pending"; + const isPaused = !this.#retryer.canStart(); + try { + if (restored) { + onContinue(); + } else { + this.#dispatch({ type: "pending", variables, isPaused }); + if (this.#mutationCache.config.onMutate) { + await this.#mutationCache.config.onMutate( + variables, + this, + mutationFnContext + ); + } + const context = await this.options.onMutate?.( + variables, + mutationFnContext + ); + if (context !== this.state.context) { + this.#dispatch({ + type: "pending", + context, + variables, + isPaused + }); + } + } + const data = await this.#retryer.start(); + await this.#mutationCache.config.onSuccess?.( + data, + variables, + this.state.context, + this, + mutationFnContext + ); + await this.options.onSuccess?.( + data, + variables, + this.state.context, + mutationFnContext + ); + await this.#mutationCache.config.onSettled?.( + data, + null, + this.state.variables, + this.state.context, + this, + mutationFnContext + ); + await this.options.onSettled?.( + data, + null, + variables, + this.state.context, + mutationFnContext + ); + this.#dispatch({ type: "success", data }); + return data; + } catch (error) { + try { + await this.#mutationCache.config.onError?.( + error, + variables, + this.state.context, + this, + mutationFnContext + ); + } catch (e) { + void Promise.reject(e); + } + try { + await this.options.onError?.( + error, + variables, + this.state.context, + mutationFnContext + ); + } catch (e) { + void Promise.reject(e); + } + try { + await this.#mutationCache.config.onSettled?.( + void 0, + error, + this.state.variables, + this.state.context, + this, + mutationFnContext + ); + } catch (e) { + void Promise.reject(e); + } + try { + await this.options.onSettled?.( + void 0, + error, + variables, + this.state.context, + mutationFnContext + ); + } catch (e) { + void Promise.reject(e); + } + this.#dispatch({ type: "error", error }); + throw error; + } finally { + this.#mutationCache.runNext(this); + } + } + #dispatch(action) { + const reducer = (state) => { + switch (action.type) { + case "failed": + return { + ...state, + failureCount: action.failureCount, + failureReason: action.error + }; + case "pause": + return { + ...state, + isPaused: true + }; + case "continue": + return { + ...state, + isPaused: false + }; + case "pending": + return { + ...state, + context: action.context, + data: void 0, + failureCount: 0, + failureReason: null, + error: null, + isPaused: action.isPaused, + status: "pending", + variables: action.variables, + submittedAt: Date.now() + }; + case "success": + return { + ...state, + data: action.data, + failureCount: 0, + failureReason: null, + error: null, + status: "success", + isPaused: false + }; + case "error": + return { + ...state, + data: void 0, + error: action.error, + failureCount: state.failureCount + 1, + failureReason: action.error, + isPaused: false, + status: "error" + }; + } + }; + this.state = reducer(this.state); + import_notifyManager.notifyManager.batch(() => { + this.#observers.forEach((observer) => { + observer.onMutationUpdate(action); + }); + this.#mutationCache.notify({ + mutation: this, + type: "updated", + action + }); + }); + } +}; +function getDefaultState() { + return { + context: void 0, + data: void 0, + error: null, + failureCount: 0, + failureReason: null, + isPaused: false, + status: "idle", + variables: void 0, + submittedAt: 0 + }; +} +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + Mutation, + getDefaultState +}); +//# sourceMappingURL=mutation.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/mutation.cjs.map b/node_modules/@tanstack/query-core/build/modern/mutation.cjs.map new file mode 100644 index 0000000..bc0a1bd --- /dev/null +++ b/node_modules/@tanstack/query-core/build/modern/mutation.cjs.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/mutation.ts"],"sourcesContent":["import { notifyManager } from './notifyManager'\nimport { Removable } from './removable'\nimport { createRetryer } from './retryer'\nimport type {\n DefaultError,\n MutationFunctionContext,\n MutationMeta,\n MutationOptions,\n MutationStatus,\n} from './types'\nimport type { MutationCache } from './mutationCache'\nimport type { MutationObserver } from './mutationObserver'\nimport type { Retryer } from './retryer'\nimport type { QueryClient } from './queryClient'\n\n// TYPES\n\ninterface MutationConfig {\n client: QueryClient\n mutationId: number\n mutationCache: MutationCache\n options: MutationOptions\n state?: MutationState\n}\n\nexport interface MutationState<\n TData = unknown,\n TError = DefaultError,\n TVariables = unknown,\n TOnMutateResult = unknown,\n> {\n context: TOnMutateResult | undefined\n data: TData | undefined\n error: TError | null\n failureCount: number\n failureReason: TError | null\n isPaused: boolean\n status: MutationStatus\n variables: TVariables | undefined\n submittedAt: number\n}\n\ninterface FailedAction {\n type: 'failed'\n failureCount: number\n error: TError | null\n}\n\ninterface PendingAction {\n type: 'pending'\n isPaused: boolean\n variables?: TVariables\n context?: TOnMutateResult\n}\n\ninterface SuccessAction {\n type: 'success'\n data: TData\n}\n\ninterface ErrorAction {\n type: 'error'\n error: TError\n}\n\ninterface PauseAction {\n type: 'pause'\n}\n\ninterface ContinueAction {\n type: 'continue'\n}\n\nexport type Action =\n | ContinueAction\n | ErrorAction\n | FailedAction\n | PendingAction\n | PauseAction\n | SuccessAction\n\n// CLASS\n\nexport class Mutation<\n TData = unknown,\n TError = DefaultError,\n TVariables = unknown,\n TOnMutateResult = unknown,\n> extends Removable {\n state: MutationState\n options!: MutationOptions\n readonly mutationId: number\n\n #client: QueryClient\n #observers: Array<\n MutationObserver\n >\n #mutationCache: MutationCache\n #retryer?: Retryer\n\n constructor(\n config: MutationConfig,\n ) {\n super()\n\n this.#client = config.client\n this.mutationId = config.mutationId\n this.#mutationCache = config.mutationCache\n this.#observers = []\n this.state = config.state || getDefaultState()\n\n this.setOptions(config.options)\n this.scheduleGc()\n }\n\n setOptions(\n options: MutationOptions,\n ): void {\n this.options = options\n\n this.updateGcTime(this.options.gcTime)\n }\n\n get meta(): MutationMeta | undefined {\n return this.options.meta\n }\n\n addObserver(observer: MutationObserver): void {\n if (!this.#observers.includes(observer)) {\n this.#observers.push(observer)\n\n // Stop the mutation from being garbage collected\n this.clearGcTimeout()\n\n this.#mutationCache.notify({\n type: 'observerAdded',\n mutation: this,\n observer,\n })\n }\n }\n\n removeObserver(observer: MutationObserver): void {\n this.#observers = this.#observers.filter((x) => x !== observer)\n\n this.scheduleGc()\n\n this.#mutationCache.notify({\n type: 'observerRemoved',\n mutation: this,\n observer,\n })\n }\n\n protected optionalRemove() {\n if (!this.#observers.length) {\n if (this.state.status === 'pending') {\n this.scheduleGc()\n } else {\n this.#mutationCache.remove(this)\n }\n }\n }\n\n continue(): Promise {\n return (\n this.#retryer?.continue() ??\n // continuing a mutation assumes that variables are set, mutation must have been dehydrated before\n this.execute(this.state.variables!)\n )\n }\n\n async execute(variables: TVariables): Promise {\n const onContinue = () => {\n this.#dispatch({ type: 'continue' })\n }\n\n const mutationFnContext = {\n client: this.#client,\n meta: this.options.meta,\n mutationKey: this.options.mutationKey,\n } satisfies MutationFunctionContext\n\n this.#retryer = createRetryer({\n fn: () => {\n if (!this.options.mutationFn) {\n return Promise.reject(new Error('No mutationFn found'))\n }\n\n return this.options.mutationFn(variables, mutationFnContext)\n },\n onFail: (failureCount, error) => {\n this.#dispatch({ type: 'failed', failureCount, error })\n },\n onPause: () => {\n this.#dispatch({ type: 'pause' })\n },\n onContinue,\n retry: this.options.retry ?? 0,\n retryDelay: this.options.retryDelay,\n networkMode: this.options.networkMode,\n canRun: () => this.#mutationCache.canRun(this),\n })\n\n const restored = this.state.status === 'pending'\n const isPaused = !this.#retryer.canStart()\n\n try {\n if (restored) {\n // Dispatch continue action to unpause restored mutation\n onContinue()\n } else {\n this.#dispatch({ type: 'pending', variables, isPaused })\n // Notify cache callback\n if (this.#mutationCache.config.onMutate) {\n await this.#mutationCache.config.onMutate(\n variables,\n this as Mutation,\n mutationFnContext,\n )\n }\n const context = await this.options.onMutate?.(\n variables,\n mutationFnContext,\n )\n if (context !== this.state.context) {\n this.#dispatch({\n type: 'pending',\n context,\n variables,\n isPaused,\n })\n }\n }\n const data = await this.#retryer.start()\n\n // Notify cache callback\n await this.#mutationCache.config.onSuccess?.(\n data,\n variables,\n this.state.context,\n this as Mutation,\n mutationFnContext,\n )\n\n await this.options.onSuccess?.(\n data,\n variables,\n this.state.context!,\n mutationFnContext,\n )\n\n // Notify cache callback\n await this.#mutationCache.config.onSettled?.(\n data,\n null,\n this.state.variables,\n this.state.context,\n this as Mutation,\n mutationFnContext,\n )\n\n await this.options.onSettled?.(\n data,\n null,\n variables,\n this.state.context,\n mutationFnContext,\n )\n\n this.#dispatch({ type: 'success', data })\n return data\n } catch (error) {\n try {\n // Notify cache callback\n await this.#mutationCache.config.onError?.(\n error as any,\n variables,\n this.state.context,\n this as Mutation,\n mutationFnContext,\n )\n } catch (e) {\n void Promise.reject(e)\n }\n\n try {\n await this.options.onError?.(\n error as TError,\n variables,\n this.state.context,\n mutationFnContext,\n )\n } catch (e) {\n void Promise.reject(e)\n }\n\n try {\n // Notify cache callback\n await this.#mutationCache.config.onSettled?.(\n undefined,\n error as any,\n this.state.variables,\n this.state.context,\n this as Mutation,\n mutationFnContext,\n )\n } catch (e) {\n void Promise.reject(e)\n }\n\n try {\n await this.options.onSettled?.(\n undefined,\n error as TError,\n variables,\n this.state.context,\n mutationFnContext,\n )\n } catch (e) {\n void Promise.reject(e)\n }\n\n this.#dispatch({ type: 'error', error: error as TError })\n throw error\n } finally {\n this.#mutationCache.runNext(this)\n }\n }\n\n #dispatch(action: Action): void {\n const reducer = (\n state: MutationState,\n ): MutationState => {\n switch (action.type) {\n case 'failed':\n return {\n ...state,\n failureCount: action.failureCount,\n failureReason: action.error,\n }\n case 'pause':\n return {\n ...state,\n isPaused: true,\n }\n case 'continue':\n return {\n ...state,\n isPaused: false,\n }\n case 'pending':\n return {\n ...state,\n context: action.context,\n data: undefined,\n failureCount: 0,\n failureReason: null,\n error: null,\n isPaused: action.isPaused,\n status: 'pending',\n variables: action.variables,\n submittedAt: Date.now(),\n }\n case 'success':\n return {\n ...state,\n data: action.data,\n failureCount: 0,\n failureReason: null,\n error: null,\n status: 'success',\n isPaused: false,\n }\n case 'error':\n return {\n ...state,\n data: undefined,\n error: action.error,\n failureCount: state.failureCount + 1,\n failureReason: action.error,\n isPaused: false,\n status: 'error',\n }\n }\n }\n this.state = reducer(this.state)\n\n notifyManager.batch(() => {\n this.#observers.forEach((observer) => {\n observer.onMutationUpdate(action)\n })\n this.#mutationCache.notify({\n mutation: this,\n type: 'updated',\n action,\n })\n })\n }\n}\n\nexport function getDefaultState<\n TData,\n TError,\n TVariables,\n TOnMutateResult,\n>(): MutationState {\n return {\n context: undefined,\n data: undefined,\n error: null,\n failureCount: 0,\n failureReason: null,\n isPaused: false,\n status: 'idle',\n variables: undefined,\n submittedAt: 0,\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,2BAA8B;AAC9B,uBAA0B;AAC1B,qBAA8B;AAiFvB,IAAM,WAAN,cAKG,2BAAU;AAAA,EAKlB;AAAA,EACA;AAAA,EAGA;AAAA,EACA;AAAA,EAEA,YACE,QACA;AACA,UAAM;AAEN,SAAK,UAAU,OAAO;AACtB,SAAK,aAAa,OAAO;AACzB,SAAK,iBAAiB,OAAO;AAC7B,SAAK,aAAa,CAAC;AACnB,SAAK,QAAQ,OAAO,SAAS,gBAAgB;AAE7C,SAAK,WAAW,OAAO,OAAO;AAC9B,SAAK,WAAW;AAAA,EAClB;AAAA,EAEA,WACE,SACM;AACN,SAAK,UAAU;AAEf,SAAK,aAAa,KAAK,QAAQ,MAAM;AAAA,EACvC;AAAA,EAEA,IAAI,OAAiC;AACnC,WAAO,KAAK,QAAQ;AAAA,EACtB;AAAA,EAEA,YAAY,UAAsD;AAChE,QAAI,CAAC,KAAK,WAAW,SAAS,QAAQ,GAAG;AACvC,WAAK,WAAW,KAAK,QAAQ;AAG7B,WAAK,eAAe;AAEpB,WAAK,eAAe,OAAO;AAAA,QACzB,MAAM;AAAA,QACN,UAAU;AAAA,QACV;AAAA,MACF,CAAC;AAAA,IACH;AAAA,EACF;AAAA,EAEA,eAAe,UAAsD;AACnE,SAAK,aAAa,KAAK,WAAW,OAAO,CAAC,MAAM,MAAM,QAAQ;AAE9D,SAAK,WAAW;AAEhB,SAAK,eAAe,OAAO;AAAA,MACzB,MAAM;AAAA,MACN,UAAU;AAAA,MAC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AACH,iBAAO;AAAA,YACL,GAAG;AAAA,YACH,MAAM,OAAO;AAAA,YACb,cAAc;AAAA,YACd,eAAe;AAAA,YACf,OAAO;AAAA,YACP,QAAQ;AAAA,YACR,UAAU;AAAA,UACZ;AAAA,QACF,KAAK;AACH,iBAAO;AAAA,YACL,GAAG;AAAA,YACH,MAAM;AAAA,YACN,OAAO,OAAO;AAAA,YACd,cAAc,MAAM,eAAe;AAAA,YACnC,eAAe,OAAO;AAAA,YACtB,UAAU;AAAA,YACV,QAAQ;AAAA,UACV;AAAA,MACJ;AAAA,IACF;AACA,SAAK,QAAQ,QAAQ,KAAK,KAAK;AAE/B,uCAAc,MAAM,MAAM;AACxB,WAAK,WAAW,QAAQ,CAAC,aAAa;AACpC,iBAAS,iBAAiB,MAAM;AAAA,MAClC,CAAC;AACD,WAAK,eAAe,OAAO;AAAA,QACzB,UAAU;AAAA,QACV,MAAM;AAAA,QACN;AAAA,MACF,CAAC;AAAA,IACH,CAAC;AAAA,EACH;AACF;AAEO,SAAS,kBAK+C;AAC7D,SAAO;AAAA,IACL,SAAS;AAAA,IACT,MAAM;AAAA,IACN,OAAO;AAAA,IACP,cAAc;AAAA,IACd,eAAe;AAAA,IACf,UAAU;AAAA,IACV,QAAQ;AAAA,IACR,WAAW;AAAA,IACX,aAAa;AAAA,EACf;AACF;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/mutation.d.cts b/node_modules/@tanstack/query-core/build/modern/mutation.d.cts new file mode 100644 index 0000000..6d5c5fa --- /dev/null +++ b/node_modules/@tanstack/query-core/build/modern/mutation.d.cts @@ -0,0 +1,3 @@ +import './removable.cjs'; +export { bj as Action, x as Mutation, y as MutationState, bk as getDefaultState } from './hydration-uphG6M-i.cjs'; +import './subscribable.cjs'; diff --git a/node_modules/@tanstack/query-core/build/modern/mutation.d.ts b/node_modules/@tanstack/query-core/build/modern/mutation.d.ts new file mode 100644 index 0000000..61bcecc --- /dev/null +++ b/node_modules/@tanstack/query-core/build/modern/mutation.d.ts @@ -0,0 +1,3 @@ +import './removable.js'; +export { bj as Action, x as Mutation, y as MutationState, bk as getDefaultState } from './hydration-BlEVG2Lp.js'; +import './subscribable.js'; diff --git a/node_modules/@tanstack/query-core/build/modern/mutation.js b/node_modules/@tanstack/query-core/build/modern/mutation.js new file mode 100644 index 0000000..c710461 --- /dev/null +++ b/node_modules/@tanstack/query-core/build/modern/mutation.js @@ -0,0 +1,281 @@ +// src/mutation.ts +import { notifyManager } from "./notifyManager.js"; +import { Removable } from "./removable.js"; +import { createRetryer } from "./retryer.js"; +var Mutation = class extends Removable { + #client; + #observers; + #mutationCache; + #retryer; + constructor(config) { + super(); + this.#client = config.client; + this.mutationId = config.mutationId; + this.#mutationCache = config.mutationCache; + this.#observers = []; + this.state = config.state || getDefaultState(); + this.setOptions(config.options); + this.scheduleGc(); + } + setOptions(options) { + this.options = options; + this.updateGcTime(this.options.gcTime); + } + get meta() { + return this.options.meta; + } + addObserver(observer) { + if (!this.#observers.includes(observer)) { + this.#observers.push(observer); + this.clearGcTimeout(); + this.#mutationCache.notify({ + type: "observerAdded", + mutation: this, + observer + }); + } + } + removeObserver(observer) { + this.#observers = this.#observers.filter((x) => x !== observer); + this.scheduleGc(); + this.#mutationCache.notify({ + type: "observerRemoved", + mutation: this, + observer + }); + } + optionalRemove() { + if (!this.#observers.length) { + if (this.state.status === "pending") { + this.scheduleGc(); + } else { + this.#mutationCache.remove(this); + } + } + } + continue() { + return this.#retryer?.continue() ?? // continuing a mutation assumes that variables are set, mutation must have been dehydrated before + this.execute(this.state.variables); + } + async execute(variables) { + const onContinue = () => { + this.#dispatch({ type: "continue" }); + }; + const mutationFnContext = { + client: this.#client, + meta: this.options.meta, + mutationKey: this.options.mutationKey + }; + this.#retryer = createRetryer({ + fn: () => { + if (!this.options.mutationFn) { + return Promise.reject(new Error("No mutationFn found")); + } + return this.options.mutationFn(variables, mutationFnContext); + }, + onFail: (failureCount, error) => { + this.#dispatch({ type: "failed", failureCount, error }); + }, + onPause: () => { + this.#dispatch({ type: "pause" }); + }, + onContinue, + retry: this.options.retry ?? 0, + retryDelay: this.options.retryDelay, + networkMode: this.options.networkMode, + canRun: () => this.#mutationCache.canRun(this) + }); + const restored = this.state.status === "pending"; + const isPaused = !this.#retryer.canStart(); + try { + if (restored) { + onContinue(); + } else { + this.#dispatch({ type: "pending", variables, isPaused }); + if (this.#mutationCache.config.onMutate) { + await this.#mutationCache.config.onMutate( + variables, + this, + mutationFnContext + ); + } + const context = await this.options.onMutate?.( + variables, + mutationFnContext + ); + if (context !== this.state.context) { + this.#dispatch({ + type: "pending", + context, + variables, + isPaused + }); + } + } + const data = await this.#retryer.start(); + await this.#mutationCache.config.onSuccess?.( + data, + variables, + this.state.context, + this, + mutationFnContext + ); + await this.options.onSuccess?.( + data, + variables, + this.state.context, + mutationFnContext + ); + await this.#mutationCache.config.onSettled?.( + data, + null, + this.state.variables, + this.state.context, + this, + mutationFnContext + ); + await this.options.onSettled?.( + data, + null, + variables, + this.state.context, + mutationFnContext + ); + this.#dispatch({ type: "success", data }); + return data; + } catch (error) { + try { + await this.#mutationCache.config.onError?.( + error, + variables, + this.state.context, + this, + mutationFnContext + ); + } catch (e) { + void Promise.reject(e); + } + try { + await this.options.onError?.( + error, + variables, + this.state.context, + mutationFnContext + ); + } catch (e) { + void Promise.reject(e); + } + try { + await this.#mutationCache.config.onSettled?.( + void 0, + error, + this.state.variables, + this.state.context, + this, + mutationFnContext + ); + } catch (e) { + void Promise.reject(e); + } + try { + await this.options.onSettled?.( + void 0, + error, + variables, + this.state.context, + mutationFnContext + ); + } catch (e) { + void Promise.reject(e); + } + this.#dispatch({ type: "error", error }); + throw error; + } finally { + this.#mutationCache.runNext(this); + } + } + #dispatch(action) { + const reducer = (state) => { + switch (action.type) { + case "failed": + return { + ...state, + failureCount: action.failureCount, + failureReason: action.error + }; + case "pause": + return { + ...state, + isPaused: true + }; + case "continue": + return { + ...state, + isPaused: false + }; + case "pending": + return { + ...state, + context: action.context, + data: void 0, + failureCount: 0, + failureReason: null, + error: null, + isPaused: action.isPaused, + status: "pending", + variables: action.variables, + submittedAt: Date.now() + }; + case "success": + return { + ...state, + data: action.data, + failureCount: 0, + failureReason: null, + error: null, + status: "success", + isPaused: false + }; + case "error": + return { + ...state, + data: void 0, + error: action.error, + failureCount: state.failureCount + 1, + failureReason: action.error, + isPaused: false, + status: "error" + }; + } + }; + this.state = reducer(this.state); + notifyManager.batch(() => { + this.#observers.forEach((observer) => { + observer.onMutationUpdate(action); + }); + this.#mutationCache.notify({ + mutation: this, + type: "updated", + action + }); + }); + } +}; +function getDefaultState() { + return { + context: void 0, + data: void 0, + error: null, + failureCount: 0, + failureReason: null, + isPaused: false, + status: "idle", + variables: void 0, + submittedAt: 0 + }; +} +export { + Mutation, + getDefaultState +}; +//# sourceMappingURL=mutation.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/mutation.js.map b/node_modules/@tanstack/query-core/build/modern/mutation.js.map new file mode 100644 index 0000000..ab3ed56 --- /dev/null +++ b/node_modules/@tanstack/query-core/build/modern/mutation.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/mutation.ts"],"sourcesContent":["import { notifyManager } from './notifyManager'\nimport { Removable } from './removable'\nimport { createRetryer } from './retryer'\nimport type {\n DefaultError,\n MutationFunctionContext,\n MutationMeta,\n MutationOptions,\n MutationStatus,\n} from './types'\nimport type { MutationCache } from './mutationCache'\nimport type { MutationObserver } from './mutationObserver'\nimport type { Retryer } from './retryer'\nimport type { QueryClient } from './queryClient'\n\n// TYPES\n\ninterface MutationConfig {\n client: QueryClient\n mutationId: number\n mutationCache: MutationCache\n options: MutationOptions\n state?: MutationState\n}\n\nexport interface MutationState<\n TData = unknown,\n TError = DefaultError,\n TVariables = unknown,\n TOnMutateResult = unknown,\n> {\n context: TOnMutateResult | undefined\n data: TData | undefined\n error: TError | null\n failureCount: number\n failureReason: TError | null\n isPaused: boolean\n status: MutationStatus\n variables: TVariables | undefined\n submittedAt: number\n}\n\ninterface FailedAction {\n type: 'failed'\n failureCount: number\n error: TError | null\n}\n\ninterface PendingAction {\n type: 'pending'\n isPaused: boolean\n variables?: TVariables\n context?: TOnMutateResult\n}\n\ninterface SuccessAction {\n type: 'success'\n data: TData\n}\n\ninterface ErrorAction {\n type: 'error'\n error: TError\n}\n\ninterface PauseAction {\n type: 'pause'\n}\n\ninterface ContinueAction {\n type: 'continue'\n}\n\nexport type Action =\n | ContinueAction\n | ErrorAction\n | FailedAction\n | PendingAction\n | PauseAction\n | SuccessAction\n\n// CLASS\n\nexport class Mutation<\n TData = unknown,\n TError = DefaultError,\n TVariables = unknown,\n TOnMutateResult = unknown,\n> extends Removable {\n state: MutationState\n options!: MutationOptions\n readonly mutationId: number\n\n #client: QueryClient\n #observers: Array<\n MutationObserver\n >\n #mutationCache: MutationCache\n #retryer?: Retryer\n\n constructor(\n config: MutationConfig,\n ) {\n super()\n\n this.#client = config.client\n this.mutationId = config.mutationId\n this.#mutationCache = config.mutationCache\n this.#observers = []\n this.state = config.state || getDefaultState()\n\n this.setOptions(config.options)\n this.scheduleGc()\n }\n\n setOptions(\n options: MutationOptions,\n ): void {\n this.options = options\n\n this.updateGcTime(this.options.gcTime)\n }\n\n get meta(): MutationMeta | undefined {\n return this.options.meta\n }\n\n addObserver(observer: MutationObserver): void {\n if (!this.#observers.includes(observer)) {\n this.#observers.push(observer)\n\n // Stop the mutation from being garbage collected\n this.clearGcTimeout()\n\n this.#mutationCache.notify({\n type: 'observerAdded',\n mutation: this,\n observer,\n })\n }\n }\n\n removeObserver(observer: MutationObserver): void {\n this.#observers = this.#observers.filter((x) => x !== observer)\n\n this.scheduleGc()\n\n this.#mutationCache.notify({\n type: 'observerRemoved',\n mutation: this,\n observer,\n })\n }\n\n protected optionalRemove() {\n if (!this.#observers.length) {\n if (this.state.status === 'pending') {\n this.scheduleGc()\n } else {\n this.#mutationCache.remove(this)\n }\n }\n }\n\n continue(): Promise {\n return (\n this.#retryer?.continue() ??\n // continuing a mutation assumes that variables are set, mutation must have been dehydrated before\n this.execute(this.state.variables!)\n )\n }\n\n async execute(variables: TVariables): Promise {\n const onContinue = () => {\n this.#dispatch({ type: 'continue' })\n }\n\n const mutationFnContext = {\n client: this.#client,\n meta: this.options.meta,\n mutationKey: this.options.mutationKey,\n } satisfies MutationFunctionContext\n\n this.#retryer = createRetryer({\n fn: () => {\n if (!this.options.mutationFn) {\n return Promise.reject(new Error('No mutationFn found'))\n }\n\n return this.options.mutationFn(variables, mutationFnContext)\n },\n onFail: (failureCount, error) => {\n this.#dispatch({ type: 'failed', failureCount, error })\n },\n onPause: () => {\n this.#dispatch({ type: 'pause' })\n },\n onContinue,\n retry: this.options.retry ?? 0,\n retryDelay: this.options.retryDelay,\n networkMode: this.options.networkMode,\n canRun: () => this.#mutationCache.canRun(this),\n })\n\n const restored = this.state.status === 'pending'\n const isPaused = !this.#retryer.canStart()\n\n try {\n if (restored) {\n // Dispatch continue action to unpause restored mutation\n onContinue()\n } else {\n this.#dispatch({ type: 'pending', variables, isPaused })\n // Notify cache callback\n if (this.#mutationCache.config.onMutate) {\n await this.#mutationCache.config.onMutate(\n variables,\n this as Mutation,\n mutationFnContext,\n )\n }\n const context = await this.options.onMutate?.(\n variables,\n mutationFnContext,\n )\n if (context !== this.state.context) {\n this.#dispatch({\n type: 'pending',\n context,\n variables,\n isPaused,\n })\n }\n }\n const data = await this.#retryer.start()\n\n // Notify cache callback\n await this.#mutationCache.config.onSuccess?.(\n data,\n variables,\n this.state.context,\n this as Mutation,\n mutationFnContext,\n )\n\n await this.options.onSuccess?.(\n data,\n variables,\n this.state.context!,\n mutationFnContext,\n )\n\n // Notify cache callback\n await this.#mutationCache.config.onSettled?.(\n data,\n null,\n this.state.variables,\n this.state.context,\n this as Mutation,\n mutationFnContext,\n )\n\n await this.options.onSettled?.(\n data,\n null,\n variables,\n this.state.context,\n mutationFnContext,\n )\n\n this.#dispatch({ type: 'success', data })\n return data\n } catch (error) {\n try {\n // Notify cache callback\n await this.#mutationCache.config.onError?.(\n error as any,\n variables,\n this.state.context,\n this as Mutation,\n mutationFnContext,\n )\n } catch (e) {\n void Promise.reject(e)\n }\n\n try {\n await this.options.onError?.(\n error as TError,\n variables,\n this.state.context,\n mutationFnContext,\n )\n } catch (e) {\n void Promise.reject(e)\n }\n\n try {\n // Notify cache callback\n await this.#mutationCache.config.onSettled?.(\n undefined,\n error as any,\n this.state.variables,\n this.state.context,\n this as Mutation,\n mutationFnContext,\n )\n } catch (e) {\n void Promise.reject(e)\n }\n\n try {\n await this.options.onSettled?.(\n undefined,\n error as TError,\n variables,\n this.state.context,\n mutationFnContext,\n )\n } catch (e) {\n void Promise.reject(e)\n }\n\n this.#dispatch({ type: 'error', error: error as TError })\n throw error\n } finally {\n this.#mutationCache.runNext(this)\n }\n }\n\n #dispatch(action: Action): void {\n const reducer = (\n state: MutationState,\n ): MutationState => {\n switch (action.type) {\n case 'failed':\n return {\n ...state,\n failureCount: action.failureCount,\n failureReason: action.error,\n }\n case 'pause':\n return {\n ...state,\n isPaused: true,\n }\n case 'continue':\n return {\n ...state,\n isPaused: false,\n }\n case 'pending':\n return {\n ...state,\n context: action.context,\n data: undefined,\n failureCount: 0,\n failureReason: null,\n error: null,\n isPaused: action.isPaused,\n status: 'pending',\n variables: action.variables,\n submittedAt: Date.now(),\n }\n case 'success':\n return {\n ...state,\n data: action.data,\n failureCount: 0,\n failureReason: null,\n error: null,\n status: 'success',\n isPaused: false,\n }\n case 'error':\n return {\n ...state,\n data: undefined,\n error: action.error,\n failureCount: state.failureCount + 1,\n failureReason: action.error,\n isPaused: false,\n status: 'error',\n }\n }\n }\n this.state = reducer(this.state)\n\n notifyManager.batch(() => {\n this.#observers.forEach((observer) => {\n observer.onMutationUpdate(action)\n })\n this.#mutationCache.notify({\n mutation: this,\n type: 'updated',\n action,\n })\n })\n }\n}\n\nexport function getDefaultState<\n TData,\n TError,\n TVariables,\n TOnMutateResult,\n>(): MutationState {\n return {\n context: undefined,\n data: undefined,\n error: null,\n failureCount: 0,\n failureReason: null,\n isPaused: false,\n status: 'idle',\n variables: undefined,\n submittedAt: 0,\n }\n}\n"],"mappings":";AAAA,SAAS,qBAAqB;AAC9B,SAAS,iBAAiB;AAC1B,SAAS,qBAAqB;AAiFvB,IAAM,WAAN,cAKG,UAAU;AAAA,EAKlB;AAAA,EACA;AAAA,EAGA;AAAA,EACA;AAAA,EAEA,YACE,QACA;AACA,UAAM;AAEN,SAAK,UAAU,OAAO;AACtB,SAAK,aAAa,OAAO;AACzB,SAAK,iBAAiB,OAAO;AAC7B,SAAK,aAAa,CAAC;AACnB,SAAK,QAAQ,OAAO,SAAS,gBAAgB;AAE7C,SAAK,WAAW,OAAO,OAAO;AAC9B,SAAK,WAAW;AAAA,EAClB;AAAA,EAEA,WACE,SACM;AACN,SAAK,UAAU;AAEf,SAAK,aAAa,KAAK,QAAQ,MAAM;AAAA,EACvC;AAAA,EAEA,IAAI,OAAiC;AACnC,WAAO,KAAK,QAAQ;AAAA,EACtB;AAAA,EAEA,YAAY,UAAsD;AAChE,QAAI,CAAC,KAAK,WAAW,SAAS,QAAQ,GAAG;AACvC,WAAK,WAAW,KAAK,QAAQ;AAG7B,WAAK,eAAe;AAEpB,WAAK,eAAe,OAAO;AAAA,QACzB,MAAM;AAAA,QACN,UAAU;AAAA,QACV;AAAA,MACF,CAAC;AAAA,IACH;AAAA,EACF;AAAA,EAEA,eAAe,UAAsD;AACnE,SAAK,aAAa,KAAK,WAAW,OAAO,CAAC,MAAM,MAAM,QAAQ;AAE9D,SAAK,WAAW;AAEhB,SAAK,eAAe,OAAO;AAAA,MACzB,MAAM;AAAA,MACN,UAAU;AAAA,MACV;AAAA,IACF,CAAC;AAAA,EACH;AAAA,EAEU,iBAAiB;AACzB,QAAI,CAAC,KAAK,WAAW,QAAQ;AAC3B,UAAI,KAAK,MAAM,WAAW,WAAW;AACnC,aAAK,WAAW;AAAA,MAClB,OAAO;AACL,aAAK,eAAe,OAAO,IAAI;A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G;AAAA,YACH,MAAM;AAAA,YACN,OAAO,OAAO;AAAA,YACd,cAAc,MAAM,eAAe;AAAA,YACnC,eAAe,OAAO;AAAA,YACtB,UAAU;AAAA,YACV,QAAQ;AAAA,UACV;AAAA,MACJ;AAAA,IACF;AACA,SAAK,QAAQ,QAAQ,KAAK,KAAK;AAE/B,kBAAc,MAAM,MAAM;AACxB,WAAK,WAAW,QAAQ,CAAC,aAAa;AACpC,iBAAS,iBAAiB,MAAM;AAAA,MAClC,CAAC;AACD,WAAK,eAAe,OAAO;AAAA,QACzB,UAAU;AAAA,QACV,MAAM;AAAA,QACN;AAAA,MACF,CAAC;AAAA,IACH,CAAC;AAAA,EACH;AACF;AAEO,SAAS,kBAK+C;AAC7D,SAAO;AAAA,IACL,SAAS;AAAA,IACT,MAAM;AAAA,IACN,OAAO;AAAA,IACP,cAAc;AAAA,IACd,eAAe;AAAA,IACf,UAAU;AAAA,IACV,QAAQ;AAAA,IACR,WAAW;AAAA,IACX,aAAa;AAAA,EACf;AACF;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/mutationCache.cjs b/node_modules/@tanstack/query-core/build/modern/mutationCache.cjs new file mode 100644 index 0000000..f939c12 --- /dev/null +++ b/node_modules/@tanstack/query-core/build/modern/mutationCache.cjs @@ -0,0 +1,149 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/mutationCache.ts +var mutationCache_exports = {}; +__export(mutationCache_exports, { + MutationCache: () => MutationCache +}); +module.exports = __toCommonJS(mutationCache_exports); +var import_notifyManager = require("./notifyManager.cjs"); +var import_mutation = require("./mutation.cjs"); +var import_utils = require("./utils.cjs"); +var import_subscribable = require("./subscribable.cjs"); +var MutationCache = class extends import_subscribable.Subscribable { + constructor(config = {}) { + super(); + this.config = config; + this.#mutations = /* @__PURE__ */ new Set(); + this.#scopes = /* @__PURE__ */ new Map(); + this.#mutationId = 0; + } + #mutations; + #scopes; + #mutationId; + build(client, options, state) { + const mutation = new import_mutation.Mutation({ + client, + mutationCache: this, + mutationId: ++this.#mutationId, + options: client.defaultMutationOptions(options), + state + }); + this.add(mutation); + return mutation; + } + add(mutation) { + this.#mutations.add(mutation); + const scope = scopeFor(mutation); + if (typeof scope === "string") { + const scopedMutations = this.#scopes.get(scope); + if (scopedMutations) { + scopedMutations.push(mutation); + } else { + this.#scopes.set(scope, [mutation]); + } + } + this.notify({ type: "added", mutation }); + } + remove(mutation) { + if (this.#mutations.delete(mutation)) { + const scope = scopeFor(mutation); + if (typeof scope === "string") { + const scopedMutations = this.#scopes.get(scope); + if (scopedMutations) { + if (scopedMutations.length > 1) { + const index = scopedMutations.indexOf(mutation); + if (index !== -1) { + scopedMutations.splice(index, 1); + } + } else if (scopedMutations[0] === mutation) { + this.#scopes.delete(scope); + } + } + } + } + this.notify({ type: "removed", mutation }); + } + canRun(mutation) { + const scope = scopeFor(mutation); + if (typeof scope === "string") { + const mutationsWithSameScope = this.#scopes.get(scope); + const firstPendingMutation = mutationsWithSameScope?.find( + (m) => m.state.status === "pending" + ); + return !firstPendingMutation || firstPendingMutation === mutation; + } else { + return true; + } + } + runNext(mutation) { + const scope = scopeFor(mutation); + if (typeof scope === "string") { + const foundMutation = this.#scopes.get(scope)?.find((m) => m !== mutation && m.state.isPaused); + return foundMutation?.continue() ?? Promise.resolve(); + } else { + return Promise.resolve(); + } + } + clear() { + import_notifyManager.notifyManager.batch(() => { + this.#mutations.forEach((mutation) => { + this.notify({ type: "removed", mutation }); + }); + this.#mutations.clear(); + this.#scopes.clear(); + }); + } + getAll() { + return Array.from(this.#mutations); + } + find(filters) { + const defaultedFilters = { exact: true, ...filters }; + return this.getAll().find( + (mutation) => (0, import_utils.matchMutation)(defaultedFilters, mutation) + ); + } + findAll(filters = {}) { + return this.getAll().filter((mutation) => (0, import_utils.matchMutation)(filters, mutation)); + } + notify(event) { + import_notifyManager.notifyManager.batch(() => { + this.listeners.forEach((listener) => { + listener(event); + }); + }); + } + resumePausedMutations() { + const pausedMutations = this.getAll().filter((x) => x.state.isPaused); + return import_notifyManager.notifyManager.batch( + () => Promise.all( + pausedMutations.map((mutation) => mutation.continue().catch(import_utils.noop)) + ) + ); + } +}; +function scopeFor(mutation) { + return mutation.options.scope?.id; +} +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + MutationCache +}); +//# sourceMappingURL=mutationCache.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/mutationCache.cjs.map b/node_modules/@tanstack/query-core/build/modern/mutationCache.cjs.map new file mode 100644 index 0000000..2308acf --- /dev/null +++ b/node_modules/@tanstack/query-core/build/modern/mutationCache.cjs.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/mutationCache.ts"],"sourcesContent":["import { notifyManager } from './notifyManager'\nimport { Mutation } from './mutation'\nimport { matchMutation, noop } from './utils'\nimport { Subscribable } from './subscribable'\nimport type { MutationObserver } from './mutationObserver'\nimport type {\n DefaultError,\n MutationFunctionContext,\n MutationOptions,\n NotifyEvent,\n} from './types'\nimport type { QueryClient } from './queryClient'\nimport type { Action, MutationState } from './mutation'\nimport type { MutationFilters } from './utils'\n\n// TYPES\n\ninterface MutationCacheConfig {\n onError?: (\n error: DefaultError,\n variables: unknown,\n onMutateResult: unknown,\n mutation: Mutation,\n context: MutationFunctionContext,\n ) => Promise | unknown\n onSuccess?: (\n data: unknown,\n variables: unknown,\n onMutateResult: unknown,\n mutation: Mutation,\n context: MutationFunctionContext,\n ) => Promise | unknown\n onMutate?: (\n variables: unknown,\n mutation: Mutation,\n context: MutationFunctionContext,\n ) => Promise | unknown\n onSettled?: (\n data: unknown | undefined,\n error: DefaultError | null,\n variables: unknown,\n onMutateResult: unknown,\n mutation: Mutation,\n context: MutationFunctionContext,\n ) => Promise | unknown\n}\n\ninterface NotifyEventMutationAdded extends NotifyEvent {\n type: 'added'\n mutation: Mutation\n}\ninterface NotifyEventMutationRemoved extends NotifyEvent {\n type: 'removed'\n mutation: Mutation\n}\n\ninterface NotifyEventMutationObserverAdded extends NotifyEvent {\n type: 'observerAdded'\n mutation: Mutation\n observer: MutationObserver\n}\n\ninterface NotifyEventMutationObserverRemoved extends NotifyEvent {\n type: 'observerRemoved'\n mutation: Mutation\n observer: MutationObserver\n}\n\ninterface NotifyEventMutationObserverOptionsUpdated extends NotifyEvent {\n type: 'observerOptionsUpdated'\n mutation?: Mutation\n observer: MutationObserver\n}\n\ninterface NotifyEventMutationUpdated extends NotifyEvent {\n type: 'updated'\n mutation: Mutation\n action: Action\n}\n\nexport type MutationCacheNotifyEvent =\n | NotifyEventMutationAdded\n | NotifyEventMutationRemoved\n | NotifyEventMutationObserverAdded\n | NotifyEventMutationObserverRemoved\n | NotifyEventMutationObserverOptionsUpdated\n | NotifyEventMutationUpdated\n\ntype MutationCacheListener = (event: MutationCacheNotifyEvent) => void\n\n// CLASS\n\nexport class MutationCache extends Subscribable {\n #mutations: Set>\n #scopes: Map>>\n #mutationId: number\n\n constructor(public config: MutationCacheConfig = {}) {\n super()\n this.#mutations = new Set()\n this.#scopes = new Map()\n this.#mutationId = 0\n }\n\n build(\n client: QueryClient,\n options: MutationOptions,\n state?: MutationState,\n ): Mutation {\n const mutation = new Mutation({\n client,\n mutationCache: this,\n mutationId: ++this.#mutationId,\n options: client.defaultMutationOptions(options),\n state,\n })\n\n this.add(mutation)\n\n return mutation\n }\n\n add(mutation: Mutation): void {\n this.#mutations.add(mutation)\n const scope = scopeFor(mutation)\n if (typeof scope === 'string') {\n const scopedMutations = this.#scopes.get(scope)\n if (scopedMutations) {\n scopedMutations.push(mutation)\n } else {\n this.#scopes.set(scope, [mutation])\n }\n }\n this.notify({ type: 'added', mutation })\n }\n\n remove(mutation: Mutation): void {\n if (this.#mutations.delete(mutation)) {\n const scope = scopeFor(mutation)\n if (typeof scope === 'string') {\n const scopedMutations = this.#scopes.get(scope)\n if (scopedMutations) {\n if (scopedMutations.length > 1) {\n const index = scopedMutations.indexOf(mutation)\n if (index !== -1) {\n scopedMutations.splice(index, 1)\n }\n } else if (scopedMutations[0] === mutation) {\n this.#scopes.delete(scope)\n }\n }\n }\n }\n\n // Currently we notify the removal even if the mutation was already removed.\n // Consider making this an error or not notifying of the removal depending on the desired semantics.\n this.notify({ type: 'removed', mutation })\n }\n\n canRun(mutation: Mutation): boolean {\n const scope = scopeFor(mutation)\n if (typeof scope === 'string') {\n const mutationsWithSameScope = this.#scopes.get(scope)\n const firstPendingMutation = mutationsWithSameScope?.find(\n (m) => m.state.status === 'pending',\n )\n // we can run if there is no current pending mutation (start use-case)\n // or if WE are the first pending mutation (continue use-case)\n return !firstPendingMutation || firstPendingMutation === mutation\n } else {\n // For unscoped mutations there are never any pending mutations in front of the\n // current mutation\n return true\n }\n }\n\n runNext(mutation: Mutation): Promise {\n const scope = scopeFor(mutation)\n if (typeof scope === 'string') {\n const foundMutation = this.#scopes\n .get(scope)\n ?.find((m) => m !== mutation && m.state.isPaused)\n\n return foundMutation?.continue() ?? Promise.resolve()\n } else {\n return Promise.resolve()\n }\n }\n\n clear(): void {\n notifyManager.batch(() => {\n this.#mutations.forEach((mutation) => {\n this.notify({ type: 'removed', mutation })\n })\n this.#mutations.clear()\n this.#scopes.clear()\n })\n }\n\n getAll(): Array {\n return Array.from(this.#mutations)\n }\n\n find<\n TData = unknown,\n TError = DefaultError,\n TVariables = any,\n TOnMutateResult = unknown,\n >(\n filters: MutationFilters,\n ): Mutation | undefined {\n const defaultedFilters = { exact: true, ...filters }\n\n return this.getAll().find((mutation) =>\n matchMutation(defaultedFilters, mutation),\n ) as Mutation | undefined\n }\n\n findAll(filters: MutationFilters = {}): Array {\n return this.getAll().filter((mutation) => matchMutation(filters, mutation))\n }\n\n notify(event: MutationCacheNotifyEvent) {\n notifyManager.batch(() => {\n this.listeners.forEach((listener) => {\n listener(event)\n })\n })\n }\n\n resumePausedMutations(): Promise {\n const pausedMutations = this.getAll().filter((x) => x.state.isPaused)\n\n return notifyManager.batch(() =>\n Promise.all(\n pausedMutations.map((mutation) => mutation.continue().catch(noop)),\n ),\n )\n }\n}\n\nfunction scopeFor(mutation: Mutation) {\n return mutation.options.scope?.id\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,2BAA8B;AAC9B,sBAAyB;AACzB,mBAAoC;AACpC,0BAA6B;AAyFtB,IAAM,gBAAN,cAA4B,iCAAoC;AAAA,EAKrE,YAAmB,SAA8B,CAAC,GAAG;AACnD,UAAM;AADW;AAEjB,SAAK,aAAa,oBAAI,IAAI;AAC1B,SAAK,UAAU,oBAAI,IAAI;AACvB,SAAK,cAAc;AAAA,EACrB;AAAA,EATA;AAAA,EACA;AAAA,EACA;AAAA,EASA,MACE,QACA,SACA,OACsD;AACtD,UAAM,WAAW,IAAI,yBAAS;AAAA,MAC5B;AAAA,MACA,eAAe;AAAA,MACf,YAAY,EAAE,KAAK;AAAA,MACnB,SAAS,OAAO,uBAAuB,OAAO;AAAA,MAC9C;AAAA,IACF,CAAC;AAED,SAAK,IAAI,QAAQ;AAEjB,WAAO;AAAA,EACT;AAAA,EAEA,IAAI,UAA8C;AAChD,SAAK,WAAW,IAAI,QAAQ;AAC5B,UAAM,QAAQ,SAAS,QAAQ;AAC/B,QAAI,OAAO,UAAU,UAAU;AAC7B,YAAM,kBAAkB,KAAK,QAAQ,IAAI,KAAK;AAC9C,UAAI,iBAAiB;AACnB,wBAAgB,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QAAQ;AAAA,IACtD,OAAO;AACL,aAAO,QAAQ,QAAQ;AAAA,IACzB;AAAA,EACF;AAAA,EAEA,QAAc;AACZ,uCAAc,MAAM,MAAM;AACxB,WAAK,WAAW,QAAQ,CAAC,aAAa;AACpC,aAAK,OAAO,EAAE,MAAM,WAAW,SAAS,CAAC;AAAA,MAC3C,CAAC;AACD,WAAK,WAAW,MAAM;AACtB,WAAK,QAAQ,MAAM;AAAA,IACrB,CAAC;AAAA,EACH;AAAA,EAEA,SAA0B;AACxB,WAAO,MAAM,KAAK,KAAK,UAAU;AAAA,EACnC;AAAA,EAEA,KAME,SACkE;AAClE,UAAM,mBAAmB,EAAE,OAAO,MAAM,GAAG,QAAQ;AAEnD,WAAO,KAAK,OAAO,EAAE;AAAA,MAAK,CAAC,iBACzB,4BAAc,kBAAkB,QAAQ;AAAA,IAC1C;AAAA,EACF;AAAA,EAEA,QAAQ,UAA2B,CAAC,GAAoB;AACtD,WAAO,KAAK,OAAO,EAAE,OAAO,CAAC,iBAAa,4BAAc,SAAS,QAAQ,CAAC;AAAA,EAC5E;AAAA,EAEA,OAAO,OAAiC;AACtC,uCAAc,MAAM,MAAM;AACxB,WAAK,UAAU,QAAQ,CAAC,aAAa;AACnC,iBAAS,KAAK;AAAA,MAChB,CAAC;AAAA,IACH,CAAC;AAAA,EACH;AAAA,EAEA,wBAA0C;AACxC,UAAM,kBAAkB,KAAK,OAAO,EAAE,OAAO,CAAC,MAAM,EAAE,MAAM,QAAQ;AAEpE,WAAO,mCAAc;AAAA,MAAM,MACzB,QAAQ;AAAA,QACN,gBAAgB,IAAI,CAAC,aAAa,SAAS,SAAS,EAAE,MAAM,iBAAI,CAAC;AAAA,MACnE;AAAA,IACF;AAAA,EACF;AACF;AAEA,SAAS,SAAS,UAAwC;AACxD,SAAO,SAAS,QAAQ,OAAO;AACjC;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/mutationCache.d.cts b/node_modules/@tanstack/query-core/build/modern/mutationCache.d.cts new file mode 100644 index 0000000..ce18321 --- /dev/null +++ b/node_modules/@tanstack/query-core/build/modern/mutationCache.d.cts @@ -0,0 +1,3 @@ +export { M as MutationCache, c as MutationCacheNotifyEvent } from './hydration-uphG6M-i.cjs'; +import './subscribable.cjs'; +import './removable.cjs'; diff --git a/node_modules/@tanstack/query-core/build/modern/mutationCache.d.ts b/node_modules/@tanstack/query-core/build/modern/mutationCache.d.ts new file mode 100644 index 0000000..67f1bfe --- /dev/null +++ b/node_modules/@tanstack/query-core/build/modern/mutationCache.d.ts @@ -0,0 +1,3 @@ +export { M as MutationCache, c as MutationCacheNotifyEvent } from './hydration-BlEVG2Lp.js'; +import './subscribable.js'; +import './removable.js'; diff --git a/node_modules/@tanstack/query-core/build/modern/mutationCache.js b/node_modules/@tanstack/query-core/build/modern/mutationCache.js new file mode 100644 index 0000000..7067b76 --- /dev/null +++ b/node_modules/@tanstack/query-core/build/modern/mutationCache.js @@ -0,0 +1,124 @@ +// src/mutationCache.ts +import { notifyManager } from "./notifyManager.js"; +import { Mutation } from "./mutation.js"; +import { matchMutation, noop } from "./utils.js"; +import { Subscribable } from "./subscribable.js"; +var MutationCache = class extends Subscribable { + constructor(config = {}) { + super(); + this.config = config; + this.#mutations = /* @__PURE__ */ new Set(); + this.#scopes = /* @__PURE__ */ new Map(); + this.#mutationId = 0; + } + #mutations; + #scopes; + #mutationId; + build(client, options, state) { + const mutation = new Mutation({ + client, + mutationCache: this, + mutationId: ++this.#mutationId, + options: client.defaultMutationOptions(options), + state + }); + this.add(mutation); + return mutation; + } + add(mutation) { + this.#mutations.add(mutation); + const scope = scopeFor(mutation); + if (typeof scope === "string") { + const scopedMutations = this.#scopes.get(scope); + if (scopedMutations) { + scopedMutations.push(mutation); + } else { + this.#scopes.set(scope, [mutation]); + } + } + this.notify({ type: "added", mutation }); + } + remove(mutation) { + if (this.#mutations.delete(mutation)) { + const scope = scopeFor(mutation); + if (typeof scope === "string") { + const scopedMutations = this.#scopes.get(scope); + if (scopedMutations) { + if (scopedMutations.length > 1) { + const index = scopedMutations.indexOf(mutation); + if (index !== -1) { + scopedMutations.splice(index, 1); + } + } else if (scopedMutations[0] === mutation) { + this.#scopes.delete(scope); + } + } + } + } + this.notify({ type: "removed", mutation }); + } + canRun(mutation) { + const scope = scopeFor(mutation); + if (typeof scope === "string") { + const mutationsWithSameScope = this.#scopes.get(scope); + const firstPendingMutation = mutationsWithSameScope?.find( + (m) => m.state.status === "pending" + ); + return !firstPendingMutation || firstPendingMutation === mutation; + } else { + return true; + } + } + runNext(mutation) { + const scope = scopeFor(mutation); + if (typeof scope === "string") { + const foundMutation = this.#scopes.get(scope)?.find((m) => m !== mutation && m.state.isPaused); + return foundMutation?.continue() ?? Promise.resolve(); + } else { + return Promise.resolve(); + } + } + clear() { + notifyManager.batch(() => { + this.#mutations.forEach((mutation) => { + this.notify({ type: "removed", mutation }); + }); + this.#mutations.clear(); + this.#scopes.clear(); + }); + } + getAll() { + return Array.from(this.#mutations); + } + find(filters) { + const defaultedFilters = { exact: true, ...filters }; + return this.getAll().find( + (mutation) => matchMutation(defaultedFilters, mutation) + ); + } + findAll(filters = {}) { + return this.getAll().filter((mutation) => matchMutation(filters, mutation)); + } + notify(event) { + notifyManager.batch(() => { + this.listeners.forEach((listener) => { + listener(event); + }); + }); + } + resumePausedMutations() { + const pausedMutations = this.getAll().filter((x) => x.state.isPaused); + return notifyManager.batch( + () => Promise.all( + pausedMutations.map((mutation) => mutation.continue().catch(noop)) + ) + ); + } +}; +function scopeFor(mutation) { + return mutation.options.scope?.id; +} +export { + MutationCache +}; +//# sourceMappingURL=mutationCache.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/mutationCache.js.map b/node_modules/@tanstack/query-core/build/modern/mutationCache.js.map new file mode 100644 index 0000000..6a7f97d --- /dev/null +++ b/node_modules/@tanstack/query-core/build/modern/mutationCache.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/mutationCache.ts"],"sourcesContent":["import { notifyManager } from './notifyManager'\nimport { Mutation } from './mutation'\nimport { matchMutation, noop } from './utils'\nimport { Subscribable } from './subscribable'\nimport type { MutationObserver } from './mutationObserver'\nimport type {\n DefaultError,\n MutationFunctionContext,\n MutationOptions,\n NotifyEvent,\n} from './types'\nimport type { QueryClient } from './queryClient'\nimport type { Action, MutationState } from './mutation'\nimport type { MutationFilters } from './utils'\n\n// TYPES\n\ninterface MutationCacheConfig {\n onError?: (\n error: DefaultError,\n variables: unknown,\n onMutateResult: unknown,\n mutation: Mutation,\n context: MutationFunctionContext,\n ) => Promise | unknown\n onSuccess?: (\n data: unknown,\n variables: unknown,\n onMutateResult: unknown,\n mutation: Mutation,\n context: MutationFunctionContext,\n ) => Promise | unknown\n onMutate?: (\n variables: unknown,\n mutation: Mutation,\n context: MutationFunctionContext,\n ) => Promise | unknown\n onSettled?: (\n data: unknown | undefined,\n error: DefaultError | null,\n variables: unknown,\n onMutateResult: unknown,\n mutation: Mutation,\n context: MutationFunctionContext,\n ) => Promise | unknown\n}\n\ninterface NotifyEventMutationAdded extends NotifyEvent {\n type: 'added'\n mutation: Mutation\n}\ninterface NotifyEventMutationRemoved extends NotifyEvent {\n type: 'removed'\n mutation: Mutation\n}\n\ninterface NotifyEventMutationObserverAdded extends NotifyEvent {\n type: 'observerAdded'\n mutation: Mutation\n observer: MutationObserver\n}\n\ninterface NotifyEventMutationObserverRemoved extends NotifyEvent {\n type: 'observerRemoved'\n mutation: Mutation\n observer: MutationObserver\n}\n\ninterface NotifyEventMutationObserverOptionsUpdated extends NotifyEvent {\n type: 'observerOptionsUpdated'\n mutation?: Mutation\n observer: MutationObserver\n}\n\ninterface NotifyEventMutationUpdated extends NotifyEvent {\n type: 'updated'\n mutation: Mutation\n action: Action\n}\n\nexport type MutationCacheNotifyEvent =\n | NotifyEventMutationAdded\n | NotifyEventMutationRemoved\n | NotifyEventMutationObserverAdded\n | NotifyEventMutationObserverRemoved\n | NotifyEventMutationObserverOptionsUpdated\n | NotifyEventMutationUpdated\n\ntype MutationCacheListener = (event: MutationCacheNotifyEvent) => void\n\n// CLASS\n\nexport class MutationCache extends Subscribable {\n #mutations: Set>\n #scopes: Map>>\n #mutationId: number\n\n constructor(public config: MutationCacheConfig = {}) {\n super()\n this.#mutations = new Set()\n this.#scopes = new Map()\n this.#mutationId = 0\n }\n\n build(\n client: QueryClient,\n options: MutationOptions,\n state?: MutationState,\n ): Mutation {\n const mutation = new Mutation({\n client,\n mutationCache: this,\n mutationId: ++this.#mutationId,\n options: client.defaultMutationOptions(options),\n state,\n })\n\n this.add(mutation)\n\n return mutation\n }\n\n add(mutation: Mutation): void {\n this.#mutations.add(mutation)\n const scope = scopeFor(mutation)\n if (typeof scope === 'string') {\n const scopedMutations = this.#scopes.get(scope)\n if (scopedMutations) {\n scopedMutations.push(mutation)\n } else {\n this.#scopes.set(scope, [mutation])\n }\n }\n this.notify({ type: 'added', mutation })\n }\n\n remove(mutation: Mutation): void {\n if (this.#mutations.delete(mutation)) {\n const scope = scopeFor(mutation)\n if (typeof scope === 'string') {\n const scopedMutations = this.#scopes.get(scope)\n if (scopedMutations) {\n if (scopedMutations.length > 1) {\n const index = scopedMutations.indexOf(mutation)\n if (index !== -1) {\n scopedMutations.splice(index, 1)\n }\n } else if (scopedMutations[0] === mutation) {\n this.#scopes.delete(scope)\n }\n }\n }\n }\n\n // Currently we notify the removal even if the mutation was already removed.\n // Consider making this an error or not notifying of the removal depending on the desired semantics.\n this.notify({ type: 'removed', mutation })\n }\n\n canRun(mutation: Mutation): boolean {\n const scope = scopeFor(mutation)\n if (typeof scope === 'string') {\n const mutationsWithSameScope = this.#scopes.get(scope)\n const firstPendingMutation = mutationsWithSameScope?.find(\n (m) => m.state.status === 'pending',\n )\n // we can run if there is no current pending mutation (start use-case)\n // or if WE are the first pending mutation (continue use-case)\n return !firstPendingMutation || firstPendingMutation === mutation\n } else {\n // For unscoped mutations there are never any pending mutations in front of the\n // current mutation\n return true\n }\n }\n\n runNext(mutation: Mutation): Promise {\n const scope = scopeFor(mutation)\n if (typeof scope === 'string') {\n const foundMutation = this.#scopes\n .get(scope)\n ?.find((m) => m !== mutation && m.state.isPaused)\n\n return foundMutation?.continue() ?? Promise.resolve()\n } else {\n return Promise.resolve()\n }\n }\n\n clear(): void {\n notifyManager.batch(() => {\n this.#mutations.forEach((mutation) => {\n this.notify({ type: 'removed', mutation })\n })\n this.#mutations.clear()\n this.#scopes.clear()\n })\n }\n\n getAll(): Array {\n return Array.from(this.#mutations)\n }\n\n find<\n TData = unknown,\n TError = DefaultError,\n TVariables = any,\n TOnMutateResult = unknown,\n >(\n filters: MutationFilters,\n ): Mutation | undefined {\n const defaultedFilters = { exact: true, ...filters }\n\n return this.getAll().find((mutation) =>\n matchMutation(defaultedFilters, mutation),\n ) as Mutation | undefined\n }\n\n findAll(filters: MutationFilters = {}): Array {\n return this.getAll().filter((mutation) => matchMutation(filters, mutation))\n }\n\n notify(event: MutationCacheNotifyEvent) {\n notifyManager.batch(() => {\n this.listeners.forEach((listener) => {\n listener(event)\n })\n })\n }\n\n resumePausedMutations(): Promise {\n const pausedMutations = this.getAll().filter((x) => x.state.isPaused)\n\n return notifyManager.batch(() =>\n Promise.all(\n pausedMutations.map((mutation) => mutation.continue().catch(noop)),\n ),\n )\n }\n}\n\nfunction scopeFor(mutation: Mutation) {\n return mutation.options.scope?.id\n}\n"],"mappings":";AAAA,SAAS,qBAAqB;AAC9B,SAAS,gBAAgB;AACzB,SAAS,eAAe,YAAY;AACpC,SAAS,oBAAoB;AAyFtB,IAAM,gBAAN,cAA4B,aAAoC;AAAA,EAKrE,YAAmB,SAA8B,CAAC,GAAG;AACnD,UAAM;AADW;AAEjB,SAAK,aAAa,oBAAI,IAAI;AAC1B,SAAK,UAAU,oBAAI,IAAI;AACvB,SAAK,cAAc;AAAA,EACrB;AAAA,EATA;AAAA,EACA;AAAA,EACA;AAAA,EASA,MACE,QACA,SACA,OACsD;AACtD,UAAM,WAAW,IAAI,SAAS;AAAA,MAC5B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AK,OAAO,EAAE,OAAO,CAAC,MAAM,EAAE,MAAM,QAAQ;AAEpE,WAAO,cAAc;AAAA,MAAM,MACzB,QAAQ;AAAA,QACN,gBAAgB,IAAI,CAAC,aAAa,SAAS,SAAS,EAAE,MAAM,IAAI,CAAC;AAAA,MACnE;AAAA,IACF;AAAA,EACF;AACF;AAEA,SAAS,SAAS,UAAwC;AACxD,SAAO,SAAS,QAAQ,OAAO;AACjC;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/mutationObserver.cjs b/node_modules/@tanstack/query-core/build/modern/mutationObserver.cjs new file mode 100644 index 0000000..b7dc73d --- /dev/null +++ b/node_modules/@tanstack/query-core/build/modern/mutationObserver.cjs @@ -0,0 +1,165 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/mutationObserver.ts +var mutationObserver_exports = {}; +__export(mutationObserver_exports, { + MutationObserver: () => MutationObserver +}); +module.exports = __toCommonJS(mutationObserver_exports); +var import_mutation = require("./mutation.cjs"); +var import_notifyManager = require("./notifyManager.cjs"); +var import_subscribable = require("./subscribable.cjs"); +var import_utils = require("./utils.cjs"); +var MutationObserver = class extends import_subscribable.Subscribable { + #client; + #currentResult = void 0; + #currentMutation; + #mutateOptions; + constructor(client, options) { + super(); + this.#client = client; + this.setOptions(options); + this.bindMethods(); + this.#updateResult(); + } + bindMethods() { + this.mutate = this.mutate.bind(this); + this.reset = this.reset.bind(this); + } + setOptions(options) { + const prevOptions = this.options; + this.options = this.#client.defaultMutationOptions(options); + if (!(0, import_utils.shallowEqualObjects)(this.options, prevOptions)) { + this.#client.getMutationCache().notify({ + type: "observerOptionsUpdated", + mutation: this.#currentMutation, + observer: this + }); + } + if (prevOptions?.mutationKey && this.options.mutationKey && (0, import_utils.hashKey)(prevOptions.mutationKey) !== (0, import_utils.hashKey)(this.options.mutationKey)) { + this.reset(); + } else if (this.#currentMutation?.state.status === "pending") { + this.#currentMutation.setOptions(this.options); + } + } + onUnsubscribe() { + if (!this.hasListeners()) { + this.#currentMutation?.removeObserver(this); + } + } + onMutationUpdate(action) { + this.#updateResult(); + this.#notify(action); + } + getCurrentResult() { + return this.#currentResult; + } + reset() { + this.#currentMutation?.removeObserver(this); + this.#currentMutation = void 0; + this.#updateResult(); + this.#notify(); + } + mutate(variables, options) { + this.#mutateOptions = options; + this.#currentMutation?.removeObserver(this); + this.#currentMutation = this.#client.getMutationCache().build(this.#client, this.options); + this.#currentMutation.addObserver(this); + return this.#currentMutation.execute(variables); + } + #updateResult() { + const state = this.#currentMutation?.state ?? (0, import_mutation.getDefaultState)(); + this.#currentResult = { + ...state, + isPending: state.status === "pending", + isSuccess: state.status === "success", + isError: state.status === "error", + isIdle: state.status === "idle", + mutate: this.mutate, + reset: this.reset + }; + } + #notify(action) { + import_notifyManager.notifyManager.batch(() => { + if (this.#mutateOptions && this.hasListeners()) { + const variables = this.#currentResult.variables; + const onMutateResult = this.#currentResult.context; + const context = { + client: this.#client, + meta: this.options.meta, + mutationKey: this.options.mutationKey + }; + if (action?.type === "success") { + try { + this.#mutateOptions.onSuccess?.( + action.data, + variables, + onMutateResult, + context + ); + } catch (e) { + void Promise.reject(e); + } + try { + this.#mutateOptions.onSettled?.( + action.data, + null, + variables, + onMutateResult, + context + ); + } catch (e) { + void Promise.reject(e); + } + } else if (action?.type === "error") { + try { + this.#mutateOptions.onError?.( + action.error, + variables, + onMutateResult, + context + ); + } catch (e) { + void Promise.reject(e); + } + try { + this.#mutateOptions.onSettled?.( + void 0, + action.error, + variables, + onMutateResult, + context + ); + } catch (e) { + void Promise.reject(e); + } + } + } + this.listeners.forEach((listener) => { + listener(this.#currentResult); + }); + }); + } +}; +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + MutationObserver +}); +//# sourceMappingURL=mutationObserver.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/mutationObserver.cjs.map b/node_modules/@tanstack/query-core/build/modern/mutationObserver.cjs.map new file mode 100644 index 0000000..642bf80 --- /dev/null +++ b/node_modules/@tanstack/query-core/build/modern/mutationObserver.cjs.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/mutationObserver.ts"],"sourcesContent":["import { getDefaultState } from './mutation'\nimport { notifyManager } from './notifyManager'\nimport { Subscribable } from './subscribable'\nimport { hashKey, shallowEqualObjects } from './utils'\nimport type { QueryClient } from './queryClient'\nimport type {\n DefaultError,\n MutateOptions,\n MutationFunctionContext,\n MutationObserverOptions,\n MutationObserverResult,\n} from './types'\nimport type { Action, Mutation } from './mutation'\n\n// TYPES\n\ntype MutationObserverListener = (\n result: MutationObserverResult,\n) => void\n\n// CLASS\n\nexport class MutationObserver<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n> extends Subscribable<\n MutationObserverListener\n> {\n options!: MutationObserverOptions\n\n #client: QueryClient\n #currentResult: MutationObserverResult<\n TData,\n TError,\n TVariables,\n TOnMutateResult\n > = undefined!\n #currentMutation?: Mutation\n #mutateOptions?: MutateOptions\n\n constructor(\n client: QueryClient,\n options: MutationObserverOptions<\n TData,\n TError,\n TVariables,\n TOnMutateResult\n >,\n ) {\n super()\n\n this.#client = client\n this.setOptions(options)\n this.bindMethods()\n this.#updateResult()\n }\n\n protected bindMethods(): void {\n this.mutate = this.mutate.bind(this)\n this.reset = this.reset.bind(this)\n }\n\n setOptions(\n options: MutationObserverOptions<\n TData,\n TError,\n TVariables,\n TOnMutateResult\n >,\n ) {\n const prevOptions = this.options as\n | MutationObserverOptions\n | undefined\n this.options = this.#client.defaultMutationOptions(options)\n if (!shallowEqualObjects(this.options, prevOptions)) {\n this.#client.getMutationCache().notify({\n type: 'observerOptionsUpdated',\n mutation: this.#currentMutation,\n observer: this,\n })\n }\n\n if (\n prevOptions?.mutationKey &&\n this.options.mutationKey &&\n hashKey(prevOptions.mutationKey) !== hashKey(this.options.mutationKey)\n ) {\n this.reset()\n } else if (this.#currentMutation?.state.status === 'pending') {\n this.#currentMutation.setOptions(this.options)\n }\n }\n\n protected onUnsubscribe(): void {\n if (!this.hasListeners()) {\n this.#currentMutation?.removeObserver(this)\n }\n }\n\n onMutationUpdate(\n action: Action,\n ): void {\n this.#updateResult()\n\n this.#notify(action)\n }\n\n getCurrentResult(): MutationObserverResult<\n TData,\n TError,\n TVariables,\n TOnMutateResult\n > {\n return this.#currentResult\n }\n\n reset(): void {\n // reset needs to remove the observer from the mutation because there is no way to \"get it back\"\n // another mutate call will yield a new mutation!\n this.#currentMutation?.removeObserver(this)\n this.#currentMutation = undefined\n this.#updateResult()\n this.#notify()\n }\n\n mutate(\n variables: TVariables,\n options?: MutateOptions,\n ): Promise {\n this.#mutateOptions = options\n\n this.#currentMutation?.removeObserver(this)\n\n this.#currentMutation = this.#client\n .getMutationCache()\n .build(this.#client, this.options)\n\n this.#currentMutation.addObserver(this)\n\n return this.#currentMutation.execute(variables)\n }\n\n #updateResult(): void {\n const state =\n this.#currentMutation?.state ??\n getDefaultState()\n\n this.#currentResult = {\n ...state,\n isPending: state.status === 'pending',\n isSuccess: state.status === 'success',\n isError: state.status === 'error',\n isIdle: state.status === 'idle',\n mutate: this.mutate,\n reset: this.reset,\n } as MutationObserverResult\n }\n\n #notify(action?: Action): void {\n notifyManager.batch(() => {\n // First trigger the mutate callbacks\n if (this.#mutateOptions && this.hasListeners()) {\n const variables = this.#currentResult.variables!\n const onMutateResult = this.#currentResult.context\n\n const context = {\n client: this.#client,\n meta: this.options.meta,\n mutationKey: this.options.mutationKey,\n } satisfies MutationFunctionContext\n\n if (action?.type === 'success') {\n try {\n this.#mutateOptions.onSuccess?.(\n action.data,\n variables,\n onMutateResult,\n context,\n )\n } catch (e) {\n void Promise.reject(e)\n }\n try {\n this.#mutateOptions.onSettled?.(\n action.data,\n null,\n variables,\n onMutateResult,\n context,\n )\n } catch (e) {\n void Promise.reject(e)\n }\n } else if (action?.type === 'error') {\n try {\n this.#mutateOptions.onError?.(\n action.error,\n variables,\n onMutateResult,\n context,\n )\n } catch (e) {\n void Promise.reject(e)\n }\n try {\n this.#mutateOptions.onSettled?.(\n undefined,\n action.error,\n variables,\n onMutateResult,\n context,\n )\n } catch (e) {\n void Promise.reject(e)\n }\n }\n }\n\n // Then trigger the listeners\n this.listeners.forEach((listener) => {\n listener(this.#currentResult)\n })\n })\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,sBAAgC;AAChC,2BAA8B;AAC9B,0BAA6B;AAC7B,mBAA6C;AAmBtC,IAAM,mBAAN,cAKG,iCAER;AAAA,EAGA;AAAA,EACA,iBAKI;AAAA,EACJ;AAAA,EACA;AAAA,EAEA,YACE,QACA,SAMA;AACA,UAAM;AAEN,SAAK,UAAU;AACf,SAAK,WAAW,OAAO;AACvB,SAAK,YAAY;AACjB,SAAK,cAAc;AAAA,EACrB;AAAA,EAEU,cAAoB;AAC5B,SAAK,SAAS,KAAK,OAAO,KAAK,IAAI;AACnC,SAAK,QAAQ,KAAK,MAAM,KAAK,IAAI;AAAA,EACnC;AAAA,EAEA,WACE,SAMA;AACA,UAAM,cAAc,KAAK;AAGzB,SAAK,UAAU,KAAK,QAAQ,uBAAuB,OAAO;AAC1D,QAAI,KAAC,kCAAoB,KAAK,SAAS,WAAW,GAAG;AACnD,WAAK,QAAQ,iBAAiB,EAAE,OAAO;AAAA,QACrC,MAAM;AAAA,QACN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uCAAc,MAAM,MAAM;AAExB,UAAI,KAAK,kBAAkB,KAAK,aAAa,GAAG;AAC9C,cAAM,YAAY,KAAK,eAAe;AACtC,cAAM,iBAAiB,KAAK,eAAe;AAE3C,cAAM,UAAU;AAAA,UACd,QAAQ,KAAK;AAAA,UACb,MAAM,KAAK,QAAQ;AAAA,UACnB,aAAa,KAAK,QAAQ;AAAA,QAC5B;AAEA,YAAI,QAAQ,SAAS,WAAW;AAC9B,cAAI;AACF,iBAAK,eAAe;AAAA,cAClB,OAAO;AAAA,cACP;AAAA,cACA;AAAA,cACA;AAAA,YACF;AAAA,UACF,SAAS,GAAG;AACV,iBAAK,QAAQ,OAAO,CAAC;AAAA,UACvB;AACA,cAAI;AACF,iBAAK,eAAe;AAAA,cAClB,OAAO;AAAA,cACP;AAAA,cACA;AAAA,cACA;AAAA,cACA;AAAA,YACF;AAAA,UACF,SAAS,GAAG;AACV,iBAAK,QAAQ,OAAO,CAAC;AAAA,UACvB;AAAA,QACF,WAAW,QAAQ,SAAS,SAAS;AACnC,cAAI;AACF,iBAAK,eAAe;AAAA,cAClB,OAAO;AAAA,cACP;AAAA,cACA;AAAA,cACA;AAAA,YACF;AAAA,UACF,SAAS,GAAG;AACV,iBAAK,QAAQ,OAAO,CAAC;AAAA,UACvB;AACA,cAAI;AACF,iBAAK,eAAe;AAAA,cAClB;AAAA,cACA,OAAO;AAAA,cACP;AAAA,cACA;AAAA,cACA;AAAA,YACF;AAAA,UACF,SAAS,GAAG;AACV,iBAAK,QAAQ,OAAO,CAAC;AAAA,UACvB;AAAA,QACF;AAAA,MACF;AAGA,WAAK,UAAU,QAAQ,CAAC,aAAa;AACnC,iBAAS,KAAK,cAAc;AAAA,MAC9B,CAAC;AAAA,IACH,CAAC;AAAA,EACH;AACF;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/mutationObserver.d.cts b/node_modules/@tanstack/query-core/build/modern/mutationObserver.d.cts new file mode 100644 index 0000000..04a9d2d --- /dev/null +++ b/node_modules/@tanstack/query-core/build/modern/mutationObserver.d.cts @@ -0,0 +1,3 @@ +import './subscribable.cjs'; +export { e as MutationObserver } from './hydration-uphG6M-i.cjs'; +import './removable.cjs'; diff --git a/node_modules/@tanstack/query-core/build/modern/mutationObserver.d.ts b/node_modules/@tanstack/query-core/build/modern/mutationObserver.d.ts new file mode 100644 index 0000000..1700476 --- /dev/null +++ b/node_modules/@tanstack/query-core/build/modern/mutationObserver.d.ts @@ -0,0 +1,3 @@ +import './subscribable.js'; +export { e as MutationObserver } from './hydration-BlEVG2Lp.js'; +import './removable.js'; diff --git a/node_modules/@tanstack/query-core/build/modern/mutationObserver.js b/node_modules/@tanstack/query-core/build/modern/mutationObserver.js new file mode 100644 index 0000000..dd2b2de --- /dev/null +++ b/node_modules/@tanstack/query-core/build/modern/mutationObserver.js @@ -0,0 +1,140 @@ +// src/mutationObserver.ts +import { getDefaultState } from "./mutation.js"; +import { notifyManager } from "./notifyManager.js"; +import { Subscribable } from "./subscribable.js"; +import { hashKey, shallowEqualObjects } from "./utils.js"; +var MutationObserver = class extends Subscribable { + #client; + #currentResult = void 0; + #currentMutation; + #mutateOptions; + constructor(client, options) { + super(); + this.#client = client; + this.setOptions(options); + this.bindMethods(); + this.#updateResult(); + } + bindMethods() { + this.mutate = this.mutate.bind(this); + this.reset = this.reset.bind(this); + } + setOptions(options) { + const prevOptions = this.options; + this.options = this.#client.defaultMutationOptions(options); + if (!shallowEqualObjects(this.options, prevOptions)) { + this.#client.getMutationCache().notify({ + type: "observerOptionsUpdated", + mutation: this.#currentMutation, + observer: this + }); + } + if (prevOptions?.mutationKey && this.options.mutationKey && hashKey(prevOptions.mutationKey) !== hashKey(this.options.mutationKey)) { + this.reset(); + } else if (this.#currentMutation?.state.status === "pending") { + this.#currentMutation.setOptions(this.options); + } + } + onUnsubscribe() { + if (!this.hasListeners()) { + this.#currentMutation?.removeObserver(this); + } + } + onMutationUpdate(action) { + this.#updateResult(); + this.#notify(action); + } + getCurrentResult() { + return this.#currentResult; + } + reset() { + this.#currentMutation?.removeObserver(this); + this.#currentMutation = void 0; + this.#updateResult(); + this.#notify(); + } + mutate(variables, options) { + this.#mutateOptions = options; + this.#currentMutation?.removeObserver(this); + this.#currentMutation = this.#client.getMutationCache().build(this.#client, this.options); + this.#currentMutation.addObserver(this); + return this.#currentMutation.execute(variables); + } + #updateResult() { + const state = this.#currentMutation?.state ?? getDefaultState(); + this.#currentResult = { + ...state, + isPending: state.status === "pending", + isSuccess: state.status === "success", + isError: state.status === "error", + isIdle: state.status === "idle", + mutate: this.mutate, + reset: this.reset + }; + } + #notify(action) { + notifyManager.batch(() => { + if (this.#mutateOptions && this.hasListeners()) { + const variables = this.#currentResult.variables; + const onMutateResult = this.#currentResult.context; + const context = { + client: this.#client, + meta: this.options.meta, + mutationKey: this.options.mutationKey + }; + if (action?.type === "success") { + try { + this.#mutateOptions.onSuccess?.( + action.data, + variables, + onMutateResult, + context + ); + } catch (e) { + void Promise.reject(e); + } + try { + this.#mutateOptions.onSettled?.( + action.data, + null, + variables, + onMutateResult, + context + ); + } catch (e) { + void Promise.reject(e); + } + } else if (action?.type === "error") { + try { + this.#mutateOptions.onError?.( + action.error, + variables, + onMutateResult, + context + ); + } catch (e) { + void Promise.reject(e); + } + try { + this.#mutateOptions.onSettled?.( + void 0, + action.error, + variables, + onMutateResult, + context + ); + } catch (e) { + void Promise.reject(e); + } + } + } + this.listeners.forEach((listener) => { + listener(this.#currentResult); + }); + }); + } +}; +export { + MutationObserver +}; +//# sourceMappingURL=mutationObserver.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/mutationObserver.js.map b/node_modules/@tanstack/query-core/build/modern/mutationObserver.js.map new file mode 100644 index 0000000..154ec66 --- /dev/null +++ b/node_modules/@tanstack/query-core/build/modern/mutationObserver.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/mutationObserver.ts"],"sourcesContent":["import { getDefaultState } from './mutation'\nimport { notifyManager } from './notifyManager'\nimport { Subscribable } from './subscribable'\nimport { hashKey, shallowEqualObjects } from './utils'\nimport type { QueryClient } from './queryClient'\nimport type {\n DefaultError,\n MutateOptions,\n MutationFunctionContext,\n MutationObserverOptions,\n MutationObserverResult,\n} from './types'\nimport type { Action, Mutation } from './mutation'\n\n// TYPES\n\ntype MutationObserverListener = (\n result: MutationObserverResult,\n) => void\n\n// CLASS\n\nexport class MutationObserver<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n> extends Subscribable<\n MutationObserverListener\n> {\n options!: MutationObserverOptions\n\n #client: QueryClient\n #currentResult: MutationObserverResult<\n TData,\n TError,\n TVariables,\n TOnMutateResult\n > = undefined!\n #currentMutation?: Mutation\n #mutateOptions?: MutateOptions\n\n constructor(\n client: QueryClient,\n options: MutationObserverOptions<\n TData,\n TError,\n TVariables,\n TOnMutateResult\n >,\n ) {\n super()\n\n this.#client = client\n this.setOptions(options)\n this.bindMethods()\n this.#updateResult()\n }\n\n protected bindMethods(): void {\n this.mutate = this.mutate.bind(this)\n this.reset = this.reset.bind(this)\n }\n\n setOptions(\n options: MutationObserverOptions<\n TData,\n TError,\n TVariables,\n TOnMutateResult\n >,\n ) {\n const prevOptions = this.options as\n | MutationObserverOptions\n | undefined\n this.options = this.#client.defaultMutationOptions(options)\n if (!shallowEqualObjects(this.options, prevOptions)) {\n this.#client.getMutationCache().notify({\n type: 'observerOptionsUpdated',\n mutation: this.#currentMutation,\n observer: this,\n })\n }\n\n if (\n prevOptions?.mutationKey &&\n this.options.mutationKey &&\n hashKey(prevOptions.mutationKey) !== hashKey(this.options.mutationKey)\n ) {\n this.reset()\n } else if (this.#currentMutation?.state.status === 'pending') {\n this.#currentMutation.setOptions(this.options)\n }\n }\n\n protected onUnsubscribe(): void {\n if (!this.hasListeners()) {\n this.#currentMutation?.removeObserver(this)\n }\n }\n\n onMutationUpdate(\n action: Action,\n ): void {\n this.#updateResult()\n\n this.#notify(action)\n }\n\n getCurrentResult(): MutationObserverResult<\n TData,\n TError,\n TVariables,\n TOnMutateResult\n > {\n return this.#currentResult\n }\n\n reset(): void {\n // reset needs to remove the observer from the mutation because there is no way to \"get it back\"\n // another mutate call will yield a new mutation!\n this.#currentMutation?.removeObserver(this)\n this.#currentMutation = undefined\n this.#updateResult()\n this.#notify()\n }\n\n mutate(\n variables: TVariables,\n options?: MutateOptions,\n ): Promise {\n this.#mutateOptions = options\n\n this.#currentMutation?.removeObserver(this)\n\n this.#currentMutation = this.#client\n .getMutationCache()\n .build(this.#client, this.options)\n\n this.#currentMutation.addObserver(this)\n\n return this.#currentMutation.execute(variables)\n }\n\n #updateResult(): void {\n const state =\n this.#currentMutation?.state ??\n getDefaultState()\n\n this.#currentResult = {\n ...state,\n isPending: state.status === 'pending',\n isSuccess: state.status === 'success',\n isError: state.status === 'error',\n isIdle: state.status === 'idle',\n mutate: this.mutate,\n reset: this.reset,\n } as MutationObserverResult\n }\n\n #notify(action?: Action): void {\n notifyManager.batch(() => {\n // First trigger the mutate callbacks\n if (this.#mutateOptions && this.hasListeners()) {\n const variables = this.#currentResult.variables!\n const onMutateResult = this.#currentResult.context\n\n const context = {\n client: this.#client,\n meta: this.options.meta,\n mutationKey: this.options.mutationKey,\n } satisfies MutationFunctionContext\n\n if (action?.type === 'success') {\n try {\n this.#mutateOptions.onSuccess?.(\n action.data,\n variables,\n onMutateResult,\n context,\n )\n } catch (e) {\n void Promise.reject(e)\n }\n try {\n this.#mutateOptions.onSettled?.(\n action.data,\n null,\n variables,\n onMutateResult,\n context,\n )\n } catch (e) {\n void Promise.reject(e)\n }\n } else if (action?.type === 'error') {\n try {\n this.#mutateOptions.onError?.(\n action.error,\n variables,\n onMutateResult,\n context,\n )\n } catch (e) {\n void Promise.reject(e)\n }\n try {\n this.#mutateOptions.onSettled?.(\n undefined,\n action.error,\n variables,\n onMutateResult,\n context,\n )\n } catch (e) {\n void Promise.reject(e)\n }\n }\n }\n\n // Then trigger the listeners\n this.listeners.forEach((listener) => {\n listener(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AAK,QAAQ,OAAO,CAAC;AAAA,UACvB;AAAA,QACF,WAAW,QAAQ,SAAS,SAAS;AACnC,cAAI;AACF,iBAAK,eAAe;AAAA,cAClB,OAAO;AAAA,cACP;AAAA,cACA;AAAA,cACA;AAAA,YACF;AAAA,UACF,SAAS,GAAG;AACV,iBAAK,QAAQ,OAAO,CAAC;AAAA,UACvB;AACA,cAAI;AACF,iBAAK,eAAe;AAAA,cAClB;AAAA,cACA,OAAO;AAAA,cACP;AAAA,cACA;AAAA,cACA;AAAA,YACF;AAAA,UACF,SAAS,GAAG;AACV,iBAAK,QAAQ,OAAO,CAAC;AAAA,UACvB;AAAA,QACF;AAAA,MACF;AAGA,WAAK,UAAU,QAAQ,CAAC,aAAa;AACnC,iBAAS,KAAK,cAAc;AAAA,MAC9B,CAAC;AAAA,IACH,CAAC;AAAA,EACH;AACF;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/notifyManager.cjs b/node_modules/@tanstack/query-core/build/modern/notifyManager.cjs new file mode 100644 index 0000000..355a2c1 --- /dev/null +++ b/node_modules/@tanstack/query-core/build/modern/notifyManager.cjs @@ -0,0 +1,113 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/notifyManager.ts +var notifyManager_exports = {}; +__export(notifyManager_exports, { + createNotifyManager: () => createNotifyManager, + defaultScheduler: () => defaultScheduler, + notifyManager: () => notifyManager +}); +module.exports = __toCommonJS(notifyManager_exports); +var import_timeoutManager = require("./timeoutManager.cjs"); +var defaultScheduler = import_timeoutManager.systemSetTimeoutZero; +function createNotifyManager() { + let queue = []; + let transactions = 0; + let notifyFn = (callback) => { + callback(); + }; + let batchNotifyFn = (callback) => { + callback(); + }; + let scheduleFn = defaultScheduler; + const schedule = (callback) => { + if (transactions) { + queue.push(callback); + } else { + scheduleFn(() => { + notifyFn(callback); + }); + } + }; + const flush = () => { + const originalQueue = queue; + queue = []; + if (originalQueue.length) { + scheduleFn(() => { + batchNotifyFn(() => { + originalQueue.forEach((callback) => { + notifyFn(callback); + }); + }); + }); + } + }; + return { + batch: (callback) => { + let result; + transactions++; + try { + result = callback(); + } finally { + transactions--; + if (!transactions) { + flush(); + } + } + return result; + }, + /** + * All calls to the wrapped function will be batched. + */ + batchCalls: (callback) => { + return (...args) => { + schedule(() => { + callback(...args); + }); + }; + }, + schedule, + /** + * Use this method to set a custom notify function. + * This can be used to for example wrap notifications with `React.act` while running tests. + */ + setNotifyFunction: (fn) => { + notifyFn = fn; + }, + /** + * Use this method to set a custom function to batch notifications together into a single tick. + * By default React Query will use the batch function provided by ReactDOM or React Native. + */ + setBatchNotifyFunction: (fn) => { + batchNotifyFn = fn; + }, + setScheduler: (fn) => { + scheduleFn = fn; + } + }; +} +var notifyManager = createNotifyManager(); +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + createNotifyManager, + defaultScheduler, + notifyManager +}); +//# sourceMappingURL=notifyManager.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/notifyManager.cjs.map b/node_modules/@tanstack/query-core/build/modern/notifyManager.cjs.map new file mode 100644 index 0000000..1756c4b --- /dev/null +++ b/node_modules/@tanstack/query-core/build/modern/notifyManager.cjs.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/notifyManager.ts"],"sourcesContent":["// TYPES\n\nimport { systemSetTimeoutZero } from './timeoutManager'\n\ntype NotifyCallback = () => void\n\ntype NotifyFunction = (callback: () => void) => void\n\ntype BatchNotifyFunction = (callback: () => void) => void\n\ntype BatchCallsCallback> = (...args: T) => void\n\ntype ScheduleFunction = (callback: () => void) => void\n\nexport const defaultScheduler: ScheduleFunction = systemSetTimeoutZero\n\nexport function createNotifyManager() {\n let queue: Array = []\n let transactions = 0\n let notifyFn: NotifyFunction = (callback) => {\n callback()\n }\n let batchNotifyFn: BatchNotifyFunction = (callback: () => void) => {\n callback()\n }\n let scheduleFn = defaultScheduler\n\n const schedule = (callback: NotifyCallback): void => {\n if (transactions) {\n queue.push(callback)\n } else {\n scheduleFn(() => {\n notifyFn(callback)\n })\n }\n }\n const flush = (): void => {\n const originalQueue = queue\n queue = []\n if (originalQueue.length) {\n scheduleFn(() => {\n batchNotifyFn(() => {\n originalQueue.forEach((callback) => {\n notifyFn(callback)\n })\n })\n })\n }\n }\n\n return {\n batch: (callback: () => T): T => {\n let result\n transactions++\n try {\n result = callback()\n } finally {\n transactions--\n if (!transactions) {\n flush()\n }\n }\n return result\n },\n /**\n * All calls to the wrapped function will be batched.\n */\n batchCalls: >(\n callback: BatchCallsCallback,\n ): BatchCallsCallback => {\n return (...args) => {\n schedule(() => {\n callback(...args)\n })\n }\n },\n schedule,\n /**\n * Use this method to set a custom notify function.\n * This can be used to for example wrap notifications with `React.act` while running tests.\n */\n setNotifyFunction: (fn: NotifyFunction) => {\n notifyFn = fn\n },\n /**\n * Use this method to set a custom function to batch notifications together into a single tick.\n * By default React Query will use the batch function provided by ReactDOM or React Native.\n */\n setBatchNotifyFunction: (fn: BatchNotifyFunction) => {\n batchNotifyFn = fn\n },\n setScheduler: (fn: ScheduleFunction) => {\n scheduleFn = fn\n },\n } as const\n}\n\n// SINGLETON\nexport const notifyManager = createNotifyManager()\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,4BAAqC;AAY9B,IAAM,mBAAqC;AAE3C,S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":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/notifyManager.d.cts b/node_modules/@tanstack/query-core/build/modern/notifyManager.d.cts new file mode 100644 index 0000000..bd4a370 --- /dev/null +++ b/node_modules/@tanstack/query-core/build/modern/notifyManager.d.cts @@ -0,0 +1,46 @@ +type NotifyCallback = () => void; +type NotifyFunction = (callback: () => void) => void; +type BatchNotifyFunction = (callback: () => void) => void; +type BatchCallsCallback> = (...args: T) => void; +type ScheduleFunction = (callback: () => void) => void; +declare const defaultScheduler: ScheduleFunction; +declare function createNotifyManager(): { + readonly batch: (callback: () => T) => T; + /** + * All calls to the wrapped function will be batched. + */ + readonly batchCalls: >(callback: BatchCallsCallback) => BatchCallsCallback; + readonly schedule: (callback: NotifyCallback) => void; + /** + * Use this method to set a custom notify function. + * This can be used to for example wrap notifications with `React.act` while running tests. + */ + readonly setNotifyFunction: (fn: NotifyFunction) => void; + /** + * Use this method to set a custom function to batch notifications together into a single tick. + * By default React Query will use the batch function provided by ReactDOM or React Native. + */ + readonly setBatchNotifyFunction: (fn: BatchNotifyFunction) => void; + readonly setScheduler: (fn: ScheduleFunction) => void; +}; +declare const notifyManager: { + readonly batch: (callback: () => T) => T; + /** + * All calls to the wrapped function will be batched. + */ + readonly batchCalls: >(callback: BatchCallsCallback) => BatchCallsCallback; + readonly schedule: (callback: NotifyCallback) => void; + /** + * Use this method to set a custom notify function. + * This can be used to for example wrap notifications with `React.act` while running tests. + */ + readonly setNotifyFunction: (fn: NotifyFunction) => void; + /** + * Use this method to set a custom function to batch notifications together into a single tick. + * By default React Query will use the batch function provided by ReactDOM or React Native. + */ + readonly setBatchNotifyFunction: (fn: BatchNotifyFunction) => void; + readonly setScheduler: (fn: ScheduleFunction) => void; +}; + +export { createNotifyManager, defaultScheduler, notifyManager }; diff --git a/node_modules/@tanstack/query-core/build/modern/notifyManager.d.ts b/node_modules/@tanstack/query-core/build/modern/notifyManager.d.ts new file mode 100644 index 0000000..bd4a370 --- /dev/null +++ b/node_modules/@tanstack/query-core/build/modern/notifyManager.d.ts @@ -0,0 +1,46 @@ +type NotifyCallback = () => void; +type NotifyFunction = (callback: () => void) => void; +type BatchNotifyFunction = (callback: () => void) => void; +type BatchCallsCallback> = (...args: T) => void; +type ScheduleFunction = (callback: () => void) => void; +declare const defaultScheduler: ScheduleFunction; +declare function createNotifyManager(): { + readonly batch: (callback: () => T) => T; + /** + * All calls to the wrapped function will be batched. + */ + readonly batchCalls: >(callback: BatchCallsCallback) => BatchCallsCallback; + readonly schedule: (callback: NotifyCallback) => void; + /** + * Use this method to set a custom notify function. + * This can be used to for example wrap notifications with `React.act` while running tests. + */ + readonly setNotifyFunction: (fn: NotifyFunction) => void; + /** + * Use this method to set a custom function to batch notifications together into a single tick. + * By default React Query will use the batch function provided by ReactDOM or React Native. + */ + readonly setBatchNotifyFunction: (fn: BatchNotifyFunction) => void; + readonly setScheduler: (fn: ScheduleFunction) => void; +}; +declare const notifyManager: { + readonly batch: (callback: () => T) => T; + /** + * All calls to the wrapped function will be batched. + */ + readonly batchCalls: >(callback: BatchCallsCallback) => BatchCallsCallback; + readonly schedule: (callback: NotifyCallback) => void; + /** + * Use this method to set a custom notify function. + * This can be used to for example wrap notifications with `React.act` while running tests. + */ + readonly setNotifyFunction: (fn: NotifyFunction) => void; + /** + * Use this method to set a custom function to batch notifications together into a single tick. + * By default React Query will use the batch function provided by ReactDOM or React Native. + */ + readonly setBatchNotifyFunction: (fn: BatchNotifyFunction) => void; + readonly setScheduler: (fn: ScheduleFunction) => void; +}; + +export { createNotifyManager, defaultScheduler, notifyManager }; diff --git a/node_modules/@tanstack/query-core/build/modern/notifyManager.js b/node_modules/@tanstack/query-core/build/modern/notifyManager.js new file mode 100644 index 0000000..fea08da --- /dev/null +++ b/node_modules/@tanstack/query-core/build/modern/notifyManager.js @@ -0,0 +1,86 @@ +// src/notifyManager.ts +import { systemSetTimeoutZero } from "./timeoutManager.js"; +var defaultScheduler = systemSetTimeoutZero; +function createNotifyManager() { + let queue = []; + let transactions = 0; + let notifyFn = (callback) => { + callback(); + }; + let batchNotifyFn = (callback) => { + callback(); + }; + let scheduleFn = defaultScheduler; + const schedule = (callback) => { + if (transactions) { + queue.push(callback); + } else { + scheduleFn(() => { + notifyFn(callback); + }); + } + }; + const flush = () => { + const originalQueue = queue; + queue = []; + if (originalQueue.length) { + scheduleFn(() => { + batchNotifyFn(() => { + originalQueue.forEach((callback) => { + notifyFn(callback); + }); + }); + }); + } + }; + return { + batch: (callback) => { + let result; + transactions++; + try { + result = callback(); + } finally { + transactions--; + if (!transactions) { + flush(); + } + } + return result; + }, + /** + * All calls to the wrapped function will be batched. + */ + batchCalls: (callback) => { + return (...args) => { + schedule(() => { + callback(...args); + }); + }; + }, + schedule, + /** + * Use this method to set a custom notify function. + * This can be used to for example wrap notifications with `React.act` while running tests. + */ + setNotifyFunction: (fn) => { + notifyFn = fn; + }, + /** + * Use this method to set a custom function to batch notifications together into a single tick. + * By default React Query will use the batch function provided by ReactDOM or React Native. + */ + setBatchNotifyFunction: (fn) => { + batchNotifyFn = fn; + }, + setScheduler: (fn) => { + scheduleFn = fn; + } + }; +} +var notifyManager = createNotifyManager(); +export { + createNotifyManager, + defaultScheduler, + notifyManager +}; +//# sourceMappingURL=notifyManager.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/notifyManager.js.map b/node_modules/@tanstack/query-core/build/modern/notifyManager.js.map new file mode 100644 index 0000000..dcc738d --- /dev/null +++ b/node_modules/@tanstack/query-core/build/modern/notifyManager.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/notifyManager.ts"],"sourcesContent":["// TYPES\n\nimport { systemSetTimeoutZero } from './timeoutManager'\n\ntype NotifyCallback = () => void\n\ntype NotifyFunction = (callback: () => void) => void\n\ntype BatchNotifyFunction = (callback: () => void) => void\n\ntype BatchCallsCallback> = (...args: T) => void\n\ntype ScheduleFunction = (callback: () => void) => void\n\nexport const defaultScheduler: ScheduleFunction = systemSetTimeoutZero\n\nexport function createNotifyManager() {\n let queue: Array = []\n let transactions = 0\n let notifyFn: NotifyFunction = (callback) => {\n callback()\n }\n let batchNotifyFn: BatchNotifyFunction = (callback: () => void) => {\n callback()\n }\n let scheduleFn = defaultScheduler\n\n const schedule = (callback: NotifyCallback): void => {\n if (transactions) {\n queue.push(callback)\n } else {\n scheduleFn(() => {\n notifyFn(callback)\n })\n }\n }\n const flush = (): void => {\n const originalQueue = queue\n queue = []\n if (originalQueue.length) {\n scheduleFn(() => {\n batchNotifyFn(() => {\n originalQueue.forEach((callback) => {\n notifyFn(callback)\n })\n })\n })\n }\n }\n\n return {\n batch: (callback: () => T): T => {\n let result\n transactions++\n try {\n result = callback()\n } finally {\n transactions--\n if (!transactions) {\n flush()\n }\n }\n return result\n },\n /**\n * All calls to the wrapped function will be batched.\n */\n batchCalls: >(\n callback: BatchCallsCallback,\n ): BatchCallsCallback => {\n return (...args) => {\n schedule(() => {\n callback(...args)\n })\n }\n },\n schedule,\n /**\n * Use this method to set a custom notify function.\n * This can be used to for example wrap notifications with `React.act` while running tests.\n */\n setNotifyFunction: (fn: NotifyFunction) => {\n notifyFn = fn\n },\n /**\n * Use this method to set a custom function to batch notifications together into a single tick.\n * By default React Query will use the batch function provided by ReactDOM or React Native.\n */\n setBatchNotifyFunction: (fn: BatchNotifyFunction) => {\n batchNotifyFn = fn\n },\n setScheduler: (fn: ScheduleFunction) => {\n scheduleFn = fn\n },\n } as const\n}\n\n// SINGLETON\nexport const notifyManager = createNotifyManager()\n"],"mappings":";AAEA,SAAS,4BAA4B;AAY9B,IAAM,mBAAqC;AAE3C,SAAS,sBAAsB;AACpC,MAAI,QAA+B,CAAC;AACpC,MAAI,eAAe;AACnB,MAAI,WAA2B,CAAC,aAAa;AAC3C,aAAS;AAAA,EACX;AACA,MAAI,gBAAqC,CAAC,aAAyB;AACjE,aAAS;AAAA,EACX;AACA,MAAI,aAAa;AAEjB,QAAM,WAAW,CAAC,aAAmC;AACnD,QAAI,cAAc;AAChB,YAAM,KAAK,QAAQ;AAAA,IACrB,OAAO;AACL,iBAAW,MAAM;AACf,iBAAS,QAAQ;AAAA,MACnB,CAAC;AAAA,IACH;AAAA,EACF;AACA,QAAM,QAAQ,MAAY;AACxB,UAAM,gBAAgB;AACtB,YAAQ,CAAC;AACT,QAAI,cAAc,QAAQ;AACxB,iBAAW,MAAM;AACf,sBAAc,MAAM;AAClB,wBAAc,QAAQ,CAAC,aAAa;AAClC,qBAAS,QAAQ;AAAA,UACnB,CAAC;AAAA,QACH,CAAC;AAAA,MACH,CAAC;AAAA,IACH;AAAA,EACF;AAEA,SAAO;AAAA,IACL,OAAO,CAAI,aAAyB;AAClC,UAAI;AACJ;AACA,UAAI;AACF,iBAAS,SAAS;AAAA,MACpB,UAAE;AACA;AACA,YAAI,CAAC,cAAc;AACjB,gBAAM;AAAA,QACR;AAAA,MACF;AACA,aAAO;AAAA,IACT;AAAA;AAAA;AAAA;AAAA,IAIA,YAAY,CACV,aAC0B;AAC1B,aAAO,IAAI,SAAS;AAClB,iBAAS,MAAM;AACb,mBAAS,GAAG,IAAI;AAAA,QAClB,CAAC;AAAA,MACH;AAAA,IACF;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA,IAKA,mBAAmB,CAAC,OAAuB;AACzC,iBAAW;AAAA,IACb;AAAA;AAAA;AAAA;AAAA;AAAA,IAKA,wBAAwB,CAAC,OAA4B;AACnD,sBAAgB;AAAA,IAClB;AAAA,IACA,cAAc,CAAC,OAAyB;AACtC,mBAAa;AAAA,IACf;AAAA,EACF;AACF;AAGO,IAAM,gBAAgB,oBAAoB;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/onlineManager.cjs b/node_modules/@tanstack/query-core/build/modern/onlineManager.cjs new file mode 100644 index 0000000..69196cf --- /dev/null +++ b/node_modules/@tanstack/query-core/build/modern/onlineManager.cjs @@ -0,0 +1,84 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/onlineManager.ts +var onlineManager_exports = {}; +__export(onlineManager_exports, { + OnlineManager: () => OnlineManager, + onlineManager: () => onlineManager +}); +module.exports = __toCommonJS(onlineManager_exports); +var import_subscribable = require("./subscribable.cjs"); +var import_utils = require("./utils.cjs"); +var OnlineManager = class extends import_subscribable.Subscribable { + #online = true; + #cleanup; + #setup; + constructor() { + super(); + this.#setup = (onOnline) => { + if (!import_utils.isServer && window.addEventListener) { + const onlineListener = () => onOnline(true); + const offlineListener = () => onOnline(false); + window.addEventListener("online", onlineListener, false); + window.addEventListener("offline", offlineListener, false); + return () => { + window.removeEventListener("online", onlineListener); + window.removeEventListener("offline", offlineListener); + }; + } + return; + }; + } + onSubscribe() { + if (!this.#cleanup) { + this.setEventListener(this.#setup); + } + } + onUnsubscribe() { + if (!this.hasListeners()) { + this.#cleanup?.(); + this.#cleanup = void 0; + } + } + setEventListener(setup) { + this.#setup = setup; + this.#cleanup?.(); + this.#cleanup = setup(this.setOnline.bind(this)); + } + setOnline(online) { + const changed = this.#online !== online; + if (changed) { + this.#online = online; + this.listeners.forEach((listener) => { + listener(online); + }); + } + } + isOnline() { + return this.#online; + } +}; +var onlineManager = new OnlineManager(); +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + OnlineManager, + onlineManager +}); +//# sourceMappingURL=onlineManager.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/onlineManager.cjs.map b/node_modules/@tanstack/query-core/build/modern/onlineManager.cjs.map new file mode 100644 index 0000000..36dae1e --- /dev/null +++ b/node_modules/@tanstack/query-core/build/modern/onlineManager.cjs.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/onlineManager.ts"],"sourcesContent":["import { Subscribable } from './subscribable'\nimport { isServer } from './utils'\n\ntype Listener = (online: boolean) => void\ntype SetupFn = (setOnline: Listener) => (() => void) | undefined\n\nexport class OnlineManager extends Subscribable {\n #online = true\n #cleanup?: () => void\n\n #setup: SetupFn\n\n constructor() {\n super()\n this.#setup = (onOnline) => {\n // addEventListener does not exist in React Native, but window does\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n if (!isServer && window.addEventListener) {\n const onlineListener = () => onOnline(true)\n const offlineListener = () => onOnline(false)\n // Listen to online\n window.addEventListener('online', onlineListener, false)\n window.addEventListener('offline', offlineListener, false)\n\n return () => {\n // Be sure to unsubscribe if a new handler is set\n window.removeEventListener('online', onlineListener)\n window.removeEventListener('offline', offlineListener)\n }\n }\n\n return\n }\n }\n\n protected onSubscribe(): void {\n if (!this.#cleanup) {\n this.setEventListener(this.#setup)\n }\n }\n\n protected onUnsubscribe() {\n if (!this.hasListeners()) {\n this.#cleanup?.()\n this.#cleanup = undefined\n }\n }\n\n setEventListener(setup: SetupFn): void {\n this.#setup = setup\n this.#cleanup?.()\n this.#cleanup = setup(this.setOnline.bind(this))\n }\n\n setOnline(online: boolean): void {\n const changed = this.#online !== online\n\n if (changed) {\n this.#online = online\n this.listeners.forEach((listener) => {\n listener(online)\n })\n }\n }\n\n isOnline(): boolean {\n return this.#online\n }\n}\n\nexport const onlineManager = new OnlineManager()\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,0BAA6B;AAC7B,mBAAyB;AAKlB,IAAM,gBAAN,cAA4B,iCAAuB;AAAA,EACxD,UAAU;AAAA,EACV;AAAA,EAEA;AAAA,EAEA,cAAc;AACZ,UAAM;AACN,SAAK,SAAS,CAAC,aAAa;AAG1B,UAAI,CAAC,yBAAY,OAAO,kBAAkB;AACxC,cAAM,iBAAiB,MAAM,SAAS,IAAI;AAC1C,cAAM,kBAAkB,MAAM,SAAS,KAAK;AAE5C,eAAO,iBAAiB,UAAU,gBAAgB,KAAK;AACvD,eAAO,iBAAiB,WAAW,iBAAiB,KAAK;AAEzD,eAAO,MAAM;AAEX,iBAAO,oBAAoB,UAAU,cAAc;AACnD,iBAAO,oBAAoB,WAAW,eAAe;AAAA,QACvD;AAAA,MACF;AAEA;AAAA,IACF;AAAA,EACF;AAAA,EAEU,cAAoB;AAC5B,QAAI,CAAC,KAAK,UAAU;AAClB,WAAK,iBAAiB,KAAK,MAAM;AAAA,IACnC;AAAA,EACF;AAAA,EAEU,gBAAgB;AACxB,QAAI,CAAC,KAAK,aAAa,GAAG;AACxB,WAAK,WAAW;AAChB,WAAK,WAAW;AAAA,IAClB;AAAA,EACF;AAAA,EAEA,iBAAiB,OAAsB;AACrC,SAAK,SAAS;AACd,SAAK,WAAW;AAChB,SAAK,WAAW,MAAM,KAAK,UAAU,KAAK,IAAI,CAAC;AAAA,EACjD;AAAA,EAEA,UAAU,QAAuB;AAC/B,UAAM,UAAU,KAAK,YAAY;AAEjC,QAAI,SAAS;AACX,WAAK,UAAU;AACf,WAAK,UAAU,QAAQ,CAAC,aAAa;AACnC,iBAAS,MAAM;AAAA,MACjB,CAAC;AAAA,IACH;AAAA,EACF;AAAA,EAEA,WAAoB;AAClB,WAAO,KAAK;AAAA,EACd;AACF;AAEO,IAAM,gBAAgB,IAAI,cAAc;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/onlineManager.d.cts b/node_modules/@tanstack/query-core/build/modern/onlineManager.d.cts new file mode 100644 index 0000000..dde932b --- /dev/null +++ b/node_modules/@tanstack/query-core/build/modern/onlineManager.d.cts @@ -0,0 +1,16 @@ +import { Subscribable } from './subscribable.cjs'; + +type Listener = (online: boolean) => void; +type SetupFn = (setOnline: Listener) => (() => void) | undefined; +declare class OnlineManager extends Subscribable { + #private; + constructor(); + protected onSubscribe(): void; + protected onUnsubscribe(): void; + setEventListener(setup: SetupFn): void; + setOnline(online: boolean): void; + isOnline(): boolean; +} +declare const onlineManager: OnlineManager; + +export { OnlineManager, onlineManager }; diff --git a/node_modules/@tanstack/query-core/build/modern/onlineManager.d.ts b/node_modules/@tanstack/query-core/build/modern/onlineManager.d.ts new file mode 100644 index 0000000..4362a5c --- /dev/null +++ b/node_modules/@tanstack/query-core/build/modern/onlineManager.d.ts @@ -0,0 +1,16 @@ +import { Subscribable } from './subscribable.js'; + +type Listener = (online: boolean) => void; +type SetupFn = (setOnline: Listener) => (() => void) | undefined; +declare class OnlineManager extends Subscribable { + #private; + constructor(); + protected onSubscribe(): void; + protected onUnsubscribe(): void; + setEventListener(setup: SetupFn): void; + setOnline(online: boolean): void; + isOnline(): boolean; +} +declare const onlineManager: OnlineManager; + +export { OnlineManager, onlineManager }; diff --git a/node_modules/@tanstack/query-core/build/modern/onlineManager.js b/node_modules/@tanstack/query-core/build/modern/onlineManager.js new file mode 100644 index 0000000..2adb2ad --- /dev/null +++ b/node_modules/@tanstack/query-core/build/modern/onlineManager.js @@ -0,0 +1,58 @@ +// src/onlineManager.ts +import { Subscribable } from "./subscribable.js"; +import { isServer } from "./utils.js"; +var OnlineManager = class extends Subscribable { + #online = true; + #cleanup; + #setup; + constructor() { + super(); + this.#setup = (onOnline) => { + if (!isServer && window.addEventListener) { + const onlineListener = () => onOnline(true); + const offlineListener = () => onOnline(false); + window.addEventListener("online", onlineListener, false); + window.addEventListener("offline", offlineListener, false); + return () => { + window.removeEventListener("online", onlineListener); + window.removeEventListener("offline", offlineListener); + }; + } + return; + }; + } + onSubscribe() { + if (!this.#cleanup) { + this.setEventListener(this.#setup); + } + } + onUnsubscribe() { + if (!this.hasListeners()) { + this.#cleanup?.(); + this.#cleanup = void 0; + } + } + setEventListener(setup) { + this.#setup = setup; + this.#cleanup?.(); + this.#cleanup = setup(this.setOnline.bind(this)); + } + setOnline(online) { + const changed = this.#online !== online; + if (changed) { + this.#online = online; + this.listeners.forEach((listener) => { + listener(online); + }); + } + } + isOnline() { + return this.#online; + } +}; +var onlineManager = new OnlineManager(); +export { + OnlineManager, + onlineManager +}; +//# sourceMappingURL=onlineManager.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/onlineManager.js.map b/node_modules/@tanstack/query-core/build/modern/onlineManager.js.map new file mode 100644 index 0000000..8530d4c --- /dev/null +++ b/node_modules/@tanstack/query-core/build/modern/onlineManager.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/onlineManager.ts"],"sourcesContent":["import { Subscribable } from './subscribable'\nimport { isServer } from './utils'\n\ntype Listener = (online: boolean) => void\ntype SetupFn = (setOnline: Listener) => (() => void) | undefined\n\nexport class OnlineManager extends Subscribable {\n #online = true\n #cleanup?: () => void\n\n #setup: SetupFn\n\n constructor() {\n super()\n this.#setup = (onOnline) => {\n // addEventListener does not exist in React Native, but window does\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n if (!isServer && window.addEventListener) {\n const onlineListener = () => onOnline(true)\n const offlineListener = () => onOnline(false)\n // Listen to online\n window.addEventListener('online', onlineListener, false)\n window.addEventListener('offline', offlineListener, false)\n\n return () => {\n // Be sure to unsubscribe if a new handler is set\n window.removeEventListener('online', onlineListener)\n window.removeEventListener('offline', offlineListener)\n }\n }\n\n return\n }\n }\n\n protected onSubscribe(): void {\n if (!this.#cleanup) {\n this.setEventListener(this.#setup)\n }\n }\n\n protected onUnsubscribe() {\n if (!this.hasListeners()) {\n this.#cleanup?.()\n this.#cleanup = undefined\n }\n }\n\n setEventListener(setup: SetupFn): void {\n this.#setup = setup\n this.#cleanup?.()\n this.#cleanup = setup(this.setOnline.bind(this))\n }\n\n setOnline(online: boolean): void {\n const changed = this.#online !== online\n\n if (changed) {\n this.#online = online\n this.listeners.forEach((listener) => {\n listener(online)\n })\n }\n }\n\n isOnline(): boolean {\n return this.#online\n }\n}\n\nexport const onlineManager = new OnlineManager()\n"],"mappings":";AAAA,SAAS,oBAAoB;AAC7B,SAAS,gBAAgB;AAKlB,IAAM,gBAAN,cAA4B,aAAuB;AAAA,EACxD,UAAU;AAAA,EACV;AAAA,EAEA;AAAA,EAEA,cAAc;AACZ,UAAM;AACN,SAAK,SAAS,CAAC,aAAa;AAG1B,UAAI,CAAC,YAAY,OAAO,kBAAkB;AACxC,cAAM,iBAAiB,MAAM,SAAS,IAAI;AAC1C,cAAM,kBAAkB,MAAM,SAAS,KAAK;AAE5C,eAAO,iBAAiB,UAAU,gBAAgB,KAAK;AACvD,eAAO,iBAAiB,WAAW,iBAAiB,KAAK;AAEzD,eAAO,MAAM;AAEX,iBAAO,oBAAoB,UAAU,cAAc;AACnD,iBAAO,oBAAoB,WAAW,eAAe;AAAA,QACvD;AAAA,MACF;AAEA;AAAA,IACF;AAAA,EACF;AAAA,EAEU,cAAoB;AAC5B,QAAI,CAAC,KAAK,UAAU;AAClB,WAAK,iBAAiB,KAAK,MAAM;AAAA,IACnC;AAAA,EACF;AAAA,EAEU,gBAAgB;AACxB,QAAI,CAAC,KAAK,aAAa,GAAG;AACxB,WAAK,WAAW;AAChB,WAAK,WAAW;AAAA,IAClB;AAAA,EACF;AAAA,EAEA,iBAAiB,OAAsB;AACrC,SAAK,SAAS;AACd,SAAK,WAAW;AAChB,SAAK,WAAW,MAAM,KAAK,UAAU,KAAK,IAAI,CAAC;AAAA,EACjD;AAAA,EAEA,UAAU,QAAuB;AAC/B,UAAM,UAAU,KAAK,YAAY;AAEjC,QAAI,SAAS;AACX,WAAK,UAAU;AACf,WAAK,UAAU,QAAQ,CAAC,aAAa;AACnC,iBAAS,MAAM;AAAA,MACjB,CAAC;AAAA,IACH;AAAA,EACF;AAAA,EAEA,WAAoB;AAClB,WAAO,KAAK;AAAA,EACd;AACF;AAEO,IAAM,gBAAgB,IAAI,cAAc;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/queriesObserver.cjs b/node_modules/@tanstack/query-core/build/modern/queriesObserver.cjs new file mode 100644 index 0000000..c1272d6 --- /dev/null +++ b/node_modules/@tanstack/query-core/build/modern/queriesObserver.cjs @@ -0,0 +1,237 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/queriesObserver.ts +var queriesObserver_exports = {}; +__export(queriesObserver_exports, { + QueriesObserver: () => QueriesObserver +}); +module.exports = __toCommonJS(queriesObserver_exports); +var import_notifyManager = require("./notifyManager.cjs"); +var import_queryObserver = require("./queryObserver.cjs"); +var import_subscribable = require("./subscribable.cjs"); +var import_utils = require("./utils.cjs"); +function difference(array1, array2) { + const excludeSet = new Set(array2); + return array1.filter((x) => !excludeSet.has(x)); +} +function replaceAt(array, index, value) { + const copy = array.slice(0); + copy[index] = value; + return copy; +} +var QueriesObserver = class extends import_subscribable.Subscribable { + #client; + #result; + #queries; + #options; + #observers; + #combinedResult; + #lastCombine; + #lastResult; + #lastQueryHashes; + #observerMatches = []; + constructor(client, queries, options) { + super(); + this.#client = client; + this.#options = options; + this.#queries = []; + this.#observers = []; + this.#result = []; + this.setQueries(queries); + } + onSubscribe() { + if (this.listeners.size === 1) { + this.#observers.forEach((observer) => { + observer.subscribe((result) => { + this.#onUpdate(observer, result); + }); + }); + } + } + onUnsubscribe() { + if (!this.listeners.size) { + this.destroy(); + } + } + destroy() { + this.listeners = /* @__PURE__ */ new Set(); + this.#observers.forEach((observer) => { + observer.destroy(); + }); + } + setQueries(queries, options) { + this.#queries = queries; + this.#options = options; + if (process.env.NODE_ENV !== "production") { + const queryHashes = queries.map( + (query) => this.#client.defaultQueryOptions(query).queryHash + ); + if (new Set(queryHashes).size !== queryHashes.length) { + console.warn( + "[QueriesObserver]: Duplicate Queries found. This might result in unexpected behavior." + ); + } + } + import_notifyManager.notifyManager.batch(() => { + const prevObservers = this.#observers; + const newObserverMatches = this.#findMatchingObservers(this.#queries); + newObserverMatches.forEach( + (match) => match.observer.setOptions(match.defaultedQueryOptions) + ); + const newObservers = newObserverMatches.map((match) => match.observer); + const newResult = newObservers.map( + (observer) => observer.getCurrentResult() + ); + const hasLengthChange = prevObservers.length !== newObservers.length; + const hasIndexChange = newObservers.some( + (observer, index) => observer !== prevObservers[index] + ); + const hasStructuralChange = hasLengthChange || hasIndexChange; + const hasResultChange = hasStructuralChange ? true : newResult.some((result, index) => { + const prev = this.#result[index]; + return !prev || !(0, import_utils.shallowEqualObjects)(result, prev); + }); + if (!hasStructuralChange && !hasResultChange) return; + if (hasStructuralChange) { + this.#observerMatches = newObserverMatches; + this.#observers = newObservers; + } + this.#result = newResult; + if (!this.hasListeners()) return; + if (hasStructuralChange) { + difference(prevObservers, newObservers).forEach((observer) => { + observer.destroy(); + }); + difference(newObservers, prevObservers).forEach((observer) => { + observer.subscribe((result) => { + this.#onUpdate(observer, result); + }); + }); + } + this.#notify(); + }); + } + getCurrentResult() { + return this.#result; + } + getQueries() { + return this.#observers.map((observer) => observer.getCurrentQuery()); + } + getObservers() { + return this.#observers; + } + getOptimisticResult(queries, combine) { + const matches = this.#findMatchingObservers(queries); + const result = matches.map( + (match) => match.observer.getOptimisticResult(match.defaultedQueryOptions) + ); + const queryHashes = matches.map( + (match) => match.defaultedQueryOptions.queryHash + ); + return [ + result, + (r) => { + return this.#combineResult(r ?? result, combine, queryHashes); + }, + () => { + return this.#trackResult(result, matches); + } + ]; + } + #trackResult(result, matches) { + return matches.map((match, index) => { + const observerResult = result[index]; + return !match.defaultedQueryOptions.notifyOnChangeProps ? match.observer.trackResult(observerResult, (accessedProp) => { + matches.forEach((m) => { + m.observer.trackProp(accessedProp); + }); + }) : observerResult; + }); + } + #combineResult(input, combine, queryHashes) { + if (combine) { + const lastHashes = this.#lastQueryHashes; + const queryHashesChanged = queryHashes !== void 0 && lastHashes !== void 0 && (lastHashes.length !== queryHashes.length || queryHashes.some((hash, i) => hash !== lastHashes[i])); + if (!this.#combinedResult || this.#result !== this.#lastResult || queryHashesChanged || combine !== this.#lastCombine) { + this.#lastCombine = combine; + this.#lastResult = this.#result; + if (queryHashes !== void 0) { + this.#lastQueryHashes = queryHashes; + } + this.#combinedResult = (0, import_utils.replaceEqualDeep)( + this.#combinedResult, + combine(input) + ); + } + return this.#combinedResult; + } + return input; + } + #findMatchingObservers(queries) { + const prevObserversMap = /* @__PURE__ */ new Map(); + this.#observers.forEach((observer) => { + const key = observer.options.queryHash; + if (!key) return; + const previousObservers = prevObserversMap.get(key); + if (previousObservers) { + previousObservers.push(observer); + } else { + prevObserversMap.set(key, [observer]); + } + }); + const observers = []; + queries.forEach((options) => { + const defaultedOptions = this.#client.defaultQueryOptions(options); + const match = prevObserversMap.get(defaultedOptions.queryHash)?.shift(); + const observer = match ?? new import_queryObserver.QueryObserver(this.#client, defaultedOptions); + observers.push({ + defaultedQueryOptions: defaultedOptions, + observer + }); + }); + return observers; + } + #onUpdate(observer, result) { + const index = this.#observers.indexOf(observer); + if (index !== -1) { + this.#result = replaceAt(this.#result, index, result); + this.#notify(); + } + } + #notify() { + if (this.hasListeners()) { + const previousResult = this.#combinedResult; + const newTracked = this.#trackResult(this.#result, this.#observerMatches); + const newResult = this.#combineResult(newTracked, this.#options?.combine); + if (previousResult !== newResult) { + import_notifyManager.notifyManager.batch(() => { + this.listeners.forEach((listener) => { + listener(this.#result); + }); + }); + } + } + } +}; +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + QueriesObserver +}); +//# sourceMappingURL=queriesObserver.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/queriesObserver.cjs.map b/node_modules/@tanstack/query-core/build/modern/queriesObserver.cjs.map new file mode 100644 index 0000000..81d7d31 --- /dev/null +++ b/node_modules/@tanstack/query-core/build/modern/queriesObserver.cjs.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/queriesObserver.ts"],"sourcesContent":["import { notifyManager } from './notifyManager'\nimport { QueryObserver } from './queryObserver'\nimport { Subscribable } from './subscribable'\nimport { replaceEqualDeep, shallowEqualObjects } from './utils'\nimport type {\n DefaultedQueryObserverOptions,\n QueryObserverOptions,\n QueryObserverResult,\n} from './types'\nimport type { QueryClient } from './queryClient'\n\nfunction difference(array1: Array, array2: Array): Array {\n const excludeSet = new Set(array2)\n return array1.filter((x) => !excludeSet.has(x))\n}\n\nfunction replaceAt(array: Array, index: number, value: T): Array {\n const copy = array.slice(0)\n copy[index] = value\n return copy\n}\n\ntype QueriesObserverListener = (result: Array) => void\n\ntype CombineFn = (\n result: Array,\n) => TCombinedResult\n\nexport interface QueriesObserverOptions<\n TCombinedResult = Array,\n> {\n combine?: CombineFn\n}\n\nexport class QueriesObserver<\n TCombinedResult = Array,\n> extends Subscribable {\n #client: QueryClient\n #result!: Array\n #queries: Array\n #options?: QueriesObserverOptions\n #observers: Array\n #combinedResult?: TCombinedResult\n #lastCombine?: CombineFn\n #lastResult?: Array\n #lastQueryHashes?: Array\n #observerMatches: Array = []\n\n constructor(\n client: QueryClient,\n queries: Array>,\n options?: QueriesObserverOptions,\n ) {\n super()\n\n this.#client = client\n this.#options = options\n this.#queries = []\n this.#observers = []\n this.#result = []\n\n this.setQueries(queries)\n }\n\n protected onSubscribe(): void {\n if (this.listeners.size === 1) {\n this.#observers.forEach((observer) => {\n observer.subscribe((result) => {\n this.#onUpdate(observer, result)\n })\n })\n }\n }\n\n protected onUnsubscribe(): void {\n if (!this.listeners.size) {\n this.destroy()\n }\n }\n\n destroy(): void {\n this.listeners = new Set()\n this.#observers.forEach((observer) => {\n observer.destroy()\n })\n }\n\n setQueries(\n queries: Array,\n options?: QueriesObserverOptions,\n ): void {\n this.#queries = queries\n this.#options = options\n\n if (process.env.NODE_ENV !== 'production') {\n const queryHashes = queries.map(\n (query) => this.#client.defaultQueryOptions(query).queryHash,\n )\n if (new Set(queryHashes).size !== queryHashes.length) {\n console.warn(\n '[QueriesObserver]: Duplicate Queries found. This might result in unexpected behavior.',\n )\n }\n }\n\n notifyManager.batch(() => {\n const prevObservers = this.#observers\n\n const newObserverMatches = this.#findMatchingObservers(this.#queries)\n\n // set options for the new observers to notify of changes\n newObserverMatches.forEach((match) =>\n match.observer.setOptions(match.defaultedQueryOptions),\n )\n\n const newObservers = newObserverMatches.map((match) => match.observer)\n const newResult = newObservers.map((observer) =>\n observer.getCurrentResult(),\n )\n\n const hasLengthChange = prevObservers.length !== newObservers.length\n const hasIndexChange = newObservers.some(\n (observer, index) => observer !== prevObservers[index],\n )\n const hasStructuralChange = hasLengthChange || hasIndexChange\n\n const hasResultChange = hasStructuralChange\n ? true\n : newResult.some((result, index) => {\n const prev = this.#result[index]\n return !prev || !shallowEqualObjects(result, prev)\n })\n\n if (!hasStructuralChange && !hasResultChange) return\n\n if (hasStructuralChange) {\n this.#observerMatches = newObserverMatches\n this.#observers = newObservers\n }\n\n this.#result = newResult\n\n if (!this.hasListeners()) return\n\n if (hasStructuralChange) {\n difference(prevObservers, newObservers).forEach((observer) => {\n observer.destroy()\n })\n difference(newObservers, prevObservers).forEach((observer) => {\n observer.subscribe((result) => {\n this.#onUpdate(observer, result)\n })\n })\n }\n\n this.#notify()\n })\n }\n\n getCurrentResult(): Array {\n return this.#result\n }\n\n getQueries() {\n return this.#observers.map((observer) => observer.getCurrentQuery())\n }\n\n getObservers() {\n return this.#observers\n }\n\n getOptimisticResult(\n queries: Array,\n combine: CombineFn | undefined,\n ): [\n rawResult: Array,\n combineResult: (r?: Array) => TCombinedResult,\n trackResult: () => Array,\n ] {\n const matches = this.#findMatchingObservers(queries)\n const result = matches.map((match) =>\n match.observer.getOptimisticResult(match.defaultedQueryOptions),\n )\n const queryHashes = matches.map(\n (match) => match.defaultedQueryOptions.queryHash,\n )\n\n return [\n result,\n (r?: Array) => {\n return this.#combineResult(r ?? result, combine, queryHashes)\n },\n () => {\n return this.#trackResult(result, matches)\n },\n ]\n }\n\n #trackResult(\n result: Array,\n matches: Array,\n ) {\n return matches.map((match, index) => {\n const observerResult = result[index]!\n return !match.defaultedQueryOptions.notifyOnChangeProps\n ? match.observer.trackResult(observerResult, (accessedProp) => {\n // track property on all observers to ensure proper (synchronized) tracking (#7000)\n matches.forEach((m) => {\n m.observer.trackProp(accessedProp)\n })\n })\n : observerResult\n })\n }\n\n #combineResult(\n input: Array,\n combine: CombineFn | undefined,\n queryHashes?: Array,\n ): TCombinedResult {\n if (combine) {\n const lastHashes = this.#lastQueryHashes\n const queryHashesChanged =\n queryHashes !== undefined &&\n lastHashes !== undefined &&\n (lastHashes.length !== queryHashes.length ||\n queryHashes.some((hash, i) => hash !== lastHashes[i]))\n\n if (\n !this.#combinedResult ||\n this.#result !== this.#lastResult ||\n queryHashesChanged ||\n combine !== this.#lastCombine\n ) {\n this.#lastCombine = combine\n this.#lastResult = this.#result\n\n if (queryHashes !== undefined) {\n this.#lastQueryHashes = queryHashes\n }\n this.#combinedResult = replaceEqualDeep(\n this.#combinedResult,\n combine(input),\n )\n }\n\n return this.#combinedResult\n }\n return input as any\n }\n\n #findMatchingObservers(\n queries: Array,\n ): Array {\n const prevObserversMap = new Map>()\n\n this.#observers.forEach((observer) => {\n const key = observer.options.queryHash\n if (!key) return\n\n const previousObservers = prevObserversMap.get(key)\n\n if (previousObservers) {\n previousObservers.push(observer)\n } else {\n prevObserversMap.set(key, [observer])\n }\n })\n\n const observers: Array = []\n\n queries.forEach((options) => {\n const defaultedOptions = this.#client.defaultQueryOptions(options)\n const match = prevObserversMap.get(defaultedOptions.queryHash)?.shift()\n const observer =\n match ?? new QueryObserver(this.#client, defaultedOptions)\n\n observers.push({\n defaultedQueryOptions: defaultedOptions,\n observer,\n })\n })\n\n return observers\n }\n\n #onUpdate(observer: QueryObserver, result: QueryObserverResult): void {\n const index = this.#observers.indexOf(observer)\n if (index !== -1) {\n this.#result = replaceAt(this.#result, index, result)\n this.#notify()\n }\n }\n\n #notify(): void {\n if (this.hasListeners()) {\n const previousResult = this.#combinedResult\n const newTracked = this.#trackResult(this.#result, this.#observerMatches)\n const newResult = this.#combineResult(newTracked, this.#options?.combine)\n\n if (previousResult !== newResult) {\n notifyManager.batch(() => {\n this.listeners.forEach((listener) => {\n listener(this.#result)\n })\n })\n }\n }\n }\n}\n\ntype QueryObserverMatch = {\n defaultedQueryOptions: DefaultedQueryObserverOptions\n observer: QueryObserver\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,2BAA8B;AAC9B,2BAA8B;AAC9B,0BAA6B;AAC7B,mBAAsD;AAQtD,SAAS,WAAc,QAAkB,QAA4B;AACnE,QAAM,aAAa,IAAI,IAAI,MAAM;AACjC,SAAO,OAAO,OAAO,CAAC,MAAM,CAAC,WAAW,IAAI,CAAC,CAAC;AAChD;AAEA,SAAS,UAAa,OAAiB,OAAe,OAAoB;AACxE,QAAM,OAAO,MAAM,MAAM,CAAC;AAC1B,OAAK,KAAK,IAAI;AACd,SAAO;AACT;AAcO,IAAM,kBAAN,cAEG,iCAAsC;AAAA,EAC9C;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,mBAA8C,CAAC;AAAA,EAE/C,YACE,QACA,SACA,SACA;AACA,UAAM;AAEN,SAAK,UAAU;AACf,SAAK,WAAW;AAChB,SAAK,WAAW,CAAC;AACjB,SAAK,aAAa,CAAC;AAC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AQ,CAAC;AAAA,MACtC;AAAA,IACF,CAAC;AAED,UAAM,YAAuC,CAAC;AAE9C,YAAQ,QAAQ,CAAC,YAAY;AAC3B,YAAM,mBAAmB,KAAK,QAAQ,oBAAoB,OAAO;AACjE,YAAM,QAAQ,iBAAiB,IAAI,iBAAiB,SAAS,GAAG,MAAM;AACtE,YAAM,WACJ,SAAS,IAAI,mCAAc,KAAK,SAAS,gBAAgB;AAE3D,gBAAU,KAAK;AAAA,QACb,uBAAuB;AAAA,QACvB;AAAA,MACF,CAAC;AAAA,IACH,CAAC;AAED,WAAO;AAAA,EACT;AAAA,EAEA,UAAU,UAAyB,QAAmC;AACpE,UAAM,QAAQ,KAAK,WAAW,QAAQ,QAAQ;AAC9C,QAAI,UAAU,IAAI;AAChB,WAAK,UAAU,UAAU,KAAK,SAAS,OAAO,MAAM;AACpD,WAAK,QAAQ;AAAA,IACf;AAAA,EACF;AAAA,EAEA,UAAgB;AACd,QAAI,KAAK,aAAa,GAAG;AACvB,YAAM,iBAAiB,KAAK;AAC5B,YAAM,aAAa,KAAK,aAAa,KAAK,SAAS,KAAK,gBAAgB;AACxE,YAAM,YAAY,KAAK,eAAe,YAAY,KAAK,UAAU,OAAO;AAExE,UAAI,mBAAmB,WAAW;AAChC,2CAAc,MAAM,MAAM;AACxB,eAAK,UAAU,QAAQ,CAAC,aAAa;AACnC,qBAAS,KAAK,OAAO;AAAA,UACvB,CAAC;AAAA,QACH,CAAC;AAAA,MACH;AAAA,IACF;AAAA,EACF;AACF;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/queriesObserver.d.cts b/node_modules/@tanstack/query-core/build/modern/queriesObserver.d.cts new file mode 100644 index 0000000..cc16e52 --- /dev/null +++ b/node_modules/@tanstack/query-core/build/modern/queriesObserver.d.cts @@ -0,0 +1,27 @@ +import { aH as QueryObserverResult, g as QueryClient, ag as QueryObserverOptions, z as Query, i as QueryObserver } from './hydration-uphG6M-i.cjs'; +import { Subscribable } from './subscribable.cjs'; +import './removable.cjs'; + +type QueriesObserverListener = (result: Array) => void; +type CombineFn = (result: Array) => TCombinedResult; +interface QueriesObserverOptions> { + combine?: CombineFn; +} +declare class QueriesObserver> extends Subscribable { + #private; + constructor(client: QueryClient, queries: Array>, options?: QueriesObserverOptions); + protected onSubscribe(): void; + protected onUnsubscribe(): void; + destroy(): void; + setQueries(queries: Array, options?: QueriesObserverOptions): void; + getCurrentResult(): Array; + getQueries(): Query[]; + getObservers(): QueryObserver[]; + getOptimisticResult(queries: Array, combine: CombineFn | undefined): [ + rawResult: Array, + combineResult: (r?: Array) => TCombinedResult, + trackResult: () => Array + ]; +} + +export { QueriesObserver, type QueriesObserverOptions }; diff --git a/node_modules/@tanstack/query-core/build/modern/queriesObserver.d.ts b/node_modules/@tanstack/query-core/build/modern/queriesObserver.d.ts new file mode 100644 index 0000000..82a6b8f --- /dev/null +++ b/node_modules/@tanstack/query-core/build/modern/queriesObserver.d.ts @@ -0,0 +1,27 @@ +import { aH as QueryObserverResult, g as QueryClient, ag as QueryObserverOptions, z as Query, i as QueryObserver } from './hydration-BlEVG2Lp.js'; +import { Subscribable } from './subscribable.js'; +import './removable.js'; + +type QueriesObserverListener = (result: Array) => void; +type CombineFn = (result: Array) => TCombinedResult; +interface QueriesObserverOptions> { + combine?: CombineFn; +} +declare class QueriesObserver> extends Subscribable { + #private; + constructor(client: QueryClient, queries: Array>, options?: QueriesObserverOptions); + protected onSubscribe(): void; + protected onUnsubscribe(): void; + destroy(): void; + setQueries(queries: Array, options?: QueriesObserverOptions): void; + getCurrentResult(): Array; + getQueries(): Query[]; + getObservers(): QueryObserver[]; + getOptimisticResult(queries: Array, combine: CombineFn | undefined): [ + rawResult: Array, + combineResult: (r?: Array) => TCombinedResult, + trackResult: () => Array + ]; +} + +export { QueriesObserver, type QueriesObserverOptions }; diff --git a/node_modules/@tanstack/query-core/build/modern/queriesObserver.js b/node_modules/@tanstack/query-core/build/modern/queriesObserver.js new file mode 100644 index 0000000..eebdfe6 --- /dev/null +++ b/node_modules/@tanstack/query-core/build/modern/queriesObserver.js @@ -0,0 +1,212 @@ +// src/queriesObserver.ts +import { notifyManager } from "./notifyManager.js"; +import { QueryObserver } from "./queryObserver.js"; +import { Subscribable } from "./subscribable.js"; +import { replaceEqualDeep, shallowEqualObjects } from "./utils.js"; +function difference(array1, array2) { + const excludeSet = new Set(array2); + return array1.filter((x) => !excludeSet.has(x)); +} +function replaceAt(array, index, value) { + const copy = array.slice(0); + copy[index] = value; + return copy; +} +var QueriesObserver = class extends Subscribable { + #client; + #result; + #queries; + #options; + #observers; + #combinedResult; + #lastCombine; + #lastResult; + #lastQueryHashes; + #observerMatches = []; + constructor(client, queries, options) { + super(); + this.#client = client; + this.#options = options; + this.#queries = []; + this.#observers = []; + this.#result = []; + this.setQueries(queries); + } + onSubscribe() { + if (this.listeners.size === 1) { + this.#observers.forEach((observer) => { + observer.subscribe((result) => { + this.#onUpdate(observer, result); + }); + }); + } + } + onUnsubscribe() { + if (!this.listeners.size) { + this.destroy(); + } + } + destroy() { + this.listeners = /* @__PURE__ */ new Set(); + this.#observers.forEach((observer) => { + observer.destroy(); + }); + } + setQueries(queries, options) { + this.#queries = queries; + this.#options = options; + if (process.env.NODE_ENV !== "production") { + const queryHashes = queries.map( + (query) => this.#client.defaultQueryOptions(query).queryHash + ); + if (new Set(queryHashes).size !== queryHashes.length) { + console.warn( + "[QueriesObserver]: Duplicate Queries found. This might result in unexpected behavior." + ); + } + } + notifyManager.batch(() => { + const prevObservers = this.#observers; + const newObserverMatches = this.#findMatchingObservers(this.#queries); + newObserverMatches.forEach( + (match) => match.observer.setOptions(match.defaultedQueryOptions) + ); + const newObservers = newObserverMatches.map((match) => match.observer); + const newResult = newObservers.map( + (observer) => observer.getCurrentResult() + ); + const hasLengthChange = prevObservers.length !== newObservers.length; + const hasIndexChange = newObservers.some( + (observer, index) => observer !== prevObservers[index] + ); + const hasStructuralChange = hasLengthChange || hasIndexChange; + const hasResultChange = hasStructuralChange ? true : newResult.some((result, index) => { + const prev = this.#result[index]; + return !prev || !shallowEqualObjects(result, prev); + }); + if (!hasStructuralChange && !hasResultChange) return; + if (hasStructuralChange) { + this.#observerMatches = newObserverMatches; + this.#observers = newObservers; + } + this.#result = newResult; + if (!this.hasListeners()) return; + if (hasStructuralChange) { + difference(prevObservers, newObservers).forEach((observer) => { + observer.destroy(); + }); + difference(newObservers, prevObservers).forEach((observer) => { + observer.subscribe((result) => { + this.#onUpdate(observer, result); + }); + }); + } + this.#notify(); + }); + } + getCurrentResult() { + return this.#result; + } + getQueries() { + return this.#observers.map((observer) => observer.getCurrentQuery()); + } + getObservers() { + return this.#observers; + } + getOptimisticResult(queries, combine) { + const matches = this.#findMatchingObservers(queries); + const result = matches.map( + (match) => match.observer.getOptimisticResult(match.defaultedQueryOptions) + ); + const queryHashes = matches.map( + (match) => match.defaultedQueryOptions.queryHash + ); + return [ + result, + (r) => { + return this.#combineResult(r ?? result, combine, queryHashes); + }, + () => { + return this.#trackResult(result, matches); + } + ]; + } + #trackResult(result, matches) { + return matches.map((match, index) => { + const observerResult = result[index]; + return !match.defaultedQueryOptions.notifyOnChangeProps ? match.observer.trackResult(observerResult, (accessedProp) => { + matches.forEach((m) => { + m.observer.trackProp(accessedProp); + }); + }) : observerResult; + }); + } + #combineResult(input, combine, queryHashes) { + if (combine) { + const lastHashes = this.#lastQueryHashes; + const queryHashesChanged = queryHashes !== void 0 && lastHashes !== void 0 && (lastHashes.length !== queryHashes.length || queryHashes.some((hash, i) => hash !== lastHashes[i])); + if (!this.#combinedResult || this.#result !== this.#lastResult || queryHashesChanged || combine !== this.#lastCombine) { + this.#lastCombine = combine; + this.#lastResult = this.#result; + if (queryHashes !== void 0) { + this.#lastQueryHashes = queryHashes; + } + this.#combinedResult = replaceEqualDeep( + this.#combinedResult, + combine(input) + ); + } + return this.#combinedResult; + } + return input; + } + #findMatchingObservers(queries) { + const prevObserversMap = /* @__PURE__ */ new Map(); + this.#observers.forEach((observer) => { + const key = observer.options.queryHash; + if (!key) return; + const previousObservers = prevObserversMap.get(key); + if (previousObservers) { + previousObservers.push(observer); + } else { + prevObserversMap.set(key, [observer]); + } + }); + const observers = []; + queries.forEach((options) => { + const defaultedOptions = this.#client.defaultQueryOptions(options); + const match = prevObserversMap.get(defaultedOptions.queryHash)?.shift(); + const observer = match ?? new QueryObserver(this.#client, defaultedOptions); + observers.push({ + defaultedQueryOptions: defaultedOptions, + observer + }); + }); + return observers; + } + #onUpdate(observer, result) { + const index = this.#observers.indexOf(observer); + if (index !== -1) { + this.#result = replaceAt(this.#result, index, result); + this.#notify(); + } + } + #notify() { + if (this.hasListeners()) { + const previousResult = this.#combinedResult; + const newTracked = this.#trackResult(this.#result, this.#observerMatches); + const newResult = this.#combineResult(newTracked, this.#options?.combine); + if (previousResult !== newResult) { + notifyManager.batch(() => { + this.listeners.forEach((listener) => { + listener(this.#result); + }); + }); + } + } + } +}; +export { + QueriesObserver +}; +//# sourceMappingURL=queriesObserver.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/queriesObserver.js.map b/node_modules/@tanstack/query-core/build/modern/queriesObserver.js.map new file mode 100644 index 0000000..802b74b --- /dev/null +++ b/node_modules/@tanstack/query-core/build/modern/queriesObserver.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/queriesObserver.ts"],"sourcesContent":["import { notifyManager } from './notifyManager'\nimport { QueryObserver } from './queryObserver'\nimport { Subscribable } from './subscribable'\nimport { replaceEqualDeep, shallowEqualObjects } from './utils'\nimport type {\n DefaultedQueryObserverOptions,\n QueryObserverOptions,\n QueryObserverResult,\n} from './types'\nimport type { QueryClient } from './queryClient'\n\nfunction difference(array1: Array, array2: Array): Array {\n const excludeSet = new Set(array2)\n return array1.filter((x) => !excludeSet.has(x))\n}\n\nfunction replaceAt(array: Array, index: number, value: T): Array {\n const copy = array.slice(0)\n copy[index] = value\n return copy\n}\n\ntype QueriesObserverListener = (result: Array) => void\n\ntype CombineFn = (\n result: Array,\n) => TCombinedResult\n\nexport interface QueriesObserverOptions<\n TCombinedResult = Array,\n> {\n combine?: CombineFn\n}\n\nexport class QueriesObserver<\n TCombinedResult = Array,\n> extends Subscribable {\n #client: QueryClient\n #result!: Array\n #queries: Array\n #options?: QueriesObserverOptions\n #observers: Array\n #combinedResult?: TCombinedResult\n #lastCombine?: CombineFn\n #lastResult?: Array\n #lastQueryHashes?: Array\n #observerMatches: Array = []\n\n constructor(\n client: QueryClient,\n queries: Array>,\n options?: QueriesObserverOptions,\n ) {\n super()\n\n this.#client = client\n this.#options = options\n this.#queries = []\n this.#observers = []\n this.#result = []\n\n this.setQueries(queries)\n }\n\n protected onSubscribe(): void {\n if (this.listeners.size === 1) {\n this.#observers.forEach((observer) => {\n observer.subscribe((result) => {\n this.#onUpdate(observer, result)\n })\n })\n }\n }\n\n protected onUnsubscribe(): void {\n if (!this.listeners.size) {\n this.destroy()\n }\n }\n\n destroy(): void {\n this.listeners = new Set()\n this.#observers.forEach((observer) => {\n observer.destroy()\n })\n }\n\n setQueries(\n queries: Array,\n options?: QueriesObserverOptions,\n ): void {\n this.#queries = queries\n this.#options = options\n\n if (process.env.NODE_ENV !== 'production') {\n const queryHashes = queries.map(\n (query) => this.#client.defaultQueryOptions(query).queryHash,\n )\n if (new Set(queryHashes).size !== queryHashes.length) {\n console.warn(\n '[QueriesObserver]: Duplicate Queries found. This might result in unexpected behavior.',\n )\n }\n }\n\n notifyManager.batch(() => {\n const prevObservers = this.#observers\n\n const newObserverMatches = this.#findMatchingObservers(this.#queries)\n\n // set options for the new observers to notify of changes\n newObserverMatches.forEach((match) =>\n match.observer.setOptions(match.defaultedQueryOptions),\n )\n\n const newObservers = newObserverMatches.map((match) => match.observer)\n const newResult = newObservers.map((observer) =>\n observer.getCurrentResult(),\n )\n\n const hasLengthChange = prevObservers.length !== newObservers.length\n const hasIndexChange = newObservers.some(\n (observer, index) => observer !== prevObservers[index],\n )\n const hasStructuralChange = hasLengthChange || hasIndexChange\n\n const hasResultChange = hasStructuralChange\n ? true\n : newResult.some((result, index) => {\n const prev = this.#result[index]\n return !prev || !shallowEqualObjects(result, prev)\n })\n\n if (!hasStructuralChange && !hasResultChange) return\n\n if (hasStructuralChange) {\n this.#observerMatches = newObserverMatches\n this.#observers = newObservers\n }\n\n this.#result = newResult\n\n if (!this.hasListeners()) return\n\n if (hasStructuralChange) {\n difference(prevObservers, newObservers).forEach((observer) => {\n observer.destroy()\n })\n difference(newObservers, prevObservers).forEach((observer) => {\n observer.subscribe((result) => {\n this.#onUpdate(observer, result)\n })\n })\n }\n\n this.#notify()\n })\n }\n\n getCurrentResult(): Array {\n return this.#result\n }\n\n getQueries() {\n return this.#observers.map((observer) => observer.getCurrentQuery())\n }\n\n getObservers() {\n return this.#observers\n }\n\n getOptimisticResult(\n queries: Array,\n combine: CombineFn | undefined,\n ): [\n rawResult: Array,\n combineResult: (r?: Array) => TCombinedResult,\n trackResult: () => Array,\n ] {\n const matches = this.#findMatchingObservers(queries)\n const result = matches.map((match) =>\n match.observer.getOptimisticResult(match.defaultedQueryOptions),\n )\n const queryHashes = matches.map(\n (match) => match.defaultedQueryOptions.queryHash,\n )\n\n return [\n result,\n (r?: Array) => {\n return this.#combineResult(r ?? result, combine, queryHashes)\n },\n () => {\n return this.#trackResult(result, matches)\n },\n ]\n }\n\n #trackResult(\n result: Array,\n matches: Array,\n ) {\n return matches.map((match, index) => {\n const observerResult = result[index]!\n return !match.defaultedQueryOptions.notifyOnChangeProps\n ? match.observer.trackResult(observerResult, (accessedProp) => {\n // track property on all observers to ensure proper (synchronized) tracking (#7000)\n matches.forEach((m) => {\n m.observer.trackProp(accessedProp)\n })\n })\n : observerResult\n })\n }\n\n #combineResult(\n input: Array,\n combine: CombineFn | undefined,\n queryHashes?: Array,\n ): TCombinedResult {\n if (combine) {\n const lastHashes = this.#lastQueryHashes\n const queryHashesChanged =\n queryHashes !== undefined &&\n lastHashes !== undefined &&\n (lastHashes.length !== queryHashes.length ||\n queryHashes.some((hash, i) => hash !== lastHashes[i]))\n\n if (\n !this.#combinedResult ||\n this.#result !== this.#lastResult ||\n queryHashesChanged ||\n combine !== this.#lastCombine\n ) {\n this.#lastCombine = combine\n this.#lastResult = this.#result\n\n if (queryHashes !== undefined) {\n this.#lastQueryHashes = queryHashes\n }\n this.#combinedResult = replaceEqualDeep(\n this.#combinedResult,\n combine(input),\n )\n }\n\n return this.#combinedResult\n }\n return input as any\n }\n\n #findMatchingObservers(\n queries: Array,\n ): Array {\n const prevObserversMap = new Map>()\n\n this.#observers.forEach((observer) => {\n const key = observer.options.queryHash\n if (!key) return\n\n const previousObservers = prevObserversMap.get(key)\n\n if (previousObservers) {\n previousObservers.push(observer)\n } else {\n prevObserversMap.set(key, [observer])\n }\n })\n\n const observers: Array = []\n\n queries.forEach((options) => {\n const defaultedOptions = this.#client.defaultQueryOptions(options)\n const match = prevObserversMap.get(defaultedOptions.queryHash)?.shift()\n const observer =\n match ?? new QueryObserver(this.#client, defaultedOptions)\n\n observers.push({\n defaultedQueryOptions: defaultedOptions,\n observer,\n })\n })\n\n return observers\n }\n\n #onUpdate(observer: QueryObserver, result: QueryObserverResult): void {\n const index = this.#observers.indexOf(observer)\n if (index !== -1) {\n this.#result = replaceAt(this.#result, index, result)\n this.#notify()\n }\n }\n\n #notify(): void {\n if (this.hasListeners()) {\n const previousResult = this.#combinedResult\n const newTracked = this.#trackResult(this.#result, this.#observerMatches)\n const newResult = this.#combineResult(newTracked, this.#options?.combine)\n\n if (previousResult !== newResult) {\n notifyManager.batch(() => {\n this.listeners.forEach((listener) => {\n listener(this.#result)\n })\n })\n }\n }\n }\n}\n\ntype QueryObserverMatch = {\n defaultedQueryOptions: DefaultedQueryObserverOptions\n observer: QueryObserver\n}\n"],"mappings":";AAAA,SAAS,qBAAqB;AAC9B,SAAS,qBAAqB;AAC9B,SAAS,oBAAoB;AAC7B,SAAS,kBAAkB,2BAA2B;AAQtD,SAAS,WAAc,QAAkB,QAA4B;AACnE,QAAM,aAAa,IAAI,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AO;AAExE,UAAI,mBAAmB,WAAW;AAChC,sBAAc,MAAM,MAAM;AACxB,eAAK,UAAU,QAAQ,CAAC,aAAa;AACnC,qBAAS,KAAK,OAAO;AAAA,UACvB,CAAC;AAAA,QACH,CAAC;AAAA,MACH;AAAA,IACF;AAAA,EACF;AACF;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/query.cjs b/node_modules/@tanstack/query-core/build/modern/query.cjs new file mode 100644 index 0000000..af8c064 --- /dev/null +++ b/node_modules/@tanstack/query-core/build/modern/query.cjs @@ -0,0 +1,452 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/query.ts +var query_exports = {}; +__export(query_exports, { + Query: () => Query, + fetchState: () => fetchState +}); +module.exports = __toCommonJS(query_exports); +var import_utils = require("./utils.cjs"); +var import_notifyManager = require("./notifyManager.cjs"); +var import_retryer = require("./retryer.cjs"); +var import_removable = require("./removable.cjs"); +var Query = class extends import_removable.Removable { + #initialState; + #revertState; + #cache; + #client; + #retryer; + #defaultOptions; + #abortSignalConsumed; + constructor(config) { + super(); + this.#abortSignalConsumed = false; + this.#defaultOptions = config.defaultOptions; + this.setOptions(config.options); + this.observers = []; + this.#client = config.client; + this.#cache = this.#client.getQueryCache(); + this.queryKey = config.queryKey; + this.queryHash = config.queryHash; + this.#initialState = getDefaultState(this.options); + this.state = config.state ?? this.#initialState; + this.scheduleGc(); + } + get meta() { + return this.options.meta; + } + get promise() { + return this.#retryer?.promise; + } + setOptions(options) { + this.options = { ...this.#defaultOptions, ...options }; + this.updateGcTime(this.options.gcTime); + if (this.state && this.state.data === void 0) { + const defaultState = getDefaultState(this.options); + if (defaultState.data !== void 0) { + this.setState( + successState(defaultState.data, defaultState.dataUpdatedAt) + ); + this.#initialState = defaultState; + } + } + } + optionalRemove() { + if (!this.observers.length && this.state.fetchStatus === "idle") { + this.#cache.remove(this); + } + } + setData(newData, options) { + const data = (0, import_utils.replaceData)(this.state.data, newData, this.options); + this.#dispatch({ + data, + type: "success", + dataUpdatedAt: options?.updatedAt, + manual: options?.manual + }); + return data; + } + setState(state, setStateOptions) { + this.#dispatch({ type: "setState", state, setStateOptions }); + } + cancel(options) { + const promise = this.#retryer?.promise; + this.#retryer?.cancel(options); + return promise ? promise.then(import_utils.noop).catch(import_utils.noop) : Promise.resolve(); + } + destroy() { + super.destroy(); + this.cancel({ silent: true }); + } + reset() { + this.destroy(); + this.setState(this.#initialState); + } + isActive() { + return this.observers.some( + (observer) => (0, import_utils.resolveEnabled)(observer.options.enabled, this) !== false + ); + } + isDisabled() { + if (this.getObserversCount() > 0) { + return !this.isActive(); + } + return this.options.queryFn === import_utils.skipToken || this.state.dataUpdateCount + this.state.errorUpdateCount === 0; + } + isStatic() { + if (this.getObserversCount() > 0) { + return this.observers.some( + (observer) => (0, import_utils.resolveStaleTime)(observer.options.staleTime, this) === "static" + ); + } + return false; + } + isStale() { + if (this.getObserversCount() > 0) { + return this.observers.some( + (observer) => observer.getCurrentResult().isStale + ); + } + return this.state.data === void 0 || this.state.isInvalidated; + } + isStaleByTime(staleTime = 0) { + if (this.state.data === void 0) { + return true; + } + if (staleTime === "static") { + return false; + } + if (this.state.isInvalidated) { + return true; + } + return !(0, import_utils.timeUntilStale)(this.state.dataUpdatedAt, staleTime); + } + onFocus() { + const observer = this.observers.find((x) => x.shouldFetchOnWindowFocus()); + observer?.refetch({ cancelRefetch: false }); + this.#retryer?.continue(); + } + onOnline() { + const observer = this.observers.find((x) => x.shouldFetchOnReconnect()); + observer?.refetch({ cancelRefetch: false }); + this.#retryer?.continue(); + } + addObserver(observer) { + if (!this.observers.includes(observer)) { + this.observers.push(observer); + this.clearGcTimeout(); + this.#cache.notify({ type: "observerAdded", query: this, observer }); + } + } + removeObserver(observer) { + if (this.observers.includes(observer)) { + this.observers = this.observers.filter((x) => x !== observer); + if (!this.observers.length) { + if (this.#retryer) { + if (this.#abortSignalConsumed) { + this.#retryer.cancel({ revert: true }); + } else { + this.#retryer.cancelRetry(); + } + } + this.scheduleGc(); + } + this.#cache.notify({ type: "observerRemoved", query: this, observer }); + } + } + getObserversCount() { + return this.observers.length; + } + invalidate() { + if (!this.state.isInvalidated) { + this.#dispatch({ type: "invalidate" }); + } + } + async fetch(options, fetchOptions) { + if (this.state.fetchStatus !== "idle" && // If the promise in the retryer is already rejected, we have to definitely + // re-start the fetch; there is a chance that the query is still in a + // pending state when that happens + this.#retryer?.status() !== "rejected") { + if (this.state.data !== void 0 && fetchOptions?.cancelRefetch) { + this.cancel({ silent: true }); + } else if (this.#retryer) { + this.#retryer.continueRetry(); + return this.#retryer.promise; + } + } + if (options) { + this.setOptions(options); + } + if (!this.options.queryFn) { + const observer = this.observers.find((x) => x.options.queryFn); + if (observer) { + this.setOptions(observer.options); + } + } + if (process.env.NODE_ENV !== "production") { + if (!Array.isArray(this.options.queryKey)) { + console.error( + `As of v4, queryKey needs to be an Array. If you are using a string like 'repoData', please change it to an Array, e.g. ['repoData']` + ); + } + } + const abortController = new AbortController(); + const addSignalProperty = (object) => { + Object.defineProperty(object, "signal", { + enumerable: true, + get: () => { + this.#abortSignalConsumed = true; + return abortController.signal; + } + }); + }; + const fetchFn = () => { + const queryFn = (0, import_utils.ensureQueryFn)(this.options, fetchOptions); + const createQueryFnContext = () => { + const queryFnContext2 = { + client: this.#client, + queryKey: this.queryKey, + meta: this.meta + }; + addSignalProperty(queryFnContext2); + return queryFnContext2; + }; + const queryFnContext = createQueryFnContext(); + this.#abortSignalConsumed = false; + if (this.options.persister) { + return this.options.persister( + queryFn, + queryFnContext, + this + ); + } + return queryFn(queryFnContext); + }; + const createFetchContext = () => { + const context2 = { + fetchOptions, + options: this.options, + queryKey: this.queryKey, + client: this.#client, + state: this.state, + fetchFn + }; + addSignalProperty(context2); + return context2; + }; + const context = createFetchContext(); + this.options.behavior?.onFetch(context, this); + this.#revertState = this.state; + if (this.state.fetchStatus === "idle" || this.state.fetchMeta !== context.fetchOptions?.meta) { + this.#dispatch({ type: "fetch", meta: context.fetchOptions?.meta }); + } + this.#retryer = (0, import_retryer.createRetryer)({ + initialPromise: fetchOptions?.initialPromise, + fn: context.fetchFn, + onCancel: (error) => { + if (error instanceof import_retryer.CancelledError && error.revert) { + this.setState({ + ...this.#revertState, + fetchStatus: "idle" + }); + } + abortController.abort(); + }, + onFail: (failureCount, error) => { + this.#dispatch({ type: "failed", failureCount, error }); + }, + onPause: () => { + this.#dispatch({ type: "pause" }); + }, + onContinue: () => { + this.#dispatch({ type: "continue" }); + }, + retry: context.options.retry, + retryDelay: context.options.retryDelay, + networkMode: context.options.networkMode, + canRun: () => true + }); + try { + const data = await this.#retryer.start(); + if (data === void 0) { + if (process.env.NODE_ENV !== "production") { + console.error( + `Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}` + ); + } + throw new Error(`${this.queryHash} data is undefined`); + } + this.setData(data); + this.#cache.config.onSuccess?.(data, this); + this.#cache.config.onSettled?.( + data, + this.state.error, + this + ); + return data; + } catch (error) { + if (error instanceof import_retryer.CancelledError) { + if (error.silent) { + return this.#retryer.promise; + } else if (error.revert) { + if (this.state.data === void 0) { + throw error; + } + return this.state.data; + } + } + this.#dispatch({ + type: "error", + error + }); + this.#cache.config.onError?.( + error, + this + ); + this.#cache.config.onSettled?.( + this.state.data, + error, + this + ); + throw error; + } finally { + this.scheduleGc(); + } + } + #dispatch(action) { + const reducer = (state) => { + switch (action.type) { + case "failed": + return { + ...state, + fetchFailureCount: action.failureCount, + fetchFailureReason: action.error + }; + case "pause": + return { + ...state, + fetchStatus: "paused" + }; + case "continue": + return { + ...state, + fetchStatus: "fetching" + }; + case "fetch": + return { + ...state, + ...fetchState(state.data, this.options), + fetchMeta: action.meta ?? null + }; + case "success": + const newState = { + ...state, + ...successState(action.data, action.dataUpdatedAt), + dataUpdateCount: state.dataUpdateCount + 1, + ...!action.manual && { + fetchStatus: "idle", + fetchFailureCount: 0, + fetchFailureReason: null + } + }; + this.#revertState = action.manual ? newState : void 0; + return newState; + case "error": + const error = action.error; + return { + ...state, + error, + errorUpdateCount: state.errorUpdateCount + 1, + errorUpdatedAt: Date.now(), + fetchFailureCount: state.fetchFailureCount + 1, + fetchFailureReason: error, + fetchStatus: "idle", + status: "error", + // flag existing data as invalidated if we get a background error + // note that "no data" always means stale so we can set unconditionally here + isInvalidated: true + }; + case "invalidate": + return { + ...state, + isInvalidated: true + }; + case "setState": + return { + ...state, + ...action.state + }; + } + }; + this.state = reducer(this.state); + import_notifyManager.notifyManager.batch(() => { + this.observers.forEach((observer) => { + observer.onQueryUpdate(); + }); + this.#cache.notify({ query: this, type: "updated", action }); + }); + } +}; +function fetchState(data, options) { + return { + fetchFailureCount: 0, + fetchFailureReason: null, + fetchStatus: (0, import_retryer.canFetch)(options.networkMode) ? "fetching" : "paused", + ...data === void 0 && { + error: null, + status: "pending" + } + }; +} +function successState(data, dataUpdatedAt) { + return { + data, + dataUpdatedAt: dataUpdatedAt ?? Date.now(), + error: null, + isInvalidated: false, + status: "success" + }; +} +function getDefaultState(options) { + const data = typeof options.initialData === "function" ? options.initialData() : options.initialData; + const hasData = data !== void 0; + const initialDataUpdatedAt = hasData ? typeof options.initialDataUpdatedAt === "function" ? options.initialDataUpdatedAt() : options.initialDataUpdatedAt : 0; + return { + data, + dataUpdateCount: 0, + dataUpdatedAt: hasData ? initialDataUpdatedAt ?? Date.now() : 0, + error: null, + errorUpdateCount: 0, + errorUpdatedAt: 0, + fetchFailureCount: 0, + fetchFailureReason: null, + fetchMeta: null, + isInvalidated: false, + status: hasData ? "success" : "pending", + fetchStatus: "idle" + }; +} +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + Query, + fetchState +}); +//# sourceMappingURL=query.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/query.cjs.map b/node_modules/@tanstack/query-core/build/modern/query.cjs.map new file mode 100644 index 0000000..d6942c5 --- /dev/null +++ b/node_modules/@tanstack/query-core/build/modern/query.cjs.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/query.ts"],"sourcesContent":["import {\n ensureQueryFn,\n noop,\n replaceData,\n resolveEnabled,\n resolveStaleTime,\n skipToken,\n timeUntilStale,\n} from './utils'\nimport { notifyManager } from './notifyManager'\nimport { CancelledError, canFetch, createRetryer } from './retryer'\nimport { Removable } from './removable'\nimport type { QueryCache } from './queryCache'\nimport type { QueryClient } from './queryClient'\nimport type {\n CancelOptions,\n DefaultError,\n FetchStatus,\n InitialDataFunction,\n OmitKeyof,\n QueryFunctionContext,\n QueryKey,\n QueryMeta,\n QueryOptions,\n QueryStatus,\n SetDataOptions,\n StaleTime,\n} from './types'\nimport type { QueryObserver } from './queryObserver'\nimport type { Retryer } from './retryer'\n\n// TYPES\n\ninterface QueryConfig<\n TQueryFnData,\n TError,\n TData,\n TQueryKey extends QueryKey = QueryKey,\n> {\n client: QueryClient\n queryKey: TQueryKey\n queryHash: string\n options?: QueryOptions\n defaultOptions?: QueryOptions\n state?: QueryState\n}\n\nexport interface QueryState {\n data: TData | undefined\n dataUpdateCount: number\n dataUpdatedAt: number\n error: TError | null\n errorUpdateCount: number\n errorUpdatedAt: number\n fetchFailureCount: number\n fetchFailureReason: TError | null\n fetchMeta: FetchMeta | null\n isInvalidated: boolean\n status: QueryStatus\n fetchStatus: FetchStatus\n}\n\nexport interface FetchContext<\n TQueryFnData,\n TError,\n TData,\n TQueryKey extends QueryKey = QueryKey,\n> {\n fetchFn: () => unknown | Promise\n fetchOptions?: FetchOptions\n signal: AbortSignal\n options: QueryOptions\n client: QueryClient\n queryKey: TQueryKey\n state: QueryState\n}\n\nexport interface QueryBehavior<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> {\n onFetch: (\n context: FetchContext,\n query: Query,\n ) => void\n}\n\nexport type FetchDirection = 'forward' | 'backward'\n\nexport interface FetchMeta {\n fetchMore?: { direction: FetchDirection }\n}\n\nexport interface FetchOptions {\n cancelRefetch?: boolean\n meta?: FetchMeta\n initialPromise?: Promise\n}\n\ninterface FailedAction {\n type: 'failed'\n failureCount: number\n error: TError\n}\n\ninterface FetchAction {\n type: 'fetch'\n meta?: FetchMeta\n}\n\ninterface SuccessAction {\n data: TData | undefined\n type: 'success'\n dataUpdatedAt?: number\n manual?: boolean\n}\n\ninterface ErrorAction {\n type: 'error'\n error: TError\n}\n\ninterface InvalidateAction {\n type: 'invalidate'\n}\n\ninterface PauseAction {\n type: 'pause'\n}\n\ninterface ContinueAction {\n type: 'continue'\n}\n\ninterface SetStateAction {\n type: 'setState'\n state: Partial>\n setStateOptions?: SetStateOptions\n}\n\nexport type Action =\n | ContinueAction\n | ErrorAction\n | FailedAction\n | FetchAction\n | InvalidateAction\n | PauseAction\n | SetStateAction\n | SuccessAction\n\nexport interface SetStateOptions {\n meta?: any\n}\n\n// CLASS\n\nexport class Query<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> extends Removable {\n queryKey: TQueryKey\n queryHash: string\n options!: QueryOptions\n state: QueryState\n\n #initialState: QueryState\n #revertState?: QueryState\n #cache: QueryCache\n #client: QueryClient\n #retryer?: Retryer\n observers: Array>\n #defaultOptions?: QueryOptions\n #abortSignalConsumed: boolean\n\n constructor(config: QueryConfig) {\n super()\n\n this.#abortSignalConsumed = false\n this.#defaultOptions = config.defaultOptions\n this.setOptions(config.options)\n this.observers = []\n this.#client = config.client\n this.#cache = this.#client.getQueryCache()\n this.queryKey = config.queryKey\n this.queryHash = config.queryHash\n this.#initialState = getDefaultState(this.options)\n this.state = config.state ?? this.#initialState\n this.scheduleGc()\n }\n get meta(): QueryMeta | undefined {\n return this.options.meta\n }\n\n get promise(): Promise | undefined {\n return this.#retryer?.promise\n }\n\n setOptions(\n options?: QueryOptions,\n ): void {\n this.options = { ...this.#defaultOptions, ...options }\n\n this.updateGcTime(this.options.gcTime)\n\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n if (this.state && this.state.data === undefined) {\n const defaultState = getDefaultState(this.options)\n if (defaultState.data !== undefined) {\n this.setState(\n successState(defaultState.data, defaultState.dataUpdatedAt),\n )\n this.#initialState = defaultState\n }\n }\n }\n\n protected optionalRemove() {\n if (!this.observers.length && this.state.fetchStatus === 'idle') {\n this.#cache.remove(this)\n }\n }\n\n setData(\n newData: TData,\n options?: SetDataOptions & { manual: boolean },\n ): TData {\n const data = replaceData(this.state.data, newData, this.options)\n\n // Set data and mark it as cached\n this.#dispatch({\n data,\n type: 'success',\n dataUpdatedAt: options?.updatedAt,\n manual: options?.manual,\n })\n\n return data\n }\n\n setState(\n state: Partial>,\n setStateOptions?: SetStateOptions,\n ): void {\n this.#dispatch({ type: 'setState', state, setStateOptions })\n }\n\n cancel(options?: CancelOptions): Promise {\n const promise = this.#retryer?.promise\n this.#retryer?.cancel(options)\n return promise ? promise.then(noop).catch(noop) : Promise.resolve()\n }\n\n destroy(): void {\n super.destroy()\n\n this.cancel({ silent: true })\n }\n\n reset(): void {\n this.destroy()\n this.setState(this.#initialState)\n }\n\n isActive(): boolean {\n return this.observers.some(\n (observer) => resolveEnabled(observer.options.enabled, this) !== false,\n )\n }\n\n isDisabled(): boolean {\n if (this.getObserversCount() > 0) {\n return !this.isActive()\n }\n // if a query has no observers, it should still be considered disabled if it never attempted a fetch\n return (\n this.options.queryFn === skipToken ||\n this.state.dataUpdateCount + this.state.errorUpdateCount === 0\n )\n }\n\n isStatic(): boolean {\n if (this.getObserversCount() > 0) {\n return this.observers.some(\n (observer) =>\n resolveStaleTime(observer.options.staleTime, this) === 'static',\n )\n }\n\n return false\n }\n\n isStale(): boolean {\n // check observers first, their `isStale` has the source of truth\n // calculated with `isStaleByTime` and it takes `enabled` into account\n if (this.getObserversCount() > 0) {\n return this.observers.some(\n (observer) => observer.getCurrentResult().isStale,\n )\n }\n\n return this.state.data === undefined || this.state.isInvalidated\n }\n\n isStaleByTime(staleTime: StaleTime = 0): boolean {\n // no data is always stale\n if (this.state.data === undefined) {\n return true\n }\n // static is never stale\n if (staleTime === 'static') {\n return false\n }\n // if the query is invalidated, it is stale\n if (this.state.isInvalidated) {\n return true\n }\n\n return !timeUntilStale(this.state.dataUpdatedAt, staleTime)\n }\n\n onFocus(): void {\n const observer = this.observers.find((x) => x.shouldFetchOnWindowFocus())\n\n observer?.refetch({ cancelRefetch: false })\n\n // Continue fetch if currently paused\n this.#retryer?.continue()\n }\n\n onOnline(): void {\n const observer = this.observers.find((x) => x.shouldFetchOnReconnect())\n\n observer?.refetch({ cancelRefetch: false })\n\n // Continue fetch if currently paused\n this.#retryer?.continue()\n }\n\n addObserver(observer: QueryObserver): void {\n if (!this.observers.includes(observer)) {\n this.observers.push(observer)\n\n // Stop the query from being garbage collected\n this.clearGcTimeout()\n\n this.#cache.notify({ type: 'observerAdded', query: this, observer })\n }\n }\n\n removeObserver(observer: QueryObserver): void {\n if (this.observers.includes(observer)) {\n this.observers = this.observers.filter((x) => x !== observer)\n\n if (!this.observers.length) {\n // If the transport layer does not support cancellation\n // we'll let the query continue so the result can be cached\n if (this.#retryer) {\n if (this.#abortSignalConsumed) {\n this.#retryer.cancel({ revert: true })\n } else {\n this.#retryer.cancelRetry()\n }\n }\n\n this.scheduleGc()\n }\n\n this.#cache.notify({ type: 'observerRemoved', query: this, observer })\n }\n }\n\n getObserversCount(): number {\n return this.observers.length\n }\n\n invalidate(): void {\n if (!this.state.isInvalidated) {\n this.#dispatch({ type: 'invalidate' })\n }\n }\n\n async fetch(\n options?: QueryOptions,\n fetchOptions?: FetchOptions,\n ): Promise {\n if (\n this.state.fetchStatus !== 'idle' &&\n // If the promise in the retryer is already rejected, we have to definitely\n // re-start the fetch; there is a chance that the query is still in a\n // pending state when that happens\n this.#retryer?.status() !== 'rejected'\n ) {\n if (this.state.data !== undefined && fetchOptions?.cancelRefetch) {\n // Silently cancel current fetch if the user wants to cancel refetch\n this.cancel({ silent: true })\n } else if (this.#retryer) {\n // make sure that retries that were potentially cancelled due to unmounts can continue\n this.#retryer.continueRetry()\n // Return current promise if we are already fetching\n return this.#retryer.promise\n }\n }\n\n // Update config if passed, otherwise the config from the last execution is used\n if (options) {\n this.setOptions(options)\n }\n\n // Use the options from the first observer with a query function if no function is found.\n // This can happen when the query is hydrated or created with setQueryData.\n if (!this.options.queryFn) {\n const observer = this.observers.find((x) => x.options.queryFn)\n if (observer) {\n this.setOptions(observer.options)\n }\n }\n\n if (process.env.NODE_ENV !== 'production') {\n if (!Array.isArray(this.options.queryKey)) {\n console.error(\n `As of v4, queryKey needs to be an Array. If you are using a string like 'repoData', please change it to an Array, e.g. ['repoData']`,\n )\n }\n }\n\n const abortController = new AbortController()\n\n // Adds an enumerable signal property to the object that\n // which sets abortSignalConsumed to true when the signal\n // is read.\n const addSignalProperty = (object: unknown) => {\n Object.defineProperty(object, 'signal', {\n enumerable: true,\n get: () => {\n this.#abortSignalConsumed = true\n return abortController.signal\n },\n })\n }\n\n // Create fetch function\n const fetchFn = () => {\n const queryFn = ensureQueryFn(this.options, fetchOptions)\n\n // Create query function context\n const createQueryFnContext = (): QueryFunctionContext => {\n const queryFnContext: OmitKeyof<\n QueryFunctionContext,\n 'signal'\n > = {\n client: this.#client,\n queryKey: this.queryKey,\n meta: this.meta,\n }\n addSignalProperty(queryFnContext)\n return queryFnContext as QueryFunctionContext\n }\n\n const queryFnContext = createQueryFnContext()\n\n this.#abortSignalConsumed = false\n if (this.options.persister) {\n return this.options.persister(\n queryFn,\n queryFnContext,\n this as unknown as Query,\n )\n }\n\n return queryFn(queryFnContext)\n }\n\n // Trigger behavior hook\n const createFetchContext = (): FetchContext<\n TQueryFnData,\n TError,\n TData,\n TQueryKey\n > => {\n const context: OmitKeyof<\n FetchContext,\n 'signal'\n > = {\n fetchOptions,\n options: this.options,\n queryKey: this.queryKey,\n client: this.#client,\n state: this.state,\n fetchFn,\n }\n\n addSignalProperty(context)\n return context as FetchContext\n }\n\n const context = createFetchContext()\n\n this.options.behavior?.onFetch(context, this as unknown as Query)\n\n // Store state in case the current fetch needs to be reverted\n this.#revertState = this.state\n\n // Set to fetching state if not already in it\n if (\n this.state.fetchStatus === 'idle' ||\n this.state.fetchMeta !== context.fetchOptions?.meta\n ) {\n this.#dispatch({ type: 'fetch', meta: context.fetchOptions?.meta })\n }\n\n // Try to fetch the data\n this.#retryer = createRetryer({\n initialPromise: fetchOptions?.initialPromise as\n | Promise\n | undefined,\n fn: context.fetchFn as () => Promise,\n onCancel: (error) => {\n if (error instanceof CancelledError && error.revert) {\n this.setState({\n ...this.#revertState,\n fetchStatus: 'idle' as const,\n })\n }\n abortController.abort()\n },\n onFail: (failureCount, error) => {\n this.#dispatch({ type: 'failed', failureCount, error })\n },\n onPause: () => {\n this.#dispatch({ type: 'pause' })\n },\n onContinue: () => {\n this.#dispatch({ type: 'continue' })\n },\n retry: context.options.retry,\n retryDelay: context.options.retryDelay,\n networkMode: context.options.networkMode,\n canRun: () => true,\n })\n\n try {\n const data = await this.#retryer.start()\n // this is more of a runtime guard\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n if (data === undefined) {\n if (process.env.NODE_ENV !== 'production') {\n console.error(\n `Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}`,\n )\n }\n throw new Error(`${this.queryHash} data is undefined`)\n }\n\n this.setData(data)\n\n // Notify cache callback\n this.#cache.config.onSuccess?.(data, this as Query)\n this.#cache.config.onSettled?.(\n data,\n this.state.error as any,\n this as Query,\n )\n return data\n } catch (error) {\n if (error instanceof CancelledError) {\n if (error.silent) {\n // silent cancellation implies a new fetch is going to be started,\n // so we piggyback onto that promise\n return this.#retryer.promise\n } else if (error.revert) {\n // transform error into reverted state data\n // if the initial fetch was cancelled, we have no data, so we have\n // to get reject with a CancelledError\n if (this.state.data === undefined) {\n throw error\n }\n return this.state.data\n }\n }\n this.#dispatch({\n type: 'error',\n error: error as TError,\n })\n\n // Notify cache callback\n this.#cache.config.onError?.(\n error as any,\n this as Query,\n )\n this.#cache.config.onSettled?.(\n this.state.data,\n error as any,\n this as Query,\n )\n\n throw error // rethrow the error for further handling\n } finally {\n // Schedule query gc after fetching\n this.scheduleGc()\n }\n }\n\n #dispatch(action: Action): void {\n const reducer = (\n state: QueryState,\n ): QueryState => {\n switch (action.type) {\n case 'failed':\n return {\n ...state,\n fetchFailureCount: action.failureCount,\n fetchFailureReason: action.error,\n }\n case 'pause':\n return {\n ...state,\n fetchStatus: 'paused',\n }\n case 'continue':\n return {\n ...state,\n fetchStatus: 'fetching',\n }\n case 'fetch':\n return {\n ...state,\n ...fetchState(state.data, this.options),\n fetchMeta: action.meta ?? null,\n }\n case 'success':\n const newState = {\n ...state,\n ...successState(action.data, action.dataUpdatedAt),\n dataUpdateCount: state.dataUpdateCount + 1,\n ...(!action.manual && {\n fetchStatus: 'idle' as const,\n fetchFailureCount: 0,\n fetchFailureReason: null,\n }),\n }\n // If fetching ends successfully, we don't need revertState as a fallback anymore.\n // For manual updates, capture the state to revert to it in case of a cancellation.\n this.#revertState = action.manual ? newState : undefined\n\n return newState\n case 'error':\n const error = action.error\n return {\n ...state,\n error,\n errorUpdateCount: state.errorUpdateCount + 1,\n errorUpdatedAt: Date.now(),\n fetchFailureCount: state.fetchFailureCount + 1,\n fetchFailureReason: error,\n fetchStatus: 'idle',\n status: 'error',\n // flag existing data as invalidated if we get a background error\n // note that \"no data\" always means stale so we can set unconditionally here\n isInvalidated: true,\n }\n case 'invalidate':\n return {\n ...state,\n isInvalidated: true,\n }\n case 'setState':\n return {\n ...state,\n ...action.state,\n }\n }\n }\n\n this.state = reducer(this.state)\n\n notifyManager.batch(() => {\n this.observers.forEach((observer) => {\n observer.onQueryUpdate()\n })\n\n this.#cache.notify({ query: this, type: 'updated', action })\n })\n }\n}\n\nexport function fetchState<\n TQueryFnData,\n TError,\n TData,\n TQueryKey extends QueryKey,\n>(\n data: TData | undefined,\n options: QueryOptions,\n) {\n return {\n fetchFailureCount: 0,\n fetchFailureReason: null,\n fetchStatus: canFetch(options.networkMode) ? 'fetching' : 'paused',\n ...(data === undefined &&\n ({\n error: null,\n status: 'pending',\n } as const)),\n } as const\n}\n\nfunction successState(data: TData | undefined, dataUpdatedAt?: number) {\n return {\n data,\n dataUpdatedAt: dataUpdatedAt ?? Date.now(),\n error: null,\n isInvalidated: false,\n status: 'success' as const,\n }\n}\n\nfunction getDefaultState<\n TQueryFnData,\n TError,\n TData,\n TQueryKey extends QueryKey,\n>(\n options: QueryOptions,\n): QueryState {\n const data =\n typeof options.initialData === 'function'\n ? (options.initialData as InitialDataFunction)()\n : options.initialData\n\n const hasData = data !== undefined\n\n const initialDataUpdatedAt = hasData\n ? typeof options.initialDataUpdatedAt === 'function'\n ? options.initialDataUpdatedAt()\n : options.initialDataUpdatedAt\n : 0\n\n return {\n data,\n dataUpdateCount: 0,\n dataUpdatedAt: hasData ? (initialDataUpdatedAt ?? Date.now()) : 0,\n error: null,\n errorUpdateCount: 0,\n errorUpdatedAt: 0,\n fetchFailureCount: 0,\n fetchFailureReason: null,\n fetchMeta: null,\n isInvalidated: false,\n status: hasData ? 'success' : 'pending',\n fetchStatus: 'idle',\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAQO;AACP,2BAA8B;AAC9B,qBAAwD;AACxD,uBAA0B;AAmJnB,IAAM,QAAN,cAKG,2BAAU;AAAA,EAMlB;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;AACxB,WAAK,UAAU,QAAQ,CAAC,aAAa;AACnC,iBAAS,cAAc;AAAA,MACzB,CAAC;AAED,WAAK,OAAO,OAAO,EAAE,OAAO,MAAM,MAAM,WAAW,OAAO,CAAC;AAAA,IAC7D,CAAC;AAAA,EACH;AACF;AAEO,SAAS,WAMd,MACA,SACA;AACA,SAAO;AAAA,IACL,mBAAmB;AAAA,IACnB,oBAAoB;AAAA,IACpB,iBAAa,yBAAS,QAAQ,WAAW,IAAI,aAAa;AAAA,IAC1D,GAAI,SAAS,UACV;AAAA,MACC,OAAO;AAAA,MACP,QAAQ;AAAA,IACV;AAAA,EACJ;AACF;AAEA,SAAS,aAAoB,MAAyB,eAAwB;AAC5E,SAAO;AAAA,IACL;AAAA,IACA,eAAe,iBAAiB,KAAK,IAAI;AAAA,IACzC,OAAO;AAAA,IACP,eAAe;AAAA,IACf,QAAQ;AAAA,EACV;AACF;AAEA,SAAS,gBAMP,SAC2B;AAC3B,QAAM,OACJ,OAAO,QAAQ,gBAAgB,aAC1B,QAAQ,YAA2C,IACpD,QAAQ;AAEd,QAAM,UAAU,SAAS;AAEzB,QAAM,uBAAuB,UACzB,OAAO,QAAQ,yBAAyB,aACtC,QAAQ,qBAAqB,IAC7B,QAAQ,uBACV;AAEJ,SAAO;AAAA,IACL;AAAA,IACA,iBAAiB;AAAA,IACjB,eAAe,UAAW,wBAAwB,KAAK,IAAI,IAAK;AAAA,IAChE,OAAO;AAAA,IACP,kBAAkB;AAAA,IAClB,gBAAgB;AAAA,IAChB,mBAAmB;AAAA,IACnB,oBAAoB;AAAA,IACpB,WAAW;AAAA,IACX,eAAe;AAAA,IACf,QAAQ,UAAU,YAAY;AAAA,IAC9B,aAAa;AAAA,EACf;AACF;","names":["queryFnContext","context"]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/query.d.cts b/node_modules/@tanstack/query-core/build/modern/query.d.cts new file mode 100644 index 0000000..c5cd428 --- /dev/null +++ b/node_modules/@tanstack/query-core/build/modern/query.d.cts @@ -0,0 +1,3 @@ +import './removable.cjs'; +export { bg as Action, bc as FetchContext, bd as FetchDirection, be as FetchMeta, bf as FetchOptions, z as Query, bb as QueryBehavior, A as QueryState, bh as SetStateOptions, bi as fetchState } from './hydration-uphG6M-i.cjs'; +import './subscribable.cjs'; diff --git a/node_modules/@tanstack/query-core/build/modern/query.d.ts b/node_modules/@tanstack/query-core/build/modern/query.d.ts new file mode 100644 index 0000000..2a8a1e0 --- /dev/null +++ b/node_modules/@tanstack/query-core/build/modern/query.d.ts @@ -0,0 +1,3 @@ +import './removable.js'; +export { bg as Action, bc as FetchContext, bd as FetchDirection, be as FetchMeta, bf as FetchOptions, z as Query, bb as QueryBehavior, A as QueryState, bh as SetStateOptions, bi as fetchState } from './hydration-BlEVG2Lp.js'; +import './subscribable.js'; diff --git a/node_modules/@tanstack/query-core/build/modern/query.js b/node_modules/@tanstack/query-core/build/modern/query.js new file mode 100644 index 0000000..41b7b03 --- /dev/null +++ b/node_modules/@tanstack/query-core/build/modern/query.js @@ -0,0 +1,434 @@ +// src/query.ts +import { + ensureQueryFn, + noop, + replaceData, + resolveEnabled, + resolveStaleTime, + skipToken, + timeUntilStale +} from "./utils.js"; +import { notifyManager } from "./notifyManager.js"; +import { CancelledError, canFetch, createRetryer } from "./retryer.js"; +import { Removable } from "./removable.js"; +var Query = class extends Removable { + #initialState; + #revertState; + #cache; + #client; + #retryer; + #defaultOptions; + #abortSignalConsumed; + constructor(config) { + super(); + this.#abortSignalConsumed = false; + this.#defaultOptions = config.defaultOptions; + this.setOptions(config.options); + this.observers = []; + this.#client = config.client; + this.#cache = this.#client.getQueryCache(); + this.queryKey = config.queryKey; + this.queryHash = config.queryHash; + this.#initialState = getDefaultState(this.options); + this.state = config.state ?? this.#initialState; + this.scheduleGc(); + } + get meta() { + return this.options.meta; + } + get promise() { + return this.#retryer?.promise; + } + setOptions(options) { + this.options = { ...this.#defaultOptions, ...options }; + this.updateGcTime(this.options.gcTime); + if (this.state && this.state.data === void 0) { + const defaultState = getDefaultState(this.options); + if (defaultState.data !== void 0) { + this.setState( + successState(defaultState.data, defaultState.dataUpdatedAt) + ); + this.#initialState = defaultState; + } + } + } + optionalRemove() { + if (!this.observers.length && this.state.fetchStatus === "idle") { + this.#cache.remove(this); + } + } + setData(newData, options) { + const data = replaceData(this.state.data, newData, this.options); + this.#dispatch({ + data, + type: "success", + dataUpdatedAt: options?.updatedAt, + manual: options?.manual + }); + return data; + } + setState(state, setStateOptions) { + this.#dispatch({ type: "setState", state, setStateOptions }); + } + cancel(options) { + const promise = this.#retryer?.promise; + this.#retryer?.cancel(options); + return promise ? promise.then(noop).catch(noop) : Promise.resolve(); + } + destroy() { + super.destroy(); + this.cancel({ silent: true }); + } + reset() { + this.destroy(); + this.setState(this.#initialState); + } + isActive() { + return this.observers.some( + (observer) => resolveEnabled(observer.options.enabled, this) !== false + ); + } + isDisabled() { + if (this.getObserversCount() > 0) { + return !this.isActive(); + } + return this.options.queryFn === skipToken || this.state.dataUpdateCount + this.state.errorUpdateCount === 0; + } + isStatic() { + if (this.getObserversCount() > 0) { + return this.observers.some( + (observer) => resolveStaleTime(observer.options.staleTime, this) === "static" + ); + } + return false; + } + isStale() { + if (this.getObserversCount() > 0) { + return this.observers.some( + (observer) => observer.getCurrentResult().isStale + ); + } + return this.state.data === void 0 || this.state.isInvalidated; + } + isStaleByTime(staleTime = 0) { + if (this.state.data === void 0) { + return true; + } + if (staleTime === "static") { + return false; + } + if (this.state.isInvalidated) { + return true; + } + return !timeUntilStale(this.state.dataUpdatedAt, staleTime); + } + onFocus() { + const observer = this.observers.find((x) => x.shouldFetchOnWindowFocus()); + observer?.refetch({ cancelRefetch: false }); + this.#retryer?.continue(); + } + onOnline() { + const observer = this.observers.find((x) => x.shouldFetchOnReconnect()); + observer?.refetch({ cancelRefetch: false }); + this.#retryer?.continue(); + } + addObserver(observer) { + if (!this.observers.includes(observer)) { + this.observers.push(observer); + this.clearGcTimeout(); + this.#cache.notify({ type: "observerAdded", query: this, observer }); + } + } + removeObserver(observer) { + if (this.observers.includes(observer)) { + this.observers = this.observers.filter((x) => x !== observer); + if (!this.observers.length) { + if (this.#retryer) { + if (this.#abortSignalConsumed) { + this.#retryer.cancel({ revert: true }); + } else { + this.#retryer.cancelRetry(); + } + } + this.scheduleGc(); + } + this.#cache.notify({ type: "observerRemoved", query: this, observer }); + } + } + getObserversCount() { + return this.observers.length; + } + invalidate() { + if (!this.state.isInvalidated) { + this.#dispatch({ type: "invalidate" }); + } + } + async fetch(options, fetchOptions) { + if (this.state.fetchStatus !== "idle" && // If the promise in the retryer is already rejected, we have to definitely + // re-start the fetch; there is a chance that the query is still in a + // pending state when that happens + this.#retryer?.status() !== "rejected") { + if (this.state.data !== void 0 && fetchOptions?.cancelRefetch) { + this.cancel({ silent: true }); + } else if (this.#retryer) { + this.#retryer.continueRetry(); + return this.#retryer.promise; + } + } + if (options) { + this.setOptions(options); + } + if (!this.options.queryFn) { + const observer = this.observers.find((x) => x.options.queryFn); + if (observer) { + this.setOptions(observer.options); + } + } + if (process.env.NODE_ENV !== "production") { + if (!Array.isArray(this.options.queryKey)) { + console.error( + `As of v4, queryKey needs to be an Array. If you are using a string like 'repoData', please change it to an Array, e.g. ['repoData']` + ); + } + } + const abortController = new AbortController(); + const addSignalProperty = (object) => { + Object.defineProperty(object, "signal", { + enumerable: true, + get: () => { + this.#abortSignalConsumed = true; + return abortController.signal; + } + }); + }; + const fetchFn = () => { + const queryFn = ensureQueryFn(this.options, fetchOptions); + const createQueryFnContext = () => { + const queryFnContext2 = { + client: this.#client, + queryKey: this.queryKey, + meta: this.meta + }; + addSignalProperty(queryFnContext2); + return queryFnContext2; + }; + const queryFnContext = createQueryFnContext(); + this.#abortSignalConsumed = false; + if (this.options.persister) { + return this.options.persister( + queryFn, + queryFnContext, + this + ); + } + return queryFn(queryFnContext); + }; + const createFetchContext = () => { + const context2 = { + fetchOptions, + options: this.options, + queryKey: this.queryKey, + client: this.#client, + state: this.state, + fetchFn + }; + addSignalProperty(context2); + return context2; + }; + const context = createFetchContext(); + this.options.behavior?.onFetch(context, this); + this.#revertState = this.state; + if (this.state.fetchStatus === "idle" || this.state.fetchMeta !== context.fetchOptions?.meta) { + this.#dispatch({ type: "fetch", meta: context.fetchOptions?.meta }); + } + this.#retryer = createRetryer({ + initialPromise: fetchOptions?.initialPromise, + fn: context.fetchFn, + onCancel: (error) => { + if (error instanceof CancelledError && error.revert) { + this.setState({ + ...this.#revertState, + fetchStatus: "idle" + }); + } + abortController.abort(); + }, + onFail: (failureCount, error) => { + this.#dispatch({ type: "failed", failureCount, error }); + }, + onPause: () => { + this.#dispatch({ type: "pause" }); + }, + onContinue: () => { + this.#dispatch({ type: "continue" }); + }, + retry: context.options.retry, + retryDelay: context.options.retryDelay, + networkMode: context.options.networkMode, + canRun: () => true + }); + try { + const data = await this.#retryer.start(); + if (data === void 0) { + if (process.env.NODE_ENV !== "production") { + console.error( + `Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}` + ); + } + throw new Error(`${this.queryHash} data is undefined`); + } + this.setData(data); + this.#cache.config.onSuccess?.(data, this); + this.#cache.config.onSettled?.( + data, + this.state.error, + this + ); + return data; + } catch (error) { + if (error instanceof CancelledError) { + if (error.silent) { + return this.#retryer.promise; + } else if (error.revert) { + if (this.state.data === void 0) { + throw error; + } + return this.state.data; + } + } + this.#dispatch({ + type: "error", + error + }); + this.#cache.config.onError?.( + error, + this + ); + this.#cache.config.onSettled?.( + this.state.data, + error, + this + ); + throw error; + } finally { + this.scheduleGc(); + } + } + #dispatch(action) { + const reducer = (state) => { + switch (action.type) { + case "failed": + return { + ...state, + fetchFailureCount: action.failureCount, + fetchFailureReason: action.error + }; + case "pause": + return { + ...state, + fetchStatus: "paused" + }; + case "continue": + return { + ...state, + fetchStatus: "fetching" + }; + case "fetch": + return { + ...state, + ...fetchState(state.data, this.options), + fetchMeta: action.meta ?? null + }; + case "success": + const newState = { + ...state, + ...successState(action.data, action.dataUpdatedAt), + dataUpdateCount: state.dataUpdateCount + 1, + ...!action.manual && { + fetchStatus: "idle", + fetchFailureCount: 0, + fetchFailureReason: null + } + }; + this.#revertState = action.manual ? newState : void 0; + return newState; + case "error": + const error = action.error; + return { + ...state, + error, + errorUpdateCount: state.errorUpdateCount + 1, + errorUpdatedAt: Date.now(), + fetchFailureCount: state.fetchFailureCount + 1, + fetchFailureReason: error, + fetchStatus: "idle", + status: "error", + // flag existing data as invalidated if we get a background error + // note that "no data" always means stale so we can set unconditionally here + isInvalidated: true + }; + case "invalidate": + return { + ...state, + isInvalidated: true + }; + case "setState": + return { + ...state, + ...action.state + }; + } + }; + this.state = reducer(this.state); + notifyManager.batch(() => { + this.observers.forEach((observer) => { + observer.onQueryUpdate(); + }); + this.#cache.notify({ query: this, type: "updated", action }); + }); + } +}; +function fetchState(data, options) { + return { + fetchFailureCount: 0, + fetchFailureReason: null, + fetchStatus: canFetch(options.networkMode) ? "fetching" : "paused", + ...data === void 0 && { + error: null, + status: "pending" + } + }; +} +function successState(data, dataUpdatedAt) { + return { + data, + dataUpdatedAt: dataUpdatedAt ?? Date.now(), + error: null, + isInvalidated: false, + status: "success" + }; +} +function getDefaultState(options) { + const data = typeof options.initialData === "function" ? options.initialData() : options.initialData; + const hasData = data !== void 0; + const initialDataUpdatedAt = hasData ? typeof options.initialDataUpdatedAt === "function" ? options.initialDataUpdatedAt() : options.initialDataUpdatedAt : 0; + return { + data, + dataUpdateCount: 0, + dataUpdatedAt: hasData ? initialDataUpdatedAt ?? Date.now() : 0, + error: null, + errorUpdateCount: 0, + errorUpdatedAt: 0, + fetchFailureCount: 0, + fetchFailureReason: null, + fetchMeta: null, + isInvalidated: false, + status: hasData ? "success" : "pending", + fetchStatus: "idle" + }; +} +export { + Query, + fetchState +}; +//# sourceMappingURL=query.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/query.js.map b/node_modules/@tanstack/query-core/build/modern/query.js.map new file mode 100644 index 0000000..ca12f12 --- /dev/null +++ b/node_modules/@tanstack/query-core/build/modern/query.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/query.ts"],"sourcesContent":["import {\n ensureQueryFn,\n noop,\n replaceData,\n resolveEnabled,\n resolveStaleTime,\n skipToken,\n timeUntilStale,\n} from './utils'\nimport { notifyManager } from './notifyManager'\nimport { CancelledError, canFetch, createRetryer } from './retryer'\nimport { Removable } from './removable'\nimport type { QueryCache } from './queryCache'\nimport type { QueryClient } from './queryClient'\nimport type {\n CancelOptions,\n DefaultError,\n FetchStatus,\n InitialDataFunction,\n OmitKeyof,\n QueryFunctionContext,\n QueryKey,\n QueryMeta,\n QueryOptions,\n QueryStatus,\n SetDataOptions,\n StaleTime,\n} from './types'\nimport type { QueryObserver } from './queryObserver'\nimport type { Retryer } from './retryer'\n\n// TYPES\n\ninterface QueryConfig<\n TQueryFnData,\n TError,\n TData,\n TQueryKey extends QueryKey = QueryKey,\n> {\n client: QueryClient\n queryKey: TQueryKey\n queryHash: string\n options?: QueryOptions\n defaultOptions?: QueryOptions\n state?: QueryState\n}\n\nexport interface QueryState {\n data: TData | undefined\n dataUpdateCount: number\n dataUpdatedAt: number\n error: TError | null\n errorUpdateCount: number\n errorUpdatedAt: number\n fetchFailureCount: number\n fetchFailureReason: TError | null\n fetchMeta: FetchMeta | null\n isInvalidated: boolean\n status: QueryStatus\n fetchStatus: FetchStatus\n}\n\nexport interface FetchContext<\n TQueryFnData,\n TError,\n TData,\n TQueryKey extends QueryKey = QueryKey,\n> {\n fetchFn: () => unknown | Promise\n fetchOptions?: FetchOptions\n signal: AbortSignal\n options: QueryOptions\n client: QueryClient\n queryKey: TQueryKey\n state: QueryState\n}\n\nexport interface QueryBehavior<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> {\n onFetch: (\n context: FetchContext,\n query: Query,\n ) => void\n}\n\nexport type FetchDirection = 'forward' | 'backward'\n\nexport interface FetchMeta {\n fetchMore?: { direction: FetchDirection }\n}\n\nexport interface FetchOptions {\n cancelRefetch?: boolean\n meta?: FetchMeta\n initialPromise?: Promise\n}\n\ninterface FailedAction {\n type: 'failed'\n failureCount: number\n error: TError\n}\n\ninterface FetchAction {\n type: 'fetch'\n meta?: FetchMeta\n}\n\ninterface SuccessAction {\n data: TData | undefined\n type: 'success'\n dataUpdatedAt?: number\n manual?: boolean\n}\n\ninterface ErrorAction {\n type: 'error'\n error: TError\n}\n\ninterface InvalidateAction {\n type: 'invalidate'\n}\n\ninterface PauseAction {\n type: 'pause'\n}\n\ninterface ContinueAction {\n type: 'continue'\n}\n\ninterface SetStateAction {\n type: 'setState'\n state: Partial>\n setStateOptions?: SetStateOptions\n}\n\nexport type Action =\n | ContinueAction\n | ErrorAction\n | FailedAction\n | FetchAction\n | InvalidateAction\n | PauseAction\n | SetStateAction\n | SuccessAction\n\nexport interface SetStateOptions {\n meta?: any\n}\n\n// CLASS\n\nexport class Query<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> extends Removable {\n queryKey: TQueryKey\n queryHash: string\n options!: QueryOptions\n state: QueryState\n\n #initialState: QueryState\n #revertState?: QueryState\n #cache: QueryCache\n #client: QueryClient\n #retryer?: Retryer\n observers: Array>\n #defaultOptions?: QueryOptions\n #abortSignalConsumed: boolean\n\n constructor(config: QueryConfig) {\n super()\n\n this.#abortSignalConsumed = false\n this.#defaultOptions = config.defaultOptions\n this.setOptions(config.options)\n this.observers = []\n this.#client = config.client\n this.#cache = this.#client.getQueryCache()\n this.queryKey = config.queryKey\n this.queryHash = config.queryHash\n this.#initialState = getDefaultState(this.options)\n this.state = config.state ?? this.#initialState\n this.scheduleGc()\n }\n get meta(): QueryMeta | undefined {\n return this.options.meta\n }\n\n get promise(): Promise | undefined {\n return this.#retryer?.promise\n }\n\n setOptions(\n options?: QueryOptions,\n ): void {\n this.options = { ...this.#defaultOptions, ...options }\n\n this.updateGcTime(this.options.gcTime)\n\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n if (this.state && this.state.data === undefined) {\n const defaultState = getDefaultState(this.options)\n if (defaultState.data !== undefined) {\n this.setState(\n successState(defaultState.data, defaultState.dataUpdatedAt),\n )\n this.#initialState = defaultState\n }\n }\n }\n\n protected optionalRemove() {\n if (!this.observers.length && this.state.fetchStatus === 'idle') {\n this.#cache.remove(this)\n }\n }\n\n setData(\n newData: TData,\n options?: SetDataOptions & { manual: boolean },\n ): TData {\n const data = replaceData(this.state.data, newData, this.options)\n\n // Set data and mark it as cached\n this.#dispatch({\n data,\n type: 'success',\n dataUpdatedAt: options?.updatedAt,\n manual: options?.manual,\n })\n\n return data\n }\n\n setState(\n state: Partial>,\n setStateOptions?: SetStateOptions,\n ): void {\n this.#dispatch({ type: 'setState', state, setStateOptions })\n }\n\n cancel(options?: CancelOptions): Promise {\n const promise = this.#retryer?.promise\n this.#retryer?.cancel(options)\n return promise ? promise.then(noop).catch(noop) : Promise.resolve()\n }\n\n destroy(): void {\n super.destroy()\n\n this.cancel({ silent: true })\n }\n\n reset(): void {\n this.destroy()\n this.setState(this.#initialState)\n }\n\n isActive(): boolean {\n return this.observers.some(\n (observer) => resolveEnabled(observer.options.enabled, this) !== false,\n )\n }\n\n isDisabled(): boolean {\n if (this.getObserversCount() > 0) {\n return !this.isActive()\n }\n // if a query has no observers, it should still be considered disabled if it never attempted a fetch\n return (\n this.options.queryFn === skipToken ||\n this.state.dataUpdateCount + this.state.errorUpdateCount === 0\n )\n }\n\n isStatic(): boolean {\n if (this.getObserversCount() > 0) {\n return this.observers.some(\n (observer) =>\n resolveStaleTime(observer.options.staleTime, this) === 'static',\n )\n }\n\n return false\n }\n\n isStale(): boolean {\n // check observers first, their `isStale` has the source of truth\n // calculated with `isStaleByTime` and it takes `enabled` into account\n if (this.getObserversCount() > 0) {\n return this.observers.some(\n (observer) => observer.getCurrentResult().isStale,\n )\n }\n\n return this.state.data === undefined || this.state.isInvalidated\n }\n\n isStaleByTime(staleTime: StaleTime = 0): boolean {\n // no data is always stale\n if (this.state.data === undefined) {\n return true\n }\n // static is never stale\n if (staleTime === 'static') {\n return false\n }\n // if the query is invalidated, it is stale\n if (this.state.isInvalidated) {\n return true\n }\n\n return !timeUntilStale(this.state.dataUpdatedAt, staleTime)\n }\n\n onFocus(): void {\n const observer = this.observers.find((x) => x.shouldFetchOnWindowFocus())\n\n observer?.refetch({ cancelRefetch: false })\n\n // Continue fetch if currently paused\n this.#retryer?.continue()\n }\n\n onOnline(): void {\n const observer = this.observers.find((x) => x.shouldFetchOnReconnect())\n\n observer?.refetch({ cancelRefetch: false })\n\n // Continue fetch if currently paused\n this.#retryer?.continue()\n }\n\n addObserver(observer: QueryObserver): void {\n if (!this.observers.includes(observer)) {\n this.observers.push(observer)\n\n // Stop the query from being garbage collected\n this.clearGcTimeout()\n\n this.#cache.notify({ type: 'observerAdded', query: this, observer })\n }\n }\n\n removeObserver(observer: QueryObserver): void {\n if (this.observers.includes(observer)) {\n this.observers = this.observers.filter((x) => x !== observer)\n\n if (!this.observers.length) {\n // If the transport layer does not support cancellation\n // we'll let the query continue so the result can be cached\n if (this.#retryer) {\n if (this.#abortSignalConsumed) {\n this.#retryer.cancel({ revert: true })\n } else {\n this.#retryer.cancelRetry()\n }\n }\n\n this.scheduleGc()\n }\n\n this.#cache.notify({ type: 'observerRemoved', query: this, observer })\n }\n }\n\n getObserversCount(): number {\n return this.observers.length\n }\n\n invalidate(): void {\n if (!this.state.isInvalidated) {\n this.#dispatch({ type: 'invalidate' })\n }\n }\n\n async fetch(\n options?: QueryOptions,\n fetchOptions?: FetchOptions,\n ): Promise {\n if (\n this.state.fetchStatus !== 'idle' &&\n // If the promise in the retryer is already rejected, we have to definitely\n // re-start the fetch; there is a chance that the query is still in a\n // pending state when that happens\n this.#retryer?.status() !== 'rejected'\n ) {\n if (this.state.data !== undefined && fetchOptions?.cancelRefetch) {\n // Silently cancel current fetch if the user wants to cancel refetch\n this.cancel({ silent: true })\n } else if (this.#retryer) {\n // make sure that retries that were potentially cancelled due to unmounts can continue\n this.#retryer.continueRetry()\n // Return current promise if we are already fetching\n return this.#retryer.promise\n }\n }\n\n // Update config if passed, otherwise the config from the last execution is used\n if (options) {\n this.setOptions(options)\n }\n\n // Use the options from the first observer with a query function if no function is found.\n // This can happen when the query is hydrated or created with setQueryData.\n if (!this.options.queryFn) {\n const observer = this.observers.find((x) => x.options.queryFn)\n if (observer) {\n this.setOptions(observer.options)\n }\n }\n\n if (process.env.NODE_ENV !== 'production') {\n if (!Array.isArray(this.options.queryKey)) {\n console.error(\n `As of v4, queryKey needs to be an Array. If you are using a string like 'repoData', please change it to an Array, e.g. ['repoData']`,\n )\n }\n }\n\n const abortController = new AbortController()\n\n // Adds an enumerable signal property to the object that\n // which sets abortSignalConsumed to true when the signal\n // is read.\n const addSignalProperty = (object: unknown) => {\n Object.defineProperty(object, 'signal', {\n enumerable: true,\n get: () => {\n this.#abortSignalConsumed = true\n return abortController.signal\n },\n })\n }\n\n // Create fetch function\n const fetchFn = () => {\n const queryFn = ensureQueryFn(this.options, fetchOptions)\n\n // Create query function context\n const createQueryFnContext = (): QueryFunctionContext => {\n const queryFnContext: OmitKeyof<\n QueryFunctionContext,\n 'signal'\n > = {\n client: this.#client,\n queryKey: this.queryKey,\n meta: this.meta,\n }\n addSignalProperty(queryFnContext)\n return queryFnContext as QueryFunctionContext\n }\n\n const queryFnContext = createQueryFnContext()\n\n this.#abortSignalConsumed = false\n if (this.options.persister) {\n return this.options.persister(\n queryFn,\n queryFnContext,\n this as unknown as Query,\n )\n }\n\n return queryFn(queryFnContext)\n }\n\n // Trigger behavior hook\n const createFetchContext = (): FetchContext<\n TQueryFnData,\n TError,\n TData,\n TQueryKey\n > => {\n const context: OmitKeyof<\n FetchContext,\n 'signal'\n > = {\n fetchOptions,\n options: this.options,\n queryKey: this.queryKey,\n client: this.#client,\n state: this.state,\n fetchFn,\n }\n\n addSignalProperty(context)\n return context as FetchContext\n }\n\n const context = createFetchContext()\n\n this.options.behavior?.onFetch(context, this as unknown as Query)\n\n // Store state in case the current fetch needs to be reverted\n this.#revertState = this.state\n\n // Set to fetching state if not already in it\n if (\n this.state.fetchStatus === 'idle' ||\n this.state.fetchMeta !== context.fetchOptions?.meta\n ) {\n this.#dispatch({ type: 'fetch', meta: context.fetchOptions?.meta })\n }\n\n // Try to fetch the data\n this.#retryer = createRetryer({\n initialPromise: fetchOptions?.initialPromise as\n | Promise\n | undefined,\n fn: context.fetchFn as () => Promise,\n onCancel: (error) => {\n if (error instanceof CancelledError && error.revert) {\n this.setState({\n ...this.#revertState,\n fetchStatus: 'idle' as const,\n })\n }\n abortController.abort()\n },\n onFail: (failureCount, error) => {\n this.#dispatch({ type: 'failed', failureCount, error })\n },\n onPause: () => {\n this.#dispatch({ type: 'pause' })\n },\n onContinue: () => {\n this.#dispatch({ type: 'continue' })\n },\n retry: context.options.retry,\n retryDelay: context.options.retryDelay,\n networkMode: context.options.networkMode,\n canRun: () => true,\n })\n\n try {\n const data = await this.#retryer.start()\n // this is more of a runtime guard\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n if (data === undefined) {\n if (process.env.NODE_ENV !== 'production') {\n console.error(\n `Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}`,\n )\n }\n throw new Error(`${this.queryHash} data is undefined`)\n }\n\n this.setData(data)\n\n // Notify cache callback\n this.#cache.config.onSuccess?.(data, this as Query)\n this.#cache.config.onSettled?.(\n data,\n this.state.error as any,\n this as Query,\n )\n return data\n } catch (error) {\n if (error instanceof CancelledError) {\n if (error.silent) {\n // silent cancellation implies a new fetch is going to be started,\n // so we piggyback onto that promise\n return this.#retryer.promise\n } else if (error.revert) {\n // transform error into reverted state data\n // if the initial fetch was cancelled, we have no data, so we have\n // to get reject with a CancelledError\n if (this.state.data === undefined) {\n throw error\n }\n return this.state.data\n }\n }\n this.#dispatch({\n type: 'error',\n error: error as TError,\n })\n\n // Notify cache callback\n this.#cache.config.onError?.(\n error as any,\n this as Query,\n )\n this.#cache.config.onSettled?.(\n this.state.data,\n error as any,\n this as Query,\n )\n\n throw error // rethrow the error for further handling\n } finally {\n // Schedule query gc after fetching\n this.scheduleGc()\n }\n }\n\n #dispatch(action: Action): void {\n const reducer = (\n state: QueryState,\n ): QueryState => {\n switch (action.type) {\n case 'failed':\n return {\n ...state,\n fetchFailureCount: action.failureCount,\n fetchFailureReason: action.error,\n }\n case 'pause':\n return {\n ...state,\n fetchStatus: 'paused',\n }\n case 'continue':\n return {\n ...state,\n fetchStatus: 'fetching',\n }\n case 'fetch':\n return {\n ...state,\n ...fetchState(state.data, this.options),\n fetchMeta: action.meta ?? null,\n }\n case 'success':\n const newState = {\n ...state,\n ...successState(action.data, action.dataUpdatedAt),\n dataUpdateCount: state.dataUpdateCount + 1,\n ...(!action.manual && {\n fetchStatus: 'idle' as const,\n fetchFailureCount: 0,\n fetchFailureReason: null,\n }),\n }\n // If fetching ends successfully, we don't need revertState as a fallback anymore.\n // For manual updates, capture the state to revert to it in case of a cancellation.\n this.#revertState = action.manual ? newState : undefined\n\n return newState\n case 'error':\n const error = action.error\n return {\n ...state,\n error,\n errorUpdateCount: state.errorUpdateCount + 1,\n errorUpdatedAt: Date.now(),\n fetchFailureCount: state.fetchFailureCount + 1,\n fetchFailureReason: error,\n fetchStatus: 'idle',\n status: 'error',\n // flag existing data as invalidated if we get a background error\n // note that \"no data\" always means stale so we can set unconditionally here\n isInvalidated: true,\n }\n case 'invalidate':\n return {\n ...state,\n isInvalidated: true,\n }\n case 'setState':\n return {\n ...state,\n ...action.state,\n }\n }\n }\n\n this.state = reducer(this.state)\n\n notifyManager.batch(() => {\n this.observers.forEach((observer) => {\n observer.onQueryUpdate()\n })\n\n this.#cache.notify({ query: this, type: 'updated', action })\n })\n }\n}\n\nexport function fetchState<\n TQueryFnData,\n TError,\n TData,\n TQueryKey extends QueryKey,\n>(\n data: TData | undefined,\n options: QueryOptions,\n) {\n return {\n fetchFailureCount: 0,\n fetchFailureReason: null,\n fetchStatus: canFetch(options.networkMode) ? 'fetching' : 'paused',\n ...(data === undefined &&\n ({\n error: null,\n status: 'pending',\n } as const)),\n } as const\n}\n\nfunction successState(data: TData | undefined, dataUpdatedAt?: number) {\n return {\n data,\n dataUpdatedAt: dataUpdatedAt ?? Date.now(),\n error: null,\n isInvalidated: false,\n status: 'success' as const,\n }\n}\n\nfunction getDefaultState<\n TQueryFnData,\n TError,\n TData,\n TQueryKey extends QueryKey,\n>(\n options: QueryOptions,\n): QueryState {\n const data =\n typeof options.initialData === 'function'\n ? (options.initialData as InitialDataFunction)()\n : options.initialData\n\n const hasData = data !== undefined\n\n const initialDataUpdatedAt = hasData\n ? typeof options.initialDataUpdatedAt === 'function'\n ? options.initialDataUpdatedAt()\n : options.initialDataUpdatedAt\n : 0\n\n return {\n data,\n dataUpdateCount: 0,\n dataUpdatedAt: hasData ? (initialDataUpdatedAt ?? Date.now()) : 0,\n error: null,\n errorUpdateCount: 0,\n errorUpdatedAt: 0,\n fetchFailureCount: 0,\n fetchFailureReason: null,\n fetchMeta: null,\n isInvalidated: false,\n status: hasData ? 'success' : 'pending',\n fetchStatus: 'idle',\n }\n}\n"],"mappings":";AAAA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,qBAAqB;AAC9B,SAAS,gBAAgB,UAAU,qBAAqB;AACxD,SAAS,iBAAiB;AAmJnB,IAAM,QAAN,cAKG,UAAU;AAAA,EAMlB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EAEA;AAAA,EACA;AAAA,EAEA,YAAY,QAA6D;AACvE,UAAM;AAEN,SAAK,uBAAuB;AAC5B,SAAK,kBAAkB,OAAO;AAC9B,SAAK,WAAW,OAAO,OAAO;AAC9B,SAAK,YAAY,CAAC;AAClB,SAAK,UAAU,OAAO;AACtB,SAAK,SAAS,KAAK,QA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,SAAS,QAAQ,WAAW,IAAI,aAAa;AAAA,IAC1D,GAAI,SAAS,UACV;AAAA,MACC,OAAO;AAAA,MACP,QAAQ;AAAA,IACV;AAAA,EACJ;AACF;AAEA,SAAS,aAAoB,MAAyB,eAAwB;AAC5E,SAAO;AAAA,IACL;AAAA,IACA,eAAe,iBAAiB,KAAK,IAAI;AAAA,IACzC,OAAO;AAAA,IACP,eAAe;AAAA,IACf,QAAQ;AAAA,EACV;AACF;AAEA,SAAS,gBAMP,SAC2B;AAC3B,QAAM,OACJ,OAAO,QAAQ,gBAAgB,aAC1B,QAAQ,YAA2C,IACpD,QAAQ;AAEd,QAAM,UAAU,SAAS;AAEzB,QAAM,uBAAuB,UACzB,OAAO,QAAQ,yBAAyB,aACtC,QAAQ,qBAAqB,IAC7B,QAAQ,uBACV;AAEJ,SAAO;AAAA,IACL;AAAA,IACA,iBAAiB;AAAA,IACjB,eAAe,UAAW,wBAAwB,KAAK,IAAI,IAAK;AAAA,IAChE,OAAO;AAAA,IACP,kBAAkB;AAAA,IAClB,gBAAgB;AAAA,IAChB,mBAAmB;AAAA,IACnB,oBAAoB;AAAA,IACpB,WAAW;AAAA,IACX,eAAe;AAAA,IACf,QAAQ,UAAU,YAAY;AAAA,IAC9B,aAAa;AAAA,EACf;AACF;","names":["queryFnContext","context"]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/queryCache.cjs b/node_modules/@tanstack/query-core/build/modern/queryCache.cjs new file mode 100644 index 0000000..ce63393 --- /dev/null +++ b/node_modules/@tanstack/query-core/build/modern/queryCache.cjs @@ -0,0 +1,122 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/queryCache.ts +var queryCache_exports = {}; +__export(queryCache_exports, { + QueryCache: () => QueryCache +}); +module.exports = __toCommonJS(queryCache_exports); +var import_utils = require("./utils.cjs"); +var import_query = require("./query.cjs"); +var import_notifyManager = require("./notifyManager.cjs"); +var import_subscribable = require("./subscribable.cjs"); +var QueryCache = class extends import_subscribable.Subscribable { + constructor(config = {}) { + super(); + this.config = config; + this.#queries = /* @__PURE__ */ new Map(); + } + #queries; + build(client, options, state) { + const queryKey = options.queryKey; + const queryHash = options.queryHash ?? (0, import_utils.hashQueryKeyByOptions)(queryKey, options); + let query = this.get(queryHash); + if (!query) { + query = new import_query.Query({ + client, + queryKey, + queryHash, + options: client.defaultQueryOptions(options), + state, + defaultOptions: client.getQueryDefaults(queryKey) + }); + this.add(query); + } + return query; + } + add(query) { + if (!this.#queries.has(query.queryHash)) { + this.#queries.set(query.queryHash, query); + this.notify({ + type: "added", + query + }); + } + } + remove(query) { + const queryInMap = this.#queries.get(query.queryHash); + if (queryInMap) { + query.destroy(); + if (queryInMap === query) { + this.#queries.delete(query.queryHash); + } + this.notify({ type: "removed", query }); + } + } + clear() { + import_notifyManager.notifyManager.batch(() => { + this.getAll().forEach((query) => { + this.remove(query); + }); + }); + } + get(queryHash) { + return this.#queries.get(queryHash); + } + getAll() { + return [...this.#queries.values()]; + } + find(filters) { + const defaultedFilters = { exact: true, ...filters }; + return this.getAll().find( + (query) => (0, import_utils.matchQuery)(defaultedFilters, query) + ); + } + findAll(filters = {}) { + const queries = this.getAll(); + return Object.keys(filters).length > 0 ? queries.filter((query) => (0, import_utils.matchQuery)(filters, query)) : queries; + } + notify(event) { + import_notifyManager.notifyManager.batch(() => { + this.listeners.forEach((listener) => { + listener(event); + }); + }); + } + onFocus() { + import_notifyManager.notifyManager.batch(() => { + this.getAll().forEach((query) => { + query.onFocus(); + }); + }); + } + onOnline() { + import_notifyManager.notifyManager.batch(() => { + this.getAll().forEach((query) => { + query.onOnline(); + }); + }); + } +}; +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + QueryCache +}); +//# sourceMappingURL=queryCache.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/queryCache.cjs.map b/node_modules/@tanstack/query-core/build/modern/queryCache.cjs.map new file mode 100644 index 0000000..7694aa1 --- /dev/null +++ b/node_modules/@tanstack/query-core/build/modern/queryCache.cjs.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/queryCache.ts"],"sourcesContent":["import { hashQueryKeyByOptions, matchQuery } from './utils'\nimport { Query } from './query'\nimport { notifyManager } from './notifyManager'\nimport { Subscribable } from './subscribable'\nimport type { QueryFilters } from './utils'\nimport type { Action, QueryState } from './query'\nimport type {\n DefaultError,\n NotifyEvent,\n QueryKey,\n QueryOptions,\n WithRequired,\n} from './types'\nimport type { QueryClient } from './queryClient'\nimport type { QueryObserver } from './queryObserver'\n\n// TYPES\n\ninterface QueryCacheConfig {\n onError?: (\n error: DefaultError,\n query: Query,\n ) => void\n onSuccess?: (data: unknown, query: Query) => void\n onSettled?: (\n data: unknown | undefined,\n error: DefaultError | null,\n query: Query,\n ) => void\n}\n\ninterface NotifyEventQueryAdded extends NotifyEvent {\n type: 'added'\n query: Query\n}\n\ninterface NotifyEventQueryRemoved extends NotifyEvent {\n type: 'removed'\n query: Query\n}\n\ninterface NotifyEventQueryUpdated extends NotifyEvent {\n type: 'updated'\n query: Query\n action: Action\n}\n\ninterface NotifyEventQueryObserverAdded extends NotifyEvent {\n type: 'observerAdded'\n query: Query\n observer: QueryObserver\n}\n\ninterface NotifyEventQueryObserverRemoved extends NotifyEvent {\n type: 'observerRemoved'\n query: Query\n observer: QueryObserver\n}\n\ninterface NotifyEventQueryObserverResultsUpdated extends NotifyEvent {\n type: 'observerResultsUpdated'\n query: Query\n}\n\ninterface NotifyEventQueryObserverOptionsUpdated extends NotifyEvent {\n type: 'observerOptionsUpdated'\n query: Query\n observer: QueryObserver\n}\n\nexport type QueryCacheNotifyEvent =\n | NotifyEventQueryAdded\n | NotifyEventQueryRemoved\n | NotifyEventQueryUpdated\n | NotifyEventQueryObserverAdded\n | NotifyEventQueryObserverRemoved\n | NotifyEventQueryObserverResultsUpdated\n | NotifyEventQueryObserverOptionsUpdated\n\ntype QueryCacheListener = (event: QueryCacheNotifyEvent) => void\n\nexport interface QueryStore {\n has: (queryHash: string) => boolean\n set: (queryHash: string, query: Query) => void\n get: (queryHash: string) => Query | undefined\n delete: (queryHash: string) => void\n values: () => IterableIterator\n}\n\n// CLASS\n\nexport class QueryCache extends Subscribable {\n #queries: QueryStore\n\n constructor(public config: QueryCacheConfig = {}) {\n super()\n this.#queries = new Map()\n }\n\n build<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n >(\n client: QueryClient,\n options: WithRequired<\n QueryOptions,\n 'queryKey'\n >,\n state?: QueryState,\n ): Query {\n const queryKey = options.queryKey\n const queryHash =\n options.queryHash ?? hashQueryKeyByOptions(queryKey, options)\n let query = this.get(queryHash)\n\n if (!query) {\n query = new Query({\n client,\n queryKey,\n queryHash,\n options: client.defaultQueryOptions(options),\n state,\n defaultOptions: client.getQueryDefaults(queryKey),\n })\n this.add(query)\n }\n\n return query\n }\n\n add(query: Query): void {\n if (!this.#queries.has(query.queryHash)) {\n this.#queries.set(query.queryHash, query)\n\n this.notify({\n type: 'added',\n query,\n })\n }\n }\n\n remove(query: Query): void {\n const queryInMap = this.#queries.get(query.queryHash)\n\n if (queryInMap) {\n query.destroy()\n\n if (queryInMap === query) {\n this.#queries.delete(query.queryHash)\n }\n\n this.notify({ type: 'removed', query })\n }\n }\n\n clear(): void {\n notifyManager.batch(() => {\n this.getAll().forEach((query) => {\n this.remove(query)\n })\n })\n }\n\n get<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n >(\n queryHash: string,\n ): Query | undefined {\n return this.#queries.get(queryHash) as\n | Query\n | undefined\n }\n\n getAll(): Array {\n return [...this.#queries.values()]\n }\n\n find(\n filters: WithRequired,\n ): Query | undefined {\n const defaultedFilters = { exact: true, ...filters }\n\n return this.getAll().find((query) =>\n matchQuery(defaultedFilters, query),\n ) as Query | undefined\n }\n\n findAll(filters: QueryFilters = {}): Array {\n const queries = this.getAll()\n return Object.keys(filters).length > 0\n ? queries.filter((query) => matchQuery(filters, query))\n : queries\n }\n\n notify(event: QueryCacheNotifyEvent): void {\n notifyManager.batch(() => {\n this.listeners.forEach((listener) => {\n listener(event)\n })\n })\n }\n\n onFocus(): void {\n notifyManager.batch(() => {\n this.getAll().forEach((query) => {\n query.onFocus()\n })\n })\n }\n\n onOnline(): void {\n notifyManager.batch(() => {\n this.getAll().forEach((query) => {\n query.onOnline()\n })\n })\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAkD;AAClD,mBAAsB;AACtB,2BAA8B;AAC9B,0BAA6B;AAwFtB,IAAM,aAAN,cAAyB,iCAAiC;AAAA,EAG/D,YAAmB,SAA2B,CAAC,GAAG;AAChD,UAAM;AADW;AAEjB,SAAK,WAAW,oBAAI,IAAmB;AAAA,EACzC;AAAA,EALA;AAAA,EAOA,MAME,QACA,SAIA,OAC+C;AAC/C,UAAM,WAAW,QAAQ;AACzB,UAAM,YACJ,QAAQ,iBAAa,oCAAsB,UAAU,OAAO;AAC9D,QAAI,QAAQ,KAAK,IAA4C,SAAS;AAEtE,QAAI,CAAC,OAAO;AACV,cAAQ,IAAI,mBAAM;AAAA,QAChB;AAAA,QACA;AAAA,QACA;AAAA,QACA,SAAS,OAAO,oBAAoB,OAAO;AAAA,QAC3C;AAAA,Q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;AAAA,EACN;AAAA,EAEA,OAAO,OAAoC;AACzC,uCAAc,MAAM,MAAM;AACxB,WAAK,UAAU,QAAQ,CAAC,aAAa;AACnC,iBAAS,KAAK;AAAA,MAChB,CAAC;AAAA,IACH,CAAC;AAAA,EACH;AAAA,EAEA,UAAgB;AACd,uCAAc,MAAM,MAAM;AACxB,WAAK,OAAO,EAAE,QAAQ,CAAC,UAAU;AAC/B,cAAM,QAAQ;AAAA,MAChB,CAAC;AAAA,IACH,CAAC;AAAA,EACH;AAAA,EAEA,WAAiB;AACf,uCAAc,MAAM,MAAM;AACxB,WAAK,OAAO,EAAE,QAAQ,CAAC,UAAU;AAC/B,cAAM,SAAS;AAAA,MACjB,CAAC;AAAA,IACH,CAAC;AAAA,EACH;AACF;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/queryCache.d.cts b/node_modules/@tanstack/query-core/build/modern/queryCache.d.cts new file mode 100644 index 0000000..7c0bfb5 --- /dev/null +++ b/node_modules/@tanstack/query-core/build/modern/queryCache.d.cts @@ -0,0 +1,3 @@ +export { Q as QueryCache, f as QueryCacheNotifyEvent, bB as QueryStore } from './hydration-uphG6M-i.cjs'; +import './subscribable.cjs'; +import './removable.cjs'; diff --git a/node_modules/@tanstack/query-core/build/modern/queryCache.d.ts b/node_modules/@tanstack/query-core/build/modern/queryCache.d.ts new file mode 100644 index 0000000..3e9dd5f --- /dev/null +++ b/node_modules/@tanstack/query-core/build/modern/queryCache.d.ts @@ -0,0 +1,3 @@ +export { Q as QueryCache, f as QueryCacheNotifyEvent, bB as QueryStore } from './hydration-BlEVG2Lp.js'; +import './subscribable.js'; +import './removable.js'; diff --git a/node_modules/@tanstack/query-core/build/modern/queryCache.js b/node_modules/@tanstack/query-core/build/modern/queryCache.js new file mode 100644 index 0000000..07bd9c1 --- /dev/null +++ b/node_modules/@tanstack/query-core/build/modern/queryCache.js @@ -0,0 +1,97 @@ +// src/queryCache.ts +import { hashQueryKeyByOptions, matchQuery } from "./utils.js"; +import { Query } from "./query.js"; +import { notifyManager } from "./notifyManager.js"; +import { Subscribable } from "./subscribable.js"; +var QueryCache = class extends Subscribable { + constructor(config = {}) { + super(); + this.config = config; + this.#queries = /* @__PURE__ */ new Map(); + } + #queries; + build(client, options, state) { + const queryKey = options.queryKey; + const queryHash = options.queryHash ?? hashQueryKeyByOptions(queryKey, options); + let query = this.get(queryHash); + if (!query) { + query = new Query({ + client, + queryKey, + queryHash, + options: client.defaultQueryOptions(options), + state, + defaultOptions: client.getQueryDefaults(queryKey) + }); + this.add(query); + } + return query; + } + add(query) { + if (!this.#queries.has(query.queryHash)) { + this.#queries.set(query.queryHash, query); + this.notify({ + type: "added", + query + }); + } + } + remove(query) { + const queryInMap = this.#queries.get(query.queryHash); + if (queryInMap) { + query.destroy(); + if (queryInMap === query) { + this.#queries.delete(query.queryHash); + } + this.notify({ type: "removed", query }); + } + } + clear() { + notifyManager.batch(() => { + this.getAll().forEach((query) => { + this.remove(query); + }); + }); + } + get(queryHash) { + return this.#queries.get(queryHash); + } + getAll() { + return [...this.#queries.values()]; + } + find(filters) { + const defaultedFilters = { exact: true, ...filters }; + return this.getAll().find( + (query) => matchQuery(defaultedFilters, query) + ); + } + findAll(filters = {}) { + const queries = this.getAll(); + return Object.keys(filters).length > 0 ? queries.filter((query) => matchQuery(filters, query)) : queries; + } + notify(event) { + notifyManager.batch(() => { + this.listeners.forEach((listener) => { + listener(event); + }); + }); + } + onFocus() { + notifyManager.batch(() => { + this.getAll().forEach((query) => { + query.onFocus(); + }); + }); + } + onOnline() { + notifyManager.batch(() => { + this.getAll().forEach((query) => { + query.onOnline(); + }); + }); + } +}; +export { + QueryCache +}; +//# sourceMappingURL=queryCache.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/queryCache.js.map b/node_modules/@tanstack/query-core/build/modern/queryCache.js.map new file mode 100644 index 0000000..6b05a5d --- /dev/null +++ b/node_modules/@tanstack/query-core/build/modern/queryCache.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/queryCache.ts"],"sourcesContent":["import { hashQueryKeyByOptions, matchQuery } from './utils'\nimport { Query } from './query'\nimport { notifyManager } from './notifyManager'\nimport { Subscribable } from './subscribable'\nimport type { QueryFilters } from './utils'\nimport type { Action, QueryState } from './query'\nimport type {\n DefaultError,\n NotifyEvent,\n QueryKey,\n QueryOptions,\n WithRequired,\n} from './types'\nimport type { QueryClient } from './queryClient'\nimport type { QueryObserver } from './queryObserver'\n\n// TYPES\n\ninterface QueryCacheConfig {\n onError?: (\n error: DefaultError,\n query: Query,\n ) => void\n onSuccess?: (data: unknown, query: Query) => void\n onSettled?: (\n data: unknown | undefined,\n error: DefaultError | null,\n query: Query,\n ) => void\n}\n\ninterface NotifyEventQueryAdded extends NotifyEvent {\n type: 'added'\n query: Query\n}\n\ninterface NotifyEventQueryRemoved extends NotifyEvent {\n type: 'removed'\n query: Query\n}\n\ninterface NotifyEventQueryUpdated extends NotifyEvent {\n type: 'updated'\n query: Query\n action: Action\n}\n\ninterface NotifyEventQueryObserverAdded extends NotifyEvent {\n type: 'observerAdded'\n query: Query\n observer: QueryObserver\n}\n\ninterface NotifyEventQueryObserverRemoved extends NotifyEvent {\n type: 'observerRemoved'\n query: Query\n observer: QueryObserver\n}\n\ninterface NotifyEventQueryObserverResultsUpdated extends NotifyEvent {\n type: 'observerResultsUpdated'\n query: Query\n}\n\ninterface NotifyEventQueryObserverOptionsUpdated extends NotifyEvent {\n type: 'observerOptionsUpdated'\n query: Query\n observer: QueryObserver\n}\n\nexport type QueryCacheNotifyEvent =\n | NotifyEventQueryAdded\n | NotifyEventQueryRemoved\n | NotifyEventQueryUpdated\n | NotifyEventQueryObserverAdded\n | NotifyEventQueryObserverRemoved\n | NotifyEventQueryObserverResultsUpdated\n | NotifyEventQueryObserverOptionsUpdated\n\ntype QueryCacheListener = (event: QueryCacheNotifyEvent) => void\n\nexport interface QueryStore {\n has: (queryHash: string) => boolean\n set: (queryHash: string, query: Query) => void\n get: (queryHash: string) => Query | undefined\n delete: (queryHash: string) => void\n values: () => IterableIterator\n}\n\n// CLASS\n\nexport class QueryCache extends Subscribable {\n #queries: QueryStore\n\n constructor(public config: QueryCacheConfig = {}) {\n super()\n this.#queries = new Map()\n }\n\n build<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n >(\n client: QueryClient,\n options: WithRequired<\n QueryOptions,\n 'queryKey'\n >,\n state?: QueryState,\n ): Query {\n const queryKey = options.queryKey\n const queryHash =\n options.queryHash ?? hashQueryKeyByOptions(queryKey, options)\n let query = this.get(queryHash)\n\n if (!query) {\n query = new Query({\n client,\n queryKey,\n queryHash,\n options: client.defaultQueryOptions(options),\n state,\n defaultOptions: client.getQueryDefaults(queryKey),\n })\n this.add(query)\n }\n\n return query\n }\n\n add(query: Query): void {\n if (!this.#queries.has(query.queryHash)) {\n this.#queries.set(query.queryHash, query)\n\n this.notify({\n type: 'added',\n query,\n })\n }\n }\n\n remove(query: Query): void {\n const queryInMap = this.#queries.get(query.queryHash)\n\n if (queryInMap) {\n query.destroy()\n\n if (queryInMap === query) {\n this.#queries.delete(query.queryHash)\n }\n\n this.notify({ type: 'removed', query })\n }\n }\n\n clear(): void {\n notifyManager.batch(() => {\n this.getAll().forEach((query) => {\n this.remove(query)\n })\n })\n }\n\n get<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n >(\n queryHash: string,\n ): Query | undefined {\n return this.#queries.get(queryHash) as\n | Query\n | undefined\n }\n\n getAll(): Array {\n return [...this.#queries.values()]\n }\n\n find(\n filters: WithRequired,\n ): Query | undefined {\n const defaultedFilters = { exact: true, ...filters }\n\n return this.getAll().find((query) =>\n matchQuery(defaultedFilters, query),\n ) as Query | undefined\n }\n\n findAll(filters: QueryFilters = {}): Array {\n const queries = this.getAll()\n return Object.keys(filters).length > 0\n ? queries.filter((query) => matchQuery(filters, query))\n : queries\n }\n\n notify(event: QueryCacheNotifyEvent): void {\n notifyManager.batch(() => {\n this.listeners.forEach((listener) => {\n listener(event)\n })\n })\n }\n\n onFocus(): void {\n notifyManager.batch(() => {\n this.getAll().forEach((query) => {\n query.onFocus()\n })\n })\n }\n\n onOnline(): void {\n notifyManager.batch(() => {\n this.getAll().forEach((query) => {\n query.onOnline()\n })\n })\n }\n}\n"],"mappings":";AAAA,SAAS,uBAAuB,kBAAkB;AAClD,SAAS,aAAa;AACtB,SAAS,qBAAqB;AAC9B,SAAS,oBAAoB;AAwFtB,IAAM,aAAN,cAAyB,aAAiC;AAAA,EAG/D,YAAmB,SAA2B,CAAC,GAAG;AAChD,UAAM;AADW;AAEjB,SAAK,WAAW,oBAAI,IAAmB;AAAA,EACzC;AAAA,EALA;AAAA,EAOA,MAME,QACA,SAIA,OAC+C;AAC/C,UAAM,WAAW,QAAQ;AACzB,UAAM,YACJ,QAAQ,aAAa,sBAAsB,UAAU,OAAO;AAC9D,QAAI,QAAQ,KAAK,IAA4C,SAAS;AAEtE,QAAI,CAAC,OAAO;AACV,cAAQ,IAAI,MAAM;AAAA,QAChB;AAAA,QACA;AAAA,QACA;AAAA,QACA,SAAS,OAAO,oBAAoB,OAAO;AAAA,QAC3C;AAAA,QACA,gBAAgB,OAAO,iBAAiB,QAAQ;AAAA,MAClD,CAAC;AACD,WAAK,IAAI,KAAK;AAAA,IAChB;AAEA,WAAO;AAAA,EACT;AAAA,EAEA,IAAI,OAAwC;AAC1C,QAAI,CAAC,KAAK,SAAS,IAAI,MAAM,SAAS,GAAG;AACvC,WAAK,SAAS,IAAI,MAAM,WAAW,KAAK;AAExC,WAAK,OAAO;AAAA,QACV,MAAM;AAAA,QACN;AAAA,MACF,CAAC;AAAA,IACH;AAAA,EACF;AAAA,EAEA,OAAO,OAAwC;AAC7C,UAAM,aAAa,KAAK,SAAS,IAAI,MAAM,SAAS;AAEpD,QAAI,YAAY;AACd,YAAM,QAAQ;AAEd,UAAI,eAAe,OAAO;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AC;AAAA,EACH;AACF;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/queryClient.cjs b/node_modules/@tanstack/query-core/build/modern/queryClient.cjs new file mode 100644 index 0000000..37e298a --- /dev/null +++ b/node_modules/@tanstack/query-core/build/modern/queryClient.cjs @@ -0,0 +1,322 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/queryClient.ts +var queryClient_exports = {}; +__export(queryClient_exports, { + QueryClient: () => QueryClient +}); +module.exports = __toCommonJS(queryClient_exports); +var import_utils = require("./utils.cjs"); +var import_queryCache = require("./queryCache.cjs"); +var import_mutationCache = require("./mutationCache.cjs"); +var import_focusManager = require("./focusManager.cjs"); +var import_onlineManager = require("./onlineManager.cjs"); +var import_notifyManager = require("./notifyManager.cjs"); +var import_infiniteQueryBehavior = require("./infiniteQueryBehavior.cjs"); +var QueryClient = class { + #queryCache; + #mutationCache; + #defaultOptions; + #queryDefaults; + #mutationDefaults; + #mountCount; + #unsubscribeFocus; + #unsubscribeOnline; + constructor(config = {}) { + this.#queryCache = config.queryCache || new import_queryCache.QueryCache(); + this.#mutationCache = config.mutationCache || new import_mutationCache.MutationCache(); + this.#defaultOptions = config.defaultOptions || {}; + this.#queryDefaults = /* @__PURE__ */ new Map(); + this.#mutationDefaults = /* @__PURE__ */ new Map(); + this.#mountCount = 0; + } + mount() { + this.#mountCount++; + if (this.#mountCount !== 1) return; + this.#unsubscribeFocus = import_focusManager.focusManager.subscribe(async (focused) => { + if (focused) { + await this.resumePausedMutations(); + this.#queryCache.onFocus(); + } + }); + this.#unsubscribeOnline = import_onlineManager.onlineManager.subscribe(async (online) => { + if (online) { + await this.resumePausedMutations(); + this.#queryCache.onOnline(); + } + }); + } + unmount() { + this.#mountCount--; + if (this.#mountCount !== 0) return; + this.#unsubscribeFocus?.(); + this.#unsubscribeFocus = void 0; + this.#unsubscribeOnline?.(); + this.#unsubscribeOnline = void 0; + } + isFetching(filters) { + return this.#queryCache.findAll({ ...filters, fetchStatus: "fetching" }).length; + } + isMutating(filters) { + return this.#mutationCache.findAll({ ...filters, status: "pending" }).length; + } + /** + * Imperative (non-reactive) way to retrieve data for a QueryKey. + * Should only be used in callbacks or functions where reading the latest data is necessary, e.g. for optimistic updates. + * + * Hint: Do not use this function inside a component, because it won't receive updates. + * Use `useQuery` to create a `QueryObserver` that subscribes to changes. + */ + getQueryData(queryKey) { + const options = this.defaultQueryOptions({ queryKey }); + return this.#queryCache.get(options.queryHash)?.state.data; + } + ensureQueryData(options) { + const defaultedOptions = this.defaultQueryOptions(options); + const query = this.#queryCache.build(this, defaultedOptions); + const cachedData = query.state.data; + if (cachedData === void 0) { + return this.fetchQuery(options); + } + if (options.revalidateIfStale && query.isStaleByTime((0, import_utils.resolveStaleTime)(defaultedOptions.staleTime, query))) { + void this.prefetchQuery(defaultedOptions); + } + return Promise.resolve(cachedData); + } + getQueriesData(filters) { + return this.#queryCache.findAll(filters).map(({ queryKey, state }) => { + const data = state.data; + return [queryKey, data]; + }); + } + setQueryData(queryKey, updater, options) { + const defaultedOptions = this.defaultQueryOptions({ queryKey }); + const query = this.#queryCache.get( + defaultedOptions.queryHash + ); + const prevData = query?.state.data; + const data = (0, import_utils.functionalUpdate)(updater, prevData); + if (data === void 0) { + return void 0; + } + return this.#queryCache.build(this, defaultedOptions).setData(data, { ...options, manual: true }); + } + setQueriesData(filters, updater, options) { + return import_notifyManager.notifyManager.batch( + () => this.#queryCache.findAll(filters).map(({ queryKey }) => [ + queryKey, + this.setQueryData(queryKey, updater, options) + ]) + ); + } + getQueryState(queryKey) { + const options = this.defaultQueryOptions({ queryKey }); + return this.#queryCache.get( + options.queryHash + )?.state; + } + removeQueries(filters) { + const queryCache = this.#queryCache; + import_notifyManager.notifyManager.batch(() => { + queryCache.findAll(filters).forEach((query) => { + queryCache.remove(query); + }); + }); + } + resetQueries(filters, options) { + const queryCache = this.#queryCache; + return import_notifyManager.notifyManager.batch(() => { + queryCache.findAll(filters).forEach((query) => { + query.reset(); + }); + return this.refetchQueries( + { + type: "active", + ...filters + }, + options + ); + }); + } + cancelQueries(filters, cancelOptions = {}) { + const defaultedCancelOptions = { revert: true, ...cancelOptions }; + const promises = import_notifyManager.notifyManager.batch( + () => this.#queryCache.findAll(filters).map((query) => query.cancel(defaultedCancelOptions)) + ); + return Promise.all(promises).then(import_utils.noop).catch(import_utils.noop); + } + invalidateQueries(filters, options = {}) { + return import_notifyManager.notifyManager.batch(() => { + this.#queryCache.findAll(filters).forEach((query) => { + query.invalidate(); + }); + if (filters?.refetchType === "none") { + return Promise.resolve(); + } + return this.refetchQueries( + { + ...filters, + type: filters?.refetchType ?? filters?.type ?? "active" + }, + options + ); + }); + } + refetchQueries(filters, options = {}) { + const fetchOptions = { + ...options, + cancelRefetch: options.cancelRefetch ?? true + }; + const promises = import_notifyManager.notifyManager.batch( + () => this.#queryCache.findAll(filters).filter((query) => !query.isDisabled() && !query.isStatic()).map((query) => { + let promise = query.fetch(void 0, fetchOptions); + if (!fetchOptions.throwOnError) { + promise = promise.catch(import_utils.noop); + } + return query.state.fetchStatus === "paused" ? Promise.resolve() : promise; + }) + ); + return Promise.all(promises).then(import_utils.noop); + } + fetchQuery(options) { + const defaultedOptions = this.defaultQueryOptions(options); + if (defaultedOptions.retry === void 0) { + defaultedOptions.retry = false; + } + const query = this.#queryCache.build(this, defaultedOptions); + return query.isStaleByTime( + (0, import_utils.resolveStaleTime)(defaultedOptions.staleTime, query) + ) ? query.fetch(defaultedOptions) : Promise.resolve(query.state.data); + } + prefetchQuery(options) { + return this.fetchQuery(options).then(import_utils.noop).catch(import_utils.noop); + } + fetchInfiniteQuery(options) { + options.behavior = (0, import_infiniteQueryBehavior.infiniteQueryBehavior)(options.pages); + return this.fetchQuery(options); + } + prefetchInfiniteQuery(options) { + return this.fetchInfiniteQuery(options).then(import_utils.noop).catch(import_utils.noop); + } + ensureInfiniteQueryData(options) { + options.behavior = (0, import_infiniteQueryBehavior.infiniteQueryBehavior)(options.pages); + return this.ensureQueryData(options); + } + resumePausedMutations() { + if (import_onlineManager.onlineManager.isOnline()) { + return this.#mutationCache.resumePausedMutations(); + } + return Promise.resolve(); + } + getQueryCache() { + return this.#queryCache; + } + getMutationCache() { + return this.#mutationCache; + } + getDefaultOptions() { + return this.#defaultOptions; + } + setDefaultOptions(options) { + this.#defaultOptions = options; + } + setQueryDefaults(queryKey, options) { + this.#queryDefaults.set((0, import_utils.hashKey)(queryKey), { + queryKey, + defaultOptions: options + }); + } + getQueryDefaults(queryKey) { + const defaults = [...this.#queryDefaults.values()]; + const result = {}; + defaults.forEach((queryDefault) => { + if ((0, import_utils.partialMatchKey)(queryKey, queryDefault.queryKey)) { + Object.assign(result, queryDefault.defaultOptions); + } + }); + return result; + } + setMutationDefaults(mutationKey, options) { + this.#mutationDefaults.set((0, import_utils.hashKey)(mutationKey), { + mutationKey, + defaultOptions: options + }); + } + getMutationDefaults(mutationKey) { + const defaults = [...this.#mutationDefaults.values()]; + const result = {}; + defaults.forEach((queryDefault) => { + if ((0, import_utils.partialMatchKey)(mutationKey, queryDefault.mutationKey)) { + Object.assign(result, queryDefault.defaultOptions); + } + }); + return result; + } + defaultQueryOptions(options) { + if (options._defaulted) { + return options; + } + const defaultedOptions = { + ...this.#defaultOptions.queries, + ...this.getQueryDefaults(options.queryKey), + ...options, + _defaulted: true + }; + if (!defaultedOptions.queryHash) { + defaultedOptions.queryHash = (0, import_utils.hashQueryKeyByOptions)( + defaultedOptions.queryKey, + defaultedOptions + ); + } + if (defaultedOptions.refetchOnReconnect === void 0) { + defaultedOptions.refetchOnReconnect = defaultedOptions.networkMode !== "always"; + } + if (defaultedOptions.throwOnError === void 0) { + defaultedOptions.throwOnError = !!defaultedOptions.suspense; + } + if (!defaultedOptions.networkMode && defaultedOptions.persister) { + defaultedOptions.networkMode = "offlineFirst"; + } + if (defaultedOptions.queryFn === import_utils.skipToken) { + defaultedOptions.enabled = false; + } + return defaultedOptions; + } + defaultMutationOptions(options) { + if (options?._defaulted) { + return options; + } + return { + ...this.#defaultOptions.mutations, + ...options?.mutationKey && this.getMutationDefaults(options.mutationKey), + ...options, + _defaulted: true + }; + } + clear() { + this.#queryCache.clear(); + this.#mutationCache.clear(); + } +}; +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + QueryClient +}); +//# sourceMappingURL=queryClient.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/queryClient.cjs.map b/node_modules/@tanstack/query-core/build/modern/queryClient.cjs.map new file mode 100644 index 0000000..423c8cf --- /dev/null +++ b/node_modules/@tanstack/query-core/build/modern/queryClient.cjs.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/queryClient.ts"],"sourcesContent":["import {\n functionalUpdate,\n hashKey,\n hashQueryKeyByOptions,\n noop,\n partialMatchKey,\n resolveStaleTime,\n skipToken,\n} from './utils'\nimport { QueryCache } from './queryCache'\nimport { MutationCache } from './mutationCache'\nimport { focusManager } from './focusManager'\nimport { onlineManager } from './onlineManager'\nimport { notifyManager } from './notifyManager'\nimport { infiniteQueryBehavior } from './infiniteQueryBehavior'\nimport type {\n CancelOptions,\n DefaultError,\n DefaultOptions,\n DefaultedQueryObserverOptions,\n EnsureInfiniteQueryDataOptions,\n EnsureQueryDataOptions,\n FetchInfiniteQueryOptions,\n FetchQueryOptions,\n InferDataFromTag,\n InferErrorFromTag,\n InfiniteData,\n InvalidateOptions,\n InvalidateQueryFilters,\n MutationKey,\n MutationObserverOptions,\n MutationOptions,\n NoInfer,\n OmitKeyof,\n QueryClientConfig,\n QueryKey,\n QueryObserverOptions,\n QueryOptions,\n RefetchOptions,\n RefetchQueryFilters,\n ResetOptions,\n SetDataOptions,\n} from './types'\nimport type { QueryState } from './query'\nimport type { MutationFilters, QueryFilters, Updater } from './utils'\n\n// TYPES\n\ninterface QueryDefaults {\n queryKey: QueryKey\n defaultOptions: OmitKeyof, 'queryKey'>\n}\n\ninterface MutationDefaults {\n mutationKey: MutationKey\n defaultOptions: MutationOptions\n}\n\n// CLASS\n\nexport class QueryClient {\n #queryCache: QueryCache\n #mutationCache: MutationCache\n #defaultOptions: DefaultOptions\n #queryDefaults: Map\n #mutationDefaults: Map\n #mountCount: number\n #unsubscribeFocus?: () => void\n #unsubscribeOnline?: () => void\n\n constructor(config: QueryClientConfig = {}) {\n this.#queryCache = config.queryCache || new QueryCache()\n this.#mutationCache = config.mutationCache || new MutationCache()\n this.#defaultOptions = config.defaultOptions || {}\n this.#queryDefaults = new Map()\n this.#mutationDefaults = new Map()\n this.#mountCount = 0\n }\n\n mount(): void {\n this.#mountCount++\n if (this.#mountCount !== 1) return\n\n this.#unsubscribeFocus = focusManager.subscribe(async (focused) => {\n if (focused) {\n await this.resumePausedMutations()\n this.#queryCache.onFocus()\n }\n })\n this.#unsubscribeOnline = onlineManager.subscribe(async (online) => {\n if (online) {\n await this.resumePausedMutations()\n this.#queryCache.onOnline()\n }\n })\n }\n\n unmount(): void {\n this.#mountCount--\n if (this.#mountCount !== 0) return\n\n this.#unsubscribeFocus?.()\n this.#unsubscribeFocus = undefined\n\n this.#unsubscribeOnline?.()\n this.#unsubscribeOnline = undefined\n }\n\n isFetching = QueryFilters>(\n filters?: TQueryFilters,\n ): number {\n return this.#queryCache.findAll({ ...filters, fetchStatus: 'fetching' })\n .length\n }\n\n isMutating<\n TMutationFilters extends MutationFilters = MutationFilters,\n >(filters?: TMutationFilters): number {\n return this.#mutationCache.findAll({ ...filters, status: 'pending' }).length\n }\n\n /**\n * Imperative (non-reactive) way to retrieve data for a QueryKey.\n * Should only be used in callbacks or functions where reading the latest data is necessary, e.g. for optimistic updates.\n *\n * Hint: Do not use this function inside a component, because it won't receive updates.\n * Use `useQuery` to create a `QueryObserver` that subscribes to changes.\n */\n getQueryData<\n TQueryFnData = unknown,\n TTaggedQueryKey extends QueryKey = QueryKey,\n TInferredQueryFnData = InferDataFromTag,\n >(queryKey: TTaggedQueryKey): TInferredQueryFnData | undefined {\n const options = this.defaultQueryOptions({ queryKey })\n\n return this.#queryCache.get(options.queryHash)?.state\n .data\n }\n\n ensureQueryData<\n TQueryFnData,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n >(\n options: EnsureQueryDataOptions,\n ): Promise {\n const defaultedOptions = this.defaultQueryOptions(options)\n const query = this.#queryCache.build(this, defaultedOptions)\n const cachedData = query.state.data\n\n if (cachedData === undefined) {\n return this.fetchQuery(options)\n }\n\n if (\n options.revalidateIfStale &&\n query.isStaleByTime(resolveStaleTime(defaultedOptions.staleTime, query))\n ) {\n void this.prefetchQuery(defaultedOptions)\n }\n\n return Promise.resolve(cachedData)\n }\n\n getQueriesData<\n TQueryFnData = unknown,\n TQueryFilters extends QueryFilters = QueryFilters,\n >(filters: TQueryFilters): Array<[QueryKey, TQueryFnData | undefined]> {\n return this.#queryCache.findAll(filters).map(({ queryKey, state }) => {\n const data = state.data as TQueryFnData | undefined\n return [queryKey, data]\n })\n }\n\n setQueryData<\n TQueryFnData = unknown,\n TTaggedQueryKey extends QueryKey = QueryKey,\n TInferredQueryFnData = InferDataFromTag,\n >(\n queryKey: TTaggedQueryKey,\n updater: Updater<\n NoInfer | undefined,\n NoInfer | undefined\n >,\n options?: SetDataOptions,\n ): NoInfer | undefined {\n const defaultedOptions = this.defaultQueryOptions<\n any,\n any,\n unknown,\n any,\n QueryKey\n >({ queryKey })\n\n const query = this.#queryCache.get(\n defaultedOptions.queryHash,\n )\n const prevData = query?.state.data\n const data = functionalUpdate(updater, prevData)\n\n if (data === undefined) {\n return undefined\n }\n\n return this.#queryCache\n .build(this, defaultedOptions)\n .setData(data, { ...options, manual: true })\n }\n\n setQueriesData<\n TQueryFnData,\n TQueryFilters extends QueryFilters = QueryFilters,\n >(\n filters: TQueryFilters,\n updater: Updater<\n NoInfer | undefined,\n NoInfer | undefined\n >,\n options?: SetDataOptions,\n ): Array<[QueryKey, TQueryFnData | undefined]> {\n return notifyManager.batch(() =>\n this.#queryCache\n .findAll(filters)\n .map(({ queryKey }) => [\n queryKey,\n this.setQueryData(queryKey, updater, options),\n ]),\n )\n }\n\n getQueryState<\n TQueryFnData = unknown,\n TError = DefaultError,\n TTaggedQueryKey extends QueryKey = QueryKey,\n TInferredQueryFnData = InferDataFromTag,\n TInferredError = InferErrorFromTag,\n >(\n queryKey: TTaggedQueryKey,\n ): QueryState | undefined {\n const options = this.defaultQueryOptions({ queryKey })\n return this.#queryCache.get(\n options.queryHash,\n )?.state\n }\n\n removeQueries(\n filters?: QueryFilters,\n ): void {\n const queryCache = this.#queryCache\n notifyManager.batch(() => {\n queryCache.findAll(filters).forEach((query) => {\n queryCache.remove(query)\n })\n })\n }\n\n resetQueries(\n filters?: QueryFilters,\n options?: ResetOptions,\n ): Promise {\n const queryCache = this.#queryCache\n\n return notifyManager.batch(() => {\n queryCache.findAll(filters).forEach((query) => {\n query.reset()\n })\n return this.refetchQueries(\n {\n type: 'active',\n ...filters,\n },\n options,\n )\n })\n }\n\n cancelQueries(\n filters?: QueryFilters,\n cancelOptions: CancelOptions = {},\n ): Promise {\n const defaultedCancelOptions = { revert: true, ...cancelOptions }\n\n const promises = notifyManager.batch(() =>\n this.#queryCache\n .findAll(filters)\n .map((query) => query.cancel(defaultedCancelOptions)),\n )\n\n return Promise.all(promises).then(noop).catch(noop)\n }\n\n invalidateQueries(\n filters?: InvalidateQueryFilters,\n options: InvalidateOptions = {},\n ): Promise {\n return notifyManager.batch(() => {\n this.#queryCache.findAll(filters).forEach((query) => {\n query.invalidate()\n })\n\n if (filters?.refetchType === 'none') {\n return Promise.resolve()\n }\n return this.refetchQueries(\n {\n ...filters,\n type: filters?.refetchType ?? filters?.type ?? 'active',\n },\n options,\n )\n })\n }\n\n refetchQueries(\n filters?: RefetchQueryFilters,\n options: RefetchOptions = {},\n ): Promise {\n const fetchOptions = {\n ...options,\n cancelRefetch: options.cancelRefetch ?? true,\n }\n const promises = notifyManager.batch(() =>\n this.#queryCache\n .findAll(filters)\n .filter((query) => !query.isDisabled() && !query.isStatic())\n .map((query) => {\n let promise = query.fetch(undefined, fetchOptions)\n if (!fetchOptions.throwOnError) {\n promise = promise.catch(noop)\n }\n return query.state.fetchStatus === 'paused'\n ? Promise.resolve()\n : promise\n }),\n )\n\n return Promise.all(promises).then(noop)\n }\n\n fetchQuery<\n TQueryFnData,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = never,\n >(\n options: FetchQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n ): Promise {\n const defaultedOptions = this.defaultQueryOptions(options)\n\n // https://github.com/tannerlinsley/react-query/issues/652\n if (defaultedOptions.retry === undefined) {\n defaultedOptions.retry = false\n }\n\n const query = this.#queryCache.build(this, defaultedOptions)\n\n return query.isStaleByTime(\n resolveStaleTime(defaultedOptions.staleTime, query),\n )\n ? query.fetch(defaultedOptions)\n : Promise.resolve(query.state.data as TData)\n }\n\n prefetchQuery<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n >(\n options: FetchQueryOptions,\n ): Promise {\n return this.fetchQuery(options).then(noop).catch(noop)\n }\n\n fetchInfiniteQuery<\n TQueryFnData,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n >(\n options: FetchInfiniteQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n ): Promise> {\n options.behavior = infiniteQueryBehavior<\n TQueryFnData,\n TError,\n TData,\n TPageParam\n >(options.pages)\n return this.fetchQuery(options as any)\n }\n\n prefetchInfiniteQuery<\n TQueryFnData,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n >(\n options: FetchInfiniteQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n ): Promise {\n return this.fetchInfiniteQuery(options).then(noop).catch(noop)\n }\n\n ensureInfiniteQueryData<\n TQueryFnData,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n >(\n options: EnsureInfiniteQueryDataOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n ): Promise> {\n options.behavior = infiniteQueryBehavior<\n TQueryFnData,\n TError,\n TData,\n TPageParam\n >(options.pages)\n\n return this.ensureQueryData(options as any)\n }\n\n resumePausedMutations(): Promise {\n if (onlineManager.isOnline()) {\n return this.#mutationCache.resumePausedMutations()\n }\n return Promise.resolve()\n }\n\n getQueryCache(): QueryCache {\n return this.#queryCache\n }\n\n getMutationCache(): MutationCache {\n return this.#mutationCache\n }\n\n getDefaultOptions(): DefaultOptions {\n return this.#defaultOptions\n }\n\n setDefaultOptions(options: DefaultOptions): void {\n this.#defaultOptions = options\n }\n\n setQueryDefaults<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryData = TQueryFnData,\n >(\n queryKey: QueryKey,\n options: Partial<\n OmitKeyof<\n QueryObserverOptions,\n 'queryKey'\n >\n >,\n ): void {\n this.#queryDefaults.set(hashKey(queryKey), {\n queryKey,\n defaultOptions: options,\n })\n }\n\n getQueryDefaults(\n queryKey: QueryKey,\n ): OmitKeyof, 'queryKey'> {\n const defaults = [...this.#queryDefaults.values()]\n\n const result: OmitKeyof<\n QueryObserverOptions,\n 'queryKey'\n > = {}\n\n defaults.forEach((queryDefault) => {\n if (partialMatchKey(queryKey, queryDefault.queryKey)) {\n Object.assign(result, queryDefault.defaultOptions)\n }\n })\n return result\n }\n\n setMutationDefaults<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n >(\n mutationKey: MutationKey,\n options: OmitKeyof<\n MutationObserverOptions,\n 'mutationKey'\n >,\n ): void {\n this.#mutationDefaults.set(hashKey(mutationKey), {\n mutationKey,\n defaultOptions: options,\n })\n }\n\n getMutationDefaults(\n mutationKey: MutationKey,\n ): OmitKeyof, 'mutationKey'> {\n const defaults = [...this.#mutationDefaults.values()]\n\n const result: OmitKeyof<\n MutationObserverOptions,\n 'mutationKey'\n > = {}\n\n defaults.forEach((queryDefault) => {\n if (partialMatchKey(mutationKey, queryDefault.mutationKey)) {\n Object.assign(result, queryDefault.defaultOptions)\n }\n })\n\n return result\n }\n\n defaultQueryOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = never,\n >(\n options:\n | QueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey,\n TPageParam\n >\n | DefaultedQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >,\n ): DefaultedQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n > {\n if (options._defaulted) {\n return options as DefaultedQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >\n }\n\n const defaultedOptions = {\n ...this.#defaultOptions.queries,\n ...this.getQueryDefaults(options.queryKey),\n ...options,\n _defaulted: true,\n }\n\n if (!defaultedOptions.queryHash) {\n defaultedOptions.queryHash = hashQueryKeyByOptions(\n defaultedOptions.queryKey,\n defaultedOptions,\n )\n }\n\n // dependent default values\n if (defaultedOptions.refetchOnReconnect === undefined) {\n defaultedOptions.refetchOnReconnect =\n defaultedOptions.networkMode !== 'always'\n }\n if (defaultedOptions.throwOnError === undefined) {\n defaultedOptions.throwOnError = !!defaultedOptions.suspense\n }\n\n if (!defaultedOptions.networkMode && defaultedOptions.persister) {\n defaultedOptions.networkMode = 'offlineFirst'\n }\n\n if (defaultedOptions.queryFn === skipToken) {\n defaultedOptions.enabled = false\n }\n\n return defaultedOptions as DefaultedQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >\n }\n\n defaultMutationOptions>(\n options?: T,\n ): T {\n if (options?._defaulted) {\n return options\n }\n return {\n ...this.#defaultOptions.mutations,\n ...(options?.mutationKey &&\n this.getMutationDefaults(options.mutationKey)),\n ...options,\n _defaulted: true,\n } as T\n }\n\n clear(): void {\n this.#queryCache.clear()\n this.#mutationCache.clear()\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAQO;AACP,wBAA2B;AAC3B,2BAA8B;AAC9B,0BAA6B;AAC7B,2BAA8B;AAC9B,2BAA8B;AAC9B,mCAAsC;AA8C/B,IAAM,cAAN,MAAkB;AAAA,EACvB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EAEA,YAAY,SAA4B,CAAC,GAAG;AAC1C,SAAK,cAAc,OAAO,cAAc,IAAI,6BAAW;AACvD,SAAK,iBAAiB,OAAO,iBAAiB,IAAI,mCAAc;AAChE,SAAK,kBAAkB,OAAO,kBAAkB,CAAC;AACjD,SAAK,iBAAiB,oBAAI,IAAI;AAC9B,SAAK,oBAAoB,oBAAI,IAAI;AACjC,SAAK,cAAc;AAAA,EACrB;AAAA,EAEA,QAAc;AACZ,SAAK;AACL,QAAI,KAAK,gBAAgB,EAAG;AAE5B,SAAK,oBAAoB,iCAAa,UAAU,OAAO,YAAY;AACjE,UAAI,SAAS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,uBAAiB,qBACf,iBAAiB,gBAAgB;AAAA,IACrC;AACA,QAAI,iBAAiB,iBAAiB,QAAW;AAC/C,uBAAiB,eAAe,CAAC,CAAC,iBAAiB;AAAA,IACrD;AAEA,QAAI,CAAC,iBAAiB,eAAe,iBAAiB,WAAW;AAC/D,uBAAiB,cAAc;AAAA,IACjC;AAEA,QAAI,iBAAiB,YAAY,wBAAW;AAC1C,uBAAiB,UAAU;AAAA,IAC7B;AAEA,WAAO;AAAA,EAOT;AAAA,EAEA,uBACE,SACG;AACH,QAAI,SAAS,YAAY;AACvB,aAAO;AAAA,IACT;AACA,WAAO;AAAA,MACL,GAAG,KAAK,gBAAgB;AAAA,MACxB,GAAI,SAAS,eACX,KAAK,oBAAoB,QAAQ,WAAW;AAAA,MAC9C,GAAG;AAAA,MACH,YAAY;AAAA,IACd;AAAA,EACF;AAAA,EAEA,QAAc;AACZ,SAAK,YAAY,MAAM;AACvB,SAAK,eAAe,MAAM;AAAA,EAC5B;AACF;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/queryClient.d.cts b/node_modules/@tanstack/query-core/build/modern/queryClient.d.cts new file mode 100644 index 0000000..bd14fb2 --- /dev/null +++ b/node_modules/@tanstack/query-core/build/modern/queryClient.d.cts @@ -0,0 +1,3 @@ +export { g as QueryClient } from './hydration-uphG6M-i.cjs'; +import './removable.cjs'; +import './subscribable.cjs'; diff --git a/node_modules/@tanstack/query-core/build/modern/queryClient.d.ts b/node_modules/@tanstack/query-core/build/modern/queryClient.d.ts new file mode 100644 index 0000000..73366c7 --- /dev/null +++ b/node_modules/@tanstack/query-core/build/modern/queryClient.d.ts @@ -0,0 +1,3 @@ +export { g as QueryClient } from './hydration-BlEVG2Lp.js'; +import './removable.js'; +import './subscribable.js'; diff --git a/node_modules/@tanstack/query-core/build/modern/queryClient.js b/node_modules/@tanstack/query-core/build/modern/queryClient.js new file mode 100644 index 0000000..64a5a5f --- /dev/null +++ b/node_modules/@tanstack/query-core/build/modern/queryClient.js @@ -0,0 +1,305 @@ +// src/queryClient.ts +import { + functionalUpdate, + hashKey, + hashQueryKeyByOptions, + noop, + partialMatchKey, + resolveStaleTime, + skipToken +} from "./utils.js"; +import { QueryCache } from "./queryCache.js"; +import { MutationCache } from "./mutationCache.js"; +import { focusManager } from "./focusManager.js"; +import { onlineManager } from "./onlineManager.js"; +import { notifyManager } from "./notifyManager.js"; +import { infiniteQueryBehavior } from "./infiniteQueryBehavior.js"; +var QueryClient = class { + #queryCache; + #mutationCache; + #defaultOptions; + #queryDefaults; + #mutationDefaults; + #mountCount; + #unsubscribeFocus; + #unsubscribeOnline; + constructor(config = {}) { + this.#queryCache = config.queryCache || new QueryCache(); + this.#mutationCache = config.mutationCache || new MutationCache(); + this.#defaultOptions = config.defaultOptions || {}; + this.#queryDefaults = /* @__PURE__ */ new Map(); + this.#mutationDefaults = /* @__PURE__ */ new Map(); + this.#mountCount = 0; + } + mount() { + this.#mountCount++; + if (this.#mountCount !== 1) return; + this.#unsubscribeFocus = focusManager.subscribe(async (focused) => { + if (focused) { + await this.resumePausedMutations(); + this.#queryCache.onFocus(); + } + }); + this.#unsubscribeOnline = onlineManager.subscribe(async (online) => { + if (online) { + await this.resumePausedMutations(); + this.#queryCache.onOnline(); + } + }); + } + unmount() { + this.#mountCount--; + if (this.#mountCount !== 0) return; + this.#unsubscribeFocus?.(); + this.#unsubscribeFocus = void 0; + this.#unsubscribeOnline?.(); + this.#unsubscribeOnline = void 0; + } + isFetching(filters) { + return this.#queryCache.findAll({ ...filters, fetchStatus: "fetching" }).length; + } + isMutating(filters) { + return this.#mutationCache.findAll({ ...filters, status: "pending" }).length; + } + /** + * Imperative (non-reactive) way to retrieve data for a QueryKey. + * Should only be used in callbacks or functions where reading the latest data is necessary, e.g. for optimistic updates. + * + * Hint: Do not use this function inside a component, because it won't receive updates. + * Use `useQuery` to create a `QueryObserver` that subscribes to changes. + */ + getQueryData(queryKey) { + const options = this.defaultQueryOptions({ queryKey }); + return this.#queryCache.get(options.queryHash)?.state.data; + } + ensureQueryData(options) { + const defaultedOptions = this.defaultQueryOptions(options); + const query = this.#queryCache.build(this, defaultedOptions); + const cachedData = query.state.data; + if (cachedData === void 0) { + return this.fetchQuery(options); + } + if (options.revalidateIfStale && query.isStaleByTime(resolveStaleTime(defaultedOptions.staleTime, query))) { + void this.prefetchQuery(defaultedOptions); + } + return Promise.resolve(cachedData); + } + getQueriesData(filters) { + return this.#queryCache.findAll(filters).map(({ queryKey, state }) => { + const data = state.data; + return [queryKey, data]; + }); + } + setQueryData(queryKey, updater, options) { + const defaultedOptions = this.defaultQueryOptions({ queryKey }); + const query = this.#queryCache.get( + defaultedOptions.queryHash + ); + const prevData = query?.state.data; + const data = functionalUpdate(updater, prevData); + if (data === void 0) { + return void 0; + } + return this.#queryCache.build(this, defaultedOptions).setData(data, { ...options, manual: true }); + } + setQueriesData(filters, updater, options) { + return notifyManager.batch( + () => this.#queryCache.findAll(filters).map(({ queryKey }) => [ + queryKey, + this.setQueryData(queryKey, updater, options) + ]) + ); + } + getQueryState(queryKey) { + const options = this.defaultQueryOptions({ queryKey }); + return this.#queryCache.get( + options.queryHash + )?.state; + } + removeQueries(filters) { + const queryCache = this.#queryCache; + notifyManager.batch(() => { + queryCache.findAll(filters).forEach((query) => { + queryCache.remove(query); + }); + }); + } + resetQueries(filters, options) { + const queryCache = this.#queryCache; + return notifyManager.batch(() => { + queryCache.findAll(filters).forEach((query) => { + query.reset(); + }); + return this.refetchQueries( + { + type: "active", + ...filters + }, + options + ); + }); + } + cancelQueries(filters, cancelOptions = {}) { + const defaultedCancelOptions = { revert: true, ...cancelOptions }; + const promises = notifyManager.batch( + () => this.#queryCache.findAll(filters).map((query) => query.cancel(defaultedCancelOptions)) + ); + return Promise.all(promises).then(noop).catch(noop); + } + invalidateQueries(filters, options = {}) { + return notifyManager.batch(() => { + this.#queryCache.findAll(filters).forEach((query) => { + query.invalidate(); + }); + if (filters?.refetchType === "none") { + return Promise.resolve(); + } + return this.refetchQueries( + { + ...filters, + type: filters?.refetchType ?? filters?.type ?? "active" + }, + options + ); + }); + } + refetchQueries(filters, options = {}) { + const fetchOptions = { + ...options, + cancelRefetch: options.cancelRefetch ?? true + }; + const promises = notifyManager.batch( + () => this.#queryCache.findAll(filters).filter((query) => !query.isDisabled() && !query.isStatic()).map((query) => { + let promise = query.fetch(void 0, fetchOptions); + if (!fetchOptions.throwOnError) { + promise = promise.catch(noop); + } + return query.state.fetchStatus === "paused" ? Promise.resolve() : promise; + }) + ); + return Promise.all(promises).then(noop); + } + fetchQuery(options) { + const defaultedOptions = this.defaultQueryOptions(options); + if (defaultedOptions.retry === void 0) { + defaultedOptions.retry = false; + } + const query = this.#queryCache.build(this, defaultedOptions); + return query.isStaleByTime( + resolveStaleTime(defaultedOptions.staleTime, query) + ) ? query.fetch(defaultedOptions) : Promise.resolve(query.state.data); + } + prefetchQuery(options) { + return this.fetchQuery(options).then(noop).catch(noop); + } + fetchInfiniteQuery(options) { + options.behavior = infiniteQueryBehavior(options.pages); + return this.fetchQuery(options); + } + prefetchInfiniteQuery(options) { + return this.fetchInfiniteQuery(options).then(noop).catch(noop); + } + ensureInfiniteQueryData(options) { + options.behavior = infiniteQueryBehavior(options.pages); + return this.ensureQueryData(options); + } + resumePausedMutations() { + if (onlineManager.isOnline()) { + return this.#mutationCache.resumePausedMutations(); + } + return Promise.resolve(); + } + getQueryCache() { + return this.#queryCache; + } + getMutationCache() { + return this.#mutationCache; + } + getDefaultOptions() { + return this.#defaultOptions; + } + setDefaultOptions(options) { + this.#defaultOptions = options; + } + setQueryDefaults(queryKey, options) { + this.#queryDefaults.set(hashKey(queryKey), { + queryKey, + defaultOptions: options + }); + } + getQueryDefaults(queryKey) { + const defaults = [...this.#queryDefaults.values()]; + const result = {}; + defaults.forEach((queryDefault) => { + if (partialMatchKey(queryKey, queryDefault.queryKey)) { + Object.assign(result, queryDefault.defaultOptions); + } + }); + return result; + } + setMutationDefaults(mutationKey, options) { + this.#mutationDefaults.set(hashKey(mutationKey), { + mutationKey, + defaultOptions: options + }); + } + getMutationDefaults(mutationKey) { + const defaults = [...this.#mutationDefaults.values()]; + const result = {}; + defaults.forEach((queryDefault) => { + if (partialMatchKey(mutationKey, queryDefault.mutationKey)) { + Object.assign(result, queryDefault.defaultOptions); + } + }); + return result; + } + defaultQueryOptions(options) { + if (options._defaulted) { + return options; + } + const defaultedOptions = { + ...this.#defaultOptions.queries, + ...this.getQueryDefaults(options.queryKey), + ...options, + _defaulted: true + }; + if (!defaultedOptions.queryHash) { + defaultedOptions.queryHash = hashQueryKeyByOptions( + defaultedOptions.queryKey, + defaultedOptions + ); + } + if (defaultedOptions.refetchOnReconnect === void 0) { + defaultedOptions.refetchOnReconnect = defaultedOptions.networkMode !== "always"; + } + if (defaultedOptions.throwOnError === void 0) { + defaultedOptions.throwOnError = !!defaultedOptions.suspense; + } + if (!defaultedOptions.networkMode && defaultedOptions.persister) { + defaultedOptions.networkMode = "offlineFirst"; + } + if (defaultedOptions.queryFn === skipToken) { + defaultedOptions.enabled = false; + } + return defaultedOptions; + } + defaultMutationOptions(options) { + if (options?._defaulted) { + return options; + } + return { + ...this.#defaultOptions.mutations, + ...options?.mutationKey && this.getMutationDefaults(options.mutationKey), + ...options, + _defaulted: true + }; + } + clear() { + this.#queryCache.clear(); + this.#mutationCache.clear(); + } +}; +export { + QueryClient +}; +//# sourceMappingURL=queryClient.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/queryClient.js.map b/node_modules/@tanstack/query-core/build/modern/queryClient.js.map new file mode 100644 index 0000000..eb99a52 --- /dev/null +++ b/node_modules/@tanstack/query-core/build/modern/queryClient.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/queryClient.ts"],"sourcesContent":["import {\n functionalUpdate,\n hashKey,\n hashQueryKeyByOptions,\n noop,\n partialMatchKey,\n resolveStaleTime,\n skipToken,\n} from './utils'\nimport { QueryCache } from './queryCache'\nimport { MutationCache } from './mutationCache'\nimport { focusManager } from './focusManager'\nimport { onlineManager } from './onlineManager'\nimport { notifyManager } from './notifyManager'\nimport { infiniteQueryBehavior } from './infiniteQueryBehavior'\nimport type {\n CancelOptions,\n DefaultError,\n DefaultOptions,\n DefaultedQueryObserverOptions,\n EnsureInfiniteQueryDataOptions,\n EnsureQueryDataOptions,\n FetchInfiniteQueryOptions,\n FetchQueryOptions,\n InferDataFromTag,\n InferErrorFromTag,\n InfiniteData,\n InvalidateOptions,\n InvalidateQueryFilters,\n MutationKey,\n MutationObserverOptions,\n MutationOptions,\n NoInfer,\n OmitKeyof,\n QueryClientConfig,\n QueryKey,\n QueryObserverOptions,\n QueryOptions,\n RefetchOptions,\n RefetchQueryFilters,\n ResetOptions,\n SetDataOptions,\n} from './types'\nimport type { QueryState } from './query'\nimport type { MutationFilters, QueryFilters, Updater } from './utils'\n\n// TYPES\n\ninterface QueryDefaults {\n queryKey: QueryKey\n defaultOptions: OmitKeyof, 'queryKey'>\n}\n\ninterface MutationDefaults {\n mutationKey: MutationKey\n defaultOptions: MutationOptions\n}\n\n// CLASS\n\nexport class QueryClient {\n #queryCache: QueryCache\n #mutationCache: MutationCache\n #defaultOptions: DefaultOptions\n #queryDefaults: Map\n #mutationDefaults: Map\n #mountCount: number\n #unsubscribeFocus?: () => void\n #unsubscribeOnline?: () => void\n\n constructor(config: QueryClientConfig = {}) {\n this.#queryCache = config.queryCache || new QueryCache()\n this.#mutationCache = config.mutationCache || new MutationCache()\n this.#defaultOptions = config.defaultOptions || {}\n this.#queryDefaults = new Map()\n this.#mutationDefaults = new Map()\n this.#mountCount = 0\n }\n\n mount(): void {\n this.#mountCount++\n if (this.#mountCount !== 1) return\n\n this.#unsubscribeFocus = focusManager.subscribe(async (focused) => {\n if (focused) {\n await this.resumePausedMutations()\n this.#queryCache.onFocus()\n }\n })\n this.#unsubscribeOnline = onlineManager.subscribe(async (online) => {\n if (online) {\n await this.resumePausedMutations()\n this.#queryCache.onOnline()\n }\n })\n }\n\n unmount(): void {\n this.#mountCount--\n if (this.#mountCount !== 0) return\n\n this.#unsubscribeFocus?.()\n this.#unsubscribeFocus = undefined\n\n this.#unsubscribeOnline?.()\n this.#unsubscribeOnline = undefined\n }\n\n isFetching = QueryFilters>(\n filters?: TQueryFilters,\n ): number {\n return this.#queryCache.findAll({ ...filters, fetchStatus: 'fetching' })\n .length\n }\n\n isMutating<\n TMutationFilters extends MutationFilters = MutationFilters,\n >(filters?: TMutationFilters): number {\n return this.#mutationCache.findAll({ ...filters, status: 'pending' }).length\n }\n\n /**\n * Imperative (non-reactive) way to retrieve data for a QueryKey.\n * Should only be used in callbacks or functions where reading the latest data is necessary, e.g. for optimistic updates.\n *\n * Hint: Do not use this function inside a component, because it won't receive updates.\n * Use `useQuery` to create a `QueryObserver` that subscribes to changes.\n */\n getQueryData<\n TQueryFnData = unknown,\n TTaggedQueryKey extends QueryKey = QueryKey,\n TInferredQueryFnData = InferDataFromTag,\n >(queryKey: TTaggedQueryKey): TInferredQueryFnData | undefined {\n const options = this.defaultQueryOptions({ queryKey })\n\n return this.#queryCache.get(options.queryHash)?.state\n .data\n }\n\n ensureQueryData<\n TQueryFnData,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n >(\n options: EnsureQueryDataOptions,\n ): Promise {\n const defaultedOptions = this.defaultQueryOptions(options)\n const query = this.#queryCache.build(this, defaultedOptions)\n const cachedData = query.state.data\n\n if (cachedData === undefined) {\n return this.fetchQuery(options)\n }\n\n if (\n options.revalidateIfStale &&\n query.isStaleByTime(resolveStaleTime(defaultedOptions.staleTime, query))\n ) {\n void this.prefetchQuery(defaultedOptions)\n }\n\n return Promise.resolve(cachedData)\n }\n\n getQueriesData<\n TQueryFnData = unknown,\n TQueryFilters extends QueryFilters = QueryFilters,\n >(filters: TQueryFilters): Array<[QueryKey, TQueryFnData | undefined]> {\n return this.#queryCache.findAll(filters).map(({ queryKey, state }) => {\n const data = state.data as TQueryFnData | undefined\n return [queryKey, data]\n })\n }\n\n setQueryData<\n TQueryFnData = unknown,\n TTaggedQueryKey extends QueryKey = QueryKey,\n TInferredQueryFnData = InferDataFromTag,\n >(\n queryKey: TTaggedQueryKey,\n updater: Updater<\n NoInfer | undefined,\n NoInfer | undefined\n >,\n options?: SetDataOptions,\n ): NoInfer | undefined {\n const defaultedOptions = this.defaultQueryOptions<\n any,\n any,\n unknown,\n any,\n QueryKey\n >({ queryKey })\n\n const query = this.#queryCache.get(\n defaultedOptions.queryHash,\n )\n const prevData = query?.state.data\n const data = functionalUpdate(updater, prevData)\n\n if (data === undefined) {\n return undefined\n }\n\n return this.#queryCache\n .build(this, defaultedOptions)\n .setData(data, { ...options, manual: true })\n }\n\n setQueriesData<\n TQueryFnData,\n TQueryFilters extends QueryFilters = QueryFilters,\n >(\n filters: TQueryFilters,\n updater: Updater<\n NoInfer | undefined,\n NoInfer | undefined\n >,\n options?: SetDataOptions,\n ): Array<[QueryKey, TQueryFnData | undefined]> {\n return notifyManager.batch(() =>\n this.#queryCache\n .findAll(filters)\n .map(({ queryKey }) => [\n queryKey,\n this.setQueryData(queryKey, updater, options),\n ]),\n )\n }\n\n getQueryState<\n TQueryFnData = unknown,\n TError = DefaultError,\n TTaggedQueryKey extends QueryKey = QueryKey,\n TInferredQueryFnData = InferDataFromTag,\n TInferredError = InferErrorFromTag,\n >(\n queryKey: TTaggedQueryKey,\n ): QueryState | undefined {\n const options = this.defaultQueryOptions({ queryKey })\n return this.#queryCache.get(\n options.queryHash,\n )?.state\n }\n\n removeQueries(\n filters?: QueryFilters,\n ): void {\n const queryCache = this.#queryCache\n notifyManager.batch(() => {\n queryCache.findAll(filters).forEach((query) => {\n queryCache.remove(query)\n })\n })\n }\n\n resetQueries(\n filters?: QueryFilters,\n options?: ResetOptions,\n ): Promise {\n const queryCache = this.#queryCache\n\n return notifyManager.batch(() => {\n queryCache.findAll(filters).forEach((query) => {\n query.reset()\n })\n return this.refetchQueries(\n {\n type: 'active',\n ...filters,\n },\n options,\n )\n })\n }\n\n cancelQueries(\n filters?: QueryFilters,\n cancelOptions: CancelOptions = {},\n ): Promise {\n const defaultedCancelOptions = { revert: true, ...cancelOptions }\n\n const promises = notifyManager.batch(() =>\n this.#queryCache\n .findAll(filters)\n .map((query) => query.cancel(defaultedCancelOptions)),\n )\n\n return Promise.all(promises).then(noop).catch(noop)\n }\n\n invalidateQueries(\n filters?: InvalidateQueryFilters,\n options: InvalidateOptions = {},\n ): Promise {\n return notifyManager.batch(() => {\n this.#queryCache.findAll(filters).forEach((query) => {\n query.invalidate()\n })\n\n if (filters?.refetchType === 'none') {\n return Promise.resolve()\n }\n return this.refetchQueries(\n {\n ...filters,\n type: filters?.refetchType ?? filters?.type ?? 'active',\n },\n options,\n )\n })\n }\n\n refetchQueries(\n filters?: RefetchQueryFilters,\n options: RefetchOptions = {},\n ): Promise {\n const fetchOptions = {\n ...options,\n cancelRefetch: options.cancelRefetch ?? true,\n }\n const promises = notifyManager.batch(() =>\n this.#queryCache\n .findAll(filters)\n .filter((query) => !query.isDisabled() && !query.isStatic())\n .map((query) => {\n let promise = query.fetch(undefined, fetchOptions)\n if (!fetchOptions.throwOnError) {\n promise = promise.catch(noop)\n }\n return query.state.fetchStatus === 'paused'\n ? Promise.resolve()\n : promise\n }),\n )\n\n return Promise.all(promises).then(noop)\n }\n\n fetchQuery<\n TQueryFnData,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = never,\n >(\n options: FetchQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n ): Promise {\n const defaultedOptions = this.defaultQueryOptions(options)\n\n // https://github.com/tannerlinsley/react-query/issues/652\n if (defaultedOptions.retry === undefined) {\n defaultedOptions.retry = false\n }\n\n const query = this.#queryCache.build(this, defaultedOptions)\n\n return query.isStaleByTime(\n resolveStaleTime(defaultedOptions.staleTime, query),\n )\n ? query.fetch(defaultedOptions)\n : Promise.resolve(query.state.data as TData)\n }\n\n prefetchQuery<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n >(\n options: FetchQueryOptions,\n ): Promise {\n return this.fetchQuery(options).then(noop).catch(noop)\n }\n\n fetchInfiniteQuery<\n TQueryFnData,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n >(\n options: FetchInfiniteQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n ): Promise> {\n options.behavior = infiniteQueryBehavior<\n TQueryFnData,\n TError,\n TData,\n TPageParam\n >(options.pages)\n return this.fetchQuery(options as any)\n }\n\n prefetchInfiniteQuery<\n TQueryFnData,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n >(\n options: FetchInfiniteQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n ): Promise {\n return this.fetchInfiniteQuery(options).then(noop).catch(noop)\n }\n\n ensureInfiniteQueryData<\n TQueryFnData,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n >(\n options: EnsureInfiniteQueryDataOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n ): Promise> {\n options.behavior = infiniteQueryBehavior<\n TQueryFnData,\n TError,\n TData,\n TPageParam\n >(options.pages)\n\n return this.ensureQueryData(options as any)\n }\n\n resumePausedMutations(): Promise {\n if (onlineManager.isOnline()) {\n return this.#mutationCache.resumePausedMutations()\n }\n return Promise.resolve()\n }\n\n getQueryCache(): QueryCache {\n return this.#queryCache\n }\n\n getMutationCache(): MutationCache {\n return this.#mutationCache\n }\n\n getDefaultOptions(): DefaultOptions {\n return this.#defaultOptions\n }\n\n setDefaultOptions(options: DefaultOptions): void {\n this.#defaultOptions = options\n }\n\n setQueryDefaults<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryData = TQueryFnData,\n >(\n queryKey: QueryKey,\n options: Partial<\n OmitKeyof<\n QueryObserverOptions,\n 'queryKey'\n >\n >,\n ): void {\n this.#queryDefaults.set(hashKey(queryKey), {\n queryKey,\n defaultOptions: options,\n })\n }\n\n getQueryDefaults(\n queryKey: QueryKey,\n ): OmitKeyof, 'queryKey'> {\n const defaults = [...this.#queryDefaults.values()]\n\n const result: OmitKeyof<\n QueryObserverOptions,\n 'queryKey'\n > = {}\n\n defaults.forEach((queryDefault) => {\n if (partialMatchKey(queryKey, queryDefault.queryKey)) {\n Object.assign(result, queryDefault.defaultOptions)\n }\n })\n return result\n }\n\n setMutationDefaults<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n >(\n mutationKey: MutationKey,\n options: OmitKeyof<\n MutationObserverOptions,\n 'mutationKey'\n >,\n ): void {\n this.#mutationDefaults.set(hashKey(mutationKey), {\n mutationKey,\n defaultOptions: options,\n })\n }\n\n getMutationDefaults(\n mutationKey: MutationKey,\n ): OmitKeyof, 'mutationKey'> {\n const defaults = [...this.#mutationDefaults.values()]\n\n const result: OmitKeyof<\n MutationObserverOptions,\n 'mutationKey'\n > = {}\n\n defaults.forEach((queryDefault) => {\n if (partialMatchKey(mutationKey, queryDefault.mutationKey)) {\n Object.assign(result, queryDefault.defaultOptions)\n }\n })\n\n return result\n }\n\n defaultQueryOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = never,\n >(\n options:\n | QueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey,\n TPageParam\n >\n | DefaultedQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >,\n ): DefaultedQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n > {\n if (options._defaulted) {\n return options as DefaultedQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >\n }\n\n const defaultedOptions = {\n ...this.#defaultOptions.queries,\n ...this.getQueryDefaults(options.queryKey),\n ...options,\n _defaulted: true,\n }\n\n if (!defaultedOptions.queryHash) {\n defaultedOptions.queryHash = hashQueryKeyByOptions(\n defaultedOptions.queryKey,\n defaultedOptions,\n )\n }\n\n // dependent default values\n if (defaultedOptions.refetchOnReconnect === undefined) {\n defaultedOptions.refetchOnReconnect =\n defaultedOptions.networkMode !== 'always'\n }\n if (defaultedOptions.throwOnError === undefined) {\n defaultedOptions.throwOnError = !!defaultedOptions.suspense\n }\n\n if (!defaultedOptions.networkMode && defaultedOptions.persister) {\n defaultedOptions.networkMode = 'offlineFirst'\n }\n\n if (defaultedOptions.queryFn === skipToken) {\n defaultedOptions.enabled = false\n }\n\n return defaultedOptions as DefaultedQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >\n }\n\n defaultMutationOptions>(\n options?: T,\n ): T {\n if (options?._defaulted) {\n return options\n }\n return {\n ...this.#defaultOptions.mutations,\n ...(options?.mutationKey &&\n this.getMutationDefaults(options.mutationKey)),\n ...options,\n _defaulted: true,\n } as T\n }\n\n clear(): void {\n this.#queryCache.clear()\n this.#mutationCache.clear()\n }\n}\n"],"mappings":";AAAA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,kBAAkB;AAC3B,SAAS,qBAAqB;AAC9B,SAAS,oBAAoB;AAC7B,SAAS,qBAAqB;AAC9B,SAAS,qBAAqB;AAC9B,SAAS,6BAA6B;AA8C/B,IAAM,cAAN,MAAkB;AAAA,EACvB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EAEA,YAAY,SAA4B,CAAC,GAAG;AAC1C,SAAK,cAAc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aAAO;AAAA,IAOT;AAEA,UAAM,mBAAmB;AAAA,MACvB,GAAG,KAAK,gBAAgB;AAAA,MACxB,GAAG,KAAK,iBAAiB,QAAQ,QAAQ;AAAA,MACzC,GAAG;AAAA,MACH,YAAY;AAAA,IACd;AAEA,QAAI,CAAC,iBAAiB,WAAW;AAC/B,uBAAiB,YAAY;AAAA,QAC3B,iBAAiB;AAAA,QACjB;AAAA,MACF;AAAA,IACF;AAGA,QAAI,iBAAiB,uBAAuB,QAAW;AACrD,uBAAiB,qBACf,iBAAiB,gBAAgB;AAAA,IACrC;AACA,QAAI,iBAAiB,iBAAiB,QAAW;AAC/C,uBAAiB,eAAe,CAAC,CAAC,iBAAiB;AAAA,IACrD;AAEA,QAAI,CAAC,iBAAiB,eAAe,iBAAiB,WAAW;AAC/D,uBAAiB,cAAc;AAAA,IACjC;AAEA,QAAI,iBAAiB,YAAY,WAAW;AAC1C,uBAAiB,UAAU;AAAA,IAC7B;AAEA,WAAO;AAAA,EAOT;AAAA,EAEA,uBACE,SACG;AACH,QAAI,SAAS,YAAY;AACvB,aAAO;AAAA,IACT;AACA,WAAO;AAAA,MACL,GAAG,KAAK,gBAAgB;AAAA,MACxB,GAAI,SAAS,eACX,KAAK,oBAAoB,QAAQ,WAAW;AAAA,MAC9C,GAAG;AAAA,MACH,YAAY;AAAA,IACd;AAAA,EACF;AAAA,EAEA,QAAc;AACZ,SAAK,YAAY,MAAM;AACvB,SAAK,eAAe,MAAM;AAAA,EAC5B;AACF;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/queryObserver.cjs b/node_modules/@tanstack/query-core/build/modern/queryObserver.cjs new file mode 100644 index 0000000..17db827 --- /dev/null +++ b/node_modules/@tanstack/query-core/build/modern/queryObserver.cjs @@ -0,0 +1,488 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/queryObserver.ts +var queryObserver_exports = {}; +__export(queryObserver_exports, { + QueryObserver: () => QueryObserver +}); +module.exports = __toCommonJS(queryObserver_exports); +var import_focusManager = require("./focusManager.cjs"); +var import_notifyManager = require("./notifyManager.cjs"); +var import_query = require("./query.cjs"); +var import_subscribable = require("./subscribable.cjs"); +var import_thenable = require("./thenable.cjs"); +var import_utils = require("./utils.cjs"); +var import_timeoutManager = require("./timeoutManager.cjs"); +var QueryObserver = class extends import_subscribable.Subscribable { + constructor(client, options) { + super(); + this.options = options; + this.#client = client; + this.#selectError = null; + this.#currentThenable = (0, import_thenable.pendingThenable)(); + this.bindMethods(); + this.setOptions(options); + } + #client; + #currentQuery = void 0; + #currentQueryInitialState = void 0; + #currentResult = void 0; + #currentResultState; + #currentResultOptions; + #currentThenable; + #selectError; + #selectFn; + #selectResult; + // This property keeps track of the last query with defined data. + // It will be used to pass the previous data and query to the placeholder function between renders. + #lastQueryWithDefinedData; + #staleTimeoutId; + #refetchIntervalId; + #currentRefetchInterval; + #trackedProps = /* @__PURE__ */ new Set(); + bindMethods() { + this.refetch = this.refetch.bind(this); + } + onSubscribe() { + if (this.listeners.size === 1) { + this.#currentQuery.addObserver(this); + if (shouldFetchOnMount(this.#currentQuery, this.options)) { + this.#executeFetch(); + } else { + this.updateResult(); + } + this.#updateTimers(); + } + } + onUnsubscribe() { + if (!this.hasListeners()) { + this.destroy(); + } + } + shouldFetchOnReconnect() { + return shouldFetchOn( + this.#currentQuery, + this.options, + this.options.refetchOnReconnect + ); + } + shouldFetchOnWindowFocus() { + return shouldFetchOn( + this.#currentQuery, + this.options, + this.options.refetchOnWindowFocus + ); + } + destroy() { + this.listeners = /* @__PURE__ */ new Set(); + this.#clearStaleTimeout(); + this.#clearRefetchInterval(); + this.#currentQuery.removeObserver(this); + } + setOptions(options) { + const prevOptions = this.options; + const prevQuery = this.#currentQuery; + this.options = this.#client.defaultQueryOptions(options); + if (this.options.enabled !== void 0 && typeof this.options.enabled !== "boolean" && typeof this.options.enabled !== "function" && typeof (0, import_utils.resolveEnabled)(this.options.enabled, this.#currentQuery) !== "boolean") { + throw new Error( + "Expected enabled to be a boolean or a callback that returns a boolean" + ); + } + this.#updateQuery(); + this.#currentQuery.setOptions(this.options); + if (prevOptions._defaulted && !(0, import_utils.shallowEqualObjects)(this.options, prevOptions)) { + this.#client.getQueryCache().notify({ + type: "observerOptionsUpdated", + query: this.#currentQuery, + observer: this + }); + } + const mounted = this.hasListeners(); + if (mounted && shouldFetchOptionally( + this.#currentQuery, + prevQuery, + this.options, + prevOptions + )) { + this.#executeFetch(); + } + this.updateResult(); + if (mounted && (this.#currentQuery !== prevQuery || (0, import_utils.resolveEnabled)(this.options.enabled, this.#currentQuery) !== (0, import_utils.resolveEnabled)(prevOptions.enabled, this.#currentQuery) || (0, import_utils.resolveStaleTime)(this.options.staleTime, this.#currentQuery) !== (0, import_utils.resolveStaleTime)(prevOptions.staleTime, this.#currentQuery))) { + this.#updateStaleTimeout(); + } + const nextRefetchInterval = this.#computeRefetchInterval(); + if (mounted && (this.#currentQuery !== prevQuery || (0, import_utils.resolveEnabled)(this.options.enabled, this.#currentQuery) !== (0, import_utils.resolveEnabled)(prevOptions.enabled, this.#currentQuery) || nextRefetchInterval !== this.#currentRefetchInterval)) { + this.#updateRefetchInterval(nextRefetchInterval); + } + } + getOptimisticResult(options) { + const query = this.#client.getQueryCache().build(this.#client, options); + const result = this.createResult(query, options); + if (shouldAssignObserverCurrentProperties(this, result)) { + this.#currentResult = result; + this.#currentResultOptions = this.options; + this.#currentResultState = this.#currentQuery.state; + } + return result; + } + getCurrentResult() { + return this.#currentResult; + } + trackResult(result, onPropTracked) { + return new Proxy(result, { + get: (target, key) => { + this.trackProp(key); + onPropTracked?.(key); + if (key === "promise") { + this.trackProp("data"); + if (!this.options.experimental_prefetchInRender && this.#currentThenable.status === "pending") { + this.#currentThenable.reject( + new Error( + "experimental_prefetchInRender feature flag is not enabled" + ) + ); + } + } + return Reflect.get(target, key); + } + }); + } + trackProp(key) { + this.#trackedProps.add(key); + } + getCurrentQuery() { + return this.#currentQuery; + } + refetch({ ...options } = {}) { + return this.fetch({ + ...options + }); + } + fetchOptimistic(options) { + const defaultedOptions = this.#client.defaultQueryOptions(options); + const query = this.#client.getQueryCache().build(this.#client, defaultedOptions); + return query.fetch().then(() => this.createResult(query, defaultedOptions)); + } + fetch(fetchOptions) { + return this.#executeFetch({ + ...fetchOptions, + cancelRefetch: fetchOptions.cancelRefetch ?? true + }).then(() => { + this.updateResult(); + return this.#currentResult; + }); + } + #executeFetch(fetchOptions) { + this.#updateQuery(); + let promise = this.#currentQuery.fetch( + this.options, + fetchOptions + ); + if (!fetchOptions?.throwOnError) { + promise = promise.catch(import_utils.noop); + } + return promise; + } + #updateStaleTimeout() { + this.#clearStaleTimeout(); + const staleTime = (0, import_utils.resolveStaleTime)( + this.options.staleTime, + this.#currentQuery + ); + if (import_utils.isServer || this.#currentResult.isStale || !(0, import_utils.isValidTimeout)(staleTime)) { + return; + } + const time = (0, import_utils.timeUntilStale)(this.#currentResult.dataUpdatedAt, staleTime); + const timeout = time + 1; + this.#staleTimeoutId = import_timeoutManager.timeoutManager.setTimeout(() => { + if (!this.#currentResult.isStale) { + this.updateResult(); + } + }, timeout); + } + #computeRefetchInterval() { + return (typeof this.options.refetchInterval === "function" ? this.options.refetchInterval(this.#currentQuery) : this.options.refetchInterval) ?? false; + } + #updateRefetchInterval(nextInterval) { + this.#clearRefetchInterval(); + this.#currentRefetchInterval = nextInterval; + if (import_utils.isServer || (0, import_utils.resolveEnabled)(this.options.enabled, this.#currentQuery) === false || !(0, import_utils.isValidTimeout)(this.#currentRefetchInterval) || this.#currentRefetchInterval === 0) { + return; + } + this.#refetchIntervalId = import_timeoutManager.timeoutManager.setInterval(() => { + if (this.options.refetchIntervalInBackground || import_focusManager.focusManager.isFocused()) { + this.#executeFetch(); + } + }, this.#currentRefetchInterval); + } + #updateTimers() { + this.#updateStaleTimeout(); + this.#updateRefetchInterval(this.#computeRefetchInterval()); + } + #clearStaleTimeout() { + if (this.#staleTimeoutId) { + import_timeoutManager.timeoutManager.clearTimeout(this.#staleTimeoutId); + this.#staleTimeoutId = void 0; + } + } + #clearRefetchInterval() { + if (this.#refetchIntervalId) { + import_timeoutManager.timeoutManager.clearInterval(this.#refetchIntervalId); + this.#refetchIntervalId = void 0; + } + } + createResult(query, options) { + const prevQuery = this.#currentQuery; + const prevOptions = this.options; + const prevResult = this.#currentResult; + const prevResultState = this.#currentResultState; + const prevResultOptions = this.#currentResultOptions; + const queryChange = query !== prevQuery; + const queryInitialState = queryChange ? query.state : this.#currentQueryInitialState; + const { state } = query; + let newState = { ...state }; + let isPlaceholderData = false; + let data; + if (options._optimisticResults) { + const mounted = this.hasListeners(); + const fetchOnMount = !mounted && shouldFetchOnMount(query, options); + const fetchOptionally = mounted && shouldFetchOptionally(query, prevQuery, options, prevOptions); + if (fetchOnMount || fetchOptionally) { + newState = { + ...newState, + ...(0, import_query.fetchState)(state.data, query.options) + }; + } + if (options._optimisticResults === "isRestoring") { + newState.fetchStatus = "idle"; + } + } + let { error, errorUpdatedAt, status } = newState; + data = newState.data; + let skipSelect = false; + if (options.placeholderData !== void 0 && data === void 0 && status === "pending") { + let placeholderData; + if (prevResult?.isPlaceholderData && options.placeholderData === prevResultOptions?.placeholderData) { + placeholderData = prevResult.data; + skipSelect = true; + } else { + placeholderData = typeof options.placeholderData === "function" ? options.placeholderData( + this.#lastQueryWithDefinedData?.state.data, + this.#lastQueryWithDefinedData + ) : options.placeholderData; + } + if (placeholderData !== void 0) { + status = "success"; + data = (0, import_utils.replaceData)( + prevResult?.data, + placeholderData, + options + ); + isPlaceholderData = true; + } + } + if (options.select && data !== void 0 && !skipSelect) { + if (prevResult && data === prevResultState?.data && options.select === this.#selectFn) { + data = this.#selectResult; + } else { + try { + this.#selectFn = options.select; + data = options.select(data); + data = (0, import_utils.replaceData)(prevResult?.data, data, options); + this.#selectResult = data; + this.#selectError = null; + } catch (selectError) { + this.#selectError = selectError; + } + } + } + if (this.#selectError) { + error = this.#selectError; + data = this.#selectResult; + errorUpdatedAt = Date.now(); + status = "error"; + } + const isFetching = newState.fetchStatus === "fetching"; + const isPending = status === "pending"; + const isError = status === "error"; + const isLoading = isPending && isFetching; + const hasData = data !== void 0; + const result = { + status, + fetchStatus: newState.fetchStatus, + isPending, + isSuccess: status === "success", + isError, + isInitialLoading: isLoading, + isLoading, + data, + dataUpdatedAt: newState.dataUpdatedAt, + error, + errorUpdatedAt, + failureCount: newState.fetchFailureCount, + failureReason: newState.fetchFailureReason, + errorUpdateCount: newState.errorUpdateCount, + isFetched: newState.dataUpdateCount > 0 || newState.errorUpdateCount > 0, + isFetchedAfterMount: newState.dataUpdateCount > queryInitialState.dataUpdateCount || newState.errorUpdateCount > queryInitialState.errorUpdateCount, + isFetching, + isRefetching: isFetching && !isPending, + isLoadingError: isError && !hasData, + isPaused: newState.fetchStatus === "paused", + isPlaceholderData, + isRefetchError: isError && hasData, + isStale: isStale(query, options), + refetch: this.refetch, + promise: this.#currentThenable, + isEnabled: (0, import_utils.resolveEnabled)(options.enabled, query) !== false + }; + const nextResult = result; + if (this.options.experimental_prefetchInRender) { + const hasResultData = nextResult.data !== void 0; + const isErrorWithoutData = nextResult.status === "error" && !hasResultData; + const finalizeThenableIfPossible = (thenable) => { + if (isErrorWithoutData) { + thenable.reject(nextResult.error); + } else if (hasResultData) { + thenable.resolve(nextResult.data); + } + }; + const recreateThenable = () => { + const pending = this.#currentThenable = nextResult.promise = (0, import_thenable.pendingThenable)(); + finalizeThenableIfPossible(pending); + }; + const prevThenable = this.#currentThenable; + switch (prevThenable.status) { + case "pending": + if (query.queryHash === prevQuery.queryHash) { + finalizeThenableIfPossible(prevThenable); + } + break; + case "fulfilled": + if (isErrorWithoutData || nextResult.data !== prevThenable.value) { + recreateThenable(); + } + break; + case "rejected": + if (!isErrorWithoutData || nextResult.error !== prevThenable.reason) { + recreateThenable(); + } + break; + } + } + return nextResult; + } + updateResult() { + const prevResult = this.#currentResult; + const nextResult = this.createResult(this.#currentQuery, this.options); + this.#currentResultState = this.#currentQuery.state; + this.#currentResultOptions = this.options; + if (this.#currentResultState.data !== void 0) { + this.#lastQueryWithDefinedData = this.#currentQuery; + } + if ((0, import_utils.shallowEqualObjects)(nextResult, prevResult)) { + return; + } + this.#currentResult = nextResult; + const shouldNotifyListeners = () => { + if (!prevResult) { + return true; + } + const { notifyOnChangeProps } = this.options; + const notifyOnChangePropsValue = typeof notifyOnChangeProps === "function" ? notifyOnChangeProps() : notifyOnChangeProps; + if (notifyOnChangePropsValue === "all" || !notifyOnChangePropsValue && !this.#trackedProps.size) { + return true; + } + const includedProps = new Set( + notifyOnChangePropsValue ?? this.#trackedProps + ); + if (this.options.throwOnError) { + includedProps.add("error"); + } + return Object.keys(this.#currentResult).some((key) => { + const typedKey = key; + const changed = this.#currentResult[typedKey] !== prevResult[typedKey]; + return changed && includedProps.has(typedKey); + }); + }; + this.#notify({ listeners: shouldNotifyListeners() }); + } + #updateQuery() { + const query = this.#client.getQueryCache().build(this.#client, this.options); + if (query === this.#currentQuery) { + return; + } + const prevQuery = this.#currentQuery; + this.#currentQuery = query; + this.#currentQueryInitialState = query.state; + if (this.hasListeners()) { + prevQuery?.removeObserver(this); + query.addObserver(this); + } + } + onQueryUpdate() { + this.updateResult(); + if (this.hasListeners()) { + this.#updateTimers(); + } + } + #notify(notifyOptions) { + import_notifyManager.notifyManager.batch(() => { + if (notifyOptions.listeners) { + this.listeners.forEach((listener) => { + listener(this.#currentResult); + }); + } + this.#client.getQueryCache().notify({ + query: this.#currentQuery, + type: "observerResultsUpdated" + }); + }); + } +}; +function shouldLoadOnMount(query, options) { + return (0, import_utils.resolveEnabled)(options.enabled, query) !== false && query.state.data === void 0 && !(query.state.status === "error" && options.retryOnMount === false); +} +function shouldFetchOnMount(query, options) { + return shouldLoadOnMount(query, options) || query.state.data !== void 0 && shouldFetchOn(query, options, options.refetchOnMount); +} +function shouldFetchOn(query, options, field) { + if ((0, import_utils.resolveEnabled)(options.enabled, query) !== false && (0, import_utils.resolveStaleTime)(options.staleTime, query) !== "static") { + const value = typeof field === "function" ? field(query) : field; + return value === "always" || value !== false && isStale(query, options); + } + return false; +} +function shouldFetchOptionally(query, prevQuery, options, prevOptions) { + return (query !== prevQuery || (0, import_utils.resolveEnabled)(prevOptions.enabled, query) === false) && (!options.suspense || query.state.status !== "error") && isStale(query, options); +} +function isStale(query, options) { + return (0, import_utils.resolveEnabled)(options.enabled, query) !== false && query.isStaleByTime((0, import_utils.resolveStaleTime)(options.staleTime, query)); +} +function shouldAssignObserverCurrentProperties(observer, optimisticResult) { + if (!(0, import_utils.shallowEqualObjects)(observer.getCurrentResult(), optimisticResult)) { + return true; + } + return false; +} +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + QueryObserver +}); +//# sourceMappingURL=queryObserver.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/queryObserver.cjs.map b/node_modules/@tanstack/query-core/build/modern/queryObserver.cjs.map new file mode 100644 index 0000000..55176d0 --- /dev/null +++ b/node_modules/@tanstack/query-core/build/modern/queryObserver.cjs.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/queryObserver.ts"],"sourcesContent":["import { focusManager } from './focusManager'\nimport { notifyManager } from './notifyManager'\nimport { fetchState } from './query'\nimport { Subscribable } from './subscribable'\nimport { pendingThenable } from './thenable'\nimport {\n isServer,\n isValidTimeout,\n noop,\n replaceData,\n resolveEnabled,\n resolveStaleTime,\n shallowEqualObjects,\n timeUntilStale,\n} from './utils'\nimport { timeoutManager } from './timeoutManager'\nimport type { ManagedTimerId } from './timeoutManager'\nimport type { FetchOptions, Query, QueryState } from './query'\nimport type { QueryClient } from './queryClient'\nimport type { PendingThenable, Thenable } from './thenable'\nimport type {\n DefaultError,\n DefaultedQueryObserverOptions,\n PlaceholderDataFunction,\n QueryKey,\n QueryObserverBaseResult,\n QueryObserverOptions,\n QueryObserverResult,\n RefetchOptions,\n} from './types'\n\ntype QueryObserverListener = (\n result: QueryObserverResult,\n) => void\n\ninterface ObserverFetchOptions extends FetchOptions {\n throwOnError?: boolean\n}\n\nexport class QueryObserver<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> extends Subscribable> {\n #client: QueryClient\n #currentQuery: Query = undefined!\n #currentQueryInitialState: QueryState = undefined!\n #currentResult: QueryObserverResult = undefined!\n #currentResultState?: QueryState\n #currentResultOptions?: QueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >\n #currentThenable: Thenable\n #selectError: TError | null\n #selectFn?: (data: TQueryData) => TData\n #selectResult?: TData\n // This property keeps track of the last query with defined data.\n // It will be used to pass the previous data and query to the placeholder function between renders.\n #lastQueryWithDefinedData?: Query\n #staleTimeoutId?: ManagedTimerId\n #refetchIntervalId?: ManagedTimerId\n #currentRefetchInterval?: number | false\n #trackedProps = new Set()\n\n constructor(\n client: QueryClient,\n public options: QueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >,\n ) {\n super()\n\n this.#client = client\n this.#selectError = null\n this.#currentThenable = pendingThenable()\n\n this.bindMethods()\n this.setOptions(options)\n }\n\n protected bindMethods(): void {\n this.refetch = this.refetch.bind(this)\n }\n\n protected onSubscribe(): void {\n if (this.listeners.size === 1) {\n this.#currentQuery.addObserver(this)\n\n if (shouldFetchOnMount(this.#currentQuery, this.options)) {\n this.#executeFetch()\n } else {\n this.updateResult()\n }\n\n this.#updateTimers()\n }\n }\n\n protected onUnsubscribe(): void {\n if (!this.hasListeners()) {\n this.destroy()\n }\n }\n\n shouldFetchOnReconnect(): boolean {\n return shouldFetchOn(\n this.#currentQuery,\n this.options,\n this.options.refetchOnReconnect,\n )\n }\n\n shouldFetchOnWindowFocus(): boolean {\n return shouldFetchOn(\n this.#currentQuery,\n this.options,\n this.options.refetchOnWindowFocus,\n )\n }\n\n destroy(): void {\n this.listeners = new Set()\n this.#clearStaleTimeout()\n this.#clearRefetchInterval()\n this.#currentQuery.removeObserver(this)\n }\n\n setOptions(\n options: QueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >,\n ): void {\n const prevOptions = this.options\n const prevQuery = this.#currentQuery\n\n this.options = this.#client.defaultQueryOptions(options)\n\n if (\n this.options.enabled !== undefined &&\n typeof this.options.enabled !== 'boolean' &&\n typeof this.options.enabled !== 'function' &&\n typeof resolveEnabled(this.options.enabled, this.#currentQuery) !==\n 'boolean'\n ) {\n throw new Error(\n 'Expected enabled to be a boolean or a callback that returns a boolean',\n )\n }\n\n this.#updateQuery()\n this.#currentQuery.setOptions(this.options)\n\n if (\n prevOptions._defaulted &&\n !shallowEqualObjects(this.options, prevOptions)\n ) {\n this.#client.getQueryCache().notify({\n type: 'observerOptionsUpdated',\n query: this.#currentQuery,\n observer: this,\n })\n }\n\n const mounted = this.hasListeners()\n\n // Fetch if there are subscribers\n if (\n mounted &&\n shouldFetchOptionally(\n this.#currentQuery,\n prevQuery,\n this.options,\n prevOptions,\n )\n ) {\n this.#executeFetch()\n }\n\n // Update result\n this.updateResult()\n\n // Update stale interval if needed\n if (\n mounted &&\n (this.#currentQuery !== prevQuery ||\n resolveEnabled(this.options.enabled, this.#currentQuery) !==\n resolveEnabled(prevOptions.enabled, this.#currentQuery) ||\n resolveStaleTime(this.options.staleTime, this.#currentQuery) !==\n resolveStaleTime(prevOptions.staleTime, this.#currentQuery))\n ) {\n this.#updateStaleTimeout()\n }\n\n const nextRefetchInterval = this.#computeRefetchInterval()\n\n // Update refetch interval if needed\n if (\n mounted &&\n (this.#currentQuery !== prevQuery ||\n resolveEnabled(this.options.enabled, this.#currentQuery) !==\n resolveEnabled(prevOptions.enabled, this.#currentQuery) ||\n nextRefetchInterval !== this.#currentRefetchInterval)\n ) {\n this.#updateRefetchInterval(nextRefetchInterval)\n }\n }\n\n getOptimisticResult(\n options: DefaultedQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >,\n ): QueryObserverResult {\n const query = this.#client.getQueryCache().build(this.#client, options)\n\n const result = this.createResult(query, options)\n\n if (shouldAssignObserverCurrentProperties(this, result)) {\n // this assigns the optimistic result to the current Observer\n // because if the query function changes, useQuery will be performing\n // an effect where it would fetch again.\n // When the fetch finishes, we perform a deep data cloning in order\n // to reuse objects references. This deep data clone is performed against\n // the `observer.currentResult.data` property\n // When QueryKey changes, we refresh the query and get new `optimistic`\n // result, while we leave the `observer.currentResult`, so when new data\n // arrives, it finds the old `observer.currentResult` which is related\n // to the old QueryKey. Which means that currentResult and selectData are\n // out of sync already.\n // To solve this, we move the cursor of the currentResult every time\n // an observer reads an optimistic value.\n\n // When keeping the previous data, the result doesn't change until new\n // data arrives.\n this.#currentResult = result\n this.#currentResultOptions = this.options\n this.#currentResultState = this.#currentQuery.state\n }\n return result\n }\n\n getCurrentResult(): QueryObserverResult {\n return this.#currentResult\n }\n\n trackResult(\n result: QueryObserverResult,\n onPropTracked?: (key: keyof QueryObserverResult) => void,\n ): QueryObserverResult {\n return new Proxy(result, {\n get: (target, key) => {\n this.trackProp(key as keyof QueryObserverResult)\n onPropTracked?.(key as keyof QueryObserverResult)\n if (key === 'promise') {\n this.trackProp('data')\n if (\n !this.options.experimental_prefetchInRender &&\n this.#currentThenable.status === 'pending'\n ) {\n this.#currentThenable.reject(\n new Error(\n 'experimental_prefetchInRender feature flag is not enabled',\n ),\n )\n }\n }\n return Reflect.get(target, key)\n },\n })\n }\n\n trackProp(key: keyof QueryObserverResult) {\n this.#trackedProps.add(key)\n }\n\n getCurrentQuery(): Query {\n return this.#currentQuery\n }\n\n refetch({ ...options }: RefetchOptions = {}): Promise<\n QueryObserverResult\n > {\n return this.fetch({\n ...options,\n })\n }\n\n fetchOptimistic(\n options: QueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >,\n ): Promise> {\n const defaultedOptions = this.#client.defaultQueryOptions(options)\n\n const query = this.#client\n .getQueryCache()\n .build(this.#client, defaultedOptions)\n\n return query.fetch().then(() => this.createResult(query, defaultedOptions))\n }\n\n protected fetch(\n fetchOptions: ObserverFetchOptions,\n ): Promise> {\n return this.#executeFetch({\n ...fetchOptions,\n cancelRefetch: fetchOptions.cancelRefetch ?? true,\n }).then(() => {\n this.updateResult()\n return this.#currentResult\n })\n }\n\n #executeFetch(\n fetchOptions?: Omit,\n ): Promise {\n // Make sure we reference the latest query as the current one might have been removed\n this.#updateQuery()\n\n // Fetch\n let promise: Promise = this.#currentQuery.fetch(\n this.options,\n fetchOptions,\n )\n\n if (!fetchOptions?.throwOnError) {\n promise = promise.catch(noop)\n }\n\n return promise\n }\n\n #updateStaleTimeout(): void {\n this.#clearStaleTimeout()\n const staleTime = resolveStaleTime(\n this.options.staleTime,\n this.#currentQuery,\n )\n\n if (isServer || this.#currentResult.isStale || !isValidTimeout(staleTime)) {\n return\n }\n\n const time = timeUntilStale(this.#currentResult.dataUpdatedAt, staleTime)\n\n // The timeout is sometimes triggered 1 ms before the stale time expiration.\n // To mitigate this issue we always add 1 ms to the timeout.\n const timeout = time + 1\n\n this.#staleTimeoutId = timeoutManager.setTimeout(() => {\n if (!this.#currentResult.isStale) {\n this.updateResult()\n }\n }, timeout)\n }\n\n #computeRefetchInterval() {\n return (\n (typeof this.options.refetchInterval === 'function'\n ? this.options.refetchInterval(this.#currentQuery)\n : this.options.refetchInterval) ?? false\n )\n }\n\n #updateRefetchInterval(nextInterval: number | false): void {\n this.#clearRefetchInterval()\n\n this.#currentRefetchInterval = nextInterval\n\n if (\n isServer ||\n resolveEnabled(this.options.enabled, this.#currentQuery) === false ||\n !isValidTimeout(this.#currentRefetchInterval) ||\n this.#currentRefetchInterval === 0\n ) {\n return\n }\n\n this.#refetchIntervalId = timeoutManager.setInterval(() => {\n if (\n this.options.refetchIntervalInBackground ||\n focusManager.isFocused()\n ) {\n this.#executeFetch()\n }\n }, this.#currentRefetchInterval)\n }\n\n #updateTimers(): void {\n this.#updateStaleTimeout()\n this.#updateRefetchInterval(this.#computeRefetchInterval())\n }\n\n #clearStaleTimeout(): void {\n if (this.#staleTimeoutId) {\n timeoutManager.clearTimeout(this.#staleTimeoutId)\n this.#staleTimeoutId = undefined\n }\n }\n\n #clearRefetchInterval(): void {\n if (this.#refetchIntervalId) {\n timeoutManager.clearInterval(this.#refetchIntervalId)\n this.#refetchIntervalId = undefined\n }\n }\n\n protected createResult(\n query: Query,\n options: QueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >,\n ): QueryObserverResult {\n const prevQuery = this.#currentQuery\n const prevOptions = this.options\n const prevResult = this.#currentResult as\n | QueryObserverResult\n | undefined\n const prevResultState = this.#currentResultState\n const prevResultOptions = this.#currentResultOptions\n const queryChange = query !== prevQuery\n const queryInitialState = queryChange\n ? query.state\n : this.#currentQueryInitialState\n\n const { state } = query\n let newState = { ...state }\n let isPlaceholderData = false\n let data: TData | undefined\n\n // Optimistically set result in fetching state if needed\n if (options._optimisticResults) {\n const mounted = this.hasListeners()\n\n const fetchOnMount = !mounted && shouldFetchOnMount(query, options)\n\n const fetchOptionally =\n mounted && shouldFetchOptionally(query, prevQuery, options, prevOptions)\n\n if (fetchOnMount || fetchOptionally) {\n newState = {\n ...newState,\n ...fetchState(state.data, query.options),\n }\n }\n if (options._optimisticResults === 'isRestoring') {\n newState.fetchStatus = 'idle'\n }\n }\n\n let { error, errorUpdatedAt, status } = newState\n\n // Per default, use query data\n data = newState.data as unknown as TData\n let skipSelect = false\n\n // use placeholderData if needed\n if (\n options.placeholderData !== undefined &&\n data === undefined &&\n status === 'pending'\n ) {\n let placeholderData\n\n // Memoize placeholder data\n if (\n prevResult?.isPlaceholderData &&\n options.placeholderData === prevResultOptions?.placeholderData\n ) {\n placeholderData = prevResult.data\n // we have to skip select when reading this memoization\n // because prevResult.data is already \"selected\"\n skipSelect = true\n } else {\n // compute placeholderData\n placeholderData =\n typeof options.placeholderData === 'function'\n ? (\n options.placeholderData as unknown as PlaceholderDataFunction\n )(\n this.#lastQueryWithDefinedData?.state.data,\n this.#lastQueryWithDefinedData as any,\n )\n : options.placeholderData\n }\n\n if (placeholderData !== undefined) {\n status = 'success'\n data = replaceData(\n prevResult?.data,\n placeholderData as unknown,\n options,\n ) as TData\n isPlaceholderData = true\n }\n }\n\n // Select data if needed\n // this also runs placeholderData through the select function\n if (options.select && data !== undefined && !skipSelect) {\n // Memoize select result\n if (\n prevResult &&\n data === prevResultState?.data &&\n options.select === this.#selectFn\n ) {\n data = this.#selectResult\n } else {\n try {\n this.#selectFn = options.select\n data = options.select(data as any)\n data = replaceData(prevResult?.data, data, options)\n this.#selectResult = data\n this.#selectError = null\n } catch (selectError) {\n this.#selectError = selectError as TError\n }\n }\n }\n\n if (this.#selectError) {\n error = this.#selectError\n data = this.#selectResult\n errorUpdatedAt = Date.now()\n status = 'error'\n }\n\n const isFetching = newState.fetchStatus === 'fetching'\n const isPending = status === 'pending'\n const isError = status === 'error'\n\n const isLoading = isPending && isFetching\n const hasData = data !== undefined\n\n const result: QueryObserverBaseResult = {\n status,\n fetchStatus: newState.fetchStatus,\n isPending,\n isSuccess: status === 'success',\n isError,\n isInitialLoading: isLoading,\n isLoading,\n data,\n dataUpdatedAt: newState.dataUpdatedAt,\n error,\n errorUpdatedAt,\n failureCount: newState.fetchFailureCount,\n failureReason: newState.fetchFailureReason,\n errorUpdateCount: newState.errorUpdateCount,\n isFetched: newState.dataUpdateCount > 0 || newState.errorUpdateCount > 0,\n isFetchedAfterMount:\n newState.dataUpdateCount > queryInitialState.dataUpdateCount ||\n newState.errorUpdateCount > queryInitialState.errorUpdateCount,\n isFetching,\n isRefetching: isFetching && !isPending,\n isLoadingError: isError && !hasData,\n isPaused: newState.fetchStatus === 'paused',\n isPlaceholderData,\n isRefetchError: isError && hasData,\n isStale: isStale(query, options),\n refetch: this.refetch,\n promise: this.#currentThenable,\n isEnabled: resolveEnabled(options.enabled, query) !== false,\n }\n\n const nextResult = result as QueryObserverResult\n\n if (this.options.experimental_prefetchInRender) {\n const hasResultData = nextResult.data !== undefined\n const isErrorWithoutData = nextResult.status === 'error' && !hasResultData\n const finalizeThenableIfPossible = (thenable: PendingThenable) => {\n if (isErrorWithoutData) {\n thenable.reject(nextResult.error)\n } else if (hasResultData) {\n thenable.resolve(nextResult.data as TData)\n }\n }\n\n /**\n * Create a new thenable and result promise when the results have changed\n */\n const recreateThenable = () => {\n const pending =\n (this.#currentThenable =\n nextResult.promise =\n pendingThenable())\n\n finalizeThenableIfPossible(pending)\n }\n\n const prevThenable = this.#currentThenable\n switch (prevThenable.status) {\n case 'pending':\n // Finalize the previous thenable if it was pending\n // and we are still observing the same query\n if (query.queryHash === prevQuery.queryHash) {\n finalizeThenableIfPossible(prevThenable)\n }\n break\n case 'fulfilled':\n if (isErrorWithoutData || nextResult.data !== prevThenable.value) {\n recreateThenable()\n }\n break\n case 'rejected':\n if (!isErrorWithoutData || nextResult.error !== prevThenable.reason) {\n recreateThenable()\n }\n break\n }\n }\n\n return nextResult\n }\n\n updateResult(): void {\n const prevResult = this.#currentResult as\n | QueryObserverResult\n | undefined\n\n const nextResult = this.createResult(this.#currentQuery, this.options)\n\n this.#currentResultState = this.#currentQuery.state\n this.#currentResultOptions = this.options\n\n if (this.#currentResultState.data !== undefined) {\n this.#lastQueryWithDefinedData = this.#currentQuery\n }\n\n // Only notify and update result if something has changed\n if (shallowEqualObjects(nextResult, prevResult)) {\n return\n }\n\n this.#currentResult = nextResult\n\n const shouldNotifyListeners = (): boolean => {\n if (!prevResult) {\n return true\n }\n\n const { notifyOnChangeProps } = this.options\n const notifyOnChangePropsValue =\n typeof notifyOnChangeProps === 'function'\n ? notifyOnChangeProps()\n : notifyOnChangeProps\n\n if (\n notifyOnChangePropsValue === 'all' ||\n (!notifyOnChangePropsValue && !this.#trackedProps.size)\n ) {\n return true\n }\n\n const includedProps = new Set(\n notifyOnChangePropsValue ?? this.#trackedProps,\n )\n\n if (this.options.throwOnError) {\n includedProps.add('error')\n }\n\n return Object.keys(this.#currentResult).some((key) => {\n const typedKey = key as keyof QueryObserverResult\n const changed = this.#currentResult[typedKey] !== prevResult[typedKey]\n\n return changed && includedProps.has(typedKey)\n })\n }\n\n this.#notify({ listeners: shouldNotifyListeners() })\n }\n\n #updateQuery(): void {\n const query = this.#client.getQueryCache().build(this.#client, this.options)\n\n if (query === this.#currentQuery) {\n return\n }\n\n const prevQuery = this.#currentQuery as\n | Query\n | undefined\n this.#currentQuery = query\n this.#currentQueryInitialState = query.state\n\n if (this.hasListeners()) {\n prevQuery?.removeObserver(this)\n query.addObserver(this)\n }\n }\n\n onQueryUpdate(): void {\n this.updateResult()\n\n if (this.hasListeners()) {\n this.#updateTimers()\n }\n }\n\n #notify(notifyOptions: { listeners: boolean }): void {\n notifyManager.batch(() => {\n // First, trigger the listeners\n if (notifyOptions.listeners) {\n this.listeners.forEach((listener) => {\n listener(this.#currentResult)\n })\n }\n\n // Then the cache listeners\n this.#client.getQueryCache().notify({\n query: this.#currentQuery,\n type: 'observerResultsUpdated',\n })\n })\n }\n}\n\nfunction shouldLoadOnMount(\n query: Query,\n options: QueryObserverOptions,\n): boolean {\n return (\n resolveEnabled(options.enabled, query) !== false &&\n query.state.data === undefined &&\n !(query.state.status === 'error' && options.retryOnMount === false)\n )\n}\n\nfunction shouldFetchOnMount(\n query: Query,\n options: QueryObserverOptions,\n): boolean {\n return (\n shouldLoadOnMount(query, options) ||\n (query.state.data !== undefined &&\n shouldFetchOn(query, options, options.refetchOnMount))\n )\n}\n\nfunction shouldFetchOn(\n query: Query,\n options: QueryObserverOptions,\n field: (typeof options)['refetchOnMount'] &\n (typeof options)['refetchOnWindowFocus'] &\n (typeof options)['refetchOnReconnect'],\n) {\n if (\n resolveEnabled(options.enabled, query) !== false &&\n resolveStaleTime(options.staleTime, query) !== 'static'\n ) {\n const value = typeof field === 'function' ? field(query) : field\n\n return value === 'always' || (value !== false && isStale(query, options))\n }\n return false\n}\n\nfunction shouldFetchOptionally(\n query: Query,\n prevQuery: Query,\n options: QueryObserverOptions,\n prevOptions: QueryObserverOptions,\n): boolean {\n return (\n (query !== prevQuery ||\n resolveEnabled(prevOptions.enabled, query) === false) &&\n (!options.suspense || query.state.status !== 'error') &&\n isStale(query, options)\n )\n}\n\nfunction isStale(\n query: Query,\n options: QueryObserverOptions,\n): boolean {\n return (\n resolveEnabled(options.enabled, query) !== false &&\n query.isStaleByTime(resolveStaleTime(options.staleTime, query))\n )\n}\n\n// this function would decide if we will update the observer's 'current'\n// properties after an optimistic reading via getOptimisticResult\nfunction shouldAssignObserverCurrentProperties<\n TQueryFnData = unknown,\n TError = unknown,\n TData = TQueryFnData,\n TQueryData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n observer: QueryObserver,\n optimisticResult: QueryObserverResult,\n) {\n // if the newly created result isn't what the observer is holding as current,\n // then we'll need to update the properties as well\n if (!shallowEqualObjects(observer.getCurrentResult(), optimisticResult)) {\n return true\n }\n\n // basically, just keep previous properties if nothing changed\n return false\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,0BAA6B;AAC7B,2BAA8B;AAC9B,mBAA2B;AAC3B,0BAA6B;AAC7B,sBAAgC;AAChC,mBASO;AACP,4BAA+B;AAwBxB,IAAM,gBAAN,cAMG,iCAAmD;AAAA,EAyB3D,YACE,QACO,SAOP;AACA,UAAM;AARC;AAUP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KAAK,CAAC;AAElE;AAIA,SAAS,sCAOP,UACA,kBACA;AAGA,MAAI,KAAC,kCAAoB,SAAS,iBAAiB,GAAG,gBAAgB,GAAG;AACvE,WAAO;AAAA,EACT;AAGA,SAAO;AACT;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/queryObserver.d.cts b/node_modules/@tanstack/query-core/build/modern/queryObserver.d.cts new file mode 100644 index 0000000..36ba2bd --- /dev/null +++ b/node_modules/@tanstack/query-core/build/modern/queryObserver.d.cts @@ -0,0 +1,3 @@ +import './subscribable.cjs'; +export { i as QueryObserver } from './hydration-uphG6M-i.cjs'; +import './removable.cjs'; diff --git a/node_modules/@tanstack/query-core/build/modern/queryObserver.d.ts b/node_modules/@tanstack/query-core/build/modern/queryObserver.d.ts new file mode 100644 index 0000000..ae279c2 --- /dev/null +++ b/node_modules/@tanstack/query-core/build/modern/queryObserver.d.ts @@ -0,0 +1,3 @@ +import './subscribable.js'; +export { i as QueryObserver } from './hydration-BlEVG2Lp.js'; +import './removable.js'; diff --git a/node_modules/@tanstack/query-core/build/modern/queryObserver.js b/node_modules/@tanstack/query-core/build/modern/queryObserver.js new file mode 100644 index 0000000..279baf4 --- /dev/null +++ b/node_modules/@tanstack/query-core/build/modern/queryObserver.js @@ -0,0 +1,472 @@ +// src/queryObserver.ts +import { focusManager } from "./focusManager.js"; +import { notifyManager } from "./notifyManager.js"; +import { fetchState } from "./query.js"; +import { Subscribable } from "./subscribable.js"; +import { pendingThenable } from "./thenable.js"; +import { + isServer, + isValidTimeout, + noop, + replaceData, + resolveEnabled, + resolveStaleTime, + shallowEqualObjects, + timeUntilStale +} from "./utils.js"; +import { timeoutManager } from "./timeoutManager.js"; +var QueryObserver = class extends Subscribable { + constructor(client, options) { + super(); + this.options = options; + this.#client = client; + this.#selectError = null; + this.#currentThenable = pendingThenable(); + this.bindMethods(); + this.setOptions(options); + } + #client; + #currentQuery = void 0; + #currentQueryInitialState = void 0; + #currentResult = void 0; + #currentResultState; + #currentResultOptions; + #currentThenable; + #selectError; + #selectFn; + #selectResult; + // This property keeps track of the last query with defined data. + // It will be used to pass the previous data and query to the placeholder function between renders. + #lastQueryWithDefinedData; + #staleTimeoutId; + #refetchIntervalId; + #currentRefetchInterval; + #trackedProps = /* @__PURE__ */ new Set(); + bindMethods() { + this.refetch = this.refetch.bind(this); + } + onSubscribe() { + if (this.listeners.size === 1) { + this.#currentQuery.addObserver(this); + if (shouldFetchOnMount(this.#currentQuery, this.options)) { + this.#executeFetch(); + } else { + this.updateResult(); + } + this.#updateTimers(); + } + } + onUnsubscribe() { + if (!this.hasListeners()) { + this.destroy(); + } + } + shouldFetchOnReconnect() { + return shouldFetchOn( + this.#currentQuery, + this.options, + this.options.refetchOnReconnect + ); + } + shouldFetchOnWindowFocus() { + return shouldFetchOn( + this.#currentQuery, + this.options, + this.options.refetchOnWindowFocus + ); + } + destroy() { + this.listeners = /* @__PURE__ */ new Set(); + this.#clearStaleTimeout(); + this.#clearRefetchInterval(); + this.#currentQuery.removeObserver(this); + } + setOptions(options) { + const prevOptions = this.options; + const prevQuery = this.#currentQuery; + this.options = this.#client.defaultQueryOptions(options); + 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" + ); + } + this.#updateQuery(); + this.#currentQuery.setOptions(this.options); + if (prevOptions._defaulted && !shallowEqualObjects(this.options, prevOptions)) { + this.#client.getQueryCache().notify({ + type: "observerOptionsUpdated", + query: this.#currentQuery, + observer: this + }); + } + const mounted = this.hasListeners(); + if (mounted && shouldFetchOptionally( + this.#currentQuery, + prevQuery, + this.options, + prevOptions + )) { + this.#executeFetch(); + } + this.updateResult(); + 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(); + } + const nextRefetchInterval = this.#computeRefetchInterval(); + if (mounted && (this.#currentQuery !== prevQuery || resolveEnabled(this.options.enabled, this.#currentQuery) !== resolveEnabled(prevOptions.enabled, this.#currentQuery) || nextRefetchInterval !== this.#currentRefetchInterval)) { + this.#updateRefetchInterval(nextRefetchInterval); + } + } + getOptimisticResult(options) { + const query = this.#client.getQueryCache().build(this.#client, options); + const result = this.createResult(query, options); + if (shouldAssignObserverCurrentProperties(this, result)) { + this.#currentResult = result; + this.#currentResultOptions = this.options; + this.#currentResultState = this.#currentQuery.state; + } + return result; + } + getCurrentResult() { + return this.#currentResult; + } + trackResult(result, onPropTracked) { + return new Proxy(result, { + get: (target, key) => { + this.trackProp(key); + onPropTracked?.(key); + if (key === "promise") { + this.trackProp("data"); + if (!this.options.experimental_prefetchInRender && this.#currentThenable.status === "pending") { + this.#currentThenable.reject( + new Error( + "experimental_prefetchInRender feature flag is not enabled" + ) + ); + } + } + return Reflect.get(target, key); + } + }); + } + trackProp(key) { + this.#trackedProps.add(key); + } + getCurrentQuery() { + return this.#currentQuery; + } + refetch({ ...options } = {}) { + return this.fetch({ + ...options + }); + } + fetchOptimistic(options) { + const defaultedOptions = this.#client.defaultQueryOptions(options); + const query = this.#client.getQueryCache().build(this.#client, defaultedOptions); + return query.fetch().then(() => this.createResult(query, defaultedOptions)); + } + fetch(fetchOptions) { + return this.#executeFetch({ + ...fetchOptions, + cancelRefetch: fetchOptions.cancelRefetch ?? true + }).then(() => { + this.updateResult(); + return this.#currentResult; + }); + } + #executeFetch(fetchOptions) { + this.#updateQuery(); + let promise = this.#currentQuery.fetch( + this.options, + fetchOptions + ); + if (!fetchOptions?.throwOnError) { + promise = promise.catch(noop); + } + return promise; + } + #updateStaleTimeout() { + this.#clearStaleTimeout(); + const staleTime = resolveStaleTime( + this.options.staleTime, + this.#currentQuery + ); + if (isServer || this.#currentResult.isStale || !isValidTimeout(staleTime)) { + return; + } + const time = timeUntilStale(this.#currentResult.dataUpdatedAt, staleTime); + const timeout = time + 1; + this.#staleTimeoutId = timeoutManager.setTimeout(() => { + if (!this.#currentResult.isStale) { + this.updateResult(); + } + }, timeout); + } + #computeRefetchInterval() { + return (typeof this.options.refetchInterval === "function" ? this.options.refetchInterval(this.#currentQuery) : this.options.refetchInterval) ?? false; + } + #updateRefetchInterval(nextInterval) { + this.#clearRefetchInterval(); + this.#currentRefetchInterval = nextInterval; + if (isServer || resolveEnabled(this.options.enabled, this.#currentQuery) === false || !isValidTimeout(this.#currentRefetchInterval) || this.#currentRefetchInterval === 0) { + return; + } + this.#refetchIntervalId = timeoutManager.setInterval(() => { + if (this.options.refetchIntervalInBackground || focusManager.isFocused()) { + this.#executeFetch(); + } + }, this.#currentRefetchInterval); + } + #updateTimers() { + this.#updateStaleTimeout(); + this.#updateRefetchInterval(this.#computeRefetchInterval()); + } + #clearStaleTimeout() { + if (this.#staleTimeoutId) { + timeoutManager.clearTimeout(this.#staleTimeoutId); + this.#staleTimeoutId = void 0; + } + } + #clearRefetchInterval() { + if (this.#refetchIntervalId) { + timeoutManager.clearInterval(this.#refetchIntervalId); + this.#refetchIntervalId = void 0; + } + } + createResult(query, options) { + const prevQuery = this.#currentQuery; + const prevOptions = this.options; + const prevResult = this.#currentResult; + const prevResultState = this.#currentResultState; + const prevResultOptions = this.#currentResultOptions; + const queryChange = query !== prevQuery; + const queryInitialState = queryChange ? query.state : this.#currentQueryInitialState; + const { state } = query; + let newState = { ...state }; + let isPlaceholderData = false; + let data; + if (options._optimisticResults) { + const mounted = this.hasListeners(); + const fetchOnMount = !mounted && shouldFetchOnMount(query, options); + const fetchOptionally = mounted && shouldFetchOptionally(query, prevQuery, options, prevOptions); + if (fetchOnMount || fetchOptionally) { + newState = { + ...newState, + ...fetchState(state.data, query.options) + }; + } + if (options._optimisticResults === "isRestoring") { + newState.fetchStatus = "idle"; + } + } + let { error, errorUpdatedAt, status } = newState; + data = newState.data; + let skipSelect = false; + if (options.placeholderData !== void 0 && data === void 0 && status === "pending") { + let placeholderData; + if (prevResult?.isPlaceholderData && options.placeholderData === prevResultOptions?.placeholderData) { + placeholderData = prevResult.data; + skipSelect = true; + } else { + placeholderData = typeof options.placeholderData === "function" ? options.placeholderData( + this.#lastQueryWithDefinedData?.state.data, + this.#lastQueryWithDefinedData + ) : options.placeholderData; + } + if (placeholderData !== void 0) { + status = "success"; + data = replaceData( + prevResult?.data, + placeholderData, + options + ); + isPlaceholderData = true; + } + } + if (options.select && data !== void 0 && !skipSelect) { + if (prevResult && data === prevResultState?.data && options.select === this.#selectFn) { + data = this.#selectResult; + } else { + try { + this.#selectFn = options.select; + data = options.select(data); + data = replaceData(prevResult?.data, data, options); + this.#selectResult = data; + this.#selectError = null; + } catch (selectError) { + this.#selectError = selectError; + } + } + } + if (this.#selectError) { + error = this.#selectError; + data = this.#selectResult; + errorUpdatedAt = Date.now(); + status = "error"; + } + const isFetching = newState.fetchStatus === "fetching"; + const isPending = status === "pending"; + const isError = status === "error"; + const isLoading = isPending && isFetching; + const hasData = data !== void 0; + const result = { + status, + fetchStatus: newState.fetchStatus, + isPending, + isSuccess: status === "success", + isError, + isInitialLoading: isLoading, + isLoading, + data, + dataUpdatedAt: newState.dataUpdatedAt, + error, + errorUpdatedAt, + failureCount: newState.fetchFailureCount, + failureReason: newState.fetchFailureReason, + errorUpdateCount: newState.errorUpdateCount, + isFetched: newState.dataUpdateCount > 0 || newState.errorUpdateCount > 0, + isFetchedAfterMount: newState.dataUpdateCount > queryInitialState.dataUpdateCount || newState.errorUpdateCount > queryInitialState.errorUpdateCount, + isFetching, + isRefetching: isFetching && !isPending, + isLoadingError: isError && !hasData, + isPaused: newState.fetchStatus === "paused", + isPlaceholderData, + isRefetchError: isError && hasData, + isStale: isStale(query, options), + refetch: this.refetch, + promise: this.#currentThenable, + isEnabled: resolveEnabled(options.enabled, query) !== false + }; + const nextResult = result; + if (this.options.experimental_prefetchInRender) { + const hasResultData = nextResult.data !== void 0; + const isErrorWithoutData = nextResult.status === "error" && !hasResultData; + const finalizeThenableIfPossible = (thenable) => { + if (isErrorWithoutData) { + thenable.reject(nextResult.error); + } else if (hasResultData) { + thenable.resolve(nextResult.data); + } + }; + const recreateThenable = () => { + const pending = this.#currentThenable = nextResult.promise = pendingThenable(); + finalizeThenableIfPossible(pending); + }; + const prevThenable = this.#currentThenable; + switch (prevThenable.status) { + case "pending": + if (query.queryHash === prevQuery.queryHash) { + finalizeThenableIfPossible(prevThenable); + } + break; + case "fulfilled": + if (isErrorWithoutData || nextResult.data !== prevThenable.value) { + recreateThenable(); + } + break; + case "rejected": + if (!isErrorWithoutData || nextResult.error !== prevThenable.reason) { + recreateThenable(); + } + break; + } + } + return nextResult; + } + updateResult() { + const prevResult = this.#currentResult; + const nextResult = this.createResult(this.#currentQuery, this.options); + this.#currentResultState = this.#currentQuery.state; + this.#currentResultOptions = this.options; + if (this.#currentResultState.data !== void 0) { + this.#lastQueryWithDefinedData = this.#currentQuery; + } + if (shallowEqualObjects(nextResult, prevResult)) { + return; + } + this.#currentResult = nextResult; + const shouldNotifyListeners = () => { + if (!prevResult) { + return true; + } + const { notifyOnChangeProps } = this.options; + const notifyOnChangePropsValue = typeof notifyOnChangeProps === "function" ? notifyOnChangeProps() : notifyOnChangeProps; + if (notifyOnChangePropsValue === "all" || !notifyOnChangePropsValue && !this.#trackedProps.size) { + return true; + } + const includedProps = new Set( + notifyOnChangePropsValue ?? this.#trackedProps + ); + if (this.options.throwOnError) { + includedProps.add("error"); + } + return Object.keys(this.#currentResult).some((key) => { + const typedKey = key; + const changed = this.#currentResult[typedKey] !== prevResult[typedKey]; + return changed && includedProps.has(typedKey); + }); + }; + this.#notify({ listeners: shouldNotifyListeners() }); + } + #updateQuery() { + const query = this.#client.getQueryCache().build(this.#client, this.options); + if (query === this.#currentQuery) { + return; + } + const prevQuery = this.#currentQuery; + this.#currentQuery = query; + this.#currentQueryInitialState = query.state; + if (this.hasListeners()) { + prevQuery?.removeObserver(this); + query.addObserver(this); + } + } + onQueryUpdate() { + this.updateResult(); + if (this.hasListeners()) { + this.#updateTimers(); + } + } + #notify(notifyOptions) { + notifyManager.batch(() => { + if (notifyOptions.listeners) { + this.listeners.forEach((listener) => { + listener(this.#currentResult); + }); + } + this.#client.getQueryCache().notify({ + query: this.#currentQuery, + type: "observerResultsUpdated" + }); + }); + } +}; +function shouldLoadOnMount(query, options) { + return resolveEnabled(options.enabled, query) !== false && query.state.data === void 0 && !(query.state.status === "error" && options.retryOnMount === false); +} +function shouldFetchOnMount(query, options) { + return shouldLoadOnMount(query, options) || query.state.data !== void 0 && shouldFetchOn(query, options, options.refetchOnMount); +} +function shouldFetchOn(query, options, field) { + if (resolveEnabled(options.enabled, query) !== false && resolveStaleTime(options.staleTime, query) !== "static") { + const value = typeof field === "function" ? field(query) : field; + return value === "always" || value !== false && isStale(query, options); + } + return false; +} +function shouldFetchOptionally(query, prevQuery, options, prevOptions) { + return (query !== prevQuery || resolveEnabled(prevOptions.enabled, query) === false) && (!options.suspense || query.state.status !== "error") && isStale(query, options); +} +function isStale(query, options) { + return resolveEnabled(options.enabled, query) !== false && query.isStaleByTime(resolveStaleTime(options.staleTime, query)); +} +function shouldAssignObserverCurrentProperties(observer, optimisticResult) { + if (!shallowEqualObjects(observer.getCurrentResult(), optimisticResult)) { + return true; + } + return false; +} +export { + QueryObserver +}; +//# sourceMappingURL=queryObserver.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/queryObserver.js.map b/node_modules/@tanstack/query-core/build/modern/queryObserver.js.map new file mode 100644 index 0000000..8d39b66 --- /dev/null +++ b/node_modules/@tanstack/query-core/build/modern/queryObserver.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/queryObserver.ts"],"sourcesContent":["import { focusManager } from './focusManager'\nimport { notifyManager } from './notifyManager'\nimport { fetchState } from './query'\nimport { Subscribable } from './subscribable'\nimport { pendingThenable } from './thenable'\nimport {\n isServer,\n isValidTimeout,\n noop,\n replaceData,\n resolveEnabled,\n resolveStaleTime,\n shallowEqualObjects,\n timeUntilStale,\n} from './utils'\nimport { timeoutManager } from './timeoutManager'\nimport type { ManagedTimerId } from './timeoutManager'\nimport type { FetchOptions, Query, QueryState } from './query'\nimport type { QueryClient } from './queryClient'\nimport type { PendingThenable, Thenable } from './thenable'\nimport type {\n DefaultError,\n DefaultedQueryObserverOptions,\n PlaceholderDataFunction,\n QueryKey,\n QueryObserverBaseResult,\n QueryObserverOptions,\n QueryObserverResult,\n RefetchOptions,\n} from './types'\n\ntype QueryObserverListener = (\n result: QueryObserverResult,\n) => void\n\ninterface ObserverFetchOptions extends FetchOptions {\n throwOnError?: boolean\n}\n\nexport class QueryObserver<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> extends Subscribable> {\n #client: QueryClient\n #currentQuery: Query = undefined!\n #currentQueryInitialState: QueryState = undefined!\n #currentResult: QueryObserverResult = undefined!\n #currentResultState?: QueryState\n #currentResultOptions?: QueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >\n #currentThenable: Thenable\n #selectError: TError | null\n #selectFn?: (data: TQueryData) => TData\n #selectResult?: TData\n // This property keeps track of the last query with defined data.\n // It will be used to pass the previous data and query to the placeholder function between renders.\n #lastQueryWithDefinedData?: Query\n #staleTimeoutId?: ManagedTimerId\n #refetchIntervalId?: ManagedTimerId\n #currentRefetchInterval?: number | false\n #trackedProps = new Set()\n\n constructor(\n client: QueryClient,\n public options: QueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >,\n ) {\n super()\n\n this.#client = client\n this.#selectError = null\n this.#currentThenable = pendingThenable()\n\n this.bindMethods()\n this.setOptions(options)\n }\n\n protected bindMethods(): void {\n this.refetch = this.refetch.bind(this)\n }\n\n protected onSubscribe(): void {\n if (this.listeners.size === 1) {\n this.#currentQuery.addObserver(this)\n\n if (shouldFetchOnMount(this.#currentQuery, this.options)) {\n this.#executeFetch()\n } else {\n this.updateResult()\n }\n\n this.#updateTimers()\n }\n }\n\n protected onUnsubscribe(): void {\n if (!this.hasListeners()) {\n this.destroy()\n }\n }\n\n shouldFetchOnReconnect(): boolean {\n return shouldFetchOn(\n this.#currentQuery,\n this.options,\n this.options.refetchOnReconnect,\n )\n }\n\n shouldFetchOnWindowFocus(): boolean {\n return shouldFetchOn(\n this.#currentQuery,\n this.options,\n this.options.refetchOnWindowFocus,\n )\n }\n\n destroy(): void {\n this.listeners = new Set()\n this.#clearStaleTimeout()\n this.#clearRefetchInterval()\n this.#currentQuery.removeObserver(this)\n }\n\n setOptions(\n options: QueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >,\n ): void {\n const prevOptions = this.options\n const prevQuery = this.#currentQuery\n\n this.options = this.#client.defaultQueryOptions(options)\n\n if (\n this.options.enabled !== undefined &&\n typeof this.options.enabled !== 'boolean' &&\n typeof this.options.enabled !== 'function' &&\n typeof resolveEnabled(this.options.enabled, this.#currentQuery) !==\n 'boolean'\n ) {\n throw new Error(\n 'Expected enabled to be a boolean or a callback that returns a boolean',\n )\n }\n\n this.#updateQuery()\n this.#currentQuery.setOptions(this.options)\n\n if (\n prevOptions._defaulted &&\n !shallowEqualObjects(this.options, prevOptions)\n ) {\n this.#client.getQueryCache().notify({\n type: 'observerOptionsUpdated',\n query: this.#currentQuery,\n observer: this,\n })\n }\n\n const mounted = this.hasListeners()\n\n // Fetch if there are subscribers\n if (\n mounted &&\n shouldFetchOptionally(\n this.#currentQuery,\n prevQuery,\n this.options,\n prevOptions,\n )\n ) {\n this.#executeFetch()\n }\n\n // Update result\n this.updateResult()\n\n // Update stale interval if needed\n if (\n mounted &&\n (this.#currentQuery !== prevQuery ||\n resolveEnabled(this.options.enabled, this.#currentQuery) !==\n resolveEnabled(prevOptions.enabled, this.#currentQuery) ||\n resolveStaleTime(this.options.staleTime, this.#currentQuery) !==\n resolveStaleTime(prevOptions.staleTime, this.#currentQuery))\n ) {\n this.#updateStaleTimeout()\n }\n\n const nextRefetchInterval = this.#computeRefetchInterval()\n\n // Update refetch interval if needed\n if (\n mounted &&\n (this.#currentQuery !== prevQuery ||\n resolveEnabled(this.options.enabled, this.#currentQuery) !==\n resolveEnabled(prevOptions.enabled, this.#currentQuery) ||\n nextRefetchInterval !== this.#currentRefetchInterval)\n ) {\n this.#updateRefetchInterval(nextRefetchInterval)\n }\n }\n\n getOptimisticResult(\n options: DefaultedQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >,\n ): QueryObserverResult {\n const query = this.#client.getQueryCache().build(this.#client, options)\n\n const result = this.createResult(query, options)\n\n if (shouldAssignObserverCurrentProperties(this, result)) {\n // this assigns the optimistic result to the current Observer\n // because if the query function changes, useQuery will be performing\n // an effect where it would fetch again.\n // When the fetch finishes, we perform a deep data cloning in order\n // to reuse objects references. This deep data clone is performed against\n // the `observer.currentResult.data` property\n // When QueryKey changes, we refresh the query and get new `optimistic`\n // result, while we leave the `observer.currentResult`, so when new data\n // arrives, it finds the old `observer.currentResult` which is related\n // to the old QueryKey. Which means that currentResult and selectData are\n // out of sync already.\n // To solve this, we move the cursor of the currentResult every time\n // an observer reads an optimistic value.\n\n // When keeping the previous data, the result doesn't change until new\n // data arrives.\n this.#currentResult = result\n this.#currentResultOptions = this.options\n this.#currentResultState = this.#currentQuery.state\n }\n return result\n }\n\n getCurrentResult(): QueryObserverResult {\n return this.#currentResult\n }\n\n trackResult(\n result: QueryObserverResult,\n onPropTracked?: (key: keyof QueryObserverResult) => void,\n ): QueryObserverResult {\n return new Proxy(result, {\n get: (target, key) => {\n this.trackProp(key as keyof QueryObserverResult)\n onPropTracked?.(key as keyof QueryObserverResult)\n if (key === 'promise') {\n this.trackProp('data')\n if (\n !this.options.experimental_prefetchInRender &&\n this.#currentThenable.status === 'pending'\n ) {\n this.#currentThenable.reject(\n new Error(\n 'experimental_prefetchInRender feature flag is not enabled',\n ),\n )\n }\n }\n return Reflect.get(target, key)\n },\n })\n }\n\n trackProp(key: keyof QueryObserverResult) {\n this.#trackedProps.add(key)\n }\n\n getCurrentQuery(): Query {\n return this.#currentQuery\n }\n\n refetch({ ...options }: RefetchOptions = {}): Promise<\n QueryObserverResult\n > {\n return this.fetch({\n ...options,\n })\n }\n\n fetchOptimistic(\n options: QueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >,\n ): Promise> {\n const defaultedOptions = this.#client.defaultQueryOptions(options)\n\n const query = this.#client\n .getQueryCache()\n .build(this.#client, defaultedOptions)\n\n return query.fetch().then(() => this.createResult(query, defaultedOptions))\n }\n\n protected fetch(\n fetchOptions: ObserverFetchOptions,\n ): Promise> {\n return this.#executeFetch({\n ...fetchOptions,\n cancelRefetch: fetchOptions.cancelRefetch ?? true,\n }).then(() => {\n this.updateResult()\n return this.#currentResult\n })\n }\n\n #executeFetch(\n fetchOptions?: Omit,\n ): Promise {\n // Make sure we reference the latest query as the current one might have been removed\n this.#updateQuery()\n\n // Fetch\n let promise: Promise = this.#currentQuery.fetch(\n this.options,\n fetchOptions,\n )\n\n if (!fetchOptions?.throwOnError) {\n promise = promise.catch(noop)\n }\n\n return promise\n }\n\n #updateStaleTimeout(): void {\n this.#clearStaleTimeout()\n const staleTime = resolveStaleTime(\n this.options.staleTime,\n this.#currentQuery,\n )\n\n if (isServer || this.#currentResult.isStale || !isValidTimeout(staleTime)) {\n return\n }\n\n const time = timeUntilStale(this.#currentResult.dataUpdatedAt, staleTime)\n\n // The timeout is sometimes triggered 1 ms before the stale time expiration.\n // To mitigate this issue we always add 1 ms to the timeout.\n const timeout = time + 1\n\n this.#staleTimeoutId = timeoutManager.setTimeout(() => {\n if (!this.#currentResult.isStale) {\n this.updateResult()\n }\n }, timeout)\n }\n\n #computeRefetchInterval() {\n return (\n (typeof this.options.refetchInterval === 'function'\n ? this.options.refetchInterval(this.#currentQuery)\n : this.options.refetchInterval) ?? false\n )\n }\n\n #updateRefetchInterval(nextInterval: number | false): void {\n this.#clearRefetchInterval()\n\n this.#currentRefetchInterval = nextInterval\n\n if (\n isServer ||\n resolveEnabled(this.options.enabled, this.#currentQuery) === false ||\n !isValidTimeout(this.#currentRefetchInterval) ||\n this.#currentRefetchInterval === 0\n ) {\n return\n }\n\n this.#refetchIntervalId = timeoutManager.setInterval(() => {\n if (\n this.options.refetchIntervalInBackground ||\n focusManager.isFocused()\n ) {\n this.#executeFetch()\n }\n }, this.#currentRefetchInterval)\n }\n\n #updateTimers(): void {\n this.#updateStaleTimeout()\n this.#updateRefetchInterval(this.#computeRefetchInterval())\n }\n\n #clearStaleTimeout(): void {\n if (this.#staleTimeoutId) {\n timeoutManager.clearTimeout(this.#staleTimeoutId)\n this.#staleTimeoutId = undefined\n }\n }\n\n #clearRefetchInterval(): void {\n if (this.#refetchIntervalId) {\n timeoutManager.clearInterval(this.#refetchIntervalId)\n this.#refetchIntervalId = undefined\n }\n }\n\n protected createResult(\n query: Query,\n options: QueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >,\n ): QueryObserverResult {\n const prevQuery = this.#currentQuery\n const prevOptions = this.options\n const prevResult = this.#currentResult as\n | QueryObserverResult\n | undefined\n const prevResultState = this.#currentResultState\n const prevResultOptions = this.#currentResultOptions\n const queryChange = query !== prevQuery\n const queryInitialState = queryChange\n ? query.state\n : this.#currentQueryInitialState\n\n const { state } = query\n let newState = { ...state }\n let isPlaceholderData = false\n let data: TData | undefined\n\n // Optimistically set result in fetching state if needed\n if (options._optimisticResults) {\n const mounted = this.hasListeners()\n\n const fetchOnMount = !mounted && shouldFetchOnMount(query, options)\n\n const fetchOptionally =\n mounted && shouldFetchOptionally(query, prevQuery, options, prevOptions)\n\n if (fetchOnMount || fetchOptionally) {\n newState = {\n ...newState,\n ...fetchState(state.data, query.options),\n }\n }\n if (options._optimisticResults === 'isRestoring') {\n newState.fetchStatus = 'idle'\n }\n }\n\n let { error, errorUpdatedAt, status } = newState\n\n // Per default, use query data\n data = newState.data as unknown as TData\n let skipSelect = false\n\n // use placeholderData if needed\n if (\n options.placeholderData !== undefined &&\n data === undefined &&\n status === 'pending'\n ) {\n let placeholderData\n\n // Memoize placeholder data\n if (\n prevResult?.isPlaceholderData &&\n options.placeholderData === prevResultOptions?.placeholderData\n ) {\n placeholderData = prevResult.data\n // we have to skip select when reading this memoization\n // because prevResult.data is already \"selected\"\n skipSelect = true\n } else {\n // compute placeholderData\n placeholderData =\n typeof options.placeholderData === 'function'\n ? (\n options.placeholderData as unknown as PlaceholderDataFunction\n )(\n this.#lastQueryWithDefinedData?.state.data,\n this.#lastQueryWithDefinedData as any,\n )\n : options.placeholderData\n }\n\n if (placeholderData !== undefined) {\n status = 'success'\n data = replaceData(\n prevResult?.data,\n placeholderData as unknown,\n options,\n ) as TData\n isPlaceholderData = true\n }\n }\n\n // Select data if needed\n // this also runs placeholderData through the select function\n if (options.select && data !== undefined && !skipSelect) {\n // Memoize select result\n if (\n prevResult &&\n data === prevResultState?.data &&\n options.select === this.#selectFn\n ) {\n data = this.#selectResult\n } else {\n try {\n this.#selectFn = options.select\n data = options.select(data as any)\n data = replaceData(prevResult?.data, data, options)\n this.#selectResult = data\n this.#selectError = null\n } catch (selectError) {\n this.#selectError = selectError as TError\n }\n }\n }\n\n if (this.#selectError) {\n error = this.#selectError\n data = this.#selectResult\n errorUpdatedAt = Date.now()\n status = 'error'\n }\n\n const isFetching = newState.fetchStatus === 'fetching'\n const isPending = status === 'pending'\n const isError = status === 'error'\n\n const isLoading = isPending && isFetching\n const hasData = data !== undefined\n\n const result: QueryObserverBaseResult = {\n status,\n fetchStatus: newState.fetchStatus,\n isPending,\n isSuccess: status === 'success',\n isError,\n isInitialLoading: isLoading,\n isLoading,\n data,\n dataUpdatedAt: newState.dataUpdatedAt,\n error,\n errorUpdatedAt,\n failureCount: newState.fetchFailureCount,\n failureReason: newState.fetchFailureReason,\n errorUpdateCount: newState.errorUpdateCount,\n isFetched: newState.dataUpdateCount > 0 || newState.errorUpdateCount > 0,\n isFetchedAfterMount:\n newState.dataUpdateCount > queryInitialState.dataUpdateCount ||\n newState.errorUpdateCount > queryInitialState.errorUpdateCount,\n isFetching,\n isRefetching: isFetching && !isPending,\n isLoadingError: isError && !hasData,\n isPaused: newState.fetchStatus === 'paused',\n isPlaceholderData,\n isRefetchError: isError && hasData,\n isStale: isStale(query, options),\n refetch: this.refetch,\n promise: this.#currentThenable,\n isEnabled: resolveEnabled(options.enabled, query) !== false,\n }\n\n const nextResult = result as QueryObserverResult\n\n if (this.options.experimental_prefetchInRender) {\n const hasResultData = nextResult.data !== undefined\n const isErrorWithoutData = nextResult.status === 'error' && !hasResultData\n const finalizeThenableIfPossible = (thenable: PendingThenable) => {\n if (isErrorWithoutData) {\n thenable.reject(nextResult.error)\n } else if (hasResultData) {\n thenable.resolve(nextResult.data as TData)\n }\n }\n\n /**\n * Create a new thenable and result promise when the results have changed\n */\n const recreateThenable = () => {\n const pending =\n (this.#currentThenable =\n nextResult.promise =\n pendingThenable())\n\n finalizeThenableIfPossible(pending)\n }\n\n const prevThenable = this.#currentThenable\n switch (prevThenable.status) {\n case 'pending':\n // Finalize the previous thenable if it was pending\n // and we are still observing the same query\n if (query.queryHash === prevQuery.queryHash) {\n finalizeThenableIfPossible(prevThenable)\n }\n break\n case 'fulfilled':\n if (isErrorWithoutData || nextResult.data !== prevThenable.value) {\n recreateThenable()\n }\n break\n case 'rejected':\n if (!isErrorWithoutData || nextResult.error !== prevThenable.reason) {\n recreateThenable()\n }\n break\n }\n }\n\n return nextResult\n }\n\n updateResult(): void {\n const prevResult = this.#currentResult as\n | QueryObserverResult\n | undefined\n\n const nextResult = this.createResult(this.#currentQuery, this.options)\n\n this.#currentResultState = this.#currentQuery.state\n this.#currentResultOptions = this.options\n\n if (this.#currentResultState.data !== undefined) {\n this.#lastQueryWithDefinedData = this.#currentQuery\n }\n\n // Only notify and update result if something has changed\n if (shallowEqualObjects(nextResult, prevResult)) {\n return\n }\n\n this.#currentResult = nextResult\n\n const shouldNotifyListeners = (): boolean => {\n if (!prevResult) {\n return true\n }\n\n const { notifyOnChangeProps } = this.options\n const notifyOnChangePropsValue =\n typeof notifyOnChangeProps === 'function'\n ? notifyOnChangeProps()\n : notifyOnChangeProps\n\n if (\n notifyOnChangePropsValue === 'all' ||\n (!notifyOnChangePropsValue && !this.#trackedProps.size)\n ) {\n return true\n }\n\n const includedProps = new Set(\n notifyOnChangePropsValue ?? this.#trackedProps,\n )\n\n if (this.options.throwOnError) {\n includedProps.add('error')\n }\n\n return Object.keys(this.#currentResult).some((key) => {\n const typedKey = key as keyof QueryObserverResult\n const changed = this.#currentResult[typedKey] !== prevResult[typedKey]\n\n return changed && includedProps.has(typedKey)\n })\n }\n\n this.#notify({ listeners: shouldNotifyListeners() })\n }\n\n #updateQuery(): void {\n const query = this.#client.getQueryCache().build(this.#client, this.options)\n\n if (query === this.#currentQuery) {\n return\n }\n\n const prevQuery = this.#currentQuery as\n | Query\n | undefined\n this.#currentQuery = query\n this.#currentQueryInitialState = query.state\n\n if (this.hasListeners()) {\n prevQuery?.removeObserver(this)\n query.addObserver(this)\n }\n }\n\n onQueryUpdate(): void {\n this.updateResult()\n\n if (this.hasListeners()) {\n this.#updateTimers()\n }\n }\n\n #notify(notifyOptions: { listeners: boolean }): void {\n notifyManager.batch(() => {\n // First, trigger the listeners\n if (notifyOptions.listeners) {\n this.listeners.forEach((listener) => {\n listener(this.#currentResult)\n })\n }\n\n // Then the cache listeners\n this.#client.getQueryCache().notify({\n query: this.#currentQuery,\n type: 'observerResultsUpdated',\n })\n })\n }\n}\n\nfunction shouldLoadOnMount(\n query: Query,\n options: QueryObserverOptions,\n): boolean {\n return (\n resolveEnabled(options.enabled, query) !== false &&\n query.state.data === undefined &&\n !(query.state.status === 'error' && options.retryOnMount === false)\n )\n}\n\nfunction shouldFetchOnMount(\n query: Query,\n options: QueryObserverOptions,\n): boolean {\n return (\n shouldLoadOnMount(query, options) ||\n (query.state.data !== undefined &&\n shouldFetchOn(query, options, options.refetchOnMount))\n )\n}\n\nfunction shouldFetchOn(\n query: Query,\n options: QueryObserverOptions,\n field: (typeof options)['refetchOnMount'] &\n (typeof options)['refetchOnWindowFocus'] &\n (typeof options)['refetchOnReconnect'],\n) {\n if (\n resolveEnabled(options.enabled, query) !== false &&\n resolveStaleTime(options.staleTime, query) !== 'static'\n ) {\n const value = typeof field === 'function' ? field(query) : field\n\n return value === 'always' || (value !== false && isStale(query, options))\n }\n return false\n}\n\nfunction shouldFetchOptionally(\n query: Query,\n prevQuery: Query,\n options: QueryObserverOptions,\n prevOptions: QueryObserverOptions,\n): boolean {\n return (\n (query !== prevQuery ||\n resolveEnabled(prevOptions.enabled, query) === false) &&\n (!options.suspense || query.state.status !== 'error') &&\n isStale(query, options)\n )\n}\n\nfunction isStale(\n query: Query,\n options: QueryObserverOptions,\n): boolean {\n return (\n resolveEnabled(options.enabled, query) !== false &&\n query.isStaleByTime(resolveStaleTime(options.staleTime, query))\n )\n}\n\n// this function would decide if we will update the observer's 'current'\n// properties after an optimistic reading via getOptimisticResult\nfunction shouldAssignObserverCurrentProperties<\n TQueryFnData = unknown,\n TError = unknown,\n TData = TQueryFnData,\n TQueryData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n observer: QueryObserver,\n optimisticResult: QueryObserverResult,\n) {\n // if the newly created result isn't what the observer is holding as current,\n // then we'll need to update the properties as well\n if (!shallowEqualObjects(observer.getCurrentResult(), optimisticResult)) {\n return true\n }\n\n // basically, just keep previous properties if nothing changed\n return false\n}\n"],"mappings":";AAAA,SAAS,oBAAoB;AAC7B,SAAS,qBAAqB;AAC9B,SAAS,kBAAkB;AAC3B,SAAS,oBAAoB;AAC7B,SAAS,uBAAuB;AAChC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EAC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ACP,OACA,SACS;AACT,SACE,eAAe,QAAQ,SAAS,KAAK,MAAM,SAC3C,MAAM,cAAc,iBAAiB,QAAQ,WAAW,KAAK,CAAC;AAElE;AAIA,SAAS,sCAOP,UACA,kBACA;AAGA,MAAI,CAAC,oBAAoB,SAAS,iBAAiB,GAAG,gBAAgB,GAAG;AACvE,WAAO;AAAA,EACT;AAGA,SAAO;AACT;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/removable.cjs b/node_modules/@tanstack/query-core/build/modern/removable.cjs new file mode 100644 index 0000000..facc9da --- /dev/null +++ b/node_modules/@tanstack/query-core/build/modern/removable.cjs @@ -0,0 +1,58 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/removable.ts +var removable_exports = {}; +__export(removable_exports, { + Removable: () => Removable +}); +module.exports = __toCommonJS(removable_exports); +var import_timeoutManager = require("./timeoutManager.cjs"); +var import_utils = require("./utils.cjs"); +var Removable = class { + #gcTimeout; + destroy() { + this.clearGcTimeout(); + } + scheduleGc() { + this.clearGcTimeout(); + if ((0, import_utils.isValidTimeout)(this.gcTime)) { + this.#gcTimeout = import_timeoutManager.timeoutManager.setTimeout(() => { + this.optionalRemove(); + }, this.gcTime); + } + } + updateGcTime(newGcTime) { + this.gcTime = Math.max( + this.gcTime || 0, + newGcTime ?? (import_utils.isServer ? Infinity : 5 * 60 * 1e3) + ); + } + clearGcTimeout() { + if (this.#gcTimeout) { + import_timeoutManager.timeoutManager.clearTimeout(this.#gcTimeout); + this.#gcTimeout = void 0; + } + } +}; +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + Removable +}); +//# sourceMappingURL=removable.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/removable.cjs.map b/node_modules/@tanstack/query-core/build/modern/removable.cjs.map new file mode 100644 index 0000000..1c13757 --- /dev/null +++ b/node_modules/@tanstack/query-core/build/modern/removable.cjs.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/removable.ts"],"sourcesContent":["import { timeoutManager } from './timeoutManager'\nimport { isServer, isValidTimeout } from './utils'\nimport type { ManagedTimerId } from './timeoutManager'\n\nexport abstract class Removable {\n gcTime!: number\n #gcTimeout?: ManagedTimerId\n\n destroy(): void {\n this.clearGcTimeout()\n }\n\n protected scheduleGc(): void {\n this.clearGcTimeout()\n\n if (isValidTimeout(this.gcTime)) {\n this.#gcTimeout = timeoutManager.setTimeout(() => {\n this.optionalRemove()\n }, this.gcTime)\n }\n }\n\n protected updateGcTime(newGcTime: number | undefined): void {\n // Default to 5 minutes (Infinity for server-side) if no gcTime is set\n this.gcTime = Math.max(\n this.gcTime || 0,\n newGcTime ?? (isServer ? Infinity : 5 * 60 * 1000),\n )\n }\n\n protected clearGcTimeout() {\n if (this.#gcTimeout) {\n timeoutManager.clearTimeout(this.#gcTimeout)\n this.#gcTimeout = undefined\n }\n }\n\n protected abstract optionalRemove(): void\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,4BAA+B;AAC/B,mBAAyC;AAGlC,IAAe,YAAf,MAAyB;AAAA,EAE9B;AAAA,EAEA,UAAgB;AACd,SAAK,eAAe;AAAA,EACtB;AAAA,EAEU,aAAmB;AAC3B,SAAK,eAAe;AAEpB,YAAI,6BAAe,KAAK,MAAM,GAAG;AAC/B,WAAK,aAAa,qCAAe,WAAW,MAAM;AAChD,aAAK,eAAe;AAAA,MACtB,GAAG,KAAK,MAAM;AAAA,IAChB;AAAA,EACF;AAAA,EAEU,aAAa,WAAqC;AAE1D,SAAK,SAAS,KAAK;AAAA,MACjB,KAAK,UAAU;AAAA,MACf,cAAc,wBAAW,WAAW,IAAI,KAAK;AAAA,IAC/C;AAAA,EACF;AAAA,EAEU,iBAAiB;AACzB,QAAI,KAAK,YAAY;AACnB,2CAAe,aAAa,KAAK,UAAU;AAC3C,WAAK,aAAa;AAAA,IACpB;AAAA,EACF;AAGF;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/removable.d.cts b/node_modules/@tanstack/query-core/build/modern/removable.d.cts new file mode 100644 index 0000000..7b82525 --- /dev/null +++ b/node_modules/@tanstack/query-core/build/modern/removable.d.cts @@ -0,0 +1,11 @@ +declare abstract class Removable { + #private; + gcTime: number; + destroy(): void; + protected scheduleGc(): void; + protected updateGcTime(newGcTime: number | undefined): void; + protected clearGcTimeout(): void; + protected abstract optionalRemove(): void; +} + +export { Removable }; diff --git a/node_modules/@tanstack/query-core/build/modern/removable.d.ts b/node_modules/@tanstack/query-core/build/modern/removable.d.ts new file mode 100644 index 0000000..7b82525 --- /dev/null +++ b/node_modules/@tanstack/query-core/build/modern/removable.d.ts @@ -0,0 +1,11 @@ +declare abstract class Removable { + #private; + gcTime: number; + destroy(): void; + protected scheduleGc(): void; + protected updateGcTime(newGcTime: number | undefined): void; + protected clearGcTimeout(): void; + protected abstract optionalRemove(): void; +} + +export { Removable }; diff --git a/node_modules/@tanstack/query-core/build/modern/removable.js b/node_modules/@tanstack/query-core/build/modern/removable.js new file mode 100644 index 0000000..8eb8f6c --- /dev/null +++ b/node_modules/@tanstack/query-core/build/modern/removable.js @@ -0,0 +1,33 @@ +// src/removable.ts +import { timeoutManager } from "./timeoutManager.js"; +import { isServer, isValidTimeout } from "./utils.js"; +var Removable = class { + #gcTimeout; + destroy() { + this.clearGcTimeout(); + } + scheduleGc() { + this.clearGcTimeout(); + if (isValidTimeout(this.gcTime)) { + this.#gcTimeout = timeoutManager.setTimeout(() => { + this.optionalRemove(); + }, this.gcTime); + } + } + updateGcTime(newGcTime) { + this.gcTime = Math.max( + this.gcTime || 0, + newGcTime ?? (isServer ? Infinity : 5 * 60 * 1e3) + ); + } + clearGcTimeout() { + if (this.#gcTimeout) { + timeoutManager.clearTimeout(this.#gcTimeout); + this.#gcTimeout = void 0; + } + } +}; +export { + Removable +}; +//# sourceMappingURL=removable.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/removable.js.map b/node_modules/@tanstack/query-core/build/modern/removable.js.map new file mode 100644 index 0000000..f26eeec --- /dev/null +++ b/node_modules/@tanstack/query-core/build/modern/removable.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/removable.ts"],"sourcesContent":["import { timeoutManager } from './timeoutManager'\nimport { isServer, isValidTimeout } from './utils'\nimport type { ManagedTimerId } from './timeoutManager'\n\nexport abstract class Removable {\n gcTime!: number\n #gcTimeout?: ManagedTimerId\n\n destroy(): void {\n this.clearGcTimeout()\n }\n\n protected scheduleGc(): void {\n this.clearGcTimeout()\n\n if (isValidTimeout(this.gcTime)) {\n this.#gcTimeout = timeoutManager.setTimeout(() => {\n this.optionalRemove()\n }, this.gcTime)\n }\n }\n\n protected updateGcTime(newGcTime: number | undefined): void {\n // Default to 5 minutes (Infinity for server-side) if no gcTime is set\n this.gcTime = Math.max(\n this.gcTime || 0,\n newGcTime ?? (isServer ? Infinity : 5 * 60 * 1000),\n )\n }\n\n protected clearGcTimeout() {\n if (this.#gcTimeout) {\n timeoutManager.clearTimeout(this.#gcTimeout)\n this.#gcTimeout = undefined\n }\n }\n\n protected abstract optionalRemove(): void\n}\n"],"mappings":";AAAA,SAAS,sBAAsB;AAC/B,SAAS,UAAU,sBAAsB;AAGlC,IAAe,YAAf,MAAyB;AAAA,EAE9B;AAAA,EAEA,UAAgB;AACd,SAAK,eAAe;AAAA,EACtB;AAAA,EAEU,aAAmB;AAC3B,SAAK,eAAe;AAEpB,QAAI,eAAe,KAAK,MAAM,GAAG;AAC/B,WAAK,aAAa,eAAe,WAAW,MAAM;AAChD,aAAK,eAAe;AAAA,MACtB,GAAG,KAAK,MAAM;AAAA,IAChB;AAAA,EACF;AAAA,EAEU,aAAa,WAAqC;AAE1D,SAAK,SAAS,KAAK;AAAA,MACjB,KAAK,UAAU;AAAA,MACf,cAAc,WAAW,WAAW,IAAI,KAAK;AAAA,IAC/C;AAAA,EACF;AAAA,EAEU,iBAAiB;AACzB,QAAI,KAAK,YAAY;AACnB,qBAAe,aAAa,KAAK,UAAU;AAC3C,WAAK,aAAa;AAAA,IACpB;AAAA,EACF;AAGF;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/retryer.cjs b/node_modules/@tanstack/query-core/build/modern/retryer.cjs new file mode 100644 index 0000000..61f9160 --- /dev/null +++ b/node_modules/@tanstack/query-core/build/modern/retryer.cjs @@ -0,0 +1,161 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/retryer.ts +var retryer_exports = {}; +__export(retryer_exports, { + CancelledError: () => CancelledError, + canFetch: () => canFetch, + createRetryer: () => createRetryer, + isCancelledError: () => isCancelledError +}); +module.exports = __toCommonJS(retryer_exports); +var import_focusManager = require("./focusManager.cjs"); +var import_onlineManager = require("./onlineManager.cjs"); +var import_thenable = require("./thenable.cjs"); +var import_utils = require("./utils.cjs"); +function defaultRetryDelay(failureCount) { + return Math.min(1e3 * 2 ** failureCount, 3e4); +} +function canFetch(networkMode) { + return (networkMode ?? "online") === "online" ? import_onlineManager.onlineManager.isOnline() : true; +} +var CancelledError = class extends Error { + constructor(options) { + super("CancelledError"); + this.revert = options?.revert; + this.silent = options?.silent; + } +}; +function isCancelledError(value) { + return value instanceof CancelledError; +} +function createRetryer(config) { + let isRetryCancelled = false; + let failureCount = 0; + let continueFn; + const thenable = (0, import_thenable.pendingThenable)(); + const isResolved = () => thenable.status !== "pending"; + const cancel = (cancelOptions) => { + if (!isResolved()) { + const error = new CancelledError(cancelOptions); + reject(error); + config.onCancel?.(error); + } + }; + const cancelRetry = () => { + isRetryCancelled = true; + }; + const continueRetry = () => { + isRetryCancelled = false; + }; + const canContinue = () => import_focusManager.focusManager.isFocused() && (config.networkMode === "always" || import_onlineManager.onlineManager.isOnline()) && config.canRun(); + const canStart = () => canFetch(config.networkMode) && config.canRun(); + const resolve = (value) => { + if (!isResolved()) { + continueFn?.(); + thenable.resolve(value); + } + }; + const reject = (value) => { + if (!isResolved()) { + continueFn?.(); + thenable.reject(value); + } + }; + const pause = () => { + return new Promise((continueResolve) => { + continueFn = (value) => { + if (isResolved() || canContinue()) { + continueResolve(value); + } + }; + config.onPause?.(); + }).then(() => { + continueFn = void 0; + if (!isResolved()) { + config.onContinue?.(); + } + }); + }; + const run = () => { + if (isResolved()) { + return; + } + let promiseOrValue; + const initialPromise = failureCount === 0 ? config.initialPromise : void 0; + try { + promiseOrValue = initialPromise ?? config.fn(); + } catch (error) { + promiseOrValue = Promise.reject(error); + } + Promise.resolve(promiseOrValue).then(resolve).catch((error) => { + if (isResolved()) { + return; + } + const retry = config.retry ?? (import_utils.isServer ? 0 : 3); + const retryDelay = config.retryDelay ?? defaultRetryDelay; + const delay = typeof retryDelay === "function" ? retryDelay(failureCount, error) : retryDelay; + const shouldRetry = retry === true || typeof retry === "number" && failureCount < retry || typeof retry === "function" && retry(failureCount, error); + if (isRetryCancelled || !shouldRetry) { + reject(error); + return; + } + failureCount++; + config.onFail?.(failureCount, error); + (0, import_utils.sleep)(delay).then(() => { + return canContinue() ? void 0 : pause(); + }).then(() => { + if (isRetryCancelled) { + reject(error); + } else { + run(); + } + }); + }); + }; + return { + promise: thenable, + status: () => thenable.status, + cancel, + continue: () => { + continueFn?.(); + return thenable; + }, + cancelRetry, + continueRetry, + canStart, + start: () => { + if (canStart()) { + run(); + } else { + pause().then(run); + } + return thenable; + } + }; +} +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + CancelledError, + canFetch, + createRetryer, + isCancelledError +}); +//# sourceMappingURL=retryer.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/retryer.cjs.map b/node_modules/@tanstack/query-core/build/modern/retryer.cjs.map new file mode 100644 index 0000000..eb30576 --- /dev/null +++ b/node_modules/@tanstack/query-core/build/modern/retryer.cjs.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/retryer.ts"],"sourcesContent":["import { focusManager } from './focusManager'\nimport { onlineManager } from './onlineManager'\nimport { pendingThenable } from './thenable'\nimport { isServer, sleep } from './utils'\nimport type { Thenable } from './thenable'\nimport type { CancelOptions, DefaultError, NetworkMode } from './types'\n\n// TYPES\n\ninterface RetryerConfig {\n fn: () => TData | Promise\n initialPromise?: Promise\n onCancel?: (error: TError) => void\n onFail?: (failureCount: number, error: TError) => void\n onPause?: () => void\n onContinue?: () => void\n retry?: RetryValue\n retryDelay?: RetryDelayValue\n networkMode: NetworkMode | undefined\n canRun: () => boolean\n}\n\nexport interface Retryer {\n promise: Promise\n cancel: (cancelOptions?: CancelOptions) => void\n continue: () => Promise\n cancelRetry: () => void\n continueRetry: () => void\n canStart: () => boolean\n start: () => Promise\n status: () => 'pending' | 'resolved' | 'rejected'\n}\n\nexport type RetryValue = boolean | number | ShouldRetryFunction\n\ntype ShouldRetryFunction = (\n failureCount: number,\n error: TError,\n) => boolean\n\nexport type RetryDelayValue = number | RetryDelayFunction\n\ntype RetryDelayFunction = (\n failureCount: number,\n error: TError,\n) => number\n\nfunction defaultRetryDelay(failureCount: number) {\n return Math.min(1000 * 2 ** failureCount, 30000)\n}\n\nexport function canFetch(networkMode: NetworkMode | undefined): boolean {\n return (networkMode ?? 'online') === 'online'\n ? onlineManager.isOnline()\n : true\n}\n\nexport class CancelledError extends Error {\n revert?: boolean\n silent?: boolean\n constructor(options?: CancelOptions) {\n super('CancelledError')\n this.revert = options?.revert\n this.silent = options?.silent\n }\n}\n\n/**\n * @deprecated Use instanceof `CancelledError` instead.\n */\nexport function isCancelledError(value: any): value is CancelledError {\n return value instanceof CancelledError\n}\n\nexport function createRetryer(\n config: RetryerConfig,\n): Retryer {\n let isRetryCancelled = false\n let failureCount = 0\n let continueFn: ((value?: unknown) => void) | undefined\n\n const thenable = pendingThenable()\n\n const isResolved = () =>\n (thenable.status as Thenable['status']) !== 'pending'\n\n const cancel = (cancelOptions?: CancelOptions): void => {\n if (!isResolved()) {\n const error = new CancelledError(cancelOptions) as TError\n reject(error)\n\n config.onCancel?.(error)\n }\n }\n const cancelRetry = () => {\n isRetryCancelled = true\n }\n\n const continueRetry = () => {\n isRetryCancelled = false\n }\n\n const canContinue = () =>\n focusManager.isFocused() &&\n (config.networkMode === 'always' || onlineManager.isOnline()) &&\n config.canRun()\n\n const canStart = () => canFetch(config.networkMode) && config.canRun()\n\n const resolve = (value: any) => {\n if (!isResolved()) {\n continueFn?.()\n thenable.resolve(value)\n }\n }\n\n const reject = (value: any) => {\n if (!isResolved()) {\n continueFn?.()\n thenable.reject(value)\n }\n }\n\n const pause = () => {\n return new Promise((continueResolve) => {\n continueFn = (value) => {\n if (isResolved() || canContinue()) {\n continueResolve(value)\n }\n }\n config.onPause?.()\n }).then(() => {\n continueFn = undefined\n if (!isResolved()) {\n config.onContinue?.()\n }\n })\n }\n\n // Create loop function\n const run = () => {\n // Do nothing if already resolved\n if (isResolved()) {\n return\n }\n\n let promiseOrValue: any\n\n // we can re-use config.initialPromise on the first call of run()\n const initialPromise =\n failureCount === 0 ? config.initialPromise : undefined\n\n // Execute query\n try {\n promiseOrValue = initialPromise ?? config.fn()\n } catch (error) {\n promiseOrValue = Promise.reject(error)\n }\n\n Promise.resolve(promiseOrValue)\n .then(resolve)\n .catch((error) => {\n // Stop if the fetch is already resolved\n if (isResolved()) {\n return\n }\n\n // Do we need to retry the request?\n const retry = config.retry ?? (isServer ? 0 : 3)\n const retryDelay = config.retryDelay ?? defaultRetryDelay\n const delay =\n typeof retryDelay === 'function'\n ? retryDelay(failureCount, error)\n : retryDelay\n const shouldRetry =\n retry === true ||\n (typeof retry === 'number' && failureCount < retry) ||\n (typeof retry === 'function' && retry(failureCount, error))\n\n if (isRetryCancelled || !shouldRetry) {\n // We are done if the query does not need to be retried\n reject(error)\n return\n }\n\n failureCount++\n\n // Notify on fail\n config.onFail?.(failureCount, error)\n\n // Delay\n sleep(delay)\n // Pause if the document is not visible or when the device is offline\n .then(() => {\n return canContinue() ? undefined : pause()\n })\n .then(() => {\n if (isRetryCancelled) {\n reject(error)\n } else {\n run()\n }\n })\n })\n }\n\n return {\n promise: thenable,\n status: () => thenable.status,\n cancel,\n continue: () => {\n continueFn?.()\n return thenable\n },\n cancelRetry,\n continueRetry,\n canStart,\n start: () => {\n // Start loop\n if (canStart()) {\n run()\n } else {\n pause().then(run)\n }\n return thenable\n },\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,0BAA6B;AAC7B,2BAA8B;AAC9B,sBAAgC;AAChC,mBAAgC;AA4ChC,SAAS,kBAAkB,cAAsB;AAC/C,SAAO,KAAK,IAAI,MAAO,KAAK,cAAc,GAAK;AACjD;AAEO,SAAS,SAAS,aAA+C;AACtE,UAAQ,eAAe,cAAc,WACjC,mCAAc,SAAS,IACvB;AACN;AA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YAAI;AAAA,MACN,OAAO;AACL,cAAM,EAAE,KAAK,GAAG;AAAA,MAClB;AACA,aAAO;AAAA,IACT;AAAA,EACF;AACF;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/retryer.d.cts b/node_modules/@tanstack/query-core/build/modern/retryer.d.cts new file mode 100644 index 0000000..d348311 --- /dev/null +++ b/node_modules/@tanstack/query-core/build/modern/retryer.d.cts @@ -0,0 +1,3 @@ +export { C as CancelledError, bE as RetryDelayValue, bD as RetryValue, bC as Retryer, bF as canFetch, bG as createRetryer, j as isCancelledError } from './hydration-uphG6M-i.cjs'; +import './removable.cjs'; +import './subscribable.cjs'; diff --git a/node_modules/@tanstack/query-core/build/modern/retryer.d.ts b/node_modules/@tanstack/query-core/build/modern/retryer.d.ts new file mode 100644 index 0000000..87ee12a --- /dev/null +++ b/node_modules/@tanstack/query-core/build/modern/retryer.d.ts @@ -0,0 +1,3 @@ +export { C as CancelledError, bE as RetryDelayValue, bD as RetryValue, bC as Retryer, bF as canFetch, bG as createRetryer, j as isCancelledError } from './hydration-BlEVG2Lp.js'; +import './removable.js'; +import './subscribable.js'; diff --git a/node_modules/@tanstack/query-core/build/modern/retryer.js b/node_modules/@tanstack/query-core/build/modern/retryer.js new file mode 100644 index 0000000..9aec541 --- /dev/null +++ b/node_modules/@tanstack/query-core/build/modern/retryer.js @@ -0,0 +1,133 @@ +// src/retryer.ts +import { focusManager } from "./focusManager.js"; +import { onlineManager } from "./onlineManager.js"; +import { pendingThenable } from "./thenable.js"; +import { isServer, sleep } from "./utils.js"; +function defaultRetryDelay(failureCount) { + return Math.min(1e3 * 2 ** failureCount, 3e4); +} +function canFetch(networkMode) { + return (networkMode ?? "online") === "online" ? onlineManager.isOnline() : true; +} +var CancelledError = class extends Error { + constructor(options) { + super("CancelledError"); + this.revert = options?.revert; + this.silent = options?.silent; + } +}; +function isCancelledError(value) { + return value instanceof CancelledError; +} +function createRetryer(config) { + let isRetryCancelled = false; + let failureCount = 0; + let continueFn; + const thenable = pendingThenable(); + const isResolved = () => thenable.status !== "pending"; + const cancel = (cancelOptions) => { + if (!isResolved()) { + const error = new CancelledError(cancelOptions); + reject(error); + config.onCancel?.(error); + } + }; + const cancelRetry = () => { + isRetryCancelled = true; + }; + const continueRetry = () => { + isRetryCancelled = false; + }; + const canContinue = () => focusManager.isFocused() && (config.networkMode === "always" || onlineManager.isOnline()) && config.canRun(); + const canStart = () => canFetch(config.networkMode) && config.canRun(); + const resolve = (value) => { + if (!isResolved()) { + continueFn?.(); + thenable.resolve(value); + } + }; + const reject = (value) => { + if (!isResolved()) { + continueFn?.(); + thenable.reject(value); + } + }; + const pause = () => { + return new Promise((continueResolve) => { + continueFn = (value) => { + if (isResolved() || canContinue()) { + continueResolve(value); + } + }; + config.onPause?.(); + }).then(() => { + continueFn = void 0; + if (!isResolved()) { + config.onContinue?.(); + } + }); + }; + const run = () => { + if (isResolved()) { + return; + } + let promiseOrValue; + const initialPromise = failureCount === 0 ? config.initialPromise : void 0; + try { + promiseOrValue = initialPromise ?? config.fn(); + } catch (error) { + promiseOrValue = Promise.reject(error); + } + Promise.resolve(promiseOrValue).then(resolve).catch((error) => { + if (isResolved()) { + return; + } + const retry = config.retry ?? (isServer ? 0 : 3); + const retryDelay = config.retryDelay ?? defaultRetryDelay; + const delay = typeof retryDelay === "function" ? retryDelay(failureCount, error) : retryDelay; + const shouldRetry = retry === true || typeof retry === "number" && failureCount < retry || typeof retry === "function" && retry(failureCount, error); + if (isRetryCancelled || !shouldRetry) { + reject(error); + return; + } + failureCount++; + config.onFail?.(failureCount, error); + sleep(delay).then(() => { + return canContinue() ? void 0 : pause(); + }).then(() => { + if (isRetryCancelled) { + reject(error); + } else { + run(); + } + }); + }); + }; + return { + promise: thenable, + status: () => thenable.status, + cancel, + continue: () => { + continueFn?.(); + return thenable; + }, + cancelRetry, + continueRetry, + canStart, + start: () => { + if (canStart()) { + run(); + } else { + pause().then(run); + } + return thenable; + } + }; +} +export { + CancelledError, + canFetch, + createRetryer, + isCancelledError +}; +//# sourceMappingURL=retryer.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/retryer.js.map b/node_modules/@tanstack/query-core/build/modern/retryer.js.map new file mode 100644 index 0000000..2682383 --- /dev/null +++ b/node_modules/@tanstack/query-core/build/modern/retryer.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/retryer.ts"],"sourcesContent":["import { focusManager } from './focusManager'\nimport { onlineManager } from './onlineManager'\nimport { pendingThenable } from './thenable'\nimport { isServer, sleep } from './utils'\nimport type { Thenable } from './thenable'\nimport type { CancelOptions, DefaultError, NetworkMode } from './types'\n\n// TYPES\n\ninterface RetryerConfig {\n fn: () => TData | Promise\n initialPromise?: Promise\n onCancel?: (error: TError) => void\n onFail?: (failureCount: number, error: TError) => void\n onPause?: () => void\n onContinue?: () => void\n retry?: RetryValue\n retryDelay?: RetryDelayValue\n networkMode: NetworkMode | undefined\n canRun: () => boolean\n}\n\nexport interface Retryer {\n promise: Promise\n cancel: (cancelOptions?: CancelOptions) => void\n continue: () => Promise\n cancelRetry: () => void\n continueRetry: () => void\n canStart: () => boolean\n start: () => Promise\n status: () => 'pending' | 'resolved' | 'rejected'\n}\n\nexport type RetryValue = boolean | number | ShouldRetryFunction\n\ntype ShouldRetryFunction = (\n failureCount: number,\n error: TError,\n) => boolean\n\nexport type RetryDelayValue = number | RetryDelayFunction\n\ntype RetryDelayFunction = (\n failureCount: number,\n error: TError,\n) => number\n\nfunction defaultRetryDelay(failureCount: number) {\n return Math.min(1000 * 2 ** failureCount, 30000)\n}\n\nexport function canFetch(networkMode: NetworkMode | undefined): boolean {\n return (networkMode ?? 'online') === 'online'\n ? onlineManager.isOnline()\n : true\n}\n\nexport class CancelledError extends Error {\n revert?: boolean\n silent?: boolean\n constructor(options?: CancelOptions) {\n super('CancelledError')\n this.revert = options?.revert\n this.silent = options?.silent\n }\n}\n\n/**\n * @deprecated Use instanceof `CancelledError` instead.\n */\nexport function isCancelledError(value: any): value is CancelledError {\n return value instanceof CancelledError\n}\n\nexport function createRetryer(\n config: RetryerConfig,\n): Retryer {\n let isRetryCancelled = false\n let failureCount = 0\n let continueFn: ((value?: unknown) => void) | undefined\n\n const thenable = pendingThenable()\n\n const isResolved = () =>\n (thenable.status as Thenable['status']) !== 'pending'\n\n const cancel = (cancelOptions?: CancelOptions): void => {\n if (!isResolved()) {\n const error = new CancelledError(cancelOptions) as TError\n reject(error)\n\n config.onCancel?.(error)\n }\n }\n const cancelRetry = () => {\n isRetryCancelled = true\n }\n\n const continueRetry = () => {\n isRetryCancelled = false\n }\n\n const canContinue = () =>\n focusManager.isFocused() &&\n (config.networkMode === 'always' || onlineManager.isOnline()) &&\n config.canRun()\n\n const canStart = () => canFetch(config.networkMode) && config.canRun()\n\n const resolve = (value: any) => {\n if (!isResolved()) {\n continueFn?.()\n thenable.resolve(value)\n }\n }\n\n const reject = (value: any) => {\n if (!isResolved()) {\n continueFn?.()\n thenable.reject(value)\n }\n }\n\n const pause = () => {\n return new Promise((continueResolve) => {\n continueFn = (value) => {\n if (isResolved() || canContinue()) {\n continueResolve(value)\n }\n }\n config.onPause?.()\n }).then(() => {\n continueFn = undefined\n if (!isResolved()) {\n config.onContinue?.()\n }\n })\n }\n\n // Create loop function\n const run = () => {\n // Do nothing if already resolved\n if (isResolved()) {\n return\n }\n\n let promiseOrValue: any\n\n // we can re-use config.initialPromise on the first call of run()\n const initialPromise =\n failureCount === 0 ? config.initialPromise : undefined\n\n // Execute query\n try {\n promiseOrValue = initialPromise ?? config.fn()\n } catch (error) {\n promiseOrValue = Promise.reject(error)\n }\n\n Promise.resolve(promiseOrValue)\n .then(resolve)\n .catch((error) => {\n // Stop if the fetch is already resolved\n if (isResolved()) {\n return\n }\n\n // Do we need to retry the request?\n const retry = config.retry ?? (isServer ? 0 : 3)\n const retryDelay = config.retryDelay ?? defaultRetryDelay\n const delay =\n typeof retryDelay === 'function'\n ? retryDelay(failureCount, error)\n : retryDelay\n const shouldRetry =\n retry === true ||\n (typeof retry === 'number' && failureCount < retry) ||\n (typeof retry === 'function' && retry(failureCount, error))\n\n if (isRetryCancelled || !shouldRetry) {\n // We are done if the query does not need to be retried\n reject(error)\n return\n }\n\n failureCount++\n\n // Notify on fail\n config.onFail?.(failureCount, error)\n\n // Delay\n sleep(delay)\n // Pause if the document is not visible or when the device is offline\n .then(() => {\n return canContinue() ? undefined : pause()\n })\n .then(() => {\n if (isRetryCancelled) {\n reject(error)\n } else {\n run()\n }\n })\n })\n }\n\n return {\n promise: thenable,\n status: () => thenable.status,\n cancel,\n continue: () => {\n continueFn?.()\n return thenable\n },\n cancelRetry,\n continueRetry,\n canStart,\n start: () => {\n // Start loop\n if (canStart()) {\n run()\n } else {\n pause().then(run)\n }\n return thenable\n },\n }\n}\n"],"mappings":";AAAA,SAAS,oBAAoB;AAC7B,SAAS,qBAAqB;AAC9B,SAAS,uBAAuB;AAChC,SAAS,UAAU,aAAa;AA4ChC,SAAS,kBAAkB,cAAsB;AAC/C,SAAO,KAAK,IAAI,MAAO,KAAK,cAAc,GAAK;AACjD;AAEO,SAAS,SAAS,aAA+C;AACtE,UAAQ,eAAe,cAAc,WACjC,cAAc,SAAS,IACvB;AACN;AAEO,IAAM,iBAAN,cAA6B,MAAM;AAAA,EAGxC,YAAY,SAAyB;AACnC,UAAM,gBAAgB;AACtB,SAAK,SAAS,SAAS;AACvB,SAAK,SAAS,SAAS;AAAA,EACzB;AACF;AAKO,SAAS,iBAAiB,OAAqC;AACpE,SAAO,iBAAiB;AAC1B;AAEO,SAAS,cACd,QACgB;AAChB,MAAI,mBAAmB;AACvB,MAAI,eAAe;AACnB,MAAI;AAEJ,QAAM,WAAW,gBAAuB;AAExC,QAAM,aAAa,MAChB,SAAS,WAAyC;AAErD,QAAM,SAAS,CAAC,kBAAwC;AACtD,QAAI,CAAC,WAAW,GAAG;AACjB,YAAM,QAAQ,IAAI,eAAe,aAAa;AAC9C,aAAO,KAAK;AAEZ,aAAO,WAAW,K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UAAU,WAAW,IAAI;AAC9C,YAAM,aAAa,OAAO,cAAc;AACxC,YAAM,QACJ,OAAO,eAAe,aAClB,WAAW,cAAc,KAAK,IAC9B;AACN,YAAM,cACJ,UAAU,QACT,OAAO,UAAU,YAAY,eAAe,SAC5C,OAAO,UAAU,cAAc,MAAM,cAAc,KAAK;AAE3D,UAAI,oBAAoB,CAAC,aAAa;AAEpC,eAAO,KAAK;AACZ;AAAA,MACF;AAEA;AAGA,aAAO,SAAS,cAAc,KAAK;AAGnC,YAAM,KAAK,EAER,KAAK,MAAM;AACV,eAAO,YAAY,IAAI,SAAY,MAAM;AAAA,MAC3C,CAAC,EACA,KAAK,MAAM;AACV,YAAI,kBAAkB;AACpB,iBAAO,KAAK;AAAA,QACd,OAAO;AACL,cAAI;AAAA,QACN;AAAA,MACF,CAAC;AAAA,IACL,CAAC;AAAA,EACL;AAEA,SAAO;AAAA,IACL,SAAS;AAAA,IACT,QAAQ,MAAM,SAAS;AAAA,IACvB;AAAA,IACA,UAAU,MAAM;AACd,mBAAa;AACb,aAAO;AAAA,IACT;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,OAAO,MAAM;AAEX,UAAI,SAAS,GAAG;AACd,YAAI;AAAA,MACN,OAAO;AACL,cAAM,EAAE,KAAK,GAAG;AAAA,MAClB;AACA,aAAO;AAAA,IACT;AAAA,EACF;AACF;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/streamedQuery.cjs b/node_modules/@tanstack/query-core/build/modern/streamedQuery.cjs new file mode 100644 index 0000000..5752fe9 --- /dev/null +++ b/node_modules/@tanstack/query-core/build/modern/streamedQuery.cjs @@ -0,0 +1,82 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/streamedQuery.ts +var streamedQuery_exports = {}; +__export(streamedQuery_exports, { + streamedQuery: () => streamedQuery +}); +module.exports = __toCommonJS(streamedQuery_exports); +var import_utils = require("./utils.cjs"); +function streamedQuery({ + streamFn, + refetchMode = "reset", + reducer = (items, chunk) => (0, import_utils.addToEnd)(items, chunk), + initialValue = [] +}) { + return async (context) => { + const query = context.client.getQueryCache().find({ queryKey: context.queryKey, exact: true }); + const isRefetch = !!query && query.state.data !== void 0; + if (isRefetch && refetchMode === "reset") { + query.setState({ + status: "pending", + data: void 0, + error: null, + fetchStatus: "fetching" + }); + } + let result = initialValue; + let cancelled = false; + const streamFnContext = (0, import_utils.addConsumeAwareSignal)( + { + client: context.client, + meta: context.meta, + queryKey: context.queryKey, + pageParam: context.pageParam, + direction: context.direction + }, + () => context.signal, + () => cancelled = true + ); + const stream = await streamFn(streamFnContext); + const isReplaceRefetch = isRefetch && refetchMode === "replace"; + for await (const chunk of stream) { + if (cancelled) { + break; + } + if (isReplaceRefetch) { + result = reducer(result, chunk); + } else { + context.client.setQueryData( + context.queryKey, + (prev) => reducer(prev === void 0 ? initialValue : prev, chunk) + ); + } + } + if (isReplaceRefetch && !cancelled) { + context.client.setQueryData(context.queryKey, result); + } + return context.client.getQueryData(context.queryKey) ?? initialValue; + }; +} +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + streamedQuery +}); +//# sourceMappingURL=streamedQuery.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/streamedQuery.cjs.map b/node_modules/@tanstack/query-core/build/modern/streamedQuery.cjs.map new file mode 100644 index 0000000..37ef7ac --- /dev/null +++ b/node_modules/@tanstack/query-core/build/modern/streamedQuery.cjs.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/streamedQuery.ts"],"sourcesContent":["import { addConsumeAwareSignal, addToEnd } from './utils'\nimport type {\n OmitKeyof,\n QueryFunction,\n QueryFunctionContext,\n QueryKey,\n} from './types'\n\ntype BaseStreamedQueryParams = {\n streamFn: (\n context: QueryFunctionContext,\n ) => AsyncIterable | Promise>\n refetchMode?: 'append' | 'reset' | 'replace'\n}\n\ntype SimpleStreamedQueryParams<\n TQueryFnData,\n TQueryKey extends QueryKey,\n> = BaseStreamedQueryParams & {\n reducer?: never\n initialValue?: never\n}\n\ntype ReducibleStreamedQueryParams<\n TQueryFnData,\n TData,\n TQueryKey extends QueryKey,\n> = BaseStreamedQueryParams & {\n reducer: (acc: TData, chunk: TQueryFnData) => TData\n initialValue: TData\n}\n\ntype StreamedQueryParams =\n | SimpleStreamedQueryParams\n | ReducibleStreamedQueryParams\n\n/**\n * This is a helper function to create a query function that streams data from an AsyncIterable.\n * Data will be an Array of all the chunks received.\n * The query will be in a 'pending' state until the first chunk of data is received, but will go to 'success' after that.\n * The query will stay in fetchStatus 'fetching' until the stream ends.\n * @param queryFn - The function that returns an AsyncIterable to stream data from.\n * @param refetchMode - Defines how re-fetches are handled.\n * Defaults to `'reset'`, erases all data and puts the query back into `pending` state.\n * Set to `'append'` to append new data to the existing data.\n * Set to `'replace'` to write all data to the cache once the stream ends.\n * @param reducer - A function to reduce the streamed chunks into the final data.\n * Defaults to a function that appends chunks to the end of the array.\n * @param initialValue - Initial value to be used while the first chunk is being fetched, and returned if the stream yields no values.\n */\nexport function streamedQuery<\n TQueryFnData = unknown,\n TData = Array,\n TQueryKey extends QueryKey = QueryKey,\n>({\n streamFn,\n refetchMode = 'reset',\n reducer = (items, chunk) =>\n addToEnd(items as Array, chunk) as TData,\n initialValue = [] as TData,\n}: StreamedQueryParams): QueryFunction<\n TData,\n TQueryKey\n> {\n return async (context) => {\n const query = context.client\n .getQueryCache()\n .find({ queryKey: context.queryKey, exact: true })\n const isRefetch = !!query && query.state.data !== undefined\n if (isRefetch && refetchMode === 'reset') {\n query.setState({\n status: 'pending',\n data: undefined,\n error: null,\n fetchStatus: 'fetching',\n })\n }\n\n let result = initialValue\n\n let cancelled: boolean = false as boolean\n const streamFnContext = addConsumeAwareSignal<\n OmitKeyof\n >(\n {\n client: context.client,\n meta: context.meta,\n queryKey: context.queryKey,\n pageParam: context.pageParam,\n direction: context.direction,\n },\n () => context.signal,\n () => (cancelled = true),\n )\n\n const stream = await streamFn(streamFnContext)\n\n const isReplaceRefetch = isRefetch && refetchMode === 'replace'\n\n for await (const chunk of stream) {\n if (cancelled) {\n break\n }\n\n if (isReplaceRefetch) {\n // don't append to the cache directly when replace-refetching\n result = reducer(result, chunk)\n } else {\n context.client.setQueryData(context.queryKey, (prev) =>\n reducer(prev === undefined ? initialValue : prev, chunk),\n )\n }\n }\n\n // finalize result: replace-refetching needs to write to the cache\n if (isReplaceRefetch && !cancelled) {\n context.client.setQueryData(context.queryKey, result)\n }\n\n return context.client.getQueryData(context.queryKey) ?? initialValue\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAgD;AAkDzC,SAAS,cAId;AAAA,EACA;AAAA,EACA,cAAc;AAAA,EACd,UAAU,CAAC,OAAO,cAChB,uBAAS,OAA8B,KAAK;AAAA,EAC9C,eAAe,CAAC;AAClB,GAGE;AACA,SAAO,OAAO,YAAY;AACxB,UAAM,QAAQ,QAAQ,OACnB,cAAc,EACd,KAAK,EAAE,UAAU,QAAQ,UAAU,OAAO,KAAK,CAAC;AACnD,UAAM,YAAY,CAAC,CAAC,SAAS,MAAM,MAAM,SAAS;AAClD,QAAI,aAAa,gBAAgB,SAAS;AACxC,YAAM,SAAS;AAAA,QACb,QAAQ;AAAA,QACR,MAAM;AAAA,QACN,OAAO;AAAA,QACP,aAAa;AAAA,MACf,CAAC;AAAA,IACH;AAEA,QAAI,SAAS;AAEb,QAAI,YAAqB;AACzB,UAAM,sBAAkB;AAAA,MAGtB;AAAA,QACE,QAAQ,QAAQ;AAAA,QAChB,MAAM,QAAQ;AAAA,QACd,UAAU,QAAQ;AAAA,QAClB,WAAW,QAAQ;AAAA,QACnB,WAAW,QAAQ;AAAA,MACrB;AAAA,MACA,MAAM,QAAQ;AAAA,MACd,MAAO,YAAY;AAAA,IACrB;AAEA,UAAM,SAAS,MAAM,SAAS,eAAe;AAE7C,UAAM,mBAAmB,aAAa,gBAAgB;AAEtD,qBAAiB,SAAS,QAAQ;AAChC,UAAI,WAAW;AACb;AAAA,MACF;AAEA,UAAI,kBAAkB;AAEpB,iBAAS,QAAQ,QAAQ,KAAK;AAAA,MAChC,OAAO;AACL,gBAAQ,OAAO;AAAA,UAAoB,QAAQ;AAAA,UAAU,CAAC,SACpD,QAAQ,SAAS,SAAY,eAAe,MAAM,KAAK;AAAA,QACzD;AAAA,MACF;AAAA,IACF;AAGA,QAAI,oBAAoB,CAAC,WAAW;AAClC,cAAQ,OAAO,aAAoB,QAAQ,UAAU,MAAM;AAAA,IAC7D;AAEA,WAAO,QAAQ,OAAO,aAAa,QAAQ,QAAQ,KAAK;AAAA,EAC1D;AACF;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/streamedQuery.d.cts b/node_modules/@tanstack/query-core/build/modern/streamedQuery.d.cts new file mode 100644 index 0000000..c133466 --- /dev/null +++ b/node_modules/@tanstack/query-core/build/modern/streamedQuery.d.cts @@ -0,0 +1,34 @@ +import { I as QueryKey, a1 as QueryFunctionContext, Y as QueryFunction } from './hydration-uphG6M-i.cjs'; +import './removable.cjs'; +import './subscribable.cjs'; + +type BaseStreamedQueryParams = { + streamFn: (context: QueryFunctionContext) => AsyncIterable | Promise>; + refetchMode?: 'append' | 'reset' | 'replace'; +}; +type SimpleStreamedQueryParams = BaseStreamedQueryParams & { + reducer?: never; + initialValue?: never; +}; +type ReducibleStreamedQueryParams = BaseStreamedQueryParams & { + reducer: (acc: TData, chunk: TQueryFnData) => TData; + initialValue: TData; +}; +type StreamedQueryParams = SimpleStreamedQueryParams | ReducibleStreamedQueryParams; +/** + * This is a helper function to create a query function that streams data from an AsyncIterable. + * Data will be an Array of all the chunks received. + * The query will be in a 'pending' state until the first chunk of data is received, but will go to 'success' after that. + * The query will stay in fetchStatus 'fetching' until the stream ends. + * @param queryFn - The function that returns an AsyncIterable to stream data from. + * @param refetchMode - Defines how re-fetches are handled. + * Defaults to `'reset'`, erases all data and puts the query back into `pending` state. + * Set to `'append'` to append new data to the existing data. + * Set to `'replace'` to write all data to the cache once the stream ends. + * @param reducer - A function to reduce the streamed chunks into the final data. + * Defaults to a function that appends chunks to the end of the array. + * @param initialValue - Initial value to be used while the first chunk is being fetched, and returned if the stream yields no values. + */ +declare function streamedQuery, TQueryKey extends QueryKey = QueryKey>({ streamFn, refetchMode, reducer, initialValue, }: StreamedQueryParams): QueryFunction; + +export { streamedQuery }; diff --git a/node_modules/@tanstack/query-core/build/modern/streamedQuery.d.ts b/node_modules/@tanstack/query-core/build/modern/streamedQuery.d.ts new file mode 100644 index 0000000..44d3ec4 --- /dev/null +++ b/node_modules/@tanstack/query-core/build/modern/streamedQuery.d.ts @@ -0,0 +1,34 @@ +import { I as QueryKey, a1 as QueryFunctionContext, Y as QueryFunction } from './hydration-BlEVG2Lp.js'; +import './removable.js'; +import './subscribable.js'; + +type BaseStreamedQueryParams = { + streamFn: (context: QueryFunctionContext) => AsyncIterable | Promise>; + refetchMode?: 'append' | 'reset' | 'replace'; +}; +type SimpleStreamedQueryParams = BaseStreamedQueryParams & { + reducer?: never; + initialValue?: never; +}; +type ReducibleStreamedQueryParams = BaseStreamedQueryParams & { + reducer: (acc: TData, chunk: TQueryFnData) => TData; + initialValue: TData; +}; +type StreamedQueryParams = SimpleStreamedQueryParams | ReducibleStreamedQueryParams; +/** + * This is a helper function to create a query function that streams data from an AsyncIterable. + * Data will be an Array of all the chunks received. + * The query will be in a 'pending' state until the first chunk of data is received, but will go to 'success' after that. + * The query will stay in fetchStatus 'fetching' until the stream ends. + * @param queryFn - The function that returns an AsyncIterable to stream data from. + * @param refetchMode - Defines how re-fetches are handled. + * Defaults to `'reset'`, erases all data and puts the query back into `pending` state. + * Set to `'append'` to append new data to the existing data. + * Set to `'replace'` to write all data to the cache once the stream ends. + * @param reducer - A function to reduce the streamed chunks into the final data. + * Defaults to a function that appends chunks to the end of the array. + * @param initialValue - Initial value to be used while the first chunk is being fetched, and returned if the stream yields no values. + */ +declare function streamedQuery, TQueryKey extends QueryKey = QueryKey>({ streamFn, refetchMode, reducer, initialValue, }: StreamedQueryParams): QueryFunction; + +export { streamedQuery }; diff --git a/node_modules/@tanstack/query-core/build/modern/streamedQuery.js b/node_modules/@tanstack/query-core/build/modern/streamedQuery.js new file mode 100644 index 0000000..0b32883 --- /dev/null +++ b/node_modules/@tanstack/query-core/build/modern/streamedQuery.js @@ -0,0 +1,57 @@ +// src/streamedQuery.ts +import { addConsumeAwareSignal, addToEnd } from "./utils.js"; +function streamedQuery({ + streamFn, + refetchMode = "reset", + reducer = (items, chunk) => addToEnd(items, chunk), + initialValue = [] +}) { + return async (context) => { + const query = context.client.getQueryCache().find({ queryKey: context.queryKey, exact: true }); + const isRefetch = !!query && query.state.data !== void 0; + if (isRefetch && refetchMode === "reset") { + query.setState({ + status: "pending", + data: void 0, + error: null, + fetchStatus: "fetching" + }); + } + let result = initialValue; + let cancelled = false; + const streamFnContext = addConsumeAwareSignal( + { + client: context.client, + meta: context.meta, + queryKey: context.queryKey, + pageParam: context.pageParam, + direction: context.direction + }, + () => context.signal, + () => cancelled = true + ); + const stream = await streamFn(streamFnContext); + const isReplaceRefetch = isRefetch && refetchMode === "replace"; + for await (const chunk of stream) { + if (cancelled) { + break; + } + if (isReplaceRefetch) { + result = reducer(result, chunk); + } else { + context.client.setQueryData( + context.queryKey, + (prev) => reducer(prev === void 0 ? initialValue : prev, chunk) + ); + } + } + if (isReplaceRefetch && !cancelled) { + context.client.setQueryData(context.queryKey, result); + } + return context.client.getQueryData(context.queryKey) ?? initialValue; + }; +} +export { + streamedQuery +}; +//# sourceMappingURL=streamedQuery.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/streamedQuery.js.map b/node_modules/@tanstack/query-core/build/modern/streamedQuery.js.map new file mode 100644 index 0000000..a862d01 --- /dev/null +++ b/node_modules/@tanstack/query-core/build/modern/streamedQuery.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/streamedQuery.ts"],"sourcesContent":["import { addConsumeAwareSignal, addToEnd } from './utils'\nimport type {\n OmitKeyof,\n QueryFunction,\n QueryFunctionContext,\n QueryKey,\n} from './types'\n\ntype BaseStreamedQueryParams = {\n streamFn: (\n context: QueryFunctionContext,\n ) => AsyncIterable | Promise>\n refetchMode?: 'append' | 'reset' | 'replace'\n}\n\ntype SimpleStreamedQueryParams<\n TQueryFnData,\n TQueryKey extends QueryKey,\n> = BaseStreamedQueryParams & {\n reducer?: never\n initialValue?: never\n}\n\ntype ReducibleStreamedQueryParams<\n TQueryFnData,\n TData,\n TQueryKey extends QueryKey,\n> = BaseStreamedQueryParams & {\n reducer: (acc: TData, chunk: TQueryFnData) => TData\n initialValue: TData\n}\n\ntype StreamedQueryParams =\n | SimpleStreamedQueryParams\n | ReducibleStreamedQueryParams\n\n/**\n * This is a helper function to create a query function that streams data from an AsyncIterable.\n * Data will be an Array of all the chunks received.\n * The query will be in a 'pending' state until the first chunk of data is received, but will go to 'success' after that.\n * The query will stay in fetchStatus 'fetching' until the stream ends.\n * @param queryFn - The function that returns an AsyncIterable to stream data from.\n * @param refetchMode - Defines how re-fetches are handled.\n * Defaults to `'reset'`, erases all data and puts the query back into `pending` state.\n * Set to `'append'` to append new data to the existing data.\n * Set to `'replace'` to write all data to the cache once the stream ends.\n * @param reducer - A function to reduce the streamed chunks into the final data.\n * Defaults to a function that appends chunks to the end of the array.\n * @param initialValue - Initial value to be used while the first chunk is being fetched, and returned if the stream yields no values.\n */\nexport function streamedQuery<\n TQueryFnData = unknown,\n TData = Array,\n TQueryKey extends QueryKey = QueryKey,\n>({\n streamFn,\n refetchMode = 'reset',\n reducer = (items, chunk) =>\n addToEnd(items as Array, chunk) as TData,\n initialValue = [] as TData,\n}: StreamedQueryParams): QueryFunction<\n TData,\n TQueryKey\n> {\n return async (context) => {\n const query = context.client\n .getQueryCache()\n .find({ queryKey: context.queryKey, exact: true })\n const isRefetch = !!query && query.state.data !== undefined\n if (isRefetch && refetchMode === 'reset') {\n query.setState({\n status: 'pending',\n data: undefined,\n error: null,\n fetchStatus: 'fetching',\n })\n }\n\n let result = initialValue\n\n let cancelled: boolean = false as boolean\n const streamFnContext = addConsumeAwareSignal<\n OmitKeyof\n >(\n {\n client: context.client,\n meta: context.meta,\n queryKey: context.queryKey,\n pageParam: context.pageParam,\n direction: context.direction,\n },\n () => context.signal,\n () => (cancelled = true),\n )\n\n const stream = await streamFn(streamFnContext)\n\n const isReplaceRefetch = isRefetch && refetchMode === 'replace'\n\n for await (const chunk of stream) {\n if (cancelled) {\n break\n }\n\n if (isReplaceRefetch) {\n // don't append to the cache directly when replace-refetching\n result = reducer(result, chunk)\n } else {\n context.client.setQueryData(context.queryKey, (prev) =>\n reducer(prev === undefined ? initialValue : prev, chunk),\n )\n }\n }\n\n // finalize result: replace-refetching needs to write to the cache\n if (isReplaceRefetch && !cancelled) {\n context.client.setQueryData(context.queryKey, result)\n }\n\n return context.client.getQueryData(context.queryKey) ?? initialValue\n }\n}\n"],"mappings":";AAAA,SAAS,uBAAuB,gBAAgB;AAkDzC,SAAS,cAId;AAAA,EACA;AAAA,EACA,cAAc;AAAA,EACd,UAAU,CAAC,OAAO,UAChB,SAAS,OAA8B,KAAK;AAAA,EAC9C,eAAe,CAAC;AAClB,GAGE;AACA,SAAO,OAAO,YAAY;AACxB,UAAM,QAAQ,QAAQ,OACnB,cAAc,EACd,KAAK,EAAE,UAAU,QAAQ,UAAU,OAAO,KAAK,CAAC;AACnD,UAAM,YAAY,CAAC,CAAC,SAAS,MAAM,MAAM,SAAS;AAClD,QAAI,aAAa,gBAAgB,SAAS;AACxC,YAAM,SAAS;AAAA,QACb,QAAQ;AAAA,QACR,MAAM;AAAA,QACN,OAAO;AAAA,QACP,aAAa;AAAA,MACf,CAAC;AAAA,IACH;AAEA,QAAI,SAAS;AAEb,QAAI,YAAqB;AACzB,UAAM,kBAAkB;AAAA,MAGtB;AAAA,QACE,QAAQ,QAAQ;AAAA,QAChB,MAAM,QAAQ;AAAA,QACd,UAAU,QAAQ;AAAA,QAClB,WAAW,QAAQ;AAAA,QACnB,WAAW,QAAQ;AAAA,MACrB;AAAA,MACA,MAAM,QAAQ;AAAA,MACd,MAAO,YAAY;AAAA,IACrB;AAEA,UAAM,SAAS,MAAM,SAAS,eAAe;AAE7C,UAAM,mBAAmB,aAAa,gBAAgB;AAEtD,qBAAiB,SAAS,QAAQ;AAChC,UAAI,WAAW;AACb;AAAA,MACF;AAEA,UAAI,kBAAkB;AAEpB,iBAAS,QAAQ,QAAQ,KAAK;AAAA,MAChC,OAAO;AACL,gBAAQ,OAAO;AAAA,UAAoB,QAAQ;AAAA,UAAU,CAAC,SACpD,QAAQ,SAAS,SAAY,eAAe,MAAM,KAAK;AAAA,QACzD;AAAA,MACF;AAAA,IACF;AAGA,QAAI,oBAAoB,CAAC,WAAW;AAClC,cAAQ,OAAO,aAAoB,QAAQ,UAAU,MAAM;AAAA,IAC7D;AAEA,WAAO,QAAQ,OAAO,aAAa,QAAQ,QAAQ,KAAK;AAAA,EAC1D;AACF;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/subscribable.cjs b/node_modules/@tanstack/query-core/build/modern/subscribable.cjs new file mode 100644 index 0000000..c402602 --- /dev/null +++ b/node_modules/@tanstack/query-core/build/modern/subscribable.cjs @@ -0,0 +1,51 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/subscribable.ts +var subscribable_exports = {}; +__export(subscribable_exports, { + Subscribable: () => Subscribable +}); +module.exports = __toCommonJS(subscribable_exports); +var Subscribable = class { + constructor() { + this.listeners = /* @__PURE__ */ new Set(); + this.subscribe = this.subscribe.bind(this); + } + subscribe(listener) { + this.listeners.add(listener); + this.onSubscribe(); + return () => { + this.listeners.delete(listener); + this.onUnsubscribe(); + }; + } + hasListeners() { + return this.listeners.size > 0; + } + onSubscribe() { + } + onUnsubscribe() { + } +}; +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + Subscribable +}); +//# sourceMappingURL=subscribable.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/subscribable.cjs.map b/node_modules/@tanstack/query-core/build/modern/subscribable.cjs.map new file mode 100644 index 0000000..43f8336 --- /dev/null +++ b/node_modules/@tanstack/query-core/build/modern/subscribable.cjs.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/subscribable.ts"],"sourcesContent":["export class Subscribable {\n protected listeners = new Set()\n\n constructor() {\n this.subscribe = this.subscribe.bind(this)\n }\n\n subscribe(listener: TListener): () => void {\n this.listeners.add(listener)\n\n this.onSubscribe()\n\n return () => {\n this.listeners.delete(listener)\n this.onUnsubscribe()\n }\n }\n\n hasListeners(): boolean {\n return this.listeners.size > 0\n }\n\n protected onSubscribe(): void {\n // Do nothing\n }\n\n protected onUnsubscribe(): void {\n // Do nothing\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAO,IAAM,eAAN,MAA+C;AAAA,EAGpD,cAAc;AAFd,SAAU,YAAY,oBAAI,IAAe;AAGvC,SAAK,YAAY,KAAK,UAAU,KAAK,IAAI;AAAA,EAC3C;AAAA,EAEA,UAAU,UAAiC;AACzC,SAAK,UAAU,IAAI,QAAQ;AAE3B,SAAK,YAAY;AAEjB,WAAO,MAAM;AACX,WAAK,UAAU,OAAO,QAAQ;AAC9B,WAAK,cAAc;AAAA,IACrB;AAAA,EACF;AAAA,EAEA,eAAwB;AACtB,WAAO,KAAK,UAAU,OAAO;AAAA,EAC/B;AAAA,EAEU,cAAoB;AAAA,EAE9B;AAAA,EAEU,gBAAsB;AAAA,EAEhC;AACF;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/subscribable.d.cts b/node_modules/@tanstack/query-core/build/modern/subscribable.d.cts new file mode 100644 index 0000000..5ac4d3d --- /dev/null +++ b/node_modules/@tanstack/query-core/build/modern/subscribable.d.cts @@ -0,0 +1,10 @@ +declare class Subscribable { + protected listeners: Set; + constructor(); + subscribe(listener: TListener): () => void; + hasListeners(): boolean; + protected onSubscribe(): void; + protected onUnsubscribe(): void; +} + +export { Subscribable }; diff --git a/node_modules/@tanstack/query-core/build/modern/subscribable.d.ts b/node_modules/@tanstack/query-core/build/modern/subscribable.d.ts new file mode 100644 index 0000000..5ac4d3d --- /dev/null +++ b/node_modules/@tanstack/query-core/build/modern/subscribable.d.ts @@ -0,0 +1,10 @@ +declare class Subscribable { + protected listeners: Set; + constructor(); + subscribe(listener: TListener): () => void; + hasListeners(): boolean; + protected onSubscribe(): void; + protected onUnsubscribe(): void; +} + +export { Subscribable }; diff --git a/node_modules/@tanstack/query-core/build/modern/subscribable.js b/node_modules/@tanstack/query-core/build/modern/subscribable.js new file mode 100644 index 0000000..a8516a4 --- /dev/null +++ b/node_modules/@tanstack/query-core/build/modern/subscribable.js @@ -0,0 +1,26 @@ +// src/subscribable.ts +var Subscribable = class { + constructor() { + this.listeners = /* @__PURE__ */ new Set(); + this.subscribe = this.subscribe.bind(this); + } + subscribe(listener) { + this.listeners.add(listener); + this.onSubscribe(); + return () => { + this.listeners.delete(listener); + this.onUnsubscribe(); + }; + } + hasListeners() { + return this.listeners.size > 0; + } + onSubscribe() { + } + onUnsubscribe() { + } +}; +export { + Subscribable +}; +//# sourceMappingURL=subscribable.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/subscribable.js.map b/node_modules/@tanstack/query-core/build/modern/subscribable.js.map new file mode 100644 index 0000000..85f855b --- /dev/null +++ b/node_modules/@tanstack/query-core/build/modern/subscribable.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/subscribable.ts"],"sourcesContent":["export class Subscribable {\n protected listeners = new Set()\n\n constructor() {\n this.subscribe = this.subscribe.bind(this)\n }\n\n subscribe(listener: TListener): () => void {\n this.listeners.add(listener)\n\n this.onSubscribe()\n\n return () => {\n this.listeners.delete(listener)\n this.onUnsubscribe()\n }\n }\n\n hasListeners(): boolean {\n return this.listeners.size > 0\n }\n\n protected onSubscribe(): void {\n // Do nothing\n }\n\n protected onUnsubscribe(): void {\n // Do nothing\n }\n}\n"],"mappings":";AAAO,IAAM,eAAN,MAA+C;AAAA,EAGpD,cAAc;AAFd,SAAU,YAAY,oBAAI,IAAe;AAGvC,SAAK,YAAY,KAAK,UAAU,KAAK,IAAI;AAAA,EAC3C;AAAA,EAEA,UAAU,UAAiC;AACzC,SAAK,UAAU,IAAI,QAAQ;AAE3B,SAAK,YAAY;AAEjB,WAAO,MAAM;AACX,WAAK,UAAU,OAAO,QAAQ;AAC9B,WAAK,cAAc;AAAA,IACrB;AAAA,EACF;AAAA,EAEA,eAAwB;AACtB,WAAO,KAAK,UAAU,OAAO;AAAA,EAC/B;AAAA,EAEU,cAAoB;AAAA,EAE9B;AAAA,EAEU,gBAAsB;AAAA,EAEhC;AACF;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/thenable.cjs b/node_modules/@tanstack/query-core/build/modern/thenable.cjs new file mode 100644 index 0000000..92d10b2 --- /dev/null +++ b/node_modules/@tanstack/query-core/build/modern/thenable.cjs @@ -0,0 +1,75 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/thenable.ts +var thenable_exports = {}; +__export(thenable_exports, { + pendingThenable: () => pendingThenable, + tryResolveSync: () => tryResolveSync +}); +module.exports = __toCommonJS(thenable_exports); +var import_utils = require("./utils.cjs"); +function pendingThenable() { + let resolve; + let reject; + const thenable = new Promise((_resolve, _reject) => { + resolve = _resolve; + reject = _reject; + }); + thenable.status = "pending"; + thenable.catch(() => { + }); + function finalize(data) { + Object.assign(thenable, data); + delete thenable.resolve; + delete thenable.reject; + } + thenable.resolve = (value) => { + finalize({ + status: "fulfilled", + value + }); + resolve(value); + }; + thenable.reject = (reason) => { + finalize({ + status: "rejected", + reason + }); + reject(reason); + }; + return thenable; +} +function tryResolveSync(promise) { + let data; + promise.then((result) => { + data = result; + return result; + }, import_utils.noop)?.catch(import_utils.noop); + if (data !== void 0) { + return { data }; + } + return void 0; +} +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + pendingThenable, + tryResolveSync +}); +//# sourceMappingURL=thenable.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/thenable.cjs.map b/node_modules/@tanstack/query-core/build/modern/thenable.cjs.map new file mode 100644 index 0000000..3170760 --- /dev/null +++ b/node_modules/@tanstack/query-core/build/modern/thenable.cjs.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/thenable.ts"],"sourcesContent":["/**\n * Thenable types which matches React's types for promises\n *\n * React seemingly uses `.status`, `.value` and `.reason` properties on a promises to optimistically unwrap data from promises\n *\n * @see https://github.com/facebook/react/blob/main/packages/shared/ReactTypes.js#L112-L138\n * @see https://github.com/facebook/react/blob/4f604941569d2e8947ce1460a0b2997e835f37b9/packages/react-debug-tools/src/ReactDebugHooks.js#L224-L227\n */\n\nimport { noop } from './utils'\n\ninterface Fulfilled {\n status: 'fulfilled'\n value: T\n}\ninterface Rejected {\n status: 'rejected'\n reason: unknown\n}\ninterface Pending {\n status: 'pending'\n\n /**\n * Resolve the promise with a value.\n * Will remove the `resolve` and `reject` properties from the promise.\n */\n resolve: (value: T) => void\n /**\n * Reject the promise with a reason.\n * Will remove the `resolve` and `reject` properties from the promise.\n */\n reject: (reason: unknown) => void\n}\n\nexport type FulfilledThenable = Promise & Fulfilled\nexport type RejectedThenable = Promise & Rejected\nexport type PendingThenable = Promise & Pending\n\nexport type Thenable =\n | FulfilledThenable\n | RejectedThenable\n | PendingThenable\n\nexport function pendingThenable(): PendingThenable {\n let resolve: Pending['resolve']\n let reject: Pending['reject']\n // this could use `Promise.withResolvers()` in the future\n const thenable = new Promise((_resolve, _reject) => {\n resolve = _resolve\n reject = _reject\n }) as PendingThenable\n\n thenable.status = 'pending'\n thenable.catch(() => {\n // prevent unhandled rejection errors\n })\n\n function finalize(data: Fulfilled | Rejected) {\n Object.assign(thenable, data)\n\n // clear pending props props to avoid calling them twice\n delete (thenable as Partial>).resolve\n delete (thenable as Partial>).reject\n }\n\n thenable.resolve = (value) => {\n finalize({\n status: 'fulfilled',\n value,\n })\n\n resolve(value)\n }\n thenable.reject = (reason) => {\n finalize({\n status: 'rejected',\n reason,\n })\n\n reject(reason)\n }\n\n return thenable\n}\n\n/**\n * This function takes a Promise-like input and detects whether the data\n * is synchronously available or not.\n *\n * It does not inspect .status, .value or .reason properties of the promise,\n * as those are not always available, and the .status of React's promises\n * should not be considered part of the public API.\n */\nexport function tryResolveSync(promise: Promise | Thenable) {\n let data: unknown\n\n promise\n .then((result) => {\n data = result\n return result\n }, noop)\n // .catch can be unavailable on certain kinds of thenable's\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n ?.catch(noop)\n\n if (data !== undefined) {\n return { data }\n }\n\n return undefined\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASA,mBAAqB;AAkCd,SAAS,kBAAyC;AACvD,MAAI;AACJ,MAAI;AAEJ,QAAM,WAAW,IAAI,QAAQ,CAAC,UAAU,YAAY;AAClD,cAAU;AACV,aAAS;AAAA,EACX,CAAC;AAED,WAAS,SAAS;AAClB,WAAS,MAAM,MAAM;AAAA,EAErB,CAAC;AAED,WAAS,SAAS,MAA+B;AAC/C,WAAO,OAAO,UAAU,IAAI;AAG5B,WAAQ,SAAyC;AACjD,WAAQ,SAAyC;AAAA,EACnD;AAEA,WAAS,UAAU,CAAC,UAAU;AAC5B,aAAS;AAAA,MACP,QAAQ;AAAA,MACR;AAAA,IACF,CAAC;AAED,YAAQ,KAAK;AAAA,EACf;AACA,WAAS,SAAS,CAAC,WAAW;AAC5B,aAAS;AAAA,MACP,QAAQ;AAAA,MACR;AAAA,IACF,CAAC;AAED,WAAO,MAAM;AAAA,EACf;AAEA,SAAO;AACT;AAUO,SAAS,eAAe,SAA+C;AAC5E,MAAI;AAEJ,UACG,KAAK,CAAC,WAAW;AAChB,WAAO;AACP,WAAO;AAAA,EACT,GAAG,iBAAI,GAGL,MAAM,iBAAI;AAEd,MAAI,SAAS,QAAW;AACtB,WAAO,EAAE,KAAK;AAAA,EAChB;AAEA,SAAO;AACT;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/thenable.d.cts b/node_modules/@tanstack/query-core/build/modern/thenable.d.cts new file mode 100644 index 0000000..2378593 --- /dev/null +++ b/node_modules/@tanstack/query-core/build/modern/thenable.d.cts @@ -0,0 +1,47 @@ +/** + * Thenable types which matches React's types for promises + * + * React seemingly uses `.status`, `.value` and `.reason` properties on a promises to optimistically unwrap data from promises + * + * @see https://github.com/facebook/react/blob/main/packages/shared/ReactTypes.js#L112-L138 + * @see https://github.com/facebook/react/blob/4f604941569d2e8947ce1460a0b2997e835f37b9/packages/react-debug-tools/src/ReactDebugHooks.js#L224-L227 + */ +interface Fulfilled { + status: 'fulfilled'; + value: T; +} +interface Rejected { + status: 'rejected'; + reason: unknown; +} +interface Pending { + status: 'pending'; + /** + * Resolve the promise with a value. + * Will remove the `resolve` and `reject` properties from the promise. + */ + resolve: (value: T) => void; + /** + * Reject the promise with a reason. + * Will remove the `resolve` and `reject` properties from the promise. + */ + reject: (reason: unknown) => void; +} +type FulfilledThenable = Promise & Fulfilled; +type RejectedThenable = Promise & Rejected; +type PendingThenable = Promise & Pending; +type Thenable = FulfilledThenable | RejectedThenable | PendingThenable; +declare function pendingThenable(): PendingThenable; +/** + * This function takes a Promise-like input and detects whether the data + * is synchronously available or not. + * + * It does not inspect .status, .value or .reason properties of the promise, + * as those are not always available, and the .status of React's promises + * should not be considered part of the public API. + */ +declare function tryResolveSync(promise: Promise | Thenable): { + data: {} | null; +} | undefined; + +export { type FulfilledThenable, type PendingThenable, type RejectedThenable, type Thenable, pendingThenable, tryResolveSync }; diff --git a/node_modules/@tanstack/query-core/build/modern/thenable.d.ts b/node_modules/@tanstack/query-core/build/modern/thenable.d.ts new file mode 100644 index 0000000..2378593 --- /dev/null +++ b/node_modules/@tanstack/query-core/build/modern/thenable.d.ts @@ -0,0 +1,47 @@ +/** + * Thenable types which matches React's types for promises + * + * React seemingly uses `.status`, `.value` and `.reason` properties on a promises to optimistically unwrap data from promises + * + * @see https://github.com/facebook/react/blob/main/packages/shared/ReactTypes.js#L112-L138 + * @see https://github.com/facebook/react/blob/4f604941569d2e8947ce1460a0b2997e835f37b9/packages/react-debug-tools/src/ReactDebugHooks.js#L224-L227 + */ +interface Fulfilled { + status: 'fulfilled'; + value: T; +} +interface Rejected { + status: 'rejected'; + reason: unknown; +} +interface Pending { + status: 'pending'; + /** + * Resolve the promise with a value. + * Will remove the `resolve` and `reject` properties from the promise. + */ + resolve: (value: T) => void; + /** + * Reject the promise with a reason. + * Will remove the `resolve` and `reject` properties from the promise. + */ + reject: (reason: unknown) => void; +} +type FulfilledThenable = Promise & Fulfilled; +type RejectedThenable = Promise & Rejected; +type PendingThenable = Promise & Pending; +type Thenable = FulfilledThenable | RejectedThenable | PendingThenable; +declare function pendingThenable(): PendingThenable; +/** + * This function takes a Promise-like input and detects whether the data + * is synchronously available or not. + * + * It does not inspect .status, .value or .reason properties of the promise, + * as those are not always available, and the .status of React's promises + * should not be considered part of the public API. + */ +declare function tryResolveSync(promise: Promise | Thenable): { + data: {} | null; +} | undefined; + +export { type FulfilledThenable, type PendingThenable, type RejectedThenable, type Thenable, pendingThenable, tryResolveSync }; diff --git a/node_modules/@tanstack/query-core/build/modern/thenable.js b/node_modules/@tanstack/query-core/build/modern/thenable.js new file mode 100644 index 0000000..b5c4f0b --- /dev/null +++ b/node_modules/@tanstack/query-core/build/modern/thenable.js @@ -0,0 +1,49 @@ +// src/thenable.ts +import { noop } from "./utils.js"; +function pendingThenable() { + let resolve; + let reject; + const thenable = new Promise((_resolve, _reject) => { + resolve = _resolve; + reject = _reject; + }); + thenable.status = "pending"; + thenable.catch(() => { + }); + function finalize(data) { + Object.assign(thenable, data); + delete thenable.resolve; + delete thenable.reject; + } + thenable.resolve = (value) => { + finalize({ + status: "fulfilled", + value + }); + resolve(value); + }; + thenable.reject = (reason) => { + finalize({ + status: "rejected", + reason + }); + reject(reason); + }; + return thenable; +} +function tryResolveSync(promise) { + let data; + promise.then((result) => { + data = result; + return result; + }, noop)?.catch(noop); + if (data !== void 0) { + return { data }; + } + return void 0; +} +export { + pendingThenable, + tryResolveSync +}; +//# sourceMappingURL=thenable.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/thenable.js.map b/node_modules/@tanstack/query-core/build/modern/thenable.js.map new file mode 100644 index 0000000..26131bb --- /dev/null +++ b/node_modules/@tanstack/query-core/build/modern/thenable.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/thenable.ts"],"sourcesContent":["/**\n * Thenable types which matches React's types for promises\n *\n * React seemingly uses `.status`, `.value` and `.reason` properties on a promises to optimistically unwrap data from promises\n *\n * @see https://github.com/facebook/react/blob/main/packages/shared/ReactTypes.js#L112-L138\n * @see https://github.com/facebook/react/blob/4f604941569d2e8947ce1460a0b2997e835f37b9/packages/react-debug-tools/src/ReactDebugHooks.js#L224-L227\n */\n\nimport { noop } from './utils'\n\ninterface Fulfilled {\n status: 'fulfilled'\n value: T\n}\ninterface Rejected {\n status: 'rejected'\n reason: unknown\n}\ninterface Pending {\n status: 'pending'\n\n /**\n * Resolve the promise with a value.\n * Will remove the `resolve` and `reject` properties from the promise.\n */\n resolve: (value: T) => void\n /**\n * Reject the promise with a reason.\n * Will remove the `resolve` and `reject` properties from the promise.\n */\n reject: (reason: unknown) => void\n}\n\nexport type FulfilledThenable = Promise & Fulfilled\nexport type RejectedThenable = Promise & Rejected\nexport type PendingThenable = Promise & Pending\n\nexport type Thenable =\n | FulfilledThenable\n | RejectedThenable\n | PendingThenable\n\nexport function pendingThenable(): PendingThenable {\n let resolve: Pending['resolve']\n let reject: Pending['reject']\n // this could use `Promise.withResolvers()` in the future\n const thenable = new Promise((_resolve, _reject) => {\n resolve = _resolve\n reject = _reject\n }) as PendingThenable\n\n thenable.status = 'pending'\n thenable.catch(() => {\n // prevent unhandled rejection errors\n })\n\n function finalize(data: Fulfilled | Rejected) {\n Object.assign(thenable, data)\n\n // clear pending props props to avoid calling them twice\n delete (thenable as Partial>).resolve\n delete (thenable as Partial>).reject\n }\n\n thenable.resolve = (value) => {\n finalize({\n status: 'fulfilled',\n value,\n })\n\n resolve(value)\n }\n thenable.reject = (reason) => {\n finalize({\n status: 'rejected',\n reason,\n })\n\n reject(reason)\n }\n\n return thenable\n}\n\n/**\n * This function takes a Promise-like input and detects whether the data\n * is synchronously available or not.\n *\n * It does not inspect .status, .value or .reason properties of the promise,\n * as those are not always available, and the .status of React's promises\n * should not be considered part of the public API.\n */\nexport function tryResolveSync(promise: Promise | Thenable) {\n let data: unknown\n\n promise\n .then((result) => {\n data = result\n return result\n }, noop)\n // .catch can be unavailable on certain kinds of thenable's\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n ?.catch(noop)\n\n if (data !== undefined) {\n return { data }\n }\n\n return undefined\n}\n"],"mappings":";AASA,SAAS,YAAY;AAkCd,SAAS,kBAAyC;AACvD,MAAI;AACJ,MAAI;AAEJ,QAAM,WAAW,IAAI,QAAQ,CAAC,UAAU,YAAY;AAClD,cAAU;AACV,aAAS;AAAA,EACX,CAAC;AAED,WAAS,SAAS;AAClB,WAAS,MAAM,MAAM;AAAA,EAErB,CAAC;AAED,WAAS,SAAS,MAA+B;AAC/C,WAAO,OAAO,UAAU,IAAI;AAG5B,WAAQ,SAAyC;AACjD,WAAQ,SAAyC;AAAA,EACnD;AAEA,WAAS,UAAU,CAAC,UAAU;AAC5B,aAAS;AAAA,MACP,QAAQ;AAAA,MACR;AAAA,IACF,CAAC;AAED,YAAQ,KAAK;AAAA,EACf;AACA,WAAS,SAAS,CAAC,WAAW;AAC5B,aAAS;AAAA,MACP,QAAQ;AAAA,MACR;AAAA,IACF,CAAC;AAED,WAAO,MAAM;AAAA,EACf;AAEA,SAAO;AACT;AAUO,SAAS,eAAe,SAA+C;AAC5E,MAAI;AAEJ,UACG,KAAK,CAAC,WAAW;AAChB,WAAO;AACP,WAAO;AAAA,EACT,GAAG,IAAI,GAGL,MAAM,IAAI;AAEd,MAAI,SAAS,QAAW;AACtB,WAAO,EAAE,KAAK;AAAA,EAChB;AAEA,SAAO;AACT;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/timeoutManager.cjs b/node_modules/@tanstack/query-core/build/modern/timeoutManager.cjs new file mode 100644 index 0000000..a37e420 --- /dev/null +++ b/node_modules/@tanstack/query-core/build/modern/timeoutManager.cjs @@ -0,0 +1,98 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/timeoutManager.ts +var timeoutManager_exports = {}; +__export(timeoutManager_exports, { + TimeoutManager: () => TimeoutManager, + defaultTimeoutProvider: () => defaultTimeoutProvider, + systemSetTimeoutZero: () => systemSetTimeoutZero, + timeoutManager: () => timeoutManager +}); +module.exports = __toCommonJS(timeoutManager_exports); +var defaultTimeoutProvider = { + // We need the wrapper function syntax below instead of direct references to + // global setTimeout etc. + // + // BAD: `setTimeout: setTimeout` + // GOOD: `setTimeout: (cb, delay) => setTimeout(cb, delay)` + // + // If we use direct references here, then anything that wants to spy on or + // replace the global setTimeout (like tests) won't work since we'll already + // have a hard reference to the original implementation at the time when this + // file was imported. + setTimeout: (callback, delay) => setTimeout(callback, delay), + clearTimeout: (timeoutId) => clearTimeout(timeoutId), + setInterval: (callback, delay) => setInterval(callback, delay), + clearInterval: (intervalId) => clearInterval(intervalId) +}; +var TimeoutManager = class { + // We cannot have TimeoutManager as we must instantiate it with a concrete + // type at app boot; and if we leave that type, then any new timer provider + // would need to support ReturnType, which is infeasible. + // + // We settle for type safety for the TimeoutProvider type, and accept that + // this class is unsafe internally to allow for extension. + #provider = defaultTimeoutProvider; + #providerCalled = false; + setTimeoutProvider(provider) { + if (process.env.NODE_ENV !== "production") { + if (this.#providerCalled && provider !== this.#provider) { + console.error( + `[timeoutManager]: Switching provider after calls to previous provider might result in unexpected behavior.`, + { previous: this.#provider, provider } + ); + } + } + this.#provider = provider; + if (process.env.NODE_ENV !== "production") { + this.#providerCalled = false; + } + } + setTimeout(callback, delay) { + if (process.env.NODE_ENV !== "production") { + this.#providerCalled = true; + } + return this.#provider.setTimeout(callback, delay); + } + clearTimeout(timeoutId) { + this.#provider.clearTimeout(timeoutId); + } + setInterval(callback, delay) { + if (process.env.NODE_ENV !== "production") { + this.#providerCalled = true; + } + return this.#provider.setInterval(callback, delay); + } + clearInterval(intervalId) { + this.#provider.clearInterval(intervalId); + } +}; +var timeoutManager = new TimeoutManager(); +function systemSetTimeoutZero(callback) { + setTimeout(callback, 0); +} +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + TimeoutManager, + defaultTimeoutProvider, + systemSetTimeoutZero, + timeoutManager +}); +//# sourceMappingURL=timeoutManager.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/timeoutManager.cjs.map b/node_modules/@tanstack/query-core/build/modern/timeoutManager.cjs.map new file mode 100644 index 0000000..d7c8691 --- /dev/null +++ b/node_modules/@tanstack/query-core/build/modern/timeoutManager.cjs.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/timeoutManager.ts"],"sourcesContent":["/**\n * {@link TimeoutManager} does not support passing arguments to the callback.\n *\n * `(_: void)` is the argument type inferred by TypeScript's default typings for\n * `setTimeout(cb, number)`.\n * If we don't accept a single void argument, then\n * `new Promise(resolve => timeoutManager.setTimeout(resolve, N))` is a type error.\n */\nexport type TimeoutCallback = (_: void) => void\n\n/**\n * Wrapping `setTimeout` is awkward from a typing perspective because platform\n * typings may extend the return type of `setTimeout`. For example, NodeJS\n * typings add `NodeJS.Timeout`; but a non-default `timeoutManager` may not be\n * able to return such a type.\n */\nexport type ManagedTimerId = number | { [Symbol.toPrimitive]: () => number }\n\n/**\n * Backend for timer functions.\n */\nexport type TimeoutProvider =\n {\n readonly setTimeout: (callback: TimeoutCallback, delay: number) => TTimerId\n readonly clearTimeout: (timeoutId: TTimerId | undefined) => void\n\n readonly setInterval: (callback: TimeoutCallback, delay: number) => TTimerId\n readonly clearInterval: (intervalId: TTimerId | undefined) => void\n }\n\nexport const defaultTimeoutProvider: TimeoutProvider<\n ReturnType\n> = {\n // We need the wrapper function syntax below instead of direct references to\n // global setTimeout etc.\n //\n // BAD: `setTimeout: setTimeout`\n // GOOD: `setTimeout: (cb, delay) => setTimeout(cb, delay)`\n //\n // If we use direct references here, then anything that wants to spy on or\n // replace the global setTimeout (like tests) won't work since we'll already\n // have a hard reference to the original implementation at the time when this\n // file was imported.\n setTimeout: (callback, delay) => setTimeout(callback, delay),\n clearTimeout: (timeoutId) => clearTimeout(timeoutId),\n\n setInterval: (callback, delay) => setInterval(callback, delay),\n clearInterval: (intervalId) => clearInterval(intervalId),\n}\n\n/**\n * Allows customization of how timeouts are created.\n *\n * @tanstack/query-core makes liberal use of timeouts to implement `staleTime`\n * and `gcTime`. The default TimeoutManager provider uses the platform's global\n * `setTimeout` implementation, which is known to have scalability issues with\n * thousands of timeouts on the event loop.\n *\n * If you hit this limitation, consider providing a custom TimeoutProvider that\n * coalesces timeouts.\n */\nexport class TimeoutManager implements Omit {\n // We cannot have TimeoutManager as we must instantiate it with a concrete\n // type at app boot; and if we leave that type, then any new timer provider\n // would need to support ReturnType, which is infeasible.\n //\n // We settle for type safety for the TimeoutProvider type, and accept that\n // this class is unsafe internally to allow for extension.\n #provider: TimeoutProvider = defaultTimeoutProvider\n #providerCalled = false\n\n setTimeoutProvider(\n provider: TimeoutProvider,\n ): void {\n if (process.env.NODE_ENV !== 'production') {\n if (this.#providerCalled && provider !== this.#provider) {\n // After changing providers, `clearTimeout` will not work as expected for\n // timeouts from the previous provider.\n //\n // Since they may allocate the same timeout ID, clearTimeout may cancel an\n // arbitrary different timeout, or unexpected no-op.\n //\n // We could protect against this by mixing the timeout ID bits\n // deterministically with some per-provider bits.\n //\n // We could internally queue `setTimeout` calls to `TimeoutManager` until\n // some API call to set the initial provider.\n console.error(\n `[timeoutManager]: Switching provider after calls to previous provider might result in unexpected behavior.`,\n { previous: this.#provider, provider },\n )\n }\n }\n\n this.#provider = provider\n if (process.env.NODE_ENV !== 'production') {\n this.#providerCalled = false\n }\n }\n\n setTimeout(callback: TimeoutCallback, delay: number): ManagedTimerId {\n if (process.env.NODE_ENV !== 'production') {\n this.#providerCalled = true\n }\n return this.#provider.setTimeout(callback, delay)\n }\n\n clearTimeout(timeoutId: ManagedTimerId | undefined): void {\n this.#provider.clearTimeout(timeoutId)\n }\n\n setInterval(callback: TimeoutCallback, delay: number): ManagedTimerId {\n if (process.env.NODE_ENV !== 'production') {\n this.#providerCalled = true\n }\n return this.#provider.setInterval(callback, delay)\n }\n\n clearInterval(intervalId: ManagedTimerId | undefined): void {\n this.#provider.clearInterval(intervalId)\n }\n}\n\nexport const timeoutManager = new TimeoutManager()\n\n/**\n * In many cases code wants to delay to the next event loop tick; this is not\n * mediated by {@link timeoutManager}.\n *\n * This function is provided to make auditing the `tanstack/query-core` for\n * incorrect use of system `setTimeout` easier.\n */\nexport function systemSetTimeoutZero(callback: TimeoutCallback): void {\n setTimeout(callback, 0)\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA8BO,IAAM,yBAET;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAWF,YAAY,CAAC,UAAU,UAAU,WAAW,UAAU,KAAK;AAAA,EAC3D,cAAc,CAAC,cAAc,aAAa,SAAS;AAAA,EAEnD,aAAa,CAAC,UAAU,UAAU,YAAY,UAAU,KAAK;AAAA,EAC7D,eAAe,CAAC,eAAe,cAAc,UAAU;AACzD;AAaO,IAAM,iBAAN,MAA8D;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOnE,YAAkC;AAAA,EAClC,kBAAkB;AAAA,EAElB,mBACE,UACM;AACN,QAAI,QAAQ,IAAI,aAAa,cAAc;AACzC,UAAI,KAAK,mBAAmB,aAAa,KAAK,WAAW;AAYvD,gBAAQ;AAAA,UACN;AAAA,UACA,EAAE,UAAU,KAAK,WAAW,SAAS;AAAA,QACvC;AAAA,MACF;AAAA,IACF;AAEA,SAAK,YAAY;AACjB,QAAI,QAAQ,IAAI,aAAa,cAAc;AACzC,WAAK,kBAAkB;AAAA,IACzB;AAAA,EACF;AAAA,EAEA,WAAW,UAA2B,OAA+B;AACnE,QAAI,QAAQ,IAAI,aAAa,cAAc;AACzC,WAAK,kBAAkB;AAAA,IACzB;AACA,WAAO,KAAK,UAAU,WAAW,UAAU,KAAK;AAAA,EAClD;AAAA,EAEA,aAAa,WAA6C;AACxD,SAAK,UAAU,aAAa,SAAS;AAAA,EACvC;AAAA,EAEA,YAAY,UAA2B,OAA+B;AACpE,QAAI,QAAQ,IAAI,aAAa,cAAc;AACzC,WAAK,kBAAkB;AAAA,IACzB;AACA,WAAO,KAAK,UAAU,YAAY,UAAU,KAAK;AAAA,EACnD;AAAA,EAEA,cAAc,YAA8C;AAC1D,SAAK,UAAU,cAAc,UAAU;AAAA,EACzC;AACF;AAEO,IAAM,iBAAiB,IAAI,eAAe;AAS1C,SAAS,qBAAqB,UAAiC;AACpE,aAAW,UAAU,CAAC;AACxB;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/timeoutManager.d.cts b/node_modules/@tanstack/query-core/build/modern/timeoutManager.d.cts new file mode 100644 index 0000000..f85f6f9 --- /dev/null +++ b/node_modules/@tanstack/query-core/build/modern/timeoutManager.d.cts @@ -0,0 +1,58 @@ +/** + * {@link TimeoutManager} does not support passing arguments to the callback. + * + * `(_: void)` is the argument type inferred by TypeScript's default typings for + * `setTimeout(cb, number)`. + * If we don't accept a single void argument, then + * `new Promise(resolve => timeoutManager.setTimeout(resolve, N))` is a type error. + */ +type TimeoutCallback = (_: void) => void; +/** + * Wrapping `setTimeout` is awkward from a typing perspective because platform + * typings may extend the return type of `setTimeout`. For example, NodeJS + * typings add `NodeJS.Timeout`; but a non-default `timeoutManager` may not be + * able to return such a type. + */ +type ManagedTimerId = number | { + [Symbol.toPrimitive]: () => number; +}; +/** + * Backend for timer functions. + */ +type TimeoutProvider = { + readonly setTimeout: (callback: TimeoutCallback, delay: number) => TTimerId; + readonly clearTimeout: (timeoutId: TTimerId | undefined) => void; + readonly setInterval: (callback: TimeoutCallback, delay: number) => TTimerId; + readonly clearInterval: (intervalId: TTimerId | undefined) => void; +}; +declare const defaultTimeoutProvider: TimeoutProvider>; +/** + * Allows customization of how timeouts are created. + * + * @tanstack/query-core makes liberal use of timeouts to implement `staleTime` + * and `gcTime`. The default TimeoutManager provider uses the platform's global + * `setTimeout` implementation, which is known to have scalability issues with + * thousands of timeouts on the event loop. + * + * If you hit this limitation, consider providing a custom TimeoutProvider that + * coalesces timeouts. + */ +declare class TimeoutManager implements Omit { + #private; + setTimeoutProvider(provider: TimeoutProvider): void; + setTimeout(callback: TimeoutCallback, delay: number): ManagedTimerId; + clearTimeout(timeoutId: ManagedTimerId | undefined): void; + setInterval(callback: TimeoutCallback, delay: number): ManagedTimerId; + clearInterval(intervalId: ManagedTimerId | undefined): void; +} +declare const timeoutManager: TimeoutManager; +/** + * In many cases code wants to delay to the next event loop tick; this is not + * mediated by {@link timeoutManager}. + * + * This function is provided to make auditing the `tanstack/query-core` for + * incorrect use of system `setTimeout` easier. + */ +declare function systemSetTimeoutZero(callback: TimeoutCallback): void; + +export { type ManagedTimerId, type TimeoutCallback, TimeoutManager, type TimeoutProvider, defaultTimeoutProvider, systemSetTimeoutZero, timeoutManager }; diff --git a/node_modules/@tanstack/query-core/build/modern/timeoutManager.d.ts b/node_modules/@tanstack/query-core/build/modern/timeoutManager.d.ts new file mode 100644 index 0000000..f85f6f9 --- /dev/null +++ b/node_modules/@tanstack/query-core/build/modern/timeoutManager.d.ts @@ -0,0 +1,58 @@ +/** + * {@link TimeoutManager} does not support passing arguments to the callback. + * + * `(_: void)` is the argument type inferred by TypeScript's default typings for + * `setTimeout(cb, number)`. + * If we don't accept a single void argument, then + * `new Promise(resolve => timeoutManager.setTimeout(resolve, N))` is a type error. + */ +type TimeoutCallback = (_: void) => void; +/** + * Wrapping `setTimeout` is awkward from a typing perspective because platform + * typings may extend the return type of `setTimeout`. For example, NodeJS + * typings add `NodeJS.Timeout`; but a non-default `timeoutManager` may not be + * able to return such a type. + */ +type ManagedTimerId = number | { + [Symbol.toPrimitive]: () => number; +}; +/** + * Backend for timer functions. + */ +type TimeoutProvider = { + readonly setTimeout: (callback: TimeoutCallback, delay: number) => TTimerId; + readonly clearTimeout: (timeoutId: TTimerId | undefined) => void; + readonly setInterval: (callback: TimeoutCallback, delay: number) => TTimerId; + readonly clearInterval: (intervalId: TTimerId | undefined) => void; +}; +declare const defaultTimeoutProvider: TimeoutProvider>; +/** + * Allows customization of how timeouts are created. + * + * @tanstack/query-core makes liberal use of timeouts to implement `staleTime` + * and `gcTime`. The default TimeoutManager provider uses the platform's global + * `setTimeout` implementation, which is known to have scalability issues with + * thousands of timeouts on the event loop. + * + * If you hit this limitation, consider providing a custom TimeoutProvider that + * coalesces timeouts. + */ +declare class TimeoutManager implements Omit { + #private; + setTimeoutProvider(provider: TimeoutProvider): void; + setTimeout(callback: TimeoutCallback, delay: number): ManagedTimerId; + clearTimeout(timeoutId: ManagedTimerId | undefined): void; + setInterval(callback: TimeoutCallback, delay: number): ManagedTimerId; + clearInterval(intervalId: ManagedTimerId | undefined): void; +} +declare const timeoutManager: TimeoutManager; +/** + * In many cases code wants to delay to the next event loop tick; this is not + * mediated by {@link timeoutManager}. + * + * This function is provided to make auditing the `tanstack/query-core` for + * incorrect use of system `setTimeout` easier. + */ +declare function systemSetTimeoutZero(callback: TimeoutCallback): void; + +export { type ManagedTimerId, type TimeoutCallback, TimeoutManager, type TimeoutProvider, defaultTimeoutProvider, systemSetTimeoutZero, timeoutManager }; diff --git a/node_modules/@tanstack/query-core/build/modern/timeoutManager.js b/node_modules/@tanstack/query-core/build/modern/timeoutManager.js new file mode 100644 index 0000000..c7d9a79 --- /dev/null +++ b/node_modules/@tanstack/query-core/build/modern/timeoutManager.js @@ -0,0 +1,70 @@ +// src/timeoutManager.ts +var defaultTimeoutProvider = { + // We need the wrapper function syntax below instead of direct references to + // global setTimeout etc. + // + // BAD: `setTimeout: setTimeout` + // GOOD: `setTimeout: (cb, delay) => setTimeout(cb, delay)` + // + // If we use direct references here, then anything that wants to spy on or + // replace the global setTimeout (like tests) won't work since we'll already + // have a hard reference to the original implementation at the time when this + // file was imported. + setTimeout: (callback, delay) => setTimeout(callback, delay), + clearTimeout: (timeoutId) => clearTimeout(timeoutId), + setInterval: (callback, delay) => setInterval(callback, delay), + clearInterval: (intervalId) => clearInterval(intervalId) +}; +var TimeoutManager = class { + // We cannot have TimeoutManager as we must instantiate it with a concrete + // type at app boot; and if we leave that type, then any new timer provider + // would need to support ReturnType, which is infeasible. + // + // We settle for type safety for the TimeoutProvider type, and accept that + // this class is unsafe internally to allow for extension. + #provider = defaultTimeoutProvider; + #providerCalled = false; + setTimeoutProvider(provider) { + if (process.env.NODE_ENV !== "production") { + if (this.#providerCalled && provider !== this.#provider) { + console.error( + `[timeoutManager]: Switching provider after calls to previous provider might result in unexpected behavior.`, + { previous: this.#provider, provider } + ); + } + } + this.#provider = provider; + if (process.env.NODE_ENV !== "production") { + this.#providerCalled = false; + } + } + setTimeout(callback, delay) { + if (process.env.NODE_ENV !== "production") { + this.#providerCalled = true; + } + return this.#provider.setTimeout(callback, delay); + } + clearTimeout(timeoutId) { + this.#provider.clearTimeout(timeoutId); + } + setInterval(callback, delay) { + if (process.env.NODE_ENV !== "production") { + this.#providerCalled = true; + } + return this.#provider.setInterval(callback, delay); + } + clearInterval(intervalId) { + this.#provider.clearInterval(intervalId); + } +}; +var timeoutManager = new TimeoutManager(); +function systemSetTimeoutZero(callback) { + setTimeout(callback, 0); +} +export { + TimeoutManager, + defaultTimeoutProvider, + systemSetTimeoutZero, + timeoutManager +}; +//# sourceMappingURL=timeoutManager.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/timeoutManager.js.map b/node_modules/@tanstack/query-core/build/modern/timeoutManager.js.map new file mode 100644 index 0000000..fbbdcbf --- /dev/null +++ b/node_modules/@tanstack/query-core/build/modern/timeoutManager.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/timeoutManager.ts"],"sourcesContent":["/**\n * {@link TimeoutManager} does not support passing arguments to the callback.\n *\n * `(_: void)` is the argument type inferred by TypeScript's default typings for\n * `setTimeout(cb, number)`.\n * If we don't accept a single void argument, then\n * `new Promise(resolve => timeoutManager.setTimeout(resolve, N))` is a type error.\n */\nexport type TimeoutCallback = (_: void) => void\n\n/**\n * Wrapping `setTimeout` is awkward from a typing perspective because platform\n * typings may extend the return type of `setTimeout`. For example, NodeJS\n * typings add `NodeJS.Timeout`; but a non-default `timeoutManager` may not be\n * able to return such a type.\n */\nexport type ManagedTimerId = number | { [Symbol.toPrimitive]: () => number }\n\n/**\n * Backend for timer functions.\n */\nexport type TimeoutProvider =\n {\n readonly setTimeout: (callback: TimeoutCallback, delay: number) => TTimerId\n readonly clearTimeout: (timeoutId: TTimerId | undefined) => void\n\n readonly setInterval: (callback: TimeoutCallback, delay: number) => TTimerId\n readonly clearInterval: (intervalId: TTimerId | undefined) => void\n }\n\nexport const defaultTimeoutProvider: TimeoutProvider<\n ReturnType\n> = {\n // We need the wrapper function syntax below instead of direct references to\n // global setTimeout etc.\n //\n // BAD: `setTimeout: setTimeout`\n // GOOD: `setTimeout: (cb, delay) => setTimeout(cb, delay)`\n //\n // If we use direct references here, then anything that wants to spy on or\n // replace the global setTimeout (like tests) won't work since we'll already\n // have a hard reference to the original implementation at the time when this\n // file was imported.\n setTimeout: (callback, delay) => setTimeout(callback, delay),\n clearTimeout: (timeoutId) => clearTimeout(timeoutId),\n\n setInterval: (callback, delay) => setInterval(callback, delay),\n clearInterval: (intervalId) => clearInterval(intervalId),\n}\n\n/**\n * Allows customization of how timeouts are created.\n *\n * @tanstack/query-core makes liberal use of timeouts to implement `staleTime`\n * and `gcTime`. The default TimeoutManager provider uses the platform's global\n * `setTimeout` implementation, which is known to have scalability issues with\n * thousands of timeouts on the event loop.\n *\n * If you hit this limitation, consider providing a custom TimeoutProvider that\n * coalesces timeouts.\n */\nexport class TimeoutManager implements Omit {\n // We cannot have TimeoutManager as we must instantiate it with a concrete\n // type at app boot; and if we leave that type, then any new timer provider\n // would need to support ReturnType, which is infeasible.\n //\n // We settle for type safety for the TimeoutProvider type, and accept that\n // this class is unsafe internally to allow for extension.\n #provider: TimeoutProvider = defaultTimeoutProvider\n #providerCalled = false\n\n setTimeoutProvider(\n provider: TimeoutProvider,\n ): void {\n if (process.env.NODE_ENV !== 'production') {\n if (this.#providerCalled && provider !== this.#provider) {\n // After changing providers, `clearTimeout` will not work as expected for\n // timeouts from the previous provider.\n //\n // Since they may allocate the same timeout ID, clearTimeout may cancel an\n // arbitrary different timeout, or unexpected no-op.\n //\n // We could protect against this by mixing the timeout ID bits\n // deterministically with some per-provider bits.\n //\n // We could internally queue `setTimeout` calls to `TimeoutManager` until\n // some API call to set the initial provider.\n console.error(\n `[timeoutManager]: Switching provider after calls to previous provider might result in unexpected behavior.`,\n { previous: this.#provider, provider },\n )\n }\n }\n\n this.#provider = provider\n if (process.env.NODE_ENV !== 'production') {\n this.#providerCalled = false\n }\n }\n\n setTimeout(callback: TimeoutCallback, delay: number): ManagedTimerId {\n if (process.env.NODE_ENV !== 'production') {\n this.#providerCalled = true\n }\n return this.#provider.setTimeout(callback, delay)\n }\n\n clearTimeout(timeoutId: ManagedTimerId | undefined): void {\n this.#provider.clearTimeout(timeoutId)\n }\n\n setInterval(callback: TimeoutCallback, delay: number): ManagedTimerId {\n if (process.env.NODE_ENV !== 'production') {\n this.#providerCalled = true\n }\n return this.#provider.setInterval(callback, delay)\n }\n\n clearInterval(intervalId: ManagedTimerId | undefined): void {\n this.#provider.clearInterval(intervalId)\n }\n}\n\nexport const timeoutManager = new TimeoutManager()\n\n/**\n * In many cases code wants to delay to the next event loop tick; this is not\n * mediated by {@link timeoutManager}.\n *\n * This function is provided to make auditing the `tanstack/query-core` for\n * incorrect use of system `setTimeout` easier.\n */\nexport function systemSetTimeoutZero(callback: TimeoutCallback): void {\n setTimeout(callback, 0)\n}\n"],"mappings":";AA8BO,IAAM,yBAET;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAWF,YAAY,CAAC,UAAU,UAAU,WAAW,UAAU,KAAK;AAAA,EAC3D,cAAc,CAAC,cAAc,aAAa,SAAS;AAAA,EAEnD,aAAa,CAAC,UAAU,UAAU,YAAY,UAAU,KAAK;AAAA,EAC7D,eAAe,CAAC,eAAe,cAAc,UAAU;AACzD;AAaO,IAAM,iBAAN,MAA8D;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOnE,YAAkC;AAAA,EAClC,kBAAkB;AAAA,EAElB,mBACE,UACM;AACN,QAAI,QAAQ,IAAI,aAAa,cAAc;AACzC,UAAI,KAAK,mBAAmB,aAAa,KAAK,WAAW;AAYvD,gBAAQ;AAAA,UACN;AAAA,UACA,EAAE,UAAU,KAAK,WAAW,SAAS;AAAA,QACvC;AAAA,MACF;AAAA,IACF;AAEA,SAAK,YAAY;AACjB,QAAI,QAAQ,IAAI,aAAa,cAAc;AACzC,WAAK,kBAAkB;AAAA,IACzB;AAAA,EACF;AAAA,EAEA,WAAW,UAA2B,OAA+B;AACnE,QAAI,QAAQ,IAAI,aAAa,cAAc;AACzC,WAAK,kBAAkB;AAAA,IACzB;AACA,WAAO,KAAK,UAAU,WAAW,UAAU,KAAK;AAAA,EAClD;AAAA,EAEA,aAAa,WAA6C;AACxD,SAAK,UAAU,aAAa,SAAS;AAAA,EACvC;AAAA,EAEA,YAAY,UAA2B,OAA+B;AACpE,QAAI,QAAQ,IAAI,aAAa,cAAc;AACzC,WAAK,kBAAkB;AAAA,IACzB;AACA,WAAO,KAAK,UAAU,YAAY,UAAU,KAAK;AAAA,EACnD;AAAA,EAEA,cAAc,YAA8C;AAC1D,SAAK,UAAU,cAAc,UAAU;AAAA,EACzC;AACF;AAEO,IAAM,iBAAiB,IAAI,eAAe;AAS1C,SAAS,qBAAqB,UAAiC;AACpE,aAAW,UAAU,CAAC;AACxB;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/types.cjs b/node_modules/@tanstack/query-core/build/modern/types.cjs new file mode 100644 index 0000000..b948e7c --- /dev/null +++ b/node_modules/@tanstack/query-core/build/modern/types.cjs @@ -0,0 +1,37 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/types.ts +var types_exports = {}; +__export(types_exports, { + dataTagErrorSymbol: () => dataTagErrorSymbol, + dataTagSymbol: () => dataTagSymbol, + unsetMarker: () => unsetMarker +}); +module.exports = __toCommonJS(types_exports); +var dataTagSymbol = /* @__PURE__ */ Symbol("dataTagSymbol"); +var dataTagErrorSymbol = /* @__PURE__ */ Symbol("dataTagErrorSymbol"); +var unsetMarker = /* @__PURE__ */ Symbol("unsetMarker"); +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + dataTagErrorSymbol, + dataTagSymbol, + unsetMarker +}); +//# sourceMappingURL=types.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/types.cjs.map b/node_modules/@tanstack/query-core/build/modern/types.cjs.map new file mode 100644 index 0000000..21fe50b --- /dev/null +++ b/node_modules/@tanstack/query-core/build/modern/types.cjs.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/types.ts"],"sourcesContent":["/* istanbul ignore file */\n\nimport type { QueryClient } from './queryClient'\nimport type { DehydrateOptions, HydrateOptions } from './hydration'\nimport type { MutationState } from './mutation'\nimport type { FetchDirection, Query, QueryBehavior } from './query'\nimport type { RetryDelayValue, RetryValue } from './retryer'\nimport type { QueryFilters, QueryTypeFilter, SkipToken } from './utils'\nimport type { QueryCache } from './queryCache'\nimport type { MutationCache } from './mutationCache'\n\nexport type NonUndefinedGuard = T extends undefined ? never : T\n\nexport type DistributiveOmit<\n TObject,\n TKey extends keyof TObject,\n> = TObject extends any ? Omit : never\n\nexport type OmitKeyof<\n TObject,\n TKey extends TStrictly extends 'safely'\n ?\n | keyof TObject\n | (string & Record)\n | (number & Record)\n | (symbol & Record)\n : keyof TObject,\n TStrictly extends 'strictly' | 'safely' = 'strictly',\n> = Omit\n\nexport type Override = {\n [AKey in keyof TTargetA]: AKey extends keyof TTargetB\n ? TTargetB[AKey]\n : TTargetA[AKey]\n}\n\nexport type NoInfer = [T][T extends any ? 0 : never]\n\nexport interface Register {\n // defaultError: Error\n // queryMeta: Record\n // mutationMeta: Record\n // queryKey: ReadonlyArray\n // mutationKey: ReadonlyArray\n}\n\nexport type DefaultError = Register extends {\n defaultError: infer TError\n}\n ? TError\n : Error\n\nexport type QueryKey = Register extends {\n queryKey: infer TQueryKey\n}\n ? TQueryKey extends ReadonlyArray\n ? TQueryKey\n : TQueryKey extends Array\n ? TQueryKey\n : ReadonlyArray\n : ReadonlyArray\n\nexport const dataTagSymbol = Symbol('dataTagSymbol')\nexport type dataTagSymbol = typeof dataTagSymbol\nexport const dataTagErrorSymbol = Symbol('dataTagErrorSymbol')\nexport type dataTagErrorSymbol = typeof dataTagErrorSymbol\nexport const unsetMarker = Symbol('unsetMarker')\nexport type UnsetMarker = typeof unsetMarker\nexport type AnyDataTag = {\n [dataTagSymbol]: any\n [dataTagErrorSymbol]: any\n}\nexport type DataTag<\n TType,\n TValue,\n TError = UnsetMarker,\n> = TType extends AnyDataTag\n ? TType\n : TType & {\n [dataTagSymbol]: TValue\n [dataTagErrorSymbol]: TError\n }\n\nexport type InferDataFromTag =\n TTaggedQueryKey extends DataTag\n ? TaggedValue\n : TQueryFnData\n\nexport type InferErrorFromTag =\n TTaggedQueryKey extends DataTag\n ? TaggedError extends UnsetMarker\n ? TError\n : TaggedError\n : TError\n\nexport type QueryFunction<\n T = unknown,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = never,\n> = (context: QueryFunctionContext) => T | Promise\n\nexport type StaleTime = number | 'static'\n\nexport type StaleTimeFunction<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> =\n | StaleTime\n | ((query: Query) => StaleTime)\n\nexport type Enabled<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> =\n | boolean\n | ((query: Query) => boolean)\n\nexport type QueryPersister<\n T = unknown,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = never,\n> = [TPageParam] extends [never]\n ? (\n queryFn: QueryFunction,\n context: QueryFunctionContext,\n query: Query,\n ) => T | Promise\n : (\n queryFn: QueryFunction,\n context: QueryFunctionContext,\n query: Query,\n ) => T | Promise\n\nexport type QueryFunctionContext<\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = never,\n> = [TPageParam] extends [never]\n ? {\n client: QueryClient\n queryKey: TQueryKey\n signal: AbortSignal\n meta: QueryMeta | undefined\n pageParam?: unknown\n /**\n * @deprecated\n * if you want access to the direction, you can add it to the pageParam\n */\n direction?: unknown\n }\n : {\n client: QueryClient\n queryKey: TQueryKey\n signal: AbortSignal\n pageParam: TPageParam\n /**\n * @deprecated\n * if you want access to the direction, you can add it to the pageParam\n */\n direction: FetchDirection\n meta: QueryMeta | undefined\n }\n\nexport type InitialDataFunction = () => T | undefined\n\ntype NonFunctionGuard = T extends Function ? never : T\n\nexport type PlaceholderDataFunction<\n TQueryFnData = unknown,\n TError = DefaultError,\n TQueryData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> = (\n previousData: TQueryData | undefined,\n previousQuery: Query | undefined,\n) => TQueryData | undefined\n\nexport type QueriesPlaceholderDataFunction = (\n previousData: undefined,\n previousQuery: undefined,\n) => TQueryData | undefined\n\nexport type QueryKeyHashFunction = (\n queryKey: TQueryKey,\n) => string\n\nexport type GetPreviousPageParamFunction = (\n firstPage: TQueryFnData,\n allPages: Array,\n firstPageParam: TPageParam,\n allPageParams: Array,\n) => TPageParam | undefined | null\n\nexport type GetNextPageParamFunction = (\n lastPage: TQueryFnData,\n allPages: Array,\n lastPageParam: TPageParam,\n allPageParams: Array,\n) => TPageParam | undefined | null\n\nexport interface InfiniteData {\n pages: Array\n pageParams: Array\n}\n\nexport type QueryMeta = Register extends {\n queryMeta: infer TQueryMeta\n}\n ? TQueryMeta extends Record\n ? TQueryMeta\n : Record\n : Record\n\nexport type NetworkMode = 'online' | 'always' | 'offlineFirst'\n\nexport type NotifyOnChangeProps =\n | Array\n | 'all'\n | undefined\n | (() => Array | 'all' | undefined)\n\nexport interface QueryOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = never,\n> {\n /**\n * If `false`, failed queries will not retry by default.\n * If `true`, failed queries will retry infinitely., failureCount: num\n * If set to an integer number, e.g. 3, failed queries will retry until the failed query count meets that number.\n * If set to a function `(failureCount, error) => boolean` failed queries will retry until the function returns false.\n */\n retry?: RetryValue\n retryDelay?: RetryDelayValue\n networkMode?: NetworkMode\n /**\n * The time in milliseconds that unused/inactive cache data remains in memory.\n * When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration.\n * When different garbage collection times are specified, the longest one will be used.\n * Setting it to `Infinity` will disable garbage collection.\n */\n gcTime?: number\n queryFn?: QueryFunction | SkipToken\n persister?: QueryPersister<\n NoInfer,\n NoInfer,\n NoInfer\n >\n queryHash?: string\n queryKey?: TQueryKey\n queryKeyHashFn?: QueryKeyHashFunction\n initialData?: TData | InitialDataFunction\n initialDataUpdatedAt?: number | (() => number | undefined)\n behavior?: QueryBehavior\n /**\n * Set this to `false` to disable structural sharing between query results.\n * Set this to a function which accepts the old and new data and returns resolved data of the same type to implement custom structural sharing logic.\n * Defaults to `true`.\n */\n structuralSharing?:\n | boolean\n | ((oldData: unknown | undefined, newData: unknown) => unknown)\n _defaulted?: boolean\n /**\n * Additional payload to be stored on each query.\n * Use this property to pass information that can be used in other places.\n */\n meta?: QueryMeta\n /**\n * Maximum number of pages to store in the data of an infinite query.\n */\n maxPages?: number\n}\n\nexport interface InitialPageParam {\n initialPageParam: TPageParam\n}\n\nexport interface InfiniteQueryPageParamsOptions<\n TQueryFnData = unknown,\n TPageParam = unknown,\n> extends InitialPageParam {\n /**\n * This function can be set to automatically get the previous cursor for infinite queries.\n * The result will also be used to determine the value of `hasPreviousPage`.\n */\n getPreviousPageParam?: GetPreviousPageParamFunction\n /**\n * This function can be set to automatically get the next cursor for infinite queries.\n * The result will also be used to determine the value of `hasNextPage`.\n */\n getNextPageParam: GetNextPageParamFunction\n}\n\nexport type ThrowOnError<\n TQueryFnData,\n TError,\n TQueryData,\n TQueryKey extends QueryKey,\n> =\n | boolean\n | ((\n error: TError,\n query: Query,\n ) => boolean)\n\nexport interface QueryObserverOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = never,\n> extends WithRequired<\n QueryOptions,\n 'queryKey'\n> {\n /**\n * Set this to `false` or a function that returns `false` to disable automatic refetching when the query mounts or changes query keys.\n * To refetch the query, use the `refetch` method returned from the `useQuery` instance.\n * Accepts a boolean or function that returns a boolean.\n * Defaults to `true`.\n */\n enabled?: Enabled\n /**\n * The time in milliseconds after data is considered stale.\n * If set to `Infinity`, the data will never be considered stale.\n * If set to a function, the function will be executed with the query to compute a `staleTime`.\n * Defaults to `0`.\n */\n staleTime?: StaleTimeFunction\n /**\n * If set to a number, the query will continuously refetch at this frequency in milliseconds.\n * If set to a function, the function will be executed with the latest data and query to compute a frequency\n * Defaults to `false`.\n */\n refetchInterval?:\n | number\n | false\n | ((\n query: Query,\n ) => number | false | undefined)\n /**\n * If set to `true`, the query will continue to refetch while their tab/window is in the background.\n * Defaults to `false`.\n */\n refetchIntervalInBackground?: boolean\n /**\n * If set to `true`, the query will refetch on window focus if the data is stale.\n * If set to `false`, the query will not refetch on window focus.\n * If set to `'always'`, the query will always refetch on window focus.\n * If set to a function, the function will be executed with the latest data and query to compute the value.\n * Defaults to `true`.\n */\n refetchOnWindowFocus?:\n | boolean\n | 'always'\n | ((\n query: Query,\n ) => boolean | 'always')\n /**\n * If set to `true`, the query will refetch on reconnect if the data is stale.\n * If set to `false`, the query will not refetch on reconnect.\n * If set to `'always'`, the query will always refetch on reconnect.\n * If set to a function, the function will be executed with the latest data and query to compute the value.\n * Defaults to the value of `networkOnline` (`true`)\n */\n refetchOnReconnect?:\n | boolean\n | 'always'\n | ((\n query: Query,\n ) => boolean | 'always')\n /**\n * If set to `true`, the query will refetch on mount if the data is stale.\n * If set to `false`, will disable additional instances of a query to trigger background refetch.\n * If set to `'always'`, the query will always refetch on mount.\n * If set to a function, the function will be executed with the latest data and query to compute the value\n * Defaults to `true`.\n */\n refetchOnMount?:\n | boolean\n | 'always'\n | ((\n query: Query,\n ) => boolean | 'always')\n /**\n * If set to `false`, the query will not be retried on mount if it contains an error.\n * Defaults to `true`.\n */\n retryOnMount?: boolean\n /**\n * If set, the component will only re-render if any of the listed properties change.\n * When set to `['data', 'error']`, the component will only re-render when the `data` or `error` properties change.\n * When set to `'all'`, the component will re-render whenever a query is updated.\n * When set to a function, the function will be executed to compute the list of properties.\n * By default, access to properties will be tracked, and the component will only re-render when one of the tracked properties change.\n */\n notifyOnChangeProps?: NotifyOnChangeProps\n /**\n * Whether errors should be thrown instead of setting the `error` property.\n * If set to `true` or `suspense` is `true`, all errors will be thrown to the error boundary.\n * If set to `false` and `suspense` is `false`, errors are returned as state.\n * If set to a function, it will be passed the error and the query, and it should return a boolean indicating whether to show the error in an error boundary (`true`) or return the error as state (`false`).\n * Defaults to `false`.\n */\n throwOnError?: ThrowOnError\n /**\n * This option can be used to transform or select a part of the data returned by the query function.\n */\n select?: (data: TQueryData) => TData\n /**\n * If set to `true`, the query will suspend when `status === 'pending'`\n * and throw errors when `status === 'error'`.\n * Defaults to `false`.\n */\n suspense?: boolean\n /**\n * If set, this value will be used as the placeholder data for this particular query observer while the query is still in the `loading` data and no initialData has been provided.\n */\n placeholderData?:\n | NonFunctionGuard\n | PlaceholderDataFunction<\n NonFunctionGuard,\n TError,\n NonFunctionGuard,\n TQueryKey\n >\n\n _optimisticResults?: 'optimistic' | 'isRestoring'\n\n /**\n * Enable prefetching during rendering\n */\n experimental_prefetchInRender?: boolean\n}\n\nexport type WithRequired = TTarget & {\n [_ in TKey]: {}\n}\n\nexport type DefaultedQueryObserverOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> = WithRequired<\n QueryObserverOptions,\n 'throwOnError' | 'refetchOnReconnect' | 'queryHash'\n>\n\nexport interface InfiniteQueryObserverOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n>\n extends\n QueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n InfiniteData,\n TQueryKey,\n TPageParam\n >,\n InfiniteQueryPageParamsOptions {}\n\nexport type DefaultedInfiniteQueryObserverOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n> = WithRequired<\n InfiniteQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n 'throwOnError' | 'refetchOnReconnect' | 'queryHash'\n>\n\nexport interface FetchQueryOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = never,\n> extends WithRequired<\n QueryOptions,\n 'queryKey'\n> {\n initialPageParam?: never\n /**\n * The time in milliseconds after data is considered stale.\n * If the data is fresh it will be returned from the cache.\n */\n staleTime?: StaleTimeFunction\n}\n\nexport interface EnsureQueryDataOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = never,\n> extends FetchQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n> {\n revalidateIfStale?: boolean\n}\n\nexport type EnsureInfiniteQueryDataOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n> = FetchInfiniteQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n> & {\n revalidateIfStale?: boolean\n}\n\ntype FetchInfiniteQueryPages =\n | { pages?: never }\n | {\n pages: number\n getNextPageParam: GetNextPageParamFunction\n }\n\nexport type FetchInfiniteQueryOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n> = Omit<\n FetchQueryOptions<\n TQueryFnData,\n TError,\n InfiniteData,\n TQueryKey,\n TPageParam\n >,\n 'initialPageParam'\n> &\n InitialPageParam &\n FetchInfiniteQueryPages\n\nexport interface ResultOptions {\n throwOnError?: boolean\n}\n\nexport interface RefetchOptions extends ResultOptions {\n /**\n * If set to `true`, a currently running request will be cancelled before a new request is made\n *\n * If set to `false`, no refetch will be made if there is already a request running.\n *\n * Defaults to `true`.\n */\n cancelRefetch?: boolean\n}\n\nexport interface InvalidateQueryFilters<\n TQueryKey extends QueryKey = QueryKey,\n> extends QueryFilters {\n refetchType?: QueryTypeFilter | 'none'\n}\n\nexport interface RefetchQueryFilters<\n TQueryKey extends QueryKey = QueryKey,\n> extends QueryFilters {}\n\nexport interface InvalidateOptions extends RefetchOptions {}\nexport interface ResetOptions extends RefetchOptions {}\n\nexport interface FetchNextPageOptions extends ResultOptions {\n /**\n * If set to `true`, calling `fetchNextPage` repeatedly will invoke `queryFn` every time,\n * whether the previous invocation has resolved or not. Also, the result from previous invocations will be ignored.\n *\n * If set to `false`, calling `fetchNextPage` repeatedly won't have any effect until the first invocation has resolved.\n *\n * Defaults to `true`.\n */\n cancelRefetch?: boolean\n}\n\nexport interface FetchPreviousPageOptions extends ResultOptions {\n /**\n * If set to `true`, calling `fetchPreviousPage` repeatedly will invoke `queryFn` every time,\n * whether the previous invocation has resolved or not. Also, the result from previous invocations will be ignored.\n *\n * If set to `false`, calling `fetchPreviousPage` repeatedly won't have any effect until the first invocation has resolved.\n *\n * Defaults to `true`.\n */\n cancelRefetch?: boolean\n}\n\nexport type QueryStatus = 'pending' | 'error' | 'success'\nexport type FetchStatus = 'fetching' | 'paused' | 'idle'\n\nexport interface QueryObserverBaseResult<\n TData = unknown,\n TError = DefaultError,\n> {\n /**\n * The last successfully resolved data for the query.\n */\n data: TData | undefined\n /**\n * The timestamp for when the query most recently returned the `status` as `\"success\"`.\n */\n dataUpdatedAt: number\n /**\n * The error object for the query, if an error was thrown.\n * - Defaults to `null`.\n */\n error: TError | null\n /**\n * The timestamp for when the query most recently returned the `status` as `\"error\"`.\n */\n errorUpdatedAt: number\n /**\n * The failure count for the query.\n * - Incremented every time the query fails.\n * - Reset to `0` when the query succeeds.\n */\n failureCount: number\n /**\n * The failure reason for the query retry.\n * - Reset to `null` when the query succeeds.\n */\n failureReason: TError | null\n /**\n * The sum of all errors.\n */\n errorUpdateCount: number\n /**\n * A derived boolean from the `status` variable, provided for convenience.\n * - `true` if the query attempt resulted in an error.\n */\n isError: boolean\n /**\n * Will be `true` if the query has been fetched.\n */\n isFetched: boolean\n /**\n * Will be `true` if the query has been fetched after the component mounted.\n * - This property can be used to not show any previously cached data.\n */\n isFetchedAfterMount: boolean\n /**\n * A derived boolean from the `fetchStatus` variable, provided for convenience.\n * - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch.\n */\n isFetching: boolean\n /**\n * Is `true` whenever the first fetch for a query is in-flight.\n * - Is the same as `isFetching && isPending`.\n */\n isLoading: boolean\n /**\n * Will be `pending` if there's no cached data and no query attempt was finished yet.\n */\n isPending: boolean\n /**\n * Will be `true` if the query failed while fetching for the first time.\n */\n isLoadingError: boolean\n /**\n * @deprecated `isInitialLoading` is being deprecated in favor of `isLoading`\n * and will be removed in the next major version.\n */\n isInitialLoading: boolean\n /**\n * A derived boolean from the `fetchStatus` variable, provided for convenience.\n * - The query wanted to fetch, but has been `paused`.\n */\n isPaused: boolean\n /**\n * Will be `true` if the data shown is the placeholder data.\n */\n isPlaceholderData: boolean\n /**\n * Will be `true` if the query failed while refetching.\n */\n isRefetchError: boolean\n /**\n * Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`.\n * - Is the same as `isFetching && !isPending`.\n */\n isRefetching: boolean\n /**\n * Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`.\n */\n isStale: boolean\n /**\n * A derived boolean from the `status` variable, provided for convenience.\n * - `true` if the query has received a response with no errors and is ready to display its data.\n */\n isSuccess: boolean\n /**\n * `true` if this observer is enabled, `false` otherwise.\n */\n isEnabled: boolean\n /**\n * A function to manually refetch the query.\n */\n refetch: (\n options?: RefetchOptions,\n ) => Promise>\n /**\n * The status of the query.\n * - Will be:\n * - `pending` if there's no cached data and no query attempt was finished yet.\n * - `error` if the query attempt resulted in an error.\n * - `success` if the query has received a response with no errors and is ready to display its data.\n */\n status: QueryStatus\n /**\n * The fetch status of the query.\n * - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch.\n * - `paused`: The query wanted to fetch, but has been `paused`.\n * - `idle`: The query is not fetching.\n * - See [Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information.\n */\n fetchStatus: FetchStatus\n /**\n * A stable promise that will be resolved with the data of the query.\n * Requires the `experimental_prefetchInRender` feature flag to be enabled.\n * @example\n *\n * ### Enabling the feature flag\n * ```ts\n * const client = new QueryClient({\n * defaultOptions: {\n * queries: {\n * experimental_prefetchInRender: true,\n * },\n * },\n * })\n * ```\n *\n * ### Usage\n * ```tsx\n * import { useQuery } from '@tanstack/react-query'\n * import React from 'react'\n * import { fetchTodos, type Todo } from './api'\n *\n * function TodoList({ query }: { query: UseQueryResult }) {\n * const data = React.use(query.promise)\n *\n * return (\n *
    \n * {data.map(todo => (\n *
  • {todo.title}
  • \n * ))}\n *
\n * )\n * }\n *\n * export function App() {\n * const query = useQuery({ queryKey: ['todos'], queryFn: fetchTodos })\n *\n * return (\n * <>\n *

Todos

\n * Loading...}>\n * \n * \n * \n * )\n * }\n * ```\n */\n promise: Promise\n}\n\nexport interface QueryObserverPendingResult<\n TData = unknown,\n TError = DefaultError,\n> extends QueryObserverBaseResult {\n data: undefined\n error: null\n isError: false\n isPending: true\n isLoadingError: false\n isRefetchError: false\n isSuccess: false\n isPlaceholderData: false\n status: 'pending'\n}\n\nexport interface QueryObserverLoadingResult<\n TData = unknown,\n TError = DefaultError,\n> extends QueryObserverBaseResult {\n data: undefined\n error: null\n isError: false\n isPending: true\n isLoading: true\n isLoadingError: false\n isRefetchError: false\n isSuccess: false\n isPlaceholderData: false\n status: 'pending'\n}\n\nexport interface QueryObserverLoadingErrorResult<\n TData = unknown,\n TError = DefaultError,\n> extends QueryObserverBaseResult {\n data: undefined\n error: TError\n isError: true\n isPending: false\n isLoading: false\n isLoadingError: true\n isRefetchError: false\n isSuccess: false\n isPlaceholderData: false\n status: 'error'\n}\n\nexport interface QueryObserverRefetchErrorResult<\n TData = unknown,\n TError = DefaultError,\n> extends QueryObserverBaseResult {\n data: TData\n error: TError\n isError: true\n isPending: false\n isLoading: false\n isLoadingError: false\n isRefetchError: true\n isSuccess: false\n isPlaceholderData: false\n status: 'error'\n}\n\nexport interface QueryObserverSuccessResult<\n TData = unknown,\n TError = DefaultError,\n> extends QueryObserverBaseResult {\n data: TData\n error: null\n isError: false\n isPending: false\n isLoading: false\n isLoadingError: false\n isRefetchError: false\n isSuccess: true\n isPlaceholderData: false\n status: 'success'\n}\n\nexport interface QueryObserverPlaceholderResult<\n TData = unknown,\n TError = DefaultError,\n> extends QueryObserverBaseResult {\n data: TData\n isError: false\n error: null\n isPending: false\n isLoading: false\n isLoadingError: false\n isRefetchError: false\n isSuccess: true\n isPlaceholderData: true\n status: 'success'\n}\n\nexport type DefinedQueryObserverResult<\n TData = unknown,\n TError = DefaultError,\n> =\n | QueryObserverRefetchErrorResult\n | QueryObserverSuccessResult\n\nexport type QueryObserverResult =\n | DefinedQueryObserverResult\n | QueryObserverLoadingErrorResult\n | QueryObserverLoadingResult\n | QueryObserverPendingResult\n | QueryObserverPlaceholderResult\n\nexport interface InfiniteQueryObserverBaseResult<\n TData = unknown,\n TError = DefaultError,\n> extends QueryObserverBaseResult {\n /**\n * This function allows you to fetch the next \"page\" of results.\n */\n fetchNextPage: (\n options?: FetchNextPageOptions,\n ) => Promise>\n /**\n * This function allows you to fetch the previous \"page\" of results.\n */\n fetchPreviousPage: (\n options?: FetchPreviousPageOptions,\n ) => Promise>\n /**\n * Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option).\n */\n hasNextPage: boolean\n /**\n * Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option).\n */\n hasPreviousPage: boolean\n /**\n * Will be `true` if the query failed while fetching the next page.\n */\n isFetchNextPageError: boolean\n /**\n * Will be `true` while fetching the next page with `fetchNextPage`.\n */\n isFetchingNextPage: boolean\n /**\n * Will be `true` if the query failed while fetching the previous page.\n */\n isFetchPreviousPageError: boolean\n /**\n * Will be `true` while fetching the previous page with `fetchPreviousPage`.\n */\n isFetchingPreviousPage: boolean\n}\n\nexport interface InfiniteQueryObserverPendingResult<\n TData = unknown,\n TError = DefaultError,\n> extends InfiniteQueryObserverBaseResult {\n data: undefined\n error: null\n isError: false\n isPending: true\n isLoadingError: false\n isRefetchError: false\n isFetchNextPageError: false\n isFetchPreviousPageError: false\n isSuccess: false\n isPlaceholderData: false\n status: 'pending'\n}\n\nexport interface InfiniteQueryObserverLoadingResult<\n TData = unknown,\n TError = DefaultError,\n> extends InfiniteQueryObserverBaseResult {\n data: undefined\n error: null\n isError: false\n isPending: true\n isLoading: true\n isLoadingError: false\n isRefetchError: false\n isFetchNextPageError: false\n isFetchPreviousPageError: false\n isSuccess: false\n isPlaceholderData: false\n status: 'pending'\n}\n\nexport interface InfiniteQueryObserverLoadingErrorResult<\n TData = unknown,\n TError = DefaultError,\n> extends InfiniteQueryObserverBaseResult {\n data: undefined\n error: TError\n isError: true\n isPending: false\n isLoading: false\n isLoadingError: true\n isRefetchError: false\n isFetchNextPageError: false\n isFetchPreviousPageError: false\n isSuccess: false\n isPlaceholderData: false\n status: 'error'\n}\n\nexport interface InfiniteQueryObserverRefetchErrorResult<\n TData = unknown,\n TError = DefaultError,\n> extends InfiniteQueryObserverBaseResult {\n data: TData\n error: TError\n isError: true\n isPending: false\n isLoading: false\n isLoadingError: false\n isRefetchError: true\n isSuccess: false\n isPlaceholderData: false\n status: 'error'\n}\n\nexport interface InfiniteQueryObserverSuccessResult<\n TData = unknown,\n TError = DefaultError,\n> extends InfiniteQueryObserverBaseResult {\n data: TData\n error: null\n isError: false\n isPending: false\n isLoading: false\n isLoadingError: false\n isRefetchError: false\n isFetchNextPageError: false\n isFetchPreviousPageError: false\n isSuccess: true\n isPlaceholderData: false\n status: 'success'\n}\n\nexport interface InfiniteQueryObserverPlaceholderResult<\n TData = unknown,\n TError = DefaultError,\n> extends InfiniteQueryObserverBaseResult {\n data: TData\n isError: false\n error: null\n isPending: false\n isLoading: false\n isLoadingError: false\n isRefetchError: false\n isSuccess: true\n isPlaceholderData: true\n isFetchNextPageError: false\n isFetchPreviousPageError: false\n status: 'success'\n}\n\nexport type DefinedInfiniteQueryObserverResult<\n TData = unknown,\n TError = DefaultError,\n> =\n | InfiniteQueryObserverRefetchErrorResult\n | InfiniteQueryObserverSuccessResult\n\nexport type InfiniteQueryObserverResult<\n TData = unknown,\n TError = DefaultError,\n> =\n | DefinedInfiniteQueryObserverResult\n | InfiniteQueryObserverLoadingErrorResult\n | InfiniteQueryObserverLoadingResult\n | InfiniteQueryObserverPendingResult\n | InfiniteQueryObserverPlaceholderResult\n\nexport type MutationKey = Register extends {\n mutationKey: infer TMutationKey\n}\n ? TMutationKey extends ReadonlyArray\n ? TMutationKey\n : TMutationKey extends Array\n ? TMutationKey\n : ReadonlyArray\n : ReadonlyArray\n\nexport type MutationStatus = 'idle' | 'pending' | 'success' | 'error'\n\nexport type MutationScope = {\n id: string\n}\n\nexport type MutationMeta = Register extends {\n mutationMeta: infer TMutationMeta\n}\n ? TMutationMeta extends Record\n ? TMutationMeta\n : Record\n : Record\n\nexport type MutationFunctionContext = {\n client: QueryClient\n meta: MutationMeta | undefined\n mutationKey?: MutationKey\n}\n\nexport type MutationFunction = (\n variables: TVariables,\n context: MutationFunctionContext,\n) => Promise\n\nexport interface MutationOptions<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n> {\n mutationFn?: MutationFunction\n mutationKey?: MutationKey\n onMutate?: (\n variables: TVariables,\n context: MutationFunctionContext,\n ) => Promise | TOnMutateResult\n onSuccess?: (\n data: TData,\n variables: TVariables,\n onMutateResult: TOnMutateResult,\n context: MutationFunctionContext,\n ) => Promise | unknown\n onError?: (\n error: TError,\n variables: TVariables,\n onMutateResult: TOnMutateResult | undefined,\n context: MutationFunctionContext,\n ) => Promise | unknown\n onSettled?: (\n data: TData | undefined,\n error: TError | null,\n variables: TVariables,\n onMutateResult: TOnMutateResult | undefined,\n context: MutationFunctionContext,\n ) => Promise | unknown\n retry?: RetryValue\n retryDelay?: RetryDelayValue\n networkMode?: NetworkMode\n gcTime?: number\n _defaulted?: boolean\n meta?: MutationMeta\n scope?: MutationScope\n}\n\nexport interface MutationObserverOptions<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n> extends MutationOptions {\n throwOnError?: boolean | ((error: TError) => boolean)\n}\n\nexport interface MutateOptions<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n> {\n onSuccess?: (\n data: TData,\n variables: TVariables,\n onMutateResult: TOnMutateResult | undefined,\n context: MutationFunctionContext,\n ) => void\n onError?: (\n error: TError,\n variables: TVariables,\n onMutateResult: TOnMutateResult | undefined,\n context: MutationFunctionContext,\n ) => void\n onSettled?: (\n data: TData | undefined,\n error: TError | null,\n variables: TVariables,\n onMutateResult: TOnMutateResult | undefined,\n context: MutationFunctionContext,\n ) => void\n}\n\nexport type MutateFunction<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n> = (\n variables: TVariables,\n options?: MutateOptions,\n) => Promise\n\nexport interface MutationObserverBaseResult<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n> extends MutationState {\n /**\n * The last successfully resolved data for the mutation.\n */\n data: TData | undefined\n /**\n * The variables object passed to the `mutationFn`.\n */\n variables: TVariables | undefined\n /**\n * The error object for the mutation, if an error was encountered.\n * - Defaults to `null`.\n */\n error: TError | null\n /**\n * A boolean variable derived from `status`.\n * - `true` if the last mutation attempt resulted in an error.\n */\n isError: boolean\n /**\n * A boolean variable derived from `status`.\n * - `true` if the mutation is in its initial state prior to executing.\n */\n isIdle: boolean\n /**\n * A boolean variable derived from `status`.\n * - `true` if the mutation is currently executing.\n */\n isPending: boolean\n /**\n * A boolean variable derived from `status`.\n * - `true` if the last mutation attempt was successful.\n */\n isSuccess: boolean\n /**\n * The status of the mutation.\n * - Will be:\n * - `idle` initial status prior to the mutation function executing.\n * - `pending` if the mutation is currently executing.\n * - `error` if the last mutation attempt resulted in an error.\n * - `success` if the last mutation attempt was successful.\n */\n status: MutationStatus\n /**\n * The mutation function you can call with variables to trigger the mutation and optionally hooks on additional callback options.\n * @param variables - The variables object to pass to the `mutationFn`.\n * @param options.onSuccess - This function will fire when the mutation is successful and will be passed the mutation's result.\n * @param options.onError - This function will fire if the mutation encounters an error and will be passed the error.\n * @param options.onSettled - This function will fire when the mutation is either successfully fetched or encounters an error and be passed either the data or error.\n * @remarks\n * - If you make multiple requests, `onSuccess` will fire only after the latest call you've made.\n * - All the callback functions (`onSuccess`, `onError`, `onSettled`) are void functions, and the returned value will be ignored.\n */\n mutate: MutateFunction\n /**\n * A function to clean the mutation internal state (i.e., it resets the mutation to its initial state).\n */\n reset: () => void\n}\n\nexport interface MutationObserverIdleResult<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n> extends MutationObserverBaseResult<\n TData,\n TError,\n TVariables,\n TOnMutateResult\n> {\n data: undefined\n variables: undefined\n error: null\n isError: false\n isIdle: true\n isPending: false\n isSuccess: false\n status: 'idle'\n}\n\nexport interface MutationObserverLoadingResult<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n> extends MutationObserverBaseResult<\n TData,\n TError,\n TVariables,\n TOnMutateResult\n> {\n data: undefined\n variables: TVariables\n error: null\n isError: false\n isIdle: false\n isPending: true\n isSuccess: false\n status: 'pending'\n}\n\nexport interface MutationObserverErrorResult<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n> extends MutationObserverBaseResult<\n TData,\n TError,\n TVariables,\n TOnMutateResult\n> {\n data: undefined\n error: TError\n variables: TVariables\n isError: true\n isIdle: false\n isPending: false\n isSuccess: false\n status: 'error'\n}\n\nexport interface MutationObserverSuccessResult<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n> extends MutationObserverBaseResult<\n TData,\n TError,\n TVariables,\n TOnMutateResult\n> {\n data: TData\n error: null\n variables: TVariables\n isError: false\n isIdle: false\n isPending: false\n isSuccess: true\n status: 'success'\n}\n\nexport type MutationObserverResult<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n> =\n | MutationObserverIdleResult\n | MutationObserverLoadingResult\n | MutationObserverErrorResult\n | MutationObserverSuccessResult\n\nexport interface QueryClientConfig {\n queryCache?: QueryCache\n mutationCache?: MutationCache\n defaultOptions?: DefaultOptions\n}\n\nexport interface DefaultOptions {\n queries?: OmitKeyof<\n QueryObserverOptions,\n 'suspense' | 'queryKey'\n >\n mutations?: MutationObserverOptions\n hydrate?: HydrateOptions['defaultOptions']\n dehydrate?: DehydrateOptions\n}\n\nexport interface CancelOptions {\n revert?: boolean\n silent?: boolean\n}\n\nexport interface SetDataOptions {\n updatedAt?: number\n}\n\nexport type NotifyEventType =\n | 'added'\n | 'removed'\n | 'updated'\n | 'observerAdded'\n | 'observerRemoved'\n | 'observerResultsUpdated'\n | 'observerOptionsUpdated'\n\nexport interface NotifyEvent {\n type: NotifyEventType\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA8DO,IAAM,gBAAgB,uBAAO,eAAe;AAE5C,IAAM,qBAAqB,uBAAO,oBAAoB;AAEtD,IAAM,cAAc,uBAAO,aAAa;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/types.d.cts b/node_modules/@tanstack/query-core/build/modern/types.d.cts new file mode 100644 index 0000000..c613caa --- /dev/null +++ b/node_modules/@tanstack/query-core/build/modern/types.d.cts @@ -0,0 +1,3 @@ +export { T as AnyDataTag, b7 as CancelOptions, V as DataTag, G as DefaultError, b6 as DefaultOptions, ak as DefaultedInfiniteQueryObserverOptions, ai as DefaultedQueryObserverOptions, aP as DefinedInfiniteQueryObserverResult, aG as DefinedQueryObserverResult, B as DistributiveOmit, $ as Enabled, an as EnsureInfiniteQueryDataOptions, am as EnsureQueryDataOptions, ao as FetchInfiniteQueryOptions, av as FetchNextPageOptions, aw as FetchPreviousPageOptions, al as FetchQueryOptions, ay as FetchStatus, a7 as GetNextPageParamFunction, a6 as GetPreviousPageParamFunction, W as InferDataFromTag, X as InferErrorFromTag, a8 as InfiniteData, aI as InfiniteQueryObserverBaseResult, aL as InfiniteQueryObserverLoadingErrorResult, aK as InfiniteQueryObserverLoadingResult, aj as InfiniteQueryObserverOptions, aJ as InfiniteQueryObserverPendingResult, aO as InfiniteQueryObserverPlaceholderResult, aM as InfiniteQueryObserverRefetchErrorResult, aQ as InfiniteQueryObserverResult, aN as InfiniteQueryObserverSuccessResult, ae as InfiniteQueryPageParamsOptions, a2 as InitialDataFunction, ad as InitialPageParam, at as InvalidateOptions, ar as InvalidateQueryFilters, a_ as MutateFunction, aZ as MutateOptions, aW as MutationFunction, aV as MutationFunctionContext, aR as MutationKey, aU as MutationMeta, a$ as MutationObserverBaseResult, b2 as MutationObserverErrorResult, b0 as MutationObserverIdleResult, b1 as MutationObserverLoadingResult, aY as MutationObserverOptions, b4 as MutationObserverResult, b3 as MutationObserverSuccessResult, aX as MutationOptions, aT as MutationScope, aS as MutationStatus, aa as NetworkMode, F as NoInfer, N as NonUndefinedGuard, ba as NotifyEvent, b9 as NotifyEventType, ab as NotifyOnChangeProps, O as OmitKeyof, E as Override, a3 as PlaceholderDataFunction, a4 as QueriesPlaceholderDataFunction, b5 as QueryClientConfig, Y as QueryFunction, a1 as QueryFunctionContext, I as QueryKey, a5 as QueryKeyHashFunction, a9 as QueryMeta, az as QueryObserverBaseResult, aC as QueryObserverLoadingErrorResult, aB as QueryObserverLoadingResult, ag as QueryObserverOptions, aA as QueryObserverPendingResult, aF as QueryObserverPlaceholderResult, aD as QueryObserverRefetchErrorResult, aH as QueryObserverResult, aE as QueryObserverSuccessResult, ac as QueryOptions, a0 as QueryPersister, ax as QueryStatus, aq as RefetchOptions, as as RefetchQueryFilters, R as Register, au as ResetOptions, ap as ResultOptions, b8 as SetDataOptions, Z as StaleTime, _ as StaleTimeFunction, af as ThrowOnError, P as UnsetMarker, ah as WithRequired, K as dataTagErrorSymbol, J as dataTagSymbol, L as unsetMarker } from './hydration-uphG6M-i.cjs'; +import './removable.cjs'; +import './subscribable.cjs'; diff --git a/node_modules/@tanstack/query-core/build/modern/types.d.ts b/node_modules/@tanstack/query-core/build/modern/types.d.ts new file mode 100644 index 0000000..f951ea6 --- /dev/null +++ b/node_modules/@tanstack/query-core/build/modern/types.d.ts @@ -0,0 +1,3 @@ +export { T as AnyDataTag, b7 as CancelOptions, V as DataTag, G as DefaultError, b6 as DefaultOptions, ak as DefaultedInfiniteQueryObserverOptions, ai as DefaultedQueryObserverOptions, aP as DefinedInfiniteQueryObserverResult, aG as DefinedQueryObserverResult, B as DistributiveOmit, $ as Enabled, an as EnsureInfiniteQueryDataOptions, am as EnsureQueryDataOptions, ao as FetchInfiniteQueryOptions, av as FetchNextPageOptions, aw as FetchPreviousPageOptions, al as FetchQueryOptions, ay as FetchStatus, a7 as GetNextPageParamFunction, a6 as GetPreviousPageParamFunction, W as InferDataFromTag, X as InferErrorFromTag, a8 as InfiniteData, aI as InfiniteQueryObserverBaseResult, aL as InfiniteQueryObserverLoadingErrorResult, aK as InfiniteQueryObserverLoadingResult, aj as InfiniteQueryObserverOptions, aJ as InfiniteQueryObserverPendingResult, aO as InfiniteQueryObserverPlaceholderResult, aM as InfiniteQueryObserverRefetchErrorResult, aQ as InfiniteQueryObserverResult, aN as InfiniteQueryObserverSuccessResult, ae as InfiniteQueryPageParamsOptions, a2 as InitialDataFunction, ad as InitialPageParam, at as InvalidateOptions, ar as InvalidateQueryFilters, a_ as MutateFunction, aZ as MutateOptions, aW as MutationFunction, aV as MutationFunctionContext, aR as MutationKey, aU as MutationMeta, a$ as MutationObserverBaseResult, b2 as MutationObserverErrorResult, b0 as MutationObserverIdleResult, b1 as MutationObserverLoadingResult, aY as MutationObserverOptions, b4 as MutationObserverResult, b3 as MutationObserverSuccessResult, aX as MutationOptions, aT as MutationScope, aS as MutationStatus, aa as NetworkMode, F as NoInfer, N as NonUndefinedGuard, ba as NotifyEvent, b9 as NotifyEventType, ab as NotifyOnChangeProps, O as OmitKeyof, E as Override, a3 as PlaceholderDataFunction, a4 as QueriesPlaceholderDataFunction, b5 as QueryClientConfig, Y as QueryFunction, a1 as QueryFunctionContext, I as QueryKey, a5 as QueryKeyHashFunction, a9 as QueryMeta, az as QueryObserverBaseResult, aC as QueryObserverLoadingErrorResult, aB as QueryObserverLoadingResult, ag as QueryObserverOptions, aA as QueryObserverPendingResult, aF as QueryObserverPlaceholderResult, aD as QueryObserverRefetchErrorResult, aH as QueryObserverResult, aE as QueryObserverSuccessResult, ac as QueryOptions, a0 as QueryPersister, ax as QueryStatus, aq as RefetchOptions, as as RefetchQueryFilters, R as Register, au as ResetOptions, ap as ResultOptions, b8 as SetDataOptions, Z as StaleTime, _ as StaleTimeFunction, af as ThrowOnError, P as UnsetMarker, ah as WithRequired, K as dataTagErrorSymbol, J as dataTagSymbol, L as unsetMarker } from './hydration-BlEVG2Lp.js'; +import './removable.js'; +import './subscribable.js'; diff --git a/node_modules/@tanstack/query-core/build/modern/types.js b/node_modules/@tanstack/query-core/build/modern/types.js new file mode 100644 index 0000000..aa05474 --- /dev/null +++ b/node_modules/@tanstack/query-core/build/modern/types.js @@ -0,0 +1,10 @@ +// src/types.ts +var dataTagSymbol = /* @__PURE__ */ Symbol("dataTagSymbol"); +var dataTagErrorSymbol = /* @__PURE__ */ Symbol("dataTagErrorSymbol"); +var unsetMarker = /* @__PURE__ */ Symbol("unsetMarker"); +export { + dataTagErrorSymbol, + dataTagSymbol, + unsetMarker +}; +//# sourceMappingURL=types.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/types.js.map b/node_modules/@tanstack/query-core/build/modern/types.js.map new file mode 100644 index 0000000..e1d384a --- /dev/null +++ b/node_modules/@tanstack/query-core/build/modern/types.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/types.ts"],"sourcesContent":["/* istanbul ignore file */\n\nimport type { QueryClient } from './queryClient'\nimport type { DehydrateOptions, HydrateOptions } from './hydration'\nimport type { MutationState } from './mutation'\nimport type { FetchDirection, Query, QueryBehavior } from './query'\nimport type { RetryDelayValue, RetryValue } from './retryer'\nimport type { QueryFilters, QueryTypeFilter, SkipToken } from './utils'\nimport type { QueryCache } from './queryCache'\nimport type { MutationCache } from './mutationCache'\n\nexport type NonUndefinedGuard = T extends undefined ? never : T\n\nexport type DistributiveOmit<\n TObject,\n TKey extends keyof TObject,\n> = TObject extends any ? Omit : never\n\nexport type OmitKeyof<\n TObject,\n TKey extends TStrictly extends 'safely'\n ?\n | keyof TObject\n | (string & Record)\n | (number & Record)\n | (symbol & Record)\n : keyof TObject,\n TStrictly extends 'strictly' | 'safely' = 'strictly',\n> = Omit\n\nexport type Override = {\n [AKey in keyof TTargetA]: AKey extends keyof TTargetB\n ? TTargetB[AKey]\n : TTargetA[AKey]\n}\n\nexport type NoInfer = [T][T extends any ? 0 : never]\n\nexport interface Register {\n // defaultError: Error\n // queryMeta: Record\n // mutationMeta: Record\n // queryKey: ReadonlyArray\n // mutationKey: ReadonlyArray\n}\n\nexport type DefaultError = Register extends {\n defaultError: infer TError\n}\n ? TError\n : Error\n\nexport type QueryKey = Register extends {\n queryKey: infer TQueryKey\n}\n ? TQueryKey extends ReadonlyArray\n ? TQueryKey\n : TQueryKey extends Array\n ? TQueryKey\n : ReadonlyArray\n : ReadonlyArray\n\nexport const dataTagSymbol = Symbol('dataTagSymbol')\nexport type dataTagSymbol = typeof dataTagSymbol\nexport const dataTagErrorSymbol = Symbol('dataTagErrorSymbol')\nexport type dataTagErrorSymbol = typeof dataTagErrorSymbol\nexport const unsetMarker = Symbol('unsetMarker')\nexport type UnsetMarker = typeof unsetMarker\nexport type AnyDataTag = {\n [dataTagSymbol]: any\n [dataTagErrorSymbol]: any\n}\nexport type DataTag<\n TType,\n TValue,\n TError = UnsetMarker,\n> = TType extends AnyDataTag\n ? TType\n : TType & {\n [dataTagSymbol]: TValue\n [dataTagErrorSymbol]: TError\n }\n\nexport type InferDataFromTag =\n TTaggedQueryKey extends DataTag\n ? TaggedValue\n : TQueryFnData\n\nexport type InferErrorFromTag =\n TTaggedQueryKey extends DataTag\n ? TaggedError extends UnsetMarker\n ? TError\n : TaggedError\n : TError\n\nexport type QueryFunction<\n T = unknown,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = never,\n> = (context: QueryFunctionContext) => T | Promise\n\nexport type StaleTime = number | 'static'\n\nexport type StaleTimeFunction<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> =\n | StaleTime\n | ((query: Query) => StaleTime)\n\nexport type Enabled<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> =\n | boolean\n | ((query: Query) => boolean)\n\nexport type QueryPersister<\n T = unknown,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = never,\n> = [TPageParam] extends [never]\n ? (\n queryFn: QueryFunction,\n context: QueryFunctionContext,\n query: Query,\n ) => T | Promise\n : (\n queryFn: QueryFunction,\n context: QueryFunctionContext,\n query: Query,\n ) => T | Promise\n\nexport type QueryFunctionContext<\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = never,\n> = [TPageParam] extends [never]\n ? {\n client: QueryClient\n queryKey: TQueryKey\n signal: AbortSignal\n meta: QueryMeta | undefined\n pageParam?: unknown\n /**\n * @deprecated\n * if you want access to the direction, you can add it to the pageParam\n */\n direction?: unknown\n }\n : {\n client: QueryClient\n queryKey: TQueryKey\n signal: AbortSignal\n pageParam: TPageParam\n /**\n * @deprecated\n * if you want access to the direction, you can add it to the pageParam\n */\n direction: FetchDirection\n meta: QueryMeta | undefined\n }\n\nexport type InitialDataFunction = () => T | undefined\n\ntype NonFunctionGuard = T extends Function ? never : T\n\nexport type PlaceholderDataFunction<\n TQueryFnData = unknown,\n TError = DefaultError,\n TQueryData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> = (\n previousData: TQueryData | undefined,\n previousQuery: Query | undefined,\n) => TQueryData | undefined\n\nexport type QueriesPlaceholderDataFunction = (\n previousData: undefined,\n previousQuery: undefined,\n) => TQueryData | undefined\n\nexport type QueryKeyHashFunction = (\n queryKey: TQueryKey,\n) => string\n\nexport type GetPreviousPageParamFunction = (\n firstPage: TQueryFnData,\n allPages: Array,\n firstPageParam: TPageParam,\n allPageParams: Array,\n) => TPageParam | undefined | null\n\nexport type GetNextPageParamFunction = (\n lastPage: TQueryFnData,\n allPages: Array,\n lastPageParam: TPageParam,\n allPageParams: Array,\n) => TPageParam | undefined | null\n\nexport interface InfiniteData {\n pages: Array\n pageParams: Array\n}\n\nexport type QueryMeta = Register extends {\n queryMeta: infer TQueryMeta\n}\n ? TQueryMeta extends Record\n ? TQueryMeta\n : Record\n : Record\n\nexport type NetworkMode = 'online' | 'always' | 'offlineFirst'\n\nexport type NotifyOnChangeProps =\n | Array\n | 'all'\n | undefined\n | (() => Array | 'all' | undefined)\n\nexport interface QueryOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = never,\n> {\n /**\n * If `false`, failed queries will not retry by default.\n * If `true`, failed queries will retry infinitely., failureCount: num\n * If set to an integer number, e.g. 3, failed queries will retry until the failed query count meets that number.\n * If set to a function `(failureCount, error) => boolean` failed queries will retry until the function returns false.\n */\n retry?: RetryValue\n retryDelay?: RetryDelayValue\n networkMode?: NetworkMode\n /**\n * The time in milliseconds that unused/inactive cache data remains in memory.\n * When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration.\n * When different garbage collection times are specified, the longest one will be used.\n * Setting it to `Infinity` will disable garbage collection.\n */\n gcTime?: number\n queryFn?: QueryFunction | SkipToken\n persister?: QueryPersister<\n NoInfer,\n NoInfer,\n NoInfer\n >\n queryHash?: string\n queryKey?: TQueryKey\n queryKeyHashFn?: QueryKeyHashFunction\n initialData?: TData | InitialDataFunction\n initialDataUpdatedAt?: number | (() => number | undefined)\n behavior?: QueryBehavior\n /**\n * Set this to `false` to disable structural sharing between query results.\n * Set this to a function which accepts the old and new data and returns resolved data of the same type to implement custom structural sharing logic.\n * Defaults to `true`.\n */\n structuralSharing?:\n | boolean\n | ((oldData: unknown | undefined, newData: unknown) => unknown)\n _defaulted?: boolean\n /**\n * Additional payload to be stored on each query.\n * Use this property to pass information that can be used in other places.\n */\n meta?: QueryMeta\n /**\n * Maximum number of pages to store in the data of an infinite query.\n */\n maxPages?: number\n}\n\nexport interface InitialPageParam {\n initialPageParam: TPageParam\n}\n\nexport interface InfiniteQueryPageParamsOptions<\n TQueryFnData = unknown,\n TPageParam = unknown,\n> extends InitialPageParam {\n /**\n * This function can be set to automatically get the previous cursor for infinite queries.\n * The result will also be used to determine the value of `hasPreviousPage`.\n */\n getPreviousPageParam?: GetPreviousPageParamFunction\n /**\n * This function can be set to automatically get the next cursor for infinite queries.\n * The result will also be used to determine the value of `hasNextPage`.\n */\n getNextPageParam: GetNextPageParamFunction\n}\n\nexport type ThrowOnError<\n TQueryFnData,\n TError,\n TQueryData,\n TQueryKey extends QueryKey,\n> =\n | boolean\n | ((\n error: TError,\n query: Query,\n ) => boolean)\n\nexport interface QueryObserverOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = never,\n> extends WithRequired<\n QueryOptions,\n 'queryKey'\n> {\n /**\n * Set this to `false` or a function that returns `false` to disable automatic refetching when the query mounts or changes query keys.\n * To refetch the query, use the `refetch` method returned from the `useQuery` instance.\n * Accepts a boolean or function that returns a boolean.\n * Defaults to `true`.\n */\n enabled?: Enabled\n /**\n * The time in milliseconds after data is considered stale.\n * If set to `Infinity`, the data will never be considered stale.\n * If set to a function, the function will be executed with the query to compute a `staleTime`.\n * Defaults to `0`.\n */\n staleTime?: StaleTimeFunction\n /**\n * If set to a number, the query will continuously refetch at this frequency in milliseconds.\n * If set to a function, the function will be executed with the latest data and query to compute a frequency\n * Defaults to `false`.\n */\n refetchInterval?:\n | number\n | false\n | ((\n query: Query,\n ) => number | false | undefined)\n /**\n * If set to `true`, the query will continue to refetch while their tab/window is in the background.\n * Defaults to `false`.\n */\n refetchIntervalInBackground?: boolean\n /**\n * If set to `true`, the query will refetch on window focus if the data is stale.\n * If set to `false`, the query will not refetch on window focus.\n * If set to `'always'`, the query will always refetch on window focus.\n * If set to a function, the function will be executed with the latest data and query to compute the value.\n * Defaults to `true`.\n */\n refetchOnWindowFocus?:\n | boolean\n | 'always'\n | ((\n query: Query,\n ) => boolean | 'always')\n /**\n * If set to `true`, the query will refetch on reconnect if the data is stale.\n * If set to `false`, the query will not refetch on reconnect.\n * If set to `'always'`, the query will always refetch on reconnect.\n * If set to a function, the function will be executed with the latest data and query to compute the value.\n * Defaults to the value of `networkOnline` (`true`)\n */\n refetchOnReconnect?:\n | boolean\n | 'always'\n | ((\n query: Query,\n ) => boolean | 'always')\n /**\n * If set to `true`, the query will refetch on mount if the data is stale.\n * If set to `false`, will disable additional instances of a query to trigger background refetch.\n * If set to `'always'`, the query will always refetch on mount.\n * If set to a function, the function will be executed with the latest data and query to compute the value\n * Defaults to `true`.\n */\n refetchOnMount?:\n | boolean\n | 'always'\n | ((\n query: Query,\n ) => boolean | 'always')\n /**\n * If set to `false`, the query will not be retried on mount if it contains an error.\n * Defaults to `true`.\n */\n retryOnMount?: boolean\n /**\n * If set, the component will only re-render if any of the listed properties change.\n * When set to `['data', 'error']`, the component will only re-render when the `data` or `error` properties change.\n * When set to `'all'`, the component will re-render whenever a query is updated.\n * When set to a function, the function will be executed to compute the list of properties.\n * By default, access to properties will be tracked, and the component will only re-render when one of the tracked properties change.\n */\n notifyOnChangeProps?: NotifyOnChangeProps\n /**\n * Whether errors should be thrown instead of setting the `error` property.\n * If set to `true` or `suspense` is `true`, all errors will be thrown to the error boundary.\n * If set to `false` and `suspense` is `false`, errors are returned as state.\n * If set to a function, it will be passed the error and the query, and it should return a boolean indicating whether to show the error in an error boundary (`true`) or return the error as state (`false`).\n * Defaults to `false`.\n */\n throwOnError?: ThrowOnError\n /**\n * This option can be used to transform or select a part of the data returned by the query function.\n */\n select?: (data: TQueryData) => TData\n /**\n * If set to `true`, the query will suspend when `status === 'pending'`\n * and throw errors when `status === 'error'`.\n * Defaults to `false`.\n */\n suspense?: boolean\n /**\n * If set, this value will be used as the placeholder data for this particular query observer while the query is still in the `loading` data and no initialData has been provided.\n */\n placeholderData?:\n | NonFunctionGuard\n | PlaceholderDataFunction<\n NonFunctionGuard,\n TError,\n NonFunctionGuard,\n TQueryKey\n >\n\n _optimisticResults?: 'optimistic' | 'isRestoring'\n\n /**\n * Enable prefetching during rendering\n */\n experimental_prefetchInRender?: boolean\n}\n\nexport type WithRequired = TTarget & {\n [_ in TKey]: {}\n}\n\nexport type DefaultedQueryObserverOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> = WithRequired<\n QueryObserverOptions,\n 'throwOnError' | 'refetchOnReconnect' | 'queryHash'\n>\n\nexport interface InfiniteQueryObserverOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n>\n extends\n QueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n InfiniteData,\n TQueryKey,\n TPageParam\n >,\n InfiniteQueryPageParamsOptions {}\n\nexport type DefaultedInfiniteQueryObserverOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n> = WithRequired<\n InfiniteQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n 'throwOnError' | 'refetchOnReconnect' | 'queryHash'\n>\n\nexport interface FetchQueryOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = never,\n> extends WithRequired<\n QueryOptions,\n 'queryKey'\n> {\n initialPageParam?: never\n /**\n * The time in milliseconds after data is considered stale.\n * If the data is fresh it will be returned from the cache.\n */\n staleTime?: StaleTimeFunction\n}\n\nexport interface EnsureQueryDataOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = never,\n> extends FetchQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n> {\n revalidateIfStale?: boolean\n}\n\nexport type EnsureInfiniteQueryDataOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n> = FetchInfiniteQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n> & {\n revalidateIfStale?: boolean\n}\n\ntype FetchInfiniteQueryPages =\n | { pages?: never }\n | {\n pages: number\n getNextPageParam: GetNextPageParamFunction\n }\n\nexport type FetchInfiniteQueryOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n> = Omit<\n FetchQueryOptions<\n TQueryFnData,\n TError,\n InfiniteData,\n TQueryKey,\n TPageParam\n >,\n 'initialPageParam'\n> &\n InitialPageParam &\n FetchInfiniteQueryPages\n\nexport interface ResultOptions {\n throwOnError?: boolean\n}\n\nexport interface RefetchOptions extends ResultOptions {\n /**\n * If set to `true`, a currently running request will be cancelled before a new request is made\n *\n * If set to `false`, no refetch will be made if there is already a request running.\n *\n * Defaults to `true`.\n */\n cancelRefetch?: boolean\n}\n\nexport interface InvalidateQueryFilters<\n TQueryKey extends QueryKey = QueryKey,\n> extends QueryFilters {\n refetchType?: QueryTypeFilter | 'none'\n}\n\nexport interface RefetchQueryFilters<\n TQueryKey extends QueryKey = QueryKey,\n> extends QueryFilters {}\n\nexport interface InvalidateOptions extends RefetchOptions {}\nexport interface ResetOptions extends RefetchOptions {}\n\nexport interface FetchNextPageOptions extends ResultOptions {\n /**\n * If set to `true`, calling `fetchNextPage` repeatedly will invoke `queryFn` every time,\n * whether the previous invocation has resolved or not. Also, the result from previous invocations will be ignored.\n *\n * If set to `false`, calling `fetchNextPage` repeatedly won't have any effect until the first invocation has resolved.\n *\n * Defaults to `true`.\n */\n cancelRefetch?: boolean\n}\n\nexport interface FetchPreviousPageOptions extends ResultOptions {\n /**\n * If set to `true`, calling `fetchPreviousPage` repeatedly will invoke `queryFn` every time,\n * whether the previous invocation has resolved or not. Also, the result from previous invocations will be ignored.\n *\n * If set to `false`, calling `fetchPreviousPage` repeatedly won't have any effect until the first invocation has resolved.\n *\n * Defaults to `true`.\n */\n cancelRefetch?: boolean\n}\n\nexport type QueryStatus = 'pending' | 'error' | 'success'\nexport type FetchStatus = 'fetching' | 'paused' | 'idle'\n\nexport interface QueryObserverBaseResult<\n TData = unknown,\n TError = DefaultError,\n> {\n /**\n * The last successfully resolved data for the query.\n */\n data: TData | undefined\n /**\n * The timestamp for when the query most recently returned the `status` as `\"success\"`.\n */\n dataUpdatedAt: number\n /**\n * The error object for the query, if an error was thrown.\n * - Defaults to `null`.\n */\n error: TError | null\n /**\n * The timestamp for when the query most recently returned the `status` as `\"error\"`.\n */\n errorUpdatedAt: number\n /**\n * The failure count for the query.\n * - Incremented every time the query fails.\n * - Reset to `0` when the query succeeds.\n */\n failureCount: number\n /**\n * The failure reason for the query retry.\n * - Reset to `null` when the query succeeds.\n */\n failureReason: TError | null\n /**\n * The sum of all errors.\n */\n errorUpdateCount: number\n /**\n * A derived boolean from the `status` variable, provided for convenience.\n * - `true` if the query attempt resulted in an error.\n */\n isError: boolean\n /**\n * Will be `true` if the query has been fetched.\n */\n isFetched: boolean\n /**\n * Will be `true` if the query has been fetched after the component mounted.\n * - This property can be used to not show any previously cached data.\n */\n isFetchedAfterMount: boolean\n /**\n * A derived boolean from the `fetchStatus` variable, provided for convenience.\n * - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch.\n */\n isFetching: boolean\n /**\n * Is `true` whenever the first fetch for a query is in-flight.\n * - Is the same as `isFetching && isPending`.\n */\n isLoading: boolean\n /**\n * Will be `pending` if there's no cached data and no query attempt was finished yet.\n */\n isPending: boolean\n /**\n * Will be `true` if the query failed while fetching for the first time.\n */\n isLoadingError: boolean\n /**\n * @deprecated `isInitialLoading` is being deprecated in favor of `isLoading`\n * and will be removed in the next major version.\n */\n isInitialLoading: boolean\n /**\n * A derived boolean from the `fetchStatus` variable, provided for convenience.\n * - The query wanted to fetch, but has been `paused`.\n */\n isPaused: boolean\n /**\n * Will be `true` if the data shown is the placeholder data.\n */\n isPlaceholderData: boolean\n /**\n * Will be `true` if the query failed while refetching.\n */\n isRefetchError: boolean\n /**\n * Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`.\n * - Is the same as `isFetching && !isPending`.\n */\n isRefetching: boolean\n /**\n * Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`.\n */\n isStale: boolean\n /**\n * A derived boolean from the `status` variable, provided for convenience.\n * - `true` if the query has received a response with no errors and is ready to display its data.\n */\n isSuccess: boolean\n /**\n * `true` if this observer is enabled, `false` otherwise.\n */\n isEnabled: boolean\n /**\n * A function to manually refetch the query.\n */\n refetch: (\n options?: RefetchOptions,\n ) => Promise>\n /**\n * The status of the query.\n * - Will be:\n * - `pending` if there's no cached data and no query attempt was finished yet.\n * - `error` if the query attempt resulted in an error.\n * - `success` if the query has received a response with no errors and is ready to display its data.\n */\n status: QueryStatus\n /**\n * The fetch status of the query.\n * - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch.\n * - `paused`: The query wanted to fetch, but has been `paused`.\n * - `idle`: The query is not fetching.\n * - See [Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information.\n */\n fetchStatus: FetchStatus\n /**\n * A stable promise that will be resolved with the data of the query.\n * Requires the `experimental_prefetchInRender` feature flag to be enabled.\n * @example\n *\n * ### Enabling the feature flag\n * ```ts\n * const client = new QueryClient({\n * defaultOptions: {\n * queries: {\n * experimental_prefetchInRender: true,\n * },\n * },\n * })\n * ```\n *\n * ### Usage\n * ```tsx\n * import { useQuery } from '@tanstack/react-query'\n * import React from 'react'\n * import { fetchTodos, type Todo } from './api'\n *\n * function TodoList({ query }: { query: UseQueryResult }) {\n * const data = React.use(query.promise)\n *\n * return (\n *
    \n * {data.map(todo => (\n *
  • {todo.title}
  • \n * ))}\n *
\n * )\n * }\n *\n * export function App() {\n * const query = useQuery({ queryKey: ['todos'], queryFn: fetchTodos })\n *\n * return (\n * <>\n *

Todos

\n * Loading...}>\n * \n * \n * \n * )\n * }\n * ```\n */\n promise: Promise\n}\n\nexport interface QueryObserverPendingResult<\n TData = unknown,\n TError = DefaultError,\n> extends QueryObserverBaseResult {\n data: undefined\n error: null\n isError: false\n isPending: true\n isLoadingError: false\n isRefetchError: false\n isSuccess: false\n isPlaceholderData: false\n status: 'pending'\n}\n\nexport interface QueryObserverLoadingResult<\n TData = unknown,\n TError = DefaultError,\n> extends QueryObserverBaseResult {\n data: undefined\n error: null\n isError: false\n isPending: true\n isLoading: true\n isLoadingError: false\n isRefetchError: false\n isSuccess: false\n isPlaceholderData: false\n status: 'pending'\n}\n\nexport interface QueryObserverLoadingErrorResult<\n TData = unknown,\n TError = DefaultError,\n> extends QueryObserverBaseResult {\n data: undefined\n error: TError\n isError: true\n isPending: false\n isLoading: false\n isLoadingError: true\n isRefetchError: false\n isSuccess: false\n isPlaceholderData: false\n status: 'error'\n}\n\nexport interface QueryObserverRefetchErrorResult<\n TData = unknown,\n TError = DefaultError,\n> extends QueryObserverBaseResult {\n data: TData\n error: TError\n isError: true\n isPending: false\n isLoading: false\n isLoadingError: false\n isRefetchError: true\n isSuccess: false\n isPlaceholderData: false\n status: 'error'\n}\n\nexport interface QueryObserverSuccessResult<\n TData = unknown,\n TError = DefaultError,\n> extends QueryObserverBaseResult {\n data: TData\n error: null\n isError: false\n isPending: false\n isLoading: false\n isLoadingError: false\n isRefetchError: false\n isSuccess: true\n isPlaceholderData: false\n status: 'success'\n}\n\nexport interface QueryObserverPlaceholderResult<\n TData = unknown,\n TError = DefaultError,\n> extends QueryObserverBaseResult {\n data: TData\n isError: false\n error: null\n isPending: false\n isLoading: false\n isLoadingError: false\n isRefetchError: false\n isSuccess: true\n isPlaceholderData: true\n status: 'success'\n}\n\nexport type DefinedQueryObserverResult<\n TData = unknown,\n TError = DefaultError,\n> =\n | QueryObserverRefetchErrorResult\n | QueryObserverSuccessResult\n\nexport type QueryObserverResult =\n | DefinedQueryObserverResult\n | QueryObserverLoadingErrorResult\n | QueryObserverLoadingResult\n | QueryObserverPendingResult\n | QueryObserverPlaceholderResult\n\nexport interface InfiniteQueryObserverBaseResult<\n TData = unknown,\n TError = DefaultError,\n> extends QueryObserverBaseResult {\n /**\n * This function allows you to fetch the next \"page\" of results.\n */\n fetchNextPage: (\n options?: FetchNextPageOptions,\n ) => Promise>\n /**\n * This function allows you to fetch the previous \"page\" of results.\n */\n fetchPreviousPage: (\n options?: FetchPreviousPageOptions,\n ) => Promise>\n /**\n * Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option).\n */\n hasNextPage: boolean\n /**\n * Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option).\n */\n hasPreviousPage: boolean\n /**\n * Will be `true` if the query failed while fetching the next page.\n */\n isFetchNextPageError: boolean\n /**\n * Will be `true` while fetching the next page with `fetchNextPage`.\n */\n isFetchingNextPage: boolean\n /**\n * Will be `true` if the query failed while fetching the previous page.\n */\n isFetchPreviousPageError: boolean\n /**\n * Will be `true` while fetching the previous page with `fetchPreviousPage`.\n */\n isFetchingPreviousPage: boolean\n}\n\nexport interface InfiniteQueryObserverPendingResult<\n TData = unknown,\n TError = DefaultError,\n> extends InfiniteQueryObserverBaseResult {\n data: undefined\n error: null\n isError: false\n isPending: true\n isLoadingError: false\n isRefetchError: false\n isFetchNextPageError: false\n isFetchPreviousPageError: false\n isSuccess: false\n isPlaceholderData: false\n status: 'pending'\n}\n\nexport interface InfiniteQueryObserverLoadingResult<\n TData = unknown,\n TError = DefaultError,\n> extends InfiniteQueryObserverBaseResult {\n data: undefined\n error: null\n isError: false\n isPending: true\n isLoading: true\n isLoadingError: false\n isRefetchError: false\n isFetchNextPageError: false\n isFetchPreviousPageError: false\n isSuccess: false\n isPlaceholderData: false\n status: 'pending'\n}\n\nexport interface InfiniteQueryObserverLoadingErrorResult<\n TData = unknown,\n TError = DefaultError,\n> extends InfiniteQueryObserverBaseResult {\n data: undefined\n error: TError\n isError: true\n isPending: false\n isLoading: false\n isLoadingError: true\n isRefetchError: false\n isFetchNextPageError: false\n isFetchPreviousPageError: false\n isSuccess: false\n isPlaceholderData: false\n status: 'error'\n}\n\nexport interface InfiniteQueryObserverRefetchErrorResult<\n TData = unknown,\n TError = DefaultError,\n> extends InfiniteQueryObserverBaseResult {\n data: TData\n error: TError\n isError: true\n isPending: false\n isLoading: false\n isLoadingError: false\n isRefetchError: true\n isSuccess: false\n isPlaceholderData: false\n status: 'error'\n}\n\nexport interface InfiniteQueryObserverSuccessResult<\n TData = unknown,\n TError = DefaultError,\n> extends InfiniteQueryObserverBaseResult {\n data: TData\n error: null\n isError: false\n isPending: false\n isLoading: false\n isLoadingError: false\n isRefetchError: false\n isFetchNextPageError: false\n isFetchPreviousPageError: false\n isSuccess: true\n isPlaceholderData: false\n status: 'success'\n}\n\nexport interface InfiniteQueryObserverPlaceholderResult<\n TData = unknown,\n TError = DefaultError,\n> extends InfiniteQueryObserverBaseResult {\n data: TData\n isError: false\n error: null\n isPending: false\n isLoading: false\n isLoadingError: false\n isRefetchError: false\n isSuccess: true\n isPlaceholderData: true\n isFetchNextPageError: false\n isFetchPreviousPageError: false\n status: 'success'\n}\n\nexport type DefinedInfiniteQueryObserverResult<\n TData = unknown,\n TError = DefaultError,\n> =\n | InfiniteQueryObserverRefetchErrorResult\n | InfiniteQueryObserverSuccessResult\n\nexport type InfiniteQueryObserverResult<\n TData = unknown,\n TError = DefaultError,\n> =\n | DefinedInfiniteQueryObserverResult\n | InfiniteQueryObserverLoadingErrorResult\n | InfiniteQueryObserverLoadingResult\n | InfiniteQueryObserverPendingResult\n | InfiniteQueryObserverPlaceholderResult\n\nexport type MutationKey = Register extends {\n mutationKey: infer TMutationKey\n}\n ? TMutationKey extends ReadonlyArray\n ? TMutationKey\n : TMutationKey extends Array\n ? TMutationKey\n : ReadonlyArray\n : ReadonlyArray\n\nexport type MutationStatus = 'idle' | 'pending' | 'success' | 'error'\n\nexport type MutationScope = {\n id: string\n}\n\nexport type MutationMeta = Register extends {\n mutationMeta: infer TMutationMeta\n}\n ? TMutationMeta extends Record\n ? TMutationMeta\n : Record\n : Record\n\nexport type MutationFunctionContext = {\n client: QueryClient\n meta: MutationMeta | undefined\n mutationKey?: MutationKey\n}\n\nexport type MutationFunction = (\n variables: TVariables,\n context: MutationFunctionContext,\n) => Promise\n\nexport interface MutationOptions<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n> {\n mutationFn?: MutationFunction\n mutationKey?: MutationKey\n onMutate?: (\n variables: TVariables,\n context: MutationFunctionContext,\n ) => Promise | TOnMutateResult\n onSuccess?: (\n data: TData,\n variables: TVariables,\n onMutateResult: TOnMutateResult,\n context: MutationFunctionContext,\n ) => Promise | unknown\n onError?: (\n error: TError,\n variables: TVariables,\n onMutateResult: TOnMutateResult | undefined,\n context: MutationFunctionContext,\n ) => Promise | unknown\n onSettled?: (\n data: TData | undefined,\n error: TError | null,\n variables: TVariables,\n onMutateResult: TOnMutateResult | undefined,\n context: MutationFunctionContext,\n ) => Promise | unknown\n retry?: RetryValue\n retryDelay?: RetryDelayValue\n networkMode?: NetworkMode\n gcTime?: number\n _defaulted?: boolean\n meta?: MutationMeta\n scope?: MutationScope\n}\n\nexport interface MutationObserverOptions<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n> extends MutationOptions {\n throwOnError?: boolean | ((error: TError) => boolean)\n}\n\nexport interface MutateOptions<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n> {\n onSuccess?: (\n data: TData,\n variables: TVariables,\n onMutateResult: TOnMutateResult | undefined,\n context: MutationFunctionContext,\n ) => void\n onError?: (\n error: TError,\n variables: TVariables,\n onMutateResult: TOnMutateResult | undefined,\n context: MutationFunctionContext,\n ) => void\n onSettled?: (\n data: TData | undefined,\n error: TError | null,\n variables: TVariables,\n onMutateResult: TOnMutateResult | undefined,\n context: MutationFunctionContext,\n ) => void\n}\n\nexport type MutateFunction<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n> = (\n variables: TVariables,\n options?: MutateOptions,\n) => Promise\n\nexport interface MutationObserverBaseResult<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n> extends MutationState {\n /**\n * The last successfully resolved data for the mutation.\n */\n data: TData | undefined\n /**\n * The variables object passed to the `mutationFn`.\n */\n variables: TVariables | undefined\n /**\n * The error object for the mutation, if an error was encountered.\n * - Defaults to `null`.\n */\n error: TError | null\n /**\n * A boolean variable derived from `status`.\n * - `true` if the last mutation attempt resulted in an error.\n */\n isError: boolean\n /**\n * A boolean variable derived from `status`.\n * - `true` if the mutation is in its initial state prior to executing.\n */\n isIdle: boolean\n /**\n * A boolean variable derived from `status`.\n * - `true` if the mutation is currently executing.\n */\n isPending: boolean\n /**\n * A boolean variable derived from `status`.\n * - `true` if the last mutation attempt was successful.\n */\n isSuccess: boolean\n /**\n * The status of the mutation.\n * - Will be:\n * - `idle` initial status prior to the mutation function executing.\n * - `pending` if the mutation is currently executing.\n * - `error` if the last mutation attempt resulted in an error.\n * - `success` if the last mutation attempt was successful.\n */\n status: MutationStatus\n /**\n * The mutation function you can call with variables to trigger the mutation and optionally hooks on additional callback options.\n * @param variables - The variables object to pass to the `mutationFn`.\n * @param options.onSuccess - This function will fire when the mutation is successful and will be passed the mutation's result.\n * @param options.onError - This function will fire if the mutation encounters an error and will be passed the error.\n * @param options.onSettled - This function will fire when the mutation is either successfully fetched or encounters an error and be passed either the data or error.\n * @remarks\n * - If you make multiple requests, `onSuccess` will fire only after the latest call you've made.\n * - All the callback functions (`onSuccess`, `onError`, `onSettled`) are void functions, and the returned value will be ignored.\n */\n mutate: MutateFunction\n /**\n * A function to clean the mutation internal state (i.e., it resets the mutation to its initial state).\n */\n reset: () => void\n}\n\nexport interface MutationObserverIdleResult<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n> extends MutationObserverBaseResult<\n TData,\n TError,\n TVariables,\n TOnMutateResult\n> {\n data: undefined\n variables: undefined\n error: null\n isError: false\n isIdle: true\n isPending: false\n isSuccess: false\n status: 'idle'\n}\n\nexport interface MutationObserverLoadingResult<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n> extends MutationObserverBaseResult<\n TData,\n TError,\n TVariables,\n TOnMutateResult\n> {\n data: undefined\n variables: TVariables\n error: null\n isError: false\n isIdle: false\n isPending: true\n isSuccess: false\n status: 'pending'\n}\n\nexport interface MutationObserverErrorResult<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n> extends MutationObserverBaseResult<\n TData,\n TError,\n TVariables,\n TOnMutateResult\n> {\n data: undefined\n error: TError\n variables: TVariables\n isError: true\n isIdle: false\n isPending: false\n isSuccess: false\n status: 'error'\n}\n\nexport interface MutationObserverSuccessResult<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n> extends MutationObserverBaseResult<\n TData,\n TError,\n TVariables,\n TOnMutateResult\n> {\n data: TData\n error: null\n variables: TVariables\n isError: false\n isIdle: false\n isPending: false\n isSuccess: true\n status: 'success'\n}\n\nexport type MutationObserverResult<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n> =\n | MutationObserverIdleResult\n | MutationObserverLoadingResult\n | MutationObserverErrorResult\n | MutationObserverSuccessResult\n\nexport interface QueryClientConfig {\n queryCache?: QueryCache\n mutationCache?: MutationCache\n defaultOptions?: DefaultOptions\n}\n\nexport interface DefaultOptions {\n queries?: OmitKeyof<\n QueryObserverOptions,\n 'suspense' | 'queryKey'\n >\n mutations?: MutationObserverOptions\n hydrate?: HydrateOptions['defaultOptions']\n dehydrate?: DehydrateOptions\n}\n\nexport interface CancelOptions {\n revert?: boolean\n silent?: boolean\n}\n\nexport interface SetDataOptions {\n updatedAt?: number\n}\n\nexport type NotifyEventType =\n | 'added'\n | 'removed'\n | 'updated'\n | 'observerAdded'\n | 'observerRemoved'\n | 'observerResultsUpdated'\n | 'observerOptionsUpdated'\n\nexport interface NotifyEvent {\n type: NotifyEventType\n}\n"],"mappings":";AA8DO,IAAM,gBAAgB,uBAAO,eAAe;AAE5C,IAAM,qBAAqB,uBAAO,oBAAoB;AAEtD,IAAM,cAAc,uBAAO,aAAa;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/utils.cjs b/node_modules/@tanstack/query-core/build/modern/utils.cjs new file mode 100644 index 0000000..495c37e --- /dev/null +++ b/node_modules/@tanstack/query-core/build/modern/utils.cjs @@ -0,0 +1,330 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/utils.ts +var utils_exports = {}; +__export(utils_exports, { + addConsumeAwareSignal: () => addConsumeAwareSignal, + addToEnd: () => addToEnd, + addToStart: () => addToStart, + ensureQueryFn: () => ensureQueryFn, + functionalUpdate: () => functionalUpdate, + hashKey: () => hashKey, + hashQueryKeyByOptions: () => hashQueryKeyByOptions, + isPlainArray: () => isPlainArray, + isPlainObject: () => isPlainObject, + isServer: () => isServer, + isValidTimeout: () => isValidTimeout, + keepPreviousData: () => keepPreviousData, + matchMutation: () => matchMutation, + matchQuery: () => matchQuery, + noop: () => noop, + partialMatchKey: () => partialMatchKey, + replaceData: () => replaceData, + replaceEqualDeep: () => replaceEqualDeep, + resolveEnabled: () => resolveEnabled, + resolveStaleTime: () => resolveStaleTime, + shallowEqualObjects: () => shallowEqualObjects, + shouldThrowError: () => shouldThrowError, + skipToken: () => skipToken, + sleep: () => sleep, + timeUntilStale: () => timeUntilStale +}); +module.exports = __toCommonJS(utils_exports); +var import_timeoutManager = require("./timeoutManager.cjs"); +var isServer = typeof window === "undefined" || "Deno" in globalThis; +function noop() { +} +function functionalUpdate(updater, input) { + return typeof updater === "function" ? updater(input) : updater; +} +function isValidTimeout(value) { + return typeof value === "number" && value >= 0 && value !== Infinity; +} +function timeUntilStale(updatedAt, staleTime) { + return Math.max(updatedAt + (staleTime || 0) - Date.now(), 0); +} +function resolveStaleTime(staleTime, query) { + return typeof staleTime === "function" ? staleTime(query) : staleTime; +} +function resolveEnabled(enabled, query) { + return typeof enabled === "function" ? enabled(query) : enabled; +} +function matchQuery(filters, query) { + const { + type = "all", + exact, + fetchStatus, + predicate, + queryKey, + stale + } = filters; + if (queryKey) { + if (exact) { + if (query.queryHash !== hashQueryKeyByOptions(queryKey, query.options)) { + return false; + } + } else if (!partialMatchKey(query.queryKey, queryKey)) { + return false; + } + } + if (type !== "all") { + const isActive = query.isActive(); + if (type === "active" && !isActive) { + return false; + } + if (type === "inactive" && isActive) { + return false; + } + } + if (typeof stale === "boolean" && query.isStale() !== stale) { + return false; + } + if (fetchStatus && fetchStatus !== query.state.fetchStatus) { + return false; + } + if (predicate && !predicate(query)) { + return false; + } + return true; +} +function matchMutation(filters, mutation) { + const { exact, status, predicate, mutationKey } = filters; + if (mutationKey) { + if (!mutation.options.mutationKey) { + return false; + } + if (exact) { + if (hashKey(mutation.options.mutationKey) !== hashKey(mutationKey)) { + return false; + } + } else if (!partialMatchKey(mutation.options.mutationKey, mutationKey)) { + return false; + } + } + if (status && mutation.state.status !== status) { + return false; + } + if (predicate && !predicate(mutation)) { + return false; + } + return true; +} +function hashQueryKeyByOptions(queryKey, options) { + const hashFn = options?.queryKeyHashFn || hashKey; + return hashFn(queryKey); +} +function hashKey(queryKey) { + return JSON.stringify( + queryKey, + (_, val) => isPlainObject(val) ? Object.keys(val).sort().reduce((result, key) => { + result[key] = val[key]; + return result; + }, {}) : val + ); +} +function partialMatchKey(a, b) { + if (a === b) { + return true; + } + if (typeof a !== typeof b) { + return false; + } + if (a && b && typeof a === "object" && typeof b === "object") { + return Object.keys(b).every((key) => partialMatchKey(a[key], b[key])); + } + return false; +} +var hasOwn = Object.prototype.hasOwnProperty; +function replaceEqualDeep(a, b, depth = 0) { + if (a === b) { + return a; + } + if (depth > 500) return b; + const array = isPlainArray(a) && isPlainArray(b); + if (!array && !(isPlainObject(a) && isPlainObject(b))) return b; + const aItems = array ? a : Object.keys(a); + const aSize = aItems.length; + const bItems = array ? b : Object.keys(b); + const bSize = bItems.length; + const copy = array ? new Array(bSize) : {}; + let equalItems = 0; + for (let i = 0; i < bSize; i++) { + const key = array ? i : bItems[i]; + const aItem = a[key]; + const bItem = b[key]; + if (aItem === bItem) { + copy[key] = aItem; + if (array ? i < aSize : hasOwn.call(a, key)) equalItems++; + continue; + } + if (aItem === null || bItem === null || typeof aItem !== "object" || typeof bItem !== "object") { + copy[key] = bItem; + continue; + } + const v = replaceEqualDeep(aItem, bItem, depth + 1); + copy[key] = v; + if (v === aItem) equalItems++; + } + return aSize === bSize && equalItems === aSize ? a : copy; +} +function shallowEqualObjects(a, b) { + if (!b || Object.keys(a).length !== Object.keys(b).length) { + return false; + } + for (const key in a) { + if (a[key] !== b[key]) { + return false; + } + } + return true; +} +function isPlainArray(value) { + return Array.isArray(value) && value.length === Object.keys(value).length; +} +function isPlainObject(o) { + if (!hasObjectPrototype(o)) { + return false; + } + const ctor = o.constructor; + if (ctor === void 0) { + return true; + } + const prot = ctor.prototype; + if (!hasObjectPrototype(prot)) { + return false; + } + if (!prot.hasOwnProperty("isPrototypeOf")) { + return false; + } + if (Object.getPrototypeOf(o) !== Object.prototype) { + return false; + } + return true; +} +function hasObjectPrototype(o) { + return Object.prototype.toString.call(o) === "[object Object]"; +} +function sleep(timeout) { + return new Promise((resolve) => { + import_timeoutManager.timeoutManager.setTimeout(resolve, timeout); + }); +} +function replaceData(prevData, data, options) { + if (typeof options.structuralSharing === "function") { + return options.structuralSharing(prevData, data); + } else if (options.structuralSharing !== false) { + if (process.env.NODE_ENV !== "production") { + try { + return replaceEqualDeep(prevData, data); + } catch (error) { + console.error( + `Structural sharing requires data to be JSON serializable. To fix this, turn off structuralSharing or return JSON-serializable data from your queryFn. [${options.queryHash}]: ${error}` + ); + throw error; + } + } + return replaceEqualDeep(prevData, data); + } + return data; +} +function keepPreviousData(previousData) { + return previousData; +} +function addToEnd(items, item, max = 0) { + const newItems = [...items, item]; + return max && newItems.length > max ? newItems.slice(1) : newItems; +} +function addToStart(items, item, max = 0) { + const newItems = [item, ...items]; + return max && newItems.length > max ? newItems.slice(0, -1) : newItems; +} +var skipToken = /* @__PURE__ */ Symbol(); +function ensureQueryFn(options, fetchOptions) { + if (process.env.NODE_ENV !== "production") { + if (options.queryFn === skipToken) { + console.error( + `Attempted to invoke queryFn when set to skipToken. This is likely a configuration error. Query hash: '${options.queryHash}'` + ); + } + } + if (!options.queryFn && fetchOptions?.initialPromise) { + return () => fetchOptions.initialPromise; + } + if (!options.queryFn || options.queryFn === skipToken) { + return () => Promise.reject(new Error(`Missing queryFn: '${options.queryHash}'`)); + } + return options.queryFn; +} +function shouldThrowError(throwOnError, params) { + if (typeof throwOnError === "function") { + return throwOnError(...params); + } + return !!throwOnError; +} +function addConsumeAwareSignal(object, getSignal, onCancelled) { + let consumed = false; + let signal; + Object.defineProperty(object, "signal", { + enumerable: true, + get: () => { + signal ??= getSignal(); + if (consumed) { + return signal; + } + consumed = true; + if (signal.aborted) { + onCancelled(); + } else { + signal.addEventListener("abort", onCancelled, { once: true }); + } + return signal; + } + }); + return object; +} +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + addConsumeAwareSignal, + addToEnd, + addToStart, + ensureQueryFn, + functionalUpdate, + hashKey, + hashQueryKeyByOptions, + isPlainArray, + isPlainObject, + isServer, + isValidTimeout, + keepPreviousData, + matchMutation, + matchQuery, + noop, + partialMatchKey, + replaceData, + replaceEqualDeep, + resolveEnabled, + resolveStaleTime, + shallowEqualObjects, + shouldThrowError, + skipToken, + sleep, + timeUntilStale +}); +//# sourceMappingURL=utils.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/utils.cjs.map b/node_modules/@tanstack/query-core/build/modern/utils.cjs.map new file mode 100644 index 0000000..3be5114 --- /dev/null +++ b/node_modules/@tanstack/query-core/build/modern/utils.cjs.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/utils.ts"],"sourcesContent":["import { timeoutManager } from './timeoutManager'\nimport type {\n DefaultError,\n Enabled,\n FetchStatus,\n MutationKey,\n MutationStatus,\n QueryFunction,\n QueryKey,\n QueryOptions,\n StaleTime,\n StaleTimeFunction,\n} from './types'\nimport type { Mutation } from './mutation'\nimport type { FetchOptions, Query } from './query'\n\n// TYPES\n\ntype DropLast> = T extends readonly [\n ...infer R,\n unknown,\n]\n ? readonly [...R]\n : never\n\ntype TuplePrefixes> = T extends readonly []\n ? readonly []\n : TuplePrefixes> | T\n\nexport interface QueryFilters {\n /**\n * Filter to active queries, inactive queries or all queries\n */\n type?: QueryTypeFilter\n /**\n * Match query key exactly\n */\n exact?: boolean\n /**\n * Include queries matching this predicate function\n */\n predicate?: (query: Query) => boolean\n /**\n * Include queries matching this query key\n */\n queryKey?: TQueryKey | TuplePrefixes\n /**\n * Include or exclude stale queries\n */\n stale?: boolean\n /**\n * Include queries matching their fetchStatus\n */\n fetchStatus?: FetchStatus\n}\n\nexport interface MutationFilters<\n TData = unknown,\n TError = DefaultError,\n TVariables = unknown,\n TOnMutateResult = unknown,\n> {\n /**\n * Match mutation key exactly\n */\n exact?: boolean\n /**\n * Include mutations matching this predicate function\n */\n predicate?: (\n mutation: Mutation,\n ) => boolean\n /**\n * Include mutations matching this mutation key\n */\n mutationKey?: TuplePrefixes\n /**\n * Filter by mutation status\n */\n status?: MutationStatus\n}\n\nexport type Updater = TOutput | ((input: TInput) => TOutput)\n\nexport type QueryTypeFilter = 'all' | 'active' | 'inactive'\n\n// UTILS\n\nexport const isServer = typeof window === 'undefined' || 'Deno' in globalThis\n\nexport function noop(): void\nexport function noop(): undefined\nexport function noop() {}\n\nexport function functionalUpdate(\n updater: Updater,\n input: TInput,\n): TOutput {\n return typeof updater === 'function'\n ? (updater as (_: TInput) => TOutput)(input)\n : updater\n}\n\nexport function isValidTimeout(value: unknown): value is number {\n return typeof value === 'number' && value >= 0 && value !== Infinity\n}\n\nexport function timeUntilStale(updatedAt: number, staleTime?: number): number {\n return Math.max(updatedAt + (staleTime || 0) - Date.now(), 0)\n}\n\nexport function resolveStaleTime<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n staleTime:\n | undefined\n | StaleTimeFunction,\n query: Query,\n): StaleTime | undefined {\n return typeof staleTime === 'function' ? staleTime(query) : staleTime\n}\n\nexport function resolveEnabled<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n enabled: undefined | Enabled,\n query: Query,\n): boolean | undefined {\n return typeof enabled === 'function' ? enabled(query) : enabled\n}\n\nexport function matchQuery(\n filters: QueryFilters,\n query: Query,\n): boolean {\n const {\n type = 'all',\n exact,\n fetchStatus,\n predicate,\n queryKey,\n stale,\n } = filters\n\n if (queryKey) {\n if (exact) {\n if (query.queryHash !== hashQueryKeyByOptions(queryKey, query.options)) {\n return false\n }\n } else if (!partialMatchKey(query.queryKey, queryKey)) {\n return false\n }\n }\n\n if (type !== 'all') {\n const isActive = query.isActive()\n if (type === 'active' && !isActive) {\n return false\n }\n if (type === 'inactive' && isActive) {\n return false\n }\n }\n\n if (typeof stale === 'boolean' && query.isStale() !== stale) {\n return false\n }\n\n if (fetchStatus && fetchStatus !== query.state.fetchStatus) {\n return false\n }\n\n if (predicate && !predicate(query)) {\n return false\n }\n\n return true\n}\n\nexport function matchMutation(\n filters: MutationFilters,\n mutation: Mutation,\n): boolean {\n const { exact, status, predicate, mutationKey } = filters\n if (mutationKey) {\n if (!mutation.options.mutationKey) {\n return false\n }\n if (exact) {\n if (hashKey(mutation.options.mutationKey) !== hashKey(mutationKey)) {\n return false\n }\n } else if (!partialMatchKey(mutation.options.mutationKey, mutationKey)) {\n return false\n }\n }\n\n if (status && mutation.state.status !== status) {\n return false\n }\n\n if (predicate && !predicate(mutation)) {\n return false\n }\n\n return true\n}\n\nexport function hashQueryKeyByOptions(\n queryKey: TQueryKey,\n options?: Pick, 'queryKeyHashFn'>,\n): string {\n const hashFn = options?.queryKeyHashFn || hashKey\n return hashFn(queryKey)\n}\n\n/**\n * Default query & mutation keys hash function.\n * Hashes the value into a stable hash.\n */\nexport function hashKey(queryKey: QueryKey | MutationKey): string {\n return JSON.stringify(queryKey, (_, val) =>\n isPlainObject(val)\n ? Object.keys(val)\n .sort()\n .reduce((result, key) => {\n result[key] = val[key]\n return result\n }, {} as any)\n : val,\n )\n}\n\n/**\n * Checks if key `b` partially matches with key `a`.\n */\nexport function partialMatchKey(a: QueryKey, b: QueryKey): boolean\nexport function partialMatchKey(a: any, b: any): boolean {\n if (a === b) {\n return true\n }\n\n if (typeof a !== typeof b) {\n return false\n }\n\n if (a && b && typeof a === 'object' && typeof b === 'object') {\n return Object.keys(b).every((key) => partialMatchKey(a[key], b[key]))\n }\n\n return false\n}\n\nconst hasOwn = Object.prototype.hasOwnProperty\n\n/**\n * This function returns `a` if `b` is deeply equal.\n * If not, it will replace any deeply equal children of `b` with those of `a`.\n * This can be used for structural sharing between JSON values for example.\n */\nexport function replaceEqualDeep(a: unknown, b: T, depth?: number): T\nexport function replaceEqualDeep(a: any, b: any, depth = 0): any {\n if (a === b) {\n return a\n }\n\n if (depth > 500) return b\n\n const array = isPlainArray(a) && isPlainArray(b)\n\n if (!array && !(isPlainObject(a) && isPlainObject(b))) return b\n\n const aItems = array ? a : Object.keys(a)\n const aSize = aItems.length\n const bItems = array ? b : Object.keys(b)\n const bSize = bItems.length\n const copy: any = array ? new Array(bSize) : {}\n\n let equalItems = 0\n\n for (let i = 0; i < bSize; i++) {\n const key: any = array ? i : bItems[i]\n const aItem = a[key]\n const bItem = b[key]\n\n if (aItem === bItem) {\n copy[key] = aItem\n if (array ? i < aSize : hasOwn.call(a, key)) equalItems++\n continue\n }\n\n if (\n aItem === null ||\n bItem === null ||\n typeof aItem !== 'object' ||\n typeof bItem !== 'object'\n ) {\n copy[key] = bItem\n continue\n }\n\n const v = replaceEqualDeep(aItem, bItem, depth + 1)\n copy[key] = v\n if (v === aItem) equalItems++\n }\n\n return aSize === bSize && equalItems === aSize ? a : copy\n}\n\n/**\n * Shallow compare objects.\n */\nexport function shallowEqualObjects>(\n a: T,\n b: T | undefined,\n): boolean {\n if (!b || Object.keys(a).length !== Object.keys(b).length) {\n return false\n }\n\n for (const key in a) {\n if (a[key] !== b[key]) {\n return false\n }\n }\n\n return true\n}\n\nexport function isPlainArray(value: unknown): value is Array {\n return Array.isArray(value) && value.length === Object.keys(value).length\n}\n\n// Copied from: https://github.com/jonschlinkert/is-plain-object\nexport function isPlainObject(o: any): o is Record {\n if (!hasObjectPrototype(o)) {\n return false\n }\n\n // If has no constructor\n const ctor = o.constructor\n if (ctor === undefined) {\n return true\n }\n\n // If has modified prototype\n const prot = ctor.prototype\n if (!hasObjectPrototype(prot)) {\n return false\n }\n\n // If constructor does not have an Object-specific method\n if (!prot.hasOwnProperty('isPrototypeOf')) {\n return false\n }\n\n // Handles Objects created by Object.create()\n if (Object.getPrototypeOf(o) !== Object.prototype) {\n return false\n }\n\n // Most likely a plain Object\n return true\n}\n\nfunction hasObjectPrototype(o: any): boolean {\n return Object.prototype.toString.call(o) === '[object Object]'\n}\n\nexport function sleep(timeout: number): Promise {\n return new Promise((resolve) => {\n timeoutManager.setTimeout(resolve, timeout)\n })\n}\n\nexport function replaceData<\n TData,\n TOptions extends QueryOptions,\n>(prevData: TData | undefined, data: TData, options: TOptions): TData {\n if (typeof options.structuralSharing === 'function') {\n return options.structuralSharing(prevData, data) as TData\n } else if (options.structuralSharing !== false) {\n if (process.env.NODE_ENV !== 'production') {\n try {\n return replaceEqualDeep(prevData, data)\n } catch (error) {\n console.error(\n `Structural sharing requires data to be JSON serializable. To fix this, turn off structuralSharing or return JSON-serializable data from your queryFn. [${options.queryHash}]: ${error}`,\n )\n\n // Prevent the replaceEqualDeep from being called again down below.\n throw error\n }\n }\n // Structurally share data between prev and new data if needed\n return replaceEqualDeep(prevData, data)\n }\n return data\n}\n\nexport function keepPreviousData(\n previousData: T | undefined,\n): T | undefined {\n return previousData\n}\n\nexport function addToEnd(items: Array, item: T, max = 0): Array {\n const newItems = [...items, item]\n return max && newItems.length > max ? newItems.slice(1) : newItems\n}\n\nexport function addToStart(items: Array, item: T, max = 0): Array {\n const newItems = [item, ...items]\n return max && newItems.length > max ? newItems.slice(0, -1) : newItems\n}\n\nexport const skipToken = Symbol()\nexport type SkipToken = typeof skipToken\n\nexport function ensureQueryFn<\n TQueryFnData = unknown,\n TQueryKey extends QueryKey = QueryKey,\n>(\n options: {\n queryFn?: QueryFunction | SkipToken\n queryHash?: string\n },\n fetchOptions?: FetchOptions,\n): QueryFunction {\n if (process.env.NODE_ENV !== 'production') {\n if (options.queryFn === skipToken) {\n console.error(\n `Attempted to invoke queryFn when set to skipToken. This is likely a configuration error. Query hash: '${options.queryHash}'`,\n )\n }\n }\n\n // if we attempt to retry a fetch that was triggered from an initialPromise\n // when we don't have a queryFn yet, we can't retry, so we just return the already rejected initialPromise\n // if an observer has already mounted, we will be able to retry with that queryFn\n if (!options.queryFn && fetchOptions?.initialPromise) {\n return () => fetchOptions.initialPromise!\n }\n\n if (!options.queryFn || options.queryFn === skipToken) {\n return () =>\n Promise.reject(new Error(`Missing queryFn: '${options.queryHash}'`))\n }\n\n return options.queryFn\n}\n\nexport function shouldThrowError) => boolean>(\n throwOnError: boolean | T | undefined,\n params: Parameters,\n): boolean {\n // Allow throwOnError function to override throwing behavior on a per-error basis\n if (typeof throwOnError === 'function') {\n return throwOnError(...params)\n }\n\n return !!throwOnError\n}\n\nexport function addConsumeAwareSignal(\n object: T,\n getSignal: () => AbortSignal,\n onCancelled: VoidFunction,\n): T & { signal: AbortSignal } {\n let consumed = false\n let signal: AbortSignal | undefined\n\n Object.defineProperty(object, 'signal', {\n enumerable: true,\n get: () => {\n signal ??= getSignal()\n if (consumed) {\n return signal\n }\n\n consumed = true\n if (signal.aborted) {\n onCancelled()\n } else {\n signal.addEventListener('abort', onCancelled, { once: true })\n }\n\n return signal\n },\n })\n\n return object as T & { signal: AbortSignal }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,4BAA+B;AAwFxB,IAAM,WAAW,OAAO,WAAW,eAAe,UAAU;AAI5D,SAAS,OAAO;AAAC;AAEjB,SAAS,iBACd,SACA,OACS;AACT,SAAO,OAAO,YAAY,aACrB,QAAmC,KAAK,IACzC;AACN;AAEO,SAAS,eAAe,OAAiC;AAC9D,SAAO,OAAO,UAAU,YAAY,SAAS,KAAK,UAAU;AAC9D;AAEO,SAAS,eAAe,WAAmB,WAA4B;AAC5E,SAAO,KAAK,IAAI,aAAa,aAAa,KAAK,KAAK,IAAI,GAAG,CAAC;AAC9D;AAEO,SAAS,iBAMd,WAGA,OACuB;AACvB,SAAO,OAAO,cAAc,aAAa,UAAU,KAAK,IAAI;AAC9D;AAEO,SAAS,eAMd,SACA,OACqB;AACrB,SAAO,OAAO,YAAY,aAAa,QAAQ,KAAK,IAAI;AAC1D;AAEO,SAAS,WACd,SACA,OACS;AACT,QAAM;AAAA,IACJ,OAAO;AAAA,IACP;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI;AAEJ,MAAI,UAAU;AACZ,QAAI,OAAO;AACT,UAAI,MAAM,cAAc,sBAAsB,UAAU,MAAM,OAAO,GAAG;AACtE,eAAO;AAAA,MACT;AAAA,IACF,WAAW,CAAC,gBAAgB,MAAM,UAAU,QAAQ,GAAG;AACrD,aAAO;AAAA,IACT;AAAA,EACF;AAEA,MAAI,SAAS,OAAO;AAClB,UAAM,WAAW,MAAM,SAAS;AAChC,QAAI,SAAS,YAAY,CAAC,UAAU;AACl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,WAAW;AACf,MAAI;AAEJ,SAAO,eAAe,QAAQ,UAAU;AAAA,IACtC,YAAY;AAAA,IACZ,KAAK,MAAM;AACT,iBAAW,UAAU;AACrB,UAAI,UAAU;AACZ,eAAO;AAAA,MACT;AAEA,iBAAW;AACX,UAAI,OAAO,SAAS;AAClB,oBAAY;AAAA,MACd,OAAO;AACL,eAAO,iBAAiB,SAAS,aAAa,EAAE,MAAM,KAAK,CAAC;AAAA,MAC9D;AAEA,aAAO;AAAA,IACT;AAAA,EACF,CAAC;AAED,SAAO;AACT;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/utils.d.cts b/node_modules/@tanstack/query-core/build/modern/utils.d.cts new file mode 100644 index 0000000..502420e --- /dev/null +++ b/node_modules/@tanstack/query-core/build/modern/utils.d.cts @@ -0,0 +1,3 @@ +export { u as MutationFilters, v as QueryFilters, bl as QueryTypeFilter, S as SkipToken, U as Updater, bA as addConsumeAwareSignal, bx as addToEnd, by as addToStart, bz as ensureQueryFn, bm as functionalUpdate, k as hashKey, br as hashQueryKeyByOptions, bt as isPlainArray, bu as isPlainObject, l as isServer, bn as isValidTimeout, m as keepPreviousData, n as matchMutation, o as matchQuery, p as noop, q as partialMatchKey, bw as replaceData, r as replaceEqualDeep, bq as resolveEnabled, bp as resolveStaleTime, bs as shallowEqualObjects, s as shouldThrowError, t as skipToken, bv as sleep, bo as timeUntilStale } from './hydration-uphG6M-i.cjs'; +import './removable.cjs'; +import './subscribable.cjs'; diff --git a/node_modules/@tanstack/query-core/build/modern/utils.d.ts b/node_modules/@tanstack/query-core/build/modern/utils.d.ts new file mode 100644 index 0000000..77dcd04 --- /dev/null +++ b/node_modules/@tanstack/query-core/build/modern/utils.d.ts @@ -0,0 +1,3 @@ +export { u as MutationFilters, v as QueryFilters, bl as QueryTypeFilter, S as SkipToken, U as Updater, bA as addConsumeAwareSignal, bx as addToEnd, by as addToStart, bz as ensureQueryFn, bm as functionalUpdate, k as hashKey, br as hashQueryKeyByOptions, bt as isPlainArray, bu as isPlainObject, l as isServer, bn as isValidTimeout, m as keepPreviousData, n as matchMutation, o as matchQuery, p as noop, q as partialMatchKey, bw as replaceData, r as replaceEqualDeep, bq as resolveEnabled, bp as resolveStaleTime, bs as shallowEqualObjects, s as shouldThrowError, t as skipToken, bv as sleep, bo as timeUntilStale } from './hydration-BlEVG2Lp.js'; +import './removable.js'; +import './subscribable.js'; diff --git a/node_modules/@tanstack/query-core/build/modern/utils.js b/node_modules/@tanstack/query-core/build/modern/utils.js new file mode 100644 index 0000000..8a91036 --- /dev/null +++ b/node_modules/@tanstack/query-core/build/modern/utils.js @@ -0,0 +1,281 @@ +// src/utils.ts +import { timeoutManager } from "./timeoutManager.js"; +var isServer = typeof window === "undefined" || "Deno" in globalThis; +function noop() { +} +function functionalUpdate(updater, input) { + return typeof updater === "function" ? updater(input) : updater; +} +function isValidTimeout(value) { + return typeof value === "number" && value >= 0 && value !== Infinity; +} +function timeUntilStale(updatedAt, staleTime) { + return Math.max(updatedAt + (staleTime || 0) - Date.now(), 0); +} +function resolveStaleTime(staleTime, query) { + return typeof staleTime === "function" ? staleTime(query) : staleTime; +} +function resolveEnabled(enabled, query) { + return typeof enabled === "function" ? enabled(query) : enabled; +} +function matchQuery(filters, query) { + const { + type = "all", + exact, + fetchStatus, + predicate, + queryKey, + stale + } = filters; + if (queryKey) { + if (exact) { + if (query.queryHash !== hashQueryKeyByOptions(queryKey, query.options)) { + return false; + } + } else if (!partialMatchKey(query.queryKey, queryKey)) { + return false; + } + } + if (type !== "all") { + const isActive = query.isActive(); + if (type === "active" && !isActive) { + return false; + } + if (type === "inactive" && isActive) { + return false; + } + } + if (typeof stale === "boolean" && query.isStale() !== stale) { + return false; + } + if (fetchStatus && fetchStatus !== query.state.fetchStatus) { + return false; + } + if (predicate && !predicate(query)) { + return false; + } + return true; +} +function matchMutation(filters, mutation) { + const { exact, status, predicate, mutationKey } = filters; + if (mutationKey) { + if (!mutation.options.mutationKey) { + return false; + } + if (exact) { + if (hashKey(mutation.options.mutationKey) !== hashKey(mutationKey)) { + return false; + } + } else if (!partialMatchKey(mutation.options.mutationKey, mutationKey)) { + return false; + } + } + if (status && mutation.state.status !== status) { + return false; + } + if (predicate && !predicate(mutation)) { + return false; + } + return true; +} +function hashQueryKeyByOptions(queryKey, options) { + const hashFn = options?.queryKeyHashFn || hashKey; + return hashFn(queryKey); +} +function hashKey(queryKey) { + return JSON.stringify( + queryKey, + (_, val) => isPlainObject(val) ? Object.keys(val).sort().reduce((result, key) => { + result[key] = val[key]; + return result; + }, {}) : val + ); +} +function partialMatchKey(a, b) { + if (a === b) { + return true; + } + if (typeof a !== typeof b) { + return false; + } + if (a && b && typeof a === "object" && typeof b === "object") { + return Object.keys(b).every((key) => partialMatchKey(a[key], b[key])); + } + return false; +} +var hasOwn = Object.prototype.hasOwnProperty; +function replaceEqualDeep(a, b, depth = 0) { + if (a === b) { + return a; + } + if (depth > 500) return b; + const array = isPlainArray(a) && isPlainArray(b); + if (!array && !(isPlainObject(a) && isPlainObject(b))) return b; + const aItems = array ? a : Object.keys(a); + const aSize = aItems.length; + const bItems = array ? b : Object.keys(b); + const bSize = bItems.length; + const copy = array ? new Array(bSize) : {}; + let equalItems = 0; + for (let i = 0; i < bSize; i++) { + const key = array ? i : bItems[i]; + const aItem = a[key]; + const bItem = b[key]; + if (aItem === bItem) { + copy[key] = aItem; + if (array ? i < aSize : hasOwn.call(a, key)) equalItems++; + continue; + } + if (aItem === null || bItem === null || typeof aItem !== "object" || typeof bItem !== "object") { + copy[key] = bItem; + continue; + } + const v = replaceEqualDeep(aItem, bItem, depth + 1); + copy[key] = v; + if (v === aItem) equalItems++; + } + return aSize === bSize && equalItems === aSize ? a : copy; +} +function shallowEqualObjects(a, b) { + if (!b || Object.keys(a).length !== Object.keys(b).length) { + return false; + } + for (const key in a) { + if (a[key] !== b[key]) { + return false; + } + } + return true; +} +function isPlainArray(value) { + return Array.isArray(value) && value.length === Object.keys(value).length; +} +function isPlainObject(o) { + if (!hasObjectPrototype(o)) { + return false; + } + const ctor = o.constructor; + if (ctor === void 0) { + return true; + } + const prot = ctor.prototype; + if (!hasObjectPrototype(prot)) { + return false; + } + if (!prot.hasOwnProperty("isPrototypeOf")) { + return false; + } + if (Object.getPrototypeOf(o) !== Object.prototype) { + return false; + } + return true; +} +function hasObjectPrototype(o) { + return Object.prototype.toString.call(o) === "[object Object]"; +} +function sleep(timeout) { + return new Promise((resolve) => { + timeoutManager.setTimeout(resolve, timeout); + }); +} +function replaceData(prevData, data, options) { + if (typeof options.structuralSharing === "function") { + return options.structuralSharing(prevData, data); + } else if (options.structuralSharing !== false) { + if (process.env.NODE_ENV !== "production") { + try { + return replaceEqualDeep(prevData, data); + } catch (error) { + console.error( + `Structural sharing requires data to be JSON serializable. To fix this, turn off structuralSharing or return JSON-serializable data from your queryFn. [${options.queryHash}]: ${error}` + ); + throw error; + } + } + return replaceEqualDeep(prevData, data); + } + return data; +} +function keepPreviousData(previousData) { + return previousData; +} +function addToEnd(items, item, max = 0) { + const newItems = [...items, item]; + return max && newItems.length > max ? newItems.slice(1) : newItems; +} +function addToStart(items, item, max = 0) { + const newItems = [item, ...items]; + return max && newItems.length > max ? newItems.slice(0, -1) : newItems; +} +var skipToken = /* @__PURE__ */ Symbol(); +function ensureQueryFn(options, fetchOptions) { + if (process.env.NODE_ENV !== "production") { + if (options.queryFn === skipToken) { + console.error( + `Attempted to invoke queryFn when set to skipToken. This is likely a configuration error. Query hash: '${options.queryHash}'` + ); + } + } + if (!options.queryFn && fetchOptions?.initialPromise) { + return () => fetchOptions.initialPromise; + } + if (!options.queryFn || options.queryFn === skipToken) { + return () => Promise.reject(new Error(`Missing queryFn: '${options.queryHash}'`)); + } + return options.queryFn; +} +function shouldThrowError(throwOnError, params) { + if (typeof throwOnError === "function") { + return throwOnError(...params); + } + return !!throwOnError; +} +function addConsumeAwareSignal(object, getSignal, onCancelled) { + let consumed = false; + let signal; + Object.defineProperty(object, "signal", { + enumerable: true, + get: () => { + signal ??= getSignal(); + if (consumed) { + return signal; + } + consumed = true; + if (signal.aborted) { + onCancelled(); + } else { + signal.addEventListener("abort", onCancelled, { once: true }); + } + return signal; + } + }); + return object; +} +export { + addConsumeAwareSignal, + addToEnd, + addToStart, + ensureQueryFn, + functionalUpdate, + hashKey, + hashQueryKeyByOptions, + isPlainArray, + isPlainObject, + isServer, + isValidTimeout, + keepPreviousData, + matchMutation, + matchQuery, + noop, + partialMatchKey, + replaceData, + replaceEqualDeep, + resolveEnabled, + resolveStaleTime, + shallowEqualObjects, + shouldThrowError, + skipToken, + sleep, + timeUntilStale +}; +//# sourceMappingURL=utils.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/utils.js.map b/node_modules/@tanstack/query-core/build/modern/utils.js.map new file mode 100644 index 0000000..a2aa3f5 --- /dev/null +++ b/node_modules/@tanstack/query-core/build/modern/utils.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/utils.ts"],"sourcesContent":["import { timeoutManager } from './timeoutManager'\nimport type {\n DefaultError,\n Enabled,\n FetchStatus,\n MutationKey,\n MutationStatus,\n QueryFunction,\n QueryKey,\n QueryOptions,\n StaleTime,\n StaleTimeFunction,\n} from './types'\nimport type { Mutation } from './mutation'\nimport type { FetchOptions, Query } from './query'\n\n// TYPES\n\ntype DropLast> = T extends readonly [\n ...infer R,\n unknown,\n]\n ? readonly [...R]\n : never\n\ntype TuplePrefixes> = T extends readonly []\n ? readonly []\n : TuplePrefixes> | T\n\nexport interface QueryFilters {\n /**\n * Filter to active queries, inactive queries or all queries\n */\n type?: QueryTypeFilter\n /**\n * Match query key exactly\n */\n exact?: boolean\n /**\n * Include queries matching this predicate function\n */\n predicate?: (query: Query) => boolean\n /**\n * Include queries matching this query key\n */\n queryKey?: TQueryKey | TuplePrefixes\n /**\n * Include or exclude stale queries\n */\n stale?: boolean\n /**\n * Include queries matching their fetchStatus\n */\n fetchStatus?: FetchStatus\n}\n\nexport interface MutationFilters<\n TData = unknown,\n TError = DefaultError,\n TVariables = unknown,\n TOnMutateResult = unknown,\n> {\n /**\n * Match mutation key exactly\n */\n exact?: boolean\n /**\n * Include mutations matching this predicate function\n */\n predicate?: (\n mutation: Mutation,\n ) => boolean\n /**\n * Include mutations matching this mutation key\n */\n mutationKey?: TuplePrefixes\n /**\n * Filter by mutation status\n */\n status?: MutationStatus\n}\n\nexport type Updater = TOutput | ((input: TInput) => TOutput)\n\nexport type QueryTypeFilter = 'all' | 'active' | 'inactive'\n\n// UTILS\n\nexport const isServer = typeof window === 'undefined' || 'Deno' in globalThis\n\nexport function noop(): void\nexport function noop(): undefined\nexport function noop() {}\n\nexport function functionalUpdate(\n updater: Updater,\n input: TInput,\n): TOutput {\n return typeof updater === 'function'\n ? (updater as (_: TInput) => TOutput)(input)\n : updater\n}\n\nexport function isValidTimeout(value: unknown): value is number {\n return typeof value === 'number' && value >= 0 && value !== Infinity\n}\n\nexport function timeUntilStale(updatedAt: number, staleTime?: number): number {\n return Math.max(updatedAt + (staleTime || 0) - Date.now(), 0)\n}\n\nexport function resolveStaleTime<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n staleTime:\n | undefined\n | StaleTimeFunction,\n query: Query,\n): StaleTime | undefined {\n return typeof staleTime === 'function' ? staleTime(query) : staleTime\n}\n\nexport function resolveEnabled<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n enabled: undefined | Enabled,\n query: Query,\n): boolean | undefined {\n return typeof enabled === 'function' ? enabled(query) : enabled\n}\n\nexport function matchQuery(\n filters: QueryFilters,\n query: Query,\n): boolean {\n const {\n type = 'all',\n exact,\n fetchStatus,\n predicate,\n queryKey,\n stale,\n } = filters\n\n if (queryKey) {\n if (exact) {\n if (query.queryHash !== hashQueryKeyByOptions(queryKey, query.options)) {\n return false\n }\n } else if (!partialMatchKey(query.queryKey, queryKey)) {\n return false\n }\n }\n\n if (type !== 'all') {\n const isActive = query.isActive()\n if (type === 'active' && !isActive) {\n return false\n }\n if (type === 'inactive' && isActive) {\n return false\n }\n }\n\n if (typeof stale === 'boolean' && query.isStale() !== stale) {\n return false\n }\n\n if (fetchStatus && fetchStatus !== query.state.fetchStatus) {\n return false\n }\n\n if (predicate && !predicate(query)) {\n return false\n }\n\n return true\n}\n\nexport function matchMutation(\n filters: MutationFilters,\n mutation: Mutation,\n): boolean {\n const { exact, status, predicate, mutationKey } = filters\n if (mutationKey) {\n if (!mutation.options.mutationKey) {\n return false\n }\n if (exact) {\n if (hashKey(mutation.options.mutationKey) !== hashKey(mutationKey)) {\n return false\n }\n } else if (!partialMatchKey(mutation.options.mutationKey, mutationKey)) {\n return false\n }\n }\n\n if (status && mutation.state.status !== status) {\n return false\n }\n\n if (predicate && !predicate(mutation)) {\n return false\n }\n\n return true\n}\n\nexport function hashQueryKeyByOptions(\n queryKey: TQueryKey,\n options?: Pick, 'queryKeyHashFn'>,\n): string {\n const hashFn = options?.queryKeyHashFn || hashKey\n return hashFn(queryKey)\n}\n\n/**\n * Default query & mutation keys hash function.\n * Hashes the value into a stable hash.\n */\nexport function hashKey(queryKey: QueryKey | MutationKey): string {\n return JSON.stringify(queryKey, (_, val) =>\n isPlainObject(val)\n ? Object.keys(val)\n .sort()\n .reduce((result, key) => {\n result[key] = val[key]\n return result\n }, {} as any)\n : val,\n )\n}\n\n/**\n * Checks if key `b` partially matches with key `a`.\n */\nexport function partialMatchKey(a: QueryKey, b: QueryKey): boolean\nexport function partialMatchKey(a: any, b: any): boolean {\n if (a === b) {\n return true\n }\n\n if (typeof a !== typeof b) {\n return false\n }\n\n if (a && b && typeof a === 'object' && typeof b === 'object') {\n return Object.keys(b).every((key) => partialMatchKey(a[key], b[key]))\n }\n\n return false\n}\n\nconst hasOwn = Object.prototype.hasOwnProperty\n\n/**\n * This function returns `a` if `b` is deeply equal.\n * If not, it will replace any deeply equal children of `b` with those of `a`.\n * This can be used for structural sharing between JSON values for example.\n */\nexport function replaceEqualDeep(a: unknown, b: T, depth?: number): T\nexport function replaceEqualDeep(a: any, b: any, depth = 0): any {\n if (a === b) {\n return a\n }\n\n if (depth > 500) return b\n\n const array = isPlainArray(a) && isPlainArray(b)\n\n if (!array && !(isPlainObject(a) && isPlainObject(b))) return b\n\n const aItems = array ? a : Object.keys(a)\n const aSize = aItems.length\n const bItems = array ? b : Object.keys(b)\n const bSize = bItems.length\n const copy: any = array ? new Array(bSize) : {}\n\n let equalItems = 0\n\n for (let i = 0; i < bSize; i++) {\n const key: any = array ? i : bItems[i]\n const aItem = a[key]\n const bItem = b[key]\n\n if (aItem === bItem) {\n copy[key] = aItem\n if (array ? i < aSize : hasOwn.call(a, key)) equalItems++\n continue\n }\n\n if (\n aItem === null ||\n bItem === null ||\n typeof aItem !== 'object' ||\n typeof bItem !== 'object'\n ) {\n copy[key] = bItem\n continue\n }\n\n const v = replaceEqualDeep(aItem, bItem, depth + 1)\n copy[key] = v\n if (v === aItem) equalItems++\n }\n\n return aSize === bSize && equalItems === aSize ? a : copy\n}\n\n/**\n * Shallow compare objects.\n */\nexport function shallowEqualObjects>(\n a: T,\n b: T | undefined,\n): boolean {\n if (!b || Object.keys(a).length !== Object.keys(b).length) {\n return false\n }\n\n for (const key in a) {\n if (a[key] !== b[key]) {\n return false\n }\n }\n\n return true\n}\n\nexport function isPlainArray(value: unknown): value is Array {\n return Array.isArray(value) && value.length === Object.keys(value).length\n}\n\n// Copied from: https://github.com/jonschlinkert/is-plain-object\nexport function isPlainObject(o: any): o is Record {\n if (!hasObjectPrototype(o)) {\n return false\n }\n\n // If has no constructor\n const ctor = o.constructor\n if (ctor === undefined) {\n return true\n }\n\n // If has modified prototype\n const prot = ctor.prototype\n if (!hasObjectPrototype(prot)) {\n return false\n }\n\n // If constructor does not have an Object-specific method\n if (!prot.hasOwnProperty('isPrototypeOf')) {\n return false\n }\n\n // Handles Objects created by Object.create()\n if (Object.getPrototypeOf(o) !== Object.prototype) {\n return false\n }\n\n // Most likely a plain Object\n return true\n}\n\nfunction hasObjectPrototype(o: any): boolean {\n return Object.prototype.toString.call(o) === '[object Object]'\n}\n\nexport function sleep(timeout: number): Promise {\n return new Promise((resolve) => {\n timeoutManager.setTimeout(resolve, timeout)\n })\n}\n\nexport function replaceData<\n TData,\n TOptions extends QueryOptions,\n>(prevData: TData | undefined, data: TData, options: TOptions): TData {\n if (typeof options.structuralSharing === 'function') {\n return options.structuralSharing(prevData, data) as TData\n } else if (options.structuralSharing !== false) {\n if (process.env.NODE_ENV !== 'production') {\n try {\n return replaceEqualDeep(prevData, data)\n } catch (error) {\n console.error(\n `Structural sharing requires data to be JSON serializable. To fix this, turn off structuralSharing or return JSON-serializable data from your queryFn. [${options.queryHash}]: ${error}`,\n )\n\n // Prevent the replaceEqualDeep from being called again down below.\n throw error\n }\n }\n // Structurally share data between prev and new data if needed\n return replaceEqualDeep(prevData, data)\n }\n return data\n}\n\nexport function keepPreviousData(\n previousData: T | undefined,\n): T | undefined {\n return previousData\n}\n\nexport function addToEnd(items: Array, item: T, max = 0): Array {\n const newItems = [...items, item]\n return max && newItems.length > max ? newItems.slice(1) : newItems\n}\n\nexport function addToStart(items: Array, item: T, max = 0): Array {\n const newItems = [item, ...items]\n return max && newItems.length > max ? newItems.slice(0, -1) : newItems\n}\n\nexport const skipToken = Symbol()\nexport type SkipToken = typeof skipToken\n\nexport function ensureQueryFn<\n TQueryFnData = unknown,\n TQueryKey extends QueryKey = QueryKey,\n>(\n options: {\n queryFn?: QueryFunction | SkipToken\n queryHash?: string\n },\n fetchOptions?: FetchOptions,\n): QueryFunction {\n if (process.env.NODE_ENV !== 'production') {\n if (options.queryFn === skipToken) {\n console.error(\n `Attempted to invoke queryFn when set to skipToken. This is likely a configuration error. Query hash: '${options.queryHash}'`,\n )\n }\n }\n\n // if we attempt to retry a fetch that was triggered from an initialPromise\n // when we don't have a queryFn yet, we can't retry, so we just return the already rejected initialPromise\n // if an observer has already mounted, we will be able to retry with that queryFn\n if (!options.queryFn && fetchOptions?.initialPromise) {\n return () => fetchOptions.initialPromise!\n }\n\n if (!options.queryFn || options.queryFn === skipToken) {\n return () =>\n Promise.reject(new Error(`Missing queryFn: '${options.queryHash}'`))\n }\n\n return options.queryFn\n}\n\nexport function shouldThrowError) => boolean>(\n throwOnError: boolean | T | undefined,\n params: Parameters,\n): boolean {\n // Allow throwOnError function to override throwing behavior on a per-error basis\n if (typeof throwOnError === 'function') {\n return throwOnError(...params)\n }\n\n return !!throwOnError\n}\n\nexport function addConsumeAwareSignal(\n object: T,\n getSignal: () => AbortSignal,\n onCancelled: VoidFunction,\n): T & { signal: AbortSignal } {\n let consumed = false\n let signal: AbortSignal | undefined\n\n Object.defineProperty(object, 'signal', {\n enumerable: true,\n get: () => {\n signal ??= getSignal()\n if (consumed) {\n return signal\n }\n\n consumed = true\n if (signal.aborted) {\n onCancelled()\n } else {\n signal.addEventListener('abort', onCancelled, { once: true })\n }\n\n return signal\n },\n })\n\n return object as T & { signal: AbortSignal }\n}\n"],"mappings":";AAAA,SAAS,sBAAsB;AAwFxB,IAAM,WAAW,OAAO,WAAW,eAAe,UAAU;AAI5D,SAAS,OAAO;AAAC;AAEjB,SAAS,iBACd,SACA,OACS;AACT,SAAO,OAAO,YAAY,aACrB,QAAmC,KAAK,IACzC;AACN;AAEO,SAAS,eAAe,OAAiC;AAC9D,SAAO,OAAO,UAAU,YAAY,SAAS,KAAK,UAAU;AAC9D;AAEO,SAAS,eAAe,WAAmB,WAA4B;AAC5E,SAAO,KAAK,IAAI,aAAa,aAAa,KAAK,KAAK,IAAI,GAAG,CAAC;AAC9D;AAEO,SAAS,iBAMd,WAGA,OACuB;AACvB,SAAO,OAAO,cAAc,aAAa,UAAU,KAAK,IAAI;AAC9D;AAEO,SAAS,eAMd,SACA,OACqB;AACrB,SAAO,OAAO,YAAY,aAAa,QAAQ,KAAK,IAAI;AAC1D;AAEO,SAAS,WACd,SACA,OACS;AACT,QAAM;AAAA,IAC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;AACpD,WAAO,MAAM,aAAa;AAAA,EAC5B;AAEA,MAAI,CAAC,QAAQ,WAAW,QAAQ,YAAY,WAAW;AACrD,WAAO,MACL,QAAQ,OAAO,IAAI,MAAM,qBAAqB,QAAQ,SAAS,GAAG,CAAC;AAAA,EACvE;AAEA,SAAO,QAAQ;AACjB;AAEO,SAAS,iBACd,cACA,QACS;AAET,MAAI,OAAO,iBAAiB,YAAY;AACtC,WAAO,aAAa,GAAG,MAAM;AAAA,EAC/B;AAEA,SAAO,CAAC,CAAC;AACX;AAEO,SAAS,sBACd,QACA,WACA,aAC6B;AAC7B,MAAI,WAAW;AACf,MAAI;AAEJ,SAAO,eAAe,QAAQ,UAAU;AAAA,IACtC,YAAY;AAAA,IACZ,KAAK,MAAM;AACT,iBAAW,UAAU;AACrB,UAAI,UAAU;AACZ,eAAO;AAAA,MACT;AAEA,iBAAW;AACX,UAAI,OAAO,SAAS;AAClB,oBAAY;AAAA,MACd,OAAO;AACL,eAAO,iBAAiB,SAAS,aAAa,EAAE,MAAM,KAAK,CAAC;AAAA,MAC9D;AAEA,aAAO;AAAA,IACT;AAAA,EACF,CAAC;AAED,SAAO;AACT;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/package.json b/node_modules/@tanstack/query-core/package.json new file mode 100644 index 0000000..f23d52c --- /dev/null +++ b/node_modules/@tanstack/query-core/package.json @@ -0,0 +1,65 @@ +{ + "name": "@tanstack/query-core", + "version": "5.90.20", + "description": "The framework agnostic core that powers TanStack Query", + "author": "tannerlinsley", + "license": "MIT", + "repository": { + "type": "git", + "url": "git+https://github.com/TanStack/query.git", + "directory": "packages/query-core" + }, + "homepage": "https://tanstack.com/query", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/tannerlinsley" + }, + "type": "module", + "types": "build/legacy/index.d.ts", + "main": "build/legacy/index.cjs", + "module": "build/legacy/index.js", + "react-native": "src/index.ts", + "exports": { + ".": { + "@tanstack/custom-condition": "./src/index.ts", + "import": { + "types": "./build/modern/index.d.ts", + "default": "./build/modern/index.js" + }, + "require": { + "types": "./build/modern/index.d.cts", + "default": "./build/modern/index.cjs" + } + }, + "./package.json": "./package.json" + }, + "sideEffects": false, + "files": [ + "build", + "src", + "!src/__tests__" + ], + "devDependencies": { + "npm-run-all2": "^5.0.0", + "@tanstack/query-test-utils": "0.0.0" + }, + "scripts": { + "clean": "premove ./build ./coverage ./dist-ts", + "compile": "tsc --build", + "test:eslint": "eslint --concurrency=auto ./src", + "test:types": "npm-run-all --serial test:types:*", + "test:types:ts50": "node ../../node_modules/typescript50/lib/tsc.js --build tsconfig.legacy.json", + "test:types:ts51": "node ../../node_modules/typescript51/lib/tsc.js --build tsconfig.legacy.json", + "test:types:ts52": "node ../../node_modules/typescript52/lib/tsc.js --build tsconfig.legacy.json", + "test:types:ts53": "node ../../node_modules/typescript53/lib/tsc.js --build tsconfig.legacy.json", + "test:types:ts54": "node ../../node_modules/typescript54/lib/tsc.js --build tsconfig.legacy.json", + "test:types:ts55": "node ../../node_modules/typescript55/lib/tsc.js --build tsconfig.legacy.json", + "test:types:ts56": "node ../../node_modules/typescript56/lib/tsc.js --build tsconfig.legacy.json", + "test:types:ts57": "node ../../node_modules/typescript57/lib/tsc.js --build tsconfig.legacy.json", + "test:types:tscurrent": "tsc --build", + "test:lib": "vitest", + "test:lib:dev": "pnpm run test:lib --watch", + "test:build": "publint --strict && attw --pack", + "build": "tsup --tsconfig tsconfig.prod.json" + } +} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/src/focusManager.ts b/node_modules/@tanstack/query-core/src/focusManager.ts new file mode 100644 index 0000000..cb0d859 --- /dev/null +++ b/node_modules/@tanstack/query-core/src/focusManager.ts @@ -0,0 +1,86 @@ +import { Subscribable } from './subscribable' +import { isServer } from './utils' + +type Listener = (focused: boolean) => void + +type SetupFn = ( + setFocused: (focused?: boolean) => void, +) => (() => void) | undefined + +export class FocusManager extends Subscribable { + #focused?: boolean + #cleanup?: () => void + + #setup: SetupFn + + constructor() { + super() + this.#setup = (onFocus) => { + // addEventListener does not exist in React Native, but window does + // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition + if (!isServer && window.addEventListener) { + const listener = () => onFocus() + // Listen to visibilitychange + window.addEventListener('visibilitychange', listener, false) + + return () => { + // Be sure to unsubscribe if a new handler is set + window.removeEventListener('visibilitychange', listener) + } + } + return + } + } + + protected onSubscribe(): void { + if (!this.#cleanup) { + this.setEventListener(this.#setup) + } + } + + protected onUnsubscribe() { + if (!this.hasListeners()) { + this.#cleanup?.() + this.#cleanup = undefined + } + } + + setEventListener(setup: SetupFn): void { + this.#setup = setup + this.#cleanup?.() + this.#cleanup = setup((focused) => { + if (typeof focused === 'boolean') { + this.setFocused(focused) + } else { + this.onFocus() + } + }) + } + + setFocused(focused?: boolean): void { + const changed = this.#focused !== focused + if (changed) { + this.#focused = focused + this.onFocus() + } + } + + onFocus(): void { + const isFocused = this.isFocused() + this.listeners.forEach((listener) => { + listener(isFocused) + }) + } + + isFocused(): boolean { + if (typeof this.#focused === 'boolean') { + return this.#focused + } + + // document global can be unavailable in react native + // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition + return globalThis.document?.visibilityState !== 'hidden' + } +} + +export const focusManager = new FocusManager() diff --git a/node_modules/@tanstack/query-core/src/hydration.ts b/node_modules/@tanstack/query-core/src/hydration.ts new file mode 100644 index 0000000..c75d8ee --- /dev/null +++ b/node_modules/@tanstack/query-core/src/hydration.ts @@ -0,0 +1,285 @@ +import { tryResolveSync } from './thenable' +import { noop } from './utils' +import type { + DefaultError, + MutationKey, + MutationMeta, + MutationOptions, + MutationScope, + QueryKey, + QueryMeta, + QueryOptions, +} from './types' +import type { QueryClient } from './queryClient' +import type { Query, QueryState } from './query' +import type { Mutation, MutationState } from './mutation' + +// TYPES +type TransformerFn = (data: any) => any +function defaultTransformerFn(data: any): any { + return data +} + +export interface DehydrateOptions { + serializeData?: TransformerFn + shouldDehydrateMutation?: (mutation: Mutation) => boolean + shouldDehydrateQuery?: (query: Query) => boolean + shouldRedactErrors?: (error: unknown) => boolean +} + +export interface HydrateOptions { + defaultOptions?: { + deserializeData?: TransformerFn + queries?: QueryOptions + mutations?: MutationOptions + } +} + +interface DehydratedMutation { + mutationKey?: MutationKey + state: MutationState + meta?: MutationMeta + scope?: MutationScope +} + +interface DehydratedQuery { + queryHash: string + queryKey: QueryKey + state: QueryState + promise?: Promise + meta?: QueryMeta + // This is only optional because older versions of Query might have dehydrated + // without it which we need to handle for backwards compatibility. + // This should be changed to required in the future. + dehydratedAt?: number +} + +export interface DehydratedState { + mutations: Array + queries: Array +} + +// FUNCTIONS + +function dehydrateMutation(mutation: Mutation): DehydratedMutation { + return { + mutationKey: mutation.options.mutationKey, + state: mutation.state, + ...(mutation.options.scope && { scope: mutation.options.scope }), + ...(mutation.meta && { meta: mutation.meta }), + } +} + +// Most config is not dehydrated but instead meant to configure again when +// consuming the de/rehydrated data, typically with useQuery on the client. +// Sometimes it might make sense to prefetch data on the server and include +// in the html-payload, but not consume it on the initial render. +function dehydrateQuery( + query: Query, + serializeData: TransformerFn, + shouldRedactErrors: (error: unknown) => boolean, +): DehydratedQuery { + const dehydratePromise = () => { + const promise = query.promise?.then(serializeData).catch((error) => { + if (!shouldRedactErrors(error)) { + // Reject original error if it should not be redacted + return Promise.reject(error) + } + // If not in production, log original error before rejecting redacted error + if (process.env.NODE_ENV !== 'production') { + console.error( + `A query that was dehydrated as pending ended up rejecting. [${query.queryHash}]: ${error}; The error will be redacted in production builds`, + ) + } + return Promise.reject(new Error('redacted')) + }) + + // Avoid unhandled promise rejections + // We need the promise we dehydrate to reject to get the correct result into + // the query cache, but we also want to avoid unhandled promise rejections + // in whatever environment the prefetches are happening in. + promise?.catch(noop) + + return promise + } + + return { + dehydratedAt: Date.now(), + state: { + ...query.state, + ...(query.state.data !== undefined && { + data: serializeData(query.state.data), + }), + }, + queryKey: query.queryKey, + queryHash: query.queryHash, + ...(query.state.status === 'pending' && { + promise: dehydratePromise(), + }), + ...(query.meta && { meta: query.meta }), + } +} + +export function defaultShouldDehydrateMutation(mutation: Mutation) { + return mutation.state.isPaused +} + +export function defaultShouldDehydrateQuery(query: Query) { + return query.state.status === 'success' +} + +function defaultShouldRedactErrors(_: unknown) { + return true +} + +export function dehydrate( + client: QueryClient, + options: DehydrateOptions = {}, +): DehydratedState { + const filterMutation = + options.shouldDehydrateMutation ?? + client.getDefaultOptions().dehydrate?.shouldDehydrateMutation ?? + defaultShouldDehydrateMutation + + const mutations = client + .getMutationCache() + .getAll() + .flatMap((mutation) => + filterMutation(mutation) ? [dehydrateMutation(mutation)] : [], + ) + + const filterQuery = + options.shouldDehydrateQuery ?? + client.getDefaultOptions().dehydrate?.shouldDehydrateQuery ?? + defaultShouldDehydrateQuery + + const shouldRedactErrors = + options.shouldRedactErrors ?? + client.getDefaultOptions().dehydrate?.shouldRedactErrors ?? + defaultShouldRedactErrors + + const serializeData = + options.serializeData ?? + client.getDefaultOptions().dehydrate?.serializeData ?? + defaultTransformerFn + + const queries = client + .getQueryCache() + .getAll() + .flatMap((query) => + filterQuery(query) + ? [dehydrateQuery(query, serializeData, shouldRedactErrors)] + : [], + ) + + return { mutations, queries } +} + +export function hydrate( + client: QueryClient, + dehydratedState: unknown, + options?: HydrateOptions, +): void { + if (typeof dehydratedState !== 'object' || dehydratedState === null) { + return + } + + const mutationCache = client.getMutationCache() + const queryCache = client.getQueryCache() + const deserializeData = + options?.defaultOptions?.deserializeData ?? + client.getDefaultOptions().hydrate?.deserializeData ?? + defaultTransformerFn + + // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition + const mutations = (dehydratedState as DehydratedState).mutations || [] + // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition + const queries = (dehydratedState as DehydratedState).queries || [] + + mutations.forEach(({ state, ...mutationOptions }) => { + mutationCache.build( + client, + { + ...client.getDefaultOptions().hydrate?.mutations, + ...options?.defaultOptions?.mutations, + ...mutationOptions, + }, + state, + ) + }) + + queries.forEach( + ({ queryKey, state, queryHash, meta, promise, dehydratedAt }) => { + const syncData = promise ? tryResolveSync(promise) : undefined + const rawData = state.data === undefined ? syncData?.data : state.data + const data = rawData === undefined ? rawData : deserializeData(rawData) + + let query = queryCache.get(queryHash) + const existingQueryIsPending = query?.state.status === 'pending' + const existingQueryIsFetching = query?.state.fetchStatus === 'fetching' + + // Do not hydrate if an existing query exists with newer data + if (query) { + const hasNewerSyncData = + syncData && + // We only need this undefined check to handle older dehydration + // payloads that might not have dehydratedAt + dehydratedAt !== undefined && + dehydratedAt > query.state.dataUpdatedAt + if ( + state.dataUpdatedAt > query.state.dataUpdatedAt || + hasNewerSyncData + ) { + // omit fetchStatus from dehydrated state + // so that query stays in its current fetchStatus + const { fetchStatus: _ignored, ...serializedState } = state + query.setState({ + ...serializedState, + data, + }) + } + } else { + // Restore query + query = queryCache.build( + client, + { + ...client.getDefaultOptions().hydrate?.queries, + ...options?.defaultOptions?.queries, + queryKey, + queryHash, + meta, + }, + // Reset fetch status to idle to avoid + // query being stuck in fetching state upon hydration + { + ...state, + data, + fetchStatus: 'idle', + status: data !== undefined ? 'success' : state.status, + }, + ) + } + + if ( + promise && + !existingQueryIsPending && + !existingQueryIsFetching && + // Only hydrate if dehydration is newer than any existing data, + // this is always true for new queries + (dehydratedAt === undefined || dehydratedAt > query.state.dataUpdatedAt) + ) { + // This doesn't actually fetch - it just creates a retryer + // which will re-use the passed `initialPromise` + // Note that we need to call these even when data was synchronously + // available, as we still need to set up the retryer + query + .fetch(undefined, { + // RSC transformed promises are not thenable + initialPromise: Promise.resolve(promise).then(deserializeData), + }) + // Avoid unhandled promise rejections + .catch(noop) + } + }, + ) +} diff --git a/node_modules/@tanstack/query-core/src/index.ts b/node_modules/@tanstack/query-core/src/index.ts new file mode 100644 index 0000000..a7763cf --- /dev/null +++ b/node_modules/@tanstack/query-core/src/index.ts @@ -0,0 +1,55 @@ +/* istanbul ignore file */ + +export { focusManager } from './focusManager' +export { + defaultShouldDehydrateMutation, + defaultShouldDehydrateQuery, + dehydrate, + hydrate, +} from './hydration' +export { InfiniteQueryObserver } from './infiniteQueryObserver' +export { MutationCache } from './mutationCache' +export type { MutationCacheNotifyEvent } from './mutationCache' +export { MutationObserver } from './mutationObserver' +export { defaultScheduler, notifyManager } from './notifyManager' +export { onlineManager } from './onlineManager' +export { QueriesObserver } from './queriesObserver' +export { QueryCache } from './queryCache' +export type { QueryCacheNotifyEvent } from './queryCache' +export { QueryClient } from './queryClient' +export { QueryObserver } from './queryObserver' +export { CancelledError, isCancelledError } from './retryer' +export { + timeoutManager, + type ManagedTimerId, + type TimeoutCallback, + type TimeoutProvider, +} from './timeoutManager' +export { + hashKey, + isServer, + keepPreviousData, + matchMutation, + matchQuery, + noop, + partialMatchKey, + replaceEqualDeep, + shouldThrowError, + skipToken, +} from './utils' +export type { MutationFilters, QueryFilters, SkipToken, Updater } from './utils' + +export { streamedQuery as experimental_streamedQuery } from './streamedQuery' + +// Types +export type { + DehydratedState, + DehydrateOptions, + HydrateOptions, +} from './hydration' +export { Mutation } from './mutation' +export type { MutationState } from './mutation' +export type { QueriesObserverOptions } from './queriesObserver' +export { Query } from './query' +export type { QueryState } from './query' +export * from './types' diff --git a/node_modules/@tanstack/query-core/src/infiniteQueryBehavior.ts b/node_modules/@tanstack/query-core/src/infiniteQueryBehavior.ts new file mode 100644 index 0000000..af9c50e --- /dev/null +++ b/node_modules/@tanstack/query-core/src/infiniteQueryBehavior.ts @@ -0,0 +1,176 @@ +import { + addConsumeAwareSignal, + addToEnd, + addToStart, + ensureQueryFn, +} from './utils' +import type { QueryBehavior } from './query' +import type { + InfiniteData, + InfiniteQueryPageParamsOptions, + OmitKeyof, + QueryFunctionContext, + QueryKey, +} from './types' + +export function infiniteQueryBehavior( + pages?: number, +): QueryBehavior> { + return { + onFetch: (context, query) => { + const options = context.options as InfiniteQueryPageParamsOptions + const direction = context.fetchOptions?.meta?.fetchMore?.direction + const oldPages = context.state.data?.pages || [] + const oldPageParams = context.state.data?.pageParams || [] + let result: InfiniteData = { pages: [], pageParams: [] } + let currentPage = 0 + + const fetchFn = async () => { + let cancelled = false + const addSignalProperty = (object: unknown) => { + addConsumeAwareSignal( + object, + () => context.signal, + () => (cancelled = true), + ) + } + + const queryFn = ensureQueryFn(context.options, context.fetchOptions) + + // Create function to fetch a page + const fetchPage = async ( + data: InfiniteData, + param: unknown, + previous?: boolean, + ): Promise> => { + if (cancelled) { + return Promise.reject() + } + + if (param == null && data.pages.length) { + return Promise.resolve(data) + } + + const createQueryFnContext = () => { + const queryFnContext: OmitKeyof< + QueryFunctionContext, + 'signal' + > = { + client: context.client, + queryKey: context.queryKey, + pageParam: param, + direction: previous ? 'backward' : 'forward', + meta: context.options.meta, + } + addSignalProperty(queryFnContext) + return queryFnContext as QueryFunctionContext + } + + const queryFnContext = createQueryFnContext() + + const page = await queryFn(queryFnContext) + + const { maxPages } = context.options + const addTo = previous ? addToStart : addToEnd + + return { + pages: addTo(data.pages, page, maxPages), + pageParams: addTo(data.pageParams, param, maxPages), + } + } + + // fetch next / previous page? + if (direction && oldPages.length) { + const previous = direction === 'backward' + const pageParamFn = previous ? getPreviousPageParam : getNextPageParam + const oldData = { + pages: oldPages, + pageParams: oldPageParams, + } + const param = pageParamFn(options, oldData) + + result = await fetchPage(oldData, param, previous) + } else { + const remainingPages = pages ?? oldPages.length + + // Fetch all pages + do { + const param = + currentPage === 0 + ? (oldPageParams[0] ?? options.initialPageParam) + : getNextPageParam(options, result) + if (currentPage > 0 && param == null) { + break + } + result = await fetchPage(result, param) + currentPage++ + } while (currentPage < remainingPages) + } + + return result + } + if (context.options.persister) { + context.fetchFn = () => { + return context.options.persister?.( + fetchFn as any, + { + client: context.client, + queryKey: context.queryKey, + meta: context.options.meta, + signal: context.signal, + }, + query, + ) + } + } else { + context.fetchFn = fetchFn + } + }, + } +} + +function getNextPageParam( + options: InfiniteQueryPageParamsOptions, + { pages, pageParams }: InfiniteData, +): unknown | undefined { + const lastIndex = pages.length - 1 + return pages.length > 0 + ? options.getNextPageParam( + pages[lastIndex], + pages, + pageParams[lastIndex], + pageParams, + ) + : undefined +} + +function getPreviousPageParam( + options: InfiniteQueryPageParamsOptions, + { pages, pageParams }: InfiniteData, +): unknown | undefined { + return pages.length > 0 + ? options.getPreviousPageParam?.(pages[0], pages, pageParams[0], pageParams) + : undefined +} + +/** + * Checks if there is a next page. + */ +export function hasNextPage( + options: InfiniteQueryPageParamsOptions, + data?: InfiniteData, +): boolean { + if (!data) return false + return getNextPageParam(options, data) != null +} + +/** + * Checks if there is a previous page. + */ +export function hasPreviousPage( + options: InfiniteQueryPageParamsOptions, + data?: InfiniteData, +): boolean { + if (!data || !options.getPreviousPageParam) return false + return getPreviousPageParam(options, data) != null +} diff --git a/node_modules/@tanstack/query-core/src/infiniteQueryObserver.ts b/node_modules/@tanstack/query-core/src/infiniteQueryObserver.ts new file mode 100644 index 0000000..1499b13 --- /dev/null +++ b/node_modules/@tanstack/query-core/src/infiniteQueryObserver.ts @@ -0,0 +1,190 @@ +import { QueryObserver } from './queryObserver' +import { + hasNextPage, + hasPreviousPage, + infiniteQueryBehavior, +} from './infiniteQueryBehavior' +import type { Subscribable } from './subscribable' +import type { + DefaultError, + DefaultedInfiniteQueryObserverOptions, + FetchNextPageOptions, + FetchPreviousPageOptions, + InfiniteData, + InfiniteQueryObserverBaseResult, + InfiniteQueryObserverOptions, + InfiniteQueryObserverResult, + QueryKey, +} from './types' +import type { QueryClient } from './queryClient' +import type { Query } from './query' + +type InfiniteQueryObserverListener = ( + result: InfiniteQueryObserverResult, +) => void + +export class InfiniteQueryObserver< + TQueryFnData = unknown, + TError = DefaultError, + TData = InfiniteData, + TQueryKey extends QueryKey = QueryKey, + TPageParam = unknown, +> extends QueryObserver< + TQueryFnData, + TError, + TData, + InfiniteData, + TQueryKey +> { + // Type override + subscribe!: Subscribable< + InfiniteQueryObserverListener + >['subscribe'] + + // Type override + getCurrentResult!: ReplaceReturnType< + QueryObserver< + TQueryFnData, + TError, + TData, + InfiniteData, + TQueryKey + >['getCurrentResult'], + InfiniteQueryObserverResult + > + + // Type override + protected fetch!: ReplaceReturnType< + QueryObserver< + TQueryFnData, + TError, + TData, + InfiniteData, + TQueryKey + >['fetch'], + Promise> + > + + constructor( + client: QueryClient, + options: InfiniteQueryObserverOptions< + TQueryFnData, + TError, + TData, + TQueryKey, + TPageParam + >, + ) { + super(client, options) + } + + protected bindMethods(): void { + super.bindMethods() + this.fetchNextPage = this.fetchNextPage.bind(this) + this.fetchPreviousPage = this.fetchPreviousPage.bind(this) + } + + setOptions( + options: InfiniteQueryObserverOptions< + TQueryFnData, + TError, + TData, + TQueryKey, + TPageParam + >, + ): void { + super.setOptions({ + ...options, + behavior: infiniteQueryBehavior(), + }) + } + + getOptimisticResult( + options: DefaultedInfiniteQueryObserverOptions< + TQueryFnData, + TError, + TData, + TQueryKey, + TPageParam + >, + ): InfiniteQueryObserverResult { + options.behavior = infiniteQueryBehavior() + return super.getOptimisticResult(options) as InfiniteQueryObserverResult< + TData, + TError + > + } + + fetchNextPage( + options?: FetchNextPageOptions, + ): Promise> { + return this.fetch({ + ...options, + meta: { + fetchMore: { direction: 'forward' }, + }, + }) + } + + fetchPreviousPage( + options?: FetchPreviousPageOptions, + ): Promise> { + return this.fetch({ + ...options, + meta: { + fetchMore: { direction: 'backward' }, + }, + }) + } + + protected createResult( + query: Query< + TQueryFnData, + TError, + InfiniteData, + TQueryKey + >, + options: InfiniteQueryObserverOptions< + TQueryFnData, + TError, + TData, + TQueryKey, + TPageParam + >, + ): InfiniteQueryObserverResult { + const { state } = query + const parentResult = super.createResult(query, options) + + const { isFetching, isRefetching, isError, isRefetchError } = parentResult + const fetchDirection = state.fetchMeta?.fetchMore?.direction + + const isFetchNextPageError = isError && fetchDirection === 'forward' + const isFetchingNextPage = isFetching && fetchDirection === 'forward' + + const isFetchPreviousPageError = isError && fetchDirection === 'backward' + const isFetchingPreviousPage = isFetching && fetchDirection === 'backward' + + const result: InfiniteQueryObserverBaseResult = { + ...parentResult, + fetchNextPage: this.fetchNextPage, + fetchPreviousPage: this.fetchPreviousPage, + hasNextPage: hasNextPage(options, state.data), + hasPreviousPage: hasPreviousPage(options, state.data), + isFetchNextPageError, + isFetchingNextPage, + isFetchPreviousPageError, + isFetchingPreviousPage, + isRefetchError: + isRefetchError && !isFetchNextPageError && !isFetchPreviousPageError, + isRefetching: + isRefetching && !isFetchingNextPage && !isFetchingPreviousPage, + } + + return result as InfiniteQueryObserverResult + } +} + +type ReplaceReturnType< + TFunction extends (...args: Array) => unknown, + TReturn, +> = (...args: Parameters) => TReturn diff --git a/node_modules/@tanstack/query-core/src/mutation.ts b/node_modules/@tanstack/query-core/src/mutation.ts new file mode 100644 index 0000000..2483b56 --- /dev/null +++ b/node_modules/@tanstack/query-core/src/mutation.ts @@ -0,0 +1,419 @@ +import { notifyManager } from './notifyManager' +import { Removable } from './removable' +import { createRetryer } from './retryer' +import type { + DefaultError, + MutationFunctionContext, + MutationMeta, + MutationOptions, + MutationStatus, +} from './types' +import type { MutationCache } from './mutationCache' +import type { MutationObserver } from './mutationObserver' +import type { Retryer } from './retryer' +import type { QueryClient } from './queryClient' + +// TYPES + +interface MutationConfig { + client: QueryClient + mutationId: number + mutationCache: MutationCache + options: MutationOptions + state?: MutationState +} + +export interface MutationState< + TData = unknown, + TError = DefaultError, + TVariables = unknown, + TOnMutateResult = unknown, +> { + context: TOnMutateResult | undefined + data: TData | undefined + error: TError | null + failureCount: number + failureReason: TError | null + isPaused: boolean + status: MutationStatus + variables: TVariables | undefined + submittedAt: number +} + +interface FailedAction { + type: 'failed' + failureCount: number + error: TError | null +} + +interface PendingAction { + type: 'pending' + isPaused: boolean + variables?: TVariables + context?: TOnMutateResult +} + +interface SuccessAction { + type: 'success' + data: TData +} + +interface ErrorAction { + type: 'error' + error: TError +} + +interface PauseAction { + type: 'pause' +} + +interface ContinueAction { + type: 'continue' +} + +export type Action = + | ContinueAction + | ErrorAction + | FailedAction + | PendingAction + | PauseAction + | SuccessAction + +// CLASS + +export class Mutation< + TData = unknown, + TError = DefaultError, + TVariables = unknown, + TOnMutateResult = unknown, +> extends Removable { + state: MutationState + options!: MutationOptions + readonly mutationId: number + + #client: QueryClient + #observers: Array< + MutationObserver + > + #mutationCache: MutationCache + #retryer?: Retryer + + constructor( + config: MutationConfig, + ) { + super() + + this.#client = config.client + this.mutationId = config.mutationId + this.#mutationCache = config.mutationCache + this.#observers = [] + this.state = config.state || getDefaultState() + + this.setOptions(config.options) + this.scheduleGc() + } + + setOptions( + options: MutationOptions, + ): void { + this.options = options + + this.updateGcTime(this.options.gcTime) + } + + get meta(): MutationMeta | undefined { + return this.options.meta + } + + addObserver(observer: MutationObserver): void { + if (!this.#observers.includes(observer)) { + this.#observers.push(observer) + + // Stop the mutation from being garbage collected + this.clearGcTimeout() + + this.#mutationCache.notify({ + type: 'observerAdded', + mutation: this, + observer, + }) + } + } + + removeObserver(observer: MutationObserver): void { + this.#observers = this.#observers.filter((x) => x !== observer) + + this.scheduleGc() + + this.#mutationCache.notify({ + type: 'observerRemoved', + mutation: this, + observer, + }) + } + + protected optionalRemove() { + if (!this.#observers.length) { + if (this.state.status === 'pending') { + this.scheduleGc() + } else { + this.#mutationCache.remove(this) + } + } + } + + continue(): Promise { + return ( + this.#retryer?.continue() ?? + // continuing a mutation assumes that variables are set, mutation must have been dehydrated before + this.execute(this.state.variables!) + ) + } + + async execute(variables: TVariables): Promise { + const onContinue = () => { + this.#dispatch({ type: 'continue' }) + } + + const mutationFnContext = { + client: this.#client, + meta: this.options.meta, + mutationKey: this.options.mutationKey, + } satisfies MutationFunctionContext + + this.#retryer = createRetryer({ + fn: () => { + if (!this.options.mutationFn) { + return Promise.reject(new Error('No mutationFn found')) + } + + return this.options.mutationFn(variables, mutationFnContext) + }, + onFail: (failureCount, error) => { + this.#dispatch({ type: 'failed', failureCount, error }) + }, + onPause: () => { + this.#dispatch({ type: 'pause' }) + }, + onContinue, + retry: this.options.retry ?? 0, + retryDelay: this.options.retryDelay, + networkMode: this.options.networkMode, + canRun: () => this.#mutationCache.canRun(this), + }) + + const restored = this.state.status === 'pending' + const isPaused = !this.#retryer.canStart() + + try { + if (restored) { + // Dispatch continue action to unpause restored mutation + onContinue() + } else { + this.#dispatch({ type: 'pending', variables, isPaused }) + // Notify cache callback + if (this.#mutationCache.config.onMutate) { + await this.#mutationCache.config.onMutate( + variables, + this as Mutation, + mutationFnContext, + ) + } + const context = await this.options.onMutate?.( + variables, + mutationFnContext, + ) + if (context !== this.state.context) { + this.#dispatch({ + type: 'pending', + context, + variables, + isPaused, + }) + } + } + const data = await this.#retryer.start() + + // Notify cache callback + await this.#mutationCache.config.onSuccess?.( + data, + variables, + this.state.context, + this as Mutation, + mutationFnContext, + ) + + await this.options.onSuccess?.( + data, + variables, + this.state.context!, + mutationFnContext, + ) + + // Notify cache callback + await this.#mutationCache.config.onSettled?.( + data, + null, + this.state.variables, + this.state.context, + this as Mutation, + mutationFnContext, + ) + + await this.options.onSettled?.( + data, + null, + variables, + this.state.context, + mutationFnContext, + ) + + this.#dispatch({ type: 'success', data }) + return data + } catch (error) { + try { + // Notify cache callback + await this.#mutationCache.config.onError?.( + error as any, + variables, + this.state.context, + this as Mutation, + mutationFnContext, + ) + } catch (e) { + void Promise.reject(e) + } + + try { + await this.options.onError?.( + error as TError, + variables, + this.state.context, + mutationFnContext, + ) + } catch (e) { + void Promise.reject(e) + } + + try { + // Notify cache callback + await this.#mutationCache.config.onSettled?.( + undefined, + error as any, + this.state.variables, + this.state.context, + this as Mutation, + mutationFnContext, + ) + } catch (e) { + void Promise.reject(e) + } + + try { + await this.options.onSettled?.( + undefined, + error as TError, + variables, + this.state.context, + mutationFnContext, + ) + } catch (e) { + void Promise.reject(e) + } + + this.#dispatch({ type: 'error', error: error as TError }) + throw error + } finally { + this.#mutationCache.runNext(this) + } + } + + #dispatch(action: Action): void { + const reducer = ( + state: MutationState, + ): MutationState => { + switch (action.type) { + case 'failed': + return { + ...state, + failureCount: action.failureCount, + failureReason: action.error, + } + case 'pause': + return { + ...state, + isPaused: true, + } + case 'continue': + return { + ...state, + isPaused: false, + } + case 'pending': + return { + ...state, + context: action.context, + data: undefined, + failureCount: 0, + failureReason: null, + error: null, + isPaused: action.isPaused, + status: 'pending', + variables: action.variables, + submittedAt: Date.now(), + } + case 'success': + return { + ...state, + data: action.data, + failureCount: 0, + failureReason: null, + error: null, + status: 'success', + isPaused: false, + } + case 'error': + return { + ...state, + data: undefined, + error: action.error, + failureCount: state.failureCount + 1, + failureReason: action.error, + isPaused: false, + status: 'error', + } + } + } + this.state = reducer(this.state) + + notifyManager.batch(() => { + this.#observers.forEach((observer) => { + observer.onMutationUpdate(action) + }) + this.#mutationCache.notify({ + mutation: this, + type: 'updated', + action, + }) + }) + } +} + +export function getDefaultState< + TData, + TError, + TVariables, + TOnMutateResult, +>(): MutationState { + return { + context: undefined, + data: undefined, + error: null, + failureCount: 0, + failureReason: null, + isPaused: false, + status: 'idle', + variables: undefined, + submittedAt: 0, + } +} diff --git a/node_modules/@tanstack/query-core/src/mutationCache.ts b/node_modules/@tanstack/query-core/src/mutationCache.ts new file mode 100644 index 0000000..d204c90 --- /dev/null +++ b/node_modules/@tanstack/query-core/src/mutationCache.ts @@ -0,0 +1,244 @@ +import { notifyManager } from './notifyManager' +import { Mutation } from './mutation' +import { matchMutation, noop } from './utils' +import { Subscribable } from './subscribable' +import type { MutationObserver } from './mutationObserver' +import type { + DefaultError, + MutationFunctionContext, + MutationOptions, + NotifyEvent, +} from './types' +import type { QueryClient } from './queryClient' +import type { Action, MutationState } from './mutation' +import type { MutationFilters } from './utils' + +// TYPES + +interface MutationCacheConfig { + onError?: ( + error: DefaultError, + variables: unknown, + onMutateResult: unknown, + mutation: Mutation, + context: MutationFunctionContext, + ) => Promise | unknown + onSuccess?: ( + data: unknown, + variables: unknown, + onMutateResult: unknown, + mutation: Mutation, + context: MutationFunctionContext, + ) => Promise | unknown + onMutate?: ( + variables: unknown, + mutation: Mutation, + context: MutationFunctionContext, + ) => Promise | unknown + onSettled?: ( + data: unknown | undefined, + error: DefaultError | null, + variables: unknown, + onMutateResult: unknown, + mutation: Mutation, + context: MutationFunctionContext, + ) => Promise | unknown +} + +interface NotifyEventMutationAdded extends NotifyEvent { + type: 'added' + mutation: Mutation +} +interface NotifyEventMutationRemoved extends NotifyEvent { + type: 'removed' + mutation: Mutation +} + +interface NotifyEventMutationObserverAdded extends NotifyEvent { + type: 'observerAdded' + mutation: Mutation + observer: MutationObserver +} + +interface NotifyEventMutationObserverRemoved extends NotifyEvent { + type: 'observerRemoved' + mutation: Mutation + observer: MutationObserver +} + +interface NotifyEventMutationObserverOptionsUpdated extends NotifyEvent { + type: 'observerOptionsUpdated' + mutation?: Mutation + observer: MutationObserver +} + +interface NotifyEventMutationUpdated extends NotifyEvent { + type: 'updated' + mutation: Mutation + action: Action +} + +export type MutationCacheNotifyEvent = + | NotifyEventMutationAdded + | NotifyEventMutationRemoved + | NotifyEventMutationObserverAdded + | NotifyEventMutationObserverRemoved + | NotifyEventMutationObserverOptionsUpdated + | NotifyEventMutationUpdated + +type MutationCacheListener = (event: MutationCacheNotifyEvent) => void + +// CLASS + +export class MutationCache extends Subscribable { + #mutations: Set> + #scopes: Map>> + #mutationId: number + + constructor(public config: MutationCacheConfig = {}) { + super() + this.#mutations = new Set() + this.#scopes = new Map() + this.#mutationId = 0 + } + + build( + client: QueryClient, + options: MutationOptions, + state?: MutationState, + ): Mutation { + const mutation = new Mutation({ + client, + mutationCache: this, + mutationId: ++this.#mutationId, + options: client.defaultMutationOptions(options), + state, + }) + + this.add(mutation) + + return mutation + } + + add(mutation: Mutation): void { + this.#mutations.add(mutation) + const scope = scopeFor(mutation) + if (typeof scope === 'string') { + const scopedMutations = this.#scopes.get(scope) + if (scopedMutations) { + scopedMutations.push(mutation) + } else { + this.#scopes.set(scope, [mutation]) + } + } + this.notify({ type: 'added', mutation }) + } + + remove(mutation: Mutation): void { + if (this.#mutations.delete(mutation)) { + const scope = scopeFor(mutation) + if (typeof scope === 'string') { + const scopedMutations = this.#scopes.get(scope) + if (scopedMutations) { + if (scopedMutations.length > 1) { + const index = scopedMutations.indexOf(mutation) + if (index !== -1) { + scopedMutations.splice(index, 1) + } + } else if (scopedMutations[0] === mutation) { + this.#scopes.delete(scope) + } + } + } + } + + // Currently we notify the removal even if the mutation was already removed. + // Consider making this an error or not notifying of the removal depending on the desired semantics. + this.notify({ type: 'removed', mutation }) + } + + canRun(mutation: Mutation): boolean { + const scope = scopeFor(mutation) + if (typeof scope === 'string') { + const mutationsWithSameScope = this.#scopes.get(scope) + const firstPendingMutation = mutationsWithSameScope?.find( + (m) => m.state.status === 'pending', + ) + // we can run if there is no current pending mutation (start use-case) + // or if WE are the first pending mutation (continue use-case) + return !firstPendingMutation || firstPendingMutation === mutation + } else { + // For unscoped mutations there are never any pending mutations in front of the + // current mutation + return true + } + } + + runNext(mutation: Mutation): Promise { + const scope = scopeFor(mutation) + if (typeof scope === 'string') { + const foundMutation = this.#scopes + .get(scope) + ?.find((m) => m !== mutation && m.state.isPaused) + + return foundMutation?.continue() ?? Promise.resolve() + } else { + return Promise.resolve() + } + } + + clear(): void { + notifyManager.batch(() => { + this.#mutations.forEach((mutation) => { + this.notify({ type: 'removed', mutation }) + }) + this.#mutations.clear() + this.#scopes.clear() + }) + } + + getAll(): Array { + return Array.from(this.#mutations) + } + + find< + TData = unknown, + TError = DefaultError, + TVariables = any, + TOnMutateResult = unknown, + >( + filters: MutationFilters, + ): Mutation | undefined { + const defaultedFilters = { exact: true, ...filters } + + return this.getAll().find((mutation) => + matchMutation(defaultedFilters, mutation), + ) as Mutation | undefined + } + + findAll(filters: MutationFilters = {}): Array { + return this.getAll().filter((mutation) => matchMutation(filters, mutation)) + } + + notify(event: MutationCacheNotifyEvent) { + notifyManager.batch(() => { + this.listeners.forEach((listener) => { + listener(event) + }) + }) + } + + resumePausedMutations(): Promise { + const pausedMutations = this.getAll().filter((x) => x.state.isPaused) + + return notifyManager.batch(() => + Promise.all( + pausedMutations.map((mutation) => mutation.continue().catch(noop)), + ), + ) + } +} + +function scopeFor(mutation: Mutation) { + return mutation.options.scope?.id +} diff --git a/node_modules/@tanstack/query-core/src/mutationObserver.ts b/node_modules/@tanstack/query-core/src/mutationObserver.ts new file mode 100644 index 0000000..2152396 --- /dev/null +++ b/node_modules/@tanstack/query-core/src/mutationObserver.ts @@ -0,0 +1,227 @@ +import { getDefaultState } from './mutation' +import { notifyManager } from './notifyManager' +import { Subscribable } from './subscribable' +import { hashKey, shallowEqualObjects } from './utils' +import type { QueryClient } from './queryClient' +import type { + DefaultError, + MutateOptions, + MutationFunctionContext, + MutationObserverOptions, + MutationObserverResult, +} from './types' +import type { Action, Mutation } from './mutation' + +// TYPES + +type MutationObserverListener = ( + result: MutationObserverResult, +) => void + +// CLASS + +export class MutationObserver< + TData = unknown, + TError = DefaultError, + TVariables = void, + TOnMutateResult = unknown, +> extends Subscribable< + MutationObserverListener +> { + options!: MutationObserverOptions + + #client: QueryClient + #currentResult: MutationObserverResult< + TData, + TError, + TVariables, + TOnMutateResult + > = undefined! + #currentMutation?: Mutation + #mutateOptions?: MutateOptions + + constructor( + client: QueryClient, + options: MutationObserverOptions< + TData, + TError, + TVariables, + TOnMutateResult + >, + ) { + super() + + this.#client = client + this.setOptions(options) + this.bindMethods() + this.#updateResult() + } + + protected bindMethods(): void { + this.mutate = this.mutate.bind(this) + this.reset = this.reset.bind(this) + } + + setOptions( + options: MutationObserverOptions< + TData, + TError, + TVariables, + TOnMutateResult + >, + ) { + const prevOptions = this.options as + | MutationObserverOptions + | undefined + this.options = this.#client.defaultMutationOptions(options) + if (!shallowEqualObjects(this.options, prevOptions)) { + this.#client.getMutationCache().notify({ + type: 'observerOptionsUpdated', + mutation: this.#currentMutation, + observer: this, + }) + } + + if ( + prevOptions?.mutationKey && + this.options.mutationKey && + hashKey(prevOptions.mutationKey) !== hashKey(this.options.mutationKey) + ) { + this.reset() + } else if (this.#currentMutation?.state.status === 'pending') { + this.#currentMutation.setOptions(this.options) + } + } + + protected onUnsubscribe(): void { + if (!this.hasListeners()) { + this.#currentMutation?.removeObserver(this) + } + } + + onMutationUpdate( + action: Action, + ): void { + this.#updateResult() + + this.#notify(action) + } + + getCurrentResult(): MutationObserverResult< + TData, + TError, + TVariables, + TOnMutateResult + > { + return this.#currentResult + } + + reset(): void { + // reset needs to remove the observer from the mutation because there is no way to "get it back" + // another mutate call will yield a new mutation! + this.#currentMutation?.removeObserver(this) + this.#currentMutation = undefined + this.#updateResult() + this.#notify() + } + + mutate( + variables: TVariables, + options?: MutateOptions, + ): Promise { + this.#mutateOptions = options + + this.#currentMutation?.removeObserver(this) + + this.#currentMutation = this.#client + .getMutationCache() + .build(this.#client, this.options) + + this.#currentMutation.addObserver(this) + + return this.#currentMutation.execute(variables) + } + + #updateResult(): void { + const state = + this.#currentMutation?.state ?? + getDefaultState() + + this.#currentResult = { + ...state, + isPending: state.status === 'pending', + isSuccess: state.status === 'success', + isError: state.status === 'error', + isIdle: state.status === 'idle', + mutate: this.mutate, + reset: this.reset, + } as MutationObserverResult + } + + #notify(action?: Action): void { + notifyManager.batch(() => { + // First trigger the mutate callbacks + if (this.#mutateOptions && this.hasListeners()) { + const variables = this.#currentResult.variables! + const onMutateResult = this.#currentResult.context + + const context = { + client: this.#client, + meta: this.options.meta, + mutationKey: this.options.mutationKey, + } satisfies MutationFunctionContext + + if (action?.type === 'success') { + try { + this.#mutateOptions.onSuccess?.( + action.data, + variables, + onMutateResult, + context, + ) + } catch (e) { + void Promise.reject(e) + } + try { + this.#mutateOptions.onSettled?.( + action.data, + null, + variables, + onMutateResult, + context, + ) + } catch (e) { + void Promise.reject(e) + } + } else if (action?.type === 'error') { + try { + this.#mutateOptions.onError?.( + action.error, + variables, + onMutateResult, + context, + ) + } catch (e) { + void Promise.reject(e) + } + try { + this.#mutateOptions.onSettled?.( + undefined, + action.error, + variables, + onMutateResult, + context, + ) + } catch (e) { + void Promise.reject(e) + } + } + } + + // Then trigger the listeners + this.listeners.forEach((listener) => { + listener(this.#currentResult) + }) + }) + } +} diff --git a/node_modules/@tanstack/query-core/src/notifyManager.ts b/node_modules/@tanstack/query-core/src/notifyManager.ts new file mode 100644 index 0000000..f4deb73 --- /dev/null +++ b/node_modules/@tanstack/query-core/src/notifyManager.ts @@ -0,0 +1,99 @@ +// TYPES + +import { systemSetTimeoutZero } from './timeoutManager' + +type NotifyCallback = () => void + +type NotifyFunction = (callback: () => void) => void + +type BatchNotifyFunction = (callback: () => void) => void + +type BatchCallsCallback> = (...args: T) => void + +type ScheduleFunction = (callback: () => void) => void + +export const defaultScheduler: ScheduleFunction = systemSetTimeoutZero + +export function createNotifyManager() { + let queue: Array = [] + let transactions = 0 + let notifyFn: NotifyFunction = (callback) => { + callback() + } + let batchNotifyFn: BatchNotifyFunction = (callback: () => void) => { + callback() + } + let scheduleFn = defaultScheduler + + const schedule = (callback: NotifyCallback): void => { + if (transactions) { + queue.push(callback) + } else { + scheduleFn(() => { + notifyFn(callback) + }) + } + } + const flush = (): void => { + const originalQueue = queue + queue = [] + if (originalQueue.length) { + scheduleFn(() => { + batchNotifyFn(() => { + originalQueue.forEach((callback) => { + notifyFn(callback) + }) + }) + }) + } + } + + return { + batch: (callback: () => T): T => { + let result + transactions++ + try { + result = callback() + } finally { + transactions-- + if (!transactions) { + flush() + } + } + return result + }, + /** + * All calls to the wrapped function will be batched. + */ + batchCalls: >( + callback: BatchCallsCallback, + ): BatchCallsCallback => { + return (...args) => { + schedule(() => { + callback(...args) + }) + } + }, + schedule, + /** + * Use this method to set a custom notify function. + * This can be used to for example wrap notifications with `React.act` while running tests. + */ + setNotifyFunction: (fn: NotifyFunction) => { + notifyFn = fn + }, + /** + * Use this method to set a custom function to batch notifications together into a single tick. + * By default React Query will use the batch function provided by ReactDOM or React Native. + */ + setBatchNotifyFunction: (fn: BatchNotifyFunction) => { + batchNotifyFn = fn + }, + setScheduler: (fn: ScheduleFunction) => { + scheduleFn = fn + }, + } as const +} + +// SINGLETON +export const notifyManager = createNotifyManager() diff --git a/node_modules/@tanstack/query-core/src/onlineManager.ts b/node_modules/@tanstack/query-core/src/onlineManager.ts new file mode 100644 index 0000000..daf77d5 --- /dev/null +++ b/node_modules/@tanstack/query-core/src/onlineManager.ts @@ -0,0 +1,71 @@ +import { Subscribable } from './subscribable' +import { isServer } from './utils' + +type Listener = (online: boolean) => void +type SetupFn = (setOnline: Listener) => (() => void) | undefined + +export class OnlineManager extends Subscribable { + #online = true + #cleanup?: () => void + + #setup: SetupFn + + constructor() { + super() + this.#setup = (onOnline) => { + // addEventListener does not exist in React Native, but window does + // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition + if (!isServer && window.addEventListener) { + const onlineListener = () => onOnline(true) + const offlineListener = () => onOnline(false) + // Listen to online + window.addEventListener('online', onlineListener, false) + window.addEventListener('offline', offlineListener, false) + + return () => { + // Be sure to unsubscribe if a new handler is set + window.removeEventListener('online', onlineListener) + window.removeEventListener('offline', offlineListener) + } + } + + return + } + } + + protected onSubscribe(): void { + if (!this.#cleanup) { + this.setEventListener(this.#setup) + } + } + + protected onUnsubscribe() { + if (!this.hasListeners()) { + this.#cleanup?.() + this.#cleanup = undefined + } + } + + setEventListener(setup: SetupFn): void { + this.#setup = setup + this.#cleanup?.() + this.#cleanup = setup(this.setOnline.bind(this)) + } + + setOnline(online: boolean): void { + const changed = this.#online !== online + + if (changed) { + this.#online = online + this.listeners.forEach((listener) => { + listener(online) + }) + } + } + + isOnline(): boolean { + return this.#online + } +} + +export const onlineManager = new OnlineManager() diff --git a/node_modules/@tanstack/query-core/src/queriesObserver.ts b/node_modules/@tanstack/query-core/src/queriesObserver.ts new file mode 100644 index 0000000..67dd088 --- /dev/null +++ b/node_modules/@tanstack/query-core/src/queriesObserver.ts @@ -0,0 +1,315 @@ +import { notifyManager } from './notifyManager' +import { QueryObserver } from './queryObserver' +import { Subscribable } from './subscribable' +import { replaceEqualDeep, shallowEqualObjects } from './utils' +import type { + DefaultedQueryObserverOptions, + QueryObserverOptions, + QueryObserverResult, +} from './types' +import type { QueryClient } from './queryClient' + +function difference(array1: Array, array2: Array): Array { + const excludeSet = new Set(array2) + return array1.filter((x) => !excludeSet.has(x)) +} + +function replaceAt(array: Array, index: number, value: T): Array { + const copy = array.slice(0) + copy[index] = value + return copy +} + +type QueriesObserverListener = (result: Array) => void + +type CombineFn = ( + result: Array, +) => TCombinedResult + +export interface QueriesObserverOptions< + TCombinedResult = Array, +> { + combine?: CombineFn +} + +export class QueriesObserver< + TCombinedResult = Array, +> extends Subscribable { + #client: QueryClient + #result!: Array + #queries: Array + #options?: QueriesObserverOptions + #observers: Array + #combinedResult?: TCombinedResult + #lastCombine?: CombineFn + #lastResult?: Array + #lastQueryHashes?: Array + #observerMatches: Array = [] + + constructor( + client: QueryClient, + queries: Array>, + options?: QueriesObserverOptions, + ) { + super() + + this.#client = client + this.#options = options + this.#queries = [] + this.#observers = [] + this.#result = [] + + this.setQueries(queries) + } + + protected onSubscribe(): void { + if (this.listeners.size === 1) { + this.#observers.forEach((observer) => { + observer.subscribe((result) => { + this.#onUpdate(observer, result) + }) + }) + } + } + + protected onUnsubscribe(): void { + if (!this.listeners.size) { + this.destroy() + } + } + + destroy(): void { + this.listeners = new Set() + this.#observers.forEach((observer) => { + observer.destroy() + }) + } + + setQueries( + queries: Array, + options?: QueriesObserverOptions, + ): void { + this.#queries = queries + this.#options = options + + if (process.env.NODE_ENV !== 'production') { + const queryHashes = queries.map( + (query) => this.#client.defaultQueryOptions(query).queryHash, + ) + if (new Set(queryHashes).size !== queryHashes.length) { + console.warn( + '[QueriesObserver]: Duplicate Queries found. This might result in unexpected behavior.', + ) + } + } + + notifyManager.batch(() => { + const prevObservers = this.#observers + + const newObserverMatches = this.#findMatchingObservers(this.#queries) + + // set options for the new observers to notify of changes + newObserverMatches.forEach((match) => + match.observer.setOptions(match.defaultedQueryOptions), + ) + + const newObservers = newObserverMatches.map((match) => match.observer) + const newResult = newObservers.map((observer) => + observer.getCurrentResult(), + ) + + const hasLengthChange = prevObservers.length !== newObservers.length + const hasIndexChange = newObservers.some( + (observer, index) => observer !== prevObservers[index], + ) + const hasStructuralChange = hasLengthChange || hasIndexChange + + const hasResultChange = hasStructuralChange + ? true + : newResult.some((result, index) => { + const prev = this.#result[index] + return !prev || !shallowEqualObjects(result, prev) + }) + + if (!hasStructuralChange && !hasResultChange) return + + if (hasStructuralChange) { + this.#observerMatches = newObserverMatches + this.#observers = newObservers + } + + this.#result = newResult + + if (!this.hasListeners()) return + + if (hasStructuralChange) { + difference(prevObservers, newObservers).forEach((observer) => { + observer.destroy() + }) + difference(newObservers, prevObservers).forEach((observer) => { + observer.subscribe((result) => { + this.#onUpdate(observer, result) + }) + }) + } + + this.#notify() + }) + } + + getCurrentResult(): Array { + return this.#result + } + + getQueries() { + return this.#observers.map((observer) => observer.getCurrentQuery()) + } + + getObservers() { + return this.#observers + } + + getOptimisticResult( + queries: Array, + combine: CombineFn | undefined, + ): [ + rawResult: Array, + combineResult: (r?: Array) => TCombinedResult, + trackResult: () => Array, + ] { + const matches = this.#findMatchingObservers(queries) + const result = matches.map((match) => + match.observer.getOptimisticResult(match.defaultedQueryOptions), + ) + const queryHashes = matches.map( + (match) => match.defaultedQueryOptions.queryHash, + ) + + return [ + result, + (r?: Array) => { + return this.#combineResult(r ?? result, combine, queryHashes) + }, + () => { + return this.#trackResult(result, matches) + }, + ] + } + + #trackResult( + result: Array, + matches: Array, + ) { + return matches.map((match, index) => { + const observerResult = result[index]! + return !match.defaultedQueryOptions.notifyOnChangeProps + ? match.observer.trackResult(observerResult, (accessedProp) => { + // track property on all observers to ensure proper (synchronized) tracking (#7000) + matches.forEach((m) => { + m.observer.trackProp(accessedProp) + }) + }) + : observerResult + }) + } + + #combineResult( + input: Array, + combine: CombineFn | undefined, + queryHashes?: Array, + ): TCombinedResult { + if (combine) { + const lastHashes = this.#lastQueryHashes + const queryHashesChanged = + queryHashes !== undefined && + lastHashes !== undefined && + (lastHashes.length !== queryHashes.length || + queryHashes.some((hash, i) => hash !== lastHashes[i])) + + if ( + !this.#combinedResult || + this.#result !== this.#lastResult || + queryHashesChanged || + combine !== this.#lastCombine + ) { + this.#lastCombine = combine + this.#lastResult = this.#result + + if (queryHashes !== undefined) { + this.#lastQueryHashes = queryHashes + } + this.#combinedResult = replaceEqualDeep( + this.#combinedResult, + combine(input), + ) + } + + return this.#combinedResult + } + return input as any + } + + #findMatchingObservers( + queries: Array, + ): Array { + const prevObserversMap = new Map>() + + this.#observers.forEach((observer) => { + const key = observer.options.queryHash + if (!key) return + + const previousObservers = prevObserversMap.get(key) + + if (previousObservers) { + previousObservers.push(observer) + } else { + prevObserversMap.set(key, [observer]) + } + }) + + const observers: Array = [] + + queries.forEach((options) => { + const defaultedOptions = this.#client.defaultQueryOptions(options) + const match = prevObserversMap.get(defaultedOptions.queryHash)?.shift() + const observer = + match ?? new QueryObserver(this.#client, defaultedOptions) + + observers.push({ + defaultedQueryOptions: defaultedOptions, + observer, + }) + }) + + return observers + } + + #onUpdate(observer: QueryObserver, result: QueryObserverResult): void { + const index = this.#observers.indexOf(observer) + if (index !== -1) { + this.#result = replaceAt(this.#result, index, result) + this.#notify() + } + } + + #notify(): void { + if (this.hasListeners()) { + const previousResult = this.#combinedResult + const newTracked = this.#trackResult(this.#result, this.#observerMatches) + const newResult = this.#combineResult(newTracked, this.#options?.combine) + + if (previousResult !== newResult) { + notifyManager.batch(() => { + this.listeners.forEach((listener) => { + listener(this.#result) + }) + }) + } + } + } +} + +type QueryObserverMatch = { + defaultedQueryOptions: DefaultedQueryObserverOptions + observer: QueryObserver +} diff --git a/node_modules/@tanstack/query-core/src/query.ts b/node_modules/@tanstack/query-core/src/query.ts new file mode 100644 index 0000000..b29b64c --- /dev/null +++ b/node_modules/@tanstack/query-core/src/query.ts @@ -0,0 +1,756 @@ +import { + ensureQueryFn, + noop, + replaceData, + resolveEnabled, + resolveStaleTime, + skipToken, + timeUntilStale, +} from './utils' +import { notifyManager } from './notifyManager' +import { CancelledError, canFetch, createRetryer } from './retryer' +import { Removable } from './removable' +import type { QueryCache } from './queryCache' +import type { QueryClient } from './queryClient' +import type { + CancelOptions, + DefaultError, + FetchStatus, + InitialDataFunction, + OmitKeyof, + QueryFunctionContext, + QueryKey, + QueryMeta, + QueryOptions, + QueryStatus, + SetDataOptions, + StaleTime, +} from './types' +import type { QueryObserver } from './queryObserver' +import type { Retryer } from './retryer' + +// TYPES + +interface QueryConfig< + TQueryFnData, + TError, + TData, + TQueryKey extends QueryKey = QueryKey, +> { + client: QueryClient + queryKey: TQueryKey + queryHash: string + options?: QueryOptions + defaultOptions?: QueryOptions + state?: QueryState +} + +export interface QueryState { + data: TData | undefined + dataUpdateCount: number + dataUpdatedAt: number + error: TError | null + errorUpdateCount: number + errorUpdatedAt: number + fetchFailureCount: number + fetchFailureReason: TError | null + fetchMeta: FetchMeta | null + isInvalidated: boolean + status: QueryStatus + fetchStatus: FetchStatus +} + +export interface FetchContext< + TQueryFnData, + TError, + TData, + TQueryKey extends QueryKey = QueryKey, +> { + fetchFn: () => unknown | Promise + fetchOptions?: FetchOptions + signal: AbortSignal + options: QueryOptions + client: QueryClient + queryKey: TQueryKey + state: QueryState +} + +export interface QueryBehavior< + TQueryFnData = unknown, + TError = DefaultError, + TData = TQueryFnData, + TQueryKey extends QueryKey = QueryKey, +> { + onFetch: ( + context: FetchContext, + query: Query, + ) => void +} + +export type FetchDirection = 'forward' | 'backward' + +export interface FetchMeta { + fetchMore?: { direction: FetchDirection } +} + +export interface FetchOptions { + cancelRefetch?: boolean + meta?: FetchMeta + initialPromise?: Promise +} + +interface FailedAction { + type: 'failed' + failureCount: number + error: TError +} + +interface FetchAction { + type: 'fetch' + meta?: FetchMeta +} + +interface SuccessAction { + data: TData | undefined + type: 'success' + dataUpdatedAt?: number + manual?: boolean +} + +interface ErrorAction { + type: 'error' + error: TError +} + +interface InvalidateAction { + type: 'invalidate' +} + +interface PauseAction { + type: 'pause' +} + +interface ContinueAction { + type: 'continue' +} + +interface SetStateAction { + type: 'setState' + state: Partial> + setStateOptions?: SetStateOptions +} + +export type Action = + | ContinueAction + | ErrorAction + | FailedAction + | FetchAction + | InvalidateAction + | PauseAction + | SetStateAction + | SuccessAction + +export interface SetStateOptions { + meta?: any +} + +// CLASS + +export class Query< + TQueryFnData = unknown, + TError = DefaultError, + TData = TQueryFnData, + TQueryKey extends QueryKey = QueryKey, +> extends Removable { + queryKey: TQueryKey + queryHash: string + options!: QueryOptions + state: QueryState + + #initialState: QueryState + #revertState?: QueryState + #cache: QueryCache + #client: QueryClient + #retryer?: Retryer + observers: Array> + #defaultOptions?: QueryOptions + #abortSignalConsumed: boolean + + constructor(config: QueryConfig) { + super() + + this.#abortSignalConsumed = false + this.#defaultOptions = config.defaultOptions + this.setOptions(config.options) + this.observers = [] + this.#client = config.client + this.#cache = this.#client.getQueryCache() + this.queryKey = config.queryKey + this.queryHash = config.queryHash + this.#initialState = getDefaultState(this.options) + this.state = config.state ?? this.#initialState + this.scheduleGc() + } + get meta(): QueryMeta | undefined { + return this.options.meta + } + + get promise(): Promise | undefined { + return this.#retryer?.promise + } + + setOptions( + options?: QueryOptions, + ): void { + this.options = { ...this.#defaultOptions, ...options } + + this.updateGcTime(this.options.gcTime) + + // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition + if (this.state && this.state.data === undefined) { + const defaultState = getDefaultState(this.options) + if (defaultState.data !== undefined) { + this.setState( + successState(defaultState.data, defaultState.dataUpdatedAt), + ) + this.#initialState = defaultState + } + } + } + + protected optionalRemove() { + if (!this.observers.length && this.state.fetchStatus === 'idle') { + this.#cache.remove(this) + } + } + + setData( + newData: TData, + options?: SetDataOptions & { manual: boolean }, + ): TData { + const data = replaceData(this.state.data, newData, this.options) + + // Set data and mark it as cached + this.#dispatch({ + data, + type: 'success', + dataUpdatedAt: options?.updatedAt, + manual: options?.manual, + }) + + return data + } + + setState( + state: Partial>, + setStateOptions?: SetStateOptions, + ): void { + this.#dispatch({ type: 'setState', state, setStateOptions }) + } + + cancel(options?: CancelOptions): Promise { + const promise = this.#retryer?.promise + this.#retryer?.cancel(options) + return promise ? promise.then(noop).catch(noop) : Promise.resolve() + } + + destroy(): void { + super.destroy() + + this.cancel({ silent: true }) + } + + reset(): void { + this.destroy() + this.setState(this.#initialState) + } + + isActive(): boolean { + return this.observers.some( + (observer) => resolveEnabled(observer.options.enabled, this) !== false, + ) + } + + isDisabled(): boolean { + if (this.getObserversCount() > 0) { + return !this.isActive() + } + // if a query has no observers, it should still be considered disabled if it never attempted a fetch + return ( + this.options.queryFn === skipToken || + this.state.dataUpdateCount + this.state.errorUpdateCount === 0 + ) + } + + isStatic(): boolean { + if (this.getObserversCount() > 0) { + return this.observers.some( + (observer) => + resolveStaleTime(observer.options.staleTime, this) === 'static', + ) + } + + return false + } + + isStale(): boolean { + // check observers first, their `isStale` has the source of truth + // calculated with `isStaleByTime` and it takes `enabled` into account + if (this.getObserversCount() > 0) { + return this.observers.some( + (observer) => observer.getCurrentResult().isStale, + ) + } + + return this.state.data === undefined || this.state.isInvalidated + } + + isStaleByTime(staleTime: StaleTime = 0): boolean { + // no data is always stale + if (this.state.data === undefined) { + return true + } + // static is never stale + if (staleTime === 'static') { + return false + } + // if the query is invalidated, it is stale + if (this.state.isInvalidated) { + return true + } + + return !timeUntilStale(this.state.dataUpdatedAt, staleTime) + } + + onFocus(): void { + const observer = this.observers.find((x) => x.shouldFetchOnWindowFocus()) + + observer?.refetch({ cancelRefetch: false }) + + // Continue fetch if currently paused + this.#retryer?.continue() + } + + onOnline(): void { + const observer = this.observers.find((x) => x.shouldFetchOnReconnect()) + + observer?.refetch({ cancelRefetch: false }) + + // Continue fetch if currently paused + this.#retryer?.continue() + } + + addObserver(observer: QueryObserver): void { + if (!this.observers.includes(observer)) { + this.observers.push(observer) + + // Stop the query from being garbage collected + this.clearGcTimeout() + + this.#cache.notify({ type: 'observerAdded', query: this, observer }) + } + } + + removeObserver(observer: QueryObserver): void { + if (this.observers.includes(observer)) { + this.observers = this.observers.filter((x) => x !== observer) + + if (!this.observers.length) { + // If the transport layer does not support cancellation + // we'll let the query continue so the result can be cached + if (this.#retryer) { + if (this.#abortSignalConsumed) { + this.#retryer.cancel({ revert: true }) + } else { + this.#retryer.cancelRetry() + } + } + + this.scheduleGc() + } + + this.#cache.notify({ type: 'observerRemoved', query: this, observer }) + } + } + + getObserversCount(): number { + return this.observers.length + } + + invalidate(): void { + if (!this.state.isInvalidated) { + this.#dispatch({ type: 'invalidate' }) + } + } + + async fetch( + options?: QueryOptions, + fetchOptions?: FetchOptions, + ): Promise { + if ( + this.state.fetchStatus !== 'idle' && + // If the promise in the retryer is already rejected, we have to definitely + // re-start the fetch; there is a chance that the query is still in a + // pending state when that happens + this.#retryer?.status() !== 'rejected' + ) { + if (this.state.data !== undefined && fetchOptions?.cancelRefetch) { + // Silently cancel current fetch if the user wants to cancel refetch + this.cancel({ silent: true }) + } else if (this.#retryer) { + // make sure that retries that were potentially cancelled due to unmounts can continue + this.#retryer.continueRetry() + // Return current promise if we are already fetching + return this.#retryer.promise + } + } + + // Update config if passed, otherwise the config from the last execution is used + if (options) { + this.setOptions(options) + } + + // Use the options from the first observer with a query function if no function is found. + // This can happen when the query is hydrated or created with setQueryData. + if (!this.options.queryFn) { + const observer = this.observers.find((x) => x.options.queryFn) + if (observer) { + this.setOptions(observer.options) + } + } + + if (process.env.NODE_ENV !== 'production') { + if (!Array.isArray(this.options.queryKey)) { + console.error( + `As of v4, queryKey needs to be an Array. If you are using a string like 'repoData', please change it to an Array, e.g. ['repoData']`, + ) + } + } + + const abortController = new AbortController() + + // Adds an enumerable signal property to the object that + // which sets abortSignalConsumed to true when the signal + // is read. + const addSignalProperty = (object: unknown) => { + Object.defineProperty(object, 'signal', { + enumerable: true, + get: () => { + this.#abortSignalConsumed = true + return abortController.signal + }, + }) + } + + // Create fetch function + const fetchFn = () => { + const queryFn = ensureQueryFn(this.options, fetchOptions) + + // Create query function context + const createQueryFnContext = (): QueryFunctionContext => { + const queryFnContext: OmitKeyof< + QueryFunctionContext, + 'signal' + > = { + client: this.#client, + queryKey: this.queryKey, + meta: this.meta, + } + addSignalProperty(queryFnContext) + return queryFnContext as QueryFunctionContext + } + + const queryFnContext = createQueryFnContext() + + this.#abortSignalConsumed = false + if (this.options.persister) { + return this.options.persister( + queryFn, + queryFnContext, + this as unknown as Query, + ) + } + + return queryFn(queryFnContext) + } + + // Trigger behavior hook + const createFetchContext = (): FetchContext< + TQueryFnData, + TError, + TData, + TQueryKey + > => { + const context: OmitKeyof< + FetchContext, + 'signal' + > = { + fetchOptions, + options: this.options, + queryKey: this.queryKey, + client: this.#client, + state: this.state, + fetchFn, + } + + addSignalProperty(context) + return context as FetchContext + } + + const context = createFetchContext() + + this.options.behavior?.onFetch(context, this as unknown as Query) + + // Store state in case the current fetch needs to be reverted + this.#revertState = this.state + + // Set to fetching state if not already in it + if ( + this.state.fetchStatus === 'idle' || + this.state.fetchMeta !== context.fetchOptions?.meta + ) { + this.#dispatch({ type: 'fetch', meta: context.fetchOptions?.meta }) + } + + // Try to fetch the data + this.#retryer = createRetryer({ + initialPromise: fetchOptions?.initialPromise as + | Promise + | undefined, + fn: context.fetchFn as () => Promise, + onCancel: (error) => { + if (error instanceof CancelledError && error.revert) { + this.setState({ + ...this.#revertState, + fetchStatus: 'idle' as const, + }) + } + abortController.abort() + }, + onFail: (failureCount, error) => { + this.#dispatch({ type: 'failed', failureCount, error }) + }, + onPause: () => { + this.#dispatch({ type: 'pause' }) + }, + onContinue: () => { + this.#dispatch({ type: 'continue' }) + }, + retry: context.options.retry, + retryDelay: context.options.retryDelay, + networkMode: context.options.networkMode, + canRun: () => true, + }) + + try { + const data = await this.#retryer.start() + // this is more of a runtime guard + // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition + if (data === undefined) { + if (process.env.NODE_ENV !== 'production') { + console.error( + `Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}`, + ) + } + throw new Error(`${this.queryHash} data is undefined`) + } + + this.setData(data) + + // Notify cache callback + this.#cache.config.onSuccess?.(data, this as Query) + this.#cache.config.onSettled?.( + data, + this.state.error as any, + this as Query, + ) + return data + } catch (error) { + if (error instanceof CancelledError) { + if (error.silent) { + // silent cancellation implies a new fetch is going to be started, + // so we piggyback onto that promise + return this.#retryer.promise + } else if (error.revert) { + // transform error into reverted state data + // if the initial fetch was cancelled, we have no data, so we have + // to get reject with a CancelledError + if (this.state.data === undefined) { + throw error + } + return this.state.data + } + } + this.#dispatch({ + type: 'error', + error: error as TError, + }) + + // Notify cache callback + this.#cache.config.onError?.( + error as any, + this as Query, + ) + this.#cache.config.onSettled?.( + this.state.data, + error as any, + this as Query, + ) + + throw error // rethrow the error for further handling + } finally { + // Schedule query gc after fetching + this.scheduleGc() + } + } + + #dispatch(action: Action): void { + const reducer = ( + state: QueryState, + ): QueryState => { + switch (action.type) { + case 'failed': + return { + ...state, + fetchFailureCount: action.failureCount, + fetchFailureReason: action.error, + } + case 'pause': + return { + ...state, + fetchStatus: 'paused', + } + case 'continue': + return { + ...state, + fetchStatus: 'fetching', + } + case 'fetch': + return { + ...state, + ...fetchState(state.data, this.options), + fetchMeta: action.meta ?? null, + } + case 'success': + const newState = { + ...state, + ...successState(action.data, action.dataUpdatedAt), + dataUpdateCount: state.dataUpdateCount + 1, + ...(!action.manual && { + fetchStatus: 'idle' as const, + fetchFailureCount: 0, + fetchFailureReason: null, + }), + } + // If fetching ends successfully, we don't need revertState as a fallback anymore. + // For manual updates, capture the state to revert to it in case of a cancellation. + this.#revertState = action.manual ? newState : undefined + + return newState + case 'error': + const error = action.error + return { + ...state, + error, + errorUpdateCount: state.errorUpdateCount + 1, + errorUpdatedAt: Date.now(), + fetchFailureCount: state.fetchFailureCount + 1, + fetchFailureReason: error, + fetchStatus: 'idle', + status: 'error', + // flag existing data as invalidated if we get a background error + // note that "no data" always means stale so we can set unconditionally here + isInvalidated: true, + } + case 'invalidate': + return { + ...state, + isInvalidated: true, + } + case 'setState': + return { + ...state, + ...action.state, + } + } + } + + this.state = reducer(this.state) + + notifyManager.batch(() => { + this.observers.forEach((observer) => { + observer.onQueryUpdate() + }) + + this.#cache.notify({ query: this, type: 'updated', action }) + }) + } +} + +export function fetchState< + TQueryFnData, + TError, + TData, + TQueryKey extends QueryKey, +>( + data: TData | undefined, + options: QueryOptions, +) { + return { + fetchFailureCount: 0, + fetchFailureReason: null, + fetchStatus: canFetch(options.networkMode) ? 'fetching' : 'paused', + ...(data === undefined && + ({ + error: null, + status: 'pending', + } as const)), + } as const +} + +function successState(data: TData | undefined, dataUpdatedAt?: number) { + return { + data, + dataUpdatedAt: dataUpdatedAt ?? Date.now(), + error: null, + isInvalidated: false, + status: 'success' as const, + } +} + +function getDefaultState< + TQueryFnData, + TError, + TData, + TQueryKey extends QueryKey, +>( + options: QueryOptions, +): QueryState { + const data = + typeof options.initialData === 'function' + ? (options.initialData as InitialDataFunction)() + : options.initialData + + const hasData = data !== undefined + + const initialDataUpdatedAt = hasData + ? typeof options.initialDataUpdatedAt === 'function' + ? options.initialDataUpdatedAt() + : options.initialDataUpdatedAt + : 0 + + return { + data, + dataUpdateCount: 0, + dataUpdatedAt: hasData ? (initialDataUpdatedAt ?? Date.now()) : 0, + error: null, + errorUpdateCount: 0, + errorUpdatedAt: 0, + fetchFailureCount: 0, + fetchFailureReason: null, + fetchMeta: null, + isInvalidated: false, + status: hasData ? 'success' : 'pending', + fetchStatus: 'idle', + } +} diff --git a/node_modules/@tanstack/query-core/src/queryCache.ts b/node_modules/@tanstack/query-core/src/queryCache.ts new file mode 100644 index 0000000..dd7123e --- /dev/null +++ b/node_modules/@tanstack/query-core/src/queryCache.ts @@ -0,0 +1,223 @@ +import { hashQueryKeyByOptions, matchQuery } from './utils' +import { Query } from './query' +import { notifyManager } from './notifyManager' +import { Subscribable } from './subscribable' +import type { QueryFilters } from './utils' +import type { Action, QueryState } from './query' +import type { + DefaultError, + NotifyEvent, + QueryKey, + QueryOptions, + WithRequired, +} from './types' +import type { QueryClient } from './queryClient' +import type { QueryObserver } from './queryObserver' + +// TYPES + +interface QueryCacheConfig { + onError?: ( + error: DefaultError, + query: Query, + ) => void + onSuccess?: (data: unknown, query: Query) => void + onSettled?: ( + data: unknown | undefined, + error: DefaultError | null, + query: Query, + ) => void +} + +interface NotifyEventQueryAdded extends NotifyEvent { + type: 'added' + query: Query +} + +interface NotifyEventQueryRemoved extends NotifyEvent { + type: 'removed' + query: Query +} + +interface NotifyEventQueryUpdated extends NotifyEvent { + type: 'updated' + query: Query + action: Action +} + +interface NotifyEventQueryObserverAdded extends NotifyEvent { + type: 'observerAdded' + query: Query + observer: QueryObserver +} + +interface NotifyEventQueryObserverRemoved extends NotifyEvent { + type: 'observerRemoved' + query: Query + observer: QueryObserver +} + +interface NotifyEventQueryObserverResultsUpdated extends NotifyEvent { + type: 'observerResultsUpdated' + query: Query +} + +interface NotifyEventQueryObserverOptionsUpdated extends NotifyEvent { + type: 'observerOptionsUpdated' + query: Query + observer: QueryObserver +} + +export type QueryCacheNotifyEvent = + | NotifyEventQueryAdded + | NotifyEventQueryRemoved + | NotifyEventQueryUpdated + | NotifyEventQueryObserverAdded + | NotifyEventQueryObserverRemoved + | NotifyEventQueryObserverResultsUpdated + | NotifyEventQueryObserverOptionsUpdated + +type QueryCacheListener = (event: QueryCacheNotifyEvent) => void + +export interface QueryStore { + has: (queryHash: string) => boolean + set: (queryHash: string, query: Query) => void + get: (queryHash: string) => Query | undefined + delete: (queryHash: string) => void + values: () => IterableIterator +} + +// CLASS + +export class QueryCache extends Subscribable { + #queries: QueryStore + + constructor(public config: QueryCacheConfig = {}) { + super() + this.#queries = new Map() + } + + build< + TQueryFnData = unknown, + TError = DefaultError, + TData = TQueryFnData, + TQueryKey extends QueryKey = QueryKey, + >( + client: QueryClient, + options: WithRequired< + QueryOptions, + 'queryKey' + >, + state?: QueryState, + ): Query { + const queryKey = options.queryKey + const queryHash = + options.queryHash ?? hashQueryKeyByOptions(queryKey, options) + let query = this.get(queryHash) + + if (!query) { + query = new Query({ + client, + queryKey, + queryHash, + options: client.defaultQueryOptions(options), + state, + defaultOptions: client.getQueryDefaults(queryKey), + }) + this.add(query) + } + + return query + } + + add(query: Query): void { + if (!this.#queries.has(query.queryHash)) { + this.#queries.set(query.queryHash, query) + + this.notify({ + type: 'added', + query, + }) + } + } + + remove(query: Query): void { + const queryInMap = this.#queries.get(query.queryHash) + + if (queryInMap) { + query.destroy() + + if (queryInMap === query) { + this.#queries.delete(query.queryHash) + } + + this.notify({ type: 'removed', query }) + } + } + + clear(): void { + notifyManager.batch(() => { + this.getAll().forEach((query) => { + this.remove(query) + }) + }) + } + + get< + TQueryFnData = unknown, + TError = DefaultError, + TData = TQueryFnData, + TQueryKey extends QueryKey = QueryKey, + >( + queryHash: string, + ): Query | undefined { + return this.#queries.get(queryHash) as + | Query + | undefined + } + + getAll(): Array { + return [...this.#queries.values()] + } + + find( + filters: WithRequired, + ): Query | undefined { + const defaultedFilters = { exact: true, ...filters } + + return this.getAll().find((query) => + matchQuery(defaultedFilters, query), + ) as Query | undefined + } + + findAll(filters: QueryFilters = {}): Array { + const queries = this.getAll() + return Object.keys(filters).length > 0 + ? queries.filter((query) => matchQuery(filters, query)) + : queries + } + + notify(event: QueryCacheNotifyEvent): void { + notifyManager.batch(() => { + this.listeners.forEach((listener) => { + listener(event) + }) + }) + } + + onFocus(): void { + notifyManager.batch(() => { + this.getAll().forEach((query) => { + query.onFocus() + }) + }) + } + + onOnline(): void { + notifyManager.batch(() => { + this.getAll().forEach((query) => { + query.onOnline() + }) + }) + } +} diff --git a/node_modules/@tanstack/query-core/src/queryClient.ts b/node_modules/@tanstack/query-core/src/queryClient.ts new file mode 100644 index 0000000..80cc366 --- /dev/null +++ b/node_modules/@tanstack/query-core/src/queryClient.ts @@ -0,0 +1,648 @@ +import { + functionalUpdate, + hashKey, + hashQueryKeyByOptions, + noop, + partialMatchKey, + resolveStaleTime, + skipToken, +} from './utils' +import { QueryCache } from './queryCache' +import { MutationCache } from './mutationCache' +import { focusManager } from './focusManager' +import { onlineManager } from './onlineManager' +import { notifyManager } from './notifyManager' +import { infiniteQueryBehavior } from './infiniteQueryBehavior' +import type { + CancelOptions, + DefaultError, + DefaultOptions, + DefaultedQueryObserverOptions, + EnsureInfiniteQueryDataOptions, + EnsureQueryDataOptions, + FetchInfiniteQueryOptions, + FetchQueryOptions, + InferDataFromTag, + InferErrorFromTag, + InfiniteData, + InvalidateOptions, + InvalidateQueryFilters, + MutationKey, + MutationObserverOptions, + MutationOptions, + NoInfer, + OmitKeyof, + QueryClientConfig, + QueryKey, + QueryObserverOptions, + QueryOptions, + RefetchOptions, + RefetchQueryFilters, + ResetOptions, + SetDataOptions, +} from './types' +import type { QueryState } from './query' +import type { MutationFilters, QueryFilters, Updater } from './utils' + +// TYPES + +interface QueryDefaults { + queryKey: QueryKey + defaultOptions: OmitKeyof, 'queryKey'> +} + +interface MutationDefaults { + mutationKey: MutationKey + defaultOptions: MutationOptions +} + +// CLASS + +export class QueryClient { + #queryCache: QueryCache + #mutationCache: MutationCache + #defaultOptions: DefaultOptions + #queryDefaults: Map + #mutationDefaults: Map + #mountCount: number + #unsubscribeFocus?: () => void + #unsubscribeOnline?: () => void + + constructor(config: QueryClientConfig = {}) { + this.#queryCache = config.queryCache || new QueryCache() + this.#mutationCache = config.mutationCache || new MutationCache() + this.#defaultOptions = config.defaultOptions || {} + this.#queryDefaults = new Map() + this.#mutationDefaults = new Map() + this.#mountCount = 0 + } + + mount(): void { + this.#mountCount++ + if (this.#mountCount !== 1) return + + this.#unsubscribeFocus = focusManager.subscribe(async (focused) => { + if (focused) { + await this.resumePausedMutations() + this.#queryCache.onFocus() + } + }) + this.#unsubscribeOnline = onlineManager.subscribe(async (online) => { + if (online) { + await this.resumePausedMutations() + this.#queryCache.onOnline() + } + }) + } + + unmount(): void { + this.#mountCount-- + if (this.#mountCount !== 0) return + + this.#unsubscribeFocus?.() + this.#unsubscribeFocus = undefined + + this.#unsubscribeOnline?.() + this.#unsubscribeOnline = undefined + } + + isFetching = QueryFilters>( + filters?: TQueryFilters, + ): number { + return this.#queryCache.findAll({ ...filters, fetchStatus: 'fetching' }) + .length + } + + isMutating< + TMutationFilters extends MutationFilters = MutationFilters, + >(filters?: TMutationFilters): number { + return this.#mutationCache.findAll({ ...filters, status: 'pending' }).length + } + + /** + * Imperative (non-reactive) way to retrieve data for a QueryKey. + * Should only be used in callbacks or functions where reading the latest data is necessary, e.g. for optimistic updates. + * + * Hint: Do not use this function inside a component, because it won't receive updates. + * Use `useQuery` to create a `QueryObserver` that subscribes to changes. + */ + getQueryData< + TQueryFnData = unknown, + TTaggedQueryKey extends QueryKey = QueryKey, + TInferredQueryFnData = InferDataFromTag, + >(queryKey: TTaggedQueryKey): TInferredQueryFnData | undefined { + const options = this.defaultQueryOptions({ queryKey }) + + return this.#queryCache.get(options.queryHash)?.state + .data + } + + ensureQueryData< + TQueryFnData, + TError = DefaultError, + TData = TQueryFnData, + TQueryKey extends QueryKey = QueryKey, + >( + options: EnsureQueryDataOptions, + ): Promise { + const defaultedOptions = this.defaultQueryOptions(options) + const query = this.#queryCache.build(this, defaultedOptions) + const cachedData = query.state.data + + if (cachedData === undefined) { + return this.fetchQuery(options) + } + + if ( + options.revalidateIfStale && + query.isStaleByTime(resolveStaleTime(defaultedOptions.staleTime, query)) + ) { + void this.prefetchQuery(defaultedOptions) + } + + return Promise.resolve(cachedData) + } + + getQueriesData< + TQueryFnData = unknown, + TQueryFilters extends QueryFilters = QueryFilters, + >(filters: TQueryFilters): Array<[QueryKey, TQueryFnData | undefined]> { + return this.#queryCache.findAll(filters).map(({ queryKey, state }) => { + const data = state.data as TQueryFnData | undefined + return [queryKey, data] + }) + } + + setQueryData< + TQueryFnData = unknown, + TTaggedQueryKey extends QueryKey = QueryKey, + TInferredQueryFnData = InferDataFromTag, + >( + queryKey: TTaggedQueryKey, + updater: Updater< + NoInfer | undefined, + NoInfer | undefined + >, + options?: SetDataOptions, + ): NoInfer | undefined { + const defaultedOptions = this.defaultQueryOptions< + any, + any, + unknown, + any, + QueryKey + >({ queryKey }) + + const query = this.#queryCache.get( + defaultedOptions.queryHash, + ) + const prevData = query?.state.data + const data = functionalUpdate(updater, prevData) + + if (data === undefined) { + return undefined + } + + return this.#queryCache + .build(this, defaultedOptions) + .setData(data, { ...options, manual: true }) + } + + setQueriesData< + TQueryFnData, + TQueryFilters extends QueryFilters = QueryFilters, + >( + filters: TQueryFilters, + updater: Updater< + NoInfer | undefined, + NoInfer | undefined + >, + options?: SetDataOptions, + ): Array<[QueryKey, TQueryFnData | undefined]> { + return notifyManager.batch(() => + this.#queryCache + .findAll(filters) + .map(({ queryKey }) => [ + queryKey, + this.setQueryData(queryKey, updater, options), + ]), + ) + } + + getQueryState< + TQueryFnData = unknown, + TError = DefaultError, + TTaggedQueryKey extends QueryKey = QueryKey, + TInferredQueryFnData = InferDataFromTag, + TInferredError = InferErrorFromTag, + >( + queryKey: TTaggedQueryKey, + ): QueryState | undefined { + const options = this.defaultQueryOptions({ queryKey }) + return this.#queryCache.get( + options.queryHash, + )?.state + } + + removeQueries( + filters?: QueryFilters, + ): void { + const queryCache = this.#queryCache + notifyManager.batch(() => { + queryCache.findAll(filters).forEach((query) => { + queryCache.remove(query) + }) + }) + } + + resetQueries( + filters?: QueryFilters, + options?: ResetOptions, + ): Promise { + const queryCache = this.#queryCache + + return notifyManager.batch(() => { + queryCache.findAll(filters).forEach((query) => { + query.reset() + }) + return this.refetchQueries( + { + type: 'active', + ...filters, + }, + options, + ) + }) + } + + cancelQueries( + filters?: QueryFilters, + cancelOptions: CancelOptions = {}, + ): Promise { + const defaultedCancelOptions = { revert: true, ...cancelOptions } + + const promises = notifyManager.batch(() => + this.#queryCache + .findAll(filters) + .map((query) => query.cancel(defaultedCancelOptions)), + ) + + return Promise.all(promises).then(noop).catch(noop) + } + + invalidateQueries( + filters?: InvalidateQueryFilters, + options: InvalidateOptions = {}, + ): Promise { + return notifyManager.batch(() => { + this.#queryCache.findAll(filters).forEach((query) => { + query.invalidate() + }) + + if (filters?.refetchType === 'none') { + return Promise.resolve() + } + return this.refetchQueries( + { + ...filters, + type: filters?.refetchType ?? filters?.type ?? 'active', + }, + options, + ) + }) + } + + refetchQueries( + filters?: RefetchQueryFilters, + options: RefetchOptions = {}, + ): Promise { + const fetchOptions = { + ...options, + cancelRefetch: options.cancelRefetch ?? true, + } + const promises = notifyManager.batch(() => + this.#queryCache + .findAll(filters) + .filter((query) => !query.isDisabled() && !query.isStatic()) + .map((query) => { + let promise = query.fetch(undefined, fetchOptions) + if (!fetchOptions.throwOnError) { + promise = promise.catch(noop) + } + return query.state.fetchStatus === 'paused' + ? Promise.resolve() + : promise + }), + ) + + return Promise.all(promises).then(noop) + } + + fetchQuery< + TQueryFnData, + TError = DefaultError, + TData = TQueryFnData, + TQueryKey extends QueryKey = QueryKey, + TPageParam = never, + >( + options: FetchQueryOptions< + TQueryFnData, + TError, + TData, + TQueryKey, + TPageParam + >, + ): Promise { + const defaultedOptions = this.defaultQueryOptions(options) + + // https://github.com/tannerlinsley/react-query/issues/652 + if (defaultedOptions.retry === undefined) { + defaultedOptions.retry = false + } + + const query = this.#queryCache.build(this, defaultedOptions) + + return query.isStaleByTime( + resolveStaleTime(defaultedOptions.staleTime, query), + ) + ? query.fetch(defaultedOptions) + : Promise.resolve(query.state.data as TData) + } + + prefetchQuery< + TQueryFnData = unknown, + TError = DefaultError, + TData = TQueryFnData, + TQueryKey extends QueryKey = QueryKey, + >( + options: FetchQueryOptions, + ): Promise { + return this.fetchQuery(options).then(noop).catch(noop) + } + + fetchInfiniteQuery< + TQueryFnData, + TError = DefaultError, + TData = TQueryFnData, + TQueryKey extends QueryKey = QueryKey, + TPageParam = unknown, + >( + options: FetchInfiniteQueryOptions< + TQueryFnData, + TError, + TData, + TQueryKey, + TPageParam + >, + ): Promise> { + options.behavior = infiniteQueryBehavior< + TQueryFnData, + TError, + TData, + TPageParam + >(options.pages) + return this.fetchQuery(options as any) + } + + prefetchInfiniteQuery< + TQueryFnData, + TError = DefaultError, + TData = TQueryFnData, + TQueryKey extends QueryKey = QueryKey, + TPageParam = unknown, + >( + options: FetchInfiniteQueryOptions< + TQueryFnData, + TError, + TData, + TQueryKey, + TPageParam + >, + ): Promise { + return this.fetchInfiniteQuery(options).then(noop).catch(noop) + } + + ensureInfiniteQueryData< + TQueryFnData, + TError = DefaultError, + TData = TQueryFnData, + TQueryKey extends QueryKey = QueryKey, + TPageParam = unknown, + >( + options: EnsureInfiniteQueryDataOptions< + TQueryFnData, + TError, + TData, + TQueryKey, + TPageParam + >, + ): Promise> { + options.behavior = infiniteQueryBehavior< + TQueryFnData, + TError, + TData, + TPageParam + >(options.pages) + + return this.ensureQueryData(options as any) + } + + resumePausedMutations(): Promise { + if (onlineManager.isOnline()) { + return this.#mutationCache.resumePausedMutations() + } + return Promise.resolve() + } + + getQueryCache(): QueryCache { + return this.#queryCache + } + + getMutationCache(): MutationCache { + return this.#mutationCache + } + + getDefaultOptions(): DefaultOptions { + return this.#defaultOptions + } + + setDefaultOptions(options: DefaultOptions): void { + this.#defaultOptions = options + } + + setQueryDefaults< + TQueryFnData = unknown, + TError = DefaultError, + TData = TQueryFnData, + TQueryData = TQueryFnData, + >( + queryKey: QueryKey, + options: Partial< + OmitKeyof< + QueryObserverOptions, + 'queryKey' + > + >, + ): void { + this.#queryDefaults.set(hashKey(queryKey), { + queryKey, + defaultOptions: options, + }) + } + + getQueryDefaults( + queryKey: QueryKey, + ): OmitKeyof, 'queryKey'> { + const defaults = [...this.#queryDefaults.values()] + + const result: OmitKeyof< + QueryObserverOptions, + 'queryKey' + > = {} + + defaults.forEach((queryDefault) => { + if (partialMatchKey(queryKey, queryDefault.queryKey)) { + Object.assign(result, queryDefault.defaultOptions) + } + }) + return result + } + + setMutationDefaults< + TData = unknown, + TError = DefaultError, + TVariables = void, + TOnMutateResult = unknown, + >( + mutationKey: MutationKey, + options: OmitKeyof< + MutationObserverOptions, + 'mutationKey' + >, + ): void { + this.#mutationDefaults.set(hashKey(mutationKey), { + mutationKey, + defaultOptions: options, + }) + } + + getMutationDefaults( + mutationKey: MutationKey, + ): OmitKeyof, 'mutationKey'> { + const defaults = [...this.#mutationDefaults.values()] + + const result: OmitKeyof< + MutationObserverOptions, + 'mutationKey' + > = {} + + defaults.forEach((queryDefault) => { + if (partialMatchKey(mutationKey, queryDefault.mutationKey)) { + Object.assign(result, queryDefault.defaultOptions) + } + }) + + return result + } + + defaultQueryOptions< + TQueryFnData = unknown, + TError = DefaultError, + TData = TQueryFnData, + TQueryData = TQueryFnData, + TQueryKey extends QueryKey = QueryKey, + TPageParam = never, + >( + options: + | QueryObserverOptions< + TQueryFnData, + TError, + TData, + TQueryData, + TQueryKey, + TPageParam + > + | DefaultedQueryObserverOptions< + TQueryFnData, + TError, + TData, + TQueryData, + TQueryKey + >, + ): DefaultedQueryObserverOptions< + TQueryFnData, + TError, + TData, + TQueryData, + TQueryKey + > { + if (options._defaulted) { + return options as DefaultedQueryObserverOptions< + TQueryFnData, + TError, + TData, + TQueryData, + TQueryKey + > + } + + const defaultedOptions = { + ...this.#defaultOptions.queries, + ...this.getQueryDefaults(options.queryKey), + ...options, + _defaulted: true, + } + + if (!defaultedOptions.queryHash) { + defaultedOptions.queryHash = hashQueryKeyByOptions( + defaultedOptions.queryKey, + defaultedOptions, + ) + } + + // dependent default values + if (defaultedOptions.refetchOnReconnect === undefined) { + defaultedOptions.refetchOnReconnect = + defaultedOptions.networkMode !== 'always' + } + if (defaultedOptions.throwOnError === undefined) { + defaultedOptions.throwOnError = !!defaultedOptions.suspense + } + + if (!defaultedOptions.networkMode && defaultedOptions.persister) { + defaultedOptions.networkMode = 'offlineFirst' + } + + if (defaultedOptions.queryFn === skipToken) { + defaultedOptions.enabled = false + } + + return defaultedOptions as DefaultedQueryObserverOptions< + TQueryFnData, + TError, + TData, + TQueryData, + TQueryKey + > + } + + defaultMutationOptions>( + options?: T, + ): T { + if (options?._defaulted) { + return options + } + return { + ...this.#defaultOptions.mutations, + ...(options?.mutationKey && + this.getMutationDefaults(options.mutationKey)), + ...options, + _defaulted: true, + } as T + } + + clear(): void { + this.#queryCache.clear() + this.#mutationCache.clear() + } +} diff --git a/node_modules/@tanstack/query-core/src/queryObserver.ts b/node_modules/@tanstack/query-core/src/queryObserver.ts new file mode 100644 index 0000000..463407a --- /dev/null +++ b/node_modules/@tanstack/query-core/src/queryObserver.ts @@ -0,0 +1,828 @@ +import { focusManager } from './focusManager' +import { notifyManager } from './notifyManager' +import { fetchState } from './query' +import { Subscribable } from './subscribable' +import { pendingThenable } from './thenable' +import { + isServer, + isValidTimeout, + noop, + replaceData, + resolveEnabled, + resolveStaleTime, + shallowEqualObjects, + timeUntilStale, +} from './utils' +import { timeoutManager } from './timeoutManager' +import type { ManagedTimerId } from './timeoutManager' +import type { FetchOptions, Query, QueryState } from './query' +import type { QueryClient } from './queryClient' +import type { PendingThenable, Thenable } from './thenable' +import type { + DefaultError, + DefaultedQueryObserverOptions, + PlaceholderDataFunction, + QueryKey, + QueryObserverBaseResult, + QueryObserverOptions, + QueryObserverResult, + RefetchOptions, +} from './types' + +type QueryObserverListener = ( + result: QueryObserverResult, +) => void + +interface ObserverFetchOptions extends FetchOptions { + throwOnError?: boolean +} + +export class QueryObserver< + TQueryFnData = unknown, + TError = DefaultError, + TData = TQueryFnData, + TQueryData = TQueryFnData, + TQueryKey extends QueryKey = QueryKey, +> extends Subscribable> { + #client: QueryClient + #currentQuery: Query = undefined! + #currentQueryInitialState: QueryState = undefined! + #currentResult: QueryObserverResult = undefined! + #currentResultState?: QueryState + #currentResultOptions?: QueryObserverOptions< + TQueryFnData, + TError, + TData, + TQueryData, + TQueryKey + > + #currentThenable: Thenable + #selectError: TError | null + #selectFn?: (data: TQueryData) => TData + #selectResult?: TData + // This property keeps track of the last query with defined data. + // It will be used to pass the previous data and query to the placeholder function between renders. + #lastQueryWithDefinedData?: Query + #staleTimeoutId?: ManagedTimerId + #refetchIntervalId?: ManagedTimerId + #currentRefetchInterval?: number | false + #trackedProps = new Set() + + constructor( + client: QueryClient, + public options: QueryObserverOptions< + TQueryFnData, + TError, + TData, + TQueryData, + TQueryKey + >, + ) { + super() + + this.#client = client + this.#selectError = null + this.#currentThenable = pendingThenable() + + this.bindMethods() + this.setOptions(options) + } + + protected bindMethods(): void { + this.refetch = this.refetch.bind(this) + } + + protected onSubscribe(): void { + if (this.listeners.size === 1) { + this.#currentQuery.addObserver(this) + + if (shouldFetchOnMount(this.#currentQuery, this.options)) { + this.#executeFetch() + } else { + this.updateResult() + } + + this.#updateTimers() + } + } + + protected onUnsubscribe(): void { + if (!this.hasListeners()) { + this.destroy() + } + } + + shouldFetchOnReconnect(): boolean { + return shouldFetchOn( + this.#currentQuery, + this.options, + this.options.refetchOnReconnect, + ) + } + + shouldFetchOnWindowFocus(): boolean { + return shouldFetchOn( + this.#currentQuery, + this.options, + this.options.refetchOnWindowFocus, + ) + } + + destroy(): void { + this.listeners = new Set() + this.#clearStaleTimeout() + this.#clearRefetchInterval() + this.#currentQuery.removeObserver(this) + } + + setOptions( + options: QueryObserverOptions< + TQueryFnData, + TError, + TData, + TQueryData, + TQueryKey + >, + ): void { + const prevOptions = this.options + const prevQuery = this.#currentQuery + + this.options = this.#client.defaultQueryOptions(options) + + if ( + this.options.enabled !== undefined && + 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', + ) + } + + this.#updateQuery() + this.#currentQuery.setOptions(this.options) + + if ( + prevOptions._defaulted && + !shallowEqualObjects(this.options, prevOptions) + ) { + this.#client.getQueryCache().notify({ + type: 'observerOptionsUpdated', + query: this.#currentQuery, + observer: this, + }) + } + + const mounted = this.hasListeners() + + // Fetch if there are subscribers + if ( + mounted && + shouldFetchOptionally( + this.#currentQuery, + prevQuery, + this.options, + prevOptions, + ) + ) { + this.#executeFetch() + } + + // Update result + this.updateResult() + + // Update stale interval if needed + 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() + } + + const nextRefetchInterval = this.#computeRefetchInterval() + + // Update refetch interval if needed + if ( + mounted && + (this.#currentQuery !== prevQuery || + resolveEnabled(this.options.enabled, this.#currentQuery) !== + resolveEnabled(prevOptions.enabled, this.#currentQuery) || + nextRefetchInterval !== this.#currentRefetchInterval) + ) { + this.#updateRefetchInterval(nextRefetchInterval) + } + } + + getOptimisticResult( + options: DefaultedQueryObserverOptions< + TQueryFnData, + TError, + TData, + TQueryData, + TQueryKey + >, + ): QueryObserverResult { + const query = this.#client.getQueryCache().build(this.#client, options) + + const result = this.createResult(query, options) + + if (shouldAssignObserverCurrentProperties(this, result)) { + // this assigns the optimistic result to the current Observer + // because if the query function changes, useQuery will be performing + // an effect where it would fetch again. + // When the fetch finishes, we perform a deep data cloning in order + // to reuse objects references. This deep data clone is performed against + // the `observer.currentResult.data` property + // When QueryKey changes, we refresh the query and get new `optimistic` + // result, while we leave the `observer.currentResult`, so when new data + // arrives, it finds the old `observer.currentResult` which is related + // to the old QueryKey. Which means that currentResult and selectData are + // out of sync already. + // To solve this, we move the cursor of the currentResult every time + // an observer reads an optimistic value. + + // When keeping the previous data, the result doesn't change until new + // data arrives. + this.#currentResult = result + this.#currentResultOptions = this.options + this.#currentResultState = this.#currentQuery.state + } + return result + } + + getCurrentResult(): QueryObserverResult { + return this.#currentResult + } + + trackResult( + result: QueryObserverResult, + onPropTracked?: (key: keyof QueryObserverResult) => void, + ): QueryObserverResult { + return new Proxy(result, { + get: (target, key) => { + this.trackProp(key as keyof QueryObserverResult) + onPropTracked?.(key as keyof QueryObserverResult) + if (key === 'promise') { + this.trackProp('data') + if ( + !this.options.experimental_prefetchInRender && + this.#currentThenable.status === 'pending' + ) { + this.#currentThenable.reject( + new Error( + 'experimental_prefetchInRender feature flag is not enabled', + ), + ) + } + } + return Reflect.get(target, key) + }, + }) + } + + trackProp(key: keyof QueryObserverResult) { + this.#trackedProps.add(key) + } + + getCurrentQuery(): Query { + return this.#currentQuery + } + + refetch({ ...options }: RefetchOptions = {}): Promise< + QueryObserverResult + > { + return this.fetch({ + ...options, + }) + } + + fetchOptimistic( + options: QueryObserverOptions< + TQueryFnData, + TError, + TData, + TQueryData, + TQueryKey + >, + ): Promise> { + const defaultedOptions = this.#client.defaultQueryOptions(options) + + const query = this.#client + .getQueryCache() + .build(this.#client, defaultedOptions) + + return query.fetch().then(() => this.createResult(query, defaultedOptions)) + } + + protected fetch( + fetchOptions: ObserverFetchOptions, + ): Promise> { + return this.#executeFetch({ + ...fetchOptions, + cancelRefetch: fetchOptions.cancelRefetch ?? true, + }).then(() => { + this.updateResult() + return this.#currentResult + }) + } + + #executeFetch( + fetchOptions?: Omit, + ): Promise { + // Make sure we reference the latest query as the current one might have been removed + this.#updateQuery() + + // Fetch + let promise: Promise = this.#currentQuery.fetch( + this.options, + fetchOptions, + ) + + if (!fetchOptions?.throwOnError) { + promise = promise.catch(noop) + } + + return promise + } + + #updateStaleTimeout(): void { + this.#clearStaleTimeout() + const staleTime = resolveStaleTime( + this.options.staleTime, + this.#currentQuery, + ) + + if (isServer || this.#currentResult.isStale || !isValidTimeout(staleTime)) { + return + } + + const time = timeUntilStale(this.#currentResult.dataUpdatedAt, staleTime) + + // The timeout is sometimes triggered 1 ms before the stale time expiration. + // To mitigate this issue we always add 1 ms to the timeout. + const timeout = time + 1 + + this.#staleTimeoutId = timeoutManager.setTimeout(() => { + if (!this.#currentResult.isStale) { + this.updateResult() + } + }, timeout) + } + + #computeRefetchInterval() { + return ( + (typeof this.options.refetchInterval === 'function' + ? this.options.refetchInterval(this.#currentQuery) + : this.options.refetchInterval) ?? false + ) + } + + #updateRefetchInterval(nextInterval: number | false): void { + this.#clearRefetchInterval() + + this.#currentRefetchInterval = nextInterval + + if ( + isServer || + resolveEnabled(this.options.enabled, this.#currentQuery) === false || + !isValidTimeout(this.#currentRefetchInterval) || + this.#currentRefetchInterval === 0 + ) { + return + } + + this.#refetchIntervalId = timeoutManager.setInterval(() => { + if ( + this.options.refetchIntervalInBackground || + focusManager.isFocused() + ) { + this.#executeFetch() + } + }, this.#currentRefetchInterval) + } + + #updateTimers(): void { + this.#updateStaleTimeout() + this.#updateRefetchInterval(this.#computeRefetchInterval()) + } + + #clearStaleTimeout(): void { + if (this.#staleTimeoutId) { + timeoutManager.clearTimeout(this.#staleTimeoutId) + this.#staleTimeoutId = undefined + } + } + + #clearRefetchInterval(): void { + if (this.#refetchIntervalId) { + timeoutManager.clearInterval(this.#refetchIntervalId) + this.#refetchIntervalId = undefined + } + } + + protected createResult( + query: Query, + options: QueryObserverOptions< + TQueryFnData, + TError, + TData, + TQueryData, + TQueryKey + >, + ): QueryObserverResult { + const prevQuery = this.#currentQuery + const prevOptions = this.options + const prevResult = this.#currentResult as + | QueryObserverResult + | undefined + const prevResultState = this.#currentResultState + const prevResultOptions = this.#currentResultOptions + const queryChange = query !== prevQuery + const queryInitialState = queryChange + ? query.state + : this.#currentQueryInitialState + + const { state } = query + let newState = { ...state } + let isPlaceholderData = false + let data: TData | undefined + + // Optimistically set result in fetching state if needed + if (options._optimisticResults) { + const mounted = this.hasListeners() + + const fetchOnMount = !mounted && shouldFetchOnMount(query, options) + + const fetchOptionally = + mounted && shouldFetchOptionally(query, prevQuery, options, prevOptions) + + if (fetchOnMount || fetchOptionally) { + newState = { + ...newState, + ...fetchState(state.data, query.options), + } + } + if (options._optimisticResults === 'isRestoring') { + newState.fetchStatus = 'idle' + } + } + + let { error, errorUpdatedAt, status } = newState + + // Per default, use query data + data = newState.data as unknown as TData + let skipSelect = false + + // use placeholderData if needed + if ( + options.placeholderData !== undefined && + data === undefined && + status === 'pending' + ) { + let placeholderData + + // Memoize placeholder data + if ( + prevResult?.isPlaceholderData && + options.placeholderData === prevResultOptions?.placeholderData + ) { + placeholderData = prevResult.data + // we have to skip select when reading this memoization + // because prevResult.data is already "selected" + skipSelect = true + } else { + // compute placeholderData + placeholderData = + typeof options.placeholderData === 'function' + ? ( + options.placeholderData as unknown as PlaceholderDataFunction + )( + this.#lastQueryWithDefinedData?.state.data, + this.#lastQueryWithDefinedData as any, + ) + : options.placeholderData + } + + if (placeholderData !== undefined) { + status = 'success' + data = replaceData( + prevResult?.data, + placeholderData as unknown, + options, + ) as TData + isPlaceholderData = true + } + } + + // Select data if needed + // this also runs placeholderData through the select function + if (options.select && data !== undefined && !skipSelect) { + // Memoize select result + if ( + prevResult && + data === prevResultState?.data && + options.select === this.#selectFn + ) { + data = this.#selectResult + } else { + try { + this.#selectFn = options.select + data = options.select(data as any) + data = replaceData(prevResult?.data, data, options) + this.#selectResult = data + this.#selectError = null + } catch (selectError) { + this.#selectError = selectError as TError + } + } + } + + if (this.#selectError) { + error = this.#selectError + data = this.#selectResult + errorUpdatedAt = Date.now() + status = 'error' + } + + const isFetching = newState.fetchStatus === 'fetching' + const isPending = status === 'pending' + const isError = status === 'error' + + const isLoading = isPending && isFetching + const hasData = data !== undefined + + const result: QueryObserverBaseResult = { + status, + fetchStatus: newState.fetchStatus, + isPending, + isSuccess: status === 'success', + isError, + isInitialLoading: isLoading, + isLoading, + data, + dataUpdatedAt: newState.dataUpdatedAt, + error, + errorUpdatedAt, + failureCount: newState.fetchFailureCount, + failureReason: newState.fetchFailureReason, + errorUpdateCount: newState.errorUpdateCount, + isFetched: newState.dataUpdateCount > 0 || newState.errorUpdateCount > 0, + isFetchedAfterMount: + newState.dataUpdateCount > queryInitialState.dataUpdateCount || + newState.errorUpdateCount > queryInitialState.errorUpdateCount, + isFetching, + isRefetching: isFetching && !isPending, + isLoadingError: isError && !hasData, + isPaused: newState.fetchStatus === 'paused', + isPlaceholderData, + isRefetchError: isError && hasData, + isStale: isStale(query, options), + refetch: this.refetch, + promise: this.#currentThenable, + isEnabled: resolveEnabled(options.enabled, query) !== false, + } + + const nextResult = result as QueryObserverResult + + if (this.options.experimental_prefetchInRender) { + const hasResultData = nextResult.data !== undefined + const isErrorWithoutData = nextResult.status === 'error' && !hasResultData + const finalizeThenableIfPossible = (thenable: PendingThenable) => { + if (isErrorWithoutData) { + thenable.reject(nextResult.error) + } else if (hasResultData) { + thenable.resolve(nextResult.data as TData) + } + } + + /** + * Create a new thenable and result promise when the results have changed + */ + const recreateThenable = () => { + const pending = + (this.#currentThenable = + nextResult.promise = + pendingThenable()) + + finalizeThenableIfPossible(pending) + } + + const prevThenable = this.#currentThenable + switch (prevThenable.status) { + case 'pending': + // Finalize the previous thenable if it was pending + // and we are still observing the same query + if (query.queryHash === prevQuery.queryHash) { + finalizeThenableIfPossible(prevThenable) + } + break + case 'fulfilled': + if (isErrorWithoutData || nextResult.data !== prevThenable.value) { + recreateThenable() + } + break + case 'rejected': + if (!isErrorWithoutData || nextResult.error !== prevThenable.reason) { + recreateThenable() + } + break + } + } + + return nextResult + } + + updateResult(): void { + const prevResult = this.#currentResult as + | QueryObserverResult + | undefined + + const nextResult = this.createResult(this.#currentQuery, this.options) + + this.#currentResultState = this.#currentQuery.state + this.#currentResultOptions = this.options + + if (this.#currentResultState.data !== undefined) { + this.#lastQueryWithDefinedData = this.#currentQuery + } + + // Only notify and update result if something has changed + if (shallowEqualObjects(nextResult, prevResult)) { + return + } + + this.#currentResult = nextResult + + const shouldNotifyListeners = (): boolean => { + if (!prevResult) { + return true + } + + const { notifyOnChangeProps } = this.options + const notifyOnChangePropsValue = + typeof notifyOnChangeProps === 'function' + ? notifyOnChangeProps() + : notifyOnChangeProps + + if ( + notifyOnChangePropsValue === 'all' || + (!notifyOnChangePropsValue && !this.#trackedProps.size) + ) { + return true + } + + const includedProps = new Set( + notifyOnChangePropsValue ?? this.#trackedProps, + ) + + if (this.options.throwOnError) { + includedProps.add('error') + } + + return Object.keys(this.#currentResult).some((key) => { + const typedKey = key as keyof QueryObserverResult + const changed = this.#currentResult[typedKey] !== prevResult[typedKey] + + return changed && includedProps.has(typedKey) + }) + } + + this.#notify({ listeners: shouldNotifyListeners() }) + } + + #updateQuery(): void { + const query = this.#client.getQueryCache().build(this.#client, this.options) + + if (query === this.#currentQuery) { + return + } + + const prevQuery = this.#currentQuery as + | Query + | undefined + this.#currentQuery = query + this.#currentQueryInitialState = query.state + + if (this.hasListeners()) { + prevQuery?.removeObserver(this) + query.addObserver(this) + } + } + + onQueryUpdate(): void { + this.updateResult() + + if (this.hasListeners()) { + this.#updateTimers() + } + } + + #notify(notifyOptions: { listeners: boolean }): void { + notifyManager.batch(() => { + // First, trigger the listeners + if (notifyOptions.listeners) { + this.listeners.forEach((listener) => { + listener(this.#currentResult) + }) + } + + // Then the cache listeners + this.#client.getQueryCache().notify({ + query: this.#currentQuery, + type: 'observerResultsUpdated', + }) + }) + } +} + +function shouldLoadOnMount( + query: Query, + options: QueryObserverOptions, +): boolean { + return ( + resolveEnabled(options.enabled, query) !== false && + query.state.data === undefined && + !(query.state.status === 'error' && options.retryOnMount === false) + ) +} + +function shouldFetchOnMount( + query: Query, + options: QueryObserverOptions, +): boolean { + return ( + shouldLoadOnMount(query, options) || + (query.state.data !== undefined && + shouldFetchOn(query, options, options.refetchOnMount)) + ) +} + +function shouldFetchOn( + query: Query, + options: QueryObserverOptions, + field: (typeof options)['refetchOnMount'] & + (typeof options)['refetchOnWindowFocus'] & + (typeof options)['refetchOnReconnect'], +) { + if ( + resolveEnabled(options.enabled, query) !== false && + resolveStaleTime(options.staleTime, query) !== 'static' + ) { + const value = typeof field === 'function' ? field(query) : field + + return value === 'always' || (value !== false && isStale(query, options)) + } + return false +} + +function shouldFetchOptionally( + query: Query, + prevQuery: Query, + options: QueryObserverOptions, + prevOptions: QueryObserverOptions, +): boolean { + return ( + (query !== prevQuery || + resolveEnabled(prevOptions.enabled, query) === false) && + (!options.suspense || query.state.status !== 'error') && + isStale(query, options) + ) +} + +function isStale( + query: Query, + options: QueryObserverOptions, +): boolean { + return ( + resolveEnabled(options.enabled, query) !== false && + query.isStaleByTime(resolveStaleTime(options.staleTime, query)) + ) +} + +// this function would decide if we will update the observer's 'current' +// properties after an optimistic reading via getOptimisticResult +function shouldAssignObserverCurrentProperties< + TQueryFnData = unknown, + TError = unknown, + TData = TQueryFnData, + TQueryData = TQueryFnData, + TQueryKey extends QueryKey = QueryKey, +>( + observer: QueryObserver, + optimisticResult: QueryObserverResult, +) { + // if the newly created result isn't what the observer is holding as current, + // then we'll need to update the properties as well + if (!shallowEqualObjects(observer.getCurrentResult(), optimisticResult)) { + return true + } + + // basically, just keep previous properties if nothing changed + return false +} diff --git a/node_modules/@tanstack/query-core/src/removable.ts b/node_modules/@tanstack/query-core/src/removable.ts new file mode 100644 index 0000000..8642ab3 --- /dev/null +++ b/node_modules/@tanstack/query-core/src/removable.ts @@ -0,0 +1,39 @@ +import { timeoutManager } from './timeoutManager' +import { isServer, isValidTimeout } from './utils' +import type { ManagedTimerId } from './timeoutManager' + +export abstract class Removable { + gcTime!: number + #gcTimeout?: ManagedTimerId + + destroy(): void { + this.clearGcTimeout() + } + + protected scheduleGc(): void { + this.clearGcTimeout() + + if (isValidTimeout(this.gcTime)) { + this.#gcTimeout = timeoutManager.setTimeout(() => { + this.optionalRemove() + }, this.gcTime) + } + } + + protected updateGcTime(newGcTime: number | undefined): void { + // Default to 5 minutes (Infinity for server-side) if no gcTime is set + this.gcTime = Math.max( + this.gcTime || 0, + newGcTime ?? (isServer ? Infinity : 5 * 60 * 1000), + ) + } + + protected clearGcTimeout() { + if (this.#gcTimeout) { + timeoutManager.clearTimeout(this.#gcTimeout) + this.#gcTimeout = undefined + } + } + + protected abstract optionalRemove(): void +} diff --git a/node_modules/@tanstack/query-core/src/retryer.ts b/node_modules/@tanstack/query-core/src/retryer.ts new file mode 100644 index 0000000..f4ada85 --- /dev/null +++ b/node_modules/@tanstack/query-core/src/retryer.ts @@ -0,0 +1,228 @@ +import { focusManager } from './focusManager' +import { onlineManager } from './onlineManager' +import { pendingThenable } from './thenable' +import { isServer, sleep } from './utils' +import type { Thenable } from './thenable' +import type { CancelOptions, DefaultError, NetworkMode } from './types' + +// TYPES + +interface RetryerConfig { + fn: () => TData | Promise + initialPromise?: Promise + onCancel?: (error: TError) => void + onFail?: (failureCount: number, error: TError) => void + onPause?: () => void + onContinue?: () => void + retry?: RetryValue + retryDelay?: RetryDelayValue + networkMode: NetworkMode | undefined + canRun: () => boolean +} + +export interface Retryer { + promise: Promise + cancel: (cancelOptions?: CancelOptions) => void + continue: () => Promise + cancelRetry: () => void + continueRetry: () => void + canStart: () => boolean + start: () => Promise + status: () => 'pending' | 'resolved' | 'rejected' +} + +export type RetryValue = boolean | number | ShouldRetryFunction + +type ShouldRetryFunction = ( + failureCount: number, + error: TError, +) => boolean + +export type RetryDelayValue = number | RetryDelayFunction + +type RetryDelayFunction = ( + failureCount: number, + error: TError, +) => number + +function defaultRetryDelay(failureCount: number) { + return Math.min(1000 * 2 ** failureCount, 30000) +} + +export function canFetch(networkMode: NetworkMode | undefined): boolean { + return (networkMode ?? 'online') === 'online' + ? onlineManager.isOnline() + : true +} + +export class CancelledError extends Error { + revert?: boolean + silent?: boolean + constructor(options?: CancelOptions) { + super('CancelledError') + this.revert = options?.revert + this.silent = options?.silent + } +} + +/** + * @deprecated Use instanceof `CancelledError` instead. + */ +export function isCancelledError(value: any): value is CancelledError { + return value instanceof CancelledError +} + +export function createRetryer( + config: RetryerConfig, +): Retryer { + let isRetryCancelled = false + let failureCount = 0 + let continueFn: ((value?: unknown) => void) | undefined + + const thenable = pendingThenable() + + const isResolved = () => + (thenable.status as Thenable['status']) !== 'pending' + + const cancel = (cancelOptions?: CancelOptions): void => { + if (!isResolved()) { + const error = new CancelledError(cancelOptions) as TError + reject(error) + + config.onCancel?.(error) + } + } + const cancelRetry = () => { + isRetryCancelled = true + } + + const continueRetry = () => { + isRetryCancelled = false + } + + const canContinue = () => + focusManager.isFocused() && + (config.networkMode === 'always' || onlineManager.isOnline()) && + config.canRun() + + const canStart = () => canFetch(config.networkMode) && config.canRun() + + const resolve = (value: any) => { + if (!isResolved()) { + continueFn?.() + thenable.resolve(value) + } + } + + const reject = (value: any) => { + if (!isResolved()) { + continueFn?.() + thenable.reject(value) + } + } + + const pause = () => { + return new Promise((continueResolve) => { + continueFn = (value) => { + if (isResolved() || canContinue()) { + continueResolve(value) + } + } + config.onPause?.() + }).then(() => { + continueFn = undefined + if (!isResolved()) { + config.onContinue?.() + } + }) + } + + // Create loop function + const run = () => { + // Do nothing if already resolved + if (isResolved()) { + return + } + + let promiseOrValue: any + + // we can re-use config.initialPromise on the first call of run() + const initialPromise = + failureCount === 0 ? config.initialPromise : undefined + + // Execute query + try { + promiseOrValue = initialPromise ?? config.fn() + } catch (error) { + promiseOrValue = Promise.reject(error) + } + + Promise.resolve(promiseOrValue) + .then(resolve) + .catch((error) => { + // Stop if the fetch is already resolved + if (isResolved()) { + return + } + + // Do we need to retry the request? + const retry = config.retry ?? (isServer ? 0 : 3) + const retryDelay = config.retryDelay ?? defaultRetryDelay + const delay = + typeof retryDelay === 'function' + ? retryDelay(failureCount, error) + : retryDelay + const shouldRetry = + retry === true || + (typeof retry === 'number' && failureCount < retry) || + (typeof retry === 'function' && retry(failureCount, error)) + + if (isRetryCancelled || !shouldRetry) { + // We are done if the query does not need to be retried + reject(error) + return + } + + failureCount++ + + // Notify on fail + config.onFail?.(failureCount, error) + + // Delay + sleep(delay) + // Pause if the document is not visible or when the device is offline + .then(() => { + return canContinue() ? undefined : pause() + }) + .then(() => { + if (isRetryCancelled) { + reject(error) + } else { + run() + } + }) + }) + } + + return { + promise: thenable, + status: () => thenable.status, + cancel, + continue: () => { + continueFn?.() + return thenable + }, + cancelRetry, + continueRetry, + canStart, + start: () => { + // Start loop + if (canStart()) { + run() + } else { + pause().then(run) + } + return thenable + }, + } +} diff --git a/node_modules/@tanstack/query-core/src/streamedQuery.ts b/node_modules/@tanstack/query-core/src/streamedQuery.ts new file mode 100644 index 0000000..8fa57c5 --- /dev/null +++ b/node_modules/@tanstack/query-core/src/streamedQuery.ts @@ -0,0 +1,122 @@ +import { addConsumeAwareSignal, addToEnd } from './utils' +import type { + OmitKeyof, + QueryFunction, + QueryFunctionContext, + QueryKey, +} from './types' + +type BaseStreamedQueryParams = { + streamFn: ( + context: QueryFunctionContext, + ) => AsyncIterable | Promise> + refetchMode?: 'append' | 'reset' | 'replace' +} + +type SimpleStreamedQueryParams< + TQueryFnData, + TQueryKey extends QueryKey, +> = BaseStreamedQueryParams & { + reducer?: never + initialValue?: never +} + +type ReducibleStreamedQueryParams< + TQueryFnData, + TData, + TQueryKey extends QueryKey, +> = BaseStreamedQueryParams & { + reducer: (acc: TData, chunk: TQueryFnData) => TData + initialValue: TData +} + +type StreamedQueryParams = + | SimpleStreamedQueryParams + | ReducibleStreamedQueryParams + +/** + * This is a helper function to create a query function that streams data from an AsyncIterable. + * Data will be an Array of all the chunks received. + * The query will be in a 'pending' state until the first chunk of data is received, but will go to 'success' after that. + * The query will stay in fetchStatus 'fetching' until the stream ends. + * @param queryFn - The function that returns an AsyncIterable to stream data from. + * @param refetchMode - Defines how re-fetches are handled. + * Defaults to `'reset'`, erases all data and puts the query back into `pending` state. + * Set to `'append'` to append new data to the existing data. + * Set to `'replace'` to write all data to the cache once the stream ends. + * @param reducer - A function to reduce the streamed chunks into the final data. + * Defaults to a function that appends chunks to the end of the array. + * @param initialValue - Initial value to be used while the first chunk is being fetched, and returned if the stream yields no values. + */ +export function streamedQuery< + TQueryFnData = unknown, + TData = Array, + TQueryKey extends QueryKey = QueryKey, +>({ + streamFn, + refetchMode = 'reset', + reducer = (items, chunk) => + addToEnd(items as Array, chunk) as TData, + initialValue = [] as TData, +}: StreamedQueryParams): QueryFunction< + TData, + TQueryKey +> { + return async (context) => { + const query = context.client + .getQueryCache() + .find({ queryKey: context.queryKey, exact: true }) + const isRefetch = !!query && query.state.data !== undefined + if (isRefetch && refetchMode === 'reset') { + query.setState({ + status: 'pending', + data: undefined, + error: null, + fetchStatus: 'fetching', + }) + } + + let result = initialValue + + let cancelled: boolean = false as boolean + const streamFnContext = addConsumeAwareSignal< + OmitKeyof + >( + { + client: context.client, + meta: context.meta, + queryKey: context.queryKey, + pageParam: context.pageParam, + direction: context.direction, + }, + () => context.signal, + () => (cancelled = true), + ) + + const stream = await streamFn(streamFnContext) + + const isReplaceRefetch = isRefetch && refetchMode === 'replace' + + for await (const chunk of stream) { + if (cancelled) { + break + } + + if (isReplaceRefetch) { + // don't append to the cache directly when replace-refetching + result = reducer(result, chunk) + } else { + context.client.setQueryData(context.queryKey, (prev) => + reducer(prev === undefined ? initialValue : prev, chunk), + ) + } + } + + // finalize result: replace-refetching needs to write to the cache + if (isReplaceRefetch && !cancelled) { + context.client.setQueryData(context.queryKey, result) + } + + return context.client.getQueryData(context.queryKey) ?? initialValue + } +} diff --git a/node_modules/@tanstack/query-core/src/subscribable.ts b/node_modules/@tanstack/query-core/src/subscribable.ts new file mode 100644 index 0000000..044efe6 --- /dev/null +++ b/node_modules/@tanstack/query-core/src/subscribable.ts @@ -0,0 +1,30 @@ +export class Subscribable { + protected listeners = new Set() + + constructor() { + this.subscribe = this.subscribe.bind(this) + } + + subscribe(listener: TListener): () => void { + this.listeners.add(listener) + + this.onSubscribe() + + return () => { + this.listeners.delete(listener) + this.onUnsubscribe() + } + } + + hasListeners(): boolean { + return this.listeners.size > 0 + } + + protected onSubscribe(): void { + // Do nothing + } + + protected onUnsubscribe(): void { + // Do nothing + } +} diff --git a/node_modules/@tanstack/query-core/src/thenable.ts b/node_modules/@tanstack/query-core/src/thenable.ts new file mode 100644 index 0000000..5e54411 --- /dev/null +++ b/node_modules/@tanstack/query-core/src/thenable.ts @@ -0,0 +1,111 @@ +/** + * Thenable types which matches React's types for promises + * + * React seemingly uses `.status`, `.value` and `.reason` properties on a promises to optimistically unwrap data from promises + * + * @see https://github.com/facebook/react/blob/main/packages/shared/ReactTypes.js#L112-L138 + * @see https://github.com/facebook/react/blob/4f604941569d2e8947ce1460a0b2997e835f37b9/packages/react-debug-tools/src/ReactDebugHooks.js#L224-L227 + */ + +import { noop } from './utils' + +interface Fulfilled { + status: 'fulfilled' + value: T +} +interface Rejected { + status: 'rejected' + reason: unknown +} +interface Pending { + status: 'pending' + + /** + * Resolve the promise with a value. + * Will remove the `resolve` and `reject` properties from the promise. + */ + resolve: (value: T) => void + /** + * Reject the promise with a reason. + * Will remove the `resolve` and `reject` properties from the promise. + */ + reject: (reason: unknown) => void +} + +export type FulfilledThenable = Promise & Fulfilled +export type RejectedThenable = Promise & Rejected +export type PendingThenable = Promise & Pending + +export type Thenable = + | FulfilledThenable + | RejectedThenable + | PendingThenable + +export function pendingThenable(): PendingThenable { + let resolve: Pending['resolve'] + let reject: Pending['reject'] + // this could use `Promise.withResolvers()` in the future + const thenable = new Promise((_resolve, _reject) => { + resolve = _resolve + reject = _reject + }) as PendingThenable + + thenable.status = 'pending' + thenable.catch(() => { + // prevent unhandled rejection errors + }) + + function finalize(data: Fulfilled | Rejected) { + Object.assign(thenable, data) + + // clear pending props props to avoid calling them twice + delete (thenable as Partial>).resolve + delete (thenable as Partial>).reject + } + + thenable.resolve = (value) => { + finalize({ + status: 'fulfilled', + value, + }) + + resolve(value) + } + thenable.reject = (reason) => { + finalize({ + status: 'rejected', + reason, + }) + + reject(reason) + } + + return thenable +} + +/** + * This function takes a Promise-like input and detects whether the data + * is synchronously available or not. + * + * It does not inspect .status, .value or .reason properties of the promise, + * as those are not always available, and the .status of React's promises + * should not be considered part of the public API. + */ +export function tryResolveSync(promise: Promise | Thenable) { + let data: unknown + + promise + .then((result) => { + data = result + return result + }, noop) + // .catch can be unavailable on certain kinds of thenable's + // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition + ?.catch(noop) + + if (data !== undefined) { + return { data } + } + + return undefined +} diff --git a/node_modules/@tanstack/query-core/src/timeoutManager.ts b/node_modules/@tanstack/query-core/src/timeoutManager.ts new file mode 100644 index 0000000..97f0870 --- /dev/null +++ b/node_modules/@tanstack/query-core/src/timeoutManager.ts @@ -0,0 +1,135 @@ +/** + * {@link TimeoutManager} does not support passing arguments to the callback. + * + * `(_: void)` is the argument type inferred by TypeScript's default typings for + * `setTimeout(cb, number)`. + * If we don't accept a single void argument, then + * `new Promise(resolve => timeoutManager.setTimeout(resolve, N))` is a type error. + */ +export type TimeoutCallback = (_: void) => void + +/** + * Wrapping `setTimeout` is awkward from a typing perspective because platform + * typings may extend the return type of `setTimeout`. For example, NodeJS + * typings add `NodeJS.Timeout`; but a non-default `timeoutManager` may not be + * able to return such a type. + */ +export type ManagedTimerId = number | { [Symbol.toPrimitive]: () => number } + +/** + * Backend for timer functions. + */ +export type TimeoutProvider = + { + readonly setTimeout: (callback: TimeoutCallback, delay: number) => TTimerId + readonly clearTimeout: (timeoutId: TTimerId | undefined) => void + + readonly setInterval: (callback: TimeoutCallback, delay: number) => TTimerId + readonly clearInterval: (intervalId: TTimerId | undefined) => void + } + +export const defaultTimeoutProvider: TimeoutProvider< + ReturnType +> = { + // We need the wrapper function syntax below instead of direct references to + // global setTimeout etc. + // + // BAD: `setTimeout: setTimeout` + // GOOD: `setTimeout: (cb, delay) => setTimeout(cb, delay)` + // + // If we use direct references here, then anything that wants to spy on or + // replace the global setTimeout (like tests) won't work since we'll already + // have a hard reference to the original implementation at the time when this + // file was imported. + setTimeout: (callback, delay) => setTimeout(callback, delay), + clearTimeout: (timeoutId) => clearTimeout(timeoutId), + + setInterval: (callback, delay) => setInterval(callback, delay), + clearInterval: (intervalId) => clearInterval(intervalId), +} + +/** + * Allows customization of how timeouts are created. + * + * @tanstack/query-core makes liberal use of timeouts to implement `staleTime` + * and `gcTime`. The default TimeoutManager provider uses the platform's global + * `setTimeout` implementation, which is known to have scalability issues with + * thousands of timeouts on the event loop. + * + * If you hit this limitation, consider providing a custom TimeoutProvider that + * coalesces timeouts. + */ +export class TimeoutManager implements Omit { + // We cannot have TimeoutManager as we must instantiate it with a concrete + // type at app boot; and if we leave that type, then any new timer provider + // would need to support ReturnType, which is infeasible. + // + // We settle for type safety for the TimeoutProvider type, and accept that + // this class is unsafe internally to allow for extension. + #provider: TimeoutProvider = defaultTimeoutProvider + #providerCalled = false + + setTimeoutProvider( + provider: TimeoutProvider, + ): void { + if (process.env.NODE_ENV !== 'production') { + if (this.#providerCalled && provider !== this.#provider) { + // After changing providers, `clearTimeout` will not work as expected for + // timeouts from the previous provider. + // + // Since they may allocate the same timeout ID, clearTimeout may cancel an + // arbitrary different timeout, or unexpected no-op. + // + // We could protect against this by mixing the timeout ID bits + // deterministically with some per-provider bits. + // + // We could internally queue `setTimeout` calls to `TimeoutManager` until + // some API call to set the initial provider. + console.error( + `[timeoutManager]: Switching provider after calls to previous provider might result in unexpected behavior.`, + { previous: this.#provider, provider }, + ) + } + } + + this.#provider = provider + if (process.env.NODE_ENV !== 'production') { + this.#providerCalled = false + } + } + + setTimeout(callback: TimeoutCallback, delay: number): ManagedTimerId { + if (process.env.NODE_ENV !== 'production') { + this.#providerCalled = true + } + return this.#provider.setTimeout(callback, delay) + } + + clearTimeout(timeoutId: ManagedTimerId | undefined): void { + this.#provider.clearTimeout(timeoutId) + } + + setInterval(callback: TimeoutCallback, delay: number): ManagedTimerId { + if (process.env.NODE_ENV !== 'production') { + this.#providerCalled = true + } + return this.#provider.setInterval(callback, delay) + } + + clearInterval(intervalId: ManagedTimerId | undefined): void { + this.#provider.clearInterval(intervalId) + } +} + +export const timeoutManager = new TimeoutManager() + +/** + * In many cases code wants to delay to the next event loop tick; this is not + * mediated by {@link timeoutManager}. + * + * This function is provided to make auditing the `tanstack/query-core` for + * incorrect use of system `setTimeout` easier. + */ +export function systemSetTimeoutZero(callback: TimeoutCallback): void { + setTimeout(callback, 0) +} diff --git a/node_modules/@tanstack/query-core/src/types.ts b/node_modules/@tanstack/query-core/src/types.ts new file mode 100644 index 0000000..4f3f4ca --- /dev/null +++ b/node_modules/@tanstack/query-core/src/types.ts @@ -0,0 +1,1391 @@ +/* istanbul ignore file */ + +import type { QueryClient } from './queryClient' +import type { DehydrateOptions, HydrateOptions } from './hydration' +import type { MutationState } from './mutation' +import type { FetchDirection, Query, QueryBehavior } from './query' +import type { RetryDelayValue, RetryValue } from './retryer' +import type { QueryFilters, QueryTypeFilter, SkipToken } from './utils' +import type { QueryCache } from './queryCache' +import type { MutationCache } from './mutationCache' + +export type NonUndefinedGuard = T extends undefined ? never : T + +export type DistributiveOmit< + TObject, + TKey extends keyof TObject, +> = TObject extends any ? Omit : never + +export type OmitKeyof< + TObject, + TKey extends TStrictly extends 'safely' + ? + | keyof TObject + | (string & Record) + | (number & Record) + | (symbol & Record) + : keyof TObject, + TStrictly extends 'strictly' | 'safely' = 'strictly', +> = Omit + +export type Override = { + [AKey in keyof TTargetA]: AKey extends keyof TTargetB + ? TTargetB[AKey] + : TTargetA[AKey] +} + +export type NoInfer = [T][T extends any ? 0 : never] + +export interface Register { + // defaultError: Error + // queryMeta: Record + // mutationMeta: Record + // queryKey: ReadonlyArray + // mutationKey: ReadonlyArray +} + +export type DefaultError = Register extends { + defaultError: infer TError +} + ? TError + : Error + +export type QueryKey = Register extends { + queryKey: infer TQueryKey +} + ? TQueryKey extends ReadonlyArray + ? TQueryKey + : TQueryKey extends Array + ? TQueryKey + : ReadonlyArray + : ReadonlyArray + +export const dataTagSymbol = Symbol('dataTagSymbol') +export type dataTagSymbol = typeof dataTagSymbol +export const dataTagErrorSymbol = Symbol('dataTagErrorSymbol') +export type dataTagErrorSymbol = typeof dataTagErrorSymbol +export const unsetMarker = Symbol('unsetMarker') +export type UnsetMarker = typeof unsetMarker +export type AnyDataTag = { + [dataTagSymbol]: any + [dataTagErrorSymbol]: any +} +export type DataTag< + TType, + TValue, + TError = UnsetMarker, +> = TType extends AnyDataTag + ? TType + : TType & { + [dataTagSymbol]: TValue + [dataTagErrorSymbol]: TError + } + +export type InferDataFromTag = + TTaggedQueryKey extends DataTag + ? TaggedValue + : TQueryFnData + +export type InferErrorFromTag = + TTaggedQueryKey extends DataTag + ? TaggedError extends UnsetMarker + ? TError + : TaggedError + : TError + +export type QueryFunction< + T = unknown, + TQueryKey extends QueryKey = QueryKey, + TPageParam = never, +> = (context: QueryFunctionContext) => T | Promise + +export type StaleTime = number | 'static' + +export type StaleTimeFunction< + TQueryFnData = unknown, + TError = DefaultError, + TData = TQueryFnData, + TQueryKey extends QueryKey = QueryKey, +> = + | StaleTime + | ((query: Query) => StaleTime) + +export type Enabled< + TQueryFnData = unknown, + TError = DefaultError, + TData = TQueryFnData, + TQueryKey extends QueryKey = QueryKey, +> = + | boolean + | ((query: Query) => boolean) + +export type QueryPersister< + T = unknown, + TQueryKey extends QueryKey = QueryKey, + TPageParam = never, +> = [TPageParam] extends [never] + ? ( + queryFn: QueryFunction, + context: QueryFunctionContext, + query: Query, + ) => T | Promise + : ( + queryFn: QueryFunction, + context: QueryFunctionContext, + query: Query, + ) => T | Promise + +export type QueryFunctionContext< + TQueryKey extends QueryKey = QueryKey, + TPageParam = never, +> = [TPageParam] extends [never] + ? { + client: QueryClient + queryKey: TQueryKey + signal: AbortSignal + meta: QueryMeta | undefined + pageParam?: unknown + /** + * @deprecated + * if you want access to the direction, you can add it to the pageParam + */ + direction?: unknown + } + : { + client: QueryClient + queryKey: TQueryKey + signal: AbortSignal + pageParam: TPageParam + /** + * @deprecated + * if you want access to the direction, you can add it to the pageParam + */ + direction: FetchDirection + meta: QueryMeta | undefined + } + +export type InitialDataFunction = () => T | undefined + +type NonFunctionGuard = T extends Function ? never : T + +export type PlaceholderDataFunction< + TQueryFnData = unknown, + TError = DefaultError, + TQueryData = TQueryFnData, + TQueryKey extends QueryKey = QueryKey, +> = ( + previousData: TQueryData | undefined, + previousQuery: Query | undefined, +) => TQueryData | undefined + +export type QueriesPlaceholderDataFunction = ( + previousData: undefined, + previousQuery: undefined, +) => TQueryData | undefined + +export type QueryKeyHashFunction = ( + queryKey: TQueryKey, +) => string + +export type GetPreviousPageParamFunction = ( + firstPage: TQueryFnData, + allPages: Array, + firstPageParam: TPageParam, + allPageParams: Array, +) => TPageParam | undefined | null + +export type GetNextPageParamFunction = ( + lastPage: TQueryFnData, + allPages: Array, + lastPageParam: TPageParam, + allPageParams: Array, +) => TPageParam | undefined | null + +export interface InfiniteData { + pages: Array + pageParams: Array +} + +export type QueryMeta = Register extends { + queryMeta: infer TQueryMeta +} + ? TQueryMeta extends Record + ? TQueryMeta + : Record + : Record + +export type NetworkMode = 'online' | 'always' | 'offlineFirst' + +export type NotifyOnChangeProps = + | Array + | 'all' + | undefined + | (() => Array | 'all' | undefined) + +export interface QueryOptions< + TQueryFnData = unknown, + TError = DefaultError, + TData = TQueryFnData, + TQueryKey extends QueryKey = QueryKey, + TPageParam = never, +> { + /** + * If `false`, failed queries will not retry by default. + * If `true`, failed queries will retry infinitely., failureCount: num + * If set to an integer number, e.g. 3, failed queries will retry until the failed query count meets that number. + * If set to a function `(failureCount, error) => boolean` failed queries will retry until the function returns false. + */ + retry?: RetryValue + retryDelay?: RetryDelayValue + networkMode?: NetworkMode + /** + * The time in milliseconds that unused/inactive cache data remains in memory. + * When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration. + * When different garbage collection times are specified, the longest one will be used. + * Setting it to `Infinity` will disable garbage collection. + */ + gcTime?: number + queryFn?: QueryFunction | SkipToken + persister?: QueryPersister< + NoInfer, + NoInfer, + NoInfer + > + queryHash?: string + queryKey?: TQueryKey + queryKeyHashFn?: QueryKeyHashFunction + initialData?: TData | InitialDataFunction + initialDataUpdatedAt?: number | (() => number | undefined) + behavior?: QueryBehavior + /** + * Set this to `false` to disable structural sharing between query results. + * Set this to a function which accepts the old and new data and returns resolved data of the same type to implement custom structural sharing logic. + * Defaults to `true`. + */ + structuralSharing?: + | boolean + | ((oldData: unknown | undefined, newData: unknown) => unknown) + _defaulted?: boolean + /** + * Additional payload to be stored on each query. + * Use this property to pass information that can be used in other places. + */ + meta?: QueryMeta + /** + * Maximum number of pages to store in the data of an infinite query. + */ + maxPages?: number +} + +export interface InitialPageParam { + initialPageParam: TPageParam +} + +export interface InfiniteQueryPageParamsOptions< + TQueryFnData = unknown, + TPageParam = unknown, +> extends InitialPageParam { + /** + * This function can be set to automatically get the previous cursor for infinite queries. + * The result will also be used to determine the value of `hasPreviousPage`. + */ + getPreviousPageParam?: GetPreviousPageParamFunction + /** + * This function can be set to automatically get the next cursor for infinite queries. + * The result will also be used to determine the value of `hasNextPage`. + */ + getNextPageParam: GetNextPageParamFunction +} + +export type ThrowOnError< + TQueryFnData, + TError, + TQueryData, + TQueryKey extends QueryKey, +> = + | boolean + | (( + error: TError, + query: Query, + ) => boolean) + +export interface QueryObserverOptions< + TQueryFnData = unknown, + TError = DefaultError, + TData = TQueryFnData, + TQueryData = TQueryFnData, + TQueryKey extends QueryKey = QueryKey, + TPageParam = never, +> extends WithRequired< + QueryOptions, + 'queryKey' +> { + /** + * Set this to `false` or a function that returns `false` to disable automatic refetching when the query mounts or changes query keys. + * To refetch the query, use the `refetch` method returned from the `useQuery` instance. + * Accepts a boolean or function that returns a boolean. + * Defaults to `true`. + */ + enabled?: Enabled + /** + * The time in milliseconds after data is considered stale. + * If set to `Infinity`, the data will never be considered stale. + * If set to a function, the function will be executed with the query to compute a `staleTime`. + * Defaults to `0`. + */ + staleTime?: StaleTimeFunction + /** + * If set to a number, the query will continuously refetch at this frequency in milliseconds. + * If set to a function, the function will be executed with the latest data and query to compute a frequency + * Defaults to `false`. + */ + refetchInterval?: + | number + | false + | (( + query: Query, + ) => number | false | undefined) + /** + * If set to `true`, the query will continue to refetch while their tab/window is in the background. + * Defaults to `false`. + */ + refetchIntervalInBackground?: boolean + /** + * If set to `true`, the query will refetch on window focus if the data is stale. + * If set to `false`, the query will not refetch on window focus. + * If set to `'always'`, the query will always refetch on window focus. + * If set to a function, the function will be executed with the latest data and query to compute the value. + * Defaults to `true`. + */ + refetchOnWindowFocus?: + | boolean + | 'always' + | (( + query: Query, + ) => boolean | 'always') + /** + * If set to `true`, the query will refetch on reconnect if the data is stale. + * If set to `false`, the query will not refetch on reconnect. + * If set to `'always'`, the query will always refetch on reconnect. + * If set to a function, the function will be executed with the latest data and query to compute the value. + * Defaults to the value of `networkOnline` (`true`) + */ + refetchOnReconnect?: + | boolean + | 'always' + | (( + query: Query, + ) => boolean | 'always') + /** + * If set to `true`, the query will refetch on mount if the data is stale. + * If set to `false`, will disable additional instances of a query to trigger background refetch. + * If set to `'always'`, the query will always refetch on mount. + * If set to a function, the function will be executed with the latest data and query to compute the value + * Defaults to `true`. + */ + refetchOnMount?: + | boolean + | 'always' + | (( + query: Query, + ) => boolean | 'always') + /** + * If set to `false`, the query will not be retried on mount if it contains an error. + * Defaults to `true`. + */ + retryOnMount?: boolean + /** + * If set, the component will only re-render if any of the listed properties change. + * When set to `['data', 'error']`, the component will only re-render when the `data` or `error` properties change. + * When set to `'all'`, the component will re-render whenever a query is updated. + * When set to a function, the function will be executed to compute the list of properties. + * By default, access to properties will be tracked, and the component will only re-render when one of the tracked properties change. + */ + notifyOnChangeProps?: NotifyOnChangeProps + /** + * Whether errors should be thrown instead of setting the `error` property. + * If set to `true` or `suspense` is `true`, all errors will be thrown to the error boundary. + * If set to `false` and `suspense` is `false`, errors are returned as state. + * If set to a function, it will be passed the error and the query, and it should return a boolean indicating whether to show the error in an error boundary (`true`) or return the error as state (`false`). + * Defaults to `false`. + */ + throwOnError?: ThrowOnError + /** + * This option can be used to transform or select a part of the data returned by the query function. + */ + select?: (data: TQueryData) => TData + /** + * If set to `true`, the query will suspend when `status === 'pending'` + * and throw errors when `status === 'error'`. + * Defaults to `false`. + */ + suspense?: boolean + /** + * If set, this value will be used as the placeholder data for this particular query observer while the query is still in the `loading` data and no initialData has been provided. + */ + placeholderData?: + | NonFunctionGuard + | PlaceholderDataFunction< + NonFunctionGuard, + TError, + NonFunctionGuard, + TQueryKey + > + + _optimisticResults?: 'optimistic' | 'isRestoring' + + /** + * Enable prefetching during rendering + */ + experimental_prefetchInRender?: boolean +} + +export type WithRequired = TTarget & { + [_ in TKey]: {} +} + +export type DefaultedQueryObserverOptions< + TQueryFnData = unknown, + TError = DefaultError, + TData = TQueryFnData, + TQueryData = TQueryFnData, + TQueryKey extends QueryKey = QueryKey, +> = WithRequired< + QueryObserverOptions, + 'throwOnError' | 'refetchOnReconnect' | 'queryHash' +> + +export interface InfiniteQueryObserverOptions< + TQueryFnData = unknown, + TError = DefaultError, + TData = TQueryFnData, + TQueryKey extends QueryKey = QueryKey, + TPageParam = unknown, +> + extends + QueryObserverOptions< + TQueryFnData, + TError, + TData, + InfiniteData, + TQueryKey, + TPageParam + >, + InfiniteQueryPageParamsOptions {} + +export type DefaultedInfiniteQueryObserverOptions< + TQueryFnData = unknown, + TError = DefaultError, + TData = TQueryFnData, + TQueryKey extends QueryKey = QueryKey, + TPageParam = unknown, +> = WithRequired< + InfiniteQueryObserverOptions< + TQueryFnData, + TError, + TData, + TQueryKey, + TPageParam + >, + 'throwOnError' | 'refetchOnReconnect' | 'queryHash' +> + +export interface FetchQueryOptions< + TQueryFnData = unknown, + TError = DefaultError, + TData = TQueryFnData, + TQueryKey extends QueryKey = QueryKey, + TPageParam = never, +> extends WithRequired< + QueryOptions, + 'queryKey' +> { + initialPageParam?: never + /** + * The time in milliseconds after data is considered stale. + * If the data is fresh it will be returned from the cache. + */ + staleTime?: StaleTimeFunction +} + +export interface EnsureQueryDataOptions< + TQueryFnData = unknown, + TError = DefaultError, + TData = TQueryFnData, + TQueryKey extends QueryKey = QueryKey, + TPageParam = never, +> extends FetchQueryOptions< + TQueryFnData, + TError, + TData, + TQueryKey, + TPageParam +> { + revalidateIfStale?: boolean +} + +export type EnsureInfiniteQueryDataOptions< + TQueryFnData = unknown, + TError = DefaultError, + TData = TQueryFnData, + TQueryKey extends QueryKey = QueryKey, + TPageParam = unknown, +> = FetchInfiniteQueryOptions< + TQueryFnData, + TError, + TData, + TQueryKey, + TPageParam +> & { + revalidateIfStale?: boolean +} + +type FetchInfiniteQueryPages = + | { pages?: never } + | { + pages: number + getNextPageParam: GetNextPageParamFunction + } + +export type FetchInfiniteQueryOptions< + TQueryFnData = unknown, + TError = DefaultError, + TData = TQueryFnData, + TQueryKey extends QueryKey = QueryKey, + TPageParam = unknown, +> = Omit< + FetchQueryOptions< + TQueryFnData, + TError, + InfiniteData, + TQueryKey, + TPageParam + >, + 'initialPageParam' +> & + InitialPageParam & + FetchInfiniteQueryPages + +export interface ResultOptions { + throwOnError?: boolean +} + +export interface RefetchOptions extends ResultOptions { + /** + * If set to `true`, a currently running request will be cancelled before a new request is made + * + * If set to `false`, no refetch will be made if there is already a request running. + * + * Defaults to `true`. + */ + cancelRefetch?: boolean +} + +export interface InvalidateQueryFilters< + TQueryKey extends QueryKey = QueryKey, +> extends QueryFilters { + refetchType?: QueryTypeFilter | 'none' +} + +export interface RefetchQueryFilters< + TQueryKey extends QueryKey = QueryKey, +> extends QueryFilters {} + +export interface InvalidateOptions extends RefetchOptions {} +export interface ResetOptions extends RefetchOptions {} + +export interface FetchNextPageOptions extends ResultOptions { + /** + * If set to `true`, calling `fetchNextPage` repeatedly will invoke `queryFn` every time, + * whether the previous invocation has resolved or not. Also, the result from previous invocations will be ignored. + * + * If set to `false`, calling `fetchNextPage` repeatedly won't have any effect until the first invocation has resolved. + * + * Defaults to `true`. + */ + cancelRefetch?: boolean +} + +export interface FetchPreviousPageOptions extends ResultOptions { + /** + * If set to `true`, calling `fetchPreviousPage` repeatedly will invoke `queryFn` every time, + * whether the previous invocation has resolved or not. Also, the result from previous invocations will be ignored. + * + * If set to `false`, calling `fetchPreviousPage` repeatedly won't have any effect until the first invocation has resolved. + * + * Defaults to `true`. + */ + cancelRefetch?: boolean +} + +export type QueryStatus = 'pending' | 'error' | 'success' +export type FetchStatus = 'fetching' | 'paused' | 'idle' + +export interface QueryObserverBaseResult< + TData = unknown, + TError = DefaultError, +> { + /** + * The last successfully resolved data for the query. + */ + data: TData | undefined + /** + * The timestamp for when the query most recently returned the `status` as `"success"`. + */ + dataUpdatedAt: number + /** + * The error object for the query, if an error was thrown. + * - Defaults to `null`. + */ + error: TError | null + /** + * The timestamp for when the query most recently returned the `status` as `"error"`. + */ + errorUpdatedAt: number + /** + * The failure count for the query. + * - Incremented every time the query fails. + * - Reset to `0` when the query succeeds. + */ + failureCount: number + /** + * The failure reason for the query retry. + * - Reset to `null` when the query succeeds. + */ + failureReason: TError | null + /** + * The sum of all errors. + */ + errorUpdateCount: number + /** + * A derived boolean from the `status` variable, provided for convenience. + * - `true` if the query attempt resulted in an error. + */ + isError: boolean + /** + * Will be `true` if the query has been fetched. + */ + isFetched: boolean + /** + * Will be `true` if the query has been fetched after the component mounted. + * - This property can be used to not show any previously cached data. + */ + isFetchedAfterMount: boolean + /** + * A derived boolean from the `fetchStatus` variable, provided for convenience. + * - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. + */ + isFetching: boolean + /** + * Is `true` whenever the first fetch for a query is in-flight. + * - Is the same as `isFetching && isPending`. + */ + isLoading: boolean + /** + * Will be `pending` if there's no cached data and no query attempt was finished yet. + */ + isPending: boolean + /** + * Will be `true` if the query failed while fetching for the first time. + */ + isLoadingError: boolean + /** + * @deprecated `isInitialLoading` is being deprecated in favor of `isLoading` + * and will be removed in the next major version. + */ + isInitialLoading: boolean + /** + * A derived boolean from the `fetchStatus` variable, provided for convenience. + * - The query wanted to fetch, but has been `paused`. + */ + isPaused: boolean + /** + * Will be `true` if the data shown is the placeholder data. + */ + isPlaceholderData: boolean + /** + * Will be `true` if the query failed while refetching. + */ + isRefetchError: boolean + /** + * Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. + * - Is the same as `isFetching && !isPending`. + */ + isRefetching: boolean + /** + * Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. + */ + isStale: boolean + /** + * A derived boolean from the `status` variable, provided for convenience. + * - `true` if the query has received a response with no errors and is ready to display its data. + */ + isSuccess: boolean + /** + * `true` if this observer is enabled, `false` otherwise. + */ + isEnabled: boolean + /** + * A function to manually refetch the query. + */ + refetch: ( + options?: RefetchOptions, + ) => Promise> + /** + * The status of the query. + * - Will be: + * - `pending` if there's no cached data and no query attempt was finished yet. + * - `error` if the query attempt resulted in an error. + * - `success` if the query has received a response with no errors and is ready to display its data. + */ + status: QueryStatus + /** + * The fetch status of the query. + * - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. + * - `paused`: The query wanted to fetch, but has been `paused`. + * - `idle`: The query is not fetching. + * - See [Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information. + */ + fetchStatus: FetchStatus + /** + * A stable promise that will be resolved with the data of the query. + * Requires the `experimental_prefetchInRender` feature flag to be enabled. + * @example + * + * ### Enabling the feature flag + * ```ts + * const client = new QueryClient({ + * defaultOptions: { + * queries: { + * experimental_prefetchInRender: true, + * }, + * }, + * }) + * ``` + * + * ### Usage + * ```tsx + * import { useQuery } from '@tanstack/react-query' + * import React from 'react' + * import { fetchTodos, type Todo } from './api' + * + * function TodoList({ query }: { query: UseQueryResult }) { + * const data = React.use(query.promise) + * + * return ( + *
    + * {data.map(todo => ( + *
  • {todo.title}
  • + * ))} + *
+ * ) + * } + * + * export function App() { + * const query = useQuery({ queryKey: ['todos'], queryFn: fetchTodos }) + * + * return ( + * <> + *

Todos

+ * Loading...}> + * + * + * + * ) + * } + * ``` + */ + promise: Promise +} + +export interface QueryObserverPendingResult< + TData = unknown, + TError = DefaultError, +> extends QueryObserverBaseResult { + data: undefined + error: null + isError: false + isPending: true + isLoadingError: false + isRefetchError: false + isSuccess: false + isPlaceholderData: false + status: 'pending' +} + +export interface QueryObserverLoadingResult< + TData = unknown, + TError = DefaultError, +> extends QueryObserverBaseResult { + data: undefined + error: null + isError: false + isPending: true + isLoading: true + isLoadingError: false + isRefetchError: false + isSuccess: false + isPlaceholderData: false + status: 'pending' +} + +export interface QueryObserverLoadingErrorResult< + TData = unknown, + TError = DefaultError, +> extends QueryObserverBaseResult { + data: undefined + error: TError + isError: true + isPending: false + isLoading: false + isLoadingError: true + isRefetchError: false + isSuccess: false + isPlaceholderData: false + status: 'error' +} + +export interface QueryObserverRefetchErrorResult< + TData = unknown, + TError = DefaultError, +> extends QueryObserverBaseResult { + data: TData + error: TError + isError: true + isPending: false + isLoading: false + isLoadingError: false + isRefetchError: true + isSuccess: false + isPlaceholderData: false + status: 'error' +} + +export interface QueryObserverSuccessResult< + TData = unknown, + TError = DefaultError, +> extends QueryObserverBaseResult { + data: TData + error: null + isError: false + isPending: false + isLoading: false + isLoadingError: false + isRefetchError: false + isSuccess: true + isPlaceholderData: false + status: 'success' +} + +export interface QueryObserverPlaceholderResult< + TData = unknown, + TError = DefaultError, +> extends QueryObserverBaseResult { + data: TData + isError: false + error: null + isPending: false + isLoading: false + isLoadingError: false + isRefetchError: false + isSuccess: true + isPlaceholderData: true + status: 'success' +} + +export type DefinedQueryObserverResult< + TData = unknown, + TError = DefaultError, +> = + | QueryObserverRefetchErrorResult + | QueryObserverSuccessResult + +export type QueryObserverResult = + | DefinedQueryObserverResult + | QueryObserverLoadingErrorResult + | QueryObserverLoadingResult + | QueryObserverPendingResult + | QueryObserverPlaceholderResult + +export interface InfiniteQueryObserverBaseResult< + TData = unknown, + TError = DefaultError, +> extends QueryObserverBaseResult { + /** + * This function allows you to fetch the next "page" of results. + */ + fetchNextPage: ( + options?: FetchNextPageOptions, + ) => Promise> + /** + * This function allows you to fetch the previous "page" of results. + */ + fetchPreviousPage: ( + options?: FetchPreviousPageOptions, + ) => Promise> + /** + * Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). + */ + hasNextPage: boolean + /** + * Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). + */ + hasPreviousPage: boolean + /** + * Will be `true` if the query failed while fetching the next page. + */ + isFetchNextPageError: boolean + /** + * Will be `true` while fetching the next page with `fetchNextPage`. + */ + isFetchingNextPage: boolean + /** + * Will be `true` if the query failed while fetching the previous page. + */ + isFetchPreviousPageError: boolean + /** + * Will be `true` while fetching the previous page with `fetchPreviousPage`. + */ + isFetchingPreviousPage: boolean +} + +export interface InfiniteQueryObserverPendingResult< + TData = unknown, + TError = DefaultError, +> extends InfiniteQueryObserverBaseResult { + data: undefined + error: null + isError: false + isPending: true + isLoadingError: false + isRefetchError: false + isFetchNextPageError: false + isFetchPreviousPageError: false + isSuccess: false + isPlaceholderData: false + status: 'pending' +} + +export interface InfiniteQueryObserverLoadingResult< + TData = unknown, + TError = DefaultError, +> extends InfiniteQueryObserverBaseResult { + data: undefined + error: null + isError: false + isPending: true + isLoading: true + isLoadingError: false + isRefetchError: false + isFetchNextPageError: false + isFetchPreviousPageError: false + isSuccess: false + isPlaceholderData: false + status: 'pending' +} + +export interface InfiniteQueryObserverLoadingErrorResult< + TData = unknown, + TError = DefaultError, +> extends InfiniteQueryObserverBaseResult { + data: undefined + error: TError + isError: true + isPending: false + isLoading: false + isLoadingError: true + isRefetchError: false + isFetchNextPageError: false + isFetchPreviousPageError: false + isSuccess: false + isPlaceholderData: false + status: 'error' +} + +export interface InfiniteQueryObserverRefetchErrorResult< + TData = unknown, + TError = DefaultError, +> extends InfiniteQueryObserverBaseResult { + data: TData + error: TError + isError: true + isPending: false + isLoading: false + isLoadingError: false + isRefetchError: true + isSuccess: false + isPlaceholderData: false + status: 'error' +} + +export interface InfiniteQueryObserverSuccessResult< + TData = unknown, + TError = DefaultError, +> extends InfiniteQueryObserverBaseResult { + data: TData + error: null + isError: false + isPending: false + isLoading: false + isLoadingError: false + isRefetchError: false + isFetchNextPageError: false + isFetchPreviousPageError: false + isSuccess: true + isPlaceholderData: false + status: 'success' +} + +export interface InfiniteQueryObserverPlaceholderResult< + TData = unknown, + TError = DefaultError, +> extends InfiniteQueryObserverBaseResult { + data: TData + isError: false + error: null + isPending: false + isLoading: false + isLoadingError: false + isRefetchError: false + isSuccess: true + isPlaceholderData: true + isFetchNextPageError: false + isFetchPreviousPageError: false + status: 'success' +} + +export type DefinedInfiniteQueryObserverResult< + TData = unknown, + TError = DefaultError, +> = + | InfiniteQueryObserverRefetchErrorResult + | InfiniteQueryObserverSuccessResult + +export type InfiniteQueryObserverResult< + TData = unknown, + TError = DefaultError, +> = + | DefinedInfiniteQueryObserverResult + | InfiniteQueryObserverLoadingErrorResult + | InfiniteQueryObserverLoadingResult + | InfiniteQueryObserverPendingResult + | InfiniteQueryObserverPlaceholderResult + +export type MutationKey = Register extends { + mutationKey: infer TMutationKey +} + ? TMutationKey extends ReadonlyArray + ? TMutationKey + : TMutationKey extends Array + ? TMutationKey + : ReadonlyArray + : ReadonlyArray + +export type MutationStatus = 'idle' | 'pending' | 'success' | 'error' + +export type MutationScope = { + id: string +} + +export type MutationMeta = Register extends { + mutationMeta: infer TMutationMeta +} + ? TMutationMeta extends Record + ? TMutationMeta + : Record + : Record + +export type MutationFunctionContext = { + client: QueryClient + meta: MutationMeta | undefined + mutationKey?: MutationKey +} + +export type MutationFunction = ( + variables: TVariables, + context: MutationFunctionContext, +) => Promise + +export interface MutationOptions< + TData = unknown, + TError = DefaultError, + TVariables = void, + TOnMutateResult = unknown, +> { + mutationFn?: MutationFunction + mutationKey?: MutationKey + onMutate?: ( + variables: TVariables, + context: MutationFunctionContext, + ) => Promise | TOnMutateResult + onSuccess?: ( + data: TData, + variables: TVariables, + onMutateResult: TOnMutateResult, + context: MutationFunctionContext, + ) => Promise | unknown + onError?: ( + error: TError, + variables: TVariables, + onMutateResult: TOnMutateResult | undefined, + context: MutationFunctionContext, + ) => Promise | unknown + onSettled?: ( + data: TData | undefined, + error: TError | null, + variables: TVariables, + onMutateResult: TOnMutateResult | undefined, + context: MutationFunctionContext, + ) => Promise | unknown + retry?: RetryValue + retryDelay?: RetryDelayValue + networkMode?: NetworkMode + gcTime?: number + _defaulted?: boolean + meta?: MutationMeta + scope?: MutationScope +} + +export interface MutationObserverOptions< + TData = unknown, + TError = DefaultError, + TVariables = void, + TOnMutateResult = unknown, +> extends MutationOptions { + throwOnError?: boolean | ((error: TError) => boolean) +} + +export interface MutateOptions< + TData = unknown, + TError = DefaultError, + TVariables = void, + TOnMutateResult = unknown, +> { + onSuccess?: ( + data: TData, + variables: TVariables, + onMutateResult: TOnMutateResult | undefined, + context: MutationFunctionContext, + ) => void + onError?: ( + error: TError, + variables: TVariables, + onMutateResult: TOnMutateResult | undefined, + context: MutationFunctionContext, + ) => void + onSettled?: ( + data: TData | undefined, + error: TError | null, + variables: TVariables, + onMutateResult: TOnMutateResult | undefined, + context: MutationFunctionContext, + ) => void +} + +export type MutateFunction< + TData = unknown, + TError = DefaultError, + TVariables = void, + TOnMutateResult = unknown, +> = ( + variables: TVariables, + options?: MutateOptions, +) => Promise + +export interface MutationObserverBaseResult< + TData = unknown, + TError = DefaultError, + TVariables = void, + TOnMutateResult = unknown, +> extends MutationState { + /** + * The last successfully resolved data for the mutation. + */ + data: TData | undefined + /** + * The variables object passed to the `mutationFn`. + */ + variables: TVariables | undefined + /** + * The error object for the mutation, if an error was encountered. + * - Defaults to `null`. + */ + error: TError | null + /** + * A boolean variable derived from `status`. + * - `true` if the last mutation attempt resulted in an error. + */ + isError: boolean + /** + * A boolean variable derived from `status`. + * - `true` if the mutation is in its initial state prior to executing. + */ + isIdle: boolean + /** + * A boolean variable derived from `status`. + * - `true` if the mutation is currently executing. + */ + isPending: boolean + /** + * A boolean variable derived from `status`. + * - `true` if the last mutation attempt was successful. + */ + isSuccess: boolean + /** + * The status of the mutation. + * - Will be: + * - `idle` initial status prior to the mutation function executing. + * - `pending` if the mutation is currently executing. + * - `error` if the last mutation attempt resulted in an error. + * - `success` if the last mutation attempt was successful. + */ + status: MutationStatus + /** + * The mutation function you can call with variables to trigger the mutation and optionally hooks on additional callback options. + * @param variables - The variables object to pass to the `mutationFn`. + * @param options.onSuccess - This function will fire when the mutation is successful and will be passed the mutation's result. + * @param options.onError - This function will fire if the mutation encounters an error and will be passed the error. + * @param options.onSettled - This function will fire when the mutation is either successfully fetched or encounters an error and be passed either the data or error. + * @remarks + * - If you make multiple requests, `onSuccess` will fire only after the latest call you've made. + * - All the callback functions (`onSuccess`, `onError`, `onSettled`) are void functions, and the returned value will be ignored. + */ + mutate: MutateFunction + /** + * A function to clean the mutation internal state (i.e., it resets the mutation to its initial state). + */ + reset: () => void +} + +export interface MutationObserverIdleResult< + TData = unknown, + TError = DefaultError, + TVariables = void, + TOnMutateResult = unknown, +> extends MutationObserverBaseResult< + TData, + TError, + TVariables, + TOnMutateResult +> { + data: undefined + variables: undefined + error: null + isError: false + isIdle: true + isPending: false + isSuccess: false + status: 'idle' +} + +export interface MutationObserverLoadingResult< + TData = unknown, + TError = DefaultError, + TVariables = void, + TOnMutateResult = unknown, +> extends MutationObserverBaseResult< + TData, + TError, + TVariables, + TOnMutateResult +> { + data: undefined + variables: TVariables + error: null + isError: false + isIdle: false + isPending: true + isSuccess: false + status: 'pending' +} + +export interface MutationObserverErrorResult< + TData = unknown, + TError = DefaultError, + TVariables = void, + TOnMutateResult = unknown, +> extends MutationObserverBaseResult< + TData, + TError, + TVariables, + TOnMutateResult +> { + data: undefined + error: TError + variables: TVariables + isError: true + isIdle: false + isPending: false + isSuccess: false + status: 'error' +} + +export interface MutationObserverSuccessResult< + TData = unknown, + TError = DefaultError, + TVariables = void, + TOnMutateResult = unknown, +> extends MutationObserverBaseResult< + TData, + TError, + TVariables, + TOnMutateResult +> { + data: TData + error: null + variables: TVariables + isError: false + isIdle: false + isPending: false + isSuccess: true + status: 'success' +} + +export type MutationObserverResult< + TData = unknown, + TError = DefaultError, + TVariables = void, + TOnMutateResult = unknown, +> = + | MutationObserverIdleResult + | MutationObserverLoadingResult + | MutationObserverErrorResult + | MutationObserverSuccessResult + +export interface QueryClientConfig { + queryCache?: QueryCache + mutationCache?: MutationCache + defaultOptions?: DefaultOptions +} + +export interface DefaultOptions { + queries?: OmitKeyof< + QueryObserverOptions, + 'suspense' | 'queryKey' + > + mutations?: MutationObserverOptions + hydrate?: HydrateOptions['defaultOptions'] + dehydrate?: DehydrateOptions +} + +export interface CancelOptions { + revert?: boolean + silent?: boolean +} + +export interface SetDataOptions { + updatedAt?: number +} + +export type NotifyEventType = + | 'added' + | 'removed' + | 'updated' + | 'observerAdded' + | 'observerRemoved' + | 'observerResultsUpdated' + | 'observerOptionsUpdated' + +export interface NotifyEvent { + type: NotifyEventType +} diff --git a/node_modules/@tanstack/query-core/src/utils.ts b/node_modules/@tanstack/query-core/src/utils.ts new file mode 100644 index 0000000..27d44bc --- /dev/null +++ b/node_modules/@tanstack/query-core/src/utils.ts @@ -0,0 +1,499 @@ +import { timeoutManager } from './timeoutManager' +import type { + DefaultError, + Enabled, + FetchStatus, + MutationKey, + MutationStatus, + QueryFunction, + QueryKey, + QueryOptions, + StaleTime, + StaleTimeFunction, +} from './types' +import type { Mutation } from './mutation' +import type { FetchOptions, Query } from './query' + +// TYPES + +type DropLast> = T extends readonly [ + ...infer R, + unknown, +] + ? readonly [...R] + : never + +type TuplePrefixes> = T extends readonly [] + ? readonly [] + : TuplePrefixes> | T + +export interface QueryFilters { + /** + * Filter to active queries, inactive queries or all queries + */ + type?: QueryTypeFilter + /** + * Match query key exactly + */ + exact?: boolean + /** + * Include queries matching this predicate function + */ + predicate?: (query: Query) => boolean + /** + * Include queries matching this query key + */ + queryKey?: TQueryKey | TuplePrefixes + /** + * Include or exclude stale queries + */ + stale?: boolean + /** + * Include queries matching their fetchStatus + */ + fetchStatus?: FetchStatus +} + +export interface MutationFilters< + TData = unknown, + TError = DefaultError, + TVariables = unknown, + TOnMutateResult = unknown, +> { + /** + * Match mutation key exactly + */ + exact?: boolean + /** + * Include mutations matching this predicate function + */ + predicate?: ( + mutation: Mutation, + ) => boolean + /** + * Include mutations matching this mutation key + */ + mutationKey?: TuplePrefixes + /** + * Filter by mutation status + */ + status?: MutationStatus +} + +export type Updater = TOutput | ((input: TInput) => TOutput) + +export type QueryTypeFilter = 'all' | 'active' | 'inactive' + +// UTILS + +export const isServer = typeof window === 'undefined' || 'Deno' in globalThis + +export function noop(): void +export function noop(): undefined +export function noop() {} + +export function functionalUpdate( + updater: Updater, + input: TInput, +): TOutput { + return typeof updater === 'function' + ? (updater as (_: TInput) => TOutput)(input) + : updater +} + +export function isValidTimeout(value: unknown): value is number { + return typeof value === 'number' && value >= 0 && value !== Infinity +} + +export function timeUntilStale(updatedAt: number, staleTime?: number): number { + return Math.max(updatedAt + (staleTime || 0) - Date.now(), 0) +} + +export function resolveStaleTime< + TQueryFnData = unknown, + TError = DefaultError, + TData = TQueryFnData, + TQueryKey extends QueryKey = QueryKey, +>( + staleTime: + | undefined + | StaleTimeFunction, + query: Query, +): StaleTime | undefined { + return typeof staleTime === 'function' ? staleTime(query) : staleTime +} + +export function resolveEnabled< + TQueryFnData = unknown, + TError = DefaultError, + TData = TQueryFnData, + TQueryKey extends QueryKey = QueryKey, +>( + enabled: undefined | Enabled, + query: Query, +): boolean | undefined { + return typeof enabled === 'function' ? enabled(query) : enabled +} + +export function matchQuery( + filters: QueryFilters, + query: Query, +): boolean { + const { + type = 'all', + exact, + fetchStatus, + predicate, + queryKey, + stale, + } = filters + + if (queryKey) { + if (exact) { + if (query.queryHash !== hashQueryKeyByOptions(queryKey, query.options)) { + return false + } + } else if (!partialMatchKey(query.queryKey, queryKey)) { + return false + } + } + + if (type !== 'all') { + const isActive = query.isActive() + if (type === 'active' && !isActive) { + return false + } + if (type === 'inactive' && isActive) { + return false + } + } + + if (typeof stale === 'boolean' && query.isStale() !== stale) { + return false + } + + if (fetchStatus && fetchStatus !== query.state.fetchStatus) { + return false + } + + if (predicate && !predicate(query)) { + return false + } + + return true +} + +export function matchMutation( + filters: MutationFilters, + mutation: Mutation, +): boolean { + const { exact, status, predicate, mutationKey } = filters + if (mutationKey) { + if (!mutation.options.mutationKey) { + return false + } + if (exact) { + if (hashKey(mutation.options.mutationKey) !== hashKey(mutationKey)) { + return false + } + } else if (!partialMatchKey(mutation.options.mutationKey, mutationKey)) { + return false + } + } + + if (status && mutation.state.status !== status) { + return false + } + + if (predicate && !predicate(mutation)) { + return false + } + + return true +} + +export function hashQueryKeyByOptions( + queryKey: TQueryKey, + options?: Pick, 'queryKeyHashFn'>, +): string { + const hashFn = options?.queryKeyHashFn || hashKey + return hashFn(queryKey) +} + +/** + * Default query & mutation keys hash function. + * Hashes the value into a stable hash. + */ +export function hashKey(queryKey: QueryKey | MutationKey): string { + return JSON.stringify(queryKey, (_, val) => + isPlainObject(val) + ? Object.keys(val) + .sort() + .reduce((result, key) => { + result[key] = val[key] + return result + }, {} as any) + : val, + ) +} + +/** + * Checks if key `b` partially matches with key `a`. + */ +export function partialMatchKey(a: QueryKey, b: QueryKey): boolean +export function partialMatchKey(a: any, b: any): boolean { + if (a === b) { + return true + } + + if (typeof a !== typeof b) { + return false + } + + if (a && b && typeof a === 'object' && typeof b === 'object') { + return Object.keys(b).every((key) => partialMatchKey(a[key], b[key])) + } + + return false +} + +const hasOwn = Object.prototype.hasOwnProperty + +/** + * This function returns `a` if `b` is deeply equal. + * If not, it will replace any deeply equal children of `b` with those of `a`. + * This can be used for structural sharing between JSON values for example. + */ +export function replaceEqualDeep(a: unknown, b: T, depth?: number): T +export function replaceEqualDeep(a: any, b: any, depth = 0): any { + if (a === b) { + return a + } + + if (depth > 500) return b + + const array = isPlainArray(a) && isPlainArray(b) + + if (!array && !(isPlainObject(a) && isPlainObject(b))) return b + + const aItems = array ? a : Object.keys(a) + const aSize = aItems.length + const bItems = array ? b : Object.keys(b) + const bSize = bItems.length + const copy: any = array ? new Array(bSize) : {} + + let equalItems = 0 + + for (let i = 0; i < bSize; i++) { + const key: any = array ? i : bItems[i] + const aItem = a[key] + const bItem = b[key] + + if (aItem === bItem) { + copy[key] = aItem + if (array ? i < aSize : hasOwn.call(a, key)) equalItems++ + continue + } + + if ( + aItem === null || + bItem === null || + typeof aItem !== 'object' || + typeof bItem !== 'object' + ) { + copy[key] = bItem + continue + } + + const v = replaceEqualDeep(aItem, bItem, depth + 1) + copy[key] = v + if (v === aItem) equalItems++ + } + + return aSize === bSize && equalItems === aSize ? a : copy +} + +/** + * Shallow compare objects. + */ +export function shallowEqualObjects>( + a: T, + b: T | undefined, +): boolean { + if (!b || Object.keys(a).length !== Object.keys(b).length) { + return false + } + + for (const key in a) { + if (a[key] !== b[key]) { + return false + } + } + + return true +} + +export function isPlainArray(value: unknown): value is Array { + return Array.isArray(value) && value.length === Object.keys(value).length +} + +// Copied from: https://github.com/jonschlinkert/is-plain-object +export function isPlainObject(o: any): o is Record { + if (!hasObjectPrototype(o)) { + return false + } + + // If has no constructor + const ctor = o.constructor + if (ctor === undefined) { + return true + } + + // If has modified prototype + const prot = ctor.prototype + if (!hasObjectPrototype(prot)) { + return false + } + + // If constructor does not have an Object-specific method + if (!prot.hasOwnProperty('isPrototypeOf')) { + return false + } + + // Handles Objects created by Object.create() + if (Object.getPrototypeOf(o) !== Object.prototype) { + return false + } + + // Most likely a plain Object + return true +} + +function hasObjectPrototype(o: any): boolean { + return Object.prototype.toString.call(o) === '[object Object]' +} + +export function sleep(timeout: number): Promise { + return new Promise((resolve) => { + timeoutManager.setTimeout(resolve, timeout) + }) +} + +export function replaceData< + TData, + TOptions extends QueryOptions, +>(prevData: TData | undefined, data: TData, options: TOptions): TData { + if (typeof options.structuralSharing === 'function') { + return options.structuralSharing(prevData, data) as TData + } else if (options.structuralSharing !== false) { + if (process.env.NODE_ENV !== 'production') { + try { + return replaceEqualDeep(prevData, data) + } catch (error) { + console.error( + `Structural sharing requires data to be JSON serializable. To fix this, turn off structuralSharing or return JSON-serializable data from your queryFn. [${options.queryHash}]: ${error}`, + ) + + // Prevent the replaceEqualDeep from being called again down below. + throw error + } + } + // Structurally share data between prev and new data if needed + return replaceEqualDeep(prevData, data) + } + return data +} + +export function keepPreviousData( + previousData: T | undefined, +): T | undefined { + return previousData +} + +export function addToEnd(items: Array, item: T, max = 0): Array { + const newItems = [...items, item] + return max && newItems.length > max ? newItems.slice(1) : newItems +} + +export function addToStart(items: Array, item: T, max = 0): Array { + const newItems = [item, ...items] + return max && newItems.length > max ? newItems.slice(0, -1) : newItems +} + +export const skipToken = Symbol() +export type SkipToken = typeof skipToken + +export function ensureQueryFn< + TQueryFnData = unknown, + TQueryKey extends QueryKey = QueryKey, +>( + options: { + queryFn?: QueryFunction | SkipToken + queryHash?: string + }, + fetchOptions?: FetchOptions, +): QueryFunction { + if (process.env.NODE_ENV !== 'production') { + if (options.queryFn === skipToken) { + console.error( + `Attempted to invoke queryFn when set to skipToken. This is likely a configuration error. Query hash: '${options.queryHash}'`, + ) + } + } + + // if we attempt to retry a fetch that was triggered from an initialPromise + // when we don't have a queryFn yet, we can't retry, so we just return the already rejected initialPromise + // if an observer has already mounted, we will be able to retry with that queryFn + if (!options.queryFn && fetchOptions?.initialPromise) { + return () => fetchOptions.initialPromise! + } + + if (!options.queryFn || options.queryFn === skipToken) { + return () => + Promise.reject(new Error(`Missing queryFn: '${options.queryHash}'`)) + } + + return options.queryFn +} + +export function shouldThrowError) => boolean>( + throwOnError: boolean | T | undefined, + params: Parameters, +): boolean { + // Allow throwOnError function to override throwing behavior on a per-error basis + if (typeof throwOnError === 'function') { + return throwOnError(...params) + } + + return !!throwOnError +} + +export function addConsumeAwareSignal( + object: T, + getSignal: () => AbortSignal, + onCancelled: VoidFunction, +): T & { signal: AbortSignal } { + let consumed = false + let signal: AbortSignal | undefined + + Object.defineProperty(object, 'signal', { + enumerable: true, + get: () => { + signal ??= getSignal() + if (consumed) { + return signal + } + + consumed = true + if (signal.aborted) { + onCancelled() + } else { + signal.addEventListener('abort', onCancelled, { once: true }) + } + + return signal + }, + }) + + return object as T & { signal: AbortSignal } +} diff --git a/node_modules/@tanstack/react-query/LICENSE b/node_modules/@tanstack/react-query/LICENSE new file mode 100644 index 0000000..1869e21 --- /dev/null +++ b/node_modules/@tanstack/react-query/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2021-present Tanner Linsley + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/@tanstack/react-query/README.md b/node_modules/@tanstack/react-query/README.md new file mode 100644 index 0000000..96bffea --- /dev/null +++ b/node_modules/@tanstack/react-query/README.md @@ -0,0 +1,48 @@ + + +![TanStack Query Header](https://github.com/TanStack/query/raw/main/media/repo-header.png) + +Hooks for fetching, caching and updating asynchronous data in React + + + #TanStack + + + + + + + + + + semantic-release + + Join the discussion on Github +Best of JS + + + + + Gitpod Ready-to-Code + + +Enjoy this library? Try the entire [TanStack](https://tanstack.com)! [TanStack Table](https://github.com/TanStack/table), [TanStack Router](https://github.com/tanstack/router), [TanStack Virtual](https://github.com/tanstack/virtual), [React Charts](https://github.com/TanStack/react-charts), [React Ranger](https://github.com/TanStack/ranger) + +## Visit [tanstack.com/query](https://tanstack.com/query) for docs, guides, API and more! + +## Quick Features + +- Transport/protocol/backend agnostic data fetching (REST, GraphQL, promises, whatever!) +- Auto Caching + Refetching (stale-while-revalidate, Window Refocus, Polling/Realtime) +- Parallel + Dependent Queries +- Mutations + Reactive Query Refetching +- Multi-layer Cache + Automatic Garbage Collection +- Paginated + Cursor-based Queries +- Load-More + Infinite Scroll Queries w/ Scroll Recovery +- Request Cancellation +- [React Suspense](https://react.dev/reference/react/Suspense) + Fetch-As-You-Render Query Prefetching +- Dedicated Devtools + +### [Become a Sponsor!](https://github.com/sponsors/tannerlinsley/) + + diff --git a/node_modules/@tanstack/react-query/build/codemods/src/utils/index.cjs b/node_modules/@tanstack/react-query/build/codemods/src/utils/index.cjs new file mode 100644 index 0000000..a652e23 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/codemods/src/utils/index.cjs @@ -0,0 +1,208 @@ +module.exports = ({ root, jscodeshift }) => { + const findImportIdentifierOf = (importSpecifiers, identifier) => { + const specifier = importSpecifiers + .filter((node) => node.value.imported.name === identifier) + .paths() + + if (specifier.length > 0) { + return specifier[0].value.local + } + + return jscodeshift.identifier(identifier) + } + + const findImportSpecifiers = (packageName) => + root + .find(jscodeshift.ImportDeclaration, { + source: { + value: packageName, + }, + }) + .find(jscodeshift.ImportSpecifier, {}) + + const locateImports = ( + identifiers, + packageName = '@tanstack/react-query', + ) => { + const findNamespaceImportIdentifier = () => { + const specifier = root + .find(jscodeshift.ImportDeclaration, { + source: { + value: packageName, + }, + }) + .find(jscodeshift.ImportNamespaceSpecifier) + .paths() + + return specifier.length > 0 ? specifier[0].value.local : null + } + + /** + * First, we search for the namespace import identifier because if we have any, we assume the consumer uses + * namespace imports. In this case, we won't search for named imports at all. + */ + const namespaceImportIdentifier = findNamespaceImportIdentifier() + + if (namespaceImportIdentifier) { + const identifierMap = {} + + for (const identifier of identifiers) { + identifierMap[identifier] = jscodeshift.identifier(identifier) + } + + return { + namespace: namespaceImportIdentifier, + ...identifierMap, + } + } + + const importSpecifiers = findImportSpecifiers(packageName) + const identifierMap = {} + + for (const identifier of identifiers) { + identifierMap[identifier] = findImportIdentifierOf( + importSpecifiers, + identifier, + ) + } + + return { + namespace: null, + ...identifierMap, + } + } + + const findAllMethodCalls = () => + root + // First, we need to find all method calls. + .find(jscodeshift.CallExpression, { + callee: { + type: jscodeshift.MemberExpression.name, + property: { + type: jscodeshift.Identifier.name, + }, + }, + }) + + const findQueryClientIdentifiers = (importIdentifiers) => + root + .find(jscodeshift.VariableDeclarator, {}) + .filter((node) => { + if (node.value.init) { + const initializer = node.value.init + + return ( + isClassInstantiationOf( + initializer, + getSelectorByImports(importIdentifiers, 'QueryClient'), + ) || + isFunctionCallOf( + initializer, + getSelectorByImports(importIdentifiers, 'useQueryClient'), + ) + ) + } + + return false + }) + .paths() + .map((node) => node.value.id.name) + + const isCallExpression = (node) => + jscodeshift.match(node, { type: jscodeshift.CallExpression.name }) + + const isIdentifier = (node) => + jscodeshift.match(node, { type: jscodeshift.Identifier.name }) + + const isMemberExpression = (node) => + jscodeshift.match(node, { type: jscodeshift.MemberExpression.name }) + + const isNewExpression = (node) => + jscodeshift.match(node, { type: jscodeshift.NewExpression.name }) + + const isArrayExpression = (node) => + jscodeshift.match(node, { type: jscodeshift.ArrayExpression.name }) + + const isObjectExpression = (node) => + jscodeshift.match(node, { type: jscodeshift.ObjectExpression.name }) + + const isObjectProperty = (node) => + jscodeshift.match(node, { type: jscodeshift.ObjectProperty.name }) + + const isSpreadElement = (node) => + jscodeshift.match(node, { type: jscodeshift.SpreadElement.name }) + + /** + * @param {import('jscodeshift').Node} node + * @returns {boolean} + */ + const isFunctionDefinition = (node) => { + const isArrowFunctionExpression = jscodeshift.match(node, { + type: jscodeshift.ArrowFunctionExpression.name, + }) + const isFunctionExpression = jscodeshift.match(node, { + type: jscodeshift.FunctionExpression.name, + }) + + return isArrowFunctionExpression || isFunctionExpression + } + + const warn = (message) => { + if (process.env.NODE_ENV !== 'test') { + console.warn(message) + } + } + + const isClassInstantiationOf = (node, selector) => { + if (!isNewExpression(node)) { + return false + } + + const parts = selector.split('.') + + return parts.length === 1 + ? isIdentifier(node.callee) && node.callee.name === parts[0] + : isMemberExpression(node.callee) && + node.callee.object.name === parts[0] && + node.callee.property.name === parts[1] + } + + const isFunctionCallOf = (node, selector) => { + if (!isCallExpression(node)) { + return false + } + + const parts = selector.split('.') + + return parts.length === 1 + ? isIdentifier(node.callee) && node.callee.name === parts[0] + : isMemberExpression(node.callee) && + node.callee.object.name === parts[0] && + node.callee.property.name === parts[1] + } + + const getSelectorByImports = (imports, path) => + imports.namespace + ? `${imports.namespace.name}.${imports[path].name}` + : imports[path].name + + return { + findAllMethodCalls, + getSelectorByImports, + isCallExpression, + isClassInstantiationOf, + isFunctionCallOf, + isIdentifier, + isMemberExpression, + isArrayExpression, + isObjectExpression, + isObjectProperty, + isSpreadElement, + isFunctionDefinition, + locateImports, + warn, + queryClient: { + findQueryClientIdentifiers, + }, + } +} diff --git a/node_modules/@tanstack/react-query/build/codemods/src/utils/transformers/query-cache-transformer.cjs b/node_modules/@tanstack/react-query/build/codemods/src/utils/transformers/query-cache-transformer.cjs new file mode 100644 index 0000000..e20bc01 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/codemods/src/utils/transformers/query-cache-transformer.cjs @@ -0,0 +1,124 @@ +module.exports = ({ + jscodeshift, + utils, + root, + packageName = '@tanstack/react-query', +}) => { + const isGetQueryCacheMethodCall = ( + initializer, + importIdentifiers, + knownQueryClientIds, + ) => { + const isKnownQueryClient = (node) => + utils.isIdentifier(node) && knownQueryClientIds.includes(node.name) + + const isGetQueryCacheIdentifier = (node) => + utils.isIdentifier(node) && node.name === 'getQueryCache' + + const isValidInitializer = (node) => + utils.isCallExpression(node) && utils.isMemberExpression(node.callee) + + if (isValidInitializer(initializer)) { + const instance = initializer.callee.object + + return ( + isGetQueryCacheIdentifier(initializer.callee.property) && + (isKnownQueryClient(instance) || + utils.isFunctionCallOf( + instance, + utils.getSelectorByImports(importIdentifiers, 'useQueryClient'), + )) + ) + } + + return false + } + + const findQueryCacheInstantiations = ( + importIdentifiers, + knownQueryClientIds, + ) => + root.find(jscodeshift.VariableDeclarator, {}).filter((node) => { + if (node.value.init) { + const initializer = node.value.init + + return ( + utils.isClassInstantiationOf( + initializer, + utils.getSelectorByImports(importIdentifiers, 'QueryCache'), + ) || + isGetQueryCacheMethodCall( + initializer, + importIdentifiers, + knownQueryClientIds, + ) + ) + } + + return false + }) + + const filterQueryCacheMethodCalls = (node) => + utils.isIdentifier(node) && ['find', 'findAll'].includes(node.name) + + const findQueryCacheMethodCalls = (importIdentifiers) => { + /** + * Here we collect all query client instantiations. We have to make aware of them because the query cache can be + * accessed by the query client as well. + */ + const queryClientIdentifiers = + utils.queryClient.findQueryClientIdentifiers(importIdentifiers) + /** + * Here we collect all query cache instantiations. The reason is simple: the methods can be called on query cache + * instances, to locate the possible usages we need to be aware of the identifier names. + */ + const queryCacheIdentifiers = findQueryCacheInstantiations( + importIdentifiers, + queryClientIdentifiers, + ) + .paths() + .map((node) => node.value.id.name) + + return ( + utils + // First, we need to find all method calls. + .findAllMethodCalls() + // Then we narrow the collection to all `fetch` and `fetchAll` methods. + .filter((node) => + filterQueryCacheMethodCalls(node.value.callee.property), + ) + .filter((node) => { + const object = node.value.callee.object + + // If the method is called on a `QueryCache` instance, we keep it in the collection. + if (utils.isIdentifier(object)) { + return queryCacheIdentifiers.includes(object.name) + } + + // If the method is called on a `QueryClient` instance, we keep it in the collection. + if (utils.isCallExpression(object)) { + return isGetQueryCacheMethodCall( + object, + importIdentifiers, + queryClientIdentifiers, + ) + } + + return false + }) + ) + } + + const execute = (replacer) => { + findQueryCacheMethodCalls( + utils.locateImports( + ['QueryCache', 'QueryClient', 'useQueryClient'], + packageName, + ), + ).replaceWith(replacer) + } + + return { + execute, + } +} diff --git a/node_modules/@tanstack/react-query/build/codemods/src/utils/transformers/query-client-transformer.cjs b/node_modules/@tanstack/react-query/build/codemods/src/utils/transformers/query-client-transformer.cjs new file mode 100644 index 0000000..8282940 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/codemods/src/utils/transformers/query-client-transformer.cjs @@ -0,0 +1,53 @@ +module.exports = ({ + jscodeshift, + utils, + root, + packageName = '@tanstack/react-query', +}) => { + const filterQueryClientMethodCalls = (node, methods) => + utils.isIdentifier(node) && methods.includes(node.name) + + const findQueryClientMethodCalls = (importIdentifiers, methods) => { + /** + * Here we collect all query client instantiations. We have to make aware of them because some method calls might + * be invoked on these instances. + */ + const queryClientIdentifiers = + utils.queryClient.findQueryClientIdentifiers(importIdentifiers) + + return ( + utils + // First, we need to find all method calls. + .findAllMethodCalls() + // Then we narrow the collection to `QueryClient` methods. + .filter((node) => + filterQueryClientMethodCalls(node.value.callee.property, methods), + ) + .filter((node) => { + const object = node.value.callee.object + + // If the method is called on a `QueryClient` instance, we keep it in the collection. + if (utils.isIdentifier(object)) { + return queryClientIdentifiers.includes(object.name) + } + + // If the method is called on the return value of `useQueryClient` hook, we keep it in the collection. + return utils.isFunctionCallOf( + object, + utils.getSelectorByImports(importIdentifiers, 'useQueryClient'), + ) + }) + ) + } + + const execute = (methods, replacer) => { + findQueryClientMethodCalls( + utils.locateImports(['QueryClient', 'useQueryClient'], packageName), + methods, + ).replaceWith(replacer) + } + + return { + execute, + } +} diff --git a/node_modules/@tanstack/react-query/build/codemods/src/utils/transformers/use-query-like-transformer.cjs b/node_modules/@tanstack/react-query/build/codemods/src/utils/transformers/use-query-like-transformer.cjs new file mode 100644 index 0000000..e364ae0 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/codemods/src/utils/transformers/use-query-like-transformer.cjs @@ -0,0 +1,38 @@ +module.exports = ({ + jscodeshift, + utils, + root, + packageName = '@tanstack/react-query', +}) => { + const filterUseQueryLikeHookCalls = (node, importIdentifiers, hooks) => { + for (const hook of hooks) { + const selector = utils.getSelectorByImports(importIdentifiers, hook) + + if (utils.isFunctionCallOf(node, selector)) { + return true + } + } + + return false + } + + const findUseQueryLikeHookCalls = (importIdentifiers, hooks) => + root + // First, we need to find all call expressions. + .find(jscodeshift.CallExpression, {}) + // Then we narrow the collection to the `useQuery` like hook calls. + .filter((node) => + filterUseQueryLikeHookCalls(node.value, importIdentifiers, hooks), + ) + + const execute = (hooks, replacer) => { + findUseQueryLikeHookCalls( + utils.locateImports(hooks, packageName), + hooks, + ).replaceWith(replacer) + } + + return { + execute, + } +} diff --git a/node_modules/@tanstack/react-query/build/codemods/src/v4/key-transformation.cjs b/node_modules/@tanstack/react-query/build/codemods/src/v4/key-transformation.cjs new file mode 100644 index 0000000..ad62c08 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/codemods/src/v4/key-transformation.cjs @@ -0,0 +1,181 @@ +const createUtilsObject = require('../utils/index.cjs') +const createKeyReplacer = require('./utils/replacers/key-replacer.cjs') +const createUseQueryLikeTransformer = require('../utils/transformers/use-query-like-transformer.cjs') +const createQueryClientTransformer = require('../utils/transformers/query-client-transformer.cjs') +const createQueryCacheTransformer = require('../utils/transformers/query-cache-transformer.cjs') + +const transformQueryClientUsages = ({ + jscodeshift, + utils, + root, + filePath, + packageName, +}) => { + const transformer = createQueryClientTransformer({ + jscodeshift, + utils, + root, + packageName, + }) + const replacer = createKeyReplacer({ jscodeshift, root, filePath }) + + transformer.execute( + [ + // Not object syntax-aware methods. + 'getMutationDefaults', + 'getQueriesData', + 'getQueryData', + 'getQueryDefaults', + 'getQueryState', + 'isFetching', + 'setMutationDefaults', + 'setQueriesData', + 'setQueryData', + 'setQueryDefaults', + // Object syntax-aware methods. + 'cancelQueries', + 'fetchInfiniteQuery', + 'fetchQuery', + 'invalidateQueries', + 'prefetchInfiniteQuery', + 'prefetchQuery', + 'refetchQueries', + 'removeQueries', + 'resetQueries', + ], + replacer, + ) +} + +const transformUseQueriesUsages = ({ + jscodeshift, + utils, + root, + packageName, +}) => { + const transformer = createUseQueryLikeTransformer({ + jscodeshift, + utils, + root, + packageName, + }) + const replacer = ({ node }) => { + /** + * When the node doesn't have the 'original' property, that means the codemod has been already applied, + * so we don't need to do any changes. + */ + if (!node.original) { + return node + } + + const newCallExpression = jscodeshift.callExpression(node.original.callee, [ + jscodeshift.objectExpression([ + jscodeshift.property( + 'init', + jscodeshift.identifier('queries'), + node.original.arguments[0], + ), + ]), + ]) + + // TODO: This should be part of one function! + if (node.typeParameters) { + newCallExpression.typeArguments = node.typeParameters + } + + return newCallExpression + } + + transformer.execute(['useQueries'], replacer) +} + +const transformUseQueryLikeUsages = ({ + jscodeshift, + utils, + root, + filePath, + packageName, +}) => { + const transformer = createUseQueryLikeTransformer({ + jscodeshift, + utils, + root, + packageName, + }) + + transformer.execute( + ['useQuery', 'useInfiniteQuery', 'useIsFetching', 'useIsMutating'], + createKeyReplacer({ + jscodeshift, + root, + filePath, + keyName: 'queryKey', + }), + ) + transformer.execute( + ['useMutation'], + createKeyReplacer({ + jscodeshift, + root, + filePath, + keyName: 'mutationKey', + }), + ) +} + +const transformQueryCacheUsages = ({ + jscodeshift, + utils, + root, + filePath, + packageName, +}) => { + const transformer = createQueryCacheTransformer({ + jscodeshift, + utils, + root, + packageName, + }) + const replacer = createKeyReplacer({ jscodeshift, root, filePath }) + + transformer.execute(replacer) +} + +module.exports = (file, api) => { + const jscodeshift = api.jscodeshift + const root = jscodeshift(file.source) + + // TODO: Execute the transformers only when it contains a `react-query` import! + + const utils = createUtilsObject({ root, jscodeshift }) + const filePath = file.path + const packageName = 'react-query' + + // This function transforms usages like `useQuery` and `useMutation`. + transformUseQueryLikeUsages({ + jscodeshift, + utils, + root, + filePath, + packageName, + }) + // This function transforms usages of `useQueries`. + transformUseQueriesUsages({ + jscodeshift, + utils, + root, + packageName, + }) + // This function transforms usages of `QueryClient`. + transformQueryClientUsages({ + jscodeshift, + utils, + root, + filePath, + packageName, + }) + // This function transforms usages of `QueryCache`. + transformQueryCacheUsages({ jscodeshift, utils, root, filePath, packageName }) + + return root.toSource({ quote: 'single', lineTerminator: '\n' }) +} diff --git a/node_modules/@tanstack/react-query/build/codemods/src/v4/replace-import-specifier.cjs b/node_modules/@tanstack/react-query/build/codemods/src/v4/replace-import-specifier.cjs new file mode 100644 index 0000000..754e2f7 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/codemods/src/v4/replace-import-specifier.cjs @@ -0,0 +1,25 @@ +module.exports = (file, api) => { + const jscodeshift = api.jscodeshift + const root = jscodeshift(file.source) + + const replacements = [ + { from: 'react-query', to: '@tanstack/react-query' }, + { from: 'react-query/devtools', to: '@tanstack/react-query-devtools' }, + ] + + replacements.forEach(({ from, to }) => { + root + .find(jscodeshift.ImportDeclaration, { + source: { + value: from, + }, + }) + .replaceWith(({ node }) => { + node.source.value = to + + return node + }) + }) + + return root.toSource({ quote: 'single', lineTerminator: '\n' }) +} diff --git a/node_modules/@tanstack/react-query/build/codemods/src/v4/utils/replacers/key-replacer.cjs b/node_modules/@tanstack/react-query/build/codemods/src/v4/utils/replacers/key-replacer.cjs new file mode 100644 index 0000000..1bd6298 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/codemods/src/v4/utils/replacers/key-replacer.cjs @@ -0,0 +1,164 @@ +class UnprocessableKeyError extends Error { + constructor(message) { + super(message) + this.name = 'UnprocessableKeyError' + } +} + +module.exports = ({ jscodeshift, root, filePath, keyName = 'queryKey' }) => { + const isArrayExpression = (node) => + jscodeshift.match(node, { type: jscodeshift.ArrayExpression.name }) + + const isStringLiteral = (node) => + jscodeshift.match(node, { type: jscodeshift.StringLiteral.name }) || + jscodeshift.match(node, { type: jscodeshift.Literal.name }) + + const isTemplateLiteral = (node) => + jscodeshift.match(node, { type: jscodeshift.TemplateLiteral.name }) + + const findVariableDeclaration = (node) => { + const declarations = root + .find(jscodeshift.VariableDeclarator, { + id: { + type: jscodeshift.Identifier.name, + name: node.name, + }, + }) + .paths() + + return declarations.length > 0 ? declarations[0] : null + } + + const createKeyValue = (node) => { + // When the node is a string literal we convert it into an array of strings. + if (isStringLiteral(node)) { + return jscodeshift.arrayExpression([ + jscodeshift.stringLiteral(node.value), + ]) + } + + // When the node is a template literal we convert it into an array of template literals. + if (isTemplateLiteral(node)) { + return jscodeshift.arrayExpression([ + jscodeshift.templateLiteral(node.quasis, node.expressions), + ]) + } + + if (jscodeshift.match(node, { type: jscodeshift.Identifier.name })) { + // When the node is an identifier at first, we try to find its declaration, because we will try + // to guess its type. + const variableDeclaration = findVariableDeclaration(node) + + if (!variableDeclaration) { + throw new UnprocessableKeyError( + `In file ${filePath} at line ${node.loc.start.line} the type of identifier \`${node.name}\` couldn't be recognized, so the codemod couldn't be applied. Please migrate manually.`, + ) + } + + const initializer = variableDeclaration.value.init + + // When it's a string, we just wrap it into an array expression. + if (isStringLiteral(initializer) || isTemplateLiteral(initializer)) { + return jscodeshift.arrayExpression([node]) + } + } + + throw new UnprocessableKeyError( + `In file ${filePath} at line ${node.loc.start.line} the type of the \`${keyName}\` couldn't be recognized, so the codemod couldn't be applied. Please migrate manually.`, + ) + } + + const createKeyProperty = (node) => + jscodeshift.property( + 'init', + jscodeshift.identifier(keyName), + createKeyValue(node), + ) + + const getPropertyFromObjectExpression = (objectExpression, propertyName) => + objectExpression.properties.find( + (property) => property.key.name === propertyName, + ) ?? null + + const buildWithTypeArguments = (node, builder) => { + const newNode = builder(node) + + if (node.typeParameters) { + newNode.typeArguments = node.typeParameters + } + + return newNode + } + + return ({ node }) => { + // When the node doesn't have the 'original' property, that means the codemod has been already applied, + // so we don't need to do any changes. + if (!node.original) { + return node + } + + const methodArguments = node.arguments + + // The method call doesn't have any arguments, we have nothing to do in this case. + if (methodArguments.length === 0) { + return node + } + + try { + const [firstArgument, ...restOfTheArguments] = methodArguments + + if ( + jscodeshift.match(firstArgument, { + type: jscodeshift.ObjectExpression.name, + }) + ) { + const originalKey = getPropertyFromObjectExpression( + firstArgument, + keyName, + ) + + if (!originalKey) { + throw new UnprocessableKeyError( + `In file ${filePath} at line ${node.loc.start.line} the \`${keyName}\` couldn't be found. Did you forget to add it?`, + ) + } + + const restOfTheProperties = firstArgument.properties.filter( + (item) => item.key.name !== keyName, + ) + + return buildWithTypeArguments(node, (originalNode) => + jscodeshift.callExpression(originalNode.original.callee, [ + jscodeshift.objectExpression([ + createKeyProperty(originalKey.value), + ...restOfTheProperties, + ]), + ...restOfTheArguments, + ]), + ) + } + + // When the node is an array expression we just simply return it because we want query keys to be arrays. + if (isArrayExpression(firstArgument)) { + return node + } + + return buildWithTypeArguments(node, (originalNode) => + jscodeshift.callExpression(originalNode.original.callee, [ + createKeyValue(firstArgument), + ...restOfTheArguments, + ]), + ) + } catch (error) { + if (error.name === 'UnprocessableKeyError') { + if (process.env.NODE_ENV !== 'test') { + console.warn(error.message) + } + + return node + } + + throw error + } + } +} diff --git a/node_modules/@tanstack/react-query/build/codemods/src/v5/is-loading/is-loading.cjs b/node_modules/@tanstack/react-query/build/codemods/src/v5/is-loading/is-loading.cjs new file mode 100644 index 0000000..eb7f1b0 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/codemods/src/v5/is-loading/is-loading.cjs @@ -0,0 +1,244 @@ +const createUtilsObject = require('../../utils/index.cjs') +const createUseQueryLikeTransformer = require('../../utils/transformers/use-query-like-transformer.cjs') +const createQueryClientTransformer = require('../../utils/transformers/query-client-transformer.cjs') + +const originalName = 'isLoading' +const newName = 'isPending' + +/** + * @param {import('jscodeshift')} jscodeshift + * @param {Object} utils + * @param {import('jscodeshift').Collection} root + * @param {string} filePath + * @param {{keyName: "mutationKey"|"queryKey", queryClientMethods: ReadonlyArray, hooks: ReadonlyArray}} config + */ +const transformUsages = ({ jscodeshift, utils, root, filePath, config }) => { + /** + * @param {import('jscodeshift').CallExpression | import('jscodeshift').ExpressionStatement} node + * @returns {{start: number, end: number}} + */ + const getNodeLocation = (node) => { + const location = utils.isCallExpression(node) ? node.callee.loc : node.loc + const start = location.start.line + const end = location.end.line + + return { start, end } + } + + /** + * @param {import('jscodeshift').ASTNode} node + * @returns {boolean} + */ + const isObjectExpression = (node) => { + return jscodeshift.match(node, { + type: jscodeshift.ObjectExpression.name, + }) + } + + /** + * @param {import('jscodeshift').ASTNode} node + * @returns {boolean} + */ + const isObjectPattern = (node) => { + return jscodeshift.match(node, { + type: jscodeshift.ObjectPattern.name, + }) + } + + /** + * @param {import('jscodeshift').ASTNode} node + * @returns {boolean} + */ + const isVariableDeclarator = (node) => { + return jscodeshift.match(node, { + type: jscodeshift.VariableDeclarator.name, + }) + } + + /** + * @param {import('jscodeshift').Node} node + * @param {import('jscodeshift').Identifier} identifier + * @returns {Collection} + */ + const findIsLoadingPropertiesOfIdentifier = (node, identifier) => { + return jscodeshift(node).find(jscodeshift.MemberExpression, { + object: { + type: jscodeshift.Identifier.name, + name: identifier.name, + }, + property: { + type: jscodeshift.Identifier.name, + name: originalName, + }, + }) + } + + /** + * @param {import('jscodeshift').ObjectPattern} node + * @returns {import('jscodeshift').ObjectProperty|null} + */ + const findIsLoadingObjectPropertyInObjectPattern = (node) => { + return ( + node.properties.find((property) => + jscodeshift.match(property, { + key: { + type: jscodeshift.Identifier.name, + name: originalName, + }, + }), + ) ?? null + ) + } + + /** + * @param {import('jscodeshift').ObjectPattern} node + * @returns {import('jscodeshift').RestElement|null} + */ + const findRestElementInObjectPattern = (node) => { + return ( + node.properties.find((property) => + jscodeshift.match(property, { + type: jscodeshift.RestElement.name, + }), + ) ?? null + ) + } + + const replacer = (path, transformNode) => { + const node = path.node + const parentNode = path.parentPath.value + const { start, end } = getNodeLocation(node) + + try { + if (!isVariableDeclarator(parentNode)) { + // The parent node is not a variable declarator, the transformation will be skipped. + return node + } + + const lookupNode = path.scope.node + const variableDeclaratorId = parentNode.id + + if (isObjectPattern(variableDeclaratorId)) { + const isLoadingObjectProperty = + findIsLoadingObjectPropertyInObjectPattern(variableDeclaratorId) + + if (isLoadingObjectProperty) { + jscodeshift(lookupNode) + .find(jscodeshift.ObjectProperty, { + key: { + type: jscodeshift.Identifier.name, + name: originalName, + }, + }) + .replaceWith((mutablePath) => { + if (isObjectPattern(mutablePath.parent)) { + const affectedProperty = mutablePath.value.value.shorthand + ? 'value' + : 'key' + + mutablePath.value[affectedProperty].name = newName + + return mutablePath.value + } + + if (isObjectExpression(mutablePath.parent)) { + const affectedProperty = mutablePath.value.value.shorthand + ? 'key' + : 'value' + + mutablePath.value[affectedProperty].name = newName + + return mutablePath.value + } + + return mutablePath.value + }) + + // Renaming all other 'isLoading' references that are object properties. + jscodeshift(lookupNode) + .find(jscodeshift.Identifier, { name: originalName }) + .replaceWith((mutablePath) => { + if ( + !jscodeshift.match(mutablePath.parent, { + type: jscodeshift.ObjectProperty.name, + }) + ) { + mutablePath.value.name = newName + } + + return mutablePath.value + }) + } + + const restElement = findRestElementInObjectPattern(variableDeclaratorId) + + if (restElement) { + findIsLoadingPropertiesOfIdentifier( + lookupNode, + restElement.argument, + ).replaceWith(({ node: mutableNode }) => { + mutableNode.property.name = newName + + return mutableNode + }) + } + + return node + } + + if (utils.isIdentifier(variableDeclaratorId)) { + findIsLoadingPropertiesOfIdentifier( + lookupNode, + variableDeclaratorId, + ).replaceWith(({ node: mutableNode }) => { + mutableNode.property.name = newName + + return mutableNode + }) + + return node + } + + utils.warn( + `The usage in file "${filePath}" at line ${start}:${end} could not be transformed. Please migrate this usage manually.`, + ) + + return node + } catch (error) { + utils.warn( + `An unknown error occurred while processing the "${filePath}" file. Please review this file, because the codemod couldn't be applied.`, + ) + + return node + } + } + + createUseQueryLikeTransformer({ jscodeshift, utils, root }).execute( + config.hooks, + replacer, + ) + + createQueryClientTransformer({ jscodeshift, utils, root }).execute( + config.queryClientMethods, + replacer, + ) +} + +module.exports = (file, api) => { + const jscodeshift = api.jscodeshift + const root = jscodeshift(file.source) + const utils = createUtilsObject({ root, jscodeshift }) + const filePath = file.path + + const dependencies = { jscodeshift, utils, root, filePath } + + transformUsages({ + ...dependencies, + config: { + hooks: ['useQuery', 'useMutation'], + queryClientMethods: [], + }, + }) + + return root.toSource({ quote: 'single', lineTerminator: '\n' }) +} diff --git a/node_modules/@tanstack/react-query/build/codemods/src/v5/keep-previous-data/README.md b/node_modules/@tanstack/react-query/build/codemods/src/v5/keep-previous-data/README.md new file mode 100644 index 0000000..a85f434 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/codemods/src/v5/keep-previous-data/README.md @@ -0,0 +1,32 @@ +### Intro + +The prerequisite for this code mod is to migrate your usages to the new syntax, so overloads for hooks and `QueryClient` methods shouldn't be available anymore. + +### Affected usages + +Please note, this code mod transforms usages only where the first argument is an object expression. + +The following usage should be transformed by the code mod: + +```ts +const { data } = useQuery({ + queryKey: ['posts'], + queryFn: queryFn, + keepPreviousData: true, +}) +``` + +But the following usage won't be transformed by the code mod, because the first argument an identifier: + +```ts +const hookArgument = { + queryKey: ['posts'], + queryFn: queryFn, + keepPreviousData: true, +} +const { data } = useQuery(hookArgument) +``` + +### Troubleshooting + +In case of any errors, feel free to reach us out via Discord or open an issue. If you open an issue, please provide a code snippet as well, because without a snippet we cannot find the bug in the code mod. diff --git a/node_modules/@tanstack/react-query/build/codemods/src/v5/keep-previous-data/keep-previous-data.cjs b/node_modules/@tanstack/react-query/build/codemods/src/v5/keep-previous-data/keep-previous-data.cjs new file mode 100644 index 0000000..3f3e3b7 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/codemods/src/v5/keep-previous-data/keep-previous-data.cjs @@ -0,0 +1,271 @@ +const createUtilsObject = require('../../utils/index.cjs') +const createUseQueryLikeTransformer = require('../../utils/transformers/use-query-like-transformer.cjs') +const createQueryClientTransformer = require('../../utils/transformers/query-client-transformer.cjs') +const AlreadyHasPlaceholderDataProperty = require('./utils/already-has-placeholder-data-property.cjs') + +/** + * @param {import('jscodeshift')} jscodeshift + * @param {Object} utils + * @param {import('jscodeshift').Collection} root + * @param {string} filePath + * @param {{keyName: "mutationKey"|"queryKey", queryClientMethods: ReadonlyArray, hooks: ReadonlyArray}} config + */ +const transformUsages = ({ jscodeshift, utils, root, filePath, config }) => { + /** + * @param {import('jscodeshift').CallExpression | import('jscodeshift').ExpressionStatement} node + * @returns {{start: number, end: number}} + */ + const getNodeLocation = (node) => { + const location = utils.isCallExpression(node) ? node.callee.loc : node.loc + const start = location.start.line + const end = location.end.line + + return { start, end } + } + + /** + * @param {import('jscodeshift').ObjectProperty} objectProperty + * @returns {boolean} + */ + const isKeepPreviousDataObjectProperty = (objectProperty) => { + return jscodeshift.match(objectProperty.key, { + type: jscodeshift.Identifier.name, + name: 'keepPreviousData', + }) + } + + /** + * @param {import('jscodeshift').ObjectProperty} objectProperty + * @returns {boolean} + */ + const isObjectPropertyHasTrueBooleanLiteralValue = (objectProperty) => { + return jscodeshift.match(objectProperty.value, { + type: jscodeshift.BooleanLiteral.name, + value: true, + }) + } + + /** + * @param {import('jscodeshift').ObjectExpression} objectExpression + * @returns {Array} + */ + const filterKeepPreviousDataProperty = (objectExpression) => { + return objectExpression.properties.filter((objectProperty) => { + return !isKeepPreviousDataObjectProperty(objectProperty) + }) + } + + const createPlaceholderDataObjectProperty = () => { + return jscodeshift.objectProperty( + jscodeshift.identifier('placeholderData'), + jscodeshift.identifier('keepPreviousData'), + ) + } + + /** + * @param {import('jscodeshift').ObjectExpression} objectExpression + * @returns {boolean} + */ + const hasPlaceholderDataProperty = (objectExpression) => { + return ( + objectExpression.properties.findIndex((objectProperty) => { + return jscodeshift.match(objectProperty.key, { + type: jscodeshift.Identifier.name, + name: 'placeholderData', + }) + }) !== -1 + ) + } + + /** + * @param {import('jscodeshift').ObjectExpression} objectExpression + * @returns {import('jscodeshift').ObjectProperty | undefined} + */ + const getKeepPreviousDataProperty = (objectExpression) => { + return objectExpression.properties.find(isKeepPreviousDataObjectProperty) + } + + let shouldAddKeepPreviousDataImport = false + + const replacer = (path, resolveTargetArgument, transformNode) => { + const node = path.node + const { start, end } = getNodeLocation(node) + + try { + const targetArgument = resolveTargetArgument(node) + + if (targetArgument && utils.isObjectExpression(targetArgument)) { + const isPlaceholderDataPropertyPresent = + hasPlaceholderDataProperty(targetArgument) + + if (hasPlaceholderDataProperty(targetArgument)) { + throw new AlreadyHasPlaceholderDataProperty(node, filePath) + } + + const keepPreviousDataProperty = + getKeepPreviousDataProperty(targetArgument) + + const keepPreviousDataPropertyHasTrueValue = + isObjectPropertyHasTrueBooleanLiteralValue(keepPreviousDataProperty) + + if (!keepPreviousDataPropertyHasTrueValue) { + utils.warn( + `The usage in file "${filePath}" at line ${start}:${end} already contains a "keepPreviousData" property but its value is not "true". Please migrate this usage manually.`, + ) + + return node + } + + if (keepPreviousDataPropertyHasTrueValue) { + // Removing the `keepPreviousData` property from the object. + const mutableObjectExpressionProperties = + filterKeepPreviousDataProperty(targetArgument) + + if (!isPlaceholderDataPropertyPresent) { + shouldAddKeepPreviousDataImport = true + + // When the `placeholderData` property is not present, the `placeholderData: keepPreviousData` property will be added. + mutableObjectExpressionProperties.push( + createPlaceholderDataObjectProperty(), + ) + } + + return transformNode( + node, + jscodeshift.objectExpression(mutableObjectExpressionProperties), + ) + } + } + + utils.warn( + `The usage in file "${filePath}" at line ${start}:${end} could not be transformed, because the first parameter is not an object expression. Please migrate this usage manually.`, + ) + + return node + } catch (error) { + utils.warn( + error.name === AlreadyHasPlaceholderDataProperty.name + ? error.message + : `An unknown error occurred while processing the "${filePath}" file. Please review this file, because the codemod couldn't be applied.`, + ) + + return node + } + } + + createUseQueryLikeTransformer({ jscodeshift, utils, root }).execute( + config.hooks, + (path) => { + const resolveTargetArgument = (node) => node.arguments[0] ?? null + const transformNode = (node, transformedArgument) => + jscodeshift.callExpression(node.original.callee, [transformedArgument]) + + return replacer(path, resolveTargetArgument, transformNode) + }, + ) + + createQueryClientTransformer({ jscodeshift, utils, root }).execute( + config.queryClientMethods, + (path) => { + const resolveTargetArgument = (node) => node.arguments[1] ?? null + const transformNode = (node, transformedArgument) => { + return jscodeshift.callExpression(node.original.callee, [ + node.arguments[0], + transformedArgument, + ...node.arguments.slice(2, 0), + ]) + } + + return replacer(path, resolveTargetArgument, transformNode) + }, + ) + + const importIdentifierOfQueryClient = utils.getSelectorByImports( + utils.locateImports(['QueryClient']), + 'QueryClient', + ) + + root + .find(jscodeshift.ExpressionStatement, { + expression: { + type: jscodeshift.NewExpression.name, + callee: { + type: jscodeshift.Identifier.name, + name: importIdentifierOfQueryClient, + }, + }, + }) + .filter((path) => path.node.expression) + .replaceWith((path) => { + const resolveTargetArgument = (node) => { + const paths = jscodeshift(node) + .find(jscodeshift.ObjectProperty, { + key: { + type: jscodeshift.Identifier.name, + name: 'keepPreviousData', + }, + }) + .paths() + + return paths.length > 0 ? paths[0].parent.node : null + } + const transformNode = (node, transformedArgument) => { + jscodeshift(node.expression) + .find(jscodeshift.ObjectProperty, { + key: { + type: jscodeshift.Identifier.name, + name: 'queries', + }, + }) + .replaceWith(({ node: mutableNode }) => { + mutableNode.value.properties = transformedArgument.properties + + return mutableNode + }) + + return node + } + + return replacer(path, resolveTargetArgument, transformNode) + }) + + return { shouldAddKeepPreviousDataImport } +} + +module.exports = (file, api) => { + const jscodeshift = api.jscodeshift + const root = jscodeshift(file.source) + const utils = createUtilsObject({ root, jscodeshift }) + const filePath = file.path + + const dependencies = { jscodeshift, utils, root, filePath } + + const { shouldAddKeepPreviousDataImport } = transformUsages({ + ...dependencies, + config: { + hooks: ['useInfiniteQuery', 'useQueries', 'useQuery'], + queryClientMethods: ['setQueryDefaults'], + }, + }) + + if (shouldAddKeepPreviousDataImport) { + root + .find(jscodeshift.ImportDeclaration, { + source: { + value: '@tanstack/react-query', + }, + }) + .replaceWith(({ node: mutableNode }) => { + mutableNode.specifiers = [ + jscodeshift.importSpecifier( + jscodeshift.identifier('keepPreviousData'), + ), + ...mutableNode.specifiers, + ] + + return mutableNode + }) + } + + return root.toSource({ quote: 'single', lineTerminator: '\n' }) +} diff --git a/node_modules/@tanstack/react-query/build/codemods/src/v5/keep-previous-data/utils/already-has-placeholder-data-property.cjs b/node_modules/@tanstack/react-query/build/codemods/src/v5/keep-previous-data/utils/already-has-placeholder-data-property.cjs new file mode 100644 index 0000000..c0bca9c --- /dev/null +++ b/node_modules/@tanstack/react-query/build/codemods/src/v5/keep-previous-data/utils/already-has-placeholder-data-property.cjs @@ -0,0 +1,26 @@ +class AlreadyHasPlaceholderDataProperty extends Error { + /** + * @param {import('jscodeshift').CallExpression} callExpression + * @param {string} filePath + */ + constructor(callExpression, filePath) { + super('') + this.message = this.buildMessage(callExpression, filePath) + this.name = 'AlreadyHasPlaceholderDataProperty' + } + + /** + * @param {import('jscodeshift').CallExpression} callExpression + * @param {string} filePath + * @returns {string} + */ + buildMessage(callExpression, filePath) { + const location = callExpression.callee.loc + const start = location.start.line + const end = location.end.line + + return `The usage in file "${filePath}" at line ${start}:${end} already contains a a "placeholderData" property. Please migrate this usage manually.` + } +} + +module.exports = AlreadyHasPlaceholderDataProperty diff --git a/node_modules/@tanstack/react-query/build/codemods/src/v5/remove-overloads/remove-overloads.cjs b/node_modules/@tanstack/react-query/build/codemods/src/v5/remove-overloads/remove-overloads.cjs new file mode 100644 index 0000000..9a7865b --- /dev/null +++ b/node_modules/@tanstack/react-query/build/codemods/src/v5/remove-overloads/remove-overloads.cjs @@ -0,0 +1,58 @@ +const createUtilsObject = require('../../utils/index.cjs') +const transformFilterAwareUsages = require('./transformers/filter-aware-usage-transformer.cjs') +const transformQueryFnAwareUsages = require('./transformers/query-fn-aware-usage-transformer.cjs') + +module.exports = (file, api) => { + const jscodeshift = api.jscodeshift + const root = jscodeshift(file.source) + const utils = createUtilsObject({ root, jscodeshift }) + const filePath = file.path + + const dependencies = { jscodeshift, utils, root, filePath } + + transformFilterAwareUsages({ + ...dependencies, + config: { + keyName: 'queryKey', + fnName: 'queryFn', + queryClientMethods: [ + 'cancelQueries', + 'getQueriesData', + 'invalidateQueries', + 'isFetching', + 'refetchQueries', + 'removeQueries', + 'resetQueries', + // 'setQueriesData', + ], + hooks: ['useIsFetching', 'useQuery'], + }, + }) + + transformFilterAwareUsages({ + ...dependencies, + config: { + keyName: 'mutationKey', + fnName: 'mutationFn', + queryClientMethods: [], + hooks: ['useIsMutating', 'useMutation'], + }, + }) + + transformQueryFnAwareUsages({ + ...dependencies, + config: { + keyName: 'queryKey', + queryClientMethods: [ + 'ensureQueryData', + 'fetchQuery', + 'prefetchQuery', + 'fetchInfiniteQuery', + 'prefetchInfiniteQuery', + ], + hooks: [], + }, + }) + + return root.toSource({ quote: 'single', lineTerminator: '\n' }) +} diff --git a/node_modules/@tanstack/react-query/build/codemods/src/v5/remove-overloads/transformers/filter-aware-usage-transformer.cjs b/node_modules/@tanstack/react-query/build/codemods/src/v5/remove-overloads/transformers/filter-aware-usage-transformer.cjs new file mode 100644 index 0000000..33e098b --- /dev/null +++ b/node_modules/@tanstack/react-query/build/codemods/src/v5/remove-overloads/transformers/filter-aware-usage-transformer.cjs @@ -0,0 +1,271 @@ +const createV5UtilsObject = require('../utils/index.cjs') +const UnknownUsageError = require('../utils/unknown-usage-error.cjs') +const createQueryClientTransformer = require('../../../utils/transformers/query-client-transformer.cjs') +const createQueryCacheTransformer = require('../../../utils/transformers/query-cache-transformer.cjs') +const createUseQueryLikeTransformer = require('../../../utils/transformers/use-query-like-transformer.cjs') + +/** + * @param {import('jscodeshift').api} jscodeshift + * @param {Object} utils + * @param {import('jscodeshift').Collection} root + * @param {string} filePath + * @param {{keyName: "mutationKey"|"queryKey", fnName: "mutationFn"|"queryFn", queryClientMethods: ReadonlyArray, hooks: ReadonlyArray}} config + */ +const transformFilterAwareUsages = ({ + jscodeshift, + utils, + root, + filePath, + config, +}) => { + const v5Utils = createV5UtilsObject({ jscodeshift, utils }) + + /** + * @param {import('jscodeshift').CallExpression} node + * @param {"mutationKey"|"queryKey"} keyName + * @param {"mutationFn"|"queryFn"} fnName + * @returns {boolean} + */ + const canSkipReplacement = (node, keyName, fnName) => { + const callArguments = node.arguments + + const hasKeyOrFnProperty = () => + callArguments[0].properties.some( + (property) => + utils.isObjectProperty(property) && + property.key.name !== keyName && + property.key.name !== fnName, + ) + + /** + * This call has at least one argument. If it's an object expression and contains the "queryKey" or "mutationKey" + * field, the transformation can be skipped, because it's already matching the expected signature. + */ + return ( + callArguments.length > 0 && + utils.isObjectExpression(callArguments[0]) && + hasKeyOrFnProperty() + ) + } + + /** + * This function checks whether the given object property is a spread element or a property that's not named + * "queryKey" or "mutationKey". + * + * @param {import('jscodeshift').ObjectProperty} property + * @returns {boolean} + */ + const predicate = (property) => { + const isSpreadElement = utils.isSpreadElement(property) + const isObjectProperty = utils.isObjectProperty(property) + + return ( + isSpreadElement || + (isObjectProperty && property.key.name !== config.keyName) + ) + } + + const replacer = (path) => { + const node = path.node + + const isFunctionDefinition = (functionArgument) => { + if (utils.isFunctionDefinition(functionArgument)) { + return true + } + + if (utils.isIdentifier(functionArgument)) { + const binding = v5Utils.getBindingFromScope( + path, + functionArgument.name, + filePath, + ) + + const isVariableDeclarator = jscodeshift.match(binding, { + type: jscodeshift.VariableDeclarator.name, + }) + + return isVariableDeclarator && utils.isFunctionDefinition(binding.init) + } + } + + try { + // If the given method/function call matches certain criteria, the node doesn't need to be replaced, this step can be skipped. + if (canSkipReplacement(node, config.keyName, config.fnName)) { + return node + } + + /** + * Here we attempt to determine the first parameter of the function call. + * If it's a function definition, we can create an object property from it (the mutation fn). + */ + const firstArgument = node.arguments[0] + if (isFunctionDefinition(firstArgument)) { + const objectExpression = jscodeshift.objectExpression([ + jscodeshift.property( + 'init', + jscodeshift.identifier(config.fnName), + firstArgument, + ), + ]) + + const secondArgument = node.arguments[1] + + if (secondArgument) { + // If it's an object expression, we can copy the properties from it to the newly created object expression. + if (utils.isObjectExpression(secondArgument)) { + v5Utils.copyPropertiesFromSource( + secondArgument, + objectExpression, + predicate, + ) + } else { + // Otherwise, we simply spread the second argument in the newly created object expression. + objectExpression.properties.push( + jscodeshift.spreadElement(secondArgument), + ) + } + } + + return jscodeshift.callExpression(node.original.callee, [ + objectExpression, + ]) + } + + /** + * If, instead, the first parameter is an array expression or an identifier that references + * an array expression, then we create an object property from it (the query or mutation key). + * + * @type {import('jscodeshift').Property|undefined} + */ + const keyProperty = v5Utils.transformArgumentToKey( + path, + node.arguments[0], + config.keyName, + filePath, + ) + + /** + * The first parameter couldn't be transformed into an object property, so it's time to throw an exception, + * it will notify the consumers that they need to rewrite this usage manually. + */ + if (!keyProperty) { + const secondArgument = + node.arguments.length > 1 ? node.arguments[1] : null + + if (!secondArgument) { + throw new UnknownUsageError(node, filePath) + } + + if (utils.isFunctionDefinition(secondArgument)) { + const originalArguments = node.arguments + const firstArgument = jscodeshift.objectExpression([ + jscodeshift.property( + 'init', + jscodeshift.identifier(config.keyName), + originalArguments[0], + ), + jscodeshift.property( + 'init', + jscodeshift.identifier(config.fnName), + secondArgument, + ), + ]) + + return jscodeshift.callExpression(node.original.callee, [ + firstArgument, + ...originalArguments.slice(2), + ]) + } + } + + const functionArguments = [jscodeshift.objectExpression([keyProperty])] + const secondParameter = node.arguments[1] + + if (secondParameter) { + const createdObjectExpression = functionArguments[0] + + if (isFunctionDefinition(secondParameter)) { + const objectExpression = jscodeshift.objectExpression([ + jscodeshift.property( + 'init', + jscodeshift.identifier(config.keyName), + node.arguments[0], + ), + jscodeshift.property( + 'init', + jscodeshift.identifier(config.fnName), + secondParameter, + ), + ]) + + const thirdArgument = node.arguments[2] + + if (thirdArgument) { + // If it's an object expression, we can copy the properties from it to the newly created object expression. + if (utils.isObjectExpression(thirdArgument)) { + v5Utils.copyPropertiesFromSource( + thirdArgument, + objectExpression, + predicate, + ) + } else { + // Otherwise, we simply spread the third argument in the newly created object expression. + objectExpression.properties.push( + jscodeshift.spreadElement(thirdArgument), + ) + } + } + + return jscodeshift.callExpression(node.original.callee, [ + objectExpression, + ]) + } + + /** + * If it has a second argument, and it's an object expression, then we get the properties from it + * (except the "queryKey" or "mutationKey" properties), because these arguments will also be moved to the + * newly created object expression. + */ + if (utils.isObjectExpression(secondParameter)) { + v5Utils.copyPropertiesFromSource( + secondParameter, + createdObjectExpression, + predicate, + ) + } else { + // Otherwise, we simply spread the second parameter in the newly created object expression. + createdObjectExpression.properties.push( + jscodeshift.spreadElement(secondParameter), + ) + } + } + + // The rest of the function arguments can be simply pushed to the function arguments object so all will be kept. + functionArguments.push(...node.arguments.slice(2)) + + return jscodeshift.callExpression(node.original.callee, functionArguments) + } catch (error) { + utils.warn( + error.name === UnknownUsageError.name + ? error.message + : `An unknown error occurred while processing the "${filePath}" file. Please review this file, because the codemod couldn't be applied.`, + ) + + return node + } + } + + createQueryClientTransformer({ jscodeshift, utils, root }).execute( + config.queryClientMethods, + replacer, + ) + + createUseQueryLikeTransformer({ jscodeshift, utils, root }).execute( + config.hooks, + replacer, + ) + + createQueryCacheTransformer({ jscodeshift, utils, root }).execute(replacer) +} + +module.exports = transformFilterAwareUsages diff --git a/node_modules/@tanstack/react-query/build/codemods/src/v5/remove-overloads/transformers/query-fn-aware-usage-transformer.cjs b/node_modules/@tanstack/react-query/build/codemods/src/v5/remove-overloads/transformers/query-fn-aware-usage-transformer.cjs new file mode 100644 index 0000000..3f29d41 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/codemods/src/v5/remove-overloads/transformers/query-fn-aware-usage-transformer.cjs @@ -0,0 +1,185 @@ +const createV5UtilsObject = require('../utils/index.cjs') +const UnknownUsageError = require('../utils/unknown-usage-error.cjs') +const createQueryClientTransformer = require('../../../utils/transformers/query-client-transformer.cjs') + +/** + * @param {import('jscodeshift').api} jscodeshift + * @param {Object} utils + * @param {import('jscodeshift').Collection} root + * @param {string} filePath + * @param {{keyName: "mutationKey"|"queryKey", queryClientMethods: ReadonlyArray, hooks: ReadonlyArray}} config + */ +const transformQueryFnAwareUsages = ({ + jscodeshift, + utils, + root, + filePath, + config, +}) => { + const v5Utils = createV5UtilsObject({ jscodeshift, utils }) + + /** + * @param {import('jscodeshift').CallExpression} node + * @returns {boolean} + */ + const canSkipReplacement = (node) => { + const callArguments = node.arguments + + const hasKeyProperty = () => + callArguments[0].properties.some( + (property) => + utils.isObjectProperty(property) && + [config.keyName, 'queryFn'].includes(property.key.name), + ) + + return ( + callArguments.length > 0 && + utils.isObjectExpression(callArguments[0]) && + hasKeyProperty() + ) + } + + const predicate = (property) => { + const isSpreadElement = utils.isSpreadElement(property) + const isObjectProperty = utils.isObjectProperty(property) + + return ( + isSpreadElement || + (isObjectProperty && property.key.name !== config.keyName) + ) + } + + const transformArgumentToQueryFunction = (path, node) => { + const isIdentifier = utils.isIdentifier(node) + const isFunctionDefinition = utils.isFunctionDefinition(node) + + if (!isIdentifier && !isFunctionDefinition) { + return undefined + } + + if (isFunctionDefinition) { + return jscodeshift.property( + 'init', + jscodeshift.identifier('queryFn'), + node, + ) + } + + const binding = v5Utils.getBindingFromScope(path, node.name, filePath) + const initializer = v5Utils.getInitializerByDeclarator(binding) + + if (!utils.isFunctionDefinition(initializer)) { + return undefined + } + + return jscodeshift.property( + 'init', + jscodeshift.identifier('queryFn'), + binding.id, + ) + } + + const transformArgumentToOptionsObject = (path, node) => { + if (!utils.isIdentifier(node)) { + return undefined + } + + const binding = v5Utils.getBindingFromScope(path, node.name, filePath) + const initializer = v5Utils.getInitializerByDeclarator(binding) + + if (utils.isObjectExpression(initializer)) { + return jscodeshift.spreadElement(binding.id) + } + } + + const replacer = (path) => { + const node = path.node + + try { + // If the given method/function call matches certain criteria, the node doesn't need to be replaced, this step can be skipped. + if (canSkipReplacement(node)) { + return node + } + + const keyProperty = v5Utils.transformArgumentToKey( + path, + node.arguments[0], + config.keyName, + filePath, + ) + + if (!keyProperty) { + throw new UnknownUsageError(node, filePath) + } + + const parameters = [jscodeshift.objectExpression([keyProperty])] + const createdObjectExpression = parameters[0] + const secondParameter = node.arguments[1] + + if (secondParameter) { + const queryFnProperty = transformArgumentToQueryFunction( + path, + secondParameter, + ) + + if (queryFnProperty) { + createdObjectExpression.properties.push(queryFnProperty) + + const thirdParameter = node.arguments[2] + + if (utils.isObjectExpression(thirdParameter)) { + v5Utils.copyPropertiesFromSource( + thirdParameter, + createdObjectExpression, + predicate, + ) + } else { + createdObjectExpression.properties.push( + jscodeshift.spreadElement(thirdParameter), + ) + } + + return jscodeshift.callExpression(node.original.callee, parameters) + } + + const optionsProperty = transformArgumentToOptionsObject( + path, + secondParameter, + ) + + if (optionsProperty) { + createdObjectExpression.properties.push(optionsProperty) + + return jscodeshift.callExpression(node.original.callee, parameters) + } + + if (utils.isObjectExpression(secondParameter)) { + v5Utils.copyPropertiesFromSource( + secondParameter, + createdObjectExpression, + predicate, + ) + } + + return jscodeshift.callExpression(node.original.callee, parameters) + } + + return jscodeshift.callExpression(node.original.callee, parameters) + } catch (error) { + utils.warn( + error.name === UnknownUsageError.name + ? error.message + : `An unknown error occurred while processing the "${filePath}" file. Please review this file, because the codemod couldn't be applied.`, + ) + + return node + } + } + + createQueryClientTransformer({ jscodeshift, utils, root }).execute( + config.queryClientMethods, + replacer, + ) +} + +module.exports = transformQueryFnAwareUsages diff --git a/node_modules/@tanstack/react-query/build/codemods/src/v5/remove-overloads/utils/index.cjs b/node_modules/@tanstack/react-query/build/codemods/src/v5/remove-overloads/utils/index.cjs new file mode 100644 index 0000000..5e81bf4 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/codemods/src/v5/remove-overloads/utils/index.cjs @@ -0,0 +1,123 @@ +const UnknownUsageError = require('./unknown-usage-error.cjs') + +module.exports = ({ jscodeshift, utils }) => { + /** + * + * @param {import('jscodeshift').ObjectExpression} source + * @param {import('jscodeshift').ObjectExpression} target + * @param {(node: import('jscodeshift').Node) => boolean} predicate + */ + const copyPropertiesFromSource = (source, target, predicate) => { + source.properties.forEach((property) => { + if (predicate(property)) { + target.properties.push(property) + } + }) + } + + /** + * @param {import('jscodeshift').NodePath} path + * @param {string} argumentName + * @param {string} filePath + * @returns {*} + */ + const getBindingFromScope = (path, argumentName, filePath) => { + /** + * If the current scope contains the declaration then we can use the actual one else we attempt to find the + * binding from above. + */ + const scope = path.scope.declares(argumentName) + ? path.scope + : path.scope.lookup(argumentName) + + /** + * The declaration couldn't be found for some reason, time to move on. We warn the user it needs to be rewritten + * by themselves. + */ + if (!scope) { + return undefined + } + + const binding = scope.bindings[argumentName] + .filter((item) => utils.isIdentifier(item.value)) + .map((item) => item.parentPath.value) + .at(0) + + if (!binding) { + throw new UnknownUsageError(path.node, filePath) + } + + return binding + } + + /** + * @param {import('jscodeshift').VariableDeclarator} binding + * @returns {import('jscodeshift').Node|undefined} + */ + const getInitializerByDeclarator = (binding) => { + const isVariableDeclaration = jscodeshift.match(binding, { + type: jscodeshift.VariableDeclarator.name, + }) + + if (!isVariableDeclaration) { + return undefined + } + + const isTSAsExpression = jscodeshift.match(binding.init, { + type: jscodeshift.TSAsExpression.name, + }) + + return isTSAsExpression ? binding.init.expression : binding.init + } + + /** + * @param {import('jscodeshift').Node} node + * @returns {boolean} + */ + const isArrayExpressionVariable = (node) => + jscodeshift.match(node, { + type: jscodeshift.VariableDeclarator.name, + init: { + type: jscodeshift.ArrayExpression.name, + }, + }) + + /** + * @param {import('jscodeshift').NodePath} path + * @param {import('jscodeshift').Node} node + * @param {"queryKey"|"mutationKey"} keyName + * @param {string} filePath + * @returns {import('jscodeshift').Property|undefined} + */ + const transformArgumentToKey = (path, node, keyName, filePath) => { + // If the first argument is an identifier we have to infer its type if possible. + if (utils.isIdentifier(node)) { + const binding = getBindingFromScope(path, node.name, filePath) + + if (isArrayExpressionVariable(binding)) { + return jscodeshift.property( + 'init', + jscodeshift.identifier(keyName), + jscodeshift.identifier(binding.id.name), + ) + } + } + + // If the first argument is an array, then it matches the following overload: + // methodName(queryKey?: QueryKey, firstObject?: TFirstObject, secondObject?: TSecondObject) + if (utils.isArrayExpression(node)) { + // Then we create the 'queryKey' property based on it, because it will be passed to the first argument + // that should be an object according to the new signature. + return jscodeshift.property('init', jscodeshift.identifier(keyName), node) + } + + return undefined + } + + return { + copyPropertiesFromSource, + getInitializerByDeclarator, + getBindingFromScope, + transformArgumentToKey, + } +} diff --git a/node_modules/@tanstack/react-query/build/codemods/src/v5/remove-overloads/utils/unknown-usage-error.cjs b/node_modules/@tanstack/react-query/build/codemods/src/v5/remove-overloads/utils/unknown-usage-error.cjs new file mode 100644 index 0000000..ff722ff --- /dev/null +++ b/node_modules/@tanstack/react-query/build/codemods/src/v5/remove-overloads/utils/unknown-usage-error.cjs @@ -0,0 +1,27 @@ +class UnknownUsageError extends Error { + /** + * @param {import('jscodeshift').CallExpression} callExpression + * @param {string} filePath + */ + constructor(callExpression, filePath) { + super('') + this.message = this.buildMessage(callExpression, filePath) + this.name = 'UnknownUsageError' + } + + /** + * + * @param {import('jscodeshift').CallExpression} callExpression + * @param {string} filePath + * @returns {string} + */ + buildMessage(callExpression, filePath) { + const location = callExpression.callee.loc + const start = location.start.line + const end = location.end.line + + return `The usage in file "${filePath}" at line ${start}:${end} could not be transformed into the new syntax. Please do this manually.` + } +} + +module.exports = UnknownUsageError diff --git a/node_modules/@tanstack/react-query/build/codemods/src/v5/rename-hydrate/rename-hydrate.cjs b/node_modules/@tanstack/react-query/build/codemods/src/v5/rename-hydrate/rename-hydrate.cjs new file mode 100644 index 0000000..488040d --- /dev/null +++ b/node_modules/@tanstack/react-query/build/codemods/src/v5/rename-hydrate/rename-hydrate.cjs @@ -0,0 +1,55 @@ +module.exports = (file, api) => { + const jscodeshift = api.jscodeshift + const root = jscodeshift(file.source) + + const importSpecifiers = root + .find(jscodeshift.ImportDeclaration, { + source: { + value: '@tanstack/react-query', + }, + }) + .find(jscodeshift.ImportSpecifier, { + imported: { + name: 'Hydrate', + }, + }) + + if (importSpecifiers.length > 0) { + const names = { + searched: 'Hydrate', // By default, we want to replace the `Hydrate` usages. + target: 'HydrationBoundary', // We want to replace them with `HydrationBoundary`. + } + + importSpecifiers.replaceWith(({ node: mutableNode }) => { + /** + * When the local and imported names match which means the code doesn't contain import aliases, we need + * to replace only the import specifier. + * @type {boolean} + */ + const usesDefaultImport = + mutableNode.local.name === mutableNode.imported.name + + if (!usesDefaultImport) { + // If the code uses import aliases, we must re-use the alias. + names.searched = mutableNode.local.name + names.target = mutableNode.local.name + } + + // Override the import specifier. + mutableNode.imported.name = 'HydrationBoundary' + + return mutableNode + }) + + root + .findJSXElements(names.searched) + .replaceWith(({ node: mutableNode }) => { + mutableNode.openingElement.name.name = names.target + mutableNode.closingElement.name.name = names.target + + return mutableNode + }) + } + + return root.toSource({ quote: 'single', lineTerminator: '\n' }) +} diff --git a/node_modules/@tanstack/react-query/build/codemods/src/v5/rename-properties/rename-properties.cjs b/node_modules/@tanstack/react-query/build/codemods/src/v5/rename-properties/rename-properties.cjs new file mode 100644 index 0000000..3213be7 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/codemods/src/v5/rename-properties/rename-properties.cjs @@ -0,0 +1,41 @@ +module.exports = (file, api) => { + const jscodeshift = api.jscodeshift + const root = jscodeshift(file.source) + + const baseRenameLogic = (kind, from, to) => { + root + .find(kind, (node) => { + return ( + node.computed === false && + (node.key?.name === from || node.key?.value === from) + ) + }) + .replaceWith(({ node: mutableNode }) => { + if (mutableNode.key.name !== undefined) { + mutableNode.key.name = to + } + + if (mutableNode.key.value !== undefined) { + mutableNode.key.value = to + } + + return mutableNode + }) + } + + const renameObjectProperty = (from, to) => { + baseRenameLogic(jscodeshift.ObjectProperty, from, to) + } + + const renameTypeScriptPropertySignature = (from, to) => { + baseRenameLogic(jscodeshift.TSPropertySignature, from, to) + } + + renameObjectProperty('cacheTime', 'gcTime') + renameObjectProperty('useErrorBoundary', 'throwOnError') + + renameTypeScriptPropertySignature('cacheTime', 'gcTime') + renameTypeScriptPropertySignature('useErrorBoundary', 'throwOnError') + + return root.toSource({ quote: 'single', lineTerminator: '\n' }) +} diff --git a/node_modules/@tanstack/react-query/build/legacy/HydrationBoundary.cjs b/node_modules/@tanstack/react-query/build/legacy/HydrationBoundary.cjs new file mode 100644 index 0000000..ac23049 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/legacy/HydrationBoundary.cjs @@ -0,0 +1,91 @@ +"use strict"; +"use client"; +var __create = Object.create; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __getProtoOf = Object.getPrototypeOf; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( + // If the importer is in node compatibility mode or this is not an ESM + // file that has been converted to a CommonJS file using a Babel- + // compatible transform (i.e. "__esModule" has not been set), then set + // "default" to the CommonJS "module.exports" for node compatibility. + isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, + mod +)); +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/HydrationBoundary.tsx +var HydrationBoundary_exports = {}; +__export(HydrationBoundary_exports, { + HydrationBoundary: () => HydrationBoundary +}); +module.exports = __toCommonJS(HydrationBoundary_exports); +var React = __toESM(require("react"), 1); +var import_query_core = require("@tanstack/query-core"); +var import_QueryClientProvider = require("./QueryClientProvider.cjs"); +var HydrationBoundary = ({ + children, + options = {}, + state, + queryClient +}) => { + const client = (0, import_QueryClientProvider.useQueryClient)(queryClient); + const optionsRef = React.useRef(options); + React.useEffect(() => { + optionsRef.current = options; + }); + const hydrationQueue = React.useMemo(() => { + if (state) { + if (typeof state !== "object") { + return; + } + const queryCache = client.getQueryCache(); + const queries = state.queries || []; + const newQueries = []; + const existingQueries = []; + for (const dehydratedQuery of queries) { + const existingQuery = queryCache.get(dehydratedQuery.queryHash); + if (!existingQuery) { + newQueries.push(dehydratedQuery); + } else { + const hydrationIsNewer = dehydratedQuery.state.dataUpdatedAt > existingQuery.state.dataUpdatedAt || dehydratedQuery.promise && existingQuery.state.status !== "pending" && existingQuery.state.fetchStatus !== "fetching" && dehydratedQuery.dehydratedAt !== void 0 && dehydratedQuery.dehydratedAt > existingQuery.state.dataUpdatedAt; + if (hydrationIsNewer) { + existingQueries.push(dehydratedQuery); + } + } + } + if (newQueries.length > 0) { + (0, import_query_core.hydrate)(client, { queries: newQueries }, optionsRef.current); + } + if (existingQueries.length > 0) { + return existingQueries; + } + } + return void 0; + }, [client, state]); + React.useEffect(() => { + if (hydrationQueue) { + (0, import_query_core.hydrate)(client, { queries: hydrationQueue }, optionsRef.current); + } + }, [client, hydrationQueue]); + return children; +}; +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + HydrationBoundary +}); +//# sourceMappingURL=HydrationBoundary.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/HydrationBoundary.cjs.map b/node_modules/@tanstack/react-query/build/legacy/HydrationBoundary.cjs.map new file mode 100644 index 0000000..7a8d445 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/legacy/HydrationBoundary.cjs.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/HydrationBoundary.tsx"],"sourcesContent":["'use client'\nimport * as React from 'react'\n\nimport { hydrate } from '@tanstack/query-core'\nimport { useQueryClient } from './QueryClientProvider'\nimport type {\n DehydratedState,\n HydrateOptions,\n OmitKeyof,\n QueryClient,\n} from '@tanstack/query-core'\n\nexport interface HydrationBoundaryProps {\n state: DehydratedState | null | undefined\n options?: OmitKeyof & {\n defaultOptions?: OmitKeyof<\n Exclude,\n 'mutations'\n >\n }\n children?: React.ReactNode\n queryClient?: QueryClient\n}\n\nexport const HydrationBoundary = ({\n children,\n options = {},\n state,\n queryClient,\n}: HydrationBoundaryProps) => {\n const client = useQueryClient(queryClient)\n\n const optionsRef = React.useRef(options)\n React.useEffect(() => {\n optionsRef.current = options\n })\n\n // This useMemo is for performance reasons only, everything inside it must\n // be safe to run in every render and code here should be read as \"in render\".\n //\n // This code needs to happen during the render phase, because after initial\n // SSR, hydration needs to happen _before_ children render. Also, if hydrating\n // during a transition, we want to hydrate as much as is safe in render so\n // we can prerender as much as possible.\n //\n // For any queries that already exist in the cache, we want to hold back on\n // hydrating until _after_ the render phase. The reason for this is that during\n // transitions, we don't want the existing queries and observers to update to\n // the new data on the current page, only _after_ the transition is committed.\n // If the transition is aborted, we will have hydrated any _new_ queries, but\n // we throw away the fresh data for any existing ones to avoid unexpectedly\n // updating the UI.\n const hydrationQueue: DehydratedState['queries'] | undefined =\n React.useMemo(() => {\n if (state) {\n if (typeof state !== 'object') {\n return\n }\n\n const queryCache = client.getQueryCache()\n // State is supplied from the outside and we might as well fail\n // gracefully if it has the wrong shape, so while we type `queries`\n // as required, we still provide a fallback.\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n const queries = state.queries || []\n\n const newQueries: DehydratedState['queries'] = []\n const existingQueries: DehydratedState['queries'] = []\n for (const dehydratedQuery of queries) {\n const existingQuery = queryCache.get(dehydratedQuery.queryHash)\n\n if (!existingQuery) {\n newQueries.push(dehydratedQuery)\n } else {\n const hydrationIsNewer =\n dehydratedQuery.state.dataUpdatedAt >\n existingQuery.state.dataUpdatedAt ||\n (dehydratedQuery.promise &&\n existingQuery.state.status !== 'pending' &&\n existingQuery.state.fetchStatus !== 'fetching' &&\n dehydratedQuery.dehydratedAt !== undefined &&\n dehydratedQuery.dehydratedAt >\n existingQuery.state.dataUpdatedAt)\n\n if (hydrationIsNewer) {\n existingQueries.push(dehydratedQuery)\n }\n }\n }\n\n if (newQueries.length > 0) {\n // It's actually fine to call this with queries/state that already exists\n // in the cache, or is older. hydrate() is idempotent for queries.\n // eslint-disable-next-line react-hooks/refs\n hydrate(client, { queries: newQueries }, optionsRef.current)\n }\n if (existingQueries.length > 0) {\n return existingQueries\n }\n }\n return undefined\n }, [client, state])\n\n React.useEffect(() => {\n if (hydrationQueue) {\n hydrate(client, { queries: hydrationQueue }, optionsRef.current)\n }\n }, [client, hydrationQueue])\n\n return children as React.ReactElement\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,YAAuB;AAEvB,wBAAwB;AACxB,iCAA+B;AAoBxB,IAAM,oBAAoB,CAAC;AAAA,EAChC;AAAA,EACA,UAAU,CAAC;AAAA,EACX;AAAA,EACA;AACF,MAA8B;AAC5B,QAAM,aAAS,2CAAe,WAAW;AAEzC,QAAM,aAAmB,aAAO,OAAO;AACvC,EAAM,gBAAU,MAAM;AACpB,eAAW,UAAU;AAAA,EACvB,CAAC;AAiBD,QAAM,iBACE,cAAQ,MAAM;AAClB,QAAI,OAAO;AACT,UAAI,OAAO,UAAU,UAAU;AAC7B;AAAA,MACF;AAEA,YAAM,aAAa,OAAO,cAAc;AAKxC,YAAM,UAAU,MAAM,WAAW,CAAC;AAElC,YAAM,aAAyC,CAAC;AAChD,YAAM,kBAA8C,CAAC;AACrD,iBAAW,mBAAmB,SAAS;AACrC,cAAM,gBAAgB,WAAW,IAAI,gBAAgB,SAAS;AAE9D,YAAI,CAAC,eAAe;AAClB,qBAAW,KAAK,eAAe;AAAA,QACjC,OAAO;AACL,gBAAM,mBACJ,gBAAgB,MAAM,gBACpB,cAAc,MAAM,iBACrB,gBAAgB,WACf,cAAc,MAAM,WAAW,aAC/B,cAAc,MAAM,gBAAgB,cACpC,gBAAgB,iBAAiB,UACjC,gBAAgB,eACd,cAAc,MAAM;AAE1B,cAAI,kBAAkB;AACpB,4BAAgB,KAAK,eAAe;AAAA,UACtC;AAAA,QACF;AAAA,MACF;AAEA,UAAI,WAAW,SAAS,GAAG;AAIzB,uCAAQ,QAAQ,EAAE,SAAS,WAAW,GAAG,WAAW,OAAO;AAAA,MAC7D;AACA,UAAI,gBAAgB,SAAS,GAAG;AAC9B,eAAO;AAAA,MACT;AAAA,IACF;AACA,WAAO;AAAA,EACT,GAAG,CAAC,QAAQ,KAAK,CAAC;AAEpB,EAAM,gBAAU,MAAM;AACpB,QAAI,gBAAgB;AAClB,qCAAQ,QAAQ,EAAE,SAAS,eAAe,GAAG,WAAW,OAAO;AAAA,IACjE;AAAA,EACF,GAAG,CAAC,QAAQ,cAAc,CAAC;AAE3B,SAAO;AACT;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/HydrationBoundary.d.cts b/node_modules/@tanstack/react-query/build/legacy/HydrationBoundary.d.cts new file mode 100644 index 0000000..39d63fa --- /dev/null +++ b/node_modules/@tanstack/react-query/build/legacy/HydrationBoundary.d.cts @@ -0,0 +1,14 @@ +import * as React from 'react'; +import { DehydratedState, OmitKeyof, HydrateOptions, QueryClient } from '@tanstack/query-core'; + +interface HydrationBoundaryProps { + state: DehydratedState | null | undefined; + options?: OmitKeyof & { + defaultOptions?: OmitKeyof, 'mutations'>; + }; + children?: React.ReactNode; + queryClient?: QueryClient; +} +declare const HydrationBoundary: ({ children, options, state, queryClient, }: HydrationBoundaryProps) => React.ReactElement; + +export { HydrationBoundary, type HydrationBoundaryProps }; diff --git a/node_modules/@tanstack/react-query/build/legacy/HydrationBoundary.d.ts b/node_modules/@tanstack/react-query/build/legacy/HydrationBoundary.d.ts new file mode 100644 index 0000000..39d63fa --- /dev/null +++ b/node_modules/@tanstack/react-query/build/legacy/HydrationBoundary.d.ts @@ -0,0 +1,14 @@ +import * as React from 'react'; +import { DehydratedState, OmitKeyof, HydrateOptions, QueryClient } from '@tanstack/query-core'; + +interface HydrationBoundaryProps { + state: DehydratedState | null | undefined; + options?: OmitKeyof & { + defaultOptions?: OmitKeyof, 'mutations'>; + }; + children?: React.ReactNode; + queryClient?: QueryClient; +} +declare const HydrationBoundary: ({ children, options, state, queryClient, }: HydrationBoundaryProps) => React.ReactElement; + +export { HydrationBoundary, type HydrationBoundaryProps }; diff --git a/node_modules/@tanstack/react-query/build/legacy/HydrationBoundary.js b/node_modules/@tanstack/react-query/build/legacy/HydrationBoundary.js new file mode 100644 index 0000000..4acd78b --- /dev/null +++ b/node_modules/@tanstack/react-query/build/legacy/HydrationBoundary.js @@ -0,0 +1,57 @@ +"use client"; + +// src/HydrationBoundary.tsx +import * as React from "react"; +import { hydrate } from "@tanstack/query-core"; +import { useQueryClient } from "./QueryClientProvider.js"; +var HydrationBoundary = ({ + children, + options = {}, + state, + queryClient +}) => { + const client = useQueryClient(queryClient); + const optionsRef = React.useRef(options); + React.useEffect(() => { + optionsRef.current = options; + }); + const hydrationQueue = React.useMemo(() => { + if (state) { + if (typeof state !== "object") { + return; + } + const queryCache = client.getQueryCache(); + const queries = state.queries || []; + const newQueries = []; + const existingQueries = []; + for (const dehydratedQuery of queries) { + const existingQuery = queryCache.get(dehydratedQuery.queryHash); + if (!existingQuery) { + newQueries.push(dehydratedQuery); + } else { + const hydrationIsNewer = dehydratedQuery.state.dataUpdatedAt > existingQuery.state.dataUpdatedAt || dehydratedQuery.promise && existingQuery.state.status !== "pending" && existingQuery.state.fetchStatus !== "fetching" && dehydratedQuery.dehydratedAt !== void 0 && dehydratedQuery.dehydratedAt > existingQuery.state.dataUpdatedAt; + if (hydrationIsNewer) { + existingQueries.push(dehydratedQuery); + } + } + } + if (newQueries.length > 0) { + hydrate(client, { queries: newQueries }, optionsRef.current); + } + if (existingQueries.length > 0) { + return existingQueries; + } + } + return void 0; + }, [client, state]); + React.useEffect(() => { + if (hydrationQueue) { + hydrate(client, { queries: hydrationQueue }, optionsRef.current); + } + }, [client, hydrationQueue]); + return children; +}; +export { + HydrationBoundary +}; +//# sourceMappingURL=HydrationBoundary.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/HydrationBoundary.js.map b/node_modules/@tanstack/react-query/build/legacy/HydrationBoundary.js.map new file mode 100644 index 0000000..63d8469 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/legacy/HydrationBoundary.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/HydrationBoundary.tsx"],"sourcesContent":["'use client'\nimport * as React from 'react'\n\nimport { hydrate } from '@tanstack/query-core'\nimport { useQueryClient } from './QueryClientProvider'\nimport type {\n DehydratedState,\n HydrateOptions,\n OmitKeyof,\n QueryClient,\n} from '@tanstack/query-core'\n\nexport interface HydrationBoundaryProps {\n state: DehydratedState | null | undefined\n options?: OmitKeyof & {\n defaultOptions?: OmitKeyof<\n Exclude,\n 'mutations'\n >\n }\n children?: React.ReactNode\n queryClient?: QueryClient\n}\n\nexport const HydrationBoundary = ({\n children,\n options = {},\n state,\n queryClient,\n}: HydrationBoundaryProps) => {\n const client = useQueryClient(queryClient)\n\n const optionsRef = React.useRef(options)\n React.useEffect(() => {\n optionsRef.current = options\n })\n\n // This useMemo is for performance reasons only, everything inside it must\n // be safe to run in every render and code here should be read as \"in render\".\n //\n // This code needs to happen during the render phase, because after initial\n // SSR, hydration needs to happen _before_ children render. Also, if hydrating\n // during a transition, we want to hydrate as much as is safe in render so\n // we can prerender as much as possible.\n //\n // For any queries that already exist in the cache, we want to hold back on\n // hydrating until _after_ the render phase. The reason for this is that during\n // transitions, we don't want the existing queries and observers to update to\n // the new data on the current page, only _after_ the transition is committed.\n // If the transition is aborted, we will have hydrated any _new_ queries, but\n // we throw away the fresh data for any existing ones to avoid unexpectedly\n // updating the UI.\n const hydrationQueue: DehydratedState['queries'] | undefined =\n React.useMemo(() => {\n if (state) {\n if (typeof state !== 'object') {\n return\n }\n\n const queryCache = client.getQueryCache()\n // State is supplied from the outside and we might as well fail\n // gracefully if it has the wrong shape, so while we type `queries`\n // as required, we still provide a fallback.\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n const queries = state.queries || []\n\n const newQueries: DehydratedState['queries'] = []\n const existingQueries: DehydratedState['queries'] = []\n for (const dehydratedQuery of queries) {\n const existingQuery = queryCache.get(dehydratedQuery.queryHash)\n\n if (!existingQuery) {\n newQueries.push(dehydratedQuery)\n } else {\n const hydrationIsNewer =\n dehydratedQuery.state.dataUpdatedAt >\n existingQuery.state.dataUpdatedAt ||\n (dehydratedQuery.promise &&\n existingQuery.state.status !== 'pending' &&\n existingQuery.state.fetchStatus !== 'fetching' &&\n dehydratedQuery.dehydratedAt !== undefined &&\n dehydratedQuery.dehydratedAt >\n existingQuery.state.dataUpdatedAt)\n\n if (hydrationIsNewer) {\n existingQueries.push(dehydratedQuery)\n }\n }\n }\n\n if (newQueries.length > 0) {\n // It's actually fine to call this with queries/state that already exists\n // in the cache, or is older. hydrate() is idempotent for queries.\n // eslint-disable-next-line react-hooks/refs\n hydrate(client, { queries: newQueries }, optionsRef.current)\n }\n if (existingQueries.length > 0) {\n return existingQueries\n }\n }\n return undefined\n }, [client, state])\n\n React.useEffect(() => {\n if (hydrationQueue) {\n hydrate(client, { queries: hydrationQueue }, optionsRef.current)\n }\n }, [client, hydrationQ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,eAAe,GAAG,WAAW,OAAO;AAAA,IACjE;AAAA,EACF,GAAG,CAAC,QAAQ,cAAc,CAAC;AAE3B,SAAO;AACT;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/IsRestoringProvider.cjs b/node_modules/@tanstack/react-query/build/legacy/IsRestoringProvider.cjs new file mode 100644 index 0000000..f607420 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/legacy/IsRestoringProvider.cjs @@ -0,0 +1,47 @@ +"use strict"; +"use client"; +var __create = Object.create; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __getProtoOf = Object.getPrototypeOf; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( + // If the importer is in node compatibility mode or this is not an ESM + // file that has been converted to a CommonJS file using a Babel- + // compatible transform (i.e. "__esModule" has not been set), then set + // "default" to the CommonJS "module.exports" for node compatibility. + isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, + mod +)); +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/IsRestoringProvider.ts +var IsRestoringProvider_exports = {}; +__export(IsRestoringProvider_exports, { + IsRestoringProvider: () => IsRestoringProvider, + useIsRestoring: () => useIsRestoring +}); +module.exports = __toCommonJS(IsRestoringProvider_exports); +var React = __toESM(require("react"), 1); +var IsRestoringContext = React.createContext(false); +var useIsRestoring = () => React.useContext(IsRestoringContext); +var IsRestoringProvider = IsRestoringContext.Provider; +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + IsRestoringProvider, + useIsRestoring +}); +//# sourceMappingURL=IsRestoringProvider.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/IsRestoringProvider.cjs.map b/node_modules/@tanstack/react-query/build/legacy/IsRestoringProvider.cjs.map new file mode 100644 index 0000000..2c98a9d --- /dev/null +++ b/node_modules/@tanstack/react-query/build/legacy/IsRestoringProvider.cjs.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/IsRestoringProvider.ts"],"sourcesContent":["'use client'\nimport * as React from 'react'\n\nconst IsRestoringContext = React.createContext(false)\n\nexport const useIsRestoring = () => React.useContext(IsRestoringContext)\nexport const IsRestoringProvider = IsRestoringContext.Provider\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,YAAuB;AAEvB,IAAM,qBAA2B,oBAAc,KAAK;AAE7C,IAAM,iBAAiB,MAAY,iBAAW,kBAAkB;AAChE,IAAM,sBAAsB,mBAAmB;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/IsRestoringProvider.d.cts b/node_modules/@tanstack/react-query/build/legacy/IsRestoringProvider.d.cts new file mode 100644 index 0000000..08b14ff --- /dev/null +++ b/node_modules/@tanstack/react-query/build/legacy/IsRestoringProvider.d.cts @@ -0,0 +1,6 @@ +import * as React from 'react'; + +declare const useIsRestoring: () => boolean; +declare const IsRestoringProvider: React.Provider; + +export { IsRestoringProvider, useIsRestoring }; diff --git a/node_modules/@tanstack/react-query/build/legacy/IsRestoringProvider.d.ts b/node_modules/@tanstack/react-query/build/legacy/IsRestoringProvider.d.ts new file mode 100644 index 0000000..08b14ff --- /dev/null +++ b/node_modules/@tanstack/react-query/build/legacy/IsRestoringProvider.d.ts @@ -0,0 +1,6 @@ +import * as React from 'react'; + +declare const useIsRestoring: () => boolean; +declare const IsRestoringProvider: React.Provider; + +export { IsRestoringProvider, useIsRestoring }; diff --git a/node_modules/@tanstack/react-query/build/legacy/IsRestoringProvider.js b/node_modules/@tanstack/react-query/build/legacy/IsRestoringProvider.js new file mode 100644 index 0000000..374f82e --- /dev/null +++ b/node_modules/@tanstack/react-query/build/legacy/IsRestoringProvider.js @@ -0,0 +1,12 @@ +"use client"; + +// src/IsRestoringProvider.ts +import * as React from "react"; +var IsRestoringContext = React.createContext(false); +var useIsRestoring = () => React.useContext(IsRestoringContext); +var IsRestoringProvider = IsRestoringContext.Provider; +export { + IsRestoringProvider, + useIsRestoring +}; +//# sourceMappingURL=IsRestoringProvider.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/IsRestoringProvider.js.map b/node_modules/@tanstack/react-query/build/legacy/IsRestoringProvider.js.map new file mode 100644 index 0000000..a31bfa3 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/legacy/IsRestoringProvider.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/IsRestoringProvider.ts"],"sourcesContent":["'use client'\nimport * as React from 'react'\n\nconst IsRestoringContext = React.createContext(false)\n\nexport const useIsRestoring = () => React.useContext(IsRestoringContext)\nexport const IsRestoringProvider = IsRestoringContext.Provider\n"],"mappings":";;;AACA,YAAY,WAAW;AAEvB,IAAM,qBAA2B,oBAAc,KAAK;AAE7C,IAAM,iBAAiB,MAAY,iBAAW,kBAAkB;AAChE,IAAM,sBAAsB,mBAAmB;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/QueryClientProvider.cjs b/node_modules/@tanstack/react-query/build/legacy/QueryClientProvider.cjs new file mode 100644 index 0000000..d91255c --- /dev/null +++ b/node_modules/@tanstack/react-query/build/legacy/QueryClientProvider.cjs @@ -0,0 +1,72 @@ +"use strict"; +"use client"; +var __create = Object.create; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __getProtoOf = Object.getPrototypeOf; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( + // If the importer is in node compatibility mode or this is not an ESM + // file that has been converted to a CommonJS file using a Babel- + // compatible transform (i.e. "__esModule" has not been set), then set + // "default" to the CommonJS "module.exports" for node compatibility. + isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, + mod +)); +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/QueryClientProvider.tsx +var QueryClientProvider_exports = {}; +__export(QueryClientProvider_exports, { + QueryClientContext: () => QueryClientContext, + QueryClientProvider: () => QueryClientProvider, + useQueryClient: () => useQueryClient +}); +module.exports = __toCommonJS(QueryClientProvider_exports); +var React = __toESM(require("react"), 1); +var import_jsx_runtime = require("react/jsx-runtime"); +var QueryClientContext = React.createContext( + void 0 +); +var useQueryClient = (queryClient) => { + const client = React.useContext(QueryClientContext); + if (queryClient) { + return queryClient; + } + if (!client) { + throw new Error("No QueryClient set, use QueryClientProvider to set one"); + } + return client; +}; +var QueryClientProvider = ({ + client, + children +}) => { + React.useEffect(() => { + client.mount(); + return () => { + client.unmount(); + }; + }, [client]); + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(QueryClientContext.Provider, { value: client, children }); +}; +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + QueryClientContext, + QueryClientProvider, + useQueryClient +}); +//# sourceMappingURL=QueryClientProvider.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/QueryClientProvider.cjs.map b/node_modules/@tanstack/react-query/build/legacy/QueryClientProvider.cjs.map new file mode 100644 index 0000000..d97eb88 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/legacy/QueryClientProvider.cjs.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/QueryClientProvider.tsx"],"sourcesContent":["'use client'\nimport * as React from 'react'\n\nimport type { QueryClient } from '@tanstack/query-core'\n\nexport const QueryClientContext = React.createContext(\n undefined,\n)\n\nexport const useQueryClient = (queryClient?: QueryClient) => {\n const client = React.useContext(QueryClientContext)\n\n if (queryClient) {\n return queryClient\n }\n\n if (!client) {\n throw new Error('No QueryClient set, use QueryClientProvider to set one')\n }\n\n return client\n}\n\nexport type QueryClientProviderProps = {\n client: QueryClient\n children?: React.ReactNode\n}\n\nexport const QueryClientProvider = ({\n client,\n children,\n}: QueryClientProviderProps): React.JSX.Element => {\n React.useEffect(() => {\n client.mount()\n return () => {\n client.unmount()\n }\n }, [client])\n\n return (\n \n {children}\n \n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,YAAuB;AAuCnB;AAnCG,IAAM,qBAA2B;AAAA,EACtC;AACF;AAEO,IAAM,iBAAiB,CAAC,gBAA8B;AAC3D,QAAM,SAAe,iBAAW,kBAAkB;AAElD,MAAI,aAAa;AACf,WAAO;AAAA,EACT;AAEA,MAAI,CAAC,QAAQ;AACX,UAAM,IAAI,MAAM,wDAAwD;AAAA,EAC1E;AAEA,SAAO;AACT;AAOO,IAAM,sBAAsB,CAAC;AAAA,EAClC;AAAA,EACA;AACF,MAAmD;AACjD,EAAM,gBAAU,MAAM;AACpB,WAAO,MAAM;AACb,WAAO,MAAM;AACX,aAAO,QAAQ;AAAA,IACjB;AAAA,EACF,GAAG,CAAC,MAAM,CAAC;AAEX,SACE,4CAAC,mBAAmB,UAAnB,EAA4B,OAAO,QACjC,UACH;AAEJ;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/QueryClientProvider.d.cts b/node_modules/@tanstack/react-query/build/legacy/QueryClientProvider.d.cts new file mode 100644 index 0000000..1b1fd69 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/legacy/QueryClientProvider.d.cts @@ -0,0 +1,12 @@ +import * as React from 'react'; +import { QueryClient } from '@tanstack/query-core'; + +declare const QueryClientContext: React.Context; +declare const useQueryClient: (queryClient?: QueryClient) => QueryClient; +type QueryClientProviderProps = { + client: QueryClient; + children?: React.ReactNode; +}; +declare const QueryClientProvider: ({ client, children, }: QueryClientProviderProps) => React.JSX.Element; + +export { QueryClientContext, QueryClientProvider, type QueryClientProviderProps, useQueryClient }; diff --git a/node_modules/@tanstack/react-query/build/legacy/QueryClientProvider.d.ts b/node_modules/@tanstack/react-query/build/legacy/QueryClientProvider.d.ts new file mode 100644 index 0000000..1b1fd69 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/legacy/QueryClientProvider.d.ts @@ -0,0 +1,12 @@ +import * as React from 'react'; +import { QueryClient } from '@tanstack/query-core'; + +declare const QueryClientContext: React.Context; +declare const useQueryClient: (queryClient?: QueryClient) => QueryClient; +type QueryClientProviderProps = { + client: QueryClient; + children?: React.ReactNode; +}; +declare const QueryClientProvider: ({ client, children, }: QueryClientProviderProps) => React.JSX.Element; + +export { QueryClientContext, QueryClientProvider, type QueryClientProviderProps, useQueryClient }; diff --git a/node_modules/@tanstack/react-query/build/legacy/QueryClientProvider.js b/node_modules/@tanstack/react-query/build/legacy/QueryClientProvider.js new file mode 100644 index 0000000..fc4d5f2 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/legacy/QueryClientProvider.js @@ -0,0 +1,36 @@ +"use client"; + +// src/QueryClientProvider.tsx +import * as React from "react"; +import { jsx } from "react/jsx-runtime"; +var QueryClientContext = React.createContext( + void 0 +); +var useQueryClient = (queryClient) => { + const client = React.useContext(QueryClientContext); + if (queryClient) { + return queryClient; + } + if (!client) { + throw new Error("No QueryClient set, use QueryClientProvider to set one"); + } + return client; +}; +var QueryClientProvider = ({ + client, + children +}) => { + React.useEffect(() => { + client.mount(); + return () => { + client.unmount(); + }; + }, [client]); + return /* @__PURE__ */ jsx(QueryClientContext.Provider, { value: client, children }); +}; +export { + QueryClientContext, + QueryClientProvider, + useQueryClient +}; +//# sourceMappingURL=QueryClientProvider.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/QueryClientProvider.js.map b/node_modules/@tanstack/react-query/build/legacy/QueryClientProvider.js.map new file mode 100644 index 0000000..44bad03 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/legacy/QueryClientProvider.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/QueryClientProvider.tsx"],"sourcesContent":["'use client'\nimport * as React from 'react'\n\nimport type { QueryClient } from '@tanstack/query-core'\n\nexport const QueryClientContext = React.createContext(\n undefined,\n)\n\nexport const useQueryClient = (queryClient?: QueryClient) => {\n const client = React.useContext(QueryClientContext)\n\n if (queryClient) {\n return queryClient\n }\n\n if (!client) {\n throw new Error('No QueryClient set, use QueryClientProvider to set one')\n }\n\n return client\n}\n\nexport type QueryClientProviderProps = {\n client: QueryClient\n children?: React.ReactNode\n}\n\nexport const QueryClientProvider = ({\n client,\n children,\n}: QueryClientProviderProps): React.JSX.Element => {\n React.useEffect(() => {\n client.mount()\n return () => {\n client.unmount()\n }\n }, [client])\n\n return (\n \n {children}\n \n )\n}\n"],"mappings":";;;AACA,YAAY,WAAW;AAuCnB;AAnCG,IAAM,qBAA2B;AAAA,EACtC;AACF;AAEO,IAAM,iBAAiB,CAAC,gBAA8B;AAC3D,QAAM,SAAe,iBAAW,kBAAkB;AAElD,MAAI,aAAa;AACf,WAAO;AAAA,EACT;AAEA,MAAI,CAAC,QAAQ;AACX,UAAM,IAAI,MAAM,wDAAwD;AAAA,EAC1E;AAEA,SAAO;AACT;AAOO,IAAM,sBAAsB,CAAC;AAAA,EAClC;AAAA,EACA;AACF,MAAmD;AACjD,EAAM,gBAAU,MAAM;AACpB,WAAO,MAAM;AACb,WAAO,MAAM;AACX,aAAO,QAAQ;AAAA,IACjB;AAAA,EACF,GAAG,CAAC,MAAM,CAAC;AAEX,SACE,oBAAC,mBAAmB,UAAnB,EAA4B,OAAO,QACjC,UACH;AAEJ;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/QueryErrorResetBoundary.cjs b/node_modules/@tanstack/react-query/build/legacy/QueryErrorResetBoundary.cjs new file mode 100644 index 0000000..7c86436 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/legacy/QueryErrorResetBoundary.cjs @@ -0,0 +1,67 @@ +"use strict"; +"use client"; +var __create = Object.create; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __getProtoOf = Object.getPrototypeOf; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( + // If the importer is in node compatibility mode or this is not an ESM + // file that has been converted to a CommonJS file using a Babel- + // compatible transform (i.e. "__esModule" has not been set), then set + // "default" to the CommonJS "module.exports" for node compatibility. + isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, + mod +)); +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/QueryErrorResetBoundary.tsx +var QueryErrorResetBoundary_exports = {}; +__export(QueryErrorResetBoundary_exports, { + QueryErrorResetBoundary: () => QueryErrorResetBoundary, + useQueryErrorResetBoundary: () => useQueryErrorResetBoundary +}); +module.exports = __toCommonJS(QueryErrorResetBoundary_exports); +var React = __toESM(require("react"), 1); +var import_jsx_runtime = require("react/jsx-runtime"); +function createValue() { + let isReset = false; + return { + clearReset: () => { + isReset = false; + }, + reset: () => { + isReset = true; + }, + isReset: () => { + return isReset; + } + }; +} +var QueryErrorResetBoundaryContext = React.createContext(createValue()); +var useQueryErrorResetBoundary = () => React.useContext(QueryErrorResetBoundaryContext); +var QueryErrorResetBoundary = ({ + children +}) => { + const [value] = React.useState(() => createValue()); + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(QueryErrorResetBoundaryContext.Provider, { value, children: typeof children === "function" ? children(value) : children }); +}; +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + QueryErrorResetBoundary, + useQueryErrorResetBoundary +}); +//# sourceMappingURL=QueryErrorResetBoundary.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/QueryErrorResetBoundary.cjs.map b/node_modules/@tanstack/react-query/build/legacy/QueryErrorResetBoundary.cjs.map new file mode 100644 index 0000000..29c7b08 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/legacy/QueryErrorResetBoundary.cjs.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/QueryErrorResetBoundary.tsx"],"sourcesContent":["'use client'\nimport * as React from 'react'\n\n// CONTEXT\nexport type QueryErrorResetFunction = () => void\nexport type QueryErrorIsResetFunction = () => boolean\nexport type QueryErrorClearResetFunction = () => void\n\nexport interface QueryErrorResetBoundaryValue {\n clearReset: QueryErrorClearResetFunction\n isReset: QueryErrorIsResetFunction\n reset: QueryErrorResetFunction\n}\n\nfunction createValue(): QueryErrorResetBoundaryValue {\n let isReset = false\n return {\n clearReset: () => {\n isReset = false\n },\n reset: () => {\n isReset = true\n },\n isReset: () => {\n return isReset\n },\n }\n}\n\nconst QueryErrorResetBoundaryContext = React.createContext(createValue())\n\n// HOOK\n\nexport const useQueryErrorResetBoundary = () =>\n React.useContext(QueryErrorResetBoundaryContext)\n\n// COMPONENT\n\nexport type QueryErrorResetBoundaryFunction = (\n value: QueryErrorResetBoundaryValue,\n) => React.ReactNode\n\nexport interface QueryErrorResetBoundaryProps {\n children: QueryErrorResetBoundaryFunction | React.ReactNode\n}\n\nexport const QueryErrorResetBoundary = ({\n children,\n}: QueryErrorResetBoundaryProps) => {\n const [value] = React.useState(() => createValue())\n return (\n \n {typeof children === 'function' ? children(value) : children}\n \n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,YAAuB;AAkDnB;AArCJ,SAAS,cAA4C;AACnD,MAAI,UAAU;AACd,SAAO;AAAA,IACL,YAAY,MAAM;AAChB,gBAAU;AAAA,IACZ;AAAA,IACA,OAAO,MAAM;AACX,gBAAU;AAAA,IACZ;AAAA,IACA,SAAS,MAAM;AACb,aAAO;AAAA,IACT;AAAA,EACF;AACF;AAEA,IAAM,iCAAuC,oBAAc,YAAY,CAAC;AAIjE,IAAM,6BAA6B,MAClC,iBAAW,8BAA8B;AAY1C,IAAM,0BAA0B,CAAC;AAAA,EACtC;AACF,MAAoC;AAClC,QAAM,CAAC,KAAK,IAAU,eAAS,MAAM,YAAY,CAAC;AAClD,SACE,4CAAC,+BAA+B,UAA/B,EAAwC,OACtC,iBAAO,aAAa,aAAa,SAAS,KAAK,IAAI,UACtD;AAEJ;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/QueryErrorResetBoundary.d.cts b/node_modules/@tanstack/react-query/build/legacy/QueryErrorResetBoundary.d.cts new file mode 100644 index 0000000..bfb5745 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/legacy/QueryErrorResetBoundary.d.cts @@ -0,0 +1,19 @@ +import * as react_jsx_runtime from 'react/jsx-runtime'; +import * as React from 'react'; + +type QueryErrorResetFunction = () => void; +type QueryErrorIsResetFunction = () => boolean; +type QueryErrorClearResetFunction = () => void; +interface QueryErrorResetBoundaryValue { + clearReset: QueryErrorClearResetFunction; + isReset: QueryErrorIsResetFunction; + reset: QueryErrorResetFunction; +} +declare const useQueryErrorResetBoundary: () => QueryErrorResetBoundaryValue; +type QueryErrorResetBoundaryFunction = (value: QueryErrorResetBoundaryValue) => React.ReactNode; +interface QueryErrorResetBoundaryProps { + children: QueryErrorResetBoundaryFunction | React.ReactNode; +} +declare const QueryErrorResetBoundary: ({ children, }: QueryErrorResetBoundaryProps) => react_jsx_runtime.JSX.Element; + +export { type QueryErrorClearResetFunction, type QueryErrorIsResetFunction, QueryErrorResetBoundary, type QueryErrorResetBoundaryFunction, type QueryErrorResetBoundaryProps, type QueryErrorResetBoundaryValue, type QueryErrorResetFunction, useQueryErrorResetBoundary }; diff --git a/node_modules/@tanstack/react-query/build/legacy/QueryErrorResetBoundary.d.ts b/node_modules/@tanstack/react-query/build/legacy/QueryErrorResetBoundary.d.ts new file mode 100644 index 0000000..bfb5745 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/legacy/QueryErrorResetBoundary.d.ts @@ -0,0 +1,19 @@ +import * as react_jsx_runtime from 'react/jsx-runtime'; +import * as React from 'react'; + +type QueryErrorResetFunction = () => void; +type QueryErrorIsResetFunction = () => boolean; +type QueryErrorClearResetFunction = () => void; +interface QueryErrorResetBoundaryValue { + clearReset: QueryErrorClearResetFunction; + isReset: QueryErrorIsResetFunction; + reset: QueryErrorResetFunction; +} +declare const useQueryErrorResetBoundary: () => QueryErrorResetBoundaryValue; +type QueryErrorResetBoundaryFunction = (value: QueryErrorResetBoundaryValue) => React.ReactNode; +interface QueryErrorResetBoundaryProps { + children: QueryErrorResetBoundaryFunction | React.ReactNode; +} +declare const QueryErrorResetBoundary: ({ children, }: QueryErrorResetBoundaryProps) => react_jsx_runtime.JSX.Element; + +export { type QueryErrorClearResetFunction, type QueryErrorIsResetFunction, QueryErrorResetBoundary, type QueryErrorResetBoundaryFunction, type QueryErrorResetBoundaryProps, type QueryErrorResetBoundaryValue, type QueryErrorResetFunction, useQueryErrorResetBoundary }; diff --git a/node_modules/@tanstack/react-query/build/legacy/QueryErrorResetBoundary.js b/node_modules/@tanstack/react-query/build/legacy/QueryErrorResetBoundary.js new file mode 100644 index 0000000..ae56edc --- /dev/null +++ b/node_modules/@tanstack/react-query/build/legacy/QueryErrorResetBoundary.js @@ -0,0 +1,32 @@ +"use client"; + +// src/QueryErrorResetBoundary.tsx +import * as React from "react"; +import { jsx } from "react/jsx-runtime"; +function createValue() { + let isReset = false; + return { + clearReset: () => { + isReset = false; + }, + reset: () => { + isReset = true; + }, + isReset: () => { + return isReset; + } + }; +} +var QueryErrorResetBoundaryContext = React.createContext(createValue()); +var useQueryErrorResetBoundary = () => React.useContext(QueryErrorResetBoundaryContext); +var QueryErrorResetBoundary = ({ + children +}) => { + const [value] = React.useState(() => createValue()); + return /* @__PURE__ */ jsx(QueryErrorResetBoundaryContext.Provider, { value, children: typeof children === "function" ? children(value) : children }); +}; +export { + QueryErrorResetBoundary, + useQueryErrorResetBoundary +}; +//# sourceMappingURL=QueryErrorResetBoundary.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/QueryErrorResetBoundary.js.map b/node_modules/@tanstack/react-query/build/legacy/QueryErrorResetBoundary.js.map new file mode 100644 index 0000000..c8b04a7 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/legacy/QueryErrorResetBoundary.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/QueryErrorResetBoundary.tsx"],"sourcesContent":["'use client'\nimport * as React from 'react'\n\n// CONTEXT\nexport type QueryErrorResetFunction = () => void\nexport type QueryErrorIsResetFunction = () => boolean\nexport type QueryErrorClearResetFunction = () => void\n\nexport interface QueryErrorResetBoundaryValue {\n clearReset: QueryErrorClearResetFunction\n isReset: QueryErrorIsResetFunction\n reset: QueryErrorResetFunction\n}\n\nfunction createValue(): QueryErrorResetBoundaryValue {\n let isReset = false\n return {\n clearReset: () => {\n isReset = false\n },\n reset: () => {\n isReset = true\n },\n isReset: () => {\n return isReset\n },\n }\n}\n\nconst QueryErrorResetBoundaryContext = React.createContext(createValue())\n\n// HOOK\n\nexport const useQueryErrorResetBoundary = () =>\n React.useContext(QueryErrorResetBoundaryContext)\n\n// COMPONENT\n\nexport type QueryErrorResetBoundaryFunction = (\n value: QueryErrorResetBoundaryValue,\n) => React.ReactNode\n\nexport interface QueryErrorResetBoundaryProps {\n children: QueryErrorResetBoundaryFunction | React.ReactNode\n}\n\nexport const QueryErrorResetBoundary = ({\n children,\n}: QueryErrorResetBoundaryProps) => {\n const [value] = React.useState(() => createValue())\n return (\n \n {typeof children === 'function' ? children(value) : children}\n \n )\n}\n"],"mappings":";;;AACA,YAAY,WAAW;AAkDnB;AArCJ,SAAS,cAA4C;AACnD,MAAI,UAAU;AACd,SAAO;AAAA,IACL,YAAY,MAAM;AAChB,gBAAU;AAAA,IACZ;AAAA,IACA,OAAO,MAAM;AACX,gBAAU;AAAA,IACZ;AAAA,IACA,SAAS,MAAM;AACb,aAAO;AAAA,IACT;AAAA,EACF;AACF;AAEA,IAAM,iCAAuC,oBAAc,YAAY,CAAC;AAIjE,IAAM,6BAA6B,MAClC,iBAAW,8BAA8B;AAY1C,IAAM,0BAA0B,CAAC;AAAA,EACtC;AACF,MAAoC;AAClC,QAAM,CAAC,KAAK,IAAU,eAAS,MAAM,YAAY,CAAC;AAClD,SACE,oBAAC,+BAA+B,UAA/B,EAAwC,OACtC,iBAAO,aAAa,aAAa,SAAS,KAAK,IAAI,UACtD;AAEJ;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/errorBoundaryUtils.cjs b/node_modules/@tanstack/react-query/build/legacy/errorBoundaryUtils.cjs new file mode 100644 index 0000000..ea4cb4f --- /dev/null +++ b/node_modules/@tanstack/react-query/build/legacy/errorBoundaryUtils.cjs @@ -0,0 +1,69 @@ +"use strict"; +"use client"; +var __create = Object.create; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __getProtoOf = Object.getPrototypeOf; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( + // If the importer is in node compatibility mode or this is not an ESM + // file that has been converted to a CommonJS file using a Babel- + // compatible transform (i.e. "__esModule" has not been set), then set + // "default" to the CommonJS "module.exports" for node compatibility. + isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, + mod +)); +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/errorBoundaryUtils.ts +var errorBoundaryUtils_exports = {}; +__export(errorBoundaryUtils_exports, { + ensurePreventErrorBoundaryRetry: () => ensurePreventErrorBoundaryRetry, + getHasError: () => getHasError, + useClearResetErrorBoundary: () => useClearResetErrorBoundary +}); +module.exports = __toCommonJS(errorBoundaryUtils_exports); +var React = __toESM(require("react"), 1); +var import_query_core = require("@tanstack/query-core"); +var ensurePreventErrorBoundaryRetry = (options, errorResetBoundary, query) => { + const throwOnError = (query == null ? void 0 : query.state.error) && typeof options.throwOnError === "function" ? (0, import_query_core.shouldThrowError)(options.throwOnError, [query.state.error, query]) : options.throwOnError; + if (options.suspense || options.experimental_prefetchInRender || throwOnError) { + if (!errorResetBoundary.isReset()) { + options.retryOnMount = false; + } + } +}; +var useClearResetErrorBoundary = (errorResetBoundary) => { + React.useEffect(() => { + errorResetBoundary.clearReset(); + }, [errorResetBoundary]); +}; +var getHasError = ({ + result, + errorResetBoundary, + throwOnError, + query, + suspense +}) => { + return result.isError && !errorResetBoundary.isReset() && !result.isFetching && query && (suspense && result.data === void 0 || (0, import_query_core.shouldThrowError)(throwOnError, [result.error, query])); +}; +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + ensurePreventErrorBoundaryRetry, + getHasError, + useClearResetErrorBoundary +}); +//# sourceMappingURL=errorBoundaryUtils.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/errorBoundaryUtils.cjs.map b/node_modules/@tanstack/react-query/build/legacy/errorBoundaryUtils.cjs.map new file mode 100644 index 0000000..99e4380 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/legacy/errorBoundaryUtils.cjs.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/errorBoundaryUtils.ts"],"sourcesContent":["'use client'\nimport * as React from 'react'\nimport { shouldThrowError } from '@tanstack/query-core'\nimport type {\n DefaultedQueryObserverOptions,\n Query,\n QueryKey,\n QueryObserverResult,\n ThrowOnError,\n} from '@tanstack/query-core'\nimport type { QueryErrorResetBoundaryValue } from './QueryErrorResetBoundary'\n\nexport const ensurePreventErrorBoundaryRetry = <\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey extends QueryKey,\n>(\n options: DefaultedQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >,\n errorResetBoundary: QueryErrorResetBoundaryValue,\n query: Query | undefined,\n) => {\n const throwOnError =\n query?.state.error && typeof options.throwOnError === 'function'\n ? shouldThrowError(options.throwOnError, [query.state.error, query])\n : options.throwOnError\n\n if (\n options.suspense ||\n options.experimental_prefetchInRender ||\n throwOnError\n ) {\n // Prevent retrying failed query if the error boundary has not been reset yet\n if (!errorResetBoundary.isReset()) {\n options.retryOnMount = false\n }\n }\n}\n\nexport const useClearResetErrorBoundary = (\n errorResetBoundary: QueryErrorResetBoundaryValue,\n) => {\n React.useEffect(() => {\n errorResetBoundary.clearReset()\n }, [errorResetBoundary])\n}\n\nexport const getHasError = <\n TData,\n TError,\n TQueryFnData,\n TQueryData,\n TQueryKey extends QueryKey,\n>({\n result,\n errorResetBoundary,\n throwOnError,\n query,\n suspense,\n}: {\n result: QueryObserverResult\n errorResetBoundary: QueryErrorResetBoundaryValue\n throwOnError: ThrowOnError\n query: Query | undefined\n suspense: boolean | undefined\n}) => {\n return (\n result.isError &&\n !errorResetBoundary.isReset() &&\n !result.isFetching &&\n query &&\n ((suspense && result.data === undefined) ||\n shouldThrowError(throwOnError, [result.error, query]))\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,YAAuB;AACvB,wBAAiC;AAU1B,IAAM,kCAAkC,CAO7C,SAOA,oBACA,UACG;AACH,QAAM,gBACJ,+BAAO,MAAM,UAAS,OAAO,QAAQ,iBAAiB,iBAClD,oCAAiB,QAAQ,cAAc,CAAC,MAAM,MAAM,OAAO,KAAK,CAAC,IACjE,QAAQ;AAEd,MACE,QAAQ,YACR,QAAQ,iCACR,cACA;AAEA,QAAI,CAAC,mBAAmB,QAAQ,GAAG;AACjC,cAAQ,eAAe;AAAA,IACzB;AAAA,EACF;AACF;AAEO,IAAM,6BAA6B,CACxC,uBACG;AACH,EAAM,gBAAU,MAAM;AACpB,uBAAmB,WAAW;AAAA,EAChC,GAAG,CAAC,kBAAkB,CAAC;AACzB;AAEO,IAAM,cAAc,CAMzB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MAMM;AACJ,SACE,OAAO,WACP,CAAC,mBAAmB,QAAQ,KAC5B,CAAC,OAAO,cACR,UACE,YAAY,OAAO,SAAS,cAC5B,oCAAiB,cAAc,CAAC,OAAO,OAAO,KAAK,CAAC;AAE1D;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/errorBoundaryUtils.d.cts b/node_modules/@tanstack/react-query/build/legacy/errorBoundaryUtils.d.cts new file mode 100644 index 0000000..1a46fd1 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/legacy/errorBoundaryUtils.d.cts @@ -0,0 +1,16 @@ +import { QueryKey, DefaultedQueryObserverOptions, Query, QueryObserverResult, ThrowOnError } from '@tanstack/query-core'; +import { QueryErrorResetBoundaryValue } from './QueryErrorResetBoundary.cjs'; +import 'react/jsx-runtime'; +import 'react'; + +declare const ensurePreventErrorBoundaryRetry: (options: DefaultedQueryObserverOptions, errorResetBoundary: QueryErrorResetBoundaryValue, query: Query | undefined) => void; +declare const useClearResetErrorBoundary: (errorResetBoundary: QueryErrorResetBoundaryValue) => void; +declare const getHasError: ({ result, errorResetBoundary, throwOnError, query, suspense, }: { + result: QueryObserverResult; + errorResetBoundary: QueryErrorResetBoundaryValue; + throwOnError: ThrowOnError; + query: Query | undefined; + suspense: boolean | undefined; +}) => boolean | undefined; + +export { ensurePreventErrorBoundaryRetry, getHasError, useClearResetErrorBoundary }; diff --git a/node_modules/@tanstack/react-query/build/legacy/errorBoundaryUtils.d.ts b/node_modules/@tanstack/react-query/build/legacy/errorBoundaryUtils.d.ts new file mode 100644 index 0000000..3b9fc8b --- /dev/null +++ b/node_modules/@tanstack/react-query/build/legacy/errorBoundaryUtils.d.ts @@ -0,0 +1,16 @@ +import { QueryKey, DefaultedQueryObserverOptions, Query, QueryObserverResult, ThrowOnError } from '@tanstack/query-core'; +import { QueryErrorResetBoundaryValue } from './QueryErrorResetBoundary.js'; +import 'react/jsx-runtime'; +import 'react'; + +declare const ensurePreventErrorBoundaryRetry: (options: DefaultedQueryObserverOptions, errorResetBoundary: QueryErrorResetBoundaryValue, query: Query | undefined) => void; +declare const useClearResetErrorBoundary: (errorResetBoundary: QueryErrorResetBoundaryValue) => void; +declare const getHasError: ({ result, errorResetBoundary, throwOnError, query, suspense, }: { + result: QueryObserverResult; + errorResetBoundary: QueryErrorResetBoundaryValue; + throwOnError: ThrowOnError; + query: Query | undefined; + suspense: boolean | undefined; +}) => boolean | undefined; + +export { ensurePreventErrorBoundaryRetry, getHasError, useClearResetErrorBoundary }; diff --git a/node_modules/@tanstack/react-query/build/legacy/errorBoundaryUtils.js b/node_modules/@tanstack/react-query/build/legacy/errorBoundaryUtils.js new file mode 100644 index 0000000..6031250 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/legacy/errorBoundaryUtils.js @@ -0,0 +1,33 @@ +"use client"; + +// src/errorBoundaryUtils.ts +import * as React from "react"; +import { shouldThrowError } from "@tanstack/query-core"; +var ensurePreventErrorBoundaryRetry = (options, errorResetBoundary, query) => { + const throwOnError = (query == null ? void 0 : query.state.error) && typeof options.throwOnError === "function" ? shouldThrowError(options.throwOnError, [query.state.error, query]) : options.throwOnError; + if (options.suspense || options.experimental_prefetchInRender || throwOnError) { + if (!errorResetBoundary.isReset()) { + options.retryOnMount = false; + } + } +}; +var useClearResetErrorBoundary = (errorResetBoundary) => { + React.useEffect(() => { + errorResetBoundary.clearReset(); + }, [errorResetBoundary]); +}; +var getHasError = ({ + result, + errorResetBoundary, + throwOnError, + query, + suspense +}) => { + return result.isError && !errorResetBoundary.isReset() && !result.isFetching && query && (suspense && result.data === void 0 || shouldThrowError(throwOnError, [result.error, query])); +}; +export { + ensurePreventErrorBoundaryRetry, + getHasError, + useClearResetErrorBoundary +}; +//# sourceMappingURL=errorBoundaryUtils.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/errorBoundaryUtils.js.map b/node_modules/@tanstack/react-query/build/legacy/errorBoundaryUtils.js.map new file mode 100644 index 0000000..cb9f9fb --- /dev/null +++ b/node_modules/@tanstack/react-query/build/legacy/errorBoundaryUtils.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/errorBoundaryUtils.ts"],"sourcesContent":["'use client'\nimport * as React from 'react'\nimport { shouldThrowError } from '@tanstack/query-core'\nimport type {\n DefaultedQueryObserverOptions,\n Query,\n QueryKey,\n QueryObserverResult,\n ThrowOnError,\n} from '@tanstack/query-core'\nimport type { QueryErrorResetBoundaryValue } from './QueryErrorResetBoundary'\n\nexport const ensurePreventErrorBoundaryRetry = <\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey extends QueryKey,\n>(\n options: DefaultedQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >,\n errorResetBoundary: QueryErrorResetBoundaryValue,\n query: Query | undefined,\n) => {\n const throwOnError =\n query?.state.error && typeof options.throwOnError === 'function'\n ? shouldThrowError(options.throwOnError, [query.state.error, query])\n : options.throwOnError\n\n if (\n options.suspense ||\n options.experimental_prefetchInRender ||\n throwOnError\n ) {\n // Prevent retrying failed query if the error boundary has not been reset yet\n if (!errorResetBoundary.isReset()) {\n options.retryOnMount = false\n }\n }\n}\n\nexport const useClearResetErrorBoundary = (\n errorResetBoundary: QueryErrorResetBoundaryValue,\n) => {\n React.useEffect(() => {\n errorResetBoundary.clearReset()\n }, [errorResetBoundary])\n}\n\nexport const getHasError = <\n TData,\n TError,\n TQueryFnData,\n TQueryData,\n TQueryKey extends QueryKey,\n>({\n result,\n errorResetBoundary,\n throwOnError,\n query,\n suspense,\n}: {\n result: QueryObserverResult\n errorResetBoundary: QueryErrorResetBoundaryValue\n throwOnError: ThrowOnError\n query: Query | undefined\n suspense: boolean | undefined\n}) => {\n return (\n result.isError &&\n !errorResetBoundary.isReset() &&\n !result.isFetching &&\n query &&\n ((suspense && result.data === undefined) ||\n shouldThrowError(throwOnError, [result.error, query]))\n )\n}\n"],"mappings":";;;AACA,YAAY,WAAW;AACvB,SAAS,wBAAwB;AAU1B,IAAM,kCAAkC,CAO7C,SAOA,oBACA,UACG;AACH,QAAM,gBACJ,+BAAO,MAAM,UAAS,OAAO,QAAQ,iBAAiB,aAClD,iBAAiB,QAAQ,cAAc,CAAC,MAAM,MAAM,OAAO,KAAK,CAAC,IACjE,QAAQ;AAEd,MACE,QAAQ,YACR,QAAQ,iCACR,cACA;AAEA,QAAI,CAAC,mBAAmB,QAAQ,GAAG;AACjC,cAAQ,eAAe;AAAA,IACzB;AAAA,EACF;AACF;AAEO,IAAM,6BAA6B,CACxC,uBACG;AACH,EAAM,gBAAU,MAAM;AACpB,uBAAmB,WAAW;AAAA,EAChC,GAAG,CAAC,kBAAkB,CAAC;AACzB;AAEO,IAAM,cAAc,CAMzB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MAMM;AACJ,SACE,OAAO,WACP,CAAC,mBAAmB,QAAQ,KAC5B,CAAC,OAAO,cACR,UACE,YAAY,OAAO,SAAS,UAC5B,iBAAiB,cAAc,CAAC,OAAO,OAAO,KAAK,CAAC;AAE1D;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/index.cjs b/node_modules/@tanstack/react-query/build/legacy/index.cjs new file mode 100644 index 0000000..0d7d36f --- /dev/null +++ b/node_modules/@tanstack/react-query/build/legacy/index.cjs @@ -0,0 +1,97 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default")); +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/index.ts +var index_exports = {}; +__export(index_exports, { + HydrationBoundary: () => import_HydrationBoundary.HydrationBoundary, + IsRestoringProvider: () => import_IsRestoringProvider.IsRestoringProvider, + QueryClientContext: () => import_QueryClientProvider.QueryClientContext, + QueryClientProvider: () => import_QueryClientProvider.QueryClientProvider, + QueryErrorResetBoundary: () => import_QueryErrorResetBoundary.QueryErrorResetBoundary, + infiniteQueryOptions: () => import_infiniteQueryOptions.infiniteQueryOptions, + mutationOptions: () => import_mutationOptions.mutationOptions, + queryOptions: () => import_queryOptions.queryOptions, + useInfiniteQuery: () => import_useInfiniteQuery.useInfiniteQuery, + useIsFetching: () => import_useIsFetching.useIsFetching, + useIsMutating: () => import_useMutationState.useIsMutating, + useIsRestoring: () => import_IsRestoringProvider.useIsRestoring, + useMutation: () => import_useMutation.useMutation, + useMutationState: () => import_useMutationState.useMutationState, + usePrefetchInfiniteQuery: () => import_usePrefetchInfiniteQuery.usePrefetchInfiniteQuery, + usePrefetchQuery: () => import_usePrefetchQuery.usePrefetchQuery, + useQueries: () => import_useQueries.useQueries, + useQuery: () => import_useQuery.useQuery, + useQueryClient: () => import_QueryClientProvider.useQueryClient, + useQueryErrorResetBoundary: () => import_QueryErrorResetBoundary.useQueryErrorResetBoundary, + useSuspenseInfiniteQuery: () => import_useSuspenseInfiniteQuery.useSuspenseInfiniteQuery, + useSuspenseQueries: () => import_useSuspenseQueries.useSuspenseQueries, + useSuspenseQuery: () => import_useSuspenseQuery.useSuspenseQuery +}); +module.exports = __toCommonJS(index_exports); +__reExport(index_exports, require("@tanstack/query-core"), module.exports); +__reExport(index_exports, require("./types.cjs"), module.exports); +var import_useQueries = require("./useQueries.cjs"); +var import_useQuery = require("./useQuery.cjs"); +var import_useSuspenseQuery = require("./useSuspenseQuery.cjs"); +var import_useSuspenseInfiniteQuery = require("./useSuspenseInfiniteQuery.cjs"); +var import_useSuspenseQueries = require("./useSuspenseQueries.cjs"); +var import_usePrefetchQuery = require("./usePrefetchQuery.cjs"); +var import_usePrefetchInfiniteQuery = require("./usePrefetchInfiniteQuery.cjs"); +var import_queryOptions = require("./queryOptions.cjs"); +var import_infiniteQueryOptions = require("./infiniteQueryOptions.cjs"); +var import_QueryClientProvider = require("./QueryClientProvider.cjs"); +var import_HydrationBoundary = require("./HydrationBoundary.cjs"); +var import_QueryErrorResetBoundary = require("./QueryErrorResetBoundary.cjs"); +var import_useIsFetching = require("./useIsFetching.cjs"); +var import_useMutationState = require("./useMutationState.cjs"); +var import_useMutation = require("./useMutation.cjs"); +var import_mutationOptions = require("./mutationOptions.cjs"); +var import_useInfiniteQuery = require("./useInfiniteQuery.cjs"); +var import_IsRestoringProvider = require("./IsRestoringProvider.cjs"); +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + HydrationBoundary, + IsRestoringProvider, + QueryClientContext, + QueryClientProvider, + QueryErrorResetBoundary, + infiniteQueryOptions, + mutationOptions, + queryOptions, + useInfiniteQuery, + useIsFetching, + useIsMutating, + useIsRestoring, + useMutation, + useMutationState, + usePrefetchInfiniteQuery, + usePrefetchQuery, + useQueries, + useQuery, + useQueryClient, + useQueryErrorResetBoundary, + useSuspenseInfiniteQuery, + useSuspenseQueries, + useSuspenseQuery, + ...require("@tanstack/query-core"), + ...require("./types.cjs") +}); +//# sourceMappingURL=index.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/index.cjs.map b/node_modules/@tanstack/react-query/build/legacy/index.cjs.map new file mode 100644 index 0000000..3e25ed1 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/legacy/index.cjs.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/index.ts"],"sourcesContent":["/* istanbul ignore file */\n\n// Re-export core\nexport * from '@tanstack/query-core'\n\n// React Query\nexport * from './types'\nexport { useQueries } from './useQueries'\nexport type { QueriesResults, QueriesOptions } from './useQueries'\nexport { useQuery } from './useQuery'\nexport { useSuspenseQuery } from './useSuspenseQuery'\nexport { useSuspenseInfiniteQuery } from './useSuspenseInfiniteQuery'\nexport { useSuspenseQueries } from './useSuspenseQueries'\nexport type {\n SuspenseQueriesResults,\n SuspenseQueriesOptions,\n} from './useSuspenseQueries'\nexport { usePrefetchQuery } from './usePrefetchQuery'\nexport { usePrefetchInfiniteQuery } from './usePrefetchInfiniteQuery'\nexport { queryOptions } from './queryOptions'\nexport type {\n DefinedInitialDataOptions,\n UndefinedInitialDataOptions,\n UnusedSkipTokenOptions,\n} from './queryOptions'\nexport { infiniteQueryOptions } from './infiniteQueryOptions'\nexport type {\n DefinedInitialDataInfiniteOptions,\n UndefinedInitialDataInfiniteOptions,\n UnusedSkipTokenInfiniteOptions,\n} from './infiniteQueryOptions'\nexport {\n QueryClientContext,\n QueryClientProvider,\n useQueryClient,\n} from './QueryClientProvider'\nexport type { QueryClientProviderProps } from './QueryClientProvider'\nexport type { QueryErrorResetBoundaryProps } from './QueryErrorResetBoundary'\nexport { HydrationBoundary } from './HydrationBoundary'\nexport type { HydrationBoundaryProps } from './HydrationBoundary'\nexport type {\n QueryErrorClearResetFunction,\n QueryErrorIsResetFunction,\n QueryErrorResetBoundaryFunction,\n QueryErrorResetFunction,\n} from './QueryErrorResetBoundary'\nexport {\n QueryErrorResetBoundary,\n useQueryErrorResetBoundary,\n} from './QueryErrorResetBoundary'\nexport { useIsFetching } from './useIsFetching'\nexport { useIsMutating, useMutationState } from './useMutationState'\nexport { useMutation } from './useMutation'\nexport { mutationOptions } from './mutationOptions'\nexport { useInfiniteQuery } from './useInfiniteQuery'\nexport { useIsRestoring, IsRestoringProvider } from './IsRestoringProvider'\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,0BAAc,iCAHd;AAMA,0BAAc,wBANd;AAOA,wBAA2B;AAE3B,sBAAyB;AACzB,8BAAiC;AACjC,sCAAyC;AACzC,gCAAmC;AAKnC,8BAAiC;AACjC,sCAAyC;AACzC,0BAA6B;AAM7B,kCAAqC;AAMrC,iCAIO;AAGP,+BAAkC;AAQlC,qCAGO;AACP,2BAA8B;AAC9B,8BAAgD;AAChD,yBAA4B;AAC5B,6BAAgC;AAChC,8BAAiC;AACjC,iCAAoD;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/index.d.cts b/node_modules/@tanstack/react-query/build/legacy/index.d.cts new file mode 100644 index 0000000..4924b4f --- /dev/null +++ b/node_modules/@tanstack/react-query/build/legacy/index.d.cts @@ -0,0 +1,22 @@ +export * from '@tanstack/query-core'; +export { AnyUseBaseQueryOptions, AnyUseInfiniteQueryOptions, AnyUseMutationOptions, AnyUseQueryOptions, AnyUseSuspenseInfiniteQueryOptions, AnyUseSuspenseQueryOptions, DefinedUseInfiniteQueryResult, DefinedUseQueryResult, UseBaseMutationResult, UseBaseQueryOptions, UseBaseQueryResult, UseInfiniteQueryOptions, UseInfiniteQueryResult, UseMutateAsyncFunction, UseMutateFunction, UseMutationOptions, UseMutationResult, UsePrefetchQueryOptions, UseQueryOptions, UseQueryResult, UseSuspenseInfiniteQueryOptions, UseSuspenseInfiniteQueryResult, UseSuspenseQueryOptions, UseSuspenseQueryResult } from './types.cjs'; +export { QueriesOptions, QueriesResults, useQueries } from './useQueries.cjs'; +export { useQuery } from './useQuery.cjs'; +export { useSuspenseQuery } from './useSuspenseQuery.cjs'; +export { useSuspenseInfiniteQuery } from './useSuspenseInfiniteQuery.cjs'; +export { SuspenseQueriesOptions, SuspenseQueriesResults, useSuspenseQueries } from './useSuspenseQueries.cjs'; +export { usePrefetchQuery } from './usePrefetchQuery.cjs'; +export { usePrefetchInfiniteQuery } from './usePrefetchInfiniteQuery.cjs'; +export { DefinedInitialDataOptions, UndefinedInitialDataOptions, UnusedSkipTokenOptions, queryOptions } from './queryOptions.cjs'; +export { DefinedInitialDataInfiniteOptions, UndefinedInitialDataInfiniteOptions, UnusedSkipTokenInfiniteOptions, infiniteQueryOptions } from './infiniteQueryOptions.cjs'; +export { QueryClientContext, QueryClientProvider, QueryClientProviderProps, useQueryClient } from './QueryClientProvider.cjs'; +export { QueryErrorClearResetFunction, QueryErrorIsResetFunction, QueryErrorResetBoundary, QueryErrorResetBoundaryFunction, QueryErrorResetBoundaryProps, QueryErrorResetFunction, useQueryErrorResetBoundary } from './QueryErrorResetBoundary.cjs'; +export { HydrationBoundary, HydrationBoundaryProps } from './HydrationBoundary.cjs'; +export { useIsFetching } from './useIsFetching.cjs'; +export { useIsMutating, useMutationState } from './useMutationState.cjs'; +export { useMutation } from './useMutation.cjs'; +export { mutationOptions } from './mutationOptions.cjs'; +export { useInfiniteQuery } from './useInfiniteQuery.cjs'; +export { IsRestoringProvider, useIsRestoring } from './IsRestoringProvider.cjs'; +import 'react'; +import 'react/jsx-runtime'; diff --git a/node_modules/@tanstack/react-query/build/legacy/index.d.ts b/node_modules/@tanstack/react-query/build/legacy/index.d.ts new file mode 100644 index 0000000..45dab83 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/legacy/index.d.ts @@ -0,0 +1,22 @@ +export * from '@tanstack/query-core'; +export { AnyUseBaseQueryOptions, AnyUseInfiniteQueryOptions, AnyUseMutationOptions, AnyUseQueryOptions, AnyUseSuspenseInfiniteQueryOptions, AnyUseSuspenseQueryOptions, DefinedUseInfiniteQueryResult, DefinedUseQueryResult, UseBaseMutationResult, UseBaseQueryOptions, UseBaseQueryResult, UseInfiniteQueryOptions, UseInfiniteQueryResult, UseMutateAsyncFunction, UseMutateFunction, UseMutationOptions, UseMutationResult, UsePrefetchQueryOptions, UseQueryOptions, UseQueryResult, UseSuspenseInfiniteQueryOptions, UseSuspenseInfiniteQueryResult, UseSuspenseQueryOptions, UseSuspenseQueryResult } from './types.js'; +export { QueriesOptions, QueriesResults, useQueries } from './useQueries.js'; +export { useQuery } from './useQuery.js'; +export { useSuspenseQuery } from './useSuspenseQuery.js'; +export { useSuspenseInfiniteQuery } from './useSuspenseInfiniteQuery.js'; +export { SuspenseQueriesOptions, SuspenseQueriesResults, useSuspenseQueries } from './useSuspenseQueries.js'; +export { usePrefetchQuery } from './usePrefetchQuery.js'; +export { usePrefetchInfiniteQuery } from './usePrefetchInfiniteQuery.js'; +export { DefinedInitialDataOptions, UndefinedInitialDataOptions, UnusedSkipTokenOptions, queryOptions } from './queryOptions.js'; +export { DefinedInitialDataInfiniteOptions, UndefinedInitialDataInfiniteOptions, UnusedSkipTokenInfiniteOptions, infiniteQueryOptions } from './infiniteQueryOptions.js'; +export { QueryClientContext, QueryClientProvider, QueryClientProviderProps, useQueryClient } from './QueryClientProvider.js'; +export { QueryErrorClearResetFunction, QueryErrorIsResetFunction, QueryErrorResetBoundary, QueryErrorResetBoundaryFunction, QueryErrorResetBoundaryProps, QueryErrorResetFunction, useQueryErrorResetBoundary } from './QueryErrorResetBoundary.js'; +export { HydrationBoundary, HydrationBoundaryProps } from './HydrationBoundary.js'; +export { useIsFetching } from './useIsFetching.js'; +export { useIsMutating, useMutationState } from './useMutationState.js'; +export { useMutation } from './useMutation.js'; +export { mutationOptions } from './mutationOptions.js'; +export { useInfiniteQuery } from './useInfiniteQuery.js'; +export { IsRestoringProvider, useIsRestoring } from './IsRestoringProvider.js'; +import 'react'; +import 'react/jsx-runtime'; diff --git a/node_modules/@tanstack/react-query/build/legacy/index.js b/node_modules/@tanstack/react-query/build/legacy/index.js new file mode 100644 index 0000000..66ddb26 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/legacy/index.js @@ -0,0 +1,54 @@ +// src/index.ts +export * from "@tanstack/query-core"; +export * from "./types.js"; +import { useQueries } from "./useQueries.js"; +import { useQuery } from "./useQuery.js"; +import { useSuspenseQuery } from "./useSuspenseQuery.js"; +import { useSuspenseInfiniteQuery } from "./useSuspenseInfiniteQuery.js"; +import { useSuspenseQueries } from "./useSuspenseQueries.js"; +import { usePrefetchQuery } from "./usePrefetchQuery.js"; +import { usePrefetchInfiniteQuery } from "./usePrefetchInfiniteQuery.js"; +import { queryOptions } from "./queryOptions.js"; +import { infiniteQueryOptions } from "./infiniteQueryOptions.js"; +import { + QueryClientContext, + QueryClientProvider, + useQueryClient +} from "./QueryClientProvider.js"; +import { HydrationBoundary } from "./HydrationBoundary.js"; +import { + QueryErrorResetBoundary, + useQueryErrorResetBoundary +} from "./QueryErrorResetBoundary.js"; +import { useIsFetching } from "./useIsFetching.js"; +import { useIsMutating, useMutationState } from "./useMutationState.js"; +import { useMutation } from "./useMutation.js"; +import { mutationOptions } from "./mutationOptions.js"; +import { useInfiniteQuery } from "./useInfiniteQuery.js"; +import { useIsRestoring, IsRestoringProvider } from "./IsRestoringProvider.js"; +export { + HydrationBoundary, + IsRestoringProvider, + QueryClientContext, + QueryClientProvider, + QueryErrorResetBoundary, + infiniteQueryOptions, + mutationOptions, + queryOptions, + useInfiniteQuery, + useIsFetching, + useIsMutating, + useIsRestoring, + useMutation, + useMutationState, + usePrefetchInfiniteQuery, + usePrefetchQuery, + useQueries, + useQuery, + useQueryClient, + useQueryErrorResetBoundary, + useSuspenseInfiniteQuery, + useSuspenseQueries, + useSuspenseQuery +}; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/index.js.map b/node_modules/@tanstack/react-query/build/legacy/index.js.map new file mode 100644 index 0000000..e3df051 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/legacy/index.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/index.ts"],"sourcesContent":["/* istanbul ignore file */\n\n// Re-export core\nexport * from '@tanstack/query-core'\n\n// React Query\nexport * from './types'\nexport { useQueries } from './useQueries'\nexport type { QueriesResults, QueriesOptions } from './useQueries'\nexport { useQuery } from './useQuery'\nexport { useSuspenseQuery } from './useSuspenseQuery'\nexport { useSuspenseInfiniteQuery } from './useSuspenseInfiniteQuery'\nexport { useSuspenseQueries } from './useSuspenseQueries'\nexport type {\n SuspenseQueriesResults,\n SuspenseQueriesOptions,\n} from './useSuspenseQueries'\nexport { usePrefetchQuery } from './usePrefetchQuery'\nexport { usePrefetchInfiniteQuery } from './usePrefetchInfiniteQuery'\nexport { queryOptions } from './queryOptions'\nexport type {\n DefinedInitialDataOptions,\n UndefinedInitialDataOptions,\n UnusedSkipTokenOptions,\n} from './queryOptions'\nexport { infiniteQueryOptions } from './infiniteQueryOptions'\nexport type {\n DefinedInitialDataInfiniteOptions,\n UndefinedInitialDataInfiniteOptions,\n UnusedSkipTokenInfiniteOptions,\n} from './infiniteQueryOptions'\nexport {\n QueryClientContext,\n QueryClientProvider,\n useQueryClient,\n} from './QueryClientProvider'\nexport type { QueryClientProviderProps } from './QueryClientProvider'\nexport type { QueryErrorResetBoundaryProps } from './QueryErrorResetBoundary'\nexport { HydrationBoundary } from './HydrationBoundary'\nexport type { HydrationBoundaryProps } from './HydrationBoundary'\nexport type {\n QueryErrorClearResetFunction,\n QueryErrorIsResetFunction,\n QueryErrorResetBoundaryFunction,\n QueryErrorResetFunction,\n} from './QueryErrorResetBoundary'\nexport {\n QueryErrorResetBoundary,\n useQueryErrorResetBoundary,\n} from './QueryErrorResetBoundary'\nexport { useIsFetching } from './useIsFetching'\nexport { useIsMutating, useMutationState } from './useMutationState'\nexport { useMutation } from './useMutation'\nexport { mutationOptions } from './mutationOptions'\nexport { useInfiniteQuery } from './useInfiniteQuery'\nexport { useIsRestoring, IsRestoringProvider } from './IsRestoringProvider'\n"],"mappings":";AAGA,cAAc;AAGd,cAAc;AACd,SAAS,kBAAkB;AAE3B,SAAS,gBAAgB;AACzB,SAAS,wBAAwB;AACjC,SAAS,gCAAgC;AACzC,SAAS,0BAA0B;AAKnC,SAAS,wBAAwB;AACjC,SAAS,gCAAgC;AACzC,SAAS,oBAAoB;AAM7B,SAAS,4BAA4B;AAMrC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAGP,SAAS,yBAAyB;AAQlC;AAAA,EACE;AAAA,EACA;AAAA,OACK;AACP,SAAS,qBAAqB;AAC9B,SAAS,eAAe,wBAAwB;AAChD,SAAS,mBAAmB;AAC5B,SAAS,uBAAuB;AAChC,SAAS,wBAAwB;AACjC,SAAS,gBAAgB,2BAA2B;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/infiniteQueryOptions.cjs b/node_modules/@tanstack/react-query/build/legacy/infiniteQueryOptions.cjs new file mode 100644 index 0000000..d0ce5b1 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/legacy/infiniteQueryOptions.cjs @@ -0,0 +1,33 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/infiniteQueryOptions.ts +var infiniteQueryOptions_exports = {}; +__export(infiniteQueryOptions_exports, { + infiniteQueryOptions: () => infiniteQueryOptions +}); +module.exports = __toCommonJS(infiniteQueryOptions_exports); +function infiniteQueryOptions(options) { + return options; +} +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + infiniteQueryOptions +}); +//# sourceMappingURL=infiniteQueryOptions.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/infiniteQueryOptions.cjs.map b/node_modules/@tanstack/react-query/build/legacy/infiniteQueryOptions.cjs.map new file mode 100644 index 0000000..b802bf9 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/legacy/infiniteQueryOptions.cjs.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/infiniteQueryOptions.ts"],"sourcesContent":["import type {\n DataTag,\n DefaultError,\n InfiniteData,\n InitialDataFunction,\n NonUndefinedGuard,\n OmitKeyof,\n QueryKey,\n SkipToken,\n} from '@tanstack/query-core'\nimport type { UseInfiniteQueryOptions } from './types'\n\nexport type UndefinedInitialDataInfiniteOptions<\n TQueryFnData,\n TError = DefaultError,\n TData = InfiniteData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n> = UseInfiniteQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n> & {\n initialData?:\n | undefined\n | NonUndefinedGuard>\n | InitialDataFunction<\n NonUndefinedGuard>\n >\n}\n\nexport type UnusedSkipTokenInfiniteOptions<\n TQueryFnData,\n TError = DefaultError,\n TData = InfiniteData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n> = OmitKeyof<\n UseInfiniteQueryOptions,\n 'queryFn'\n> & {\n queryFn?: Exclude<\n UseInfiniteQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >['queryFn'],\n SkipToken | undefined\n >\n}\n\nexport type DefinedInitialDataInfiniteOptions<\n TQueryFnData,\n TError = DefaultError,\n TData = InfiniteData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n> = UseInfiniteQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n> & {\n initialData:\n | NonUndefinedGuard>\n | (() => NonUndefinedGuard>)\n | undefined\n}\n\nexport function infiniteQueryOptions<\n TQueryFnData,\n TError = DefaultError,\n TData = InfiniteData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n>(\n options: DefinedInitialDataInfiniteOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n): DefinedInitialDataInfiniteOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n> & {\n queryKey: DataTag, TError>\n}\n\nexport function infiniteQueryOptions<\n TQueryFnData,\n TError = DefaultError,\n TData = InfiniteData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n>(\n options: UnusedSkipTokenInfiniteOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n): UnusedSkipTokenInfiniteOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n> & {\n queryKey: DataTag, TError>\n}\n\nexport function infiniteQueryOptions<\n TQueryFnData,\n TError = DefaultError,\n TData = InfiniteData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n>(\n options: UndefinedInitialDataInfiniteOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n): UndefinedInitialDataInfiniteOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n> & {\n queryKey: DataTag, TError>\n}\n\nexport function infiniteQueryOptions(options: unknown) {\n return options\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAkJO,SAAS,qBAAqB,SAAkB;AACrD,SAAO;AACT;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/infiniteQueryOptions.d.cts b/node_modules/@tanstack/react-query/build/legacy/infiniteQueryOptions.d.cts new file mode 100644 index 0000000..c363f90 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/legacy/infiniteQueryOptions.d.cts @@ -0,0 +1,23 @@ +import { DefaultError, InfiniteData, QueryKey, NonUndefinedGuard, InitialDataFunction, OmitKeyof, SkipToken, DataTag } from '@tanstack/query-core'; +import { UseInfiniteQueryOptions } from './types.cjs'; + +type UndefinedInitialDataInfiniteOptions, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown> = UseInfiniteQueryOptions & { + initialData?: undefined | NonUndefinedGuard> | InitialDataFunction>>; +}; +type UnusedSkipTokenInfiniteOptions, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown> = OmitKeyof, 'queryFn'> & { + queryFn?: Exclude['queryFn'], SkipToken | undefined>; +}; +type DefinedInitialDataInfiniteOptions, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown> = UseInfiniteQueryOptions & { + initialData: NonUndefinedGuard> | (() => NonUndefinedGuard>) | undefined; +}; +declare function infiniteQueryOptions, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown>(options: DefinedInitialDataInfiniteOptions): DefinedInitialDataInfiniteOptions & { + queryKey: DataTag, TError>; +}; +declare function infiniteQueryOptions, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown>(options: UnusedSkipTokenInfiniteOptions): UnusedSkipTokenInfiniteOptions & { + queryKey: DataTag, TError>; +}; +declare function infiniteQueryOptions, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown>(options: UndefinedInitialDataInfiniteOptions): UndefinedInitialDataInfiniteOptions & { + queryKey: DataTag, TError>; +}; + +export { type DefinedInitialDataInfiniteOptions, type UndefinedInitialDataInfiniteOptions, type UnusedSkipTokenInfiniteOptions, infiniteQueryOptions }; diff --git a/node_modules/@tanstack/react-query/build/legacy/infiniteQueryOptions.d.ts b/node_modules/@tanstack/react-query/build/legacy/infiniteQueryOptions.d.ts new file mode 100644 index 0000000..a37a4de --- /dev/null +++ b/node_modules/@tanstack/react-query/build/legacy/infiniteQueryOptions.d.ts @@ -0,0 +1,23 @@ +import { DefaultError, InfiniteData, QueryKey, NonUndefinedGuard, InitialDataFunction, OmitKeyof, SkipToken, DataTag } from '@tanstack/query-core'; +import { UseInfiniteQueryOptions } from './types.js'; + +type UndefinedInitialDataInfiniteOptions, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown> = UseInfiniteQueryOptions & { + initialData?: undefined | NonUndefinedGuard> | InitialDataFunction>>; +}; +type UnusedSkipTokenInfiniteOptions, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown> = OmitKeyof, 'queryFn'> & { + queryFn?: Exclude['queryFn'], SkipToken | undefined>; +}; +type DefinedInitialDataInfiniteOptions, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown> = UseInfiniteQueryOptions & { + initialData: NonUndefinedGuard> | (() => NonUndefinedGuard>) | undefined; +}; +declare function infiniteQueryOptions, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown>(options: DefinedInitialDataInfiniteOptions): DefinedInitialDataInfiniteOptions & { + queryKey: DataTag, TError>; +}; +declare function infiniteQueryOptions, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown>(options: UnusedSkipTokenInfiniteOptions): UnusedSkipTokenInfiniteOptions & { + queryKey: DataTag, TError>; +}; +declare function infiniteQueryOptions, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown>(options: UndefinedInitialDataInfiniteOptions): UndefinedInitialDataInfiniteOptions & { + queryKey: DataTag, TError>; +}; + +export { type DefinedInitialDataInfiniteOptions, type UndefinedInitialDataInfiniteOptions, type UnusedSkipTokenInfiniteOptions, infiniteQueryOptions }; diff --git a/node_modules/@tanstack/react-query/build/legacy/infiniteQueryOptions.js b/node_modules/@tanstack/react-query/build/legacy/infiniteQueryOptions.js new file mode 100644 index 0000000..bc8d5b0 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/legacy/infiniteQueryOptions.js @@ -0,0 +1,8 @@ +// src/infiniteQueryOptions.ts +function infiniteQueryOptions(options) { + return options; +} +export { + infiniteQueryOptions +}; +//# sourceMappingURL=infiniteQueryOptions.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/infiniteQueryOptions.js.map b/node_modules/@tanstack/react-query/build/legacy/infiniteQueryOptions.js.map new file mode 100644 index 0000000..fb592fc --- /dev/null +++ b/node_modules/@tanstack/react-query/build/legacy/infiniteQueryOptions.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/infiniteQueryOptions.ts"],"sourcesContent":["import type {\n DataTag,\n DefaultError,\n InfiniteData,\n InitialDataFunction,\n NonUndefinedGuard,\n OmitKeyof,\n QueryKey,\n SkipToken,\n} from '@tanstack/query-core'\nimport type { UseInfiniteQueryOptions } from './types'\n\nexport type UndefinedInitialDataInfiniteOptions<\n TQueryFnData,\n TError = DefaultError,\n TData = InfiniteData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n> = UseInfiniteQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n> & {\n initialData?:\n | undefined\n | NonUndefinedGuard>\n | InitialDataFunction<\n NonUndefinedGuard>\n >\n}\n\nexport type UnusedSkipTokenInfiniteOptions<\n TQueryFnData,\n TError = DefaultError,\n TData = InfiniteData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n> = OmitKeyof<\n UseInfiniteQueryOptions,\n 'queryFn'\n> & {\n queryFn?: Exclude<\n UseInfiniteQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >['queryFn'],\n SkipToken | undefined\n >\n}\n\nexport type DefinedInitialDataInfiniteOptions<\n TQueryFnData,\n TError = DefaultError,\n TData = InfiniteData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n> = UseInfiniteQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n> & {\n initialData:\n | NonUndefinedGuard>\n | (() => NonUndefinedGuard>)\n | undefined\n}\n\nexport function infiniteQueryOptions<\n TQueryFnData,\n TError = DefaultError,\n TData = InfiniteData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n>(\n options: DefinedInitialDataInfiniteOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n): DefinedInitialDataInfiniteOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n> & {\n queryKey: DataTag, TError>\n}\n\nexport function infiniteQueryOptions<\n TQueryFnData,\n TError = DefaultError,\n TData = InfiniteData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n>(\n options: UnusedSkipTokenInfiniteOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n): UnusedSkipTokenInfiniteOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n> & {\n queryKey: DataTag, TError>\n}\n\nexport function infiniteQueryOptions<\n TQueryFnData,\n TError = DefaultError,\n TData = InfiniteData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n>(\n options: UndefinedInitialDataInfiniteOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n): UndefinedInitialDataInfiniteOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n> & {\n queryKey: DataTag, TError>\n}\n\nexport function infiniteQueryOptions(options: unknown) {\n return options\n}\n"],"mappings":";AAkJO,SAAS,qBAAqB,SAAkB;AACrD,SAAO;AACT;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/mutationOptions.cjs b/node_modules/@tanstack/react-query/build/legacy/mutationOptions.cjs new file mode 100644 index 0000000..db3ac10 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/legacy/mutationOptions.cjs @@ -0,0 +1,33 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/mutationOptions.ts +var mutationOptions_exports = {}; +__export(mutationOptions_exports, { + mutationOptions: () => mutationOptions +}); +module.exports = __toCommonJS(mutationOptions_exports); +function mutationOptions(options) { + return options; +} +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + mutationOptions +}); +//# sourceMappingURL=mutationOptions.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/mutationOptions.cjs.map b/node_modules/@tanstack/react-query/build/legacy/mutationOptions.cjs.map new file mode 100644 index 0000000..683b965 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/legacy/mutationOptions.cjs.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/mutationOptions.ts"],"sourcesContent":["import type { DefaultError, WithRequired } from '@tanstack/query-core'\nimport type { UseMutationOptions } from './types'\n\nexport function mutationOptions<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n>(\n options: WithRequired<\n UseMutationOptions,\n 'mutationKey'\n >,\n): WithRequired<\n UseMutationOptions,\n 'mutationKey'\n>\nexport function mutationOptions<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n>(\n options: Omit<\n UseMutationOptions,\n 'mutationKey'\n >,\n): Omit<\n UseMutationOptions,\n 'mutationKey'\n>\nexport function mutationOptions<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n>(\n options: UseMutationOptions,\n): UseMutationOptions {\n return options\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AA+BO,SAAS,gBAMd,SACgE;AAChE,SAAO;AACT;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/mutationOptions.d.cts b/node_modules/@tanstack/react-query/build/legacy/mutationOptions.d.cts new file mode 100644 index 0000000..170edf3 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/legacy/mutationOptions.d.cts @@ -0,0 +1,7 @@ +import { DefaultError, WithRequired } from '@tanstack/query-core'; +import { UseMutationOptions } from './types.cjs'; + +declare function mutationOptions(options: WithRequired, 'mutationKey'>): WithRequired, 'mutationKey'>; +declare function mutationOptions(options: Omit, 'mutationKey'>): Omit, 'mutationKey'>; + +export { mutationOptions }; diff --git a/node_modules/@tanstack/react-query/build/legacy/mutationOptions.d.ts b/node_modules/@tanstack/react-query/build/legacy/mutationOptions.d.ts new file mode 100644 index 0000000..b080cf2 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/legacy/mutationOptions.d.ts @@ -0,0 +1,7 @@ +import { DefaultError, WithRequired } from '@tanstack/query-core'; +import { UseMutationOptions } from './types.js'; + +declare function mutationOptions(options: WithRequired, 'mutationKey'>): WithRequired, 'mutationKey'>; +declare function mutationOptions(options: Omit, 'mutationKey'>): Omit, 'mutationKey'>; + +export { mutationOptions }; diff --git a/node_modules/@tanstack/react-query/build/legacy/mutationOptions.js b/node_modules/@tanstack/react-query/build/legacy/mutationOptions.js new file mode 100644 index 0000000..d40279e --- /dev/null +++ b/node_modules/@tanstack/react-query/build/legacy/mutationOptions.js @@ -0,0 +1,8 @@ +// src/mutationOptions.ts +function mutationOptions(options) { + return options; +} +export { + mutationOptions +}; +//# sourceMappingURL=mutationOptions.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/mutationOptions.js.map b/node_modules/@tanstack/react-query/build/legacy/mutationOptions.js.map new file mode 100644 index 0000000..d0a8b6d --- /dev/null +++ b/node_modules/@tanstack/react-query/build/legacy/mutationOptions.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/mutationOptions.ts"],"sourcesContent":["import type { DefaultError, WithRequired } from '@tanstack/query-core'\nimport type { UseMutationOptions } from './types'\n\nexport function mutationOptions<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n>(\n options: WithRequired<\n UseMutationOptions,\n 'mutationKey'\n >,\n): WithRequired<\n UseMutationOptions,\n 'mutationKey'\n>\nexport function mutationOptions<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n>(\n options: Omit<\n UseMutationOptions,\n 'mutationKey'\n >,\n): Omit<\n UseMutationOptions,\n 'mutationKey'\n>\nexport function mutationOptions<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n>(\n options: UseMutationOptions,\n): UseMutationOptions {\n return options\n}\n"],"mappings":";AA+BO,SAAS,gBAMd,SACgE;AAChE,SAAO;AACT;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/queryOptions.cjs b/node_modules/@tanstack/react-query/build/legacy/queryOptions.cjs new file mode 100644 index 0000000..ffda67f --- /dev/null +++ b/node_modules/@tanstack/react-query/build/legacy/queryOptions.cjs @@ -0,0 +1,33 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/queryOptions.ts +var queryOptions_exports = {}; +__export(queryOptions_exports, { + queryOptions: () => queryOptions +}); +module.exports = __toCommonJS(queryOptions_exports); +function queryOptions(options) { + return options; +} +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + queryOptions +}); +//# sourceMappingURL=queryOptions.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/queryOptions.cjs.map b/node_modules/@tanstack/react-query/build/legacy/queryOptions.cjs.map new file mode 100644 index 0000000..426573b --- /dev/null +++ b/node_modules/@tanstack/react-query/build/legacy/queryOptions.cjs.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/queryOptions.ts"],"sourcesContent":["import type {\n DataTag,\n DefaultError,\n InitialDataFunction,\n NonUndefinedGuard,\n OmitKeyof,\n QueryFunction,\n QueryKey,\n SkipToken,\n} from '@tanstack/query-core'\nimport type { UseQueryOptions } from './types'\n\nexport type UndefinedInitialDataOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> = UseQueryOptions & {\n initialData?:\n | undefined\n | InitialDataFunction>\n | NonUndefinedGuard\n}\n\nexport type UnusedSkipTokenOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> = OmitKeyof<\n UseQueryOptions,\n 'queryFn'\n> & {\n queryFn?: Exclude<\n UseQueryOptions['queryFn'],\n SkipToken | undefined\n >\n}\n\nexport type DefinedInitialDataOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> = Omit, 'queryFn'> & {\n initialData:\n | NonUndefinedGuard\n | (() => NonUndefinedGuard)\n queryFn?: QueryFunction\n}\n\nexport function queryOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n options: DefinedInitialDataOptions,\n): DefinedInitialDataOptions & {\n queryKey: DataTag\n}\n\nexport function queryOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n options: UnusedSkipTokenOptions,\n): UnusedSkipTokenOptions & {\n queryKey: DataTag\n}\n\nexport function queryOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n options: UndefinedInitialDataOptions,\n): UndefinedInitialDataOptions & {\n queryKey: DataTag\n}\n\nexport function queryOptions(options: unknown) {\n return options\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAoFO,SAAS,aAAa,SAAkB;AAC7C,SAAO;AACT;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/queryOptions.d.cts b/node_modules/@tanstack/react-query/build/legacy/queryOptions.d.cts new file mode 100644 index 0000000..05489f6 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/legacy/queryOptions.d.cts @@ -0,0 +1,24 @@ +import { DefaultError, QueryKey, NonUndefinedGuard, QueryFunction, InitialDataFunction, OmitKeyof, SkipToken, DataTag } from '@tanstack/query-core'; +import { UseQueryOptions } from './types.cjs'; + +type UndefinedInitialDataOptions = UseQueryOptions & { + initialData?: undefined | InitialDataFunction> | NonUndefinedGuard; +}; +type UnusedSkipTokenOptions = OmitKeyof, 'queryFn'> & { + queryFn?: Exclude['queryFn'], SkipToken | undefined>; +}; +type DefinedInitialDataOptions = Omit, 'queryFn'> & { + initialData: NonUndefinedGuard | (() => NonUndefinedGuard); + queryFn?: QueryFunction; +}; +declare function queryOptions(options: DefinedInitialDataOptions): DefinedInitialDataOptions & { + queryKey: DataTag; +}; +declare function queryOptions(options: UnusedSkipTokenOptions): UnusedSkipTokenOptions & { + queryKey: DataTag; +}; +declare function queryOptions(options: UndefinedInitialDataOptions): UndefinedInitialDataOptions & { + queryKey: DataTag; +}; + +export { type DefinedInitialDataOptions, type UndefinedInitialDataOptions, type UnusedSkipTokenOptions, queryOptions }; diff --git a/node_modules/@tanstack/react-query/build/legacy/queryOptions.d.ts b/node_modules/@tanstack/react-query/build/legacy/queryOptions.d.ts new file mode 100644 index 0000000..7a93665 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/legacy/queryOptions.d.ts @@ -0,0 +1,24 @@ +import { DefaultError, QueryKey, NonUndefinedGuard, QueryFunction, InitialDataFunction, OmitKeyof, SkipToken, DataTag } from '@tanstack/query-core'; +import { UseQueryOptions } from './types.js'; + +type UndefinedInitialDataOptions = UseQueryOptions & { + initialData?: undefined | InitialDataFunction> | NonUndefinedGuard; +}; +type UnusedSkipTokenOptions = OmitKeyof, 'queryFn'> & { + queryFn?: Exclude['queryFn'], SkipToken | undefined>; +}; +type DefinedInitialDataOptions = Omit, 'queryFn'> & { + initialData: NonUndefinedGuard | (() => NonUndefinedGuard); + queryFn?: QueryFunction; +}; +declare function queryOptions(options: DefinedInitialDataOptions): DefinedInitialDataOptions & { + queryKey: DataTag; +}; +declare function queryOptions(options: UnusedSkipTokenOptions): UnusedSkipTokenOptions & { + queryKey: DataTag; +}; +declare function queryOptions(options: UndefinedInitialDataOptions): UndefinedInitialDataOptions & { + queryKey: DataTag; +}; + +export { type DefinedInitialDataOptions, type UndefinedInitialDataOptions, type UnusedSkipTokenOptions, queryOptions }; diff --git a/node_modules/@tanstack/react-query/build/legacy/queryOptions.js b/node_modules/@tanstack/react-query/build/legacy/queryOptions.js new file mode 100644 index 0000000..7fb75ff --- /dev/null +++ b/node_modules/@tanstack/react-query/build/legacy/queryOptions.js @@ -0,0 +1,8 @@ +// src/queryOptions.ts +function queryOptions(options) { + return options; +} +export { + queryOptions +}; +//# sourceMappingURL=queryOptions.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/queryOptions.js.map b/node_modules/@tanstack/react-query/build/legacy/queryOptions.js.map new file mode 100644 index 0000000..4ee7f34 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/legacy/queryOptions.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/queryOptions.ts"],"sourcesContent":["import type {\n DataTag,\n DefaultError,\n InitialDataFunction,\n NonUndefinedGuard,\n OmitKeyof,\n QueryFunction,\n QueryKey,\n SkipToken,\n} from '@tanstack/query-core'\nimport type { UseQueryOptions } from './types'\n\nexport type UndefinedInitialDataOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> = UseQueryOptions & {\n initialData?:\n | undefined\n | InitialDataFunction>\n | NonUndefinedGuard\n}\n\nexport type UnusedSkipTokenOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> = OmitKeyof<\n UseQueryOptions,\n 'queryFn'\n> & {\n queryFn?: Exclude<\n UseQueryOptions['queryFn'],\n SkipToken | undefined\n >\n}\n\nexport type DefinedInitialDataOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> = Omit, 'queryFn'> & {\n initialData:\n | NonUndefinedGuard\n | (() => NonUndefinedGuard)\n queryFn?: QueryFunction\n}\n\nexport function queryOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n options: DefinedInitialDataOptions,\n): DefinedInitialDataOptions & {\n queryKey: DataTag\n}\n\nexport function queryOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n options: UnusedSkipTokenOptions,\n): UnusedSkipTokenOptions & {\n queryKey: DataTag\n}\n\nexport function queryOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n options: UndefinedInitialDataOptions,\n): UndefinedInitialDataOptions & {\n queryKey: DataTag\n}\n\nexport function queryOptions(options: unknown) {\n return options\n}\n"],"mappings":";AAoFO,SAAS,aAAa,SAAkB;AAC7C,SAAO;AACT;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/suspense.cjs b/node_modules/@tanstack/react-query/build/legacy/suspense.cjs new file mode 100644 index 0000000..d3745f0 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/legacy/suspense.cjs @@ -0,0 +1,58 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/suspense.ts +var suspense_exports = {}; +__export(suspense_exports, { + defaultThrowOnError: () => defaultThrowOnError, + ensureSuspenseTimers: () => ensureSuspenseTimers, + fetchOptimistic: () => fetchOptimistic, + shouldSuspend: () => shouldSuspend, + willFetch: () => willFetch +}); +module.exports = __toCommonJS(suspense_exports); +var defaultThrowOnError = (_error, query) => query.state.data === void 0; +var ensureSuspenseTimers = (defaultedOptions) => { + if (defaultedOptions.suspense) { + const MIN_SUSPENSE_TIME_MS = 1e3; + const clamp = (value) => value === "static" ? value : Math.max(value ?? MIN_SUSPENSE_TIME_MS, MIN_SUSPENSE_TIME_MS); + const originalStaleTime = defaultedOptions.staleTime; + defaultedOptions.staleTime = typeof originalStaleTime === "function" ? (...args) => clamp(originalStaleTime(...args)) : clamp(originalStaleTime); + if (typeof defaultedOptions.gcTime === "number") { + defaultedOptions.gcTime = Math.max( + defaultedOptions.gcTime, + MIN_SUSPENSE_TIME_MS + ); + } + } +}; +var willFetch = (result, isRestoring) => result.isLoading && result.isFetching && !isRestoring; +var shouldSuspend = (defaultedOptions, result) => (defaultedOptions == null ? void 0 : defaultedOptions.suspense) && result.isPending; +var fetchOptimistic = (defaultedOptions, observer, errorResetBoundary) => observer.fetchOptimistic(defaultedOptions).catch(() => { + errorResetBoundary.clearReset(); +}); +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + defaultThrowOnError, + ensureSuspenseTimers, + fetchOptimistic, + shouldSuspend, + willFetch +}); +//# sourceMappingURL=suspense.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/suspense.cjs.map b/node_modules/@tanstack/react-query/build/legacy/suspense.cjs.map new file mode 100644 index 0000000..fdf2ecc --- /dev/null +++ b/node_modules/@tanstack/react-query/build/legacy/suspense.cjs.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/suspense.ts"],"sourcesContent":["import type {\n DefaultError,\n DefaultedQueryObserverOptions,\n Query,\n QueryKey,\n QueryObserver,\n QueryObserverResult,\n} from '@tanstack/query-core'\nimport type { QueryErrorResetBoundaryValue } from './QueryErrorResetBoundary'\n\nexport const defaultThrowOnError = <\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n _error: TError,\n query: Query,\n) => query.state.data === undefined\n\nexport const ensureSuspenseTimers = (\n defaultedOptions: DefaultedQueryObserverOptions,\n) => {\n if (defaultedOptions.suspense) {\n // Handle staleTime to ensure minimum 1000ms in Suspense mode\n // This prevents unnecessary refetching when components remount after suspending\n const MIN_SUSPENSE_TIME_MS = 1000\n\n const clamp = (value: number | 'static' | undefined) =>\n value === 'static'\n ? value\n : Math.max(value ?? MIN_SUSPENSE_TIME_MS, MIN_SUSPENSE_TIME_MS)\n\n const originalStaleTime = defaultedOptions.staleTime\n defaultedOptions.staleTime =\n typeof originalStaleTime === 'function'\n ? (...args) => clamp(originalStaleTime(...args))\n : clamp(originalStaleTime)\n\n if (typeof defaultedOptions.gcTime === 'number') {\n defaultedOptions.gcTime = Math.max(\n defaultedOptions.gcTime,\n MIN_SUSPENSE_TIME_MS,\n )\n }\n }\n}\n\nexport const willFetch = (\n result: QueryObserverResult,\n isRestoring: boolean,\n) => result.isLoading && result.isFetching && !isRestoring\n\nexport const shouldSuspend = (\n defaultedOptions:\n | DefaultedQueryObserverOptions\n | undefined,\n result: QueryObserverResult,\n) => defaultedOptions?.suspense && result.isPending\n\nexport const fetchOptimistic = <\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey extends QueryKey,\n>(\n defaultedOptions: DefaultedQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >,\n observer: QueryObserver,\n errorResetBoundary: QueryErrorResetBoundaryValue,\n) =>\n observer.fetchOptimistic(defaultedOptions).catch(() => {\n errorResetBoundary.clearReset()\n })\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAUO,IAAM,sBAAsB,CAMjC,QACA,UACG,MAAM,MAAM,SAAS;AAEnB,IAAM,uBAAuB,CAClC,qBACG;AACH,MAAI,iBAAiB,UAAU;AAG7B,UAAM,uBAAuB;AAE7B,UAAM,QAAQ,CAAC,UACb,UAAU,WACN,QACA,KAAK,IAAI,SAAS,sBAAsB,oBAAoB;AAElE,UAAM,oBAAoB,iBAAiB;AAC3C,qBAAiB,YACf,OAAO,sBAAsB,aACzB,IAAI,SAAS,MAAM,kBAAkB,GAAG,IAAI,CAAC,IAC7C,MAAM,iBAAiB;AAE7B,QAAI,OAAO,iBAAiB,WAAW,UAAU;AAC/C,uBAAiB,SAAS,KAAK;AAAA,QAC7B,iBAAiB;AAAA,QACjB;AAAA,MACF;AAAA,IACF;AAAA,EACF;AACF;AAEO,IAAM,YAAY,CACvB,QACA,gBACG,OAAO,aAAa,OAAO,cAAc,CAAC;AAExC,IAAM,gBAAgB,CAC3B,kBAGA,YACG,qDAAkB,aAAY,OAAO;AAEnC,IAAM,kBAAkB,CAO7B,kBAOA,UACA,uBAEA,SAAS,gBAAgB,gBAAgB,EAAE,MAAM,MAAM;AACrD,qBAAmB,WAAW;AAChC,CAAC;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/suspense.d.cts b/node_modules/@tanstack/react-query/build/legacy/suspense.d.cts new file mode 100644 index 0000000..da077db --- /dev/null +++ b/node_modules/@tanstack/react-query/build/legacy/suspense.d.cts @@ -0,0 +1,12 @@ +import { DefaultError, QueryKey, Query, DefaultedQueryObserverOptions, QueryObserver, QueryObserverResult } from '@tanstack/query-core'; +import { QueryErrorResetBoundaryValue } from './QueryErrorResetBoundary.cjs'; +import 'react/jsx-runtime'; +import 'react'; + +declare const defaultThrowOnError: (_error: TError, query: Query) => boolean; +declare const ensureSuspenseTimers: (defaultedOptions: DefaultedQueryObserverOptions) => void; +declare const willFetch: (result: QueryObserverResult, isRestoring: boolean) => boolean; +declare const shouldSuspend: (defaultedOptions: DefaultedQueryObserverOptions | undefined, result: QueryObserverResult) => boolean | undefined; +declare const fetchOptimistic: (defaultedOptions: DefaultedQueryObserverOptions, observer: QueryObserver, errorResetBoundary: QueryErrorResetBoundaryValue) => Promise>; + +export { defaultThrowOnError, ensureSuspenseTimers, fetchOptimistic, shouldSuspend, willFetch }; diff --git a/node_modules/@tanstack/react-query/build/legacy/suspense.d.ts b/node_modules/@tanstack/react-query/build/legacy/suspense.d.ts new file mode 100644 index 0000000..954f1fb --- /dev/null +++ b/node_modules/@tanstack/react-query/build/legacy/suspense.d.ts @@ -0,0 +1,12 @@ +import { DefaultError, QueryKey, Query, DefaultedQueryObserverOptions, QueryObserver, QueryObserverResult } from '@tanstack/query-core'; +import { QueryErrorResetBoundaryValue } from './QueryErrorResetBoundary.js'; +import 'react/jsx-runtime'; +import 'react'; + +declare const defaultThrowOnError: (_error: TError, query: Query) => boolean; +declare const ensureSuspenseTimers: (defaultedOptions: DefaultedQueryObserverOptions) => void; +declare const willFetch: (result: QueryObserverResult, isRestoring: boolean) => boolean; +declare const shouldSuspend: (defaultedOptions: DefaultedQueryObserverOptions | undefined, result: QueryObserverResult) => boolean | undefined; +declare const fetchOptimistic: (defaultedOptions: DefaultedQueryObserverOptions, observer: QueryObserver, errorResetBoundary: QueryErrorResetBoundaryValue) => Promise>; + +export { defaultThrowOnError, ensureSuspenseTimers, fetchOptimistic, shouldSuspend, willFetch }; diff --git a/node_modules/@tanstack/react-query/build/legacy/suspense.js b/node_modules/@tanstack/react-query/build/legacy/suspense.js new file mode 100644 index 0000000..c4efc02 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/legacy/suspense.js @@ -0,0 +1,29 @@ +// src/suspense.ts +var defaultThrowOnError = (_error, query) => query.state.data === void 0; +var ensureSuspenseTimers = (defaultedOptions) => { + if (defaultedOptions.suspense) { + const MIN_SUSPENSE_TIME_MS = 1e3; + const clamp = (value) => value === "static" ? value : Math.max(value ?? MIN_SUSPENSE_TIME_MS, MIN_SUSPENSE_TIME_MS); + const originalStaleTime = defaultedOptions.staleTime; + defaultedOptions.staleTime = typeof originalStaleTime === "function" ? (...args) => clamp(originalStaleTime(...args)) : clamp(originalStaleTime); + if (typeof defaultedOptions.gcTime === "number") { + defaultedOptions.gcTime = Math.max( + defaultedOptions.gcTime, + MIN_SUSPENSE_TIME_MS + ); + } + } +}; +var willFetch = (result, isRestoring) => result.isLoading && result.isFetching && !isRestoring; +var shouldSuspend = (defaultedOptions, result) => (defaultedOptions == null ? void 0 : defaultedOptions.suspense) && result.isPending; +var fetchOptimistic = (defaultedOptions, observer, errorResetBoundary) => observer.fetchOptimistic(defaultedOptions).catch(() => { + errorResetBoundary.clearReset(); +}); +export { + defaultThrowOnError, + ensureSuspenseTimers, + fetchOptimistic, + shouldSuspend, + willFetch +}; +//# sourceMappingURL=suspense.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/suspense.js.map b/node_modules/@tanstack/react-query/build/legacy/suspense.js.map new file mode 100644 index 0000000..c245b02 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/legacy/suspense.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/suspense.ts"],"sourcesContent":["import type {\n DefaultError,\n DefaultedQueryObserverOptions,\n Query,\n QueryKey,\n QueryObserver,\n QueryObserverResult,\n} from '@tanstack/query-core'\nimport type { QueryErrorResetBoundaryValue } from './QueryErrorResetBoundary'\n\nexport const defaultThrowOnError = <\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n _error: TError,\n query: Query,\n) => query.state.data === undefined\n\nexport const ensureSuspenseTimers = (\n defaultedOptions: DefaultedQueryObserverOptions,\n) => {\n if (defaultedOptions.suspense) {\n // Handle staleTime to ensure minimum 1000ms in Suspense mode\n // This prevents unnecessary refetching when components remount after suspending\n const MIN_SUSPENSE_TIME_MS = 1000\n\n const clamp = (value: number | 'static' | undefined) =>\n value === 'static'\n ? value\n : Math.max(value ?? MIN_SUSPENSE_TIME_MS, MIN_SUSPENSE_TIME_MS)\n\n const originalStaleTime = defaultedOptions.staleTime\n defaultedOptions.staleTime =\n typeof originalStaleTime === 'function'\n ? (...args) => clamp(originalStaleTime(...args))\n : clamp(originalStaleTime)\n\n if (typeof defaultedOptions.gcTime === 'number') {\n defaultedOptions.gcTime = Math.max(\n defaultedOptions.gcTime,\n MIN_SUSPENSE_TIME_MS,\n )\n }\n }\n}\n\nexport const willFetch = (\n result: QueryObserverResult,\n isRestoring: boolean,\n) => result.isLoading && result.isFetching && !isRestoring\n\nexport const shouldSuspend = (\n defaultedOptions:\n | DefaultedQueryObserverOptions\n | undefined,\n result: QueryObserverResult,\n) => defaultedOptions?.suspense && result.isPending\n\nexport const fetchOptimistic = <\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey extends QueryKey,\n>(\n defaultedOptions: DefaultedQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >,\n observer: QueryObserver,\n errorResetBoundary: QueryErrorResetBoundaryValue,\n) =>\n observer.fetchOptimistic(defaultedOptions).catch(() => {\n errorResetBoundary.clearReset()\n })\n"],"mappings":";AAUO,IAAM,sBAAsB,CAMjC,QACA,UACG,MAAM,MAAM,SAAS;AAEnB,IAAM,uBAAuB,CAClC,qBACG;AACH,MAAI,iBAAiB,UAAU;AAG7B,UAAM,uBAAuB;AAE7B,UAAM,QAAQ,CAAC,UACb,UAAU,WACN,QACA,KAAK,IAAI,SAAS,sBAAsB,oBAAoB;AAElE,UAAM,oBAAoB,iBAAiB;AAC3C,qBAAiB,YACf,OAAO,sBAAsB,aACzB,IAAI,SAAS,MAAM,kBAAkB,GAAG,IAAI,CAAC,IAC7C,MAAM,iBAAiB;AAE7B,QAAI,OAAO,iBAAiB,WAAW,UAAU;AAC/C,uBAAiB,SAAS,KAAK;AAAA,QAC7B,iBAAiB;AAAA,QACjB;AAAA,MACF;AAAA,IACF;AAAA,EACF;AACF;AAEO,IAAM,YAAY,CACvB,QACA,gBACG,OAAO,aAAa,OAAO,cAAc,CAAC;AAExC,IAAM,gBAAgB,CAC3B,kBAGA,YACG,qDAAkB,aAAY,OAAO;AAEnC,IAAM,kBAAkB,CAO7B,kBAOA,UACA,uBAEA,SAAS,gBAAgB,gBAAgB,EAAE,MAAM,MAAM;AACrD,qBAAmB,WAAW;AAChC,CAAC;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/types.cjs b/node_modules/@tanstack/react-query/build/legacy/types.cjs new file mode 100644 index 0000000..d22152b --- /dev/null +++ b/node_modules/@tanstack/react-query/build/legacy/types.cjs @@ -0,0 +1,19 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/types.ts +var types_exports = {}; +module.exports = __toCommonJS(types_exports); +//# sourceMappingURL=types.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/types.cjs.map b/node_modules/@tanstack/react-query/build/legacy/types.cjs.map new file mode 100644 index 0000000..3d02938 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/legacy/types.cjs.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/types.ts"],"sourcesContent":["/* istanbul ignore file */\n\nimport type {\n DefaultError,\n DefinedInfiniteQueryObserverResult,\n DefinedQueryObserverResult,\n DistributiveOmit,\n FetchQueryOptions,\n InfiniteQueryObserverOptions,\n InfiniteQueryObserverResult,\n MutateFunction,\n MutationObserverOptions,\n MutationObserverResult,\n OmitKeyof,\n Override,\n QueryKey,\n QueryObserverOptions,\n QueryObserverResult,\n SkipToken,\n} from '@tanstack/query-core'\n\nexport type AnyUseBaseQueryOptions = UseBaseQueryOptions<\n any,\n any,\n any,\n any,\n any\n>\nexport interface UseBaseQueryOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> extends QueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n> {\n /**\n * Set this to `false` to unsubscribe this observer from updates to the query cache.\n * Defaults to `true`.\n */\n subscribed?: boolean\n}\n\nexport interface UsePrefetchQueryOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> extends OmitKeyof<\n FetchQueryOptions,\n 'queryFn'\n> {\n queryFn?: Exclude<\n FetchQueryOptions['queryFn'],\n SkipToken\n >\n}\n\nexport type AnyUseQueryOptions = UseQueryOptions\nexport interface UseQueryOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> extends OmitKeyof<\n UseBaseQueryOptions,\n 'suspense'\n> {}\n\nexport type AnyUseSuspenseQueryOptions = UseSuspenseQueryOptions<\n any,\n any,\n any,\n any\n>\nexport interface UseSuspenseQueryOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> extends OmitKeyof<\n UseQueryOptions,\n 'queryFn' | 'enabled' | 'throwOnError' | 'placeholderData'\n> {\n queryFn?: Exclude<\n UseQueryOptions['queryFn'],\n SkipToken\n >\n}\n\nexport type AnyUseInfiniteQueryOptions = UseInfiniteQueryOptions<\n any,\n any,\n any,\n any,\n any\n>\nexport interface UseInfiniteQueryOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n> extends OmitKeyof<\n InfiniteQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n 'suspense'\n> {\n /**\n * Set this to `false` to unsubscribe this observer from updates to the query cache.\n * Defaults to `true`.\n */\n subscribed?: boolean\n}\n\nexport type AnyUseSuspenseInfiniteQueryOptions =\n UseSuspenseInfiniteQueryOptions\nexport interface UseSuspenseInfiniteQueryOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n> extends OmitKeyof<\n UseInfiniteQueryOptions,\n 'queryFn' | 'enabled' | 'throwOnError' | 'placeholderData'\n> {\n queryFn?: Exclude<\n UseInfiniteQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >['queryFn'],\n SkipToken\n >\n}\n\nexport type UseBaseQueryResult<\n TData = unknown,\n TError = DefaultError,\n> = QueryObserverResult\n\nexport type UseQueryResult<\n TData = unknown,\n TError = DefaultError,\n> = UseBaseQueryResult\n\nexport type UseSuspenseQueryResult<\n TData = unknown,\n TError = DefaultError,\n> = DistributiveOmit<\n DefinedQueryObserverResult,\n 'isPlaceholderData' | 'promise'\n>\n\nexport type DefinedUseQueryResult<\n TData = unknown,\n TError = DefaultError,\n> = DefinedQueryObserverResult\n\nexport type UseInfiniteQueryResult<\n TData = unknown,\n TError = DefaultError,\n> = InfiniteQueryObserverResult\n\nexport type DefinedUseInfiniteQueryResult<\n TData = unknown,\n TError = DefaultError,\n> = DefinedInfiniteQueryObserverResult\n\nexport type UseSuspenseInfiniteQueryResult<\n TData = unknown,\n TError = DefaultError,\n> = OmitKeyof<\n DefinedInfiniteQueryObserverResult,\n 'isPlaceholderData' | 'promise'\n>\n\nexport type AnyUseMutationOptions = UseMutationOptions\nexport interface UseMutationOptions<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n> extends OmitKeyof<\n MutationObserverOptions,\n '_defaulted'\n> {}\n\nexport type UseMutateFunction<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n> = (\n ...args: Parameters<\n MutateFunction\n >\n) => void\n\nexport type UseMutateAsyncFunction<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n> = MutateFunction\n\nexport type UseBaseMutationResult<\n TData = unknown,\n TError = DefaultError,\n TVariables = unknown,\n TOnMutateResult = unknown,\n> = Override<\n MutationObserverResult,\n { mutate: UseMutateFunction }\n> & {\n mutateAsync: UseMutateAsyncFunction<\n TData,\n TError,\n TVariables,\n TOnMutateResult\n >\n}\n\nexport type UseMutationResult<\n TData = unknown,\n TError = DefaultError,\n TVariables = unknown,\n TOnMutateResult = unknown,\n> = UseBaseMutationResult\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/types.d.cts b/node_modules/@tanstack/react-query/build/legacy/types.d.cts new file mode 100644 index 0000000..e9d55b2 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/legacy/types.d.cts @@ -0,0 +1,52 @@ +import { DefaultError, QueryKey, QueryObserverOptions, OmitKeyof, InfiniteQueryObserverOptions, MutationObserverOptions, SkipToken, DefinedInfiniteQueryObserverResult, DefinedQueryObserverResult, QueryObserverResult, DistributiveOmit, Override, MutationObserverResult, MutateFunction, InfiniteQueryObserverResult, FetchQueryOptions } from '@tanstack/query-core'; + +type AnyUseBaseQueryOptions = UseBaseQueryOptions; +interface UseBaseQueryOptions extends QueryObserverOptions { + /** + * Set this to `false` to unsubscribe this observer from updates to the query cache. + * Defaults to `true`. + */ + subscribed?: boolean; +} +interface UsePrefetchQueryOptions extends OmitKeyof, 'queryFn'> { + queryFn?: Exclude['queryFn'], SkipToken>; +} +type AnyUseQueryOptions = UseQueryOptions; +interface UseQueryOptions extends OmitKeyof, 'suspense'> { +} +type AnyUseSuspenseQueryOptions = UseSuspenseQueryOptions; +interface UseSuspenseQueryOptions extends OmitKeyof, 'queryFn' | 'enabled' | 'throwOnError' | 'placeholderData'> { + queryFn?: Exclude['queryFn'], SkipToken>; +} +type AnyUseInfiniteQueryOptions = UseInfiniteQueryOptions; +interface UseInfiniteQueryOptions extends OmitKeyof, 'suspense'> { + /** + * Set this to `false` to unsubscribe this observer from updates to the query cache. + * Defaults to `true`. + */ + subscribed?: boolean; +} +type AnyUseSuspenseInfiniteQueryOptions = UseSuspenseInfiniteQueryOptions; +interface UseSuspenseInfiniteQueryOptions extends OmitKeyof, 'queryFn' | 'enabled' | 'throwOnError' | 'placeholderData'> { + queryFn?: Exclude['queryFn'], SkipToken>; +} +type UseBaseQueryResult = QueryObserverResult; +type UseQueryResult = UseBaseQueryResult; +type UseSuspenseQueryResult = DistributiveOmit, 'isPlaceholderData' | 'promise'>; +type DefinedUseQueryResult = DefinedQueryObserverResult; +type UseInfiniteQueryResult = InfiniteQueryObserverResult; +type DefinedUseInfiniteQueryResult = DefinedInfiniteQueryObserverResult; +type UseSuspenseInfiniteQueryResult = OmitKeyof, 'isPlaceholderData' | 'promise'>; +type AnyUseMutationOptions = UseMutationOptions; +interface UseMutationOptions extends OmitKeyof, '_defaulted'> { +} +type UseMutateFunction = (...args: Parameters>) => void; +type UseMutateAsyncFunction = MutateFunction; +type UseBaseMutationResult = Override, { + mutate: UseMutateFunction; +}> & { + mutateAsync: UseMutateAsyncFunction; +}; +type UseMutationResult = UseBaseMutationResult; + +export type { AnyUseBaseQueryOptions, AnyUseInfiniteQueryOptions, AnyUseMutationOptions, AnyUseQueryOptions, AnyUseSuspenseInfiniteQueryOptions, AnyUseSuspenseQueryOptions, DefinedUseInfiniteQueryResult, DefinedUseQueryResult, UseBaseMutationResult, UseBaseQueryOptions, UseBaseQueryResult, UseInfiniteQueryOptions, UseInfiniteQueryResult, UseMutateAsyncFunction, UseMutateFunction, UseMutationOptions, UseMutationResult, UsePrefetchQueryOptions, UseQueryOptions, UseQueryResult, UseSuspenseInfiniteQueryOptions, UseSuspenseInfiniteQueryResult, UseSuspenseQueryOptions, UseSuspenseQueryResult }; diff --git a/node_modules/@tanstack/react-query/build/legacy/types.d.ts b/node_modules/@tanstack/react-query/build/legacy/types.d.ts new file mode 100644 index 0000000..e9d55b2 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/legacy/types.d.ts @@ -0,0 +1,52 @@ +import { DefaultError, QueryKey, QueryObserverOptions, OmitKeyof, InfiniteQueryObserverOptions, MutationObserverOptions, SkipToken, DefinedInfiniteQueryObserverResult, DefinedQueryObserverResult, QueryObserverResult, DistributiveOmit, Override, MutationObserverResult, MutateFunction, InfiniteQueryObserverResult, FetchQueryOptions } from '@tanstack/query-core'; + +type AnyUseBaseQueryOptions = UseBaseQueryOptions; +interface UseBaseQueryOptions extends QueryObserverOptions { + /** + * Set this to `false` to unsubscribe this observer from updates to the query cache. + * Defaults to `true`. + */ + subscribed?: boolean; +} +interface UsePrefetchQueryOptions extends OmitKeyof, 'queryFn'> { + queryFn?: Exclude['queryFn'], SkipToken>; +} +type AnyUseQueryOptions = UseQueryOptions; +interface UseQueryOptions extends OmitKeyof, 'suspense'> { +} +type AnyUseSuspenseQueryOptions = UseSuspenseQueryOptions; +interface UseSuspenseQueryOptions extends OmitKeyof, 'queryFn' | 'enabled' | 'throwOnError' | 'placeholderData'> { + queryFn?: Exclude['queryFn'], SkipToken>; +} +type AnyUseInfiniteQueryOptions = UseInfiniteQueryOptions; +interface UseInfiniteQueryOptions extends OmitKeyof, 'suspense'> { + /** + * Set this to `false` to unsubscribe this observer from updates to the query cache. + * Defaults to `true`. + */ + subscribed?: boolean; +} +type AnyUseSuspenseInfiniteQueryOptions = UseSuspenseInfiniteQueryOptions; +interface UseSuspenseInfiniteQueryOptions extends OmitKeyof, 'queryFn' | 'enabled' | 'throwOnError' | 'placeholderData'> { + queryFn?: Exclude['queryFn'], SkipToken>; +} +type UseBaseQueryResult = QueryObserverResult; +type UseQueryResult = UseBaseQueryResult; +type UseSuspenseQueryResult = DistributiveOmit, 'isPlaceholderData' | 'promise'>; +type DefinedUseQueryResult = DefinedQueryObserverResult; +type UseInfiniteQueryResult = InfiniteQueryObserverResult; +type DefinedUseInfiniteQueryResult = DefinedInfiniteQueryObserverResult; +type UseSuspenseInfiniteQueryResult = OmitKeyof, 'isPlaceholderData' | 'promise'>; +type AnyUseMutationOptions = UseMutationOptions; +interface UseMutationOptions extends OmitKeyof, '_defaulted'> { +} +type UseMutateFunction = (...args: Parameters>) => void; +type UseMutateAsyncFunction = MutateFunction; +type UseBaseMutationResult = Override, { + mutate: UseMutateFunction; +}> & { + mutateAsync: UseMutateAsyncFunction; +}; +type UseMutationResult = UseBaseMutationResult; + +export type { AnyUseBaseQueryOptions, AnyUseInfiniteQueryOptions, AnyUseMutationOptions, AnyUseQueryOptions, AnyUseSuspenseInfiniteQueryOptions, AnyUseSuspenseQueryOptions, DefinedUseInfiniteQueryResult, DefinedUseQueryResult, UseBaseMutationResult, UseBaseQueryOptions, UseBaseQueryResult, UseInfiniteQueryOptions, UseInfiniteQueryResult, UseMutateAsyncFunction, UseMutateFunction, UseMutationOptions, UseMutationResult, UsePrefetchQueryOptions, UseQueryOptions, UseQueryResult, UseSuspenseInfiniteQueryOptions, UseSuspenseInfiniteQueryResult, UseSuspenseQueryOptions, UseSuspenseQueryResult }; diff --git a/node_modules/@tanstack/react-query/build/legacy/types.js b/node_modules/@tanstack/react-query/build/legacy/types.js new file mode 100644 index 0000000..5b2306a --- /dev/null +++ b/node_modules/@tanstack/react-query/build/legacy/types.js @@ -0,0 +1 @@ +//# sourceMappingURL=types.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/types.js.map b/node_modules/@tanstack/react-query/build/legacy/types.js.map new file mode 100644 index 0000000..84c51b2 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/legacy/types.js.map @@ -0,0 +1 @@ +{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/useBaseQuery.cjs b/node_modules/@tanstack/react-query/build/legacy/useBaseQuery.cjs new file mode 100644 index 0000000..a479f54 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/legacy/useBaseQuery.cjs @@ -0,0 +1,133 @@ +"use strict"; +"use client"; +var __create = Object.create; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __getProtoOf = Object.getPrototypeOf; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( + // If the importer is in node compatibility mode or this is not an ESM + // file that has been converted to a CommonJS file using a Babel- + // compatible transform (i.e. "__esModule" has not been set), then set + // "default" to the CommonJS "module.exports" for node compatibility. + isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, + mod +)); +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/useBaseQuery.ts +var useBaseQuery_exports = {}; +__export(useBaseQuery_exports, { + useBaseQuery: () => useBaseQuery +}); +module.exports = __toCommonJS(useBaseQuery_exports); +var React = __toESM(require("react"), 1); +var import_query_core = require("@tanstack/query-core"); +var import_QueryClientProvider = require("./QueryClientProvider.cjs"); +var import_QueryErrorResetBoundary = require("./QueryErrorResetBoundary.cjs"); +var import_errorBoundaryUtils = require("./errorBoundaryUtils.cjs"); +var import_IsRestoringProvider = require("./IsRestoringProvider.cjs"); +var import_suspense = require("./suspense.cjs"); +function useBaseQuery(options, Observer, queryClient) { + var _a, _b, _c, _d; + if (process.env.NODE_ENV !== "production") { + if (typeof options !== "object" || Array.isArray(options)) { + throw new Error( + 'Bad argument type. Starting with v5, only the "Object" form is allowed when calling query related functions. Please use the error stack to find the culprit call. More info here: https://tanstack.com/query/latest/docs/react/guides/migrating-to-v5#supports-a-single-signature-one-object' + ); + } + } + const isRestoring = (0, import_IsRestoringProvider.useIsRestoring)(); + const errorResetBoundary = (0, import_QueryErrorResetBoundary.useQueryErrorResetBoundary)(); + const client = (0, import_QueryClientProvider.useQueryClient)(queryClient); + const defaultedOptions = client.defaultQueryOptions(options); + (_b = (_a = client.getDefaultOptions().queries) == null ? void 0 : _a._experimental_beforeQuery) == null ? void 0 : _b.call( + _a, + defaultedOptions + ); + const query = client.getQueryCache().get(defaultedOptions.queryHash); + if (process.env.NODE_ENV !== "production") { + if (!defaultedOptions.queryFn) { + console.error( + `[${defaultedOptions.queryHash}]: No queryFn was passed as an option, and no default queryFn was found. The queryFn parameter is only optional when using a default queryFn. More info here: https://tanstack.com/query/latest/docs/framework/react/guides/default-query-function` + ); + } + } + defaultedOptions._optimisticResults = isRestoring ? "isRestoring" : "optimistic"; + (0, import_suspense.ensureSuspenseTimers)(defaultedOptions); + (0, import_errorBoundaryUtils.ensurePreventErrorBoundaryRetry)(defaultedOptions, errorResetBoundary, query); + (0, import_errorBoundaryUtils.useClearResetErrorBoundary)(errorResetBoundary); + const isNewCacheEntry = !client.getQueryCache().get(defaultedOptions.queryHash); + const [observer] = React.useState( + () => new Observer( + client, + defaultedOptions + ) + ); + const result = observer.getOptimisticResult(defaultedOptions); + const shouldSubscribe = !isRestoring && options.subscribed !== false; + React.useSyncExternalStore( + React.useCallback( + (onStoreChange) => { + const unsubscribe = shouldSubscribe ? observer.subscribe(import_query_core.notifyManager.batchCalls(onStoreChange)) : import_query_core.noop; + observer.updateResult(); + return unsubscribe; + }, + [observer, shouldSubscribe] + ), + () => observer.getCurrentResult(), + () => observer.getCurrentResult() + ); + React.useEffect(() => { + observer.setOptions(defaultedOptions); + }, [defaultedOptions, observer]); + if ((0, import_suspense.shouldSuspend)(defaultedOptions, result)) { + throw (0, import_suspense.fetchOptimistic)(defaultedOptions, observer, errorResetBoundary); + } + if ((0, import_errorBoundaryUtils.getHasError)({ + result, + errorResetBoundary, + throwOnError: defaultedOptions.throwOnError, + query, + suspense: defaultedOptions.suspense + })) { + throw result.error; + } + ; + (_d = (_c = client.getDefaultOptions().queries) == null ? void 0 : _c._experimental_afterQuery) == null ? void 0 : _d.call( + _c, + defaultedOptions, + result + ); + if (defaultedOptions.experimental_prefetchInRender && !import_query_core.isServer && (0, import_suspense.willFetch)(result, isRestoring)) { + const promise = isNewCacheEntry ? ( + // Fetch immediately on render in order to ensure `.promise` is resolved even if the component is unmounted + (0, import_suspense.fetchOptimistic)(defaultedOptions, observer, errorResetBoundary) + ) : ( + // subscribe to the "cache promise" so that we can finalize the currentThenable once data comes in + query == null ? void 0 : query.promise + ); + promise == null ? void 0 : promise.catch(import_query_core.noop).finally(() => { + observer.updateResult(); + }); + } + return !defaultedOptions.notifyOnChangeProps ? observer.trackResult(result) : result; +} +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + useBaseQuery +}); +//# sourceMappingURL=useBaseQuery.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/useBaseQuery.cjs.map b/node_modules/@tanstack/react-query/build/legacy/useBaseQuery.cjs.map new file mode 100644 index 0000000..6380c13 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/legacy/useBaseQuery.cjs.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/useBaseQuery.ts"],"sourcesContent":["'use client'\nimport * as React from 'react'\n\nimport { isServer, noop, notifyManager } from '@tanstack/query-core'\nimport { useQueryClient } from './QueryClientProvider'\nimport { useQueryErrorResetBoundary } from './QueryErrorResetBoundary'\nimport {\n ensurePreventErrorBoundaryRetry,\n getHasError,\n useClearResetErrorBoundary,\n} from './errorBoundaryUtils'\nimport { useIsRestoring } from './IsRestoringProvider'\nimport {\n ensureSuspenseTimers,\n fetchOptimistic,\n shouldSuspend,\n willFetch,\n} from './suspense'\nimport type {\n QueryClient,\n QueryKey,\n QueryObserver,\n QueryObserverResult,\n} from '@tanstack/query-core'\nimport type { UseBaseQueryOptions } from './types'\n\nexport function useBaseQuery<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey extends QueryKey,\n>(\n options: UseBaseQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >,\n Observer: typeof QueryObserver,\n queryClient?: QueryClient,\n): QueryObserverResult {\n if (process.env.NODE_ENV !== 'production') {\n if (typeof options !== 'object' || Array.isArray(options)) {\n throw new Error(\n 'Bad argument type. Starting with v5, only the \"Object\" form is allowed when calling query related functions. Please use the error stack to find the culprit call. More info here: https://tanstack.com/query/latest/docs/react/guides/migrating-to-v5#supports-a-single-signature-one-object',\n )\n }\n }\n\n const isRestoring = useIsRestoring()\n const errorResetBoundary = useQueryErrorResetBoundary()\n const client = useQueryClient(queryClient)\n const defaultedOptions = client.defaultQueryOptions(options)\n ;(client.getDefaultOptions().queries as any)?._experimental_beforeQuery?.(\n defaultedOptions,\n )\n\n const query = client\n .getQueryCache()\n .get<\n TQueryFnData,\n TError,\n TQueryData,\n TQueryKey\n >(defaultedOptions.queryHash)\n\n if (process.env.NODE_ENV !== 'production') {\n if (!defaultedOptions.queryFn) {\n console.error(\n `[${defaultedOptions.queryHash}]: No queryFn was passed as an option, and no default queryFn was found. The queryFn parameter is only optional when using a default queryFn. More info here: https://tanstack.com/query/latest/docs/framework/react/guides/default-query-function`,\n )\n }\n }\n\n // Make sure results are optimistically set in fetching state before subscribing or updating options\n defaultedOptions._optimisticResults = isRestoring\n ? 'isRestoring'\n : 'optimistic'\n\n ensureSuspenseTimers(defaultedOptions)\n ensurePreventErrorBoundaryRetry(defaultedOptions, errorResetBoundary, query)\n useClearResetErrorBoundary(errorResetBoundary)\n\n // this needs to be invoked before creating the Observer because that can create a cache entry\n const isNewCacheEntry = !client\n .getQueryCache()\n .get(defaultedOptions.queryHash)\n\n const [observer] = React.useState(\n () =>\n new Observer(\n client,\n defaultedOptions,\n ),\n )\n\n // note: this must be called before useSyncExternalStore\n const result = observer.getOptimisticResult(defaultedOptions)\n\n const shouldSubscribe = !isRestoring && options.subscribed !== false\n React.useSyncExternalStore(\n React.useCallback(\n (onStoreChange) => {\n const unsubscribe = shouldSubscribe\n ? observer.subscribe(notifyManager.batchCalls(onStoreChange))\n : noop\n\n // Update result to make sure we did not miss any query updates\n // between creating the observer and subscribing to it.\n observer.updateResult()\n\n return unsubscribe\n },\n [observer, shouldSubscribe],\n ),\n () => observer.getCurrentResult(),\n () => observer.getCurrentResult(),\n )\n\n React.useEffect(() => {\n observer.setOptions(defaultedOptions)\n }, [defaultedOptions, observer])\n\n // Handle suspense\n if (shouldSuspend(defaultedOptions, result)) {\n throw fetchOptimistic(defaultedOptions, observer, errorResetBoundary)\n }\n\n // Handle error boundary\n if (\n getHasError({\n result,\n errorResetBoundary,\n throwOnError: defaultedOptions.throwOnError,\n query,\n suspense: defaultedOptions.suspense,\n })\n ) {\n throw result.error\n }\n\n ;(client.getDefaultOptions().queries as any)?._experimental_afterQuery?.(\n defaultedOptions,\n result,\n )\n\n if (\n defaultedOptions.experimental_prefetchInRender &&\n !isServer &&\n willFetch(result, isRestoring)\n ) {\n const promise = isNewCacheEntry\n ? // Fetch immediately on render in order to ensure `.promise` is resolved even if the component is unmounted\n fetchOptimistic(defaultedOptions, observer, errorResetBoundary)\n : // subscribe to the \"cache promise\" so that we can finalize the currentThenable once data comes in\n query?.promise\n\n promise?.catch(noop).finally(() => {\n // `.updateResult()` will trigger `.#currentThenable` to finalize\n observer.updateResult()\n })\n }\n\n // Handle result property usage tracking\n return !defaultedOptions.notifyOnChangeProps\n ? observer.trackResult(result)\n : result\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,YAAuB;AAEvB,wBAA8C;AAC9C,iCAA+B;AAC/B,qCAA2C;AAC3C,gCAIO;AACP,iCAA+B;AAC/B,sBAKO;AASA,SAAS,aAOd,SAOA,UACA,aACoC;AA1CtC;AA2CE,MAAI,QAAQ,IAAI,aAAa,cAAc;AACzC,QAAI,OAAO,YAAY,YAAY,MAAM,QAAQ,OAAO,GAAG;AACzD,YAAM,IAAI;AAAA,QACR;AAAA,MACF;AAAA,IACF;AAAA,EACF;AAEA,QAAM,kBAAc,2CAAe;AACnC,QAAM,yBAAqB,2DAA2B;AACtD,QAAM,aAAS,2CAAe,WAAW;AACzC,QAAM,mBAAmB,OAAO,oBAAoB,OAAO;AAC1D,GAAC,kBAAO,kBAAkB,EAAE,YAA3B,mBAA4C,8BAA5C;AAAA;AAAA,IACA;AAAA;AAGF,QAAM,QAAQ,OACX,cAAc,EACd,IAKC,iBAAiB,SAAS;AAE9B,MAAI,QAAQ,IAAI,aAAa,cAAc;AACzC,QAAI,CAAC,iBAAiB,SAAS;AAC7B,cAAQ;AAAA,QACN,IAAI,iBAAiB,SAAS;AAAA,MAChC;AAAA,IACF;AAAA,EACF;AAGA,mBAAiB,qBAAqB,cAClC,gBACA;AAEJ,4CAAqB,gBAAgB;AACrC,iEAAgC,kBAAkB,oBAAoB,KAAK;AAC3E,4DAA2B,kBAAkB;AAG7C,QAAM,kBAAkB,CAAC,OACtB,cAAc,EACd,IAAI,iBAAiB,SAAS;AAEjC,QAAM,CAAC,QAAQ,IAAU;AAAA,IACvB,MACE,IAAI;AAAA,MACF;AAAA,MACA;AAAA,IACF;AAAA,EACJ;AAGA,QAAM,SAAS,SAAS,oBAAoB,gBAAgB;AAE5D,QAAM,kBAAkB,CAAC,eAAe,QAAQ,eAAe;AAC/D,EAAM;AAAA,IACE;AAAA,MACJ,CAAC,kBAAkB;AACjB,cAAM,cAAc,kBAChB,SAAS,UAAU,gCAAc,WAAW,aAAa,CAAC,IAC1D;AAIJ,iBAAS,aAAa;AAEtB,eAAO;AAAA,MACT;AAAA,MACA,CAAC,UAAU,eAAe;AAAA,IAC5B;AAAA,IACA,MAAM,SAAS,iBAAiB;AAAA,IAChC,MAAM,SAAS,iBAAiB;AAAA,EAClC;AAEA,EAAM,gBAAU,MAAM;AACpB,aAAS,WAAW,gBAAgB;AAAA,EACtC,GAAG,CAAC,kBAAkB,QAAQ,CAAC;AAG/B,UAAI,+BAAc,kBAAkB,MAAM,GAAG;AAC3C,cAAM,iCAAgB,kBAAkB,UAAU,kBAAkB;AAAA,EACtE;AAGA,UACE,uCAAY;AAAA,IACV;AAAA,IACA;AAAA,IACA,cAAc,iBAAiB;AAAA,IAC/B;AAAA,IACA,UAAU,iBAAiB;AAAA,EAC7B,CAAC,GACD;AACA,UAAM,OAAO;AAAA,EACf;AAEA;AAAC,GAAC,kBAAO,kBAAkB,EAAE,YAA3B,mBAA4C,6BAA5C;AAAA;AAAA,IACA;AAAA,IACA;AAAA;AAGF,MACE,iBAAiB,iCACjB,CAAC,kCACD,2BAAU,QAAQ,WAAW,GAC7B;AACA,UAAM,UAAU;AAAA;AAAA,UAEZ,iCAAgB,kBAAkB,UAAU,kBAAkB;AAAA;AAAA;AAAA,MAE9D,+BAAO;AAAA;AAEX,uCAAS,MAAM,wBAAM,QAAQ,MAAM;AAEjC,eAAS,aAAa;AAAA,IACxB;AAAA,EACF;AAGA,SAAO,CAAC,iBAAiB,sBACrB,SAAS,YAAY,MAAM,IAC3B;AACN;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/useBaseQuery.d.cts b/node_modules/@tanstack/react-query/build/legacy/useBaseQuery.d.cts new file mode 100644 index 0000000..baa8469 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/legacy/useBaseQuery.d.cts @@ -0,0 +1,6 @@ +import { QueryKey, QueryObserver, QueryClient, QueryObserverResult } from '@tanstack/query-core'; +import { UseBaseQueryOptions } from './types.cjs'; + +declare function useBaseQuery(options: UseBaseQueryOptions, Observer: typeof QueryObserver, queryClient?: QueryClient): QueryObserverResult; + +export { useBaseQuery }; diff --git a/node_modules/@tanstack/react-query/build/legacy/useBaseQuery.d.ts b/node_modules/@tanstack/react-query/build/legacy/useBaseQuery.d.ts new file mode 100644 index 0000000..60430b0 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/legacy/useBaseQuery.d.ts @@ -0,0 +1,6 @@ +import { QueryKey, QueryObserver, QueryClient, QueryObserverResult } from '@tanstack/query-core'; +import { UseBaseQueryOptions } from './types.js'; + +declare function useBaseQuery(options: UseBaseQueryOptions, Observer: typeof QueryObserver, queryClient?: QueryClient): QueryObserverResult; + +export { useBaseQuery }; diff --git a/node_modules/@tanstack/react-query/build/legacy/useBaseQuery.js b/node_modules/@tanstack/react-query/build/legacy/useBaseQuery.js new file mode 100644 index 0000000..d5c322c --- /dev/null +++ b/node_modules/@tanstack/react-query/build/legacy/useBaseQuery.js @@ -0,0 +1,108 @@ +"use client"; + +// src/useBaseQuery.ts +import * as React from "react"; +import { isServer, noop, notifyManager } from "@tanstack/query-core"; +import { useQueryClient } from "./QueryClientProvider.js"; +import { useQueryErrorResetBoundary } from "./QueryErrorResetBoundary.js"; +import { + ensurePreventErrorBoundaryRetry, + getHasError, + useClearResetErrorBoundary +} from "./errorBoundaryUtils.js"; +import { useIsRestoring } from "./IsRestoringProvider.js"; +import { + ensureSuspenseTimers, + fetchOptimistic, + shouldSuspend, + willFetch +} from "./suspense.js"; +function useBaseQuery(options, Observer, queryClient) { + var _a, _b, _c, _d; + if (process.env.NODE_ENV !== "production") { + if (typeof options !== "object" || Array.isArray(options)) { + throw new Error( + 'Bad argument type. Starting with v5, only the "Object" form is allowed when calling query related functions. Please use the error stack to find the culprit call. More info here: https://tanstack.com/query/latest/docs/react/guides/migrating-to-v5#supports-a-single-signature-one-object' + ); + } + } + const isRestoring = useIsRestoring(); + const errorResetBoundary = useQueryErrorResetBoundary(); + const client = useQueryClient(queryClient); + const defaultedOptions = client.defaultQueryOptions(options); + (_b = (_a = client.getDefaultOptions().queries) == null ? void 0 : _a._experimental_beforeQuery) == null ? void 0 : _b.call( + _a, + defaultedOptions + ); + const query = client.getQueryCache().get(defaultedOptions.queryHash); + if (process.env.NODE_ENV !== "production") { + if (!defaultedOptions.queryFn) { + console.error( + `[${defaultedOptions.queryHash}]: No queryFn was passed as an option, and no default queryFn was found. The queryFn parameter is only optional when using a default queryFn. More info here: https://tanstack.com/query/latest/docs/framework/react/guides/default-query-function` + ); + } + } + defaultedOptions._optimisticResults = isRestoring ? "isRestoring" : "optimistic"; + ensureSuspenseTimers(defaultedOptions); + ensurePreventErrorBoundaryRetry(defaultedOptions, errorResetBoundary, query); + useClearResetErrorBoundary(errorResetBoundary); + const isNewCacheEntry = !client.getQueryCache().get(defaultedOptions.queryHash); + const [observer] = React.useState( + () => new Observer( + client, + defaultedOptions + ) + ); + const result = observer.getOptimisticResult(defaultedOptions); + const shouldSubscribe = !isRestoring && options.subscribed !== false; + React.useSyncExternalStore( + React.useCallback( + (onStoreChange) => { + const unsubscribe = shouldSubscribe ? observer.subscribe(notifyManager.batchCalls(onStoreChange)) : noop; + observer.updateResult(); + return unsubscribe; + }, + [observer, shouldSubscribe] + ), + () => observer.getCurrentResult(), + () => observer.getCurrentResult() + ); + React.useEffect(() => { + observer.setOptions(defaultedOptions); + }, [defaultedOptions, observer]); + if (shouldSuspend(defaultedOptions, result)) { + throw fetchOptimistic(defaultedOptions, observer, errorResetBoundary); + } + if (getHasError({ + result, + errorResetBoundary, + throwOnError: defaultedOptions.throwOnError, + query, + suspense: defaultedOptions.suspense + })) { + throw result.error; + } + ; + (_d = (_c = client.getDefaultOptions().queries) == null ? void 0 : _c._experimental_afterQuery) == null ? void 0 : _d.call( + _c, + defaultedOptions, + result + ); + if (defaultedOptions.experimental_prefetchInRender && !isServer && willFetch(result, isRestoring)) { + const promise = isNewCacheEntry ? ( + // Fetch immediately on render in order to ensure `.promise` is resolved even if the component is unmounted + fetchOptimistic(defaultedOptions, observer, errorResetBoundary) + ) : ( + // subscribe to the "cache promise" so that we can finalize the currentThenable once data comes in + query == null ? void 0 : query.promise + ); + promise == null ? void 0 : promise.catch(noop).finally(() => { + observer.updateResult(); + }); + } + return !defaultedOptions.notifyOnChangeProps ? observer.trackResult(result) : result; +} +export { + useBaseQuery +}; +//# sourceMappingURL=useBaseQuery.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/useBaseQuery.js.map b/node_modules/@tanstack/react-query/build/legacy/useBaseQuery.js.map new file mode 100644 index 0000000..cd85130 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/legacy/useBaseQuery.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/useBaseQuery.ts"],"sourcesContent":["'use client'\nimport * as React from 'react'\n\nimport { isServer, noop, notifyManager } from '@tanstack/query-core'\nimport { useQueryClient } from './QueryClientProvider'\nimport { useQueryErrorResetBoundary } from './QueryErrorResetBoundary'\nimport {\n ensurePreventErrorBoundaryRetry,\n getHasError,\n useClearResetErrorBoundary,\n} from './errorBoundaryUtils'\nimport { useIsRestoring } from './IsRestoringProvider'\nimport {\n ensureSuspenseTimers,\n fetchOptimistic,\n shouldSuspend,\n willFetch,\n} from './suspense'\nimport type {\n QueryClient,\n QueryKey,\n QueryObserver,\n QueryObserverResult,\n} from '@tanstack/query-core'\nimport type { UseBaseQueryOptions } from './types'\n\nexport function useBaseQuery<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey extends QueryKey,\n>(\n options: UseBaseQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >,\n Observer: typeof QueryObserver,\n queryClient?: QueryClient,\n): QueryObserverResult {\n if (process.env.NODE_ENV !== 'production') {\n if (typeof options !== 'object' || Array.isArray(options)) {\n throw new Error(\n 'Bad argument type. Starting with v5, only the \"Object\" form is allowed when calling query related functions. Please use the error stack to find the culprit call. More info here: https://tanstack.com/query/latest/docs/react/guides/migrating-to-v5#supports-a-single-signature-one-object',\n )\n }\n }\n\n const isRestoring = useIsRestoring()\n const errorResetBoundary = useQueryErrorResetBoundary()\n const client = useQueryClient(queryClient)\n const defaultedOptions = client.defaultQueryOptions(options)\n ;(client.getDefaultOptions().queries as any)?._experimental_beforeQuery?.(\n defaultedOptions,\n )\n\n const query = client\n .getQueryCache()\n .get<\n TQueryFnData,\n TError,\n TQueryData,\n TQueryKey\n >(defaultedOptions.queryHash)\n\n if (process.env.NODE_ENV !== 'production') {\n if (!defaultedOptions.queryFn) {\n console.error(\n `[${defaultedOptions.queryHash}]: No queryFn was passed as an option, and no default queryFn was found. The queryFn parameter is only optional when using a default queryFn. More info here: https://tanstack.com/query/latest/docs/framework/react/guides/default-query-function`,\n )\n }\n }\n\n // Make sure results are optimistically set in fetching state before subscribing or updating options\n defaultedOptions._optimisticResults = isRestoring\n ? 'isRestoring'\n : 'optimistic'\n\n ensureSuspenseTimers(defaultedOptions)\n ensurePreventErrorBoundaryRetry(defaultedOptions, errorResetBoundary, query)\n useClearResetErrorBoundary(errorResetBoundary)\n\n // this needs to be invoked before creating the Observer because that can create a cache entry\n const isNewCacheEntry = !client\n .getQueryCache()\n .get(defaultedOptions.queryHash)\n\n const [observer] = React.useState(\n () =>\n new Observer(\n client,\n defaultedOptions,\n ),\n )\n\n // note: this must be called before useSyncExternalStore\n const result = observer.getOptimisticResult(defaultedOptions)\n\n const shouldSubscribe = !isRestoring && options.subscribed !== false\n React.useSyncExternalStore(\n React.useCallback(\n (onStoreChange) => {\n const unsubscribe = shouldSubscribe\n ? observer.subscribe(notifyManager.batchCalls(onStoreChange))\n : noop\n\n // Update result to make sure we did not miss any query updates\n // between creating the observer and subscribing to it.\n observer.updateResult()\n\n return unsubscribe\n },\n [observer, shouldSubscribe],\n ),\n () => observer.getCurrentResult(),\n () => observer.getCurrentResult(),\n )\n\n React.useEffect(() => {\n observer.setOptions(defaultedOptions)\n }, [defaultedOptions, observer])\n\n // Handle suspense\n if (shouldSuspend(defaultedOptions, result)) {\n throw fetchOptimistic(defaultedOptions, observer, errorResetBoundary)\n }\n\n // Handle error boundary\n if (\n getHasError({\n result,\n errorResetBoundary,\n throwOnError: defaultedOptions.throwOnError,\n query,\n suspense: defaultedOptions.suspense,\n })\n ) {\n throw result.error\n }\n\n ;(client.getDefaultOptions().queries as any)?._experimental_afterQuery?.(\n defaultedOptions,\n result,\n )\n\n if (\n defaultedOptions.experimental_prefetchInRender &&\n !isServer &&\n willFetch(result, isRestoring)\n ) {\n const promise = isNewCacheEntry\n ? // Fetch immediately on render in order to ensure `.promise` is resolved even if the component is unmounted\n fetchOptimistic(defaultedOptions, observer, errorResetBoundary)\n : // subscribe to the \"cache promise\" so that we can finalize the currentThenable once data comes in\n query?.promise\n\n promise?.catch(noop).finally(() => {\n // `.updateResult()` will trigger `.#currentThenable` to finalize\n observer.updateResult()\n })\n }\n\n // Handle result property usage tracking\n return !defaultedOptions.notifyOnChangeProps\n ? observer.trackResult(result)\n : result\n}\n"],"mappings":";;;AACA,YAAY,WAAW;AAEvB,SAAS,UAAU,MAAM,qBAAqB;AAC9C,SAAS,sBAAsB;AAC/B,SAAS,kCAAkC;AAC3C;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,sBAAsB;AAC/B;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AASA,SAAS,aAOd,SAOA,UACA,aACoC;AA1CtC;AA2CE,MAAI,QAAQ,IAAI,aAAa,cAAc;AACzC,QAAI,OAAO,YAAY,YAAY,MAAM,QAAQ,OAAO,GAAG;AACzD,YAAM,IAAI;AAAA,QACR;AAAA,MACF;AAAA,IACF;AAAA,EACF;AAEA,QAAM,cAAc,eAAe;AACnC,QAAM,qBAAqB,2BAA2B;AACtD,QAAM,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;AAAA,IACA,cAAc,iBAAiB;AAAA,IAC/B;AAAA,IACA,UAAU,iBAAiB;AAAA,EAC7B,CAAC,GACD;AACA,UAAM,OAAO;AAAA,EACf;AAEA;AAAC,GAAC,kBAAO,kBAAkB,EAAE,YAA3B,mBAA4C,6BAA5C;AAAA;AAAA,IACA;AAAA,IACA;AAAA;AAGF,MACE,iBAAiB,iCACjB,CAAC,YACD,UAAU,QAAQ,WAAW,GAC7B;AACA,UAAM,UAAU;AAAA;AAAA,MAEZ,gBAAgB,kBAAkB,UAAU,kBAAkB;AAAA;AAAA;AAAA,MAE9D,+BAAO;AAAA;AAEX,uCAAS,MAAM,MAAM,QAAQ,MAAM;AAEjC,eAAS,aAAa;AAAA,IACxB;AAAA,EACF;AAGA,SAAO,CAAC,iBAAiB,sBACrB,SAAS,YAAY,MAAM,IAC3B;AACN;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/useInfiniteQuery.cjs b/node_modules/@tanstack/react-query/build/legacy/useInfiniteQuery.cjs new file mode 100644 index 0000000..e1ae216 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/legacy/useInfiniteQuery.cjs @@ -0,0 +1,40 @@ +"use strict"; +"use client"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/useInfiniteQuery.ts +var useInfiniteQuery_exports = {}; +__export(useInfiniteQuery_exports, { + useInfiniteQuery: () => useInfiniteQuery +}); +module.exports = __toCommonJS(useInfiniteQuery_exports); +var import_query_core = require("@tanstack/query-core"); +var import_useBaseQuery = require("./useBaseQuery.cjs"); +function useInfiniteQuery(options, queryClient) { + return (0, import_useBaseQuery.useBaseQuery)( + options, + import_query_core.InfiniteQueryObserver, + queryClient + ); +} +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + useInfiniteQuery +}); +//# sourceMappingURL=useInfiniteQuery.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/useInfiniteQuery.cjs.map b/node_modules/@tanstack/react-query/build/legacy/useInfiniteQuery.cjs.map new file mode 100644 index 0000000..66c4cc1 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/legacy/useInfiniteQuery.cjs.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/useInfiniteQuery.ts"],"sourcesContent":["'use client'\nimport { InfiniteQueryObserver } from '@tanstack/query-core'\nimport { useBaseQuery } from './useBaseQuery'\nimport type {\n DefaultError,\n InfiniteData,\n QueryClient,\n QueryKey,\n QueryObserver,\n} from '@tanstack/query-core'\nimport type {\n DefinedUseInfiniteQueryResult,\n UseInfiniteQueryOptions,\n UseInfiniteQueryResult,\n} from './types'\nimport type {\n DefinedInitialDataInfiniteOptions,\n UndefinedInitialDataInfiniteOptions,\n} from './infiniteQueryOptions'\n\nexport function useInfiniteQuery<\n TQueryFnData,\n TError = DefaultError,\n TData = InfiniteData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n>(\n options: DefinedInitialDataInfiniteOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n queryClient?: QueryClient,\n): DefinedUseInfiniteQueryResult\n\nexport function useInfiniteQuery<\n TQueryFnData,\n TError = DefaultError,\n TData = InfiniteData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n>(\n options: UndefinedInitialDataInfiniteOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n queryClient?: QueryClient,\n): UseInfiniteQueryResult\n\nexport function useInfiniteQuery<\n TQueryFnData,\n TError = DefaultError,\n TData = InfiniteData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n>(\n options: UseInfiniteQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n queryClient?: QueryClient,\n): UseInfiniteQueryResult\n\nexport function useInfiniteQuery(\n options: UseInfiniteQueryOptions,\n queryClient?: QueryClient,\n) {\n return useBaseQuery(\n options,\n InfiniteQueryObserver as typeof QueryObserver,\n queryClient,\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,wBAAsC;AACtC,0BAA6B;AAqEtB,SAAS,iBACd,SACA,aACA;AACA,aAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/useInfiniteQuery.d.cts b/node_modules/@tanstack/react-query/build/legacy/useInfiniteQuery.d.cts new file mode 100644 index 0000000..8401170 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/legacy/useInfiniteQuery.d.cts @@ -0,0 +1,9 @@ +import { DefaultError, InfiniteData, QueryKey, QueryClient } from '@tanstack/query-core'; +import { DefinedUseInfiniteQueryResult, UseInfiniteQueryResult, UseInfiniteQueryOptions } from './types.cjs'; +import { DefinedInitialDataInfiniteOptions, UndefinedInitialDataInfiniteOptions } from './infiniteQueryOptions.cjs'; + +declare function useInfiniteQuery, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown>(options: DefinedInitialDataInfiniteOptions, queryClient?: QueryClient): DefinedUseInfiniteQueryResult; +declare function useInfiniteQuery, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown>(options: UndefinedInitialDataInfiniteOptions, queryClient?: QueryClient): UseInfiniteQueryResult; +declare function useInfiniteQuery, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown>(options: UseInfiniteQueryOptions, queryClient?: QueryClient): UseInfiniteQueryResult; + +export { useInfiniteQuery }; diff --git a/node_modules/@tanstack/react-query/build/legacy/useInfiniteQuery.d.ts b/node_modules/@tanstack/react-query/build/legacy/useInfiniteQuery.d.ts new file mode 100644 index 0000000..47bb383 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/legacy/useInfiniteQuery.d.ts @@ -0,0 +1,9 @@ +import { DefaultError, InfiniteData, QueryKey, QueryClient } from '@tanstack/query-core'; +import { DefinedUseInfiniteQueryResult, UseInfiniteQueryResult, UseInfiniteQueryOptions } from './types.js'; +import { DefinedInitialDataInfiniteOptions, UndefinedInitialDataInfiniteOptions } from './infiniteQueryOptions.js'; + +declare function useInfiniteQuery, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown>(options: DefinedInitialDataInfiniteOptions, queryClient?: QueryClient): DefinedUseInfiniteQueryResult; +declare function useInfiniteQuery, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown>(options: UndefinedInitialDataInfiniteOptions, queryClient?: QueryClient): UseInfiniteQueryResult; +declare function useInfiniteQuery, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown>(options: UseInfiniteQueryOptions, queryClient?: QueryClient): UseInfiniteQueryResult; + +export { useInfiniteQuery }; diff --git a/node_modules/@tanstack/react-query/build/legacy/useInfiniteQuery.js b/node_modules/@tanstack/react-query/build/legacy/useInfiniteQuery.js new file mode 100644 index 0000000..2e32e08 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/legacy/useInfiniteQuery.js @@ -0,0 +1,16 @@ +"use client"; + +// src/useInfiniteQuery.ts +import { InfiniteQueryObserver } from "@tanstack/query-core"; +import { useBaseQuery } from "./useBaseQuery.js"; +function useInfiniteQuery(options, queryClient) { + return useBaseQuery( + options, + InfiniteQueryObserver, + queryClient + ); +} +export { + useInfiniteQuery +}; +//# sourceMappingURL=useInfiniteQuery.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/useInfiniteQuery.js.map b/node_modules/@tanstack/react-query/build/legacy/useInfiniteQuery.js.map new file mode 100644 index 0000000..4b2fbe4 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/legacy/useInfiniteQuery.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/useInfiniteQuery.ts"],"sourcesContent":["'use client'\nimport { InfiniteQueryObserver } from '@tanstack/query-core'\nimport { useBaseQuery } from './useBaseQuery'\nimport type {\n DefaultError,\n InfiniteData,\n QueryClient,\n QueryKey,\n QueryObserver,\n} from '@tanstack/query-core'\nimport type {\n DefinedUseInfiniteQueryResult,\n UseInfiniteQueryOptions,\n UseInfiniteQueryResult,\n} from './types'\nimport type {\n DefinedInitialDataInfiniteOptions,\n UndefinedInitialDataInfiniteOptions,\n} from './infiniteQueryOptions'\n\nexport function useInfiniteQuery<\n TQueryFnData,\n TError = DefaultError,\n TData = InfiniteData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n>(\n options: DefinedInitialDataInfiniteOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n queryClient?: QueryClient,\n): DefinedUseInfiniteQueryResult\n\nexport function useInfiniteQuery<\n TQueryFnData,\n TError = DefaultError,\n TData = InfiniteData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n>(\n options: UndefinedInitialDataInfiniteOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n queryClient?: QueryClient,\n): UseInfiniteQueryResult\n\nexport function useInfiniteQuery<\n TQueryFnData,\n TError = DefaultError,\n TData = InfiniteData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n>(\n options: UseInfiniteQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n queryClient?: QueryClient,\n): UseInfiniteQueryResult\n\nexport function useInfiniteQuery(\n options: UseInfiniteQueryOptions,\n queryClient?: QueryClient,\n) {\n return useBaseQuery(\n options,\n InfiniteQueryObserver as typeof QueryObserver,\n queryClient,\n )\n}\n"],"mappings":";;;AACA,SAAS,6BAA6B;AACtC,SAAS,oBAAoB;AAqEtB,SAAS,iBACd,SACA,aACA;AACA,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/useIsFetching.cjs b/node_modules/@tanstack/react-query/build/legacy/useIsFetching.cjs new file mode 100644 index 0000000..28660e7 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/legacy/useIsFetching.cjs @@ -0,0 +1,56 @@ +"use strict"; +"use client"; +var __create = Object.create; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __getProtoOf = Object.getPrototypeOf; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( + // If the importer is in node compatibility mode or this is not an ESM + // file that has been converted to a CommonJS file using a Babel- + // compatible transform (i.e. "__esModule" has not been set), then set + // "default" to the CommonJS "module.exports" for node compatibility. + isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, + mod +)); +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/useIsFetching.ts +var useIsFetching_exports = {}; +__export(useIsFetching_exports, { + useIsFetching: () => useIsFetching +}); +module.exports = __toCommonJS(useIsFetching_exports); +var React = __toESM(require("react"), 1); +var import_query_core = require("@tanstack/query-core"); +var import_QueryClientProvider = require("./QueryClientProvider.cjs"); +function useIsFetching(filters, queryClient) { + const client = (0, import_QueryClientProvider.useQueryClient)(queryClient); + const queryCache = client.getQueryCache(); + return React.useSyncExternalStore( + React.useCallback( + (onStoreChange) => queryCache.subscribe(import_query_core.notifyManager.batchCalls(onStoreChange)), + [queryCache] + ), + () => client.isFetching(filters), + () => client.isFetching(filters) + ); +} +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + useIsFetching +}); +//# sourceMappingURL=useIsFetching.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/useIsFetching.cjs.map b/node_modules/@tanstack/react-query/build/legacy/useIsFetching.cjs.map new file mode 100644 index 0000000..5a58e86 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/legacy/useIsFetching.cjs.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/useIsFetching.ts"],"sourcesContent":["'use client'\nimport * as React from 'react'\nimport { notifyManager } from '@tanstack/query-core'\n\nimport { useQueryClient } from './QueryClientProvider'\nimport type { QueryClient, QueryFilters } from '@tanstack/query-core'\n\nexport function useIsFetching(\n filters?: QueryFilters,\n queryClient?: QueryClient,\n): number {\n const client = useQueryClient(queryClient)\n const queryCache = client.getQueryCache()\n\n return React.useSyncExternalStore(\n React.useCallback(\n (onStoreChange) =>\n queryCache.subscribe(notifyManager.batchCalls(onStoreChange)),\n [queryCache],\n ),\n () => client.isFetching(filters),\n () => client.isFetching(filters),\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,YAAuB;AACvB,wBAA8B;AAE9B,iCAA+B;AAGxB,SAAS,cACd,SACA,aACQ;AACR,QAAM,aAAS,2CAAe,WAAW;AACzC,QAAM,aAAa,OAAO,cAAc;AAExC,SAAa;AAAA,IACL;AAAA,MACJ,CAAC,kBACC,WAAW,UAAU,gCAAc,WAAW,aAAa,CAAC;AAAA,MAC9D,CAAC,UAAU;AAAA,IACb;AAAA,IACA,MAAM,OAAO,WAAW,OAAO;AAAA,IAC/B,MAAM,OAAO,WAAW,OAAO;AAAA,EACjC;AACF;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/useIsFetching.d.cts b/node_modules/@tanstack/react-query/build/legacy/useIsFetching.d.cts new file mode 100644 index 0000000..832d33f --- /dev/null +++ b/node_modules/@tanstack/react-query/build/legacy/useIsFetching.d.cts @@ -0,0 +1,5 @@ +import { QueryFilters, QueryClient } from '@tanstack/query-core'; + +declare function useIsFetching(filters?: QueryFilters, queryClient?: QueryClient): number; + +export { useIsFetching }; diff --git a/node_modules/@tanstack/react-query/build/legacy/useIsFetching.d.ts b/node_modules/@tanstack/react-query/build/legacy/useIsFetching.d.ts new file mode 100644 index 0000000..832d33f --- /dev/null +++ b/node_modules/@tanstack/react-query/build/legacy/useIsFetching.d.ts @@ -0,0 +1,5 @@ +import { QueryFilters, QueryClient } from '@tanstack/query-core'; + +declare function useIsFetching(filters?: QueryFilters, queryClient?: QueryClient): number; + +export { useIsFetching }; diff --git a/node_modules/@tanstack/react-query/build/legacy/useIsFetching.js b/node_modules/@tanstack/react-query/build/legacy/useIsFetching.js new file mode 100644 index 0000000..acfc67a --- /dev/null +++ b/node_modules/@tanstack/react-query/build/legacy/useIsFetching.js @@ -0,0 +1,22 @@ +"use client"; + +// src/useIsFetching.ts +import * as React from "react"; +import { notifyManager } from "@tanstack/query-core"; +import { useQueryClient } from "./QueryClientProvider.js"; +function useIsFetching(filters, queryClient) { + const client = useQueryClient(queryClient); + const queryCache = client.getQueryCache(); + return React.useSyncExternalStore( + React.useCallback( + (onStoreChange) => queryCache.subscribe(notifyManager.batchCalls(onStoreChange)), + [queryCache] + ), + () => client.isFetching(filters), + () => client.isFetching(filters) + ); +} +export { + useIsFetching +}; +//# sourceMappingURL=useIsFetching.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/useIsFetching.js.map b/node_modules/@tanstack/react-query/build/legacy/useIsFetching.js.map new file mode 100644 index 0000000..9921ab6 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/legacy/useIsFetching.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/useIsFetching.ts"],"sourcesContent":["'use client'\nimport * as React from 'react'\nimport { notifyManager } from '@tanstack/query-core'\n\nimport { useQueryClient } from './QueryClientProvider'\nimport type { QueryClient, QueryFilters } from '@tanstack/query-core'\n\nexport function useIsFetching(\n filters?: QueryFilters,\n queryClient?: QueryClient,\n): number {\n const client = useQueryClient(queryClient)\n const queryCache = client.getQueryCache()\n\n return React.useSyncExternalStore(\n React.useCallback(\n (onStoreChange) =>\n queryCache.subscribe(notifyManager.batchCalls(onStoreChange)),\n [queryCache],\n ),\n () => client.isFetching(filters),\n () => client.isFetching(filters),\n )\n}\n"],"mappings":";;;AACA,YAAY,WAAW;AACvB,SAAS,qBAAqB;AAE9B,SAAS,sBAAsB;AAGxB,SAAS,cACd,SACA,aACQ;AACR,QAAM,SAAS,eAAe,WAAW;AACzC,QAAM,aAAa,OAAO,cAAc;AAExC,SAAa;AAAA,IACL;AAAA,MACJ,CAAC,kBACC,WAAW,UAAU,cAAc,WAAW,aAAa,CAAC;AAAA,MAC9D,CAAC,UAAU;AAAA,IACb;AAAA,IACA,MAAM,OAAO,WAAW,OAAO;AAAA,IAC/B,MAAM,OAAO,WAAW,OAAO;AAAA,EACjC;AACF;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/useMutation.cjs b/node_modules/@tanstack/react-query/build/legacy/useMutation.cjs new file mode 100644 index 0000000..2ae4221 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/legacy/useMutation.cjs @@ -0,0 +1,74 @@ +"use strict"; +"use client"; +var __create = Object.create; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __getProtoOf = Object.getPrototypeOf; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( + // If the importer is in node compatibility mode or this is not an ESM + // file that has been converted to a CommonJS file using a Babel- + // compatible transform (i.e. "__esModule" has not been set), then set + // "default" to the CommonJS "module.exports" for node compatibility. + isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, + mod +)); +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/useMutation.ts +var useMutation_exports = {}; +__export(useMutation_exports, { + useMutation: () => useMutation +}); +module.exports = __toCommonJS(useMutation_exports); +var React = __toESM(require("react"), 1); +var import_query_core = require("@tanstack/query-core"); +var import_QueryClientProvider = require("./QueryClientProvider.cjs"); +function useMutation(options, queryClient) { + const client = (0, import_QueryClientProvider.useQueryClient)(queryClient); + const [observer] = React.useState( + () => new import_query_core.MutationObserver( + client, + options + ) + ); + React.useEffect(() => { + observer.setOptions(options); + }, [observer, options]); + const result = React.useSyncExternalStore( + React.useCallback( + (onStoreChange) => observer.subscribe(import_query_core.notifyManager.batchCalls(onStoreChange)), + [observer] + ), + () => observer.getCurrentResult(), + () => observer.getCurrentResult() + ); + const mutate = React.useCallback( + (variables, mutateOptions) => { + observer.mutate(variables, mutateOptions).catch(import_query_core.noop); + }, + [observer] + ); + if (result.error && (0, import_query_core.shouldThrowError)(observer.options.throwOnError, [result.error])) { + throw result.error; + } + return { ...result, mutate, mutateAsync: result.mutate }; +} +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + useMutation +}); +//# sourceMappingURL=useMutation.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/useMutation.cjs.map b/node_modules/@tanstack/react-query/build/legacy/useMutation.cjs.map new file mode 100644 index 0000000..23c4d2e --- /dev/null +++ b/node_modules/@tanstack/react-query/build/legacy/useMutation.cjs.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/useMutation.ts"],"sourcesContent":["'use client'\nimport * as React from 'react'\nimport {\n MutationObserver,\n noop,\n notifyManager,\n shouldThrowError,\n} from '@tanstack/query-core'\nimport { useQueryClient } from './QueryClientProvider'\nimport type {\n UseMutateFunction,\n UseMutationOptions,\n UseMutationResult,\n} from './types'\nimport type { DefaultError, QueryClient } from '@tanstack/query-core'\n\n// HOOK\n\nexport function useMutation<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n>(\n options: UseMutationOptions,\n queryClient?: QueryClient,\n): UseMutationResult {\n const client = useQueryClient(queryClient)\n\n const [observer] = React.useState(\n () =>\n new MutationObserver(\n client,\n options,\n ),\n )\n\n React.useEffect(() => {\n observer.setOptions(options)\n }, [observer, options])\n\n const result = React.useSyncExternalStore(\n React.useCallback(\n (onStoreChange) =>\n observer.subscribe(notifyManager.batchCalls(onStoreChange)),\n [observer],\n ),\n () => observer.getCurrentResult(),\n () => observer.getCurrentResult(),\n )\n\n const mutate = React.useCallback<\n UseMutateFunction\n >(\n (variables, mutateOptions) => {\n observer.mutate(variables, mutateOptions).catch(noop)\n },\n [observer],\n )\n\n if (\n result.error &&\n shouldThrowError(observer.options.throwOnError, [result.error])\n ) {\n throw result.error\n }\n\n return { ...result, mutate, mutateAsync: result.mutate }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,YAAuB;AACvB,wBAKO;AACP,iCAA+B;AAUxB,SAAS,YAMd,SACA,aAC+D;AAC/D,QAAM,aAAS,2CAAe,WAAW;AAEzC,QAAM,CAAC,QAAQ,IAAU;AAAA,IACvB,MACE,IAAI;AAAA,MACF;AAAA,MACA;AAAA,IACF;AAAA,EACJ;AAEA,EAAM,gBAAU,MAAM;AACpB,aAAS,WAAW,OAAO;AAAA,EAC7B,GAAG,CAAC,UAAU,OAAO,CAAC;AAEtB,QAAM,SAAe;AAAA,IACb;AAAA,MACJ,CAAC,kBACC,SAAS,UAAU,gCAAc,WAAW,aAAa,CAAC;AAAA,MAC5D,CAAC,QAAQ;AAAA,IACX;AAAA,IACA,MAAM,SAAS,iBAAiB;AAAA,IAChC,MAAM,SAAS,iBAAiB;AAAA,EAClC;AAEA,QAAM,SAAe;AAAA,IAGnB,CAAC,WAAW,kBAAkB;AAC5B,eAAS,OAAO,WAAW,aAAa,EAAE,MAAM,sBAAI;AAAA,IACtD;AAAA,IACA,CAAC,QAAQ;AAAA,EACX;AAEA,MACE,OAAO,aACP,oCAAiB,SAAS,QAAQ,cAAc,CAAC,OAAO,KAAK,CAAC,GAC9D;AACA,UAAM,OAAO;AAAA,EACf;AAEA,SAAO,EAAE,GAAG,QAAQ,QAAQ,aAAa,OAAO,OAAO;AACzD;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/useMutation.d.cts b/node_modules/@tanstack/react-query/build/legacy/useMutation.d.cts new file mode 100644 index 0000000..09102dd --- /dev/null +++ b/node_modules/@tanstack/react-query/build/legacy/useMutation.d.cts @@ -0,0 +1,6 @@ +import { UseMutationOptions, UseMutationResult } from './types.cjs'; +import { DefaultError, QueryClient } from '@tanstack/query-core'; + +declare function useMutation(options: UseMutationOptions, queryClient?: QueryClient): UseMutationResult; + +export { useMutation }; diff --git a/node_modules/@tanstack/react-query/build/legacy/useMutation.d.ts b/node_modules/@tanstack/react-query/build/legacy/useMutation.d.ts new file mode 100644 index 0000000..0f29460 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/legacy/useMutation.d.ts @@ -0,0 +1,6 @@ +import { UseMutationOptions, UseMutationResult } from './types.js'; +import { DefaultError, QueryClient } from '@tanstack/query-core'; + +declare function useMutation(options: UseMutationOptions, queryClient?: QueryClient): UseMutationResult; + +export { useMutation }; diff --git a/node_modules/@tanstack/react-query/build/legacy/useMutation.js b/node_modules/@tanstack/react-query/build/legacy/useMutation.js new file mode 100644 index 0000000..8e089c4 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/legacy/useMutation.js @@ -0,0 +1,45 @@ +"use client"; + +// src/useMutation.ts +import * as React from "react"; +import { + MutationObserver, + noop, + notifyManager, + shouldThrowError +} from "@tanstack/query-core"; +import { useQueryClient } from "./QueryClientProvider.js"; +function useMutation(options, queryClient) { + const client = useQueryClient(queryClient); + const [observer] = React.useState( + () => new MutationObserver( + client, + options + ) + ); + React.useEffect(() => { + observer.setOptions(options); + }, [observer, options]); + const result = React.useSyncExternalStore( + React.useCallback( + (onStoreChange) => observer.subscribe(notifyManager.batchCalls(onStoreChange)), + [observer] + ), + () => observer.getCurrentResult(), + () => observer.getCurrentResult() + ); + const mutate = React.useCallback( + (variables, mutateOptions) => { + observer.mutate(variables, mutateOptions).catch(noop); + }, + [observer] + ); + if (result.error && shouldThrowError(observer.options.throwOnError, [result.error])) { + throw result.error; + } + return { ...result, mutate, mutateAsync: result.mutate }; +} +export { + useMutation +}; +//# sourceMappingURL=useMutation.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/useMutation.js.map b/node_modules/@tanstack/react-query/build/legacy/useMutation.js.map new file mode 100644 index 0000000..0df164b --- /dev/null +++ b/node_modules/@tanstack/react-query/build/legacy/useMutation.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/useMutation.ts"],"sourcesContent":["'use client'\nimport * as React from 'react'\nimport {\n MutationObserver,\n noop,\n notifyManager,\n shouldThrowError,\n} from '@tanstack/query-core'\nimport { useQueryClient } from './QueryClientProvider'\nimport type {\n UseMutateFunction,\n UseMutationOptions,\n UseMutationResult,\n} from './types'\nimport type { DefaultError, QueryClient } from '@tanstack/query-core'\n\n// HOOK\n\nexport function useMutation<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n>(\n options: UseMutationOptions,\n queryClient?: QueryClient,\n): UseMutationResult {\n const client = useQueryClient(queryClient)\n\n const [observer] = React.useState(\n () =>\n new MutationObserver(\n client,\n options,\n ),\n )\n\n React.useEffect(() => {\n observer.setOptions(options)\n }, [observer, options])\n\n const result = React.useSyncExternalStore(\n React.useCallback(\n (onStoreChange) =>\n observer.subscribe(notifyManager.batchCalls(onStoreChange)),\n [observer],\n ),\n () => observer.getCurrentResult(),\n () => observer.getCurrentResult(),\n )\n\n const mutate = React.useCallback<\n UseMutateFunction\n >(\n (variables, mutateOptions) => {\n observer.mutate(variables, mutateOptions).catch(noop)\n },\n [observer],\n )\n\n if (\n result.error &&\n shouldThrowError(observer.options.throwOnError, [result.error])\n ) {\n throw result.error\n }\n\n return { ...result, mutate, mutateAsync: result.mutate }\n}\n"],"mappings":";;;AACA,YAAY,WAAW;AACvB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,sBAAsB;AAUxB,SAAS,YAMd,SACA,aAC+D;AAC/D,QAAM,SAAS,eAAe,WAAW;AAEzC,QAAM,CAAC,QAAQ,IAAU;AAAA,IACvB,MACE,IAAI;AAAA,MACF;AAAA,MACA;AAAA,IACF;AAAA,EACJ;AAEA,EAAM,gBAAU,MAAM;AACpB,aAAS,WAAW,OAAO;AAAA,EAC7B,GAAG,CAAC,UAAU,OAAO,CAAC;AAEtB,QAAM,SAAe;AAAA,IACb;AAAA,MACJ,CAAC,kBACC,SAAS,UAAU,cAAc,WAAW,aAAa,CAAC;AAAA,MAC5D,CAAC,QAAQ;AAAA,IACX;AAAA,IACA,MAAM,SAAS,iBAAiB;AAAA,IAChC,MAAM,SAAS,iBAAiB;AAAA,EAClC;AAEA,QAAM,SAAe;AAAA,IAGnB,CAAC,WAAW,kBAAkB;AAC5B,eAAS,OAAO,WAAW,aAAa,EAAE,MAAM,IAAI;AAAA,IACtD;AAAA,IACA,CAAC,QAAQ;AAAA,EACX;AAEA,MACE,OAAO,SACP,iBAAiB,SAAS,QAAQ,cAAc,CAAC,OAAO,KAAK,CAAC,GAC9D;AACA,UAAM,OAAO;AAAA,EACf;AAEA,SAAO,EAAE,GAAG,QAAQ,QAAQ,aAAa,OAAO,OAAO;AACzD;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/useMutationState.cjs b/node_modules/@tanstack/react-query/build/legacy/useMutationState.cjs new file mode 100644 index 0000000..b256e68 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/legacy/useMutationState.cjs @@ -0,0 +1,86 @@ +"use strict"; +"use client"; +var __create = Object.create; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __getProtoOf = Object.getPrototypeOf; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( + // If the importer is in node compatibility mode or this is not an ESM + // file that has been converted to a CommonJS file using a Babel- + // compatible transform (i.e. "__esModule" has not been set), then set + // "default" to the CommonJS "module.exports" for node compatibility. + isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, + mod +)); +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/useMutationState.ts +var useMutationState_exports = {}; +__export(useMutationState_exports, { + useIsMutating: () => useIsMutating, + useMutationState: () => useMutationState +}); +module.exports = __toCommonJS(useMutationState_exports); +var React = __toESM(require("react"), 1); +var import_query_core = require("@tanstack/query-core"); +var import_QueryClientProvider = require("./QueryClientProvider.cjs"); +function useIsMutating(filters, queryClient) { + const client = (0, import_QueryClientProvider.useQueryClient)(queryClient); + return useMutationState( + { filters: { ...filters, status: "pending" } }, + client + ).length; +} +function getResult(mutationCache, options) { + return mutationCache.findAll(options.filters).map( + (mutation) => options.select ? options.select(mutation) : mutation.state + ); +} +function useMutationState(options = {}, queryClient) { + const mutationCache = (0, import_QueryClientProvider.useQueryClient)(queryClient).getMutationCache(); + const optionsRef = React.useRef(options); + const result = React.useRef(null); + if (result.current === null) { + result.current = getResult(mutationCache, options); + } + React.useEffect(() => { + optionsRef.current = options; + }); + return React.useSyncExternalStore( + React.useCallback( + (onStoreChange) => mutationCache.subscribe(() => { + const nextResult = (0, import_query_core.replaceEqualDeep)( + result.current, + getResult(mutationCache, optionsRef.current) + ); + if (result.current !== nextResult) { + result.current = nextResult; + import_query_core.notifyManager.schedule(onStoreChange); + } + }), + [mutationCache] + ), + () => result.current, + () => result.current + ); +} +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + useIsMutating, + useMutationState +}); +//# sourceMappingURL=useMutationState.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/useMutationState.cjs.map b/node_modules/@tanstack/react-query/build/legacy/useMutationState.cjs.map new file mode 100644 index 0000000..b43a480 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/legacy/useMutationState.cjs.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/useMutationState.ts"],"sourcesContent":["'use client'\nimport * as React from 'react'\n\nimport { notifyManager, replaceEqualDeep } from '@tanstack/query-core'\nimport { useQueryClient } from './QueryClientProvider'\nimport type {\n Mutation,\n MutationCache,\n MutationFilters,\n MutationState,\n QueryClient,\n} from '@tanstack/query-core'\n\nexport function useIsMutating(\n filters?: MutationFilters,\n queryClient?: QueryClient,\n): number {\n const client = useQueryClient(queryClient)\n return useMutationState(\n { filters: { ...filters, status: 'pending' } },\n client,\n ).length\n}\n\ntype MutationStateOptions = {\n filters?: MutationFilters\n select?: (mutation: Mutation) => TResult\n}\n\nfunction getResult(\n mutationCache: MutationCache,\n options: MutationStateOptions,\n): Array {\n return mutationCache\n .findAll(options.filters)\n .map(\n (mutation): TResult =>\n (options.select ? options.select(mutation) : mutation.state) as TResult,\n )\n}\n\nexport function useMutationState(\n options: MutationStateOptions = {},\n queryClient?: QueryClient,\n): Array {\n const mutationCache = useQueryClient(queryClient).getMutationCache()\n const optionsRef = React.useRef(options)\n const result = React.useRef>(null)\n if (result.current === null) {\n result.current = getResult(mutationCache, options)\n }\n\n React.useEffect(() => {\n optionsRef.current = options\n })\n\n return React.useSyncExternalStore(\n React.useCallback(\n (onStoreChange) =>\n mutationCache.subscribe(() => {\n const nextResult = replaceEqualDeep(\n result.current,\n getResult(mutationCache, optionsRef.current),\n )\n if (result.current !== nextResult) {\n result.current = nextResult\n notifyManager.schedule(onStoreChange)\n }\n }),\n [mutationCache],\n ),\n () => result.current,\n () => result.current,\n )!\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,YAAuB;AAEvB,wBAAgD;AAChD,iCAA+B;AASxB,SAAS,cACd,SACA,aACQ;AACR,QAAM,aAAS,2CAAe,WAAW;AACzC,SAAO;AAAA,IACL,EAAE,SAAS,EAAE,GAAG,SAAS,QAAQ,UAAU,EAAE;AAAA,IAC7C;AAAA,EACF,EAAE;AACJ;AAOA,SAAS,UACP,eACA,SACgB;AAChB,SAAO,cACJ,QAAQ,QAAQ,OAAO,EACvB;AAAA,IACC,CAAC,aACE,QAAQ,SAAS,QAAQ,OAAO,QAAQ,IAAI,SAAS;AAAA,EAC1D;AACJ;AAEO,SAAS,iBACd,UAAyC,CAAC,GAC1C,aACgB;AAChB,QAAM,oBAAgB,2CAAe,WAAW,EAAE,iBAAiB;AACnE,QAAM,aAAmB,aAAO,OAAO;AACvC,QAAM,SAAe,aAAuB,IAAI;AAChD,MAAI,OAAO,YAAY,MAAM;AAC3B,WAAO,UAAU,UAAU,eAAe,OAAO;AAAA,EACnD;AAEA,EAAM,gBAAU,MAAM;AACpB,eAAW,UAAU;AAAA,EACvB,CAAC;AAED,SAAa;AAAA,IACL;AAAA,MACJ,CAAC,kBACC,cAAc,UAAU,MAAM;AAC5B,cAAM,iBAAa;AAAA,UACjB,OAAO;AAAA,UACP,UAAU,eAAe,WAAW,OAAO;AAAA,QAC7C;AACA,YAAI,OAAO,YAAY,YAAY;AACjC,iBAAO,UAAU;AACjB,0CAAc,SAAS,aAAa;AAAA,QACtC;AAAA,MACF,CAAC;AAAA,MACH,CAAC,aAAa;AAAA,IAChB;AAAA,IACA,MAAM,OAAO;AAAA,IACb,MAAM,OAAO;AAAA,EACf;AACF;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/useMutationState.d.cts b/node_modules/@tanstack/react-query/build/legacy/useMutationState.d.cts new file mode 100644 index 0000000..6f35037 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/legacy/useMutationState.d.cts @@ -0,0 +1,10 @@ +import { MutationFilters, QueryClient, MutationState, Mutation } from '@tanstack/query-core'; + +declare function useIsMutating(filters?: MutationFilters, queryClient?: QueryClient): number; +type MutationStateOptions = { + filters?: MutationFilters; + select?: (mutation: Mutation) => TResult; +}; +declare function useMutationState(options?: MutationStateOptions, queryClient?: QueryClient): Array; + +export { useIsMutating, useMutationState }; diff --git a/node_modules/@tanstack/react-query/build/legacy/useMutationState.d.ts b/node_modules/@tanstack/react-query/build/legacy/useMutationState.d.ts new file mode 100644 index 0000000..6f35037 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/legacy/useMutationState.d.ts @@ -0,0 +1,10 @@ +import { MutationFilters, QueryClient, MutationState, Mutation } from '@tanstack/query-core'; + +declare function useIsMutating(filters?: MutationFilters, queryClient?: QueryClient): number; +type MutationStateOptions = { + filters?: MutationFilters; + select?: (mutation: Mutation) => TResult; +}; +declare function useMutationState(options?: MutationStateOptions, queryClient?: QueryClient): Array; + +export { useIsMutating, useMutationState }; diff --git a/node_modules/@tanstack/react-query/build/legacy/useMutationState.js b/node_modules/@tanstack/react-query/build/legacy/useMutationState.js new file mode 100644 index 0000000..aa22350 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/legacy/useMutationState.js @@ -0,0 +1,51 @@ +"use client"; + +// src/useMutationState.ts +import * as React from "react"; +import { notifyManager, replaceEqualDeep } from "@tanstack/query-core"; +import { useQueryClient } from "./QueryClientProvider.js"; +function useIsMutating(filters, queryClient) { + const client = useQueryClient(queryClient); + return useMutationState( + { filters: { ...filters, status: "pending" } }, + client + ).length; +} +function getResult(mutationCache, options) { + return mutationCache.findAll(options.filters).map( + (mutation) => options.select ? options.select(mutation) : mutation.state + ); +} +function useMutationState(options = {}, queryClient) { + const mutationCache = useQueryClient(queryClient).getMutationCache(); + const optionsRef = React.useRef(options); + const result = React.useRef(null); + if (result.current === null) { + result.current = getResult(mutationCache, options); + } + React.useEffect(() => { + optionsRef.current = options; + }); + return React.useSyncExternalStore( + React.useCallback( + (onStoreChange) => mutationCache.subscribe(() => { + const nextResult = replaceEqualDeep( + result.current, + getResult(mutationCache, optionsRef.current) + ); + if (result.current !== nextResult) { + result.current = nextResult; + notifyManager.schedule(onStoreChange); + } + }), + [mutationCache] + ), + () => result.current, + () => result.current + ); +} +export { + useIsMutating, + useMutationState +}; +//# sourceMappingURL=useMutationState.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/useMutationState.js.map b/node_modules/@tanstack/react-query/build/legacy/useMutationState.js.map new file mode 100644 index 0000000..399a5a1 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/legacy/useMutationState.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/useMutationState.ts"],"sourcesContent":["'use client'\nimport * as React from 'react'\n\nimport { notifyManager, replaceEqualDeep } from '@tanstack/query-core'\nimport { useQueryClient } from './QueryClientProvider'\nimport type {\n Mutation,\n MutationCache,\n MutationFilters,\n MutationState,\n QueryClient,\n} from '@tanstack/query-core'\n\nexport function useIsMutating(\n filters?: MutationFilters,\n queryClient?: QueryClient,\n): number {\n const client = useQueryClient(queryClient)\n return useMutationState(\n { filters: { ...filters, status: 'pending' } },\n client,\n ).length\n}\n\ntype MutationStateOptions = {\n filters?: MutationFilters\n select?: (mutation: Mutation) => TResult\n}\n\nfunction getResult(\n mutationCache: MutationCache,\n options: MutationStateOptions,\n): Array {\n return mutationCache\n .findAll(options.filters)\n .map(\n (mutation): TResult =>\n (options.select ? options.select(mutation) : mutation.state) as TResult,\n )\n}\n\nexport function useMutationState(\n options: MutationStateOptions = {},\n queryClient?: QueryClient,\n): Array {\n const mutationCache = useQueryClient(queryClient).getMutationCache()\n const optionsRef = React.useRef(options)\n const result = React.useRef>(null)\n if (result.current === null) {\n result.current = getResult(mutationCache, options)\n }\n\n React.useEffect(() => {\n optionsRef.current = options\n })\n\n return React.useSyncExternalStore(\n React.useCallback(\n (onStoreChange) =>\n mutationCache.subscribe(() => {\n const nextResult = replaceEqualDeep(\n result.current,\n getResult(mutationCache, optionsRef.current),\n )\n if (result.current !== nextResult) {\n result.current = nextResult\n notifyManager.schedule(onStoreChange)\n }\n }),\n [mutationCache],\n ),\n () => result.current,\n () => result.current,\n )!\n}\n"],"mappings":";;;AACA,YAAY,WAAW;AAEvB,SAAS,eAAe,wBAAwB;AAChD,SAAS,sBAAsB;AASxB,SAAS,cACd,SACA,aACQ;AACR,QAAM,SAAS,eAAe,WAAW;AACzC,SAAO;AAAA,IACL,EAAE,SAAS,EAAE,GAAG,SAAS,QAAQ,UAAU,EAAE;AAAA,IAC7C;AAAA,EACF,EAAE;AACJ;AAOA,SAAS,UACP,eACA,SACgB;AAChB,SAAO,cACJ,QAAQ,QAAQ,OAAO,EACvB;AAAA,IACC,CAAC,aACE,QAAQ,SAAS,QAAQ,OAAO,QAAQ,IAAI,SAAS;AAAA,EAC1D;AACJ;AAEO,SAAS,iBACd,UAAyC,CAAC,GAC1C,aACgB;AAChB,QAAM,gBAAgB,eAAe,WAAW,EAAE,iBAAiB;AACnE,QAAM,aAAmB,aAAO,OAAO;AACvC,QAAM,SAAe,aAAuB,IAAI;AAChD,MAAI,OAAO,YAAY,MAAM;AAC3B,WAAO,UAAU,UAAU,eAAe,OAAO;AAAA,EACnD;AAEA,EAAM,gBAAU,MAAM;AACpB,eAAW,UAAU;AAAA,EACvB,CAAC;AAED,SAAa;AAAA,IACL;AAAA,MACJ,CAAC,kBACC,cAAc,UAAU,MAAM;AAC5B,cAAM,aAAa;AAAA,UACjB,OAAO;AAAA,UACP,UAAU,eAAe,WAAW,OAAO;AAAA,QAC7C;AACA,YAAI,OAAO,YAAY,YAAY;AACjC,iBAAO,UAAU;AACjB,wBAAc,SAAS,aAAa;AAAA,QACtC;AAAA,MACF,CAAC;AAAA,MACH,CAAC,aAAa;AAAA,IAChB;AAAA,IACA,MAAM,OAAO;AAAA,IACb,MAAM,OAAO;AAAA,EACf;AACF;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/usePrefetchInfiniteQuery.cjs b/node_modules/@tanstack/react-query/build/legacy/usePrefetchInfiniteQuery.cjs new file mode 100644 index 0000000..9148196 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/legacy/usePrefetchInfiniteQuery.cjs @@ -0,0 +1,37 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/usePrefetchInfiniteQuery.tsx +var usePrefetchInfiniteQuery_exports = {}; +__export(usePrefetchInfiniteQuery_exports, { + usePrefetchInfiniteQuery: () => usePrefetchInfiniteQuery +}); +module.exports = __toCommonJS(usePrefetchInfiniteQuery_exports); +var import_QueryClientProvider = require("./QueryClientProvider.cjs"); +function usePrefetchInfiniteQuery(options, queryClient) { + const client = (0, import_QueryClientProvider.useQueryClient)(queryClient); + if (!client.getQueryState(options.queryKey)) { + client.prefetchInfiniteQuery(options); + } +} +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + usePrefetchInfiniteQuery +}); +//# sourceMappingURL=usePrefetchInfiniteQuery.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/usePrefetchInfiniteQuery.cjs.map b/node_modules/@tanstack/react-query/build/legacy/usePrefetchInfiniteQuery.cjs.map new file mode 100644 index 0000000..e912e76 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/legacy/usePrefetchInfiniteQuery.cjs.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/usePrefetchInfiniteQuery.tsx"],"sourcesContent":["import { useQueryClient } from './QueryClientProvider'\nimport type {\n DefaultError,\n FetchInfiniteQueryOptions,\n QueryClient,\n QueryKey,\n} from '@tanstack/query-core'\n\nexport function usePrefetchInfiniteQuery<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n>(\n options: FetchInfiniteQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n queryClient?: QueryClient,\n) {\n const client = useQueryClient(queryClient)\n\n if (!client.getQueryState(options.queryKey)) {\n client.prefetchInfiniteQuery(options)\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,iCAA+B;AAQxB,SAAS,yBAOd,SAOA,aACA;AACA,QAAM,aAAS,2CAAe,WAAW;AAEzC,MAAI,CAAC,OAAO,cAAc,QAAQ,QAAQ,GAAG;AAC3C,WAAO,sBAAsB,OAAO;AAAA,EACtC;AACF;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/usePrefetchInfiniteQuery.d.cts b/node_modules/@tanstack/react-query/build/legacy/usePrefetchInfiniteQuery.d.cts new file mode 100644 index 0000000..aeba2f8 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/legacy/usePrefetchInfiniteQuery.d.cts @@ -0,0 +1,5 @@ +import { DefaultError, QueryKey, FetchInfiniteQueryOptions, QueryClient } from '@tanstack/query-core'; + +declare function usePrefetchInfiniteQuery(options: FetchInfiniteQueryOptions, queryClient?: QueryClient): void; + +export { usePrefetchInfiniteQuery }; diff --git a/node_modules/@tanstack/react-query/build/legacy/usePrefetchInfiniteQuery.d.ts b/node_modules/@tanstack/react-query/build/legacy/usePrefetchInfiniteQuery.d.ts new file mode 100644 index 0000000..aeba2f8 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/legacy/usePrefetchInfiniteQuery.d.ts @@ -0,0 +1,5 @@ +import { DefaultError, QueryKey, FetchInfiniteQueryOptions, QueryClient } from '@tanstack/query-core'; + +declare function usePrefetchInfiniteQuery(options: FetchInfiniteQueryOptions, queryClient?: QueryClient): void; + +export { usePrefetchInfiniteQuery }; diff --git a/node_modules/@tanstack/react-query/build/legacy/usePrefetchInfiniteQuery.js b/node_modules/@tanstack/react-query/build/legacy/usePrefetchInfiniteQuery.js new file mode 100644 index 0000000..bce85f3 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/legacy/usePrefetchInfiniteQuery.js @@ -0,0 +1,12 @@ +// src/usePrefetchInfiniteQuery.tsx +import { useQueryClient } from "./QueryClientProvider.js"; +function usePrefetchInfiniteQuery(options, queryClient) { + const client = useQueryClient(queryClient); + if (!client.getQueryState(options.queryKey)) { + client.prefetchInfiniteQuery(options); + } +} +export { + usePrefetchInfiniteQuery +}; +//# sourceMappingURL=usePrefetchInfiniteQuery.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/usePrefetchInfiniteQuery.js.map b/node_modules/@tanstack/react-query/build/legacy/usePrefetchInfiniteQuery.js.map new file mode 100644 index 0000000..20e3042 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/legacy/usePrefetchInfiniteQuery.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/usePrefetchInfiniteQuery.tsx"],"sourcesContent":["import { useQueryClient } from './QueryClientProvider'\nimport type {\n DefaultError,\n FetchInfiniteQueryOptions,\n QueryClient,\n QueryKey,\n} from '@tanstack/query-core'\n\nexport function usePrefetchInfiniteQuery<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n>(\n options: FetchInfiniteQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n queryClient?: QueryClient,\n) {\n const client = useQueryClient(queryClient)\n\n if (!client.getQueryState(options.queryKey)) {\n client.prefetchInfiniteQuery(options)\n }\n}\n"],"mappings":";AAAA,SAAS,sBAAsB;AAQxB,SAAS,yBAOd,SAOA,aACA;AACA,QAAM,SAAS,eAAe,WAAW;AAEzC,MAAI,CAAC,OAAO,cAAc,QAAQ,QAAQ,GAAG;AAC3C,WAAO,sBAAsB,OAAO;AAAA,EACtC;AACF;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/usePrefetchQuery.cjs b/node_modules/@tanstack/react-query/build/legacy/usePrefetchQuery.cjs new file mode 100644 index 0000000..a884e0f --- /dev/null +++ b/node_modules/@tanstack/react-query/build/legacy/usePrefetchQuery.cjs @@ -0,0 +1,37 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/usePrefetchQuery.tsx +var usePrefetchQuery_exports = {}; +__export(usePrefetchQuery_exports, { + usePrefetchQuery: () => usePrefetchQuery +}); +module.exports = __toCommonJS(usePrefetchQuery_exports); +var import_QueryClientProvider = require("./QueryClientProvider.cjs"); +function usePrefetchQuery(options, queryClient) { + const client = (0, import_QueryClientProvider.useQueryClient)(queryClient); + if (!client.getQueryState(options.queryKey)) { + client.prefetchQuery(options); + } +} +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + usePrefetchQuery +}); +//# sourceMappingURL=usePrefetchQuery.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/usePrefetchQuery.cjs.map b/node_modules/@tanstack/react-query/build/legacy/usePrefetchQuery.cjs.map new file mode 100644 index 0000000..c5571bb --- /dev/null +++ b/node_modules/@tanstack/react-query/build/legacy/usePrefetchQuery.cjs.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/usePrefetchQuery.tsx"],"sourcesContent":["import { useQueryClient } from './QueryClientProvider'\nimport type { DefaultError, QueryClient, QueryKey } from '@tanstack/query-core'\nimport type { UsePrefetchQueryOptions } from './types'\n\nexport function usePrefetchQuery<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n options: UsePrefetchQueryOptions,\n queryClient?: QueryClient,\n) {\n const client = useQueryClient(queryClient)\n\n if (!client.getQueryState(options.queryKey)) {\n client.prefetchQuery(options)\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,iCAA+B;AAIxB,SAAS,iBAMd,SACA,aACA;AACA,QAAM,aAAS,2CAAe,WAAW;AAEzC,MAAI,CAAC,OAAO,cAAc,QAAQ,QAAQ,GAAG;AAC3C,WAAO,cAAc,OAAO;AAAA,EAC9B;AACF;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/usePrefetchQuery.d.cts b/node_modules/@tanstack/react-query/build/legacy/usePrefetchQuery.d.cts new file mode 100644 index 0000000..714b71d --- /dev/null +++ b/node_modules/@tanstack/react-query/build/legacy/usePrefetchQuery.d.cts @@ -0,0 +1,6 @@ +import { DefaultError, QueryKey, QueryClient } from '@tanstack/query-core'; +import { UsePrefetchQueryOptions } from './types.cjs'; + +declare function usePrefetchQuery(options: UsePrefetchQueryOptions, queryClient?: QueryClient): void; + +export { usePrefetchQuery }; diff --git a/node_modules/@tanstack/react-query/build/legacy/usePrefetchQuery.d.ts b/node_modules/@tanstack/react-query/build/legacy/usePrefetchQuery.d.ts new file mode 100644 index 0000000..12589eb --- /dev/null +++ b/node_modules/@tanstack/react-query/build/legacy/usePrefetchQuery.d.ts @@ -0,0 +1,6 @@ +import { DefaultError, QueryKey, QueryClient } from '@tanstack/query-core'; +import { UsePrefetchQueryOptions } from './types.js'; + +declare function usePrefetchQuery(options: UsePrefetchQueryOptions, queryClient?: QueryClient): void; + +export { usePrefetchQuery }; diff --git a/node_modules/@tanstack/react-query/build/legacy/usePrefetchQuery.js b/node_modules/@tanstack/react-query/build/legacy/usePrefetchQuery.js new file mode 100644 index 0000000..63d3292 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/legacy/usePrefetchQuery.js @@ -0,0 +1,12 @@ +// src/usePrefetchQuery.tsx +import { useQueryClient } from "./QueryClientProvider.js"; +function usePrefetchQuery(options, queryClient) { + const client = useQueryClient(queryClient); + if (!client.getQueryState(options.queryKey)) { + client.prefetchQuery(options); + } +} +export { + usePrefetchQuery +}; +//# sourceMappingURL=usePrefetchQuery.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/usePrefetchQuery.js.map b/node_modules/@tanstack/react-query/build/legacy/usePrefetchQuery.js.map new file mode 100644 index 0000000..b7f1881 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/legacy/usePrefetchQuery.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/usePrefetchQuery.tsx"],"sourcesContent":["import { useQueryClient } from './QueryClientProvider'\nimport type { DefaultError, QueryClient, QueryKey } from '@tanstack/query-core'\nimport type { UsePrefetchQueryOptions } from './types'\n\nexport function usePrefetchQuery<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n options: UsePrefetchQueryOptions,\n queryClient?: QueryClient,\n) {\n const client = useQueryClient(queryClient)\n\n if (!client.getQueryState(options.queryKey)) {\n client.prefetchQuery(options)\n }\n}\n"],"mappings":";AAAA,SAAS,sBAAsB;AAIxB,SAAS,iBAMd,SACA,aACA;AACA,QAAM,SAAS,eAAe,WAAW;AAEzC,MAAI,CAAC,OAAO,cAAc,QAAQ,QAAQ,GAAG;AAC3C,WAAO,cAAc,OAAO;AAAA,EAC9B;AACF;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/useQueries.cjs b/node_modules/@tanstack/react-query/build/legacy/useQueries.cjs new file mode 100644 index 0000000..8833f13 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/legacy/useQueries.cjs @@ -0,0 +1,128 @@ +"use strict"; +"use client"; +var __create = Object.create; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __getProtoOf = Object.getPrototypeOf; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( + // If the importer is in node compatibility mode or this is not an ESM + // file that has been converted to a CommonJS file using a Babel- + // compatible transform (i.e. "__esModule" has not been set), then set + // "default" to the CommonJS "module.exports" for node compatibility. + isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, + mod +)); +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/useQueries.ts +var useQueries_exports = {}; +__export(useQueries_exports, { + useQueries: () => useQueries +}); +module.exports = __toCommonJS(useQueries_exports); +var React = __toESM(require("react"), 1); +var import_query_core = require("@tanstack/query-core"); +var import_QueryClientProvider = require("./QueryClientProvider.cjs"); +var import_IsRestoringProvider = require("./IsRestoringProvider.cjs"); +var import_QueryErrorResetBoundary = require("./QueryErrorResetBoundary.cjs"); +var import_errorBoundaryUtils = require("./errorBoundaryUtils.cjs"); +var import_suspense = require("./suspense.cjs"); +function useQueries({ + queries, + ...options +}, queryClient) { + const client = (0, import_QueryClientProvider.useQueryClient)(queryClient); + const isRestoring = (0, import_IsRestoringProvider.useIsRestoring)(); + const errorResetBoundary = (0, import_QueryErrorResetBoundary.useQueryErrorResetBoundary)(); + const defaultedQueries = React.useMemo( + () => queries.map((opts) => { + const defaultedOptions = client.defaultQueryOptions( + opts + ); + defaultedOptions._optimisticResults = isRestoring ? "isRestoring" : "optimistic"; + return defaultedOptions; + }), + [queries, client, isRestoring] + ); + defaultedQueries.forEach((queryOptions) => { + (0, import_suspense.ensureSuspenseTimers)(queryOptions); + const query = client.getQueryCache().get(queryOptions.queryHash); + (0, import_errorBoundaryUtils.ensurePreventErrorBoundaryRetry)(queryOptions, errorResetBoundary, query); + }); + (0, import_errorBoundaryUtils.useClearResetErrorBoundary)(errorResetBoundary); + const [observer] = React.useState( + () => new import_query_core.QueriesObserver( + client, + defaultedQueries, + options + ) + ); + const [optimisticResult, getCombinedResult, trackResult] = observer.getOptimisticResult( + defaultedQueries, + options.combine + ); + const shouldSubscribe = !isRestoring && options.subscribed !== false; + React.useSyncExternalStore( + React.useCallback( + (onStoreChange) => shouldSubscribe ? observer.subscribe(import_query_core.notifyManager.batchCalls(onStoreChange)) : import_query_core.noop, + [observer, shouldSubscribe] + ), + () => observer.getCurrentResult(), + () => observer.getCurrentResult() + ); + React.useEffect(() => { + observer.setQueries( + defaultedQueries, + options + ); + }, [defaultedQueries, options, observer]); + const shouldAtLeastOneSuspend = optimisticResult.some( + (result, index) => (0, import_suspense.shouldSuspend)(defaultedQueries[index], result) + ); + const suspensePromises = shouldAtLeastOneSuspend ? optimisticResult.flatMap((result, index) => { + const opts = defaultedQueries[index]; + if (opts && (0, import_suspense.shouldSuspend)(opts, result)) { + const queryObserver = new import_query_core.QueryObserver(client, opts); + return (0, import_suspense.fetchOptimistic)(opts, queryObserver, errorResetBoundary); + } + return []; + }) : []; + if (suspensePromises.length > 0) { + throw Promise.all(suspensePromises); + } + const firstSingleResultWhichShouldThrow = optimisticResult.find( + (result, index) => { + const query = defaultedQueries[index]; + return query && (0, import_errorBoundaryUtils.getHasError)({ + result, + errorResetBoundary, + throwOnError: query.throwOnError, + query: client.getQueryCache().get(query.queryHash), + suspense: query.suspense + }); + } + ); + if (firstSingleResultWhichShouldThrow == null ? void 0 : firstSingleResultWhichShouldThrow.error) { + throw firstSingleResultWhichShouldThrow.error; + } + return getCombinedResult(trackResult()); +} +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + useQueries +}); +//# sourceMappingURL=useQueries.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/useQueries.cjs.map b/node_modules/@tanstack/react-query/build/legacy/useQueries.cjs.map new file mode 100644 index 0000000..0a50572 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/legacy/useQueries.cjs.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/useQueries.ts"],"sourcesContent":["'use client'\nimport * as React from 'react'\n\nimport {\n QueriesObserver,\n QueryObserver,\n noop,\n notifyManager,\n} from '@tanstack/query-core'\nimport { useQueryClient } from './QueryClientProvider'\nimport { useIsRestoring } from './IsRestoringProvider'\nimport { useQueryErrorResetBoundary } from './QueryErrorResetBoundary'\nimport {\n ensurePreventErrorBoundaryRetry,\n getHasError,\n useClearResetErrorBoundary,\n} from './errorBoundaryUtils'\nimport {\n ensureSuspenseTimers,\n fetchOptimistic,\n shouldSuspend,\n} from './suspense'\nimport type {\n DefinedUseQueryResult,\n UseQueryOptions,\n UseQueryResult,\n} from './types'\nimport type {\n DefaultError,\n OmitKeyof,\n QueriesObserverOptions,\n QueriesPlaceholderDataFunction,\n QueryClient,\n QueryFunction,\n QueryKey,\n QueryObserverOptions,\n ThrowOnError,\n} from '@tanstack/query-core'\n\n// This defines the `UseQueryOptions` that are accepted in `QueriesOptions` & `GetOptions`.\n// `placeholderData` function always gets undefined passed\ntype UseQueryOptionsForUseQueries<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> = OmitKeyof<\n UseQueryOptions,\n 'placeholderData' | 'subscribed'\n> & {\n placeholderData?: TQueryFnData | QueriesPlaceholderDataFunction\n}\n\n// Avoid TS depth-limit error in case of large array literal\ntype MAXIMUM_DEPTH = 20\n\n// Widen the type of the symbol to enable type inference even if skipToken is not immutable.\ntype SkipTokenForUseQueries = symbol\n\ntype GetUseQueryOptionsForUseQueries =\n // Part 1: responsible for applying explicit type parameter to function arguments, if object { queryFnData: TQueryFnData, error: TError, data: TData }\n T extends {\n queryFnData: infer TQueryFnData\n error?: infer TError\n data: infer TData\n }\n ? UseQueryOptionsForUseQueries\n : T extends { queryFnData: infer TQueryFnData; error?: infer TError }\n ? UseQueryOptionsForUseQueries\n : T extends { data: infer TData; error?: infer TError }\n ? UseQueryOptionsForUseQueries\n : // Part 2: responsible for applying explicit type parameter to function arguments, if tuple [TQueryFnData, TError, TData]\n T extends [infer TQueryFnData, infer TError, infer TData]\n ? UseQueryOptionsForUseQueries\n : T extends [infer TQueryFnData, infer TError]\n ? UseQueryOptionsForUseQueries\n : T extends [infer TQueryFnData]\n ? UseQueryOptionsForUseQueries\n : // Part 3: responsible for inferring and enforcing type if no explicit parameter was provided\n T extends {\n queryFn?:\n | QueryFunction\n | SkipTokenForUseQueries\n select?: (data: any) => infer TData\n throwOnError?: ThrowOnError\n }\n ? UseQueryOptionsForUseQueries<\n TQueryFnData,\n unknown extends TError ? DefaultError : TError,\n unknown extends TData ? TQueryFnData : TData,\n TQueryKey\n >\n : // Fallback\n UseQueryOptionsForUseQueries\n\n// A defined initialData setting should return a DefinedUseQueryResult rather than UseQueryResult\ntype GetDefinedOrUndefinedQueryResult = T extends {\n initialData?: infer TInitialData\n}\n ? unknown extends TInitialData\n ? UseQueryResult\n : TInitialData extends TData\n ? DefinedUseQueryResult\n : TInitialData extends () => infer TInitialDataResult\n ? unknown extends TInitialDataResult\n ? UseQueryResult\n : TInitialDataResult extends TData\n ? DefinedUseQueryResult\n : UseQueryResult\n : UseQueryResult\n : UseQueryResult\n\ntype GetUseQueryResult =\n // Part 1: responsible for mapping explicit type parameter to function result, if object\n T extends { queryFnData: any; error?: infer TError; data: infer TData }\n ? GetDefinedOrUndefinedQueryResult\n : T extends { queryFnData: infer TQueryFnData; error?: infer TError }\n ? GetDefinedOrUndefinedQueryResult\n : T extends { data: infer TData; error?: infer TError }\n ? GetDefinedOrUndefinedQueryResult\n : // Part 2: responsible for mapping explicit type parameter to function result, if tuple\n T extends [any, infer TError, infer TData]\n ? GetDefinedOrUndefinedQueryResult\n : T extends [infer TQueryFnData, infer TError]\n ? GetDefinedOrUndefinedQueryResult\n : T extends [infer TQueryFnData]\n ? GetDefinedOrUndefinedQueryResult\n : // Part 3: responsible for mapping inferred type to results, if no explicit parameter was provided\n T extends {\n queryFn?:\n | QueryFunction\n | SkipTokenForUseQueries\n select?: (data: any) => infer TData\n throwOnError?: ThrowOnError\n }\n ? GetDefinedOrUndefinedQueryResult<\n T,\n unknown extends TData ? TQueryFnData : TData,\n unknown extends TError ? DefaultError : TError\n >\n : // Fallback\n UseQueryResult\n\n/**\n * QueriesOptions reducer recursively unwraps function arguments to infer/enforce type param\n */\nexport type QueriesOptions<\n T extends Array,\n TResults extends Array = [],\n TDepth extends ReadonlyArray = [],\n> = TDepth['length'] extends MAXIMUM_DEPTH\n ? Array\n : T extends []\n ? []\n : T extends [infer Head]\n ? [...TResults, GetUseQueryOptionsForUseQueries]\n : T extends [infer Head, ...infer Tails]\n ? QueriesOptions<\n [...Tails],\n [...TResults, GetUseQueryOptionsForUseQueries],\n [...TDepth, 1]\n >\n : ReadonlyArray extends T\n ? T\n : // If T is *some* array but we couldn't assign unknown[] to it, then it must hold some known/homogenous type!\n // use this to infer the param types in the case of Array.map() argument\n T extends Array<\n UseQueryOptionsForUseQueries<\n infer TQueryFnData,\n infer TError,\n infer TData,\n infer TQueryKey\n >\n >\n ? Array<\n UseQueryOptionsForUseQueries<\n TQueryFnData,\n TError,\n TData,\n TQueryKey\n >\n >\n : // Fallback\n Array\n\n/**\n * QueriesResults reducer recursively maps type param to results\n */\nexport type QueriesResults<\n T extends Array,\n TResults extends Array = [],\n TDepth extends ReadonlyArray = [],\n> = TDepth['length'] extends MAXIMUM_DEPTH\n ? Array\n : T extends []\n ? []\n : T extends [infer Head]\n ? [...TResults, GetUseQueryResult]\n : T extends [infer Head, ...infer Tails]\n ? QueriesResults<\n [...Tails],\n [...TResults, GetUseQueryResult],\n [...TDepth, 1]\n >\n : { [K in keyof T]: GetUseQueryResult }\n\nexport function useQueries<\n T extends Array,\n TCombinedResult = QueriesResults,\n>(\n {\n queries,\n ...options\n }: {\n queries:\n | readonly [...QueriesOptions]\n | readonly [...{ [K in keyof T]: GetUseQueryOptionsForUseQueries }]\n combine?: (result: QueriesResults) => TCombinedResult\n subscribed?: boolean\n },\n queryClient?: QueryClient,\n): TCombinedResult {\n const client = useQueryClient(queryClient)\n const isRestoring = useIsRestoring()\n const errorResetBoundary = useQueryErrorResetBoundary()\n\n const defaultedQueries = React.useMemo(\n () =>\n queries.map((opts) => {\n const defaultedOptions = client.defaultQueryOptions(\n opts as QueryObserverOptions,\n )\n\n // Make sure the results are already in fetching state before subscribing or updating options\n defaultedOptions._optimisticResults = isRestoring\n ? 'isRestoring'\n : 'optimistic'\n\n return defaultedOptions\n }),\n [queries, client, isRestoring],\n )\n\n defaultedQueries.forEach((queryOptions) => {\n ensureSuspenseTimers(queryOptions)\n const query = client.getQueryCache().get(queryOptions.queryHash)\n ensurePreventErrorBoundaryRetry(queryOptions, errorResetBoundary, query)\n })\n\n useClearResetErrorBoundary(errorResetBoundary)\n\n const [observer] = React.useState(\n () =>\n new QueriesObserver(\n client,\n defaultedQueries,\n options as QueriesObserverOptions,\n ),\n )\n\n // note: this must be called before useSyncExternalStore\n const [optimisticResult, getCombinedResult, trackResult] =\n observer.getOptimisticResult(\n defaultedQueries,\n (options as QueriesObserverOptions).combine,\n )\n\n const shouldSubscribe = !isRestoring && options.subscribed !== false\n React.useSyncExternalStore(\n React.useCallback(\n (onStoreChange) =>\n shouldSubscribe\n ? observer.subscribe(notifyManager.batchCalls(onStoreChange))\n : noop,\n [observer, shouldSubscribe],\n ),\n () => observer.getCurrentResult(),\n () => observer.getCurrentResult(),\n )\n\n React.useEffect(() => {\n observer.setQueries(\n defaultedQueries,\n options as QueriesObserverOptions,\n )\n }, [defaultedQueries, options, observer])\n\n const shouldAtLeastOneSuspend = optimisticResult.some((result, index) =>\n shouldSuspend(defaultedQueries[index], result),\n )\n\n const suspensePromises = shouldAtLeastOneSuspend\n ? optimisticResult.flatMap((result, index) => {\n const opts = defaultedQueries[index]\n\n if (opts && shouldSuspend(opts, result)) {\n const queryObserver = new QueryObserver(client, opts)\n return fetchOptimistic(opts, queryObserver, errorResetBoundary)\n }\n return []\n })\n : []\n\n if (suspensePromises.length > 0) {\n throw Promise.all(suspensePromises)\n }\n const firstSingleResultWhichShouldThrow = optimisticResult.find(\n (result, index) => {\n const query = defaultedQueries[index]\n return (\n query &&\n getHasError({\n result,\n errorResetBoundary,\n throwOnError: query.throwOnError,\n query: client.getQueryCache().get(query.queryHash),\n suspense: query.suspense,\n })\n )\n },\n )\n\n if (firstSingleResultWhichShouldThrow?.error) {\n throw firstSingleResultWhichShouldThrow.error\n }\n\n return getCombinedResult(trackResult())\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,YAAuB;AAEvB,wBAKO;AACP,iCAA+B;AAC/B,iCAA+B;AAC/B,qCAA2C;AAC3C,gCAIO;AACP,sBAIO;AAyLA,SAAS,WAId;AAAA,EACE;AAAA,EACA,GAAG;AACL,GAOA,aACiB;AACjB,QAAM,aAAS,2CAAe,WAAW;AACzC,QAAM,kBAAc,2CAAe;AACnC,QAAM,yBAAqB,2DAA2B;AAEtD,QAAM,mBAAyB;AAAA,IAC7B,MACE,QAAQ,IAAI,CAAC,SAAS;AACpB,YAAM,mBAAmB,OAAO;AAAA,QAC9B;AAAA,MACF;AAGA,uBAAiB,qBAAqB,cAClC,gBACA;AAEJ,aAAO;AAAA,IACT,CAAC;AAAA,IACH,CAAC,SAAS,QAAQ,WAAW;AAAA,EAC/B;AAEA,mBAAiB,QAAQ,CAAC,iBAAiB;AACzC,8CAAqB,YAAY;AACjC,UAAM,QAAQ,OAAO,cAAc,EAAE,IAAI,aAAa,SAAS;AAC/D,mEAAgC,cAAc,oBAAoB,KAAK;AAAA,EACzE,CAAC;AAED,4DAA2B,kBAAkB;AAE7C,QAAM,CAAC,QAAQ,IAAU;AAAA,IACvB,MACE,IAAI;AAAA,MACF;AAAA,MACA;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ClB,CAAC;AAAA,IAEL;AAAA,EACF;AAEA,MAAI,uFAAmC,OAAO;AAC5C,UAAM,kCAAkC;AAAA,EAC1C;AAEA,SAAO,kBAAkB,YAAY,CAAC;AACxC;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/useQueries.d.cts b/node_modules/@tanstack/react-query/build/legacy/useQueries.d.cts new file mode 100644 index 0000000..bf88750 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/legacy/useQueries.d.cts @@ -0,0 +1,76 @@ +import { UseQueryOptions, UseQueryResult, DefinedUseQueryResult } from './types.cjs'; +import { DefaultError, QueryKey, OmitKeyof, QueriesPlaceholderDataFunction, QueryFunction, ThrowOnError, QueryClient } from '@tanstack/query-core'; + +type UseQueryOptionsForUseQueries = OmitKeyof, 'placeholderData' | 'subscribed'> & { + placeholderData?: TQueryFnData | QueriesPlaceholderDataFunction; +}; +type MAXIMUM_DEPTH = 20; +type SkipTokenForUseQueries = symbol; +type GetUseQueryOptionsForUseQueries = T extends { + queryFnData: infer TQueryFnData; + error?: infer TError; + data: infer TData; +} ? UseQueryOptionsForUseQueries : T extends { + queryFnData: infer TQueryFnData; + error?: infer TError; +} ? UseQueryOptionsForUseQueries : T extends { + data: infer TData; + error?: infer TError; +} ? UseQueryOptionsForUseQueries : T extends [infer TQueryFnData, infer TError, infer TData] ? UseQueryOptionsForUseQueries : T extends [infer TQueryFnData, infer TError] ? UseQueryOptionsForUseQueries : T extends [infer TQueryFnData] ? UseQueryOptionsForUseQueries : T extends { + queryFn?: QueryFunction | SkipTokenForUseQueries; + select?: (data: any) => infer TData; + throwOnError?: ThrowOnError; +} ? UseQueryOptionsForUseQueries : UseQueryOptionsForUseQueries; +type GetDefinedOrUndefinedQueryResult = T extends { + initialData?: infer TInitialData; +} ? unknown extends TInitialData ? UseQueryResult : TInitialData extends TData ? DefinedUseQueryResult : TInitialData extends () => infer TInitialDataResult ? unknown extends TInitialDataResult ? UseQueryResult : TInitialDataResult extends TData ? DefinedUseQueryResult : UseQueryResult : UseQueryResult : UseQueryResult; +type GetUseQueryResult = T extends { + queryFnData: any; + error?: infer TError; + data: infer TData; +} ? GetDefinedOrUndefinedQueryResult : T extends { + queryFnData: infer TQueryFnData; + error?: infer TError; +} ? GetDefinedOrUndefinedQueryResult : T extends { + data: infer TData; + error?: infer TError; +} ? GetDefinedOrUndefinedQueryResult : T extends [any, infer TError, infer TData] ? GetDefinedOrUndefinedQueryResult : T extends [infer TQueryFnData, infer TError] ? GetDefinedOrUndefinedQueryResult : T extends [infer TQueryFnData] ? GetDefinedOrUndefinedQueryResult : T extends { + queryFn?: QueryFunction | SkipTokenForUseQueries; + select?: (data: any) => infer TData; + throwOnError?: ThrowOnError; +} ? GetDefinedOrUndefinedQueryResult : UseQueryResult; +/** + * QueriesOptions reducer recursively unwraps function arguments to infer/enforce type param + */ +type QueriesOptions, TResults extends Array = [], TDepth extends ReadonlyArray = []> = TDepth['length'] extends MAXIMUM_DEPTH ? Array : T extends [] ? [] : T extends [infer Head] ? [...TResults, GetUseQueryOptionsForUseQueries] : T extends [infer Head, ...infer Tails] ? QueriesOptions<[ + ...Tails +], [ + ...TResults, + GetUseQueryOptionsForUseQueries +], [ + ...TDepth, + 1 +]> : ReadonlyArray extends T ? T : T extends Array> ? Array> : Array; +/** + * QueriesResults reducer recursively maps type param to results + */ +type QueriesResults, TResults extends Array = [], TDepth extends ReadonlyArray = []> = TDepth['length'] extends MAXIMUM_DEPTH ? Array : T extends [] ? [] : T extends [infer Head] ? [...TResults, GetUseQueryResult] : T extends [infer Head, ...infer Tails] ? QueriesResults<[ + ...Tails +], [ + ...TResults, + GetUseQueryResult +], [ + ...TDepth, + 1 +]> : { + [K in keyof T]: GetUseQueryResult; +}; +declare function useQueries, TCombinedResult = QueriesResults>({ queries, ...options }: { + queries: readonly [...QueriesOptions] | readonly [...{ + [K in keyof T]: GetUseQueryOptionsForUseQueries; + }]; + combine?: (result: QueriesResults) => TCombinedResult; + subscribed?: boolean; +}, queryClient?: QueryClient): TCombinedResult; + +export { type QueriesOptions, type QueriesResults, useQueries }; diff --git a/node_modules/@tanstack/react-query/build/legacy/useQueries.d.ts b/node_modules/@tanstack/react-query/build/legacy/useQueries.d.ts new file mode 100644 index 0000000..2311f83 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/legacy/useQueries.d.ts @@ -0,0 +1,76 @@ +import { UseQueryOptions, UseQueryResult, DefinedUseQueryResult } from './types.js'; +import { DefaultError, QueryKey, OmitKeyof, QueriesPlaceholderDataFunction, QueryFunction, ThrowOnError, QueryClient } from '@tanstack/query-core'; + +type UseQueryOptionsForUseQueries = OmitKeyof, 'placeholderData' | 'subscribed'> & { + placeholderData?: TQueryFnData | QueriesPlaceholderDataFunction; +}; +type MAXIMUM_DEPTH = 20; +type SkipTokenForUseQueries = symbol; +type GetUseQueryOptionsForUseQueries = T extends { + queryFnData: infer TQueryFnData; + error?: infer TError; + data: infer TData; +} ? UseQueryOptionsForUseQueries : T extends { + queryFnData: infer TQueryFnData; + error?: infer TError; +} ? UseQueryOptionsForUseQueries : T extends { + data: infer TData; + error?: infer TError; +} ? UseQueryOptionsForUseQueries : T extends [infer TQueryFnData, infer TError, infer TData] ? UseQueryOptionsForUseQueries : T extends [infer TQueryFnData, infer TError] ? UseQueryOptionsForUseQueries : T extends [infer TQueryFnData] ? UseQueryOptionsForUseQueries : T extends { + queryFn?: QueryFunction | SkipTokenForUseQueries; + select?: (data: any) => infer TData; + throwOnError?: ThrowOnError; +} ? UseQueryOptionsForUseQueries : UseQueryOptionsForUseQueries; +type GetDefinedOrUndefinedQueryResult = T extends { + initialData?: infer TInitialData; +} ? unknown extends TInitialData ? UseQueryResult : TInitialData extends TData ? DefinedUseQueryResult : TInitialData extends () => infer TInitialDataResult ? unknown extends TInitialDataResult ? UseQueryResult : TInitialDataResult extends TData ? DefinedUseQueryResult : UseQueryResult : UseQueryResult : UseQueryResult; +type GetUseQueryResult = T extends { + queryFnData: any; + error?: infer TError; + data: infer TData; +} ? GetDefinedOrUndefinedQueryResult : T extends { + queryFnData: infer TQueryFnData; + error?: infer TError; +} ? GetDefinedOrUndefinedQueryResult : T extends { + data: infer TData; + error?: infer TError; +} ? GetDefinedOrUndefinedQueryResult : T extends [any, infer TError, infer TData] ? GetDefinedOrUndefinedQueryResult : T extends [infer TQueryFnData, infer TError] ? GetDefinedOrUndefinedQueryResult : T extends [infer TQueryFnData] ? GetDefinedOrUndefinedQueryResult : T extends { + queryFn?: QueryFunction | SkipTokenForUseQueries; + select?: (data: any) => infer TData; + throwOnError?: ThrowOnError; +} ? GetDefinedOrUndefinedQueryResult : UseQueryResult; +/** + * QueriesOptions reducer recursively unwraps function arguments to infer/enforce type param + */ +type QueriesOptions, TResults extends Array = [], TDepth extends ReadonlyArray = []> = TDepth['length'] extends MAXIMUM_DEPTH ? Array : T extends [] ? [] : T extends [infer Head] ? [...TResults, GetUseQueryOptionsForUseQueries] : T extends [infer Head, ...infer Tails] ? QueriesOptions<[ + ...Tails +], [ + ...TResults, + GetUseQueryOptionsForUseQueries +], [ + ...TDepth, + 1 +]> : ReadonlyArray extends T ? T : T extends Array> ? Array> : Array; +/** + * QueriesResults reducer recursively maps type param to results + */ +type QueriesResults, TResults extends Array = [], TDepth extends ReadonlyArray = []> = TDepth['length'] extends MAXIMUM_DEPTH ? Array : T extends [] ? [] : T extends [infer Head] ? [...TResults, GetUseQueryResult] : T extends [infer Head, ...infer Tails] ? QueriesResults<[ + ...Tails +], [ + ...TResults, + GetUseQueryResult +], [ + ...TDepth, + 1 +]> : { + [K in keyof T]: GetUseQueryResult; +}; +declare function useQueries, TCombinedResult = QueriesResults>({ queries, ...options }: { + queries: readonly [...QueriesOptions] | readonly [...{ + [K in keyof T]: GetUseQueryOptionsForUseQueries; + }]; + combine?: (result: QueriesResults) => TCombinedResult; + subscribed?: boolean; +}, queryClient?: QueryClient): TCombinedResult; + +export { type QueriesOptions, type QueriesResults, useQueries }; diff --git a/node_modules/@tanstack/react-query/build/legacy/useQueries.js b/node_modules/@tanstack/react-query/build/legacy/useQueries.js new file mode 100644 index 0000000..5a3a6d3 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/legacy/useQueries.js @@ -0,0 +1,107 @@ +"use client"; + +// src/useQueries.ts +import * as React from "react"; +import { + QueriesObserver, + QueryObserver, + noop, + notifyManager +} from "@tanstack/query-core"; +import { useQueryClient } from "./QueryClientProvider.js"; +import { useIsRestoring } from "./IsRestoringProvider.js"; +import { useQueryErrorResetBoundary } from "./QueryErrorResetBoundary.js"; +import { + ensurePreventErrorBoundaryRetry, + getHasError, + useClearResetErrorBoundary +} from "./errorBoundaryUtils.js"; +import { + ensureSuspenseTimers, + fetchOptimistic, + shouldSuspend +} from "./suspense.js"; +function useQueries({ + queries, + ...options +}, queryClient) { + const client = useQueryClient(queryClient); + const isRestoring = useIsRestoring(); + const errorResetBoundary = useQueryErrorResetBoundary(); + const defaultedQueries = React.useMemo( + () => queries.map((opts) => { + const defaultedOptions = client.defaultQueryOptions( + opts + ); + defaultedOptions._optimisticResults = isRestoring ? "isRestoring" : "optimistic"; + return defaultedOptions; + }), + [queries, client, isRestoring] + ); + defaultedQueries.forEach((queryOptions) => { + ensureSuspenseTimers(queryOptions); + const query = client.getQueryCache().get(queryOptions.queryHash); + ensurePreventErrorBoundaryRetry(queryOptions, errorResetBoundary, query); + }); + useClearResetErrorBoundary(errorResetBoundary); + const [observer] = React.useState( + () => new QueriesObserver( + client, + defaultedQueries, + options + ) + ); + const [optimisticResult, getCombinedResult, trackResult] = observer.getOptimisticResult( + defaultedQueries, + options.combine + ); + const shouldSubscribe = !isRestoring && options.subscribed !== false; + React.useSyncExternalStore( + React.useCallback( + (onStoreChange) => shouldSubscribe ? observer.subscribe(notifyManager.batchCalls(onStoreChange)) : noop, + [observer, shouldSubscribe] + ), + () => observer.getCurrentResult(), + () => observer.getCurrentResult() + ); + React.useEffect(() => { + observer.setQueries( + defaultedQueries, + options + ); + }, [defaultedQueries, options, observer]); + const shouldAtLeastOneSuspend = optimisticResult.some( + (result, index) => shouldSuspend(defaultedQueries[index], result) + ); + const suspensePromises = shouldAtLeastOneSuspend ? optimisticResult.flatMap((result, index) => { + const opts = defaultedQueries[index]; + if (opts && shouldSuspend(opts, result)) { + const queryObserver = new QueryObserver(client, opts); + return fetchOptimistic(opts, queryObserver, errorResetBoundary); + } + return []; + }) : []; + if (suspensePromises.length > 0) { + throw Promise.all(suspensePromises); + } + const firstSingleResultWhichShouldThrow = optimisticResult.find( + (result, index) => { + const query = defaultedQueries[index]; + return query && getHasError({ + result, + errorResetBoundary, + throwOnError: query.throwOnError, + query: client.getQueryCache().get(query.queryHash), + suspense: query.suspense + }); + } + ); + if (firstSingleResultWhichShouldThrow == null ? void 0 : firstSingleResultWhichShouldThrow.error) { + throw firstSingleResultWhichShouldThrow.error; + } + return getCombinedResult(trackResult()); +} +export { + useQueries +}; +//# sourceMappingURL=useQueries.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/useQueries.js.map b/node_modules/@tanstack/react-query/build/legacy/useQueries.js.map new file mode 100644 index 0000000..112d3e6 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/legacy/useQueries.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/useQueries.ts"],"sourcesContent":["'use client'\nimport * as React from 'react'\n\nimport {\n QueriesObserver,\n QueryObserver,\n noop,\n notifyManager,\n} from '@tanstack/query-core'\nimport { useQueryClient } from './QueryClientProvider'\nimport { useIsRestoring } from './IsRestoringProvider'\nimport { useQueryErrorResetBoundary } from './QueryErrorResetBoundary'\nimport {\n ensurePreventErrorBoundaryRetry,\n getHasError,\n useClearResetErrorBoundary,\n} from './errorBoundaryUtils'\nimport {\n ensureSuspenseTimers,\n fetchOptimistic,\n shouldSuspend,\n} from './suspense'\nimport type {\n DefinedUseQueryResult,\n UseQueryOptions,\n UseQueryResult,\n} from './types'\nimport type {\n DefaultError,\n OmitKeyof,\n QueriesObserverOptions,\n QueriesPlaceholderDataFunction,\n QueryClient,\n QueryFunction,\n QueryKey,\n QueryObserverOptions,\n ThrowOnError,\n} from '@tanstack/query-core'\n\n// This defines the `UseQueryOptions` that are accepted in `QueriesOptions` & `GetOptions`.\n// `placeholderData` function always gets undefined passed\ntype UseQueryOptionsForUseQueries<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> = OmitKeyof<\n UseQueryOptions,\n 'placeholderData' | 'subscribed'\n> & {\n placeholderData?: TQueryFnData | QueriesPlaceholderDataFunction\n}\n\n// Avoid TS depth-limit error in case of large array literal\ntype MAXIMUM_DEPTH = 20\n\n// Widen the type of the symbol to enable type inference even if skipToken is not immutable.\ntype SkipTokenForUseQueries = symbol\n\ntype GetUseQueryOptionsForUseQueries =\n // Part 1: responsible for applying explicit type parameter to function arguments, if object { queryFnData: TQueryFnData, error: TError, data: TData }\n T extends {\n queryFnData: infer TQueryFnData\n error?: infer TError\n data: infer TData\n }\n ? UseQueryOptionsForUseQueries\n : T extends { queryFnData: infer TQueryFnData; error?: infer TError }\n ? UseQueryOptionsForUseQueries\n : T extends { data: infer TData; error?: infer TError }\n ? UseQueryOptionsForUseQueries\n : // Part 2: responsible for applying explicit type parameter to function arguments, if tuple [TQueryFnData, TError, TData]\n T extends [infer TQueryFnData, infer TError, infer TData]\n ? UseQueryOptionsForUseQueries\n : T extends [infer TQueryFnData, infer TError]\n ? UseQueryOptionsForUseQueries\n : T extends [infer TQueryFnData]\n ? UseQueryOptionsForUseQueries\n : // Part 3: responsible for inferring and enforcing type if no explicit parameter was provided\n T extends {\n queryFn?:\n | QueryFunction\n | SkipTokenForUseQueries\n select?: (data: any) => infer TData\n throwOnError?: ThrowOnError\n }\n ? UseQueryOptionsForUseQueries<\n TQueryFnData,\n unknown extends TError ? DefaultError : TError,\n unknown extends TData ? TQueryFnData : TData,\n TQueryKey\n >\n : // Fallback\n UseQueryOptionsForUseQueries\n\n// A defined initialData setting should return a DefinedUseQueryResult rather than UseQueryResult\ntype GetDefinedOrUndefinedQueryResult = T extends {\n initialData?: infer TInitialData\n}\n ? unknown extends TInitialData\n ? UseQueryResult\n : TInitialData extends TData\n ? DefinedUseQueryResult\n : TInitialData extends () => infer TInitialDataResult\n ? unknown extends TInitialDataResult\n ? UseQueryResult\n : TInitialDataResult extends TData\n ? DefinedUseQueryResult\n : UseQueryResult\n : UseQueryResult\n : UseQueryResult\n\ntype GetUseQueryResult =\n // Part 1: responsible for mapping explicit type parameter to function result, if object\n T extends { queryFnData: any; error?: infer TError; data: infer TData }\n ? GetDefinedOrUndefinedQueryResult\n : T extends { queryFnData: infer TQueryFnData; error?: infer TError }\n ? GetDefinedOrUndefinedQueryResult\n : T extends { data: infer TData; error?: infer TError }\n ? GetDefinedOrUndefinedQueryResult\n : // Part 2: responsible for mapping explicit type parameter to function result, if tuple\n T extends [any, infer TError, infer TData]\n ? GetDefinedOrUndefinedQueryResult\n : T extends [infer TQueryFnData, infer TError]\n ? GetDefinedOrUndefinedQueryResult\n : T extends [infer TQueryFnData]\n ? GetDefinedOrUndefinedQueryResult\n : // Part 3: responsible for mapping inferred type to results, if no explicit parameter was provided\n T extends {\n queryFn?:\n | QueryFunction\n | SkipTokenForUseQueries\n select?: (data: any) => infer TData\n throwOnError?: ThrowOnError\n }\n ? GetDefinedOrUndefinedQueryResult<\n T,\n unknown extends TData ? TQueryFnData : TData,\n unknown extends TError ? DefaultError : TError\n >\n : // Fallback\n UseQueryResult\n\n/**\n * QueriesOptions reducer recursively unwraps function arguments to infer/enforce type param\n */\nexport type QueriesOptions<\n T extends Array,\n TResults extends Array = [],\n TDepth extends ReadonlyArray = [],\n> = TDepth['length'] extends MAXIMUM_DEPTH\n ? Array\n : T extends []\n ? []\n : T extends [infer Head]\n ? [...TResults, GetUseQueryOptionsForUseQueries]\n : T extends [infer Head, ...infer Tails]\n ? QueriesOptions<\n [...Tails],\n [...TResults, GetUseQueryOptionsForUseQueries],\n [...TDepth, 1]\n >\n : ReadonlyArray extends T\n ? T\n : // If T is *some* array but we couldn't assign unknown[] to it, then it must hold some known/homogenous type!\n // use this to infer the param types in the case of Array.map() argument\n T extends Array<\n UseQueryOptionsForUseQueries<\n infer TQueryFnData,\n infer TError,\n infer TData,\n infer TQueryKey\n >\n >\n ? Array<\n UseQueryOptionsForUseQueries<\n TQueryFnData,\n TError,\n TData,\n TQueryKey\n >\n >\n : // Fallback\n Array\n\n/**\n * QueriesResults reducer recursively maps type param to results\n */\nexport type QueriesResults<\n T extends Array,\n TResults extends Array = [],\n TDepth extends ReadonlyArray = [],\n> = TDepth['length'] extends MAXIMUM_DEPTH\n ? Array\n : T extends []\n ? []\n : T extends [infer Head]\n ? [...TResults, GetUseQueryResult]\n : T extends [infer Head, ...infer Tails]\n ? QueriesResults<\n [...Tails],\n [...TResults, GetUseQueryResult],\n [...TDepth, 1]\n >\n : { [K in keyof T]: GetUseQueryResult }\n\nexport function useQueries<\n T extends Array,\n TCombinedResult = QueriesResults,\n>(\n {\n queries,\n ...options\n }: {\n queries:\n | readonly [...QueriesOptions]\n | readonly [...{ [K in keyof T]: GetUseQueryOptionsForUseQueries }]\n combine?: (result: QueriesResults) => TCombinedResult\n subscribed?: boolean\n },\n queryClient?: QueryClient,\n): TCombinedResult {\n const client = useQueryClient(queryClient)\n const isRestoring = useIsRestoring()\n const errorResetBoundary = useQueryErrorResetBoundary()\n\n const defaultedQueries = React.useMemo(\n () =>\n queries.map((opts) => {\n const defaultedOptions = client.defaultQueryOptions(\n opts as QueryObserverOptions,\n )\n\n // Make sure the results are already in fetching state before subscribing or updating options\n defaultedOptions._optimisticResults = isRestoring\n ? 'isRestoring'\n : 'optimistic'\n\n return defaultedOptions\n }),\n [queries, client, isRestoring],\n )\n\n defaultedQueries.forEach((queryOptions) => {\n ensureSuspenseTimers(queryOptions)\n const query = client.getQueryCache().get(queryOptions.queryHash)\n ensurePreventErrorBoundaryRetry(queryOptions, errorResetBoundary, query)\n })\n\n useClearResetErrorBoundary(errorResetBoundary)\n\n const [observer] = React.useState(\n () =>\n new QueriesObserver(\n client,\n defaultedQueries,\n options as QueriesObserverOptions,\n ),\n )\n\n // note: this must be called before useSyncExternalStore\n const [optimisticResult, getCombinedResult, trackResult] =\n observer.getOptimisticResult(\n defaultedQueries,\n (options as QueriesObserverOptions).combine,\n )\n\n const shouldSubscribe = !isRestoring && options.subscribed !== false\n React.useSyncExternalStore(\n React.useCallback(\n (onStoreChange) =>\n shouldSubscribe\n ? observer.subscribe(notifyManager.batchCalls(onStoreChange))\n : noop,\n [observer, shouldSubscribe],\n ),\n () => observer.getCurrentResult(),\n () => observer.getCurrentResult(),\n )\n\n React.useEffect(() => {\n observer.setQueries(\n defaultedQueries,\n options as QueriesObserverOptions,\n )\n }, [defaultedQueries, options, observer])\n\n const shouldAtLeastOneSuspend = optimisticResult.some((result, index) =>\n shouldSuspend(defaultedQueries[index], result),\n )\n\n const suspensePromises = shouldAtLeastOneSuspend\n ? optimisticResult.flatMap((result, index) => {\n const opts = defaultedQueries[index]\n\n if (opts && shouldSuspend(opts, result)) {\n const queryObserver = new QueryObserver(client, opts)\n return fetchOptimistic(opts, queryObserver, errorResetBoundary)\n }\n return []\n })\n : []\n\n if (suspensePromises.length > 0) {\n throw Promise.all(suspensePromises)\n }\n const firstSingleResultWhichShouldThrow = optimisticResult.find(\n (result, index) => {\n const query = defaultedQueries[index]\n return (\n query &&\n getHasError({\n result,\n errorResetBoundary,\n throwOnError: query.throwOnError,\n query: client.getQueryCache().get(query.queryHash),\n suspense: query.suspense,\n })\n )\n },\n )\n\n if (firstSingleResultWhichShouldThrow?.error) {\n throw firstSingleResultWhichShouldThrow.error\n }\n\n return getCombinedResult(trackResult())\n}\n"],"mappings":";;;AACA,YAAY,WAAW;AAEvB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,sBAAsB;AAC/B,SAAS,sBAAsB;AAC/B,SAAS,kCAAkC;AAC3C;AAAA,EACE;AAAA,EACA;AAAA,EAC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BAAiB;AAAA,IAAK,CAAC,QAAQ,UAC7D,cAAc,iBAAiB,KAAK,GAAG,MAAM;AAAA,EAC/C;AAEA,QAAM,mBAAmB,0BACrB,iBAAiB,QAAQ,CAAC,QAAQ,UAAU;AAC1C,UAAM,OAAO,iBAAiB,KAAK;AAEnC,QAAI,QAAQ,cAAc,MAAM,MAAM,GAAG;AACvC,YAAM,gBAAgB,IAAI,cAAc,QAAQ,IAAI;AACpD,aAAO,gBAAgB,MAAM,eAAe,kBAAkB;AAAA,IAChE;AACA,WAAO,CAAC;AAAA,EACV,CAAC,IACD,CAAC;AAEL,MAAI,iBAAiB,SAAS,GAAG;AAC/B,UAAM,QAAQ,IAAI,gBAAgB;AAAA,EACpC;AACA,QAAM,oCAAoC,iBAAiB;AAAA,IACzD,CAAC,QAAQ,UAAU;AACjB,YAAM,QAAQ,iBAAiB,KAAK;AACpC,aACE,SACA,YAAY;AAAA,QACV;AAAA,QACA;AAAA,QACA,cAAc,MAAM;AAAA,QACpB,OAAO,OAAO,cAAc,EAAE,IAAI,MAAM,SAAS;AAAA,QACjD,UAAU,MAAM;AAAA,MAClB,CAAC;AAAA,IAEL;AAAA,EACF;AAEA,MAAI,uFAAmC,OAAO;AAC5C,UAAM,kCAAkC;AAAA,EAC1C;AAEA,SAAO,kBAAkB,YAAY,CAAC;AACxC;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/useQuery.cjs b/node_modules/@tanstack/react-query/build/legacy/useQuery.cjs new file mode 100644 index 0000000..993525b --- /dev/null +++ b/node_modules/@tanstack/react-query/build/legacy/useQuery.cjs @@ -0,0 +1,36 @@ +"use strict"; +"use client"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/useQuery.ts +var useQuery_exports = {}; +__export(useQuery_exports, { + useQuery: () => useQuery +}); +module.exports = __toCommonJS(useQuery_exports); +var import_query_core = require("@tanstack/query-core"); +var import_useBaseQuery = require("./useBaseQuery.cjs"); +function useQuery(options, queryClient) { + return (0, import_useBaseQuery.useBaseQuery)(options, import_query_core.QueryObserver, queryClient); +} +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + useQuery +}); +//# sourceMappingURL=useQuery.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/useQuery.cjs.map b/node_modules/@tanstack/react-query/build/legacy/useQuery.cjs.map new file mode 100644 index 0000000..4b0a996 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/legacy/useQuery.cjs.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/useQuery.ts"],"sourcesContent":["'use client'\nimport { QueryObserver } from '@tanstack/query-core'\nimport { useBaseQuery } from './useBaseQuery'\nimport type {\n DefaultError,\n NoInfer,\n QueryClient,\n QueryKey,\n} from '@tanstack/query-core'\nimport type {\n DefinedUseQueryResult,\n UseQueryOptions,\n UseQueryResult,\n} from './types'\nimport type {\n DefinedInitialDataOptions,\n UndefinedInitialDataOptions,\n} from './queryOptions'\n\nexport function useQuery<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n options: DefinedInitialDataOptions,\n queryClient?: QueryClient,\n): DefinedUseQueryResult, TError>\n\nexport function useQuery<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n options: UndefinedInitialDataOptions,\n queryClient?: QueryClient,\n): UseQueryResult, TError>\n\nexport function useQuery<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n options: UseQueryOptions,\n queryClient?: QueryClient,\n): UseQueryResult, TError>\n\nexport function useQuery(options: UseQueryOptions, queryClient?: QueryClient) {\n return useBaseQuery(options, QueryObserver, queryClient)\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,wBAA8B;AAC9B,0BAA6B;AA+CtB,SAAS,SAAS,SAA0B,aAA2B;AAC5E,aAAO,kCAAa,SAAS,iCAAe,WAAW;AACzD;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/useQuery.d.cts b/node_modules/@tanstack/react-query/build/legacy/useQuery.d.cts new file mode 100644 index 0000000..da16840 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/legacy/useQuery.d.cts @@ -0,0 +1,9 @@ +import { DefaultError, QueryKey, QueryClient, NoInfer } from '@tanstack/query-core'; +import { DefinedUseQueryResult, UseQueryResult, UseQueryOptions } from './types.cjs'; +import { DefinedInitialDataOptions, UndefinedInitialDataOptions } from './queryOptions.cjs'; + +declare function useQuery(options: DefinedInitialDataOptions, queryClient?: QueryClient): DefinedUseQueryResult, TError>; +declare function useQuery(options: UndefinedInitialDataOptions, queryClient?: QueryClient): UseQueryResult, TError>; +declare function useQuery(options: UseQueryOptions, queryClient?: QueryClient): UseQueryResult, TError>; + +export { useQuery }; diff --git a/node_modules/@tanstack/react-query/build/legacy/useQuery.d.ts b/node_modules/@tanstack/react-query/build/legacy/useQuery.d.ts new file mode 100644 index 0000000..72bc861 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/legacy/useQuery.d.ts @@ -0,0 +1,9 @@ +import { DefaultError, QueryKey, QueryClient, NoInfer } from '@tanstack/query-core'; +import { DefinedUseQueryResult, UseQueryResult, UseQueryOptions } from './types.js'; +import { DefinedInitialDataOptions, UndefinedInitialDataOptions } from './queryOptions.js'; + +declare function useQuery(options: DefinedInitialDataOptions, queryClient?: QueryClient): DefinedUseQueryResult, TError>; +declare function useQuery(options: UndefinedInitialDataOptions, queryClient?: QueryClient): UseQueryResult, TError>; +declare function useQuery(options: UseQueryOptions, queryClient?: QueryClient): UseQueryResult, TError>; + +export { useQuery }; diff --git a/node_modules/@tanstack/react-query/build/legacy/useQuery.js b/node_modules/@tanstack/react-query/build/legacy/useQuery.js new file mode 100644 index 0000000..6173d62 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/legacy/useQuery.js @@ -0,0 +1,12 @@ +"use client"; + +// src/useQuery.ts +import { QueryObserver } from "@tanstack/query-core"; +import { useBaseQuery } from "./useBaseQuery.js"; +function useQuery(options, queryClient) { + return useBaseQuery(options, QueryObserver, queryClient); +} +export { + useQuery +}; +//# sourceMappingURL=useQuery.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/useQuery.js.map b/node_modules/@tanstack/react-query/build/legacy/useQuery.js.map new file mode 100644 index 0000000..3f4f63f --- /dev/null +++ b/node_modules/@tanstack/react-query/build/legacy/useQuery.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/useQuery.ts"],"sourcesContent":["'use client'\nimport { QueryObserver } from '@tanstack/query-core'\nimport { useBaseQuery } from './useBaseQuery'\nimport type {\n DefaultError,\n NoInfer,\n QueryClient,\n QueryKey,\n} from '@tanstack/query-core'\nimport type {\n DefinedUseQueryResult,\n UseQueryOptions,\n UseQueryResult,\n} from './types'\nimport type {\n DefinedInitialDataOptions,\n UndefinedInitialDataOptions,\n} from './queryOptions'\n\nexport function useQuery<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n options: DefinedInitialDataOptions,\n queryClient?: QueryClient,\n): DefinedUseQueryResult, TError>\n\nexport function useQuery<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n options: UndefinedInitialDataOptions,\n queryClient?: QueryClient,\n): UseQueryResult, TError>\n\nexport function useQuery<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n options: UseQueryOptions,\n queryClient?: QueryClient,\n): UseQueryResult, TError>\n\nexport function useQuery(options: UseQueryOptions, queryClient?: QueryClient) {\n return useBaseQuery(options, QueryObserver, queryClient)\n}\n"],"mappings":";;;AACA,SAAS,qBAAqB;AAC9B,SAAS,oBAAoB;AA+CtB,SAAS,SAAS,SAA0B,aAA2B;AAC5E,SAAO,aAAa,SAAS,eAAe,WAAW;AACzD;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/useSuspenseInfiniteQuery.cjs b/node_modules/@tanstack/react-query/build/legacy/useSuspenseInfiniteQuery.cjs new file mode 100644 index 0000000..1d06bb1 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/legacy/useSuspenseInfiniteQuery.cjs @@ -0,0 +1,51 @@ +"use strict"; +"use client"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/useSuspenseInfiniteQuery.ts +var useSuspenseInfiniteQuery_exports = {}; +__export(useSuspenseInfiniteQuery_exports, { + useSuspenseInfiniteQuery: () => useSuspenseInfiniteQuery +}); +module.exports = __toCommonJS(useSuspenseInfiniteQuery_exports); +var import_query_core = require("@tanstack/query-core"); +var import_useBaseQuery = require("./useBaseQuery.cjs"); +var import_suspense = require("./suspense.cjs"); +function useSuspenseInfiniteQuery(options, queryClient) { + if (process.env.NODE_ENV !== "production") { + if (options.queryFn === import_query_core.skipToken) { + console.error("skipToken is not allowed for useSuspenseInfiniteQuery"); + } + } + return (0, import_useBaseQuery.useBaseQuery)( + { + ...options, + enabled: true, + suspense: true, + throwOnError: import_suspense.defaultThrowOnError + }, + import_query_core.InfiniteQueryObserver, + queryClient + ); +} +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + useSuspenseInfiniteQuery +}); +//# sourceMappingURL=useSuspenseInfiniteQuery.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/useSuspenseInfiniteQuery.cjs.map b/node_modules/@tanstack/react-query/build/legacy/useSuspenseInfiniteQuery.cjs.map new file mode 100644 index 0000000..98d9c0b --- /dev/null +++ b/node_modules/@tanstack/react-query/build/legacy/useSuspenseInfiniteQuery.cjs.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/useSuspenseInfiniteQuery.ts"],"sourcesContent":["'use client'\nimport { InfiniteQueryObserver, skipToken } from '@tanstack/query-core'\nimport { useBaseQuery } from './useBaseQuery'\nimport { defaultThrowOnError } from './suspense'\nimport type {\n DefaultError,\n InfiniteData,\n InfiniteQueryObserverSuccessResult,\n QueryClient,\n QueryKey,\n QueryObserver,\n} from '@tanstack/query-core'\nimport type {\n UseSuspenseInfiniteQueryOptions,\n UseSuspenseInfiniteQueryResult,\n} from './types'\n\nexport function useSuspenseInfiniteQuery<\n TQueryFnData,\n TError = DefaultError,\n TData = InfiniteData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n>(\n options: UseSuspenseInfiniteQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n queryClient?: QueryClient,\n): UseSuspenseInfiniteQueryResult {\n if (process.env.NODE_ENV !== 'production') {\n if ((options.queryFn as any) === skipToken) {\n console.error('skipToken is not allowed for useSuspenseInfiniteQuery')\n }\n }\n\n return useBaseQuery(\n {\n ...options,\n enabled: true,\n suspense: true,\n throwOnError: defaultThrowOnError,\n },\n InfiniteQueryObserver as typeof QueryObserver,\n queryClient,\n ) as InfiniteQueryObserverSuccessResult\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,wBAAiD;AACjD,0BAA6B;AAC7B,sBAAoC;AAc7B,SAAS,yBAOd,SAOA,aAC+C;AAC/C,MAAI,QAAQ,IAAI,aAAa,cAAc;AACzC,QAAK,QAAQ,YAAoB,6BAAW;AAC1C,cAAQ,MAAM,uDAAuD;AAAA,IACvE;AAAA,EACF;AAEA,aAAO;AAAA,IACL;AAAA,MACE,GAAG;AAAA,MACH,SAAS;AAAA,MACT,UAAU;AAAA,MACV,cAAc;AAAA,IAChB;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/useSuspenseInfiniteQuery.d.cts b/node_modules/@tanstack/react-query/build/legacy/useSuspenseInfiniteQuery.d.cts new file mode 100644 index 0000000..e056e82 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/legacy/useSuspenseInfiniteQuery.d.cts @@ -0,0 +1,6 @@ +import { DefaultError, InfiniteData, QueryKey, QueryClient } from '@tanstack/query-core'; +import { UseSuspenseInfiniteQueryOptions, UseSuspenseInfiniteQueryResult } from './types.cjs'; + +declare function useSuspenseInfiniteQuery, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown>(options: UseSuspenseInfiniteQueryOptions, queryClient?: QueryClient): UseSuspenseInfiniteQueryResult; + +export { useSuspenseInfiniteQuery }; diff --git a/node_modules/@tanstack/react-query/build/legacy/useSuspenseInfiniteQuery.d.ts b/node_modules/@tanstack/react-query/build/legacy/useSuspenseInfiniteQuery.d.ts new file mode 100644 index 0000000..42d7b61 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/legacy/useSuspenseInfiniteQuery.d.ts @@ -0,0 +1,6 @@ +import { DefaultError, InfiniteData, QueryKey, QueryClient } from '@tanstack/query-core'; +import { UseSuspenseInfiniteQueryOptions, UseSuspenseInfiniteQueryResult } from './types.js'; + +declare function useSuspenseInfiniteQuery, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown>(options: UseSuspenseInfiniteQueryOptions, queryClient?: QueryClient): UseSuspenseInfiniteQueryResult; + +export { useSuspenseInfiniteQuery }; diff --git a/node_modules/@tanstack/react-query/build/legacy/useSuspenseInfiniteQuery.js b/node_modules/@tanstack/react-query/build/legacy/useSuspenseInfiniteQuery.js new file mode 100644 index 0000000..7c8facf --- /dev/null +++ b/node_modules/@tanstack/react-query/build/legacy/useSuspenseInfiniteQuery.js @@ -0,0 +1,27 @@ +"use client"; + +// src/useSuspenseInfiniteQuery.ts +import { InfiniteQueryObserver, skipToken } from "@tanstack/query-core"; +import { useBaseQuery } from "./useBaseQuery.js"; +import { defaultThrowOnError } from "./suspense.js"; +function useSuspenseInfiniteQuery(options, queryClient) { + if (process.env.NODE_ENV !== "production") { + if (options.queryFn === skipToken) { + console.error("skipToken is not allowed for useSuspenseInfiniteQuery"); + } + } + return useBaseQuery( + { + ...options, + enabled: true, + suspense: true, + throwOnError: defaultThrowOnError + }, + InfiniteQueryObserver, + queryClient + ); +} +export { + useSuspenseInfiniteQuery +}; +//# sourceMappingURL=useSuspenseInfiniteQuery.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/useSuspenseInfiniteQuery.js.map b/node_modules/@tanstack/react-query/build/legacy/useSuspenseInfiniteQuery.js.map new file mode 100644 index 0000000..a4937c6 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/legacy/useSuspenseInfiniteQuery.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/useSuspenseInfiniteQuery.ts"],"sourcesContent":["'use client'\nimport { InfiniteQueryObserver, skipToken } from '@tanstack/query-core'\nimport { useBaseQuery } from './useBaseQuery'\nimport { defaultThrowOnError } from './suspense'\nimport type {\n DefaultError,\n InfiniteData,\n InfiniteQueryObserverSuccessResult,\n QueryClient,\n QueryKey,\n QueryObserver,\n} from '@tanstack/query-core'\nimport type {\n UseSuspenseInfiniteQueryOptions,\n UseSuspenseInfiniteQueryResult,\n} from './types'\n\nexport function useSuspenseInfiniteQuery<\n TQueryFnData,\n TError = DefaultError,\n TData = InfiniteData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n>(\n options: UseSuspenseInfiniteQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n queryClient?: QueryClient,\n): UseSuspenseInfiniteQueryResult {\n if (process.env.NODE_ENV !== 'production') {\n if ((options.queryFn as any) === skipToken) {\n console.error('skipToken is not allowed for useSuspenseInfiniteQuery')\n }\n }\n\n return useBaseQuery(\n {\n ...options,\n enabled: true,\n suspense: true,\n throwOnError: defaultThrowOnError,\n },\n InfiniteQueryObserver as typeof QueryObserver,\n queryClient,\n ) as InfiniteQueryObserverSuccessResult\n}\n"],"mappings":";;;AACA,SAAS,uBAAuB,iBAAiB;AACjD,SAAS,oBAAoB;AAC7B,SAAS,2BAA2B;AAc7B,SAAS,yBAOd,SAOA,aAC+C;AAC/C,MAAI,QAAQ,IAAI,aAAa,cAAc;AACzC,QAAK,QAAQ,YAAoB,WAAW;AAC1C,cAAQ,MAAM,uDAAuD;AAAA,IACvE;AAAA,EACF;AAEA,SAAO;AAAA,IACL;AAAA,MACE,GAAG;AAAA,MACH,SAAS;AAAA,MACT,UAAU;AAAA,MACV,cAAc;AAAA,IAChB;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/useSuspenseQueries.cjs b/node_modules/@tanstack/react-query/build/legacy/useSuspenseQueries.cjs new file mode 100644 index 0000000..75f86ef --- /dev/null +++ b/node_modules/@tanstack/react-query/build/legacy/useSuspenseQueries.cjs @@ -0,0 +1,56 @@ +"use strict"; +"use client"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/useSuspenseQueries.ts +var useSuspenseQueries_exports = {}; +__export(useSuspenseQueries_exports, { + useSuspenseQueries: () => useSuspenseQueries +}); +module.exports = __toCommonJS(useSuspenseQueries_exports); +var import_query_core = require("@tanstack/query-core"); +var import_useQueries = require("./useQueries.cjs"); +var import_suspense = require("./suspense.cjs"); +function useSuspenseQueries(options, queryClient) { + return (0, import_useQueries.useQueries)( + { + ...options, + queries: options.queries.map((query) => { + if (process.env.NODE_ENV !== "production") { + if (query.queryFn === import_query_core.skipToken) { + console.error("skipToken is not allowed for useSuspenseQueries"); + } + } + return { + ...query, + suspense: true, + throwOnError: import_suspense.defaultThrowOnError, + enabled: true, + placeholderData: void 0 + }; + }) + }, + queryClient + ); +} +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + useSuspenseQueries +}); +//# sourceMappingURL=useSuspenseQueries.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/useSuspenseQueries.cjs.map b/node_modules/@tanstack/react-query/build/legacy/useSuspenseQueries.cjs.map new file mode 100644 index 0000000..f8548ca --- /dev/null +++ b/node_modules/@tanstack/react-query/build/legacy/useSuspenseQueries.cjs.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/useSuspenseQueries.ts"],"sourcesContent":["'use client'\nimport { skipToken } from '@tanstack/query-core'\nimport { useQueries } from './useQueries'\nimport { defaultThrowOnError } from './suspense'\nimport type { UseSuspenseQueryOptions, UseSuspenseQueryResult } from './types'\nimport type {\n DefaultError,\n QueryClient,\n QueryFunction,\n ThrowOnError,\n} from '@tanstack/query-core'\n\n// Avoid TS depth-limit error in case of large array literal\ntype MAXIMUM_DEPTH = 20\n\n// Widen the type of the symbol to enable type inference even if skipToken is not immutable.\ntype SkipTokenForUseQueries = symbol\n\ntype GetUseSuspenseQueryOptions =\n // Part 1: responsible for applying explicit type parameter to function arguments, if object { queryFnData: TQueryFnData, error: TError, data: TData }\n T extends {\n queryFnData: infer TQueryFnData\n error?: infer TError\n data: infer TData\n }\n ? UseSuspenseQueryOptions\n : T extends { queryFnData: infer TQueryFnData; error?: infer TError }\n ? UseSuspenseQueryOptions\n : T extends { data: infer TData; error?: infer TError }\n ? UseSuspenseQueryOptions\n : // Part 2: responsible for applying explicit type parameter to function arguments, if tuple [TQueryFnData, TError, TData]\n T extends [infer TQueryFnData, infer TError, infer TData]\n ? UseSuspenseQueryOptions\n : T extends [infer TQueryFnData, infer TError]\n ? UseSuspenseQueryOptions\n : T extends [infer TQueryFnData]\n ? UseSuspenseQueryOptions\n : // Part 3: responsible for inferring and enforcing type if no explicit parameter was provided\n T extends {\n queryFn?:\n | QueryFunction\n | SkipTokenForUseQueries\n select?: (data: any) => infer TData\n throwOnError?: ThrowOnError\n }\n ? UseSuspenseQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey\n >\n : T extends {\n queryFn?:\n | QueryFunction\n | SkipTokenForUseQueries\n throwOnError?: ThrowOnError\n }\n ? UseSuspenseQueryOptions<\n TQueryFnData,\n TError,\n TQueryFnData,\n TQueryKey\n >\n : // Fallback\n UseSuspenseQueryOptions\n\ntype GetUseSuspenseQueryResult =\n // Part 1: responsible for mapping explicit type parameter to function result, if object\n T extends { queryFnData: any; error?: infer TError; data: infer TData }\n ? UseSuspenseQueryResult\n : T extends { queryFnData: infer TQueryFnData; error?: infer TError }\n ? UseSuspenseQueryResult\n : T extends { data: infer TData; error?: infer TError }\n ? UseSuspenseQueryResult\n : // Part 2: responsible for mapping explicit type parameter to function result, if tuple\n T extends [any, infer TError, infer TData]\n ? UseSuspenseQueryResult\n : T extends [infer TQueryFnData, infer TError]\n ? UseSuspenseQueryResult\n : T extends [infer TQueryFnData]\n ? UseSuspenseQueryResult\n : // Part 3: responsible for mapping inferred type to results, if no explicit parameter was provided\n T extends {\n queryFn?:\n | QueryFunction\n | SkipTokenForUseQueries\n select?: (data: any) => infer TData\n throwOnError?: ThrowOnError\n }\n ? UseSuspenseQueryResult<\n unknown extends TData ? TQueryFnData : TData,\n unknown extends TError ? DefaultError : TError\n >\n : T extends {\n queryFn?:\n | QueryFunction\n | SkipTokenForUseQueries\n throwOnError?: ThrowOnError\n }\n ? UseSuspenseQueryResult<\n TQueryFnData,\n unknown extends TError ? DefaultError : TError\n >\n : // Fallback\n UseSuspenseQueryResult\n\n/**\n * SuspenseQueriesOptions reducer recursively unwraps function arguments to infer/enforce type param\n */\nexport type SuspenseQueriesOptions<\n T extends Array,\n TResults extends Array = [],\n TDepth extends ReadonlyArray = [],\n> = TDepth['length'] extends MAXIMUM_DEPTH\n ? Array\n : T extends []\n ? []\n : T extends [infer Head]\n ? [...TResults, GetUseSuspenseQueryOptions]\n : T extends [infer Head, ...infer Tails]\n ? SuspenseQueriesOptions<\n [...Tails],\n [...TResults, GetUseSuspenseQueryOptions],\n [...TDepth, 1]\n >\n : Array extends T\n ? T\n : // If T is *some* array but we couldn't assign unknown[] to it, then it must hold some known/homogenous type!\n // use this to infer the param types in the case of Array.map() argument\n T extends Array<\n UseSuspenseQueryOptions<\n infer TQueryFnData,\n infer TError,\n infer TData,\n infer TQueryKey\n >\n >\n ? Array<\n UseSuspenseQueryOptions\n >\n : // Fallback\n Array\n\n/**\n * SuspenseQueriesResults reducer recursively maps type param to results\n */\nexport type SuspenseQueriesResults<\n T extends Array,\n TResults extends Array = [],\n TDepth extends ReadonlyArray = [],\n> = TDepth['length'] extends MAXIMUM_DEPTH\n ? Array\n : T extends []\n ? []\n : T extends [infer Head]\n ? [...TResults, GetUseSuspenseQueryResult]\n : T extends [infer Head, ...infer Tails]\n ? SuspenseQueriesResults<\n [...Tails],\n [...TResults, GetUseSuspenseQueryResult],\n [...TDepth, 1]\n >\n : { [K in keyof T]: GetUseSuspenseQueryResult }\n\nexport function useSuspenseQueries<\n T extends Array,\n TCombinedResult = SuspenseQueriesResults,\n>(\n options: {\n queries:\n | readonly [...SuspenseQueriesOptions]\n | readonly [...{ [K in keyof T]: GetUseSuspenseQueryOptions }]\n combine?: (result: SuspenseQueriesResults) => TCombinedResult\n },\n queryClient?: QueryClient,\n): TCombinedResult\n\nexport function useSuspenseQueries<\n T extends Array,\n TCombinedResult = SuspenseQueriesResults,\n>(\n options: {\n queries: readonly [...SuspenseQueriesOptions]\n combine?: (result: SuspenseQueriesResults) => TCombinedResult\n },\n queryClient?: QueryClient,\n): TCombinedResult\n\nexport function useSuspenseQueries(options: any, queryClient?: QueryClient) {\n return useQueries(\n {\n ...options,\n queries: options.queries.map((query: any) => {\n if (process.env.NODE_ENV !== 'production') {\n if (query.queryFn === skipToken) {\n console.error('skipToken is not allowed for useSuspenseQueries')\n }\n }\n\n return {\n ...query,\n suspense: true,\n throwOnError: defaultThrowOnError,\n enabled: true,\n placeholderData: undefined,\n }\n }),\n },\n queryClient,\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,wBAA0B;AAC1B,wBAA2B;AAC3B,sBAAoC;AAyL7B,SAAS,mBAAmB,SAAc,aAA2B;AAC1E,aAAO;AAAA,IACL;AAAA,MACE,GAAG;AAAA,MACH,SAAS,QAAQ,QAAQ,IAAI,CAAC,UAAe;AAC3C,YAAI,QAAQ,IAAI,aAAa,cAAc;AACzC,cAAI,MAAM,YAAY,6BAAW;AAC/B,oBAAQ,MAAM,iDAAiD;AAAA,UACjE;AAAA,QACF;AAEA,eAAO;AAAA,UACL,GAAG;AAAA,UACH,UAAU;AAAA,UACV,cAAc;AAAA,UACd,SAAS;AAAA,UACT,iBAAiB;AAAA,QACnB;AAAA,MACF,CAAC;AAAA,IACH;AAAA,IACA;AAAA,EACF;AACF;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/useSuspenseQueries.d.cts b/node_modules/@tanstack/react-query/build/legacy/useSuspenseQueries.d.cts new file mode 100644 index 0000000..f3f9618 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/legacy/useSuspenseQueries.d.cts @@ -0,0 +1,79 @@ +import { UseSuspenseQueryOptions, UseSuspenseQueryResult } from './types.cjs'; +import { QueryFunction, ThrowOnError, DefaultError, QueryClient } from '@tanstack/query-core'; + +type MAXIMUM_DEPTH = 20; +type SkipTokenForUseQueries = symbol; +type GetUseSuspenseQueryOptions = T extends { + queryFnData: infer TQueryFnData; + error?: infer TError; + data: infer TData; +} ? UseSuspenseQueryOptions : T extends { + queryFnData: infer TQueryFnData; + error?: infer TError; +} ? UseSuspenseQueryOptions : T extends { + data: infer TData; + error?: infer TError; +} ? UseSuspenseQueryOptions : T extends [infer TQueryFnData, infer TError, infer TData] ? UseSuspenseQueryOptions : T extends [infer TQueryFnData, infer TError] ? UseSuspenseQueryOptions : T extends [infer TQueryFnData] ? UseSuspenseQueryOptions : T extends { + queryFn?: QueryFunction | SkipTokenForUseQueries; + select?: (data: any) => infer TData; + throwOnError?: ThrowOnError; +} ? UseSuspenseQueryOptions : T extends { + queryFn?: QueryFunction | SkipTokenForUseQueries; + throwOnError?: ThrowOnError; +} ? UseSuspenseQueryOptions : UseSuspenseQueryOptions; +type GetUseSuspenseQueryResult = T extends { + queryFnData: any; + error?: infer TError; + data: infer TData; +} ? UseSuspenseQueryResult : T extends { + queryFnData: infer TQueryFnData; + error?: infer TError; +} ? UseSuspenseQueryResult : T extends { + data: infer TData; + error?: infer TError; +} ? UseSuspenseQueryResult : T extends [any, infer TError, infer TData] ? UseSuspenseQueryResult : T extends [infer TQueryFnData, infer TError] ? UseSuspenseQueryResult : T extends [infer TQueryFnData] ? UseSuspenseQueryResult : T extends { + queryFn?: QueryFunction | SkipTokenForUseQueries; + select?: (data: any) => infer TData; + throwOnError?: ThrowOnError; +} ? UseSuspenseQueryResult : T extends { + queryFn?: QueryFunction | SkipTokenForUseQueries; + throwOnError?: ThrowOnError; +} ? UseSuspenseQueryResult : UseSuspenseQueryResult; +/** + * SuspenseQueriesOptions reducer recursively unwraps function arguments to infer/enforce type param + */ +type SuspenseQueriesOptions, TResults extends Array = [], TDepth extends ReadonlyArray = []> = TDepth['length'] extends MAXIMUM_DEPTH ? Array : T extends [] ? [] : T extends [infer Head] ? [...TResults, GetUseSuspenseQueryOptions] : T extends [infer Head, ...infer Tails] ? SuspenseQueriesOptions<[ + ...Tails +], [ + ...TResults, + GetUseSuspenseQueryOptions +], [ + ...TDepth, + 1 +]> : Array extends T ? T : T extends Array> ? Array> : Array; +/** + * SuspenseQueriesResults reducer recursively maps type param to results + */ +type SuspenseQueriesResults, TResults extends Array = [], TDepth extends ReadonlyArray = []> = TDepth['length'] extends MAXIMUM_DEPTH ? Array : T extends [] ? [] : T extends [infer Head] ? [...TResults, GetUseSuspenseQueryResult] : T extends [infer Head, ...infer Tails] ? SuspenseQueriesResults<[ + ...Tails +], [ + ...TResults, + GetUseSuspenseQueryResult +], [ + ...TDepth, + 1 +]> : { + [K in keyof T]: GetUseSuspenseQueryResult; +}; +declare function useSuspenseQueries, TCombinedResult = SuspenseQueriesResults>(options: { + queries: readonly [...SuspenseQueriesOptions] | readonly [...{ + [K in keyof T]: GetUseSuspenseQueryOptions; + }]; + combine?: (result: SuspenseQueriesResults) => TCombinedResult; +}, queryClient?: QueryClient): TCombinedResult; +declare function useSuspenseQueries, TCombinedResult = SuspenseQueriesResults>(options: { + queries: readonly [...SuspenseQueriesOptions]; + combine?: (result: SuspenseQueriesResults) => TCombinedResult; +}, queryClient?: QueryClient): TCombinedResult; + +export { type SuspenseQueriesOptions, type SuspenseQueriesResults, useSuspenseQueries }; diff --git a/node_modules/@tanstack/react-query/build/legacy/useSuspenseQueries.d.ts b/node_modules/@tanstack/react-query/build/legacy/useSuspenseQueries.d.ts new file mode 100644 index 0000000..300e26f --- /dev/null +++ b/node_modules/@tanstack/react-query/build/legacy/useSuspenseQueries.d.ts @@ -0,0 +1,79 @@ +import { UseSuspenseQueryOptions, UseSuspenseQueryResult } from './types.js'; +import { QueryFunction, ThrowOnError, DefaultError, QueryClient } from '@tanstack/query-core'; + +type MAXIMUM_DEPTH = 20; +type SkipTokenForUseQueries = symbol; +type GetUseSuspenseQueryOptions = T extends { + queryFnData: infer TQueryFnData; + error?: infer TError; + data: infer TData; +} ? UseSuspenseQueryOptions : T extends { + queryFnData: infer TQueryFnData; + error?: infer TError; +} ? UseSuspenseQueryOptions : T extends { + data: infer TData; + error?: infer TError; +} ? UseSuspenseQueryOptions : T extends [infer TQueryFnData, infer TError, infer TData] ? UseSuspenseQueryOptions : T extends [infer TQueryFnData, infer TError] ? UseSuspenseQueryOptions : T extends [infer TQueryFnData] ? UseSuspenseQueryOptions : T extends { + queryFn?: QueryFunction | SkipTokenForUseQueries; + select?: (data: any) => infer TData; + throwOnError?: ThrowOnError; +} ? UseSuspenseQueryOptions : T extends { + queryFn?: QueryFunction | SkipTokenForUseQueries; + throwOnError?: ThrowOnError; +} ? UseSuspenseQueryOptions : UseSuspenseQueryOptions; +type GetUseSuspenseQueryResult = T extends { + queryFnData: any; + error?: infer TError; + data: infer TData; +} ? UseSuspenseQueryResult : T extends { + queryFnData: infer TQueryFnData; + error?: infer TError; +} ? UseSuspenseQueryResult : T extends { + data: infer TData; + error?: infer TError; +} ? UseSuspenseQueryResult : T extends [any, infer TError, infer TData] ? UseSuspenseQueryResult : T extends [infer TQueryFnData, infer TError] ? UseSuspenseQueryResult : T extends [infer TQueryFnData] ? UseSuspenseQueryResult : T extends { + queryFn?: QueryFunction | SkipTokenForUseQueries; + select?: (data: any) => infer TData; + throwOnError?: ThrowOnError; +} ? UseSuspenseQueryResult : T extends { + queryFn?: QueryFunction | SkipTokenForUseQueries; + throwOnError?: ThrowOnError; +} ? UseSuspenseQueryResult : UseSuspenseQueryResult; +/** + * SuspenseQueriesOptions reducer recursively unwraps function arguments to infer/enforce type param + */ +type SuspenseQueriesOptions, TResults extends Array = [], TDepth extends ReadonlyArray = []> = TDepth['length'] extends MAXIMUM_DEPTH ? Array : T extends [] ? [] : T extends [infer Head] ? [...TResults, GetUseSuspenseQueryOptions] : T extends [infer Head, ...infer Tails] ? SuspenseQueriesOptions<[ + ...Tails +], [ + ...TResults, + GetUseSuspenseQueryOptions +], [ + ...TDepth, + 1 +]> : Array extends T ? T : T extends Array> ? Array> : Array; +/** + * SuspenseQueriesResults reducer recursively maps type param to results + */ +type SuspenseQueriesResults, TResults extends Array = [], TDepth extends ReadonlyArray = []> = TDepth['length'] extends MAXIMUM_DEPTH ? Array : T extends [] ? [] : T extends [infer Head] ? [...TResults, GetUseSuspenseQueryResult] : T extends [infer Head, ...infer Tails] ? SuspenseQueriesResults<[ + ...Tails +], [ + ...TResults, + GetUseSuspenseQueryResult +], [ + ...TDepth, + 1 +]> : { + [K in keyof T]: GetUseSuspenseQueryResult; +}; +declare function useSuspenseQueries, TCombinedResult = SuspenseQueriesResults>(options: { + queries: readonly [...SuspenseQueriesOptions] | readonly [...{ + [K in keyof T]: GetUseSuspenseQueryOptions; + }]; + combine?: (result: SuspenseQueriesResults) => TCombinedResult; +}, queryClient?: QueryClient): TCombinedResult; +declare function useSuspenseQueries, TCombinedResult = SuspenseQueriesResults>(options: { + queries: readonly [...SuspenseQueriesOptions]; + combine?: (result: SuspenseQueriesResults) => TCombinedResult; +}, queryClient?: QueryClient): TCombinedResult; + +export { type SuspenseQueriesOptions, type SuspenseQueriesResults, useSuspenseQueries }; diff --git a/node_modules/@tanstack/react-query/build/legacy/useSuspenseQueries.js b/node_modules/@tanstack/react-query/build/legacy/useSuspenseQueries.js new file mode 100644 index 0000000..a6f0445 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/legacy/useSuspenseQueries.js @@ -0,0 +1,32 @@ +"use client"; + +// src/useSuspenseQueries.ts +import { skipToken } from "@tanstack/query-core"; +import { useQueries } from "./useQueries.js"; +import { defaultThrowOnError } from "./suspense.js"; +function useSuspenseQueries(options, queryClient) { + return useQueries( + { + ...options, + queries: options.queries.map((query) => { + if (process.env.NODE_ENV !== "production") { + if (query.queryFn === skipToken) { + console.error("skipToken is not allowed for useSuspenseQueries"); + } + } + return { + ...query, + suspense: true, + throwOnError: defaultThrowOnError, + enabled: true, + placeholderData: void 0 + }; + }) + }, + queryClient + ); +} +export { + useSuspenseQueries +}; +//# sourceMappingURL=useSuspenseQueries.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/useSuspenseQueries.js.map b/node_modules/@tanstack/react-query/build/legacy/useSuspenseQueries.js.map new file mode 100644 index 0000000..ee09004 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/legacy/useSuspenseQueries.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/useSuspenseQueries.ts"],"sourcesContent":["'use client'\nimport { skipToken } from '@tanstack/query-core'\nimport { useQueries } from './useQueries'\nimport { defaultThrowOnError } from './suspense'\nimport type { UseSuspenseQueryOptions, UseSuspenseQueryResult } from './types'\nimport type {\n DefaultError,\n QueryClient,\n QueryFunction,\n ThrowOnError,\n} from '@tanstack/query-core'\n\n// Avoid TS depth-limit error in case of large array literal\ntype MAXIMUM_DEPTH = 20\n\n// Widen the type of the symbol to enable type inference even if skipToken is not immutable.\ntype SkipTokenForUseQueries = symbol\n\ntype GetUseSuspenseQueryOptions =\n // Part 1: responsible for applying explicit type parameter to function arguments, if object { queryFnData: TQueryFnData, error: TError, data: TData }\n T extends {\n queryFnData: infer TQueryFnData\n error?: infer TError\n data: infer TData\n }\n ? UseSuspenseQueryOptions\n : T extends { queryFnData: infer TQueryFnData; error?: infer TError }\n ? UseSuspenseQueryOptions\n : T extends { data: infer TData; error?: infer TError }\n ? UseSuspenseQueryOptions\n : // Part 2: responsible for applying explicit type parameter to function arguments, if tuple [TQueryFnData, TError, TData]\n T extends [infer TQueryFnData, infer TError, infer TData]\n ? UseSuspenseQueryOptions\n : T extends [infer TQueryFnData, infer TError]\n ? UseSuspenseQueryOptions\n : T extends [infer TQueryFnData]\n ? UseSuspenseQueryOptions\n : // Part 3: responsible for inferring and enforcing type if no explicit parameter was provided\n T extends {\n queryFn?:\n | QueryFunction\n | SkipTokenForUseQueries\n select?: (data: any) => infer TData\n throwOnError?: ThrowOnError\n }\n ? UseSuspenseQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey\n >\n : T extends {\n queryFn?:\n | QueryFunction\n | SkipTokenForUseQueries\n throwOnError?: ThrowOnError\n }\n ? UseSuspenseQueryOptions<\n TQueryFnData,\n TError,\n TQueryFnData,\n TQueryKey\n >\n : // Fallback\n UseSuspenseQueryOptions\n\ntype GetUseSuspenseQueryResult =\n // Part 1: responsible for mapping explicit type parameter to function result, if object\n T extends { queryFnData: any; error?: infer TError; data: infer TData }\n ? UseSuspenseQueryResult\n : T extends { queryFnData: infer TQueryFnData; error?: infer TError }\n ? UseSuspenseQueryResult\n : T extends { data: infer TData; error?: infer TError }\n ? UseSuspenseQueryResult\n : // Part 2: responsible for mapping explicit type parameter to function result, if tuple\n T extends [any, infer TError, infer TData]\n ? UseSuspenseQueryResult\n : T extends [infer TQueryFnData, infer TError]\n ? UseSuspenseQueryResult\n : T extends [infer TQueryFnData]\n ? UseSuspenseQueryResult\n : // Part 3: responsible for mapping inferred type to results, if no explicit parameter was provided\n T extends {\n queryFn?:\n | QueryFunction\n | SkipTokenForUseQueries\n select?: (data: any) => infer TData\n throwOnError?: ThrowOnError\n }\n ? UseSuspenseQueryResult<\n unknown extends TData ? TQueryFnData : TData,\n unknown extends TError ? DefaultError : TError\n >\n : T extends {\n queryFn?:\n | QueryFunction\n | SkipTokenForUseQueries\n throwOnError?: ThrowOnError\n }\n ? UseSuspenseQueryResult<\n TQueryFnData,\n unknown extends TError ? DefaultError : TError\n >\n : // Fallback\n UseSuspenseQueryResult\n\n/**\n * SuspenseQueriesOptions reducer recursively unwraps function arguments to infer/enforce type param\n */\nexport type SuspenseQueriesOptions<\n T extends Array,\n TResults extends Array = [],\n TDepth extends ReadonlyArray = [],\n> = TDepth['length'] extends MAXIMUM_DEPTH\n ? Array\n : T extends []\n ? []\n : T extends [infer Head]\n ? [...TResults, GetUseSuspenseQueryOptions]\n : T extends [infer Head, ...infer Tails]\n ? SuspenseQueriesOptions<\n [...Tails],\n [...TResults, GetUseSuspenseQueryOptions],\n [...TDepth, 1]\n >\n : Array extends T\n ? T\n : // If T is *some* array but we couldn't assign unknown[] to it, then it must hold some known/homogenous type!\n // use this to infer the param types in the case of Array.map() argument\n T extends Array<\n UseSuspenseQueryOptions<\n infer TQueryFnData,\n infer TError,\n infer TData,\n infer TQueryKey\n >\n >\n ? Array<\n UseSuspenseQueryOptions\n >\n : // Fallback\n Array\n\n/**\n * SuspenseQueriesResults reducer recursively maps type param to results\n */\nexport type SuspenseQueriesResults<\n T extends Array,\n TResults extends Array = [],\n TDepth extends ReadonlyArray = [],\n> = TDepth['length'] extends MAXIMUM_DEPTH\n ? Array\n : T extends []\n ? []\n : T extends [infer Head]\n ? [...TResults, GetUseSuspenseQueryResult]\n : T extends [infer Head, ...infer Tails]\n ? SuspenseQueriesResults<\n [...Tails],\n [...TResults, GetUseSuspenseQueryResult],\n [...TDepth, 1]\n >\n : { [K in keyof T]: GetUseSuspenseQueryResult }\n\nexport function useSuspenseQueries<\n T extends Array,\n TCombinedResult = SuspenseQueriesResults,\n>(\n options: {\n queries:\n | readonly [...SuspenseQueriesOptions]\n | readonly [...{ [K in keyof T]: GetUseSuspenseQueryOptions }]\n combine?: (result: SuspenseQueriesResults) => TCombinedResult\n },\n queryClient?: QueryClient,\n): TCombinedResult\n\nexport function useSuspenseQueries<\n T extends Array,\n TCombinedResult = SuspenseQueriesResults,\n>(\n options: {\n queries: readonly [...SuspenseQueriesOptions]\n combine?: (result: SuspenseQueriesResults) => TCombinedResult\n },\n queryClient?: QueryClient,\n): TCombinedResult\n\nexport function useSuspenseQueries(options: any, queryClient?: QueryClient) {\n return useQueries(\n {\n ...options,\n queries: options.queries.map((query: any) => {\n if (process.env.NODE_ENV !== 'production') {\n if (query.queryFn === skipToken) {\n console.error('skipToken is not allowed for useSuspenseQueries')\n }\n }\n\n return {\n ...query,\n suspense: true,\n throwOnError: defaultThrowOnError,\n enabled: true,\n placeholderData: undefined,\n }\n }),\n },\n queryClient,\n )\n}\n"],"mappings":";;;AACA,SAAS,iBAAiB;AAC1B,SAAS,kBAAkB;AAC3B,SAAS,2BAA2B;AAyL7B,SAAS,mBAAmB,SAAc,aAA2B;AAC1E,SAAO;AAAA,IACL;AAAA,MACE,GAAG;AAAA,MACH,SAAS,QAAQ,QAAQ,IAAI,CAAC,UAAe;AAC3C,YAAI,QAAQ,IAAI,aAAa,cAAc;AACzC,cAAI,MAAM,YAAY,WAAW;AAC/B,oBAAQ,MAAM,iDAAiD;AAAA,UACjE;AAAA,QACF;AAEA,eAAO;AAAA,UACL,GAAG;AAAA,UACH,UAAU;AAAA,UACV,cAAc;AAAA,UACd,SAAS;AAAA,UACT,iBAAiB;AAAA,QACnB;AAAA,MACF,CAAC;AAAA,IACH;AAAA,IACA;AAAA,EACF;AACF;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/useSuspenseQuery.cjs b/node_modules/@tanstack/react-query/build/legacy/useSuspenseQuery.cjs new file mode 100644 index 0000000..dcf18a2 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/legacy/useSuspenseQuery.cjs @@ -0,0 +1,52 @@ +"use strict"; +"use client"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/useSuspenseQuery.ts +var useSuspenseQuery_exports = {}; +__export(useSuspenseQuery_exports, { + useSuspenseQuery: () => useSuspenseQuery +}); +module.exports = __toCommonJS(useSuspenseQuery_exports); +var import_query_core = require("@tanstack/query-core"); +var import_useBaseQuery = require("./useBaseQuery.cjs"); +var import_suspense = require("./suspense.cjs"); +function useSuspenseQuery(options, queryClient) { + if (process.env.NODE_ENV !== "production") { + if (options.queryFn === import_query_core.skipToken) { + console.error("skipToken is not allowed for useSuspenseQuery"); + } + } + return (0, import_useBaseQuery.useBaseQuery)( + { + ...options, + enabled: true, + suspense: true, + throwOnError: import_suspense.defaultThrowOnError, + placeholderData: void 0 + }, + import_query_core.QueryObserver, + queryClient + ); +} +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + useSuspenseQuery +}); +//# sourceMappingURL=useSuspenseQuery.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/useSuspenseQuery.cjs.map b/node_modules/@tanstack/react-query/build/legacy/useSuspenseQuery.cjs.map new file mode 100644 index 0000000..c456860 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/legacy/useSuspenseQuery.cjs.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/useSuspenseQuery.ts"],"sourcesContent":["'use client'\nimport { QueryObserver, skipToken } from '@tanstack/query-core'\nimport { useBaseQuery } from './useBaseQuery'\nimport { defaultThrowOnError } from './suspense'\nimport type { UseSuspenseQueryOptions, UseSuspenseQueryResult } from './types'\nimport type { DefaultError, QueryClient, QueryKey } from '@tanstack/query-core'\n\nexport function useSuspenseQuery<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n options: UseSuspenseQueryOptions,\n queryClient?: QueryClient,\n): UseSuspenseQueryResult {\n if (process.env.NODE_ENV !== 'production') {\n if ((options.queryFn as any) === skipToken) {\n console.error('skipToken is not allowed for useSuspenseQuery')\n }\n }\n\n return useBaseQuery(\n {\n ...options,\n enabled: true,\n suspense: true,\n throwOnError: defaultThrowOnError,\n placeholderData: undefined,\n },\n QueryObserver,\n queryClient,\n ) as UseSuspenseQueryResult\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,wBAAyC;AACzC,0BAA6B;AAC7B,sBAAoC;AAI7B,SAAS,iBAMd,SACA,aACuC;AACvC,MAAI,QAAQ,IAAI,aAAa,cAAc;AACzC,QAAK,QAAQ,YAAoB,6BAAW;AAC1C,cAAQ,MAAM,+CAA+C;AAAA,IAC/D;AAAA,EACF;AAEA,aAAO;AAAA,IACL;AAAA,MACE,GAAG;AAAA,MACH,SAAS;AAAA,MACT,UAAU;AAAA,MACV,cAAc;AAAA,MACd,iBAAiB;AAAA,IACnB;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/useSuspenseQuery.d.cts b/node_modules/@tanstack/react-query/build/legacy/useSuspenseQuery.d.cts new file mode 100644 index 0000000..b2e662e --- /dev/null +++ b/node_modules/@tanstack/react-query/build/legacy/useSuspenseQuery.d.cts @@ -0,0 +1,6 @@ +import { UseSuspenseQueryOptions, UseSuspenseQueryResult } from './types.cjs'; +import { DefaultError, QueryKey, QueryClient } from '@tanstack/query-core'; + +declare function useSuspenseQuery(options: UseSuspenseQueryOptions, queryClient?: QueryClient): UseSuspenseQueryResult; + +export { useSuspenseQuery }; diff --git a/node_modules/@tanstack/react-query/build/legacy/useSuspenseQuery.d.ts b/node_modules/@tanstack/react-query/build/legacy/useSuspenseQuery.d.ts new file mode 100644 index 0000000..f53bc83 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/legacy/useSuspenseQuery.d.ts @@ -0,0 +1,6 @@ +import { UseSuspenseQueryOptions, UseSuspenseQueryResult } from './types.js'; +import { DefaultError, QueryKey, QueryClient } from '@tanstack/query-core'; + +declare function useSuspenseQuery(options: UseSuspenseQueryOptions, queryClient?: QueryClient): UseSuspenseQueryResult; + +export { useSuspenseQuery }; diff --git a/node_modules/@tanstack/react-query/build/legacy/useSuspenseQuery.js b/node_modules/@tanstack/react-query/build/legacy/useSuspenseQuery.js new file mode 100644 index 0000000..98296da --- /dev/null +++ b/node_modules/@tanstack/react-query/build/legacy/useSuspenseQuery.js @@ -0,0 +1,28 @@ +"use client"; + +// src/useSuspenseQuery.ts +import { QueryObserver, skipToken } from "@tanstack/query-core"; +import { useBaseQuery } from "./useBaseQuery.js"; +import { defaultThrowOnError } from "./suspense.js"; +function useSuspenseQuery(options, queryClient) { + if (process.env.NODE_ENV !== "production") { + if (options.queryFn === skipToken) { + console.error("skipToken is not allowed for useSuspenseQuery"); + } + } + return useBaseQuery( + { + ...options, + enabled: true, + suspense: true, + throwOnError: defaultThrowOnError, + placeholderData: void 0 + }, + QueryObserver, + queryClient + ); +} +export { + useSuspenseQuery +}; +//# sourceMappingURL=useSuspenseQuery.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/useSuspenseQuery.js.map b/node_modules/@tanstack/react-query/build/legacy/useSuspenseQuery.js.map new file mode 100644 index 0000000..2d96142 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/legacy/useSuspenseQuery.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/useSuspenseQuery.ts"],"sourcesContent":["'use client'\nimport { QueryObserver, skipToken } from '@tanstack/query-core'\nimport { useBaseQuery } from './useBaseQuery'\nimport { defaultThrowOnError } from './suspense'\nimport type { UseSuspenseQueryOptions, UseSuspenseQueryResult } from './types'\nimport type { DefaultError, QueryClient, QueryKey } from '@tanstack/query-core'\n\nexport function useSuspenseQuery<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n options: UseSuspenseQueryOptions,\n queryClient?: QueryClient,\n): UseSuspenseQueryResult {\n if (process.env.NODE_ENV !== 'production') {\n if ((options.queryFn as any) === skipToken) {\n console.error('skipToken is not allowed for useSuspenseQuery')\n }\n }\n\n return useBaseQuery(\n {\n ...options,\n enabled: true,\n suspense: true,\n throwOnError: defaultThrowOnError,\n placeholderData: undefined,\n },\n QueryObserver,\n queryClient,\n ) as UseSuspenseQueryResult\n}\n"],"mappings":";;;AACA,SAAS,eAAe,iBAAiB;AACzC,SAAS,oBAAoB;AAC7B,SAAS,2BAA2B;AAI7B,SAAS,iBAMd,SACA,aACuC;AACvC,MAAI,QAAQ,IAAI,aAAa,cAAc;AACzC,QAAK,QAAQ,YAAoB,WAAW;AAC1C,cAAQ,MAAM,+CAA+C;AAAA,IAC/D;AAAA,EACF;AAEA,SAAO;AAAA,IACL;AAAA,MACE,GAAG;AAAA,MACH,SAAS;AAAA,MACT,UAAU;AAAA,MACV,cAAc;AAAA,MACd,iBAAiB;AAAA,IACnB;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/HydrationBoundary.cjs b/node_modules/@tanstack/react-query/build/modern/HydrationBoundary.cjs new file mode 100644 index 0000000..ac23049 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/modern/HydrationBoundary.cjs @@ -0,0 +1,91 @@ +"use strict"; +"use client"; +var __create = Object.create; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __getProtoOf = Object.getPrototypeOf; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( + // If the importer is in node compatibility mode or this is not an ESM + // file that has been converted to a CommonJS file using a Babel- + // compatible transform (i.e. "__esModule" has not been set), then set + // "default" to the CommonJS "module.exports" for node compatibility. + isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, + mod +)); +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/HydrationBoundary.tsx +var HydrationBoundary_exports = {}; +__export(HydrationBoundary_exports, { + HydrationBoundary: () => HydrationBoundary +}); +module.exports = __toCommonJS(HydrationBoundary_exports); +var React = __toESM(require("react"), 1); +var import_query_core = require("@tanstack/query-core"); +var import_QueryClientProvider = require("./QueryClientProvider.cjs"); +var HydrationBoundary = ({ + children, + options = {}, + state, + queryClient +}) => { + const client = (0, import_QueryClientProvider.useQueryClient)(queryClient); + const optionsRef = React.useRef(options); + React.useEffect(() => { + optionsRef.current = options; + }); + const hydrationQueue = React.useMemo(() => { + if (state) { + if (typeof state !== "object") { + return; + } + const queryCache = client.getQueryCache(); + const queries = state.queries || []; + const newQueries = []; + const existingQueries = []; + for (const dehydratedQuery of queries) { + const existingQuery = queryCache.get(dehydratedQuery.queryHash); + if (!existingQuery) { + newQueries.push(dehydratedQuery); + } else { + const hydrationIsNewer = dehydratedQuery.state.dataUpdatedAt > existingQuery.state.dataUpdatedAt || dehydratedQuery.promise && existingQuery.state.status !== "pending" && existingQuery.state.fetchStatus !== "fetching" && dehydratedQuery.dehydratedAt !== void 0 && dehydratedQuery.dehydratedAt > existingQuery.state.dataUpdatedAt; + if (hydrationIsNewer) { + existingQueries.push(dehydratedQuery); + } + } + } + if (newQueries.length > 0) { + (0, import_query_core.hydrate)(client, { queries: newQueries }, optionsRef.current); + } + if (existingQueries.length > 0) { + return existingQueries; + } + } + return void 0; + }, [client, state]); + React.useEffect(() => { + if (hydrationQueue) { + (0, import_query_core.hydrate)(client, { queries: hydrationQueue }, optionsRef.current); + } + }, [client, hydrationQueue]); + return children; +}; +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + HydrationBoundary +}); +//# sourceMappingURL=HydrationBoundary.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/HydrationBoundary.cjs.map b/node_modules/@tanstack/react-query/build/modern/HydrationBoundary.cjs.map new file mode 100644 index 0000000..7a8d445 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/modern/HydrationBoundary.cjs.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/HydrationBoundary.tsx"],"sourcesContent":["'use client'\nimport * as React from 'react'\n\nimport { hydrate } from '@tanstack/query-core'\nimport { useQueryClient } from './QueryClientProvider'\nimport type {\n DehydratedState,\n HydrateOptions,\n OmitKeyof,\n QueryClient,\n} from '@tanstack/query-core'\n\nexport interface HydrationBoundaryProps {\n state: DehydratedState | null | undefined\n options?: OmitKeyof & {\n defaultOptions?: OmitKeyof<\n Exclude,\n 'mutations'\n >\n }\n children?: React.ReactNode\n queryClient?: QueryClient\n}\n\nexport const HydrationBoundary = ({\n children,\n options = {},\n state,\n queryClient,\n}: HydrationBoundaryProps) => {\n const client = useQueryClient(queryClient)\n\n const optionsRef = React.useRef(options)\n React.useEffect(() => {\n optionsRef.current = options\n })\n\n // This useMemo is for performance reasons only, everything inside it must\n // be safe to run in every render and code here should be read as \"in render\".\n //\n // This code needs to happen during the render phase, because after initial\n // SSR, hydration needs to happen _before_ children render. Also, if hydrating\n // during a transition, we want to hydrate as much as is safe in render so\n // we can prerender as much as possible.\n //\n // For any queries that already exist in the cache, we want to hold back on\n // hydrating until _after_ the render phase. The reason for this is that during\n // transitions, we don't want the existing queries and observers to update to\n // the new data on the current page, only _after_ the transition is committed.\n // If the transition is aborted, we will have hydrated any _new_ queries, but\n // we throw away the fresh data for any existing ones to avoid unexpectedly\n // updating the UI.\n const hydrationQueue: DehydratedState['queries'] | undefined =\n React.useMemo(() => {\n if (state) {\n if (typeof state !== 'object') {\n return\n }\n\n const queryCache = client.getQueryCache()\n // State is supplied from the outside and we might as well fail\n // gracefully if it has the wrong shape, so while we type `queries`\n // as required, we still provide a fallback.\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n const queries = state.queries || []\n\n const newQueries: DehydratedState['queries'] = []\n const existingQueries: DehydratedState['queries'] = []\n for (const dehydratedQuery of queries) {\n const existingQuery = queryCache.get(dehydratedQuery.queryHash)\n\n if (!existingQuery) {\n newQueries.push(dehydratedQuery)\n } else {\n const hydrationIsNewer =\n dehydratedQuery.state.dataUpdatedAt >\n existingQuery.state.dataUpdatedAt ||\n (dehydratedQuery.promise &&\n existingQuery.state.status !== 'pending' &&\n existingQuery.state.fetchStatus !== 'fetching' &&\n dehydratedQuery.dehydratedAt !== undefined &&\n dehydratedQuery.dehydratedAt >\n existingQuery.state.dataUpdatedAt)\n\n if (hydrationIsNewer) {\n existingQueries.push(dehydratedQuery)\n }\n }\n }\n\n if (newQueries.length > 0) {\n // It's actually fine to call this with queries/state that already exists\n // in the cache, or is older. hydrate() is idempotent for queries.\n // eslint-disable-next-line react-hooks/refs\n hydrate(client, { queries: newQueries }, optionsRef.current)\n }\n if (existingQueries.length > 0) {\n return existingQueries\n }\n }\n return undefined\n }, [client, state])\n\n React.useEffect(() => {\n if (hydrationQueue) {\n hydrate(client, { queries: hydrationQueue }, optionsRef.current)\n }\n }, [client, hydrationQueue])\n\n return children as React.ReactElement\n}\n"],"mappings":";;;;;;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AAE,SAAS,eAAe,GAAG,WAAW,OAAO;AAAA,IACjE;AAAA,EACF,GAAG,CAAC,QAAQ,cAAc,CAAC;AAE3B,SAAO;AACT;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/HydrationBoundary.d.cts b/node_modules/@tanstack/react-query/build/modern/HydrationBoundary.d.cts new file mode 100644 index 0000000..39d63fa --- /dev/null +++ b/node_modules/@tanstack/react-query/build/modern/HydrationBoundary.d.cts @@ -0,0 +1,14 @@ +import * as React from 'react'; +import { DehydratedState, OmitKeyof, HydrateOptions, QueryClient } from '@tanstack/query-core'; + +interface HydrationBoundaryProps { + state: DehydratedState | null | undefined; + options?: OmitKeyof & { + defaultOptions?: OmitKeyof, 'mutations'>; + }; + children?: React.ReactNode; + queryClient?: QueryClient; +} +declare const HydrationBoundary: ({ children, options, state, queryClient, }: HydrationBoundaryProps) => React.ReactElement; + +export { HydrationBoundary, type HydrationBoundaryProps }; diff --git a/node_modules/@tanstack/react-query/build/modern/HydrationBoundary.d.ts b/node_modules/@tanstack/react-query/build/modern/HydrationBoundary.d.ts new file mode 100644 index 0000000..39d63fa --- /dev/null +++ b/node_modules/@tanstack/react-query/build/modern/HydrationBoundary.d.ts @@ -0,0 +1,14 @@ +import * as React from 'react'; +import { DehydratedState, OmitKeyof, HydrateOptions, QueryClient } from '@tanstack/query-core'; + +interface HydrationBoundaryProps { + state: DehydratedState | null | undefined; + options?: OmitKeyof & { + defaultOptions?: OmitKeyof, 'mutations'>; + }; + children?: React.ReactNode; + queryClient?: QueryClient; +} +declare const HydrationBoundary: ({ children, options, state, queryClient, }: HydrationBoundaryProps) => React.ReactElement; + +export { HydrationBoundary, type HydrationBoundaryProps }; diff --git a/node_modules/@tanstack/react-query/build/modern/HydrationBoundary.js b/node_modules/@tanstack/react-query/build/modern/HydrationBoundary.js new file mode 100644 index 0000000..4acd78b --- /dev/null +++ b/node_modules/@tanstack/react-query/build/modern/HydrationBoundary.js @@ -0,0 +1,57 @@ +"use client"; + +// src/HydrationBoundary.tsx +import * as React from "react"; +import { hydrate } from "@tanstack/query-core"; +import { useQueryClient } from "./QueryClientProvider.js"; +var HydrationBoundary = ({ + children, + options = {}, + state, + queryClient +}) => { + const client = useQueryClient(queryClient); + const optionsRef = React.useRef(options); + React.useEffect(() => { + optionsRef.current = options; + }); + const hydrationQueue = React.useMemo(() => { + if (state) { + if (typeof state !== "object") { + return; + } + const queryCache = client.getQueryCache(); + const queries = state.queries || []; + const newQueries = []; + const existingQueries = []; + for (const dehydratedQuery of queries) { + const existingQuery = queryCache.get(dehydratedQuery.queryHash); + if (!existingQuery) { + newQueries.push(dehydratedQuery); + } else { + const hydrationIsNewer = dehydratedQuery.state.dataUpdatedAt > existingQuery.state.dataUpdatedAt || dehydratedQuery.promise && existingQuery.state.status !== "pending" && existingQuery.state.fetchStatus !== "fetching" && dehydratedQuery.dehydratedAt !== void 0 && dehydratedQuery.dehydratedAt > existingQuery.state.dataUpdatedAt; + if (hydrationIsNewer) { + existingQueries.push(dehydratedQuery); + } + } + } + if (newQueries.length > 0) { + hydrate(client, { queries: newQueries }, optionsRef.current); + } + if (existingQueries.length > 0) { + return existingQueries; + } + } + return void 0; + }, [client, state]); + React.useEffect(() => { + if (hydrationQueue) { + hydrate(client, { queries: hydrationQueue }, optionsRef.current); + } + }, [client, hydrationQueue]); + return children; +}; +export { + HydrationBoundary +}; +//# sourceMappingURL=HydrationBoundary.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/HydrationBoundary.js.map b/node_modules/@tanstack/react-query/build/modern/HydrationBoundary.js.map new file mode 100644 index 0000000..63d8469 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/modern/HydrationBoundary.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/HydrationBoundary.tsx"],"sourcesContent":["'use client'\nimport * as React from 'react'\n\nimport { hydrate } from '@tanstack/query-core'\nimport { useQueryClient } from './QueryClientProvider'\nimport type {\n DehydratedState,\n HydrateOptions,\n OmitKeyof,\n QueryClient,\n} from '@tanstack/query-core'\n\nexport interface HydrationBoundaryProps {\n state: DehydratedState | null | undefined\n options?: OmitKeyof & {\n defaultOptions?: OmitKeyof<\n Exclude,\n 'mutations'\n >\n }\n children?: React.ReactNode\n queryClient?: QueryClient\n}\n\nexport const HydrationBoundary = ({\n children,\n options = {},\n state,\n queryClient,\n}: HydrationBoundaryProps) => {\n const client = useQueryClient(queryClient)\n\n const optionsRef = React.useRef(options)\n React.useEffect(() => {\n optionsRef.current = options\n })\n\n // This useMemo is for performance reasons only, everything inside it must\n // be safe to run in every render and code here should be read as \"in render\".\n //\n // This code needs to happen during the render phase, because after initial\n // SSR, hydration needs to happen _before_ children render. Also, if hydrating\n // during a transition, we want to hydrate as much as is safe in render so\n // we can prerender as much as possible.\n //\n // For any queries that already exist in the cache, we want to hold back on\n // hydrating until _after_ the render phase. The reason for this is that during\n // transitions, we don't want the existing queries and observers to update to\n // the new data on the current page, only _after_ the transition is committed.\n // If the transition is aborted, we will have hydrated any _new_ queries, but\n // we throw away the fresh data for any existing ones to avoid unexpectedly\n // updating the UI.\n const hydrationQueue: DehydratedState['queries'] | undefined =\n React.useMemo(() => {\n if (state) {\n if (typeof state !== 'object') {\n return\n }\n\n const queryCache = client.getQueryCache()\n // State is supplied from the outside and we might as well fail\n // gracefully if it has the wrong shape, so while we type `queries`\n // as required, we still provide a fallback.\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n const queries = state.queries || []\n\n const newQueries: DehydratedState['queries'] = []\n const existingQueries: DehydratedState['queries'] = []\n for (const dehydratedQuery of queries) {\n const existingQuery = queryCache.get(dehydratedQuery.queryHash)\n\n if (!existingQuery) {\n newQueries.push(dehydratedQuery)\n } else {\n const hydrationIsNewer =\n dehydratedQuery.state.dataUpdatedAt >\n existingQuery.state.dataUpdatedAt ||\n (dehydratedQuery.promise &&\n existingQuery.state.status !== 'pending' &&\n existingQuery.state.fetchStatus !== 'fetching' &&\n dehydratedQuery.dehydratedAt !== undefined &&\n dehydratedQuery.dehydratedAt >\n existingQuery.state.dataUpdatedAt)\n\n if (hydrationIsNewer) {\n existingQueries.push(dehydratedQuery)\n }\n }\n }\n\n if (newQueries.length > 0) {\n // It's actually fine to call this with queries/state that already exists\n // in the cache, or is older. hydrate() is idempotent for queries.\n // eslint-disable-next-line react-hooks/refs\n hydrate(client, { queries: newQueries }, optionsRef.current)\n }\n if (existingQueries.length > 0) {\n return existingQueries\n }\n }\n return undefined\n }, [client, state])\n\n React.useEffect(() => {\n if (hydrationQueue) {\n hydrate(client, { queries: hydrationQueue }, optionsRef.current)\n }\n }, [client, hydrationQueue])\n\n return children as React.ReactElement\n}\n"],"mappings":";;;AACA,YAAY,WAAW;AAEvB,SAAS,eAAe;AACxB,SAAS,sBAAsB;AAoBxB,IAAM,oBAAoB,CAAC;AAAA,EAChC;AAAA,EACA,UAAU,CAAC;AAAA,EACX;AAAA,EACA;AACF,MAA8B;AAC5B,QAAM,SAAS,eAAe,WAAW;AAEzC,QAAM,aAAmB,aAAO,OAAO;AACvC,EAAM,gBAAU,MAAM;AACpB,eAAW,UAAU;AAAA,EACvB,CAAC;AAiBD,QAAM,iBACE,cAAQ,MAAM;AAClB,QAAI,OAAO;AACT,UAAI,OAAO,UAAU,UAAU;AAC7B;AAAA,MACF;AAEA,YAAM,aAAa,OAAO,cAAc;AAKxC,YAAM,UAAU,MAAM,WAAW,CAAC;AAElC,YAAM,aAAyC,CAAC;AAChD,YAAM,kBAA8C,CAAC;AACrD,iBAAW,mBAAmB,SAAS;AACrC,cAAM,gBAAgB,WAAW,IAAI,gBAAgB,SAAS;AAE9D,YAAI,CAAC,eAAe;AAClB,qBAAW,KAAK,eAAe;AAAA,QACjC,OAAO;AACL,gBAAM,mBACJ,gBAAgB,MAAM,gBACpB,cAAc,MAAM,iBACrB,gBAAgB,WACf,cAAc,MAAM,WAAW,aAC/B,cAAc,MAAM,gBAAgB,cACpC,gBAAgB,iBAAiB,UACjC,gBAAgB,eACd,cAAc,MAAM;AAE1B,cAAI,kBAAkB;AACpB,4BAAgB,KAAK,eAAe;AAAA,UACtC;AAAA,QACF;AAAA,MACF;AAEA,UAAI,WAAW,SAAS,GAAG;AAIzB,gBAAQ,QAAQ,EAAE,SAAS,WAAW,GAAG,WAAW,OAAO;AAAA,MAC7D;AACA,UAAI,gBAAgB,SAAS,GAAG;AAC9B,eAAO;AAAA,MACT;AAAA,IACF;AACA,WAAO;AAAA,EACT,GAAG,CAAC,QAAQ,KAAK,CAAC;AAEpB,EAAM,gBAAU,MAAM;AACpB,QAAI,gBAAgB;AAClB,cAAQ,QAAQ,EAAE,SAAS,eAAe,GAAG,WAAW,OAAO;AAAA,IACjE;AAAA,EACF,GAAG,CAAC,QAAQ,cAAc,CAAC;AAE3B,SAAO;AACT;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/IsRestoringProvider.cjs b/node_modules/@tanstack/react-query/build/modern/IsRestoringProvider.cjs new file mode 100644 index 0000000..f607420 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/modern/IsRestoringProvider.cjs @@ -0,0 +1,47 @@ +"use strict"; +"use client"; +var __create = Object.create; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __getProtoOf = Object.getPrototypeOf; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( + // If the importer is in node compatibility mode or this is not an ESM + // file that has been converted to a CommonJS file using a Babel- + // compatible transform (i.e. "__esModule" has not been set), then set + // "default" to the CommonJS "module.exports" for node compatibility. + isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, + mod +)); +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/IsRestoringProvider.ts +var IsRestoringProvider_exports = {}; +__export(IsRestoringProvider_exports, { + IsRestoringProvider: () => IsRestoringProvider, + useIsRestoring: () => useIsRestoring +}); +module.exports = __toCommonJS(IsRestoringProvider_exports); +var React = __toESM(require("react"), 1); +var IsRestoringContext = React.createContext(false); +var useIsRestoring = () => React.useContext(IsRestoringContext); +var IsRestoringProvider = IsRestoringContext.Provider; +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + IsRestoringProvider, + useIsRestoring +}); +//# sourceMappingURL=IsRestoringProvider.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/IsRestoringProvider.cjs.map b/node_modules/@tanstack/react-query/build/modern/IsRestoringProvider.cjs.map new file mode 100644 index 0000000..2c98a9d --- /dev/null +++ b/node_modules/@tanstack/react-query/build/modern/IsRestoringProvider.cjs.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/IsRestoringProvider.ts"],"sourcesContent":["'use client'\nimport * as React from 'react'\n\nconst IsRestoringContext = React.createContext(false)\n\nexport const useIsRestoring = () => React.useContext(IsRestoringContext)\nexport const IsRestoringProvider = IsRestoringContext.Provider\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,YAAuB;AAEvB,IAAM,qBAA2B,oBAAc,KAAK;AAE7C,IAAM,iBAAiB,MAAY,iBAAW,kBAAkB;AAChE,IAAM,sBAAsB,mBAAmB;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/IsRestoringProvider.d.cts b/node_modules/@tanstack/react-query/build/modern/IsRestoringProvider.d.cts new file mode 100644 index 0000000..08b14ff --- /dev/null +++ b/node_modules/@tanstack/react-query/build/modern/IsRestoringProvider.d.cts @@ -0,0 +1,6 @@ +import * as React from 'react'; + +declare const useIsRestoring: () => boolean; +declare const IsRestoringProvider: React.Provider; + +export { IsRestoringProvider, useIsRestoring }; diff --git a/node_modules/@tanstack/react-query/build/modern/IsRestoringProvider.d.ts b/node_modules/@tanstack/react-query/build/modern/IsRestoringProvider.d.ts new file mode 100644 index 0000000..08b14ff --- /dev/null +++ b/node_modules/@tanstack/react-query/build/modern/IsRestoringProvider.d.ts @@ -0,0 +1,6 @@ +import * as React from 'react'; + +declare const useIsRestoring: () => boolean; +declare const IsRestoringProvider: React.Provider; + +export { IsRestoringProvider, useIsRestoring }; diff --git a/node_modules/@tanstack/react-query/build/modern/IsRestoringProvider.js b/node_modules/@tanstack/react-query/build/modern/IsRestoringProvider.js new file mode 100644 index 0000000..374f82e --- /dev/null +++ b/node_modules/@tanstack/react-query/build/modern/IsRestoringProvider.js @@ -0,0 +1,12 @@ +"use client"; + +// src/IsRestoringProvider.ts +import * as React from "react"; +var IsRestoringContext = React.createContext(false); +var useIsRestoring = () => React.useContext(IsRestoringContext); +var IsRestoringProvider = IsRestoringContext.Provider; +export { + IsRestoringProvider, + useIsRestoring +}; +//# sourceMappingURL=IsRestoringProvider.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/IsRestoringProvider.js.map b/node_modules/@tanstack/react-query/build/modern/IsRestoringProvider.js.map new file mode 100644 index 0000000..a31bfa3 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/modern/IsRestoringProvider.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/IsRestoringProvider.ts"],"sourcesContent":["'use client'\nimport * as React from 'react'\n\nconst IsRestoringContext = React.createContext(false)\n\nexport const useIsRestoring = () => React.useContext(IsRestoringContext)\nexport const IsRestoringProvider = IsRestoringContext.Provider\n"],"mappings":";;;AACA,YAAY,WAAW;AAEvB,IAAM,qBAA2B,oBAAc,KAAK;AAE7C,IAAM,iBAAiB,MAAY,iBAAW,kBAAkB;AAChE,IAAM,sBAAsB,mBAAmB;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/QueryClientProvider.cjs b/node_modules/@tanstack/react-query/build/modern/QueryClientProvider.cjs new file mode 100644 index 0000000..d91255c --- /dev/null +++ b/node_modules/@tanstack/react-query/build/modern/QueryClientProvider.cjs @@ -0,0 +1,72 @@ +"use strict"; +"use client"; +var __create = Object.create; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __getProtoOf = Object.getPrototypeOf; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( + // If the importer is in node compatibility mode or this is not an ESM + // file that has been converted to a CommonJS file using a Babel- + // compatible transform (i.e. "__esModule" has not been set), then set + // "default" to the CommonJS "module.exports" for node compatibility. + isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, + mod +)); +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/QueryClientProvider.tsx +var QueryClientProvider_exports = {}; +__export(QueryClientProvider_exports, { + QueryClientContext: () => QueryClientContext, + QueryClientProvider: () => QueryClientProvider, + useQueryClient: () => useQueryClient +}); +module.exports = __toCommonJS(QueryClientProvider_exports); +var React = __toESM(require("react"), 1); +var import_jsx_runtime = require("react/jsx-runtime"); +var QueryClientContext = React.createContext( + void 0 +); +var useQueryClient = (queryClient) => { + const client = React.useContext(QueryClientContext); + if (queryClient) { + return queryClient; + } + if (!client) { + throw new Error("No QueryClient set, use QueryClientProvider to set one"); + } + return client; +}; +var QueryClientProvider = ({ + client, + children +}) => { + React.useEffect(() => { + client.mount(); + return () => { + client.unmount(); + }; + }, [client]); + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(QueryClientContext.Provider, { value: client, children }); +}; +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + QueryClientContext, + QueryClientProvider, + useQueryClient +}); +//# sourceMappingURL=QueryClientProvider.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/QueryClientProvider.cjs.map b/node_modules/@tanstack/react-query/build/modern/QueryClientProvider.cjs.map new file mode 100644 index 0000000..d97eb88 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/modern/QueryClientProvider.cjs.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/QueryClientProvider.tsx"],"sourcesContent":["'use client'\nimport * as React from 'react'\n\nimport type { QueryClient } from '@tanstack/query-core'\n\nexport const QueryClientContext = React.createContext(\n undefined,\n)\n\nexport const useQueryClient = (queryClient?: QueryClient) => {\n const client = React.useContext(QueryClientContext)\n\n if (queryClient) {\n return queryClient\n }\n\n if (!client) {\n throw new Error('No QueryClient set, use QueryClientProvider to set one')\n }\n\n return client\n}\n\nexport type QueryClientProviderProps = {\n client: QueryClient\n children?: React.ReactNode\n}\n\nexport const QueryClientProvider = ({\n client,\n children,\n}: QueryClientProviderProps): React.JSX.Element => {\n React.useEffect(() => {\n client.mount()\n return () => {\n client.unmount()\n }\n }, [client])\n\n return (\n \n {children}\n \n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,YAAuB;AAuCnB;AAnCG,IAAM,qBAA2B;AAAA,EACtC;AACF;AAEO,IAAM,iBAAiB,CAAC,gBAA8B;AAC3D,QAAM,SAAe,iBAAW,kBAAkB;AAElD,MAAI,aAAa;AACf,WAAO;AAAA,EACT;AAEA,MAAI,CAAC,QAAQ;AACX,UAAM,IAAI,MAAM,wDAAwD;AAAA,EAC1E;AAEA,SAAO;AACT;AAOO,IAAM,sBAAsB,CAAC;AAAA,EAClC;AAAA,EACA;AACF,MAAmD;AACjD,EAAM,gBAAU,MAAM;AACpB,WAAO,MAAM;AACb,WAAO,MAAM;AACX,aAAO,QAAQ;AAAA,IACjB;AAAA,EACF,GAAG,CAAC,MAAM,CAAC;AAEX,SACE,4CAAC,mBAAmB,UAAnB,EAA4B,OAAO,QACjC,UACH;AAEJ;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/QueryClientProvider.d.cts b/node_modules/@tanstack/react-query/build/modern/QueryClientProvider.d.cts new file mode 100644 index 0000000..1b1fd69 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/modern/QueryClientProvider.d.cts @@ -0,0 +1,12 @@ +import * as React from 'react'; +import { QueryClient } from '@tanstack/query-core'; + +declare const QueryClientContext: React.Context; +declare const useQueryClient: (queryClient?: QueryClient) => QueryClient; +type QueryClientProviderProps = { + client: QueryClient; + children?: React.ReactNode; +}; +declare const QueryClientProvider: ({ client, children, }: QueryClientProviderProps) => React.JSX.Element; + +export { QueryClientContext, QueryClientProvider, type QueryClientProviderProps, useQueryClient }; diff --git a/node_modules/@tanstack/react-query/build/modern/QueryClientProvider.d.ts b/node_modules/@tanstack/react-query/build/modern/QueryClientProvider.d.ts new file mode 100644 index 0000000..1b1fd69 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/modern/QueryClientProvider.d.ts @@ -0,0 +1,12 @@ +import * as React from 'react'; +import { QueryClient } from '@tanstack/query-core'; + +declare const QueryClientContext: React.Context; +declare const useQueryClient: (queryClient?: QueryClient) => QueryClient; +type QueryClientProviderProps = { + client: QueryClient; + children?: React.ReactNode; +}; +declare const QueryClientProvider: ({ client, children, }: QueryClientProviderProps) => React.JSX.Element; + +export { QueryClientContext, QueryClientProvider, type QueryClientProviderProps, useQueryClient }; diff --git a/node_modules/@tanstack/react-query/build/modern/QueryClientProvider.js b/node_modules/@tanstack/react-query/build/modern/QueryClientProvider.js new file mode 100644 index 0000000..fc4d5f2 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/modern/QueryClientProvider.js @@ -0,0 +1,36 @@ +"use client"; + +// src/QueryClientProvider.tsx +import * as React from "react"; +import { jsx } from "react/jsx-runtime"; +var QueryClientContext = React.createContext( + void 0 +); +var useQueryClient = (queryClient) => { + const client = React.useContext(QueryClientContext); + if (queryClient) { + return queryClient; + } + if (!client) { + throw new Error("No QueryClient set, use QueryClientProvider to set one"); + } + return client; +}; +var QueryClientProvider = ({ + client, + children +}) => { + React.useEffect(() => { + client.mount(); + return () => { + client.unmount(); + }; + }, [client]); + return /* @__PURE__ */ jsx(QueryClientContext.Provider, { value: client, children }); +}; +export { + QueryClientContext, + QueryClientProvider, + useQueryClient +}; +//# sourceMappingURL=QueryClientProvider.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/QueryClientProvider.js.map b/node_modules/@tanstack/react-query/build/modern/QueryClientProvider.js.map new file mode 100644 index 0000000..44bad03 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/modern/QueryClientProvider.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/QueryClientProvider.tsx"],"sourcesContent":["'use client'\nimport * as React from 'react'\n\nimport type { QueryClient } from '@tanstack/query-core'\n\nexport const QueryClientContext = React.createContext(\n undefined,\n)\n\nexport const useQueryClient = (queryClient?: QueryClient) => {\n const client = React.useContext(QueryClientContext)\n\n if (queryClient) {\n return queryClient\n }\n\n if (!client) {\n throw new Error('No QueryClient set, use QueryClientProvider to set one')\n }\n\n return client\n}\n\nexport type QueryClientProviderProps = {\n client: QueryClient\n children?: React.ReactNode\n}\n\nexport const QueryClientProvider = ({\n client,\n children,\n}: QueryClientProviderProps): React.JSX.Element => {\n React.useEffect(() => {\n client.mount()\n return () => {\n client.unmount()\n }\n }, [client])\n\n return (\n \n {children}\n \n )\n}\n"],"mappings":";;;AACA,YAAY,WAAW;AAuCnB;AAnCG,IAAM,qBAA2B;AAAA,EACtC;AACF;AAEO,IAAM,iBAAiB,CAAC,gBAA8B;AAC3D,QAAM,SAAe,iBAAW,kBAAkB;AAElD,MAAI,aAAa;AACf,WAAO;AAAA,EACT;AAEA,MAAI,CAAC,QAAQ;AACX,UAAM,IAAI,MAAM,wDAAwD;AAAA,EAC1E;AAEA,SAAO;AACT;AAOO,IAAM,sBAAsB,CAAC;AAAA,EAClC;AAAA,EACA;AACF,MAAmD;AACjD,EAAM,gBAAU,MAAM;AACpB,WAAO,MAAM;AACb,WAAO,MAAM;AACX,aAAO,QAAQ;AAAA,IACjB;AAAA,EACF,GAAG,CAAC,MAAM,CAAC;AAEX,SACE,oBAAC,mBAAmB,UAAnB,EAA4B,OAAO,QACjC,UACH;AAEJ;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/QueryErrorResetBoundary.cjs b/node_modules/@tanstack/react-query/build/modern/QueryErrorResetBoundary.cjs new file mode 100644 index 0000000..7c86436 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/modern/QueryErrorResetBoundary.cjs @@ -0,0 +1,67 @@ +"use strict"; +"use client"; +var __create = Object.create; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __getProtoOf = Object.getPrototypeOf; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( + // If the importer is in node compatibility mode or this is not an ESM + // file that has been converted to a CommonJS file using a Babel- + // compatible transform (i.e. "__esModule" has not been set), then set + // "default" to the CommonJS "module.exports" for node compatibility. + isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, + mod +)); +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/QueryErrorResetBoundary.tsx +var QueryErrorResetBoundary_exports = {}; +__export(QueryErrorResetBoundary_exports, { + QueryErrorResetBoundary: () => QueryErrorResetBoundary, + useQueryErrorResetBoundary: () => useQueryErrorResetBoundary +}); +module.exports = __toCommonJS(QueryErrorResetBoundary_exports); +var React = __toESM(require("react"), 1); +var import_jsx_runtime = require("react/jsx-runtime"); +function createValue() { + let isReset = false; + return { + clearReset: () => { + isReset = false; + }, + reset: () => { + isReset = true; + }, + isReset: () => { + return isReset; + } + }; +} +var QueryErrorResetBoundaryContext = React.createContext(createValue()); +var useQueryErrorResetBoundary = () => React.useContext(QueryErrorResetBoundaryContext); +var QueryErrorResetBoundary = ({ + children +}) => { + const [value] = React.useState(() => createValue()); + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(QueryErrorResetBoundaryContext.Provider, { value, children: typeof children === "function" ? children(value) : children }); +}; +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + QueryErrorResetBoundary, + useQueryErrorResetBoundary +}); +//# sourceMappingURL=QueryErrorResetBoundary.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/QueryErrorResetBoundary.cjs.map b/node_modules/@tanstack/react-query/build/modern/QueryErrorResetBoundary.cjs.map new file mode 100644 index 0000000..29c7b08 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/modern/QueryErrorResetBoundary.cjs.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/QueryErrorResetBoundary.tsx"],"sourcesContent":["'use client'\nimport * as React from 'react'\n\n// CONTEXT\nexport type QueryErrorResetFunction = () => void\nexport type QueryErrorIsResetFunction = () => boolean\nexport type QueryErrorClearResetFunction = () => void\n\nexport interface QueryErrorResetBoundaryValue {\n clearReset: QueryErrorClearResetFunction\n isReset: QueryErrorIsResetFunction\n reset: QueryErrorResetFunction\n}\n\nfunction createValue(): QueryErrorResetBoundaryValue {\n let isReset = false\n return {\n clearReset: () => {\n isReset = false\n },\n reset: () => {\n isReset = true\n },\n isReset: () => {\n return isReset\n },\n }\n}\n\nconst QueryErrorResetBoundaryContext = React.createContext(createValue())\n\n// HOOK\n\nexport const useQueryErrorResetBoundary = () =>\n React.useContext(QueryErrorResetBoundaryContext)\n\n// COMPONENT\n\nexport type QueryErrorResetBoundaryFunction = (\n value: QueryErrorResetBoundaryValue,\n) => React.ReactNode\n\nexport interface QueryErrorResetBoundaryProps {\n children: QueryErrorResetBoundaryFunction | React.ReactNode\n}\n\nexport const QueryErrorResetBoundary = ({\n children,\n}: QueryErrorResetBoundaryProps) => {\n const [value] = React.useState(() => createValue())\n return (\n \n {typeof children === 'function' ? children(value) : children}\n \n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,YAAuB;AAkDnB;AArCJ,SAAS,cAA4C;AACnD,MAAI,UAAU;AACd,SAAO;AAAA,IACL,YAAY,MAAM;AAChB,gBAAU;AAAA,IACZ;AAAA,IACA,OAAO,MAAM;AACX,gBAAU;AAAA,IACZ;AAAA,IACA,SAAS,MAAM;AACb,aAAO;AAAA,IACT;AAAA,EACF;AACF;AAEA,IAAM,iCAAuC,oBAAc,YAAY,CAAC;AAIjE,IAAM,6BAA6B,MAClC,iBAAW,8BAA8B;AAY1C,IAAM,0BAA0B,CAAC;AAAA,EACtC;AACF,MAAoC;AAClC,QAAM,CAAC,KAAK,IAAU,eAAS,MAAM,YAAY,CAAC;AAClD,SACE,4CAAC,+BAA+B,UAA/B,EAAwC,OACtC,iBAAO,aAAa,aAAa,SAAS,KAAK,IAAI,UACtD;AAEJ;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/QueryErrorResetBoundary.d.cts b/node_modules/@tanstack/react-query/build/modern/QueryErrorResetBoundary.d.cts new file mode 100644 index 0000000..bfb5745 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/modern/QueryErrorResetBoundary.d.cts @@ -0,0 +1,19 @@ +import * as react_jsx_runtime from 'react/jsx-runtime'; +import * as React from 'react'; + +type QueryErrorResetFunction = () => void; +type QueryErrorIsResetFunction = () => boolean; +type QueryErrorClearResetFunction = () => void; +interface QueryErrorResetBoundaryValue { + clearReset: QueryErrorClearResetFunction; + isReset: QueryErrorIsResetFunction; + reset: QueryErrorResetFunction; +} +declare const useQueryErrorResetBoundary: () => QueryErrorResetBoundaryValue; +type QueryErrorResetBoundaryFunction = (value: QueryErrorResetBoundaryValue) => React.ReactNode; +interface QueryErrorResetBoundaryProps { + children: QueryErrorResetBoundaryFunction | React.ReactNode; +} +declare const QueryErrorResetBoundary: ({ children, }: QueryErrorResetBoundaryProps) => react_jsx_runtime.JSX.Element; + +export { type QueryErrorClearResetFunction, type QueryErrorIsResetFunction, QueryErrorResetBoundary, type QueryErrorResetBoundaryFunction, type QueryErrorResetBoundaryProps, type QueryErrorResetBoundaryValue, type QueryErrorResetFunction, useQueryErrorResetBoundary }; diff --git a/node_modules/@tanstack/react-query/build/modern/QueryErrorResetBoundary.d.ts b/node_modules/@tanstack/react-query/build/modern/QueryErrorResetBoundary.d.ts new file mode 100644 index 0000000..bfb5745 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/modern/QueryErrorResetBoundary.d.ts @@ -0,0 +1,19 @@ +import * as react_jsx_runtime from 'react/jsx-runtime'; +import * as React from 'react'; + +type QueryErrorResetFunction = () => void; +type QueryErrorIsResetFunction = () => boolean; +type QueryErrorClearResetFunction = () => void; +interface QueryErrorResetBoundaryValue { + clearReset: QueryErrorClearResetFunction; + isReset: QueryErrorIsResetFunction; + reset: QueryErrorResetFunction; +} +declare const useQueryErrorResetBoundary: () => QueryErrorResetBoundaryValue; +type QueryErrorResetBoundaryFunction = (value: QueryErrorResetBoundaryValue) => React.ReactNode; +interface QueryErrorResetBoundaryProps { + children: QueryErrorResetBoundaryFunction | React.ReactNode; +} +declare const QueryErrorResetBoundary: ({ children, }: QueryErrorResetBoundaryProps) => react_jsx_runtime.JSX.Element; + +export { type QueryErrorClearResetFunction, type QueryErrorIsResetFunction, QueryErrorResetBoundary, type QueryErrorResetBoundaryFunction, type QueryErrorResetBoundaryProps, type QueryErrorResetBoundaryValue, type QueryErrorResetFunction, useQueryErrorResetBoundary }; diff --git a/node_modules/@tanstack/react-query/build/modern/QueryErrorResetBoundary.js b/node_modules/@tanstack/react-query/build/modern/QueryErrorResetBoundary.js new file mode 100644 index 0000000..ae56edc --- /dev/null +++ b/node_modules/@tanstack/react-query/build/modern/QueryErrorResetBoundary.js @@ -0,0 +1,32 @@ +"use client"; + +// src/QueryErrorResetBoundary.tsx +import * as React from "react"; +import { jsx } from "react/jsx-runtime"; +function createValue() { + let isReset = false; + return { + clearReset: () => { + isReset = false; + }, + reset: () => { + isReset = true; + }, + isReset: () => { + return isReset; + } + }; +} +var QueryErrorResetBoundaryContext = React.createContext(createValue()); +var useQueryErrorResetBoundary = () => React.useContext(QueryErrorResetBoundaryContext); +var QueryErrorResetBoundary = ({ + children +}) => { + const [value] = React.useState(() => createValue()); + return /* @__PURE__ */ jsx(QueryErrorResetBoundaryContext.Provider, { value, children: typeof children === "function" ? children(value) : children }); +}; +export { + QueryErrorResetBoundary, + useQueryErrorResetBoundary +}; +//# sourceMappingURL=QueryErrorResetBoundary.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/QueryErrorResetBoundary.js.map b/node_modules/@tanstack/react-query/build/modern/QueryErrorResetBoundary.js.map new file mode 100644 index 0000000..c8b04a7 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/modern/QueryErrorResetBoundary.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/QueryErrorResetBoundary.tsx"],"sourcesContent":["'use client'\nimport * as React from 'react'\n\n// CONTEXT\nexport type QueryErrorResetFunction = () => void\nexport type QueryErrorIsResetFunction = () => boolean\nexport type QueryErrorClearResetFunction = () => void\n\nexport interface QueryErrorResetBoundaryValue {\n clearReset: QueryErrorClearResetFunction\n isReset: QueryErrorIsResetFunction\n reset: QueryErrorResetFunction\n}\n\nfunction createValue(): QueryErrorResetBoundaryValue {\n let isReset = false\n return {\n clearReset: () => {\n isReset = false\n },\n reset: () => {\n isReset = true\n },\n isReset: () => {\n return isReset\n },\n }\n}\n\nconst QueryErrorResetBoundaryContext = React.createContext(createValue())\n\n// HOOK\n\nexport const useQueryErrorResetBoundary = () =>\n React.useContext(QueryErrorResetBoundaryContext)\n\n// COMPONENT\n\nexport type QueryErrorResetBoundaryFunction = (\n value: QueryErrorResetBoundaryValue,\n) => React.ReactNode\n\nexport interface QueryErrorResetBoundaryProps {\n children: QueryErrorResetBoundaryFunction | React.ReactNode\n}\n\nexport const QueryErrorResetBoundary = ({\n children,\n}: QueryErrorResetBoundaryProps) => {\n const [value] = React.useState(() => createValue())\n return (\n \n {typeof children === 'function' ? children(value) : children}\n \n )\n}\n"],"mappings":";;;AACA,YAAY,WAAW;AAkDnB;AArCJ,SAAS,cAA4C;AACnD,MAAI,UAAU;AACd,SAAO;AAAA,IACL,YAAY,MAAM;AAChB,gBAAU;AAAA,IACZ;AAAA,IACA,OAAO,MAAM;AACX,gBAAU;AAAA,IACZ;AAAA,IACA,SAAS,MAAM;AACb,aAAO;AAAA,IACT;AAAA,EACF;AACF;AAEA,IAAM,iCAAuC,oBAAc,YAAY,CAAC;AAIjE,IAAM,6BAA6B,MAClC,iBAAW,8BAA8B;AAY1C,IAAM,0BAA0B,CAAC;AAAA,EACtC;AACF,MAAoC;AAClC,QAAM,CAAC,KAAK,IAAU,eAAS,MAAM,YAAY,CAAC;AAClD,SACE,oBAAC,+BAA+B,UAA/B,EAAwC,OACtC,iBAAO,aAAa,aAAa,SAAS,KAAK,IAAI,UACtD;AAEJ;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/errorBoundaryUtils.cjs b/node_modules/@tanstack/react-query/build/modern/errorBoundaryUtils.cjs new file mode 100644 index 0000000..eada8e3 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/modern/errorBoundaryUtils.cjs @@ -0,0 +1,69 @@ +"use strict"; +"use client"; +var __create = Object.create; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __getProtoOf = Object.getPrototypeOf; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( + // If the importer is in node compatibility mode or this is not an ESM + // file that has been converted to a CommonJS file using a Babel- + // compatible transform (i.e. "__esModule" has not been set), then set + // "default" to the CommonJS "module.exports" for node compatibility. + isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, + mod +)); +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/errorBoundaryUtils.ts +var errorBoundaryUtils_exports = {}; +__export(errorBoundaryUtils_exports, { + ensurePreventErrorBoundaryRetry: () => ensurePreventErrorBoundaryRetry, + getHasError: () => getHasError, + useClearResetErrorBoundary: () => useClearResetErrorBoundary +}); +module.exports = __toCommonJS(errorBoundaryUtils_exports); +var React = __toESM(require("react"), 1); +var import_query_core = require("@tanstack/query-core"); +var ensurePreventErrorBoundaryRetry = (options, errorResetBoundary, query) => { + const throwOnError = query?.state.error && typeof options.throwOnError === "function" ? (0, import_query_core.shouldThrowError)(options.throwOnError, [query.state.error, query]) : options.throwOnError; + if (options.suspense || options.experimental_prefetchInRender || throwOnError) { + if (!errorResetBoundary.isReset()) { + options.retryOnMount = false; + } + } +}; +var useClearResetErrorBoundary = (errorResetBoundary) => { + React.useEffect(() => { + errorResetBoundary.clearReset(); + }, [errorResetBoundary]); +}; +var getHasError = ({ + result, + errorResetBoundary, + throwOnError, + query, + suspense +}) => { + return result.isError && !errorResetBoundary.isReset() && !result.isFetching && query && (suspense && result.data === void 0 || (0, import_query_core.shouldThrowError)(throwOnError, [result.error, query])); +}; +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + ensurePreventErrorBoundaryRetry, + getHasError, + useClearResetErrorBoundary +}); +//# sourceMappingURL=errorBoundaryUtils.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/errorBoundaryUtils.cjs.map b/node_modules/@tanstack/react-query/build/modern/errorBoundaryUtils.cjs.map new file mode 100644 index 0000000..a3e5032 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/modern/errorBoundaryUtils.cjs.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/errorBoundaryUtils.ts"],"sourcesContent":["'use client'\nimport * as React from 'react'\nimport { shouldThrowError } from '@tanstack/query-core'\nimport type {\n DefaultedQueryObserverOptions,\n Query,\n QueryKey,\n QueryObserverResult,\n ThrowOnError,\n} from '@tanstack/query-core'\nimport type { QueryErrorResetBoundaryValue } from './QueryErrorResetBoundary'\n\nexport const ensurePreventErrorBoundaryRetry = <\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey extends QueryKey,\n>(\n options: DefaultedQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >,\n errorResetBoundary: QueryErrorResetBoundaryValue,\n query: Query | undefined,\n) => {\n const throwOnError =\n query?.state.error && typeof options.throwOnError === 'function'\n ? shouldThrowError(options.throwOnError, [query.state.error, query])\n : options.throwOnError\n\n if (\n options.suspense ||\n options.experimental_prefetchInRender ||\n throwOnError\n ) {\n // Prevent retrying failed query if the error boundary has not been reset yet\n if (!errorResetBoundary.isReset()) {\n options.retryOnMount = false\n }\n }\n}\n\nexport const useClearResetErrorBoundary = (\n errorResetBoundary: QueryErrorResetBoundaryValue,\n) => {\n React.useEffect(() => {\n errorResetBoundary.clearReset()\n }, [errorResetBoundary])\n}\n\nexport const getHasError = <\n TData,\n TError,\n TQueryFnData,\n TQueryData,\n TQueryKey extends QueryKey,\n>({\n result,\n errorResetBoundary,\n throwOnError,\n query,\n suspense,\n}: {\n result: QueryObserverResult\n errorResetBoundary: QueryErrorResetBoundaryValue\n throwOnError: ThrowOnError\n query: Query | undefined\n suspense: boolean | undefined\n}) => {\n return (\n result.isError &&\n !errorResetBoundary.isReset() &&\n !result.isFetching &&\n query &&\n ((suspense && result.data === undefined) ||\n shouldThrowError(throwOnError, [result.error, query]))\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,YAAuB;AACvB,wBAAiC;AAU1B,IAAM,kCAAkC,CAO7C,SAOA,oBACA,UACG;AACH,QAAM,eACJ,OAAO,MAAM,SAAS,OAAO,QAAQ,iBAAiB,iBAClD,oCAAiB,QAAQ,cAAc,CAAC,MAAM,MAAM,OAAO,KAAK,CAAC,IACjE,QAAQ;AAEd,MACE,QAAQ,YACR,QAAQ,iCACR,cACA;AAEA,QAAI,CAAC,mBAAmB,QAAQ,GAAG;AACjC,cAAQ,eAAe;AAAA,IACzB;AAAA,EACF;AACF;AAEO,IAAM,6BAA6B,CACxC,uBACG;AACH,EAAM,gBAAU,MAAM;AACpB,uBAAmB,WAAW;AAAA,EAChC,GAAG,CAAC,kBAAkB,CAAC;AACzB;AAEO,IAAM,cAAc,CAMzB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MAMM;AACJ,SACE,OAAO,WACP,CAAC,mBAAmB,QAAQ,KAC5B,CAAC,OAAO,cACR,UACE,YAAY,OAAO,SAAS,cAC5B,oCAAiB,cAAc,CAAC,OAAO,OAAO,KAAK,CAAC;AAE1D;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/errorBoundaryUtils.d.cts b/node_modules/@tanstack/react-query/build/modern/errorBoundaryUtils.d.cts new file mode 100644 index 0000000..1a46fd1 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/modern/errorBoundaryUtils.d.cts @@ -0,0 +1,16 @@ +import { QueryKey, DefaultedQueryObserverOptions, Query, QueryObserverResult, ThrowOnError } from '@tanstack/query-core'; +import { QueryErrorResetBoundaryValue } from './QueryErrorResetBoundary.cjs'; +import 'react/jsx-runtime'; +import 'react'; + +declare const ensurePreventErrorBoundaryRetry: (options: DefaultedQueryObserverOptions, errorResetBoundary: QueryErrorResetBoundaryValue, query: Query | undefined) => void; +declare const useClearResetErrorBoundary: (errorResetBoundary: QueryErrorResetBoundaryValue) => void; +declare const getHasError: ({ result, errorResetBoundary, throwOnError, query, suspense, }: { + result: QueryObserverResult; + errorResetBoundary: QueryErrorResetBoundaryValue; + throwOnError: ThrowOnError; + query: Query | undefined; + suspense: boolean | undefined; +}) => boolean | undefined; + +export { ensurePreventErrorBoundaryRetry, getHasError, useClearResetErrorBoundary }; diff --git a/node_modules/@tanstack/react-query/build/modern/errorBoundaryUtils.d.ts b/node_modules/@tanstack/react-query/build/modern/errorBoundaryUtils.d.ts new file mode 100644 index 0000000..3b9fc8b --- /dev/null +++ b/node_modules/@tanstack/react-query/build/modern/errorBoundaryUtils.d.ts @@ -0,0 +1,16 @@ +import { QueryKey, DefaultedQueryObserverOptions, Query, QueryObserverResult, ThrowOnError } from '@tanstack/query-core'; +import { QueryErrorResetBoundaryValue } from './QueryErrorResetBoundary.js'; +import 'react/jsx-runtime'; +import 'react'; + +declare const ensurePreventErrorBoundaryRetry: (options: DefaultedQueryObserverOptions, errorResetBoundary: QueryErrorResetBoundaryValue, query: Query | undefined) => void; +declare const useClearResetErrorBoundary: (errorResetBoundary: QueryErrorResetBoundaryValue) => void; +declare const getHasError: ({ result, errorResetBoundary, throwOnError, query, suspense, }: { + result: QueryObserverResult; + errorResetBoundary: QueryErrorResetBoundaryValue; + throwOnError: ThrowOnError; + query: Query | undefined; + suspense: boolean | undefined; +}) => boolean | undefined; + +export { ensurePreventErrorBoundaryRetry, getHasError, useClearResetErrorBoundary }; diff --git a/node_modules/@tanstack/react-query/build/modern/errorBoundaryUtils.js b/node_modules/@tanstack/react-query/build/modern/errorBoundaryUtils.js new file mode 100644 index 0000000..548f738 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/modern/errorBoundaryUtils.js @@ -0,0 +1,33 @@ +"use client"; + +// src/errorBoundaryUtils.ts +import * as React from "react"; +import { shouldThrowError } from "@tanstack/query-core"; +var ensurePreventErrorBoundaryRetry = (options, errorResetBoundary, query) => { + const throwOnError = query?.state.error && typeof options.throwOnError === "function" ? shouldThrowError(options.throwOnError, [query.state.error, query]) : options.throwOnError; + if (options.suspense || options.experimental_prefetchInRender || throwOnError) { + if (!errorResetBoundary.isReset()) { + options.retryOnMount = false; + } + } +}; +var useClearResetErrorBoundary = (errorResetBoundary) => { + React.useEffect(() => { + errorResetBoundary.clearReset(); + }, [errorResetBoundary]); +}; +var getHasError = ({ + result, + errorResetBoundary, + throwOnError, + query, + suspense +}) => { + return result.isError && !errorResetBoundary.isReset() && !result.isFetching && query && (suspense && result.data === void 0 || shouldThrowError(throwOnError, [result.error, query])); +}; +export { + ensurePreventErrorBoundaryRetry, + getHasError, + useClearResetErrorBoundary +}; +//# sourceMappingURL=errorBoundaryUtils.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/errorBoundaryUtils.js.map b/node_modules/@tanstack/react-query/build/modern/errorBoundaryUtils.js.map new file mode 100644 index 0000000..9a29308 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/modern/errorBoundaryUtils.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/errorBoundaryUtils.ts"],"sourcesContent":["'use client'\nimport * as React from 'react'\nimport { shouldThrowError } from '@tanstack/query-core'\nimport type {\n DefaultedQueryObserverOptions,\n Query,\n QueryKey,\n QueryObserverResult,\n ThrowOnError,\n} from '@tanstack/query-core'\nimport type { QueryErrorResetBoundaryValue } from './QueryErrorResetBoundary'\n\nexport const ensurePreventErrorBoundaryRetry = <\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey extends QueryKey,\n>(\n options: DefaultedQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >,\n errorResetBoundary: QueryErrorResetBoundaryValue,\n query: Query | undefined,\n) => {\n const throwOnError =\n query?.state.error && typeof options.throwOnError === 'function'\n ? shouldThrowError(options.throwOnError, [query.state.error, query])\n : options.throwOnError\n\n if (\n options.suspense ||\n options.experimental_prefetchInRender ||\n throwOnError\n ) {\n // Prevent retrying failed query if the error boundary has not been reset yet\n if (!errorResetBoundary.isReset()) {\n options.retryOnMount = false\n }\n }\n}\n\nexport const useClearResetErrorBoundary = (\n errorResetBoundary: QueryErrorResetBoundaryValue,\n) => {\n React.useEffect(() => {\n errorResetBoundary.clearReset()\n }, [errorResetBoundary])\n}\n\nexport const getHasError = <\n TData,\n TError,\n TQueryFnData,\n TQueryData,\n TQueryKey extends QueryKey,\n>({\n result,\n errorResetBoundary,\n throwOnError,\n query,\n suspense,\n}: {\n result: QueryObserverResult\n errorResetBoundary: QueryErrorResetBoundaryValue\n throwOnError: ThrowOnError\n query: Query | undefined\n suspense: boolean | undefined\n}) => {\n return (\n result.isError &&\n !errorResetBoundary.isReset() &&\n !result.isFetching &&\n query &&\n ((suspense && result.data === undefined) ||\n shouldThrowError(throwOnError, [result.error, query]))\n )\n}\n"],"mappings":";;;AACA,YAAY,WAAW;AACvB,SAAS,wBAAwB;AAU1B,IAAM,kCAAkC,CAO7C,SAOA,oBACA,UACG;AACH,QAAM,eACJ,OAAO,MAAM,SAAS,OAAO,QAAQ,iBAAiB,aAClD,iBAAiB,QAAQ,cAAc,CAAC,MAAM,MAAM,OAAO,KAAK,CAAC,IACjE,QAAQ;AAEd,MACE,QAAQ,YACR,QAAQ,iCACR,cACA;AAEA,QAAI,CAAC,mBAAmB,QAAQ,GAAG;AACjC,cAAQ,eAAe;AAAA,IACzB;AAAA,EACF;AACF;AAEO,IAAM,6BAA6B,CACxC,uBACG;AACH,EAAM,gBAAU,MAAM;AACpB,uBAAmB,WAAW;AAAA,EAChC,GAAG,CAAC,kBAAkB,CAAC;AACzB;AAEO,IAAM,cAAc,CAMzB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MAMM;AACJ,SACE,OAAO,WACP,CAAC,mBAAmB,QAAQ,KAC5B,CAAC,OAAO,cACR,UACE,YAAY,OAAO,SAAS,UAC5B,iBAAiB,cAAc,CAAC,OAAO,OAAO,KAAK,CAAC;AAE1D;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/index.cjs b/node_modules/@tanstack/react-query/build/modern/index.cjs new file mode 100644 index 0000000..0d7d36f --- /dev/null +++ b/node_modules/@tanstack/react-query/build/modern/index.cjs @@ -0,0 +1,97 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default")); +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/index.ts +var index_exports = {}; +__export(index_exports, { + HydrationBoundary: () => import_HydrationBoundary.HydrationBoundary, + IsRestoringProvider: () => import_IsRestoringProvider.IsRestoringProvider, + QueryClientContext: () => import_QueryClientProvider.QueryClientContext, + QueryClientProvider: () => import_QueryClientProvider.QueryClientProvider, + QueryErrorResetBoundary: () => import_QueryErrorResetBoundary.QueryErrorResetBoundary, + infiniteQueryOptions: () => import_infiniteQueryOptions.infiniteQueryOptions, + mutationOptions: () => import_mutationOptions.mutationOptions, + queryOptions: () => import_queryOptions.queryOptions, + useInfiniteQuery: () => import_useInfiniteQuery.useInfiniteQuery, + useIsFetching: () => import_useIsFetching.useIsFetching, + useIsMutating: () => import_useMutationState.useIsMutating, + useIsRestoring: () => import_IsRestoringProvider.useIsRestoring, + useMutation: () => import_useMutation.useMutation, + useMutationState: () => import_useMutationState.useMutationState, + usePrefetchInfiniteQuery: () => import_usePrefetchInfiniteQuery.usePrefetchInfiniteQuery, + usePrefetchQuery: () => import_usePrefetchQuery.usePrefetchQuery, + useQueries: () => import_useQueries.useQueries, + useQuery: () => import_useQuery.useQuery, + useQueryClient: () => import_QueryClientProvider.useQueryClient, + useQueryErrorResetBoundary: () => import_QueryErrorResetBoundary.useQueryErrorResetBoundary, + useSuspenseInfiniteQuery: () => import_useSuspenseInfiniteQuery.useSuspenseInfiniteQuery, + useSuspenseQueries: () => import_useSuspenseQueries.useSuspenseQueries, + useSuspenseQuery: () => import_useSuspenseQuery.useSuspenseQuery +}); +module.exports = __toCommonJS(index_exports); +__reExport(index_exports, require("@tanstack/query-core"), module.exports); +__reExport(index_exports, require("./types.cjs"), module.exports); +var import_useQueries = require("./useQueries.cjs"); +var import_useQuery = require("./useQuery.cjs"); +var import_useSuspenseQuery = require("./useSuspenseQuery.cjs"); +var import_useSuspenseInfiniteQuery = require("./useSuspenseInfiniteQuery.cjs"); +var import_useSuspenseQueries = require("./useSuspenseQueries.cjs"); +var import_usePrefetchQuery = require("./usePrefetchQuery.cjs"); +var import_usePrefetchInfiniteQuery = require("./usePrefetchInfiniteQuery.cjs"); +var import_queryOptions = require("./queryOptions.cjs"); +var import_infiniteQueryOptions = require("./infiniteQueryOptions.cjs"); +var import_QueryClientProvider = require("./QueryClientProvider.cjs"); +var import_HydrationBoundary = require("./HydrationBoundary.cjs"); +var import_QueryErrorResetBoundary = require("./QueryErrorResetBoundary.cjs"); +var import_useIsFetching = require("./useIsFetching.cjs"); +var import_useMutationState = require("./useMutationState.cjs"); +var import_useMutation = require("./useMutation.cjs"); +var import_mutationOptions = require("./mutationOptions.cjs"); +var import_useInfiniteQuery = require("./useInfiniteQuery.cjs"); +var import_IsRestoringProvider = require("./IsRestoringProvider.cjs"); +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + HydrationBoundary, + IsRestoringProvider, + QueryClientContext, + QueryClientProvider, + QueryErrorResetBoundary, + infiniteQueryOptions, + mutationOptions, + queryOptions, + useInfiniteQuery, + useIsFetching, + useIsMutating, + useIsRestoring, + useMutation, + useMutationState, + usePrefetchInfiniteQuery, + usePrefetchQuery, + useQueries, + useQuery, + useQueryClient, + useQueryErrorResetBoundary, + useSuspenseInfiniteQuery, + useSuspenseQueries, + useSuspenseQuery, + ...require("@tanstack/query-core"), + ...require("./types.cjs") +}); +//# sourceMappingURL=index.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/index.cjs.map b/node_modules/@tanstack/react-query/build/modern/index.cjs.map new file mode 100644 index 0000000..3e25ed1 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/modern/index.cjs.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/index.ts"],"sourcesContent":["/* istanbul ignore file */\n\n// Re-export core\nexport * from '@tanstack/query-core'\n\n// React Query\nexport * from './types'\nexport { useQueries } from './useQueries'\nexport type { QueriesResults, QueriesOptions } from './useQueries'\nexport { useQuery } from './useQuery'\nexport { useSuspenseQuery } from './useSuspenseQuery'\nexport { useSuspenseInfiniteQuery } from './useSuspenseInfiniteQuery'\nexport { useSuspenseQueries } from './useSuspenseQueries'\nexport type {\n SuspenseQueriesResults,\n SuspenseQueriesOptions,\n} from './useSuspenseQueries'\nexport { usePrefetchQuery } from './usePrefetchQuery'\nexport { usePrefetchInfiniteQuery } from './usePrefetchInfiniteQuery'\nexport { queryOptions } from './queryOptions'\nexport type {\n DefinedInitialDataOptions,\n UndefinedInitialDataOptions,\n UnusedSkipTokenOptions,\n} from './queryOptions'\nexport { infiniteQueryOptions } from './infiniteQueryOptions'\nexport type {\n DefinedInitialDataInfiniteOptions,\n UndefinedInitialDataInfiniteOptions,\n UnusedSkipTokenInfiniteOptions,\n} from './infiniteQueryOptions'\nexport {\n QueryClientContext,\n QueryClientProvider,\n useQueryClient,\n} from './QueryClientProvider'\nexport type { QueryClientProviderProps } from './QueryClientProvider'\nexport type { QueryErrorResetBoundaryProps } from './QueryErrorResetBoundary'\nexport { HydrationBoundary } from './HydrationBoundary'\nexport type { HydrationBoundaryProps } from './HydrationBoundary'\nexport type {\n QueryErrorClearResetFunction,\n QueryErrorIsResetFunction,\n QueryErrorResetBoundaryFunction,\n QueryErrorResetFunction,\n} from './QueryErrorResetBoundary'\nexport {\n QueryErrorResetBoundary,\n useQueryErrorResetBoundary,\n} from './QueryErrorResetBoundary'\nexport { useIsFetching } from './useIsFetching'\nexport { useIsMutating, useMutationState } from './useMutationState'\nexport { useMutation } from './useMutation'\nexport { mutationOptions } from './mutationOptions'\nexport { useInfiniteQuery } from './useInfiniteQuery'\nexport { useIsRestoring, IsRestoringProvider } from './IsRestoringProvider'\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,0BAAc,iCAHd;AAMA,0BAAc,wBANd;AAOA,wBAA2B;AAE3B,sBAAyB;AACzB,8BAAiC;AACjC,sCAAyC;AACzC,gCAAmC;AAKnC,8BAAiC;AACjC,sCAAyC;AACzC,0BAA6B;AAM7B,kCAAqC;AAMrC,iCAIO;AAGP,+BAAkC;AAQlC,qCAGO;AACP,2BAA8B;AAC9B,8BAAgD;AAChD,yBAA4B;AAC5B,6BAAgC;AAChC,8BAAiC;AACjC,iCAAoD;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/index.d.cts b/node_modules/@tanstack/react-query/build/modern/index.d.cts new file mode 100644 index 0000000..4924b4f --- /dev/null +++ b/node_modules/@tanstack/react-query/build/modern/index.d.cts @@ -0,0 +1,22 @@ +export * from '@tanstack/query-core'; +export { AnyUseBaseQueryOptions, AnyUseInfiniteQueryOptions, AnyUseMutationOptions, AnyUseQueryOptions, AnyUseSuspenseInfiniteQueryOptions, AnyUseSuspenseQueryOptions, DefinedUseInfiniteQueryResult, DefinedUseQueryResult, UseBaseMutationResult, UseBaseQueryOptions, UseBaseQueryResult, UseInfiniteQueryOptions, UseInfiniteQueryResult, UseMutateAsyncFunction, UseMutateFunction, UseMutationOptions, UseMutationResult, UsePrefetchQueryOptions, UseQueryOptions, UseQueryResult, UseSuspenseInfiniteQueryOptions, UseSuspenseInfiniteQueryResult, UseSuspenseQueryOptions, UseSuspenseQueryResult } from './types.cjs'; +export { QueriesOptions, QueriesResults, useQueries } from './useQueries.cjs'; +export { useQuery } from './useQuery.cjs'; +export { useSuspenseQuery } from './useSuspenseQuery.cjs'; +export { useSuspenseInfiniteQuery } from './useSuspenseInfiniteQuery.cjs'; +export { SuspenseQueriesOptions, SuspenseQueriesResults, useSuspenseQueries } from './useSuspenseQueries.cjs'; +export { usePrefetchQuery } from './usePrefetchQuery.cjs'; +export { usePrefetchInfiniteQuery } from './usePrefetchInfiniteQuery.cjs'; +export { DefinedInitialDataOptions, UndefinedInitialDataOptions, UnusedSkipTokenOptions, queryOptions } from './queryOptions.cjs'; +export { DefinedInitialDataInfiniteOptions, UndefinedInitialDataInfiniteOptions, UnusedSkipTokenInfiniteOptions, infiniteQueryOptions } from './infiniteQueryOptions.cjs'; +export { QueryClientContext, QueryClientProvider, QueryClientProviderProps, useQueryClient } from './QueryClientProvider.cjs'; +export { QueryErrorClearResetFunction, QueryErrorIsResetFunction, QueryErrorResetBoundary, QueryErrorResetBoundaryFunction, QueryErrorResetBoundaryProps, QueryErrorResetFunction, useQueryErrorResetBoundary } from './QueryErrorResetBoundary.cjs'; +export { HydrationBoundary, HydrationBoundaryProps } from './HydrationBoundary.cjs'; +export { useIsFetching } from './useIsFetching.cjs'; +export { useIsMutating, useMutationState } from './useMutationState.cjs'; +export { useMutation } from './useMutation.cjs'; +export { mutationOptions } from './mutationOptions.cjs'; +export { useInfiniteQuery } from './useInfiniteQuery.cjs'; +export { IsRestoringProvider, useIsRestoring } from './IsRestoringProvider.cjs'; +import 'react'; +import 'react/jsx-runtime'; diff --git a/node_modules/@tanstack/react-query/build/modern/index.d.ts b/node_modules/@tanstack/react-query/build/modern/index.d.ts new file mode 100644 index 0000000..45dab83 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/modern/index.d.ts @@ -0,0 +1,22 @@ +export * from '@tanstack/query-core'; +export { AnyUseBaseQueryOptions, AnyUseInfiniteQueryOptions, AnyUseMutationOptions, AnyUseQueryOptions, AnyUseSuspenseInfiniteQueryOptions, AnyUseSuspenseQueryOptions, DefinedUseInfiniteQueryResult, DefinedUseQueryResult, UseBaseMutationResult, UseBaseQueryOptions, UseBaseQueryResult, UseInfiniteQueryOptions, UseInfiniteQueryResult, UseMutateAsyncFunction, UseMutateFunction, UseMutationOptions, UseMutationResult, UsePrefetchQueryOptions, UseQueryOptions, UseQueryResult, UseSuspenseInfiniteQueryOptions, UseSuspenseInfiniteQueryResult, UseSuspenseQueryOptions, UseSuspenseQueryResult } from './types.js'; +export { QueriesOptions, QueriesResults, useQueries } from './useQueries.js'; +export { useQuery } from './useQuery.js'; +export { useSuspenseQuery } from './useSuspenseQuery.js'; +export { useSuspenseInfiniteQuery } from './useSuspenseInfiniteQuery.js'; +export { SuspenseQueriesOptions, SuspenseQueriesResults, useSuspenseQueries } from './useSuspenseQueries.js'; +export { usePrefetchQuery } from './usePrefetchQuery.js'; +export { usePrefetchInfiniteQuery } from './usePrefetchInfiniteQuery.js'; +export { DefinedInitialDataOptions, UndefinedInitialDataOptions, UnusedSkipTokenOptions, queryOptions } from './queryOptions.js'; +export { DefinedInitialDataInfiniteOptions, UndefinedInitialDataInfiniteOptions, UnusedSkipTokenInfiniteOptions, infiniteQueryOptions } from './infiniteQueryOptions.js'; +export { QueryClientContext, QueryClientProvider, QueryClientProviderProps, useQueryClient } from './QueryClientProvider.js'; +export { QueryErrorClearResetFunction, QueryErrorIsResetFunction, QueryErrorResetBoundary, QueryErrorResetBoundaryFunction, QueryErrorResetBoundaryProps, QueryErrorResetFunction, useQueryErrorResetBoundary } from './QueryErrorResetBoundary.js'; +export { HydrationBoundary, HydrationBoundaryProps } from './HydrationBoundary.js'; +export { useIsFetching } from './useIsFetching.js'; +export { useIsMutating, useMutationState } from './useMutationState.js'; +export { useMutation } from './useMutation.js'; +export { mutationOptions } from './mutationOptions.js'; +export { useInfiniteQuery } from './useInfiniteQuery.js'; +export { IsRestoringProvider, useIsRestoring } from './IsRestoringProvider.js'; +import 'react'; +import 'react/jsx-runtime'; diff --git a/node_modules/@tanstack/react-query/build/modern/index.js b/node_modules/@tanstack/react-query/build/modern/index.js new file mode 100644 index 0000000..66ddb26 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/modern/index.js @@ -0,0 +1,54 @@ +// src/index.ts +export * from "@tanstack/query-core"; +export * from "./types.js"; +import { useQueries } from "./useQueries.js"; +import { useQuery } from "./useQuery.js"; +import { useSuspenseQuery } from "./useSuspenseQuery.js"; +import { useSuspenseInfiniteQuery } from "./useSuspenseInfiniteQuery.js"; +import { useSuspenseQueries } from "./useSuspenseQueries.js"; +import { usePrefetchQuery } from "./usePrefetchQuery.js"; +import { usePrefetchInfiniteQuery } from "./usePrefetchInfiniteQuery.js"; +import { queryOptions } from "./queryOptions.js"; +import { infiniteQueryOptions } from "./infiniteQueryOptions.js"; +import { + QueryClientContext, + QueryClientProvider, + useQueryClient +} from "./QueryClientProvider.js"; +import { HydrationBoundary } from "./HydrationBoundary.js"; +import { + QueryErrorResetBoundary, + useQueryErrorResetBoundary +} from "./QueryErrorResetBoundary.js"; +import { useIsFetching } from "./useIsFetching.js"; +import { useIsMutating, useMutationState } from "./useMutationState.js"; +import { useMutation } from "./useMutation.js"; +import { mutationOptions } from "./mutationOptions.js"; +import { useInfiniteQuery } from "./useInfiniteQuery.js"; +import { useIsRestoring, IsRestoringProvider } from "./IsRestoringProvider.js"; +export { + HydrationBoundary, + IsRestoringProvider, + QueryClientContext, + QueryClientProvider, + QueryErrorResetBoundary, + infiniteQueryOptions, + mutationOptions, + queryOptions, + useInfiniteQuery, + useIsFetching, + useIsMutating, + useIsRestoring, + useMutation, + useMutationState, + usePrefetchInfiniteQuery, + usePrefetchQuery, + useQueries, + useQuery, + useQueryClient, + useQueryErrorResetBoundary, + useSuspenseInfiniteQuery, + useSuspenseQueries, + useSuspenseQuery +}; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/index.js.map b/node_modules/@tanstack/react-query/build/modern/index.js.map new file mode 100644 index 0000000..e3df051 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/modern/index.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/index.ts"],"sourcesContent":["/* istanbul ignore file */\n\n// Re-export core\nexport * from '@tanstack/query-core'\n\n// React Query\nexport * from './types'\nexport { useQueries } from './useQueries'\nexport type { QueriesResults, QueriesOptions } from './useQueries'\nexport { useQuery } from './useQuery'\nexport { useSuspenseQuery } from './useSuspenseQuery'\nexport { useSuspenseInfiniteQuery } from './useSuspenseInfiniteQuery'\nexport { useSuspenseQueries } from './useSuspenseQueries'\nexport type {\n SuspenseQueriesResults,\n SuspenseQueriesOptions,\n} from './useSuspenseQueries'\nexport { usePrefetchQuery } from './usePrefetchQuery'\nexport { usePrefetchInfiniteQuery } from './usePrefetchInfiniteQuery'\nexport { queryOptions } from './queryOptions'\nexport type {\n DefinedInitialDataOptions,\n UndefinedInitialDataOptions,\n UnusedSkipTokenOptions,\n} from './queryOptions'\nexport { infiniteQueryOptions } from './infiniteQueryOptions'\nexport type {\n DefinedInitialDataInfiniteOptions,\n UndefinedInitialDataInfiniteOptions,\n UnusedSkipTokenInfiniteOptions,\n} from './infiniteQueryOptions'\nexport {\n QueryClientContext,\n QueryClientProvider,\n useQueryClient,\n} from './QueryClientProvider'\nexport type { QueryClientProviderProps } from './QueryClientProvider'\nexport type { QueryErrorResetBoundaryProps } from './QueryErrorResetBoundary'\nexport { HydrationBoundary } from './HydrationBoundary'\nexport type { HydrationBoundaryProps } from './HydrationBoundary'\nexport type {\n QueryErrorClearResetFunction,\n QueryErrorIsResetFunction,\n QueryErrorResetBoundaryFunction,\n QueryErrorResetFunction,\n} from './QueryErrorResetBoundary'\nexport {\n QueryErrorResetBoundary,\n useQueryErrorResetBoundary,\n} from './QueryErrorResetBoundary'\nexport { useIsFetching } from './useIsFetching'\nexport { useIsMutating, useMutationState } from './useMutationState'\nexport { useMutation } from './useMutation'\nexport { mutationOptions } from './mutationOptions'\nexport { useInfiniteQuery } from './useInfiniteQuery'\nexport { useIsRestoring, IsRestoringProvider } from './IsRestoringProvider'\n"],"mappings":";AAGA,cAAc;AAGd,cAAc;AACd,SAAS,kBAAkB;AAE3B,SAAS,gBAAgB;AACzB,SAAS,wBAAwB;AACjC,SAAS,gCAAgC;AACzC,SAAS,0BAA0B;AAKnC,SAAS,wBAAwB;AACjC,SAAS,gCAAgC;AACzC,SAAS,oBAAoB;AAM7B,SAAS,4BAA4B;AAMrC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAGP,SAAS,yBAAyB;AAQlC;AAAA,EACE;AAAA,EACA;AAAA,OACK;AACP,SAAS,qBAAqB;AAC9B,SAAS,eAAe,wBAAwB;AAChD,SAAS,mBAAmB;AAC5B,SAAS,uBAAuB;AAChC,SAAS,wBAAwB;AACjC,SAAS,gBAAgB,2BAA2B;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/infiniteQueryOptions.cjs b/node_modules/@tanstack/react-query/build/modern/infiniteQueryOptions.cjs new file mode 100644 index 0000000..d0ce5b1 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/modern/infiniteQueryOptions.cjs @@ -0,0 +1,33 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/infiniteQueryOptions.ts +var infiniteQueryOptions_exports = {}; +__export(infiniteQueryOptions_exports, { + infiniteQueryOptions: () => infiniteQueryOptions +}); +module.exports = __toCommonJS(infiniteQueryOptions_exports); +function infiniteQueryOptions(options) { + return options; +} +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + infiniteQueryOptions +}); +//# sourceMappingURL=infiniteQueryOptions.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/infiniteQueryOptions.cjs.map b/node_modules/@tanstack/react-query/build/modern/infiniteQueryOptions.cjs.map new file mode 100644 index 0000000..b802bf9 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/modern/infiniteQueryOptions.cjs.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/infiniteQueryOptions.ts"],"sourcesContent":["import type {\n DataTag,\n DefaultError,\n InfiniteData,\n InitialDataFunction,\n NonUndefinedGuard,\n OmitKeyof,\n QueryKey,\n SkipToken,\n} from '@tanstack/query-core'\nimport type { UseInfiniteQueryOptions } from './types'\n\nexport type UndefinedInitialDataInfiniteOptions<\n TQueryFnData,\n TError = DefaultError,\n TData = InfiniteData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n> = UseInfiniteQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n> & {\n initialData?:\n | undefined\n | NonUndefinedGuard>\n | InitialDataFunction<\n NonUndefinedGuard>\n >\n}\n\nexport type UnusedSkipTokenInfiniteOptions<\n TQueryFnData,\n TError = DefaultError,\n TData = InfiniteData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n> = OmitKeyof<\n UseInfiniteQueryOptions,\n 'queryFn'\n> & {\n queryFn?: Exclude<\n UseInfiniteQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >['queryFn'],\n SkipToken | undefined\n >\n}\n\nexport type DefinedInitialDataInfiniteOptions<\n TQueryFnData,\n TError = DefaultError,\n TData = InfiniteData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n> = UseInfiniteQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n> & {\n initialData:\n | NonUndefinedGuard>\n | (() => NonUndefinedGuard>)\n | undefined\n}\n\nexport function infiniteQueryOptions<\n TQueryFnData,\n TError = DefaultError,\n TData = InfiniteData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n>(\n options: DefinedInitialDataInfiniteOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n): DefinedInitialDataInfiniteOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n> & {\n queryKey: DataTag, TError>\n}\n\nexport function infiniteQueryOptions<\n TQueryFnData,\n TError = DefaultError,\n TData = InfiniteData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n>(\n options: UnusedSkipTokenInfiniteOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n): UnusedSkipTokenInfiniteOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n> & {\n queryKey: DataTag, TError>\n}\n\nexport function infiniteQueryOptions<\n TQueryFnData,\n TError = DefaultError,\n TData = InfiniteData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n>(\n options: UndefinedInitialDataInfiniteOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n): UndefinedInitialDataInfiniteOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n> & {\n queryKey: DataTag, TError>\n}\n\nexport function infiniteQueryOptions(options: unknown) {\n return options\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAkJO,SAAS,qBAAqB,SAAkB;AACrD,SAAO;AACT;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/infiniteQueryOptions.d.cts b/node_modules/@tanstack/react-query/build/modern/infiniteQueryOptions.d.cts new file mode 100644 index 0000000..c363f90 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/modern/infiniteQueryOptions.d.cts @@ -0,0 +1,23 @@ +import { DefaultError, InfiniteData, QueryKey, NonUndefinedGuard, InitialDataFunction, OmitKeyof, SkipToken, DataTag } from '@tanstack/query-core'; +import { UseInfiniteQueryOptions } from './types.cjs'; + +type UndefinedInitialDataInfiniteOptions, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown> = UseInfiniteQueryOptions & { + initialData?: undefined | NonUndefinedGuard> | InitialDataFunction>>; +}; +type UnusedSkipTokenInfiniteOptions, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown> = OmitKeyof, 'queryFn'> & { + queryFn?: Exclude['queryFn'], SkipToken | undefined>; +}; +type DefinedInitialDataInfiniteOptions, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown> = UseInfiniteQueryOptions & { + initialData: NonUndefinedGuard> | (() => NonUndefinedGuard>) | undefined; +}; +declare function infiniteQueryOptions, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown>(options: DefinedInitialDataInfiniteOptions): DefinedInitialDataInfiniteOptions & { + queryKey: DataTag, TError>; +}; +declare function infiniteQueryOptions, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown>(options: UnusedSkipTokenInfiniteOptions): UnusedSkipTokenInfiniteOptions & { + queryKey: DataTag, TError>; +}; +declare function infiniteQueryOptions, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown>(options: UndefinedInitialDataInfiniteOptions): UndefinedInitialDataInfiniteOptions & { + queryKey: DataTag, TError>; +}; + +export { type DefinedInitialDataInfiniteOptions, type UndefinedInitialDataInfiniteOptions, type UnusedSkipTokenInfiniteOptions, infiniteQueryOptions }; diff --git a/node_modules/@tanstack/react-query/build/modern/infiniteQueryOptions.d.ts b/node_modules/@tanstack/react-query/build/modern/infiniteQueryOptions.d.ts new file mode 100644 index 0000000..a37a4de --- /dev/null +++ b/node_modules/@tanstack/react-query/build/modern/infiniteQueryOptions.d.ts @@ -0,0 +1,23 @@ +import { DefaultError, InfiniteData, QueryKey, NonUndefinedGuard, InitialDataFunction, OmitKeyof, SkipToken, DataTag } from '@tanstack/query-core'; +import { UseInfiniteQueryOptions } from './types.js'; + +type UndefinedInitialDataInfiniteOptions, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown> = UseInfiniteQueryOptions & { + initialData?: undefined | NonUndefinedGuard> | InitialDataFunction>>; +}; +type UnusedSkipTokenInfiniteOptions, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown> = OmitKeyof, 'queryFn'> & { + queryFn?: Exclude['queryFn'], SkipToken | undefined>; +}; +type DefinedInitialDataInfiniteOptions, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown> = UseInfiniteQueryOptions & { + initialData: NonUndefinedGuard> | (() => NonUndefinedGuard>) | undefined; +}; +declare function infiniteQueryOptions, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown>(options: DefinedInitialDataInfiniteOptions): DefinedInitialDataInfiniteOptions & { + queryKey: DataTag, TError>; +}; +declare function infiniteQueryOptions, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown>(options: UnusedSkipTokenInfiniteOptions): UnusedSkipTokenInfiniteOptions & { + queryKey: DataTag, TError>; +}; +declare function infiniteQueryOptions, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown>(options: UndefinedInitialDataInfiniteOptions): UndefinedInitialDataInfiniteOptions & { + queryKey: DataTag, TError>; +}; + +export { type DefinedInitialDataInfiniteOptions, type UndefinedInitialDataInfiniteOptions, type UnusedSkipTokenInfiniteOptions, infiniteQueryOptions }; diff --git a/node_modules/@tanstack/react-query/build/modern/infiniteQueryOptions.js b/node_modules/@tanstack/react-query/build/modern/infiniteQueryOptions.js new file mode 100644 index 0000000..bc8d5b0 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/modern/infiniteQueryOptions.js @@ -0,0 +1,8 @@ +// src/infiniteQueryOptions.ts +function infiniteQueryOptions(options) { + return options; +} +export { + infiniteQueryOptions +}; +//# sourceMappingURL=infiniteQueryOptions.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/infiniteQueryOptions.js.map b/node_modules/@tanstack/react-query/build/modern/infiniteQueryOptions.js.map new file mode 100644 index 0000000..fb592fc --- /dev/null +++ b/node_modules/@tanstack/react-query/build/modern/infiniteQueryOptions.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/infiniteQueryOptions.ts"],"sourcesContent":["import type {\n DataTag,\n DefaultError,\n InfiniteData,\n InitialDataFunction,\n NonUndefinedGuard,\n OmitKeyof,\n QueryKey,\n SkipToken,\n} from '@tanstack/query-core'\nimport type { UseInfiniteQueryOptions } from './types'\n\nexport type UndefinedInitialDataInfiniteOptions<\n TQueryFnData,\n TError = DefaultError,\n TData = InfiniteData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n> = UseInfiniteQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n> & {\n initialData?:\n | undefined\n | NonUndefinedGuard>\n | InitialDataFunction<\n NonUndefinedGuard>\n >\n}\n\nexport type UnusedSkipTokenInfiniteOptions<\n TQueryFnData,\n TError = DefaultError,\n TData = InfiniteData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n> = OmitKeyof<\n UseInfiniteQueryOptions,\n 'queryFn'\n> & {\n queryFn?: Exclude<\n UseInfiniteQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >['queryFn'],\n SkipToken | undefined\n >\n}\n\nexport type DefinedInitialDataInfiniteOptions<\n TQueryFnData,\n TError = DefaultError,\n TData = InfiniteData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n> = UseInfiniteQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n> & {\n initialData:\n | NonUndefinedGuard>\n | (() => NonUndefinedGuard>)\n | undefined\n}\n\nexport function infiniteQueryOptions<\n TQueryFnData,\n TError = DefaultError,\n TData = InfiniteData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n>(\n options: DefinedInitialDataInfiniteOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n): DefinedInitialDataInfiniteOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n> & {\n queryKey: DataTag, TError>\n}\n\nexport function infiniteQueryOptions<\n TQueryFnData,\n TError = DefaultError,\n TData = InfiniteData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n>(\n options: UnusedSkipTokenInfiniteOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n): UnusedSkipTokenInfiniteOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n> & {\n queryKey: DataTag, TError>\n}\n\nexport function infiniteQueryOptions<\n TQueryFnData,\n TError = DefaultError,\n TData = InfiniteData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n>(\n options: UndefinedInitialDataInfiniteOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n): UndefinedInitialDataInfiniteOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n> & {\n queryKey: DataTag, TError>\n}\n\nexport function infiniteQueryOptions(options: unknown) {\n return options\n}\n"],"mappings":";AAkJO,SAAS,qBAAqB,SAAkB;AACrD,SAAO;AACT;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/mutationOptions.cjs b/node_modules/@tanstack/react-query/build/modern/mutationOptions.cjs new file mode 100644 index 0000000..db3ac10 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/modern/mutationOptions.cjs @@ -0,0 +1,33 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/mutationOptions.ts +var mutationOptions_exports = {}; +__export(mutationOptions_exports, { + mutationOptions: () => mutationOptions +}); +module.exports = __toCommonJS(mutationOptions_exports); +function mutationOptions(options) { + return options; +} +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + mutationOptions +}); +//# sourceMappingURL=mutationOptions.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/mutationOptions.cjs.map b/node_modules/@tanstack/react-query/build/modern/mutationOptions.cjs.map new file mode 100644 index 0000000..683b965 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/modern/mutationOptions.cjs.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/mutationOptions.ts"],"sourcesContent":["import type { DefaultError, WithRequired } from '@tanstack/query-core'\nimport type { UseMutationOptions } from './types'\n\nexport function mutationOptions<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n>(\n options: WithRequired<\n UseMutationOptions,\n 'mutationKey'\n >,\n): WithRequired<\n UseMutationOptions,\n 'mutationKey'\n>\nexport function mutationOptions<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n>(\n options: Omit<\n UseMutationOptions,\n 'mutationKey'\n >,\n): Omit<\n UseMutationOptions,\n 'mutationKey'\n>\nexport function mutationOptions<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n>(\n options: UseMutationOptions,\n): UseMutationOptions {\n return options\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AA+BO,SAAS,gBAMd,SACgE;AAChE,SAAO;AACT;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/mutationOptions.d.cts b/node_modules/@tanstack/react-query/build/modern/mutationOptions.d.cts new file mode 100644 index 0000000..170edf3 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/modern/mutationOptions.d.cts @@ -0,0 +1,7 @@ +import { DefaultError, WithRequired } from '@tanstack/query-core'; +import { UseMutationOptions } from './types.cjs'; + +declare function mutationOptions(options: WithRequired, 'mutationKey'>): WithRequired, 'mutationKey'>; +declare function mutationOptions(options: Omit, 'mutationKey'>): Omit, 'mutationKey'>; + +export { mutationOptions }; diff --git a/node_modules/@tanstack/react-query/build/modern/mutationOptions.d.ts b/node_modules/@tanstack/react-query/build/modern/mutationOptions.d.ts new file mode 100644 index 0000000..b080cf2 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/modern/mutationOptions.d.ts @@ -0,0 +1,7 @@ +import { DefaultError, WithRequired } from '@tanstack/query-core'; +import { UseMutationOptions } from './types.js'; + +declare function mutationOptions(options: WithRequired, 'mutationKey'>): WithRequired, 'mutationKey'>; +declare function mutationOptions(options: Omit, 'mutationKey'>): Omit, 'mutationKey'>; + +export { mutationOptions }; diff --git a/node_modules/@tanstack/react-query/build/modern/mutationOptions.js b/node_modules/@tanstack/react-query/build/modern/mutationOptions.js new file mode 100644 index 0000000..d40279e --- /dev/null +++ b/node_modules/@tanstack/react-query/build/modern/mutationOptions.js @@ -0,0 +1,8 @@ +// src/mutationOptions.ts +function mutationOptions(options) { + return options; +} +export { + mutationOptions +}; +//# sourceMappingURL=mutationOptions.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/mutationOptions.js.map b/node_modules/@tanstack/react-query/build/modern/mutationOptions.js.map new file mode 100644 index 0000000..d0a8b6d --- /dev/null +++ b/node_modules/@tanstack/react-query/build/modern/mutationOptions.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/mutationOptions.ts"],"sourcesContent":["import type { DefaultError, WithRequired } from '@tanstack/query-core'\nimport type { UseMutationOptions } from './types'\n\nexport function mutationOptions<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n>(\n options: WithRequired<\n UseMutationOptions,\n 'mutationKey'\n >,\n): WithRequired<\n UseMutationOptions,\n 'mutationKey'\n>\nexport function mutationOptions<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n>(\n options: Omit<\n UseMutationOptions,\n 'mutationKey'\n >,\n): Omit<\n UseMutationOptions,\n 'mutationKey'\n>\nexport function mutationOptions<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n>(\n options: UseMutationOptions,\n): UseMutationOptions {\n return options\n}\n"],"mappings":";AA+BO,SAAS,gBAMd,SACgE;AAChE,SAAO;AACT;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/queryOptions.cjs b/node_modules/@tanstack/react-query/build/modern/queryOptions.cjs new file mode 100644 index 0000000..ffda67f --- /dev/null +++ b/node_modules/@tanstack/react-query/build/modern/queryOptions.cjs @@ -0,0 +1,33 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/queryOptions.ts +var queryOptions_exports = {}; +__export(queryOptions_exports, { + queryOptions: () => queryOptions +}); +module.exports = __toCommonJS(queryOptions_exports); +function queryOptions(options) { + return options; +} +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + queryOptions +}); +//# sourceMappingURL=queryOptions.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/queryOptions.cjs.map b/node_modules/@tanstack/react-query/build/modern/queryOptions.cjs.map new file mode 100644 index 0000000..426573b --- /dev/null +++ b/node_modules/@tanstack/react-query/build/modern/queryOptions.cjs.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/queryOptions.ts"],"sourcesContent":["import type {\n DataTag,\n DefaultError,\n InitialDataFunction,\n NonUndefinedGuard,\n OmitKeyof,\n QueryFunction,\n QueryKey,\n SkipToken,\n} from '@tanstack/query-core'\nimport type { UseQueryOptions } from './types'\n\nexport type UndefinedInitialDataOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> = UseQueryOptions & {\n initialData?:\n | undefined\n | InitialDataFunction>\n | NonUndefinedGuard\n}\n\nexport type UnusedSkipTokenOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> = OmitKeyof<\n UseQueryOptions,\n 'queryFn'\n> & {\n queryFn?: Exclude<\n UseQueryOptions['queryFn'],\n SkipToken | undefined\n >\n}\n\nexport type DefinedInitialDataOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> = Omit, 'queryFn'> & {\n initialData:\n | NonUndefinedGuard\n | (() => NonUndefinedGuard)\n queryFn?: QueryFunction\n}\n\nexport function queryOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n options: DefinedInitialDataOptions,\n): DefinedInitialDataOptions & {\n queryKey: DataTag\n}\n\nexport function queryOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n options: UnusedSkipTokenOptions,\n): UnusedSkipTokenOptions & {\n queryKey: DataTag\n}\n\nexport function queryOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n options: UndefinedInitialDataOptions,\n): UndefinedInitialDataOptions & {\n queryKey: DataTag\n}\n\nexport function queryOptions(options: unknown) {\n return options\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAoFO,SAAS,aAAa,SAAkB;AAC7C,SAAO;AACT;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/queryOptions.d.cts b/node_modules/@tanstack/react-query/build/modern/queryOptions.d.cts new file mode 100644 index 0000000..05489f6 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/modern/queryOptions.d.cts @@ -0,0 +1,24 @@ +import { DefaultError, QueryKey, NonUndefinedGuard, QueryFunction, InitialDataFunction, OmitKeyof, SkipToken, DataTag } from '@tanstack/query-core'; +import { UseQueryOptions } from './types.cjs'; + +type UndefinedInitialDataOptions = UseQueryOptions & { + initialData?: undefined | InitialDataFunction> | NonUndefinedGuard; +}; +type UnusedSkipTokenOptions = OmitKeyof, 'queryFn'> & { + queryFn?: Exclude['queryFn'], SkipToken | undefined>; +}; +type DefinedInitialDataOptions = Omit, 'queryFn'> & { + initialData: NonUndefinedGuard | (() => NonUndefinedGuard); + queryFn?: QueryFunction; +}; +declare function queryOptions(options: DefinedInitialDataOptions): DefinedInitialDataOptions & { + queryKey: DataTag; +}; +declare function queryOptions(options: UnusedSkipTokenOptions): UnusedSkipTokenOptions & { + queryKey: DataTag; +}; +declare function queryOptions(options: UndefinedInitialDataOptions): UndefinedInitialDataOptions & { + queryKey: DataTag; +}; + +export { type DefinedInitialDataOptions, type UndefinedInitialDataOptions, type UnusedSkipTokenOptions, queryOptions }; diff --git a/node_modules/@tanstack/react-query/build/modern/queryOptions.d.ts b/node_modules/@tanstack/react-query/build/modern/queryOptions.d.ts new file mode 100644 index 0000000..7a93665 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/modern/queryOptions.d.ts @@ -0,0 +1,24 @@ +import { DefaultError, QueryKey, NonUndefinedGuard, QueryFunction, InitialDataFunction, OmitKeyof, SkipToken, DataTag } from '@tanstack/query-core'; +import { UseQueryOptions } from './types.js'; + +type UndefinedInitialDataOptions = UseQueryOptions & { + initialData?: undefined | InitialDataFunction> | NonUndefinedGuard; +}; +type UnusedSkipTokenOptions = OmitKeyof, 'queryFn'> & { + queryFn?: Exclude['queryFn'], SkipToken | undefined>; +}; +type DefinedInitialDataOptions = Omit, 'queryFn'> & { + initialData: NonUndefinedGuard | (() => NonUndefinedGuard); + queryFn?: QueryFunction; +}; +declare function queryOptions(options: DefinedInitialDataOptions): DefinedInitialDataOptions & { + queryKey: DataTag; +}; +declare function queryOptions(options: UnusedSkipTokenOptions): UnusedSkipTokenOptions & { + queryKey: DataTag; +}; +declare function queryOptions(options: UndefinedInitialDataOptions): UndefinedInitialDataOptions & { + queryKey: DataTag; +}; + +export { type DefinedInitialDataOptions, type UndefinedInitialDataOptions, type UnusedSkipTokenOptions, queryOptions }; diff --git a/node_modules/@tanstack/react-query/build/modern/queryOptions.js b/node_modules/@tanstack/react-query/build/modern/queryOptions.js new file mode 100644 index 0000000..7fb75ff --- /dev/null +++ b/node_modules/@tanstack/react-query/build/modern/queryOptions.js @@ -0,0 +1,8 @@ +// src/queryOptions.ts +function queryOptions(options) { + return options; +} +export { + queryOptions +}; +//# sourceMappingURL=queryOptions.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/queryOptions.js.map b/node_modules/@tanstack/react-query/build/modern/queryOptions.js.map new file mode 100644 index 0000000..4ee7f34 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/modern/queryOptions.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/queryOptions.ts"],"sourcesContent":["import type {\n DataTag,\n DefaultError,\n InitialDataFunction,\n NonUndefinedGuard,\n OmitKeyof,\n QueryFunction,\n QueryKey,\n SkipToken,\n} from '@tanstack/query-core'\nimport type { UseQueryOptions } from './types'\n\nexport type UndefinedInitialDataOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> = UseQueryOptions & {\n initialData?:\n | undefined\n | InitialDataFunction>\n | NonUndefinedGuard\n}\n\nexport type UnusedSkipTokenOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> = OmitKeyof<\n UseQueryOptions,\n 'queryFn'\n> & {\n queryFn?: Exclude<\n UseQueryOptions['queryFn'],\n SkipToken | undefined\n >\n}\n\nexport type DefinedInitialDataOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> = Omit, 'queryFn'> & {\n initialData:\n | NonUndefinedGuard\n | (() => NonUndefinedGuard)\n queryFn?: QueryFunction\n}\n\nexport function queryOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n options: DefinedInitialDataOptions,\n): DefinedInitialDataOptions & {\n queryKey: DataTag\n}\n\nexport function queryOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n options: UnusedSkipTokenOptions,\n): UnusedSkipTokenOptions & {\n queryKey: DataTag\n}\n\nexport function queryOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n options: UndefinedInitialDataOptions,\n): UndefinedInitialDataOptions & {\n queryKey: DataTag\n}\n\nexport function queryOptions(options: unknown) {\n return options\n}\n"],"mappings":";AAoFO,SAAS,aAAa,SAAkB;AAC7C,SAAO;AACT;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/suspense.cjs b/node_modules/@tanstack/react-query/build/modern/suspense.cjs new file mode 100644 index 0000000..b282a93 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/modern/suspense.cjs @@ -0,0 +1,58 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/suspense.ts +var suspense_exports = {}; +__export(suspense_exports, { + defaultThrowOnError: () => defaultThrowOnError, + ensureSuspenseTimers: () => ensureSuspenseTimers, + fetchOptimistic: () => fetchOptimistic, + shouldSuspend: () => shouldSuspend, + willFetch: () => willFetch +}); +module.exports = __toCommonJS(suspense_exports); +var defaultThrowOnError = (_error, query) => query.state.data === void 0; +var ensureSuspenseTimers = (defaultedOptions) => { + if (defaultedOptions.suspense) { + const MIN_SUSPENSE_TIME_MS = 1e3; + const clamp = (value) => value === "static" ? value : Math.max(value ?? MIN_SUSPENSE_TIME_MS, MIN_SUSPENSE_TIME_MS); + const originalStaleTime = defaultedOptions.staleTime; + defaultedOptions.staleTime = typeof originalStaleTime === "function" ? (...args) => clamp(originalStaleTime(...args)) : clamp(originalStaleTime); + if (typeof defaultedOptions.gcTime === "number") { + defaultedOptions.gcTime = Math.max( + defaultedOptions.gcTime, + MIN_SUSPENSE_TIME_MS + ); + } + } +}; +var willFetch = (result, isRestoring) => result.isLoading && result.isFetching && !isRestoring; +var shouldSuspend = (defaultedOptions, result) => defaultedOptions?.suspense && result.isPending; +var fetchOptimistic = (defaultedOptions, observer, errorResetBoundary) => observer.fetchOptimistic(defaultedOptions).catch(() => { + errorResetBoundary.clearReset(); +}); +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + defaultThrowOnError, + ensureSuspenseTimers, + fetchOptimistic, + shouldSuspend, + willFetch +}); +//# sourceMappingURL=suspense.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/suspense.cjs.map b/node_modules/@tanstack/react-query/build/modern/suspense.cjs.map new file mode 100644 index 0000000..2e12a10 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/modern/suspense.cjs.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/suspense.ts"],"sourcesContent":["import type {\n DefaultError,\n DefaultedQueryObserverOptions,\n Query,\n QueryKey,\n QueryObserver,\n QueryObserverResult,\n} from '@tanstack/query-core'\nimport type { QueryErrorResetBoundaryValue } from './QueryErrorResetBoundary'\n\nexport const defaultThrowOnError = <\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n _error: TError,\n query: Query,\n) => query.state.data === undefined\n\nexport const ensureSuspenseTimers = (\n defaultedOptions: DefaultedQueryObserverOptions,\n) => {\n if (defaultedOptions.suspense) {\n // Handle staleTime to ensure minimum 1000ms in Suspense mode\n // This prevents unnecessary refetching when components remount after suspending\n const MIN_SUSPENSE_TIME_MS = 1000\n\n const clamp = (value: number | 'static' | undefined) =>\n value === 'static'\n ? value\n : Math.max(value ?? MIN_SUSPENSE_TIME_MS, MIN_SUSPENSE_TIME_MS)\n\n const originalStaleTime = defaultedOptions.staleTime\n defaultedOptions.staleTime =\n typeof originalStaleTime === 'function'\n ? (...args) => clamp(originalStaleTime(...args))\n : clamp(originalStaleTime)\n\n if (typeof defaultedOptions.gcTime === 'number') {\n defaultedOptions.gcTime = Math.max(\n defaultedOptions.gcTime,\n MIN_SUSPENSE_TIME_MS,\n )\n }\n }\n}\n\nexport const willFetch = (\n result: QueryObserverResult,\n isRestoring: boolean,\n) => result.isLoading && result.isFetching && !isRestoring\n\nexport const shouldSuspend = (\n defaultedOptions:\n | DefaultedQueryObserverOptions\n | undefined,\n result: QueryObserverResult,\n) => defaultedOptions?.suspense && result.isPending\n\nexport const fetchOptimistic = <\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey extends QueryKey,\n>(\n defaultedOptions: DefaultedQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >,\n observer: QueryObserver,\n errorResetBoundary: QueryErrorResetBoundaryValue,\n) =>\n observer.fetchOptimistic(defaultedOptions).catch(() => {\n errorResetBoundary.clearReset()\n })\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAUO,IAAM,sBAAsB,CAMjC,QACA,UACG,MAAM,MAAM,SAAS;AAEnB,IAAM,uBAAuB,CAClC,qBACG;AACH,MAAI,iBAAiB,UAAU;AAG7B,UAAM,uBAAuB;AAE7B,UAAM,QAAQ,CAAC,UACb,UAAU,WACN,QACA,KAAK,IAAI,SAAS,sBAAsB,oBAAoB;AAElE,UAAM,oBAAoB,iBAAiB;AAC3C,qBAAiB,YACf,OAAO,sBAAsB,aACzB,IAAI,SAAS,MAAM,kBAAkB,GAAG,IAAI,CAAC,IAC7C,MAAM,iBAAiB;AAE7B,QAAI,OAAO,iBAAiB,WAAW,UAAU;AAC/C,uBAAiB,SAAS,KAAK;AAAA,QAC7B,iBAAiB;AAAA,QACjB;AAAA,MACF;AAAA,IACF;AAAA,EACF;AACF;AAEO,IAAM,YAAY,CACvB,QACA,gBACG,OAAO,aAAa,OAAO,cAAc,CAAC;AAExC,IAAM,gBAAgB,CAC3B,kBAGA,WACG,kBAAkB,YAAY,OAAO;AAEnC,IAAM,kBAAkB,CAO7B,kBAOA,UACA,uBAEA,SAAS,gBAAgB,gBAAgB,EAAE,MAAM,MAAM;AACrD,qBAAmB,WAAW;AAChC,CAAC;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/suspense.d.cts b/node_modules/@tanstack/react-query/build/modern/suspense.d.cts new file mode 100644 index 0000000..da077db --- /dev/null +++ b/node_modules/@tanstack/react-query/build/modern/suspense.d.cts @@ -0,0 +1,12 @@ +import { DefaultError, QueryKey, Query, DefaultedQueryObserverOptions, QueryObserver, QueryObserverResult } from '@tanstack/query-core'; +import { QueryErrorResetBoundaryValue } from './QueryErrorResetBoundary.cjs'; +import 'react/jsx-runtime'; +import 'react'; + +declare const defaultThrowOnError: (_error: TError, query: Query) => boolean; +declare const ensureSuspenseTimers: (defaultedOptions: DefaultedQueryObserverOptions) => void; +declare const willFetch: (result: QueryObserverResult, isRestoring: boolean) => boolean; +declare const shouldSuspend: (defaultedOptions: DefaultedQueryObserverOptions | undefined, result: QueryObserverResult) => boolean | undefined; +declare const fetchOptimistic: (defaultedOptions: DefaultedQueryObserverOptions, observer: QueryObserver, errorResetBoundary: QueryErrorResetBoundaryValue) => Promise>; + +export { defaultThrowOnError, ensureSuspenseTimers, fetchOptimistic, shouldSuspend, willFetch }; diff --git a/node_modules/@tanstack/react-query/build/modern/suspense.d.ts b/node_modules/@tanstack/react-query/build/modern/suspense.d.ts new file mode 100644 index 0000000..954f1fb --- /dev/null +++ b/node_modules/@tanstack/react-query/build/modern/suspense.d.ts @@ -0,0 +1,12 @@ +import { DefaultError, QueryKey, Query, DefaultedQueryObserverOptions, QueryObserver, QueryObserverResult } from '@tanstack/query-core'; +import { QueryErrorResetBoundaryValue } from './QueryErrorResetBoundary.js'; +import 'react/jsx-runtime'; +import 'react'; + +declare const defaultThrowOnError: (_error: TError, query: Query) => boolean; +declare const ensureSuspenseTimers: (defaultedOptions: DefaultedQueryObserverOptions) => void; +declare const willFetch: (result: QueryObserverResult, isRestoring: boolean) => boolean; +declare const shouldSuspend: (defaultedOptions: DefaultedQueryObserverOptions | undefined, result: QueryObserverResult) => boolean | undefined; +declare const fetchOptimistic: (defaultedOptions: DefaultedQueryObserverOptions, observer: QueryObserver, errorResetBoundary: QueryErrorResetBoundaryValue) => Promise>; + +export { defaultThrowOnError, ensureSuspenseTimers, fetchOptimistic, shouldSuspend, willFetch }; diff --git a/node_modules/@tanstack/react-query/build/modern/suspense.js b/node_modules/@tanstack/react-query/build/modern/suspense.js new file mode 100644 index 0000000..58d8198 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/modern/suspense.js @@ -0,0 +1,29 @@ +// src/suspense.ts +var defaultThrowOnError = (_error, query) => query.state.data === void 0; +var ensureSuspenseTimers = (defaultedOptions) => { + if (defaultedOptions.suspense) { + const MIN_SUSPENSE_TIME_MS = 1e3; + const clamp = (value) => value === "static" ? value : Math.max(value ?? MIN_SUSPENSE_TIME_MS, MIN_SUSPENSE_TIME_MS); + const originalStaleTime = defaultedOptions.staleTime; + defaultedOptions.staleTime = typeof originalStaleTime === "function" ? (...args) => clamp(originalStaleTime(...args)) : clamp(originalStaleTime); + if (typeof defaultedOptions.gcTime === "number") { + defaultedOptions.gcTime = Math.max( + defaultedOptions.gcTime, + MIN_SUSPENSE_TIME_MS + ); + } + } +}; +var willFetch = (result, isRestoring) => result.isLoading && result.isFetching && !isRestoring; +var shouldSuspend = (defaultedOptions, result) => defaultedOptions?.suspense && result.isPending; +var fetchOptimistic = (defaultedOptions, observer, errorResetBoundary) => observer.fetchOptimistic(defaultedOptions).catch(() => { + errorResetBoundary.clearReset(); +}); +export { + defaultThrowOnError, + ensureSuspenseTimers, + fetchOptimistic, + shouldSuspend, + willFetch +}; +//# sourceMappingURL=suspense.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/suspense.js.map b/node_modules/@tanstack/react-query/build/modern/suspense.js.map new file mode 100644 index 0000000..6d16820 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/modern/suspense.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/suspense.ts"],"sourcesContent":["import type {\n DefaultError,\n DefaultedQueryObserverOptions,\n Query,\n QueryKey,\n QueryObserver,\n QueryObserverResult,\n} from '@tanstack/query-core'\nimport type { QueryErrorResetBoundaryValue } from './QueryErrorResetBoundary'\n\nexport const defaultThrowOnError = <\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n _error: TError,\n query: Query,\n) => query.state.data === undefined\n\nexport const ensureSuspenseTimers = (\n defaultedOptions: DefaultedQueryObserverOptions,\n) => {\n if (defaultedOptions.suspense) {\n // Handle staleTime to ensure minimum 1000ms in Suspense mode\n // This prevents unnecessary refetching when components remount after suspending\n const MIN_SUSPENSE_TIME_MS = 1000\n\n const clamp = (value: number | 'static' | undefined) =>\n value === 'static'\n ? value\n : Math.max(value ?? MIN_SUSPENSE_TIME_MS, MIN_SUSPENSE_TIME_MS)\n\n const originalStaleTime = defaultedOptions.staleTime\n defaultedOptions.staleTime =\n typeof originalStaleTime === 'function'\n ? (...args) => clamp(originalStaleTime(...args))\n : clamp(originalStaleTime)\n\n if (typeof defaultedOptions.gcTime === 'number') {\n defaultedOptions.gcTime = Math.max(\n defaultedOptions.gcTime,\n MIN_SUSPENSE_TIME_MS,\n )\n }\n }\n}\n\nexport const willFetch = (\n result: QueryObserverResult,\n isRestoring: boolean,\n) => result.isLoading && result.isFetching && !isRestoring\n\nexport const shouldSuspend = (\n defaultedOptions:\n | DefaultedQueryObserverOptions\n | undefined,\n result: QueryObserverResult,\n) => defaultedOptions?.suspense && result.isPending\n\nexport const fetchOptimistic = <\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey extends QueryKey,\n>(\n defaultedOptions: DefaultedQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >,\n observer: QueryObserver,\n errorResetBoundary: QueryErrorResetBoundaryValue,\n) =>\n observer.fetchOptimistic(defaultedOptions).catch(() => {\n errorResetBoundary.clearReset()\n })\n"],"mappings":";AAUO,IAAM,sBAAsB,CAMjC,QACA,UACG,MAAM,MAAM,SAAS;AAEnB,IAAM,uBAAuB,CAClC,qBACG;AACH,MAAI,iBAAiB,UAAU;AAG7B,UAAM,uBAAuB;AAE7B,UAAM,QAAQ,CAAC,UACb,UAAU,WACN,QACA,KAAK,IAAI,SAAS,sBAAsB,oBAAoB;AAElE,UAAM,oBAAoB,iBAAiB;AAC3C,qBAAiB,YACf,OAAO,sBAAsB,aACzB,IAAI,SAAS,MAAM,kBAAkB,GAAG,IAAI,CAAC,IAC7C,MAAM,iBAAiB;AAE7B,QAAI,OAAO,iBAAiB,WAAW,UAAU;AAC/C,uBAAiB,SAAS,KAAK;AAAA,QAC7B,iBAAiB;AAAA,QACjB;AAAA,MACF;AAAA,IACF;AAAA,EACF;AACF;AAEO,IAAM,YAAY,CACvB,QACA,gBACG,OAAO,aAAa,OAAO,cAAc,CAAC;AAExC,IAAM,gBAAgB,CAC3B,kBAGA,WACG,kBAAkB,YAAY,OAAO;AAEnC,IAAM,kBAAkB,CAO7B,kBAOA,UACA,uBAEA,SAAS,gBAAgB,gBAAgB,EAAE,MAAM,MAAM;AACrD,qBAAmB,WAAW;AAChC,CAAC;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/types.cjs b/node_modules/@tanstack/react-query/build/modern/types.cjs new file mode 100644 index 0000000..d22152b --- /dev/null +++ b/node_modules/@tanstack/react-query/build/modern/types.cjs @@ -0,0 +1,19 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/types.ts +var types_exports = {}; +module.exports = __toCommonJS(types_exports); +//# sourceMappingURL=types.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/types.cjs.map b/node_modules/@tanstack/react-query/build/modern/types.cjs.map new file mode 100644 index 0000000..3d02938 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/modern/types.cjs.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/types.ts"],"sourcesContent":["/* istanbul ignore file */\n\nimport type {\n DefaultError,\n DefinedInfiniteQueryObserverResult,\n DefinedQueryObserverResult,\n DistributiveOmit,\n FetchQueryOptions,\n InfiniteQueryObserverOptions,\n InfiniteQueryObserverResult,\n MutateFunction,\n MutationObserverOptions,\n MutationObserverResult,\n OmitKeyof,\n Override,\n QueryKey,\n QueryObserverOptions,\n QueryObserverResult,\n SkipToken,\n} from '@tanstack/query-core'\n\nexport type AnyUseBaseQueryOptions = UseBaseQueryOptions<\n any,\n any,\n any,\n any,\n any\n>\nexport interface UseBaseQueryOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> extends QueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n> {\n /**\n * Set this to `false` to unsubscribe this observer from updates to the query cache.\n * Defaults to `true`.\n */\n subscribed?: boolean\n}\n\nexport interface UsePrefetchQueryOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> extends OmitKeyof<\n FetchQueryOptions,\n 'queryFn'\n> {\n queryFn?: Exclude<\n FetchQueryOptions['queryFn'],\n SkipToken\n >\n}\n\nexport type AnyUseQueryOptions = UseQueryOptions\nexport interface UseQueryOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> extends OmitKeyof<\n UseBaseQueryOptions,\n 'suspense'\n> {}\n\nexport type AnyUseSuspenseQueryOptions = UseSuspenseQueryOptions<\n any,\n any,\n any,\n any\n>\nexport interface UseSuspenseQueryOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> extends OmitKeyof<\n UseQueryOptions,\n 'queryFn' | 'enabled' | 'throwOnError' | 'placeholderData'\n> {\n queryFn?: Exclude<\n UseQueryOptions['queryFn'],\n SkipToken\n >\n}\n\nexport type AnyUseInfiniteQueryOptions = UseInfiniteQueryOptions<\n any,\n any,\n any,\n any,\n any\n>\nexport interface UseInfiniteQueryOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n> extends OmitKeyof<\n InfiniteQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n 'suspense'\n> {\n /**\n * Set this to `false` to unsubscribe this observer from updates to the query cache.\n * Defaults to `true`.\n */\n subscribed?: boolean\n}\n\nexport type AnyUseSuspenseInfiniteQueryOptions =\n UseSuspenseInfiniteQueryOptions\nexport interface UseSuspenseInfiniteQueryOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n> extends OmitKeyof<\n UseInfiniteQueryOptions,\n 'queryFn' | 'enabled' | 'throwOnError' | 'placeholderData'\n> {\n queryFn?: Exclude<\n UseInfiniteQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >['queryFn'],\n SkipToken\n >\n}\n\nexport type UseBaseQueryResult<\n TData = unknown,\n TError = DefaultError,\n> = QueryObserverResult\n\nexport type UseQueryResult<\n TData = unknown,\n TError = DefaultError,\n> = UseBaseQueryResult\n\nexport type UseSuspenseQueryResult<\n TData = unknown,\n TError = DefaultError,\n> = DistributiveOmit<\n DefinedQueryObserverResult,\n 'isPlaceholderData' | 'promise'\n>\n\nexport type DefinedUseQueryResult<\n TData = unknown,\n TError = DefaultError,\n> = DefinedQueryObserverResult\n\nexport type UseInfiniteQueryResult<\n TData = unknown,\n TError = DefaultError,\n> = InfiniteQueryObserverResult\n\nexport type DefinedUseInfiniteQueryResult<\n TData = unknown,\n TError = DefaultError,\n> = DefinedInfiniteQueryObserverResult\n\nexport type UseSuspenseInfiniteQueryResult<\n TData = unknown,\n TError = DefaultError,\n> = OmitKeyof<\n DefinedInfiniteQueryObserverResult,\n 'isPlaceholderData' | 'promise'\n>\n\nexport type AnyUseMutationOptions = UseMutationOptions\nexport interface UseMutationOptions<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n> extends OmitKeyof<\n MutationObserverOptions,\n '_defaulted'\n> {}\n\nexport type UseMutateFunction<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n> = (\n ...args: Parameters<\n MutateFunction\n >\n) => void\n\nexport type UseMutateAsyncFunction<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n> = MutateFunction\n\nexport type UseBaseMutationResult<\n TData = unknown,\n TError = DefaultError,\n TVariables = unknown,\n TOnMutateResult = unknown,\n> = Override<\n MutationObserverResult,\n { mutate: UseMutateFunction }\n> & {\n mutateAsync: UseMutateAsyncFunction<\n TData,\n TError,\n TVariables,\n TOnMutateResult\n >\n}\n\nexport type UseMutationResult<\n TData = unknown,\n TError = DefaultError,\n TVariables = unknown,\n TOnMutateResult = unknown,\n> = UseBaseMutationResult\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/types.d.cts b/node_modules/@tanstack/react-query/build/modern/types.d.cts new file mode 100644 index 0000000..e9d55b2 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/modern/types.d.cts @@ -0,0 +1,52 @@ +import { DefaultError, QueryKey, QueryObserverOptions, OmitKeyof, InfiniteQueryObserverOptions, MutationObserverOptions, SkipToken, DefinedInfiniteQueryObserverResult, DefinedQueryObserverResult, QueryObserverResult, DistributiveOmit, Override, MutationObserverResult, MutateFunction, InfiniteQueryObserverResult, FetchQueryOptions } from '@tanstack/query-core'; + +type AnyUseBaseQueryOptions = UseBaseQueryOptions; +interface UseBaseQueryOptions extends QueryObserverOptions { + /** + * Set this to `false` to unsubscribe this observer from updates to the query cache. + * Defaults to `true`. + */ + subscribed?: boolean; +} +interface UsePrefetchQueryOptions extends OmitKeyof, 'queryFn'> { + queryFn?: Exclude['queryFn'], SkipToken>; +} +type AnyUseQueryOptions = UseQueryOptions; +interface UseQueryOptions extends OmitKeyof, 'suspense'> { +} +type AnyUseSuspenseQueryOptions = UseSuspenseQueryOptions; +interface UseSuspenseQueryOptions extends OmitKeyof, 'queryFn' | 'enabled' | 'throwOnError' | 'placeholderData'> { + queryFn?: Exclude['queryFn'], SkipToken>; +} +type AnyUseInfiniteQueryOptions = UseInfiniteQueryOptions; +interface UseInfiniteQueryOptions extends OmitKeyof, 'suspense'> { + /** + * Set this to `false` to unsubscribe this observer from updates to the query cache. + * Defaults to `true`. + */ + subscribed?: boolean; +} +type AnyUseSuspenseInfiniteQueryOptions = UseSuspenseInfiniteQueryOptions; +interface UseSuspenseInfiniteQueryOptions extends OmitKeyof, 'queryFn' | 'enabled' | 'throwOnError' | 'placeholderData'> { + queryFn?: Exclude['queryFn'], SkipToken>; +} +type UseBaseQueryResult = QueryObserverResult; +type UseQueryResult = UseBaseQueryResult; +type UseSuspenseQueryResult = DistributiveOmit, 'isPlaceholderData' | 'promise'>; +type DefinedUseQueryResult = DefinedQueryObserverResult; +type UseInfiniteQueryResult = InfiniteQueryObserverResult; +type DefinedUseInfiniteQueryResult = DefinedInfiniteQueryObserverResult; +type UseSuspenseInfiniteQueryResult = OmitKeyof, 'isPlaceholderData' | 'promise'>; +type AnyUseMutationOptions = UseMutationOptions; +interface UseMutationOptions extends OmitKeyof, '_defaulted'> { +} +type UseMutateFunction = (...args: Parameters>) => void; +type UseMutateAsyncFunction = MutateFunction; +type UseBaseMutationResult = Override, { + mutate: UseMutateFunction; +}> & { + mutateAsync: UseMutateAsyncFunction; +}; +type UseMutationResult = UseBaseMutationResult; + +export type { AnyUseBaseQueryOptions, AnyUseInfiniteQueryOptions, AnyUseMutationOptions, AnyUseQueryOptions, AnyUseSuspenseInfiniteQueryOptions, AnyUseSuspenseQueryOptions, DefinedUseInfiniteQueryResult, DefinedUseQueryResult, UseBaseMutationResult, UseBaseQueryOptions, UseBaseQueryResult, UseInfiniteQueryOptions, UseInfiniteQueryResult, UseMutateAsyncFunction, UseMutateFunction, UseMutationOptions, UseMutationResult, UsePrefetchQueryOptions, UseQueryOptions, UseQueryResult, UseSuspenseInfiniteQueryOptions, UseSuspenseInfiniteQueryResult, UseSuspenseQueryOptions, UseSuspenseQueryResult }; diff --git a/node_modules/@tanstack/react-query/build/modern/types.d.ts b/node_modules/@tanstack/react-query/build/modern/types.d.ts new file mode 100644 index 0000000..e9d55b2 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/modern/types.d.ts @@ -0,0 +1,52 @@ +import { DefaultError, QueryKey, QueryObserverOptions, OmitKeyof, InfiniteQueryObserverOptions, MutationObserverOptions, SkipToken, DefinedInfiniteQueryObserverResult, DefinedQueryObserverResult, QueryObserverResult, DistributiveOmit, Override, MutationObserverResult, MutateFunction, InfiniteQueryObserverResult, FetchQueryOptions } from '@tanstack/query-core'; + +type AnyUseBaseQueryOptions = UseBaseQueryOptions; +interface UseBaseQueryOptions extends QueryObserverOptions { + /** + * Set this to `false` to unsubscribe this observer from updates to the query cache. + * Defaults to `true`. + */ + subscribed?: boolean; +} +interface UsePrefetchQueryOptions extends OmitKeyof, 'queryFn'> { + queryFn?: Exclude['queryFn'], SkipToken>; +} +type AnyUseQueryOptions = UseQueryOptions; +interface UseQueryOptions extends OmitKeyof, 'suspense'> { +} +type AnyUseSuspenseQueryOptions = UseSuspenseQueryOptions; +interface UseSuspenseQueryOptions extends OmitKeyof, 'queryFn' | 'enabled' | 'throwOnError' | 'placeholderData'> { + queryFn?: Exclude['queryFn'], SkipToken>; +} +type AnyUseInfiniteQueryOptions = UseInfiniteQueryOptions; +interface UseInfiniteQueryOptions extends OmitKeyof, 'suspense'> { + /** + * Set this to `false` to unsubscribe this observer from updates to the query cache. + * Defaults to `true`. + */ + subscribed?: boolean; +} +type AnyUseSuspenseInfiniteQueryOptions = UseSuspenseInfiniteQueryOptions; +interface UseSuspenseInfiniteQueryOptions extends OmitKeyof, 'queryFn' | 'enabled' | 'throwOnError' | 'placeholderData'> { + queryFn?: Exclude['queryFn'], SkipToken>; +} +type UseBaseQueryResult = QueryObserverResult; +type UseQueryResult = UseBaseQueryResult; +type UseSuspenseQueryResult = DistributiveOmit, 'isPlaceholderData' | 'promise'>; +type DefinedUseQueryResult = DefinedQueryObserverResult; +type UseInfiniteQueryResult = InfiniteQueryObserverResult; +type DefinedUseInfiniteQueryResult = DefinedInfiniteQueryObserverResult; +type UseSuspenseInfiniteQueryResult = OmitKeyof, 'isPlaceholderData' | 'promise'>; +type AnyUseMutationOptions = UseMutationOptions; +interface UseMutationOptions extends OmitKeyof, '_defaulted'> { +} +type UseMutateFunction = (...args: Parameters>) => void; +type UseMutateAsyncFunction = MutateFunction; +type UseBaseMutationResult = Override, { + mutate: UseMutateFunction; +}> & { + mutateAsync: UseMutateAsyncFunction; +}; +type UseMutationResult = UseBaseMutationResult; + +export type { AnyUseBaseQueryOptions, AnyUseInfiniteQueryOptions, AnyUseMutationOptions, AnyUseQueryOptions, AnyUseSuspenseInfiniteQueryOptions, AnyUseSuspenseQueryOptions, DefinedUseInfiniteQueryResult, DefinedUseQueryResult, UseBaseMutationResult, UseBaseQueryOptions, UseBaseQueryResult, UseInfiniteQueryOptions, UseInfiniteQueryResult, UseMutateAsyncFunction, UseMutateFunction, UseMutationOptions, UseMutationResult, UsePrefetchQueryOptions, UseQueryOptions, UseQueryResult, UseSuspenseInfiniteQueryOptions, UseSuspenseInfiniteQueryResult, UseSuspenseQueryOptions, UseSuspenseQueryResult }; diff --git a/node_modules/@tanstack/react-query/build/modern/types.js b/node_modules/@tanstack/react-query/build/modern/types.js new file mode 100644 index 0000000..5b2306a --- /dev/null +++ b/node_modules/@tanstack/react-query/build/modern/types.js @@ -0,0 +1 @@ +//# sourceMappingURL=types.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/types.js.map b/node_modules/@tanstack/react-query/build/modern/types.js.map new file mode 100644 index 0000000..84c51b2 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/modern/types.js.map @@ -0,0 +1 @@ +{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/useBaseQuery.cjs b/node_modules/@tanstack/react-query/build/modern/useBaseQuery.cjs new file mode 100644 index 0000000..6fc8ff5 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/modern/useBaseQuery.cjs @@ -0,0 +1,130 @@ +"use strict"; +"use client"; +var __create = Object.create; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __getProtoOf = Object.getPrototypeOf; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( + // If the importer is in node compatibility mode or this is not an ESM + // file that has been converted to a CommonJS file using a Babel- + // compatible transform (i.e. "__esModule" has not been set), then set + // "default" to the CommonJS "module.exports" for node compatibility. + isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, + mod +)); +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/useBaseQuery.ts +var useBaseQuery_exports = {}; +__export(useBaseQuery_exports, { + useBaseQuery: () => useBaseQuery +}); +module.exports = __toCommonJS(useBaseQuery_exports); +var React = __toESM(require("react"), 1); +var import_query_core = require("@tanstack/query-core"); +var import_QueryClientProvider = require("./QueryClientProvider.cjs"); +var import_QueryErrorResetBoundary = require("./QueryErrorResetBoundary.cjs"); +var import_errorBoundaryUtils = require("./errorBoundaryUtils.cjs"); +var import_IsRestoringProvider = require("./IsRestoringProvider.cjs"); +var import_suspense = require("./suspense.cjs"); +function useBaseQuery(options, Observer, queryClient) { + if (process.env.NODE_ENV !== "production") { + if (typeof options !== "object" || Array.isArray(options)) { + throw new Error( + 'Bad argument type. Starting with v5, only the "Object" form is allowed when calling query related functions. Please use the error stack to find the culprit call. More info here: https://tanstack.com/query/latest/docs/react/guides/migrating-to-v5#supports-a-single-signature-one-object' + ); + } + } + const isRestoring = (0, import_IsRestoringProvider.useIsRestoring)(); + const errorResetBoundary = (0, import_QueryErrorResetBoundary.useQueryErrorResetBoundary)(); + const client = (0, import_QueryClientProvider.useQueryClient)(queryClient); + const defaultedOptions = client.defaultQueryOptions(options); + client.getDefaultOptions().queries?._experimental_beforeQuery?.( + defaultedOptions + ); + const query = client.getQueryCache().get(defaultedOptions.queryHash); + if (process.env.NODE_ENV !== "production") { + if (!defaultedOptions.queryFn) { + console.error( + `[${defaultedOptions.queryHash}]: No queryFn was passed as an option, and no default queryFn was found. The queryFn parameter is only optional when using a default queryFn. More info here: https://tanstack.com/query/latest/docs/framework/react/guides/default-query-function` + ); + } + } + defaultedOptions._optimisticResults = isRestoring ? "isRestoring" : "optimistic"; + (0, import_suspense.ensureSuspenseTimers)(defaultedOptions); + (0, import_errorBoundaryUtils.ensurePreventErrorBoundaryRetry)(defaultedOptions, errorResetBoundary, query); + (0, import_errorBoundaryUtils.useClearResetErrorBoundary)(errorResetBoundary); + const isNewCacheEntry = !client.getQueryCache().get(defaultedOptions.queryHash); + const [observer] = React.useState( + () => new Observer( + client, + defaultedOptions + ) + ); + const result = observer.getOptimisticResult(defaultedOptions); + const shouldSubscribe = !isRestoring && options.subscribed !== false; + React.useSyncExternalStore( + React.useCallback( + (onStoreChange) => { + const unsubscribe = shouldSubscribe ? observer.subscribe(import_query_core.notifyManager.batchCalls(onStoreChange)) : import_query_core.noop; + observer.updateResult(); + return unsubscribe; + }, + [observer, shouldSubscribe] + ), + () => observer.getCurrentResult(), + () => observer.getCurrentResult() + ); + React.useEffect(() => { + observer.setOptions(defaultedOptions); + }, [defaultedOptions, observer]); + if ((0, import_suspense.shouldSuspend)(defaultedOptions, result)) { + throw (0, import_suspense.fetchOptimistic)(defaultedOptions, observer, errorResetBoundary); + } + if ((0, import_errorBoundaryUtils.getHasError)({ + result, + errorResetBoundary, + throwOnError: defaultedOptions.throwOnError, + query, + suspense: defaultedOptions.suspense + })) { + throw result.error; + } + ; + client.getDefaultOptions().queries?._experimental_afterQuery?.( + defaultedOptions, + result + ); + if (defaultedOptions.experimental_prefetchInRender && !import_query_core.isServer && (0, import_suspense.willFetch)(result, isRestoring)) { + const promise = isNewCacheEntry ? ( + // Fetch immediately on render in order to ensure `.promise` is resolved even if the component is unmounted + (0, import_suspense.fetchOptimistic)(defaultedOptions, observer, errorResetBoundary) + ) : ( + // subscribe to the "cache promise" so that we can finalize the currentThenable once data comes in + query?.promise + ); + promise?.catch(import_query_core.noop).finally(() => { + observer.updateResult(); + }); + } + return !defaultedOptions.notifyOnChangeProps ? observer.trackResult(result) : result; +} +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + useBaseQuery +}); +//# sourceMappingURL=useBaseQuery.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/useBaseQuery.cjs.map b/node_modules/@tanstack/react-query/build/modern/useBaseQuery.cjs.map new file mode 100644 index 0000000..c530f95 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/modern/useBaseQuery.cjs.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/useBaseQuery.ts"],"sourcesContent":["'use client'\nimport * as React from 'react'\n\nimport { isServer, noop, notifyManager } from '@tanstack/query-core'\nimport { useQueryClient } from './QueryClientProvider'\nimport { useQueryErrorResetBoundary } from './QueryErrorResetBoundary'\nimport {\n ensurePreventErrorBoundaryRetry,\n getHasError,\n useClearResetErrorBoundary,\n} from './errorBoundaryUtils'\nimport { useIsRestoring } from './IsRestoringProvider'\nimport {\n ensureSuspenseTimers,\n fetchOptimistic,\n shouldSuspend,\n willFetch,\n} from './suspense'\nimport type {\n QueryClient,\n QueryKey,\n QueryObserver,\n QueryObserverResult,\n} from '@tanstack/query-core'\nimport type { UseBaseQueryOptions } from './types'\n\nexport function useBaseQuery<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey extends QueryKey,\n>(\n options: UseBaseQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >,\n Observer: typeof QueryObserver,\n queryClient?: QueryClient,\n): QueryObserverResult {\n if (process.env.NODE_ENV !== 'production') {\n if (typeof options !== 'object' || Array.isArray(options)) {\n throw new Error(\n 'Bad argument type. Starting with v5, only the \"Object\" form is allowed when calling query related functions. Please use the error stack to find the culprit call. More info here: https://tanstack.com/query/latest/docs/react/guides/migrating-to-v5#supports-a-single-signature-one-object',\n )\n }\n }\n\n const isRestoring = useIsRestoring()\n const errorResetBoundary = useQueryErrorResetBoundary()\n const client = useQueryClient(queryClient)\n const defaultedOptions = client.defaultQueryOptions(options)\n ;(client.getDefaultOptions().queries as any)?._experimental_beforeQuery?.(\n defaultedOptions,\n )\n\n const query = client\n .getQueryCache()\n .get<\n TQueryFnData,\n TError,\n TQueryData,\n TQueryKey\n >(defaultedOptions.queryHash)\n\n if (process.env.NODE_ENV !== 'production') {\n if (!defaultedOptions.queryFn) {\n console.error(\n `[${defaultedOptions.queryHash}]: No queryFn was passed as an option, and no default queryFn was found. The queryFn parameter is only optional when using a default queryFn. More info here: https://tanstack.com/query/latest/docs/framework/react/guides/default-query-function`,\n )\n }\n }\n\n // Make sure results are optimistically set in fetching state before subscribing or updating options\n defaultedOptions._optimisticResults = isRestoring\n ? 'isRestoring'\n : 'optimistic'\n\n ensureSuspenseTimers(defaultedOptions)\n ensurePreventErrorBoundaryRetry(defaultedOptions, errorResetBoundary, query)\n useClearResetErrorBoundary(errorResetBoundary)\n\n // this needs to be invoked before creating the Observer because that can create a cache entry\n const isNewCacheEntry = !client\n .getQueryCache()\n .get(defaultedOptions.queryHash)\n\n const [observer] = React.useState(\n () =>\n new Observer(\n client,\n defaultedOptions,\n ),\n )\n\n // note: this must be called before useSyncExternalStore\n const result = observer.getOptimisticResult(defaultedOptions)\n\n const shouldSubscribe = !isRestoring && options.subscribed !== false\n React.useSyncExternalStore(\n React.useCallback(\n (onStoreChange) => {\n const unsubscribe = shouldSubscribe\n ? observer.subscribe(notifyManager.batchCalls(onStoreChange))\n : noop\n\n // Update result to make sure we did not miss any query updates\n // between creating the observer and subscribing to it.\n observer.updateResult()\n\n return unsubscribe\n },\n [observer, shouldSubscribe],\n ),\n () => observer.getCurrentResult(),\n () => observer.getCurrentResult(),\n )\n\n React.useEffect(() => {\n observer.setOptions(defaultedOptions)\n }, [defaultedOptions, observer])\n\n // Handle suspense\n if (shouldSuspend(defaultedOptions, result)) {\n throw fetchOptimistic(defaultedOptions, observer, errorResetBoundary)\n }\n\n // Handle error boundary\n if (\n getHasError({\n result,\n errorResetBoundary,\n throwOnError: defaultedOptions.throwOnError,\n query,\n suspense: defaultedOptions.suspense,\n })\n ) {\n throw result.error\n }\n\n ;(client.getDefaultOptions().queries as any)?._experimental_afterQuery?.(\n defaultedOptions,\n result,\n )\n\n if (\n defaultedOptions.experimental_prefetchInRender &&\n !isServer &&\n willFetch(result, isRestoring)\n ) {\n const promise = isNewCacheEntry\n ? // Fetch immediately on render in order to ensure `.promise` is resolved even if the component is unmounted\n fetchOptimistic(defaultedOptions, observer, errorResetBoundary)\n : // subscribe to the \"cache promise\" so that we can finalize the currentThenable once data comes in\n query?.promise\n\n promise?.catch(noop).finally(() => {\n // `.updateResult()` will trigger `.#currentThenable` to finalize\n observer.updateResult()\n })\n }\n\n // Handle result property usage tracking\n return !defaultedOpt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B,cAAM,cAAc,kBAChB,SAAS,UAAU,gCAAc,WAAW,aAAa,CAAC,IAC1D;AAIJ,iBAAS,aAAa;AAEtB,eAAO;AAAA,MACT;AAAA,MACA,CAAC,UAAU,eAAe;AAAA,IAC5B;AAAA,IACA,MAAM,SAAS,iBAAiB;AAAA,IAChC,MAAM,SAAS,iBAAiB;AAAA,EAClC;AAEA,EAAM,gBAAU,MAAM;AACpB,aAAS,WAAW,gBAAgB;AAAA,EACtC,GAAG,CAAC,kBAAkB,QAAQ,CAAC;AAG/B,UAAI,+BAAc,kBAAkB,MAAM,GAAG;AAC3C,cAAM,iCAAgB,kBAAkB,UAAU,kBAAkB;AAAA,EACtE;AAGA,UACE,uCAAY;AAAA,IACV;AAAA,IACA;AAAA,IACA,cAAc,iBAAiB;AAAA,IAC/B;AAAA,IACA,UAAU,iBAAiB;AAAA,EAC7B,CAAC,GACD;AACA,UAAM,OAAO;AAAA,EACf;AAEA;AAAC,EAAC,OAAO,kBAAkB,EAAE,SAAiB;AAAA,IAC5C;AAAA,IACA;AAAA,EACF;AAEA,MACE,iBAAiB,iCACjB,CAAC,kCACD,2BAAU,QAAQ,WAAW,GAC7B;AACA,UAAM,UAAU;AAAA;AAAA,UAEZ,iCAAgB,kBAAkB,UAAU,kBAAkB;AAAA;AAAA;AAAA,MAE9D,OAAO;AAAA;AAEX,aAAS,MAAM,sBAAI,EAAE,QAAQ,MAAM;AAEjC,eAAS,aAAa;AAAA,IACxB,CAAC;AAAA,EACH;AAGA,SAAO,CAAC,iBAAiB,sBACrB,SAAS,YAAY,MAAM,IAC3B;AACN;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/useBaseQuery.d.cts b/node_modules/@tanstack/react-query/build/modern/useBaseQuery.d.cts new file mode 100644 index 0000000..baa8469 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/modern/useBaseQuery.d.cts @@ -0,0 +1,6 @@ +import { QueryKey, QueryObserver, QueryClient, QueryObserverResult } from '@tanstack/query-core'; +import { UseBaseQueryOptions } from './types.cjs'; + +declare function useBaseQuery(options: UseBaseQueryOptions, Observer: typeof QueryObserver, queryClient?: QueryClient): QueryObserverResult; + +export { useBaseQuery }; diff --git a/node_modules/@tanstack/react-query/build/modern/useBaseQuery.d.ts b/node_modules/@tanstack/react-query/build/modern/useBaseQuery.d.ts new file mode 100644 index 0000000..60430b0 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/modern/useBaseQuery.d.ts @@ -0,0 +1,6 @@ +import { QueryKey, QueryObserver, QueryClient, QueryObserverResult } from '@tanstack/query-core'; +import { UseBaseQueryOptions } from './types.js'; + +declare function useBaseQuery(options: UseBaseQueryOptions, Observer: typeof QueryObserver, queryClient?: QueryClient): QueryObserverResult; + +export { useBaseQuery }; diff --git a/node_modules/@tanstack/react-query/build/modern/useBaseQuery.js b/node_modules/@tanstack/react-query/build/modern/useBaseQuery.js new file mode 100644 index 0000000..d1c375a --- /dev/null +++ b/node_modules/@tanstack/react-query/build/modern/useBaseQuery.js @@ -0,0 +1,105 @@ +"use client"; + +// src/useBaseQuery.ts +import * as React from "react"; +import { isServer, noop, notifyManager } from "@tanstack/query-core"; +import { useQueryClient } from "./QueryClientProvider.js"; +import { useQueryErrorResetBoundary } from "./QueryErrorResetBoundary.js"; +import { + ensurePreventErrorBoundaryRetry, + getHasError, + useClearResetErrorBoundary +} from "./errorBoundaryUtils.js"; +import { useIsRestoring } from "./IsRestoringProvider.js"; +import { + ensureSuspenseTimers, + fetchOptimistic, + shouldSuspend, + willFetch +} from "./suspense.js"; +function useBaseQuery(options, Observer, queryClient) { + if (process.env.NODE_ENV !== "production") { + if (typeof options !== "object" || Array.isArray(options)) { + throw new Error( + 'Bad argument type. Starting with v5, only the "Object" form is allowed when calling query related functions. Please use the error stack to find the culprit call. More info here: https://tanstack.com/query/latest/docs/react/guides/migrating-to-v5#supports-a-single-signature-one-object' + ); + } + } + const isRestoring = useIsRestoring(); + const errorResetBoundary = useQueryErrorResetBoundary(); + const client = useQueryClient(queryClient); + const defaultedOptions = client.defaultQueryOptions(options); + client.getDefaultOptions().queries?._experimental_beforeQuery?.( + defaultedOptions + ); + const query = client.getQueryCache().get(defaultedOptions.queryHash); + if (process.env.NODE_ENV !== "production") { + if (!defaultedOptions.queryFn) { + console.error( + `[${defaultedOptions.queryHash}]: No queryFn was passed as an option, and no default queryFn was found. The queryFn parameter is only optional when using a default queryFn. More info here: https://tanstack.com/query/latest/docs/framework/react/guides/default-query-function` + ); + } + } + defaultedOptions._optimisticResults = isRestoring ? "isRestoring" : "optimistic"; + ensureSuspenseTimers(defaultedOptions); + ensurePreventErrorBoundaryRetry(defaultedOptions, errorResetBoundary, query); + useClearResetErrorBoundary(errorResetBoundary); + const isNewCacheEntry = !client.getQueryCache().get(defaultedOptions.queryHash); + const [observer] = React.useState( + () => new Observer( + client, + defaultedOptions + ) + ); + const result = observer.getOptimisticResult(defaultedOptions); + const shouldSubscribe = !isRestoring && options.subscribed !== false; + React.useSyncExternalStore( + React.useCallback( + (onStoreChange) => { + const unsubscribe = shouldSubscribe ? observer.subscribe(notifyManager.batchCalls(onStoreChange)) : noop; + observer.updateResult(); + return unsubscribe; + }, + [observer, shouldSubscribe] + ), + () => observer.getCurrentResult(), + () => observer.getCurrentResult() + ); + React.useEffect(() => { + observer.setOptions(defaultedOptions); + }, [defaultedOptions, observer]); + if (shouldSuspend(defaultedOptions, result)) { + throw fetchOptimistic(defaultedOptions, observer, errorResetBoundary); + } + if (getHasError({ + result, + errorResetBoundary, + throwOnError: defaultedOptions.throwOnError, + query, + suspense: defaultedOptions.suspense + })) { + throw result.error; + } + ; + client.getDefaultOptions().queries?._experimental_afterQuery?.( + defaultedOptions, + result + ); + if (defaultedOptions.experimental_prefetchInRender && !isServer && willFetch(result, isRestoring)) { + const promise = isNewCacheEntry ? ( + // Fetch immediately on render in order to ensure `.promise` is resolved even if the component is unmounted + fetchOptimistic(defaultedOptions, observer, errorResetBoundary) + ) : ( + // subscribe to the "cache promise" so that we can finalize the currentThenable once data comes in + query?.promise + ); + promise?.catch(noop).finally(() => { + observer.updateResult(); + }); + } + return !defaultedOptions.notifyOnChangeProps ? observer.trackResult(result) : result; +} +export { + useBaseQuery +}; +//# sourceMappingURL=useBaseQuery.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/useBaseQuery.js.map b/node_modules/@tanstack/react-query/build/modern/useBaseQuery.js.map new file mode 100644 index 0000000..43e2543 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/modern/useBaseQuery.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/useBaseQuery.ts"],"sourcesContent":["'use client'\nimport * as React from 'react'\n\nimport { isServer, noop, notifyManager } from '@tanstack/query-core'\nimport { useQueryClient } from './QueryClientProvider'\nimport { useQueryErrorResetBoundary } from './QueryErrorResetBoundary'\nimport {\n ensurePreventErrorBoundaryRetry,\n getHasError,\n useClearResetErrorBoundary,\n} from './errorBoundaryUtils'\nimport { useIsRestoring } from './IsRestoringProvider'\nimport {\n ensureSuspenseTimers,\n fetchOptimistic,\n shouldSuspend,\n willFetch,\n} from './suspense'\nimport type {\n QueryClient,\n QueryKey,\n QueryObserver,\n QueryObserverResult,\n} from '@tanstack/query-core'\nimport type { UseBaseQueryOptions } from './types'\n\nexport function useBaseQuery<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey extends QueryKey,\n>(\n options: UseBaseQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >,\n Observer: typeof QueryObserver,\n queryClient?: QueryClient,\n): QueryObserverResult {\n if (process.env.NODE_ENV !== 'production') {\n if (typeof options !== 'object' || Array.isArray(options)) {\n throw new Error(\n 'Bad argument type. Starting with v5, only the \"Object\" form is allowed when calling query related functions. Please use the error stack to find the culprit call. More info here: https://tanstack.com/query/latest/docs/react/guides/migrating-to-v5#supports-a-single-signature-one-object',\n )\n }\n }\n\n const isRestoring = useIsRestoring()\n const errorResetBoundary = useQueryErrorResetBoundary()\n const client = useQueryClient(queryClient)\n const defaultedOptions = client.defaultQueryOptions(options)\n ;(client.getDefaultOptions().queries as any)?._experimental_beforeQuery?.(\n defaultedOptions,\n )\n\n const query = client\n .getQueryCache()\n .get<\n TQueryFnData,\n TError,\n TQueryData,\n TQueryKey\n >(defaultedOptions.queryHash)\n\n if (process.env.NODE_ENV !== 'production') {\n if (!defaultedOptions.queryFn) {\n console.error(\n `[${defaultedOptions.queryHash}]: No queryFn was passed as an option, and no default queryFn was found. The queryFn parameter is only optional when using a default queryFn. More info here: https://tanstack.com/query/latest/docs/framework/react/guides/default-query-function`,\n )\n }\n }\n\n // Make sure results are optimistically set in fetching state before subscribing or updating options\n defaultedOptions._optimisticResults = isRestoring\n ? 'isRestoring'\n : 'optimistic'\n\n ensureSuspenseTimers(defaultedOptions)\n ensurePreventErrorBoundaryRetry(defaultedOptions, errorResetBoundary, query)\n useClearResetErrorBoundary(errorResetBoundary)\n\n // this needs to be invoked before creating the Observer because that can create a cache entry\n const isNewCacheEntry = !client\n .getQueryCache()\n .get(defaultedOptions.queryHash)\n\n const [observer] = React.useState(\n () =>\n new Observer(\n client,\n defaultedOptions,\n ),\n )\n\n // note: this must be called before useSyncExternalStore\n const result = observer.getOptimisticResult(defaultedOptions)\n\n const shouldSubscribe = !isRestoring && options.subscribed !== false\n React.useSyncExternalStore(\n React.useCallback(\n (onStoreChange) => {\n const unsubscribe = shouldSubscribe\n ? observer.subscribe(notifyManager.batchCalls(onStoreChange))\n : noop\n\n // Update result to make sure we did not miss any query updates\n // between creating the observer and subscribing to it.\n observer.updateResult()\n\n return unsubscribe\n },\n [observer, shouldSubscribe],\n ),\n () => observer.getCurrentResult(),\n () => observer.getCurrentResult(),\n )\n\n React.useEffect(() => {\n observer.setOptions(defaultedOptions)\n }, [defaultedOptions, observer])\n\n // Handle suspense\n if (shouldSuspend(defaultedOptions, result)) {\n throw fetchOptimistic(defaultedOptions, observer, errorResetBoundary)\n }\n\n // Handle error boundary\n if (\n getHasError({\n result,\n errorResetBoundary,\n throwOnError: defaultedOptions.throwOnError,\n query,\n suspense: defaultedOptions.suspense,\n })\n ) {\n throw result.error\n }\n\n ;(client.getDefaultOptions().queries as any)?._experimental_afterQuery?.(\n defaultedOptions,\n result,\n )\n\n if (\n defaultedOptions.experimental_prefetchInRender &&\n !isServer &&\n willFetch(result, isRestoring)\n ) {\n const promise = isNewCacheEntry\n ? // Fetch immediately on render in order to ensure `.promise` is resolved even if the component is unmounted\n fetchOptimistic(defaultedOptions, observer, errorResetBoundary)\n : // subscribe to the \"cache promise\" so that we can finalize the currentThenable once data comes in\n query?.promise\n\n promise?.catch(noop).finally(() => {\n // `.updateResult()` will trigger `.#currentThenable` to finalize\n observer.updateResult()\n })\n }\n\n // Handle result property usage tracking\n return !defaultedOptions.notifyOnChangeProps\n ? observer.trackResult(result)\n : result\n}\n"],"mappings":";;;AACA,YAAY,WAAW;AAEvB,SAAS,UAAU,MAAM,qBAAqB;AAC9C,SAAS,sBAAsB;AAC/B,SAAS,kCAAkC;AAC3C;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,sBAAsB;AAC/B;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AASA,SAAS,aAOd,SAOA,UACA,aACoC;AACpC,MAAI,QAAQ,IAAI,aAAa,cAAc;AACzC,QAAI,OAAO,YAAY,YAAY,MAAM,QAAQ,OAAO,GAAG;AACzD,YAAM,IAAI;AAAA,QACR;AAAA,MACF;AAAA,IACF;AAAA,EACF;AAEA,QAAM,cAAc,eAAe;AACnC,QAAM,qBAAqB,2BAA2B;AACtD,QAAM,SAAS,eAAe,WAAW;AACzC,QAAM,mBAAmB,OAAO,oBAAoB,OAAO;AAC1D,EAAC,OAAO,kBAAkB,EAAE,SAAiB;AAAA,IAC5C;AAAA,EACF;AAEA,QAAM,QAAQ,OACX,cAAc,EACd,IAKC,iBAAiB,SAAS;AAE9B,MAAI,QAAQ,IAAI,aAAa,cAA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D,UAAU,QAAQ,WAAW,GAC7B;AACA,UAAM,UAAU;AAAA;AAAA,MAEZ,gBAAgB,kBAAkB,UAAU,kBAAkB;AAAA;AAAA;AAAA,MAE9D,OAAO;AAAA;AAEX,aAAS,MAAM,IAAI,EAAE,QAAQ,MAAM;AAEjC,eAAS,aAAa;AAAA,IACxB,CAAC;AAAA,EACH;AAGA,SAAO,CAAC,iBAAiB,sBACrB,SAAS,YAAY,MAAM,IAC3B;AACN;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/useInfiniteQuery.cjs b/node_modules/@tanstack/react-query/build/modern/useInfiniteQuery.cjs new file mode 100644 index 0000000..e1ae216 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/modern/useInfiniteQuery.cjs @@ -0,0 +1,40 @@ +"use strict"; +"use client"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/useInfiniteQuery.ts +var useInfiniteQuery_exports = {}; +__export(useInfiniteQuery_exports, { + useInfiniteQuery: () => useInfiniteQuery +}); +module.exports = __toCommonJS(useInfiniteQuery_exports); +var import_query_core = require("@tanstack/query-core"); +var import_useBaseQuery = require("./useBaseQuery.cjs"); +function useInfiniteQuery(options, queryClient) { + return (0, import_useBaseQuery.useBaseQuery)( + options, + import_query_core.InfiniteQueryObserver, + queryClient + ); +} +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + useInfiniteQuery +}); +//# sourceMappingURL=useInfiniteQuery.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/useInfiniteQuery.cjs.map b/node_modules/@tanstack/react-query/build/modern/useInfiniteQuery.cjs.map new file mode 100644 index 0000000..66c4cc1 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/modern/useInfiniteQuery.cjs.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/useInfiniteQuery.ts"],"sourcesContent":["'use client'\nimport { InfiniteQueryObserver } from '@tanstack/query-core'\nimport { useBaseQuery } from './useBaseQuery'\nimport type {\n DefaultError,\n InfiniteData,\n QueryClient,\n QueryKey,\n QueryObserver,\n} from '@tanstack/query-core'\nimport type {\n DefinedUseInfiniteQueryResult,\n UseInfiniteQueryOptions,\n UseInfiniteQueryResult,\n} from './types'\nimport type {\n DefinedInitialDataInfiniteOptions,\n UndefinedInitialDataInfiniteOptions,\n} from './infiniteQueryOptions'\n\nexport function useInfiniteQuery<\n TQueryFnData,\n TError = DefaultError,\n TData = InfiniteData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n>(\n options: DefinedInitialDataInfiniteOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n queryClient?: QueryClient,\n): DefinedUseInfiniteQueryResult\n\nexport function useInfiniteQuery<\n TQueryFnData,\n TError = DefaultError,\n TData = InfiniteData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n>(\n options: UndefinedInitialDataInfiniteOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n queryClient?: QueryClient,\n): UseInfiniteQueryResult\n\nexport function useInfiniteQuery<\n TQueryFnData,\n TError = DefaultError,\n TData = InfiniteData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n>(\n options: UseInfiniteQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n queryClient?: QueryClient,\n): UseInfiniteQueryResult\n\nexport function useInfiniteQuery(\n options: UseInfiniteQueryOptions,\n queryClient?: QueryClient,\n) {\n return useBaseQuery(\n options,\n InfiniteQueryObserver as typeof QueryObserver,\n queryClient,\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,wBAAsC;AACtC,0BAA6B;AAqEtB,SAAS,iBACd,SACA,aACA;AACA,aAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/useInfiniteQuery.d.cts b/node_modules/@tanstack/react-query/build/modern/useInfiniteQuery.d.cts new file mode 100644 index 0000000..8401170 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/modern/useInfiniteQuery.d.cts @@ -0,0 +1,9 @@ +import { DefaultError, InfiniteData, QueryKey, QueryClient } from '@tanstack/query-core'; +import { DefinedUseInfiniteQueryResult, UseInfiniteQueryResult, UseInfiniteQueryOptions } from './types.cjs'; +import { DefinedInitialDataInfiniteOptions, UndefinedInitialDataInfiniteOptions } from './infiniteQueryOptions.cjs'; + +declare function useInfiniteQuery, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown>(options: DefinedInitialDataInfiniteOptions, queryClient?: QueryClient): DefinedUseInfiniteQueryResult; +declare function useInfiniteQuery, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown>(options: UndefinedInitialDataInfiniteOptions, queryClient?: QueryClient): UseInfiniteQueryResult; +declare function useInfiniteQuery, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown>(options: UseInfiniteQueryOptions, queryClient?: QueryClient): UseInfiniteQueryResult; + +export { useInfiniteQuery }; diff --git a/node_modules/@tanstack/react-query/build/modern/useInfiniteQuery.d.ts b/node_modules/@tanstack/react-query/build/modern/useInfiniteQuery.d.ts new file mode 100644 index 0000000..47bb383 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/modern/useInfiniteQuery.d.ts @@ -0,0 +1,9 @@ +import { DefaultError, InfiniteData, QueryKey, QueryClient } from '@tanstack/query-core'; +import { DefinedUseInfiniteQueryResult, UseInfiniteQueryResult, UseInfiniteQueryOptions } from './types.js'; +import { DefinedInitialDataInfiniteOptions, UndefinedInitialDataInfiniteOptions } from './infiniteQueryOptions.js'; + +declare function useInfiniteQuery, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown>(options: DefinedInitialDataInfiniteOptions, queryClient?: QueryClient): DefinedUseInfiniteQueryResult; +declare function useInfiniteQuery, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown>(options: UndefinedInitialDataInfiniteOptions, queryClient?: QueryClient): UseInfiniteQueryResult; +declare function useInfiniteQuery, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown>(options: UseInfiniteQueryOptions, queryClient?: QueryClient): UseInfiniteQueryResult; + +export { useInfiniteQuery }; diff --git a/node_modules/@tanstack/react-query/build/modern/useInfiniteQuery.js b/node_modules/@tanstack/react-query/build/modern/useInfiniteQuery.js new file mode 100644 index 0000000..2e32e08 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/modern/useInfiniteQuery.js @@ -0,0 +1,16 @@ +"use client"; + +// src/useInfiniteQuery.ts +import { InfiniteQueryObserver } from "@tanstack/query-core"; +import { useBaseQuery } from "./useBaseQuery.js"; +function useInfiniteQuery(options, queryClient) { + return useBaseQuery( + options, + InfiniteQueryObserver, + queryClient + ); +} +export { + useInfiniteQuery +}; +//# sourceMappingURL=useInfiniteQuery.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/useInfiniteQuery.js.map b/node_modules/@tanstack/react-query/build/modern/useInfiniteQuery.js.map new file mode 100644 index 0000000..4b2fbe4 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/modern/useInfiniteQuery.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/useInfiniteQuery.ts"],"sourcesContent":["'use client'\nimport { InfiniteQueryObserver } from '@tanstack/query-core'\nimport { useBaseQuery } from './useBaseQuery'\nimport type {\n DefaultError,\n InfiniteData,\n QueryClient,\n QueryKey,\n QueryObserver,\n} from '@tanstack/query-core'\nimport type {\n DefinedUseInfiniteQueryResult,\n UseInfiniteQueryOptions,\n UseInfiniteQueryResult,\n} from './types'\nimport type {\n DefinedInitialDataInfiniteOptions,\n UndefinedInitialDataInfiniteOptions,\n} from './infiniteQueryOptions'\n\nexport function useInfiniteQuery<\n TQueryFnData,\n TError = DefaultError,\n TData = InfiniteData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n>(\n options: DefinedInitialDataInfiniteOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n queryClient?: QueryClient,\n): DefinedUseInfiniteQueryResult\n\nexport function useInfiniteQuery<\n TQueryFnData,\n TError = DefaultError,\n TData = InfiniteData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n>(\n options: UndefinedInitialDataInfiniteOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n queryClient?: QueryClient,\n): UseInfiniteQueryResult\n\nexport function useInfiniteQuery<\n TQueryFnData,\n TError = DefaultError,\n TData = InfiniteData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n>(\n options: UseInfiniteQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n queryClient?: QueryClient,\n): UseInfiniteQueryResult\n\nexport function useInfiniteQuery(\n options: UseInfiniteQueryOptions,\n queryClient?: QueryClient,\n) {\n return useBaseQuery(\n options,\n InfiniteQueryObserver as typeof QueryObserver,\n queryClient,\n )\n}\n"],"mappings":";;;AACA,SAAS,6BAA6B;AACtC,SAAS,oBAAoB;AAqEtB,SAAS,iBACd,SACA,aACA;AACA,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/useIsFetching.cjs b/node_modules/@tanstack/react-query/build/modern/useIsFetching.cjs new file mode 100644 index 0000000..28660e7 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/modern/useIsFetching.cjs @@ -0,0 +1,56 @@ +"use strict"; +"use client"; +var __create = Object.create; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __getProtoOf = Object.getPrototypeOf; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( + // If the importer is in node compatibility mode or this is not an ESM + // file that has been converted to a CommonJS file using a Babel- + // compatible transform (i.e. "__esModule" has not been set), then set + // "default" to the CommonJS "module.exports" for node compatibility. + isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, + mod +)); +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/useIsFetching.ts +var useIsFetching_exports = {}; +__export(useIsFetching_exports, { + useIsFetching: () => useIsFetching +}); +module.exports = __toCommonJS(useIsFetching_exports); +var React = __toESM(require("react"), 1); +var import_query_core = require("@tanstack/query-core"); +var import_QueryClientProvider = require("./QueryClientProvider.cjs"); +function useIsFetching(filters, queryClient) { + const client = (0, import_QueryClientProvider.useQueryClient)(queryClient); + const queryCache = client.getQueryCache(); + return React.useSyncExternalStore( + React.useCallback( + (onStoreChange) => queryCache.subscribe(import_query_core.notifyManager.batchCalls(onStoreChange)), + [queryCache] + ), + () => client.isFetching(filters), + () => client.isFetching(filters) + ); +} +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + useIsFetching +}); +//# sourceMappingURL=useIsFetching.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/useIsFetching.cjs.map b/node_modules/@tanstack/react-query/build/modern/useIsFetching.cjs.map new file mode 100644 index 0000000..5a58e86 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/modern/useIsFetching.cjs.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/useIsFetching.ts"],"sourcesContent":["'use client'\nimport * as React from 'react'\nimport { notifyManager } from '@tanstack/query-core'\n\nimport { useQueryClient } from './QueryClientProvider'\nimport type { QueryClient, QueryFilters } from '@tanstack/query-core'\n\nexport function useIsFetching(\n filters?: QueryFilters,\n queryClient?: QueryClient,\n): number {\n const client = useQueryClient(queryClient)\n const queryCache = client.getQueryCache()\n\n return React.useSyncExternalStore(\n React.useCallback(\n (onStoreChange) =>\n queryCache.subscribe(notifyManager.batchCalls(onStoreChange)),\n [queryCache],\n ),\n () => client.isFetching(filters),\n () => client.isFetching(filters),\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,YAAuB;AACvB,wBAA8B;AAE9B,iCAA+B;AAGxB,SAAS,cACd,SACA,aACQ;AACR,QAAM,aAAS,2CAAe,WAAW;AACzC,QAAM,aAAa,OAAO,cAAc;AAExC,SAAa;AAAA,IACL;AAAA,MACJ,CAAC,kBACC,WAAW,UAAU,gCAAc,WAAW,aAAa,CAAC;AAAA,MAC9D,CAAC,UAAU;AAAA,IACb;AAAA,IACA,MAAM,OAAO,WAAW,OAAO;AAAA,IAC/B,MAAM,OAAO,WAAW,OAAO;AAAA,EACjC;AACF;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/useIsFetching.d.cts b/node_modules/@tanstack/react-query/build/modern/useIsFetching.d.cts new file mode 100644 index 0000000..832d33f --- /dev/null +++ b/node_modules/@tanstack/react-query/build/modern/useIsFetching.d.cts @@ -0,0 +1,5 @@ +import { QueryFilters, QueryClient } from '@tanstack/query-core'; + +declare function useIsFetching(filters?: QueryFilters, queryClient?: QueryClient): number; + +export { useIsFetching }; diff --git a/node_modules/@tanstack/react-query/build/modern/useIsFetching.d.ts b/node_modules/@tanstack/react-query/build/modern/useIsFetching.d.ts new file mode 100644 index 0000000..832d33f --- /dev/null +++ b/node_modules/@tanstack/react-query/build/modern/useIsFetching.d.ts @@ -0,0 +1,5 @@ +import { QueryFilters, QueryClient } from '@tanstack/query-core'; + +declare function useIsFetching(filters?: QueryFilters, queryClient?: QueryClient): number; + +export { useIsFetching }; diff --git a/node_modules/@tanstack/react-query/build/modern/useIsFetching.js b/node_modules/@tanstack/react-query/build/modern/useIsFetching.js new file mode 100644 index 0000000..acfc67a --- /dev/null +++ b/node_modules/@tanstack/react-query/build/modern/useIsFetching.js @@ -0,0 +1,22 @@ +"use client"; + +// src/useIsFetching.ts +import * as React from "react"; +import { notifyManager } from "@tanstack/query-core"; +import { useQueryClient } from "./QueryClientProvider.js"; +function useIsFetching(filters, queryClient) { + const client = useQueryClient(queryClient); + const queryCache = client.getQueryCache(); + return React.useSyncExternalStore( + React.useCallback( + (onStoreChange) => queryCache.subscribe(notifyManager.batchCalls(onStoreChange)), + [queryCache] + ), + () => client.isFetching(filters), + () => client.isFetching(filters) + ); +} +export { + useIsFetching +}; +//# sourceMappingURL=useIsFetching.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/useIsFetching.js.map b/node_modules/@tanstack/react-query/build/modern/useIsFetching.js.map new file mode 100644 index 0000000..9921ab6 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/modern/useIsFetching.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/useIsFetching.ts"],"sourcesContent":["'use client'\nimport * as React from 'react'\nimport { notifyManager } from '@tanstack/query-core'\n\nimport { useQueryClient } from './QueryClientProvider'\nimport type { QueryClient, QueryFilters } from '@tanstack/query-core'\n\nexport function useIsFetching(\n filters?: QueryFilters,\n queryClient?: QueryClient,\n): number {\n const client = useQueryClient(queryClient)\n const queryCache = client.getQueryCache()\n\n return React.useSyncExternalStore(\n React.useCallback(\n (onStoreChange) =>\n queryCache.subscribe(notifyManager.batchCalls(onStoreChange)),\n [queryCache],\n ),\n () => client.isFetching(filters),\n () => client.isFetching(filters),\n )\n}\n"],"mappings":";;;AACA,YAAY,WAAW;AACvB,SAAS,qBAAqB;AAE9B,SAAS,sBAAsB;AAGxB,SAAS,cACd,SACA,aACQ;AACR,QAAM,SAAS,eAAe,WAAW;AACzC,QAAM,aAAa,OAAO,cAAc;AAExC,SAAa;AAAA,IACL;AAAA,MACJ,CAAC,kBACC,WAAW,UAAU,cAAc,WAAW,aAAa,CAAC;AAAA,MAC9D,CAAC,UAAU;AAAA,IACb;AAAA,IACA,MAAM,OAAO,WAAW,OAAO;AAAA,IAC/B,MAAM,OAAO,WAAW,OAAO;AAAA,EACjC;AACF;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/useMutation.cjs b/node_modules/@tanstack/react-query/build/modern/useMutation.cjs new file mode 100644 index 0000000..2ae4221 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/modern/useMutation.cjs @@ -0,0 +1,74 @@ +"use strict"; +"use client"; +var __create = Object.create; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __getProtoOf = Object.getPrototypeOf; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( + // If the importer is in node compatibility mode or this is not an ESM + // file that has been converted to a CommonJS file using a Babel- + // compatible transform (i.e. "__esModule" has not been set), then set + // "default" to the CommonJS "module.exports" for node compatibility. + isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, + mod +)); +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/useMutation.ts +var useMutation_exports = {}; +__export(useMutation_exports, { + useMutation: () => useMutation +}); +module.exports = __toCommonJS(useMutation_exports); +var React = __toESM(require("react"), 1); +var import_query_core = require("@tanstack/query-core"); +var import_QueryClientProvider = require("./QueryClientProvider.cjs"); +function useMutation(options, queryClient) { + const client = (0, import_QueryClientProvider.useQueryClient)(queryClient); + const [observer] = React.useState( + () => new import_query_core.MutationObserver( + client, + options + ) + ); + React.useEffect(() => { + observer.setOptions(options); + }, [observer, options]); + const result = React.useSyncExternalStore( + React.useCallback( + (onStoreChange) => observer.subscribe(import_query_core.notifyManager.batchCalls(onStoreChange)), + [observer] + ), + () => observer.getCurrentResult(), + () => observer.getCurrentResult() + ); + const mutate = React.useCallback( + (variables, mutateOptions) => { + observer.mutate(variables, mutateOptions).catch(import_query_core.noop); + }, + [observer] + ); + if (result.error && (0, import_query_core.shouldThrowError)(observer.options.throwOnError, [result.error])) { + throw result.error; + } + return { ...result, mutate, mutateAsync: result.mutate }; +} +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + useMutation +}); +//# sourceMappingURL=useMutation.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/useMutation.cjs.map b/node_modules/@tanstack/react-query/build/modern/useMutation.cjs.map new file mode 100644 index 0000000..23c4d2e --- /dev/null +++ b/node_modules/@tanstack/react-query/build/modern/useMutation.cjs.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/useMutation.ts"],"sourcesContent":["'use client'\nimport * as React from 'react'\nimport {\n MutationObserver,\n noop,\n notifyManager,\n shouldThrowError,\n} from '@tanstack/query-core'\nimport { useQueryClient } from './QueryClientProvider'\nimport type {\n UseMutateFunction,\n UseMutationOptions,\n UseMutationResult,\n} from './types'\nimport type { DefaultError, QueryClient } from '@tanstack/query-core'\n\n// HOOK\n\nexport function useMutation<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n>(\n options: UseMutationOptions,\n queryClient?: QueryClient,\n): UseMutationResult {\n const client = useQueryClient(queryClient)\n\n const [observer] = React.useState(\n () =>\n new MutationObserver(\n client,\n options,\n ),\n )\n\n React.useEffect(() => {\n observer.setOptions(options)\n }, [observer, options])\n\n const result = React.useSyncExternalStore(\n React.useCallback(\n (onStoreChange) =>\n observer.subscribe(notifyManager.batchCalls(onStoreChange)),\n [observer],\n ),\n () => observer.getCurrentResult(),\n () => observer.getCurrentResult(),\n )\n\n const mutate = React.useCallback<\n UseMutateFunction\n >(\n (variables, mutateOptions) => {\n observer.mutate(variables, mutateOptions).catch(noop)\n },\n [observer],\n )\n\n if (\n result.error &&\n shouldThrowError(observer.options.throwOnError, [result.error])\n ) {\n throw result.error\n }\n\n return { ...result, mutate, mutateAsync: result.mutate }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,YAAuB;AACvB,wBAKO;AACP,iCAA+B;AAUxB,SAAS,YAMd,SACA,aAC+D;AAC/D,QAAM,aAAS,2CAAe,WAAW;AAEzC,QAAM,CAAC,QAAQ,IAAU;AAAA,IACvB,MACE,IAAI;AAAA,MACF;AAAA,MACA;AAAA,IACF;AAAA,EACJ;AAEA,EAAM,gBAAU,MAAM;AACpB,aAAS,WAAW,OAAO;AAAA,EAC7B,GAAG,CAAC,UAAU,OAAO,CAAC;AAEtB,QAAM,SAAe;AAAA,IACb;AAAA,MACJ,CAAC,kBACC,SAAS,UAAU,gCAAc,WAAW,aAAa,CAAC;AAAA,MAC5D,CAAC,QAAQ;AAAA,IACX;AAAA,IACA,MAAM,SAAS,iBAAiB;AAAA,IAChC,MAAM,SAAS,iBAAiB;AAAA,EAClC;AAEA,QAAM,SAAe;AAAA,IAGnB,CAAC,WAAW,kBAAkB;AAC5B,eAAS,OAAO,WAAW,aAAa,EAAE,MAAM,sBAAI;AAAA,IACtD;AAAA,IACA,CAAC,QAAQ;AAAA,EACX;AAEA,MACE,OAAO,aACP,oCAAiB,SAAS,QAAQ,cAAc,CAAC,OAAO,KAAK,CAAC,GAC9D;AACA,UAAM,OAAO;AAAA,EACf;AAEA,SAAO,EAAE,GAAG,QAAQ,QAAQ,aAAa,OAAO,OAAO;AACzD;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/useMutation.d.cts b/node_modules/@tanstack/react-query/build/modern/useMutation.d.cts new file mode 100644 index 0000000..09102dd --- /dev/null +++ b/node_modules/@tanstack/react-query/build/modern/useMutation.d.cts @@ -0,0 +1,6 @@ +import { UseMutationOptions, UseMutationResult } from './types.cjs'; +import { DefaultError, QueryClient } from '@tanstack/query-core'; + +declare function useMutation(options: UseMutationOptions, queryClient?: QueryClient): UseMutationResult; + +export { useMutation }; diff --git a/node_modules/@tanstack/react-query/build/modern/useMutation.d.ts b/node_modules/@tanstack/react-query/build/modern/useMutation.d.ts new file mode 100644 index 0000000..0f29460 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/modern/useMutation.d.ts @@ -0,0 +1,6 @@ +import { UseMutationOptions, UseMutationResult } from './types.js'; +import { DefaultError, QueryClient } from '@tanstack/query-core'; + +declare function useMutation(options: UseMutationOptions, queryClient?: QueryClient): UseMutationResult; + +export { useMutation }; diff --git a/node_modules/@tanstack/react-query/build/modern/useMutation.js b/node_modules/@tanstack/react-query/build/modern/useMutation.js new file mode 100644 index 0000000..8e089c4 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/modern/useMutation.js @@ -0,0 +1,45 @@ +"use client"; + +// src/useMutation.ts +import * as React from "react"; +import { + MutationObserver, + noop, + notifyManager, + shouldThrowError +} from "@tanstack/query-core"; +import { useQueryClient } from "./QueryClientProvider.js"; +function useMutation(options, queryClient) { + const client = useQueryClient(queryClient); + const [observer] = React.useState( + () => new MutationObserver( + client, + options + ) + ); + React.useEffect(() => { + observer.setOptions(options); + }, [observer, options]); + const result = React.useSyncExternalStore( + React.useCallback( + (onStoreChange) => observer.subscribe(notifyManager.batchCalls(onStoreChange)), + [observer] + ), + () => observer.getCurrentResult(), + () => observer.getCurrentResult() + ); + const mutate = React.useCallback( + (variables, mutateOptions) => { + observer.mutate(variables, mutateOptions).catch(noop); + }, + [observer] + ); + if (result.error && shouldThrowError(observer.options.throwOnError, [result.error])) { + throw result.error; + } + return { ...result, mutate, mutateAsync: result.mutate }; +} +export { + useMutation +}; +//# sourceMappingURL=useMutation.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/useMutation.js.map b/node_modules/@tanstack/react-query/build/modern/useMutation.js.map new file mode 100644 index 0000000..0df164b --- /dev/null +++ b/node_modules/@tanstack/react-query/build/modern/useMutation.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/useMutation.ts"],"sourcesContent":["'use client'\nimport * as React from 'react'\nimport {\n MutationObserver,\n noop,\n notifyManager,\n shouldThrowError,\n} from '@tanstack/query-core'\nimport { useQueryClient } from './QueryClientProvider'\nimport type {\n UseMutateFunction,\n UseMutationOptions,\n UseMutationResult,\n} from './types'\nimport type { DefaultError, QueryClient } from '@tanstack/query-core'\n\n// HOOK\n\nexport function useMutation<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n>(\n options: UseMutationOptions,\n queryClient?: QueryClient,\n): UseMutationResult {\n const client = useQueryClient(queryClient)\n\n const [observer] = React.useState(\n () =>\n new MutationObserver(\n client,\n options,\n ),\n )\n\n React.useEffect(() => {\n observer.setOptions(options)\n }, [observer, options])\n\n const result = React.useSyncExternalStore(\n React.useCallback(\n (onStoreChange) =>\n observer.subscribe(notifyManager.batchCalls(onStoreChange)),\n [observer],\n ),\n () => observer.getCurrentResult(),\n () => observer.getCurrentResult(),\n )\n\n const mutate = React.useCallback<\n UseMutateFunction\n >(\n (variables, mutateOptions) => {\n observer.mutate(variables, mutateOptions).catch(noop)\n },\n [observer],\n )\n\n if (\n result.error &&\n shouldThrowError(observer.options.throwOnError, [result.error])\n ) {\n throw result.error\n }\n\n return { ...result, mutate, mutateAsync: result.mutate }\n}\n"],"mappings":";;;AACA,YAAY,WAAW;AACvB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,sBAAsB;AAUxB,SAAS,YAMd,SACA,aAC+D;AAC/D,QAAM,SAAS,eAAe,WAAW;AAEzC,QAAM,CAAC,QAAQ,IAAU;AAAA,IACvB,MACE,IAAI;AAAA,MACF;AAAA,MACA;AAAA,IACF;AAAA,EACJ;AAEA,EAAM,gBAAU,MAAM;AACpB,aAAS,WAAW,OAAO;AAAA,EAC7B,GAAG,CAAC,UAAU,OAAO,CAAC;AAEtB,QAAM,SAAe;AAAA,IACb;AAAA,MACJ,CAAC,kBACC,SAAS,UAAU,cAAc,WAAW,aAAa,CAAC;AAAA,MAC5D,CAAC,QAAQ;AAAA,IACX;AAAA,IACA,MAAM,SAAS,iBAAiB;AAAA,IAChC,MAAM,SAAS,iBAAiB;AAAA,EAClC;AAEA,QAAM,SAAe;AAAA,IAGnB,CAAC,WAAW,kBAAkB;AAC5B,eAAS,OAAO,WAAW,aAAa,EAAE,MAAM,IAAI;AAAA,IACtD;AAAA,IACA,CAAC,QAAQ;AAAA,EACX;AAEA,MACE,OAAO,SACP,iBAAiB,SAAS,QAAQ,cAAc,CAAC,OAAO,KAAK,CAAC,GAC9D;AACA,UAAM,OAAO;AAAA,EACf;AAEA,SAAO,EAAE,GAAG,QAAQ,QAAQ,aAAa,OAAO,OAAO;AACzD;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/useMutationState.cjs b/node_modules/@tanstack/react-query/build/modern/useMutationState.cjs new file mode 100644 index 0000000..b256e68 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/modern/useMutationState.cjs @@ -0,0 +1,86 @@ +"use strict"; +"use client"; +var __create = Object.create; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __getProtoOf = Object.getPrototypeOf; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( + // If the importer is in node compatibility mode or this is not an ESM + // file that has been converted to a CommonJS file using a Babel- + // compatible transform (i.e. "__esModule" has not been set), then set + // "default" to the CommonJS "module.exports" for node compatibility. + isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, + mod +)); +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/useMutationState.ts +var useMutationState_exports = {}; +__export(useMutationState_exports, { + useIsMutating: () => useIsMutating, + useMutationState: () => useMutationState +}); +module.exports = __toCommonJS(useMutationState_exports); +var React = __toESM(require("react"), 1); +var import_query_core = require("@tanstack/query-core"); +var import_QueryClientProvider = require("./QueryClientProvider.cjs"); +function useIsMutating(filters, queryClient) { + const client = (0, import_QueryClientProvider.useQueryClient)(queryClient); + return useMutationState( + { filters: { ...filters, status: "pending" } }, + client + ).length; +} +function getResult(mutationCache, options) { + return mutationCache.findAll(options.filters).map( + (mutation) => options.select ? options.select(mutation) : mutation.state + ); +} +function useMutationState(options = {}, queryClient) { + const mutationCache = (0, import_QueryClientProvider.useQueryClient)(queryClient).getMutationCache(); + const optionsRef = React.useRef(options); + const result = React.useRef(null); + if (result.current === null) { + result.current = getResult(mutationCache, options); + } + React.useEffect(() => { + optionsRef.current = options; + }); + return React.useSyncExternalStore( + React.useCallback( + (onStoreChange) => mutationCache.subscribe(() => { + const nextResult = (0, import_query_core.replaceEqualDeep)( + result.current, + getResult(mutationCache, optionsRef.current) + ); + if (result.current !== nextResult) { + result.current = nextResult; + import_query_core.notifyManager.schedule(onStoreChange); + } + }), + [mutationCache] + ), + () => result.current, + () => result.current + ); +} +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + useIsMutating, + useMutationState +}); +//# sourceMappingURL=useMutationState.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/useMutationState.cjs.map b/node_modules/@tanstack/react-query/build/modern/useMutationState.cjs.map new file mode 100644 index 0000000..b43a480 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/modern/useMutationState.cjs.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/useMutationState.ts"],"sourcesContent":["'use client'\nimport * as React from 'react'\n\nimport { notifyManager, replaceEqualDeep } from '@tanstack/query-core'\nimport { useQueryClient } from './QueryClientProvider'\nimport type {\n Mutation,\n MutationCache,\n MutationFilters,\n MutationState,\n QueryClient,\n} from '@tanstack/query-core'\n\nexport function useIsMutating(\n filters?: MutationFilters,\n queryClient?: QueryClient,\n): number {\n const client = useQueryClient(queryClient)\n return useMutationState(\n { filters: { ...filters, status: 'pending' } },\n client,\n ).length\n}\n\ntype MutationStateOptions = {\n filters?: MutationFilters\n select?: (mutation: Mutation) => TResult\n}\n\nfunction getResult(\n mutationCache: MutationCache,\n options: MutationStateOptions,\n): Array {\n return mutationCache\n .findAll(options.filters)\n .map(\n (mutation): TResult =>\n (options.select ? options.select(mutation) : mutation.state) as TResult,\n )\n}\n\nexport function useMutationState(\n options: MutationStateOptions = {},\n queryClient?: QueryClient,\n): Array {\n const mutationCache = useQueryClient(queryClient).getMutationCache()\n const optionsRef = React.useRef(options)\n const result = React.useRef>(null)\n if (result.current === null) {\n result.current = getResult(mutationCache, options)\n }\n\n React.useEffect(() => {\n optionsRef.current = options\n })\n\n return React.useSyncExternalStore(\n React.useCallback(\n (onStoreChange) =>\n mutationCache.subscribe(() => {\n const nextResult = replaceEqualDeep(\n result.current,\n getResult(mutationCache, optionsRef.current),\n )\n if (result.current !== nextResult) {\n result.current = nextResult\n notifyManager.schedule(onStoreChange)\n }\n }),\n [mutationCache],\n ),\n () => result.current,\n () => result.current,\n )!\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,YAAuB;AAEvB,wBAAgD;AAChD,iCAA+B;AASxB,SAAS,cACd,SACA,aACQ;AACR,QAAM,aAAS,2CAAe,WAAW;AACzC,SAAO;AAAA,IACL,EAAE,SAAS,EAAE,GAAG,SAAS,QAAQ,UAAU,EAAE;AAAA,IAC7C;AAAA,EACF,EAAE;AACJ;AAOA,SAAS,UACP,eACA,SACgB;AAChB,SAAO,cACJ,QAAQ,QAAQ,OAAO,EACvB;AAAA,IACC,CAAC,aACE,QAAQ,SAAS,QAAQ,OAAO,QAAQ,IAAI,SAAS;AAAA,EAC1D;AACJ;AAEO,SAAS,iBACd,UAAyC,CAAC,GAC1C,aACgB;AAChB,QAAM,oBAAgB,2CAAe,WAAW,EAAE,iBAAiB;AACnE,QAAM,aAAmB,aAAO,OAAO;AACvC,QAAM,SAAe,aAAuB,IAAI;AAChD,MAAI,OAAO,YAAY,MAAM;AAC3B,WAAO,UAAU,UAAU,eAAe,OAAO;AAAA,EACnD;AAEA,EAAM,gBAAU,MAAM;AACpB,eAAW,UAAU;AAAA,EACvB,CAAC;AAED,SAAa;AAAA,IACL;AAAA,MACJ,CAAC,kBACC,cAAc,UAAU,MAAM;AAC5B,cAAM,iBAAa;AAAA,UACjB,OAAO;AAAA,UACP,UAAU,eAAe,WAAW,OAAO;AAAA,QAC7C;AACA,YAAI,OAAO,YAAY,YAAY;AACjC,iBAAO,UAAU;AACjB,0CAAc,SAAS,aAAa;AAAA,QACtC;AAAA,MACF,CAAC;AAAA,MACH,CAAC,aAAa;AAAA,IAChB;AAAA,IACA,MAAM,OAAO;AAAA,IACb,MAAM,OAAO;AAAA,EACf;AACF;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/useMutationState.d.cts b/node_modules/@tanstack/react-query/build/modern/useMutationState.d.cts new file mode 100644 index 0000000..6f35037 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/modern/useMutationState.d.cts @@ -0,0 +1,10 @@ +import { MutationFilters, QueryClient, MutationState, Mutation } from '@tanstack/query-core'; + +declare function useIsMutating(filters?: MutationFilters, queryClient?: QueryClient): number; +type MutationStateOptions = { + filters?: MutationFilters; + select?: (mutation: Mutation) => TResult; +}; +declare function useMutationState(options?: MutationStateOptions, queryClient?: QueryClient): Array; + +export { useIsMutating, useMutationState }; diff --git a/node_modules/@tanstack/react-query/build/modern/useMutationState.d.ts b/node_modules/@tanstack/react-query/build/modern/useMutationState.d.ts new file mode 100644 index 0000000..6f35037 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/modern/useMutationState.d.ts @@ -0,0 +1,10 @@ +import { MutationFilters, QueryClient, MutationState, Mutation } from '@tanstack/query-core'; + +declare function useIsMutating(filters?: MutationFilters, queryClient?: QueryClient): number; +type MutationStateOptions = { + filters?: MutationFilters; + select?: (mutation: Mutation) => TResult; +}; +declare function useMutationState(options?: MutationStateOptions, queryClient?: QueryClient): Array; + +export { useIsMutating, useMutationState }; diff --git a/node_modules/@tanstack/react-query/build/modern/useMutationState.js b/node_modules/@tanstack/react-query/build/modern/useMutationState.js new file mode 100644 index 0000000..aa22350 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/modern/useMutationState.js @@ -0,0 +1,51 @@ +"use client"; + +// src/useMutationState.ts +import * as React from "react"; +import { notifyManager, replaceEqualDeep } from "@tanstack/query-core"; +import { useQueryClient } from "./QueryClientProvider.js"; +function useIsMutating(filters, queryClient) { + const client = useQueryClient(queryClient); + return useMutationState( + { filters: { ...filters, status: "pending" } }, + client + ).length; +} +function getResult(mutationCache, options) { + return mutationCache.findAll(options.filters).map( + (mutation) => options.select ? options.select(mutation) : mutation.state + ); +} +function useMutationState(options = {}, queryClient) { + const mutationCache = useQueryClient(queryClient).getMutationCache(); + const optionsRef = React.useRef(options); + const result = React.useRef(null); + if (result.current === null) { + result.current = getResult(mutationCache, options); + } + React.useEffect(() => { + optionsRef.current = options; + }); + return React.useSyncExternalStore( + React.useCallback( + (onStoreChange) => mutationCache.subscribe(() => { + const nextResult = replaceEqualDeep( + result.current, + getResult(mutationCache, optionsRef.current) + ); + if (result.current !== nextResult) { + result.current = nextResult; + notifyManager.schedule(onStoreChange); + } + }), + [mutationCache] + ), + () => result.current, + () => result.current + ); +} +export { + useIsMutating, + useMutationState +}; +//# sourceMappingURL=useMutationState.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/useMutationState.js.map b/node_modules/@tanstack/react-query/build/modern/useMutationState.js.map new file mode 100644 index 0000000..399a5a1 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/modern/useMutationState.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/useMutationState.ts"],"sourcesContent":["'use client'\nimport * as React from 'react'\n\nimport { notifyManager, replaceEqualDeep } from '@tanstack/query-core'\nimport { useQueryClient } from './QueryClientProvider'\nimport type {\n Mutation,\n MutationCache,\n MutationFilters,\n MutationState,\n QueryClient,\n} from '@tanstack/query-core'\n\nexport function useIsMutating(\n filters?: MutationFilters,\n queryClient?: QueryClient,\n): number {\n const client = useQueryClient(queryClient)\n return useMutationState(\n { filters: { ...filters, status: 'pending' } },\n client,\n ).length\n}\n\ntype MutationStateOptions = {\n filters?: MutationFilters\n select?: (mutation: Mutation) => TResult\n}\n\nfunction getResult(\n mutationCache: MutationCache,\n options: MutationStateOptions,\n): Array {\n return mutationCache\n .findAll(options.filters)\n .map(\n (mutation): TResult =>\n (options.select ? options.select(mutation) : mutation.state) as TResult,\n )\n}\n\nexport function useMutationState(\n options: MutationStateOptions = {},\n queryClient?: QueryClient,\n): Array {\n const mutationCache = useQueryClient(queryClient).getMutationCache()\n const optionsRef = React.useRef(options)\n const result = React.useRef>(null)\n if (result.current === null) {\n result.current = getResult(mutationCache, options)\n }\n\n React.useEffect(() => {\n optionsRef.current = options\n })\n\n return React.useSyncExternalStore(\n React.useCallback(\n (onStoreChange) =>\n mutationCache.subscribe(() => {\n const nextResult = replaceEqualDeep(\n result.current,\n getResult(mutationCache, optionsRef.current),\n )\n if (result.current !== nextResult) {\n result.current = nextResult\n notifyManager.schedule(onStoreChange)\n }\n }),\n [mutationCache],\n ),\n () => result.current,\n () => result.current,\n )!\n}\n"],"mappings":";;;AACA,YAAY,WAAW;AAEvB,SAAS,eAAe,wBAAwB;AAChD,SAAS,sBAAsB;AASxB,SAAS,cACd,SACA,aACQ;AACR,QAAM,SAAS,eAAe,WAAW;AACzC,SAAO;AAAA,IACL,EAAE,SAAS,EAAE,GAAG,SAAS,QAAQ,UAAU,EAAE;AAAA,IAC7C;AAAA,EACF,EAAE;AACJ;AAOA,SAAS,UACP,eACA,SACgB;AAChB,SAAO,cACJ,QAAQ,QAAQ,OAAO,EACvB;AAAA,IACC,CAAC,aACE,QAAQ,SAAS,QAAQ,OAAO,QAAQ,IAAI,SAAS;AAAA,EAC1D;AACJ;AAEO,SAAS,iBACd,UAAyC,CAAC,GAC1C,aACgB;AAChB,QAAM,gBAAgB,eAAe,WAAW,EAAE,iBAAiB;AACnE,QAAM,aAAmB,aAAO,OAAO;AACvC,QAAM,SAAe,aAAuB,IAAI;AAChD,MAAI,OAAO,YAAY,MAAM;AAC3B,WAAO,UAAU,UAAU,eAAe,OAAO;AAAA,EACnD;AAEA,EAAM,gBAAU,MAAM;AACpB,eAAW,UAAU;AAAA,EACvB,CAAC;AAED,SAAa;AAAA,IACL;AAAA,MACJ,CAAC,kBACC,cAAc,UAAU,MAAM;AAC5B,cAAM,aAAa;AAAA,UACjB,OAAO;AAAA,UACP,UAAU,eAAe,WAAW,OAAO;AAAA,QAC7C;AACA,YAAI,OAAO,YAAY,YAAY;AACjC,iBAAO,UAAU;AACjB,wBAAc,SAAS,aAAa;AAAA,QACtC;AAAA,MACF,CAAC;AAAA,MACH,CAAC,aAAa;AAAA,IAChB;AAAA,IACA,MAAM,OAAO;AAAA,IACb,MAAM,OAAO;AAAA,EACf;AACF;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/usePrefetchInfiniteQuery.cjs b/node_modules/@tanstack/react-query/build/modern/usePrefetchInfiniteQuery.cjs new file mode 100644 index 0000000..9148196 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/modern/usePrefetchInfiniteQuery.cjs @@ -0,0 +1,37 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/usePrefetchInfiniteQuery.tsx +var usePrefetchInfiniteQuery_exports = {}; +__export(usePrefetchInfiniteQuery_exports, { + usePrefetchInfiniteQuery: () => usePrefetchInfiniteQuery +}); +module.exports = __toCommonJS(usePrefetchInfiniteQuery_exports); +var import_QueryClientProvider = require("./QueryClientProvider.cjs"); +function usePrefetchInfiniteQuery(options, queryClient) { + const client = (0, import_QueryClientProvider.useQueryClient)(queryClient); + if (!client.getQueryState(options.queryKey)) { + client.prefetchInfiniteQuery(options); + } +} +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + usePrefetchInfiniteQuery +}); +//# sourceMappingURL=usePrefetchInfiniteQuery.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/usePrefetchInfiniteQuery.cjs.map b/node_modules/@tanstack/react-query/build/modern/usePrefetchInfiniteQuery.cjs.map new file mode 100644 index 0000000..e912e76 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/modern/usePrefetchInfiniteQuery.cjs.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/usePrefetchInfiniteQuery.tsx"],"sourcesContent":["import { useQueryClient } from './QueryClientProvider'\nimport type {\n DefaultError,\n FetchInfiniteQueryOptions,\n QueryClient,\n QueryKey,\n} from '@tanstack/query-core'\n\nexport function usePrefetchInfiniteQuery<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n>(\n options: FetchInfiniteQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n queryClient?: QueryClient,\n) {\n const client = useQueryClient(queryClient)\n\n if (!client.getQueryState(options.queryKey)) {\n client.prefetchInfiniteQuery(options)\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,iCAA+B;AAQxB,SAAS,yBAOd,SAOA,aACA;AACA,QAAM,aAAS,2CAAe,WAAW;AAEzC,MAAI,CAAC,OAAO,cAAc,QAAQ,QAAQ,GAAG;AAC3C,WAAO,sBAAsB,OAAO;AAAA,EACtC;AACF;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/usePrefetchInfiniteQuery.d.cts b/node_modules/@tanstack/react-query/build/modern/usePrefetchInfiniteQuery.d.cts new file mode 100644 index 0000000..aeba2f8 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/modern/usePrefetchInfiniteQuery.d.cts @@ -0,0 +1,5 @@ +import { DefaultError, QueryKey, FetchInfiniteQueryOptions, QueryClient } from '@tanstack/query-core'; + +declare function usePrefetchInfiniteQuery(options: FetchInfiniteQueryOptions, queryClient?: QueryClient): void; + +export { usePrefetchInfiniteQuery }; diff --git a/node_modules/@tanstack/react-query/build/modern/usePrefetchInfiniteQuery.d.ts b/node_modules/@tanstack/react-query/build/modern/usePrefetchInfiniteQuery.d.ts new file mode 100644 index 0000000..aeba2f8 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/modern/usePrefetchInfiniteQuery.d.ts @@ -0,0 +1,5 @@ +import { DefaultError, QueryKey, FetchInfiniteQueryOptions, QueryClient } from '@tanstack/query-core'; + +declare function usePrefetchInfiniteQuery(options: FetchInfiniteQueryOptions, queryClient?: QueryClient): void; + +export { usePrefetchInfiniteQuery }; diff --git a/node_modules/@tanstack/react-query/build/modern/usePrefetchInfiniteQuery.js b/node_modules/@tanstack/react-query/build/modern/usePrefetchInfiniteQuery.js new file mode 100644 index 0000000..bce85f3 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/modern/usePrefetchInfiniteQuery.js @@ -0,0 +1,12 @@ +// src/usePrefetchInfiniteQuery.tsx +import { useQueryClient } from "./QueryClientProvider.js"; +function usePrefetchInfiniteQuery(options, queryClient) { + const client = useQueryClient(queryClient); + if (!client.getQueryState(options.queryKey)) { + client.prefetchInfiniteQuery(options); + } +} +export { + usePrefetchInfiniteQuery +}; +//# sourceMappingURL=usePrefetchInfiniteQuery.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/usePrefetchInfiniteQuery.js.map b/node_modules/@tanstack/react-query/build/modern/usePrefetchInfiniteQuery.js.map new file mode 100644 index 0000000..20e3042 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/modern/usePrefetchInfiniteQuery.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/usePrefetchInfiniteQuery.tsx"],"sourcesContent":["import { useQueryClient } from './QueryClientProvider'\nimport type {\n DefaultError,\n FetchInfiniteQueryOptions,\n QueryClient,\n QueryKey,\n} from '@tanstack/query-core'\n\nexport function usePrefetchInfiniteQuery<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n>(\n options: FetchInfiniteQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n queryClient?: QueryClient,\n) {\n const client = useQueryClient(queryClient)\n\n if (!client.getQueryState(options.queryKey)) {\n client.prefetchInfiniteQuery(options)\n }\n}\n"],"mappings":";AAAA,SAAS,sBAAsB;AAQxB,SAAS,yBAOd,SAOA,aACA;AACA,QAAM,SAAS,eAAe,WAAW;AAEzC,MAAI,CAAC,OAAO,cAAc,QAAQ,QAAQ,GAAG;AAC3C,WAAO,sBAAsB,OAAO;AAAA,EACtC;AACF;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/usePrefetchQuery.cjs b/node_modules/@tanstack/react-query/build/modern/usePrefetchQuery.cjs new file mode 100644 index 0000000..a884e0f --- /dev/null +++ b/node_modules/@tanstack/react-query/build/modern/usePrefetchQuery.cjs @@ -0,0 +1,37 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/usePrefetchQuery.tsx +var usePrefetchQuery_exports = {}; +__export(usePrefetchQuery_exports, { + usePrefetchQuery: () => usePrefetchQuery +}); +module.exports = __toCommonJS(usePrefetchQuery_exports); +var import_QueryClientProvider = require("./QueryClientProvider.cjs"); +function usePrefetchQuery(options, queryClient) { + const client = (0, import_QueryClientProvider.useQueryClient)(queryClient); + if (!client.getQueryState(options.queryKey)) { + client.prefetchQuery(options); + } +} +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + usePrefetchQuery +}); +//# sourceMappingURL=usePrefetchQuery.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/usePrefetchQuery.cjs.map b/node_modules/@tanstack/react-query/build/modern/usePrefetchQuery.cjs.map new file mode 100644 index 0000000..c5571bb --- /dev/null +++ b/node_modules/@tanstack/react-query/build/modern/usePrefetchQuery.cjs.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/usePrefetchQuery.tsx"],"sourcesContent":["import { useQueryClient } from './QueryClientProvider'\nimport type { DefaultError, QueryClient, QueryKey } from '@tanstack/query-core'\nimport type { UsePrefetchQueryOptions } from './types'\n\nexport function usePrefetchQuery<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n options: UsePrefetchQueryOptions,\n queryClient?: QueryClient,\n) {\n const client = useQueryClient(queryClient)\n\n if (!client.getQueryState(options.queryKey)) {\n client.prefetchQuery(options)\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,iCAA+B;AAIxB,SAAS,iBAMd,SACA,aACA;AACA,QAAM,aAAS,2CAAe,WAAW;AAEzC,MAAI,CAAC,OAAO,cAAc,QAAQ,QAAQ,GAAG;AAC3C,WAAO,cAAc,OAAO;AAAA,EAC9B;AACF;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/usePrefetchQuery.d.cts b/node_modules/@tanstack/react-query/build/modern/usePrefetchQuery.d.cts new file mode 100644 index 0000000..714b71d --- /dev/null +++ b/node_modules/@tanstack/react-query/build/modern/usePrefetchQuery.d.cts @@ -0,0 +1,6 @@ +import { DefaultError, QueryKey, QueryClient } from '@tanstack/query-core'; +import { UsePrefetchQueryOptions } from './types.cjs'; + +declare function usePrefetchQuery(options: UsePrefetchQueryOptions, queryClient?: QueryClient): void; + +export { usePrefetchQuery }; diff --git a/node_modules/@tanstack/react-query/build/modern/usePrefetchQuery.d.ts b/node_modules/@tanstack/react-query/build/modern/usePrefetchQuery.d.ts new file mode 100644 index 0000000..12589eb --- /dev/null +++ b/node_modules/@tanstack/react-query/build/modern/usePrefetchQuery.d.ts @@ -0,0 +1,6 @@ +import { DefaultError, QueryKey, QueryClient } from '@tanstack/query-core'; +import { UsePrefetchQueryOptions } from './types.js'; + +declare function usePrefetchQuery(options: UsePrefetchQueryOptions, queryClient?: QueryClient): void; + +export { usePrefetchQuery }; diff --git a/node_modules/@tanstack/react-query/build/modern/usePrefetchQuery.js b/node_modules/@tanstack/react-query/build/modern/usePrefetchQuery.js new file mode 100644 index 0000000..63d3292 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/modern/usePrefetchQuery.js @@ -0,0 +1,12 @@ +// src/usePrefetchQuery.tsx +import { useQueryClient } from "./QueryClientProvider.js"; +function usePrefetchQuery(options, queryClient) { + const client = useQueryClient(queryClient); + if (!client.getQueryState(options.queryKey)) { + client.prefetchQuery(options); + } +} +export { + usePrefetchQuery +}; +//# sourceMappingURL=usePrefetchQuery.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/usePrefetchQuery.js.map b/node_modules/@tanstack/react-query/build/modern/usePrefetchQuery.js.map new file mode 100644 index 0000000..b7f1881 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/modern/usePrefetchQuery.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/usePrefetchQuery.tsx"],"sourcesContent":["import { useQueryClient } from './QueryClientProvider'\nimport type { DefaultError, QueryClient, QueryKey } from '@tanstack/query-core'\nimport type { UsePrefetchQueryOptions } from './types'\n\nexport function usePrefetchQuery<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n options: UsePrefetchQueryOptions,\n queryClient?: QueryClient,\n) {\n const client = useQueryClient(queryClient)\n\n if (!client.getQueryState(options.queryKey)) {\n client.prefetchQuery(options)\n }\n}\n"],"mappings":";AAAA,SAAS,sBAAsB;AAIxB,SAAS,iBAMd,SACA,aACA;AACA,QAAM,SAAS,eAAe,WAAW;AAEzC,MAAI,CAAC,OAAO,cAAc,QAAQ,QAAQ,GAAG;AAC3C,WAAO,cAAc,OAAO;AAAA,EAC9B;AACF;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/useQueries.cjs b/node_modules/@tanstack/react-query/build/modern/useQueries.cjs new file mode 100644 index 0000000..d3b35aa --- /dev/null +++ b/node_modules/@tanstack/react-query/build/modern/useQueries.cjs @@ -0,0 +1,128 @@ +"use strict"; +"use client"; +var __create = Object.create; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __getProtoOf = Object.getPrototypeOf; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( + // If the importer is in node compatibility mode or this is not an ESM + // file that has been converted to a CommonJS file using a Babel- + // compatible transform (i.e. "__esModule" has not been set), then set + // "default" to the CommonJS "module.exports" for node compatibility. + isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, + mod +)); +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/useQueries.ts +var useQueries_exports = {}; +__export(useQueries_exports, { + useQueries: () => useQueries +}); +module.exports = __toCommonJS(useQueries_exports); +var React = __toESM(require("react"), 1); +var import_query_core = require("@tanstack/query-core"); +var import_QueryClientProvider = require("./QueryClientProvider.cjs"); +var import_IsRestoringProvider = require("./IsRestoringProvider.cjs"); +var import_QueryErrorResetBoundary = require("./QueryErrorResetBoundary.cjs"); +var import_errorBoundaryUtils = require("./errorBoundaryUtils.cjs"); +var import_suspense = require("./suspense.cjs"); +function useQueries({ + queries, + ...options +}, queryClient) { + const client = (0, import_QueryClientProvider.useQueryClient)(queryClient); + const isRestoring = (0, import_IsRestoringProvider.useIsRestoring)(); + const errorResetBoundary = (0, import_QueryErrorResetBoundary.useQueryErrorResetBoundary)(); + const defaultedQueries = React.useMemo( + () => queries.map((opts) => { + const defaultedOptions = client.defaultQueryOptions( + opts + ); + defaultedOptions._optimisticResults = isRestoring ? "isRestoring" : "optimistic"; + return defaultedOptions; + }), + [queries, client, isRestoring] + ); + defaultedQueries.forEach((queryOptions) => { + (0, import_suspense.ensureSuspenseTimers)(queryOptions); + const query = client.getQueryCache().get(queryOptions.queryHash); + (0, import_errorBoundaryUtils.ensurePreventErrorBoundaryRetry)(queryOptions, errorResetBoundary, query); + }); + (0, import_errorBoundaryUtils.useClearResetErrorBoundary)(errorResetBoundary); + const [observer] = React.useState( + () => new import_query_core.QueriesObserver( + client, + defaultedQueries, + options + ) + ); + const [optimisticResult, getCombinedResult, trackResult] = observer.getOptimisticResult( + defaultedQueries, + options.combine + ); + const shouldSubscribe = !isRestoring && options.subscribed !== false; + React.useSyncExternalStore( + React.useCallback( + (onStoreChange) => shouldSubscribe ? observer.subscribe(import_query_core.notifyManager.batchCalls(onStoreChange)) : import_query_core.noop, + [observer, shouldSubscribe] + ), + () => observer.getCurrentResult(), + () => observer.getCurrentResult() + ); + React.useEffect(() => { + observer.setQueries( + defaultedQueries, + options + ); + }, [defaultedQueries, options, observer]); + const shouldAtLeastOneSuspend = optimisticResult.some( + (result, index) => (0, import_suspense.shouldSuspend)(defaultedQueries[index], result) + ); + const suspensePromises = shouldAtLeastOneSuspend ? optimisticResult.flatMap((result, index) => { + const opts = defaultedQueries[index]; + if (opts && (0, import_suspense.shouldSuspend)(opts, result)) { + const queryObserver = new import_query_core.QueryObserver(client, opts); + return (0, import_suspense.fetchOptimistic)(opts, queryObserver, errorResetBoundary); + } + return []; + }) : []; + if (suspensePromises.length > 0) { + throw Promise.all(suspensePromises); + } + const firstSingleResultWhichShouldThrow = optimisticResult.find( + (result, index) => { + const query = defaultedQueries[index]; + return query && (0, import_errorBoundaryUtils.getHasError)({ + result, + errorResetBoundary, + throwOnError: query.throwOnError, + query: client.getQueryCache().get(query.queryHash), + suspense: query.suspense + }); + } + ); + if (firstSingleResultWhichShouldThrow?.error) { + throw firstSingleResultWhichShouldThrow.error; + } + return getCombinedResult(trackResult()); +} +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + useQueries +}); +//# sourceMappingURL=useQueries.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/useQueries.cjs.map b/node_modules/@tanstack/react-query/build/modern/useQueries.cjs.map new file mode 100644 index 0000000..f0ef75c --- /dev/null +++ b/node_modules/@tanstack/react-query/build/modern/useQueries.cjs.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/useQueries.ts"],"sourcesContent":["'use client'\nimport * as React from 'react'\n\nimport {\n QueriesObserver,\n QueryObserver,\n noop,\n notifyManager,\n} from '@tanstack/query-core'\nimport { useQueryClient } from './QueryClientProvider'\nimport { useIsRestoring } from './IsRestoringProvider'\nimport { useQueryErrorResetBoundary } from './QueryErrorResetBoundary'\nimport {\n ensurePreventErrorBoundaryRetry,\n getHasError,\n useClearResetErrorBoundary,\n} from './errorBoundaryUtils'\nimport {\n ensureSuspenseTimers,\n fetchOptimistic,\n shouldSuspend,\n} from './suspense'\nimport type {\n DefinedUseQueryResult,\n UseQueryOptions,\n UseQueryResult,\n} from './types'\nimport type {\n DefaultError,\n OmitKeyof,\n QueriesObserverOptions,\n QueriesPlaceholderDataFunction,\n QueryClient,\n QueryFunction,\n QueryKey,\n QueryObserverOptions,\n ThrowOnError,\n} from '@tanstack/query-core'\n\n// This defines the `UseQueryOptions` that are accepted in `QueriesOptions` & `GetOptions`.\n// `placeholderData` function always gets undefined passed\ntype UseQueryOptionsForUseQueries<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> = OmitKeyof<\n UseQueryOptions,\n 'placeholderData' | 'subscribed'\n> & {\n placeholderData?: TQueryFnData | QueriesPlaceholderDataFunction\n}\n\n// Avoid TS depth-limit error in case of large array literal\ntype MAXIMUM_DEPTH = 20\n\n// Widen the type of the symbol to enable type inference even if skipToken is not immutable.\ntype SkipTokenForUseQueries = symbol\n\ntype GetUseQueryOptionsForUseQueries =\n // Part 1: responsible for applying explicit type parameter to function arguments, if object { queryFnData: TQueryFnData, error: TError, data: TData }\n T extends {\n queryFnData: infer TQueryFnData\n error?: infer TError\n data: infer TData\n }\n ? UseQueryOptionsForUseQueries\n : T extends { queryFnData: infer TQueryFnData; error?: infer TError }\n ? UseQueryOptionsForUseQueries\n : T extends { data: infer TData; error?: infer TError }\n ? UseQueryOptionsForUseQueries\n : // Part 2: responsible for applying explicit type parameter to function arguments, if tuple [TQueryFnData, TError, TData]\n T extends [infer TQueryFnData, infer TError, infer TData]\n ? UseQueryOptionsForUseQueries\n : T extends [infer TQueryFnData, infer TError]\n ? UseQueryOptionsForUseQueries\n : T extends [infer TQueryFnData]\n ? UseQueryOptionsForUseQueries\n : // Part 3: responsible for inferring and enforcing type if no explicit parameter was provided\n T extends {\n queryFn?:\n | QueryFunction\n | SkipTokenForUseQueries\n select?: (data: any) => infer TData\n throwOnError?: ThrowOnError\n }\n ? UseQueryOptionsForUseQueries<\n TQueryFnData,\n unknown extends TError ? DefaultError : TError,\n unknown extends TData ? TQueryFnData : TData,\n TQueryKey\n >\n : // Fallback\n UseQueryOptionsForUseQueries\n\n// A defined initialData setting should return a DefinedUseQueryResult rather than UseQueryResult\ntype GetDefinedOrUndefinedQueryResult = T extends {\n initialData?: infer TInitialData\n}\n ? unknown extends TInitialData\n ? UseQueryResult\n : TInitialData extends TData\n ? DefinedUseQueryResult\n : TInitialData extends () => infer TInitialDataResult\n ? unknown extends TInitialDataResult\n ? UseQueryResult\n : TInitialDataResult extends TData\n ? DefinedUseQueryResult\n : UseQueryResult\n : UseQueryResult\n : UseQueryResult\n\ntype GetUseQueryResult =\n // Part 1: responsible for mapping explicit type parameter to function result, if object\n T extends { queryFnData: any; error?: infer TError; data: infer TData }\n ? GetDefinedOrUndefinedQueryResult\n : T extends { queryFnData: infer TQueryFnData; error?: infer TError }\n ? GetDefinedOrUndefinedQueryResult\n : T extends { data: infer TData; error?: infer TError }\n ? GetDefinedOrUndefinedQueryResult\n : // Part 2: responsible for mapping explicit type parameter to function result, if tuple\n T extends [any, infer TError, infer TData]\n ? GetDefinedOrUndefinedQueryResult\n : T extends [infer TQueryFnData, infer TError]\n ? GetDefinedOrUndefinedQueryResult\n : T extends [infer TQueryFnData]\n ? GetDefinedOrUndefinedQueryResult\n : // Part 3: responsible for mapping inferred type to results, if no explicit parameter was provided\n T extends {\n queryFn?:\n | QueryFunction\n | SkipTokenForUseQueries\n select?: (data: any) => infer TData\n throwOnError?: ThrowOnError\n }\n ? GetDefinedOrUndefinedQueryResult<\n T,\n unknown extends TData ? TQueryFnData : TData,\n unknown extends TError ? DefaultError : TError\n >\n : // Fallback\n UseQueryResult\n\n/**\n * QueriesOptions reducer recursively unwraps function arguments to infer/enforce type param\n */\nexport type QueriesOptions<\n T extends Array,\n TResults extends Array = [],\n TDepth extends ReadonlyArray = [],\n> = TDepth['length'] extends MAXIMUM_DEPTH\n ? Array\n : T extends []\n ? []\n : T extends [infer Head]\n ? [...TResults, GetUseQueryOptionsForUseQueries]\n : T extends [infer Head, ...infer Tails]\n ? QueriesOptions<\n [...Tails],\n [...TResults, GetUseQueryOptionsForUseQueries],\n [...TDepth, 1]\n >\n : ReadonlyArray extends T\n ? T\n : // If T is *some* array but we couldn't assign unknown[] to it, then it must hold some known/homogenous type!\n // use this to infer the param types in the case of Array.map() argument\n T extends Array<\n UseQueryOptionsForUseQueries<\n infer TQueryFnData,\n infer TError,\n infer TData,\n infer TQueryKey\n >\n >\n ? Array<\n UseQueryOptionsForUseQueries<\n TQueryFnData,\n TError,\n TData,\n TQueryKey\n >\n >\n : // Fallback\n Array\n\n/**\n * QueriesResults reducer recursively maps type param to results\n */\nexport type QueriesResults<\n T extends Array,\n TResults extends Array = [],\n TDepth extends ReadonlyArray = [],\n> = TDepth['length'] extends MAXIMUM_DEPTH\n ? Array\n : T extends []\n ? []\n : T extends [infer Head]\n ? [...TResults, GetUseQueryResult]\n : T extends [infer Head, ...infer Tails]\n ? QueriesResults<\n [...Tails],\n [...TResults, GetUseQueryResult],\n [...TDepth, 1]\n >\n : { [K in keyof T]: GetUseQueryResult }\n\nexport function useQueries<\n T extends Array,\n TCombinedResult = QueriesResults,\n>(\n {\n queries,\n ...options\n }: {\n queries:\n | readonly [...QueriesOptions]\n | readonly [...{ [K in keyof T]: GetUseQueryOptionsForUseQueries }]\n combine?: (result: QueriesResults) => TCombinedResult\n subscribed?: boolean\n },\n queryClient?: QueryClient,\n): TCombinedResult {\n const client = useQueryClient(queryClient)\n const isRestoring = useIsRestoring()\n const errorResetBoundary = useQueryErrorResetBoundary()\n\n const defaultedQueries = React.useMemo(\n () =>\n queries.map((opts) => {\n const defaultedOptions = client.defaultQueryOptions(\n opts as QueryObserverOptions,\n )\n\n // Make sure the results are already in fetching state before subscribing or updating options\n defaultedOptions._optimisticResults = isRestoring\n ? 'isRestoring'\n : 'optimistic'\n\n return defaultedOptions\n }),\n [queries, client, isRestoring],\n )\n\n defaultedQueries.forEach((queryOptions) => {\n ensureSuspenseTimers(queryOptions)\n const query = client.getQueryCache().get(queryOptions.queryHash)\n ensurePreventErrorBoundaryRetry(queryOptions, errorResetBoundary, query)\n })\n\n useClearResetErrorBoundary(errorResetBoundary)\n\n const [observer] = React.useState(\n () =>\n new QueriesObserver(\n client,\n defaultedQueries,\n options as QueriesObserverOptions,\n ),\n )\n\n // note: this must be called before useSyncExternalStore\n const [optimisticResult, getCombinedResult, trackResult] =\n observer.getOptimisticResult(\n defaultedQueries,\n (options as QueriesObserverOptions).combine,\n )\n\n const shouldSubscribe = !isRestoring && options.subscribed !== false\n React.useSyncExternalStore(\n React.useCallback(\n (onStoreChange) =>\n shouldSubscribe\n ? observer.subscribe(notifyManager.batchCalls(onStoreChange))\n : noop,\n [observer, shouldSubscribe],\n ),\n () => observer.getCurrentResult(),\n () => observer.getCurrentResult(),\n )\n\n React.useEffect(() => {\n observer.setQueries(\n defaultedQueries,\n options as QueriesObserverOptions,\n )\n }, [defaultedQueries, options, observer])\n\n const shouldAtLeastOneSuspend = optimisticResult.some((result, index) =>\n shouldSuspend(defaultedQueries[index], result),\n )\n\n const suspensePromises = shouldAtLeastOneSuspend\n ? optimisticResult.flatMap((result, index) => {\n const opts = defaultedQueries[index]\n\n if (opts && shouldSuspend(opts, result)) {\n const queryObserver = new QueryObserver(client, opts)\n return fetchOptimistic(opts, queryObserver, errorResetBoundary)\n }\n return []\n })\n : []\n\n if (suspensePromises.length > 0) {\n throw Promise.all(suspensePromises)\n }\n const firstSingleResultWhichShouldThrow = optimisticResult.find(\n (result, index) => {\n const query = defaultedQueries[index]\n return (\n query &&\n getHasError({\n result,\n errorResetBoundary,\n throwOnError: query.throwOnError,\n query: client.getQueryCache().get(query.queryHash),\n suspense: query.suspense,\n })\n )\n },\n )\n\n if (firstSingleResultWhichShouldThrow?.error) {\n throw firstSingleResultWhichShouldThrow.error\n }\n\n return getCombinedResult(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BAAU,MAAM;AACpB,aAAS;AAAA,MACP;AAAA,MACA;AAAA,IACF;AAAA,EACF,GAAG,CAAC,kBAAkB,SAAS,QAAQ,CAAC;AAExC,QAAM,0BAA0B,iBAAiB;AAAA,IAAK,CAAC,QAAQ,cAC7D,+BAAc,iBAAiB,KAAK,GAAG,MAAM;AAAA,EAC/C;AAEA,QAAM,mBAAmB,0BACrB,iBAAiB,QAAQ,CAAC,QAAQ,UAAU;AAC1C,UAAM,OAAO,iBAAiB,KAAK;AAEnC,QAAI,YAAQ,+BAAc,MAAM,MAAM,GAAG;AACvC,YAAM,gBAAgB,IAAI,gCAAc,QAAQ,IAAI;AACpD,iBAAO,iCAAgB,MAAM,eAAe,kBAAkB;AAAA,IAChE;AACA,WAAO,CAAC;AAAA,EACV,CAAC,IACD,CAAC;AAEL,MAAI,iBAAiB,SAAS,GAAG;AAC/B,UAAM,QAAQ,IAAI,gBAAgB;AAAA,EACpC;AACA,QAAM,oCAAoC,iBAAiB;AAAA,IACzD,CAAC,QAAQ,UAAU;AACjB,YAAM,QAAQ,iBAAiB,KAAK;AACpC,aACE,aACA,uCAAY;AAAA,QACV;AAAA,QACA;AAAA,QACA,cAAc,MAAM;AAAA,QACpB,OAAO,OAAO,cAAc,EAAE,IAAI,MAAM,SAAS;AAAA,QACjD,UAAU,MAAM;AAAA,MAClB,CAAC;AAAA,IAEL;AAAA,EACF;AAEA,MAAI,mCAAmC,OAAO;AAC5C,UAAM,kCAAkC;AAAA,EAC1C;AAEA,SAAO,kBAAkB,YAAY,CAAC;AACxC;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/useQueries.d.cts b/node_modules/@tanstack/react-query/build/modern/useQueries.d.cts new file mode 100644 index 0000000..bf88750 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/modern/useQueries.d.cts @@ -0,0 +1,76 @@ +import { UseQueryOptions, UseQueryResult, DefinedUseQueryResult } from './types.cjs'; +import { DefaultError, QueryKey, OmitKeyof, QueriesPlaceholderDataFunction, QueryFunction, ThrowOnError, QueryClient } from '@tanstack/query-core'; + +type UseQueryOptionsForUseQueries = OmitKeyof, 'placeholderData' | 'subscribed'> & { + placeholderData?: TQueryFnData | QueriesPlaceholderDataFunction; +}; +type MAXIMUM_DEPTH = 20; +type SkipTokenForUseQueries = symbol; +type GetUseQueryOptionsForUseQueries = T extends { + queryFnData: infer TQueryFnData; + error?: infer TError; + data: infer TData; +} ? UseQueryOptionsForUseQueries : T extends { + queryFnData: infer TQueryFnData; + error?: infer TError; +} ? UseQueryOptionsForUseQueries : T extends { + data: infer TData; + error?: infer TError; +} ? UseQueryOptionsForUseQueries : T extends [infer TQueryFnData, infer TError, infer TData] ? UseQueryOptionsForUseQueries : T extends [infer TQueryFnData, infer TError] ? UseQueryOptionsForUseQueries : T extends [infer TQueryFnData] ? UseQueryOptionsForUseQueries : T extends { + queryFn?: QueryFunction | SkipTokenForUseQueries; + select?: (data: any) => infer TData; + throwOnError?: ThrowOnError; +} ? UseQueryOptionsForUseQueries : UseQueryOptionsForUseQueries; +type GetDefinedOrUndefinedQueryResult = T extends { + initialData?: infer TInitialData; +} ? unknown extends TInitialData ? UseQueryResult : TInitialData extends TData ? DefinedUseQueryResult : TInitialData extends () => infer TInitialDataResult ? unknown extends TInitialDataResult ? UseQueryResult : TInitialDataResult extends TData ? DefinedUseQueryResult : UseQueryResult : UseQueryResult : UseQueryResult; +type GetUseQueryResult = T extends { + queryFnData: any; + error?: infer TError; + data: infer TData; +} ? GetDefinedOrUndefinedQueryResult : T extends { + queryFnData: infer TQueryFnData; + error?: infer TError; +} ? GetDefinedOrUndefinedQueryResult : T extends { + data: infer TData; + error?: infer TError; +} ? GetDefinedOrUndefinedQueryResult : T extends [any, infer TError, infer TData] ? GetDefinedOrUndefinedQueryResult : T extends [infer TQueryFnData, infer TError] ? GetDefinedOrUndefinedQueryResult : T extends [infer TQueryFnData] ? GetDefinedOrUndefinedQueryResult : T extends { + queryFn?: QueryFunction | SkipTokenForUseQueries; + select?: (data: any) => infer TData; + throwOnError?: ThrowOnError; +} ? GetDefinedOrUndefinedQueryResult : UseQueryResult; +/** + * QueriesOptions reducer recursively unwraps function arguments to infer/enforce type param + */ +type QueriesOptions, TResults extends Array = [], TDepth extends ReadonlyArray = []> = TDepth['length'] extends MAXIMUM_DEPTH ? Array : T extends [] ? [] : T extends [infer Head] ? [...TResults, GetUseQueryOptionsForUseQueries] : T extends [infer Head, ...infer Tails] ? QueriesOptions<[ + ...Tails +], [ + ...TResults, + GetUseQueryOptionsForUseQueries +], [ + ...TDepth, + 1 +]> : ReadonlyArray extends T ? T : T extends Array> ? Array> : Array; +/** + * QueriesResults reducer recursively maps type param to results + */ +type QueriesResults, TResults extends Array = [], TDepth extends ReadonlyArray = []> = TDepth['length'] extends MAXIMUM_DEPTH ? Array : T extends [] ? [] : T extends [infer Head] ? [...TResults, GetUseQueryResult] : T extends [infer Head, ...infer Tails] ? QueriesResults<[ + ...Tails +], [ + ...TResults, + GetUseQueryResult +], [ + ...TDepth, + 1 +]> : { + [K in keyof T]: GetUseQueryResult; +}; +declare function useQueries, TCombinedResult = QueriesResults>({ queries, ...options }: { + queries: readonly [...QueriesOptions] | readonly [...{ + [K in keyof T]: GetUseQueryOptionsForUseQueries; + }]; + combine?: (result: QueriesResults) => TCombinedResult; + subscribed?: boolean; +}, queryClient?: QueryClient): TCombinedResult; + +export { type QueriesOptions, type QueriesResults, useQueries }; diff --git a/node_modules/@tanstack/react-query/build/modern/useQueries.d.ts b/node_modules/@tanstack/react-query/build/modern/useQueries.d.ts new file mode 100644 index 0000000..2311f83 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/modern/useQueries.d.ts @@ -0,0 +1,76 @@ +import { UseQueryOptions, UseQueryResult, DefinedUseQueryResult } from './types.js'; +import { DefaultError, QueryKey, OmitKeyof, QueriesPlaceholderDataFunction, QueryFunction, ThrowOnError, QueryClient } from '@tanstack/query-core'; + +type UseQueryOptionsForUseQueries = OmitKeyof, 'placeholderData' | 'subscribed'> & { + placeholderData?: TQueryFnData | QueriesPlaceholderDataFunction; +}; +type MAXIMUM_DEPTH = 20; +type SkipTokenForUseQueries = symbol; +type GetUseQueryOptionsForUseQueries = T extends { + queryFnData: infer TQueryFnData; + error?: infer TError; + data: infer TData; +} ? UseQueryOptionsForUseQueries : T extends { + queryFnData: infer TQueryFnData; + error?: infer TError; +} ? UseQueryOptionsForUseQueries : T extends { + data: infer TData; + error?: infer TError; +} ? UseQueryOptionsForUseQueries : T extends [infer TQueryFnData, infer TError, infer TData] ? UseQueryOptionsForUseQueries : T extends [infer TQueryFnData, infer TError] ? UseQueryOptionsForUseQueries : T extends [infer TQueryFnData] ? UseQueryOptionsForUseQueries : T extends { + queryFn?: QueryFunction | SkipTokenForUseQueries; + select?: (data: any) => infer TData; + throwOnError?: ThrowOnError; +} ? UseQueryOptionsForUseQueries : UseQueryOptionsForUseQueries; +type GetDefinedOrUndefinedQueryResult = T extends { + initialData?: infer TInitialData; +} ? unknown extends TInitialData ? UseQueryResult : TInitialData extends TData ? DefinedUseQueryResult : TInitialData extends () => infer TInitialDataResult ? unknown extends TInitialDataResult ? UseQueryResult : TInitialDataResult extends TData ? DefinedUseQueryResult : UseQueryResult : UseQueryResult : UseQueryResult; +type GetUseQueryResult = T extends { + queryFnData: any; + error?: infer TError; + data: infer TData; +} ? GetDefinedOrUndefinedQueryResult : T extends { + queryFnData: infer TQueryFnData; + error?: infer TError; +} ? GetDefinedOrUndefinedQueryResult : T extends { + data: infer TData; + error?: infer TError; +} ? GetDefinedOrUndefinedQueryResult : T extends [any, infer TError, infer TData] ? GetDefinedOrUndefinedQueryResult : T extends [infer TQueryFnData, infer TError] ? GetDefinedOrUndefinedQueryResult : T extends [infer TQueryFnData] ? GetDefinedOrUndefinedQueryResult : T extends { + queryFn?: QueryFunction | SkipTokenForUseQueries; + select?: (data: any) => infer TData; + throwOnError?: ThrowOnError; +} ? GetDefinedOrUndefinedQueryResult : UseQueryResult; +/** + * QueriesOptions reducer recursively unwraps function arguments to infer/enforce type param + */ +type QueriesOptions, TResults extends Array = [], TDepth extends ReadonlyArray = []> = TDepth['length'] extends MAXIMUM_DEPTH ? Array : T extends [] ? [] : T extends [infer Head] ? [...TResults, GetUseQueryOptionsForUseQueries] : T extends [infer Head, ...infer Tails] ? QueriesOptions<[ + ...Tails +], [ + ...TResults, + GetUseQueryOptionsForUseQueries +], [ + ...TDepth, + 1 +]> : ReadonlyArray extends T ? T : T extends Array> ? Array> : Array; +/** + * QueriesResults reducer recursively maps type param to results + */ +type QueriesResults, TResults extends Array = [], TDepth extends ReadonlyArray = []> = TDepth['length'] extends MAXIMUM_DEPTH ? Array : T extends [] ? [] : T extends [infer Head] ? [...TResults, GetUseQueryResult] : T extends [infer Head, ...infer Tails] ? QueriesResults<[ + ...Tails +], [ + ...TResults, + GetUseQueryResult +], [ + ...TDepth, + 1 +]> : { + [K in keyof T]: GetUseQueryResult; +}; +declare function useQueries, TCombinedResult = QueriesResults>({ queries, ...options }: { + queries: readonly [...QueriesOptions] | readonly [...{ + [K in keyof T]: GetUseQueryOptionsForUseQueries; + }]; + combine?: (result: QueriesResults) => TCombinedResult; + subscribed?: boolean; +}, queryClient?: QueryClient): TCombinedResult; + +export { type QueriesOptions, type QueriesResults, useQueries }; diff --git a/node_modules/@tanstack/react-query/build/modern/useQueries.js b/node_modules/@tanstack/react-query/build/modern/useQueries.js new file mode 100644 index 0000000..ec7ba7d --- /dev/null +++ b/node_modules/@tanstack/react-query/build/modern/useQueries.js @@ -0,0 +1,107 @@ +"use client"; + +// src/useQueries.ts +import * as React from "react"; +import { + QueriesObserver, + QueryObserver, + noop, + notifyManager +} from "@tanstack/query-core"; +import { useQueryClient } from "./QueryClientProvider.js"; +import { useIsRestoring } from "./IsRestoringProvider.js"; +import { useQueryErrorResetBoundary } from "./QueryErrorResetBoundary.js"; +import { + ensurePreventErrorBoundaryRetry, + getHasError, + useClearResetErrorBoundary +} from "./errorBoundaryUtils.js"; +import { + ensureSuspenseTimers, + fetchOptimistic, + shouldSuspend +} from "./suspense.js"; +function useQueries({ + queries, + ...options +}, queryClient) { + const client = useQueryClient(queryClient); + const isRestoring = useIsRestoring(); + const errorResetBoundary = useQueryErrorResetBoundary(); + const defaultedQueries = React.useMemo( + () => queries.map((opts) => { + const defaultedOptions = client.defaultQueryOptions( + opts + ); + defaultedOptions._optimisticResults = isRestoring ? "isRestoring" : "optimistic"; + return defaultedOptions; + }), + [queries, client, isRestoring] + ); + defaultedQueries.forEach((queryOptions) => { + ensureSuspenseTimers(queryOptions); + const query = client.getQueryCache().get(queryOptions.queryHash); + ensurePreventErrorBoundaryRetry(queryOptions, errorResetBoundary, query); + }); + useClearResetErrorBoundary(errorResetBoundary); + const [observer] = React.useState( + () => new QueriesObserver( + client, + defaultedQueries, + options + ) + ); + const [optimisticResult, getCombinedResult, trackResult] = observer.getOptimisticResult( + defaultedQueries, + options.combine + ); + const shouldSubscribe = !isRestoring && options.subscribed !== false; + React.useSyncExternalStore( + React.useCallback( + (onStoreChange) => shouldSubscribe ? observer.subscribe(notifyManager.batchCalls(onStoreChange)) : noop, + [observer, shouldSubscribe] + ), + () => observer.getCurrentResult(), + () => observer.getCurrentResult() + ); + React.useEffect(() => { + observer.setQueries( + defaultedQueries, + options + ); + }, [defaultedQueries, options, observer]); + const shouldAtLeastOneSuspend = optimisticResult.some( + (result, index) => shouldSuspend(defaultedQueries[index], result) + ); + const suspensePromises = shouldAtLeastOneSuspend ? optimisticResult.flatMap((result, index) => { + const opts = defaultedQueries[index]; + if (opts && shouldSuspend(opts, result)) { + const queryObserver = new QueryObserver(client, opts); + return fetchOptimistic(opts, queryObserver, errorResetBoundary); + } + return []; + }) : []; + if (suspensePromises.length > 0) { + throw Promise.all(suspensePromises); + } + const firstSingleResultWhichShouldThrow = optimisticResult.find( + (result, index) => { + const query = defaultedQueries[index]; + return query && getHasError({ + result, + errorResetBoundary, + throwOnError: query.throwOnError, + query: client.getQueryCache().get(query.queryHash), + suspense: query.suspense + }); + } + ); + if (firstSingleResultWhichShouldThrow?.error) { + throw firstSingleResultWhichShouldThrow.error; + } + return getCombinedResult(trackResult()); +} +export { + useQueries +}; +//# sourceMappingURL=useQueries.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/useQueries.js.map b/node_modules/@tanstack/react-query/build/modern/useQueries.js.map new file mode 100644 index 0000000..5aca456 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/modern/useQueries.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/useQueries.ts"],"sourcesContent":["'use client'\nimport * as React from 'react'\n\nimport {\n QueriesObserver,\n QueryObserver,\n noop,\n notifyManager,\n} from '@tanstack/query-core'\nimport { useQueryClient } from './QueryClientProvider'\nimport { useIsRestoring } from './IsRestoringProvider'\nimport { useQueryErrorResetBoundary } from './QueryErrorResetBoundary'\nimport {\n ensurePreventErrorBoundaryRetry,\n getHasError,\n useClearResetErrorBoundary,\n} from './errorBoundaryUtils'\nimport {\n ensureSuspenseTimers,\n fetchOptimistic,\n shouldSuspend,\n} from './suspense'\nimport type {\n DefinedUseQueryResult,\n UseQueryOptions,\n UseQueryResult,\n} from './types'\nimport type {\n DefaultError,\n OmitKeyof,\n QueriesObserverOptions,\n QueriesPlaceholderDataFunction,\n QueryClient,\n QueryFunction,\n QueryKey,\n QueryObserverOptions,\n ThrowOnError,\n} from '@tanstack/query-core'\n\n// This defines the `UseQueryOptions` that are accepted in `QueriesOptions` & `GetOptions`.\n// `placeholderData` function always gets undefined passed\ntype UseQueryOptionsForUseQueries<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> = OmitKeyof<\n UseQueryOptions,\n 'placeholderData' | 'subscribed'\n> & {\n placeholderData?: TQueryFnData | QueriesPlaceholderDataFunction\n}\n\n// Avoid TS depth-limit error in case of large array literal\ntype MAXIMUM_DEPTH = 20\n\n// Widen the type of the symbol to enable type inference even if skipToken is not immutable.\ntype SkipTokenForUseQueries = symbol\n\ntype GetUseQueryOptionsForUseQueries =\n // Part 1: responsible for applying explicit type parameter to function arguments, if object { queryFnData: TQueryFnData, error: TError, data: TData }\n T extends {\n queryFnData: infer TQueryFnData\n error?: infer TError\n data: infer TData\n }\n ? UseQueryOptionsForUseQueries\n : T extends { queryFnData: infer TQueryFnData; error?: infer TError }\n ? UseQueryOptionsForUseQueries\n : T extends { data: infer TData; error?: infer TError }\n ? UseQueryOptionsForUseQueries\n : // Part 2: responsible for applying explicit type parameter to function arguments, if tuple [TQueryFnData, TError, TData]\n T extends [infer TQueryFnData, infer TError, infer TData]\n ? UseQueryOptionsForUseQueries\n : T extends [infer TQueryFnData, infer TError]\n ? UseQueryOptionsForUseQueries\n : T extends [infer TQueryFnData]\n ? UseQueryOptionsForUseQueries\n : // Part 3: responsible for inferring and enforcing type if no explicit parameter was provided\n T extends {\n queryFn?:\n | QueryFunction\n | SkipTokenForUseQueries\n select?: (data: any) => infer TData\n throwOnError?: ThrowOnError\n }\n ? UseQueryOptionsForUseQueries<\n TQueryFnData,\n unknown extends TError ? DefaultError : TError,\n unknown extends TData ? TQueryFnData : TData,\n TQueryKey\n >\n : // Fallback\n UseQueryOptionsForUseQueries\n\n// A defined initialData setting should return a DefinedUseQueryResult rather than UseQueryResult\ntype GetDefinedOrUndefinedQueryResult = T extends {\n initialData?: infer TInitialData\n}\n ? unknown extends TInitialData\n ? UseQueryResult\n : TInitialData extends TData\n ? DefinedUseQueryResult\n : TInitialData extends () => infer TInitialDataResult\n ? unknown extends TInitialDataResult\n ? UseQueryResult\n : TInitialDataResult extends TData\n ? DefinedUseQueryResult\n : UseQueryResult\n : UseQueryResult\n : UseQueryResult\n\ntype GetUseQueryResult =\n // Part 1: responsible for mapping explicit type parameter to function result, if object\n T extends { queryFnData: any; error?: infer TError; data: infer TData }\n ? GetDefinedOrUndefinedQueryResult\n : T extends { queryFnData: infer TQueryFnData; error?: infer TError }\n ? GetDefinedOrUndefinedQueryResult\n : T extends { data: infer TData; error?: infer TError }\n ? GetDefinedOrUndefinedQueryResult\n : // Part 2: responsible for mapping explicit type parameter to function result, if tuple\n T extends [any, infer TError, infer TData]\n ? GetDefinedOrUndefinedQueryResult\n : T extends [infer TQueryFnData, infer TError]\n ? GetDefinedOrUndefinedQueryResult\n : T extends [infer TQueryFnData]\n ? GetDefinedOrUndefinedQueryResult\n : // Part 3: responsible for mapping inferred type to results, if no explicit parameter was provided\n T extends {\n queryFn?:\n | QueryFunction\n | SkipTokenForUseQueries\n select?: (data: any) => infer TData\n throwOnError?: ThrowOnError\n }\n ? GetDefinedOrUndefinedQueryResult<\n T,\n unknown extends TData ? TQueryFnData : TData,\n unknown extends TError ? DefaultError : TError\n >\n : // Fallback\n UseQueryResult\n\n/**\n * QueriesOptions reducer recursively unwraps function arguments to infer/enforce type param\n */\nexport type QueriesOptions<\n T extends Array,\n TResults extends Array = [],\n TDepth extends ReadonlyArray = [],\n> = TDepth['length'] extends MAXIMUM_DEPTH\n ? Array\n : T extends []\n ? []\n : T extends [infer Head]\n ? [...TResults, GetUseQueryOptionsForUseQueries]\n : T extends [infer Head, ...infer Tails]\n ? QueriesOptions<\n [...Tails],\n [...TResults, GetUseQueryOptionsForUseQueries],\n [...TDepth, 1]\n >\n : ReadonlyArray extends T\n ? T\n : // If T is *some* array but we couldn't assign unknown[] to it, then it must hold some known/homogenous type!\n // use this to infer the param types in the case of Array.map() argument\n T extends Array<\n UseQueryOptionsForUseQueries<\n infer TQueryFnData,\n infer TError,\n infer TData,\n infer TQueryKey\n >\n >\n ? Array<\n UseQueryOptionsForUseQueries<\n TQueryFnData,\n TError,\n TData,\n TQueryKey\n >\n >\n : // Fallback\n Array\n\n/**\n * QueriesResults reducer recursively maps type param to results\n */\nexport type QueriesResults<\n T extends Array,\n TResults extends Array = [],\n TDepth extends ReadonlyArray = [],\n> = TDepth['length'] extends MAXIMUM_DEPTH\n ? Array\n : T extends []\n ? []\n : T extends [infer Head]\n ? [...TResults, GetUseQueryResult]\n : T extends [infer Head, ...infer Tails]\n ? QueriesResults<\n [...Tails],\n [...TResults, GetUseQueryResult],\n [...TDepth, 1]\n >\n : { [K in keyof T]: GetUseQueryResult }\n\nexport function useQueries<\n T extends Array,\n TCombinedResult = QueriesResults,\n>(\n {\n queries,\n ...options\n }: {\n queries:\n | readonly [...QueriesOptions]\n | readonly [...{ [K in keyof T]: GetUseQueryOptionsForUseQueries }]\n combine?: (result: QueriesResults) => TCombinedResult\n subscribed?: boolean\n },\n queryClient?: QueryClient,\n): TCombinedResult {\n const client = useQueryClient(queryClient)\n const isRestoring = useIsRestoring()\n const errorResetBoundary = useQueryErrorResetBoundary()\n\n const defaultedQueries = React.useMemo(\n () =>\n queries.map((opts) => {\n const defaultedOptions = client.defaultQueryOptions(\n opts as QueryObserverOptions,\n )\n\n // Make sure the results are already in fetching state before subscribing or updating options\n defaultedOptions._optimisticResults = isRestoring\n ? 'isRestoring'\n : 'optimistic'\n\n return defaultedOptions\n }),\n [queries, client, isRestoring],\n )\n\n defaultedQueries.forEach((queryOptions) => {\n ensureSuspenseTimers(queryOptions)\n const query = client.getQueryCache().get(queryOptions.queryHash)\n ensurePreventErrorBoundaryRetry(queryOptions, errorResetBoundary, query)\n })\n\n useClearResetErrorBoundary(errorResetBoundary)\n\n const [observer] = React.useState(\n () =>\n new QueriesObserver(\n client,\n defaultedQueries,\n options as QueriesObserverOptions,\n ),\n )\n\n // note: this must be called before useSyncExternalStore\n const [optimisticResult, getCombinedResult, trackResult] =\n observer.getOptimisticResult(\n defaultedQueries,\n (options as QueriesObserverOptions).combine,\n )\n\n const shouldSubscribe = !isRestoring && options.subscribed !== false\n React.useSyncExternalStore(\n React.useCallback(\n (onStoreChange) =>\n shouldSubscribe\n ? observer.subscribe(notifyManager.batchCalls(onStoreChange))\n : noop,\n [observer, shouldSubscribe],\n ),\n () => observer.getCurrentResult(),\n () => observer.getCurrentResult(),\n )\n\n React.useEffect(() => {\n observer.setQueries(\n defaultedQueries,\n options as QueriesObserverOptions,\n )\n }, [defaultedQueries, options, observer])\n\n const shouldAtLeastOneSuspend = optimisticResult.some((result, index) =>\n shouldSuspend(defaultedQueries[index], result),\n )\n\n const suspensePromises = shouldAtLeastOneSuspend\n ? optimisticResult.flatMap((result, index) => {\n const opts = defaultedQueries[index]\n\n if (opts && shouldSuspend(opts, result)) {\n const queryObserver = new QueryObserver(client, opts)\n return fetchOptimistic(opts, queryObserver, errorResetBoundary)\n }\n return []\n })\n : []\n\n if (suspensePromises.length > 0) {\n throw Promise.all(suspensePromises)\n }\n const firstSingleResultWhichShouldThrow = optimisticResult.find(\n (result, index) => {\n const query = defaultedQueries[index]\n return (\n query &&\n getHasError({\n result,\n errorResetBoundary,\n throwOnError: query.throwOnError,\n query: client.getQueryCache().get(query.queryHash),\n suspense: query.suspense,\n })\n )\n },\n )\n\n if (firstSingleResultWhichShouldThrow?.error) {\n throw firstSingleResultWhichShouldThrow.error\n }\n\n return getCombinedResult(trackResult())\n}\n"],"mappings":";;;AACA,YAAY,WAAW;AAEvB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,sBAAsB;AAC/B,SAAS,sBAAsB;AAC/B,SAAS,kCAAkC;AAC3C;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAyLA,SAAS,WAId;AAAA,EACE;AAAA,EACA,GAAG;AACL,GAOA,aACiB;AACjB,QAAM,SAAS,eAAe,WAAW;AACzC,QAAM,cAAc,eAAe;AACnC,QAAM,qBAAqB,2BAA2B;AAEtD,QAAM,mBAAyB;AAAA,IAC7B,MACE,QAAQ,IAAI,CAAC,SAAS;AACpB,YAAM,mBAAmB,OAAO;AAAA,QAC9B;AAAA,MACF;AAGA,uBAAiB,qBAAqB,cAClC,gBACA;AAEJ,aAAO;AAAA,IACT,CAAC;AAAA,IACH,CAAC,SAAS,QAAQ,WAAW;AAAA,EAC/B;AAEA,mBAAi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AACA,QAAM,oCAAoC,iBAAiB;AAAA,IACzD,CAAC,QAAQ,UAAU;AACjB,YAAM,QAAQ,iBAAiB,KAAK;AACpC,aACE,SACA,YAAY;AAAA,QACV;AAAA,QACA;AAAA,QACA,cAAc,MAAM;AAAA,QACpB,OAAO,OAAO,cAAc,EAAE,IAAI,MAAM,SAAS;AAAA,QACjD,UAAU,MAAM;AAAA,MAClB,CAAC;AAAA,IAEL;AAAA,EACF;AAEA,MAAI,mCAAmC,OAAO;AAC5C,UAAM,kCAAkC;AAAA,EAC1C;AAEA,SAAO,kBAAkB,YAAY,CAAC;AACxC;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/useQuery.cjs b/node_modules/@tanstack/react-query/build/modern/useQuery.cjs new file mode 100644 index 0000000..993525b --- /dev/null +++ b/node_modules/@tanstack/react-query/build/modern/useQuery.cjs @@ -0,0 +1,36 @@ +"use strict"; +"use client"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/useQuery.ts +var useQuery_exports = {}; +__export(useQuery_exports, { + useQuery: () => useQuery +}); +module.exports = __toCommonJS(useQuery_exports); +var import_query_core = require("@tanstack/query-core"); +var import_useBaseQuery = require("./useBaseQuery.cjs"); +function useQuery(options, queryClient) { + return (0, import_useBaseQuery.useBaseQuery)(options, import_query_core.QueryObserver, queryClient); +} +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + useQuery +}); +//# sourceMappingURL=useQuery.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/useQuery.cjs.map b/node_modules/@tanstack/react-query/build/modern/useQuery.cjs.map new file mode 100644 index 0000000..4b0a996 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/modern/useQuery.cjs.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/useQuery.ts"],"sourcesContent":["'use client'\nimport { QueryObserver } from '@tanstack/query-core'\nimport { useBaseQuery } from './useBaseQuery'\nimport type {\n DefaultError,\n NoInfer,\n QueryClient,\n QueryKey,\n} from '@tanstack/query-core'\nimport type {\n DefinedUseQueryResult,\n UseQueryOptions,\n UseQueryResult,\n} from './types'\nimport type {\n DefinedInitialDataOptions,\n UndefinedInitialDataOptions,\n} from './queryOptions'\n\nexport function useQuery<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n options: DefinedInitialDataOptions,\n queryClient?: QueryClient,\n): DefinedUseQueryResult, TError>\n\nexport function useQuery<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n options: UndefinedInitialDataOptions,\n queryClient?: QueryClient,\n): UseQueryResult, TError>\n\nexport function useQuery<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n options: UseQueryOptions,\n queryClient?: QueryClient,\n): UseQueryResult, TError>\n\nexport function useQuery(options: UseQueryOptions, queryClient?: QueryClient) {\n return useBaseQuery(options, QueryObserver, queryClient)\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,wBAA8B;AAC9B,0BAA6B;AA+CtB,SAAS,SAAS,SAA0B,aAA2B;AAC5E,aAAO,kCAAa,SAAS,iCAAe,WAAW;AACzD;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/useQuery.d.cts b/node_modules/@tanstack/react-query/build/modern/useQuery.d.cts new file mode 100644 index 0000000..da16840 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/modern/useQuery.d.cts @@ -0,0 +1,9 @@ +import { DefaultError, QueryKey, QueryClient, NoInfer } from '@tanstack/query-core'; +import { DefinedUseQueryResult, UseQueryResult, UseQueryOptions } from './types.cjs'; +import { DefinedInitialDataOptions, UndefinedInitialDataOptions } from './queryOptions.cjs'; + +declare function useQuery(options: DefinedInitialDataOptions, queryClient?: QueryClient): DefinedUseQueryResult, TError>; +declare function useQuery(options: UndefinedInitialDataOptions, queryClient?: QueryClient): UseQueryResult, TError>; +declare function useQuery(options: UseQueryOptions, queryClient?: QueryClient): UseQueryResult, TError>; + +export { useQuery }; diff --git a/node_modules/@tanstack/react-query/build/modern/useQuery.d.ts b/node_modules/@tanstack/react-query/build/modern/useQuery.d.ts new file mode 100644 index 0000000..72bc861 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/modern/useQuery.d.ts @@ -0,0 +1,9 @@ +import { DefaultError, QueryKey, QueryClient, NoInfer } from '@tanstack/query-core'; +import { DefinedUseQueryResult, UseQueryResult, UseQueryOptions } from './types.js'; +import { DefinedInitialDataOptions, UndefinedInitialDataOptions } from './queryOptions.js'; + +declare function useQuery(options: DefinedInitialDataOptions, queryClient?: QueryClient): DefinedUseQueryResult, TError>; +declare function useQuery(options: UndefinedInitialDataOptions, queryClient?: QueryClient): UseQueryResult, TError>; +declare function useQuery(options: UseQueryOptions, queryClient?: QueryClient): UseQueryResult, TError>; + +export { useQuery }; diff --git a/node_modules/@tanstack/react-query/build/modern/useQuery.js b/node_modules/@tanstack/react-query/build/modern/useQuery.js new file mode 100644 index 0000000..6173d62 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/modern/useQuery.js @@ -0,0 +1,12 @@ +"use client"; + +// src/useQuery.ts +import { QueryObserver } from "@tanstack/query-core"; +import { useBaseQuery } from "./useBaseQuery.js"; +function useQuery(options, queryClient) { + return useBaseQuery(options, QueryObserver, queryClient); +} +export { + useQuery +}; +//# sourceMappingURL=useQuery.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/useQuery.js.map b/node_modules/@tanstack/react-query/build/modern/useQuery.js.map new file mode 100644 index 0000000..3f4f63f --- /dev/null +++ b/node_modules/@tanstack/react-query/build/modern/useQuery.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/useQuery.ts"],"sourcesContent":["'use client'\nimport { QueryObserver } from '@tanstack/query-core'\nimport { useBaseQuery } from './useBaseQuery'\nimport type {\n DefaultError,\n NoInfer,\n QueryClient,\n QueryKey,\n} from '@tanstack/query-core'\nimport type {\n DefinedUseQueryResult,\n UseQueryOptions,\n UseQueryResult,\n} from './types'\nimport type {\n DefinedInitialDataOptions,\n UndefinedInitialDataOptions,\n} from './queryOptions'\n\nexport function useQuery<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n options: DefinedInitialDataOptions,\n queryClient?: QueryClient,\n): DefinedUseQueryResult, TError>\n\nexport function useQuery<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n options: UndefinedInitialDataOptions,\n queryClient?: QueryClient,\n): UseQueryResult, TError>\n\nexport function useQuery<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n options: UseQueryOptions,\n queryClient?: QueryClient,\n): UseQueryResult, TError>\n\nexport function useQuery(options: UseQueryOptions, queryClient?: QueryClient) {\n return useBaseQuery(options, QueryObserver, queryClient)\n}\n"],"mappings":";;;AACA,SAAS,qBAAqB;AAC9B,SAAS,oBAAoB;AA+CtB,SAAS,SAAS,SAA0B,aAA2B;AAC5E,SAAO,aAAa,SAAS,eAAe,WAAW;AACzD;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/useSuspenseInfiniteQuery.cjs b/node_modules/@tanstack/react-query/build/modern/useSuspenseInfiniteQuery.cjs new file mode 100644 index 0000000..1d06bb1 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/modern/useSuspenseInfiniteQuery.cjs @@ -0,0 +1,51 @@ +"use strict"; +"use client"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/useSuspenseInfiniteQuery.ts +var useSuspenseInfiniteQuery_exports = {}; +__export(useSuspenseInfiniteQuery_exports, { + useSuspenseInfiniteQuery: () => useSuspenseInfiniteQuery +}); +module.exports = __toCommonJS(useSuspenseInfiniteQuery_exports); +var import_query_core = require("@tanstack/query-core"); +var import_useBaseQuery = require("./useBaseQuery.cjs"); +var import_suspense = require("./suspense.cjs"); +function useSuspenseInfiniteQuery(options, queryClient) { + if (process.env.NODE_ENV !== "production") { + if (options.queryFn === import_query_core.skipToken) { + console.error("skipToken is not allowed for useSuspenseInfiniteQuery"); + } + } + return (0, import_useBaseQuery.useBaseQuery)( + { + ...options, + enabled: true, + suspense: true, + throwOnError: import_suspense.defaultThrowOnError + }, + import_query_core.InfiniteQueryObserver, + queryClient + ); +} +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + useSuspenseInfiniteQuery +}); +//# sourceMappingURL=useSuspenseInfiniteQuery.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/useSuspenseInfiniteQuery.cjs.map b/node_modules/@tanstack/react-query/build/modern/useSuspenseInfiniteQuery.cjs.map new file mode 100644 index 0000000..98d9c0b --- /dev/null +++ b/node_modules/@tanstack/react-query/build/modern/useSuspenseInfiniteQuery.cjs.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/useSuspenseInfiniteQuery.ts"],"sourcesContent":["'use client'\nimport { InfiniteQueryObserver, skipToken } from '@tanstack/query-core'\nimport { useBaseQuery } from './useBaseQuery'\nimport { defaultThrowOnError } from './suspense'\nimport type {\n DefaultError,\n InfiniteData,\n InfiniteQueryObserverSuccessResult,\n QueryClient,\n QueryKey,\n QueryObserver,\n} from '@tanstack/query-core'\nimport type {\n UseSuspenseInfiniteQueryOptions,\n UseSuspenseInfiniteQueryResult,\n} from './types'\n\nexport function useSuspenseInfiniteQuery<\n TQueryFnData,\n TError = DefaultError,\n TData = InfiniteData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n>(\n options: UseSuspenseInfiniteQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n queryClient?: QueryClient,\n): UseSuspenseInfiniteQueryResult {\n if (process.env.NODE_ENV !== 'production') {\n if ((options.queryFn as any) === skipToken) {\n console.error('skipToken is not allowed for useSuspenseInfiniteQuery')\n }\n }\n\n return useBaseQuery(\n {\n ...options,\n enabled: true,\n suspense: true,\n throwOnError: defaultThrowOnError,\n },\n InfiniteQueryObserver as typeof QueryObserver,\n queryClient,\n ) as InfiniteQueryObserverSuccessResult\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,wBAAiD;AACjD,0BAA6B;AAC7B,sBAAoC;AAc7B,SAAS,yBAOd,SAOA,aAC+C;AAC/C,MAAI,QAAQ,IAAI,aAAa,cAAc;AACzC,QAAK,QAAQ,YAAoB,6BAAW;AAC1C,cAAQ,MAAM,uDAAuD;AAAA,IACvE;AAAA,EACF;AAEA,aAAO;AAAA,IACL;AAAA,MACE,GAAG;AAAA,MACH,SAAS;AAAA,MACT,UAAU;AAAA,MACV,cAAc;AAAA,IAChB;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/useSuspenseInfiniteQuery.d.cts b/node_modules/@tanstack/react-query/build/modern/useSuspenseInfiniteQuery.d.cts new file mode 100644 index 0000000..e056e82 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/modern/useSuspenseInfiniteQuery.d.cts @@ -0,0 +1,6 @@ +import { DefaultError, InfiniteData, QueryKey, QueryClient } from '@tanstack/query-core'; +import { UseSuspenseInfiniteQueryOptions, UseSuspenseInfiniteQueryResult } from './types.cjs'; + +declare function useSuspenseInfiniteQuery, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown>(options: UseSuspenseInfiniteQueryOptions, queryClient?: QueryClient): UseSuspenseInfiniteQueryResult; + +export { useSuspenseInfiniteQuery }; diff --git a/node_modules/@tanstack/react-query/build/modern/useSuspenseInfiniteQuery.d.ts b/node_modules/@tanstack/react-query/build/modern/useSuspenseInfiniteQuery.d.ts new file mode 100644 index 0000000..42d7b61 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/modern/useSuspenseInfiniteQuery.d.ts @@ -0,0 +1,6 @@ +import { DefaultError, InfiniteData, QueryKey, QueryClient } from '@tanstack/query-core'; +import { UseSuspenseInfiniteQueryOptions, UseSuspenseInfiniteQueryResult } from './types.js'; + +declare function useSuspenseInfiniteQuery, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown>(options: UseSuspenseInfiniteQueryOptions, queryClient?: QueryClient): UseSuspenseInfiniteQueryResult; + +export { useSuspenseInfiniteQuery }; diff --git a/node_modules/@tanstack/react-query/build/modern/useSuspenseInfiniteQuery.js b/node_modules/@tanstack/react-query/build/modern/useSuspenseInfiniteQuery.js new file mode 100644 index 0000000..7c8facf --- /dev/null +++ b/node_modules/@tanstack/react-query/build/modern/useSuspenseInfiniteQuery.js @@ -0,0 +1,27 @@ +"use client"; + +// src/useSuspenseInfiniteQuery.ts +import { InfiniteQueryObserver, skipToken } from "@tanstack/query-core"; +import { useBaseQuery } from "./useBaseQuery.js"; +import { defaultThrowOnError } from "./suspense.js"; +function useSuspenseInfiniteQuery(options, queryClient) { + if (process.env.NODE_ENV !== "production") { + if (options.queryFn === skipToken) { + console.error("skipToken is not allowed for useSuspenseInfiniteQuery"); + } + } + return useBaseQuery( + { + ...options, + enabled: true, + suspense: true, + throwOnError: defaultThrowOnError + }, + InfiniteQueryObserver, + queryClient + ); +} +export { + useSuspenseInfiniteQuery +}; +//# sourceMappingURL=useSuspenseInfiniteQuery.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/useSuspenseInfiniteQuery.js.map b/node_modules/@tanstack/react-query/build/modern/useSuspenseInfiniteQuery.js.map new file mode 100644 index 0000000..a4937c6 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/modern/useSuspenseInfiniteQuery.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/useSuspenseInfiniteQuery.ts"],"sourcesContent":["'use client'\nimport { InfiniteQueryObserver, skipToken } from '@tanstack/query-core'\nimport { useBaseQuery } from './useBaseQuery'\nimport { defaultThrowOnError } from './suspense'\nimport type {\n DefaultError,\n InfiniteData,\n InfiniteQueryObserverSuccessResult,\n QueryClient,\n QueryKey,\n QueryObserver,\n} from '@tanstack/query-core'\nimport type {\n UseSuspenseInfiniteQueryOptions,\n UseSuspenseInfiniteQueryResult,\n} from './types'\n\nexport function useSuspenseInfiniteQuery<\n TQueryFnData,\n TError = DefaultError,\n TData = InfiniteData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n>(\n options: UseSuspenseInfiniteQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n queryClient?: QueryClient,\n): UseSuspenseInfiniteQueryResult {\n if (process.env.NODE_ENV !== 'production') {\n if ((options.queryFn as any) === skipToken) {\n console.error('skipToken is not allowed for useSuspenseInfiniteQuery')\n }\n }\n\n return useBaseQuery(\n {\n ...options,\n enabled: true,\n suspense: true,\n throwOnError: defaultThrowOnError,\n },\n InfiniteQueryObserver as typeof QueryObserver,\n queryClient,\n ) as InfiniteQueryObserverSuccessResult\n}\n"],"mappings":";;;AACA,SAAS,uBAAuB,iBAAiB;AACjD,SAAS,oBAAoB;AAC7B,SAAS,2BAA2B;AAc7B,SAAS,yBAOd,SAOA,aAC+C;AAC/C,MAAI,QAAQ,IAAI,aAAa,cAAc;AACzC,QAAK,QAAQ,YAAoB,WAAW;AAC1C,cAAQ,MAAM,uDAAuD;AAAA,IACvE;AAAA,EACF;AAEA,SAAO;AAAA,IACL;AAAA,MACE,GAAG;AAAA,MACH,SAAS;AAAA,MACT,UAAU;AAAA,MACV,cAAc;AAAA,IAChB;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/useSuspenseQueries.cjs b/node_modules/@tanstack/react-query/build/modern/useSuspenseQueries.cjs new file mode 100644 index 0000000..75f86ef --- /dev/null +++ b/node_modules/@tanstack/react-query/build/modern/useSuspenseQueries.cjs @@ -0,0 +1,56 @@ +"use strict"; +"use client"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/useSuspenseQueries.ts +var useSuspenseQueries_exports = {}; +__export(useSuspenseQueries_exports, { + useSuspenseQueries: () => useSuspenseQueries +}); +module.exports = __toCommonJS(useSuspenseQueries_exports); +var import_query_core = require("@tanstack/query-core"); +var import_useQueries = require("./useQueries.cjs"); +var import_suspense = require("./suspense.cjs"); +function useSuspenseQueries(options, queryClient) { + return (0, import_useQueries.useQueries)( + { + ...options, + queries: options.queries.map((query) => { + if (process.env.NODE_ENV !== "production") { + if (query.queryFn === import_query_core.skipToken) { + console.error("skipToken is not allowed for useSuspenseQueries"); + } + } + return { + ...query, + suspense: true, + throwOnError: import_suspense.defaultThrowOnError, + enabled: true, + placeholderData: void 0 + }; + }) + }, + queryClient + ); +} +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + useSuspenseQueries +}); +//# sourceMappingURL=useSuspenseQueries.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/useSuspenseQueries.cjs.map b/node_modules/@tanstack/react-query/build/modern/useSuspenseQueries.cjs.map new file mode 100644 index 0000000..f8548ca --- /dev/null +++ b/node_modules/@tanstack/react-query/build/modern/useSuspenseQueries.cjs.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/useSuspenseQueries.ts"],"sourcesContent":["'use client'\nimport { skipToken } from '@tanstack/query-core'\nimport { useQueries } from './useQueries'\nimport { defaultThrowOnError } from './suspense'\nimport type { UseSuspenseQueryOptions, UseSuspenseQueryResult } from './types'\nimport type {\n DefaultError,\n QueryClient,\n QueryFunction,\n ThrowOnError,\n} from '@tanstack/query-core'\n\n// Avoid TS depth-limit error in case of large array literal\ntype MAXIMUM_DEPTH = 20\n\n// Widen the type of the symbol to enable type inference even if skipToken is not immutable.\ntype SkipTokenForUseQueries = symbol\n\ntype GetUseSuspenseQueryOptions =\n // Part 1: responsible for applying explicit type parameter to function arguments, if object { queryFnData: TQueryFnData, error: TError, data: TData }\n T extends {\n queryFnData: infer TQueryFnData\n error?: infer TError\n data: infer TData\n }\n ? UseSuspenseQueryOptions\n : T extends { queryFnData: infer TQueryFnData; error?: infer TError }\n ? UseSuspenseQueryOptions\n : T extends { data: infer TData; error?: infer TError }\n ? UseSuspenseQueryOptions\n : // Part 2: responsible for applying explicit type parameter to function arguments, if tuple [TQueryFnData, TError, TData]\n T extends [infer TQueryFnData, infer TError, infer TData]\n ? UseSuspenseQueryOptions\n : T extends [infer TQueryFnData, infer TError]\n ? UseSuspenseQueryOptions\n : T extends [infer TQueryFnData]\n ? UseSuspenseQueryOptions\n : // Part 3: responsible for inferring and enforcing type if no explicit parameter was provided\n T extends {\n queryFn?:\n | QueryFunction\n | SkipTokenForUseQueries\n select?: (data: any) => infer TData\n throwOnError?: ThrowOnError\n }\n ? UseSuspenseQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey\n >\n : T extends {\n queryFn?:\n | QueryFunction\n | SkipTokenForUseQueries\n throwOnError?: ThrowOnError\n }\n ? UseSuspenseQueryOptions<\n TQueryFnData,\n TError,\n TQueryFnData,\n TQueryKey\n >\n : // Fallback\n UseSuspenseQueryOptions\n\ntype GetUseSuspenseQueryResult =\n // Part 1: responsible for mapping explicit type parameter to function result, if object\n T extends { queryFnData: any; error?: infer TError; data: infer TData }\n ? UseSuspenseQueryResult\n : T extends { queryFnData: infer TQueryFnData; error?: infer TError }\n ? UseSuspenseQueryResult\n : T extends { data: infer TData; error?: infer TError }\n ? UseSuspenseQueryResult\n : // Part 2: responsible for mapping explicit type parameter to function result, if tuple\n T extends [any, infer TError, infer TData]\n ? UseSuspenseQueryResult\n : T extends [infer TQueryFnData, infer TError]\n ? UseSuspenseQueryResult\n : T extends [infer TQueryFnData]\n ? UseSuspenseQueryResult\n : // Part 3: responsible for mapping inferred type to results, if no explicit parameter was provided\n T extends {\n queryFn?:\n | QueryFunction\n | SkipTokenForUseQueries\n select?: (data: any) => infer TData\n throwOnError?: ThrowOnError\n }\n ? UseSuspenseQueryResult<\n unknown extends TData ? TQueryFnData : TData,\n unknown extends TError ? DefaultError : TError\n >\n : T extends {\n queryFn?:\n | QueryFunction\n | SkipTokenForUseQueries\n throwOnError?: ThrowOnError\n }\n ? UseSuspenseQueryResult<\n TQueryFnData,\n unknown extends TError ? DefaultError : TError\n >\n : // Fallback\n UseSuspenseQueryResult\n\n/**\n * SuspenseQueriesOptions reducer recursively unwraps function arguments to infer/enforce type param\n */\nexport type SuspenseQueriesOptions<\n T extends Array,\n TResults extends Array = [],\n TDepth extends ReadonlyArray = [],\n> = TDepth['length'] extends MAXIMUM_DEPTH\n ? Array\n : T extends []\n ? []\n : T extends [infer Head]\n ? [...TResults, GetUseSuspenseQueryOptions]\n : T extends [infer Head, ...infer Tails]\n ? SuspenseQueriesOptions<\n [...Tails],\n [...TResults, GetUseSuspenseQueryOptions],\n [...TDepth, 1]\n >\n : Array extends T\n ? T\n : // If T is *some* array but we couldn't assign unknown[] to it, then it must hold some known/homogenous type!\n // use this to infer the param types in the case of Array.map() argument\n T extends Array<\n UseSuspenseQueryOptions<\n infer TQueryFnData,\n infer TError,\n infer TData,\n infer TQueryKey\n >\n >\n ? Array<\n UseSuspenseQueryOptions\n >\n : // Fallback\n Array\n\n/**\n * SuspenseQueriesResults reducer recursively maps type param to results\n */\nexport type SuspenseQueriesResults<\n T extends Array,\n TResults extends Array = [],\n TDepth extends ReadonlyArray = [],\n> = TDepth['length'] extends MAXIMUM_DEPTH\n ? Array\n : T extends []\n ? []\n : T extends [infer Head]\n ? [...TResults, GetUseSuspenseQueryResult]\n : T extends [infer Head, ...infer Tails]\n ? SuspenseQueriesResults<\n [...Tails],\n [...TResults, GetUseSuspenseQueryResult],\n [...TDepth, 1]\n >\n : { [K in keyof T]: GetUseSuspenseQueryResult }\n\nexport function useSuspenseQueries<\n T extends Array,\n TCombinedResult = SuspenseQueriesResults,\n>(\n options: {\n queries:\n | readonly [...SuspenseQueriesOptions]\n | readonly [...{ [K in keyof T]: GetUseSuspenseQueryOptions }]\n combine?: (result: SuspenseQueriesResults) => TCombinedResult\n },\n queryClient?: QueryClient,\n): TCombinedResult\n\nexport function useSuspenseQueries<\n T extends Array,\n TCombinedResult = SuspenseQueriesResults,\n>(\n options: {\n queries: readonly [...SuspenseQueriesOptions]\n combine?: (result: SuspenseQueriesResults) => TCombinedResult\n },\n queryClient?: QueryClient,\n): TCombinedResult\n\nexport function useSuspenseQueries(options: any, queryClient?: QueryClient) {\n return useQueries(\n {\n ...options,\n queries: options.queries.map((query: any) => {\n if (process.env.NODE_ENV !== 'production') {\n if (query.queryFn === skipToken) {\n console.error('skipToken is not allowed for useSuspenseQueries')\n }\n }\n\n return {\n ...query,\n suspense: true,\n throwOnError: defaultThrowOnError,\n enabled: true,\n placeholderData: undefined,\n }\n }),\n },\n queryClient,\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,wBAA0B;AAC1B,wBAA2B;AAC3B,sBAAoC;AAyL7B,SAAS,mBAAmB,SAAc,aAA2B;AAC1E,aAAO;AAAA,IACL;AAAA,MACE,GAAG;AAAA,MACH,SAAS,QAAQ,QAAQ,IAAI,CAAC,UAAe;AAC3C,YAAI,QAAQ,IAAI,aAAa,cAAc;AACzC,cAAI,MAAM,YAAY,6BAAW;AAC/B,oBAAQ,MAAM,iDAAiD;AAAA,UACjE;AAAA,QACF;AAEA,eAAO;AAAA,UACL,GAAG;AAAA,UACH,UAAU;AAAA,UACV,cAAc;AAAA,UACd,SAAS;AAAA,UACT,iBAAiB;AAAA,QACnB;AAAA,MACF,CAAC;AAAA,IACH;AAAA,IACA;AAAA,EACF;AACF;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/useSuspenseQueries.d.cts b/node_modules/@tanstack/react-query/build/modern/useSuspenseQueries.d.cts new file mode 100644 index 0000000..f3f9618 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/modern/useSuspenseQueries.d.cts @@ -0,0 +1,79 @@ +import { UseSuspenseQueryOptions, UseSuspenseQueryResult } from './types.cjs'; +import { QueryFunction, ThrowOnError, DefaultError, QueryClient } from '@tanstack/query-core'; + +type MAXIMUM_DEPTH = 20; +type SkipTokenForUseQueries = symbol; +type GetUseSuspenseQueryOptions = T extends { + queryFnData: infer TQueryFnData; + error?: infer TError; + data: infer TData; +} ? UseSuspenseQueryOptions : T extends { + queryFnData: infer TQueryFnData; + error?: infer TError; +} ? UseSuspenseQueryOptions : T extends { + data: infer TData; + error?: infer TError; +} ? UseSuspenseQueryOptions : T extends [infer TQueryFnData, infer TError, infer TData] ? UseSuspenseQueryOptions : T extends [infer TQueryFnData, infer TError] ? UseSuspenseQueryOptions : T extends [infer TQueryFnData] ? UseSuspenseQueryOptions : T extends { + queryFn?: QueryFunction | SkipTokenForUseQueries; + select?: (data: any) => infer TData; + throwOnError?: ThrowOnError; +} ? UseSuspenseQueryOptions : T extends { + queryFn?: QueryFunction | SkipTokenForUseQueries; + throwOnError?: ThrowOnError; +} ? UseSuspenseQueryOptions : UseSuspenseQueryOptions; +type GetUseSuspenseQueryResult = T extends { + queryFnData: any; + error?: infer TError; + data: infer TData; +} ? UseSuspenseQueryResult : T extends { + queryFnData: infer TQueryFnData; + error?: infer TError; +} ? UseSuspenseQueryResult : T extends { + data: infer TData; + error?: infer TError; +} ? UseSuspenseQueryResult : T extends [any, infer TError, infer TData] ? UseSuspenseQueryResult : T extends [infer TQueryFnData, infer TError] ? UseSuspenseQueryResult : T extends [infer TQueryFnData] ? UseSuspenseQueryResult : T extends { + queryFn?: QueryFunction | SkipTokenForUseQueries; + select?: (data: any) => infer TData; + throwOnError?: ThrowOnError; +} ? UseSuspenseQueryResult : T extends { + queryFn?: QueryFunction | SkipTokenForUseQueries; + throwOnError?: ThrowOnError; +} ? UseSuspenseQueryResult : UseSuspenseQueryResult; +/** + * SuspenseQueriesOptions reducer recursively unwraps function arguments to infer/enforce type param + */ +type SuspenseQueriesOptions, TResults extends Array = [], TDepth extends ReadonlyArray = []> = TDepth['length'] extends MAXIMUM_DEPTH ? Array : T extends [] ? [] : T extends [infer Head] ? [...TResults, GetUseSuspenseQueryOptions] : T extends [infer Head, ...infer Tails] ? SuspenseQueriesOptions<[ + ...Tails +], [ + ...TResults, + GetUseSuspenseQueryOptions +], [ + ...TDepth, + 1 +]> : Array extends T ? T : T extends Array> ? Array> : Array; +/** + * SuspenseQueriesResults reducer recursively maps type param to results + */ +type SuspenseQueriesResults, TResults extends Array = [], TDepth extends ReadonlyArray = []> = TDepth['length'] extends MAXIMUM_DEPTH ? Array : T extends [] ? [] : T extends [infer Head] ? [...TResults, GetUseSuspenseQueryResult] : T extends [infer Head, ...infer Tails] ? SuspenseQueriesResults<[ + ...Tails +], [ + ...TResults, + GetUseSuspenseQueryResult +], [ + ...TDepth, + 1 +]> : { + [K in keyof T]: GetUseSuspenseQueryResult; +}; +declare function useSuspenseQueries, TCombinedResult = SuspenseQueriesResults>(options: { + queries: readonly [...SuspenseQueriesOptions] | readonly [...{ + [K in keyof T]: GetUseSuspenseQueryOptions; + }]; + combine?: (result: SuspenseQueriesResults) => TCombinedResult; +}, queryClient?: QueryClient): TCombinedResult; +declare function useSuspenseQueries, TCombinedResult = SuspenseQueriesResults>(options: { + queries: readonly [...SuspenseQueriesOptions]; + combine?: (result: SuspenseQueriesResults) => TCombinedResult; +}, queryClient?: QueryClient): TCombinedResult; + +export { type SuspenseQueriesOptions, type SuspenseQueriesResults, useSuspenseQueries }; diff --git a/node_modules/@tanstack/react-query/build/modern/useSuspenseQueries.d.ts b/node_modules/@tanstack/react-query/build/modern/useSuspenseQueries.d.ts new file mode 100644 index 0000000..300e26f --- /dev/null +++ b/node_modules/@tanstack/react-query/build/modern/useSuspenseQueries.d.ts @@ -0,0 +1,79 @@ +import { UseSuspenseQueryOptions, UseSuspenseQueryResult } from './types.js'; +import { QueryFunction, ThrowOnError, DefaultError, QueryClient } from '@tanstack/query-core'; + +type MAXIMUM_DEPTH = 20; +type SkipTokenForUseQueries = symbol; +type GetUseSuspenseQueryOptions = T extends { + queryFnData: infer TQueryFnData; + error?: infer TError; + data: infer TData; +} ? UseSuspenseQueryOptions : T extends { + queryFnData: infer TQueryFnData; + error?: infer TError; +} ? UseSuspenseQueryOptions : T extends { + data: infer TData; + error?: infer TError; +} ? UseSuspenseQueryOptions : T extends [infer TQueryFnData, infer TError, infer TData] ? UseSuspenseQueryOptions : T extends [infer TQueryFnData, infer TError] ? UseSuspenseQueryOptions : T extends [infer TQueryFnData] ? UseSuspenseQueryOptions : T extends { + queryFn?: QueryFunction | SkipTokenForUseQueries; + select?: (data: any) => infer TData; + throwOnError?: ThrowOnError; +} ? UseSuspenseQueryOptions : T extends { + queryFn?: QueryFunction | SkipTokenForUseQueries; + throwOnError?: ThrowOnError; +} ? UseSuspenseQueryOptions : UseSuspenseQueryOptions; +type GetUseSuspenseQueryResult = T extends { + queryFnData: any; + error?: infer TError; + data: infer TData; +} ? UseSuspenseQueryResult : T extends { + queryFnData: infer TQueryFnData; + error?: infer TError; +} ? UseSuspenseQueryResult : T extends { + data: infer TData; + error?: infer TError; +} ? UseSuspenseQueryResult : T extends [any, infer TError, infer TData] ? UseSuspenseQueryResult : T extends [infer TQueryFnData, infer TError] ? UseSuspenseQueryResult : T extends [infer TQueryFnData] ? UseSuspenseQueryResult : T extends { + queryFn?: QueryFunction | SkipTokenForUseQueries; + select?: (data: any) => infer TData; + throwOnError?: ThrowOnError; +} ? UseSuspenseQueryResult : T extends { + queryFn?: QueryFunction | SkipTokenForUseQueries; + throwOnError?: ThrowOnError; +} ? UseSuspenseQueryResult : UseSuspenseQueryResult; +/** + * SuspenseQueriesOptions reducer recursively unwraps function arguments to infer/enforce type param + */ +type SuspenseQueriesOptions, TResults extends Array = [], TDepth extends ReadonlyArray = []> = TDepth['length'] extends MAXIMUM_DEPTH ? Array : T extends [] ? [] : T extends [infer Head] ? [...TResults, GetUseSuspenseQueryOptions] : T extends [infer Head, ...infer Tails] ? SuspenseQueriesOptions<[ + ...Tails +], [ + ...TResults, + GetUseSuspenseQueryOptions +], [ + ...TDepth, + 1 +]> : Array extends T ? T : T extends Array> ? Array> : Array; +/** + * SuspenseQueriesResults reducer recursively maps type param to results + */ +type SuspenseQueriesResults, TResults extends Array = [], TDepth extends ReadonlyArray = []> = TDepth['length'] extends MAXIMUM_DEPTH ? Array : T extends [] ? [] : T extends [infer Head] ? [...TResults, GetUseSuspenseQueryResult] : T extends [infer Head, ...infer Tails] ? SuspenseQueriesResults<[ + ...Tails +], [ + ...TResults, + GetUseSuspenseQueryResult +], [ + ...TDepth, + 1 +]> : { + [K in keyof T]: GetUseSuspenseQueryResult; +}; +declare function useSuspenseQueries, TCombinedResult = SuspenseQueriesResults>(options: { + queries: readonly [...SuspenseQueriesOptions] | readonly [...{ + [K in keyof T]: GetUseSuspenseQueryOptions; + }]; + combine?: (result: SuspenseQueriesResults) => TCombinedResult; +}, queryClient?: QueryClient): TCombinedResult; +declare function useSuspenseQueries, TCombinedResult = SuspenseQueriesResults>(options: { + queries: readonly [...SuspenseQueriesOptions]; + combine?: (result: SuspenseQueriesResults) => TCombinedResult; +}, queryClient?: QueryClient): TCombinedResult; + +export { type SuspenseQueriesOptions, type SuspenseQueriesResults, useSuspenseQueries }; diff --git a/node_modules/@tanstack/react-query/build/modern/useSuspenseQueries.js b/node_modules/@tanstack/react-query/build/modern/useSuspenseQueries.js new file mode 100644 index 0000000..a6f0445 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/modern/useSuspenseQueries.js @@ -0,0 +1,32 @@ +"use client"; + +// src/useSuspenseQueries.ts +import { skipToken } from "@tanstack/query-core"; +import { useQueries } from "./useQueries.js"; +import { defaultThrowOnError } from "./suspense.js"; +function useSuspenseQueries(options, queryClient) { + return useQueries( + { + ...options, + queries: options.queries.map((query) => { + if (process.env.NODE_ENV !== "production") { + if (query.queryFn === skipToken) { + console.error("skipToken is not allowed for useSuspenseQueries"); + } + } + return { + ...query, + suspense: true, + throwOnError: defaultThrowOnError, + enabled: true, + placeholderData: void 0 + }; + }) + }, + queryClient + ); +} +export { + useSuspenseQueries +}; +//# sourceMappingURL=useSuspenseQueries.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/useSuspenseQueries.js.map b/node_modules/@tanstack/react-query/build/modern/useSuspenseQueries.js.map new file mode 100644 index 0000000..ee09004 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/modern/useSuspenseQueries.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/useSuspenseQueries.ts"],"sourcesContent":["'use client'\nimport { skipToken } from '@tanstack/query-core'\nimport { useQueries } from './useQueries'\nimport { defaultThrowOnError } from './suspense'\nimport type { UseSuspenseQueryOptions, UseSuspenseQueryResult } from './types'\nimport type {\n DefaultError,\n QueryClient,\n QueryFunction,\n ThrowOnError,\n} from '@tanstack/query-core'\n\n// Avoid TS depth-limit error in case of large array literal\ntype MAXIMUM_DEPTH = 20\n\n// Widen the type of the symbol to enable type inference even if skipToken is not immutable.\ntype SkipTokenForUseQueries = symbol\n\ntype GetUseSuspenseQueryOptions =\n // Part 1: responsible for applying explicit type parameter to function arguments, if object { queryFnData: TQueryFnData, error: TError, data: TData }\n T extends {\n queryFnData: infer TQueryFnData\n error?: infer TError\n data: infer TData\n }\n ? UseSuspenseQueryOptions\n : T extends { queryFnData: infer TQueryFnData; error?: infer TError }\n ? UseSuspenseQueryOptions\n : T extends { data: infer TData; error?: infer TError }\n ? UseSuspenseQueryOptions\n : // Part 2: responsible for applying explicit type parameter to function arguments, if tuple [TQueryFnData, TError, TData]\n T extends [infer TQueryFnData, infer TError, infer TData]\n ? UseSuspenseQueryOptions\n : T extends [infer TQueryFnData, infer TError]\n ? UseSuspenseQueryOptions\n : T extends [infer TQueryFnData]\n ? UseSuspenseQueryOptions\n : // Part 3: responsible for inferring and enforcing type if no explicit parameter was provided\n T extends {\n queryFn?:\n | QueryFunction\n | SkipTokenForUseQueries\n select?: (data: any) => infer TData\n throwOnError?: ThrowOnError\n }\n ? UseSuspenseQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey\n >\n : T extends {\n queryFn?:\n | QueryFunction\n | SkipTokenForUseQueries\n throwOnError?: ThrowOnError\n }\n ? UseSuspenseQueryOptions<\n TQueryFnData,\n TError,\n TQueryFnData,\n TQueryKey\n >\n : // Fallback\n UseSuspenseQueryOptions\n\ntype GetUseSuspenseQueryResult =\n // Part 1: responsible for mapping explicit type parameter to function result, if object\n T extends { queryFnData: any; error?: infer TError; data: infer TData }\n ? UseSuspenseQueryResult\n : T extends { queryFnData: infer TQueryFnData; error?: infer TError }\n ? UseSuspenseQueryResult\n : T extends { data: infer TData; error?: infer TError }\n ? UseSuspenseQueryResult\n : // Part 2: responsible for mapping explicit type parameter to function result, if tuple\n T extends [any, infer TError, infer TData]\n ? UseSuspenseQueryResult\n : T extends [infer TQueryFnData, infer TError]\n ? UseSuspenseQueryResult\n : T extends [infer TQueryFnData]\n ? UseSuspenseQueryResult\n : // Part 3: responsible for mapping inferred type to results, if no explicit parameter was provided\n T extends {\n queryFn?:\n | QueryFunction\n | SkipTokenForUseQueries\n select?: (data: any) => infer TData\n throwOnError?: ThrowOnError\n }\n ? UseSuspenseQueryResult<\n unknown extends TData ? TQueryFnData : TData,\n unknown extends TError ? DefaultError : TError\n >\n : T extends {\n queryFn?:\n | QueryFunction\n | SkipTokenForUseQueries\n throwOnError?: ThrowOnError\n }\n ? UseSuspenseQueryResult<\n TQueryFnData,\n unknown extends TError ? DefaultError : TError\n >\n : // Fallback\n UseSuspenseQueryResult\n\n/**\n * SuspenseQueriesOptions reducer recursively unwraps function arguments to infer/enforce type param\n */\nexport type SuspenseQueriesOptions<\n T extends Array,\n TResults extends Array = [],\n TDepth extends ReadonlyArray = [],\n> = TDepth['length'] extends MAXIMUM_DEPTH\n ? Array\n : T extends []\n ? []\n : T extends [infer Head]\n ? [...TResults, GetUseSuspenseQueryOptions]\n : T extends [infer Head, ...infer Tails]\n ? SuspenseQueriesOptions<\n [...Tails],\n [...TResults, GetUseSuspenseQueryOptions],\n [...TDepth, 1]\n >\n : Array extends T\n ? T\n : // If T is *some* array but we couldn't assign unknown[] to it, then it must hold some known/homogenous type!\n // use this to infer the param types in the case of Array.map() argument\n T extends Array<\n UseSuspenseQueryOptions<\n infer TQueryFnData,\n infer TError,\n infer TData,\n infer TQueryKey\n >\n >\n ? Array<\n UseSuspenseQueryOptions\n >\n : // Fallback\n Array\n\n/**\n * SuspenseQueriesResults reducer recursively maps type param to results\n */\nexport type SuspenseQueriesResults<\n T extends Array,\n TResults extends Array = [],\n TDepth extends ReadonlyArray = [],\n> = TDepth['length'] extends MAXIMUM_DEPTH\n ? Array\n : T extends []\n ? []\n : T extends [infer Head]\n ? [...TResults, GetUseSuspenseQueryResult]\n : T extends [infer Head, ...infer Tails]\n ? SuspenseQueriesResults<\n [...Tails],\n [...TResults, GetUseSuspenseQueryResult],\n [...TDepth, 1]\n >\n : { [K in keyof T]: GetUseSuspenseQueryResult }\n\nexport function useSuspenseQueries<\n T extends Array,\n TCombinedResult = SuspenseQueriesResults,\n>(\n options: {\n queries:\n | readonly [...SuspenseQueriesOptions]\n | readonly [...{ [K in keyof T]: GetUseSuspenseQueryOptions }]\n combine?: (result: SuspenseQueriesResults) => TCombinedResult\n },\n queryClient?: QueryClient,\n): TCombinedResult\n\nexport function useSuspenseQueries<\n T extends Array,\n TCombinedResult = SuspenseQueriesResults,\n>(\n options: {\n queries: readonly [...SuspenseQueriesOptions]\n combine?: (result: SuspenseQueriesResults) => TCombinedResult\n },\n queryClient?: QueryClient,\n): TCombinedResult\n\nexport function useSuspenseQueries(options: any, queryClient?: QueryClient) {\n return useQueries(\n {\n ...options,\n queries: options.queries.map((query: any) => {\n if (process.env.NODE_ENV !== 'production') {\n if (query.queryFn === skipToken) {\n console.error('skipToken is not allowed for useSuspenseQueries')\n }\n }\n\n return {\n ...query,\n suspense: true,\n throwOnError: defaultThrowOnError,\n enabled: true,\n placeholderData: undefined,\n }\n }),\n },\n queryClient,\n )\n}\n"],"mappings":";;;AACA,SAAS,iBAAiB;AAC1B,SAAS,kBAAkB;AAC3B,SAAS,2BAA2B;AAyL7B,SAAS,mBAAmB,SAAc,aAA2B;AAC1E,SAAO;AAAA,IACL;AAAA,MACE,GAAG;AAAA,MACH,SAAS,QAAQ,QAAQ,IAAI,CAAC,UAAe;AAC3C,YAAI,QAAQ,IAAI,aAAa,cAAc;AACzC,cAAI,MAAM,YAAY,WAAW;AAC/B,oBAAQ,MAAM,iDAAiD;AAAA,UACjE;AAAA,QACF;AAEA,eAAO;AAAA,UACL,GAAG;AAAA,UACH,UAAU;AAAA,UACV,cAAc;AAAA,UACd,SAAS;AAAA,UACT,iBAAiB;AAAA,QACnB;AAAA,MACF,CAAC;AAAA,IACH;AAAA,IACA;AAAA,EACF;AACF;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/useSuspenseQuery.cjs b/node_modules/@tanstack/react-query/build/modern/useSuspenseQuery.cjs new file mode 100644 index 0000000..dcf18a2 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/modern/useSuspenseQuery.cjs @@ -0,0 +1,52 @@ +"use strict"; +"use client"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/useSuspenseQuery.ts +var useSuspenseQuery_exports = {}; +__export(useSuspenseQuery_exports, { + useSuspenseQuery: () => useSuspenseQuery +}); +module.exports = __toCommonJS(useSuspenseQuery_exports); +var import_query_core = require("@tanstack/query-core"); +var import_useBaseQuery = require("./useBaseQuery.cjs"); +var import_suspense = require("./suspense.cjs"); +function useSuspenseQuery(options, queryClient) { + if (process.env.NODE_ENV !== "production") { + if (options.queryFn === import_query_core.skipToken) { + console.error("skipToken is not allowed for useSuspenseQuery"); + } + } + return (0, import_useBaseQuery.useBaseQuery)( + { + ...options, + enabled: true, + suspense: true, + throwOnError: import_suspense.defaultThrowOnError, + placeholderData: void 0 + }, + import_query_core.QueryObserver, + queryClient + ); +} +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + useSuspenseQuery +}); +//# sourceMappingURL=useSuspenseQuery.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/useSuspenseQuery.cjs.map b/node_modules/@tanstack/react-query/build/modern/useSuspenseQuery.cjs.map new file mode 100644 index 0000000..c456860 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/modern/useSuspenseQuery.cjs.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/useSuspenseQuery.ts"],"sourcesContent":["'use client'\nimport { QueryObserver, skipToken } from '@tanstack/query-core'\nimport { useBaseQuery } from './useBaseQuery'\nimport { defaultThrowOnError } from './suspense'\nimport type { UseSuspenseQueryOptions, UseSuspenseQueryResult } from './types'\nimport type { DefaultError, QueryClient, QueryKey } from '@tanstack/query-core'\n\nexport function useSuspenseQuery<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n options: UseSuspenseQueryOptions,\n queryClient?: QueryClient,\n): UseSuspenseQueryResult {\n if (process.env.NODE_ENV !== 'production') {\n if ((options.queryFn as any) === skipToken) {\n console.error('skipToken is not allowed for useSuspenseQuery')\n }\n }\n\n return useBaseQuery(\n {\n ...options,\n enabled: true,\n suspense: true,\n throwOnError: defaultThrowOnError,\n placeholderData: undefined,\n },\n QueryObserver,\n queryClient,\n ) as UseSuspenseQueryResult\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,wBAAyC;AACzC,0BAA6B;AAC7B,sBAAoC;AAI7B,SAAS,iBAMd,SACA,aACuC;AACvC,MAAI,QAAQ,IAAI,aAAa,cAAc;AACzC,QAAK,QAAQ,YAAoB,6BAAW;AAC1C,cAAQ,MAAM,+CAA+C;AAAA,IAC/D;AAAA,EACF;AAEA,aAAO;AAAA,IACL;AAAA,MACE,GAAG;AAAA,MACH,SAAS;AAAA,MACT,UAAU;AAAA,MACV,cAAc;AAAA,MACd,iBAAiB;AAAA,IACnB;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/useSuspenseQuery.d.cts b/node_modules/@tanstack/react-query/build/modern/useSuspenseQuery.d.cts new file mode 100644 index 0000000..b2e662e --- /dev/null +++ b/node_modules/@tanstack/react-query/build/modern/useSuspenseQuery.d.cts @@ -0,0 +1,6 @@ +import { UseSuspenseQueryOptions, UseSuspenseQueryResult } from './types.cjs'; +import { DefaultError, QueryKey, QueryClient } from '@tanstack/query-core'; + +declare function useSuspenseQuery(options: UseSuspenseQueryOptions, queryClient?: QueryClient): UseSuspenseQueryResult; + +export { useSuspenseQuery }; diff --git a/node_modules/@tanstack/react-query/build/modern/useSuspenseQuery.d.ts b/node_modules/@tanstack/react-query/build/modern/useSuspenseQuery.d.ts new file mode 100644 index 0000000..f53bc83 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/modern/useSuspenseQuery.d.ts @@ -0,0 +1,6 @@ +import { UseSuspenseQueryOptions, UseSuspenseQueryResult } from './types.js'; +import { DefaultError, QueryKey, QueryClient } from '@tanstack/query-core'; + +declare function useSuspenseQuery(options: UseSuspenseQueryOptions, queryClient?: QueryClient): UseSuspenseQueryResult; + +export { useSuspenseQuery }; diff --git a/node_modules/@tanstack/react-query/build/modern/useSuspenseQuery.js b/node_modules/@tanstack/react-query/build/modern/useSuspenseQuery.js new file mode 100644 index 0000000..98296da --- /dev/null +++ b/node_modules/@tanstack/react-query/build/modern/useSuspenseQuery.js @@ -0,0 +1,28 @@ +"use client"; + +// src/useSuspenseQuery.ts +import { QueryObserver, skipToken } from "@tanstack/query-core"; +import { useBaseQuery } from "./useBaseQuery.js"; +import { defaultThrowOnError } from "./suspense.js"; +function useSuspenseQuery(options, queryClient) { + if (process.env.NODE_ENV !== "production") { + if (options.queryFn === skipToken) { + console.error("skipToken is not allowed for useSuspenseQuery"); + } + } + return useBaseQuery( + { + ...options, + enabled: true, + suspense: true, + throwOnError: defaultThrowOnError, + placeholderData: void 0 + }, + QueryObserver, + queryClient + ); +} +export { + useSuspenseQuery +}; +//# sourceMappingURL=useSuspenseQuery.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/useSuspenseQuery.js.map b/node_modules/@tanstack/react-query/build/modern/useSuspenseQuery.js.map new file mode 100644 index 0000000..2d96142 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/modern/useSuspenseQuery.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/useSuspenseQuery.ts"],"sourcesContent":["'use client'\nimport { QueryObserver, skipToken } from '@tanstack/query-core'\nimport { useBaseQuery } from './useBaseQuery'\nimport { defaultThrowOnError } from './suspense'\nimport type { UseSuspenseQueryOptions, UseSuspenseQueryResult } from './types'\nimport type { DefaultError, QueryClient, QueryKey } from '@tanstack/query-core'\n\nexport function useSuspenseQuery<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n options: UseSuspenseQueryOptions,\n queryClient?: QueryClient,\n): UseSuspenseQueryResult {\n if (process.env.NODE_ENV !== 'production') {\n if ((options.queryFn as any) === skipToken) {\n console.error('skipToken is not allowed for useSuspenseQuery')\n }\n }\n\n return useBaseQuery(\n {\n ...options,\n enabled: true,\n suspense: true,\n throwOnError: defaultThrowOnError,\n placeholderData: undefined,\n },\n QueryObserver,\n queryClient,\n ) as UseSuspenseQueryResult\n}\n"],"mappings":";;;AACA,SAAS,eAAe,iBAAiB;AACzC,SAAS,oBAAoB;AAC7B,SAAS,2BAA2B;AAI7B,SAAS,iBAMd,SACA,aACuC;AACvC,MAAI,QAAQ,IAAI,aAAa,cAAc;AACzC,QAAK,QAAQ,YAAoB,WAAW;AAC1C,cAAQ,MAAM,+CAA+C;AAAA,IAC/D;AAAA,EACF;AAEA,SAAO;AAAA,IACL;AAAA,MACE,GAAG;AAAA,MACH,SAAS;AAAA,MACT,UAAU;AAAA,MACV,cAAc;AAAA,MACd,iBAAiB;AAAA,IACnB;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/query-codemods/eslint.config.js b/node_modules/@tanstack/react-query/build/query-codemods/eslint.config.js new file mode 100644 index 0000000..c3c009f --- /dev/null +++ b/node_modules/@tanstack/react-query/build/query-codemods/eslint.config.js @@ -0,0 +1,18 @@ +// @ts-check + +import rootConfig from './root.eslint.config.js' + +export default [ + ...rootConfig, + { + rules: { + 'cspell/spellchecker': 'off', + '@typescript-eslint/no-unnecessary-condition': 'off', + 'import/no-duplicates': 'off', + 'import/no-unresolved': 'off', + 'import/order': 'off', + 'no-shadow': 'off', + 'sort-imports': 'off', + }, + }, +] diff --git a/node_modules/@tanstack/react-query/build/query-codemods/package.json b/node_modules/@tanstack/react-query/build/query-codemods/package.json new file mode 100644 index 0000000..fd78665 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/query-codemods/package.json @@ -0,0 +1,38 @@ +{ + "name": "@tanstack/query-codemods", + "private": true, + "description": "Collection of codemods to make the migration easier.", + "author": "Balázs Máté Petró", + "license": "MIT", + "repository": { + "type": "git", + "url": "git+https://github.com/TanStack/query.git", + "directory": "packages/query-codemods" + }, + "homepage": "https://tanstack.com/query", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/tannerlinsley" + }, + "scripts": { + "clean": "premove ./coverage ./dist-ts", + "test:eslint": "eslint --concurrency=auto ./src", + "test:lib": "vitest", + "test:lib:dev": "pnpm run test:lib --watch" + }, + "type": "module", + "exports": { + "./package.json": "./package.json" + }, + "sideEffects": false, + "files": [ + "src", + "!src/jest.config.js", + "!src/**/__testfixtures__", + "!src/**/__tests__" + ], + "devDependencies": { + "@types/jscodeshift": "17.3.0", + "jscodeshift": "17.3.0" + } +} diff --git a/node_modules/@tanstack/react-query/build/query-codemods/root.eslint.config.js b/node_modules/@tanstack/react-query/build/query-codemods/root.eslint.config.js new file mode 100644 index 0000000..d9a08b8 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/query-codemods/root.eslint.config.js @@ -0,0 +1,64 @@ +// @ts-check + +// @ts-ignore Needed due to moduleResolution Node vs Bundler +import { tanstackConfig } from '@tanstack/eslint-config' +import pluginCspell from '@cspell/eslint-plugin' +import vitest from '@vitest/eslint-plugin' + +export default [ + ...tanstackConfig, + { + name: 'tanstack/temp', + plugins: { + cspell: pluginCspell, + }, + rules: { + 'cspell/spellchecker': [ + 'warn', + { + cspell: { + words: [ + 'Promisable', // Our public interface + 'TSES', // @typescript-eslint package's interface + 'codemod', // We support our codemod + 'combinate', // Library name + 'datatag', // Query options tagging + 'extralight', // Our public interface + 'jscodeshift', + 'refetches', // Query refetch operations + 'retryer', // Our public interface + 'solidjs', // Our target framework + 'tabular-nums', // https://developer.mozilla.org/en-US/docs/Web/CSS/font-variant-numeric + 'tanstack', // Our package scope + 'todos', // Too general word to be caught as error + 'tsqd', // Our public interface (TanStack Query Devtools shorthand) + 'tsup', // We use tsup as builder + 'typecheck', // Field of vite.config.ts + 'vue-demi', // dependency of @tanstack/vue-query + 'ɵkind', // Angular specific + 'ɵproviders', // Angular specific + ], + }, + }, + ], + '@typescript-eslint/no-empty-function': 'off', + '@typescript-eslint/no-unsafe-function-type': 'off', + 'no-case-declarations': 'off', + 'prefer-const': 'off', + }, + }, + { + files: ['**/*.spec.ts*', '**/*.test.ts*', '**/*.test-d.ts*'], + plugins: { vitest }, + rules: { + ...vitest.configs.recommended.rules, + 'vitest/no-standalone-expect': [ + 'error', + { + additionalTestBlockFunctions: ['testIf'], + }, + ], + }, + settings: { vitest: { typecheck: true } }, + }, +] diff --git a/node_modules/@tanstack/react-query/build/query-codemods/tsconfig.json b/node_modules/@tanstack/react-query/build/query-codemods/tsconfig.json new file mode 100644 index 0000000..bcd89cd --- /dev/null +++ b/node_modules/@tanstack/react-query/build/query-codemods/tsconfig.json @@ -0,0 +1,8 @@ +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + "outDir": "./dist-ts", + "rootDir": "." + }, + "include": ["src", "*.config.*", "package.json"] +} diff --git a/node_modules/@tanstack/react-query/build/query-codemods/vite.config.ts b/node_modules/@tanstack/react-query/build/query-codemods/vite.config.ts new file mode 100644 index 0000000..bd580e8 --- /dev/null +++ b/node_modules/@tanstack/react-query/build/query-codemods/vite.config.ts @@ -0,0 +1,30 @@ +import { defineConfig } from 'vitest/config' + +import packageJson from './package.json' + +export default defineConfig({ + // fix from https://github.com/vitest-dev/vitest/issues/6992#issuecomment-2509408660 + resolve: { + conditions: ['@tanstack/custom-condition'], + }, + environments: { + ssr: { + resolve: { + conditions: ['@tanstack/custom-condition'], + }, + }, + }, + test: { + name: packageJson.name, + dir: './src', + watch: false, + globals: true, + coverage: { + enabled: true, + provider: 'istanbul', + include: ['src/**/*.{js,ts,cjs,mjs,jsx,tsx}'], + }, + typecheck: { enabled: true }, + restoreMocks: true, + }, +}) diff --git a/node_modules/@tanstack/react-query/package.json b/node_modules/@tanstack/react-query/package.json new file mode 100644 index 0000000..245d535 --- /dev/null +++ b/node_modules/@tanstack/react-query/package.json @@ -0,0 +1,87 @@ +{ + "name": "@tanstack/react-query", + "version": "5.90.21", + "description": "Hooks for managing, caching and syncing asynchronous and remote data in React", + "author": "tannerlinsley", + "license": "MIT", + "repository": { + "type": "git", + "url": "git+https://github.com/TanStack/query.git", + "directory": "packages/react-query" + }, + "homepage": "https://tanstack.com/query", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/tannerlinsley" + }, + "type": "module", + "types": "build/legacy/index.d.ts", + "main": "build/legacy/index.cjs", + "module": "build/legacy/index.js", + "react-native": "src/index.ts", + "exports": { + ".": { + "@tanstack/custom-condition": "./src/index.ts", + "import": { + "types": "./build/modern/index.d.ts", + "default": "./build/modern/index.js" + }, + "require": { + "types": "./build/modern/index.d.cts", + "default": "./build/modern/index.cjs" + } + }, + "./package.json": "./package.json" + }, + "sideEffects": false, + "files": [ + "build", + "src", + "!src/__tests__", + "!build/codemods/node_modules", + "!build/codemods/vite.config.ts", + "!build/codemods/**/__testfixtures__", + "!build/codemods/**/__tests__" + ], + "dependencies": { + "@tanstack/query-core": "5.90.20" + }, + "devDependencies": { + "@testing-library/react": "^16.1.0", + "@testing-library/react-render-stream": "^2.0.2", + "@types/react": "^19.2.7", + "@types/react-dom": "^19.2.3", + "@vitejs/plugin-react": "^4.3.4", + "cpy-cli": "^5.0.0", + "npm-run-all2": "^5.0.0", + "react": "^19.2.1", + "react-dom": "^19.2.1", + "react-error-boundary": "^4.1.2", + "@tanstack/query-persist-client-core": "5.91.19", + "@tanstack/query-test-utils": "0.0.0" + }, + "peerDependencies": { + "react": "^18 || ^19" + }, + "scripts": { + "clean": "premove ./build ./coverage ./dist-ts", + "compile": "tsc --build", + "test:eslint": "eslint --concurrency=auto ./src", + "test:types": "npm-run-all --serial test:types:*", + "test:types:ts50": "node ../../node_modules/typescript50/lib/tsc.js --build tsconfig.legacy.json", + "test:types:ts51": "node ../../node_modules/typescript51/lib/tsc.js --build tsconfig.legacy.json", + "test:types:ts52": "node ../../node_modules/typescript52/lib/tsc.js --build tsconfig.legacy.json", + "test:types:ts53": "node ../../node_modules/typescript53/lib/tsc.js --build tsconfig.legacy.json", + "test:types:ts54": "node ../../node_modules/typescript54/lib/tsc.js --build tsconfig.legacy.json", + "test:types:ts55": "node ../../node_modules/typescript55/lib/tsc.js --build tsconfig.legacy.json", + "test:types:ts56": "node ../../node_modules/typescript56/lib/tsc.js --build tsconfig.legacy.json", + "test:types:ts57": "node ../../node_modules/typescript57/lib/tsc.js --build tsconfig.legacy.json", + "test:types:tscurrent": "tsc --build", + "test:lib": "vitest", + "test:lib:dev": "pnpm run test:lib --watch", + "test:build": "publint --strict && attw --pack", + "build": "pnpm build:tsup && pnpm build:codemods", + "build:tsup": "tsup --tsconfig tsconfig.prod.json", + "build:codemods": "cpy ../query-codemods/* ./build/codemods" + } +} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/src/HydrationBoundary.tsx b/node_modules/@tanstack/react-query/src/HydrationBoundary.tsx new file mode 100644 index 0000000..901c8e9 --- /dev/null +++ b/node_modules/@tanstack/react-query/src/HydrationBoundary.tsx @@ -0,0 +1,111 @@ +'use client' +import * as React from 'react' + +import { hydrate } from '@tanstack/query-core' +import { useQueryClient } from './QueryClientProvider' +import type { + DehydratedState, + HydrateOptions, + OmitKeyof, + QueryClient, +} from '@tanstack/query-core' + +export interface HydrationBoundaryProps { + state: DehydratedState | null | undefined + options?: OmitKeyof & { + defaultOptions?: OmitKeyof< + Exclude, + 'mutations' + > + } + children?: React.ReactNode + queryClient?: QueryClient +} + +export const HydrationBoundary = ({ + children, + options = {}, + state, + queryClient, +}: HydrationBoundaryProps) => { + const client = useQueryClient(queryClient) + + const optionsRef = React.useRef(options) + React.useEffect(() => { + optionsRef.current = options + }) + + // This useMemo is for performance reasons only, everything inside it must + // be safe to run in every render and code here should be read as "in render". + // + // This code needs to happen during the render phase, because after initial + // SSR, hydration needs to happen _before_ children render. Also, if hydrating + // during a transition, we want to hydrate as much as is safe in render so + // we can prerender as much as possible. + // + // For any queries that already exist in the cache, we want to hold back on + // hydrating until _after_ the render phase. The reason for this is that during + // transitions, we don't want the existing queries and observers to update to + // the new data on the current page, only _after_ the transition is committed. + // If the transition is aborted, we will have hydrated any _new_ queries, but + // we throw away the fresh data for any existing ones to avoid unexpectedly + // updating the UI. + const hydrationQueue: DehydratedState['queries'] | undefined = + React.useMemo(() => { + if (state) { + if (typeof state !== 'object') { + return + } + + const queryCache = client.getQueryCache() + // State is supplied from the outside and we might as well fail + // gracefully if it has the wrong shape, so while we type `queries` + // as required, we still provide a fallback. + // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition + const queries = state.queries || [] + + const newQueries: DehydratedState['queries'] = [] + const existingQueries: DehydratedState['queries'] = [] + for (const dehydratedQuery of queries) { + const existingQuery = queryCache.get(dehydratedQuery.queryHash) + + if (!existingQuery) { + newQueries.push(dehydratedQuery) + } else { + const hydrationIsNewer = + dehydratedQuery.state.dataUpdatedAt > + existingQuery.state.dataUpdatedAt || + (dehydratedQuery.promise && + existingQuery.state.status !== 'pending' && + existingQuery.state.fetchStatus !== 'fetching' && + dehydratedQuery.dehydratedAt !== undefined && + dehydratedQuery.dehydratedAt > + existingQuery.state.dataUpdatedAt) + + if (hydrationIsNewer) { + existingQueries.push(dehydratedQuery) + } + } + } + + if (newQueries.length > 0) { + // It's actually fine to call this with queries/state that already exists + // in the cache, or is older. hydrate() is idempotent for queries. + // eslint-disable-next-line react-hooks/refs + hydrate(client, { queries: newQueries }, optionsRef.current) + } + if (existingQueries.length > 0) { + return existingQueries + } + } + return undefined + }, [client, state]) + + React.useEffect(() => { + if (hydrationQueue) { + hydrate(client, { queries: hydrationQueue }, optionsRef.current) + } + }, [client, hydrationQueue]) + + return children as React.ReactElement +} diff --git a/node_modules/@tanstack/react-query/src/IsRestoringProvider.ts b/node_modules/@tanstack/react-query/src/IsRestoringProvider.ts new file mode 100644 index 0000000..7d59c72 --- /dev/null +++ b/node_modules/@tanstack/react-query/src/IsRestoringProvider.ts @@ -0,0 +1,7 @@ +'use client' +import * as React from 'react' + +const IsRestoringContext = React.createContext(false) + +export const useIsRestoring = () => React.useContext(IsRestoringContext) +export const IsRestoringProvider = IsRestoringContext.Provider diff --git a/node_modules/@tanstack/react-query/src/QueryClientProvider.tsx b/node_modules/@tanstack/react-query/src/QueryClientProvider.tsx new file mode 100644 index 0000000..7fa1df9 --- /dev/null +++ b/node_modules/@tanstack/react-query/src/QueryClientProvider.tsx @@ -0,0 +1,45 @@ +'use client' +import * as React from 'react' + +import type { QueryClient } from '@tanstack/query-core' + +export const QueryClientContext = React.createContext( + undefined, +) + +export const useQueryClient = (queryClient?: QueryClient) => { + const client = React.useContext(QueryClientContext) + + if (queryClient) { + return queryClient + } + + if (!client) { + throw new Error('No QueryClient set, use QueryClientProvider to set one') + } + + return client +} + +export type QueryClientProviderProps = { + client: QueryClient + children?: React.ReactNode +} + +export const QueryClientProvider = ({ + client, + children, +}: QueryClientProviderProps): React.JSX.Element => { + React.useEffect(() => { + client.mount() + return () => { + client.unmount() + } + }, [client]) + + return ( + + {children} + + ) +} diff --git a/node_modules/@tanstack/react-query/src/QueryErrorResetBoundary.tsx b/node_modules/@tanstack/react-query/src/QueryErrorResetBoundary.tsx new file mode 100644 index 0000000..910215b --- /dev/null +++ b/node_modules/@tanstack/react-query/src/QueryErrorResetBoundary.tsx @@ -0,0 +1,56 @@ +'use client' +import * as React from 'react' + +// CONTEXT +export type QueryErrorResetFunction = () => void +export type QueryErrorIsResetFunction = () => boolean +export type QueryErrorClearResetFunction = () => void + +export interface QueryErrorResetBoundaryValue { + clearReset: QueryErrorClearResetFunction + isReset: QueryErrorIsResetFunction + reset: QueryErrorResetFunction +} + +function createValue(): QueryErrorResetBoundaryValue { + let isReset = false + return { + clearReset: () => { + isReset = false + }, + reset: () => { + isReset = true + }, + isReset: () => { + return isReset + }, + } +} + +const QueryErrorResetBoundaryContext = React.createContext(createValue()) + +// HOOK + +export const useQueryErrorResetBoundary = () => + React.useContext(QueryErrorResetBoundaryContext) + +// COMPONENT + +export type QueryErrorResetBoundaryFunction = ( + value: QueryErrorResetBoundaryValue, +) => React.ReactNode + +export interface QueryErrorResetBoundaryProps { + children: QueryErrorResetBoundaryFunction | React.ReactNode +} + +export const QueryErrorResetBoundary = ({ + children, +}: QueryErrorResetBoundaryProps) => { + const [value] = React.useState(() => createValue()) + return ( + + {typeof children === 'function' ? children(value) : children} + + ) +} diff --git a/node_modules/@tanstack/react-query/src/errorBoundaryUtils.ts b/node_modules/@tanstack/react-query/src/errorBoundaryUtils.ts new file mode 100644 index 0000000..734cc74 --- /dev/null +++ b/node_modules/@tanstack/react-query/src/errorBoundaryUtils.ts @@ -0,0 +1,82 @@ +'use client' +import * as React from 'react' +import { shouldThrowError } from '@tanstack/query-core' +import type { + DefaultedQueryObserverOptions, + Query, + QueryKey, + QueryObserverResult, + ThrowOnError, +} from '@tanstack/query-core' +import type { QueryErrorResetBoundaryValue } from './QueryErrorResetBoundary' + +export const ensurePreventErrorBoundaryRetry = < + TQueryFnData, + TError, + TData, + TQueryData, + TQueryKey extends QueryKey, +>( + options: DefaultedQueryObserverOptions< + TQueryFnData, + TError, + TData, + TQueryData, + TQueryKey + >, + errorResetBoundary: QueryErrorResetBoundaryValue, + query: Query | undefined, +) => { + const throwOnError = + query?.state.error && typeof options.throwOnError === 'function' + ? shouldThrowError(options.throwOnError, [query.state.error, query]) + : options.throwOnError + + if ( + options.suspense || + options.experimental_prefetchInRender || + throwOnError + ) { + // Prevent retrying failed query if the error boundary has not been reset yet + if (!errorResetBoundary.isReset()) { + options.retryOnMount = false + } + } +} + +export const useClearResetErrorBoundary = ( + errorResetBoundary: QueryErrorResetBoundaryValue, +) => { + React.useEffect(() => { + errorResetBoundary.clearReset() + }, [errorResetBoundary]) +} + +export const getHasError = < + TData, + TError, + TQueryFnData, + TQueryData, + TQueryKey extends QueryKey, +>({ + result, + errorResetBoundary, + throwOnError, + query, + suspense, +}: { + result: QueryObserverResult + errorResetBoundary: QueryErrorResetBoundaryValue + throwOnError: ThrowOnError + query: Query | undefined + suspense: boolean | undefined +}) => { + return ( + result.isError && + !errorResetBoundary.isReset() && + !result.isFetching && + query && + ((suspense && result.data === undefined) || + shouldThrowError(throwOnError, [result.error, query])) + ) +} diff --git a/node_modules/@tanstack/react-query/src/index.ts b/node_modules/@tanstack/react-query/src/index.ts new file mode 100644 index 0000000..36ea8da --- /dev/null +++ b/node_modules/@tanstack/react-query/src/index.ts @@ -0,0 +1,56 @@ +/* istanbul ignore file */ + +// Re-export core +export * from '@tanstack/query-core' + +// React Query +export * from './types' +export { useQueries } from './useQueries' +export type { QueriesResults, QueriesOptions } from './useQueries' +export { useQuery } from './useQuery' +export { useSuspenseQuery } from './useSuspenseQuery' +export { useSuspenseInfiniteQuery } from './useSuspenseInfiniteQuery' +export { useSuspenseQueries } from './useSuspenseQueries' +export type { + SuspenseQueriesResults, + SuspenseQueriesOptions, +} from './useSuspenseQueries' +export { usePrefetchQuery } from './usePrefetchQuery' +export { usePrefetchInfiniteQuery } from './usePrefetchInfiniteQuery' +export { queryOptions } from './queryOptions' +export type { + DefinedInitialDataOptions, + UndefinedInitialDataOptions, + UnusedSkipTokenOptions, +} from './queryOptions' +export { infiniteQueryOptions } from './infiniteQueryOptions' +export type { + DefinedInitialDataInfiniteOptions, + UndefinedInitialDataInfiniteOptions, + UnusedSkipTokenInfiniteOptions, +} from './infiniteQueryOptions' +export { + QueryClientContext, + QueryClientProvider, + useQueryClient, +} from './QueryClientProvider' +export type { QueryClientProviderProps } from './QueryClientProvider' +export type { QueryErrorResetBoundaryProps } from './QueryErrorResetBoundary' +export { HydrationBoundary } from './HydrationBoundary' +export type { HydrationBoundaryProps } from './HydrationBoundary' +export type { + QueryErrorClearResetFunction, + QueryErrorIsResetFunction, + QueryErrorResetBoundaryFunction, + QueryErrorResetFunction, +} from './QueryErrorResetBoundary' +export { + QueryErrorResetBoundary, + useQueryErrorResetBoundary, +} from './QueryErrorResetBoundary' +export { useIsFetching } from './useIsFetching' +export { useIsMutating, useMutationState } from './useMutationState' +export { useMutation } from './useMutation' +export { mutationOptions } from './mutationOptions' +export { useInfiniteQuery } from './useInfiniteQuery' +export { useIsRestoring, IsRestoringProvider } from './IsRestoringProvider' diff --git a/node_modules/@tanstack/react-query/src/infiniteQueryOptions.ts b/node_modules/@tanstack/react-query/src/infiniteQueryOptions.ts new file mode 100644 index 0000000..5e8c371 --- /dev/null +++ b/node_modules/@tanstack/react-query/src/infiniteQueryOptions.ts @@ -0,0 +1,149 @@ +import type { + DataTag, + DefaultError, + InfiniteData, + InitialDataFunction, + NonUndefinedGuard, + OmitKeyof, + QueryKey, + SkipToken, +} from '@tanstack/query-core' +import type { UseInfiniteQueryOptions } from './types' + +export type UndefinedInitialDataInfiniteOptions< + TQueryFnData, + TError = DefaultError, + TData = InfiniteData, + TQueryKey extends QueryKey = QueryKey, + TPageParam = unknown, +> = UseInfiniteQueryOptions< + TQueryFnData, + TError, + TData, + TQueryKey, + TPageParam +> & { + initialData?: + | undefined + | NonUndefinedGuard> + | InitialDataFunction< + NonUndefinedGuard> + > +} + +export type UnusedSkipTokenInfiniteOptions< + TQueryFnData, + TError = DefaultError, + TData = InfiniteData, + TQueryKey extends QueryKey = QueryKey, + TPageParam = unknown, +> = OmitKeyof< + UseInfiniteQueryOptions, + 'queryFn' +> & { + queryFn?: Exclude< + UseInfiniteQueryOptions< + TQueryFnData, + TError, + TData, + TQueryKey, + TPageParam + >['queryFn'], + SkipToken | undefined + > +} + +export type DefinedInitialDataInfiniteOptions< + TQueryFnData, + TError = DefaultError, + TData = InfiniteData, + TQueryKey extends QueryKey = QueryKey, + TPageParam = unknown, +> = UseInfiniteQueryOptions< + TQueryFnData, + TError, + TData, + TQueryKey, + TPageParam +> & { + initialData: + | NonUndefinedGuard> + | (() => NonUndefinedGuard>) + | undefined +} + +export function infiniteQueryOptions< + TQueryFnData, + TError = DefaultError, + TData = InfiniteData, + TQueryKey extends QueryKey = QueryKey, + TPageParam = unknown, +>( + options: DefinedInitialDataInfiniteOptions< + TQueryFnData, + TError, + TData, + TQueryKey, + TPageParam + >, +): DefinedInitialDataInfiniteOptions< + TQueryFnData, + TError, + TData, + TQueryKey, + TPageParam +> & { + queryKey: DataTag, TError> +} + +export function infiniteQueryOptions< + TQueryFnData, + TError = DefaultError, + TData = InfiniteData, + TQueryKey extends QueryKey = QueryKey, + TPageParam = unknown, +>( + options: UnusedSkipTokenInfiniteOptions< + TQueryFnData, + TError, + TData, + TQueryKey, + TPageParam + >, +): UnusedSkipTokenInfiniteOptions< + TQueryFnData, + TError, + TData, + TQueryKey, + TPageParam +> & { + queryKey: DataTag, TError> +} + +export function infiniteQueryOptions< + TQueryFnData, + TError = DefaultError, + TData = InfiniteData, + TQueryKey extends QueryKey = QueryKey, + TPageParam = unknown, +>( + options: UndefinedInitialDataInfiniteOptions< + TQueryFnData, + TError, + TData, + TQueryKey, + TPageParam + >, +): UndefinedInitialDataInfiniteOptions< + TQueryFnData, + TError, + TData, + TQueryKey, + TPageParam +> & { + queryKey: DataTag, TError> +} + +export function infiniteQueryOptions(options: unknown) { + return options +} diff --git a/node_modules/@tanstack/react-query/src/mutationOptions.ts b/node_modules/@tanstack/react-query/src/mutationOptions.ts new file mode 100644 index 0000000..1ee3110 --- /dev/null +++ b/node_modules/@tanstack/react-query/src/mutationOptions.ts @@ -0,0 +1,41 @@ +import type { DefaultError, WithRequired } from '@tanstack/query-core' +import type { UseMutationOptions } from './types' + +export function mutationOptions< + TData = unknown, + TError = DefaultError, + TVariables = void, + TOnMutateResult = unknown, +>( + options: WithRequired< + UseMutationOptions, + 'mutationKey' + >, +): WithRequired< + UseMutationOptions, + 'mutationKey' +> +export function mutationOptions< + TData = unknown, + TError = DefaultError, + TVariables = void, + TOnMutateResult = unknown, +>( + options: Omit< + UseMutationOptions, + 'mutationKey' + >, +): Omit< + UseMutationOptions, + 'mutationKey' +> +export function mutationOptions< + TData = unknown, + TError = DefaultError, + TVariables = void, + TOnMutateResult = unknown, +>( + options: UseMutationOptions, +): UseMutationOptions { + return options +} diff --git a/node_modules/@tanstack/react-query/src/queryOptions.ts b/node_modules/@tanstack/react-query/src/queryOptions.ts new file mode 100644 index 0000000..644ac26 --- /dev/null +++ b/node_modules/@tanstack/react-query/src/queryOptions.ts @@ -0,0 +1,87 @@ +import type { + DataTag, + DefaultError, + InitialDataFunction, + NonUndefinedGuard, + OmitKeyof, + QueryFunction, + QueryKey, + SkipToken, +} from '@tanstack/query-core' +import type { UseQueryOptions } from './types' + +export type UndefinedInitialDataOptions< + TQueryFnData = unknown, + TError = DefaultError, + TData = TQueryFnData, + TQueryKey extends QueryKey = QueryKey, +> = UseQueryOptions & { + initialData?: + | undefined + | InitialDataFunction> + | NonUndefinedGuard +} + +export type UnusedSkipTokenOptions< + TQueryFnData = unknown, + TError = DefaultError, + TData = TQueryFnData, + TQueryKey extends QueryKey = QueryKey, +> = OmitKeyof< + UseQueryOptions, + 'queryFn' +> & { + queryFn?: Exclude< + UseQueryOptions['queryFn'], + SkipToken | undefined + > +} + +export type DefinedInitialDataOptions< + TQueryFnData = unknown, + TError = DefaultError, + TData = TQueryFnData, + TQueryKey extends QueryKey = QueryKey, +> = Omit, 'queryFn'> & { + initialData: + | NonUndefinedGuard + | (() => NonUndefinedGuard) + queryFn?: QueryFunction +} + +export function queryOptions< + TQueryFnData = unknown, + TError = DefaultError, + TData = TQueryFnData, + TQueryKey extends QueryKey = QueryKey, +>( + options: DefinedInitialDataOptions, +): DefinedInitialDataOptions & { + queryKey: DataTag +} + +export function queryOptions< + TQueryFnData = unknown, + TError = DefaultError, + TData = TQueryFnData, + TQueryKey extends QueryKey = QueryKey, +>( + options: UnusedSkipTokenOptions, +): UnusedSkipTokenOptions & { + queryKey: DataTag +} + +export function queryOptions< + TQueryFnData = unknown, + TError = DefaultError, + TData = TQueryFnData, + TQueryKey extends QueryKey = QueryKey, +>( + options: UndefinedInitialDataOptions, +): UndefinedInitialDataOptions & { + queryKey: DataTag +} + +export function queryOptions(options: unknown) { + return options +} diff --git a/node_modules/@tanstack/react-query/src/suspense.ts b/node_modules/@tanstack/react-query/src/suspense.ts new file mode 100644 index 0000000..d87569f --- /dev/null +++ b/node_modules/@tanstack/react-query/src/suspense.ts @@ -0,0 +1,80 @@ +import type { + DefaultError, + DefaultedQueryObserverOptions, + Query, + QueryKey, + QueryObserver, + QueryObserverResult, +} from '@tanstack/query-core' +import type { QueryErrorResetBoundaryValue } from './QueryErrorResetBoundary' + +export const defaultThrowOnError = < + TQueryFnData = unknown, + TError = DefaultError, + TData = TQueryFnData, + TQueryKey extends QueryKey = QueryKey, +>( + _error: TError, + query: Query, +) => query.state.data === undefined + +export const ensureSuspenseTimers = ( + defaultedOptions: DefaultedQueryObserverOptions, +) => { + if (defaultedOptions.suspense) { + // Handle staleTime to ensure minimum 1000ms in Suspense mode + // This prevents unnecessary refetching when components remount after suspending + const MIN_SUSPENSE_TIME_MS = 1000 + + const clamp = (value: number | 'static' | undefined) => + value === 'static' + ? value + : Math.max(value ?? MIN_SUSPENSE_TIME_MS, MIN_SUSPENSE_TIME_MS) + + const originalStaleTime = defaultedOptions.staleTime + defaultedOptions.staleTime = + typeof originalStaleTime === 'function' + ? (...args) => clamp(originalStaleTime(...args)) + : clamp(originalStaleTime) + + if (typeof defaultedOptions.gcTime === 'number') { + defaultedOptions.gcTime = Math.max( + defaultedOptions.gcTime, + MIN_SUSPENSE_TIME_MS, + ) + } + } +} + +export const willFetch = ( + result: QueryObserverResult, + isRestoring: boolean, +) => result.isLoading && result.isFetching && !isRestoring + +export const shouldSuspend = ( + defaultedOptions: + | DefaultedQueryObserverOptions + | undefined, + result: QueryObserverResult, +) => defaultedOptions?.suspense && result.isPending + +export const fetchOptimistic = < + TQueryFnData, + TError, + TData, + TQueryData, + TQueryKey extends QueryKey, +>( + defaultedOptions: DefaultedQueryObserverOptions< + TQueryFnData, + TError, + TData, + TQueryData, + TQueryKey + >, + observer: QueryObserver, + errorResetBoundary: QueryErrorResetBoundaryValue, +) => + observer.fetchOptimistic(defaultedOptions).catch(() => { + errorResetBoundary.clearReset() + }) diff --git a/node_modules/@tanstack/react-query/src/types.ts b/node_modules/@tanstack/react-query/src/types.ts new file mode 100644 index 0000000..50df2d3 --- /dev/null +++ b/node_modules/@tanstack/react-query/src/types.ts @@ -0,0 +1,242 @@ +/* istanbul ignore file */ + +import type { + DefaultError, + DefinedInfiniteQueryObserverResult, + DefinedQueryObserverResult, + DistributiveOmit, + FetchQueryOptions, + InfiniteQueryObserverOptions, + InfiniteQueryObserverResult, + MutateFunction, + MutationObserverOptions, + MutationObserverResult, + OmitKeyof, + Override, + QueryKey, + QueryObserverOptions, + QueryObserverResult, + SkipToken, +} from '@tanstack/query-core' + +export type AnyUseBaseQueryOptions = UseBaseQueryOptions< + any, + any, + any, + any, + any +> +export interface UseBaseQueryOptions< + TQueryFnData = unknown, + TError = DefaultError, + TData = TQueryFnData, + TQueryData = TQueryFnData, + TQueryKey extends QueryKey = QueryKey, +> extends QueryObserverOptions< + TQueryFnData, + TError, + TData, + TQueryData, + TQueryKey +> { + /** + * Set this to `false` to unsubscribe this observer from updates to the query cache. + * Defaults to `true`. + */ + subscribed?: boolean +} + +export interface UsePrefetchQueryOptions< + TQueryFnData = unknown, + TError = DefaultError, + TData = TQueryFnData, + TQueryKey extends QueryKey = QueryKey, +> extends OmitKeyof< + FetchQueryOptions, + 'queryFn' +> { + queryFn?: Exclude< + FetchQueryOptions['queryFn'], + SkipToken + > +} + +export type AnyUseQueryOptions = UseQueryOptions +export interface UseQueryOptions< + TQueryFnData = unknown, + TError = DefaultError, + TData = TQueryFnData, + TQueryKey extends QueryKey = QueryKey, +> extends OmitKeyof< + UseBaseQueryOptions, + 'suspense' +> {} + +export type AnyUseSuspenseQueryOptions = UseSuspenseQueryOptions< + any, + any, + any, + any +> +export interface UseSuspenseQueryOptions< + TQueryFnData = unknown, + TError = DefaultError, + TData = TQueryFnData, + TQueryKey extends QueryKey = QueryKey, +> extends OmitKeyof< + UseQueryOptions, + 'queryFn' | 'enabled' | 'throwOnError' | 'placeholderData' +> { + queryFn?: Exclude< + UseQueryOptions['queryFn'], + SkipToken + > +} + +export type AnyUseInfiniteQueryOptions = UseInfiniteQueryOptions< + any, + any, + any, + any, + any +> +export interface UseInfiniteQueryOptions< + TQueryFnData = unknown, + TError = DefaultError, + TData = TQueryFnData, + TQueryKey extends QueryKey = QueryKey, + TPageParam = unknown, +> extends OmitKeyof< + InfiniteQueryObserverOptions< + TQueryFnData, + TError, + TData, + TQueryKey, + TPageParam + >, + 'suspense' +> { + /** + * Set this to `false` to unsubscribe this observer from updates to the query cache. + * Defaults to `true`. + */ + subscribed?: boolean +} + +export type AnyUseSuspenseInfiniteQueryOptions = + UseSuspenseInfiniteQueryOptions +export interface UseSuspenseInfiniteQueryOptions< + TQueryFnData = unknown, + TError = DefaultError, + TData = TQueryFnData, + TQueryKey extends QueryKey = QueryKey, + TPageParam = unknown, +> extends OmitKeyof< + UseInfiniteQueryOptions, + 'queryFn' | 'enabled' | 'throwOnError' | 'placeholderData' +> { + queryFn?: Exclude< + UseInfiniteQueryOptions< + TQueryFnData, + TError, + TData, + TQueryKey, + TPageParam + >['queryFn'], + SkipToken + > +} + +export type UseBaseQueryResult< + TData = unknown, + TError = DefaultError, +> = QueryObserverResult + +export type UseQueryResult< + TData = unknown, + TError = DefaultError, +> = UseBaseQueryResult + +export type UseSuspenseQueryResult< + TData = unknown, + TError = DefaultError, +> = DistributiveOmit< + DefinedQueryObserverResult, + 'isPlaceholderData' | 'promise' +> + +export type DefinedUseQueryResult< + TData = unknown, + TError = DefaultError, +> = DefinedQueryObserverResult + +export type UseInfiniteQueryResult< + TData = unknown, + TError = DefaultError, +> = InfiniteQueryObserverResult + +export type DefinedUseInfiniteQueryResult< + TData = unknown, + TError = DefaultError, +> = DefinedInfiniteQueryObserverResult + +export type UseSuspenseInfiniteQueryResult< + TData = unknown, + TError = DefaultError, +> = OmitKeyof< + DefinedInfiniteQueryObserverResult, + 'isPlaceholderData' | 'promise' +> + +export type AnyUseMutationOptions = UseMutationOptions +export interface UseMutationOptions< + TData = unknown, + TError = DefaultError, + TVariables = void, + TOnMutateResult = unknown, +> extends OmitKeyof< + MutationObserverOptions, + '_defaulted' +> {} + +export type UseMutateFunction< + TData = unknown, + TError = DefaultError, + TVariables = void, + TOnMutateResult = unknown, +> = ( + ...args: Parameters< + MutateFunction + > +) => void + +export type UseMutateAsyncFunction< + TData = unknown, + TError = DefaultError, + TVariables = void, + TOnMutateResult = unknown, +> = MutateFunction + +export type UseBaseMutationResult< + TData = unknown, + TError = DefaultError, + TVariables = unknown, + TOnMutateResult = unknown, +> = Override< + MutationObserverResult, + { mutate: UseMutateFunction } +> & { + mutateAsync: UseMutateAsyncFunction< + TData, + TError, + TVariables, + TOnMutateResult + > +} + +export type UseMutationResult< + TData = unknown, + TError = DefaultError, + TVariables = unknown, + TOnMutateResult = unknown, +> = UseBaseMutationResult diff --git a/node_modules/@tanstack/react-query/src/useBaseQuery.ts b/node_modules/@tanstack/react-query/src/useBaseQuery.ts new file mode 100644 index 0000000..2a151fe --- /dev/null +++ b/node_modules/@tanstack/react-query/src/useBaseQuery.ts @@ -0,0 +1,170 @@ +'use client' +import * as React from 'react' + +import { isServer, noop, notifyManager } from '@tanstack/query-core' +import { useQueryClient } from './QueryClientProvider' +import { useQueryErrorResetBoundary } from './QueryErrorResetBoundary' +import { + ensurePreventErrorBoundaryRetry, + getHasError, + useClearResetErrorBoundary, +} from './errorBoundaryUtils' +import { useIsRestoring } from './IsRestoringProvider' +import { + ensureSuspenseTimers, + fetchOptimistic, + shouldSuspend, + willFetch, +} from './suspense' +import type { + QueryClient, + QueryKey, + QueryObserver, + QueryObserverResult, +} from '@tanstack/query-core' +import type { UseBaseQueryOptions } from './types' + +export function useBaseQuery< + TQueryFnData, + TError, + TData, + TQueryData, + TQueryKey extends QueryKey, +>( + options: UseBaseQueryOptions< + TQueryFnData, + TError, + TData, + TQueryData, + TQueryKey + >, + Observer: typeof QueryObserver, + queryClient?: QueryClient, +): QueryObserverResult { + if (process.env.NODE_ENV !== 'production') { + if (typeof options !== 'object' || Array.isArray(options)) { + throw new Error( + 'Bad argument type. Starting with v5, only the "Object" form is allowed when calling query related functions. Please use the error stack to find the culprit call. More info here: https://tanstack.com/query/latest/docs/react/guides/migrating-to-v5#supports-a-single-signature-one-object', + ) + } + } + + const isRestoring = useIsRestoring() + const errorResetBoundary = useQueryErrorResetBoundary() + const client = useQueryClient(queryClient) + const defaultedOptions = client.defaultQueryOptions(options) + ;(client.getDefaultOptions().queries as any)?._experimental_beforeQuery?.( + defaultedOptions, + ) + + const query = client + .getQueryCache() + .get< + TQueryFnData, + TError, + TQueryData, + TQueryKey + >(defaultedOptions.queryHash) + + if (process.env.NODE_ENV !== 'production') { + if (!defaultedOptions.queryFn) { + console.error( + `[${defaultedOptions.queryHash}]: No queryFn was passed as an option, and no default queryFn was found. The queryFn parameter is only optional when using a default queryFn. More info here: https://tanstack.com/query/latest/docs/framework/react/guides/default-query-function`, + ) + } + } + + // Make sure results are optimistically set in fetching state before subscribing or updating options + defaultedOptions._optimisticResults = isRestoring + ? 'isRestoring' + : 'optimistic' + + ensureSuspenseTimers(defaultedOptions) + ensurePreventErrorBoundaryRetry(defaultedOptions, errorResetBoundary, query) + useClearResetErrorBoundary(errorResetBoundary) + + // this needs to be invoked before creating the Observer because that can create a cache entry + const isNewCacheEntry = !client + .getQueryCache() + .get(defaultedOptions.queryHash) + + const [observer] = React.useState( + () => + new Observer( + client, + defaultedOptions, + ), + ) + + // note: this must be called before useSyncExternalStore + const result = observer.getOptimisticResult(defaultedOptions) + + const shouldSubscribe = !isRestoring && options.subscribed !== false + React.useSyncExternalStore( + React.useCallback( + (onStoreChange) => { + const unsubscribe = shouldSubscribe + ? observer.subscribe(notifyManager.batchCalls(onStoreChange)) + : noop + + // Update result to make sure we did not miss any query updates + // between creating the observer and subscribing to it. + observer.updateResult() + + return unsubscribe + }, + [observer, shouldSubscribe], + ), + () => observer.getCurrentResult(), + () => observer.getCurrentResult(), + ) + + React.useEffect(() => { + observer.setOptions(defaultedOptions) + }, [defaultedOptions, observer]) + + // Handle suspense + if (shouldSuspend(defaultedOptions, result)) { + throw fetchOptimistic(defaultedOptions, observer, errorResetBoundary) + } + + // Handle error boundary + if ( + getHasError({ + result, + errorResetBoundary, + throwOnError: defaultedOptions.throwOnError, + query, + suspense: defaultedOptions.suspense, + }) + ) { + throw result.error + } + + ;(client.getDefaultOptions().queries as any)?._experimental_afterQuery?.( + defaultedOptions, + result, + ) + + if ( + defaultedOptions.experimental_prefetchInRender && + !isServer && + willFetch(result, isRestoring) + ) { + const promise = isNewCacheEntry + ? // Fetch immediately on render in order to ensure `.promise` is resolved even if the component is unmounted + fetchOptimistic(defaultedOptions, observer, errorResetBoundary) + : // subscribe to the "cache promise" so that we can finalize the currentThenable once data comes in + query?.promise + + promise?.catch(noop).finally(() => { + // `.updateResult()` will trigger `.#currentThenable` to finalize + observer.updateResult() + }) + } + + // Handle result property usage tracking + return !defaultedOptions.notifyOnChangeProps + ? observer.trackResult(result) + : result +} diff --git a/node_modules/@tanstack/react-query/src/useInfiniteQuery.ts b/node_modules/@tanstack/react-query/src/useInfiniteQuery.ts new file mode 100644 index 0000000..32ebfb7 --- /dev/null +++ b/node_modules/@tanstack/react-query/src/useInfiniteQuery.ts @@ -0,0 +1,81 @@ +'use client' +import { InfiniteQueryObserver } from '@tanstack/query-core' +import { useBaseQuery } from './useBaseQuery' +import type { + DefaultError, + InfiniteData, + QueryClient, + QueryKey, + QueryObserver, +} from '@tanstack/query-core' +import type { + DefinedUseInfiniteQueryResult, + UseInfiniteQueryOptions, + UseInfiniteQueryResult, +} from './types' +import type { + DefinedInitialDataInfiniteOptions, + UndefinedInitialDataInfiniteOptions, +} from './infiniteQueryOptions' + +export function useInfiniteQuery< + TQueryFnData, + TError = DefaultError, + TData = InfiniteData, + TQueryKey extends QueryKey = QueryKey, + TPageParam = unknown, +>( + options: DefinedInitialDataInfiniteOptions< + TQueryFnData, + TError, + TData, + TQueryKey, + TPageParam + >, + queryClient?: QueryClient, +): DefinedUseInfiniteQueryResult + +export function useInfiniteQuery< + TQueryFnData, + TError = DefaultError, + TData = InfiniteData, + TQueryKey extends QueryKey = QueryKey, + TPageParam = unknown, +>( + options: UndefinedInitialDataInfiniteOptions< + TQueryFnData, + TError, + TData, + TQueryKey, + TPageParam + >, + queryClient?: QueryClient, +): UseInfiniteQueryResult + +export function useInfiniteQuery< + TQueryFnData, + TError = DefaultError, + TData = InfiniteData, + TQueryKey extends QueryKey = QueryKey, + TPageParam = unknown, +>( + options: UseInfiniteQueryOptions< + TQueryFnData, + TError, + TData, + TQueryKey, + TPageParam + >, + queryClient?: QueryClient, +): UseInfiniteQueryResult + +export function useInfiniteQuery( + options: UseInfiniteQueryOptions, + queryClient?: QueryClient, +) { + return useBaseQuery( + options, + InfiniteQueryObserver as typeof QueryObserver, + queryClient, + ) +} diff --git a/node_modules/@tanstack/react-query/src/useIsFetching.ts b/node_modules/@tanstack/react-query/src/useIsFetching.ts new file mode 100644 index 0000000..a625291 --- /dev/null +++ b/node_modules/@tanstack/react-query/src/useIsFetching.ts @@ -0,0 +1,24 @@ +'use client' +import * as React from 'react' +import { notifyManager } from '@tanstack/query-core' + +import { useQueryClient } from './QueryClientProvider' +import type { QueryClient, QueryFilters } from '@tanstack/query-core' + +export function useIsFetching( + filters?: QueryFilters, + queryClient?: QueryClient, +): number { + const client = useQueryClient(queryClient) + const queryCache = client.getQueryCache() + + return React.useSyncExternalStore( + React.useCallback( + (onStoreChange) => + queryCache.subscribe(notifyManager.batchCalls(onStoreChange)), + [queryCache], + ), + () => client.isFetching(filters), + () => client.isFetching(filters), + ) +} diff --git a/node_modules/@tanstack/react-query/src/useMutation.ts b/node_modules/@tanstack/react-query/src/useMutation.ts new file mode 100644 index 0000000..2c66eb8 --- /dev/null +++ b/node_modules/@tanstack/react-query/src/useMutation.ts @@ -0,0 +1,69 @@ +'use client' +import * as React from 'react' +import { + MutationObserver, + noop, + notifyManager, + shouldThrowError, +} from '@tanstack/query-core' +import { useQueryClient } from './QueryClientProvider' +import type { + UseMutateFunction, + UseMutationOptions, + UseMutationResult, +} from './types' +import type { DefaultError, QueryClient } from '@tanstack/query-core' + +// HOOK + +export function useMutation< + TData = unknown, + TError = DefaultError, + TVariables = void, + TOnMutateResult = unknown, +>( + options: UseMutationOptions, + queryClient?: QueryClient, +): UseMutationResult { + const client = useQueryClient(queryClient) + + const [observer] = React.useState( + () => + new MutationObserver( + client, + options, + ), + ) + + React.useEffect(() => { + observer.setOptions(options) + }, [observer, options]) + + const result = React.useSyncExternalStore( + React.useCallback( + (onStoreChange) => + observer.subscribe(notifyManager.batchCalls(onStoreChange)), + [observer], + ), + () => observer.getCurrentResult(), + () => observer.getCurrentResult(), + ) + + const mutate = React.useCallback< + UseMutateFunction + >( + (variables, mutateOptions) => { + observer.mutate(variables, mutateOptions).catch(noop) + }, + [observer], + ) + + if ( + result.error && + shouldThrowError(observer.options.throwOnError, [result.error]) + ) { + throw result.error + } + + return { ...result, mutate, mutateAsync: result.mutate } +} diff --git a/node_modules/@tanstack/react-query/src/useMutationState.ts b/node_modules/@tanstack/react-query/src/useMutationState.ts new file mode 100644 index 0000000..dfd0c41 --- /dev/null +++ b/node_modules/@tanstack/react-query/src/useMutationState.ts @@ -0,0 +1,75 @@ +'use client' +import * as React from 'react' + +import { notifyManager, replaceEqualDeep } from '@tanstack/query-core' +import { useQueryClient } from './QueryClientProvider' +import type { + Mutation, + MutationCache, + MutationFilters, + MutationState, + QueryClient, +} from '@tanstack/query-core' + +export function useIsMutating( + filters?: MutationFilters, + queryClient?: QueryClient, +): number { + const client = useQueryClient(queryClient) + return useMutationState( + { filters: { ...filters, status: 'pending' } }, + client, + ).length +} + +type MutationStateOptions = { + filters?: MutationFilters + select?: (mutation: Mutation) => TResult +} + +function getResult( + mutationCache: MutationCache, + options: MutationStateOptions, +): Array { + return mutationCache + .findAll(options.filters) + .map( + (mutation): TResult => + (options.select ? options.select(mutation) : mutation.state) as TResult, + ) +} + +export function useMutationState( + options: MutationStateOptions = {}, + queryClient?: QueryClient, +): Array { + const mutationCache = useQueryClient(queryClient).getMutationCache() + const optionsRef = React.useRef(options) + const result = React.useRef>(null) + if (result.current === null) { + result.current = getResult(mutationCache, options) + } + + React.useEffect(() => { + optionsRef.current = options + }) + + return React.useSyncExternalStore( + React.useCallback( + (onStoreChange) => + mutationCache.subscribe(() => { + const nextResult = replaceEqualDeep( + result.current, + getResult(mutationCache, optionsRef.current), + ) + if (result.current !== nextResult) { + result.current = nextResult + notifyManager.schedule(onStoreChange) + } + }), + [mutationCache], + ), + () => result.current, + () => result.current, + )! +} diff --git a/node_modules/@tanstack/react-query/src/usePrefetchInfiniteQuery.tsx b/node_modules/@tanstack/react-query/src/usePrefetchInfiniteQuery.tsx new file mode 100644 index 0000000..08c2fcd --- /dev/null +++ b/node_modules/@tanstack/react-query/src/usePrefetchInfiniteQuery.tsx @@ -0,0 +1,30 @@ +import { useQueryClient } from './QueryClientProvider' +import type { + DefaultError, + FetchInfiniteQueryOptions, + QueryClient, + QueryKey, +} from '@tanstack/query-core' + +export function usePrefetchInfiniteQuery< + TQueryFnData = unknown, + TError = DefaultError, + TData = TQueryFnData, + TQueryKey extends QueryKey = QueryKey, + TPageParam = unknown, +>( + options: FetchInfiniteQueryOptions< + TQueryFnData, + TError, + TData, + TQueryKey, + TPageParam + >, + queryClient?: QueryClient, +) { + const client = useQueryClient(queryClient) + + if (!client.getQueryState(options.queryKey)) { + client.prefetchInfiniteQuery(options) + } +} diff --git a/node_modules/@tanstack/react-query/src/usePrefetchQuery.tsx b/node_modules/@tanstack/react-query/src/usePrefetchQuery.tsx new file mode 100644 index 0000000..3f508c3 --- /dev/null +++ b/node_modules/@tanstack/react-query/src/usePrefetchQuery.tsx @@ -0,0 +1,19 @@ +import { useQueryClient } from './QueryClientProvider' +import type { DefaultError, QueryClient, QueryKey } from '@tanstack/query-core' +import type { UsePrefetchQueryOptions } from './types' + +export function usePrefetchQuery< + TQueryFnData = unknown, + TError = DefaultError, + TData = TQueryFnData, + TQueryKey extends QueryKey = QueryKey, +>( + options: UsePrefetchQueryOptions, + queryClient?: QueryClient, +) { + const client = useQueryClient(queryClient) + + if (!client.getQueryState(options.queryKey)) { + client.prefetchQuery(options) + } +} diff --git a/node_modules/@tanstack/react-query/src/useQueries.ts b/node_modules/@tanstack/react-query/src/useQueries.ts new file mode 100644 index 0000000..de17983 --- /dev/null +++ b/node_modules/@tanstack/react-query/src/useQueries.ts @@ -0,0 +1,328 @@ +'use client' +import * as React from 'react' + +import { + QueriesObserver, + QueryObserver, + noop, + notifyManager, +} from '@tanstack/query-core' +import { useQueryClient } from './QueryClientProvider' +import { useIsRestoring } from './IsRestoringProvider' +import { useQueryErrorResetBoundary } from './QueryErrorResetBoundary' +import { + ensurePreventErrorBoundaryRetry, + getHasError, + useClearResetErrorBoundary, +} from './errorBoundaryUtils' +import { + ensureSuspenseTimers, + fetchOptimistic, + shouldSuspend, +} from './suspense' +import type { + DefinedUseQueryResult, + UseQueryOptions, + UseQueryResult, +} from './types' +import type { + DefaultError, + OmitKeyof, + QueriesObserverOptions, + QueriesPlaceholderDataFunction, + QueryClient, + QueryFunction, + QueryKey, + QueryObserverOptions, + ThrowOnError, +} from '@tanstack/query-core' + +// This defines the `UseQueryOptions` that are accepted in `QueriesOptions` & `GetOptions`. +// `placeholderData` function always gets undefined passed +type UseQueryOptionsForUseQueries< + TQueryFnData = unknown, + TError = DefaultError, + TData = TQueryFnData, + TQueryKey extends QueryKey = QueryKey, +> = OmitKeyof< + UseQueryOptions, + 'placeholderData' | 'subscribed' +> & { + placeholderData?: TQueryFnData | QueriesPlaceholderDataFunction +} + +// Avoid TS depth-limit error in case of large array literal +type MAXIMUM_DEPTH = 20 + +// Widen the type of the symbol to enable type inference even if skipToken is not immutable. +type SkipTokenForUseQueries = symbol + +type GetUseQueryOptionsForUseQueries = + // Part 1: responsible for applying explicit type parameter to function arguments, if object { queryFnData: TQueryFnData, error: TError, data: TData } + T extends { + queryFnData: infer TQueryFnData + error?: infer TError + data: infer TData + } + ? UseQueryOptionsForUseQueries + : T extends { queryFnData: infer TQueryFnData; error?: infer TError } + ? UseQueryOptionsForUseQueries + : T extends { data: infer TData; error?: infer TError } + ? UseQueryOptionsForUseQueries + : // Part 2: responsible for applying explicit type parameter to function arguments, if tuple [TQueryFnData, TError, TData] + T extends [infer TQueryFnData, infer TError, infer TData] + ? UseQueryOptionsForUseQueries + : T extends [infer TQueryFnData, infer TError] + ? UseQueryOptionsForUseQueries + : T extends [infer TQueryFnData] + ? UseQueryOptionsForUseQueries + : // Part 3: responsible for inferring and enforcing type if no explicit parameter was provided + T extends { + queryFn?: + | QueryFunction + | SkipTokenForUseQueries + select?: (data: any) => infer TData + throwOnError?: ThrowOnError + } + ? UseQueryOptionsForUseQueries< + TQueryFnData, + unknown extends TError ? DefaultError : TError, + unknown extends TData ? TQueryFnData : TData, + TQueryKey + > + : // Fallback + UseQueryOptionsForUseQueries + +// A defined initialData setting should return a DefinedUseQueryResult rather than UseQueryResult +type GetDefinedOrUndefinedQueryResult = T extends { + initialData?: infer TInitialData +} + ? unknown extends TInitialData + ? UseQueryResult + : TInitialData extends TData + ? DefinedUseQueryResult + : TInitialData extends () => infer TInitialDataResult + ? unknown extends TInitialDataResult + ? UseQueryResult + : TInitialDataResult extends TData + ? DefinedUseQueryResult + : UseQueryResult + : UseQueryResult + : UseQueryResult + +type GetUseQueryResult = + // Part 1: responsible for mapping explicit type parameter to function result, if object + T extends { queryFnData: any; error?: infer TError; data: infer TData } + ? GetDefinedOrUndefinedQueryResult + : T extends { queryFnData: infer TQueryFnData; error?: infer TError } + ? GetDefinedOrUndefinedQueryResult + : T extends { data: infer TData; error?: infer TError } + ? GetDefinedOrUndefinedQueryResult + : // Part 2: responsible for mapping explicit type parameter to function result, if tuple + T extends [any, infer TError, infer TData] + ? GetDefinedOrUndefinedQueryResult + : T extends [infer TQueryFnData, infer TError] + ? GetDefinedOrUndefinedQueryResult + : T extends [infer TQueryFnData] + ? GetDefinedOrUndefinedQueryResult + : // Part 3: responsible for mapping inferred type to results, if no explicit parameter was provided + T extends { + queryFn?: + | QueryFunction + | SkipTokenForUseQueries + select?: (data: any) => infer TData + throwOnError?: ThrowOnError + } + ? GetDefinedOrUndefinedQueryResult< + T, + unknown extends TData ? TQueryFnData : TData, + unknown extends TError ? DefaultError : TError + > + : // Fallback + UseQueryResult + +/** + * QueriesOptions reducer recursively unwraps function arguments to infer/enforce type param + */ +export type QueriesOptions< + T extends Array, + TResults extends Array = [], + TDepth extends ReadonlyArray = [], +> = TDepth['length'] extends MAXIMUM_DEPTH + ? Array + : T extends [] + ? [] + : T extends [infer Head] + ? [...TResults, GetUseQueryOptionsForUseQueries] + : T extends [infer Head, ...infer Tails] + ? QueriesOptions< + [...Tails], + [...TResults, GetUseQueryOptionsForUseQueries], + [...TDepth, 1] + > + : ReadonlyArray extends T + ? T + : // If T is *some* array but we couldn't assign unknown[] to it, then it must hold some known/homogenous type! + // use this to infer the param types in the case of Array.map() argument + T extends Array< + UseQueryOptionsForUseQueries< + infer TQueryFnData, + infer TError, + infer TData, + infer TQueryKey + > + > + ? Array< + UseQueryOptionsForUseQueries< + TQueryFnData, + TError, + TData, + TQueryKey + > + > + : // Fallback + Array + +/** + * QueriesResults reducer recursively maps type param to results + */ +export type QueriesResults< + T extends Array, + TResults extends Array = [], + TDepth extends ReadonlyArray = [], +> = TDepth['length'] extends MAXIMUM_DEPTH + ? Array + : T extends [] + ? [] + : T extends [infer Head] + ? [...TResults, GetUseQueryResult] + : T extends [infer Head, ...infer Tails] + ? QueriesResults< + [...Tails], + [...TResults, GetUseQueryResult], + [...TDepth, 1] + > + : { [K in keyof T]: GetUseQueryResult } + +export function useQueries< + T extends Array, + TCombinedResult = QueriesResults, +>( + { + queries, + ...options + }: { + queries: + | readonly [...QueriesOptions] + | readonly [...{ [K in keyof T]: GetUseQueryOptionsForUseQueries }] + combine?: (result: QueriesResults) => TCombinedResult + subscribed?: boolean + }, + queryClient?: QueryClient, +): TCombinedResult { + const client = useQueryClient(queryClient) + const isRestoring = useIsRestoring() + const errorResetBoundary = useQueryErrorResetBoundary() + + const defaultedQueries = React.useMemo( + () => + queries.map((opts) => { + const defaultedOptions = client.defaultQueryOptions( + opts as QueryObserverOptions, + ) + + // Make sure the results are already in fetching state before subscribing or updating options + defaultedOptions._optimisticResults = isRestoring + ? 'isRestoring' + : 'optimistic' + + return defaultedOptions + }), + [queries, client, isRestoring], + ) + + defaultedQueries.forEach((queryOptions) => { + ensureSuspenseTimers(queryOptions) + const query = client.getQueryCache().get(queryOptions.queryHash) + ensurePreventErrorBoundaryRetry(queryOptions, errorResetBoundary, query) + }) + + useClearResetErrorBoundary(errorResetBoundary) + + const [observer] = React.useState( + () => + new QueriesObserver( + client, + defaultedQueries, + options as QueriesObserverOptions, + ), + ) + + // note: this must be called before useSyncExternalStore + const [optimisticResult, getCombinedResult, trackResult] = + observer.getOptimisticResult( + defaultedQueries, + (options as QueriesObserverOptions).combine, + ) + + const shouldSubscribe = !isRestoring && options.subscribed !== false + React.useSyncExternalStore( + React.useCallback( + (onStoreChange) => + shouldSubscribe + ? observer.subscribe(notifyManager.batchCalls(onStoreChange)) + : noop, + [observer, shouldSubscribe], + ), + () => observer.getCurrentResult(), + () => observer.getCurrentResult(), + ) + + React.useEffect(() => { + observer.setQueries( + defaultedQueries, + options as QueriesObserverOptions, + ) + }, [defaultedQueries, options, observer]) + + const shouldAtLeastOneSuspend = optimisticResult.some((result, index) => + shouldSuspend(defaultedQueries[index], result), + ) + + const suspensePromises = shouldAtLeastOneSuspend + ? optimisticResult.flatMap((result, index) => { + const opts = defaultedQueries[index] + + if (opts && shouldSuspend(opts, result)) { + const queryObserver = new QueryObserver(client, opts) + return fetchOptimistic(opts, queryObserver, errorResetBoundary) + } + return [] + }) + : [] + + if (suspensePromises.length > 0) { + throw Promise.all(suspensePromises) + } + const firstSingleResultWhichShouldThrow = optimisticResult.find( + (result, index) => { + const query = defaultedQueries[index] + return ( + query && + getHasError({ + result, + errorResetBoundary, + throwOnError: query.throwOnError, + query: client.getQueryCache().get(query.queryHash), + suspense: query.suspense, + }) + ) + }, + ) + + if (firstSingleResultWhichShouldThrow?.error) { + throw firstSingleResultWhichShouldThrow.error + } + + return getCombinedResult(trackResult()) +} diff --git a/node_modules/@tanstack/react-query/src/useQuery.ts b/node_modules/@tanstack/react-query/src/useQuery.ts new file mode 100644 index 0000000..52d4795 --- /dev/null +++ b/node_modules/@tanstack/react-query/src/useQuery.ts @@ -0,0 +1,52 @@ +'use client' +import { QueryObserver } from '@tanstack/query-core' +import { useBaseQuery } from './useBaseQuery' +import type { + DefaultError, + NoInfer, + QueryClient, + QueryKey, +} from '@tanstack/query-core' +import type { + DefinedUseQueryResult, + UseQueryOptions, + UseQueryResult, +} from './types' +import type { + DefinedInitialDataOptions, + UndefinedInitialDataOptions, +} from './queryOptions' + +export function useQuery< + TQueryFnData = unknown, + TError = DefaultError, + TData = TQueryFnData, + TQueryKey extends QueryKey = QueryKey, +>( + options: DefinedInitialDataOptions, + queryClient?: QueryClient, +): DefinedUseQueryResult, TError> + +export function useQuery< + TQueryFnData = unknown, + TError = DefaultError, + TData = TQueryFnData, + TQueryKey extends QueryKey = QueryKey, +>( + options: UndefinedInitialDataOptions, + queryClient?: QueryClient, +): UseQueryResult, TError> + +export function useQuery< + TQueryFnData = unknown, + TError = DefaultError, + TData = TQueryFnData, + TQueryKey extends QueryKey = QueryKey, +>( + options: UseQueryOptions, + queryClient?: QueryClient, +): UseQueryResult, TError> + +export function useQuery(options: UseQueryOptions, queryClient?: QueryClient) { + return useBaseQuery(options, QueryObserver, queryClient) +} diff --git a/node_modules/@tanstack/react-query/src/useSuspenseInfiniteQuery.ts b/node_modules/@tanstack/react-query/src/useSuspenseInfiniteQuery.ts new file mode 100644 index 0000000..3c2fdfd --- /dev/null +++ b/node_modules/@tanstack/react-query/src/useSuspenseInfiniteQuery.ts @@ -0,0 +1,50 @@ +'use client' +import { InfiniteQueryObserver, skipToken } from '@tanstack/query-core' +import { useBaseQuery } from './useBaseQuery' +import { defaultThrowOnError } from './suspense' +import type { + DefaultError, + InfiniteData, + InfiniteQueryObserverSuccessResult, + QueryClient, + QueryKey, + QueryObserver, +} from '@tanstack/query-core' +import type { + UseSuspenseInfiniteQueryOptions, + UseSuspenseInfiniteQueryResult, +} from './types' + +export function useSuspenseInfiniteQuery< + TQueryFnData, + TError = DefaultError, + TData = InfiniteData, + TQueryKey extends QueryKey = QueryKey, + TPageParam = unknown, +>( + options: UseSuspenseInfiniteQueryOptions< + TQueryFnData, + TError, + TData, + TQueryKey, + TPageParam + >, + queryClient?: QueryClient, +): UseSuspenseInfiniteQueryResult { + if (process.env.NODE_ENV !== 'production') { + if ((options.queryFn as any) === skipToken) { + console.error('skipToken is not allowed for useSuspenseInfiniteQuery') + } + } + + return useBaseQuery( + { + ...options, + enabled: true, + suspense: true, + throwOnError: defaultThrowOnError, + }, + InfiniteQueryObserver as typeof QueryObserver, + queryClient, + ) as InfiniteQueryObserverSuccessResult +} diff --git a/node_modules/@tanstack/react-query/src/useSuspenseQueries.ts b/node_modules/@tanstack/react-query/src/useSuspenseQueries.ts new file mode 100644 index 0000000..f014095 --- /dev/null +++ b/node_modules/@tanstack/react-query/src/useSuspenseQueries.ts @@ -0,0 +1,211 @@ +'use client' +import { skipToken } from '@tanstack/query-core' +import { useQueries } from './useQueries' +import { defaultThrowOnError } from './suspense' +import type { UseSuspenseQueryOptions, UseSuspenseQueryResult } from './types' +import type { + DefaultError, + QueryClient, + QueryFunction, + ThrowOnError, +} from '@tanstack/query-core' + +// Avoid TS depth-limit error in case of large array literal +type MAXIMUM_DEPTH = 20 + +// Widen the type of the symbol to enable type inference even if skipToken is not immutable. +type SkipTokenForUseQueries = symbol + +type GetUseSuspenseQueryOptions = + // Part 1: responsible for applying explicit type parameter to function arguments, if object { queryFnData: TQueryFnData, error: TError, data: TData } + T extends { + queryFnData: infer TQueryFnData + error?: infer TError + data: infer TData + } + ? UseSuspenseQueryOptions + : T extends { queryFnData: infer TQueryFnData; error?: infer TError } + ? UseSuspenseQueryOptions + : T extends { data: infer TData; error?: infer TError } + ? UseSuspenseQueryOptions + : // Part 2: responsible for applying explicit type parameter to function arguments, if tuple [TQueryFnData, TError, TData] + T extends [infer TQueryFnData, infer TError, infer TData] + ? UseSuspenseQueryOptions + : T extends [infer TQueryFnData, infer TError] + ? UseSuspenseQueryOptions + : T extends [infer TQueryFnData] + ? UseSuspenseQueryOptions + : // Part 3: responsible for inferring and enforcing type if no explicit parameter was provided + T extends { + queryFn?: + | QueryFunction + | SkipTokenForUseQueries + select?: (data: any) => infer TData + throwOnError?: ThrowOnError + } + ? UseSuspenseQueryOptions< + TQueryFnData, + TError, + TData, + TQueryKey + > + : T extends { + queryFn?: + | QueryFunction + | SkipTokenForUseQueries + throwOnError?: ThrowOnError + } + ? UseSuspenseQueryOptions< + TQueryFnData, + TError, + TQueryFnData, + TQueryKey + > + : // Fallback + UseSuspenseQueryOptions + +type GetUseSuspenseQueryResult = + // Part 1: responsible for mapping explicit type parameter to function result, if object + T extends { queryFnData: any; error?: infer TError; data: infer TData } + ? UseSuspenseQueryResult + : T extends { queryFnData: infer TQueryFnData; error?: infer TError } + ? UseSuspenseQueryResult + : T extends { data: infer TData; error?: infer TError } + ? UseSuspenseQueryResult + : // Part 2: responsible for mapping explicit type parameter to function result, if tuple + T extends [any, infer TError, infer TData] + ? UseSuspenseQueryResult + : T extends [infer TQueryFnData, infer TError] + ? UseSuspenseQueryResult + : T extends [infer TQueryFnData] + ? UseSuspenseQueryResult + : // Part 3: responsible for mapping inferred type to results, if no explicit parameter was provided + T extends { + queryFn?: + | QueryFunction + | SkipTokenForUseQueries + select?: (data: any) => infer TData + throwOnError?: ThrowOnError + } + ? UseSuspenseQueryResult< + unknown extends TData ? TQueryFnData : TData, + unknown extends TError ? DefaultError : TError + > + : T extends { + queryFn?: + | QueryFunction + | SkipTokenForUseQueries + throwOnError?: ThrowOnError + } + ? UseSuspenseQueryResult< + TQueryFnData, + unknown extends TError ? DefaultError : TError + > + : // Fallback + UseSuspenseQueryResult + +/** + * SuspenseQueriesOptions reducer recursively unwraps function arguments to infer/enforce type param + */ +export type SuspenseQueriesOptions< + T extends Array, + TResults extends Array = [], + TDepth extends ReadonlyArray = [], +> = TDepth['length'] extends MAXIMUM_DEPTH + ? Array + : T extends [] + ? [] + : T extends [infer Head] + ? [...TResults, GetUseSuspenseQueryOptions] + : T extends [infer Head, ...infer Tails] + ? SuspenseQueriesOptions< + [...Tails], + [...TResults, GetUseSuspenseQueryOptions], + [...TDepth, 1] + > + : Array extends T + ? T + : // If T is *some* array but we couldn't assign unknown[] to it, then it must hold some known/homogenous type! + // use this to infer the param types in the case of Array.map() argument + T extends Array< + UseSuspenseQueryOptions< + infer TQueryFnData, + infer TError, + infer TData, + infer TQueryKey + > + > + ? Array< + UseSuspenseQueryOptions + > + : // Fallback + Array + +/** + * SuspenseQueriesResults reducer recursively maps type param to results + */ +export type SuspenseQueriesResults< + T extends Array, + TResults extends Array = [], + TDepth extends ReadonlyArray = [], +> = TDepth['length'] extends MAXIMUM_DEPTH + ? Array + : T extends [] + ? [] + : T extends [infer Head] + ? [...TResults, GetUseSuspenseQueryResult] + : T extends [infer Head, ...infer Tails] + ? SuspenseQueriesResults< + [...Tails], + [...TResults, GetUseSuspenseQueryResult], + [...TDepth, 1] + > + : { [K in keyof T]: GetUseSuspenseQueryResult } + +export function useSuspenseQueries< + T extends Array, + TCombinedResult = SuspenseQueriesResults, +>( + options: { + queries: + | readonly [...SuspenseQueriesOptions] + | readonly [...{ [K in keyof T]: GetUseSuspenseQueryOptions }] + combine?: (result: SuspenseQueriesResults) => TCombinedResult + }, + queryClient?: QueryClient, +): TCombinedResult + +export function useSuspenseQueries< + T extends Array, + TCombinedResult = SuspenseQueriesResults, +>( + options: { + queries: readonly [...SuspenseQueriesOptions] + combine?: (result: SuspenseQueriesResults) => TCombinedResult + }, + queryClient?: QueryClient, +): TCombinedResult + +export function useSuspenseQueries(options: any, queryClient?: QueryClient) { + return useQueries( + { + ...options, + queries: options.queries.map((query: any) => { + if (process.env.NODE_ENV !== 'production') { + if (query.queryFn === skipToken) { + console.error('skipToken is not allowed for useSuspenseQueries') + } + } + + return { + ...query, + suspense: true, + throwOnError: defaultThrowOnError, + enabled: true, + placeholderData: undefined, + } + }), + }, + queryClient, + ) +} diff --git a/node_modules/@tanstack/react-query/src/useSuspenseQuery.ts b/node_modules/@tanstack/react-query/src/useSuspenseQuery.ts new file mode 100644 index 0000000..7dfdb06 --- /dev/null +++ b/node_modules/@tanstack/react-query/src/useSuspenseQuery.ts @@ -0,0 +1,34 @@ +'use client' +import { QueryObserver, skipToken } from '@tanstack/query-core' +import { useBaseQuery } from './useBaseQuery' +import { defaultThrowOnError } from './suspense' +import type { UseSuspenseQueryOptions, UseSuspenseQueryResult } from './types' +import type { DefaultError, QueryClient, QueryKey } from '@tanstack/query-core' + +export function useSuspenseQuery< + TQueryFnData = unknown, + TError = DefaultError, + TData = TQueryFnData, + TQueryKey extends QueryKey = QueryKey, +>( + options: UseSuspenseQueryOptions, + queryClient?: QueryClient, +): UseSuspenseQueryResult { + if (process.env.NODE_ENV !== 'production') { + if ((options.queryFn as any) === skipToken) { + console.error('skipToken is not allowed for useSuspenseQuery') + } + } + + return useBaseQuery( + { + ...options, + enabled: true, + suspense: true, + throwOnError: defaultThrowOnError, + placeholderData: undefined, + }, + QueryObserver, + queryClient, + ) as UseSuspenseQueryResult +} diff --git a/node_modules/react/LICENSE b/node_modules/react/LICENSE new file mode 100644 index 0000000..b93be90 --- /dev/null +++ b/node_modules/react/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) Meta Platforms, Inc. and affiliates. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/react/README.md b/node_modules/react/README.md new file mode 100644 index 0000000..20a855e --- /dev/null +++ b/node_modules/react/README.md @@ -0,0 +1,37 @@ +# `react` + +React is a JavaScript library for creating user interfaces. + +The `react` package contains only the functionality necessary to define React components. It is typically used together with a React renderer like `react-dom` for the web, or `react-native` for the native environments. + +**Note:** by default, React will be in development mode. The development version includes extra warnings about common mistakes, whereas the production version includes extra performance optimizations and strips all error messages. Don't forget to use the [production build](https://reactjs.org/docs/optimizing-performance.html#use-the-production-build) when deploying your application. + +## Usage + +```js +import { useState } from 'react'; +import { createRoot } from 'react-dom/client'; + +function Counter() { + const [count, setCount] = useState(0); + return ( + <> +

{count}

+ + + ); +} + +const root = createRoot(document.getElementById('root')); +root.render(); +``` + +## Documentation + +See https://react.dev/ + +## API + +See https://react.dev/reference/react diff --git a/node_modules/react/cjs/react-compiler-runtime.development.js b/node_modules/react/cjs/react-compiler-runtime.development.js new file mode 100644 index 0000000..84ceaac --- /dev/null +++ b/node_modules/react/cjs/react-compiler-runtime.development.js @@ -0,0 +1,24 @@ +/** + * @license React + * react-compiler-runtime.development.js + * + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +"use strict"; +"production" !== process.env.NODE_ENV && + (function () { + var ReactSharedInternals = + require("react").__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE; + exports.c = function (size) { + var dispatcher = ReactSharedInternals.H; + null === dispatcher && + console.error( + "Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\n1. You might have mismatching versions of React and the renderer (such as React DOM)\n2. You might be breaking the Rules of Hooks\n3. You might have more than one copy of React in the same app\nSee https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem." + ); + return dispatcher.useMemoCache(size); + }; + })(); diff --git a/node_modules/react/cjs/react-compiler-runtime.production.js b/node_modules/react/cjs/react-compiler-runtime.production.js new file mode 100644 index 0000000..4d5ade3 --- /dev/null +++ b/node_modules/react/cjs/react-compiler-runtime.production.js @@ -0,0 +1,16 @@ +/** + * @license React + * react-compiler-runtime.production.js + * + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +"use strict"; +var ReactSharedInternals = + require("react").__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE; +exports.c = function (size) { + return ReactSharedInternals.H.useMemoCache(size); +}; diff --git a/node_modules/react/cjs/react-compiler-runtime.profiling.js b/node_modules/react/cjs/react-compiler-runtime.profiling.js new file mode 100644 index 0000000..9b93257 --- /dev/null +++ b/node_modules/react/cjs/react-compiler-runtime.profiling.js @@ -0,0 +1,16 @@ +/** + * @license React + * react-compiler-runtime.profiling.js + * + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +"use strict"; +var ReactSharedInternals = + require("react").__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE; +exports.c = function (size) { + return ReactSharedInternals.H.useMemoCache(size); +}; diff --git a/node_modules/react/cjs/react-jsx-dev-runtime.development.js b/node_modules/react/cjs/react-jsx-dev-runtime.development.js new file mode 100644 index 0000000..95f9877 --- /dev/null +++ b/node_modules/react/cjs/react-jsx-dev-runtime.development.js @@ -0,0 +1,338 @@ +/** + * @license React + * react-jsx-dev-runtime.development.js + * + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +"use strict"; +"production" !== process.env.NODE_ENV && + (function () { + function getComponentNameFromType(type) { + if (null == type) return null; + if ("function" === typeof type) + return type.$$typeof === REACT_CLIENT_REFERENCE + ? null + : type.displayName || type.name || null; + if ("string" === typeof type) return type; + switch (type) { + case REACT_FRAGMENT_TYPE: + return "Fragment"; + case REACT_PROFILER_TYPE: + return "Profiler"; + case REACT_STRICT_MODE_TYPE: + return "StrictMode"; + case REACT_SUSPENSE_TYPE: + return "Suspense"; + case REACT_SUSPENSE_LIST_TYPE: + return "SuspenseList"; + case REACT_ACTIVITY_TYPE: + return "Activity"; + } + if ("object" === typeof type) + switch ( + ("number" === typeof type.tag && + console.error( + "Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue." + ), + type.$$typeof) + ) { + case REACT_PORTAL_TYPE: + return "Portal"; + case REACT_CONTEXT_TYPE: + return type.displayName || "Context"; + case REACT_CONSUMER_TYPE: + return (type._context.displayName || "Context") + ".Consumer"; + case REACT_FORWARD_REF_TYPE: + var innerType = type.render; + type = type.displayName; + type || + ((type = innerType.displayName || innerType.name || ""), + (type = "" !== type ? "ForwardRef(" + type + ")" : "ForwardRef")); + return type; + case REACT_MEMO_TYPE: + return ( + (innerType = type.displayName || null), + null !== innerType + ? innerType + : getComponentNameFromType(type.type) || "Memo" + ); + case REACT_LAZY_TYPE: + innerType = type._payload; + type = type._init; + try { + return getComponentNameFromType(type(innerType)); + } catch (x) {} + } + return null; + } + function testStringCoercion(value) { + return "" + value; + } + function checkKeyStringCoercion(value) { + try { + testStringCoercion(value); + var JSCompiler_inline_result = !1; + } catch (e) { + JSCompiler_inline_result = !0; + } + if (JSCompiler_inline_result) { + JSCompiler_inline_result = console; + var JSCompiler_temp_const = JSCompiler_inline_result.error; + var JSCompiler_inline_result$jscomp$0 = + ("function" === typeof Symbol && + Symbol.toStringTag && + value[Symbol.toStringTag]) || + value.constructor.name || + "Object"; + JSCompiler_temp_const.call( + JSCompiler_inline_result, + "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.", + JSCompiler_inline_result$jscomp$0 + ); + return testStringCoercion(value); + } + } + function getTaskName(type) { + if (type === REACT_FRAGMENT_TYPE) return "<>"; + if ( + "object" === typeof type && + null !== type && + type.$$typeof === REACT_LAZY_TYPE + ) + return "<...>"; + try { + var name = getComponentNameFromType(type); + return name ? "<" + name + ">" : "<...>"; + } catch (x) { + return "<...>"; + } + } + function getOwner() { + var dispatcher = ReactSharedInternals.A; + return null === dispatcher ? null : dispatcher.getOwner(); + } + function UnknownOwner() { + return Error("react-stack-top-frame"); + } + function hasValidKey(config) { + if (hasOwnProperty.call(config, "key")) { + var getter = Object.getOwnPropertyDescriptor(config, "key").get; + if (getter && getter.isReactWarning) return !1; + } + return void 0 !== config.key; + } + function defineKeyPropWarningGetter(props, displayName) { + function warnAboutAccessingKey() { + specialPropKeyWarningShown || + ((specialPropKeyWarningShown = !0), + console.error( + "%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)", + displayName + )); + } + warnAboutAccessingKey.isReactWarning = !0; + Object.defineProperty(props, "key", { + get: warnAboutAccessingKey, + configurable: !0 + }); + } + function elementRefGetterWithDeprecationWarning() { + var componentName = getComponentNameFromType(this.type); + didWarnAboutElementRef[componentName] || + ((didWarnAboutElementRef[componentName] = !0), + console.error( + "Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release." + )); + componentName = this.props.ref; + return void 0 !== componentName ? componentName : null; + } + function ReactElement(type, key, props, owner, debugStack, debugTask) { + var refProp = props.ref; + type = { + $$typeof: REACT_ELEMENT_TYPE, + type: type, + key: key, + props: props, + _owner: owner + }; + null !== (void 0 !== refProp ? refProp : null) + ? Object.defineProperty(type, "ref", { + enumerable: !1, + get: elementRefGetterWithDeprecationWarning + }) + : Object.defineProperty(type, "ref", { enumerable: !1, value: null }); + type._store = {}; + Object.defineProperty(type._store, "validated", { + configurable: !1, + enumerable: !1, + writable: !0, + value: 0 + }); + Object.defineProperty(type, "_debugInfo", { + configurable: !1, + enumerable: !1, + writable: !0, + value: null + }); + Object.defineProperty(type, "_debugStack", { + configurable: !1, + enumerable: !1, + writable: !0, + value: debugStack + }); + Object.defineProperty(type, "_debugTask", { + configurable: !1, + enumerable: !1, + writable: !0, + value: debugTask + }); + Object.freeze && (Object.freeze(type.props), Object.freeze(type)); + return type; + } + function jsxDEVImpl( + type, + config, + maybeKey, + isStaticChildren, + debugStack, + debugTask + ) { + var children = config.children; + if (void 0 !== children) + if (isStaticChildren) + if (isArrayImpl(children)) { + for ( + isStaticChildren = 0; + isStaticChildren < children.length; + isStaticChildren++ + ) + validateChildKeys(children[isStaticChildren]); + Object.freeze && Object.freeze(children); + } else + console.error( + "React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead." + ); + else validateChildKeys(children); + if (hasOwnProperty.call(config, "key")) { + children = getComponentNameFromType(type); + var keys = Object.keys(config).filter(function (k) { + return "key" !== k; + }); + isStaticChildren = + 0 < keys.length + ? "{key: someKey, " + keys.join(": ..., ") + ": ...}" + : "{key: someKey}"; + didWarnAboutKeySpread[children + isStaticChildren] || + ((keys = + 0 < keys.length ? "{" + keys.join(": ..., ") + ": ...}" : "{}"), + console.error( + 'A props object containing a "key" prop is being spread into JSX:\n let props = %s;\n <%s {...props} />\nReact keys must be passed directly to JSX without using spread:\n let props = %s;\n <%s key={someKey} {...props} />', + isStaticChildren, + children, + keys, + children + ), + (didWarnAboutKeySpread[children + isStaticChildren] = !0)); + } + children = null; + void 0 !== maybeKey && + (checkKeyStringCoercion(maybeKey), (children = "" + maybeKey)); + hasValidKey(config) && + (checkKeyStringCoercion(config.key), (children = "" + config.key)); + if ("key" in config) { + maybeKey = {}; + for (var propName in config) + "key" !== propName && (maybeKey[propName] = config[propName]); + } else maybeKey = config; + children && + defineKeyPropWarningGetter( + maybeKey, + "function" === typeof type + ? type.displayName || type.name || "Unknown" + : type + ); + return ReactElement( + type, + children, + maybeKey, + getOwner(), + debugStack, + debugTask + ); + } + function validateChildKeys(node) { + isValidElement(node) + ? node._store && (node._store.validated = 1) + : "object" === typeof node && + null !== node && + node.$$typeof === REACT_LAZY_TYPE && + ("fulfilled" === node._payload.status + ? isValidElement(node._payload.value) && + node._payload.value._store && + (node._payload.value._store.validated = 1) + : node._store && (node._store.validated = 1)); + } + function isValidElement(object) { + return ( + "object" === typeof object && + null !== object && + object.$$typeof === REACT_ELEMENT_TYPE + ); + } + var React = require("react"), + REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"), + REACT_PORTAL_TYPE = Symbol.for("react.portal"), + REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"), + REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"), + REACT_PROFILER_TYPE = Symbol.for("react.profiler"), + REACT_CONSUMER_TYPE = Symbol.for("react.consumer"), + REACT_CONTEXT_TYPE = Symbol.for("react.context"), + REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"), + REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"), + REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"), + REACT_MEMO_TYPE = Symbol.for("react.memo"), + REACT_LAZY_TYPE = Symbol.for("react.lazy"), + REACT_ACTIVITY_TYPE = Symbol.for("react.activity"), + REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference"), + ReactSharedInternals = + React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, + hasOwnProperty = Object.prototype.hasOwnProperty, + isArrayImpl = Array.isArray, + createTask = console.createTask + ? console.createTask + : function () { + return null; + }; + React = { + react_stack_bottom_frame: function (callStackForError) { + return callStackForError(); + } + }; + var specialPropKeyWarningShown; + var didWarnAboutElementRef = {}; + var unknownOwnerDebugStack = React.react_stack_bottom_frame.bind( + React, + UnknownOwner + )(); + var unknownOwnerDebugTask = createTask(getTaskName(UnknownOwner)); + var didWarnAboutKeySpread = {}; + exports.Fragment = REACT_FRAGMENT_TYPE; + exports.jsxDEV = function (type, config, maybeKey, isStaticChildren) { + var trackActualOwner = + 1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++; + return jsxDEVImpl( + type, + config, + maybeKey, + isStaticChildren, + trackActualOwner + ? Error("react-stack-top-frame") + : unknownOwnerDebugStack, + trackActualOwner ? createTask(getTaskName(type)) : unknownOwnerDebugTask + ); + }; + })(); diff --git a/node_modules/react/cjs/react-jsx-dev-runtime.production.js b/node_modules/react/cjs/react-jsx-dev-runtime.production.js new file mode 100644 index 0000000..22ad886 --- /dev/null +++ b/node_modules/react/cjs/react-jsx-dev-runtime.production.js @@ -0,0 +1,14 @@ +/** + * @license React + * react-jsx-dev-runtime.production.js + * + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +"use strict"; +var REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"); +exports.Fragment = REACT_FRAGMENT_TYPE; +exports.jsxDEV = void 0; diff --git a/node_modules/react/cjs/react-jsx-dev-runtime.profiling.js b/node_modules/react/cjs/react-jsx-dev-runtime.profiling.js new file mode 100644 index 0000000..f9e8942 --- /dev/null +++ b/node_modules/react/cjs/react-jsx-dev-runtime.profiling.js @@ -0,0 +1,14 @@ +/** + * @license React + * react-jsx-dev-runtime.profiling.js + * + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +"use strict"; +var REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"); +exports.Fragment = REACT_FRAGMENT_TYPE; +exports.jsxDEV = void 0; diff --git a/node_modules/react/cjs/react-jsx-dev-runtime.react-server.development.js b/node_modules/react/cjs/react-jsx-dev-runtime.react-server.development.js new file mode 100644 index 0000000..b79b758 --- /dev/null +++ b/node_modules/react/cjs/react-jsx-dev-runtime.react-server.development.js @@ -0,0 +1,370 @@ +/** + * @license React + * react-jsx-dev-runtime.react-server.development.js + * + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +"use strict"; +"production" !== process.env.NODE_ENV && + (function () { + function getComponentNameFromType(type) { + if (null == type) return null; + if ("function" === typeof type) + return type.$$typeof === REACT_CLIENT_REFERENCE + ? null + : type.displayName || type.name || null; + if ("string" === typeof type) return type; + switch (type) { + case REACT_FRAGMENT_TYPE: + return "Fragment"; + case REACT_PROFILER_TYPE: + return "Profiler"; + case REACT_STRICT_MODE_TYPE: + return "StrictMode"; + case REACT_SUSPENSE_TYPE: + return "Suspense"; + case REACT_SUSPENSE_LIST_TYPE: + return "SuspenseList"; + case REACT_ACTIVITY_TYPE: + return "Activity"; + } + if ("object" === typeof type) + switch ( + ("number" === typeof type.tag && + console.error( + "Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue." + ), + type.$$typeof) + ) { + case REACT_PORTAL_TYPE: + return "Portal"; + case REACT_CONTEXT_TYPE: + return type.displayName || "Context"; + case REACT_CONSUMER_TYPE: + return (type._context.displayName || "Context") + ".Consumer"; + case REACT_FORWARD_REF_TYPE: + var innerType = type.render; + type = type.displayName; + type || + ((type = innerType.displayName || innerType.name || ""), + (type = "" !== type ? "ForwardRef(" + type + ")" : "ForwardRef")); + return type; + case REACT_MEMO_TYPE: + return ( + (innerType = type.displayName || null), + null !== innerType + ? innerType + : getComponentNameFromType(type.type) || "Memo" + ); + case REACT_LAZY_TYPE: + innerType = type._payload; + type = type._init; + try { + return getComponentNameFromType(type(innerType)); + } catch (x) {} + } + return null; + } + function testStringCoercion(value) { + return "" + value; + } + function checkKeyStringCoercion(value) { + try { + testStringCoercion(value); + var JSCompiler_inline_result = !1; + } catch (e) { + JSCompiler_inline_result = !0; + } + if (JSCompiler_inline_result) { + JSCompiler_inline_result = console; + var JSCompiler_temp_const = JSCompiler_inline_result.error; + var JSCompiler_inline_result$jscomp$0 = + ("function" === typeof Symbol && + Symbol.toStringTag && + value[Symbol.toStringTag]) || + value.constructor.name || + "Object"; + JSCompiler_temp_const.call( + JSCompiler_inline_result, + "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.", + JSCompiler_inline_result$jscomp$0 + ); + return testStringCoercion(value); + } + } + function getTaskName(type) { + if (type === REACT_FRAGMENT_TYPE) return "<>"; + if ( + "object" === typeof type && + null !== type && + type.$$typeof === REACT_LAZY_TYPE + ) + return "<...>"; + try { + var name = getComponentNameFromType(type); + return name ? "<" + name + ">" : "<...>"; + } catch (x) { + return "<...>"; + } + } + function getOwner() { + var dispatcher = ReactSharedInternalsServer.A; + return null === dispatcher ? null : dispatcher.getOwner(); + } + function UnknownOwner() { + return Error("react-stack-top-frame"); + } + function hasValidKey(config) { + if (hasOwnProperty.call(config, "key")) { + var getter = Object.getOwnPropertyDescriptor(config, "key").get; + if (getter && getter.isReactWarning) return !1; + } + return void 0 !== config.key; + } + function defineKeyPropWarningGetter(props, displayName) { + function warnAboutAccessingKey() { + specialPropKeyWarningShown || + ((specialPropKeyWarningShown = !0), + console.error( + "%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)", + displayName + )); + } + warnAboutAccessingKey.isReactWarning = !0; + Object.defineProperty(props, "key", { + get: warnAboutAccessingKey, + configurable: !0 + }); + } + function elementRefGetterWithDeprecationWarning() { + var componentName = getComponentNameFromType(this.type); + didWarnAboutElementRef[componentName] || + ((didWarnAboutElementRef[componentName] = !0), + console.error( + "Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release." + )); + componentName = this.props.ref; + return void 0 !== componentName ? componentName : null; + } + function ReactElement(type, key, props, owner, debugStack, debugTask) { + var refProp = props.ref; + type = { + $$typeof: REACT_ELEMENT_TYPE, + type: type, + key: key, + props: props, + _owner: owner + }; + null !== (void 0 !== refProp ? refProp : null) + ? Object.defineProperty(type, "ref", { + enumerable: !1, + get: elementRefGetterWithDeprecationWarning + }) + : Object.defineProperty(type, "ref", { enumerable: !1, value: null }); + type._store = {}; + Object.defineProperty(type._store, "validated", { + configurable: !1, + enumerable: !1, + writable: !0, + value: 0 + }); + Object.defineProperty(type, "_debugInfo", { + configurable: !1, + enumerable: !1, + writable: !0, + value: null + }); + Object.defineProperty(type, "_debugStack", { + configurable: !1, + enumerable: !1, + writable: !0, + value: debugStack + }); + Object.defineProperty(type, "_debugTask", { + configurable: !1, + enumerable: !1, + writable: !0, + value: debugTask + }); + Object.freeze && (Object.freeze(type.props), Object.freeze(type)); + return type; + } + function jsxDEVImpl( + type, + config, + maybeKey, + isStaticChildren, + debugStack, + debugTask + ) { + var children = config.children; + if (void 0 !== children) + if (isStaticChildren) + if (isArrayImpl(children)) { + for ( + isStaticChildren = 0; + isStaticChildren < children.length; + isStaticChildren++ + ) + validateChildKeys(children[isStaticChildren]); + Object.freeze && Object.freeze(children); + } else + console.error( + "React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead." + ); + else validateChildKeys(children); + if (hasOwnProperty.call(config, "key")) { + children = getComponentNameFromType(type); + var keys = Object.keys(config).filter(function (k) { + return "key" !== k; + }); + isStaticChildren = + 0 < keys.length + ? "{key: someKey, " + keys.join(": ..., ") + ": ...}" + : "{key: someKey}"; + didWarnAboutKeySpread[children + isStaticChildren] || + ((keys = + 0 < keys.length ? "{" + keys.join(": ..., ") + ": ...}" : "{}"), + console.error( + 'A props object containing a "key" prop is being spread into JSX:\n let props = %s;\n <%s {...props} />\nReact keys must be passed directly to JSX without using spread:\n let props = %s;\n <%s key={someKey} {...props} />', + isStaticChildren, + children, + keys, + children + ), + (didWarnAboutKeySpread[children + isStaticChildren] = !0)); + } + children = null; + void 0 !== maybeKey && + (checkKeyStringCoercion(maybeKey), (children = "" + maybeKey)); + hasValidKey(config) && + (checkKeyStringCoercion(config.key), (children = "" + config.key)); + if ("key" in config) { + maybeKey = {}; + for (var propName in config) + "key" !== propName && (maybeKey[propName] = config[propName]); + } else maybeKey = config; + children && + defineKeyPropWarningGetter( + maybeKey, + "function" === typeof type + ? type.displayName || type.name || "Unknown" + : type + ); + return ReactElement( + type, + children, + maybeKey, + getOwner(), + debugStack, + debugTask + ); + } + function validateChildKeys(node) { + isValidElement(node) + ? node._store && (node._store.validated = 1) + : "object" === typeof node && + null !== node && + node.$$typeof === REACT_LAZY_TYPE && + ("fulfilled" === node._payload.status + ? isValidElement(node._payload.value) && + node._payload.value._store && + (node._payload.value._store.validated = 1) + : node._store && (node._store.validated = 1)); + } + function isValidElement(object) { + return ( + "object" === typeof object && + null !== object && + object.$$typeof === REACT_ELEMENT_TYPE + ); + } + var React = require("react"), + REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"), + REACT_PORTAL_TYPE = Symbol.for("react.portal"), + REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"), + REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"), + REACT_PROFILER_TYPE = Symbol.for("react.profiler"), + REACT_CONSUMER_TYPE = Symbol.for("react.consumer"), + REACT_CONTEXT_TYPE = Symbol.for("react.context"), + REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"), + REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"), + REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"), + REACT_MEMO_TYPE = Symbol.for("react.memo"), + REACT_LAZY_TYPE = Symbol.for("react.lazy"), + REACT_ACTIVITY_TYPE = Symbol.for("react.activity"), + REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference"), + ReactSharedInternalsServer = + React.__SERVER_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE; + if (!ReactSharedInternalsServer) + throw Error( + 'The "react" package in this environment is not configured correctly. The "react-server" condition must be enabled in any environment that runs React Server Components.' + ); + var hasOwnProperty = Object.prototype.hasOwnProperty, + isArrayImpl = Array.isArray, + createTask = console.createTask + ? console.createTask + : function () { + return null; + }; + React = { + react_stack_bottom_frame: function (callStackForError) { + return callStackForError(); + } + }; + var specialPropKeyWarningShown; + var didWarnAboutElementRef = {}; + var unknownOwnerDebugStack = React.react_stack_bottom_frame.bind( + React, + UnknownOwner + )(); + var unknownOwnerDebugTask = createTask(getTaskName(UnknownOwner)); + var didWarnAboutKeySpread = {}; + exports.Fragment = REACT_FRAGMENT_TYPE; + exports.jsx = function (type, config, maybeKey) { + var trackActualOwner = + 1e4 > ReactSharedInternalsServer.recentlyCreatedOwnerStacks++; + return jsxDEVImpl( + type, + config, + maybeKey, + !1, + trackActualOwner + ? Error("react-stack-top-frame") + : unknownOwnerDebugStack, + trackActualOwner ? createTask(getTaskName(type)) : unknownOwnerDebugTask + ); + }; + exports.jsxDEV = function (type, config, maybeKey, isStaticChildren) { + var trackActualOwner = + 1e4 > ReactSharedInternalsServer.recentlyCreatedOwnerStacks++; + return jsxDEVImpl( + type, + config, + maybeKey, + isStaticChildren, + trackActualOwner + ? Error("react-stack-top-frame") + : unknownOwnerDebugStack, + trackActualOwner ? createTask(getTaskName(type)) : unknownOwnerDebugTask + ); + }; + exports.jsxs = function (type, config, maybeKey) { + var trackActualOwner = + 1e4 > ReactSharedInternalsServer.recentlyCreatedOwnerStacks++; + return jsxDEVImpl( + type, + config, + maybeKey, + !0, + trackActualOwner + ? Error("react-stack-top-frame") + : unknownOwnerDebugStack, + trackActualOwner ? createTask(getTaskName(type)) : unknownOwnerDebugTask + ); + }; + })(); diff --git a/node_modules/react/cjs/react-jsx-dev-runtime.react-server.production.js b/node_modules/react/cjs/react-jsx-dev-runtime.react-server.production.js new file mode 100644 index 0000000..0664121 --- /dev/null +++ b/node_modules/react/cjs/react-jsx-dev-runtime.react-server.production.js @@ -0,0 +1,40 @@ +/** + * @license React + * react-jsx-dev-runtime.react-server.production.js + * + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +"use strict"; +var React = require("react"), + REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"), + REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"); +if (!React.__SERVER_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE) + throw Error( + 'The "react" package in this environment is not configured correctly. The "react-server" condition must be enabled in any environment that runs React Server Components.' + ); +function jsxProd(type, config, maybeKey) { + var key = null; + void 0 !== maybeKey && (key = "" + maybeKey); + void 0 !== config.key && (key = "" + config.key); + if ("key" in config) { + maybeKey = {}; + for (var propName in config) + "key" !== propName && (maybeKey[propName] = config[propName]); + } else maybeKey = config; + config = maybeKey.ref; + return { + $$typeof: REACT_ELEMENT_TYPE, + type: type, + key: key, + ref: void 0 !== config ? config : null, + props: maybeKey + }; +} +exports.Fragment = REACT_FRAGMENT_TYPE; +exports.jsx = jsxProd; +exports.jsxDEV = void 0; +exports.jsxs = jsxProd; diff --git a/node_modules/react/cjs/react-jsx-runtime.development.js b/node_modules/react/cjs/react-jsx-runtime.development.js new file mode 100644 index 0000000..35331a3 --- /dev/null +++ b/node_modules/react/cjs/react-jsx-runtime.development.js @@ -0,0 +1,352 @@ +/** + * @license React + * react-jsx-runtime.development.js + * + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +"use strict"; +"production" !== process.env.NODE_ENV && + (function () { + function getComponentNameFromType(type) { + if (null == type) return null; + if ("function" === typeof type) + return type.$$typeof === REACT_CLIENT_REFERENCE + ? null + : type.displayName || type.name || null; + if ("string" === typeof type) return type; + switch (type) { + case REACT_FRAGMENT_TYPE: + return "Fragment"; + case REACT_PROFILER_TYPE: + return "Profiler"; + case REACT_STRICT_MODE_TYPE: + return "StrictMode"; + case REACT_SUSPENSE_TYPE: + return "Suspense"; + case REACT_SUSPENSE_LIST_TYPE: + return "SuspenseList"; + case REACT_ACTIVITY_TYPE: + return "Activity"; + } + if ("object" === typeof type) + switch ( + ("number" === typeof type.tag && + console.error( + "Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue." + ), + type.$$typeof) + ) { + case REACT_PORTAL_TYPE: + return "Portal"; + case REACT_CONTEXT_TYPE: + return type.displayName || "Context"; + case REACT_CONSUMER_TYPE: + return (type._context.displayName || "Context") + ".Consumer"; + case REACT_FORWARD_REF_TYPE: + var innerType = type.render; + type = type.displayName; + type || + ((type = innerType.displayName || innerType.name || ""), + (type = "" !== type ? "ForwardRef(" + type + ")" : "ForwardRef")); + return type; + case REACT_MEMO_TYPE: + return ( + (innerType = type.displayName || null), + null !== innerType + ? innerType + : getComponentNameFromType(type.type) || "Memo" + ); + case REACT_LAZY_TYPE: + innerType = type._payload; + type = type._init; + try { + return getComponentNameFromType(type(innerType)); + } catch (x) {} + } + return null; + } + function testStringCoercion(value) { + return "" + value; + } + function checkKeyStringCoercion(value) { + try { + testStringCoercion(value); + var JSCompiler_inline_result = !1; + } catch (e) { + JSCompiler_inline_result = !0; + } + if (JSCompiler_inline_result) { + JSCompiler_inline_result = console; + var JSCompiler_temp_const = JSCompiler_inline_result.error; + var JSCompiler_inline_result$jscomp$0 = + ("function" === typeof Symbol && + Symbol.toStringTag && + value[Symbol.toStringTag]) || + value.constructor.name || + "Object"; + JSCompiler_temp_const.call( + JSCompiler_inline_result, + "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.", + JSCompiler_inline_result$jscomp$0 + ); + return testStringCoercion(value); + } + } + function getTaskName(type) { + if (type === REACT_FRAGMENT_TYPE) return "<>"; + if ( + "object" === typeof type && + null !== type && + type.$$typeof === REACT_LAZY_TYPE + ) + return "<...>"; + try { + var name = getComponentNameFromType(type); + return name ? "<" + name + ">" : "<...>"; + } catch (x) { + return "<...>"; + } + } + function getOwner() { + var dispatcher = ReactSharedInternals.A; + return null === dispatcher ? null : dispatcher.getOwner(); + } + function UnknownOwner() { + return Error("react-stack-top-frame"); + } + function hasValidKey(config) { + if (hasOwnProperty.call(config, "key")) { + var getter = Object.getOwnPropertyDescriptor(config, "key").get; + if (getter && getter.isReactWarning) return !1; + } + return void 0 !== config.key; + } + function defineKeyPropWarningGetter(props, displayName) { + function warnAboutAccessingKey() { + specialPropKeyWarningShown || + ((specialPropKeyWarningShown = !0), + console.error( + "%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)", + displayName + )); + } + warnAboutAccessingKey.isReactWarning = !0; + Object.defineProperty(props, "key", { + get: warnAboutAccessingKey, + configurable: !0 + }); + } + function elementRefGetterWithDeprecationWarning() { + var componentName = getComponentNameFromType(this.type); + didWarnAboutElementRef[componentName] || + ((didWarnAboutElementRef[componentName] = !0), + console.error( + "Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release." + )); + componentName = this.props.ref; + return void 0 !== componentName ? componentName : null; + } + function ReactElement(type, key, props, owner, debugStack, debugTask) { + var refProp = props.ref; + type = { + $$typeof: REACT_ELEMENT_TYPE, + type: type, + key: key, + props: props, + _owner: owner + }; + null !== (void 0 !== refProp ? refProp : null) + ? Object.defineProperty(type, "ref", { + enumerable: !1, + get: elementRefGetterWithDeprecationWarning + }) + : Object.defineProperty(type, "ref", { enumerable: !1, value: null }); + type._store = {}; + Object.defineProperty(type._store, "validated", { + configurable: !1, + enumerable: !1, + writable: !0, + value: 0 + }); + Object.defineProperty(type, "_debugInfo", { + configurable: !1, + enumerable: !1, + writable: !0, + value: null + }); + Object.defineProperty(type, "_debugStack", { + configurable: !1, + enumerable: !1, + writable: !0, + value: debugStack + }); + Object.defineProperty(type, "_debugTask", { + configurable: !1, + enumerable: !1, + writable: !0, + value: debugTask + }); + Object.freeze && (Object.freeze(type.props), Object.freeze(type)); + return type; + } + function jsxDEVImpl( + type, + config, + maybeKey, + isStaticChildren, + debugStack, + debugTask + ) { + var children = config.children; + if (void 0 !== children) + if (isStaticChildren) + if (isArrayImpl(children)) { + for ( + isStaticChildren = 0; + isStaticChildren < children.length; + isStaticChildren++ + ) + validateChildKeys(children[isStaticChildren]); + Object.freeze && Object.freeze(children); + } else + console.error( + "React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead." + ); + else validateChildKeys(children); + if (hasOwnProperty.call(config, "key")) { + children = getComponentNameFromType(type); + var keys = Object.keys(config).filter(function (k) { + return "key" !== k; + }); + isStaticChildren = + 0 < keys.length + ? "{key: someKey, " + keys.join(": ..., ") + ": ...}" + : "{key: someKey}"; + didWarnAboutKeySpread[children + isStaticChildren] || + ((keys = + 0 < keys.length ? "{" + keys.join(": ..., ") + ": ...}" : "{}"), + console.error( + 'A props object containing a "key" prop is being spread into JSX:\n let props = %s;\n <%s {...props} />\nReact keys must be passed directly to JSX without using spread:\n let props = %s;\n <%s key={someKey} {...props} />', + isStaticChildren, + children, + keys, + children + ), + (didWarnAboutKeySpread[children + isStaticChildren] = !0)); + } + children = null; + void 0 !== maybeKey && + (checkKeyStringCoercion(maybeKey), (children = "" + maybeKey)); + hasValidKey(config) && + (checkKeyStringCoercion(config.key), (children = "" + config.key)); + if ("key" in config) { + maybeKey = {}; + for (var propName in config) + "key" !== propName && (maybeKey[propName] = config[propName]); + } else maybeKey = config; + children && + defineKeyPropWarningGetter( + maybeKey, + "function" === typeof type + ? type.displayName || type.name || "Unknown" + : type + ); + return ReactElement( + type, + children, + maybeKey, + getOwner(), + debugStack, + debugTask + ); + } + function validateChildKeys(node) { + isValidElement(node) + ? node._store && (node._store.validated = 1) + : "object" === typeof node && + null !== node && + node.$$typeof === REACT_LAZY_TYPE && + ("fulfilled" === node._payload.status + ? isValidElement(node._payload.value) && + node._payload.value._store && + (node._payload.value._store.validated = 1) + : node._store && (node._store.validated = 1)); + } + function isValidElement(object) { + return ( + "object" === typeof object && + null !== object && + object.$$typeof === REACT_ELEMENT_TYPE + ); + } + var React = require("react"), + REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"), + REACT_PORTAL_TYPE = Symbol.for("react.portal"), + REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"), + REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"), + REACT_PROFILER_TYPE = Symbol.for("react.profiler"), + REACT_CONSUMER_TYPE = Symbol.for("react.consumer"), + REACT_CONTEXT_TYPE = Symbol.for("react.context"), + REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"), + REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"), + REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"), + REACT_MEMO_TYPE = Symbol.for("react.memo"), + REACT_LAZY_TYPE = Symbol.for("react.lazy"), + REACT_ACTIVITY_TYPE = Symbol.for("react.activity"), + REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference"), + ReactSharedInternals = + React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, + hasOwnProperty = Object.prototype.hasOwnProperty, + isArrayImpl = Array.isArray, + createTask = console.createTask + ? console.createTask + : function () { + return null; + }; + React = { + react_stack_bottom_frame: function (callStackForError) { + return callStackForError(); + } + }; + var specialPropKeyWarningShown; + var didWarnAboutElementRef = {}; + var unknownOwnerDebugStack = React.react_stack_bottom_frame.bind( + React, + UnknownOwner + )(); + var unknownOwnerDebugTask = createTask(getTaskName(UnknownOwner)); + var didWarnAboutKeySpread = {}; + exports.Fragment = REACT_FRAGMENT_TYPE; + exports.jsx = function (type, config, maybeKey) { + var trackActualOwner = + 1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++; + return jsxDEVImpl( + type, + config, + maybeKey, + !1, + trackActualOwner + ? Error("react-stack-top-frame") + : unknownOwnerDebugStack, + trackActualOwner ? createTask(getTaskName(type)) : unknownOwnerDebugTask + ); + }; + exports.jsxs = function (type, config, maybeKey) { + var trackActualOwner = + 1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++; + return jsxDEVImpl( + type, + config, + maybeKey, + !0, + trackActualOwner + ? Error("react-stack-top-frame") + : unknownOwnerDebugStack, + trackActualOwner ? createTask(getTaskName(type)) : unknownOwnerDebugTask + ); + }; + })(); diff --git a/node_modules/react/cjs/react-jsx-runtime.production.js b/node_modules/react/cjs/react-jsx-runtime.production.js new file mode 100644 index 0000000..12d6088 --- /dev/null +++ b/node_modules/react/cjs/react-jsx-runtime.production.js @@ -0,0 +1,34 @@ +/** + * @license React + * react-jsx-runtime.production.js + * + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +"use strict"; +var REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"), + REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"); +function jsxProd(type, config, maybeKey) { + var key = null; + void 0 !== maybeKey && (key = "" + maybeKey); + void 0 !== config.key && (key = "" + config.key); + if ("key" in config) { + maybeKey = {}; + for (var propName in config) + "key" !== propName && (maybeKey[propName] = config[propName]); + } else maybeKey = config; + config = maybeKey.ref; + return { + $$typeof: REACT_ELEMENT_TYPE, + type: type, + key: key, + ref: void 0 !== config ? config : null, + props: maybeKey + }; +} +exports.Fragment = REACT_FRAGMENT_TYPE; +exports.jsx = jsxProd; +exports.jsxs = jsxProd; diff --git a/node_modules/react/cjs/react-jsx-runtime.profiling.js b/node_modules/react/cjs/react-jsx-runtime.profiling.js new file mode 100644 index 0000000..68a28d6 --- /dev/null +++ b/node_modules/react/cjs/react-jsx-runtime.profiling.js @@ -0,0 +1,34 @@ +/** + * @license React + * react-jsx-runtime.profiling.js + * + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +"use strict"; +var REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"), + REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"); +function jsxProd(type, config, maybeKey) { + var key = null; + void 0 !== maybeKey && (key = "" + maybeKey); + void 0 !== config.key && (key = "" + config.key); + if ("key" in config) { + maybeKey = {}; + for (var propName in config) + "key" !== propName && (maybeKey[propName] = config[propName]); + } else maybeKey = config; + config = maybeKey.ref; + return { + $$typeof: REACT_ELEMENT_TYPE, + type: type, + key: key, + ref: void 0 !== config ? config : null, + props: maybeKey + }; +} +exports.Fragment = REACT_FRAGMENT_TYPE; +exports.jsx = jsxProd; +exports.jsxs = jsxProd; diff --git a/node_modules/react/cjs/react-jsx-runtime.react-server.development.js b/node_modules/react/cjs/react-jsx-runtime.react-server.development.js new file mode 100644 index 0000000..59ee4be --- /dev/null +++ b/node_modules/react/cjs/react-jsx-runtime.react-server.development.js @@ -0,0 +1,370 @@ +/** + * @license React + * react-jsx-runtime.react-server.development.js + * + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +"use strict"; +"production" !== process.env.NODE_ENV && + (function () { + function getComponentNameFromType(type) { + if (null == type) return null; + if ("function" === typeof type) + return type.$$typeof === REACT_CLIENT_REFERENCE + ? null + : type.displayName || type.name || null; + if ("string" === typeof type) return type; + switch (type) { + case REACT_FRAGMENT_TYPE: + return "Fragment"; + case REACT_PROFILER_TYPE: + return "Profiler"; + case REACT_STRICT_MODE_TYPE: + return "StrictMode"; + case REACT_SUSPENSE_TYPE: + return "Suspense"; + case REACT_SUSPENSE_LIST_TYPE: + return "SuspenseList"; + case REACT_ACTIVITY_TYPE: + return "Activity"; + } + if ("object" === typeof type) + switch ( + ("number" === typeof type.tag && + console.error( + "Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue." + ), + type.$$typeof) + ) { + case REACT_PORTAL_TYPE: + return "Portal"; + case REACT_CONTEXT_TYPE: + return type.displayName || "Context"; + case REACT_CONSUMER_TYPE: + return (type._context.displayName || "Context") + ".Consumer"; + case REACT_FORWARD_REF_TYPE: + var innerType = type.render; + type = type.displayName; + type || + ((type = innerType.displayName || innerType.name || ""), + (type = "" !== type ? "ForwardRef(" + type + ")" : "ForwardRef")); + return type; + case REACT_MEMO_TYPE: + return ( + (innerType = type.displayName || null), + null !== innerType + ? innerType + : getComponentNameFromType(type.type) || "Memo" + ); + case REACT_LAZY_TYPE: + innerType = type._payload; + type = type._init; + try { + return getComponentNameFromType(type(innerType)); + } catch (x) {} + } + return null; + } + function testStringCoercion(value) { + return "" + value; + } + function checkKeyStringCoercion(value) { + try { + testStringCoercion(value); + var JSCompiler_inline_result = !1; + } catch (e) { + JSCompiler_inline_result = !0; + } + if (JSCompiler_inline_result) { + JSCompiler_inline_result = console; + var JSCompiler_temp_const = JSCompiler_inline_result.error; + var JSCompiler_inline_result$jscomp$0 = + ("function" === typeof Symbol && + Symbol.toStringTag && + value[Symbol.toStringTag]) || + value.constructor.name || + "Object"; + JSCompiler_temp_const.call( + JSCompiler_inline_result, + "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.", + JSCompiler_inline_result$jscomp$0 + ); + return testStringCoercion(value); + } + } + function getTaskName(type) { + if (type === REACT_FRAGMENT_TYPE) return "<>"; + if ( + "object" === typeof type && + null !== type && + type.$$typeof === REACT_LAZY_TYPE + ) + return "<...>"; + try { + var name = getComponentNameFromType(type); + return name ? "<" + name + ">" : "<...>"; + } catch (x) { + return "<...>"; + } + } + function getOwner() { + var dispatcher = ReactSharedInternalsServer.A; + return null === dispatcher ? null : dispatcher.getOwner(); + } + function UnknownOwner() { + return Error("react-stack-top-frame"); + } + function hasValidKey(config) { + if (hasOwnProperty.call(config, "key")) { + var getter = Object.getOwnPropertyDescriptor(config, "key").get; + if (getter && getter.isReactWarning) return !1; + } + return void 0 !== config.key; + } + function defineKeyPropWarningGetter(props, displayName) { + function warnAboutAccessingKey() { + specialPropKeyWarningShown || + ((specialPropKeyWarningShown = !0), + console.error( + "%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)", + displayName + )); + } + warnAboutAccessingKey.isReactWarning = !0; + Object.defineProperty(props, "key", { + get: warnAboutAccessingKey, + configurable: !0 + }); + } + function elementRefGetterWithDeprecationWarning() { + var componentName = getComponentNameFromType(this.type); + didWarnAboutElementRef[componentName] || + ((didWarnAboutElementRef[componentName] = !0), + console.error( + "Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release." + )); + componentName = this.props.ref; + return void 0 !== componentName ? componentName : null; + } + function ReactElement(type, key, props, owner, debugStack, debugTask) { + var refProp = props.ref; + type = { + $$typeof: REACT_ELEMENT_TYPE, + type: type, + key: key, + props: props, + _owner: owner + }; + null !== (void 0 !== refProp ? refProp : null) + ? Object.defineProperty(type, "ref", { + enumerable: !1, + get: elementRefGetterWithDeprecationWarning + }) + : Object.defineProperty(type, "ref", { enumerable: !1, value: null }); + type._store = {}; + Object.defineProperty(type._store, "validated", { + configurable: !1, + enumerable: !1, + writable: !0, + value: 0 + }); + Object.defineProperty(type, "_debugInfo", { + configurable: !1, + enumerable: !1, + writable: !0, + value: null + }); + Object.defineProperty(type, "_debugStack", { + configurable: !1, + enumerable: !1, + writable: !0, + value: debugStack + }); + Object.defineProperty(type, "_debugTask", { + configurable: !1, + enumerable: !1, + writable: !0, + value: debugTask + }); + Object.freeze && (Object.freeze(type.props), Object.freeze(type)); + return type; + } + function jsxDEVImpl( + type, + config, + maybeKey, + isStaticChildren, + debugStack, + debugTask + ) { + var children = config.children; + if (void 0 !== children) + if (isStaticChildren) + if (isArrayImpl(children)) { + for ( + isStaticChildren = 0; + isStaticChildren < children.length; + isStaticChildren++ + ) + validateChildKeys(children[isStaticChildren]); + Object.freeze && Object.freeze(children); + } else + console.error( + "React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead." + ); + else validateChildKeys(children); + if (hasOwnProperty.call(config, "key")) { + children = getComponentNameFromType(type); + var keys = Object.keys(config).filter(function (k) { + return "key" !== k; + }); + isStaticChildren = + 0 < keys.length + ? "{key: someKey, " + keys.join(": ..., ") + ": ...}" + : "{key: someKey}"; + didWarnAboutKeySpread[children + isStaticChildren] || + ((keys = + 0 < keys.length ? "{" + keys.join(": ..., ") + ": ...}" : "{}"), + console.error( + 'A props object containing a "key" prop is being spread into JSX:\n let props = %s;\n <%s {...props} />\nReact keys must be passed directly to JSX without using spread:\n let props = %s;\n <%s key={someKey} {...props} />', + isStaticChildren, + children, + keys, + children + ), + (didWarnAboutKeySpread[children + isStaticChildren] = !0)); + } + children = null; + void 0 !== maybeKey && + (checkKeyStringCoercion(maybeKey), (children = "" + maybeKey)); + hasValidKey(config) && + (checkKeyStringCoercion(config.key), (children = "" + config.key)); + if ("key" in config) { + maybeKey = {}; + for (var propName in config) + "key" !== propName && (maybeKey[propName] = config[propName]); + } else maybeKey = config; + children && + defineKeyPropWarningGetter( + maybeKey, + "function" === typeof type + ? type.displayName || type.name || "Unknown" + : type + ); + return ReactElement( + type, + children, + maybeKey, + getOwner(), + debugStack, + debugTask + ); + } + function validateChildKeys(node) { + isValidElement(node) + ? node._store && (node._store.validated = 1) + : "object" === typeof node && + null !== node && + node.$$typeof === REACT_LAZY_TYPE && + ("fulfilled" === node._payload.status + ? isValidElement(node._payload.value) && + node._payload.value._store && + (node._payload.value._store.validated = 1) + : node._store && (node._store.validated = 1)); + } + function isValidElement(object) { + return ( + "object" === typeof object && + null !== object && + object.$$typeof === REACT_ELEMENT_TYPE + ); + } + var React = require("react"), + REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"), + REACT_PORTAL_TYPE = Symbol.for("react.portal"), + REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"), + REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"), + REACT_PROFILER_TYPE = Symbol.for("react.profiler"), + REACT_CONSUMER_TYPE = Symbol.for("react.consumer"), + REACT_CONTEXT_TYPE = Symbol.for("react.context"), + REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"), + REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"), + REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"), + REACT_MEMO_TYPE = Symbol.for("react.memo"), + REACT_LAZY_TYPE = Symbol.for("react.lazy"), + REACT_ACTIVITY_TYPE = Symbol.for("react.activity"), + REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference"), + ReactSharedInternalsServer = + React.__SERVER_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE; + if (!ReactSharedInternalsServer) + throw Error( + 'The "react" package in this environment is not configured correctly. The "react-server" condition must be enabled in any environment that runs React Server Components.' + ); + var hasOwnProperty = Object.prototype.hasOwnProperty, + isArrayImpl = Array.isArray, + createTask = console.createTask + ? console.createTask + : function () { + return null; + }; + React = { + react_stack_bottom_frame: function (callStackForError) { + return callStackForError(); + } + }; + var specialPropKeyWarningShown; + var didWarnAboutElementRef = {}; + var unknownOwnerDebugStack = React.react_stack_bottom_frame.bind( + React, + UnknownOwner + )(); + var unknownOwnerDebugTask = createTask(getTaskName(UnknownOwner)); + var didWarnAboutKeySpread = {}; + exports.Fragment = REACT_FRAGMENT_TYPE; + exports.jsx = function (type, config, maybeKey) { + var trackActualOwner = + 1e4 > ReactSharedInternalsServer.recentlyCreatedOwnerStacks++; + return jsxDEVImpl( + type, + config, + maybeKey, + !1, + trackActualOwner + ? Error("react-stack-top-frame") + : unknownOwnerDebugStack, + trackActualOwner ? createTask(getTaskName(type)) : unknownOwnerDebugTask + ); + }; + exports.jsxDEV = function (type, config, maybeKey, isStaticChildren) { + var trackActualOwner = + 1e4 > ReactSharedInternalsServer.recentlyCreatedOwnerStacks++; + return jsxDEVImpl( + type, + config, + maybeKey, + isStaticChildren, + trackActualOwner + ? Error("react-stack-top-frame") + : unknownOwnerDebugStack, + trackActualOwner ? createTask(getTaskName(type)) : unknownOwnerDebugTask + ); + }; + exports.jsxs = function (type, config, maybeKey) { + var trackActualOwner = + 1e4 > ReactSharedInternalsServer.recentlyCreatedOwnerStacks++; + return jsxDEVImpl( + type, + config, + maybeKey, + !0, + trackActualOwner + ? Error("react-stack-top-frame") + : unknownOwnerDebugStack, + trackActualOwner ? createTask(getTaskName(type)) : unknownOwnerDebugTask + ); + }; + })(); diff --git a/node_modules/react/cjs/react-jsx-runtime.react-server.production.js b/node_modules/react/cjs/react-jsx-runtime.react-server.production.js new file mode 100644 index 0000000..486facb --- /dev/null +++ b/node_modules/react/cjs/react-jsx-runtime.react-server.production.js @@ -0,0 +1,40 @@ +/** + * @license React + * react-jsx-runtime.react-server.production.js + * + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +"use strict"; +var React = require("react"), + REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"), + REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"); +if (!React.__SERVER_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE) + throw Error( + 'The "react" package in this environment is not configured correctly. The "react-server" condition must be enabled in any environment that runs React Server Components.' + ); +function jsxProd(type, config, maybeKey) { + var key = null; + void 0 !== maybeKey && (key = "" + maybeKey); + void 0 !== config.key && (key = "" + config.key); + if ("key" in config) { + maybeKey = {}; + for (var propName in config) + "key" !== propName && (maybeKey[propName] = config[propName]); + } else maybeKey = config; + config = maybeKey.ref; + return { + $$typeof: REACT_ELEMENT_TYPE, + type: type, + key: key, + ref: void 0 !== config ? config : null, + props: maybeKey + }; +} +exports.Fragment = REACT_FRAGMENT_TYPE; +exports.jsx = jsxProd; +exports.jsxDEV = void 0; +exports.jsxs = jsxProd; diff --git a/node_modules/react/cjs/react.development.js b/node_modules/react/cjs/react.development.js new file mode 100644 index 0000000..8c026f9 --- /dev/null +++ b/node_modules/react/cjs/react.development.js @@ -0,0 +1,1284 @@ +/** + * @license React + * react.development.js + * + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +"use strict"; +"production" !== process.env.NODE_ENV && + (function () { + function defineDeprecationWarning(methodName, info) { + Object.defineProperty(Component.prototype, methodName, { + get: function () { + console.warn( + "%s(...) is deprecated in plain JavaScript React classes. %s", + info[0], + info[1] + ); + } + }); + } + function getIteratorFn(maybeIterable) { + if (null === maybeIterable || "object" !== typeof maybeIterable) + return null; + maybeIterable = + (MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL]) || + maybeIterable["@@iterator"]; + return "function" === typeof maybeIterable ? maybeIterable : null; + } + function warnNoop(publicInstance, callerName) { + publicInstance = + ((publicInstance = publicInstance.constructor) && + (publicInstance.displayName || publicInstance.name)) || + "ReactClass"; + var warningKey = publicInstance + "." + callerName; + didWarnStateUpdateForUnmountedComponent[warningKey] || + (console.error( + "Can't call %s on a component that is not yet mounted. This is a no-op, but it might indicate a bug in your application. Instead, assign to `this.state` directly or define a `state = {};` class property with the desired state in the %s component.", + callerName, + publicInstance + ), + (didWarnStateUpdateForUnmountedComponent[warningKey] = !0)); + } + function Component(props, context, updater) { + this.props = props; + this.context = context; + this.refs = emptyObject; + this.updater = updater || ReactNoopUpdateQueue; + } + function ComponentDummy() {} + function PureComponent(props, context, updater) { + this.props = props; + this.context = context; + this.refs = emptyObject; + this.updater = updater || ReactNoopUpdateQueue; + } + function noop() {} + function testStringCoercion(value) { + return "" + value; + } + function checkKeyStringCoercion(value) { + try { + testStringCoercion(value); + var JSCompiler_inline_result = !1; + } catch (e) { + JSCompiler_inline_result = !0; + } + if (JSCompiler_inline_result) { + JSCompiler_inline_result = console; + var JSCompiler_temp_const = JSCompiler_inline_result.error; + var JSCompiler_inline_result$jscomp$0 = + ("function" === typeof Symbol && + Symbol.toStringTag && + value[Symbol.toStringTag]) || + value.constructor.name || + "Object"; + JSCompiler_temp_const.call( + JSCompiler_inline_result, + "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.", + JSCompiler_inline_result$jscomp$0 + ); + return testStringCoercion(value); + } + } + function getComponentNameFromType(type) { + if (null == type) return null; + if ("function" === typeof type) + return type.$$typeof === REACT_CLIENT_REFERENCE + ? null + : type.displayName || type.name || null; + if ("string" === typeof type) return type; + switch (type) { + case REACT_FRAGMENT_TYPE: + return "Fragment"; + case REACT_PROFILER_TYPE: + return "Profiler"; + case REACT_STRICT_MODE_TYPE: + return "StrictMode"; + case REACT_SUSPENSE_TYPE: + return "Suspense"; + case REACT_SUSPENSE_LIST_TYPE: + return "SuspenseList"; + case REACT_ACTIVITY_TYPE: + return "Activity"; + } + if ("object" === typeof type) + switch ( + ("number" === typeof type.tag && + console.error( + "Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue." + ), + type.$$typeof) + ) { + case REACT_PORTAL_TYPE: + return "Portal"; + case REACT_CONTEXT_TYPE: + return type.displayName || "Context"; + case REACT_CONSUMER_TYPE: + return (type._context.displayName || "Context") + ".Consumer"; + case REACT_FORWARD_REF_TYPE: + var innerType = type.render; + type = type.displayName; + type || + ((type = innerType.displayName || innerType.name || ""), + (type = "" !== type ? "ForwardRef(" + type + ")" : "ForwardRef")); + return type; + case REACT_MEMO_TYPE: + return ( + (innerType = type.displayName || null), + null !== innerType + ? innerType + : getComponentNameFromType(type.type) || "Memo" + ); + case REACT_LAZY_TYPE: + innerType = type._payload; + type = type._init; + try { + return getComponentNameFromType(type(innerType)); + } catch (x) {} + } + return null; + } + function getTaskName(type) { + if (type === REACT_FRAGMENT_TYPE) return "<>"; + if ( + "object" === typeof type && + null !== type && + type.$$typeof === REACT_LAZY_TYPE + ) + return "<...>"; + try { + var name = getComponentNameFromType(type); + return name ? "<" + name + ">" : "<...>"; + } catch (x) { + return "<...>"; + } + } + function getOwner() { + var dispatcher = ReactSharedInternals.A; + return null === dispatcher ? null : dispatcher.getOwner(); + } + function UnknownOwner() { + return Error("react-stack-top-frame"); + } + function hasValidKey(config) { + if (hasOwnProperty.call(config, "key")) { + var getter = Object.getOwnPropertyDescriptor(config, "key").get; + if (getter && getter.isReactWarning) return !1; + } + return void 0 !== config.key; + } + function defineKeyPropWarningGetter(props, displayName) { + function warnAboutAccessingKey() { + specialPropKeyWarningShown || + ((specialPropKeyWarningShown = !0), + console.error( + "%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)", + displayName + )); + } + warnAboutAccessingKey.isReactWarning = !0; + Object.defineProperty(props, "key", { + get: warnAboutAccessingKey, + configurable: !0 + }); + } + function elementRefGetterWithDeprecationWarning() { + var componentName = getComponentNameFromType(this.type); + didWarnAboutElementRef[componentName] || + ((didWarnAboutElementRef[componentName] = !0), + console.error( + "Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release." + )); + componentName = this.props.ref; + return void 0 !== componentName ? componentName : null; + } + function ReactElement(type, key, props, owner, debugStack, debugTask) { + var refProp = props.ref; + type = { + $$typeof: REACT_ELEMENT_TYPE, + type: type, + key: key, + props: props, + _owner: owner + }; + null !== (void 0 !== refProp ? refProp : null) + ? Object.defineProperty(type, "ref", { + enumerable: !1, + get: elementRefGetterWithDeprecationWarning + }) + : Object.defineProperty(type, "ref", { enumerable: !1, value: null }); + type._store = {}; + Object.defineProperty(type._store, "validated", { + configurable: !1, + enumerable: !1, + writable: !0, + value: 0 + }); + Object.defineProperty(type, "_debugInfo", { + configurable: !1, + enumerable: !1, + writable: !0, + value: null + }); + Object.defineProperty(type, "_debugStack", { + configurable: !1, + enumerable: !1, + writable: !0, + value: debugStack + }); + Object.defineProperty(type, "_debugTask", { + configurable: !1, + enumerable: !1, + writable: !0, + value: debugTask + }); + Object.freeze && (Object.freeze(type.props), Object.freeze(type)); + return type; + } + function cloneAndReplaceKey(oldElement, newKey) { + newKey = ReactElement( + oldElement.type, + newKey, + oldElement.props, + oldElement._owner, + oldElement._debugStack, + oldElement._debugTask + ); + oldElement._store && + (newKey._store.validated = oldElement._store.validated); + return newKey; + } + function validateChildKeys(node) { + isValidElement(node) + ? node._store && (node._store.validated = 1) + : "object" === typeof node && + null !== node && + node.$$typeof === REACT_LAZY_TYPE && + ("fulfilled" === node._payload.status + ? isValidElement(node._payload.value) && + node._payload.value._store && + (node._payload.value._store.validated = 1) + : node._store && (node._store.validated = 1)); + } + function isValidElement(object) { + return ( + "object" === typeof object && + null !== object && + object.$$typeof === REACT_ELEMENT_TYPE + ); + } + function escape(key) { + var escaperLookup = { "=": "=0", ":": "=2" }; + return ( + "$" + + key.replace(/[=:]/g, function (match) { + return escaperLookup[match]; + }) + ); + } + function getElementKey(element, index) { + return "object" === typeof element && + null !== element && + null != element.key + ? (checkKeyStringCoercion(element.key), escape("" + element.key)) + : index.toString(36); + } + function resolveThenable(thenable) { + switch (thenable.status) { + case "fulfilled": + return thenable.value; + case "rejected": + throw thenable.reason; + default: + switch ( + ("string" === typeof thenable.status + ? thenable.then(noop, noop) + : ((thenable.status = "pending"), + thenable.then( + function (fulfilledValue) { + "pending" === thenable.status && + ((thenable.status = "fulfilled"), + (thenable.value = fulfilledValue)); + }, + function (error) { + "pending" === thenable.status && + ((thenable.status = "rejected"), + (thenable.reason = error)); + } + )), + thenable.status) + ) { + case "fulfilled": + return thenable.value; + case "rejected": + throw thenable.reason; + } + } + throw thenable; + } + function mapIntoArray(children, array, escapedPrefix, nameSoFar, callback) { + var type = typeof children; + if ("undefined" === type || "boolean" === type) children = null; + var invokeCallback = !1; + if (null === children) invokeCallback = !0; + else + switch (type) { + case "bigint": + case "string": + case "number": + invokeCallback = !0; + break; + case "object": + switch (children.$$typeof) { + case REACT_ELEMENT_TYPE: + case REACT_PORTAL_TYPE: + invokeCallback = !0; + break; + case REACT_LAZY_TYPE: + return ( + (invokeCallback = children._init), + mapIntoArray( + invokeCallback(children._payload), + array, + escapedPrefix, + nameSoFar, + callback + ) + ); + } + } + if (invokeCallback) { + invokeCallback = children; + callback = callback(invokeCallback); + var childKey = + "" === nameSoFar ? "." + getElementKey(invokeCallback, 0) : nameSoFar; + isArrayImpl(callback) + ? ((escapedPrefix = ""), + null != childKey && + (escapedPrefix = + childKey.replace(userProvidedKeyEscapeRegex, "$&/") + "/"), + mapIntoArray(callback, array, escapedPrefix, "", function (c) { + return c; + })) + : null != callback && + (isValidElement(callback) && + (null != callback.key && + ((invokeCallback && invokeCallback.key === callback.key) || + checkKeyStringCoercion(callback.key)), + (escapedPrefix = cloneAndReplaceKey( + callback, + escapedPrefix + + (null == callback.key || + (invokeCallback && invokeCallback.key === callback.key) + ? "" + : ("" + callback.key).replace( + userProvidedKeyEscapeRegex, + "$&/" + ) + "/") + + childKey + )), + "" !== nameSoFar && + null != invokeCallback && + isValidElement(invokeCallback) && + null == invokeCallback.key && + invokeCallback._store && + !invokeCallback._store.validated && + (escapedPrefix._store.validated = 2), + (callback = escapedPrefix)), + array.push(callback)); + return 1; + } + invokeCallback = 0; + childKey = "" === nameSoFar ? "." : nameSoFar + ":"; + if (isArrayImpl(children)) + for (var i = 0; i < children.length; i++) + (nameSoFar = children[i]), + (type = childKey + getElementKey(nameSoFar, i)), + (invokeCallback += mapIntoArray( + nameSoFar, + array, + escapedPrefix, + type, + callback + )); + else if (((i = getIteratorFn(children)), "function" === typeof i)) + for ( + i === children.entries && + (didWarnAboutMaps || + console.warn( + "Using Maps as children is not supported. Use an array of keyed ReactElements instead." + ), + (didWarnAboutMaps = !0)), + children = i.call(children), + i = 0; + !(nameSoFar = children.next()).done; + + ) + (nameSoFar = nameSoFar.value), + (type = childKey + getElementKey(nameSoFar, i++)), + (invokeCallback += mapIntoArray( + nameSoFar, + array, + escapedPrefix, + type, + callback + )); + else if ("object" === type) { + if ("function" === typeof children.then) + return mapIntoArray( + resolveThenable(children), + array, + escapedPrefix, + nameSoFar, + callback + ); + array = String(children); + throw Error( + "Objects are not valid as a React child (found: " + + ("[object Object]" === array + ? "object with keys {" + Object.keys(children).join(", ") + "}" + : array) + + "). If you meant to render a collection of children, use an array instead." + ); + } + return invokeCallback; + } + function mapChildren(children, func, context) { + if (null == children) return children; + var result = [], + count = 0; + mapIntoArray(children, result, "", "", function (child) { + return func.call(context, child, count++); + }); + return result; + } + function lazyInitializer(payload) { + if (-1 === payload._status) { + var ioInfo = payload._ioInfo; + null != ioInfo && (ioInfo.start = ioInfo.end = performance.now()); + ioInfo = payload._result; + var thenable = ioInfo(); + thenable.then( + function (moduleObject) { + if (0 === payload._status || -1 === payload._status) { + payload._status = 1; + payload._result = moduleObject; + var _ioInfo = payload._ioInfo; + null != _ioInfo && (_ioInfo.end = performance.now()); + void 0 === thenable.status && + ((thenable.status = "fulfilled"), + (thenable.value = moduleObject)); + } + }, + function (error) { + if (0 === payload._status || -1 === payload._status) { + payload._status = 2; + payload._result = error; + var _ioInfo2 = payload._ioInfo; + null != _ioInfo2 && (_ioInfo2.end = performance.now()); + void 0 === thenable.status && + ((thenable.status = "rejected"), (thenable.reason = error)); + } + } + ); + ioInfo = payload._ioInfo; + if (null != ioInfo) { + ioInfo.value = thenable; + var displayName = thenable.displayName; + "string" === typeof displayName && (ioInfo.name = displayName); + } + -1 === payload._status && + ((payload._status = 0), (payload._result = thenable)); + } + if (1 === payload._status) + return ( + (ioInfo = payload._result), + void 0 === ioInfo && + console.error( + "lazy: Expected the result of a dynamic import() call. Instead received: %s\n\nYour code should look like: \n const MyComponent = lazy(() => import('./MyComponent'))\n\nDid you accidentally put curly braces around the import?", + ioInfo + ), + "default" in ioInfo || + console.error( + "lazy: Expected the result of a dynamic import() call. Instead received: %s\n\nYour code should look like: \n const MyComponent = lazy(() => import('./MyComponent'))", + ioInfo + ), + ioInfo.default + ); + throw payload._result; + } + function resolveDispatcher() { + var dispatcher = ReactSharedInternals.H; + null === dispatcher && + console.error( + "Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\n1. You might have mismatching versions of React and the renderer (such as React DOM)\n2. You might be breaking the Rules of Hooks\n3. You might have more than one copy of React in the same app\nSee https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem." + ); + return dispatcher; + } + function releaseAsyncTransition() { + ReactSharedInternals.asyncTransitions--; + } + function enqueueTask(task) { + if (null === enqueueTaskImpl) + try { + var requireString = ("require" + Math.random()).slice(0, 7); + enqueueTaskImpl = (module && module[requireString]).call( + module, + "timers" + ).setImmediate; + } catch (_err) { + enqueueTaskImpl = function (callback) { + !1 === didWarnAboutMessageChannel && + ((didWarnAboutMessageChannel = !0), + "undefined" === typeof MessageChannel && + console.error( + "This browser does not have a MessageChannel implementation, so enqueuing tasks via await act(async () => ...) will fail. Please file an issue at https://github.com/facebook/react/issues if you encounter this warning." + )); + var channel = new MessageChannel(); + channel.port1.onmessage = callback; + channel.port2.postMessage(void 0); + }; + } + return enqueueTaskImpl(task); + } + function aggregateErrors(errors) { + return 1 < errors.length && "function" === typeof AggregateError + ? new AggregateError(errors) + : errors[0]; + } + function popActScope(prevActQueue, prevActScopeDepth) { + prevActScopeDepth !== actScopeDepth - 1 && + console.error( + "You seem to have overlapping act() calls, this is not supported. Be sure to await previous act() calls before making a new one. " + ); + actScopeDepth = prevActScopeDepth; + } + function recursivelyFlushAsyncActWork(returnValue, resolve, reject) { + var queue = ReactSharedInternals.actQueue; + if (null !== queue) + if (0 !== queue.length) + try { + flushActQueue(queue); + enqueueTask(function () { + return recursivelyFlushAsyncActWork(returnValue, resolve, reject); + }); + return; + } catch (error) { + ReactSharedInternals.thrownErrors.push(error); + } + else ReactSharedInternals.actQueue = null; + 0 < ReactSharedInternals.thrownErrors.length + ? ((queue = aggregateErrors(ReactSharedInternals.thrownErrors)), + (ReactSharedInternals.thrownErrors.length = 0), + reject(queue)) + : resolve(returnValue); + } + function flushActQueue(queue) { + if (!isFlushing) { + isFlushing = !0; + var i = 0; + try { + for (; i < queue.length; i++) { + var callback = queue[i]; + do { + ReactSharedInternals.didUsePromise = !1; + var continuation = callback(!1); + if (null !== continuation) { + if (ReactSharedInternals.didUsePromise) { + queue[i] = callback; + queue.splice(0, i); + return; + } + callback = continuation; + } else break; + } while (1); + } + queue.length = 0; + } catch (error) { + queue.splice(0, i + 1), ReactSharedInternals.thrownErrors.push(error); + } finally { + isFlushing = !1; + } + } + } + "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && + "function" === + typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart && + __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error()); + var REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"), + REACT_PORTAL_TYPE = Symbol.for("react.portal"), + REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"), + REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"), + REACT_PROFILER_TYPE = Symbol.for("react.profiler"), + REACT_CONSUMER_TYPE = Symbol.for("react.consumer"), + REACT_CONTEXT_TYPE = Symbol.for("react.context"), + REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"), + REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"), + REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"), + REACT_MEMO_TYPE = Symbol.for("react.memo"), + REACT_LAZY_TYPE = Symbol.for("react.lazy"), + REACT_ACTIVITY_TYPE = Symbol.for("react.activity"), + MAYBE_ITERATOR_SYMBOL = Symbol.iterator, + didWarnStateUpdateForUnmountedComponent = {}, + ReactNoopUpdateQueue = { + isMounted: function () { + return !1; + }, + enqueueForceUpdate: function (publicInstance) { + warnNoop(publicInstance, "forceUpdate"); + }, + enqueueReplaceState: function (publicInstance) { + warnNoop(publicInstance, "replaceState"); + }, + enqueueSetState: function (publicInstance) { + warnNoop(publicInstance, "setState"); + } + }, + assign = Object.assign, + emptyObject = {}; + Object.freeze(emptyObject); + Component.prototype.isReactComponent = {}; + Component.prototype.setState = function (partialState, callback) { + if ( + "object" !== typeof partialState && + "function" !== typeof partialState && + null != partialState + ) + throw Error( + "takes an object of state variables to update or a function which returns an object of state variables." + ); + this.updater.enqueueSetState(this, partialState, callback, "setState"); + }; + Component.prototype.forceUpdate = function (callback) { + this.updater.enqueueForceUpdate(this, callback, "forceUpdate"); + }; + var deprecatedAPIs = { + isMounted: [ + "isMounted", + "Instead, make sure to clean up subscriptions and pending requests in componentWillUnmount to prevent memory leaks." + ], + replaceState: [ + "replaceState", + "Refactor your code to use setState instead (see https://github.com/facebook/react/issues/3236)." + ] + }; + for (fnName in deprecatedAPIs) + deprecatedAPIs.hasOwnProperty(fnName) && + defineDeprecationWarning(fnName, deprecatedAPIs[fnName]); + ComponentDummy.prototype = Component.prototype; + deprecatedAPIs = PureComponent.prototype = new ComponentDummy(); + deprecatedAPIs.constructor = PureComponent; + assign(deprecatedAPIs, Component.prototype); + deprecatedAPIs.isPureReactComponent = !0; + var isArrayImpl = Array.isArray, + REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference"), + ReactSharedInternals = { + H: null, + A: null, + T: null, + S: null, + actQueue: null, + asyncTransitions: 0, + isBatchingLegacy: !1, + didScheduleLegacyUpdate: !1, + didUsePromise: !1, + thrownErrors: [], + getCurrentStack: null, + recentlyCreatedOwnerStacks: 0 + }, + hasOwnProperty = Object.prototype.hasOwnProperty, + createTask = console.createTask + ? console.createTask + : function () { + return null; + }; + deprecatedAPIs = { + react_stack_bottom_frame: function (callStackForError) { + return callStackForError(); + } + }; + var specialPropKeyWarningShown, didWarnAboutOldJSXRuntime; + var didWarnAboutElementRef = {}; + var unknownOwnerDebugStack = deprecatedAPIs.react_stack_bottom_frame.bind( + deprecatedAPIs, + UnknownOwner + )(); + var unknownOwnerDebugTask = createTask(getTaskName(UnknownOwner)); + var didWarnAboutMaps = !1, + userProvidedKeyEscapeRegex = /\/+/g, + reportGlobalError = + "function" === typeof reportError + ? reportError + : function (error) { + if ( + "object" === typeof window && + "function" === typeof window.ErrorEvent + ) { + var event = new window.ErrorEvent("error", { + bubbles: !0, + cancelable: !0, + message: + "object" === typeof error && + null !== error && + "string" === typeof error.message + ? String(error.message) + : String(error), + error: error + }); + if (!window.dispatchEvent(event)) return; + } else if ( + "object" === typeof process && + "function" === typeof process.emit + ) { + process.emit("uncaughtException", error); + return; + } + console.error(error); + }, + didWarnAboutMessageChannel = !1, + enqueueTaskImpl = null, + actScopeDepth = 0, + didWarnNoAwaitAct = !1, + isFlushing = !1, + queueSeveralMicrotasks = + "function" === typeof queueMicrotask + ? function (callback) { + queueMicrotask(function () { + return queueMicrotask(callback); + }); + } + : enqueueTask; + deprecatedAPIs = Object.freeze({ + __proto__: null, + c: function (size) { + return resolveDispatcher().useMemoCache(size); + } + }); + var fnName = { + map: mapChildren, + forEach: function (children, forEachFunc, forEachContext) { + mapChildren( + children, + function () { + forEachFunc.apply(this, arguments); + }, + forEachContext + ); + }, + count: function (children) { + var n = 0; + mapChildren(children, function () { + n++; + }); + return n; + }, + toArray: function (children) { + return ( + mapChildren(children, function (child) { + return child; + }) || [] + ); + }, + only: function (children) { + if (!isValidElement(children)) + throw Error( + "React.Children.only expected to receive a single React element child." + ); + return children; + } + }; + exports.Activity = REACT_ACTIVITY_TYPE; + exports.Children = fnName; + exports.Component = Component; + exports.Fragment = REACT_FRAGMENT_TYPE; + exports.Profiler = REACT_PROFILER_TYPE; + exports.PureComponent = PureComponent; + exports.StrictMode = REACT_STRICT_MODE_TYPE; + exports.Suspense = REACT_SUSPENSE_TYPE; + exports.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE = + ReactSharedInternals; + exports.__COMPILER_RUNTIME = deprecatedAPIs; + exports.act = function (callback) { + var prevActQueue = ReactSharedInternals.actQueue, + prevActScopeDepth = actScopeDepth; + actScopeDepth++; + var queue = (ReactSharedInternals.actQueue = + null !== prevActQueue ? prevActQueue : []), + didAwaitActCall = !1; + try { + var result = callback(); + } catch (error) { + ReactSharedInternals.thrownErrors.push(error); + } + if (0 < ReactSharedInternals.thrownErrors.length) + throw ( + (popActScope(prevActQueue, prevActScopeDepth), + (callback = aggregateErrors(ReactSharedInternals.thrownErrors)), + (ReactSharedInternals.thrownErrors.length = 0), + callback) + ); + if ( + null !== result && + "object" === typeof result && + "function" === typeof result.then + ) { + var thenable = result; + queueSeveralMicrotasks(function () { + didAwaitActCall || + didWarnNoAwaitAct || + ((didWarnNoAwaitAct = !0), + console.error( + "You called act(async () => ...) without await. This could lead to unexpected testing behaviour, interleaving multiple act calls and mixing their scopes. You should - await act(async () => ...);" + )); + }); + return { + then: function (resolve, reject) { + didAwaitActCall = !0; + thenable.then( + function (returnValue) { + popActScope(prevActQueue, prevActScopeDepth); + if (0 === prevActScopeDepth) { + try { + flushActQueue(queue), + enqueueTask(function () { + return recursivelyFlushAsyncActWork( + returnValue, + resolve, + reject + ); + }); + } catch (error$0) { + ReactSharedInternals.thrownErrors.push(error$0); + } + if (0 < ReactSharedInternals.thrownErrors.length) { + var _thrownError = aggregateErrors( + ReactSharedInternals.thrownErrors + ); + ReactSharedInternals.thrownErrors.length = 0; + reject(_thrownError); + } + } else resolve(returnValue); + }, + function (error) { + popActScope(prevActQueue, prevActScopeDepth); + 0 < ReactSharedInternals.thrownErrors.length + ? ((error = aggregateErrors( + ReactSharedInternals.thrownErrors + )), + (ReactSharedInternals.thrownErrors.length = 0), + reject(error)) + : reject(error); + } + ); + } + }; + } + var returnValue$jscomp$0 = result; + popActScope(prevActQueue, prevActScopeDepth); + 0 === prevActScopeDepth && + (flushActQueue(queue), + 0 !== queue.length && + queueSeveralMicrotasks(function () { + didAwaitActCall || + didWarnNoAwaitAct || + ((didWarnNoAwaitAct = !0), + console.error( + "A component suspended inside an `act` scope, but the `act` call was not awaited. When testing React components that depend on asynchronous data, you must await the result:\n\nawait act(() => ...)" + )); + }), + (ReactSharedInternals.actQueue = null)); + if (0 < ReactSharedInternals.thrownErrors.length) + throw ( + ((callback = aggregateErrors(ReactSharedInternals.thrownErrors)), + (ReactSharedInternals.thrownErrors.length = 0), + callback) + ); + return { + then: function (resolve, reject) { + didAwaitActCall = !0; + 0 === prevActScopeDepth + ? ((ReactSharedInternals.actQueue = queue), + enqueueTask(function () { + return recursivelyFlushAsyncActWork( + returnValue$jscomp$0, + resolve, + reject + ); + })) + : resolve(returnValue$jscomp$0); + } + }; + }; + exports.cache = function (fn) { + return function () { + return fn.apply(null, arguments); + }; + }; + exports.cacheSignal = function () { + return null; + }; + exports.captureOwnerStack = function () { + var getCurrentStack = ReactSharedInternals.getCurrentStack; + return null === getCurrentStack ? null : getCurrentStack(); + }; + exports.cloneElement = function (element, config, children) { + if (null === element || void 0 === element) + throw Error( + "The argument must be a React element, but you passed " + + element + + "." + ); + var props = assign({}, element.props), + key = element.key, + owner = element._owner; + if (null != config) { + var JSCompiler_inline_result; + a: { + if ( + hasOwnProperty.call(config, "ref") && + (JSCompiler_inline_result = Object.getOwnPropertyDescriptor( + config, + "ref" + ).get) && + JSCompiler_inline_result.isReactWarning + ) { + JSCompiler_inline_result = !1; + break a; + } + JSCompiler_inline_result = void 0 !== config.ref; + } + JSCompiler_inline_result && (owner = getOwner()); + hasValidKey(config) && + (checkKeyStringCoercion(config.key), (key = "" + config.key)); + for (propName in config) + !hasOwnProperty.call(config, propName) || + "key" === propName || + "__self" === propName || + "__source" === propName || + ("ref" === propName && void 0 === config.ref) || + (props[propName] = config[propName]); + } + var propName = arguments.length - 2; + if (1 === propName) props.children = children; + else if (1 < propName) { + JSCompiler_inline_result = Array(propName); + for (var i = 0; i < propName; i++) + JSCompiler_inline_result[i] = arguments[i + 2]; + props.children = JSCompiler_inline_result; + } + props = ReactElement( + element.type, + key, + props, + owner, + element._debugStack, + element._debugTask + ); + for (key = 2; key < arguments.length; key++) + validateChildKeys(arguments[key]); + return props; + }; + exports.createContext = function (defaultValue) { + defaultValue = { + $$typeof: REACT_CONTEXT_TYPE, + _currentValue: defaultValue, + _currentValue2: defaultValue, + _threadCount: 0, + Provider: null, + Consumer: null + }; + defaultValue.Provider = defaultValue; + defaultValue.Consumer = { + $$typeof: REACT_CONSUMER_TYPE, + _context: defaultValue + }; + defaultValue._currentRenderer = null; + defaultValue._currentRenderer2 = null; + return defaultValue; + }; + exports.createElement = function (type, config, children) { + for (var i = 2; i < arguments.length; i++) + validateChildKeys(arguments[i]); + i = {}; + var key = null; + if (null != config) + for (propName in (didWarnAboutOldJSXRuntime || + !("__self" in config) || + "key" in config || + ((didWarnAboutOldJSXRuntime = !0), + console.warn( + "Your app (or one of its dependencies) is using an outdated JSX transform. Update to the modern JSX transform for faster performance: https://react.dev/link/new-jsx-transform" + )), + hasValidKey(config) && + (checkKeyStringCoercion(config.key), (key = "" + config.key)), + config)) + hasOwnProperty.call(config, propName) && + "key" !== propName && + "__self" !== propName && + "__source" !== propName && + (i[propName] = config[propName]); + var childrenLength = arguments.length - 2; + if (1 === childrenLength) i.children = children; + else if (1 < childrenLength) { + for ( + var childArray = Array(childrenLength), _i = 0; + _i < childrenLength; + _i++ + ) + childArray[_i] = arguments[_i + 2]; + Object.freeze && Object.freeze(childArray); + i.children = childArray; + } + if (type && type.defaultProps) + for (propName in ((childrenLength = type.defaultProps), childrenLength)) + void 0 === i[propName] && (i[propName] = childrenLength[propName]); + key && + defineKeyPropWarningGetter( + i, + "function" === typeof type + ? type.displayName || type.name || "Unknown" + : type + ); + var propName = 1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++; + return ReactElement( + type, + key, + i, + getOwner(), + propName ? Error("react-stack-top-frame") : unknownOwnerDebugStack, + propName ? createTask(getTaskName(type)) : unknownOwnerDebugTask + ); + }; + exports.createRef = function () { + var refObject = { current: null }; + Object.seal(refObject); + return refObject; + }; + exports.forwardRef = function (render) { + null != render && render.$$typeof === REACT_MEMO_TYPE + ? console.error( + "forwardRef requires a render function but received a `memo` component. Instead of forwardRef(memo(...)), use memo(forwardRef(...))." + ) + : "function" !== typeof render + ? console.error( + "forwardRef requires a render function but was given %s.", + null === render ? "null" : typeof render + ) + : 0 !== render.length && + 2 !== render.length && + console.error( + "forwardRef render functions accept exactly two parameters: props and ref. %s", + 1 === render.length + ? "Did you forget to use the ref parameter?" + : "Any additional parameter will be undefined." + ); + null != render && + null != render.defaultProps && + console.error( + "forwardRef render functions do not support defaultProps. Did you accidentally pass a React component?" + ); + var elementType = { $$typeof: REACT_FORWARD_REF_TYPE, render: render }, + ownName; + Object.defineProperty(elementType, "displayName", { + enumerable: !1, + configurable: !0, + get: function () { + return ownName; + }, + set: function (name) { + ownName = name; + render.name || + render.displayName || + (Object.defineProperty(render, "name", { value: name }), + (render.displayName = name)); + } + }); + return elementType; + }; + exports.isValidElement = isValidElement; + exports.lazy = function (ctor) { + ctor = { _status: -1, _result: ctor }; + var lazyType = { + $$typeof: REACT_LAZY_TYPE, + _payload: ctor, + _init: lazyInitializer + }, + ioInfo = { + name: "lazy", + start: -1, + end: -1, + value: null, + owner: null, + debugStack: Error("react-stack-top-frame"), + debugTask: console.createTask ? console.createTask("lazy()") : null + }; + ctor._ioInfo = ioInfo; + lazyType._debugInfo = [{ awaited: ioInfo }]; + return lazyType; + }; + exports.memo = function (type, compare) { + null == type && + console.error( + "memo: The first argument must be a component. Instead received: %s", + null === type ? "null" : typeof type + ); + compare = { + $$typeof: REACT_MEMO_TYPE, + type: type, + compare: void 0 === compare ? null : compare + }; + var ownName; + Object.defineProperty(compare, "displayName", { + enumerable: !1, + configurable: !0, + get: function () { + return ownName; + }, + set: function (name) { + ownName = name; + type.name || + type.displayName || + (Object.defineProperty(type, "name", { value: name }), + (type.displayName = name)); + } + }); + return compare; + }; + exports.startTransition = function (scope) { + var prevTransition = ReactSharedInternals.T, + currentTransition = {}; + currentTransition._updatedFibers = new Set(); + ReactSharedInternals.T = currentTransition; + try { + var returnValue = scope(), + onStartTransitionFinish = ReactSharedInternals.S; + null !== onStartTransitionFinish && + onStartTransitionFinish(currentTransition, returnValue); + "object" === typeof returnValue && + null !== returnValue && + "function" === typeof returnValue.then && + (ReactSharedInternals.asyncTransitions++, + returnValue.then(releaseAsyncTransition, releaseAsyncTransition), + returnValue.then(noop, reportGlobalError)); + } catch (error) { + reportGlobalError(error); + } finally { + null === prevTransition && + currentTransition._updatedFibers && + ((scope = currentTransition._updatedFibers.size), + currentTransition._updatedFibers.clear(), + 10 < scope && + console.warn( + "Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table." + )), + null !== prevTransition && + null !== currentTransition.types && + (null !== prevTransition.types && + prevTransition.types !== currentTransition.types && + console.error( + "We expected inner Transitions to have transferred the outer types set and that you cannot add to the outer Transition while inside the inner.This is a bug in React." + ), + (prevTransition.types = currentTransition.types)), + (ReactSharedInternals.T = prevTransition); + } + }; + exports.unstable_useCacheRefresh = function () { + return resolveDispatcher().useCacheRefresh(); + }; + exports.use = function (usable) { + return resolveDispatcher().use(usable); + }; + exports.useActionState = function (action, initialState, permalink) { + return resolveDispatcher().useActionState( + action, + initialState, + permalink + ); + }; + exports.useCallback = function (callback, deps) { + return resolveDispatcher().useCallback(callback, deps); + }; + exports.useContext = function (Context) { + var dispatcher = resolveDispatcher(); + Context.$$typeof === REACT_CONSUMER_TYPE && + console.error( + "Calling useContext(Context.Consumer) is not supported and will cause bugs. Did you mean to call useContext(Context) instead?" + ); + return dispatcher.useContext(Context); + }; + exports.useDebugValue = function (value, formatterFn) { + return resolveDispatcher().useDebugValue(value, formatterFn); + }; + exports.useDeferredValue = function (value, initialValue) { + return resolveDispatcher().useDeferredValue(value, initialValue); + }; + exports.useEffect = function (create, deps) { + null == create && + console.warn( + "React Hook useEffect requires an effect callback. Did you forget to pass a callback to the hook?" + ); + return resolveDispatcher().useEffect(create, deps); + }; + exports.useEffectEvent = function (callback) { + return resolveDispatcher().useEffectEvent(callback); + }; + exports.useId = function () { + return resolveDispatcher().useId(); + }; + exports.useImperativeHandle = function (ref, create, deps) { + return resolveDispatcher().useImperativeHandle(ref, create, deps); + }; + exports.useInsertionEffect = function (create, deps) { + null == create && + console.warn( + "React Hook useInsertionEffect requires an effect callback. Did you forget to pass a callback to the hook?" + ); + return resolveDispatcher().useInsertionEffect(create, deps); + }; + exports.useLayoutEffect = function (create, deps) { + null == create && + console.warn( + "React Hook useLayoutEffect requires an effect callback. Did you forget to pass a callback to the hook?" + ); + return resolveDispatcher().useLayoutEffect(create, deps); + }; + exports.useMemo = function (create, deps) { + return resolveDispatcher().useMemo(create, deps); + }; + exports.useOptimistic = function (passthrough, reducer) { + return resolveDispatcher().useOptimistic(passthrough, reducer); + }; + exports.useReducer = function (reducer, initialArg, init) { + return resolveDispatcher().useReducer(reducer, initialArg, init); + }; + exports.useRef = function (initialValue) { + return resolveDispatcher().useRef(initialValue); + }; + exports.useState = function (initialState) { + return resolveDispatcher().useState(initialState); + }; + exports.useSyncExternalStore = function ( + subscribe, + getSnapshot, + getServerSnapshot + ) { + return resolveDispatcher().useSyncExternalStore( + subscribe, + getSnapshot, + getServerSnapshot + ); + }; + exports.useTransition = function () { + return resolveDispatcher().useTransition(); + }; + exports.version = "19.2.4"; + "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && + "function" === + typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && + __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error()); + })(); diff --git a/node_modules/react/cjs/react.production.js b/node_modules/react/cjs/react.production.js new file mode 100644 index 0000000..28eed1e --- /dev/null +++ b/node_modules/react/cjs/react.production.js @@ -0,0 +1,542 @@ +/** + * @license React + * react.production.js + * + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +"use strict"; +var REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"), + REACT_PORTAL_TYPE = Symbol.for("react.portal"), + REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"), + REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"), + REACT_PROFILER_TYPE = Symbol.for("react.profiler"), + REACT_CONSUMER_TYPE = Symbol.for("react.consumer"), + REACT_CONTEXT_TYPE = Symbol.for("react.context"), + REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"), + REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"), + REACT_MEMO_TYPE = Symbol.for("react.memo"), + REACT_LAZY_TYPE = Symbol.for("react.lazy"), + REACT_ACTIVITY_TYPE = Symbol.for("react.activity"), + MAYBE_ITERATOR_SYMBOL = Symbol.iterator; +function getIteratorFn(maybeIterable) { + if (null === maybeIterable || "object" !== typeof maybeIterable) return null; + maybeIterable = + (MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL]) || + maybeIterable["@@iterator"]; + return "function" === typeof maybeIterable ? maybeIterable : null; +} +var ReactNoopUpdateQueue = { + isMounted: function () { + return !1; + }, + enqueueForceUpdate: function () {}, + enqueueReplaceState: function () {}, + enqueueSetState: function () {} + }, + assign = Object.assign, + emptyObject = {}; +function Component(props, context, updater) { + this.props = props; + this.context = context; + this.refs = emptyObject; + this.updater = updater || ReactNoopUpdateQueue; +} +Component.prototype.isReactComponent = {}; +Component.prototype.setState = function (partialState, callback) { + if ( + "object" !== typeof partialState && + "function" !== typeof partialState && + null != partialState + ) + throw Error( + "takes an object of state variables to update or a function which returns an object of state variables." + ); + this.updater.enqueueSetState(this, partialState, callback, "setState"); +}; +Component.prototype.forceUpdate = function (callback) { + this.updater.enqueueForceUpdate(this, callback, "forceUpdate"); +}; +function ComponentDummy() {} +ComponentDummy.prototype = Component.prototype; +function PureComponent(props, context, updater) { + this.props = props; + this.context = context; + this.refs = emptyObject; + this.updater = updater || ReactNoopUpdateQueue; +} +var pureComponentPrototype = (PureComponent.prototype = new ComponentDummy()); +pureComponentPrototype.constructor = PureComponent; +assign(pureComponentPrototype, Component.prototype); +pureComponentPrototype.isPureReactComponent = !0; +var isArrayImpl = Array.isArray; +function noop() {} +var ReactSharedInternals = { H: null, A: null, T: null, S: null }, + hasOwnProperty = Object.prototype.hasOwnProperty; +function ReactElement(type, key, props) { + var refProp = props.ref; + return { + $$typeof: REACT_ELEMENT_TYPE, + type: type, + key: key, + ref: void 0 !== refProp ? refProp : null, + props: props + }; +} +function cloneAndReplaceKey(oldElement, newKey) { + return ReactElement(oldElement.type, newKey, oldElement.props); +} +function isValidElement(object) { + return ( + "object" === typeof object && + null !== object && + object.$$typeof === REACT_ELEMENT_TYPE + ); +} +function escape(key) { + var escaperLookup = { "=": "=0", ":": "=2" }; + return ( + "$" + + key.replace(/[=:]/g, function (match) { + return escaperLookup[match]; + }) + ); +} +var userProvidedKeyEscapeRegex = /\/+/g; +function getElementKey(element, index) { + return "object" === typeof element && null !== element && null != element.key + ? escape("" + element.key) + : index.toString(36); +} +function resolveThenable(thenable) { + switch (thenable.status) { + case "fulfilled": + return thenable.value; + case "rejected": + throw thenable.reason; + default: + switch ( + ("string" === typeof thenable.status + ? thenable.then(noop, noop) + : ((thenable.status = "pending"), + thenable.then( + function (fulfilledValue) { + "pending" === thenable.status && + ((thenable.status = "fulfilled"), + (thenable.value = fulfilledValue)); + }, + function (error) { + "pending" === thenable.status && + ((thenable.status = "rejected"), (thenable.reason = error)); + } + )), + thenable.status) + ) { + case "fulfilled": + return thenable.value; + case "rejected": + throw thenable.reason; + } + } + throw thenable; +} +function mapIntoArray(children, array, escapedPrefix, nameSoFar, callback) { + var type = typeof children; + if ("undefined" === type || "boolean" === type) children = null; + var invokeCallback = !1; + if (null === children) invokeCallback = !0; + else + switch (type) { + case "bigint": + case "string": + case "number": + invokeCallback = !0; + break; + case "object": + switch (children.$$typeof) { + case REACT_ELEMENT_TYPE: + case REACT_PORTAL_TYPE: + invokeCallback = !0; + break; + case REACT_LAZY_TYPE: + return ( + (invokeCallback = children._init), + mapIntoArray( + invokeCallback(children._payload), + array, + escapedPrefix, + nameSoFar, + callback + ) + ); + } + } + if (invokeCallback) + return ( + (callback = callback(children)), + (invokeCallback = + "" === nameSoFar ? "." + getElementKey(children, 0) : nameSoFar), + isArrayImpl(callback) + ? ((escapedPrefix = ""), + null != invokeCallback && + (escapedPrefix = + invokeCallback.replace(userProvidedKeyEscapeRegex, "$&/") + "/"), + mapIntoArray(callback, array, escapedPrefix, "", function (c) { + return c; + })) + : null != callback && + (isValidElement(callback) && + (callback = cloneAndReplaceKey( + callback, + escapedPrefix + + (null == callback.key || + (children && children.key === callback.key) + ? "" + : ("" + callback.key).replace( + userProvidedKeyEscapeRegex, + "$&/" + ) + "/") + + invokeCallback + )), + array.push(callback)), + 1 + ); + invokeCallback = 0; + var nextNamePrefix = "" === nameSoFar ? "." : nameSoFar + ":"; + if (isArrayImpl(children)) + for (var i = 0; i < children.length; i++) + (nameSoFar = children[i]), + (type = nextNamePrefix + getElementKey(nameSoFar, i)), + (invokeCallback += mapIntoArray( + nameSoFar, + array, + escapedPrefix, + type, + callback + )); + else if (((i = getIteratorFn(children)), "function" === typeof i)) + for ( + children = i.call(children), i = 0; + !(nameSoFar = children.next()).done; + + ) + (nameSoFar = nameSoFar.value), + (type = nextNamePrefix + getElementKey(nameSoFar, i++)), + (invokeCallback += mapIntoArray( + nameSoFar, + array, + escapedPrefix, + type, + callback + )); + else if ("object" === type) { + if ("function" === typeof children.then) + return mapIntoArray( + resolveThenable(children), + array, + escapedPrefix, + nameSoFar, + callback + ); + array = String(children); + throw Error( + "Objects are not valid as a React child (found: " + + ("[object Object]" === array + ? "object with keys {" + Object.keys(children).join(", ") + "}" + : array) + + "). If you meant to render a collection of children, use an array instead." + ); + } + return invokeCallback; +} +function mapChildren(children, func, context) { + if (null == children) return children; + var result = [], + count = 0; + mapIntoArray(children, result, "", "", function (child) { + return func.call(context, child, count++); + }); + return result; +} +function lazyInitializer(payload) { + if (-1 === payload._status) { + var ctor = payload._result; + ctor = ctor(); + ctor.then( + function (moduleObject) { + if (0 === payload._status || -1 === payload._status) + (payload._status = 1), (payload._result = moduleObject); + }, + function (error) { + if (0 === payload._status || -1 === payload._status) + (payload._status = 2), (payload._result = error); + } + ); + -1 === payload._status && ((payload._status = 0), (payload._result = ctor)); + } + if (1 === payload._status) return payload._result.default; + throw payload._result; +} +var reportGlobalError = + "function" === typeof reportError + ? reportError + : function (error) { + if ( + "object" === typeof window && + "function" === typeof window.ErrorEvent + ) { + var event = new window.ErrorEvent("error", { + bubbles: !0, + cancelable: !0, + message: + "object" === typeof error && + null !== error && + "string" === typeof error.message + ? String(error.message) + : String(error), + error: error + }); + if (!window.dispatchEvent(event)) return; + } else if ( + "object" === typeof process && + "function" === typeof process.emit + ) { + process.emit("uncaughtException", error); + return; + } + console.error(error); + }, + Children = { + map: mapChildren, + forEach: function (children, forEachFunc, forEachContext) { + mapChildren( + children, + function () { + forEachFunc.apply(this, arguments); + }, + forEachContext + ); + }, + count: function (children) { + var n = 0; + mapChildren(children, function () { + n++; + }); + return n; + }, + toArray: function (children) { + return ( + mapChildren(children, function (child) { + return child; + }) || [] + ); + }, + only: function (children) { + if (!isValidElement(children)) + throw Error( + "React.Children.only expected to receive a single React element child." + ); + return children; + } + }; +exports.Activity = REACT_ACTIVITY_TYPE; +exports.Children = Children; +exports.Component = Component; +exports.Fragment = REACT_FRAGMENT_TYPE; +exports.Profiler = REACT_PROFILER_TYPE; +exports.PureComponent = PureComponent; +exports.StrictMode = REACT_STRICT_MODE_TYPE; +exports.Suspense = REACT_SUSPENSE_TYPE; +exports.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE = + ReactSharedInternals; +exports.__COMPILER_RUNTIME = { + __proto__: null, + c: function (size) { + return ReactSharedInternals.H.useMemoCache(size); + } +}; +exports.cache = function (fn) { + return function () { + return fn.apply(null, arguments); + }; +}; +exports.cacheSignal = function () { + return null; +}; +exports.cloneElement = function (element, config, children) { + if (null === element || void 0 === element) + throw Error( + "The argument must be a React element, but you passed " + element + "." + ); + var props = assign({}, element.props), + key = element.key; + if (null != config) + for (propName in (void 0 !== config.key && (key = "" + config.key), config)) + !hasOwnProperty.call(config, propName) || + "key" === propName || + "__self" === propName || + "__source" === propName || + ("ref" === propName && void 0 === config.ref) || + (props[propName] = config[propName]); + var propName = arguments.length - 2; + if (1 === propName) props.children = children; + else if (1 < propName) { + for (var childArray = Array(propName), i = 0; i < propName; i++) + childArray[i] = arguments[i + 2]; + props.children = childArray; + } + return ReactElement(element.type, key, props); +}; +exports.createContext = function (defaultValue) { + defaultValue = { + $$typeof: REACT_CONTEXT_TYPE, + _currentValue: defaultValue, + _currentValue2: defaultValue, + _threadCount: 0, + Provider: null, + Consumer: null + }; + defaultValue.Provider = defaultValue; + defaultValue.Consumer = { + $$typeof: REACT_CONSUMER_TYPE, + _context: defaultValue + }; + return defaultValue; +}; +exports.createElement = function (type, config, children) { + var propName, + props = {}, + key = null; + if (null != config) + for (propName in (void 0 !== config.key && (key = "" + config.key), config)) + hasOwnProperty.call(config, propName) && + "key" !== propName && + "__self" !== propName && + "__source" !== propName && + (props[propName] = config[propName]); + var childrenLength = arguments.length - 2; + if (1 === childrenLength) props.children = children; + else if (1 < childrenLength) { + for (var childArray = Array(childrenLength), i = 0; i < childrenLength; i++) + childArray[i] = arguments[i + 2]; + props.children = childArray; + } + if (type && type.defaultProps) + for (propName in ((childrenLength = type.defaultProps), childrenLength)) + void 0 === props[propName] && + (props[propName] = childrenLength[propName]); + return ReactElement(type, key, props); +}; +exports.createRef = function () { + return { current: null }; +}; +exports.forwardRef = function (render) { + return { $$typeof: REACT_FORWARD_REF_TYPE, render: render }; +}; +exports.isValidElement = isValidElement; +exports.lazy = function (ctor) { + return { + $$typeof: REACT_LAZY_TYPE, + _payload: { _status: -1, _result: ctor }, + _init: lazyInitializer + }; +}; +exports.memo = function (type, compare) { + return { + $$typeof: REACT_MEMO_TYPE, + type: type, + compare: void 0 === compare ? null : compare + }; +}; +exports.startTransition = function (scope) { + var prevTransition = ReactSharedInternals.T, + currentTransition = {}; + ReactSharedInternals.T = currentTransition; + try { + var returnValue = scope(), + onStartTransitionFinish = ReactSharedInternals.S; + null !== onStartTransitionFinish && + onStartTransitionFinish(currentTransition, returnValue); + "object" === typeof returnValue && + null !== returnValue && + "function" === typeof returnValue.then && + returnValue.then(noop, reportGlobalError); + } catch (error) { + reportGlobalError(error); + } finally { + null !== prevTransition && + null !== currentTransition.types && + (prevTransition.types = currentTransition.types), + (ReactSharedInternals.T = prevTransition); + } +}; +exports.unstable_useCacheRefresh = function () { + return ReactSharedInternals.H.useCacheRefresh(); +}; +exports.use = function (usable) { + return ReactSharedInternals.H.use(usable); +}; +exports.useActionState = function (action, initialState, permalink) { + return ReactSharedInternals.H.useActionState(action, initialState, permalink); +}; +exports.useCallback = function (callback, deps) { + return ReactSharedInternals.H.useCallback(callback, deps); +}; +exports.useContext = function (Context) { + return ReactSharedInternals.H.useContext(Context); +}; +exports.useDebugValue = function () {}; +exports.useDeferredValue = function (value, initialValue) { + return ReactSharedInternals.H.useDeferredValue(value, initialValue); +}; +exports.useEffect = function (create, deps) { + return ReactSharedInternals.H.useEffect(create, deps); +}; +exports.useEffectEvent = function (callback) { + return ReactSharedInternals.H.useEffectEvent(callback); +}; +exports.useId = function () { + return ReactSharedInternals.H.useId(); +}; +exports.useImperativeHandle = function (ref, create, deps) { + return ReactSharedInternals.H.useImperativeHandle(ref, create, deps); +}; +exports.useInsertionEffect = function (create, deps) { + return ReactSharedInternals.H.useInsertionEffect(create, deps); +}; +exports.useLayoutEffect = function (create, deps) { + return ReactSharedInternals.H.useLayoutEffect(create, deps); +}; +exports.useMemo = function (create, deps) { + return ReactSharedInternals.H.useMemo(create, deps); +}; +exports.useOptimistic = function (passthrough, reducer) { + return ReactSharedInternals.H.useOptimistic(passthrough, reducer); +}; +exports.useReducer = function (reducer, initialArg, init) { + return ReactSharedInternals.H.useReducer(reducer, initialArg, init); +}; +exports.useRef = function (initialValue) { + return ReactSharedInternals.H.useRef(initialValue); +}; +exports.useState = function (initialState) { + return ReactSharedInternals.H.useState(initialState); +}; +exports.useSyncExternalStore = function ( + subscribe, + getSnapshot, + getServerSnapshot +) { + return ReactSharedInternals.H.useSyncExternalStore( + subscribe, + getSnapshot, + getServerSnapshot + ); +}; +exports.useTransition = function () { + return ReactSharedInternals.H.useTransition(); +}; +exports.version = "19.2.4"; diff --git a/node_modules/react/cjs/react.react-server.development.js b/node_modules/react/cjs/react.react-server.development.js new file mode 100644 index 0000000..43625fb --- /dev/null +++ b/node_modules/react/cjs/react.react-server.development.js @@ -0,0 +1,848 @@ +/** + * @license React + * react.react-server.development.js + * + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +"use strict"; +"production" !== process.env.NODE_ENV && + (function () { + function noop() {} + function getIteratorFn(maybeIterable) { + if (null === maybeIterable || "object" !== typeof maybeIterable) + return null; + maybeIterable = + (MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL]) || + maybeIterable["@@iterator"]; + return "function" === typeof maybeIterable ? maybeIterable : null; + } + function testStringCoercion(value) { + return "" + value; + } + function checkKeyStringCoercion(value) { + try { + testStringCoercion(value); + var JSCompiler_inline_result = !1; + } catch (e) { + JSCompiler_inline_result = !0; + } + if (JSCompiler_inline_result) { + JSCompiler_inline_result = console; + var JSCompiler_temp_const = JSCompiler_inline_result.error; + var JSCompiler_inline_result$jscomp$0 = + ("function" === typeof Symbol && + Symbol.toStringTag && + value[Symbol.toStringTag]) || + value.constructor.name || + "Object"; + JSCompiler_temp_const.call( + JSCompiler_inline_result, + "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.", + JSCompiler_inline_result$jscomp$0 + ); + return testStringCoercion(value); + } + } + function getComponentNameFromType(type) { + if (null == type) return null; + if ("function" === typeof type) + return type.$$typeof === REACT_CLIENT_REFERENCE + ? null + : type.displayName || type.name || null; + if ("string" === typeof type) return type; + switch (type) { + case REACT_FRAGMENT_TYPE: + return "Fragment"; + case REACT_PROFILER_TYPE: + return "Profiler"; + case REACT_STRICT_MODE_TYPE: + return "StrictMode"; + case REACT_SUSPENSE_TYPE: + return "Suspense"; + case REACT_SUSPENSE_LIST_TYPE: + return "SuspenseList"; + case REACT_ACTIVITY_TYPE: + return "Activity"; + } + if ("object" === typeof type) + switch ( + ("number" === typeof type.tag && + console.error( + "Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue." + ), + type.$$typeof) + ) { + case REACT_PORTAL_TYPE: + return "Portal"; + case REACT_CONTEXT_TYPE: + return type.displayName || "Context"; + case REACT_CONSUMER_TYPE: + return (type._context.displayName || "Context") + ".Consumer"; + case REACT_FORWARD_REF_TYPE: + var innerType = type.render; + type = type.displayName; + type || + ((type = innerType.displayName || innerType.name || ""), + (type = "" !== type ? "ForwardRef(" + type + ")" : "ForwardRef")); + return type; + case REACT_MEMO_TYPE: + return ( + (innerType = type.displayName || null), + null !== innerType + ? innerType + : getComponentNameFromType(type.type) || "Memo" + ); + case REACT_LAZY_TYPE: + innerType = type._payload; + type = type._init; + try { + return getComponentNameFromType(type(innerType)); + } catch (x) {} + } + return null; + } + function getTaskName(type) { + if (type === REACT_FRAGMENT_TYPE) return "<>"; + if ( + "object" === typeof type && + null !== type && + type.$$typeof === REACT_LAZY_TYPE + ) + return "<...>"; + try { + var name = getComponentNameFromType(type); + return name ? "<" + name + ">" : "<...>"; + } catch (x) { + return "<...>"; + } + } + function getOwner() { + var dispatcher = ReactSharedInternals.A; + return null === dispatcher ? null : dispatcher.getOwner(); + } + function UnknownOwner() { + return Error("react-stack-top-frame"); + } + function hasValidKey(config) { + if (hasOwnProperty.call(config, "key")) { + var getter = Object.getOwnPropertyDescriptor(config, "key").get; + if (getter && getter.isReactWarning) return !1; + } + return void 0 !== config.key; + } + function defineKeyPropWarningGetter(props, displayName) { + function warnAboutAccessingKey() { + specialPropKeyWarningShown || + ((specialPropKeyWarningShown = !0), + console.error( + "%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)", + displayName + )); + } + warnAboutAccessingKey.isReactWarning = !0; + Object.defineProperty(props, "key", { + get: warnAboutAccessingKey, + configurable: !0 + }); + } + function elementRefGetterWithDeprecationWarning() { + var componentName = getComponentNameFromType(this.type); + didWarnAboutElementRef[componentName] || + ((didWarnAboutElementRef[componentName] = !0), + console.error( + "Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release." + )); + componentName = this.props.ref; + return void 0 !== componentName ? componentName : null; + } + function ReactElement(type, key, props, owner, debugStack, debugTask) { + var refProp = props.ref; + type = { + $$typeof: REACT_ELEMENT_TYPE, + type: type, + key: key, + props: props, + _owner: owner + }; + null !== (void 0 !== refProp ? refProp : null) + ? Object.defineProperty(type, "ref", { + enumerable: !1, + get: elementRefGetterWithDeprecationWarning + }) + : Object.defineProperty(type, "ref", { enumerable: !1, value: null }); + type._store = {}; + Object.defineProperty(type._store, "validated", { + configurable: !1, + enumerable: !1, + writable: !0, + value: 0 + }); + Object.defineProperty(type, "_debugInfo", { + configurable: !1, + enumerable: !1, + writable: !0, + value: null + }); + Object.defineProperty(type, "_debugStack", { + configurable: !1, + enumerable: !1, + writable: !0, + value: debugStack + }); + Object.defineProperty(type, "_debugTask", { + configurable: !1, + enumerable: !1, + writable: !0, + value: debugTask + }); + Object.freeze && (Object.freeze(type.props), Object.freeze(type)); + return type; + } + function cloneAndReplaceKey(oldElement, newKey) { + newKey = ReactElement( + oldElement.type, + newKey, + oldElement.props, + oldElement._owner, + oldElement._debugStack, + oldElement._debugTask + ); + oldElement._store && + (newKey._store.validated = oldElement._store.validated); + return newKey; + } + function validateChildKeys(node) { + isValidElement(node) + ? node._store && (node._store.validated = 1) + : "object" === typeof node && + null !== node && + node.$$typeof === REACT_LAZY_TYPE && + ("fulfilled" === node._payload.status + ? isValidElement(node._payload.value) && + node._payload.value._store && + (node._payload.value._store.validated = 1) + : node._store && (node._store.validated = 1)); + } + function isValidElement(object) { + return ( + "object" === typeof object && + null !== object && + object.$$typeof === REACT_ELEMENT_TYPE + ); + } + function escape(key) { + var escaperLookup = { "=": "=0", ":": "=2" }; + return ( + "$" + + key.replace(/[=:]/g, function (match) { + return escaperLookup[match]; + }) + ); + } + function getElementKey(element, index) { + return "object" === typeof element && + null !== element && + null != element.key + ? (checkKeyStringCoercion(element.key), escape("" + element.key)) + : index.toString(36); + } + function resolveThenable(thenable) { + switch (thenable.status) { + case "fulfilled": + return thenable.value; + case "rejected": + throw thenable.reason; + default: + switch ( + ("string" === typeof thenable.status + ? thenable.then(noop, noop) + : ((thenable.status = "pending"), + thenable.then( + function (fulfilledValue) { + "pending" === thenable.status && + ((thenable.status = "fulfilled"), + (thenable.value = fulfilledValue)); + }, + function (error) { + "pending" === thenable.status && + ((thenable.status = "rejected"), + (thenable.reason = error)); + } + )), + thenable.status) + ) { + case "fulfilled": + return thenable.value; + case "rejected": + throw thenable.reason; + } + } + throw thenable; + } + function mapIntoArray(children, array, escapedPrefix, nameSoFar, callback) { + var type = typeof children; + if ("undefined" === type || "boolean" === type) children = null; + var invokeCallback = !1; + if (null === children) invokeCallback = !0; + else + switch (type) { + case "bigint": + case "string": + case "number": + invokeCallback = !0; + break; + case "object": + switch (children.$$typeof) { + case REACT_ELEMENT_TYPE: + case REACT_PORTAL_TYPE: + invokeCallback = !0; + break; + case REACT_LAZY_TYPE: + return ( + (invokeCallback = children._init), + mapIntoArray( + invokeCallback(children._payload), + array, + escapedPrefix, + nameSoFar, + callback + ) + ); + } + } + if (invokeCallback) { + invokeCallback = children; + callback = callback(invokeCallback); + var childKey = + "" === nameSoFar ? "." + getElementKey(invokeCallback, 0) : nameSoFar; + isArrayImpl(callback) + ? ((escapedPrefix = ""), + null != childKey && + (escapedPrefix = + childKey.replace(userProvidedKeyEscapeRegex, "$&/") + "/"), + mapIntoArray(callback, array, escapedPrefix, "", function (c) { + return c; + })) + : null != callback && + (isValidElement(callback) && + (null != callback.key && + ((invokeCallback && invokeCallback.key === callback.key) || + checkKeyStringCoercion(callback.key)), + (escapedPrefix = cloneAndReplaceKey( + callback, + escapedPrefix + + (null == callback.key || + (invokeCallback && invokeCallback.key === callback.key) + ? "" + : ("" + callback.key).replace( + userProvidedKeyEscapeRegex, + "$&/" + ) + "/") + + childKey + )), + "" !== nameSoFar && + null != invokeCallback && + isValidElement(invokeCallback) && + null == invokeCallback.key && + invokeCallback._store && + !invokeCallback._store.validated && + (escapedPrefix._store.validated = 2), + (callback = escapedPrefix)), + array.push(callback)); + return 1; + } + invokeCallback = 0; + childKey = "" === nameSoFar ? "." : nameSoFar + ":"; + if (isArrayImpl(children)) + for (var i = 0; i < children.length; i++) + (nameSoFar = children[i]), + (type = childKey + getElementKey(nameSoFar, i)), + (invokeCallback += mapIntoArray( + nameSoFar, + array, + escapedPrefix, + type, + callback + )); + else if (((i = getIteratorFn(children)), "function" === typeof i)) + for ( + i === children.entries && + (didWarnAboutMaps || + console.warn( + "Using Maps as children is not supported. Use an array of keyed ReactElements instead." + ), + (didWarnAboutMaps = !0)), + children = i.call(children), + i = 0; + !(nameSoFar = children.next()).done; + + ) + (nameSoFar = nameSoFar.value), + (type = childKey + getElementKey(nameSoFar, i++)), + (invokeCallback += mapIntoArray( + nameSoFar, + array, + escapedPrefix, + type, + callback + )); + else if ("object" === type) { + if ("function" === typeof children.then) + return mapIntoArray( + resolveThenable(children), + array, + escapedPrefix, + nameSoFar, + callback + ); + array = String(children); + throw Error( + "Objects are not valid as a React child (found: " + + ("[object Object]" === array + ? "object with keys {" + Object.keys(children).join(", ") + "}" + : array) + + "). If you meant to render a collection of children, use an array instead." + ); + } + return invokeCallback; + } + function mapChildren(children, func, context) { + if (null == children) return children; + var result = [], + count = 0; + mapIntoArray(children, result, "", "", function (child) { + return func.call(context, child, count++); + }); + return result; + } + function resolveDispatcher() { + var dispatcher = ReactSharedInternals.H; + null === dispatcher && + console.error( + "Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\n1. You might have mismatching versions of React and the renderer (such as React DOM)\n2. You might be breaking the Rules of Hooks\n3. You might have more than one copy of React in the same app\nSee https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem." + ); + return dispatcher; + } + function lazyInitializer(payload) { + if (-1 === payload._status) { + var ioInfo = payload._ioInfo; + null != ioInfo && (ioInfo.start = ioInfo.end = performance.now()); + ioInfo = payload._result; + var thenable = ioInfo(); + thenable.then( + function (moduleObject) { + if (0 === payload._status || -1 === payload._status) { + payload._status = 1; + payload._result = moduleObject; + var _ioInfo = payload._ioInfo; + null != _ioInfo && (_ioInfo.end = performance.now()); + void 0 === thenable.status && + ((thenable.status = "fulfilled"), + (thenable.value = moduleObject)); + } + }, + function (error) { + if (0 === payload._status || -1 === payload._status) { + payload._status = 2; + payload._result = error; + var _ioInfo2 = payload._ioInfo; + null != _ioInfo2 && (_ioInfo2.end = performance.now()); + void 0 === thenable.status && + ((thenable.status = "rejected"), (thenable.reason = error)); + } + } + ); + ioInfo = payload._ioInfo; + if (null != ioInfo) { + ioInfo.value = thenable; + var displayName = thenable.displayName; + "string" === typeof displayName && (ioInfo.name = displayName); + } + -1 === payload._status && + ((payload._status = 0), (payload._result = thenable)); + } + if (1 === payload._status) + return ( + (ioInfo = payload._result), + void 0 === ioInfo && + console.error( + "lazy: Expected the result of a dynamic import() call. Instead received: %s\n\nYour code should look like: \n const MyComponent = lazy(() => import('./MyComponent'))\n\nDid you accidentally put curly braces around the import?", + ioInfo + ), + "default" in ioInfo || + console.error( + "lazy: Expected the result of a dynamic import() call. Instead received: %s\n\nYour code should look like: \n const MyComponent = lazy(() => import('./MyComponent'))", + ioInfo + ), + ioInfo.default + ); + throw payload._result; + } + function createCacheRoot() { + return new WeakMap(); + } + function createCacheNode() { + return { s: 0, v: void 0, o: null, p: null }; + } + var ReactSharedInternals = { + H: null, + A: null, + getCurrentStack: null, + recentlyCreatedOwnerStacks: 0 + }, + isArrayImpl = Array.isArray, + REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"), + REACT_PORTAL_TYPE = Symbol.for("react.portal"), + REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"), + REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"), + REACT_PROFILER_TYPE = Symbol.for("react.profiler"), + REACT_CONSUMER_TYPE = Symbol.for("react.consumer"), + REACT_CONTEXT_TYPE = Symbol.for("react.context"), + REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"), + REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"), + REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"), + REACT_MEMO_TYPE = Symbol.for("react.memo"), + REACT_LAZY_TYPE = Symbol.for("react.lazy"), + REACT_ACTIVITY_TYPE = Symbol.for("react.activity"), + MAYBE_ITERATOR_SYMBOL = Symbol.iterator, + REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference"), + hasOwnProperty = Object.prototype.hasOwnProperty, + assign = Object.assign, + createTask = console.createTask + ? console.createTask + : function () { + return null; + }, + createFakeCallStack = { + react_stack_bottom_frame: function (callStackForError) { + return callStackForError(); + } + }, + specialPropKeyWarningShown, + didWarnAboutOldJSXRuntime; + var didWarnAboutElementRef = {}; + var unknownOwnerDebugStack = + createFakeCallStack.react_stack_bottom_frame.bind( + createFakeCallStack, + UnknownOwner + )(); + var unknownOwnerDebugTask = createTask(getTaskName(UnknownOwner)); + var didWarnAboutMaps = !1, + userProvidedKeyEscapeRegex = /\/+/g; + exports.Children = { + map: mapChildren, + forEach: function (children, forEachFunc, forEachContext) { + mapChildren( + children, + function () { + forEachFunc.apply(this, arguments); + }, + forEachContext + ); + }, + count: function (children) { + var n = 0; + mapChildren(children, function () { + n++; + }); + return n; + }, + toArray: function (children) { + return ( + mapChildren(children, function (child) { + return child; + }) || [] + ); + }, + only: function (children) { + if (!isValidElement(children)) + throw Error( + "React.Children.only expected to receive a single React element child." + ); + return children; + } + }; + exports.Fragment = REACT_FRAGMENT_TYPE; + exports.Profiler = REACT_PROFILER_TYPE; + exports.StrictMode = REACT_STRICT_MODE_TYPE; + exports.Suspense = REACT_SUSPENSE_TYPE; + exports.__SERVER_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE = + ReactSharedInternals; + exports.cache = function (fn) { + return function () { + var dispatcher = ReactSharedInternals.A; + if (!dispatcher) return fn.apply(null, arguments); + var fnMap = dispatcher.getCacheForType(createCacheRoot); + dispatcher = fnMap.get(fn); + void 0 === dispatcher && + ((dispatcher = createCacheNode()), fnMap.set(fn, dispatcher)); + fnMap = 0; + for (var l = arguments.length; fnMap < l; fnMap++) { + var arg = arguments[fnMap]; + if ( + "function" === typeof arg || + ("object" === typeof arg && null !== arg) + ) { + var objectCache = dispatcher.o; + null === objectCache && + (dispatcher.o = objectCache = new WeakMap()); + dispatcher = objectCache.get(arg); + void 0 === dispatcher && + ((dispatcher = createCacheNode()), + objectCache.set(arg, dispatcher)); + } else + (objectCache = dispatcher.p), + null === objectCache && (dispatcher.p = objectCache = new Map()), + (dispatcher = objectCache.get(arg)), + void 0 === dispatcher && + ((dispatcher = createCacheNode()), + objectCache.set(arg, dispatcher)); + } + if (1 === dispatcher.s) return dispatcher.v; + if (2 === dispatcher.s) throw dispatcher.v; + try { + var result = fn.apply(null, arguments); + fnMap = dispatcher; + fnMap.s = 1; + return (fnMap.v = result); + } catch (error) { + throw ( + ((result = dispatcher), (result.s = 2), (result.v = error), error) + ); + } + }; + }; + exports.cacheSignal = function () { + var dispatcher = ReactSharedInternals.A; + return dispatcher ? dispatcher.cacheSignal() : null; + }; + exports.captureOwnerStack = function () { + var getCurrentStack = ReactSharedInternals.getCurrentStack; + return null === getCurrentStack ? null : getCurrentStack(); + }; + exports.cloneElement = function (element, config, children) { + if (null === element || void 0 === element) + throw Error( + "The argument must be a React element, but you passed " + + element + + "." + ); + var props = assign({}, element.props), + key = element.key, + owner = element._owner; + if (null != config) { + var JSCompiler_inline_result; + a: { + if ( + hasOwnProperty.call(config, "ref") && + (JSCompiler_inline_result = Object.getOwnPropertyDescriptor( + config, + "ref" + ).get) && + JSCompiler_inline_result.isReactWarning + ) { + JSCompiler_inline_result = !1; + break a; + } + JSCompiler_inline_result = void 0 !== config.ref; + } + JSCompiler_inline_result && (owner = getOwner()); + hasValidKey(config) && + (checkKeyStringCoercion(config.key), (key = "" + config.key)); + for (propName in config) + !hasOwnProperty.call(config, propName) || + "key" === propName || + "__self" === propName || + "__source" === propName || + ("ref" === propName && void 0 === config.ref) || + (props[propName] = config[propName]); + } + var propName = arguments.length - 2; + if (1 === propName) props.children = children; + else if (1 < propName) { + JSCompiler_inline_result = Array(propName); + for (var i = 0; i < propName; i++) + JSCompiler_inline_result[i] = arguments[i + 2]; + props.children = JSCompiler_inline_result; + } + props = ReactElement( + element.type, + key, + props, + owner, + element._debugStack, + element._debugTask + ); + for (key = 2; key < arguments.length; key++) + validateChildKeys(arguments[key]); + return props; + }; + exports.createElement = function (type, config, children) { + for (var i = 2; i < arguments.length; i++) + validateChildKeys(arguments[i]); + i = {}; + var key = null; + if (null != config) + for (propName in (didWarnAboutOldJSXRuntime || + !("__self" in config) || + "key" in config || + ((didWarnAboutOldJSXRuntime = !0), + console.warn( + "Your app (or one of its dependencies) is using an outdated JSX transform. Update to the modern JSX transform for faster performance: https://react.dev/link/new-jsx-transform" + )), + hasValidKey(config) && + (checkKeyStringCoercion(config.key), (key = "" + config.key)), + config)) + hasOwnProperty.call(config, propName) && + "key" !== propName && + "__self" !== propName && + "__source" !== propName && + (i[propName] = config[propName]); + var childrenLength = arguments.length - 2; + if (1 === childrenLength) i.children = children; + else if (1 < childrenLength) { + for ( + var childArray = Array(childrenLength), _i = 0; + _i < childrenLength; + _i++ + ) + childArray[_i] = arguments[_i + 2]; + Object.freeze && Object.freeze(childArray); + i.children = childArray; + } + if (type && type.defaultProps) + for (propName in ((childrenLength = type.defaultProps), childrenLength)) + void 0 === i[propName] && (i[propName] = childrenLength[propName]); + key && + defineKeyPropWarningGetter( + i, + "function" === typeof type + ? type.displayName || type.name || "Unknown" + : type + ); + var propName = 1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++; + return ReactElement( + type, + key, + i, + getOwner(), + propName ? Error("react-stack-top-frame") : unknownOwnerDebugStack, + propName ? createTask(getTaskName(type)) : unknownOwnerDebugTask + ); + }; + exports.createRef = function () { + var refObject = { current: null }; + Object.seal(refObject); + return refObject; + }; + exports.forwardRef = function (render) { + null != render && render.$$typeof === REACT_MEMO_TYPE + ? console.error( + "forwardRef requires a render function but received a `memo` component. Instead of forwardRef(memo(...)), use memo(forwardRef(...))." + ) + : "function" !== typeof render + ? console.error( + "forwardRef requires a render function but was given %s.", + null === render ? "null" : typeof render + ) + : 0 !== render.length && + 2 !== render.length && + console.error( + "forwardRef render functions accept exactly two parameters: props and ref. %s", + 1 === render.length + ? "Did you forget to use the ref parameter?" + : "Any additional parameter will be undefined." + ); + null != render && + null != render.defaultProps && + console.error( + "forwardRef render functions do not support defaultProps. Did you accidentally pass a React component?" + ); + var elementType = { $$typeof: REACT_FORWARD_REF_TYPE, render: render }, + ownName; + Object.defineProperty(elementType, "displayName", { + enumerable: !1, + configurable: !0, + get: function () { + return ownName; + }, + set: function (name) { + ownName = name; + render.name || + render.displayName || + (Object.defineProperty(render, "name", { value: name }), + (render.displayName = name)); + } + }); + return elementType; + }; + exports.isValidElement = isValidElement; + exports.lazy = function (ctor) { + ctor = { _status: -1, _result: ctor }; + var lazyType = { + $$typeof: REACT_LAZY_TYPE, + _payload: ctor, + _init: lazyInitializer + }, + ioInfo = { + name: "lazy", + start: -1, + end: -1, + value: null, + owner: null, + debugStack: Error("react-stack-top-frame"), + debugTask: console.createTask ? console.createTask("lazy()") : null + }; + ctor._ioInfo = ioInfo; + lazyType._debugInfo = [{ awaited: ioInfo }]; + return lazyType; + }; + exports.memo = function (type, compare) { + null == type && + console.error( + "memo: The first argument must be a component. Instead received: %s", + null === type ? "null" : typeof type + ); + compare = { + $$typeof: REACT_MEMO_TYPE, + type: type, + compare: void 0 === compare ? null : compare + }; + var ownName; + Object.defineProperty(compare, "displayName", { + enumerable: !1, + configurable: !0, + get: function () { + return ownName; + }, + set: function (name) { + ownName = name; + type.name || + type.displayName || + (Object.defineProperty(type, "name", { value: name }), + (type.displayName = name)); + } + }); + return compare; + }; + exports.use = function (usable) { + return resolveDispatcher().use(usable); + }; + exports.useCallback = function (callback, deps) { + return resolveDispatcher().useCallback(callback, deps); + }; + exports.useDebugValue = function (value, formatterFn) { + return resolveDispatcher().useDebugValue(value, formatterFn); + }; + exports.useId = function () { + return resolveDispatcher().useId(); + }; + exports.useMemo = function (create, deps) { + return resolveDispatcher().useMemo(create, deps); + }; + exports.version = "19.2.4"; + })(); diff --git a/node_modules/react/cjs/react.react-server.production.js b/node_modules/react/cjs/react.react-server.production.js new file mode 100644 index 0000000..30e61f6 --- /dev/null +++ b/node_modules/react/cjs/react.react-server.production.js @@ -0,0 +1,423 @@ +/** + * @license React + * react.react-server.production.js + * + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +"use strict"; +var ReactSharedInternals = { H: null, A: null }; +function formatProdErrorMessage(code) { + var url = "https://react.dev/errors/" + code; + if (1 < arguments.length) { + url += "?args[]=" + encodeURIComponent(arguments[1]); + for (var i = 2; i < arguments.length; i++) + url += "&args[]=" + encodeURIComponent(arguments[i]); + } + return ( + "Minified React error #" + + code + + "; visit " + + url + + " for the full message or use the non-minified dev environment for full errors and additional helpful warnings." + ); +} +var isArrayImpl = Array.isArray; +function noop() {} +var REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"), + REACT_PORTAL_TYPE = Symbol.for("react.portal"), + REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"), + REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"), + REACT_PROFILER_TYPE = Symbol.for("react.profiler"), + REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"), + REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"), + REACT_MEMO_TYPE = Symbol.for("react.memo"), + REACT_LAZY_TYPE = Symbol.for("react.lazy"), + MAYBE_ITERATOR_SYMBOL = Symbol.iterator; +function getIteratorFn(maybeIterable) { + if (null === maybeIterable || "object" !== typeof maybeIterable) return null; + maybeIterable = + (MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL]) || + maybeIterable["@@iterator"]; + return "function" === typeof maybeIterable ? maybeIterable : null; +} +var hasOwnProperty = Object.prototype.hasOwnProperty, + assign = Object.assign; +function ReactElement(type, key, props) { + var refProp = props.ref; + return { + $$typeof: REACT_ELEMENT_TYPE, + type: type, + key: key, + ref: void 0 !== refProp ? refProp : null, + props: props + }; +} +function cloneAndReplaceKey(oldElement, newKey) { + return ReactElement(oldElement.type, newKey, oldElement.props); +} +function isValidElement(object) { + return ( + "object" === typeof object && + null !== object && + object.$$typeof === REACT_ELEMENT_TYPE + ); +} +function escape(key) { + var escaperLookup = { "=": "=0", ":": "=2" }; + return ( + "$" + + key.replace(/[=:]/g, function (match) { + return escaperLookup[match]; + }) + ); +} +var userProvidedKeyEscapeRegex = /\/+/g; +function getElementKey(element, index) { + return "object" === typeof element && null !== element && null != element.key + ? escape("" + element.key) + : index.toString(36); +} +function resolveThenable(thenable) { + switch (thenable.status) { + case "fulfilled": + return thenable.value; + case "rejected": + throw thenable.reason; + default: + switch ( + ("string" === typeof thenable.status + ? thenable.then(noop, noop) + : ((thenable.status = "pending"), + thenable.then( + function (fulfilledValue) { + "pending" === thenable.status && + ((thenable.status = "fulfilled"), + (thenable.value = fulfilledValue)); + }, + function (error) { + "pending" === thenable.status && + ((thenable.status = "rejected"), (thenable.reason = error)); + } + )), + thenable.status) + ) { + case "fulfilled": + return thenable.value; + case "rejected": + throw thenable.reason; + } + } + throw thenable; +} +function mapIntoArray(children, array, escapedPrefix, nameSoFar, callback) { + var type = typeof children; + if ("undefined" === type || "boolean" === type) children = null; + var invokeCallback = !1; + if (null === children) invokeCallback = !0; + else + switch (type) { + case "bigint": + case "string": + case "number": + invokeCallback = !0; + break; + case "object": + switch (children.$$typeof) { + case REACT_ELEMENT_TYPE: + case REACT_PORTAL_TYPE: + invokeCallback = !0; + break; + case REACT_LAZY_TYPE: + return ( + (invokeCallback = children._init), + mapIntoArray( + invokeCallback(children._payload), + array, + escapedPrefix, + nameSoFar, + callback + ) + ); + } + } + if (invokeCallback) + return ( + (callback = callback(children)), + (invokeCallback = + "" === nameSoFar ? "." + getElementKey(children, 0) : nameSoFar), + isArrayImpl(callback) + ? ((escapedPrefix = ""), + null != invokeCallback && + (escapedPrefix = + invokeCallback.replace(userProvidedKeyEscapeRegex, "$&/") + "/"), + mapIntoArray(callback, array, escapedPrefix, "", function (c) { + return c; + })) + : null != callback && + (isValidElement(callback) && + (callback = cloneAndReplaceKey( + callback, + escapedPrefix + + (null == callback.key || + (children && children.key === callback.key) + ? "" + : ("" + callback.key).replace( + userProvidedKeyEscapeRegex, + "$&/" + ) + "/") + + invokeCallback + )), + array.push(callback)), + 1 + ); + invokeCallback = 0; + var nextNamePrefix = "" === nameSoFar ? "." : nameSoFar + ":"; + if (isArrayImpl(children)) + for (var i = 0; i < children.length; i++) + (nameSoFar = children[i]), + (type = nextNamePrefix + getElementKey(nameSoFar, i)), + (invokeCallback += mapIntoArray( + nameSoFar, + array, + escapedPrefix, + type, + callback + )); + else if (((i = getIteratorFn(children)), "function" === typeof i)) + for ( + children = i.call(children), i = 0; + !(nameSoFar = children.next()).done; + + ) + (nameSoFar = nameSoFar.value), + (type = nextNamePrefix + getElementKey(nameSoFar, i++)), + (invokeCallback += mapIntoArray( + nameSoFar, + array, + escapedPrefix, + type, + callback + )); + else if ("object" === type) { + if ("function" === typeof children.then) + return mapIntoArray( + resolveThenable(children), + array, + escapedPrefix, + nameSoFar, + callback + ); + array = String(children); + throw Error( + formatProdErrorMessage( + 31, + "[object Object]" === array + ? "object with keys {" + Object.keys(children).join(", ") + "}" + : array + ) + ); + } + return invokeCallback; +} +function mapChildren(children, func, context) { + if (null == children) return children; + var result = [], + count = 0; + mapIntoArray(children, result, "", "", function (child) { + return func.call(context, child, count++); + }); + return result; +} +function lazyInitializer(payload) { + if (-1 === payload._status) { + var ctor = payload._result; + ctor = ctor(); + ctor.then( + function (moduleObject) { + if (0 === payload._status || -1 === payload._status) + (payload._status = 1), (payload._result = moduleObject); + }, + function (error) { + if (0 === payload._status || -1 === payload._status) + (payload._status = 2), (payload._result = error); + } + ); + -1 === payload._status && ((payload._status = 0), (payload._result = ctor)); + } + if (1 === payload._status) return payload._result.default; + throw payload._result; +} +function createCacheRoot() { + return new WeakMap(); +} +function createCacheNode() { + return { s: 0, v: void 0, o: null, p: null }; +} +exports.Children = { + map: mapChildren, + forEach: function (children, forEachFunc, forEachContext) { + mapChildren( + children, + function () { + forEachFunc.apply(this, arguments); + }, + forEachContext + ); + }, + count: function (children) { + var n = 0; + mapChildren(children, function () { + n++; + }); + return n; + }, + toArray: function (children) { + return ( + mapChildren(children, function (child) { + return child; + }) || [] + ); + }, + only: function (children) { + if (!isValidElement(children)) throw Error(formatProdErrorMessage(143)); + return children; + } +}; +exports.Fragment = REACT_FRAGMENT_TYPE; +exports.Profiler = REACT_PROFILER_TYPE; +exports.StrictMode = REACT_STRICT_MODE_TYPE; +exports.Suspense = REACT_SUSPENSE_TYPE; +exports.__SERVER_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE = + ReactSharedInternals; +exports.cache = function (fn) { + return function () { + var dispatcher = ReactSharedInternals.A; + if (!dispatcher) return fn.apply(null, arguments); + var fnMap = dispatcher.getCacheForType(createCacheRoot); + dispatcher = fnMap.get(fn); + void 0 === dispatcher && + ((dispatcher = createCacheNode()), fnMap.set(fn, dispatcher)); + fnMap = 0; + for (var l = arguments.length; fnMap < l; fnMap++) { + var arg = arguments[fnMap]; + if ( + "function" === typeof arg || + ("object" === typeof arg && null !== arg) + ) { + var objectCache = dispatcher.o; + null === objectCache && (dispatcher.o = objectCache = new WeakMap()); + dispatcher = objectCache.get(arg); + void 0 === dispatcher && + ((dispatcher = createCacheNode()), objectCache.set(arg, dispatcher)); + } else + (objectCache = dispatcher.p), + null === objectCache && (dispatcher.p = objectCache = new Map()), + (dispatcher = objectCache.get(arg)), + void 0 === dispatcher && + ((dispatcher = createCacheNode()), + objectCache.set(arg, dispatcher)); + } + if (1 === dispatcher.s) return dispatcher.v; + if (2 === dispatcher.s) throw dispatcher.v; + try { + var result = fn.apply(null, arguments); + fnMap = dispatcher; + fnMap.s = 1; + return (fnMap.v = result); + } catch (error) { + throw ((result = dispatcher), (result.s = 2), (result.v = error), error); + } + }; +}; +exports.cacheSignal = function () { + var dispatcher = ReactSharedInternals.A; + return dispatcher ? dispatcher.cacheSignal() : null; +}; +exports.captureOwnerStack = function () { + return null; +}; +exports.cloneElement = function (element, config, children) { + if (null === element || void 0 === element) + throw Error(formatProdErrorMessage(267, element)); + var props = assign({}, element.props), + key = element.key; + if (null != config) + for (propName in (void 0 !== config.key && (key = "" + config.key), config)) + !hasOwnProperty.call(config, propName) || + "key" === propName || + "__self" === propName || + "__source" === propName || + ("ref" === propName && void 0 === config.ref) || + (props[propName] = config[propName]); + var propName = arguments.length - 2; + if (1 === propName) props.children = children; + else if (1 < propName) { + for (var childArray = Array(propName), i = 0; i < propName; i++) + childArray[i] = arguments[i + 2]; + props.children = childArray; + } + return ReactElement(element.type, key, props); +}; +exports.createElement = function (type, config, children) { + var propName, + props = {}, + key = null; + if (null != config) + for (propName in (void 0 !== config.key && (key = "" + config.key), config)) + hasOwnProperty.call(config, propName) && + "key" !== propName && + "__self" !== propName && + "__source" !== propName && + (props[propName] = config[propName]); + var childrenLength = arguments.length - 2; + if (1 === childrenLength) props.children = children; + else if (1 < childrenLength) { + for (var childArray = Array(childrenLength), i = 0; i < childrenLength; i++) + childArray[i] = arguments[i + 2]; + props.children = childArray; + } + if (type && type.defaultProps) + for (propName in ((childrenLength = type.defaultProps), childrenLength)) + void 0 === props[propName] && + (props[propName] = childrenLength[propName]); + return ReactElement(type, key, props); +}; +exports.createRef = function () { + return { current: null }; +}; +exports.forwardRef = function (render) { + return { $$typeof: REACT_FORWARD_REF_TYPE, render: render }; +}; +exports.isValidElement = isValidElement; +exports.lazy = function (ctor) { + return { + $$typeof: REACT_LAZY_TYPE, + _payload: { _status: -1, _result: ctor }, + _init: lazyInitializer + }; +}; +exports.memo = function (type, compare) { + return { + $$typeof: REACT_MEMO_TYPE, + type: type, + compare: void 0 === compare ? null : compare + }; +}; +exports.use = function (usable) { + return ReactSharedInternals.H.use(usable); +}; +exports.useCallback = function (callback, deps) { + return ReactSharedInternals.H.useCallback(callback, deps); +}; +exports.useDebugValue = function () {}; +exports.useId = function () { + return ReactSharedInternals.H.useId(); +}; +exports.useMemo = function (create, deps) { + return ReactSharedInternals.H.useMemo(create, deps); +}; +exports.version = "19.2.4"; diff --git a/node_modules/react/compiler-runtime.js b/node_modules/react/compiler-runtime.js new file mode 100644 index 0000000..ab6aabb --- /dev/null +++ b/node_modules/react/compiler-runtime.js @@ -0,0 +1,14 @@ +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +'use strict'; + +if (process.env.NODE_ENV === 'production') { + module.exports = require('./cjs/react-compiler-runtime.production.js'); +} else { + module.exports = require('./cjs/react-compiler-runtime.development.js'); +} diff --git a/node_modules/react/index.js b/node_modules/react/index.js new file mode 100644 index 0000000..d830d7a --- /dev/null +++ b/node_modules/react/index.js @@ -0,0 +1,7 @@ +'use strict'; + +if (process.env.NODE_ENV === 'production') { + module.exports = require('./cjs/react.production.js'); +} else { + module.exports = require('./cjs/react.development.js'); +} diff --git a/node_modules/react/jsx-dev-runtime.js b/node_modules/react/jsx-dev-runtime.js new file mode 100644 index 0000000..0a80857 --- /dev/null +++ b/node_modules/react/jsx-dev-runtime.js @@ -0,0 +1,7 @@ +'use strict'; + +if (process.env.NODE_ENV === 'production') { + module.exports = require('./cjs/react-jsx-dev-runtime.production.js'); +} else { + module.exports = require('./cjs/react-jsx-dev-runtime.development.js'); +} diff --git a/node_modules/react/jsx-dev-runtime.react-server.js b/node_modules/react/jsx-dev-runtime.react-server.js new file mode 100644 index 0000000..d11e6e8 --- /dev/null +++ b/node_modules/react/jsx-dev-runtime.react-server.js @@ -0,0 +1,7 @@ +'use strict'; + +if (process.env.NODE_ENV === 'production') { + module.exports = require('./cjs/react-jsx-dev-runtime.react-server.production.js'); +} else { + module.exports = require('./cjs/react-jsx-dev-runtime.react-server.development.js'); +} diff --git a/node_modules/react/jsx-runtime.js b/node_modules/react/jsx-runtime.js new file mode 100644 index 0000000..8679b72 --- /dev/null +++ b/node_modules/react/jsx-runtime.js @@ -0,0 +1,7 @@ +'use strict'; + +if (process.env.NODE_ENV === 'production') { + module.exports = require('./cjs/react-jsx-runtime.production.js'); +} else { + module.exports = require('./cjs/react-jsx-runtime.development.js'); +} diff --git a/node_modules/react/jsx-runtime.react-server.js b/node_modules/react/jsx-runtime.react-server.js new file mode 100644 index 0000000..2d23c8c --- /dev/null +++ b/node_modules/react/jsx-runtime.react-server.js @@ -0,0 +1,7 @@ +'use strict'; + +if (process.env.NODE_ENV === 'production') { + module.exports = require('./cjs/react-jsx-runtime.react-server.production.js'); +} else { + module.exports = require('./cjs/react-jsx-runtime.react-server.development.js'); +} diff --git a/node_modules/react/package.json b/node_modules/react/package.json new file mode 100644 index 0000000..da45a9d --- /dev/null +++ b/node_modules/react/package.json @@ -0,0 +1,51 @@ +{ + "name": "react", + "description": "React is a JavaScript library for building user interfaces.", + "keywords": [ + "react" + ], + "version": "19.2.4", + "homepage": "https://react.dev/", + "bugs": "https://github.com/facebook/react/issues", + "license": "MIT", + "files": [ + "LICENSE", + "README.md", + "index.js", + "cjs/", + "compiler-runtime.js", + "jsx-runtime.js", + "jsx-runtime.react-server.js", + "jsx-dev-runtime.js", + "jsx-dev-runtime.react-server.js", + "react.react-server.js" + ], + "main": "index.js", + "exports": { + ".": { + "react-server": "./react.react-server.js", + "default": "./index.js" + }, + "./package.json": "./package.json", + "./jsx-runtime": { + "react-server": "./jsx-runtime.react-server.js", + "default": "./jsx-runtime.js" + }, + "./jsx-dev-runtime": { + "react-server": "./jsx-dev-runtime.react-server.js", + "default": "./jsx-dev-runtime.js" + }, + "./compiler-runtime": { + "react-server": "./compiler-runtime.js", + "default": "./compiler-runtime.js" + } + }, + "repository": { + "type": "git", + "url": "https://github.com/facebook/react.git", + "directory": "packages/react" + }, + "engines": { + "node": ">=0.10.0" + } +} \ No newline at end of file diff --git a/node_modules/react/react.react-server.js b/node_modules/react/react.react-server.js new file mode 100644 index 0000000..c66e3b7 --- /dev/null +++ b/node_modules/react/react.react-server.js @@ -0,0 +1,7 @@ +'use strict'; + +if (process.env.NODE_ENV === 'production') { + module.exports = require('./cjs/react.react-server.production.js'); +} else { + module.exports = require('./cjs/react.react-server.development.js'); +} diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..38641dd --- /dev/null +++ b/package-lock.json @@ -0,0 +1,48 @@ +{ + "name": "ManageAssets", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "dependencies": { + "@tanstack/react-query": "^5.90.21" + } + }, + "node_modules/@tanstack/query-core": { + "version": "5.90.20", + "resolved": "https://registry.npmjs.org/@tanstack/query-core/-/query-core-5.90.20.tgz", + "integrity": "sha512-OMD2HLpNouXEfZJWcKeVKUgQ5n+n3A2JFmBaScpNDUqSrQSjiveC7dKMe53uJUg1nDG16ttFPz2xfilz6i2uVg==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/tannerlinsley" + } + }, + "node_modules/@tanstack/react-query": { + "version": "5.90.21", + "resolved": "https://registry.npmjs.org/@tanstack/react-query/-/react-query-5.90.21.tgz", + "integrity": "sha512-0Lu6y5t+tvlTJMTO7oh5NSpJfpg/5D41LlThfepTixPYkJ0sE2Jj0m0f6yYqujBwIXlId87e234+MxG3D3g7kg==", + "license": "MIT", + "dependencies": { + "@tanstack/query-core": "5.90.20" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/tannerlinsley" + }, + "peerDependencies": { + "react": "^18 || ^19" + } + }, + "node_modules/react": { + "version": "19.2.4", + "resolved": "https://registry.npmjs.org/react/-/react-19.2.4.tgz", + "integrity": "sha512-9nfp2hYpCwOjAN+8TZFGhtWEwgvWHXqESH8qT89AT/lWklpLON22Lc8pEtnpsZz7VmawabSU0gCjnj8aC0euHQ==", + "license": "MIT", + "peer": true, + "engines": { + "node": ">=0.10.0" + } + } + } +} diff --git a/package.json b/package.json new file mode 100644 index 0000000..6e2bd21 --- /dev/null +++ b/package.json @@ -0,0 +1,5 @@ +{ + "dependencies": { + "@tanstack/react-query": "^5.90.21" + } +} From ef74455194d606d0359c8f6ee296bdefff272f5d Mon Sep 17 00:00:00 2001 From: shamoo53 Date: Sun, 22 Feb 2026 18:05:10 +0100 Subject: [PATCH 2/2] remove node remove bode --- node_modules/.package-lock.json | 43 - node_modules/@tanstack/query-core/LICENSE | 21 - .../query-core/build/legacy/chunk-PXG64RU4.js | 25 - .../build/legacy/chunk-PXG64RU4.js.map | 1 - .../query-core/build/legacy/focusManager.cjs | 108 -- .../build/legacy/focusManager.cjs.map | 1 - .../build/legacy/focusManager.d.cts | 17 - .../query-core/build/legacy/focusManager.d.ts | 17 - .../query-core/build/legacy/focusManager.js | 81 - .../build/legacy/focusManager.js.map | 1 - .../build/legacy/hydration-BlEVG2Lp.d.ts | 1384 ---------------- .../build/legacy/hydration-uphG6M-i.d.cts | 1384 ---------------- .../query-core/build/legacy/hydration.cjs | 178 --- .../query-core/build/legacy/hydration.cjs.map | 1 - .../query-core/build/legacy/hydration.d.cts | 3 - .../query-core/build/legacy/hydration.d.ts | 3 - .../query-core/build/legacy/hydration.js | 152 -- .../query-core/build/legacy/hydration.js.map | 1 - .../query-core/build/legacy/index.cjs | 110 -- .../query-core/build/legacy/index.cjs.map | 1 - .../query-core/build/legacy/index.d.cts | 10 - .../query-core/build/legacy/index.d.ts | 10 - .../query-core/build/legacy/index.js | 73 - .../query-core/build/legacy/index.js.map | 1 - .../build/legacy/infiniteQueryBehavior.cjs | 146 -- .../legacy/infiniteQueryBehavior.cjs.map | 1 - .../build/legacy/infiniteQueryBehavior.d.cts | 15 - .../build/legacy/infiniteQueryBehavior.d.ts | 15 - .../build/legacy/infiniteQueryBehavior.js | 126 -- .../build/legacy/infiniteQueryBehavior.js.map | 1 - .../build/legacy/infiniteQueryObserver.cjs | 93 -- .../legacy/infiniteQueryObserver.cjs.map | 1 - .../build/legacy/infiniteQueryObserver.d.cts | 20 - .../build/legacy/infiniteQueryObserver.d.ts | 20 - .../build/legacy/infiniteQueryObserver.js | 74 - .../build/legacy/infiniteQueryObserver.js.map | 1 - .../query-core/build/legacy/mutation.cjs | 333 ---- .../query-core/build/legacy/mutation.cjs.map | 1 - .../query-core/build/legacy/mutation.d.cts | 3 - .../query-core/build/legacy/mutation.d.ts | 3 - .../query-core/build/legacy/mutation.js | 306 ---- .../query-core/build/legacy/mutation.js.map | 1 - .../query-core/build/legacy/mutationCache.cjs | 170 -- .../build/legacy/mutationCache.cjs.map | 1 - .../build/legacy/mutationCache.d.cts | 3 - .../build/legacy/mutationCache.d.ts | 3 - .../query-core/build/legacy/mutationCache.js | 137 -- .../build/legacy/mutationCache.js.map | 1 - .../build/legacy/mutationObserver.cjs | 190 --- .../build/legacy/mutationObserver.cjs.map | 1 - .../build/legacy/mutationObserver.d.cts | 3 - .../build/legacy/mutationObserver.d.ts | 3 - .../build/legacy/mutationObserver.js | 164 -- .../build/legacy/mutationObserver.js.map | 1 - .../query-core/build/legacy/notifyManager.cjs | 113 -- .../build/legacy/notifyManager.cjs.map | 1 - .../build/legacy/notifyManager.d.cts | 46 - .../build/legacy/notifyManager.d.ts | 46 - .../query-core/build/legacy/notifyManager.js | 88 -- .../build/legacy/notifyManager.js.map | 1 - .../query-core/build/legacy/onlineManager.cjs | 97 -- .../build/legacy/onlineManager.cjs.map | 1 - .../build/legacy/onlineManager.d.cts | 16 - .../build/legacy/onlineManager.d.ts | 16 - .../query-core/build/legacy/onlineManager.js | 70 - .../build/legacy/onlineManager.js.map | 1 - .../build/legacy/queriesObserver.cjs | 260 --- .../build/legacy/queriesObserver.cjs.map | 1 - .../build/legacy/queriesObserver.d.cts | 27 - .../build/legacy/queriesObserver.d.ts | 27 - .../build/legacy/queriesObserver.js | 234 --- .../build/legacy/queriesObserver.js.map | 1 - .../query-core/build/legacy/query.cjs | 478 ------ .../query-core/build/legacy/query.cjs.map | 1 - .../query-core/build/legacy/query.d.cts | 3 - .../query-core/build/legacy/query.d.ts | 3 - .../query-core/build/legacy/query.js | 459 ------ .../query-core/build/legacy/query.js.map | 1 - .../query-core/build/legacy/queryCache.cjs | 131 -- .../build/legacy/queryCache.cjs.map | 1 - .../query-core/build/legacy/queryCache.d.cts | 3 - .../query-core/build/legacy/queryCache.d.ts | 3 - .../query-core/build/legacy/queryCache.js | 105 -- .../query-core/build/legacy/queryCache.js.map | 1 - .../query-core/build/legacy/queryClient.cjs | 349 ----- .../build/legacy/queryClient.cjs.map | 1 - .../query-core/build/legacy/queryClient.d.cts | 3 - .../query-core/build/legacy/queryClient.d.ts | 3 - .../query-core/build/legacy/queryClient.js | 324 ---- .../build/legacy/queryClient.js.map | 1 - .../query-core/build/legacy/queryObserver.cjs | 515 ------ .../build/legacy/queryObserver.cjs.map | 1 - .../build/legacy/queryObserver.d.cts | 3 - .../build/legacy/queryObserver.d.ts | 3 - .../query-core/build/legacy/queryObserver.js | 498 ------ .../build/legacy/queryObserver.js.map | 1 - .../query-core/build/legacy/removable.cjs | 69 - .../query-core/build/legacy/removable.cjs.map | 1 - .../query-core/build/legacy/removable.d.cts | 11 - .../query-core/build/legacy/removable.d.ts | 11 - .../query-core/build/legacy/removable.js | 43 - .../query-core/build/legacy/removable.js.map | 1 - .../query-core/build/legacy/retryer.cjs | 165 -- .../query-core/build/legacy/retryer.cjs.map | 1 - .../query-core/build/legacy/retryer.d.cts | 3 - .../query-core/build/legacy/retryer.d.ts | 3 - .../query-core/build/legacy/retryer.js | 139 -- .../query-core/build/legacy/retryer.js.map | 1 - .../query-core/build/legacy/streamedQuery.cjs | 82 - .../build/legacy/streamedQuery.cjs.map | 1 - .../build/legacy/streamedQuery.d.cts | 34 - .../build/legacy/streamedQuery.d.ts | 34 - .../query-core/build/legacy/streamedQuery.js | 59 - .../build/legacy/streamedQuery.js.map | 1 - .../query-core/build/legacy/subscribable.cjs | 51 - .../build/legacy/subscribable.cjs.map | 1 - .../build/legacy/subscribable.d.cts | 10 - .../query-core/build/legacy/subscribable.d.ts | 10 - .../query-core/build/legacy/subscribable.js | 28 - .../build/legacy/subscribable.js.map | 1 - .../query-core/build/legacy/thenable.cjs | 76 - .../query-core/build/legacy/thenable.cjs.map | 1 - .../query-core/build/legacy/thenable.d.cts | 47 - .../query-core/build/legacy/thenable.d.ts | 47 - .../query-core/build/legacy/thenable.js | 52 - .../query-core/build/legacy/thenable.js.map | 1 - .../build/legacy/timeoutManager.cjs | 110 -- .../build/legacy/timeoutManager.cjs.map | 1 - .../build/legacy/timeoutManager.d.cts | 58 - .../build/legacy/timeoutManager.d.ts | 58 - .../query-core/build/legacy/timeoutManager.js | 81 - .../build/legacy/timeoutManager.js.map | 1 - .../query-core/build/legacy/types.cjs | 37 - .../query-core/build/legacy/types.cjs.map | 1 - .../query-core/build/legacy/types.d.cts | 3 - .../query-core/build/legacy/types.d.ts | 3 - .../query-core/build/legacy/types.js | 12 - .../query-core/build/legacy/types.js.map | 1 - .../query-core/build/legacy/utils.cjs | 330 ---- .../query-core/build/legacy/utils.cjs.map | 1 - .../query-core/build/legacy/utils.d.cts | 3 - .../query-core/build/legacy/utils.d.ts | 3 - .../query-core/build/legacy/utils.js | 283 ---- .../query-core/build/legacy/utils.js.map | 1 - .../query-core/build/modern/focusManager.cjs | 94 -- .../build/modern/focusManager.cjs.map | 1 - .../build/modern/focusManager.d.cts | 17 - .../query-core/build/modern/focusManager.d.ts | 17 - .../query-core/build/modern/focusManager.js | 68 - .../build/modern/focusManager.js.map | 1 - .../build/modern/hydration-BlEVG2Lp.d.ts | 1384 ---------------- .../build/modern/hydration-uphG6M-i.d.cts | 1384 ---------------- .../query-core/build/modern/hydration.cjs | 173 -- .../query-core/build/modern/hydration.cjs.map | 1 - .../query-core/build/modern/hydration.d.cts | 3 - .../query-core/build/modern/hydration.d.ts | 3 - .../query-core/build/modern/hydration.js | 145 -- .../query-core/build/modern/hydration.js.map | 1 - .../query-core/build/modern/index.cjs | 110 -- .../query-core/build/modern/index.cjs.map | 1 - .../query-core/build/modern/index.d.cts | 10 - .../query-core/build/modern/index.d.ts | 10 - .../query-core/build/modern/index.js | 71 - .../query-core/build/modern/index.js.map | 1 - .../build/modern/infiniteQueryBehavior.cjs | 142 -- .../modern/infiniteQueryBehavior.cjs.map | 1 - .../build/modern/infiniteQueryBehavior.d.cts | 15 - .../build/modern/infiniteQueryBehavior.d.ts | 15 - .../build/modern/infiniteQueryBehavior.js | 120 -- .../build/modern/infiniteQueryBehavior.js.map | 1 - .../build/modern/infiniteQueryObserver.cjs | 92 -- .../modern/infiniteQueryObserver.cjs.map | 1 - .../build/modern/infiniteQueryObserver.d.cts | 20 - .../build/modern/infiniteQueryObserver.d.ts | 20 - .../build/modern/infiniteQueryObserver.js | 71 - .../build/modern/infiniteQueryObserver.js.map | 1 - .../query-core/build/modern/mutation.cjs | 307 ---- .../query-core/build/modern/mutation.cjs.map | 1 - .../query-core/build/modern/mutation.d.cts | 3 - .../query-core/build/modern/mutation.d.ts | 3 - .../query-core/build/modern/mutation.js | 281 ---- .../query-core/build/modern/mutation.js.map | 1 - .../query-core/build/modern/mutationCache.cjs | 149 -- .../build/modern/mutationCache.cjs.map | 1 - .../build/modern/mutationCache.d.cts | 3 - .../build/modern/mutationCache.d.ts | 3 - .../query-core/build/modern/mutationCache.js | 124 -- .../build/modern/mutationCache.js.map | 1 - .../build/modern/mutationObserver.cjs | 165 -- .../build/modern/mutationObserver.cjs.map | 1 - .../build/modern/mutationObserver.d.cts | 3 - .../build/modern/mutationObserver.d.ts | 3 - .../build/modern/mutationObserver.js | 140 -- .../build/modern/mutationObserver.js.map | 1 - .../query-core/build/modern/notifyManager.cjs | 113 -- .../build/modern/notifyManager.cjs.map | 1 - .../build/modern/notifyManager.d.cts | 46 - .../build/modern/notifyManager.d.ts | 46 - .../query-core/build/modern/notifyManager.js | 86 - .../build/modern/notifyManager.js.map | 1 - .../query-core/build/modern/onlineManager.cjs | 84 - .../build/modern/onlineManager.cjs.map | 1 - .../build/modern/onlineManager.d.cts | 16 - .../build/modern/onlineManager.d.ts | 16 - .../query-core/build/modern/onlineManager.js | 58 - .../build/modern/onlineManager.js.map | 1 - .../build/modern/queriesObserver.cjs | 237 --- .../build/modern/queriesObserver.cjs.map | 1 - .../build/modern/queriesObserver.d.cts | 27 - .../build/modern/queriesObserver.d.ts | 27 - .../build/modern/queriesObserver.js | 212 --- .../build/modern/queriesObserver.js.map | 1 - .../query-core/build/modern/query.cjs | 452 ------ .../query-core/build/modern/query.cjs.map | 1 - .../query-core/build/modern/query.d.cts | 3 - .../query-core/build/modern/query.d.ts | 3 - .../query-core/build/modern/query.js | 434 ----- .../query-core/build/modern/query.js.map | 1 - .../query-core/build/modern/queryCache.cjs | 122 -- .../build/modern/queryCache.cjs.map | 1 - .../query-core/build/modern/queryCache.d.cts | 3 - .../query-core/build/modern/queryCache.d.ts | 3 - .../query-core/build/modern/queryCache.js | 97 -- .../query-core/build/modern/queryCache.js.map | 1 - .../query-core/build/modern/queryClient.cjs | 322 ---- .../build/modern/queryClient.cjs.map | 1 - .../query-core/build/modern/queryClient.d.cts | 3 - .../query-core/build/modern/queryClient.d.ts | 3 - .../query-core/build/modern/queryClient.js | 305 ---- .../build/modern/queryClient.js.map | 1 - .../query-core/build/modern/queryObserver.cjs | 488 ------ .../build/modern/queryObserver.cjs.map | 1 - .../build/modern/queryObserver.d.cts | 3 - .../build/modern/queryObserver.d.ts | 3 - .../query-core/build/modern/queryObserver.js | 472 ------ .../build/modern/queryObserver.js.map | 1 - .../query-core/build/modern/removable.cjs | 58 - .../query-core/build/modern/removable.cjs.map | 1 - .../query-core/build/modern/removable.d.cts | 11 - .../query-core/build/modern/removable.d.ts | 11 - .../query-core/build/modern/removable.js | 33 - .../query-core/build/modern/removable.js.map | 1 - .../query-core/build/modern/retryer.cjs | 161 -- .../query-core/build/modern/retryer.cjs.map | 1 - .../query-core/build/modern/retryer.d.cts | 3 - .../query-core/build/modern/retryer.d.ts | 3 - .../query-core/build/modern/retryer.js | 133 -- .../query-core/build/modern/retryer.js.map | 1 - .../query-core/build/modern/streamedQuery.cjs | 82 - .../build/modern/streamedQuery.cjs.map | 1 - .../build/modern/streamedQuery.d.cts | 34 - .../build/modern/streamedQuery.d.ts | 34 - .../query-core/build/modern/streamedQuery.js | 57 - .../build/modern/streamedQuery.js.map | 1 - .../query-core/build/modern/subscribable.cjs | 51 - .../build/modern/subscribable.cjs.map | 1 - .../build/modern/subscribable.d.cts | 10 - .../query-core/build/modern/subscribable.d.ts | 10 - .../query-core/build/modern/subscribable.js | 26 - .../build/modern/subscribable.js.map | 1 - .../query-core/build/modern/thenable.cjs | 75 - .../query-core/build/modern/thenable.cjs.map | 1 - .../query-core/build/modern/thenable.d.cts | 47 - .../query-core/build/modern/thenable.d.ts | 47 - .../query-core/build/modern/thenable.js | 49 - .../query-core/build/modern/thenable.js.map | 1 - .../build/modern/timeoutManager.cjs | 98 -- .../build/modern/timeoutManager.cjs.map | 1 - .../build/modern/timeoutManager.d.cts | 58 - .../build/modern/timeoutManager.d.ts | 58 - .../query-core/build/modern/timeoutManager.js | 70 - .../build/modern/timeoutManager.js.map | 1 - .../query-core/build/modern/types.cjs | 37 - .../query-core/build/modern/types.cjs.map | 1 - .../query-core/build/modern/types.d.cts | 3 - .../query-core/build/modern/types.d.ts | 3 - .../query-core/build/modern/types.js | 10 - .../query-core/build/modern/types.js.map | 1 - .../query-core/build/modern/utils.cjs | 330 ---- .../query-core/build/modern/utils.cjs.map | 1 - .../query-core/build/modern/utils.d.cts | 3 - .../query-core/build/modern/utils.d.ts | 3 - .../query-core/build/modern/utils.js | 281 ---- .../query-core/build/modern/utils.js.map | 1 - .../@tanstack/query-core/package.json | 65 - .../@tanstack/query-core/src/focusManager.ts | 86 - .../@tanstack/query-core/src/hydration.ts | 285 ---- .../@tanstack/query-core/src/index.ts | 55 - .../query-core/src/infiniteQueryBehavior.ts | 176 --- .../query-core/src/infiniteQueryObserver.ts | 190 --- .../@tanstack/query-core/src/mutation.ts | 419 ----- .../@tanstack/query-core/src/mutationCache.ts | 244 --- .../query-core/src/mutationObserver.ts | 227 --- .../@tanstack/query-core/src/notifyManager.ts | 99 -- .../@tanstack/query-core/src/onlineManager.ts | 71 - .../query-core/src/queriesObserver.ts | 315 ---- .../@tanstack/query-core/src/query.ts | 756 --------- .../@tanstack/query-core/src/queryCache.ts | 223 --- .../@tanstack/query-core/src/queryClient.ts | 648 -------- .../@tanstack/query-core/src/queryObserver.ts | 828 ---------- .../@tanstack/query-core/src/removable.ts | 39 - .../@tanstack/query-core/src/retryer.ts | 228 --- .../@tanstack/query-core/src/streamedQuery.ts | 122 -- .../@tanstack/query-core/src/subscribable.ts | 30 - .../@tanstack/query-core/src/thenable.ts | 111 -- .../query-core/src/timeoutManager.ts | 135 -- .../@tanstack/query-core/src/types.ts | 1391 ----------------- .../@tanstack/query-core/src/utils.ts | 499 ------ node_modules/@tanstack/react-query/LICENSE | 21 - node_modules/@tanstack/react-query/README.md | 48 - .../build/codemods/src/utils/index.cjs | 208 --- .../transformers/query-cache-transformer.cjs | 124 -- .../transformers/query-client-transformer.cjs | 53 - .../use-query-like-transformer.cjs | 38 - .../codemods/src/v4/key-transformation.cjs | 181 --- .../src/v4/replace-import-specifier.cjs | 25 - .../src/v4/utils/replacers/key-replacer.cjs | 164 -- .../codemods/src/v5/is-loading/is-loading.cjs | 244 --- .../src/v5/keep-previous-data/README.md | 32 - .../keep-previous-data/keep-previous-data.cjs | 271 ---- .../already-has-placeholder-data-property.cjs | 26 - .../v5/remove-overloads/remove-overloads.cjs | 58 - .../filter-aware-usage-transformer.cjs | 271 ---- .../query-fn-aware-usage-transformer.cjs | 185 --- .../src/v5/remove-overloads/utils/index.cjs | 123 -- .../utils/unknown-usage-error.cjs | 27 - .../src/v5/rename-hydrate/rename-hydrate.cjs | 55 - .../rename-properties/rename-properties.cjs | 41 - .../build/legacy/HydrationBoundary.cjs | 91 -- .../build/legacy/HydrationBoundary.cjs.map | 1 - .../build/legacy/HydrationBoundary.d.cts | 14 - .../build/legacy/HydrationBoundary.d.ts | 14 - .../build/legacy/HydrationBoundary.js | 57 - .../build/legacy/HydrationBoundary.js.map | 1 - .../build/legacy/IsRestoringProvider.cjs | 47 - .../build/legacy/IsRestoringProvider.cjs.map | 1 - .../build/legacy/IsRestoringProvider.d.cts | 6 - .../build/legacy/IsRestoringProvider.d.ts | 6 - .../build/legacy/IsRestoringProvider.js | 12 - .../build/legacy/IsRestoringProvider.js.map | 1 - .../build/legacy/QueryClientProvider.cjs | 72 - .../build/legacy/QueryClientProvider.cjs.map | 1 - .../build/legacy/QueryClientProvider.d.cts | 12 - .../build/legacy/QueryClientProvider.d.ts | 12 - .../build/legacy/QueryClientProvider.js | 36 - .../build/legacy/QueryClientProvider.js.map | 1 - .../build/legacy/QueryErrorResetBoundary.cjs | 67 - .../legacy/QueryErrorResetBoundary.cjs.map | 1 - .../legacy/QueryErrorResetBoundary.d.cts | 19 - .../build/legacy/QueryErrorResetBoundary.d.ts | 19 - .../build/legacy/QueryErrorResetBoundary.js | 32 - .../legacy/QueryErrorResetBoundary.js.map | 1 - .../build/legacy/errorBoundaryUtils.cjs | 69 - .../build/legacy/errorBoundaryUtils.cjs.map | 1 - .../build/legacy/errorBoundaryUtils.d.cts | 16 - .../build/legacy/errorBoundaryUtils.d.ts | 16 - .../build/legacy/errorBoundaryUtils.js | 33 - .../build/legacy/errorBoundaryUtils.js.map | 1 - .../react-query/build/legacy/index.cjs | 97 -- .../react-query/build/legacy/index.cjs.map | 1 - .../react-query/build/legacy/index.d.cts | 22 - .../react-query/build/legacy/index.d.ts | 22 - .../react-query/build/legacy/index.js | 54 - .../react-query/build/legacy/index.js.map | 1 - .../build/legacy/infiniteQueryOptions.cjs | 33 - .../build/legacy/infiniteQueryOptions.cjs.map | 1 - .../build/legacy/infiniteQueryOptions.d.cts | 23 - .../build/legacy/infiniteQueryOptions.d.ts | 23 - .../build/legacy/infiniteQueryOptions.js | 8 - .../build/legacy/infiniteQueryOptions.js.map | 1 - .../build/legacy/mutationOptions.cjs | 33 - .../build/legacy/mutationOptions.cjs.map | 1 - .../build/legacy/mutationOptions.d.cts | 7 - .../build/legacy/mutationOptions.d.ts | 7 - .../build/legacy/mutationOptions.js | 8 - .../build/legacy/mutationOptions.js.map | 1 - .../react-query/build/legacy/queryOptions.cjs | 33 - .../build/legacy/queryOptions.cjs.map | 1 - .../build/legacy/queryOptions.d.cts | 24 - .../build/legacy/queryOptions.d.ts | 24 - .../react-query/build/legacy/queryOptions.js | 8 - .../build/legacy/queryOptions.js.map | 1 - .../react-query/build/legacy/suspense.cjs | 58 - .../react-query/build/legacy/suspense.cjs.map | 1 - .../react-query/build/legacy/suspense.d.cts | 12 - .../react-query/build/legacy/suspense.d.ts | 12 - .../react-query/build/legacy/suspense.js | 29 - .../react-query/build/legacy/suspense.js.map | 1 - .../react-query/build/legacy/types.cjs | 19 - .../react-query/build/legacy/types.cjs.map | 1 - .../react-query/build/legacy/types.d.cts | 52 - .../react-query/build/legacy/types.d.ts | 52 - .../react-query/build/legacy/types.js | 1 - .../react-query/build/legacy/types.js.map | 1 - .../react-query/build/legacy/useBaseQuery.cjs | 133 -- .../build/legacy/useBaseQuery.cjs.map | 1 - .../build/legacy/useBaseQuery.d.cts | 6 - .../build/legacy/useBaseQuery.d.ts | 6 - .../react-query/build/legacy/useBaseQuery.js | 108 -- .../build/legacy/useBaseQuery.js.map | 1 - .../build/legacy/useInfiniteQuery.cjs | 40 - .../build/legacy/useInfiniteQuery.cjs.map | 1 - .../build/legacy/useInfiniteQuery.d.cts | 9 - .../build/legacy/useInfiniteQuery.d.ts | 9 - .../build/legacy/useInfiniteQuery.js | 16 - .../build/legacy/useInfiniteQuery.js.map | 1 - .../build/legacy/useIsFetching.cjs | 56 - .../build/legacy/useIsFetching.cjs.map | 1 - .../build/legacy/useIsFetching.d.cts | 5 - .../build/legacy/useIsFetching.d.ts | 5 - .../react-query/build/legacy/useIsFetching.js | 22 - .../build/legacy/useIsFetching.js.map | 1 - .../react-query/build/legacy/useMutation.cjs | 74 - .../build/legacy/useMutation.cjs.map | 1 - .../build/legacy/useMutation.d.cts | 6 - .../react-query/build/legacy/useMutation.d.ts | 6 - .../react-query/build/legacy/useMutation.js | 45 - .../build/legacy/useMutation.js.map | 1 - .../build/legacy/useMutationState.cjs | 86 - .../build/legacy/useMutationState.cjs.map | 1 - .../build/legacy/useMutationState.d.cts | 10 - .../build/legacy/useMutationState.d.ts | 10 - .../build/legacy/useMutationState.js | 51 - .../build/legacy/useMutationState.js.map | 1 - .../build/legacy/usePrefetchInfiniteQuery.cjs | 37 - .../legacy/usePrefetchInfiniteQuery.cjs.map | 1 - .../legacy/usePrefetchInfiniteQuery.d.cts | 5 - .../legacy/usePrefetchInfiniteQuery.d.ts | 5 - .../build/legacy/usePrefetchInfiniteQuery.js | 12 - .../legacy/usePrefetchInfiniteQuery.js.map | 1 - .../build/legacy/usePrefetchQuery.cjs | 37 - .../build/legacy/usePrefetchQuery.cjs.map | 1 - .../build/legacy/usePrefetchQuery.d.cts | 6 - .../build/legacy/usePrefetchQuery.d.ts | 6 - .../build/legacy/usePrefetchQuery.js | 12 - .../build/legacy/usePrefetchQuery.js.map | 1 - .../react-query/build/legacy/useQueries.cjs | 128 -- .../build/legacy/useQueries.cjs.map | 1 - .../react-query/build/legacy/useQueries.d.cts | 76 - .../react-query/build/legacy/useQueries.d.ts | 76 - .../react-query/build/legacy/useQueries.js | 107 -- .../build/legacy/useQueries.js.map | 1 - .../react-query/build/legacy/useQuery.cjs | 36 - .../react-query/build/legacy/useQuery.cjs.map | 1 - .../react-query/build/legacy/useQuery.d.cts | 9 - .../react-query/build/legacy/useQuery.d.ts | 9 - .../react-query/build/legacy/useQuery.js | 12 - .../react-query/build/legacy/useQuery.js.map | 1 - .../build/legacy/useSuspenseInfiniteQuery.cjs | 51 - .../legacy/useSuspenseInfiniteQuery.cjs.map | 1 - .../legacy/useSuspenseInfiniteQuery.d.cts | 6 - .../legacy/useSuspenseInfiniteQuery.d.ts | 6 - .../build/legacy/useSuspenseInfiniteQuery.js | 27 - .../legacy/useSuspenseInfiniteQuery.js.map | 1 - .../build/legacy/useSuspenseQueries.cjs | 56 - .../build/legacy/useSuspenseQueries.cjs.map | 1 - .../build/legacy/useSuspenseQueries.d.cts | 79 - .../build/legacy/useSuspenseQueries.d.ts | 79 - .../build/legacy/useSuspenseQueries.js | 32 - .../build/legacy/useSuspenseQueries.js.map | 1 - .../build/legacy/useSuspenseQuery.cjs | 52 - .../build/legacy/useSuspenseQuery.cjs.map | 1 - .../build/legacy/useSuspenseQuery.d.cts | 6 - .../build/legacy/useSuspenseQuery.d.ts | 6 - .../build/legacy/useSuspenseQuery.js | 28 - .../build/legacy/useSuspenseQuery.js.map | 1 - .../build/modern/HydrationBoundary.cjs | 91 -- .../build/modern/HydrationBoundary.cjs.map | 1 - .../build/modern/HydrationBoundary.d.cts | 14 - .../build/modern/HydrationBoundary.d.ts | 14 - .../build/modern/HydrationBoundary.js | 57 - .../build/modern/HydrationBoundary.js.map | 1 - .../build/modern/IsRestoringProvider.cjs | 47 - .../build/modern/IsRestoringProvider.cjs.map | 1 - .../build/modern/IsRestoringProvider.d.cts | 6 - .../build/modern/IsRestoringProvider.d.ts | 6 - .../build/modern/IsRestoringProvider.js | 12 - .../build/modern/IsRestoringProvider.js.map | 1 - .../build/modern/QueryClientProvider.cjs | 72 - .../build/modern/QueryClientProvider.cjs.map | 1 - .../build/modern/QueryClientProvider.d.cts | 12 - .../build/modern/QueryClientProvider.d.ts | 12 - .../build/modern/QueryClientProvider.js | 36 - .../build/modern/QueryClientProvider.js.map | 1 - .../build/modern/QueryErrorResetBoundary.cjs | 67 - .../modern/QueryErrorResetBoundary.cjs.map | 1 - .../modern/QueryErrorResetBoundary.d.cts | 19 - .../build/modern/QueryErrorResetBoundary.d.ts | 19 - .../build/modern/QueryErrorResetBoundary.js | 32 - .../modern/QueryErrorResetBoundary.js.map | 1 - .../build/modern/errorBoundaryUtils.cjs | 69 - .../build/modern/errorBoundaryUtils.cjs.map | 1 - .../build/modern/errorBoundaryUtils.d.cts | 16 - .../build/modern/errorBoundaryUtils.d.ts | 16 - .../build/modern/errorBoundaryUtils.js | 33 - .../build/modern/errorBoundaryUtils.js.map | 1 - .../react-query/build/modern/index.cjs | 97 -- .../react-query/build/modern/index.cjs.map | 1 - .../react-query/build/modern/index.d.cts | 22 - .../react-query/build/modern/index.d.ts | 22 - .../react-query/build/modern/index.js | 54 - .../react-query/build/modern/index.js.map | 1 - .../build/modern/infiniteQueryOptions.cjs | 33 - .../build/modern/infiniteQueryOptions.cjs.map | 1 - .../build/modern/infiniteQueryOptions.d.cts | 23 - .../build/modern/infiniteQueryOptions.d.ts | 23 - .../build/modern/infiniteQueryOptions.js | 8 - .../build/modern/infiniteQueryOptions.js.map | 1 - .../build/modern/mutationOptions.cjs | 33 - .../build/modern/mutationOptions.cjs.map | 1 - .../build/modern/mutationOptions.d.cts | 7 - .../build/modern/mutationOptions.d.ts | 7 - .../build/modern/mutationOptions.js | 8 - .../build/modern/mutationOptions.js.map | 1 - .../react-query/build/modern/queryOptions.cjs | 33 - .../build/modern/queryOptions.cjs.map | 1 - .../build/modern/queryOptions.d.cts | 24 - .../build/modern/queryOptions.d.ts | 24 - .../react-query/build/modern/queryOptions.js | 8 - .../build/modern/queryOptions.js.map | 1 - .../react-query/build/modern/suspense.cjs | 58 - .../react-query/build/modern/suspense.cjs.map | 1 - .../react-query/build/modern/suspense.d.cts | 12 - .../react-query/build/modern/suspense.d.ts | 12 - .../react-query/build/modern/suspense.js | 29 - .../react-query/build/modern/suspense.js.map | 1 - .../react-query/build/modern/types.cjs | 19 - .../react-query/build/modern/types.cjs.map | 1 - .../react-query/build/modern/types.d.cts | 52 - .../react-query/build/modern/types.d.ts | 52 - .../react-query/build/modern/types.js | 1 - .../react-query/build/modern/types.js.map | 1 - .../react-query/build/modern/useBaseQuery.cjs | 130 -- .../build/modern/useBaseQuery.cjs.map | 1 - .../build/modern/useBaseQuery.d.cts | 6 - .../build/modern/useBaseQuery.d.ts | 6 - .../react-query/build/modern/useBaseQuery.js | 105 -- .../build/modern/useBaseQuery.js.map | 1 - .../build/modern/useInfiniteQuery.cjs | 40 - .../build/modern/useInfiniteQuery.cjs.map | 1 - .../build/modern/useInfiniteQuery.d.cts | 9 - .../build/modern/useInfiniteQuery.d.ts | 9 - .../build/modern/useInfiniteQuery.js | 16 - .../build/modern/useInfiniteQuery.js.map | 1 - .../build/modern/useIsFetching.cjs | 56 - .../build/modern/useIsFetching.cjs.map | 1 - .../build/modern/useIsFetching.d.cts | 5 - .../build/modern/useIsFetching.d.ts | 5 - .../react-query/build/modern/useIsFetching.js | 22 - .../build/modern/useIsFetching.js.map | 1 - .../react-query/build/modern/useMutation.cjs | 74 - .../build/modern/useMutation.cjs.map | 1 - .../build/modern/useMutation.d.cts | 6 - .../react-query/build/modern/useMutation.d.ts | 6 - .../react-query/build/modern/useMutation.js | 45 - .../build/modern/useMutation.js.map | 1 - .../build/modern/useMutationState.cjs | 86 - .../build/modern/useMutationState.cjs.map | 1 - .../build/modern/useMutationState.d.cts | 10 - .../build/modern/useMutationState.d.ts | 10 - .../build/modern/useMutationState.js | 51 - .../build/modern/useMutationState.js.map | 1 - .../build/modern/usePrefetchInfiniteQuery.cjs | 37 - .../modern/usePrefetchInfiniteQuery.cjs.map | 1 - .../modern/usePrefetchInfiniteQuery.d.cts | 5 - .../modern/usePrefetchInfiniteQuery.d.ts | 5 - .../build/modern/usePrefetchInfiniteQuery.js | 12 - .../modern/usePrefetchInfiniteQuery.js.map | 1 - .../build/modern/usePrefetchQuery.cjs | 37 - .../build/modern/usePrefetchQuery.cjs.map | 1 - .../build/modern/usePrefetchQuery.d.cts | 6 - .../build/modern/usePrefetchQuery.d.ts | 6 - .../build/modern/usePrefetchQuery.js | 12 - .../build/modern/usePrefetchQuery.js.map | 1 - .../react-query/build/modern/useQueries.cjs | 128 -- .../build/modern/useQueries.cjs.map | 1 - .../react-query/build/modern/useQueries.d.cts | 76 - .../react-query/build/modern/useQueries.d.ts | 76 - .../react-query/build/modern/useQueries.js | 107 -- .../build/modern/useQueries.js.map | 1 - .../react-query/build/modern/useQuery.cjs | 36 - .../react-query/build/modern/useQuery.cjs.map | 1 - .../react-query/build/modern/useQuery.d.cts | 9 - .../react-query/build/modern/useQuery.d.ts | 9 - .../react-query/build/modern/useQuery.js | 12 - .../react-query/build/modern/useQuery.js.map | 1 - .../build/modern/useSuspenseInfiniteQuery.cjs | 51 - .../modern/useSuspenseInfiniteQuery.cjs.map | 1 - .../modern/useSuspenseInfiniteQuery.d.cts | 6 - .../modern/useSuspenseInfiniteQuery.d.ts | 6 - .../build/modern/useSuspenseInfiniteQuery.js | 27 - .../modern/useSuspenseInfiniteQuery.js.map | 1 - .../build/modern/useSuspenseQueries.cjs | 56 - .../build/modern/useSuspenseQueries.cjs.map | 1 - .../build/modern/useSuspenseQueries.d.cts | 79 - .../build/modern/useSuspenseQueries.d.ts | 79 - .../build/modern/useSuspenseQueries.js | 32 - .../build/modern/useSuspenseQueries.js.map | 1 - .../build/modern/useSuspenseQuery.cjs | 52 - .../build/modern/useSuspenseQuery.cjs.map | 1 - .../build/modern/useSuspenseQuery.d.cts | 6 - .../build/modern/useSuspenseQuery.d.ts | 6 - .../build/modern/useSuspenseQuery.js | 28 - .../build/modern/useSuspenseQuery.js.map | 1 - .../build/query-codemods/eslint.config.js | 18 - .../build/query-codemods/package.json | 38 - .../query-codemods/root.eslint.config.js | 64 - .../build/query-codemods/tsconfig.json | 8 - .../build/query-codemods/vite.config.ts | 30 - .../@tanstack/react-query/package.json | 87 -- .../react-query/src/HydrationBoundary.tsx | 111 -- .../react-query/src/IsRestoringProvider.ts | 7 - .../react-query/src/QueryClientProvider.tsx | 45 - .../src/QueryErrorResetBoundary.tsx | 56 - .../react-query/src/errorBoundaryUtils.ts | 82 - .../@tanstack/react-query/src/index.ts | 56 - .../react-query/src/infiniteQueryOptions.ts | 149 -- .../react-query/src/mutationOptions.ts | 41 - .../@tanstack/react-query/src/queryOptions.ts | 87 -- .../@tanstack/react-query/src/suspense.ts | 80 - .../@tanstack/react-query/src/types.ts | 242 --- .../@tanstack/react-query/src/useBaseQuery.ts | 170 -- .../react-query/src/useInfiniteQuery.ts | 81 - .../react-query/src/useIsFetching.ts | 24 - .../@tanstack/react-query/src/useMutation.ts | 69 - .../react-query/src/useMutationState.ts | 75 - .../src/usePrefetchInfiniteQuery.tsx | 30 - .../react-query/src/usePrefetchQuery.tsx | 19 - .../@tanstack/react-query/src/useQueries.ts | 328 ---- .../@tanstack/react-query/src/useQuery.ts | 52 - .../src/useSuspenseInfiniteQuery.ts | 50 - .../react-query/src/useSuspenseQueries.ts | 211 --- .../react-query/src/useSuspenseQuery.ts | 34 - node_modules/react/LICENSE | 21 - node_modules/react/README.md | 37 - .../cjs/react-compiler-runtime.development.js | 24 - .../cjs/react-compiler-runtime.production.js | 16 - .../cjs/react-compiler-runtime.profiling.js | 16 - .../cjs/react-jsx-dev-runtime.development.js | 338 ---- .../cjs/react-jsx-dev-runtime.production.js | 14 - .../cjs/react-jsx-dev-runtime.profiling.js | 14 - ...sx-dev-runtime.react-server.development.js | 370 ----- ...jsx-dev-runtime.react-server.production.js | 40 - .../cjs/react-jsx-runtime.development.js | 352 ----- .../react/cjs/react-jsx-runtime.production.js | 34 - .../react/cjs/react-jsx-runtime.profiling.js | 34 - ...ct-jsx-runtime.react-server.development.js | 370 ----- ...act-jsx-runtime.react-server.production.js | 40 - node_modules/react/cjs/react.development.js | 1284 --------------- node_modules/react/cjs/react.production.js | 542 ------- .../cjs/react.react-server.development.js | 848 ---------- .../cjs/react.react-server.production.js | 423 ----- node_modules/react/compiler-runtime.js | 14 - node_modules/react/index.js | 7 - node_modules/react/jsx-dev-runtime.js | 7 - .../react/jsx-dev-runtime.react-server.js | 7 - node_modules/react/jsx-runtime.js | 7 - .../react/jsx-runtime.react-server.js | 7 - node_modules/react/package.json | 51 - node_modules/react/react.react-server.js | 7 - 660 files changed, 44979 deletions(-) delete mode 100644 node_modules/.package-lock.json delete mode 100644 node_modules/@tanstack/query-core/LICENSE delete mode 100644 node_modules/@tanstack/query-core/build/legacy/chunk-PXG64RU4.js delete mode 100644 node_modules/@tanstack/query-core/build/legacy/chunk-PXG64RU4.js.map delete mode 100644 node_modules/@tanstack/query-core/build/legacy/focusManager.cjs delete mode 100644 node_modules/@tanstack/query-core/build/legacy/focusManager.cjs.map delete mode 100644 node_modules/@tanstack/query-core/build/legacy/focusManager.d.cts delete mode 100644 node_modules/@tanstack/query-core/build/legacy/focusManager.d.ts delete mode 100644 node_modules/@tanstack/query-core/build/legacy/focusManager.js delete mode 100644 node_modules/@tanstack/query-core/build/legacy/focusManager.js.map delete mode 100644 node_modules/@tanstack/query-core/build/legacy/hydration-BlEVG2Lp.d.ts delete mode 100644 node_modules/@tanstack/query-core/build/legacy/hydration-uphG6M-i.d.cts delete mode 100644 node_modules/@tanstack/query-core/build/legacy/hydration.cjs delete mode 100644 node_modules/@tanstack/query-core/build/legacy/hydration.cjs.map delete mode 100644 node_modules/@tanstack/query-core/build/legacy/hydration.d.cts delete mode 100644 node_modules/@tanstack/query-core/build/legacy/hydration.d.ts delete mode 100644 node_modules/@tanstack/query-core/build/legacy/hydration.js delete mode 100644 node_modules/@tanstack/query-core/build/legacy/hydration.js.map delete mode 100644 node_modules/@tanstack/query-core/build/legacy/index.cjs delete mode 100644 node_modules/@tanstack/query-core/build/legacy/index.cjs.map delete mode 100644 node_modules/@tanstack/query-core/build/legacy/index.d.cts delete mode 100644 node_modules/@tanstack/query-core/build/legacy/index.d.ts delete mode 100644 node_modules/@tanstack/query-core/build/legacy/index.js delete mode 100644 node_modules/@tanstack/query-core/build/legacy/index.js.map delete mode 100644 node_modules/@tanstack/query-core/build/legacy/infiniteQueryBehavior.cjs delete mode 100644 node_modules/@tanstack/query-core/build/legacy/infiniteQueryBehavior.cjs.map delete mode 100644 node_modules/@tanstack/query-core/build/legacy/infiniteQueryBehavior.d.cts delete mode 100644 node_modules/@tanstack/query-core/build/legacy/infiniteQueryBehavior.d.ts delete mode 100644 node_modules/@tanstack/query-core/build/legacy/infiniteQueryBehavior.js delete mode 100644 node_modules/@tanstack/query-core/build/legacy/infiniteQueryBehavior.js.map delete mode 100644 node_modules/@tanstack/query-core/build/legacy/infiniteQueryObserver.cjs delete mode 100644 node_modules/@tanstack/query-core/build/legacy/infiniteQueryObserver.cjs.map delete mode 100644 node_modules/@tanstack/query-core/build/legacy/infiniteQueryObserver.d.cts delete mode 100644 node_modules/@tanstack/query-core/build/legacy/infiniteQueryObserver.d.ts delete mode 100644 node_modules/@tanstack/query-core/build/legacy/infiniteQueryObserver.js delete mode 100644 node_modules/@tanstack/query-core/build/legacy/infiniteQueryObserver.js.map delete mode 100644 node_modules/@tanstack/query-core/build/legacy/mutation.cjs delete mode 100644 node_modules/@tanstack/query-core/build/legacy/mutation.cjs.map delete mode 100644 node_modules/@tanstack/query-core/build/legacy/mutation.d.cts delete mode 100644 node_modules/@tanstack/query-core/build/legacy/mutation.d.ts delete mode 100644 node_modules/@tanstack/query-core/build/legacy/mutation.js delete mode 100644 node_modules/@tanstack/query-core/build/legacy/mutation.js.map delete mode 100644 node_modules/@tanstack/query-core/build/legacy/mutationCache.cjs delete mode 100644 node_modules/@tanstack/query-core/build/legacy/mutationCache.cjs.map delete mode 100644 node_modules/@tanstack/query-core/build/legacy/mutationCache.d.cts delete mode 100644 node_modules/@tanstack/query-core/build/legacy/mutationCache.d.ts delete mode 100644 node_modules/@tanstack/query-core/build/legacy/mutationCache.js delete mode 100644 node_modules/@tanstack/query-core/build/legacy/mutationCache.js.map delete mode 100644 node_modules/@tanstack/query-core/build/legacy/mutationObserver.cjs delete mode 100644 node_modules/@tanstack/query-core/build/legacy/mutationObserver.cjs.map delete mode 100644 node_modules/@tanstack/query-core/build/legacy/mutationObserver.d.cts delete mode 100644 node_modules/@tanstack/query-core/build/legacy/mutationObserver.d.ts delete mode 100644 node_modules/@tanstack/query-core/build/legacy/mutationObserver.js delete mode 100644 node_modules/@tanstack/query-core/build/legacy/mutationObserver.js.map delete mode 100644 node_modules/@tanstack/query-core/build/legacy/notifyManager.cjs delete mode 100644 node_modules/@tanstack/query-core/build/legacy/notifyManager.cjs.map delete mode 100644 node_modules/@tanstack/query-core/build/legacy/notifyManager.d.cts delete mode 100644 node_modules/@tanstack/query-core/build/legacy/notifyManager.d.ts delete mode 100644 node_modules/@tanstack/query-core/build/legacy/notifyManager.js delete mode 100644 node_modules/@tanstack/query-core/build/legacy/notifyManager.js.map delete mode 100644 node_modules/@tanstack/query-core/build/legacy/onlineManager.cjs delete mode 100644 node_modules/@tanstack/query-core/build/legacy/onlineManager.cjs.map delete mode 100644 node_modules/@tanstack/query-core/build/legacy/onlineManager.d.cts delete mode 100644 node_modules/@tanstack/query-core/build/legacy/onlineManager.d.ts delete mode 100644 node_modules/@tanstack/query-core/build/legacy/onlineManager.js delete mode 100644 node_modules/@tanstack/query-core/build/legacy/onlineManager.js.map delete mode 100644 node_modules/@tanstack/query-core/build/legacy/queriesObserver.cjs delete mode 100644 node_modules/@tanstack/query-core/build/legacy/queriesObserver.cjs.map delete mode 100644 node_modules/@tanstack/query-core/build/legacy/queriesObserver.d.cts delete mode 100644 node_modules/@tanstack/query-core/build/legacy/queriesObserver.d.ts delete mode 100644 node_modules/@tanstack/query-core/build/legacy/queriesObserver.js delete mode 100644 node_modules/@tanstack/query-core/build/legacy/queriesObserver.js.map delete mode 100644 node_modules/@tanstack/query-core/build/legacy/query.cjs delete mode 100644 node_modules/@tanstack/query-core/build/legacy/query.cjs.map delete mode 100644 node_modules/@tanstack/query-core/build/legacy/query.d.cts delete mode 100644 node_modules/@tanstack/query-core/build/legacy/query.d.ts delete mode 100644 node_modules/@tanstack/query-core/build/legacy/query.js delete mode 100644 node_modules/@tanstack/query-core/build/legacy/query.js.map delete mode 100644 node_modules/@tanstack/query-core/build/legacy/queryCache.cjs delete mode 100644 node_modules/@tanstack/query-core/build/legacy/queryCache.cjs.map delete mode 100644 node_modules/@tanstack/query-core/build/legacy/queryCache.d.cts delete mode 100644 node_modules/@tanstack/query-core/build/legacy/queryCache.d.ts delete mode 100644 node_modules/@tanstack/query-core/build/legacy/queryCache.js delete mode 100644 node_modules/@tanstack/query-core/build/legacy/queryCache.js.map delete mode 100644 node_modules/@tanstack/query-core/build/legacy/queryClient.cjs delete mode 100644 node_modules/@tanstack/query-core/build/legacy/queryClient.cjs.map delete mode 100644 node_modules/@tanstack/query-core/build/legacy/queryClient.d.cts delete mode 100644 node_modules/@tanstack/query-core/build/legacy/queryClient.d.ts delete mode 100644 node_modules/@tanstack/query-core/build/legacy/queryClient.js delete mode 100644 node_modules/@tanstack/query-core/build/legacy/queryClient.js.map delete mode 100644 node_modules/@tanstack/query-core/build/legacy/queryObserver.cjs delete mode 100644 node_modules/@tanstack/query-core/build/legacy/queryObserver.cjs.map delete mode 100644 node_modules/@tanstack/query-core/build/legacy/queryObserver.d.cts delete mode 100644 node_modules/@tanstack/query-core/build/legacy/queryObserver.d.ts delete mode 100644 node_modules/@tanstack/query-core/build/legacy/queryObserver.js delete mode 100644 node_modules/@tanstack/query-core/build/legacy/queryObserver.js.map delete mode 100644 node_modules/@tanstack/query-core/build/legacy/removable.cjs delete mode 100644 node_modules/@tanstack/query-core/build/legacy/removable.cjs.map delete mode 100644 node_modules/@tanstack/query-core/build/legacy/removable.d.cts delete mode 100644 node_modules/@tanstack/query-core/build/legacy/removable.d.ts delete mode 100644 node_modules/@tanstack/query-core/build/legacy/removable.js delete mode 100644 node_modules/@tanstack/query-core/build/legacy/removable.js.map delete mode 100644 node_modules/@tanstack/query-core/build/legacy/retryer.cjs delete mode 100644 node_modules/@tanstack/query-core/build/legacy/retryer.cjs.map delete mode 100644 node_modules/@tanstack/query-core/build/legacy/retryer.d.cts delete mode 100644 node_modules/@tanstack/query-core/build/legacy/retryer.d.ts delete mode 100644 node_modules/@tanstack/query-core/build/legacy/retryer.js delete mode 100644 node_modules/@tanstack/query-core/build/legacy/retryer.js.map delete mode 100644 node_modules/@tanstack/query-core/build/legacy/streamedQuery.cjs delete mode 100644 node_modules/@tanstack/query-core/build/legacy/streamedQuery.cjs.map delete mode 100644 node_modules/@tanstack/query-core/build/legacy/streamedQuery.d.cts delete mode 100644 node_modules/@tanstack/query-core/build/legacy/streamedQuery.d.ts delete mode 100644 node_modules/@tanstack/query-core/build/legacy/streamedQuery.js delete mode 100644 node_modules/@tanstack/query-core/build/legacy/streamedQuery.js.map delete mode 100644 node_modules/@tanstack/query-core/build/legacy/subscribable.cjs delete mode 100644 node_modules/@tanstack/query-core/build/legacy/subscribable.cjs.map delete mode 100644 node_modules/@tanstack/query-core/build/legacy/subscribable.d.cts delete mode 100644 node_modules/@tanstack/query-core/build/legacy/subscribable.d.ts delete mode 100644 node_modules/@tanstack/query-core/build/legacy/subscribable.js delete mode 100644 node_modules/@tanstack/query-core/build/legacy/subscribable.js.map delete mode 100644 node_modules/@tanstack/query-core/build/legacy/thenable.cjs delete mode 100644 node_modules/@tanstack/query-core/build/legacy/thenable.cjs.map delete mode 100644 node_modules/@tanstack/query-core/build/legacy/thenable.d.cts delete mode 100644 node_modules/@tanstack/query-core/build/legacy/thenable.d.ts delete mode 100644 node_modules/@tanstack/query-core/build/legacy/thenable.js delete mode 100644 node_modules/@tanstack/query-core/build/legacy/thenable.js.map delete mode 100644 node_modules/@tanstack/query-core/build/legacy/timeoutManager.cjs delete mode 100644 node_modules/@tanstack/query-core/build/legacy/timeoutManager.cjs.map delete mode 100644 node_modules/@tanstack/query-core/build/legacy/timeoutManager.d.cts delete mode 100644 node_modules/@tanstack/query-core/build/legacy/timeoutManager.d.ts delete mode 100644 node_modules/@tanstack/query-core/build/legacy/timeoutManager.js delete mode 100644 node_modules/@tanstack/query-core/build/legacy/timeoutManager.js.map delete mode 100644 node_modules/@tanstack/query-core/build/legacy/types.cjs delete mode 100644 node_modules/@tanstack/query-core/build/legacy/types.cjs.map delete mode 100644 node_modules/@tanstack/query-core/build/legacy/types.d.cts delete mode 100644 node_modules/@tanstack/query-core/build/legacy/types.d.ts delete mode 100644 node_modules/@tanstack/query-core/build/legacy/types.js delete mode 100644 node_modules/@tanstack/query-core/build/legacy/types.js.map delete mode 100644 node_modules/@tanstack/query-core/build/legacy/utils.cjs delete mode 100644 node_modules/@tanstack/query-core/build/legacy/utils.cjs.map delete mode 100644 node_modules/@tanstack/query-core/build/legacy/utils.d.cts delete mode 100644 node_modules/@tanstack/query-core/build/legacy/utils.d.ts delete mode 100644 node_modules/@tanstack/query-core/build/legacy/utils.js delete mode 100644 node_modules/@tanstack/query-core/build/legacy/utils.js.map delete mode 100644 node_modules/@tanstack/query-core/build/modern/focusManager.cjs delete mode 100644 node_modules/@tanstack/query-core/build/modern/focusManager.cjs.map delete mode 100644 node_modules/@tanstack/query-core/build/modern/focusManager.d.cts delete mode 100644 node_modules/@tanstack/query-core/build/modern/focusManager.d.ts delete mode 100644 node_modules/@tanstack/query-core/build/modern/focusManager.js delete mode 100644 node_modules/@tanstack/query-core/build/modern/focusManager.js.map delete mode 100644 node_modules/@tanstack/query-core/build/modern/hydration-BlEVG2Lp.d.ts delete mode 100644 node_modules/@tanstack/query-core/build/modern/hydration-uphG6M-i.d.cts delete mode 100644 node_modules/@tanstack/query-core/build/modern/hydration.cjs delete mode 100644 node_modules/@tanstack/query-core/build/modern/hydration.cjs.map delete mode 100644 node_modules/@tanstack/query-core/build/modern/hydration.d.cts delete mode 100644 node_modules/@tanstack/query-core/build/modern/hydration.d.ts delete mode 100644 node_modules/@tanstack/query-core/build/modern/hydration.js delete mode 100644 node_modules/@tanstack/query-core/build/modern/hydration.js.map delete mode 100644 node_modules/@tanstack/query-core/build/modern/index.cjs delete mode 100644 node_modules/@tanstack/query-core/build/modern/index.cjs.map delete mode 100644 node_modules/@tanstack/query-core/build/modern/index.d.cts delete mode 100644 node_modules/@tanstack/query-core/build/modern/index.d.ts delete mode 100644 node_modules/@tanstack/query-core/build/modern/index.js delete mode 100644 node_modules/@tanstack/query-core/build/modern/index.js.map delete mode 100644 node_modules/@tanstack/query-core/build/modern/infiniteQueryBehavior.cjs delete mode 100644 node_modules/@tanstack/query-core/build/modern/infiniteQueryBehavior.cjs.map delete mode 100644 node_modules/@tanstack/query-core/build/modern/infiniteQueryBehavior.d.cts delete mode 100644 node_modules/@tanstack/query-core/build/modern/infiniteQueryBehavior.d.ts delete mode 100644 node_modules/@tanstack/query-core/build/modern/infiniteQueryBehavior.js delete mode 100644 node_modules/@tanstack/query-core/build/modern/infiniteQueryBehavior.js.map delete mode 100644 node_modules/@tanstack/query-core/build/modern/infiniteQueryObserver.cjs delete mode 100644 node_modules/@tanstack/query-core/build/modern/infiniteQueryObserver.cjs.map delete mode 100644 node_modules/@tanstack/query-core/build/modern/infiniteQueryObserver.d.cts delete mode 100644 node_modules/@tanstack/query-core/build/modern/infiniteQueryObserver.d.ts delete mode 100644 node_modules/@tanstack/query-core/build/modern/infiniteQueryObserver.js delete mode 100644 node_modules/@tanstack/query-core/build/modern/infiniteQueryObserver.js.map delete mode 100644 node_modules/@tanstack/query-core/build/modern/mutation.cjs delete mode 100644 node_modules/@tanstack/query-core/build/modern/mutation.cjs.map delete mode 100644 node_modules/@tanstack/query-core/build/modern/mutation.d.cts delete mode 100644 node_modules/@tanstack/query-core/build/modern/mutation.d.ts delete mode 100644 node_modules/@tanstack/query-core/build/modern/mutation.js delete mode 100644 node_modules/@tanstack/query-core/build/modern/mutation.js.map delete mode 100644 node_modules/@tanstack/query-core/build/modern/mutationCache.cjs delete mode 100644 node_modules/@tanstack/query-core/build/modern/mutationCache.cjs.map delete mode 100644 node_modules/@tanstack/query-core/build/modern/mutationCache.d.cts delete mode 100644 node_modules/@tanstack/query-core/build/modern/mutationCache.d.ts delete mode 100644 node_modules/@tanstack/query-core/build/modern/mutationCache.js delete mode 100644 node_modules/@tanstack/query-core/build/modern/mutationCache.js.map delete mode 100644 node_modules/@tanstack/query-core/build/modern/mutationObserver.cjs delete mode 100644 node_modules/@tanstack/query-core/build/modern/mutationObserver.cjs.map delete mode 100644 node_modules/@tanstack/query-core/build/modern/mutationObserver.d.cts delete mode 100644 node_modules/@tanstack/query-core/build/modern/mutationObserver.d.ts delete mode 100644 node_modules/@tanstack/query-core/build/modern/mutationObserver.js delete mode 100644 node_modules/@tanstack/query-core/build/modern/mutationObserver.js.map delete mode 100644 node_modules/@tanstack/query-core/build/modern/notifyManager.cjs delete mode 100644 node_modules/@tanstack/query-core/build/modern/notifyManager.cjs.map delete mode 100644 node_modules/@tanstack/query-core/build/modern/notifyManager.d.cts delete mode 100644 node_modules/@tanstack/query-core/build/modern/notifyManager.d.ts delete mode 100644 node_modules/@tanstack/query-core/build/modern/notifyManager.js delete mode 100644 node_modules/@tanstack/query-core/build/modern/notifyManager.js.map delete mode 100644 node_modules/@tanstack/query-core/build/modern/onlineManager.cjs delete mode 100644 node_modules/@tanstack/query-core/build/modern/onlineManager.cjs.map delete mode 100644 node_modules/@tanstack/query-core/build/modern/onlineManager.d.cts delete mode 100644 node_modules/@tanstack/query-core/build/modern/onlineManager.d.ts delete mode 100644 node_modules/@tanstack/query-core/build/modern/onlineManager.js delete mode 100644 node_modules/@tanstack/query-core/build/modern/onlineManager.js.map delete mode 100644 node_modules/@tanstack/query-core/build/modern/queriesObserver.cjs delete mode 100644 node_modules/@tanstack/query-core/build/modern/queriesObserver.cjs.map delete mode 100644 node_modules/@tanstack/query-core/build/modern/queriesObserver.d.cts delete mode 100644 node_modules/@tanstack/query-core/build/modern/queriesObserver.d.ts delete mode 100644 node_modules/@tanstack/query-core/build/modern/queriesObserver.js delete mode 100644 node_modules/@tanstack/query-core/build/modern/queriesObserver.js.map delete mode 100644 node_modules/@tanstack/query-core/build/modern/query.cjs delete mode 100644 node_modules/@tanstack/query-core/build/modern/query.cjs.map delete mode 100644 node_modules/@tanstack/query-core/build/modern/query.d.cts delete mode 100644 node_modules/@tanstack/query-core/build/modern/query.d.ts delete mode 100644 node_modules/@tanstack/query-core/build/modern/query.js delete mode 100644 node_modules/@tanstack/query-core/build/modern/query.js.map delete mode 100644 node_modules/@tanstack/query-core/build/modern/queryCache.cjs delete mode 100644 node_modules/@tanstack/query-core/build/modern/queryCache.cjs.map delete mode 100644 node_modules/@tanstack/query-core/build/modern/queryCache.d.cts delete mode 100644 node_modules/@tanstack/query-core/build/modern/queryCache.d.ts delete mode 100644 node_modules/@tanstack/query-core/build/modern/queryCache.js delete mode 100644 node_modules/@tanstack/query-core/build/modern/queryCache.js.map delete mode 100644 node_modules/@tanstack/query-core/build/modern/queryClient.cjs delete mode 100644 node_modules/@tanstack/query-core/build/modern/queryClient.cjs.map delete mode 100644 node_modules/@tanstack/query-core/build/modern/queryClient.d.cts delete mode 100644 node_modules/@tanstack/query-core/build/modern/queryClient.d.ts delete mode 100644 node_modules/@tanstack/query-core/build/modern/queryClient.js delete mode 100644 node_modules/@tanstack/query-core/build/modern/queryClient.js.map delete mode 100644 node_modules/@tanstack/query-core/build/modern/queryObserver.cjs delete mode 100644 node_modules/@tanstack/query-core/build/modern/queryObserver.cjs.map delete mode 100644 node_modules/@tanstack/query-core/build/modern/queryObserver.d.cts delete mode 100644 node_modules/@tanstack/query-core/build/modern/queryObserver.d.ts delete mode 100644 node_modules/@tanstack/query-core/build/modern/queryObserver.js delete mode 100644 node_modules/@tanstack/query-core/build/modern/queryObserver.js.map delete mode 100644 node_modules/@tanstack/query-core/build/modern/removable.cjs delete mode 100644 node_modules/@tanstack/query-core/build/modern/removable.cjs.map delete mode 100644 node_modules/@tanstack/query-core/build/modern/removable.d.cts delete mode 100644 node_modules/@tanstack/query-core/build/modern/removable.d.ts delete mode 100644 node_modules/@tanstack/query-core/build/modern/removable.js delete mode 100644 node_modules/@tanstack/query-core/build/modern/removable.js.map delete mode 100644 node_modules/@tanstack/query-core/build/modern/retryer.cjs delete mode 100644 node_modules/@tanstack/query-core/build/modern/retryer.cjs.map delete mode 100644 node_modules/@tanstack/query-core/build/modern/retryer.d.cts delete mode 100644 node_modules/@tanstack/query-core/build/modern/retryer.d.ts delete mode 100644 node_modules/@tanstack/query-core/build/modern/retryer.js delete mode 100644 node_modules/@tanstack/query-core/build/modern/retryer.js.map delete mode 100644 node_modules/@tanstack/query-core/build/modern/streamedQuery.cjs delete mode 100644 node_modules/@tanstack/query-core/build/modern/streamedQuery.cjs.map delete mode 100644 node_modules/@tanstack/query-core/build/modern/streamedQuery.d.cts delete mode 100644 node_modules/@tanstack/query-core/build/modern/streamedQuery.d.ts delete mode 100644 node_modules/@tanstack/query-core/build/modern/streamedQuery.js delete mode 100644 node_modules/@tanstack/query-core/build/modern/streamedQuery.js.map delete mode 100644 node_modules/@tanstack/query-core/build/modern/subscribable.cjs delete mode 100644 node_modules/@tanstack/query-core/build/modern/subscribable.cjs.map delete mode 100644 node_modules/@tanstack/query-core/build/modern/subscribable.d.cts delete mode 100644 node_modules/@tanstack/query-core/build/modern/subscribable.d.ts delete mode 100644 node_modules/@tanstack/query-core/build/modern/subscribable.js delete mode 100644 node_modules/@tanstack/query-core/build/modern/subscribable.js.map delete mode 100644 node_modules/@tanstack/query-core/build/modern/thenable.cjs delete mode 100644 node_modules/@tanstack/query-core/build/modern/thenable.cjs.map delete mode 100644 node_modules/@tanstack/query-core/build/modern/thenable.d.cts delete mode 100644 node_modules/@tanstack/query-core/build/modern/thenable.d.ts delete mode 100644 node_modules/@tanstack/query-core/build/modern/thenable.js delete mode 100644 node_modules/@tanstack/query-core/build/modern/thenable.js.map delete mode 100644 node_modules/@tanstack/query-core/build/modern/timeoutManager.cjs delete mode 100644 node_modules/@tanstack/query-core/build/modern/timeoutManager.cjs.map delete mode 100644 node_modules/@tanstack/query-core/build/modern/timeoutManager.d.cts delete mode 100644 node_modules/@tanstack/query-core/build/modern/timeoutManager.d.ts delete mode 100644 node_modules/@tanstack/query-core/build/modern/timeoutManager.js delete mode 100644 node_modules/@tanstack/query-core/build/modern/timeoutManager.js.map delete mode 100644 node_modules/@tanstack/query-core/build/modern/types.cjs delete mode 100644 node_modules/@tanstack/query-core/build/modern/types.cjs.map delete mode 100644 node_modules/@tanstack/query-core/build/modern/types.d.cts delete mode 100644 node_modules/@tanstack/query-core/build/modern/types.d.ts delete mode 100644 node_modules/@tanstack/query-core/build/modern/types.js delete mode 100644 node_modules/@tanstack/query-core/build/modern/types.js.map delete mode 100644 node_modules/@tanstack/query-core/build/modern/utils.cjs delete mode 100644 node_modules/@tanstack/query-core/build/modern/utils.cjs.map delete mode 100644 node_modules/@tanstack/query-core/build/modern/utils.d.cts delete mode 100644 node_modules/@tanstack/query-core/build/modern/utils.d.ts delete mode 100644 node_modules/@tanstack/query-core/build/modern/utils.js delete mode 100644 node_modules/@tanstack/query-core/build/modern/utils.js.map delete mode 100644 node_modules/@tanstack/query-core/package.json delete mode 100644 node_modules/@tanstack/query-core/src/focusManager.ts delete mode 100644 node_modules/@tanstack/query-core/src/hydration.ts delete mode 100644 node_modules/@tanstack/query-core/src/index.ts delete mode 100644 node_modules/@tanstack/query-core/src/infiniteQueryBehavior.ts delete mode 100644 node_modules/@tanstack/query-core/src/infiniteQueryObserver.ts delete mode 100644 node_modules/@tanstack/query-core/src/mutation.ts delete mode 100644 node_modules/@tanstack/query-core/src/mutationCache.ts delete mode 100644 node_modules/@tanstack/query-core/src/mutationObserver.ts delete mode 100644 node_modules/@tanstack/query-core/src/notifyManager.ts delete mode 100644 node_modules/@tanstack/query-core/src/onlineManager.ts delete mode 100644 node_modules/@tanstack/query-core/src/queriesObserver.ts delete mode 100644 node_modules/@tanstack/query-core/src/query.ts delete mode 100644 node_modules/@tanstack/query-core/src/queryCache.ts delete mode 100644 node_modules/@tanstack/query-core/src/queryClient.ts delete mode 100644 node_modules/@tanstack/query-core/src/queryObserver.ts delete mode 100644 node_modules/@tanstack/query-core/src/removable.ts delete mode 100644 node_modules/@tanstack/query-core/src/retryer.ts delete mode 100644 node_modules/@tanstack/query-core/src/streamedQuery.ts delete mode 100644 node_modules/@tanstack/query-core/src/subscribable.ts delete mode 100644 node_modules/@tanstack/query-core/src/thenable.ts delete mode 100644 node_modules/@tanstack/query-core/src/timeoutManager.ts delete mode 100644 node_modules/@tanstack/query-core/src/types.ts delete mode 100644 node_modules/@tanstack/query-core/src/utils.ts delete mode 100644 node_modules/@tanstack/react-query/LICENSE delete mode 100644 node_modules/@tanstack/react-query/README.md delete mode 100644 node_modules/@tanstack/react-query/build/codemods/src/utils/index.cjs delete mode 100644 node_modules/@tanstack/react-query/build/codemods/src/utils/transformers/query-cache-transformer.cjs delete mode 100644 node_modules/@tanstack/react-query/build/codemods/src/utils/transformers/query-client-transformer.cjs delete mode 100644 node_modules/@tanstack/react-query/build/codemods/src/utils/transformers/use-query-like-transformer.cjs delete mode 100644 node_modules/@tanstack/react-query/build/codemods/src/v4/key-transformation.cjs delete mode 100644 node_modules/@tanstack/react-query/build/codemods/src/v4/replace-import-specifier.cjs delete mode 100644 node_modules/@tanstack/react-query/build/codemods/src/v4/utils/replacers/key-replacer.cjs delete mode 100644 node_modules/@tanstack/react-query/build/codemods/src/v5/is-loading/is-loading.cjs delete mode 100644 node_modules/@tanstack/react-query/build/codemods/src/v5/keep-previous-data/README.md delete mode 100644 node_modules/@tanstack/react-query/build/codemods/src/v5/keep-previous-data/keep-previous-data.cjs delete mode 100644 node_modules/@tanstack/react-query/build/codemods/src/v5/keep-previous-data/utils/already-has-placeholder-data-property.cjs delete mode 100644 node_modules/@tanstack/react-query/build/codemods/src/v5/remove-overloads/remove-overloads.cjs delete mode 100644 node_modules/@tanstack/react-query/build/codemods/src/v5/remove-overloads/transformers/filter-aware-usage-transformer.cjs delete mode 100644 node_modules/@tanstack/react-query/build/codemods/src/v5/remove-overloads/transformers/query-fn-aware-usage-transformer.cjs delete mode 100644 node_modules/@tanstack/react-query/build/codemods/src/v5/remove-overloads/utils/index.cjs delete mode 100644 node_modules/@tanstack/react-query/build/codemods/src/v5/remove-overloads/utils/unknown-usage-error.cjs delete mode 100644 node_modules/@tanstack/react-query/build/codemods/src/v5/rename-hydrate/rename-hydrate.cjs delete mode 100644 node_modules/@tanstack/react-query/build/codemods/src/v5/rename-properties/rename-properties.cjs delete mode 100644 node_modules/@tanstack/react-query/build/legacy/HydrationBoundary.cjs delete mode 100644 node_modules/@tanstack/react-query/build/legacy/HydrationBoundary.cjs.map delete mode 100644 node_modules/@tanstack/react-query/build/legacy/HydrationBoundary.d.cts delete mode 100644 node_modules/@tanstack/react-query/build/legacy/HydrationBoundary.d.ts delete mode 100644 node_modules/@tanstack/react-query/build/legacy/HydrationBoundary.js delete mode 100644 node_modules/@tanstack/react-query/build/legacy/HydrationBoundary.js.map delete mode 100644 node_modules/@tanstack/react-query/build/legacy/IsRestoringProvider.cjs delete mode 100644 node_modules/@tanstack/react-query/build/legacy/IsRestoringProvider.cjs.map delete mode 100644 node_modules/@tanstack/react-query/build/legacy/IsRestoringProvider.d.cts delete mode 100644 node_modules/@tanstack/react-query/build/legacy/IsRestoringProvider.d.ts delete mode 100644 node_modules/@tanstack/react-query/build/legacy/IsRestoringProvider.js delete mode 100644 node_modules/@tanstack/react-query/build/legacy/IsRestoringProvider.js.map delete mode 100644 node_modules/@tanstack/react-query/build/legacy/QueryClientProvider.cjs delete mode 100644 node_modules/@tanstack/react-query/build/legacy/QueryClientProvider.cjs.map delete mode 100644 node_modules/@tanstack/react-query/build/legacy/QueryClientProvider.d.cts delete mode 100644 node_modules/@tanstack/react-query/build/legacy/QueryClientProvider.d.ts delete mode 100644 node_modules/@tanstack/react-query/build/legacy/QueryClientProvider.js delete mode 100644 node_modules/@tanstack/react-query/build/legacy/QueryClientProvider.js.map delete mode 100644 node_modules/@tanstack/react-query/build/legacy/QueryErrorResetBoundary.cjs delete mode 100644 node_modules/@tanstack/react-query/build/legacy/QueryErrorResetBoundary.cjs.map delete mode 100644 node_modules/@tanstack/react-query/build/legacy/QueryErrorResetBoundary.d.cts delete mode 100644 node_modules/@tanstack/react-query/build/legacy/QueryErrorResetBoundary.d.ts delete mode 100644 node_modules/@tanstack/react-query/build/legacy/QueryErrorResetBoundary.js delete mode 100644 node_modules/@tanstack/react-query/build/legacy/QueryErrorResetBoundary.js.map delete mode 100644 node_modules/@tanstack/react-query/build/legacy/errorBoundaryUtils.cjs delete mode 100644 node_modules/@tanstack/react-query/build/legacy/errorBoundaryUtils.cjs.map delete mode 100644 node_modules/@tanstack/react-query/build/legacy/errorBoundaryUtils.d.cts delete mode 100644 node_modules/@tanstack/react-query/build/legacy/errorBoundaryUtils.d.ts delete mode 100644 node_modules/@tanstack/react-query/build/legacy/errorBoundaryUtils.js delete mode 100644 node_modules/@tanstack/react-query/build/legacy/errorBoundaryUtils.js.map delete mode 100644 node_modules/@tanstack/react-query/build/legacy/index.cjs delete mode 100644 node_modules/@tanstack/react-query/build/legacy/index.cjs.map delete mode 100644 node_modules/@tanstack/react-query/build/legacy/index.d.cts delete mode 100644 node_modules/@tanstack/react-query/build/legacy/index.d.ts delete mode 100644 node_modules/@tanstack/react-query/build/legacy/index.js delete mode 100644 node_modules/@tanstack/react-query/build/legacy/index.js.map delete mode 100644 node_modules/@tanstack/react-query/build/legacy/infiniteQueryOptions.cjs delete mode 100644 node_modules/@tanstack/react-query/build/legacy/infiniteQueryOptions.cjs.map delete mode 100644 node_modules/@tanstack/react-query/build/legacy/infiniteQueryOptions.d.cts delete mode 100644 node_modules/@tanstack/react-query/build/legacy/infiniteQueryOptions.d.ts delete mode 100644 node_modules/@tanstack/react-query/build/legacy/infiniteQueryOptions.js delete mode 100644 node_modules/@tanstack/react-query/build/legacy/infiniteQueryOptions.js.map delete mode 100644 node_modules/@tanstack/react-query/build/legacy/mutationOptions.cjs delete mode 100644 node_modules/@tanstack/react-query/build/legacy/mutationOptions.cjs.map delete mode 100644 node_modules/@tanstack/react-query/build/legacy/mutationOptions.d.cts delete mode 100644 node_modules/@tanstack/react-query/build/legacy/mutationOptions.d.ts delete mode 100644 node_modules/@tanstack/react-query/build/legacy/mutationOptions.js delete mode 100644 node_modules/@tanstack/react-query/build/legacy/mutationOptions.js.map delete mode 100644 node_modules/@tanstack/react-query/build/legacy/queryOptions.cjs delete mode 100644 node_modules/@tanstack/react-query/build/legacy/queryOptions.cjs.map delete mode 100644 node_modules/@tanstack/react-query/build/legacy/queryOptions.d.cts delete mode 100644 node_modules/@tanstack/react-query/build/legacy/queryOptions.d.ts delete mode 100644 node_modules/@tanstack/react-query/build/legacy/queryOptions.js delete mode 100644 node_modules/@tanstack/react-query/build/legacy/queryOptions.js.map delete mode 100644 node_modules/@tanstack/react-query/build/legacy/suspense.cjs delete mode 100644 node_modules/@tanstack/react-query/build/legacy/suspense.cjs.map delete mode 100644 node_modules/@tanstack/react-query/build/legacy/suspense.d.cts delete mode 100644 node_modules/@tanstack/react-query/build/legacy/suspense.d.ts delete mode 100644 node_modules/@tanstack/react-query/build/legacy/suspense.js delete mode 100644 node_modules/@tanstack/react-query/build/legacy/suspense.js.map delete mode 100644 node_modules/@tanstack/react-query/build/legacy/types.cjs delete mode 100644 node_modules/@tanstack/react-query/build/legacy/types.cjs.map delete mode 100644 node_modules/@tanstack/react-query/build/legacy/types.d.cts delete mode 100644 node_modules/@tanstack/react-query/build/legacy/types.d.ts delete mode 100644 node_modules/@tanstack/react-query/build/legacy/types.js delete mode 100644 node_modules/@tanstack/react-query/build/legacy/types.js.map delete mode 100644 node_modules/@tanstack/react-query/build/legacy/useBaseQuery.cjs delete mode 100644 node_modules/@tanstack/react-query/build/legacy/useBaseQuery.cjs.map delete mode 100644 node_modules/@tanstack/react-query/build/legacy/useBaseQuery.d.cts delete mode 100644 node_modules/@tanstack/react-query/build/legacy/useBaseQuery.d.ts delete mode 100644 node_modules/@tanstack/react-query/build/legacy/useBaseQuery.js delete mode 100644 node_modules/@tanstack/react-query/build/legacy/useBaseQuery.js.map delete mode 100644 node_modules/@tanstack/react-query/build/legacy/useInfiniteQuery.cjs delete mode 100644 node_modules/@tanstack/react-query/build/legacy/useInfiniteQuery.cjs.map delete mode 100644 node_modules/@tanstack/react-query/build/legacy/useInfiniteQuery.d.cts delete mode 100644 node_modules/@tanstack/react-query/build/legacy/useInfiniteQuery.d.ts delete mode 100644 node_modules/@tanstack/react-query/build/legacy/useInfiniteQuery.js delete mode 100644 node_modules/@tanstack/react-query/build/legacy/useInfiniteQuery.js.map delete mode 100644 node_modules/@tanstack/react-query/build/legacy/useIsFetching.cjs delete mode 100644 node_modules/@tanstack/react-query/build/legacy/useIsFetching.cjs.map delete mode 100644 node_modules/@tanstack/react-query/build/legacy/useIsFetching.d.cts delete mode 100644 node_modules/@tanstack/react-query/build/legacy/useIsFetching.d.ts delete mode 100644 node_modules/@tanstack/react-query/build/legacy/useIsFetching.js delete mode 100644 node_modules/@tanstack/react-query/build/legacy/useIsFetching.js.map delete mode 100644 node_modules/@tanstack/react-query/build/legacy/useMutation.cjs delete mode 100644 node_modules/@tanstack/react-query/build/legacy/useMutation.cjs.map delete mode 100644 node_modules/@tanstack/react-query/build/legacy/useMutation.d.cts delete mode 100644 node_modules/@tanstack/react-query/build/legacy/useMutation.d.ts delete mode 100644 node_modules/@tanstack/react-query/build/legacy/useMutation.js delete mode 100644 node_modules/@tanstack/react-query/build/legacy/useMutation.js.map delete mode 100644 node_modules/@tanstack/react-query/build/legacy/useMutationState.cjs delete mode 100644 node_modules/@tanstack/react-query/build/legacy/useMutationState.cjs.map delete mode 100644 node_modules/@tanstack/react-query/build/legacy/useMutationState.d.cts delete mode 100644 node_modules/@tanstack/react-query/build/legacy/useMutationState.d.ts delete mode 100644 node_modules/@tanstack/react-query/build/legacy/useMutationState.js delete mode 100644 node_modules/@tanstack/react-query/build/legacy/useMutationState.js.map delete mode 100644 node_modules/@tanstack/react-query/build/legacy/usePrefetchInfiniteQuery.cjs delete mode 100644 node_modules/@tanstack/react-query/build/legacy/usePrefetchInfiniteQuery.cjs.map delete mode 100644 node_modules/@tanstack/react-query/build/legacy/usePrefetchInfiniteQuery.d.cts delete mode 100644 node_modules/@tanstack/react-query/build/legacy/usePrefetchInfiniteQuery.d.ts delete mode 100644 node_modules/@tanstack/react-query/build/legacy/usePrefetchInfiniteQuery.js delete mode 100644 node_modules/@tanstack/react-query/build/legacy/usePrefetchInfiniteQuery.js.map delete mode 100644 node_modules/@tanstack/react-query/build/legacy/usePrefetchQuery.cjs delete mode 100644 node_modules/@tanstack/react-query/build/legacy/usePrefetchQuery.cjs.map delete mode 100644 node_modules/@tanstack/react-query/build/legacy/usePrefetchQuery.d.cts delete mode 100644 node_modules/@tanstack/react-query/build/legacy/usePrefetchQuery.d.ts delete mode 100644 node_modules/@tanstack/react-query/build/legacy/usePrefetchQuery.js delete mode 100644 node_modules/@tanstack/react-query/build/legacy/usePrefetchQuery.js.map delete mode 100644 node_modules/@tanstack/react-query/build/legacy/useQueries.cjs delete mode 100644 node_modules/@tanstack/react-query/build/legacy/useQueries.cjs.map delete mode 100644 node_modules/@tanstack/react-query/build/legacy/useQueries.d.cts delete mode 100644 node_modules/@tanstack/react-query/build/legacy/useQueries.d.ts delete mode 100644 node_modules/@tanstack/react-query/build/legacy/useQueries.js delete mode 100644 node_modules/@tanstack/react-query/build/legacy/useQueries.js.map delete mode 100644 node_modules/@tanstack/react-query/build/legacy/useQuery.cjs delete mode 100644 node_modules/@tanstack/react-query/build/legacy/useQuery.cjs.map delete mode 100644 node_modules/@tanstack/react-query/build/legacy/useQuery.d.cts delete mode 100644 node_modules/@tanstack/react-query/build/legacy/useQuery.d.ts delete mode 100644 node_modules/@tanstack/react-query/build/legacy/useQuery.js delete mode 100644 node_modules/@tanstack/react-query/build/legacy/useQuery.js.map delete mode 100644 node_modules/@tanstack/react-query/build/legacy/useSuspenseInfiniteQuery.cjs delete mode 100644 node_modules/@tanstack/react-query/build/legacy/useSuspenseInfiniteQuery.cjs.map delete mode 100644 node_modules/@tanstack/react-query/build/legacy/useSuspenseInfiniteQuery.d.cts delete mode 100644 node_modules/@tanstack/react-query/build/legacy/useSuspenseInfiniteQuery.d.ts delete mode 100644 node_modules/@tanstack/react-query/build/legacy/useSuspenseInfiniteQuery.js delete mode 100644 node_modules/@tanstack/react-query/build/legacy/useSuspenseInfiniteQuery.js.map delete mode 100644 node_modules/@tanstack/react-query/build/legacy/useSuspenseQueries.cjs delete mode 100644 node_modules/@tanstack/react-query/build/legacy/useSuspenseQueries.cjs.map delete mode 100644 node_modules/@tanstack/react-query/build/legacy/useSuspenseQueries.d.cts delete mode 100644 node_modules/@tanstack/react-query/build/legacy/useSuspenseQueries.d.ts delete mode 100644 node_modules/@tanstack/react-query/build/legacy/useSuspenseQueries.js delete mode 100644 node_modules/@tanstack/react-query/build/legacy/useSuspenseQueries.js.map delete mode 100644 node_modules/@tanstack/react-query/build/legacy/useSuspenseQuery.cjs delete mode 100644 node_modules/@tanstack/react-query/build/legacy/useSuspenseQuery.cjs.map delete mode 100644 node_modules/@tanstack/react-query/build/legacy/useSuspenseQuery.d.cts delete mode 100644 node_modules/@tanstack/react-query/build/legacy/useSuspenseQuery.d.ts delete mode 100644 node_modules/@tanstack/react-query/build/legacy/useSuspenseQuery.js delete mode 100644 node_modules/@tanstack/react-query/build/legacy/useSuspenseQuery.js.map delete mode 100644 node_modules/@tanstack/react-query/build/modern/HydrationBoundary.cjs delete mode 100644 node_modules/@tanstack/react-query/build/modern/HydrationBoundary.cjs.map delete mode 100644 node_modules/@tanstack/react-query/build/modern/HydrationBoundary.d.cts delete mode 100644 node_modules/@tanstack/react-query/build/modern/HydrationBoundary.d.ts delete mode 100644 node_modules/@tanstack/react-query/build/modern/HydrationBoundary.js delete mode 100644 node_modules/@tanstack/react-query/build/modern/HydrationBoundary.js.map delete mode 100644 node_modules/@tanstack/react-query/build/modern/IsRestoringProvider.cjs delete mode 100644 node_modules/@tanstack/react-query/build/modern/IsRestoringProvider.cjs.map delete mode 100644 node_modules/@tanstack/react-query/build/modern/IsRestoringProvider.d.cts delete mode 100644 node_modules/@tanstack/react-query/build/modern/IsRestoringProvider.d.ts delete mode 100644 node_modules/@tanstack/react-query/build/modern/IsRestoringProvider.js delete mode 100644 node_modules/@tanstack/react-query/build/modern/IsRestoringProvider.js.map delete mode 100644 node_modules/@tanstack/react-query/build/modern/QueryClientProvider.cjs delete mode 100644 node_modules/@tanstack/react-query/build/modern/QueryClientProvider.cjs.map delete mode 100644 node_modules/@tanstack/react-query/build/modern/QueryClientProvider.d.cts delete mode 100644 node_modules/@tanstack/react-query/build/modern/QueryClientProvider.d.ts delete mode 100644 node_modules/@tanstack/react-query/build/modern/QueryClientProvider.js delete mode 100644 node_modules/@tanstack/react-query/build/modern/QueryClientProvider.js.map delete mode 100644 node_modules/@tanstack/react-query/build/modern/QueryErrorResetBoundary.cjs delete mode 100644 node_modules/@tanstack/react-query/build/modern/QueryErrorResetBoundary.cjs.map delete mode 100644 node_modules/@tanstack/react-query/build/modern/QueryErrorResetBoundary.d.cts delete mode 100644 node_modules/@tanstack/react-query/build/modern/QueryErrorResetBoundary.d.ts delete mode 100644 node_modules/@tanstack/react-query/build/modern/QueryErrorResetBoundary.js delete mode 100644 node_modules/@tanstack/react-query/build/modern/QueryErrorResetBoundary.js.map delete mode 100644 node_modules/@tanstack/react-query/build/modern/errorBoundaryUtils.cjs delete mode 100644 node_modules/@tanstack/react-query/build/modern/errorBoundaryUtils.cjs.map delete mode 100644 node_modules/@tanstack/react-query/build/modern/errorBoundaryUtils.d.cts delete mode 100644 node_modules/@tanstack/react-query/build/modern/errorBoundaryUtils.d.ts delete mode 100644 node_modules/@tanstack/react-query/build/modern/errorBoundaryUtils.js delete mode 100644 node_modules/@tanstack/react-query/build/modern/errorBoundaryUtils.js.map delete mode 100644 node_modules/@tanstack/react-query/build/modern/index.cjs delete mode 100644 node_modules/@tanstack/react-query/build/modern/index.cjs.map delete mode 100644 node_modules/@tanstack/react-query/build/modern/index.d.cts delete mode 100644 node_modules/@tanstack/react-query/build/modern/index.d.ts delete mode 100644 node_modules/@tanstack/react-query/build/modern/index.js delete mode 100644 node_modules/@tanstack/react-query/build/modern/index.js.map delete mode 100644 node_modules/@tanstack/react-query/build/modern/infiniteQueryOptions.cjs delete mode 100644 node_modules/@tanstack/react-query/build/modern/infiniteQueryOptions.cjs.map delete mode 100644 node_modules/@tanstack/react-query/build/modern/infiniteQueryOptions.d.cts delete mode 100644 node_modules/@tanstack/react-query/build/modern/infiniteQueryOptions.d.ts delete mode 100644 node_modules/@tanstack/react-query/build/modern/infiniteQueryOptions.js delete mode 100644 node_modules/@tanstack/react-query/build/modern/infiniteQueryOptions.js.map delete mode 100644 node_modules/@tanstack/react-query/build/modern/mutationOptions.cjs delete mode 100644 node_modules/@tanstack/react-query/build/modern/mutationOptions.cjs.map delete mode 100644 node_modules/@tanstack/react-query/build/modern/mutationOptions.d.cts delete mode 100644 node_modules/@tanstack/react-query/build/modern/mutationOptions.d.ts delete mode 100644 node_modules/@tanstack/react-query/build/modern/mutationOptions.js delete mode 100644 node_modules/@tanstack/react-query/build/modern/mutationOptions.js.map delete mode 100644 node_modules/@tanstack/react-query/build/modern/queryOptions.cjs delete mode 100644 node_modules/@tanstack/react-query/build/modern/queryOptions.cjs.map delete mode 100644 node_modules/@tanstack/react-query/build/modern/queryOptions.d.cts delete mode 100644 node_modules/@tanstack/react-query/build/modern/queryOptions.d.ts delete mode 100644 node_modules/@tanstack/react-query/build/modern/queryOptions.js delete mode 100644 node_modules/@tanstack/react-query/build/modern/queryOptions.js.map delete mode 100644 node_modules/@tanstack/react-query/build/modern/suspense.cjs delete mode 100644 node_modules/@tanstack/react-query/build/modern/suspense.cjs.map delete mode 100644 node_modules/@tanstack/react-query/build/modern/suspense.d.cts delete mode 100644 node_modules/@tanstack/react-query/build/modern/suspense.d.ts delete mode 100644 node_modules/@tanstack/react-query/build/modern/suspense.js delete mode 100644 node_modules/@tanstack/react-query/build/modern/suspense.js.map delete mode 100644 node_modules/@tanstack/react-query/build/modern/types.cjs delete mode 100644 node_modules/@tanstack/react-query/build/modern/types.cjs.map delete mode 100644 node_modules/@tanstack/react-query/build/modern/types.d.cts delete mode 100644 node_modules/@tanstack/react-query/build/modern/types.d.ts delete mode 100644 node_modules/@tanstack/react-query/build/modern/types.js delete mode 100644 node_modules/@tanstack/react-query/build/modern/types.js.map delete mode 100644 node_modules/@tanstack/react-query/build/modern/useBaseQuery.cjs delete mode 100644 node_modules/@tanstack/react-query/build/modern/useBaseQuery.cjs.map delete mode 100644 node_modules/@tanstack/react-query/build/modern/useBaseQuery.d.cts delete mode 100644 node_modules/@tanstack/react-query/build/modern/useBaseQuery.d.ts delete mode 100644 node_modules/@tanstack/react-query/build/modern/useBaseQuery.js delete mode 100644 node_modules/@tanstack/react-query/build/modern/useBaseQuery.js.map delete mode 100644 node_modules/@tanstack/react-query/build/modern/useInfiniteQuery.cjs delete mode 100644 node_modules/@tanstack/react-query/build/modern/useInfiniteQuery.cjs.map delete mode 100644 node_modules/@tanstack/react-query/build/modern/useInfiniteQuery.d.cts delete mode 100644 node_modules/@tanstack/react-query/build/modern/useInfiniteQuery.d.ts delete mode 100644 node_modules/@tanstack/react-query/build/modern/useInfiniteQuery.js delete mode 100644 node_modules/@tanstack/react-query/build/modern/useInfiniteQuery.js.map delete mode 100644 node_modules/@tanstack/react-query/build/modern/useIsFetching.cjs delete mode 100644 node_modules/@tanstack/react-query/build/modern/useIsFetching.cjs.map delete mode 100644 node_modules/@tanstack/react-query/build/modern/useIsFetching.d.cts delete mode 100644 node_modules/@tanstack/react-query/build/modern/useIsFetching.d.ts delete mode 100644 node_modules/@tanstack/react-query/build/modern/useIsFetching.js delete mode 100644 node_modules/@tanstack/react-query/build/modern/useIsFetching.js.map delete mode 100644 node_modules/@tanstack/react-query/build/modern/useMutation.cjs delete mode 100644 node_modules/@tanstack/react-query/build/modern/useMutation.cjs.map delete mode 100644 node_modules/@tanstack/react-query/build/modern/useMutation.d.cts delete mode 100644 node_modules/@tanstack/react-query/build/modern/useMutation.d.ts delete mode 100644 node_modules/@tanstack/react-query/build/modern/useMutation.js delete mode 100644 node_modules/@tanstack/react-query/build/modern/useMutation.js.map delete mode 100644 node_modules/@tanstack/react-query/build/modern/useMutationState.cjs delete mode 100644 node_modules/@tanstack/react-query/build/modern/useMutationState.cjs.map delete mode 100644 node_modules/@tanstack/react-query/build/modern/useMutationState.d.cts delete mode 100644 node_modules/@tanstack/react-query/build/modern/useMutationState.d.ts delete mode 100644 node_modules/@tanstack/react-query/build/modern/useMutationState.js delete mode 100644 node_modules/@tanstack/react-query/build/modern/useMutationState.js.map delete mode 100644 node_modules/@tanstack/react-query/build/modern/usePrefetchInfiniteQuery.cjs delete mode 100644 node_modules/@tanstack/react-query/build/modern/usePrefetchInfiniteQuery.cjs.map delete mode 100644 node_modules/@tanstack/react-query/build/modern/usePrefetchInfiniteQuery.d.cts delete mode 100644 node_modules/@tanstack/react-query/build/modern/usePrefetchInfiniteQuery.d.ts delete mode 100644 node_modules/@tanstack/react-query/build/modern/usePrefetchInfiniteQuery.js delete mode 100644 node_modules/@tanstack/react-query/build/modern/usePrefetchInfiniteQuery.js.map delete mode 100644 node_modules/@tanstack/react-query/build/modern/usePrefetchQuery.cjs delete mode 100644 node_modules/@tanstack/react-query/build/modern/usePrefetchQuery.cjs.map delete mode 100644 node_modules/@tanstack/react-query/build/modern/usePrefetchQuery.d.cts delete mode 100644 node_modules/@tanstack/react-query/build/modern/usePrefetchQuery.d.ts delete mode 100644 node_modules/@tanstack/react-query/build/modern/usePrefetchQuery.js delete mode 100644 node_modules/@tanstack/react-query/build/modern/usePrefetchQuery.js.map delete mode 100644 node_modules/@tanstack/react-query/build/modern/useQueries.cjs delete mode 100644 node_modules/@tanstack/react-query/build/modern/useQueries.cjs.map delete mode 100644 node_modules/@tanstack/react-query/build/modern/useQueries.d.cts delete mode 100644 node_modules/@tanstack/react-query/build/modern/useQueries.d.ts delete mode 100644 node_modules/@tanstack/react-query/build/modern/useQueries.js delete mode 100644 node_modules/@tanstack/react-query/build/modern/useQueries.js.map delete mode 100644 node_modules/@tanstack/react-query/build/modern/useQuery.cjs delete mode 100644 node_modules/@tanstack/react-query/build/modern/useQuery.cjs.map delete mode 100644 node_modules/@tanstack/react-query/build/modern/useQuery.d.cts delete mode 100644 node_modules/@tanstack/react-query/build/modern/useQuery.d.ts delete mode 100644 node_modules/@tanstack/react-query/build/modern/useQuery.js delete mode 100644 node_modules/@tanstack/react-query/build/modern/useQuery.js.map delete mode 100644 node_modules/@tanstack/react-query/build/modern/useSuspenseInfiniteQuery.cjs delete mode 100644 node_modules/@tanstack/react-query/build/modern/useSuspenseInfiniteQuery.cjs.map delete mode 100644 node_modules/@tanstack/react-query/build/modern/useSuspenseInfiniteQuery.d.cts delete mode 100644 node_modules/@tanstack/react-query/build/modern/useSuspenseInfiniteQuery.d.ts delete mode 100644 node_modules/@tanstack/react-query/build/modern/useSuspenseInfiniteQuery.js delete mode 100644 node_modules/@tanstack/react-query/build/modern/useSuspenseInfiniteQuery.js.map delete mode 100644 node_modules/@tanstack/react-query/build/modern/useSuspenseQueries.cjs delete mode 100644 node_modules/@tanstack/react-query/build/modern/useSuspenseQueries.cjs.map delete mode 100644 node_modules/@tanstack/react-query/build/modern/useSuspenseQueries.d.cts delete mode 100644 node_modules/@tanstack/react-query/build/modern/useSuspenseQueries.d.ts delete mode 100644 node_modules/@tanstack/react-query/build/modern/useSuspenseQueries.js delete mode 100644 node_modules/@tanstack/react-query/build/modern/useSuspenseQueries.js.map delete mode 100644 node_modules/@tanstack/react-query/build/modern/useSuspenseQuery.cjs delete mode 100644 node_modules/@tanstack/react-query/build/modern/useSuspenseQuery.cjs.map delete mode 100644 node_modules/@tanstack/react-query/build/modern/useSuspenseQuery.d.cts delete mode 100644 node_modules/@tanstack/react-query/build/modern/useSuspenseQuery.d.ts delete mode 100644 node_modules/@tanstack/react-query/build/modern/useSuspenseQuery.js delete mode 100644 node_modules/@tanstack/react-query/build/modern/useSuspenseQuery.js.map delete mode 100644 node_modules/@tanstack/react-query/build/query-codemods/eslint.config.js delete mode 100644 node_modules/@tanstack/react-query/build/query-codemods/package.json delete mode 100644 node_modules/@tanstack/react-query/build/query-codemods/root.eslint.config.js delete mode 100644 node_modules/@tanstack/react-query/build/query-codemods/tsconfig.json delete mode 100644 node_modules/@tanstack/react-query/build/query-codemods/vite.config.ts delete mode 100644 node_modules/@tanstack/react-query/package.json delete mode 100644 node_modules/@tanstack/react-query/src/HydrationBoundary.tsx delete mode 100644 node_modules/@tanstack/react-query/src/IsRestoringProvider.ts delete mode 100644 node_modules/@tanstack/react-query/src/QueryClientProvider.tsx delete mode 100644 node_modules/@tanstack/react-query/src/QueryErrorResetBoundary.tsx delete mode 100644 node_modules/@tanstack/react-query/src/errorBoundaryUtils.ts delete mode 100644 node_modules/@tanstack/react-query/src/index.ts delete mode 100644 node_modules/@tanstack/react-query/src/infiniteQueryOptions.ts delete mode 100644 node_modules/@tanstack/react-query/src/mutationOptions.ts delete mode 100644 node_modules/@tanstack/react-query/src/queryOptions.ts delete mode 100644 node_modules/@tanstack/react-query/src/suspense.ts delete mode 100644 node_modules/@tanstack/react-query/src/types.ts delete mode 100644 node_modules/@tanstack/react-query/src/useBaseQuery.ts delete mode 100644 node_modules/@tanstack/react-query/src/useInfiniteQuery.ts delete mode 100644 node_modules/@tanstack/react-query/src/useIsFetching.ts delete mode 100644 node_modules/@tanstack/react-query/src/useMutation.ts delete mode 100644 node_modules/@tanstack/react-query/src/useMutationState.ts delete mode 100644 node_modules/@tanstack/react-query/src/usePrefetchInfiniteQuery.tsx delete mode 100644 node_modules/@tanstack/react-query/src/usePrefetchQuery.tsx delete mode 100644 node_modules/@tanstack/react-query/src/useQueries.ts delete mode 100644 node_modules/@tanstack/react-query/src/useQuery.ts delete mode 100644 node_modules/@tanstack/react-query/src/useSuspenseInfiniteQuery.ts delete mode 100644 node_modules/@tanstack/react-query/src/useSuspenseQueries.ts delete mode 100644 node_modules/@tanstack/react-query/src/useSuspenseQuery.ts delete mode 100644 node_modules/react/LICENSE delete mode 100644 node_modules/react/README.md delete mode 100644 node_modules/react/cjs/react-compiler-runtime.development.js delete mode 100644 node_modules/react/cjs/react-compiler-runtime.production.js delete mode 100644 node_modules/react/cjs/react-compiler-runtime.profiling.js delete mode 100644 node_modules/react/cjs/react-jsx-dev-runtime.development.js delete mode 100644 node_modules/react/cjs/react-jsx-dev-runtime.production.js delete mode 100644 node_modules/react/cjs/react-jsx-dev-runtime.profiling.js delete mode 100644 node_modules/react/cjs/react-jsx-dev-runtime.react-server.development.js delete mode 100644 node_modules/react/cjs/react-jsx-dev-runtime.react-server.production.js delete mode 100644 node_modules/react/cjs/react-jsx-runtime.development.js delete mode 100644 node_modules/react/cjs/react-jsx-runtime.production.js delete mode 100644 node_modules/react/cjs/react-jsx-runtime.profiling.js delete mode 100644 node_modules/react/cjs/react-jsx-runtime.react-server.development.js delete mode 100644 node_modules/react/cjs/react-jsx-runtime.react-server.production.js delete mode 100644 node_modules/react/cjs/react.development.js delete mode 100644 node_modules/react/cjs/react.production.js delete mode 100644 node_modules/react/cjs/react.react-server.development.js delete mode 100644 node_modules/react/cjs/react.react-server.production.js delete mode 100644 node_modules/react/compiler-runtime.js delete mode 100644 node_modules/react/index.js delete mode 100644 node_modules/react/jsx-dev-runtime.js delete mode 100644 node_modules/react/jsx-dev-runtime.react-server.js delete mode 100644 node_modules/react/jsx-runtime.js delete mode 100644 node_modules/react/jsx-runtime.react-server.js delete mode 100644 node_modules/react/package.json delete mode 100644 node_modules/react/react.react-server.js diff --git a/node_modules/.package-lock.json b/node_modules/.package-lock.json deleted file mode 100644 index 7ec269b..0000000 --- a/node_modules/.package-lock.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "name": "ManageAssets", - "lockfileVersion": 3, - "requires": true, - "packages": { - "node_modules/@tanstack/query-core": { - "version": "5.90.20", - "resolved": "https://registry.npmjs.org/@tanstack/query-core/-/query-core-5.90.20.tgz", - "integrity": "sha512-OMD2HLpNouXEfZJWcKeVKUgQ5n+n3A2JFmBaScpNDUqSrQSjiveC7dKMe53uJUg1nDG16ttFPz2xfilz6i2uVg==", - "license": "MIT", - "funding": { - "type": "github", - "url": "https://github.com/sponsors/tannerlinsley" - } - }, - "node_modules/@tanstack/react-query": { - "version": "5.90.21", - "resolved": "https://registry.npmjs.org/@tanstack/react-query/-/react-query-5.90.21.tgz", - "integrity": "sha512-0Lu6y5t+tvlTJMTO7oh5NSpJfpg/5D41LlThfepTixPYkJ0sE2Jj0m0f6yYqujBwIXlId87e234+MxG3D3g7kg==", - "license": "MIT", - "dependencies": { - "@tanstack/query-core": "5.90.20" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/tannerlinsley" - }, - "peerDependencies": { - "react": "^18 || ^19" - } - }, - "node_modules/react": { - "version": "19.2.4", - "resolved": "https://registry.npmjs.org/react/-/react-19.2.4.tgz", - "integrity": "sha512-9nfp2hYpCwOjAN+8TZFGhtWEwgvWHXqESH8qT89AT/lWklpLON22Lc8pEtnpsZz7VmawabSU0gCjnj8aC0euHQ==", - "license": "MIT", - "peer": true, - "engines": { - "node": ">=0.10.0" - } - } - } -} diff --git a/node_modules/@tanstack/query-core/LICENSE b/node_modules/@tanstack/query-core/LICENSE deleted file mode 100644 index 1869e21..0000000 --- a/node_modules/@tanstack/query-core/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2021-present Tanner Linsley - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/node_modules/@tanstack/query-core/build/legacy/chunk-PXG64RU4.js b/node_modules/@tanstack/query-core/build/legacy/chunk-PXG64RU4.js deleted file mode 100644 index 62f76a2..0000000 --- a/node_modules/@tanstack/query-core/build/legacy/chunk-PXG64RU4.js +++ /dev/null @@ -1,25 +0,0 @@ -var __typeError = (msg) => { - throw TypeError(msg); -}; -var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg); -var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj)); -var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value); -var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value); -var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method); -var __privateWrapper = (obj, member, setter, getter) => ({ - set _(value) { - __privateSet(obj, member, value, setter); - }, - get _() { - return __privateGet(obj, member, getter); - } -}); - -export { - __privateGet, - __privateAdd, - __privateSet, - __privateMethod, - __privateWrapper -}; -//# sourceMappingURL=chunk-PXG64RU4.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/chunk-PXG64RU4.js.map b/node_modules/@tanstack/query-core/build/legacy/chunk-PXG64RU4.js.map deleted file mode 100644 index 84c51b2..0000000 --- a/node_modules/@tanstack/query-core/build/legacy/chunk-PXG64RU4.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/focusManager.cjs b/node_modules/@tanstack/query-core/build/legacy/focusManager.cjs deleted file mode 100644 index c2ae467..0000000 --- a/node_modules/@tanstack/query-core/build/legacy/focusManager.cjs +++ /dev/null @@ -1,108 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __typeError = (msg) => { - throw TypeError(msg); -}; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg); -var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj)); -var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value); -var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value); - -// src/focusManager.ts -var focusManager_exports = {}; -__export(focusManager_exports, { - FocusManager: () => FocusManager, - focusManager: () => focusManager -}); -module.exports = __toCommonJS(focusManager_exports); -var import_subscribable = require("./subscribable.cjs"); -var import_utils = require("./utils.cjs"); -var _focused, _cleanup, _setup; -var FocusManager = class extends import_subscribable.Subscribable { - constructor() { - super(); - __privateAdd(this, _focused); - __privateAdd(this, _cleanup); - __privateAdd(this, _setup); - __privateSet(this, _setup, (onFocus) => { - if (!import_utils.isServer && window.addEventListener) { - const listener = () => onFocus(); - window.addEventListener("visibilitychange", listener, false); - return () => { - window.removeEventListener("visibilitychange", listener); - }; - } - return; - }); - } - onSubscribe() { - if (!__privateGet(this, _cleanup)) { - this.setEventListener(__privateGet(this, _setup)); - } - } - onUnsubscribe() { - var _a; - if (!this.hasListeners()) { - (_a = __privateGet(this, _cleanup)) == null ? void 0 : _a.call(this); - __privateSet(this, _cleanup, void 0); - } - } - setEventListener(setup) { - var _a; - __privateSet(this, _setup, setup); - (_a = __privateGet(this, _cleanup)) == null ? void 0 : _a.call(this); - __privateSet(this, _cleanup, setup((focused) => { - if (typeof focused === "boolean") { - this.setFocused(focused); - } else { - this.onFocus(); - } - })); - } - setFocused(focused) { - const changed = __privateGet(this, _focused) !== focused; - if (changed) { - __privateSet(this, _focused, focused); - this.onFocus(); - } - } - onFocus() { - const isFocused = this.isFocused(); - this.listeners.forEach((listener) => { - listener(isFocused); - }); - } - isFocused() { - var _a; - if (typeof __privateGet(this, _focused) === "boolean") { - return __privateGet(this, _focused); - } - return ((_a = globalThis.document) == null ? void 0 : _a.visibilityState) !== "hidden"; - } -}; -_focused = new WeakMap(); -_cleanup = new WeakMap(); -_setup = new WeakMap(); -var focusManager = new FocusManager(); -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - FocusManager, - focusManager -}); -//# sourceMappingURL=focusManager.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/focusManager.cjs.map b/node_modules/@tanstack/query-core/build/legacy/focusManager.cjs.map deleted file mode 100644 index 81db698..0000000 --- a/node_modules/@tanstack/query-core/build/legacy/focusManager.cjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/focusManager.ts"],"sourcesContent":["import { Subscribable } from './subscribable'\nimport { isServer } from './utils'\n\ntype Listener = (focused: boolean) => void\n\ntype SetupFn = (\n setFocused: (focused?: boolean) => void,\n) => (() => void) | undefined\n\nexport class FocusManager extends Subscribable {\n #focused?: boolean\n #cleanup?: () => void\n\n #setup: SetupFn\n\n constructor() {\n super()\n this.#setup = (onFocus) => {\n // addEventListener does not exist in React Native, but window does\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n if (!isServer && window.addEventListener) {\n const listener = () => onFocus()\n // Listen to visibilitychange\n window.addEventListener('visibilitychange', listener, false)\n\n return () => {\n // Be sure to unsubscribe if a new handler is set\n window.removeEventListener('visibilitychange', listener)\n }\n }\n return\n }\n }\n\n protected onSubscribe(): void {\n if (!this.#cleanup) {\n this.setEventListener(this.#setup)\n }\n }\n\n protected onUnsubscribe() {\n if (!this.hasListeners()) {\n this.#cleanup?.()\n this.#cleanup = undefined\n }\n }\n\n setEventListener(setup: SetupFn): void {\n this.#setup = setup\n this.#cleanup?.()\n this.#cleanup = setup((focused) => {\n if (typeof focused === 'boolean') {\n this.setFocused(focused)\n } else {\n this.onFocus()\n }\n })\n }\n\n setFocused(focused?: boolean): void {\n const changed = this.#focused !== focused\n if (changed) {\n this.#focused = focused\n this.onFocus()\n }\n }\n\n onFocus(): void {\n const isFocused = this.isFocused()\n this.listeners.forEach((listener) => {\n listener(isFocused)\n })\n }\n\n isFocused(): boolean {\n if (typeof this.#focused === 'boolean') {\n return this.#focused\n }\n\n // document global can be unavailable in react native\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n return globalThis.document?.visibilityState !== 'hidden'\n }\n}\n\nexport const focusManager = new FocusManager()\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,0BAA6B;AAC7B,mBAAyB;AADzB;AASO,IAAM,eAAN,cAA2B,iCAAuB;AAAA,EAMvD,cAAc;AACZ,UAAM;AANR;AACA;AAEA;AAIE,uBAAK,QAAS,CAAC,YAAY;AAGzB,UAAI,CAAC,yBAAY,OAAO,kBAAkB;AACxC,cAAM,WAAW,MAAM,QAAQ;AAE/B,eAAO,iBAAiB,oBAAoB,UAAU,KAAK;AAE3D,eAAO,MAAM;AAEX,iBAAO,oBAAoB,oBAAoB,QAAQ;AAAA,QACzD;AAAA,MACF;AACA;AAAA,IACF;AAAA,EACF;AAAA,EAEU,cAAoB;AAC5B,QAAI,CAAC,mBAAK,WAAU;AAClB,WAAK,iBAAiB,mBAAK,OAAM;AAAA,IACnC;AAAA,EACF;AAAA,EAEU,gBAAgB;AAxC5B;AAyCI,QAAI,CAAC,KAAK,aAAa,GAAG;AACxB,+BAAK,cAAL;AACA,yBAAK,UAAW;AAAA,IAClB;AAAA,EACF;AAAA,EAEA,iBAAiB,OAAsB;AA/CzC;AAgDI,uBAAK,QAAS;AACd,6BAAK,cAAL;AACA,uBAAK,UAAW,MAAM,CAAC,YAAY;AACjC,UAAI,OAAO,YAAY,WAAW;AAChC,aAAK,WAAW,OAAO;AAAA,MACzB,OAAO;AACL,aAAK,QAAQ;AAAA,MACf;AAAA,IACF,CAAC;AAAA,EACH;AAAA,EAEA,WAAW,SAAyB;AAClC,UAAM,UAAU,mBAAK,cAAa;AAClC,QAAI,SAAS;AACX,yBAAK,UAAW;AAChB,WAAK,QAAQ;AAAA,IACf;AAAA,EACF;AAAA,EAEA,UAAgB;AACd,UAAM,YAAY,KAAK,UAAU;AACjC,SAAK,UAAU,QAAQ,CAAC,aAAa;AACnC,eAAS,SAAS;AAAA,IACpB,CAAC;AAAA,EACH;AAAA,EAEA,YAAqB;AA1EvB;AA2EI,QAAI,OAAO,mBAAK,cAAa,WAAW;AACtC,aAAO,mBAAK;AAAA,IACd;AAIA,aAAO,gBAAW,aAAX,mBAAqB,qBAAoB;AAAA,EAClD;AACF;AAzEE;AACA;AAEA;AAwEK,IAAM,eAAe,IAAI,aAAa;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/focusManager.d.cts b/node_modules/@tanstack/query-core/build/legacy/focusManager.d.cts deleted file mode 100644 index c0f57ac..0000000 --- a/node_modules/@tanstack/query-core/build/legacy/focusManager.d.cts +++ /dev/null @@ -1,17 +0,0 @@ -import { Subscribable } from './subscribable.cjs'; - -type Listener = (focused: boolean) => void; -type SetupFn = (setFocused: (focused?: boolean) => void) => (() => void) | undefined; -declare class FocusManager extends Subscribable { - #private; - constructor(); - protected onSubscribe(): void; - protected onUnsubscribe(): void; - setEventListener(setup: SetupFn): void; - setFocused(focused?: boolean): void; - onFocus(): void; - isFocused(): boolean; -} -declare const focusManager: FocusManager; - -export { FocusManager, focusManager }; diff --git a/node_modules/@tanstack/query-core/build/legacy/focusManager.d.ts b/node_modules/@tanstack/query-core/build/legacy/focusManager.d.ts deleted file mode 100644 index da33a8b..0000000 --- a/node_modules/@tanstack/query-core/build/legacy/focusManager.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { Subscribable } from './subscribable.js'; - -type Listener = (focused: boolean) => void; -type SetupFn = (setFocused: (focused?: boolean) => void) => (() => void) | undefined; -declare class FocusManager extends Subscribable { - #private; - constructor(); - protected onSubscribe(): void; - protected onUnsubscribe(): void; - setEventListener(setup: SetupFn): void; - setFocused(focused?: boolean): void; - onFocus(): void; - isFocused(): boolean; -} -declare const focusManager: FocusManager; - -export { FocusManager, focusManager }; diff --git a/node_modules/@tanstack/query-core/build/legacy/focusManager.js b/node_modules/@tanstack/query-core/build/legacy/focusManager.js deleted file mode 100644 index 515ffbe..0000000 --- a/node_modules/@tanstack/query-core/build/legacy/focusManager.js +++ /dev/null @@ -1,81 +0,0 @@ -import { - __privateAdd, - __privateGet, - __privateSet -} from "./chunk-PXG64RU4.js"; - -// src/focusManager.ts -import { Subscribable } from "./subscribable.js"; -import { isServer } from "./utils.js"; -var _focused, _cleanup, _setup; -var FocusManager = class extends Subscribable { - constructor() { - super(); - __privateAdd(this, _focused); - __privateAdd(this, _cleanup); - __privateAdd(this, _setup); - __privateSet(this, _setup, (onFocus) => { - if (!isServer && window.addEventListener) { - const listener = () => onFocus(); - window.addEventListener("visibilitychange", listener, false); - return () => { - window.removeEventListener("visibilitychange", listener); - }; - } - return; - }); - } - onSubscribe() { - if (!__privateGet(this, _cleanup)) { - this.setEventListener(__privateGet(this, _setup)); - } - } - onUnsubscribe() { - var _a; - if (!this.hasListeners()) { - (_a = __privateGet(this, _cleanup)) == null ? void 0 : _a.call(this); - __privateSet(this, _cleanup, void 0); - } - } - setEventListener(setup) { - var _a; - __privateSet(this, _setup, setup); - (_a = __privateGet(this, _cleanup)) == null ? void 0 : _a.call(this); - __privateSet(this, _cleanup, setup((focused) => { - if (typeof focused === "boolean") { - this.setFocused(focused); - } else { - this.onFocus(); - } - })); - } - setFocused(focused) { - const changed = __privateGet(this, _focused) !== focused; - if (changed) { - __privateSet(this, _focused, focused); - this.onFocus(); - } - } - onFocus() { - const isFocused = this.isFocused(); - this.listeners.forEach((listener) => { - listener(isFocused); - }); - } - isFocused() { - var _a; - if (typeof __privateGet(this, _focused) === "boolean") { - return __privateGet(this, _focused); - } - return ((_a = globalThis.document) == null ? void 0 : _a.visibilityState) !== "hidden"; - } -}; -_focused = new WeakMap(); -_cleanup = new WeakMap(); -_setup = new WeakMap(); -var focusManager = new FocusManager(); -export { - FocusManager, - focusManager -}; -//# sourceMappingURL=focusManager.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/focusManager.js.map b/node_modules/@tanstack/query-core/build/legacy/focusManager.js.map deleted file mode 100644 index 9de77ce..0000000 --- a/node_modules/@tanstack/query-core/build/legacy/focusManager.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/focusManager.ts"],"sourcesContent":["import { Subscribable } from './subscribable'\nimport { isServer } from './utils'\n\ntype Listener = (focused: boolean) => void\n\ntype SetupFn = (\n setFocused: (focused?: boolean) => void,\n) => (() => void) | undefined\n\nexport class FocusManager extends Subscribable {\n #focused?: boolean\n #cleanup?: () => void\n\n #setup: SetupFn\n\n constructor() {\n super()\n this.#setup = (onFocus) => {\n // addEventListener does not exist in React Native, but window does\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n if (!isServer && window.addEventListener) {\n const listener = () => onFocus()\n // Listen to visibilitychange\n window.addEventListener('visibilitychange', listener, false)\n\n return () => {\n // Be sure to unsubscribe if a new handler is set\n window.removeEventListener('visibilitychange', listener)\n }\n }\n return\n }\n }\n\n protected onSubscribe(): void {\n if (!this.#cleanup) {\n this.setEventListener(this.#setup)\n }\n }\n\n protected onUnsubscribe() {\n if (!this.hasListeners()) {\n this.#cleanup?.()\n this.#cleanup = undefined\n }\n }\n\n setEventListener(setup: SetupFn): void {\n this.#setup = setup\n this.#cleanup?.()\n this.#cleanup = setup((focused) => {\n if (typeof focused === 'boolean') {\n this.setFocused(focused)\n } else {\n this.onFocus()\n }\n })\n }\n\n setFocused(focused?: boolean): void {\n const changed = this.#focused !== focused\n if (changed) {\n this.#focused = focused\n this.onFocus()\n }\n }\n\n onFocus(): void {\n const isFocused = this.isFocused()\n this.listeners.forEach((listener) => {\n listener(isFocused)\n })\n }\n\n isFocused(): boolean {\n if (typeof this.#focused === 'boolean') {\n return this.#focused\n }\n\n // document global can be unavailable in react native\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n return globalThis.document?.visibilityState !== 'hidden'\n }\n}\n\nexport const focusManager = new FocusManager()\n"],"mappings":";;;;;;;AAAA,SAAS,oBAAoB;AAC7B,SAAS,gBAAgB;AADzB;AASO,IAAM,eAAN,cAA2B,aAAuB;AAAA,EAMvD,cAAc;AACZ,UAAM;AANR;AACA;AAEA;AAIE,uBAAK,QAAS,CAAC,YAAY;AAGzB,UAAI,CAAC,YAAY,OAAO,kBAAkB;AACxC,cAAM,WAAW,MAAM,QAAQ;AAE/B,eAAO,iBAAiB,oBAAoB,UAAU,KAAK;AAE3D,eAAO,MAAM;AAEX,iBAAO,oBAAoB,oBAAoB,QAAQ;AAAA,QACzD;AAAA,MACF;AACA;AAAA,IACF;AAAA,EACF;AAAA,EAEU,cAAoB;AAC5B,QAAI,CAAC,mBAAK,WAAU;AAClB,WAAK,iBAAiB,mBAAK,OAAM;AAAA,IACnC;AAAA,EACF;AAAA,EAEU,gBAAgB;AAxC5B;AAyCI,QAAI,CAAC,KAAK,aAAa,GAAG;AACxB,+BAAK,cAAL;AACA,yBAAK,UAAW;AAAA,IAClB;AAAA,EACF;AAAA,EAEA,iBAAiB,OAAsB;AA/CzC;AAgDI,uBAAK,QAAS;AACd,6BAAK,cAAL;AACA,uBAAK,UAAW,MAAM,CAAC,YAAY;AACjC,UAAI,OAAO,YAAY,WAAW;AAChC,aAAK,WAAW,OAAO;AAAA,MACzB,OAAO;AACL,aAAK,QAAQ;AAAA,MACf;AAAA,IACF,CAAC;AAAA,EACH;AAAA,EAEA,WAAW,SAAyB;AAClC,UAAM,UAAU,mBAAK,cAAa;AAClC,QAAI,SAAS;AACX,yBAAK,UAAW;AAChB,WAAK,QAAQ;AAAA,IACf;AAAA,EACF;AAAA,EAEA,UAAgB;AACd,UAAM,YAAY,KAAK,UAAU;AACjC,SAAK,UAAU,QAAQ,CAAC,aAAa;AACnC,eAAS,SAAS;AAAA,IACpB,CAAC;AAAA,EACH;AAAA,EAEA,YAAqB;AA1EvB;AA2EI,QAAI,OAAO,mBAAK,cAAa,WAAW;AACtC,aAAO,mBAAK;AAAA,IACd;AAIA,aAAO,gBAAW,aAAX,mBAAqB,qBAAoB;AAAA,EAClD;AACF;AAzEE;AACA;AAEA;AAwEK,IAAM,eAAe,IAAI,aAAa;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/hydration-BlEVG2Lp.d.ts b/node_modules/@tanstack/query-core/build/legacy/hydration-BlEVG2Lp.d.ts deleted file mode 100644 index 8d5a8e3..0000000 --- a/node_modules/@tanstack/query-core/build/legacy/hydration-BlEVG2Lp.d.ts +++ /dev/null @@ -1,1384 +0,0 @@ -import { Removable } from './removable.js'; -import { Subscribable } from './subscribable.js'; - -type QueryObserverListener = (result: QueryObserverResult) => void; -interface ObserverFetchOptions extends FetchOptions { - throwOnError?: boolean; -} -declare class QueryObserver extends Subscribable> { - #private; - options: QueryObserverOptions; - constructor(client: QueryClient, options: QueryObserverOptions); - protected bindMethods(): void; - protected onSubscribe(): void; - protected onUnsubscribe(): void; - shouldFetchOnReconnect(): boolean; - shouldFetchOnWindowFocus(): boolean; - destroy(): void; - setOptions(options: QueryObserverOptions): void; - getOptimisticResult(options: DefaultedQueryObserverOptions): QueryObserverResult; - getCurrentResult(): QueryObserverResult; - trackResult(result: QueryObserverResult, onPropTracked?: (key: keyof QueryObserverResult) => void): QueryObserverResult; - trackProp(key: keyof QueryObserverResult): void; - getCurrentQuery(): Query; - refetch({ ...options }?: RefetchOptions): Promise>; - fetchOptimistic(options: QueryObserverOptions): Promise>; - protected fetch(fetchOptions: ObserverFetchOptions): Promise>; - protected createResult(query: Query, options: QueryObserverOptions): QueryObserverResult; - updateResult(): void; - onQueryUpdate(): void; -} - -interface QueryConfig { - client: QueryClient; - queryKey: TQueryKey; - queryHash: string; - options?: QueryOptions; - defaultOptions?: QueryOptions; - state?: QueryState; -} -interface QueryState { - data: TData | undefined; - dataUpdateCount: number; - dataUpdatedAt: number; - error: TError | null; - errorUpdateCount: number; - errorUpdatedAt: number; - fetchFailureCount: number; - fetchFailureReason: TError | null; - fetchMeta: FetchMeta | null; - isInvalidated: boolean; - status: QueryStatus; - fetchStatus: FetchStatus; -} -interface FetchContext { - fetchFn: () => unknown | Promise; - fetchOptions?: FetchOptions; - signal: AbortSignal; - options: QueryOptions; - client: QueryClient; - queryKey: TQueryKey; - state: QueryState; -} -interface QueryBehavior { - onFetch: (context: FetchContext, query: Query) => void; -} -type FetchDirection = 'forward' | 'backward'; -interface FetchMeta { - fetchMore?: { - direction: FetchDirection; - }; -} -interface FetchOptions { - cancelRefetch?: boolean; - meta?: FetchMeta; - initialPromise?: Promise; -} -interface FailedAction$1 { - type: 'failed'; - failureCount: number; - error: TError; -} -interface FetchAction { - type: 'fetch'; - meta?: FetchMeta; -} -interface SuccessAction$1 { - data: TData | undefined; - type: 'success'; - dataUpdatedAt?: number; - manual?: boolean; -} -interface ErrorAction$1 { - type: 'error'; - error: TError; -} -interface InvalidateAction { - type: 'invalidate'; -} -interface PauseAction$1 { - type: 'pause'; -} -interface ContinueAction$1 { - type: 'continue'; -} -interface SetStateAction { - type: 'setState'; - state: Partial>; - setStateOptions?: SetStateOptions; -} -type Action$1 = ContinueAction$1 | ErrorAction$1 | FailedAction$1 | FetchAction | InvalidateAction | PauseAction$1 | SetStateAction | SuccessAction$1; -interface SetStateOptions { - meta?: any; -} -declare class Query extends Removable { - #private; - queryKey: TQueryKey; - queryHash: string; - options: QueryOptions; - state: QueryState; - observers: Array>; - constructor(config: QueryConfig); - get meta(): QueryMeta | undefined; - get promise(): Promise | undefined; - setOptions(options?: QueryOptions): void; - protected optionalRemove(): void; - setData(newData: TData, options?: SetDataOptions & { - manual: boolean; - }): TData; - setState(state: Partial>, setStateOptions?: SetStateOptions): void; - cancel(options?: CancelOptions): Promise; - destroy(): void; - reset(): void; - isActive(): boolean; - isDisabled(): boolean; - isStatic(): boolean; - isStale(): boolean; - isStaleByTime(staleTime?: StaleTime): boolean; - onFocus(): void; - onOnline(): void; - addObserver(observer: QueryObserver): void; - removeObserver(observer: QueryObserver): void; - getObserversCount(): number; - invalidate(): void; - fetch(options?: QueryOptions, fetchOptions?: FetchOptions): Promise; -} -declare function fetchState(data: TData | undefined, options: QueryOptions): { - readonly error?: null | undefined; - readonly status?: "pending" | undefined; - readonly fetchFailureCount: 0; - readonly fetchFailureReason: null; - readonly fetchStatus: "fetching" | "paused"; -}; - -type MutationObserverListener = (result: MutationObserverResult) => void; -declare class MutationObserver extends Subscribable> { - #private; - options: MutationObserverOptions; - constructor(client: QueryClient, options: MutationObserverOptions); - protected bindMethods(): void; - setOptions(options: MutationObserverOptions): void; - protected onUnsubscribe(): void; - onMutationUpdate(action: Action): void; - getCurrentResult(): MutationObserverResult; - reset(): void; - mutate(variables: TVariables, options?: MutateOptions): Promise; -} - -interface MutationCacheConfig { - onError?: (error: DefaultError, variables: unknown, onMutateResult: unknown, mutation: Mutation, context: MutationFunctionContext) => Promise | unknown; - onSuccess?: (data: unknown, variables: unknown, onMutateResult: unknown, mutation: Mutation, context: MutationFunctionContext) => Promise | unknown; - onMutate?: (variables: unknown, mutation: Mutation, context: MutationFunctionContext) => Promise | unknown; - onSettled?: (data: unknown | undefined, error: DefaultError | null, variables: unknown, onMutateResult: unknown, mutation: Mutation, context: MutationFunctionContext) => Promise | unknown; -} -interface NotifyEventMutationAdded extends NotifyEvent { - type: 'added'; - mutation: Mutation; -} -interface NotifyEventMutationRemoved extends NotifyEvent { - type: 'removed'; - mutation: Mutation; -} -interface NotifyEventMutationObserverAdded extends NotifyEvent { - type: 'observerAdded'; - mutation: Mutation; - observer: MutationObserver; -} -interface NotifyEventMutationObserverRemoved extends NotifyEvent { - type: 'observerRemoved'; - mutation: Mutation; - observer: MutationObserver; -} -interface NotifyEventMutationObserverOptionsUpdated extends NotifyEvent { - type: 'observerOptionsUpdated'; - mutation?: Mutation; - observer: MutationObserver; -} -interface NotifyEventMutationUpdated extends NotifyEvent { - type: 'updated'; - mutation: Mutation; - action: Action; -} -type MutationCacheNotifyEvent = NotifyEventMutationAdded | NotifyEventMutationRemoved | NotifyEventMutationObserverAdded | NotifyEventMutationObserverRemoved | NotifyEventMutationObserverOptionsUpdated | NotifyEventMutationUpdated; -type MutationCacheListener = (event: MutationCacheNotifyEvent) => void; -declare class MutationCache extends Subscribable { - #private; - config: MutationCacheConfig; - constructor(config?: MutationCacheConfig); - build(client: QueryClient, options: MutationOptions, state?: MutationState): Mutation; - add(mutation: Mutation): void; - remove(mutation: Mutation): void; - canRun(mutation: Mutation): boolean; - runNext(mutation: Mutation): Promise; - clear(): void; - getAll(): Array; - find(filters: MutationFilters): Mutation | undefined; - findAll(filters?: MutationFilters): Array; - notify(event: MutationCacheNotifyEvent): void; - resumePausedMutations(): Promise; -} - -interface MutationConfig { - client: QueryClient; - mutationId: number; - mutationCache: MutationCache; - options: MutationOptions; - state?: MutationState; -} -interface MutationState { - context: TOnMutateResult | undefined; - data: TData | undefined; - error: TError | null; - failureCount: number; - failureReason: TError | null; - isPaused: boolean; - status: MutationStatus; - variables: TVariables | undefined; - submittedAt: number; -} -interface FailedAction { - type: 'failed'; - failureCount: number; - error: TError | null; -} -interface PendingAction { - type: 'pending'; - isPaused: boolean; - variables?: TVariables; - context?: TOnMutateResult; -} -interface SuccessAction { - type: 'success'; - data: TData; -} -interface ErrorAction { - type: 'error'; - error: TError; -} -interface PauseAction { - type: 'pause'; -} -interface ContinueAction { - type: 'continue'; -} -type Action = ContinueAction | ErrorAction | FailedAction | PendingAction | PauseAction | SuccessAction; -declare class Mutation extends Removable { - #private; - state: MutationState; - options: MutationOptions; - readonly mutationId: number; - constructor(config: MutationConfig); - setOptions(options: MutationOptions): void; - get meta(): MutationMeta | undefined; - addObserver(observer: MutationObserver): void; - removeObserver(observer: MutationObserver): void; - protected optionalRemove(): void; - continue(): Promise; - execute(variables: TVariables): Promise; -} -declare function getDefaultState(): MutationState; - -type DropLast> = T extends readonly [ - ...infer R, - unknown -] ? readonly [...R] : never; -type TuplePrefixes> = T extends readonly [] ? readonly [] : TuplePrefixes> | T; -interface QueryFilters { - /** - * Filter to active queries, inactive queries or all queries - */ - type?: QueryTypeFilter; - /** - * Match query key exactly - */ - exact?: boolean; - /** - * Include queries matching this predicate function - */ - predicate?: (query: Query) => boolean; - /** - * Include queries matching this query key - */ - queryKey?: TQueryKey | TuplePrefixes; - /** - * Include or exclude stale queries - */ - stale?: boolean; - /** - * Include queries matching their fetchStatus - */ - fetchStatus?: FetchStatus; -} -interface MutationFilters { - /** - * Match mutation key exactly - */ - exact?: boolean; - /** - * Include mutations matching this predicate function - */ - predicate?: (mutation: Mutation) => boolean; - /** - * Include mutations matching this mutation key - */ - mutationKey?: TuplePrefixes; - /** - * Filter by mutation status - */ - status?: MutationStatus; -} -type Updater = TOutput | ((input: TInput) => TOutput); -type QueryTypeFilter = 'all' | 'active' | 'inactive'; -declare const isServer: boolean; -declare function noop(): void; -declare function noop(): undefined; -declare function functionalUpdate(updater: Updater, input: TInput): TOutput; -declare function isValidTimeout(value: unknown): value is number; -declare function timeUntilStale(updatedAt: number, staleTime?: number): number; -declare function resolveStaleTime(staleTime: undefined | StaleTimeFunction, query: Query): StaleTime | undefined; -declare function resolveEnabled(enabled: undefined | Enabled, query: Query): boolean | undefined; -declare function matchQuery(filters: QueryFilters, query: Query): boolean; -declare function matchMutation(filters: MutationFilters, mutation: Mutation): boolean; -declare function hashQueryKeyByOptions(queryKey: TQueryKey, options?: Pick, 'queryKeyHashFn'>): string; -/** - * Default query & mutation keys hash function. - * Hashes the value into a stable hash. - */ -declare function hashKey(queryKey: QueryKey | MutationKey): string; -/** - * Checks if key `b` partially matches with key `a`. - */ -declare function partialMatchKey(a: QueryKey, b: QueryKey): boolean; -/** - * This function returns `a` if `b` is deeply equal. - * If not, it will replace any deeply equal children of `b` with those of `a`. - * This can be used for structural sharing between JSON values for example. - */ -declare function replaceEqualDeep(a: unknown, b: T, depth?: number): T; -/** - * Shallow compare objects. - */ -declare function shallowEqualObjects>(a: T, b: T | undefined): boolean; -declare function isPlainArray(value: unknown): value is Array; -declare function isPlainObject(o: any): o is Record; -declare function sleep(timeout: number): Promise; -declare function replaceData>(prevData: TData | undefined, data: TData, options: TOptions): TData; -declare function keepPreviousData(previousData: T | undefined): T | undefined; -declare function addToEnd(items: Array, item: T, max?: number): Array; -declare function addToStart(items: Array, item: T, max?: number): Array; -declare const skipToken: unique symbol; -type SkipToken = typeof skipToken; -declare function ensureQueryFn(options: { - queryFn?: QueryFunction | SkipToken; - queryHash?: string; -}, fetchOptions?: FetchOptions): QueryFunction; -declare function shouldThrowError) => boolean>(throwOnError: boolean | T | undefined, params: Parameters): boolean; -declare function addConsumeAwareSignal(object: T, getSignal: () => AbortSignal, onCancelled: VoidFunction): T & { - signal: AbortSignal; -}; - -interface QueryCacheConfig { - onError?: (error: DefaultError, query: Query) => void; - onSuccess?: (data: unknown, query: Query) => void; - onSettled?: (data: unknown | undefined, error: DefaultError | null, query: Query) => void; -} -interface NotifyEventQueryAdded extends NotifyEvent { - type: 'added'; - query: Query; -} -interface NotifyEventQueryRemoved extends NotifyEvent { - type: 'removed'; - query: Query; -} -interface NotifyEventQueryUpdated extends NotifyEvent { - type: 'updated'; - query: Query; - action: Action$1; -} -interface NotifyEventQueryObserverAdded extends NotifyEvent { - type: 'observerAdded'; - query: Query; - observer: QueryObserver; -} -interface NotifyEventQueryObserverRemoved extends NotifyEvent { - type: 'observerRemoved'; - query: Query; - observer: QueryObserver; -} -interface NotifyEventQueryObserverResultsUpdated extends NotifyEvent { - type: 'observerResultsUpdated'; - query: Query; -} -interface NotifyEventQueryObserverOptionsUpdated extends NotifyEvent { - type: 'observerOptionsUpdated'; - query: Query; - observer: QueryObserver; -} -type QueryCacheNotifyEvent = NotifyEventQueryAdded | NotifyEventQueryRemoved | NotifyEventQueryUpdated | NotifyEventQueryObserverAdded | NotifyEventQueryObserverRemoved | NotifyEventQueryObserverResultsUpdated | NotifyEventQueryObserverOptionsUpdated; -type QueryCacheListener = (event: QueryCacheNotifyEvent) => void; -interface QueryStore { - has: (queryHash: string) => boolean; - set: (queryHash: string, query: Query) => void; - get: (queryHash: string) => Query | undefined; - delete: (queryHash: string) => void; - values: () => IterableIterator; -} -declare class QueryCache extends Subscribable { - #private; - config: QueryCacheConfig; - constructor(config?: QueryCacheConfig); - build(client: QueryClient, options: WithRequired, 'queryKey'>, state?: QueryState): Query; - add(query: Query): void; - remove(query: Query): void; - clear(): void; - get(queryHash: string): Query | undefined; - getAll(): Array; - find(filters: WithRequired): Query | undefined; - findAll(filters?: QueryFilters): Array; - notify(event: QueryCacheNotifyEvent): void; - onFocus(): void; - onOnline(): void; -} - -declare class QueryClient { - #private; - constructor(config?: QueryClientConfig); - mount(): void; - unmount(): void; - isFetching = QueryFilters>(filters?: TQueryFilters): number; - isMutating = MutationFilters>(filters?: TMutationFilters): number; - /** - * Imperative (non-reactive) way to retrieve data for a QueryKey. - * Should only be used in callbacks or functions where reading the latest data is necessary, e.g. for optimistic updates. - * - * Hint: Do not use this function inside a component, because it won't receive updates. - * Use `useQuery` to create a `QueryObserver` that subscribes to changes. - */ - getQueryData>(queryKey: TTaggedQueryKey): TInferredQueryFnData | undefined; - ensureQueryData(options: EnsureQueryDataOptions): Promise; - getQueriesData = QueryFilters>(filters: TQueryFilters): Array<[QueryKey, TQueryFnData | undefined]>; - setQueryData>(queryKey: TTaggedQueryKey, updater: Updater | undefined, NoInfer | undefined>, options?: SetDataOptions): NoInfer | undefined; - setQueriesData = QueryFilters>(filters: TQueryFilters, updater: Updater | undefined, NoInfer | undefined>, options?: SetDataOptions): Array<[QueryKey, TQueryFnData | undefined]>; - getQueryState, TInferredError = InferErrorFromTag>(queryKey: TTaggedQueryKey): QueryState | undefined; - removeQueries(filters?: QueryFilters): void; - resetQueries(filters?: QueryFilters, options?: ResetOptions): Promise; - cancelQueries(filters?: QueryFilters, cancelOptions?: CancelOptions): Promise; - invalidateQueries(filters?: InvalidateQueryFilters, options?: InvalidateOptions): Promise; - refetchQueries(filters?: RefetchQueryFilters, options?: RefetchOptions): Promise; - fetchQuery(options: FetchQueryOptions): Promise; - prefetchQuery(options: FetchQueryOptions): Promise; - fetchInfiniteQuery(options: FetchInfiniteQueryOptions): Promise>; - prefetchInfiniteQuery(options: FetchInfiniteQueryOptions): Promise; - ensureInfiniteQueryData(options: EnsureInfiniteQueryDataOptions): Promise>; - resumePausedMutations(): Promise; - getQueryCache(): QueryCache; - getMutationCache(): MutationCache; - getDefaultOptions(): DefaultOptions; - setDefaultOptions(options: DefaultOptions): void; - setQueryDefaults(queryKey: QueryKey, options: Partial, 'queryKey'>>): void; - getQueryDefaults(queryKey: QueryKey): OmitKeyof, 'queryKey'>; - setMutationDefaults(mutationKey: MutationKey, options: OmitKeyof, 'mutationKey'>): void; - getMutationDefaults(mutationKey: MutationKey): OmitKeyof, 'mutationKey'>; - defaultQueryOptions(options: QueryObserverOptions | DefaultedQueryObserverOptions): DefaultedQueryObserverOptions; - defaultMutationOptions>(options?: T): T; - clear(): void; -} - -interface RetryerConfig { - fn: () => TData | Promise; - initialPromise?: Promise; - onCancel?: (error: TError) => void; - onFail?: (failureCount: number, error: TError) => void; - onPause?: () => void; - onContinue?: () => void; - retry?: RetryValue; - retryDelay?: RetryDelayValue; - networkMode: NetworkMode | undefined; - canRun: () => boolean; -} -interface Retryer { - promise: Promise; - cancel: (cancelOptions?: CancelOptions) => void; - continue: () => Promise; - cancelRetry: () => void; - continueRetry: () => void; - canStart: () => boolean; - start: () => Promise; - status: () => 'pending' | 'resolved' | 'rejected'; -} -type RetryValue = boolean | number | ShouldRetryFunction; -type ShouldRetryFunction = (failureCount: number, error: TError) => boolean; -type RetryDelayValue = number | RetryDelayFunction; -type RetryDelayFunction = (failureCount: number, error: TError) => number; -declare function canFetch(networkMode: NetworkMode | undefined): boolean; -declare class CancelledError extends Error { - revert?: boolean; - silent?: boolean; - constructor(options?: CancelOptions); -} -/** - * @deprecated Use instanceof `CancelledError` instead. - */ -declare function isCancelledError(value: any): value is CancelledError; -declare function createRetryer(config: RetryerConfig): Retryer; - -type NonUndefinedGuard = T extends undefined ? never : T; -type DistributiveOmit = TObject extends any ? Omit : never; -type OmitKeyof) | (number & Record) | (symbol & Record) : keyof TObject, TStrictly extends 'strictly' | 'safely' = 'strictly'> = Omit; -type Override = { - [AKey in keyof TTargetA]: AKey extends keyof TTargetB ? TTargetB[AKey] : TTargetA[AKey]; -}; -type NoInfer = [T][T extends any ? 0 : never]; -interface Register { -} -type DefaultError = Register extends { - defaultError: infer TError; -} ? TError : Error; -type QueryKey = Register extends { - queryKey: infer TQueryKey; -} ? TQueryKey extends ReadonlyArray ? TQueryKey : TQueryKey extends Array ? TQueryKey : ReadonlyArray : ReadonlyArray; -declare const dataTagSymbol: unique symbol; -type dataTagSymbol = typeof dataTagSymbol; -declare const dataTagErrorSymbol: unique symbol; -type dataTagErrorSymbol = typeof dataTagErrorSymbol; -declare const unsetMarker: unique symbol; -type UnsetMarker = typeof unsetMarker; -type AnyDataTag = { - [dataTagSymbol]: any; - [dataTagErrorSymbol]: any; -}; -type DataTag = TType extends AnyDataTag ? TType : TType & { - [dataTagSymbol]: TValue; - [dataTagErrorSymbol]: TError; -}; -type InferDataFromTag = TTaggedQueryKey extends DataTag ? TaggedValue : TQueryFnData; -type InferErrorFromTag = TTaggedQueryKey extends DataTag ? TaggedError extends UnsetMarker ? TError : TaggedError : TError; -type QueryFunction = (context: QueryFunctionContext) => T | Promise; -type StaleTime = number | 'static'; -type StaleTimeFunction = StaleTime | ((query: Query) => StaleTime); -type Enabled = boolean | ((query: Query) => boolean); -type QueryPersister = [TPageParam] extends [never] ? (queryFn: QueryFunction, context: QueryFunctionContext, query: Query) => T | Promise : (queryFn: QueryFunction, context: QueryFunctionContext, query: Query) => T | Promise; -type QueryFunctionContext = [TPageParam] extends [never] ? { - client: QueryClient; - queryKey: TQueryKey; - signal: AbortSignal; - meta: QueryMeta | undefined; - pageParam?: unknown; - /** - * @deprecated - * if you want access to the direction, you can add it to the pageParam - */ - direction?: unknown; -} : { - client: QueryClient; - queryKey: TQueryKey; - signal: AbortSignal; - pageParam: TPageParam; - /** - * @deprecated - * if you want access to the direction, you can add it to the pageParam - */ - direction: FetchDirection; - meta: QueryMeta | undefined; -}; -type InitialDataFunction = () => T | undefined; -type NonFunctionGuard = T extends Function ? never : T; -type PlaceholderDataFunction = (previousData: TQueryData | undefined, previousQuery: Query | undefined) => TQueryData | undefined; -type QueriesPlaceholderDataFunction = (previousData: undefined, previousQuery: undefined) => TQueryData | undefined; -type QueryKeyHashFunction = (queryKey: TQueryKey) => string; -type GetPreviousPageParamFunction = (firstPage: TQueryFnData, allPages: Array, firstPageParam: TPageParam, allPageParams: Array) => TPageParam | undefined | null; -type GetNextPageParamFunction = (lastPage: TQueryFnData, allPages: Array, lastPageParam: TPageParam, allPageParams: Array) => TPageParam | undefined | null; -interface InfiniteData { - pages: Array; - pageParams: Array; -} -type QueryMeta = Register extends { - queryMeta: infer TQueryMeta; -} ? TQueryMeta extends Record ? TQueryMeta : Record : Record; -type NetworkMode = 'online' | 'always' | 'offlineFirst'; -type NotifyOnChangeProps = Array | 'all' | undefined | (() => Array | 'all' | undefined); -interface QueryOptions { - /** - * If `false`, failed queries will not retry by default. - * If `true`, failed queries will retry infinitely., failureCount: num - * If set to an integer number, e.g. 3, failed queries will retry until the failed query count meets that number. - * If set to a function `(failureCount, error) => boolean` failed queries will retry until the function returns false. - */ - retry?: RetryValue; - retryDelay?: RetryDelayValue; - networkMode?: NetworkMode; - /** - * The time in milliseconds that unused/inactive cache data remains in memory. - * When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration. - * When different garbage collection times are specified, the longest one will be used. - * Setting it to `Infinity` will disable garbage collection. - */ - gcTime?: number; - queryFn?: QueryFunction | SkipToken; - persister?: QueryPersister, NoInfer, NoInfer>; - queryHash?: string; - queryKey?: TQueryKey; - queryKeyHashFn?: QueryKeyHashFunction; - initialData?: TData | InitialDataFunction; - initialDataUpdatedAt?: number | (() => number | undefined); - behavior?: QueryBehavior; - /** - * Set this to `false` to disable structural sharing between query results. - * Set this to a function which accepts the old and new data and returns resolved data of the same type to implement custom structural sharing logic. - * Defaults to `true`. - */ - structuralSharing?: boolean | ((oldData: unknown | undefined, newData: unknown) => unknown); - _defaulted?: boolean; - /** - * Additional payload to be stored on each query. - * Use this property to pass information that can be used in other places. - */ - meta?: QueryMeta; - /** - * Maximum number of pages to store in the data of an infinite query. - */ - maxPages?: number; -} -interface InitialPageParam { - initialPageParam: TPageParam; -} -interface InfiniteQueryPageParamsOptions extends InitialPageParam { - /** - * This function can be set to automatically get the previous cursor for infinite queries. - * The result will also be used to determine the value of `hasPreviousPage`. - */ - getPreviousPageParam?: GetPreviousPageParamFunction; - /** - * This function can be set to automatically get the next cursor for infinite queries. - * The result will also be used to determine the value of `hasNextPage`. - */ - getNextPageParam: GetNextPageParamFunction; -} -type ThrowOnError = boolean | ((error: TError, query: Query) => boolean); -interface QueryObserverOptions extends WithRequired, 'queryKey'> { - /** - * Set this to `false` or a function that returns `false` to disable automatic refetching when the query mounts or changes query keys. - * To refetch the query, use the `refetch` method returned from the `useQuery` instance. - * Accepts a boolean or function that returns a boolean. - * Defaults to `true`. - */ - enabled?: Enabled; - /** - * The time in milliseconds after data is considered stale. - * If set to `Infinity`, the data will never be considered stale. - * If set to a function, the function will be executed with the query to compute a `staleTime`. - * Defaults to `0`. - */ - staleTime?: StaleTimeFunction; - /** - * If set to a number, the query will continuously refetch at this frequency in milliseconds. - * If set to a function, the function will be executed with the latest data and query to compute a frequency - * Defaults to `false`. - */ - refetchInterval?: number | false | ((query: Query) => number | false | undefined); - /** - * If set to `true`, the query will continue to refetch while their tab/window is in the background. - * Defaults to `false`. - */ - refetchIntervalInBackground?: boolean; - /** - * If set to `true`, the query will refetch on window focus if the data is stale. - * If set to `false`, the query will not refetch on window focus. - * If set to `'always'`, the query will always refetch on window focus. - * If set to a function, the function will be executed with the latest data and query to compute the value. - * Defaults to `true`. - */ - refetchOnWindowFocus?: boolean | 'always' | ((query: Query) => boolean | 'always'); - /** - * If set to `true`, the query will refetch on reconnect if the data is stale. - * If set to `false`, the query will not refetch on reconnect. - * If set to `'always'`, the query will always refetch on reconnect. - * If set to a function, the function will be executed with the latest data and query to compute the value. - * Defaults to the value of `networkOnline` (`true`) - */ - refetchOnReconnect?: boolean | 'always' | ((query: Query) => boolean | 'always'); - /** - * If set to `true`, the query will refetch on mount if the data is stale. - * If set to `false`, will disable additional instances of a query to trigger background refetch. - * If set to `'always'`, the query will always refetch on mount. - * If set to a function, the function will be executed with the latest data and query to compute the value - * Defaults to `true`. - */ - refetchOnMount?: boolean | 'always' | ((query: Query) => boolean | 'always'); - /** - * If set to `false`, the query will not be retried on mount if it contains an error. - * Defaults to `true`. - */ - retryOnMount?: boolean; - /** - * If set, the component will only re-render if any of the listed properties change. - * When set to `['data', 'error']`, the component will only re-render when the `data` or `error` properties change. - * When set to `'all'`, the component will re-render whenever a query is updated. - * When set to a function, the function will be executed to compute the list of properties. - * By default, access to properties will be tracked, and the component will only re-render when one of the tracked properties change. - */ - notifyOnChangeProps?: NotifyOnChangeProps; - /** - * Whether errors should be thrown instead of setting the `error` property. - * If set to `true` or `suspense` is `true`, all errors will be thrown to the error boundary. - * If set to `false` and `suspense` is `false`, errors are returned as state. - * If set to a function, it will be passed the error and the query, and it should return a boolean indicating whether to show the error in an error boundary (`true`) or return the error as state (`false`). - * Defaults to `false`. - */ - throwOnError?: ThrowOnError; - /** - * This option can be used to transform or select a part of the data returned by the query function. - */ - select?: (data: TQueryData) => TData; - /** - * If set to `true`, the query will suspend when `status === 'pending'` - * and throw errors when `status === 'error'`. - * Defaults to `false`. - */ - suspense?: boolean; - /** - * If set, this value will be used as the placeholder data for this particular query observer while the query is still in the `loading` data and no initialData has been provided. - */ - placeholderData?: NonFunctionGuard | PlaceholderDataFunction, TError, NonFunctionGuard, TQueryKey>; - _optimisticResults?: 'optimistic' | 'isRestoring'; - /** - * Enable prefetching during rendering - */ - experimental_prefetchInRender?: boolean; -} -type WithRequired = TTarget & { - [_ in TKey]: {}; -}; -type DefaultedQueryObserverOptions = WithRequired, 'throwOnError' | 'refetchOnReconnect' | 'queryHash'>; -interface InfiniteQueryObserverOptions extends QueryObserverOptions, TQueryKey, TPageParam>, InfiniteQueryPageParamsOptions { -} -type DefaultedInfiniteQueryObserverOptions = WithRequired, 'throwOnError' | 'refetchOnReconnect' | 'queryHash'>; -interface FetchQueryOptions extends WithRequired, 'queryKey'> { - initialPageParam?: never; - /** - * The time in milliseconds after data is considered stale. - * If the data is fresh it will be returned from the cache. - */ - staleTime?: StaleTimeFunction; -} -interface EnsureQueryDataOptions extends FetchQueryOptions { - revalidateIfStale?: boolean; -} -type EnsureInfiniteQueryDataOptions = FetchInfiniteQueryOptions & { - revalidateIfStale?: boolean; -}; -type FetchInfiniteQueryPages = { - pages?: never; -} | { - pages: number; - getNextPageParam: GetNextPageParamFunction; -}; -type FetchInfiniteQueryOptions = Omit, TQueryKey, TPageParam>, 'initialPageParam'> & InitialPageParam & FetchInfiniteQueryPages; -interface ResultOptions { - throwOnError?: boolean; -} -interface RefetchOptions extends ResultOptions { - /** - * If set to `true`, a currently running request will be cancelled before a new request is made - * - * If set to `false`, no refetch will be made if there is already a request running. - * - * Defaults to `true`. - */ - cancelRefetch?: boolean; -} -interface InvalidateQueryFilters extends QueryFilters { - refetchType?: QueryTypeFilter | 'none'; -} -interface RefetchQueryFilters extends QueryFilters { -} -interface InvalidateOptions extends RefetchOptions { -} -interface ResetOptions extends RefetchOptions { -} -interface FetchNextPageOptions extends ResultOptions { - /** - * If set to `true`, calling `fetchNextPage` repeatedly will invoke `queryFn` every time, - * whether the previous invocation has resolved or not. Also, the result from previous invocations will be ignored. - * - * If set to `false`, calling `fetchNextPage` repeatedly won't have any effect until the first invocation has resolved. - * - * Defaults to `true`. - */ - cancelRefetch?: boolean; -} -interface FetchPreviousPageOptions extends ResultOptions { - /** - * If set to `true`, calling `fetchPreviousPage` repeatedly will invoke `queryFn` every time, - * whether the previous invocation has resolved or not. Also, the result from previous invocations will be ignored. - * - * If set to `false`, calling `fetchPreviousPage` repeatedly won't have any effect until the first invocation has resolved. - * - * Defaults to `true`. - */ - cancelRefetch?: boolean; -} -type QueryStatus = 'pending' | 'error' | 'success'; -type FetchStatus = 'fetching' | 'paused' | 'idle'; -interface QueryObserverBaseResult { - /** - * The last successfully resolved data for the query. - */ - data: TData | undefined; - /** - * The timestamp for when the query most recently returned the `status` as `"success"`. - */ - dataUpdatedAt: number; - /** - * The error object for the query, if an error was thrown. - * - Defaults to `null`. - */ - error: TError | null; - /** - * The timestamp for when the query most recently returned the `status` as `"error"`. - */ - errorUpdatedAt: number; - /** - * The failure count for the query. - * - Incremented every time the query fails. - * - Reset to `0` when the query succeeds. - */ - failureCount: number; - /** - * The failure reason for the query retry. - * - Reset to `null` when the query succeeds. - */ - failureReason: TError | null; - /** - * The sum of all errors. - */ - errorUpdateCount: number; - /** - * A derived boolean from the `status` variable, provided for convenience. - * - `true` if the query attempt resulted in an error. - */ - isError: boolean; - /** - * Will be `true` if the query has been fetched. - */ - isFetched: boolean; - /** - * Will be `true` if the query has been fetched after the component mounted. - * - This property can be used to not show any previously cached data. - */ - isFetchedAfterMount: boolean; - /** - * A derived boolean from the `fetchStatus` variable, provided for convenience. - * - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. - */ - isFetching: boolean; - /** - * Is `true` whenever the first fetch for a query is in-flight. - * - Is the same as `isFetching && isPending`. - */ - isLoading: boolean; - /** - * Will be `pending` if there's no cached data and no query attempt was finished yet. - */ - isPending: boolean; - /** - * Will be `true` if the query failed while fetching for the first time. - */ - isLoadingError: boolean; - /** - * @deprecated `isInitialLoading` is being deprecated in favor of `isLoading` - * and will be removed in the next major version. - */ - isInitialLoading: boolean; - /** - * A derived boolean from the `fetchStatus` variable, provided for convenience. - * - The query wanted to fetch, but has been `paused`. - */ - isPaused: boolean; - /** - * Will be `true` if the data shown is the placeholder data. - */ - isPlaceholderData: boolean; - /** - * Will be `true` if the query failed while refetching. - */ - isRefetchError: boolean; - /** - * Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - * - Is the same as `isFetching && !isPending`. - */ - isRefetching: boolean; - /** - * Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. - */ - isStale: boolean; - /** - * A derived boolean from the `status` variable, provided for convenience. - * - `true` if the query has received a response with no errors and is ready to display its data. - */ - isSuccess: boolean; - /** - * `true` if this observer is enabled, `false` otherwise. - */ - isEnabled: boolean; - /** - * A function to manually refetch the query. - */ - refetch: (options?: RefetchOptions) => Promise>; - /** - * The status of the query. - * - Will be: - * - `pending` if there's no cached data and no query attempt was finished yet. - * - `error` if the query attempt resulted in an error. - * - `success` if the query has received a response with no errors and is ready to display its data. - */ - status: QueryStatus; - /** - * The fetch status of the query. - * - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. - * - `paused`: The query wanted to fetch, but has been `paused`. - * - `idle`: The query is not fetching. - * - See [Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information. - */ - fetchStatus: FetchStatus; - /** - * A stable promise that will be resolved with the data of the query. - * Requires the `experimental_prefetchInRender` feature flag to be enabled. - * @example - * - * ### Enabling the feature flag - * ```ts - * const client = new QueryClient({ - * defaultOptions: { - * queries: { - * experimental_prefetchInRender: true, - * }, - * }, - * }) - * ``` - * - * ### Usage - * ```tsx - * import { useQuery } from '@tanstack/react-query' - * import React from 'react' - * import { fetchTodos, type Todo } from './api' - * - * function TodoList({ query }: { query: UseQueryResult }) { - * const data = React.use(query.promise) - * - * return ( - *
    - * {data.map(todo => ( - *
  • {todo.title}
  • - * ))} - *
- * ) - * } - * - * export function App() { - * const query = useQuery({ queryKey: ['todos'], queryFn: fetchTodos }) - * - * return ( - * <> - *

Todos

- * Loading...}> - * - * - * - * ) - * } - * ``` - */ - promise: Promise; -} -interface QueryObserverPendingResult extends QueryObserverBaseResult { - data: undefined; - error: null; - isError: false; - isPending: true; - isLoadingError: false; - isRefetchError: false; - isSuccess: false; - isPlaceholderData: false; - status: 'pending'; -} -interface QueryObserverLoadingResult extends QueryObserverBaseResult { - data: undefined; - error: null; - isError: false; - isPending: true; - isLoading: true; - isLoadingError: false; - isRefetchError: false; - isSuccess: false; - isPlaceholderData: false; - status: 'pending'; -} -interface QueryObserverLoadingErrorResult extends QueryObserverBaseResult { - data: undefined; - error: TError; - isError: true; - isPending: false; - isLoading: false; - isLoadingError: true; - isRefetchError: false; - isSuccess: false; - isPlaceholderData: false; - status: 'error'; -} -interface QueryObserverRefetchErrorResult extends QueryObserverBaseResult { - data: TData; - error: TError; - isError: true; - isPending: false; - isLoading: false; - isLoadingError: false; - isRefetchError: true; - isSuccess: false; - isPlaceholderData: false; - status: 'error'; -} -interface QueryObserverSuccessResult extends QueryObserverBaseResult { - data: TData; - error: null; - isError: false; - isPending: false; - isLoading: false; - isLoadingError: false; - isRefetchError: false; - isSuccess: true; - isPlaceholderData: false; - status: 'success'; -} -interface QueryObserverPlaceholderResult extends QueryObserverBaseResult { - data: TData; - isError: false; - error: null; - isPending: false; - isLoading: false; - isLoadingError: false; - isRefetchError: false; - isSuccess: true; - isPlaceholderData: true; - status: 'success'; -} -type DefinedQueryObserverResult = QueryObserverRefetchErrorResult | QueryObserverSuccessResult; -type QueryObserverResult = DefinedQueryObserverResult | QueryObserverLoadingErrorResult | QueryObserverLoadingResult | QueryObserverPendingResult | QueryObserverPlaceholderResult; -interface InfiniteQueryObserverBaseResult extends QueryObserverBaseResult { - /** - * This function allows you to fetch the next "page" of results. - */ - fetchNextPage: (options?: FetchNextPageOptions) => Promise>; - /** - * This function allows you to fetch the previous "page" of results. - */ - fetchPreviousPage: (options?: FetchPreviousPageOptions) => Promise>; - /** - * Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). - */ - hasNextPage: boolean; - /** - * Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). - */ - hasPreviousPage: boolean; - /** - * Will be `true` if the query failed while fetching the next page. - */ - isFetchNextPageError: boolean; - /** - * Will be `true` while fetching the next page with `fetchNextPage`. - */ - isFetchingNextPage: boolean; - /** - * Will be `true` if the query failed while fetching the previous page. - */ - isFetchPreviousPageError: boolean; - /** - * Will be `true` while fetching the previous page with `fetchPreviousPage`. - */ - isFetchingPreviousPage: boolean; -} -interface InfiniteQueryObserverPendingResult extends InfiniteQueryObserverBaseResult { - data: undefined; - error: null; - isError: false; - isPending: true; - isLoadingError: false; - isRefetchError: false; - isFetchNextPageError: false; - isFetchPreviousPageError: false; - isSuccess: false; - isPlaceholderData: false; - status: 'pending'; -} -interface InfiniteQueryObserverLoadingResult extends InfiniteQueryObserverBaseResult { - data: undefined; - error: null; - isError: false; - isPending: true; - isLoading: true; - isLoadingError: false; - isRefetchError: false; - isFetchNextPageError: false; - isFetchPreviousPageError: false; - isSuccess: false; - isPlaceholderData: false; - status: 'pending'; -} -interface InfiniteQueryObserverLoadingErrorResult extends InfiniteQueryObserverBaseResult { - data: undefined; - error: TError; - isError: true; - isPending: false; - isLoading: false; - isLoadingError: true; - isRefetchError: false; - isFetchNextPageError: false; - isFetchPreviousPageError: false; - isSuccess: false; - isPlaceholderData: false; - status: 'error'; -} -interface InfiniteQueryObserverRefetchErrorResult extends InfiniteQueryObserverBaseResult { - data: TData; - error: TError; - isError: true; - isPending: false; - isLoading: false; - isLoadingError: false; - isRefetchError: true; - isSuccess: false; - isPlaceholderData: false; - status: 'error'; -} -interface InfiniteQueryObserverSuccessResult extends InfiniteQueryObserverBaseResult { - data: TData; - error: null; - isError: false; - isPending: false; - isLoading: false; - isLoadingError: false; - isRefetchError: false; - isFetchNextPageError: false; - isFetchPreviousPageError: false; - isSuccess: true; - isPlaceholderData: false; - status: 'success'; -} -interface InfiniteQueryObserverPlaceholderResult extends InfiniteQueryObserverBaseResult { - data: TData; - isError: false; - error: null; - isPending: false; - isLoading: false; - isLoadingError: false; - isRefetchError: false; - isSuccess: true; - isPlaceholderData: true; - isFetchNextPageError: false; - isFetchPreviousPageError: false; - status: 'success'; -} -type DefinedInfiniteQueryObserverResult = InfiniteQueryObserverRefetchErrorResult | InfiniteQueryObserverSuccessResult; -type InfiniteQueryObserverResult = DefinedInfiniteQueryObserverResult | InfiniteQueryObserverLoadingErrorResult | InfiniteQueryObserverLoadingResult | InfiniteQueryObserverPendingResult | InfiniteQueryObserverPlaceholderResult; -type MutationKey = Register extends { - mutationKey: infer TMutationKey; -} ? TMutationKey extends ReadonlyArray ? TMutationKey : TMutationKey extends Array ? TMutationKey : ReadonlyArray : ReadonlyArray; -type MutationStatus = 'idle' | 'pending' | 'success' | 'error'; -type MutationScope = { - id: string; -}; -type MutationMeta = Register extends { - mutationMeta: infer TMutationMeta; -} ? TMutationMeta extends Record ? TMutationMeta : Record : Record; -type MutationFunctionContext = { - client: QueryClient; - meta: MutationMeta | undefined; - mutationKey?: MutationKey; -}; -type MutationFunction = (variables: TVariables, context: MutationFunctionContext) => Promise; -interface MutationOptions { - mutationFn?: MutationFunction; - mutationKey?: MutationKey; - onMutate?: (variables: TVariables, context: MutationFunctionContext) => Promise | TOnMutateResult; - onSuccess?: (data: TData, variables: TVariables, onMutateResult: TOnMutateResult, context: MutationFunctionContext) => Promise | unknown; - onError?: (error: TError, variables: TVariables, onMutateResult: TOnMutateResult | undefined, context: MutationFunctionContext) => Promise | unknown; - onSettled?: (data: TData | undefined, error: TError | null, variables: TVariables, onMutateResult: TOnMutateResult | undefined, context: MutationFunctionContext) => Promise | unknown; - retry?: RetryValue; - retryDelay?: RetryDelayValue; - networkMode?: NetworkMode; - gcTime?: number; - _defaulted?: boolean; - meta?: MutationMeta; - scope?: MutationScope; -} -interface MutationObserverOptions extends MutationOptions { - throwOnError?: boolean | ((error: TError) => boolean); -} -interface MutateOptions { - onSuccess?: (data: TData, variables: TVariables, onMutateResult: TOnMutateResult | undefined, context: MutationFunctionContext) => void; - onError?: (error: TError, variables: TVariables, onMutateResult: TOnMutateResult | undefined, context: MutationFunctionContext) => void; - onSettled?: (data: TData | undefined, error: TError | null, variables: TVariables, onMutateResult: TOnMutateResult | undefined, context: MutationFunctionContext) => void; -} -type MutateFunction = (variables: TVariables, options?: MutateOptions) => Promise; -interface MutationObserverBaseResult extends MutationState { - /** - * The last successfully resolved data for the mutation. - */ - data: TData | undefined; - /** - * The variables object passed to the `mutationFn`. - */ - variables: TVariables | undefined; - /** - * The error object for the mutation, if an error was encountered. - * - Defaults to `null`. - */ - error: TError | null; - /** - * A boolean variable derived from `status`. - * - `true` if the last mutation attempt resulted in an error. - */ - isError: boolean; - /** - * A boolean variable derived from `status`. - * - `true` if the mutation is in its initial state prior to executing. - */ - isIdle: boolean; - /** - * A boolean variable derived from `status`. - * - `true` if the mutation is currently executing. - */ - isPending: boolean; - /** - * A boolean variable derived from `status`. - * - `true` if the last mutation attempt was successful. - */ - isSuccess: boolean; - /** - * The status of the mutation. - * - Will be: - * - `idle` initial status prior to the mutation function executing. - * - `pending` if the mutation is currently executing. - * - `error` if the last mutation attempt resulted in an error. - * - `success` if the last mutation attempt was successful. - */ - status: MutationStatus; - /** - * The mutation function you can call with variables to trigger the mutation and optionally hooks on additional callback options. - * @param variables - The variables object to pass to the `mutationFn`. - * @param options.onSuccess - This function will fire when the mutation is successful and will be passed the mutation's result. - * @param options.onError - This function will fire if the mutation encounters an error and will be passed the error. - * @param options.onSettled - This function will fire when the mutation is either successfully fetched or encounters an error and be passed either the data or error. - * @remarks - * - If you make multiple requests, `onSuccess` will fire only after the latest call you've made. - * - All the callback functions (`onSuccess`, `onError`, `onSettled`) are void functions, and the returned value will be ignored. - */ - mutate: MutateFunction; - /** - * A function to clean the mutation internal state (i.e., it resets the mutation to its initial state). - */ - reset: () => void; -} -interface MutationObserverIdleResult extends MutationObserverBaseResult { - data: undefined; - variables: undefined; - error: null; - isError: false; - isIdle: true; - isPending: false; - isSuccess: false; - status: 'idle'; -} -interface MutationObserverLoadingResult extends MutationObserverBaseResult { - data: undefined; - variables: TVariables; - error: null; - isError: false; - isIdle: false; - isPending: true; - isSuccess: false; - status: 'pending'; -} -interface MutationObserverErrorResult extends MutationObserverBaseResult { - data: undefined; - error: TError; - variables: TVariables; - isError: true; - isIdle: false; - isPending: false; - isSuccess: false; - status: 'error'; -} -interface MutationObserverSuccessResult extends MutationObserverBaseResult { - data: TData; - error: null; - variables: TVariables; - isError: false; - isIdle: false; - isPending: false; - isSuccess: true; - status: 'success'; -} -type MutationObserverResult = MutationObserverIdleResult | MutationObserverLoadingResult | MutationObserverErrorResult | MutationObserverSuccessResult; -interface QueryClientConfig { - queryCache?: QueryCache; - mutationCache?: MutationCache; - defaultOptions?: DefaultOptions; -} -interface DefaultOptions { - queries?: OmitKeyof, 'suspense' | 'queryKey'>; - mutations?: MutationObserverOptions; - hydrate?: HydrateOptions['defaultOptions']; - dehydrate?: DehydrateOptions; -} -interface CancelOptions { - revert?: boolean; - silent?: boolean; -} -interface SetDataOptions { - updatedAt?: number; -} -type NotifyEventType = 'added' | 'removed' | 'updated' | 'observerAdded' | 'observerRemoved' | 'observerResultsUpdated' | 'observerOptionsUpdated'; -interface NotifyEvent { - type: NotifyEventType; -} - -type TransformerFn = (data: any) => any; -interface DehydrateOptions { - serializeData?: TransformerFn; - shouldDehydrateMutation?: (mutation: Mutation) => boolean; - shouldDehydrateQuery?: (query: Query) => boolean; - shouldRedactErrors?: (error: unknown) => boolean; -} -interface HydrateOptions { - defaultOptions?: { - deserializeData?: TransformerFn; - queries?: QueryOptions; - mutations?: MutationOptions; - }; -} -interface DehydratedMutation { - mutationKey?: MutationKey; - state: MutationState; - meta?: MutationMeta; - scope?: MutationScope; -} -interface DehydratedQuery { - queryHash: string; - queryKey: QueryKey; - state: QueryState; - promise?: Promise; - meta?: QueryMeta; - dehydratedAt?: number; -} -interface DehydratedState { - mutations: Array; - queries: Array; -} -declare function defaultShouldDehydrateMutation(mutation: Mutation): boolean; -declare function defaultShouldDehydrateQuery(query: Query): boolean; -declare function dehydrate(client: QueryClient, options?: DehydrateOptions): DehydratedState; -declare function hydrate(client: QueryClient, dehydratedState: unknown, options?: HydrateOptions): void; - -export { type Enabled as $, type QueryState as A, type DistributiveOmit as B, CancelledError as C, type DehydratedState as D, type Override as E, type NoInfer as F, type DefaultError as G, type HydrateOptions as H, type QueryKey as I, dataTagSymbol as J, dataTagErrorSymbol as K, unsetMarker as L, MutationCache as M, type NonUndefinedGuard as N, type OmitKeyof as O, type UnsetMarker as P, QueryCache as Q, type Register as R, type SkipToken as S, type AnyDataTag as T, type Updater as U, type DataTag as V, type InferDataFromTag as W, type InferErrorFromTag as X, type QueryFunction as Y, type StaleTime as Z, type StaleTimeFunction as _, defaultShouldDehydrateQuery as a, type MutationObserverBaseResult as a$, type QueryPersister as a0, type QueryFunctionContext as a1, type InitialDataFunction as a2, type PlaceholderDataFunction as a3, type QueriesPlaceholderDataFunction as a4, type QueryKeyHashFunction as a5, type GetPreviousPageParamFunction as a6, type GetNextPageParamFunction as a7, type InfiniteData as a8, type QueryMeta as a9, type QueryObserverPendingResult as aA, type QueryObserverLoadingResult as aB, type QueryObserverLoadingErrorResult as aC, type QueryObserverRefetchErrorResult as aD, type QueryObserverSuccessResult as aE, type QueryObserverPlaceholderResult as aF, type DefinedQueryObserverResult as aG, type QueryObserverResult as aH, type InfiniteQueryObserverBaseResult as aI, type InfiniteQueryObserverPendingResult as aJ, type InfiniteQueryObserverLoadingResult as aK, type InfiniteQueryObserverLoadingErrorResult as aL, type InfiniteQueryObserverRefetchErrorResult as aM, type InfiniteQueryObserverSuccessResult as aN, type InfiniteQueryObserverPlaceholderResult as aO, type DefinedInfiniteQueryObserverResult as aP, type InfiniteQueryObserverResult as aQ, type MutationKey as aR, type MutationStatus as aS, type MutationScope as aT, type MutationMeta as aU, type MutationFunctionContext as aV, type MutationFunction as aW, type MutationOptions as aX, type MutationObserverOptions as aY, type MutateOptions as aZ, type MutateFunction as a_, type NetworkMode as aa, type NotifyOnChangeProps as ab, type QueryOptions as ac, type InitialPageParam as ad, type InfiniteQueryPageParamsOptions as ae, type ThrowOnError as af, type QueryObserverOptions as ag, type WithRequired as ah, type DefaultedQueryObserverOptions as ai, type InfiniteQueryObserverOptions as aj, type DefaultedInfiniteQueryObserverOptions as ak, type FetchQueryOptions as al, type EnsureQueryDataOptions as am, type EnsureInfiniteQueryDataOptions as an, type FetchInfiniteQueryOptions as ao, type ResultOptions as ap, type RefetchOptions as aq, type InvalidateQueryFilters as ar, type RefetchQueryFilters as as, type InvalidateOptions as at, type ResetOptions as au, type FetchNextPageOptions as av, type FetchPreviousPageOptions as aw, type QueryStatus as ax, type FetchStatus as ay, type QueryObserverBaseResult as az, dehydrate as b, type MutationObserverIdleResult as b0, type MutationObserverLoadingResult as b1, type MutationObserverErrorResult as b2, type MutationObserverSuccessResult as b3, type MutationObserverResult as b4, type QueryClientConfig as b5, type DefaultOptions as b6, type CancelOptions as b7, type SetDataOptions as b8, type NotifyEventType as b9, addConsumeAwareSignal as bA, type QueryStore as bB, type Retryer as bC, type RetryValue as bD, type RetryDelayValue as bE, canFetch as bF, createRetryer as bG, type NotifyEvent as ba, type QueryBehavior as bb, type FetchContext as bc, type FetchDirection as bd, type FetchMeta as be, type FetchOptions as bf, type Action$1 as bg, type SetStateOptions as bh, fetchState as bi, type Action as bj, getDefaultState as bk, type QueryTypeFilter as bl, functionalUpdate as bm, isValidTimeout as bn, timeUntilStale as bo, resolveStaleTime as bp, resolveEnabled as bq, hashQueryKeyByOptions as br, shallowEqualObjects as bs, isPlainArray as bt, isPlainObject as bu, sleep as bv, replaceData as bw, addToEnd as bx, addToStart as by, ensureQueryFn as bz, type MutationCacheNotifyEvent as c, defaultShouldDehydrateMutation as d, MutationObserver as e, type QueryCacheNotifyEvent as f, QueryClient as g, hydrate as h, QueryObserver as i, isCancelledError as j, hashKey as k, isServer as l, keepPreviousData as m, matchMutation as n, matchQuery as o, noop as p, partialMatchKey as q, replaceEqualDeep as r, shouldThrowError as s, skipToken as t, type MutationFilters as u, type QueryFilters as v, type DehydrateOptions as w, Mutation as x, type MutationState as y, Query as z }; diff --git a/node_modules/@tanstack/query-core/build/legacy/hydration-uphG6M-i.d.cts b/node_modules/@tanstack/query-core/build/legacy/hydration-uphG6M-i.d.cts deleted file mode 100644 index fdea1ed..0000000 --- a/node_modules/@tanstack/query-core/build/legacy/hydration-uphG6M-i.d.cts +++ /dev/null @@ -1,1384 +0,0 @@ -import { Removable } from './removable.cjs'; -import { Subscribable } from './subscribable.cjs'; - -type QueryObserverListener = (result: QueryObserverResult) => void; -interface ObserverFetchOptions extends FetchOptions { - throwOnError?: boolean; -} -declare class QueryObserver extends Subscribable> { - #private; - options: QueryObserverOptions; - constructor(client: QueryClient, options: QueryObserverOptions); - protected bindMethods(): void; - protected onSubscribe(): void; - protected onUnsubscribe(): void; - shouldFetchOnReconnect(): boolean; - shouldFetchOnWindowFocus(): boolean; - destroy(): void; - setOptions(options: QueryObserverOptions): void; - getOptimisticResult(options: DefaultedQueryObserverOptions): QueryObserverResult; - getCurrentResult(): QueryObserverResult; - trackResult(result: QueryObserverResult, onPropTracked?: (key: keyof QueryObserverResult) => void): QueryObserverResult; - trackProp(key: keyof QueryObserverResult): void; - getCurrentQuery(): Query; - refetch({ ...options }?: RefetchOptions): Promise>; - fetchOptimistic(options: QueryObserverOptions): Promise>; - protected fetch(fetchOptions: ObserverFetchOptions): Promise>; - protected createResult(query: Query, options: QueryObserverOptions): QueryObserverResult; - updateResult(): void; - onQueryUpdate(): void; -} - -interface QueryConfig { - client: QueryClient; - queryKey: TQueryKey; - queryHash: string; - options?: QueryOptions; - defaultOptions?: QueryOptions; - state?: QueryState; -} -interface QueryState { - data: TData | undefined; - dataUpdateCount: number; - dataUpdatedAt: number; - error: TError | null; - errorUpdateCount: number; - errorUpdatedAt: number; - fetchFailureCount: number; - fetchFailureReason: TError | null; - fetchMeta: FetchMeta | null; - isInvalidated: boolean; - status: QueryStatus; - fetchStatus: FetchStatus; -} -interface FetchContext { - fetchFn: () => unknown | Promise; - fetchOptions?: FetchOptions; - signal: AbortSignal; - options: QueryOptions; - client: QueryClient; - queryKey: TQueryKey; - state: QueryState; -} -interface QueryBehavior { - onFetch: (context: FetchContext, query: Query) => void; -} -type FetchDirection = 'forward' | 'backward'; -interface FetchMeta { - fetchMore?: { - direction: FetchDirection; - }; -} -interface FetchOptions { - cancelRefetch?: boolean; - meta?: FetchMeta; - initialPromise?: Promise; -} -interface FailedAction$1 { - type: 'failed'; - failureCount: number; - error: TError; -} -interface FetchAction { - type: 'fetch'; - meta?: FetchMeta; -} -interface SuccessAction$1 { - data: TData | undefined; - type: 'success'; - dataUpdatedAt?: number; - manual?: boolean; -} -interface ErrorAction$1 { - type: 'error'; - error: TError; -} -interface InvalidateAction { - type: 'invalidate'; -} -interface PauseAction$1 { - type: 'pause'; -} -interface ContinueAction$1 { - type: 'continue'; -} -interface SetStateAction { - type: 'setState'; - state: Partial>; - setStateOptions?: SetStateOptions; -} -type Action$1 = ContinueAction$1 | ErrorAction$1 | FailedAction$1 | FetchAction | InvalidateAction | PauseAction$1 | SetStateAction | SuccessAction$1; -interface SetStateOptions { - meta?: any; -} -declare class Query extends Removable { - #private; - queryKey: TQueryKey; - queryHash: string; - options: QueryOptions; - state: QueryState; - observers: Array>; - constructor(config: QueryConfig); - get meta(): QueryMeta | undefined; - get promise(): Promise | undefined; - setOptions(options?: QueryOptions): void; - protected optionalRemove(): void; - setData(newData: TData, options?: SetDataOptions & { - manual: boolean; - }): TData; - setState(state: Partial>, setStateOptions?: SetStateOptions): void; - cancel(options?: CancelOptions): Promise; - destroy(): void; - reset(): void; - isActive(): boolean; - isDisabled(): boolean; - isStatic(): boolean; - isStale(): boolean; - isStaleByTime(staleTime?: StaleTime): boolean; - onFocus(): void; - onOnline(): void; - addObserver(observer: QueryObserver): void; - removeObserver(observer: QueryObserver): void; - getObserversCount(): number; - invalidate(): void; - fetch(options?: QueryOptions, fetchOptions?: FetchOptions): Promise; -} -declare function fetchState(data: TData | undefined, options: QueryOptions): { - readonly error?: null | undefined; - readonly status?: "pending" | undefined; - readonly fetchFailureCount: 0; - readonly fetchFailureReason: null; - readonly fetchStatus: "fetching" | "paused"; -}; - -type MutationObserverListener = (result: MutationObserverResult) => void; -declare class MutationObserver extends Subscribable> { - #private; - options: MutationObserverOptions; - constructor(client: QueryClient, options: MutationObserverOptions); - protected bindMethods(): void; - setOptions(options: MutationObserverOptions): void; - protected onUnsubscribe(): void; - onMutationUpdate(action: Action): void; - getCurrentResult(): MutationObserverResult; - reset(): void; - mutate(variables: TVariables, options?: MutateOptions): Promise; -} - -interface MutationCacheConfig { - onError?: (error: DefaultError, variables: unknown, onMutateResult: unknown, mutation: Mutation, context: MutationFunctionContext) => Promise | unknown; - onSuccess?: (data: unknown, variables: unknown, onMutateResult: unknown, mutation: Mutation, context: MutationFunctionContext) => Promise | unknown; - onMutate?: (variables: unknown, mutation: Mutation, context: MutationFunctionContext) => Promise | unknown; - onSettled?: (data: unknown | undefined, error: DefaultError | null, variables: unknown, onMutateResult: unknown, mutation: Mutation, context: MutationFunctionContext) => Promise | unknown; -} -interface NotifyEventMutationAdded extends NotifyEvent { - type: 'added'; - mutation: Mutation; -} -interface NotifyEventMutationRemoved extends NotifyEvent { - type: 'removed'; - mutation: Mutation; -} -interface NotifyEventMutationObserverAdded extends NotifyEvent { - type: 'observerAdded'; - mutation: Mutation; - observer: MutationObserver; -} -interface NotifyEventMutationObserverRemoved extends NotifyEvent { - type: 'observerRemoved'; - mutation: Mutation; - observer: MutationObserver; -} -interface NotifyEventMutationObserverOptionsUpdated extends NotifyEvent { - type: 'observerOptionsUpdated'; - mutation?: Mutation; - observer: MutationObserver; -} -interface NotifyEventMutationUpdated extends NotifyEvent { - type: 'updated'; - mutation: Mutation; - action: Action; -} -type MutationCacheNotifyEvent = NotifyEventMutationAdded | NotifyEventMutationRemoved | NotifyEventMutationObserverAdded | NotifyEventMutationObserverRemoved | NotifyEventMutationObserverOptionsUpdated | NotifyEventMutationUpdated; -type MutationCacheListener = (event: MutationCacheNotifyEvent) => void; -declare class MutationCache extends Subscribable { - #private; - config: MutationCacheConfig; - constructor(config?: MutationCacheConfig); - build(client: QueryClient, options: MutationOptions, state?: MutationState): Mutation; - add(mutation: Mutation): void; - remove(mutation: Mutation): void; - canRun(mutation: Mutation): boolean; - runNext(mutation: Mutation): Promise; - clear(): void; - getAll(): Array; - find(filters: MutationFilters): Mutation | undefined; - findAll(filters?: MutationFilters): Array; - notify(event: MutationCacheNotifyEvent): void; - resumePausedMutations(): Promise; -} - -interface MutationConfig { - client: QueryClient; - mutationId: number; - mutationCache: MutationCache; - options: MutationOptions; - state?: MutationState; -} -interface MutationState { - context: TOnMutateResult | undefined; - data: TData | undefined; - error: TError | null; - failureCount: number; - failureReason: TError | null; - isPaused: boolean; - status: MutationStatus; - variables: TVariables | undefined; - submittedAt: number; -} -interface FailedAction { - type: 'failed'; - failureCount: number; - error: TError | null; -} -interface PendingAction { - type: 'pending'; - isPaused: boolean; - variables?: TVariables; - context?: TOnMutateResult; -} -interface SuccessAction { - type: 'success'; - data: TData; -} -interface ErrorAction { - type: 'error'; - error: TError; -} -interface PauseAction { - type: 'pause'; -} -interface ContinueAction { - type: 'continue'; -} -type Action = ContinueAction | ErrorAction | FailedAction | PendingAction | PauseAction | SuccessAction; -declare class Mutation extends Removable { - #private; - state: MutationState; - options: MutationOptions; - readonly mutationId: number; - constructor(config: MutationConfig); - setOptions(options: MutationOptions): void; - get meta(): MutationMeta | undefined; - addObserver(observer: MutationObserver): void; - removeObserver(observer: MutationObserver): void; - protected optionalRemove(): void; - continue(): Promise; - execute(variables: TVariables): Promise; -} -declare function getDefaultState(): MutationState; - -type DropLast> = T extends readonly [ - ...infer R, - unknown -] ? readonly [...R] : never; -type TuplePrefixes> = T extends readonly [] ? readonly [] : TuplePrefixes> | T; -interface QueryFilters { - /** - * Filter to active queries, inactive queries or all queries - */ - type?: QueryTypeFilter; - /** - * Match query key exactly - */ - exact?: boolean; - /** - * Include queries matching this predicate function - */ - predicate?: (query: Query) => boolean; - /** - * Include queries matching this query key - */ - queryKey?: TQueryKey | TuplePrefixes; - /** - * Include or exclude stale queries - */ - stale?: boolean; - /** - * Include queries matching their fetchStatus - */ - fetchStatus?: FetchStatus; -} -interface MutationFilters { - /** - * Match mutation key exactly - */ - exact?: boolean; - /** - * Include mutations matching this predicate function - */ - predicate?: (mutation: Mutation) => boolean; - /** - * Include mutations matching this mutation key - */ - mutationKey?: TuplePrefixes; - /** - * Filter by mutation status - */ - status?: MutationStatus; -} -type Updater = TOutput | ((input: TInput) => TOutput); -type QueryTypeFilter = 'all' | 'active' | 'inactive'; -declare const isServer: boolean; -declare function noop(): void; -declare function noop(): undefined; -declare function functionalUpdate(updater: Updater, input: TInput): TOutput; -declare function isValidTimeout(value: unknown): value is number; -declare function timeUntilStale(updatedAt: number, staleTime?: number): number; -declare function resolveStaleTime(staleTime: undefined | StaleTimeFunction, query: Query): StaleTime | undefined; -declare function resolveEnabled(enabled: undefined | Enabled, query: Query): boolean | undefined; -declare function matchQuery(filters: QueryFilters, query: Query): boolean; -declare function matchMutation(filters: MutationFilters, mutation: Mutation): boolean; -declare function hashQueryKeyByOptions(queryKey: TQueryKey, options?: Pick, 'queryKeyHashFn'>): string; -/** - * Default query & mutation keys hash function. - * Hashes the value into a stable hash. - */ -declare function hashKey(queryKey: QueryKey | MutationKey): string; -/** - * Checks if key `b` partially matches with key `a`. - */ -declare function partialMatchKey(a: QueryKey, b: QueryKey): boolean; -/** - * This function returns `a` if `b` is deeply equal. - * If not, it will replace any deeply equal children of `b` with those of `a`. - * This can be used for structural sharing between JSON values for example. - */ -declare function replaceEqualDeep(a: unknown, b: T, depth?: number): T; -/** - * Shallow compare objects. - */ -declare function shallowEqualObjects>(a: T, b: T | undefined): boolean; -declare function isPlainArray(value: unknown): value is Array; -declare function isPlainObject(o: any): o is Record; -declare function sleep(timeout: number): Promise; -declare function replaceData>(prevData: TData | undefined, data: TData, options: TOptions): TData; -declare function keepPreviousData(previousData: T | undefined): T | undefined; -declare function addToEnd(items: Array, item: T, max?: number): Array; -declare function addToStart(items: Array, item: T, max?: number): Array; -declare const skipToken: unique symbol; -type SkipToken = typeof skipToken; -declare function ensureQueryFn(options: { - queryFn?: QueryFunction | SkipToken; - queryHash?: string; -}, fetchOptions?: FetchOptions): QueryFunction; -declare function shouldThrowError) => boolean>(throwOnError: boolean | T | undefined, params: Parameters): boolean; -declare function addConsumeAwareSignal(object: T, getSignal: () => AbortSignal, onCancelled: VoidFunction): T & { - signal: AbortSignal; -}; - -interface QueryCacheConfig { - onError?: (error: DefaultError, query: Query) => void; - onSuccess?: (data: unknown, query: Query) => void; - onSettled?: (data: unknown | undefined, error: DefaultError | null, query: Query) => void; -} -interface NotifyEventQueryAdded extends NotifyEvent { - type: 'added'; - query: Query; -} -interface NotifyEventQueryRemoved extends NotifyEvent { - type: 'removed'; - query: Query; -} -interface NotifyEventQueryUpdated extends NotifyEvent { - type: 'updated'; - query: Query; - action: Action$1; -} -interface NotifyEventQueryObserverAdded extends NotifyEvent { - type: 'observerAdded'; - query: Query; - observer: QueryObserver; -} -interface NotifyEventQueryObserverRemoved extends NotifyEvent { - type: 'observerRemoved'; - query: Query; - observer: QueryObserver; -} -interface NotifyEventQueryObserverResultsUpdated extends NotifyEvent { - type: 'observerResultsUpdated'; - query: Query; -} -interface NotifyEventQueryObserverOptionsUpdated extends NotifyEvent { - type: 'observerOptionsUpdated'; - query: Query; - observer: QueryObserver; -} -type QueryCacheNotifyEvent = NotifyEventQueryAdded | NotifyEventQueryRemoved | NotifyEventQueryUpdated | NotifyEventQueryObserverAdded | NotifyEventQueryObserverRemoved | NotifyEventQueryObserverResultsUpdated | NotifyEventQueryObserverOptionsUpdated; -type QueryCacheListener = (event: QueryCacheNotifyEvent) => void; -interface QueryStore { - has: (queryHash: string) => boolean; - set: (queryHash: string, query: Query) => void; - get: (queryHash: string) => Query | undefined; - delete: (queryHash: string) => void; - values: () => IterableIterator; -} -declare class QueryCache extends Subscribable { - #private; - config: QueryCacheConfig; - constructor(config?: QueryCacheConfig); - build(client: QueryClient, options: WithRequired, 'queryKey'>, state?: QueryState): Query; - add(query: Query): void; - remove(query: Query): void; - clear(): void; - get(queryHash: string): Query | undefined; - getAll(): Array; - find(filters: WithRequired): Query | undefined; - findAll(filters?: QueryFilters): Array; - notify(event: QueryCacheNotifyEvent): void; - onFocus(): void; - onOnline(): void; -} - -declare class QueryClient { - #private; - constructor(config?: QueryClientConfig); - mount(): void; - unmount(): void; - isFetching = QueryFilters>(filters?: TQueryFilters): number; - isMutating = MutationFilters>(filters?: TMutationFilters): number; - /** - * Imperative (non-reactive) way to retrieve data for a QueryKey. - * Should only be used in callbacks or functions where reading the latest data is necessary, e.g. for optimistic updates. - * - * Hint: Do not use this function inside a component, because it won't receive updates. - * Use `useQuery` to create a `QueryObserver` that subscribes to changes. - */ - getQueryData>(queryKey: TTaggedQueryKey): TInferredQueryFnData | undefined; - ensureQueryData(options: EnsureQueryDataOptions): Promise; - getQueriesData = QueryFilters>(filters: TQueryFilters): Array<[QueryKey, TQueryFnData | undefined]>; - setQueryData>(queryKey: TTaggedQueryKey, updater: Updater | undefined, NoInfer | undefined>, options?: SetDataOptions): NoInfer | undefined; - setQueriesData = QueryFilters>(filters: TQueryFilters, updater: Updater | undefined, NoInfer | undefined>, options?: SetDataOptions): Array<[QueryKey, TQueryFnData | undefined]>; - getQueryState, TInferredError = InferErrorFromTag>(queryKey: TTaggedQueryKey): QueryState | undefined; - removeQueries(filters?: QueryFilters): void; - resetQueries(filters?: QueryFilters, options?: ResetOptions): Promise; - cancelQueries(filters?: QueryFilters, cancelOptions?: CancelOptions): Promise; - invalidateQueries(filters?: InvalidateQueryFilters, options?: InvalidateOptions): Promise; - refetchQueries(filters?: RefetchQueryFilters, options?: RefetchOptions): Promise; - fetchQuery(options: FetchQueryOptions): Promise; - prefetchQuery(options: FetchQueryOptions): Promise; - fetchInfiniteQuery(options: FetchInfiniteQueryOptions): Promise>; - prefetchInfiniteQuery(options: FetchInfiniteQueryOptions): Promise; - ensureInfiniteQueryData(options: EnsureInfiniteQueryDataOptions): Promise>; - resumePausedMutations(): Promise; - getQueryCache(): QueryCache; - getMutationCache(): MutationCache; - getDefaultOptions(): DefaultOptions; - setDefaultOptions(options: DefaultOptions): void; - setQueryDefaults(queryKey: QueryKey, options: Partial, 'queryKey'>>): void; - getQueryDefaults(queryKey: QueryKey): OmitKeyof, 'queryKey'>; - setMutationDefaults(mutationKey: MutationKey, options: OmitKeyof, 'mutationKey'>): void; - getMutationDefaults(mutationKey: MutationKey): OmitKeyof, 'mutationKey'>; - defaultQueryOptions(options: QueryObserverOptions | DefaultedQueryObserverOptions): DefaultedQueryObserverOptions; - defaultMutationOptions>(options?: T): T; - clear(): void; -} - -interface RetryerConfig { - fn: () => TData | Promise; - initialPromise?: Promise; - onCancel?: (error: TError) => void; - onFail?: (failureCount: number, error: TError) => void; - onPause?: () => void; - onContinue?: () => void; - retry?: RetryValue; - retryDelay?: RetryDelayValue; - networkMode: NetworkMode | undefined; - canRun: () => boolean; -} -interface Retryer { - promise: Promise; - cancel: (cancelOptions?: CancelOptions) => void; - continue: () => Promise; - cancelRetry: () => void; - continueRetry: () => void; - canStart: () => boolean; - start: () => Promise; - status: () => 'pending' | 'resolved' | 'rejected'; -} -type RetryValue = boolean | number | ShouldRetryFunction; -type ShouldRetryFunction = (failureCount: number, error: TError) => boolean; -type RetryDelayValue = number | RetryDelayFunction; -type RetryDelayFunction = (failureCount: number, error: TError) => number; -declare function canFetch(networkMode: NetworkMode | undefined): boolean; -declare class CancelledError extends Error { - revert?: boolean; - silent?: boolean; - constructor(options?: CancelOptions); -} -/** - * @deprecated Use instanceof `CancelledError` instead. - */ -declare function isCancelledError(value: any): value is CancelledError; -declare function createRetryer(config: RetryerConfig): Retryer; - -type NonUndefinedGuard = T extends undefined ? never : T; -type DistributiveOmit = TObject extends any ? Omit : never; -type OmitKeyof) | (number & Record) | (symbol & Record) : keyof TObject, TStrictly extends 'strictly' | 'safely' = 'strictly'> = Omit; -type Override = { - [AKey in keyof TTargetA]: AKey extends keyof TTargetB ? TTargetB[AKey] : TTargetA[AKey]; -}; -type NoInfer = [T][T extends any ? 0 : never]; -interface Register { -} -type DefaultError = Register extends { - defaultError: infer TError; -} ? TError : Error; -type QueryKey = Register extends { - queryKey: infer TQueryKey; -} ? TQueryKey extends ReadonlyArray ? TQueryKey : TQueryKey extends Array ? TQueryKey : ReadonlyArray : ReadonlyArray; -declare const dataTagSymbol: unique symbol; -type dataTagSymbol = typeof dataTagSymbol; -declare const dataTagErrorSymbol: unique symbol; -type dataTagErrorSymbol = typeof dataTagErrorSymbol; -declare const unsetMarker: unique symbol; -type UnsetMarker = typeof unsetMarker; -type AnyDataTag = { - [dataTagSymbol]: any; - [dataTagErrorSymbol]: any; -}; -type DataTag = TType extends AnyDataTag ? TType : TType & { - [dataTagSymbol]: TValue; - [dataTagErrorSymbol]: TError; -}; -type InferDataFromTag = TTaggedQueryKey extends DataTag ? TaggedValue : TQueryFnData; -type InferErrorFromTag = TTaggedQueryKey extends DataTag ? TaggedError extends UnsetMarker ? TError : TaggedError : TError; -type QueryFunction = (context: QueryFunctionContext) => T | Promise; -type StaleTime = number | 'static'; -type StaleTimeFunction = StaleTime | ((query: Query) => StaleTime); -type Enabled = boolean | ((query: Query) => boolean); -type QueryPersister = [TPageParam] extends [never] ? (queryFn: QueryFunction, context: QueryFunctionContext, query: Query) => T | Promise : (queryFn: QueryFunction, context: QueryFunctionContext, query: Query) => T | Promise; -type QueryFunctionContext = [TPageParam] extends [never] ? { - client: QueryClient; - queryKey: TQueryKey; - signal: AbortSignal; - meta: QueryMeta | undefined; - pageParam?: unknown; - /** - * @deprecated - * if you want access to the direction, you can add it to the pageParam - */ - direction?: unknown; -} : { - client: QueryClient; - queryKey: TQueryKey; - signal: AbortSignal; - pageParam: TPageParam; - /** - * @deprecated - * if you want access to the direction, you can add it to the pageParam - */ - direction: FetchDirection; - meta: QueryMeta | undefined; -}; -type InitialDataFunction = () => T | undefined; -type NonFunctionGuard = T extends Function ? never : T; -type PlaceholderDataFunction = (previousData: TQueryData | undefined, previousQuery: Query | undefined) => TQueryData | undefined; -type QueriesPlaceholderDataFunction = (previousData: undefined, previousQuery: undefined) => TQueryData | undefined; -type QueryKeyHashFunction = (queryKey: TQueryKey) => string; -type GetPreviousPageParamFunction = (firstPage: TQueryFnData, allPages: Array, firstPageParam: TPageParam, allPageParams: Array) => TPageParam | undefined | null; -type GetNextPageParamFunction = (lastPage: TQueryFnData, allPages: Array, lastPageParam: TPageParam, allPageParams: Array) => TPageParam | undefined | null; -interface InfiniteData { - pages: Array; - pageParams: Array; -} -type QueryMeta = Register extends { - queryMeta: infer TQueryMeta; -} ? TQueryMeta extends Record ? TQueryMeta : Record : Record; -type NetworkMode = 'online' | 'always' | 'offlineFirst'; -type NotifyOnChangeProps = Array | 'all' | undefined | (() => Array | 'all' | undefined); -interface QueryOptions { - /** - * If `false`, failed queries will not retry by default. - * If `true`, failed queries will retry infinitely., failureCount: num - * If set to an integer number, e.g. 3, failed queries will retry until the failed query count meets that number. - * If set to a function `(failureCount, error) => boolean` failed queries will retry until the function returns false. - */ - retry?: RetryValue; - retryDelay?: RetryDelayValue; - networkMode?: NetworkMode; - /** - * The time in milliseconds that unused/inactive cache data remains in memory. - * When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration. - * When different garbage collection times are specified, the longest one will be used. - * Setting it to `Infinity` will disable garbage collection. - */ - gcTime?: number; - queryFn?: QueryFunction | SkipToken; - persister?: QueryPersister, NoInfer, NoInfer>; - queryHash?: string; - queryKey?: TQueryKey; - queryKeyHashFn?: QueryKeyHashFunction; - initialData?: TData | InitialDataFunction; - initialDataUpdatedAt?: number | (() => number | undefined); - behavior?: QueryBehavior; - /** - * Set this to `false` to disable structural sharing between query results. - * Set this to a function which accepts the old and new data and returns resolved data of the same type to implement custom structural sharing logic. - * Defaults to `true`. - */ - structuralSharing?: boolean | ((oldData: unknown | undefined, newData: unknown) => unknown); - _defaulted?: boolean; - /** - * Additional payload to be stored on each query. - * Use this property to pass information that can be used in other places. - */ - meta?: QueryMeta; - /** - * Maximum number of pages to store in the data of an infinite query. - */ - maxPages?: number; -} -interface InitialPageParam { - initialPageParam: TPageParam; -} -interface InfiniteQueryPageParamsOptions extends InitialPageParam { - /** - * This function can be set to automatically get the previous cursor for infinite queries. - * The result will also be used to determine the value of `hasPreviousPage`. - */ - getPreviousPageParam?: GetPreviousPageParamFunction; - /** - * This function can be set to automatically get the next cursor for infinite queries. - * The result will also be used to determine the value of `hasNextPage`. - */ - getNextPageParam: GetNextPageParamFunction; -} -type ThrowOnError = boolean | ((error: TError, query: Query) => boolean); -interface QueryObserverOptions extends WithRequired, 'queryKey'> { - /** - * Set this to `false` or a function that returns `false` to disable automatic refetching when the query mounts or changes query keys. - * To refetch the query, use the `refetch` method returned from the `useQuery` instance. - * Accepts a boolean or function that returns a boolean. - * Defaults to `true`. - */ - enabled?: Enabled; - /** - * The time in milliseconds after data is considered stale. - * If set to `Infinity`, the data will never be considered stale. - * If set to a function, the function will be executed with the query to compute a `staleTime`. - * Defaults to `0`. - */ - staleTime?: StaleTimeFunction; - /** - * If set to a number, the query will continuously refetch at this frequency in milliseconds. - * If set to a function, the function will be executed with the latest data and query to compute a frequency - * Defaults to `false`. - */ - refetchInterval?: number | false | ((query: Query) => number | false | undefined); - /** - * If set to `true`, the query will continue to refetch while their tab/window is in the background. - * Defaults to `false`. - */ - refetchIntervalInBackground?: boolean; - /** - * If set to `true`, the query will refetch on window focus if the data is stale. - * If set to `false`, the query will not refetch on window focus. - * If set to `'always'`, the query will always refetch on window focus. - * If set to a function, the function will be executed with the latest data and query to compute the value. - * Defaults to `true`. - */ - refetchOnWindowFocus?: boolean | 'always' | ((query: Query) => boolean | 'always'); - /** - * If set to `true`, the query will refetch on reconnect if the data is stale. - * If set to `false`, the query will not refetch on reconnect. - * If set to `'always'`, the query will always refetch on reconnect. - * If set to a function, the function will be executed with the latest data and query to compute the value. - * Defaults to the value of `networkOnline` (`true`) - */ - refetchOnReconnect?: boolean | 'always' | ((query: Query) => boolean | 'always'); - /** - * If set to `true`, the query will refetch on mount if the data is stale. - * If set to `false`, will disable additional instances of a query to trigger background refetch. - * If set to `'always'`, the query will always refetch on mount. - * If set to a function, the function will be executed with the latest data and query to compute the value - * Defaults to `true`. - */ - refetchOnMount?: boolean | 'always' | ((query: Query) => boolean | 'always'); - /** - * If set to `false`, the query will not be retried on mount if it contains an error. - * Defaults to `true`. - */ - retryOnMount?: boolean; - /** - * If set, the component will only re-render if any of the listed properties change. - * When set to `['data', 'error']`, the component will only re-render when the `data` or `error` properties change. - * When set to `'all'`, the component will re-render whenever a query is updated. - * When set to a function, the function will be executed to compute the list of properties. - * By default, access to properties will be tracked, and the component will only re-render when one of the tracked properties change. - */ - notifyOnChangeProps?: NotifyOnChangeProps; - /** - * Whether errors should be thrown instead of setting the `error` property. - * If set to `true` or `suspense` is `true`, all errors will be thrown to the error boundary. - * If set to `false` and `suspense` is `false`, errors are returned as state. - * If set to a function, it will be passed the error and the query, and it should return a boolean indicating whether to show the error in an error boundary (`true`) or return the error as state (`false`). - * Defaults to `false`. - */ - throwOnError?: ThrowOnError; - /** - * This option can be used to transform or select a part of the data returned by the query function. - */ - select?: (data: TQueryData) => TData; - /** - * If set to `true`, the query will suspend when `status === 'pending'` - * and throw errors when `status === 'error'`. - * Defaults to `false`. - */ - suspense?: boolean; - /** - * If set, this value will be used as the placeholder data for this particular query observer while the query is still in the `loading` data and no initialData has been provided. - */ - placeholderData?: NonFunctionGuard | PlaceholderDataFunction, TError, NonFunctionGuard, TQueryKey>; - _optimisticResults?: 'optimistic' | 'isRestoring'; - /** - * Enable prefetching during rendering - */ - experimental_prefetchInRender?: boolean; -} -type WithRequired = TTarget & { - [_ in TKey]: {}; -}; -type DefaultedQueryObserverOptions = WithRequired, 'throwOnError' | 'refetchOnReconnect' | 'queryHash'>; -interface InfiniteQueryObserverOptions extends QueryObserverOptions, TQueryKey, TPageParam>, InfiniteQueryPageParamsOptions { -} -type DefaultedInfiniteQueryObserverOptions = WithRequired, 'throwOnError' | 'refetchOnReconnect' | 'queryHash'>; -interface FetchQueryOptions extends WithRequired, 'queryKey'> { - initialPageParam?: never; - /** - * The time in milliseconds after data is considered stale. - * If the data is fresh it will be returned from the cache. - */ - staleTime?: StaleTimeFunction; -} -interface EnsureQueryDataOptions extends FetchQueryOptions { - revalidateIfStale?: boolean; -} -type EnsureInfiniteQueryDataOptions = FetchInfiniteQueryOptions & { - revalidateIfStale?: boolean; -}; -type FetchInfiniteQueryPages = { - pages?: never; -} | { - pages: number; - getNextPageParam: GetNextPageParamFunction; -}; -type FetchInfiniteQueryOptions = Omit, TQueryKey, TPageParam>, 'initialPageParam'> & InitialPageParam & FetchInfiniteQueryPages; -interface ResultOptions { - throwOnError?: boolean; -} -interface RefetchOptions extends ResultOptions { - /** - * If set to `true`, a currently running request will be cancelled before a new request is made - * - * If set to `false`, no refetch will be made if there is already a request running. - * - * Defaults to `true`. - */ - cancelRefetch?: boolean; -} -interface InvalidateQueryFilters extends QueryFilters { - refetchType?: QueryTypeFilter | 'none'; -} -interface RefetchQueryFilters extends QueryFilters { -} -interface InvalidateOptions extends RefetchOptions { -} -interface ResetOptions extends RefetchOptions { -} -interface FetchNextPageOptions extends ResultOptions { - /** - * If set to `true`, calling `fetchNextPage` repeatedly will invoke `queryFn` every time, - * whether the previous invocation has resolved or not. Also, the result from previous invocations will be ignored. - * - * If set to `false`, calling `fetchNextPage` repeatedly won't have any effect until the first invocation has resolved. - * - * Defaults to `true`. - */ - cancelRefetch?: boolean; -} -interface FetchPreviousPageOptions extends ResultOptions { - /** - * If set to `true`, calling `fetchPreviousPage` repeatedly will invoke `queryFn` every time, - * whether the previous invocation has resolved or not. Also, the result from previous invocations will be ignored. - * - * If set to `false`, calling `fetchPreviousPage` repeatedly won't have any effect until the first invocation has resolved. - * - * Defaults to `true`. - */ - cancelRefetch?: boolean; -} -type QueryStatus = 'pending' | 'error' | 'success'; -type FetchStatus = 'fetching' | 'paused' | 'idle'; -interface QueryObserverBaseResult { - /** - * The last successfully resolved data for the query. - */ - data: TData | undefined; - /** - * The timestamp for when the query most recently returned the `status` as `"success"`. - */ - dataUpdatedAt: number; - /** - * The error object for the query, if an error was thrown. - * - Defaults to `null`. - */ - error: TError | null; - /** - * The timestamp for when the query most recently returned the `status` as `"error"`. - */ - errorUpdatedAt: number; - /** - * The failure count for the query. - * - Incremented every time the query fails. - * - Reset to `0` when the query succeeds. - */ - failureCount: number; - /** - * The failure reason for the query retry. - * - Reset to `null` when the query succeeds. - */ - failureReason: TError | null; - /** - * The sum of all errors. - */ - errorUpdateCount: number; - /** - * A derived boolean from the `status` variable, provided for convenience. - * - `true` if the query attempt resulted in an error. - */ - isError: boolean; - /** - * Will be `true` if the query has been fetched. - */ - isFetched: boolean; - /** - * Will be `true` if the query has been fetched after the component mounted. - * - This property can be used to not show any previously cached data. - */ - isFetchedAfterMount: boolean; - /** - * A derived boolean from the `fetchStatus` variable, provided for convenience. - * - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. - */ - isFetching: boolean; - /** - * Is `true` whenever the first fetch for a query is in-flight. - * - Is the same as `isFetching && isPending`. - */ - isLoading: boolean; - /** - * Will be `pending` if there's no cached data and no query attempt was finished yet. - */ - isPending: boolean; - /** - * Will be `true` if the query failed while fetching for the first time. - */ - isLoadingError: boolean; - /** - * @deprecated `isInitialLoading` is being deprecated in favor of `isLoading` - * and will be removed in the next major version. - */ - isInitialLoading: boolean; - /** - * A derived boolean from the `fetchStatus` variable, provided for convenience. - * - The query wanted to fetch, but has been `paused`. - */ - isPaused: boolean; - /** - * Will be `true` if the data shown is the placeholder data. - */ - isPlaceholderData: boolean; - /** - * Will be `true` if the query failed while refetching. - */ - isRefetchError: boolean; - /** - * Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - * - Is the same as `isFetching && !isPending`. - */ - isRefetching: boolean; - /** - * Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. - */ - isStale: boolean; - /** - * A derived boolean from the `status` variable, provided for convenience. - * - `true` if the query has received a response with no errors and is ready to display its data. - */ - isSuccess: boolean; - /** - * `true` if this observer is enabled, `false` otherwise. - */ - isEnabled: boolean; - /** - * A function to manually refetch the query. - */ - refetch: (options?: RefetchOptions) => Promise>; - /** - * The status of the query. - * - Will be: - * - `pending` if there's no cached data and no query attempt was finished yet. - * - `error` if the query attempt resulted in an error. - * - `success` if the query has received a response with no errors and is ready to display its data. - */ - status: QueryStatus; - /** - * The fetch status of the query. - * - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. - * - `paused`: The query wanted to fetch, but has been `paused`. - * - `idle`: The query is not fetching. - * - See [Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information. - */ - fetchStatus: FetchStatus; - /** - * A stable promise that will be resolved with the data of the query. - * Requires the `experimental_prefetchInRender` feature flag to be enabled. - * @example - * - * ### Enabling the feature flag - * ```ts - * const client = new QueryClient({ - * defaultOptions: { - * queries: { - * experimental_prefetchInRender: true, - * }, - * }, - * }) - * ``` - * - * ### Usage - * ```tsx - * import { useQuery } from '@tanstack/react-query' - * import React from 'react' - * import { fetchTodos, type Todo } from './api' - * - * function TodoList({ query }: { query: UseQueryResult }) { - * const data = React.use(query.promise) - * - * return ( - *
    - * {data.map(todo => ( - *
  • {todo.title}
  • - * ))} - *
- * ) - * } - * - * export function App() { - * const query = useQuery({ queryKey: ['todos'], queryFn: fetchTodos }) - * - * return ( - * <> - *

Todos

- * Loading...}> - * - * - * - * ) - * } - * ``` - */ - promise: Promise; -} -interface QueryObserverPendingResult extends QueryObserverBaseResult { - data: undefined; - error: null; - isError: false; - isPending: true; - isLoadingError: false; - isRefetchError: false; - isSuccess: false; - isPlaceholderData: false; - status: 'pending'; -} -interface QueryObserverLoadingResult extends QueryObserverBaseResult { - data: undefined; - error: null; - isError: false; - isPending: true; - isLoading: true; - isLoadingError: false; - isRefetchError: false; - isSuccess: false; - isPlaceholderData: false; - status: 'pending'; -} -interface QueryObserverLoadingErrorResult extends QueryObserverBaseResult { - data: undefined; - error: TError; - isError: true; - isPending: false; - isLoading: false; - isLoadingError: true; - isRefetchError: false; - isSuccess: false; - isPlaceholderData: false; - status: 'error'; -} -interface QueryObserverRefetchErrorResult extends QueryObserverBaseResult { - data: TData; - error: TError; - isError: true; - isPending: false; - isLoading: false; - isLoadingError: false; - isRefetchError: true; - isSuccess: false; - isPlaceholderData: false; - status: 'error'; -} -interface QueryObserverSuccessResult extends QueryObserverBaseResult { - data: TData; - error: null; - isError: false; - isPending: false; - isLoading: false; - isLoadingError: false; - isRefetchError: false; - isSuccess: true; - isPlaceholderData: false; - status: 'success'; -} -interface QueryObserverPlaceholderResult extends QueryObserverBaseResult { - data: TData; - isError: false; - error: null; - isPending: false; - isLoading: false; - isLoadingError: false; - isRefetchError: false; - isSuccess: true; - isPlaceholderData: true; - status: 'success'; -} -type DefinedQueryObserverResult = QueryObserverRefetchErrorResult | QueryObserverSuccessResult; -type QueryObserverResult = DefinedQueryObserverResult | QueryObserverLoadingErrorResult | QueryObserverLoadingResult | QueryObserverPendingResult | QueryObserverPlaceholderResult; -interface InfiniteQueryObserverBaseResult extends QueryObserverBaseResult { - /** - * This function allows you to fetch the next "page" of results. - */ - fetchNextPage: (options?: FetchNextPageOptions) => Promise>; - /** - * This function allows you to fetch the previous "page" of results. - */ - fetchPreviousPage: (options?: FetchPreviousPageOptions) => Promise>; - /** - * Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). - */ - hasNextPage: boolean; - /** - * Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). - */ - hasPreviousPage: boolean; - /** - * Will be `true` if the query failed while fetching the next page. - */ - isFetchNextPageError: boolean; - /** - * Will be `true` while fetching the next page with `fetchNextPage`. - */ - isFetchingNextPage: boolean; - /** - * Will be `true` if the query failed while fetching the previous page. - */ - isFetchPreviousPageError: boolean; - /** - * Will be `true` while fetching the previous page with `fetchPreviousPage`. - */ - isFetchingPreviousPage: boolean; -} -interface InfiniteQueryObserverPendingResult extends InfiniteQueryObserverBaseResult { - data: undefined; - error: null; - isError: false; - isPending: true; - isLoadingError: false; - isRefetchError: false; - isFetchNextPageError: false; - isFetchPreviousPageError: false; - isSuccess: false; - isPlaceholderData: false; - status: 'pending'; -} -interface InfiniteQueryObserverLoadingResult extends InfiniteQueryObserverBaseResult { - data: undefined; - error: null; - isError: false; - isPending: true; - isLoading: true; - isLoadingError: false; - isRefetchError: false; - isFetchNextPageError: false; - isFetchPreviousPageError: false; - isSuccess: false; - isPlaceholderData: false; - status: 'pending'; -} -interface InfiniteQueryObserverLoadingErrorResult extends InfiniteQueryObserverBaseResult { - data: undefined; - error: TError; - isError: true; - isPending: false; - isLoading: false; - isLoadingError: true; - isRefetchError: false; - isFetchNextPageError: false; - isFetchPreviousPageError: false; - isSuccess: false; - isPlaceholderData: false; - status: 'error'; -} -interface InfiniteQueryObserverRefetchErrorResult extends InfiniteQueryObserverBaseResult { - data: TData; - error: TError; - isError: true; - isPending: false; - isLoading: false; - isLoadingError: false; - isRefetchError: true; - isSuccess: false; - isPlaceholderData: false; - status: 'error'; -} -interface InfiniteQueryObserverSuccessResult extends InfiniteQueryObserverBaseResult { - data: TData; - error: null; - isError: false; - isPending: false; - isLoading: false; - isLoadingError: false; - isRefetchError: false; - isFetchNextPageError: false; - isFetchPreviousPageError: false; - isSuccess: true; - isPlaceholderData: false; - status: 'success'; -} -interface InfiniteQueryObserverPlaceholderResult extends InfiniteQueryObserverBaseResult { - data: TData; - isError: false; - error: null; - isPending: false; - isLoading: false; - isLoadingError: false; - isRefetchError: false; - isSuccess: true; - isPlaceholderData: true; - isFetchNextPageError: false; - isFetchPreviousPageError: false; - status: 'success'; -} -type DefinedInfiniteQueryObserverResult = InfiniteQueryObserverRefetchErrorResult | InfiniteQueryObserverSuccessResult; -type InfiniteQueryObserverResult = DefinedInfiniteQueryObserverResult | InfiniteQueryObserverLoadingErrorResult | InfiniteQueryObserverLoadingResult | InfiniteQueryObserverPendingResult | InfiniteQueryObserverPlaceholderResult; -type MutationKey = Register extends { - mutationKey: infer TMutationKey; -} ? TMutationKey extends ReadonlyArray ? TMutationKey : TMutationKey extends Array ? TMutationKey : ReadonlyArray : ReadonlyArray; -type MutationStatus = 'idle' | 'pending' | 'success' | 'error'; -type MutationScope = { - id: string; -}; -type MutationMeta = Register extends { - mutationMeta: infer TMutationMeta; -} ? TMutationMeta extends Record ? TMutationMeta : Record : Record; -type MutationFunctionContext = { - client: QueryClient; - meta: MutationMeta | undefined; - mutationKey?: MutationKey; -}; -type MutationFunction = (variables: TVariables, context: MutationFunctionContext) => Promise; -interface MutationOptions { - mutationFn?: MutationFunction; - mutationKey?: MutationKey; - onMutate?: (variables: TVariables, context: MutationFunctionContext) => Promise | TOnMutateResult; - onSuccess?: (data: TData, variables: TVariables, onMutateResult: TOnMutateResult, context: MutationFunctionContext) => Promise | unknown; - onError?: (error: TError, variables: TVariables, onMutateResult: TOnMutateResult | undefined, context: MutationFunctionContext) => Promise | unknown; - onSettled?: (data: TData | undefined, error: TError | null, variables: TVariables, onMutateResult: TOnMutateResult | undefined, context: MutationFunctionContext) => Promise | unknown; - retry?: RetryValue; - retryDelay?: RetryDelayValue; - networkMode?: NetworkMode; - gcTime?: number; - _defaulted?: boolean; - meta?: MutationMeta; - scope?: MutationScope; -} -interface MutationObserverOptions extends MutationOptions { - throwOnError?: boolean | ((error: TError) => boolean); -} -interface MutateOptions { - onSuccess?: (data: TData, variables: TVariables, onMutateResult: TOnMutateResult | undefined, context: MutationFunctionContext) => void; - onError?: (error: TError, variables: TVariables, onMutateResult: TOnMutateResult | undefined, context: MutationFunctionContext) => void; - onSettled?: (data: TData | undefined, error: TError | null, variables: TVariables, onMutateResult: TOnMutateResult | undefined, context: MutationFunctionContext) => void; -} -type MutateFunction = (variables: TVariables, options?: MutateOptions) => Promise; -interface MutationObserverBaseResult extends MutationState { - /** - * The last successfully resolved data for the mutation. - */ - data: TData | undefined; - /** - * The variables object passed to the `mutationFn`. - */ - variables: TVariables | undefined; - /** - * The error object for the mutation, if an error was encountered. - * - Defaults to `null`. - */ - error: TError | null; - /** - * A boolean variable derived from `status`. - * - `true` if the last mutation attempt resulted in an error. - */ - isError: boolean; - /** - * A boolean variable derived from `status`. - * - `true` if the mutation is in its initial state prior to executing. - */ - isIdle: boolean; - /** - * A boolean variable derived from `status`. - * - `true` if the mutation is currently executing. - */ - isPending: boolean; - /** - * A boolean variable derived from `status`. - * - `true` if the last mutation attempt was successful. - */ - isSuccess: boolean; - /** - * The status of the mutation. - * - Will be: - * - `idle` initial status prior to the mutation function executing. - * - `pending` if the mutation is currently executing. - * - `error` if the last mutation attempt resulted in an error. - * - `success` if the last mutation attempt was successful. - */ - status: MutationStatus; - /** - * The mutation function you can call with variables to trigger the mutation and optionally hooks on additional callback options. - * @param variables - The variables object to pass to the `mutationFn`. - * @param options.onSuccess - This function will fire when the mutation is successful and will be passed the mutation's result. - * @param options.onError - This function will fire if the mutation encounters an error and will be passed the error. - * @param options.onSettled - This function will fire when the mutation is either successfully fetched or encounters an error and be passed either the data or error. - * @remarks - * - If you make multiple requests, `onSuccess` will fire only after the latest call you've made. - * - All the callback functions (`onSuccess`, `onError`, `onSettled`) are void functions, and the returned value will be ignored. - */ - mutate: MutateFunction; - /** - * A function to clean the mutation internal state (i.e., it resets the mutation to its initial state). - */ - reset: () => void; -} -interface MutationObserverIdleResult extends MutationObserverBaseResult { - data: undefined; - variables: undefined; - error: null; - isError: false; - isIdle: true; - isPending: false; - isSuccess: false; - status: 'idle'; -} -interface MutationObserverLoadingResult extends MutationObserverBaseResult { - data: undefined; - variables: TVariables; - error: null; - isError: false; - isIdle: false; - isPending: true; - isSuccess: false; - status: 'pending'; -} -interface MutationObserverErrorResult extends MutationObserverBaseResult { - data: undefined; - error: TError; - variables: TVariables; - isError: true; - isIdle: false; - isPending: false; - isSuccess: false; - status: 'error'; -} -interface MutationObserverSuccessResult extends MutationObserverBaseResult { - data: TData; - error: null; - variables: TVariables; - isError: false; - isIdle: false; - isPending: false; - isSuccess: true; - status: 'success'; -} -type MutationObserverResult = MutationObserverIdleResult | MutationObserverLoadingResult | MutationObserverErrorResult | MutationObserverSuccessResult; -interface QueryClientConfig { - queryCache?: QueryCache; - mutationCache?: MutationCache; - defaultOptions?: DefaultOptions; -} -interface DefaultOptions { - queries?: OmitKeyof, 'suspense' | 'queryKey'>; - mutations?: MutationObserverOptions; - hydrate?: HydrateOptions['defaultOptions']; - dehydrate?: DehydrateOptions; -} -interface CancelOptions { - revert?: boolean; - silent?: boolean; -} -interface SetDataOptions { - updatedAt?: number; -} -type NotifyEventType = 'added' | 'removed' | 'updated' | 'observerAdded' | 'observerRemoved' | 'observerResultsUpdated' | 'observerOptionsUpdated'; -interface NotifyEvent { - type: NotifyEventType; -} - -type TransformerFn = (data: any) => any; -interface DehydrateOptions { - serializeData?: TransformerFn; - shouldDehydrateMutation?: (mutation: Mutation) => boolean; - shouldDehydrateQuery?: (query: Query) => boolean; - shouldRedactErrors?: (error: unknown) => boolean; -} -interface HydrateOptions { - defaultOptions?: { - deserializeData?: TransformerFn; - queries?: QueryOptions; - mutations?: MutationOptions; - }; -} -interface DehydratedMutation { - mutationKey?: MutationKey; - state: MutationState; - meta?: MutationMeta; - scope?: MutationScope; -} -interface DehydratedQuery { - queryHash: string; - queryKey: QueryKey; - state: QueryState; - promise?: Promise; - meta?: QueryMeta; - dehydratedAt?: number; -} -interface DehydratedState { - mutations: Array; - queries: Array; -} -declare function defaultShouldDehydrateMutation(mutation: Mutation): boolean; -declare function defaultShouldDehydrateQuery(query: Query): boolean; -declare function dehydrate(client: QueryClient, options?: DehydrateOptions): DehydratedState; -declare function hydrate(client: QueryClient, dehydratedState: unknown, options?: HydrateOptions): void; - -export { type Enabled as $, type QueryState as A, type DistributiveOmit as B, CancelledError as C, type DehydratedState as D, type Override as E, type NoInfer as F, type DefaultError as G, type HydrateOptions as H, type QueryKey as I, dataTagSymbol as J, dataTagErrorSymbol as K, unsetMarker as L, MutationCache as M, type NonUndefinedGuard as N, type OmitKeyof as O, type UnsetMarker as P, QueryCache as Q, type Register as R, type SkipToken as S, type AnyDataTag as T, type Updater as U, type DataTag as V, type InferDataFromTag as W, type InferErrorFromTag as X, type QueryFunction as Y, type StaleTime as Z, type StaleTimeFunction as _, defaultShouldDehydrateQuery as a, type MutationObserverBaseResult as a$, type QueryPersister as a0, type QueryFunctionContext as a1, type InitialDataFunction as a2, type PlaceholderDataFunction as a3, type QueriesPlaceholderDataFunction as a4, type QueryKeyHashFunction as a5, type GetPreviousPageParamFunction as a6, type GetNextPageParamFunction as a7, type InfiniteData as a8, type QueryMeta as a9, type QueryObserverPendingResult as aA, type QueryObserverLoadingResult as aB, type QueryObserverLoadingErrorResult as aC, type QueryObserverRefetchErrorResult as aD, type QueryObserverSuccessResult as aE, type QueryObserverPlaceholderResult as aF, type DefinedQueryObserverResult as aG, type QueryObserverResult as aH, type InfiniteQueryObserverBaseResult as aI, type InfiniteQueryObserverPendingResult as aJ, type InfiniteQueryObserverLoadingResult as aK, type InfiniteQueryObserverLoadingErrorResult as aL, type InfiniteQueryObserverRefetchErrorResult as aM, type InfiniteQueryObserverSuccessResult as aN, type InfiniteQueryObserverPlaceholderResult as aO, type DefinedInfiniteQueryObserverResult as aP, type InfiniteQueryObserverResult as aQ, type MutationKey as aR, type MutationStatus as aS, type MutationScope as aT, type MutationMeta as aU, type MutationFunctionContext as aV, type MutationFunction as aW, type MutationOptions as aX, type MutationObserverOptions as aY, type MutateOptions as aZ, type MutateFunction as a_, type NetworkMode as aa, type NotifyOnChangeProps as ab, type QueryOptions as ac, type InitialPageParam as ad, type InfiniteQueryPageParamsOptions as ae, type ThrowOnError as af, type QueryObserverOptions as ag, type WithRequired as ah, type DefaultedQueryObserverOptions as ai, type InfiniteQueryObserverOptions as aj, type DefaultedInfiniteQueryObserverOptions as ak, type FetchQueryOptions as al, type EnsureQueryDataOptions as am, type EnsureInfiniteQueryDataOptions as an, type FetchInfiniteQueryOptions as ao, type ResultOptions as ap, type RefetchOptions as aq, type InvalidateQueryFilters as ar, type RefetchQueryFilters as as, type InvalidateOptions as at, type ResetOptions as au, type FetchNextPageOptions as av, type FetchPreviousPageOptions as aw, type QueryStatus as ax, type FetchStatus as ay, type QueryObserverBaseResult as az, dehydrate as b, type MutationObserverIdleResult as b0, type MutationObserverLoadingResult as b1, type MutationObserverErrorResult as b2, type MutationObserverSuccessResult as b3, type MutationObserverResult as b4, type QueryClientConfig as b5, type DefaultOptions as b6, type CancelOptions as b7, type SetDataOptions as b8, type NotifyEventType as b9, addConsumeAwareSignal as bA, type QueryStore as bB, type Retryer as bC, type RetryValue as bD, type RetryDelayValue as bE, canFetch as bF, createRetryer as bG, type NotifyEvent as ba, type QueryBehavior as bb, type FetchContext as bc, type FetchDirection as bd, type FetchMeta as be, type FetchOptions as bf, type Action$1 as bg, type SetStateOptions as bh, fetchState as bi, type Action as bj, getDefaultState as bk, type QueryTypeFilter as bl, functionalUpdate as bm, isValidTimeout as bn, timeUntilStale as bo, resolveStaleTime as bp, resolveEnabled as bq, hashQueryKeyByOptions as br, shallowEqualObjects as bs, isPlainArray as bt, isPlainObject as bu, sleep as bv, replaceData as bw, addToEnd as bx, addToStart as by, ensureQueryFn as bz, type MutationCacheNotifyEvent as c, defaultShouldDehydrateMutation as d, MutationObserver as e, type QueryCacheNotifyEvent as f, QueryClient as g, hydrate as h, QueryObserver as i, isCancelledError as j, hashKey as k, isServer as l, keepPreviousData as m, matchMutation as n, matchQuery as o, noop as p, partialMatchKey as q, replaceEqualDeep as r, shouldThrowError as s, skipToken as t, type MutationFilters as u, type QueryFilters as v, type DehydrateOptions as w, Mutation as x, type MutationState as y, Query as z }; diff --git a/node_modules/@tanstack/query-core/build/legacy/hydration.cjs b/node_modules/@tanstack/query-core/build/legacy/hydration.cjs deleted file mode 100644 index 0b89027..0000000 --- a/node_modules/@tanstack/query-core/build/legacy/hydration.cjs +++ /dev/null @@ -1,178 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// src/hydration.ts -var hydration_exports = {}; -__export(hydration_exports, { - defaultShouldDehydrateMutation: () => defaultShouldDehydrateMutation, - defaultShouldDehydrateQuery: () => defaultShouldDehydrateQuery, - dehydrate: () => dehydrate, - hydrate: () => hydrate -}); -module.exports = __toCommonJS(hydration_exports); -var import_thenable = require("./thenable.cjs"); -var import_utils = require("./utils.cjs"); -function defaultTransformerFn(data) { - return data; -} -function dehydrateMutation(mutation) { - return { - mutationKey: mutation.options.mutationKey, - state: mutation.state, - ...mutation.options.scope && { scope: mutation.options.scope }, - ...mutation.meta && { meta: mutation.meta } - }; -} -function dehydrateQuery(query, serializeData, shouldRedactErrors) { - const dehydratePromise = () => { - var _a; - const promise = (_a = query.promise) == null ? void 0 : _a.then(serializeData).catch((error) => { - if (!shouldRedactErrors(error)) { - return Promise.reject(error); - } - if (process.env.NODE_ENV !== "production") { - console.error( - `A query that was dehydrated as pending ended up rejecting. [${query.queryHash}]: ${error}; The error will be redacted in production builds` - ); - } - return Promise.reject(new Error("redacted")); - }); - promise == null ? void 0 : promise.catch(import_utils.noop); - return promise; - }; - return { - dehydratedAt: Date.now(), - state: { - ...query.state, - ...query.state.data !== void 0 && { - data: serializeData(query.state.data) - } - }, - queryKey: query.queryKey, - queryHash: query.queryHash, - ...query.state.status === "pending" && { - promise: dehydratePromise() - }, - ...query.meta && { meta: query.meta } - }; -} -function defaultShouldDehydrateMutation(mutation) { - return mutation.state.isPaused; -} -function defaultShouldDehydrateQuery(query) { - return query.state.status === "success"; -} -function defaultShouldRedactErrors(_) { - return true; -} -function dehydrate(client, options = {}) { - var _a, _b, _c, _d; - const filterMutation = options.shouldDehydrateMutation ?? ((_a = client.getDefaultOptions().dehydrate) == null ? void 0 : _a.shouldDehydrateMutation) ?? defaultShouldDehydrateMutation; - const mutations = client.getMutationCache().getAll().flatMap( - (mutation) => filterMutation(mutation) ? [dehydrateMutation(mutation)] : [] - ); - const filterQuery = options.shouldDehydrateQuery ?? ((_b = client.getDefaultOptions().dehydrate) == null ? void 0 : _b.shouldDehydrateQuery) ?? defaultShouldDehydrateQuery; - const shouldRedactErrors = options.shouldRedactErrors ?? ((_c = client.getDefaultOptions().dehydrate) == null ? void 0 : _c.shouldRedactErrors) ?? defaultShouldRedactErrors; - const serializeData = options.serializeData ?? ((_d = client.getDefaultOptions().dehydrate) == null ? void 0 : _d.serializeData) ?? defaultTransformerFn; - const queries = client.getQueryCache().getAll().flatMap( - (query) => filterQuery(query) ? [dehydrateQuery(query, serializeData, shouldRedactErrors)] : [] - ); - return { mutations, queries }; -} -function hydrate(client, dehydratedState, options) { - var _a, _b; - if (typeof dehydratedState !== "object" || dehydratedState === null) { - return; - } - const mutationCache = client.getMutationCache(); - const queryCache = client.getQueryCache(); - const deserializeData = ((_a = options == null ? void 0 : options.defaultOptions) == null ? void 0 : _a.deserializeData) ?? ((_b = client.getDefaultOptions().hydrate) == null ? void 0 : _b.deserializeData) ?? defaultTransformerFn; - const mutations = dehydratedState.mutations || []; - const queries = dehydratedState.queries || []; - mutations.forEach(({ state, ...mutationOptions }) => { - var _a2, _b2; - mutationCache.build( - client, - { - ...(_a2 = client.getDefaultOptions().hydrate) == null ? void 0 : _a2.mutations, - ...(_b2 = options == null ? void 0 : options.defaultOptions) == null ? void 0 : _b2.mutations, - ...mutationOptions - }, - state - ); - }); - queries.forEach( - ({ queryKey, state, queryHash, meta, promise, dehydratedAt }) => { - var _a2, _b2; - const syncData = promise ? (0, import_thenable.tryResolveSync)(promise) : void 0; - const rawData = state.data === void 0 ? syncData == null ? void 0 : syncData.data : state.data; - const data = rawData === void 0 ? rawData : deserializeData(rawData); - let query = queryCache.get(queryHash); - const existingQueryIsPending = (query == null ? void 0 : query.state.status) === "pending"; - const existingQueryIsFetching = (query == null ? void 0 : query.state.fetchStatus) === "fetching"; - if (query) { - const hasNewerSyncData = syncData && // We only need this undefined check to handle older dehydration - // payloads that might not have dehydratedAt - dehydratedAt !== void 0 && dehydratedAt > query.state.dataUpdatedAt; - if (state.dataUpdatedAt > query.state.dataUpdatedAt || hasNewerSyncData) { - const { fetchStatus: _ignored, ...serializedState } = state; - query.setState({ - ...serializedState, - data - }); - } - } else { - query = queryCache.build( - client, - { - ...(_a2 = client.getDefaultOptions().hydrate) == null ? void 0 : _a2.queries, - ...(_b2 = options == null ? void 0 : options.defaultOptions) == null ? void 0 : _b2.queries, - queryKey, - queryHash, - meta - }, - // Reset fetch status to idle to avoid - // query being stuck in fetching state upon hydration - { - ...state, - data, - fetchStatus: "idle", - status: data !== void 0 ? "success" : state.status - } - ); - } - if (promise && !existingQueryIsPending && !existingQueryIsFetching && // Only hydrate if dehydration is newer than any existing data, - // this is always true for new queries - (dehydratedAt === void 0 || dehydratedAt > query.state.dataUpdatedAt)) { - query.fetch(void 0, { - // RSC transformed promises are not thenable - initialPromise: Promise.resolve(promise).then(deserializeData) - }).catch(import_utils.noop); - } - } - ); -} -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - defaultShouldDehydrateMutation, - defaultShouldDehydrateQuery, - dehydrate, - hydrate -}); -//# sourceMappingURL=hydration.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/hydration.cjs.map b/node_modules/@tanstack/query-core/build/legacy/hydration.cjs.map deleted file mode 100644 index 9e429d3..0000000 --- a/node_modules/@tanstack/query-core/build/legacy/hydration.cjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/hydration.ts"],"sourcesContent":["import { tryResolveSync } from './thenable'\nimport { noop } from './utils'\nimport type {\n DefaultError,\n MutationKey,\n MutationMeta,\n MutationOptions,\n MutationScope,\n QueryKey,\n QueryMeta,\n QueryOptions,\n} from './types'\nimport type { QueryClient } from './queryClient'\nimport type { Query, QueryState } from './query'\nimport type { Mutation, MutationState } from './mutation'\n\n// TYPES\ntype TransformerFn = (data: any) => any\nfunction defaultTransformerFn(data: any): any {\n return data\n}\n\nexport interface DehydrateOptions {\n serializeData?: TransformerFn\n shouldDehydrateMutation?: (mutation: Mutation) => boolean\n shouldDehydrateQuery?: (query: Query) => boolean\n shouldRedactErrors?: (error: unknown) => boolean\n}\n\nexport interface HydrateOptions {\n defaultOptions?: {\n deserializeData?: TransformerFn\n queries?: QueryOptions\n mutations?: MutationOptions\n }\n}\n\ninterface DehydratedMutation {\n mutationKey?: MutationKey\n state: MutationState\n meta?: MutationMeta\n scope?: MutationScope\n}\n\ninterface DehydratedQuery {\n queryHash: string\n queryKey: QueryKey\n state: QueryState\n promise?: Promise\n meta?: QueryMeta\n // This is only optional because older versions of Query might have dehydrated\n // without it which we need to handle for backwards compatibility.\n // This should be changed to required in the future.\n dehydratedAt?: number\n}\n\nexport interface DehydratedState {\n mutations: Array\n queries: Array\n}\n\n// FUNCTIONS\n\nfunction dehydrateMutation(mutation: Mutation): DehydratedMutation {\n return {\n mutationKey: mutation.options.mutationKey,\n state: mutation.state,\n ...(mutation.options.scope && { scope: mutation.options.scope }),\n ...(mutation.meta && { meta: mutation.meta }),\n }\n}\n\n// Most config is not dehydrated but instead meant to configure again when\n// consuming the de/rehydrated data, typically with useQuery on the client.\n// Sometimes it might make sense to prefetch data on the server and include\n// in the html-payload, but not consume it on the initial render.\nfunction dehydrateQuery(\n query: Query,\n serializeData: TransformerFn,\n shouldRedactErrors: (error: unknown) => boolean,\n): DehydratedQuery {\n const dehydratePromise = () => {\n const promise = query.promise?.then(serializeData).catch((error) => {\n if (!shouldRedactErrors(error)) {\n // Reject original error if it should not be redacted\n return Promise.reject(error)\n }\n // If not in production, log original error before rejecting redacted error\n if (process.env.NODE_ENV !== 'production') {\n console.error(\n `A query that was dehydrated as pending ended up rejecting. [${query.queryHash}]: ${error}; The error will be redacted in production builds`,\n )\n }\n return Promise.reject(new Error('redacted'))\n })\n\n // Avoid unhandled promise rejections\n // We need the promise we dehydrate to reject to get the correct result into\n // the query cache, but we also want to avoid unhandled promise rejections\n // in whatever environment the prefetches are happening in.\n promise?.catch(noop)\n\n return promise\n }\n\n return {\n dehydratedAt: Date.now(),\n state: {\n ...query.state,\n ...(query.state.data !== undefined && {\n data: serializeData(query.state.data),\n }),\n },\n queryKey: query.queryKey,\n queryHash: query.queryHash,\n ...(query.state.status === 'pending' && {\n promise: dehydratePromise(),\n }),\n ...(query.meta && { meta: query.meta }),\n }\n}\n\nexport function defaultShouldDehydrateMutation(mutation: Mutation) {\n return mutation.state.isPaused\n}\n\nexport function defaultShouldDehydrateQuery(query: Query) {\n return query.state.status === 'success'\n}\n\nfunction defaultShouldRedactErrors(_: unknown) {\n return true\n}\n\nexport function dehydrate(\n client: QueryClient,\n options: DehydrateOptions = {},\n): DehydratedState {\n const filterMutation =\n options.shouldDehydrateMutation ??\n client.getDefaultOptions().dehydrate?.shouldDehydrateMutation ??\n defaultShouldDehydrateMutation\n\n const mutations = client\n .getMutationCache()\n .getAll()\n .flatMap((mutation) =>\n filterMutation(mutation) ? [dehydrateMutation(mutation)] : [],\n )\n\n const filterQuery =\n options.shouldDehydrateQuery ??\n client.getDefaultOptions().dehydrate?.shouldDehydrateQuery ??\n defaultShouldDehydrateQuery\n\n const shouldRedactErrors =\n options.shouldRedactErrors ??\n client.getDefaultOptions().dehydrate?.shouldRedactErrors ??\n defaultShouldRedactErrors\n\n const serializeData =\n options.serializeData ??\n client.getDefaultOptions().dehydrate?.serializeData ??\n defaultTransformerFn\n\n const queries = client\n .getQueryCache()\n .getAll()\n .flatMap((query) =>\n filterQuery(query)\n ? [dehydrateQuery(query, serializeData, shouldRedactErrors)]\n : [],\n )\n\n return { mutations, queries }\n}\n\nexport function hydrate(\n client: QueryClient,\n dehydratedState: unknown,\n options?: HydrateOptions,\n): void {\n if (typeof dehydratedState !== 'object' || dehydratedState === null) {\n return\n }\n\n const mutationCache = client.getMutationCache()\n const queryCache = client.getQueryCache()\n const deserializeData =\n options?.defaultOptions?.deserializeData ??\n client.getDefaultOptions().hydrate?.deserializeData ??\n defaultTransformerFn\n\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n const mutations = (dehydratedState as DehydratedState).mutations || []\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n const queries = (dehydratedState as DehydratedState).queries || []\n\n mutations.forEach(({ state, ...mutationOptions }) => {\n mutationCache.build(\n client,\n {\n ...client.getDefaultOptions().hydrate?.mutations,\n ...options?.defaultOptions?.mutations,\n ...mutationOptions,\n },\n state,\n )\n })\n\n queries.forEach(\n ({ queryKey, state, queryHash, meta, promise, dehydratedAt }) => {\n const syncData = promise ? tryResolveSync(promise) : undefined\n const rawData = state.data === undefined ? syncData?.data : state.data\n const data = rawData === undefined ? rawData : deserializeData(rawData)\n\n let query = queryCache.get(queryHash)\n const existingQueryIsPending = query?.state.status === 'pending'\n const existingQueryIsFetching = query?.state.fetchStatus === 'fetching'\n\n // Do not hydrate if an existing query exists with newer data\n if (query) {\n const hasNewerSyncData =\n syncData &&\n // We only need this undefined check to handle older dehydration\n // payloads that might not have dehydratedAt\n dehydratedAt !== undefined &&\n dehydratedAt > query.state.dataUpdatedAt\n if (\n state.dataUpdatedAt > query.state.dataUpdatedAt ||\n hasNewerSyncData\n ) {\n // omit fetchStatus from dehydrated state\n // so that query stays in its current fetchStatus\n const { fetchStatus: _ignored, ...serializedState } = state\n query.setState({\n ...serializedState,\n data,\n })\n }\n } else {\n // Restore query\n query = queryCache.build(\n client,\n {\n ...client.getDefaultOptions().hydrate?.queries,\n ...options?.defaultOptions?.queries,\n queryKey,\n queryHash,\n meta,\n },\n // Reset fetch status to idle to avoid\n // query being stuck in fetching state upon hydration\n {\n ...state,\n data,\n fetchStatus: 'idle',\n status: data !== undefined ? 'success' : state.status,\n },\n )\n }\n\n if (\n promise &&\n !existingQueryIsPending &&\n !existingQueryIsFetching &&\n // Only hydrate if dehydration is newer than any existing data,\n // this is always true for new queries\n (dehydratedAt === undefined || dehydratedAt > query.state.dataUpdatedAt)\n ) {\n // This doesn't actually fetch - it just creates a retryer\n // which will re-use the passed `initialPromise`\n // Note that we need to call these even when data was synchronously\n // available, as we still need to set up the retryer\n query\n .fetch(undefined, {\n // RSC transformed promises are not thenable\n initialPromise: Promise.resolve(promise).then(deserializeData),\n })\n // Avoid unhandled promise rejections\n .catch(noop)\n }\n },\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,sBAA+B;AAC/B,mBAAqB;AAiBrB,SAAS,qBAAqB,MAAgB;AAC5C,SAAO;AACT;AA2CA,SAAS,kBAAkB,UAAwC;AACjE,SAAO;AAAA,IACL,aAAa,SAAS,QAAQ;AAAA,IAC9B,OAAO,SAAS;AAAA,IAChB,GAAI,SAAS,QAAQ,SAAS,EAAE,OAAO,SAAS,QAAQ,MAAM;AAAA,IAC9D,GAAI,SAAS,QAAQ,EAAE,MAAM,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YAAM,WAAW,cAAU,gCAAe,OAAO,IAAI;AACrD,YAAM,UAAU,MAAM,SAAS,SAAY,qCAAU,OAAO,MAAM;AAClE,YAAM,OAAO,YAAY,SAAY,UAAU,gBAAgB,OAAO;AAEtE,UAAI,QAAQ,WAAW,IAAI,SAAS;AACpC,YAAM,0BAAyB,+BAAO,MAAM,YAAW;AACvD,YAAM,2BAA0B,+BAAO,MAAM,iBAAgB;AAG7D,UAAI,OAAO;AACT,cAAM,mBACJ;AAAA;AAAA,QAGA,iBAAiB,UACjB,eAAe,MAAM,MAAM;AAC7B,YACE,MAAM,gBAAgB,MAAM,MAAM,iBAClC,kBACA;AAGA,gBAAM,EAAE,aAAa,UAAU,GAAG,gBAAgB,IAAI;AACtD,gBAAM,SAAS;AAAA,YACb,GAAG;AAAA,YACH;AAAA,UACF,CAAC;AAAA,QACH;AAAA,MACF,OAAO;AAEL,gBAAQ,WAAW;AAAA,UACjB;AAAA,UACA;AAAA,YACE,IAAGD,MAAA,OAAO,kBAAkB,EAAE,YAA3B,gBAAAA,IAAoC;AAAA,YACvC,IAAGC,MAAA,mCAAS,mBAAT,gBAAAA,IAAyB;AAAA,YAC5B;AAAA,YACA;AAAA,YACA;AAAA,UACF;AAAA;AAAA;AAAA,UAGA;AAAA,YACE,GAAG;AAAA,YACH;AAAA,YACA,aAAa;AAAA,YACb,QAAQ,SAAS,SAAY,YAAY,MAAM;AAAA,UACjD;AAAA,QACF;AAAA,MACF;AAEA,UACE,WACA,CAAC,0BACD,CAAC;AAAA;AAAA,OAGA,iBAAiB,UAAa,eAAe,MAAM,MAAM,gBAC1D;AAKA,cACG,MAAM,QAAW;AAAA;AAAA,UAEhB,gBAAgB,QAAQ,QAAQ,OAAO,EAAE,KAAK,eAAe;AAAA,QAC/D,CAAC,EAEA,MAAM,iBAAI;AAAA,MACf;AAAA,IACF;AAAA,EACF;AACF;","names":["_a","_b"]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/hydration.d.cts b/node_modules/@tanstack/query-core/build/legacy/hydration.d.cts deleted file mode 100644 index 1681473..0000000 --- a/node_modules/@tanstack/query-core/build/legacy/hydration.d.cts +++ /dev/null @@ -1,3 +0,0 @@ -export { w as DehydrateOptions, D as DehydratedState, H as HydrateOptions, d as defaultShouldDehydrateMutation, a as defaultShouldDehydrateQuery, b as dehydrate, h as hydrate } from './hydration-uphG6M-i.cjs'; -import './removable.cjs'; -import './subscribable.cjs'; diff --git a/node_modules/@tanstack/query-core/build/legacy/hydration.d.ts b/node_modules/@tanstack/query-core/build/legacy/hydration.d.ts deleted file mode 100644 index e507d39..0000000 --- a/node_modules/@tanstack/query-core/build/legacy/hydration.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export { w as DehydrateOptions, D as DehydratedState, H as HydrateOptions, d as defaultShouldDehydrateMutation, a as defaultShouldDehydrateQuery, b as dehydrate, h as hydrate } from './hydration-BlEVG2Lp.js'; -import './removable.js'; -import './subscribable.js'; diff --git a/node_modules/@tanstack/query-core/build/legacy/hydration.js b/node_modules/@tanstack/query-core/build/legacy/hydration.js deleted file mode 100644 index 97cebe7..0000000 --- a/node_modules/@tanstack/query-core/build/legacy/hydration.js +++ /dev/null @@ -1,152 +0,0 @@ -import "./chunk-PXG64RU4.js"; - -// src/hydration.ts -import { tryResolveSync } from "./thenable.js"; -import { noop } from "./utils.js"; -function defaultTransformerFn(data) { - return data; -} -function dehydrateMutation(mutation) { - return { - mutationKey: mutation.options.mutationKey, - state: mutation.state, - ...mutation.options.scope && { scope: mutation.options.scope }, - ...mutation.meta && { meta: mutation.meta } - }; -} -function dehydrateQuery(query, serializeData, shouldRedactErrors) { - const dehydratePromise = () => { - var _a; - const promise = (_a = query.promise) == null ? void 0 : _a.then(serializeData).catch((error) => { - if (!shouldRedactErrors(error)) { - return Promise.reject(error); - } - if (process.env.NODE_ENV !== "production") { - console.error( - `A query that was dehydrated as pending ended up rejecting. [${query.queryHash}]: ${error}; The error will be redacted in production builds` - ); - } - return Promise.reject(new Error("redacted")); - }); - promise == null ? void 0 : promise.catch(noop); - return promise; - }; - return { - dehydratedAt: Date.now(), - state: { - ...query.state, - ...query.state.data !== void 0 && { - data: serializeData(query.state.data) - } - }, - queryKey: query.queryKey, - queryHash: query.queryHash, - ...query.state.status === "pending" && { - promise: dehydratePromise() - }, - ...query.meta && { meta: query.meta } - }; -} -function defaultShouldDehydrateMutation(mutation) { - return mutation.state.isPaused; -} -function defaultShouldDehydrateQuery(query) { - return query.state.status === "success"; -} -function defaultShouldRedactErrors(_) { - return true; -} -function dehydrate(client, options = {}) { - var _a, _b, _c, _d; - const filterMutation = options.shouldDehydrateMutation ?? ((_a = client.getDefaultOptions().dehydrate) == null ? void 0 : _a.shouldDehydrateMutation) ?? defaultShouldDehydrateMutation; - const mutations = client.getMutationCache().getAll().flatMap( - (mutation) => filterMutation(mutation) ? [dehydrateMutation(mutation)] : [] - ); - const filterQuery = options.shouldDehydrateQuery ?? ((_b = client.getDefaultOptions().dehydrate) == null ? void 0 : _b.shouldDehydrateQuery) ?? defaultShouldDehydrateQuery; - const shouldRedactErrors = options.shouldRedactErrors ?? ((_c = client.getDefaultOptions().dehydrate) == null ? void 0 : _c.shouldRedactErrors) ?? defaultShouldRedactErrors; - const serializeData = options.serializeData ?? ((_d = client.getDefaultOptions().dehydrate) == null ? void 0 : _d.serializeData) ?? defaultTransformerFn; - const queries = client.getQueryCache().getAll().flatMap( - (query) => filterQuery(query) ? [dehydrateQuery(query, serializeData, shouldRedactErrors)] : [] - ); - return { mutations, queries }; -} -function hydrate(client, dehydratedState, options) { - var _a, _b; - if (typeof dehydratedState !== "object" || dehydratedState === null) { - return; - } - const mutationCache = client.getMutationCache(); - const queryCache = client.getQueryCache(); - const deserializeData = ((_a = options == null ? void 0 : options.defaultOptions) == null ? void 0 : _a.deserializeData) ?? ((_b = client.getDefaultOptions().hydrate) == null ? void 0 : _b.deserializeData) ?? defaultTransformerFn; - const mutations = dehydratedState.mutations || []; - const queries = dehydratedState.queries || []; - mutations.forEach(({ state, ...mutationOptions }) => { - var _a2, _b2; - mutationCache.build( - client, - { - ...(_a2 = client.getDefaultOptions().hydrate) == null ? void 0 : _a2.mutations, - ...(_b2 = options == null ? void 0 : options.defaultOptions) == null ? void 0 : _b2.mutations, - ...mutationOptions - }, - state - ); - }); - queries.forEach( - ({ queryKey, state, queryHash, meta, promise, dehydratedAt }) => { - var _a2, _b2; - const syncData = promise ? tryResolveSync(promise) : void 0; - const rawData = state.data === void 0 ? syncData == null ? void 0 : syncData.data : state.data; - const data = rawData === void 0 ? rawData : deserializeData(rawData); - let query = queryCache.get(queryHash); - const existingQueryIsPending = (query == null ? void 0 : query.state.status) === "pending"; - const existingQueryIsFetching = (query == null ? void 0 : query.state.fetchStatus) === "fetching"; - if (query) { - const hasNewerSyncData = syncData && // We only need this undefined check to handle older dehydration - // payloads that might not have dehydratedAt - dehydratedAt !== void 0 && dehydratedAt > query.state.dataUpdatedAt; - if (state.dataUpdatedAt > query.state.dataUpdatedAt || hasNewerSyncData) { - const { fetchStatus: _ignored, ...serializedState } = state; - query.setState({ - ...serializedState, - data - }); - } - } else { - query = queryCache.build( - client, - { - ...(_a2 = client.getDefaultOptions().hydrate) == null ? void 0 : _a2.queries, - ...(_b2 = options == null ? void 0 : options.defaultOptions) == null ? void 0 : _b2.queries, - queryKey, - queryHash, - meta - }, - // Reset fetch status to idle to avoid - // query being stuck in fetching state upon hydration - { - ...state, - data, - fetchStatus: "idle", - status: data !== void 0 ? "success" : state.status - } - ); - } - if (promise && !existingQueryIsPending && !existingQueryIsFetching && // Only hydrate if dehydration is newer than any existing data, - // this is always true for new queries - (dehydratedAt === void 0 || dehydratedAt > query.state.dataUpdatedAt)) { - query.fetch(void 0, { - // RSC transformed promises are not thenable - initialPromise: Promise.resolve(promise).then(deserializeData) - }).catch(noop); - } - } - ); -} -export { - defaultShouldDehydrateMutation, - defaultShouldDehydrateQuery, - dehydrate, - hydrate -}; -//# sourceMappingURL=hydration.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/hydration.js.map b/node_modules/@tanstack/query-core/build/legacy/hydration.js.map deleted file mode 100644 index c3c8a89..0000000 --- a/node_modules/@tanstack/query-core/build/legacy/hydration.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/hydration.ts"],"sourcesContent":["import { tryResolveSync } from './thenable'\nimport { noop } from './utils'\nimport type {\n DefaultError,\n MutationKey,\n MutationMeta,\n MutationOptions,\n MutationScope,\n QueryKey,\n QueryMeta,\n QueryOptions,\n} from './types'\nimport type { QueryClient } from './queryClient'\nimport type { Query, QueryState } from './query'\nimport type { Mutation, MutationState } from './mutation'\n\n// TYPES\ntype TransformerFn = (data: any) => any\nfunction defaultTransformerFn(data: any): any {\n return data\n}\n\nexport interface DehydrateOptions {\n serializeData?: TransformerFn\n shouldDehydrateMutation?: (mutation: Mutation) => boolean\n shouldDehydrateQuery?: (query: Query) => boolean\n shouldRedactErrors?: (error: unknown) => boolean\n}\n\nexport interface HydrateOptions {\n defaultOptions?: {\n deserializeData?: TransformerFn\n queries?: QueryOptions\n mutations?: MutationOptions\n }\n}\n\ninterface DehydratedMutation {\n mutationKey?: MutationKey\n state: MutationState\n meta?: MutationMeta\n scope?: MutationScope\n}\n\ninterface DehydratedQuery {\n queryHash: string\n queryKey: QueryKey\n state: QueryState\n promise?: Promise\n meta?: QueryMeta\n // This is only optional because older versions of Query might have dehydrated\n // without it which we need to handle for backwards compatibility.\n // This should be changed to required in the future.\n dehydratedAt?: number\n}\n\nexport interface DehydratedState {\n mutations: Array\n queries: Array\n}\n\n// FUNCTIONS\n\nfunction dehydrateMutation(mutation: Mutation): DehydratedMutation {\n return {\n mutationKey: mutation.options.mutationKey,\n state: mutation.state,\n ...(mutation.options.scope && { scope: mutation.options.scope }),\n ...(mutation.meta && { meta: mutation.meta }),\n }\n}\n\n// Most config is not dehydrated but instead meant to configure again when\n// consuming the de/rehydrated data, typically with useQuery on the client.\n// Sometimes it might make sense to prefetch data on the server and include\n// in the html-payload, but not consume it on the initial render.\nfunction dehydrateQuery(\n query: Query,\n serializeData: TransformerFn,\n shouldRedactErrors: (error: unknown) => boolean,\n): DehydratedQuery {\n const dehydratePromise = () => {\n const promise = query.promise?.then(serializeData).catch((error) => {\n if (!shouldRedactErrors(error)) {\n // Reject original error if it should not be redacted\n return Promise.reject(error)\n }\n // If not in production, log original error before rejecting redacted error\n if (process.env.NODE_ENV !== 'production') {\n console.error(\n `A query that was dehydrated as pending ended up rejecting. [${query.queryHash}]: ${error}; The error will be redacted in production builds`,\n )\n }\n return Promise.reject(new Error('redacted'))\n })\n\n // Avoid unhandled promise rejections\n // We need the promise we dehydrate to reject to get the correct result into\n // the query cache, but we also want to avoid unhandled promise rejections\n // in whatever environment the prefetches are happening in.\n promise?.catch(noop)\n\n return promise\n }\n\n return {\n dehydratedAt: Date.now(),\n state: {\n ...query.state,\n ...(query.state.data !== undefined && {\n data: serializeData(query.state.data),\n }),\n },\n queryKey: query.queryKey,\n queryHash: query.queryHash,\n ...(query.state.status === 'pending' && {\n promise: dehydratePromise(),\n }),\n ...(query.meta && { meta: query.meta }),\n }\n}\n\nexport function defaultShouldDehydrateMutation(mutation: Mutation) {\n return mutation.state.isPaused\n}\n\nexport function defaultShouldDehydrateQuery(query: Query) {\n return query.state.status === 'success'\n}\n\nfunction defaultShouldRedactErrors(_: unknown) {\n return true\n}\n\nexport function dehydrate(\n client: QueryClient,\n options: DehydrateOptions = {},\n): DehydratedState {\n const filterMutation =\n options.shouldDehydrateMutation ??\n client.getDefaultOptions().dehydrate?.shouldDehydrateMutation ??\n defaultShouldDehydrateMutation\n\n const mutations = client\n .getMutationCache()\n .getAll()\n .flatMap((mutation) =>\n filterMutation(mutation) ? [dehydrateMutation(mutation)] : [],\n )\n\n const filterQuery =\n options.shouldDehydrateQuery ??\n client.getDefaultOptions().dehydrate?.shouldDehydrateQuery ??\n defaultShouldDehydrateQuery\n\n const shouldRedactErrors =\n options.shouldRedactErrors ??\n client.getDefaultOptions().dehydrate?.shouldRedactErrors ??\n defaultShouldRedactErrors\n\n const serializeData =\n options.serializeData ??\n client.getDefaultOptions().dehydrate?.serializeData ??\n defaultTransformerFn\n\n const queries = client\n .getQueryCache()\n .getAll()\n .flatMap((query) =>\n filterQuery(query)\n ? [dehydrateQuery(query, serializeData, shouldRedactErrors)]\n : [],\n )\n\n return { mutations, queries }\n}\n\nexport function hydrate(\n client: QueryClient,\n dehydratedState: unknown,\n options?: HydrateOptions,\n): void {\n if (typeof dehydratedState !== 'object' || dehydratedState === null) {\n return\n }\n\n const mutationCache = client.getMutationCache()\n const queryCache = client.getQueryCache()\n const deserializeData =\n options?.defaultOptions?.deserializeData ??\n client.getDefaultOptions().hydrate?.deserializeData ??\n defaultTransformerFn\n\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n const mutations = (dehydratedState as DehydratedState).mutations || []\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n const queries = (dehydratedState as DehydratedState).queries || []\n\n mutations.forEach(({ state, ...mutationOptions }) => {\n mutationCache.build(\n client,\n {\n ...client.getDefaultOptions().hydrate?.mutations,\n ...options?.defaultOptions?.mutations,\n ...mutationOptions,\n },\n state,\n )\n })\n\n queries.forEach(\n ({ queryKey, state, queryHash, meta, promise, dehydratedAt }) => {\n const syncData = promise ? tryResolveSync(promise) : undefined\n const rawData = state.data === undefined ? syncData?.data : state.data\n const data = rawData === undefined ? rawData : deserializeData(rawData)\n\n let query = queryCache.get(queryHash)\n const existingQueryIsPending = query?.state.status === 'pending'\n const existingQueryIsFetching = query?.state.fetchStatus === 'fetching'\n\n // Do not hydrate if an existing query exists with newer data\n if (query) {\n const hasNewerSyncData =\n syncData &&\n // We only need this undefined check to handle older dehydration\n // payloads that might not have dehydratedAt\n dehydratedAt !== undefined &&\n dehydratedAt > query.state.dataUpdatedAt\n if (\n state.dataUpdatedAt > query.state.dataUpdatedAt ||\n hasNewerSyncData\n ) {\n // omit fetchStatus from dehydrated state\n // so that query stays in its current fetchStatus\n const { fetchStatus: _ignored, ...serializedState } = state\n query.setState({\n ...serializedState,\n data,\n })\n }\n } else {\n // Restore query\n query = queryCache.build(\n client,\n {\n ...client.getDefaultOptions().hydrate?.queries,\n ...options?.defaultOptions?.queries,\n queryKey,\n queryHash,\n meta,\n },\n // Reset fetch status to idle to avoid\n // query being stuck in fetching state upon hydration\n {\n ...state,\n data,\n fetchStatus: 'idle',\n status: data !== undefined ? 'success' : state.status,\n },\n )\n }\n\n if (\n promise &&\n !existingQueryIsPending &&\n !existingQueryIsFetching &&\n // Only hydrate if dehydration is newer than any existing data,\n // this is always true for new queries\n (dehydratedAt === undefined || dehydratedAt > query.state.dataUpdatedAt)\n ) {\n // This doesn't actually fetch - it just creates a retryer\n // which will re-use the passed `initialPromise`\n // Note that we need to call these even when data was synchronously\n // available, as we still need to set up the retryer\n query\n .fetch(undefined, {\n // RSC transformed promises are not thenable\n initialPromise: Promise.resolve(promise).then(deserializeData),\n })\n // Avoid unhandled promise rejections\n .catch(noop)\n }\n },\n )\n}\n"],"mappings":";;;AAAA,SAAS,sBAAsB;AAC/B,SAAS,YAAY;AAiBrB,SAAS,qBAAqB,MAAgB;AAC5C,SAAO;AACT;AA2CA,SAAS,kBAAkB,UAAwC;AACjE,SAAO;AAAA,IACL,aAAa,SAAS,QAAQ;AAAA,IAC9B,OAAO,SAAS;AAAA,IAChB,GAAI,SAAS,QAAQ,SAAS,EAAE,OAAO,SAAS,QAAQ,MAAM;AAAA,IAC9D,GAAI,SAAS,QAAQ,EAAE,MAAM,SAAS,KAAK;AAAA,EAC7C;AACF;AAMA,SAAS,eACP,OACA,eACA,oBACiB;AACjB,QAAM,mBAAmB,MAAM;AAjFjC;AAkFI,UAAM,WAAU,WAAM,YAAN,mBAAe,KAAK,eAAe,MAAM,CAAC,UAAU;AAClE,UAAI,CAAC,mBAAmB,KAAK,GAAG;AAE9B,eAAO,QAAQ,OAAO,KAAK;AAAA,MAC7B;AAEA,UAAI,QAAQ,IAAI,aA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O;AACT,cAAM,mBACJ;AAAA;AAAA,QAGA,iBAAiB,UACjB,eAAe,MAAM,MAAM;AAC7B,YACE,MAAM,gBAAgB,MAAM,MAAM,iBAClC,kBACA;AAGA,gBAAM,EAAE,aAAa,UAAU,GAAG,gBAAgB,IAAI;AACtD,gBAAM,SAAS;AAAA,YACb,GAAG;AAAA,YACH;AAAA,UACF,CAAC;AAAA,QACH;AAAA,MACF,OAAO;AAEL,gBAAQ,WAAW;AAAA,UACjB;AAAA,UACA;AAAA,YACE,IAAGD,MAAA,OAAO,kBAAkB,EAAE,YAA3B,gBAAAA,IAAoC;AAAA,YACvC,IAAGC,MAAA,mCAAS,mBAAT,gBAAAA,IAAyB;AAAA,YAC5B;AAAA,YACA;AAAA,YACA;AAAA,UACF;AAAA;AAAA;AAAA,UAGA;AAAA,YACE,GAAG;AAAA,YACH;AAAA,YACA,aAAa;AAAA,YACb,QAAQ,SAAS,SAAY,YAAY,MAAM;AAAA,UACjD;AAAA,QACF;AAAA,MACF;AAEA,UACE,WACA,CAAC,0BACD,CAAC;AAAA;AAAA,OAGA,iBAAiB,UAAa,eAAe,MAAM,MAAM,gBAC1D;AAKA,cACG,MAAM,QAAW;AAAA;AAAA,UAEhB,gBAAgB,QAAQ,QAAQ,OAAO,EAAE,KAAK,eAAe;AAAA,QAC/D,CAAC,EAEA,MAAM,IAAI;AAAA,MACf;AAAA,IACF;AAAA,EACF;AACF;","names":["_a","_b"]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/index.cjs b/node_modules/@tanstack/query-core/build/legacy/index.cjs deleted file mode 100644 index cac316e..0000000 --- a/node_modules/@tanstack/query-core/build/legacy/index.cjs +++ /dev/null @@ -1,110 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default")); -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// src/index.ts -var index_exports = {}; -__export(index_exports, { - CancelledError: () => import_retryer.CancelledError, - InfiniteQueryObserver: () => import_infiniteQueryObserver.InfiniteQueryObserver, - Mutation: () => import_mutation.Mutation, - MutationCache: () => import_mutationCache.MutationCache, - MutationObserver: () => import_mutationObserver.MutationObserver, - QueriesObserver: () => import_queriesObserver.QueriesObserver, - Query: () => import_query.Query, - QueryCache: () => import_queryCache.QueryCache, - QueryClient: () => import_queryClient.QueryClient, - QueryObserver: () => import_queryObserver.QueryObserver, - defaultScheduler: () => import_notifyManager.defaultScheduler, - defaultShouldDehydrateMutation: () => import_hydration.defaultShouldDehydrateMutation, - defaultShouldDehydrateQuery: () => import_hydration.defaultShouldDehydrateQuery, - dehydrate: () => import_hydration.dehydrate, - experimental_streamedQuery: () => import_streamedQuery.streamedQuery, - focusManager: () => import_focusManager.focusManager, - hashKey: () => import_utils.hashKey, - hydrate: () => import_hydration.hydrate, - isCancelledError: () => import_retryer.isCancelledError, - isServer: () => import_utils.isServer, - keepPreviousData: () => import_utils.keepPreviousData, - matchMutation: () => import_utils.matchMutation, - matchQuery: () => import_utils.matchQuery, - noop: () => import_utils.noop, - notifyManager: () => import_notifyManager.notifyManager, - onlineManager: () => import_onlineManager.onlineManager, - partialMatchKey: () => import_utils.partialMatchKey, - replaceEqualDeep: () => import_utils.replaceEqualDeep, - shouldThrowError: () => import_utils.shouldThrowError, - skipToken: () => import_utils.skipToken, - timeoutManager: () => import_timeoutManager.timeoutManager -}); -module.exports = __toCommonJS(index_exports); -var import_focusManager = require("./focusManager.cjs"); -var import_hydration = require("./hydration.cjs"); -var import_infiniteQueryObserver = require("./infiniteQueryObserver.cjs"); -var import_mutationCache = require("./mutationCache.cjs"); -var import_mutationObserver = require("./mutationObserver.cjs"); -var import_notifyManager = require("./notifyManager.cjs"); -var import_onlineManager = require("./onlineManager.cjs"); -var import_queriesObserver = require("./queriesObserver.cjs"); -var import_queryCache = require("./queryCache.cjs"); -var import_queryClient = require("./queryClient.cjs"); -var import_queryObserver = require("./queryObserver.cjs"); -var import_retryer = require("./retryer.cjs"); -var import_timeoutManager = require("./timeoutManager.cjs"); -var import_utils = require("./utils.cjs"); -var import_streamedQuery = require("./streamedQuery.cjs"); -var import_mutation = require("./mutation.cjs"); -var import_query = require("./query.cjs"); -__reExport(index_exports, require("./types.cjs"), module.exports); -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - CancelledError, - InfiniteQueryObserver, - Mutation, - MutationCache, - MutationObserver, - QueriesObserver, - Query, - QueryCache, - QueryClient, - QueryObserver, - defaultScheduler, - defaultShouldDehydrateMutation, - defaultShouldDehydrateQuery, - dehydrate, - experimental_streamedQuery, - focusManager, - hashKey, - hydrate, - isCancelledError, - isServer, - keepPreviousData, - matchMutation, - matchQuery, - noop, - notifyManager, - onlineManager, - partialMatchKey, - replaceEqualDeep, - shouldThrowError, - skipToken, - timeoutManager, - ...require("./types.cjs") -}); -//# sourceMappingURL=index.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/index.cjs.map b/node_modules/@tanstack/query-core/build/legacy/index.cjs.map deleted file mode 100644 index 239bda0..0000000 --- a/node_modules/@tanstack/query-core/build/legacy/index.cjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/index.ts"],"sourcesContent":["/* istanbul ignore file */\n\nexport { focusManager } from './focusManager'\nexport {\n defaultShouldDehydrateMutation,\n defaultShouldDehydrateQuery,\n dehydrate,\n hydrate,\n} from './hydration'\nexport { InfiniteQueryObserver } from './infiniteQueryObserver'\nexport { MutationCache } from './mutationCache'\nexport type { MutationCacheNotifyEvent } from './mutationCache'\nexport { MutationObserver } from './mutationObserver'\nexport { defaultScheduler, notifyManager } from './notifyManager'\nexport { onlineManager } from './onlineManager'\nexport { QueriesObserver } from './queriesObserver'\nexport { QueryCache } from './queryCache'\nexport type { QueryCacheNotifyEvent } from './queryCache'\nexport { QueryClient } from './queryClient'\nexport { QueryObserver } from './queryObserver'\nexport { CancelledError, isCancelledError } from './retryer'\nexport {\n timeoutManager,\n type ManagedTimerId,\n type TimeoutCallback,\n type TimeoutProvider,\n} from './timeoutManager'\nexport {\n hashKey,\n isServer,\n keepPreviousData,\n matchMutation,\n matchQuery,\n noop,\n partialMatchKey,\n replaceEqualDeep,\n shouldThrowError,\n skipToken,\n} from './utils'\nexport type { MutationFilters, QueryFilters, SkipToken, Updater } from './utils'\n\nexport { streamedQuery as experimental_streamedQuery } from './streamedQuery'\n\n// Types\nexport type {\n DehydratedState,\n DehydrateOptions,\n HydrateOptions,\n} from './hydration'\nexport { Mutation } from './mutation'\nexport type { MutationState } from './mutation'\nexport type { QueriesObserverOptions } from './queriesObserver'\nexport { Query } from './query'\nexport type { QueryState } from './query'\nexport * from './types'\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,0BAA6B;AAC7B,uBAKO;AACP,mCAAsC;AACtC,2BAA8B;AAE9B,8BAAiC;AACjC,2BAAgD;AAChD,2BAA8B;AAC9B,6BAAgC;AAChC,wBAA2B;AAE3B,yBAA4B;AAC5B,2BAA8B;AAC9B,qBAAiD;AACjD,4BAKO;AACP,mBAWO;AAGP,2BAA4D;AAQ5D,sBAAyB;AAGzB,mBAAsB;AAEtB,0BAAc,wBAtDd;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/index.d.cts b/node_modules/@tanstack/query-core/build/legacy/index.d.cts deleted file mode 100644 index 9d894bb..0000000 --- a/node_modules/@tanstack/query-core/build/legacy/index.d.cts +++ /dev/null @@ -1,10 +0,0 @@ -export { focusManager } from './focusManager.cjs'; -export { T as AnyDataTag, b7 as CancelOptions, C as CancelledError, V as DataTag, G as DefaultError, b6 as DefaultOptions, ak as DefaultedInfiniteQueryObserverOptions, ai as DefaultedQueryObserverOptions, aP as DefinedInfiniteQueryObserverResult, aG as DefinedQueryObserverResult, w as DehydrateOptions, D as DehydratedState, B as DistributiveOmit, $ as Enabled, an as EnsureInfiniteQueryDataOptions, am as EnsureQueryDataOptions, ao as FetchInfiniteQueryOptions, av as FetchNextPageOptions, aw as FetchPreviousPageOptions, al as FetchQueryOptions, ay as FetchStatus, a7 as GetNextPageParamFunction, a6 as GetPreviousPageParamFunction, H as HydrateOptions, W as InferDataFromTag, X as InferErrorFromTag, a8 as InfiniteData, aI as InfiniteQueryObserverBaseResult, aL as InfiniteQueryObserverLoadingErrorResult, aK as InfiniteQueryObserverLoadingResult, aj as InfiniteQueryObserverOptions, aJ as InfiniteQueryObserverPendingResult, aO as InfiniteQueryObserverPlaceholderResult, aM as InfiniteQueryObserverRefetchErrorResult, aQ as InfiniteQueryObserverResult, aN as InfiniteQueryObserverSuccessResult, ae as InfiniteQueryPageParamsOptions, a2 as InitialDataFunction, ad as InitialPageParam, at as InvalidateOptions, ar as InvalidateQueryFilters, a_ as MutateFunction, aZ as MutateOptions, x as Mutation, M as MutationCache, c as MutationCacheNotifyEvent, u as MutationFilters, aW as MutationFunction, aV as MutationFunctionContext, aR as MutationKey, aU as MutationMeta, e as MutationObserver, a$ as MutationObserverBaseResult, b2 as MutationObserverErrorResult, b0 as MutationObserverIdleResult, b1 as MutationObserverLoadingResult, aY as MutationObserverOptions, b4 as MutationObserverResult, b3 as MutationObserverSuccessResult, aX as MutationOptions, aT as MutationScope, y as MutationState, aS as MutationStatus, aa as NetworkMode, F as NoInfer, N as NonUndefinedGuard, ba as NotifyEvent, b9 as NotifyEventType, ab as NotifyOnChangeProps, O as OmitKeyof, E as Override, a3 as PlaceholderDataFunction, a4 as QueriesPlaceholderDataFunction, z as Query, Q as QueryCache, f as QueryCacheNotifyEvent, g as QueryClient, b5 as QueryClientConfig, v as QueryFilters, Y as QueryFunction, a1 as QueryFunctionContext, I as QueryKey, a5 as QueryKeyHashFunction, a9 as QueryMeta, i as QueryObserver, az as QueryObserverBaseResult, aC as QueryObserverLoadingErrorResult, aB as QueryObserverLoadingResult, ag as QueryObserverOptions, aA as QueryObserverPendingResult, aF as QueryObserverPlaceholderResult, aD as QueryObserverRefetchErrorResult, aH as QueryObserverResult, aE as QueryObserverSuccessResult, ac as QueryOptions, a0 as QueryPersister, A as QueryState, ax as QueryStatus, aq as RefetchOptions, as as RefetchQueryFilters, R as Register, au as ResetOptions, ap as ResultOptions, b8 as SetDataOptions, S as SkipToken, Z as StaleTime, _ as StaleTimeFunction, af as ThrowOnError, P as UnsetMarker, U as Updater, ah as WithRequired, K as dataTagErrorSymbol, J as dataTagSymbol, d as defaultShouldDehydrateMutation, a as defaultShouldDehydrateQuery, b as dehydrate, k as hashKey, h as hydrate, j as isCancelledError, l as isServer, m as keepPreviousData, n as matchMutation, o as matchQuery, p as noop, q as partialMatchKey, r as replaceEqualDeep, s as shouldThrowError, t as skipToken, L as unsetMarker } from './hydration-uphG6M-i.cjs'; -export { InfiniteQueryObserver } from './infiniteQueryObserver.cjs'; -export { defaultScheduler, notifyManager } from './notifyManager.cjs'; -export { onlineManager } from './onlineManager.cjs'; -export { QueriesObserver, QueriesObserverOptions } from './queriesObserver.cjs'; -export { ManagedTimerId, TimeoutCallback, TimeoutProvider, timeoutManager } from './timeoutManager.cjs'; -export { streamedQuery as experimental_streamedQuery } from './streamedQuery.cjs'; -import './subscribable.cjs'; -import './removable.cjs'; diff --git a/node_modules/@tanstack/query-core/build/legacy/index.d.ts b/node_modules/@tanstack/query-core/build/legacy/index.d.ts deleted file mode 100644 index 54af14c..0000000 --- a/node_modules/@tanstack/query-core/build/legacy/index.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -export { focusManager } from './focusManager.js'; -export { T as AnyDataTag, b7 as CancelOptions, C as CancelledError, V as DataTag, G as DefaultError, b6 as DefaultOptions, ak as DefaultedInfiniteQueryObserverOptions, ai as DefaultedQueryObserverOptions, aP as DefinedInfiniteQueryObserverResult, aG as DefinedQueryObserverResult, w as DehydrateOptions, D as DehydratedState, B as DistributiveOmit, $ as Enabled, an as EnsureInfiniteQueryDataOptions, am as EnsureQueryDataOptions, ao as FetchInfiniteQueryOptions, av as FetchNextPageOptions, aw as FetchPreviousPageOptions, al as FetchQueryOptions, ay as FetchStatus, a7 as GetNextPageParamFunction, a6 as GetPreviousPageParamFunction, H as HydrateOptions, W as InferDataFromTag, X as InferErrorFromTag, a8 as InfiniteData, aI as InfiniteQueryObserverBaseResult, aL as InfiniteQueryObserverLoadingErrorResult, aK as InfiniteQueryObserverLoadingResult, aj as InfiniteQueryObserverOptions, aJ as InfiniteQueryObserverPendingResult, aO as InfiniteQueryObserverPlaceholderResult, aM as InfiniteQueryObserverRefetchErrorResult, aQ as InfiniteQueryObserverResult, aN as InfiniteQueryObserverSuccessResult, ae as InfiniteQueryPageParamsOptions, a2 as InitialDataFunction, ad as InitialPageParam, at as InvalidateOptions, ar as InvalidateQueryFilters, a_ as MutateFunction, aZ as MutateOptions, x as Mutation, M as MutationCache, c as MutationCacheNotifyEvent, u as MutationFilters, aW as MutationFunction, aV as MutationFunctionContext, aR as MutationKey, aU as MutationMeta, e as MutationObserver, a$ as MutationObserverBaseResult, b2 as MutationObserverErrorResult, b0 as MutationObserverIdleResult, b1 as MutationObserverLoadingResult, aY as MutationObserverOptions, b4 as MutationObserverResult, b3 as MutationObserverSuccessResult, aX as MutationOptions, aT as MutationScope, y as MutationState, aS as MutationStatus, aa as NetworkMode, F as NoInfer, N as NonUndefinedGuard, ba as NotifyEvent, b9 as NotifyEventType, ab as NotifyOnChangeProps, O as OmitKeyof, E as Override, a3 as PlaceholderDataFunction, a4 as QueriesPlaceholderDataFunction, z as Query, Q as QueryCache, f as QueryCacheNotifyEvent, g as QueryClient, b5 as QueryClientConfig, v as QueryFilters, Y as QueryFunction, a1 as QueryFunctionContext, I as QueryKey, a5 as QueryKeyHashFunction, a9 as QueryMeta, i as QueryObserver, az as QueryObserverBaseResult, aC as QueryObserverLoadingErrorResult, aB as QueryObserverLoadingResult, ag as QueryObserverOptions, aA as QueryObserverPendingResult, aF as QueryObserverPlaceholderResult, aD as QueryObserverRefetchErrorResult, aH as QueryObserverResult, aE as QueryObserverSuccessResult, ac as QueryOptions, a0 as QueryPersister, A as QueryState, ax as QueryStatus, aq as RefetchOptions, as as RefetchQueryFilters, R as Register, au as ResetOptions, ap as ResultOptions, b8 as SetDataOptions, S as SkipToken, Z as StaleTime, _ as StaleTimeFunction, af as ThrowOnError, P as UnsetMarker, U as Updater, ah as WithRequired, K as dataTagErrorSymbol, J as dataTagSymbol, d as defaultShouldDehydrateMutation, a as defaultShouldDehydrateQuery, b as dehydrate, k as hashKey, h as hydrate, j as isCancelledError, l as isServer, m as keepPreviousData, n as matchMutation, o as matchQuery, p as noop, q as partialMatchKey, r as replaceEqualDeep, s as shouldThrowError, t as skipToken, L as unsetMarker } from './hydration-BlEVG2Lp.js'; -export { InfiniteQueryObserver } from './infiniteQueryObserver.js'; -export { defaultScheduler, notifyManager } from './notifyManager.js'; -export { onlineManager } from './onlineManager.js'; -export { QueriesObserver, QueriesObserverOptions } from './queriesObserver.js'; -export { ManagedTimerId, TimeoutCallback, TimeoutProvider, timeoutManager } from './timeoutManager.js'; -export { streamedQuery as experimental_streamedQuery } from './streamedQuery.js'; -import './subscribable.js'; -import './removable.js'; diff --git a/node_modules/@tanstack/query-core/build/legacy/index.js b/node_modules/@tanstack/query-core/build/legacy/index.js deleted file mode 100644 index 04a50d1..0000000 --- a/node_modules/@tanstack/query-core/build/legacy/index.js +++ /dev/null @@ -1,73 +0,0 @@ -import "./chunk-PXG64RU4.js"; - -// src/index.ts -import { focusManager } from "./focusManager.js"; -import { - defaultShouldDehydrateMutation, - defaultShouldDehydrateQuery, - dehydrate, - hydrate -} from "./hydration.js"; -import { InfiniteQueryObserver } from "./infiniteQueryObserver.js"; -import { MutationCache } from "./mutationCache.js"; -import { MutationObserver } from "./mutationObserver.js"; -import { defaultScheduler, notifyManager } from "./notifyManager.js"; -import { onlineManager } from "./onlineManager.js"; -import { QueriesObserver } from "./queriesObserver.js"; -import { QueryCache } from "./queryCache.js"; -import { QueryClient } from "./queryClient.js"; -import { QueryObserver } from "./queryObserver.js"; -import { CancelledError, isCancelledError } from "./retryer.js"; -import { - timeoutManager -} from "./timeoutManager.js"; -import { - hashKey, - isServer, - keepPreviousData, - matchMutation, - matchQuery, - noop, - partialMatchKey, - replaceEqualDeep, - shouldThrowError, - skipToken -} from "./utils.js"; -import { streamedQuery } from "./streamedQuery.js"; -import { Mutation } from "./mutation.js"; -import { Query } from "./query.js"; -export * from "./types.js"; -export { - CancelledError, - InfiniteQueryObserver, - Mutation, - MutationCache, - MutationObserver, - QueriesObserver, - Query, - QueryCache, - QueryClient, - QueryObserver, - defaultScheduler, - defaultShouldDehydrateMutation, - defaultShouldDehydrateQuery, - dehydrate, - streamedQuery as experimental_streamedQuery, - focusManager, - hashKey, - hydrate, - isCancelledError, - isServer, - keepPreviousData, - matchMutation, - matchQuery, - noop, - notifyManager, - onlineManager, - partialMatchKey, - replaceEqualDeep, - shouldThrowError, - skipToken, - timeoutManager -}; -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/index.js.map b/node_modules/@tanstack/query-core/build/legacy/index.js.map deleted file mode 100644 index 737d579..0000000 --- a/node_modules/@tanstack/query-core/build/legacy/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/index.ts"],"sourcesContent":["/* istanbul ignore file */\n\nexport { focusManager } from './focusManager'\nexport {\n defaultShouldDehydrateMutation,\n defaultShouldDehydrateQuery,\n dehydrate,\n hydrate,\n} from './hydration'\nexport { InfiniteQueryObserver } from './infiniteQueryObserver'\nexport { MutationCache } from './mutationCache'\nexport type { MutationCacheNotifyEvent } from './mutationCache'\nexport { MutationObserver } from './mutationObserver'\nexport { defaultScheduler, notifyManager } from './notifyManager'\nexport { onlineManager } from './onlineManager'\nexport { QueriesObserver } from './queriesObserver'\nexport { QueryCache } from './queryCache'\nexport type { QueryCacheNotifyEvent } from './queryCache'\nexport { QueryClient } from './queryClient'\nexport { QueryObserver } from './queryObserver'\nexport { CancelledError, isCancelledError } from './retryer'\nexport {\n timeoutManager,\n type ManagedTimerId,\n type TimeoutCallback,\n type TimeoutProvider,\n} from './timeoutManager'\nexport {\n hashKey,\n isServer,\n keepPreviousData,\n matchMutation,\n matchQuery,\n noop,\n partialMatchKey,\n replaceEqualDeep,\n shouldThrowError,\n skipToken,\n} from './utils'\nexport type { MutationFilters, QueryFilters, SkipToken, Updater } from './utils'\n\nexport { streamedQuery as experimental_streamedQuery } from './streamedQuery'\n\n// Types\nexport type {\n DehydratedState,\n DehydrateOptions,\n HydrateOptions,\n} from './hydration'\nexport { Mutation } from './mutation'\nexport type { MutationState } from './mutation'\nexport type { QueriesObserverOptions } from './queriesObserver'\nexport { Query } from './query'\nexport type { QueryState } from './query'\nexport * from './types'\n"],"mappings":";;;AAEA,SAAS,oBAAoB;AAC7B;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,6BAA6B;AACtC,SAAS,qBAAqB;AAE9B,SAAS,wBAAwB;AACjC,SAAS,kBAAkB,qBAAqB;AAChD,SAAS,qBAAqB;AAC9B,SAAS,uBAAuB;AAChC,SAAS,kBAAkB;AAE3B,SAAS,mBAAmB;AAC5B,SAAS,qBAAqB;AAC9B,SAAS,gBAAgB,wBAAwB;AACjD;AAAA,EACE;AAAA,OAIK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAGP,SAA0B,qBAAkC;AAQ5D,SAAS,gBAAgB;AAGzB,SAAS,aAAa;AAEtB,cAAc;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/infiniteQueryBehavior.cjs b/node_modules/@tanstack/query-core/build/legacy/infiniteQueryBehavior.cjs deleted file mode 100644 index c130091..0000000 --- a/node_modules/@tanstack/query-core/build/legacy/infiniteQueryBehavior.cjs +++ /dev/null @@ -1,146 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// src/infiniteQueryBehavior.ts -var infiniteQueryBehavior_exports = {}; -__export(infiniteQueryBehavior_exports, { - hasNextPage: () => hasNextPage, - hasPreviousPage: () => hasPreviousPage, - infiniteQueryBehavior: () => infiniteQueryBehavior -}); -module.exports = __toCommonJS(infiniteQueryBehavior_exports); -var import_utils = require("./utils.cjs"); -function infiniteQueryBehavior(pages) { - return { - onFetch: (context, query) => { - var _a, _b, _c, _d, _e; - const options = context.options; - const direction = (_c = (_b = (_a = context.fetchOptions) == null ? void 0 : _a.meta) == null ? void 0 : _b.fetchMore) == null ? void 0 : _c.direction; - const oldPages = ((_d = context.state.data) == null ? void 0 : _d.pages) || []; - const oldPageParams = ((_e = context.state.data) == null ? void 0 : _e.pageParams) || []; - let result = { pages: [], pageParams: [] }; - let currentPage = 0; - const fetchFn = async () => { - let cancelled = false; - const addSignalProperty = (object) => { - (0, import_utils.addConsumeAwareSignal)( - object, - () => context.signal, - () => cancelled = true - ); - }; - const queryFn = (0, import_utils.ensureQueryFn)(context.options, context.fetchOptions); - const fetchPage = async (data, param, previous) => { - if (cancelled) { - return Promise.reject(); - } - if (param == null && data.pages.length) { - return Promise.resolve(data); - } - const createQueryFnContext = () => { - const queryFnContext2 = { - client: context.client, - queryKey: context.queryKey, - pageParam: param, - direction: previous ? "backward" : "forward", - meta: context.options.meta - }; - addSignalProperty(queryFnContext2); - return queryFnContext2; - }; - const queryFnContext = createQueryFnContext(); - const page = await queryFn(queryFnContext); - const { maxPages } = context.options; - const addTo = previous ? import_utils.addToStart : import_utils.addToEnd; - return { - pages: addTo(data.pages, page, maxPages), - pageParams: addTo(data.pageParams, param, maxPages) - }; - }; - if (direction && oldPages.length) { - const previous = direction === "backward"; - const pageParamFn = previous ? getPreviousPageParam : getNextPageParam; - const oldData = { - pages: oldPages, - pageParams: oldPageParams - }; - const param = pageParamFn(options, oldData); - result = await fetchPage(oldData, param, previous); - } else { - const remainingPages = pages ?? oldPages.length; - do { - const param = currentPage === 0 ? oldPageParams[0] ?? options.initialPageParam : getNextPageParam(options, result); - if (currentPage > 0 && param == null) { - break; - } - result = await fetchPage(result, param); - currentPage++; - } while (currentPage < remainingPages); - } - return result; - }; - if (context.options.persister) { - context.fetchFn = () => { - var _a2, _b2; - return (_b2 = (_a2 = context.options).persister) == null ? void 0 : _b2.call( - _a2, - fetchFn, - { - client: context.client, - queryKey: context.queryKey, - meta: context.options.meta, - signal: context.signal - }, - query - ); - }; - } else { - context.fetchFn = fetchFn; - } - } - }; -} -function getNextPageParam(options, { pages, pageParams }) { - const lastIndex = pages.length - 1; - return pages.length > 0 ? options.getNextPageParam( - pages[lastIndex], - pages, - pageParams[lastIndex], - pageParams - ) : void 0; -} -function getPreviousPageParam(options, { pages, pageParams }) { - var _a; - return pages.length > 0 ? (_a = options.getPreviousPageParam) == null ? void 0 : _a.call(options, pages[0], pages, pageParams[0], pageParams) : void 0; -} -function hasNextPage(options, data) { - if (!data) return false; - return getNextPageParam(options, data) != null; -} -function hasPreviousPage(options, data) { - if (!data || !options.getPreviousPageParam) return false; - return getPreviousPageParam(options, data) != null; -} -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - hasNextPage, - hasPreviousPage, - infiniteQueryBehavior -}); -//# sourceMappingURL=infiniteQueryBehavior.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/infiniteQueryBehavior.cjs.map b/node_modules/@tanstack/query-core/build/legacy/infiniteQueryBehavior.cjs.map deleted file mode 100644 index d76f30f..0000000 --- a/node_modules/@tanstack/query-core/build/legacy/infiniteQueryBehavior.cjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/infiniteQueryBehavior.ts"],"sourcesContent":["import {\n addConsumeAwareSignal,\n addToEnd,\n addToStart,\n ensureQueryFn,\n} from './utils'\nimport type { QueryBehavior } from './query'\nimport type {\n InfiniteData,\n InfiniteQueryPageParamsOptions,\n OmitKeyof,\n QueryFunctionContext,\n QueryKey,\n} from './types'\n\nexport function infiniteQueryBehavior(\n pages?: number,\n): QueryBehavior> {\n return {\n onFetch: (context, query) => {\n const options = context.options as InfiniteQueryPageParamsOptions\n const direction = context.fetchOptions?.meta?.fetchMore?.direction\n const oldPages = context.state.data?.pages || []\n const oldPageParams = context.state.data?.pageParams || []\n let result: InfiniteData = { pages: [], pageParams: [] }\n let currentPage = 0\n\n const fetchFn = async () => {\n let cancelled = false\n const addSignalProperty = (object: unknown) => {\n addConsumeAwareSignal(\n object,\n () => context.signal,\n () => (cancelled = true),\n )\n }\n\n const queryFn = ensureQueryFn(context.options, context.fetchOptions)\n\n // Create function to fetch a page\n const fetchPage = async (\n data: InfiniteData,\n param: unknown,\n previous?: boolean,\n ): Promise> => {\n if (cancelled) {\n return Promise.reject()\n }\n\n if (param == null && data.pages.length) {\n return Promise.resolve(data)\n }\n\n const createQueryFnContext = () => {\n const queryFnContext: OmitKeyof<\n QueryFunctionContext,\n 'signal'\n > = {\n client: context.client,\n queryKey: context.queryKey,\n pageParam: param,\n direction: previous ? 'backward' : 'forward',\n meta: context.options.meta,\n }\n addSignalProperty(queryFnContext)\n return queryFnContext as QueryFunctionContext\n }\n\n const queryFnContext = createQueryFnContext()\n\n const page = await queryFn(queryFnContext)\n\n const { maxPages } = context.options\n const addTo = previous ? addToStart : addToEnd\n\n return {\n pages: addTo(data.pages, page, maxPages),\n pageParams: addTo(data.pageParams, param, maxPages),\n }\n }\n\n // fetch next / previous page?\n if (direction && oldPages.length) {\n const previous = direction === 'backward'\n const pageParamFn = previous ? getPreviousPageParam : getNextPageParam\n const oldData = {\n pages: oldPages,\n pageParams: oldPageParams,\n }\n const param = pageParamFn(options, oldData)\n\n result = await fetchPage(oldData, param, previous)\n } else {\n const remainingPages = pages ?? oldPages.length\n\n // Fetch all pages\n do {\n const param =\n currentPage === 0\n ? (oldPageParams[0] ?? options.initialPageParam)\n : getNextPageParam(options, result)\n if (currentPage > 0 && param == null) {\n break\n }\n result = await fetchPage(result, param)\n currentPage++\n } while (currentPage < remainingPages)\n }\n\n return result\n }\n if (context.options.persister) {\n context.fetchFn = () => {\n return context.options.persister?.(\n fetchFn as any,\n {\n client: context.client,\n queryKey: context.queryKey,\n meta: context.options.meta,\n signal: context.signal,\n },\n query,\n )\n }\n } else {\n context.fetchFn = fetchFn\n }\n },\n }\n}\n\nfunction getNextPageParam(\n options: InfiniteQueryPageParamsOptions,\n { pages, pageParams }: InfiniteData,\n): unknown | undefined {\n const lastIndex = pages.length - 1\n return pages.length > 0\n ? options.getNextPageParam(\n pages[lastIndex],\n pages,\n pageParams[lastIndex],\n pageParams,\n )\n : undefined\n}\n\nfunction getPreviousPageParam(\n options: InfiniteQueryPageParamsOptions,\n { pages, pageParams }: InfiniteData,\n): unknown | undefined {\n return pages.length > 0\n ? options.getPreviousPageParam?.(pages[0], pages, pageParams[0], pageParams)\n : undefined\n}\n\n/**\n * Checks if there is a next page.\n */\nexport function hasNextPage(\n options: InfiniteQueryPageParamsOptions,\n data?: InfiniteData,\n): boolean {\n if (!data) return false\n return getNextPageParam(options, data) != null\n}\n\n/**\n * Checks if there is a previous page.\n */\nexport function hasPreviousPage(\n options: InfiniteQueryPageParamsOptions,\n data?: InfiniteData,\n): boolean {\n if (!data || !options.getPreviousPageParam) return false\n return getPreviousPageParam(options, data) != null\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAKO;AAUA,SAAS,sBACd,OACsE;AACtE,SAAO;AAAA,IACL,SAAS,CAAC,SAAS,UAAU;AAnBjC;AAoBM,YAAM,UAAU,QAAQ;AACxB,YAAM,aAAY,yBAAQ,iBAAR,mBAAsB,SAAtB,mBAA4B,cAA5B,mBAAuC;AACzD,YAAM,aAAW,aAAQ,MAAM,SAAd,mBAAoB,UAAS,CAAC;AAC/C,YAAM,kBAAgB,aAAQ,MAAM,SAAd,mBAAoB,eAAc,CAAC;AACzD,UAAI,SAAgC,EAAE,OAAO,CAAC,GAAG,YAAY,CAAC,EAAE;AAChE,UAAI,cAAc;AAElB,YAAM,UAAU,YAAY;AAC1B,YAAI,YAAY;AAChB,cAAM,oBAAoB,CAAC,WAAoB;AAC7C;AAAA,YACE;AAAA,YACA,MAAM,QAAQ;AAAA,YACd,MAAO,YAAY;AAAA,UACrB;AAAA,QACF;AAEA,cAAM,cAAU,4BAAc,QAAQ,SAAS,QAAQ,YAAY;AAGnE,cAAM,YAAY,OAChB,MACA,OACA,aACmC;AACnC,cAAI,WAAW;AAC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UAAU,MAAM;AAhHhC,cAAAC,KAAAC;AAiHU,kBAAOA,OAAAD,MAAA,QAAQ,SAAQ,cAAhB,gBAAAC,IAAA;AAAA,YAAAD;AAAA,YACL;AAAA,YACA;AAAA,cACE,QAAQ,QAAQ;AAAA,cAChB,UAAU,QAAQ;AAAA,cAClB,MAAM,QAAQ,QAAQ;AAAA,cACtB,QAAQ,QAAQ;AAAA,YAClB;AAAA,YACA;AAAA;AAAA,QAEJ;AAAA,MACF,OAAO;AACL,gBAAQ,UAAU;AAAA,MACpB;AAAA,IACF;AAAA,EACF;AACF;AAEA,SAAS,iBACP,SACA,EAAE,OAAO,WAAW,GACC;AACrB,QAAM,YAAY,MAAM,SAAS;AACjC,SAAO,MAAM,SAAS,IAClB,QAAQ;AAAA,IACN,MAAM,SAAS;AAAA,IACf;AAAA,IACA,WAAW,SAAS;AAAA,IACpB;AAAA,EACF,IACA;AACN;AAEA,SAAS,qBACP,SACA,EAAE,OAAO,WAAW,GACC;AArJvB;AAsJE,SAAO,MAAM,SAAS,KAClB,aAAQ,yBAAR,iCAA+B,MAAM,CAAC,GAAG,OAAO,WAAW,CAAC,GAAG,cAC/D;AACN;AAKO,SAAS,YACd,SACA,MACS;AACT,MAAI,CAAC,KAAM,QAAO;AAClB,SAAO,iBAAiB,SAAS,IAAI,KAAK;AAC5C;AAKO,SAAS,gBACd,SACA,MACS;AACT,MAAI,CAAC,QAAQ,CAAC,QAAQ,qBAAsB,QAAO;AACnD,SAAO,qBAAqB,SAAS,IAAI,KAAK;AAChD;","names":["queryFnContext","_a","_b"]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/infiniteQueryBehavior.d.cts b/node_modules/@tanstack/query-core/build/legacy/infiniteQueryBehavior.d.cts deleted file mode 100644 index 8a7fd8a..0000000 --- a/node_modules/@tanstack/query-core/build/legacy/infiniteQueryBehavior.d.cts +++ /dev/null @@ -1,15 +0,0 @@ -import { bb as QueryBehavior, a8 as InfiniteData, ae as InfiniteQueryPageParamsOptions } from './hydration-uphG6M-i.cjs'; -import './removable.cjs'; -import './subscribable.cjs'; - -declare function infiniteQueryBehavior(pages?: number): QueryBehavior>; -/** - * Checks if there is a next page. - */ -declare function hasNextPage(options: InfiniteQueryPageParamsOptions, data?: InfiniteData): boolean; -/** - * Checks if there is a previous page. - */ -declare function hasPreviousPage(options: InfiniteQueryPageParamsOptions, data?: InfiniteData): boolean; - -export { hasNextPage, hasPreviousPage, infiniteQueryBehavior }; diff --git a/node_modules/@tanstack/query-core/build/legacy/infiniteQueryBehavior.d.ts b/node_modules/@tanstack/query-core/build/legacy/infiniteQueryBehavior.d.ts deleted file mode 100644 index a9a90e2..0000000 --- a/node_modules/@tanstack/query-core/build/legacy/infiniteQueryBehavior.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { bb as QueryBehavior, a8 as InfiniteData, ae as InfiniteQueryPageParamsOptions } from './hydration-BlEVG2Lp.js'; -import './removable.js'; -import './subscribable.js'; - -declare function infiniteQueryBehavior(pages?: number): QueryBehavior>; -/** - * Checks if there is a next page. - */ -declare function hasNextPage(options: InfiniteQueryPageParamsOptions, data?: InfiniteData): boolean; -/** - * Checks if there is a previous page. - */ -declare function hasPreviousPage(options: InfiniteQueryPageParamsOptions, data?: InfiniteData): boolean; - -export { hasNextPage, hasPreviousPage, infiniteQueryBehavior }; diff --git a/node_modules/@tanstack/query-core/build/legacy/infiniteQueryBehavior.js b/node_modules/@tanstack/query-core/build/legacy/infiniteQueryBehavior.js deleted file mode 100644 index d115b5e..0000000 --- a/node_modules/@tanstack/query-core/build/legacy/infiniteQueryBehavior.js +++ /dev/null @@ -1,126 +0,0 @@ -import "./chunk-PXG64RU4.js"; - -// src/infiniteQueryBehavior.ts -import { - addConsumeAwareSignal, - addToEnd, - addToStart, - ensureQueryFn -} from "./utils.js"; -function infiniteQueryBehavior(pages) { - return { - onFetch: (context, query) => { - var _a, _b, _c, _d, _e; - const options = context.options; - const direction = (_c = (_b = (_a = context.fetchOptions) == null ? void 0 : _a.meta) == null ? void 0 : _b.fetchMore) == null ? void 0 : _c.direction; - const oldPages = ((_d = context.state.data) == null ? void 0 : _d.pages) || []; - const oldPageParams = ((_e = context.state.data) == null ? void 0 : _e.pageParams) || []; - let result = { pages: [], pageParams: [] }; - let currentPage = 0; - const fetchFn = async () => { - let cancelled = false; - const addSignalProperty = (object) => { - addConsumeAwareSignal( - object, - () => context.signal, - () => cancelled = true - ); - }; - const queryFn = ensureQueryFn(context.options, context.fetchOptions); - const fetchPage = async (data, param, previous) => { - if (cancelled) { - return Promise.reject(); - } - if (param == null && data.pages.length) { - return Promise.resolve(data); - } - const createQueryFnContext = () => { - const queryFnContext2 = { - client: context.client, - queryKey: context.queryKey, - pageParam: param, - direction: previous ? "backward" : "forward", - meta: context.options.meta - }; - addSignalProperty(queryFnContext2); - return queryFnContext2; - }; - const queryFnContext = createQueryFnContext(); - const page = await queryFn(queryFnContext); - const { maxPages } = context.options; - const addTo = previous ? addToStart : addToEnd; - return { - pages: addTo(data.pages, page, maxPages), - pageParams: addTo(data.pageParams, param, maxPages) - }; - }; - if (direction && oldPages.length) { - const previous = direction === "backward"; - const pageParamFn = previous ? getPreviousPageParam : getNextPageParam; - const oldData = { - pages: oldPages, - pageParams: oldPageParams - }; - const param = pageParamFn(options, oldData); - result = await fetchPage(oldData, param, previous); - } else { - const remainingPages = pages ?? oldPages.length; - do { - const param = currentPage === 0 ? oldPageParams[0] ?? options.initialPageParam : getNextPageParam(options, result); - if (currentPage > 0 && param == null) { - break; - } - result = await fetchPage(result, param); - currentPage++; - } while (currentPage < remainingPages); - } - return result; - }; - if (context.options.persister) { - context.fetchFn = () => { - var _a2, _b2; - return (_b2 = (_a2 = context.options).persister) == null ? void 0 : _b2.call( - _a2, - fetchFn, - { - client: context.client, - queryKey: context.queryKey, - meta: context.options.meta, - signal: context.signal - }, - query - ); - }; - } else { - context.fetchFn = fetchFn; - } - } - }; -} -function getNextPageParam(options, { pages, pageParams }) { - const lastIndex = pages.length - 1; - return pages.length > 0 ? options.getNextPageParam( - pages[lastIndex], - pages, - pageParams[lastIndex], - pageParams - ) : void 0; -} -function getPreviousPageParam(options, { pages, pageParams }) { - var _a; - return pages.length > 0 ? (_a = options.getPreviousPageParam) == null ? void 0 : _a.call(options, pages[0], pages, pageParams[0], pageParams) : void 0; -} -function hasNextPage(options, data) { - if (!data) return false; - return getNextPageParam(options, data) != null; -} -function hasPreviousPage(options, data) { - if (!data || !options.getPreviousPageParam) return false; - return getPreviousPageParam(options, data) != null; -} -export { - hasNextPage, - hasPreviousPage, - infiniteQueryBehavior -}; -//# sourceMappingURL=infiniteQueryBehavior.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/infiniteQueryBehavior.js.map b/node_modules/@tanstack/query-core/build/legacy/infiniteQueryBehavior.js.map deleted file mode 100644 index 5b77d0c..0000000 --- a/node_modules/@tanstack/query-core/build/legacy/infiniteQueryBehavior.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/infiniteQueryBehavior.ts"],"sourcesContent":["import {\n addConsumeAwareSignal,\n addToEnd,\n addToStart,\n ensureQueryFn,\n} from './utils'\nimport type { QueryBehavior } from './query'\nimport type {\n InfiniteData,\n InfiniteQueryPageParamsOptions,\n OmitKeyof,\n QueryFunctionContext,\n QueryKey,\n} from './types'\n\nexport function infiniteQueryBehavior(\n pages?: number,\n): QueryBehavior> {\n return {\n onFetch: (context, query) => {\n const options = context.options as InfiniteQueryPageParamsOptions\n const direction = context.fetchOptions?.meta?.fetchMore?.direction\n const oldPages = context.state.data?.pages || []\n const oldPageParams = context.state.data?.pageParams || []\n let result: InfiniteData = { pages: [], pageParams: [] }\n let currentPage = 0\n\n const fetchFn = async () => {\n let cancelled = false\n const addSignalProperty = (object: unknown) => {\n addConsumeAwareSignal(\n object,\n () => context.signal,\n () => (cancelled = true),\n )\n }\n\n const queryFn = ensureQueryFn(context.options, context.fetchOptions)\n\n // Create function to fetch a page\n const fetchPage = async (\n data: InfiniteData,\n param: unknown,\n previous?: boolean,\n ): Promise> => {\n if (cancelled) {\n return Promise.reject()\n }\n\n if (param == null && data.pages.length) {\n return Promise.resolve(data)\n }\n\n const createQueryFnContext = () => {\n const queryFnContext: OmitKeyof<\n QueryFunctionContext,\n 'signal'\n > = {\n client: context.client,\n queryKey: context.queryKey,\n pageParam: param,\n direction: previous ? 'backward' : 'forward',\n meta: context.options.meta,\n }\n addSignalProperty(queryFnContext)\n return queryFnContext as QueryFunctionContext\n }\n\n const queryFnContext = createQueryFnContext()\n\n const page = await queryFn(queryFnContext)\n\n const { maxPages } = context.options\n const addTo = previous ? addToStart : addToEnd\n\n return {\n pages: addTo(data.pages, page, maxPages),\n pageParams: addTo(data.pageParams, param, maxPages),\n }\n }\n\n // fetch next / previous page?\n if (direction && oldPages.length) {\n const previous = direction === 'backward'\n const pageParamFn = previous ? getPreviousPageParam : getNextPageParam\n const oldData = {\n pages: oldPages,\n pageParams: oldPageParams,\n }\n const param = pageParamFn(options, oldData)\n\n result = await fetchPage(oldData, param, previous)\n } else {\n const remainingPages = pages ?? oldPages.length\n\n // Fetch all pages\n do {\n const param =\n currentPage === 0\n ? (oldPageParams[0] ?? options.initialPageParam)\n : getNextPageParam(options, result)\n if (currentPage > 0 && param == null) {\n break\n }\n result = await fetchPage(result, param)\n currentPage++\n } while (currentPage < remainingPages)\n }\n\n return result\n }\n if (context.options.persister) {\n context.fetchFn = () => {\n return context.options.persister?.(\n fetchFn as any,\n {\n client: context.client,\n queryKey: context.queryKey,\n meta: context.options.meta,\n signal: context.signal,\n },\n query,\n )\n }\n } else {\n context.fetchFn = fetchFn\n }\n },\n }\n}\n\nfunction getNextPageParam(\n options: InfiniteQueryPageParamsOptions,\n { pages, pageParams }: InfiniteData,\n): unknown | undefined {\n const lastIndex = pages.length - 1\n return pages.length > 0\n ? options.getNextPageParam(\n pages[lastIndex],\n pages,\n pageParams[lastIndex],\n pageParams,\n )\n : undefined\n}\n\nfunction getPreviousPageParam(\n options: InfiniteQueryPageParamsOptions,\n { pages, pageParams }: InfiniteData,\n): unknown | undefined {\n return pages.length > 0\n ? options.getPreviousPageParam?.(pages[0], pages, pageParams[0], pageParams)\n : undefined\n}\n\n/**\n * Checks if there is a next page.\n */\nexport function hasNextPage(\n options: InfiniteQueryPageParamsOptions,\n data?: InfiniteData,\n): boolean {\n if (!data) return false\n return getNextPageParam(options, data) != null\n}\n\n/**\n * Checks if there is a previous page.\n */\nexport function hasPreviousPage(\n options: InfiniteQueryPageParamsOptions,\n data?: InfiniteData,\n): boolean {\n if (!data || !options.getPreviousPageParam) return false\n return getPreviousPageParam(options, data) != null\n}\n"],"mappings":";;;AAAA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAUA,SAAS,sBACd,OACsE;AACtE,SAAO;AAAA,IACL,SAAS,CAAC,SAAS,UAAU;AAnBjC;AAoBM,YAAM,UAAU,QAAQ;AACxB,YAAM,aAAY,yBAAQ,iBAAR,mBAAsB,SAAtB,mBAA4B,cAA5B,mBAAuC;AACzD,YAAM,aAAW,aAAQ,MAAM,SAAd,mBAAoB,UAAS,CAAC;AAC/C,YAAM,kBAAgB,aAAQ,MAAM,SAAd,mBAAoB,eAAc,CAAC;AACzD,UAAI,SAAgC,EAAE,OAAO,CAAC,GAAG,YAAY,CAAC,EAAE;AAChE,UAAI,cAAc;AAElB,YAAM,UAAU,YAAY;AAC1B,YAAI,YAAY;AAChB,cAAM,oBAAoB,CAAC,WAAoB;AAC7C;AAAA,YACE;AAAA,YACA,MAAM,QAAQ;AAAA,YACd,MAAO,YAAY;AAAA,UACrB;AAAA,QACF;AAEA,cAAM,UAAU,cAAc,QAAQ,SAAS,QAAQ,YAAY;AAGnE,cAAM,YAAY,OAChB,MACA,OACA,aACmC;AACnC,cAAI,WAAW;AACb,mBAAO,QAAQ,OAAO;AAAA,UACxB;AAEA,cAAI,SAAS,QAAQ,KAAK,MAAM,QAAQ;AACtC,mBAAO,QAAQ,QAAQ,IAA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;AAAA,YACL;AAAA,YACA;AAAA,cACE,QAAQ,QAAQ;AAAA,cAChB,UAAU,QAAQ;AAAA,cAClB,MAAM,QAAQ,QAAQ;AAAA,cACtB,QAAQ,QAAQ;AAAA,YAClB;AAAA,YACA;AAAA;AAAA,QAEJ;AAAA,MACF,OAAO;AACL,gBAAQ,UAAU;AAAA,MACpB;AAAA,IACF;AAAA,EACF;AACF;AAEA,SAAS,iBACP,SACA,EAAE,OAAO,WAAW,GACC;AACrB,QAAM,YAAY,MAAM,SAAS;AACjC,SAAO,MAAM,SAAS,IAClB,QAAQ;AAAA,IACN,MAAM,SAAS;AAAA,IACf;AAAA,IACA,WAAW,SAAS;AAAA,IACpB;AAAA,EACF,IACA;AACN;AAEA,SAAS,qBACP,SACA,EAAE,OAAO,WAAW,GACC;AArJvB;AAsJE,SAAO,MAAM,SAAS,KAClB,aAAQ,yBAAR,iCAA+B,MAAM,CAAC,GAAG,OAAO,WAAW,CAAC,GAAG,cAC/D;AACN;AAKO,SAAS,YACd,SACA,MACS;AACT,MAAI,CAAC,KAAM,QAAO;AAClB,SAAO,iBAAiB,SAAS,IAAI,KAAK;AAC5C;AAKO,SAAS,gBACd,SACA,MACS;AACT,MAAI,CAAC,QAAQ,CAAC,QAAQ,qBAAsB,QAAO;AACnD,SAAO,qBAAqB,SAAS,IAAI,KAAK;AAChD;","names":["queryFnContext","_a","_b"]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/infiniteQueryObserver.cjs b/node_modules/@tanstack/query-core/build/legacy/infiniteQueryObserver.cjs deleted file mode 100644 index 1b4de6d..0000000 --- a/node_modules/@tanstack/query-core/build/legacy/infiniteQueryObserver.cjs +++ /dev/null @@ -1,93 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// src/infiniteQueryObserver.ts -var infiniteQueryObserver_exports = {}; -__export(infiniteQueryObserver_exports, { - InfiniteQueryObserver: () => InfiniteQueryObserver -}); -module.exports = __toCommonJS(infiniteQueryObserver_exports); -var import_queryObserver = require("./queryObserver.cjs"); -var import_infiniteQueryBehavior = require("./infiniteQueryBehavior.cjs"); -var InfiniteQueryObserver = class extends import_queryObserver.QueryObserver { - constructor(client, options) { - super(client, options); - } - bindMethods() { - super.bindMethods(); - this.fetchNextPage = this.fetchNextPage.bind(this); - this.fetchPreviousPage = this.fetchPreviousPage.bind(this); - } - setOptions(options) { - super.setOptions({ - ...options, - behavior: (0, import_infiniteQueryBehavior.infiniteQueryBehavior)() - }); - } - getOptimisticResult(options) { - options.behavior = (0, import_infiniteQueryBehavior.infiniteQueryBehavior)(); - return super.getOptimisticResult(options); - } - fetchNextPage(options) { - return this.fetch({ - ...options, - meta: { - fetchMore: { direction: "forward" } - } - }); - } - fetchPreviousPage(options) { - return this.fetch({ - ...options, - meta: { - fetchMore: { direction: "backward" } - } - }); - } - createResult(query, options) { - var _a, _b; - const { state } = query; - const parentResult = super.createResult(query, options); - const { isFetching, isRefetching, isError, isRefetchError } = parentResult; - const fetchDirection = (_b = (_a = state.fetchMeta) == null ? void 0 : _a.fetchMore) == null ? void 0 : _b.direction; - const isFetchNextPageError = isError && fetchDirection === "forward"; - const isFetchingNextPage = isFetching && fetchDirection === "forward"; - const isFetchPreviousPageError = isError && fetchDirection === "backward"; - const isFetchingPreviousPage = isFetching && fetchDirection === "backward"; - const result = { - ...parentResult, - fetchNextPage: this.fetchNextPage, - fetchPreviousPage: this.fetchPreviousPage, - hasNextPage: (0, import_infiniteQueryBehavior.hasNextPage)(options, state.data), - hasPreviousPage: (0, import_infiniteQueryBehavior.hasPreviousPage)(options, state.data), - isFetchNextPageError, - isFetchingNextPage, - isFetchPreviousPageError, - isFetchingPreviousPage, - isRefetchError: isRefetchError && !isFetchNextPageError && !isFetchPreviousPageError, - isRefetching: isRefetching && !isFetchingNextPage && !isFetchingPreviousPage - }; - return result; - } -}; -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - InfiniteQueryObserver -}); -//# sourceMappingURL=infiniteQueryObserver.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/infiniteQueryObserver.cjs.map b/node_modules/@tanstack/query-core/build/legacy/infiniteQueryObserver.cjs.map deleted file mode 100644 index a4a85d8..0000000 --- a/node_modules/@tanstack/query-core/build/legacy/infiniteQueryObserver.cjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/infiniteQueryObserver.ts"],"sourcesContent":["import { QueryObserver } from './queryObserver'\nimport {\n hasNextPage,\n hasPreviousPage,\n infiniteQueryBehavior,\n} from './infiniteQueryBehavior'\nimport type { Subscribable } from './subscribable'\nimport type {\n DefaultError,\n DefaultedInfiniteQueryObserverOptions,\n FetchNextPageOptions,\n FetchPreviousPageOptions,\n InfiniteData,\n InfiniteQueryObserverBaseResult,\n InfiniteQueryObserverOptions,\n InfiniteQueryObserverResult,\n QueryKey,\n} from './types'\nimport type { QueryClient } from './queryClient'\nimport type { Query } from './query'\n\ntype InfiniteQueryObserverListener = (\n result: InfiniteQueryObserverResult,\n) => void\n\nexport class InfiniteQueryObserver<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = InfiniteData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n> extends QueryObserver<\n TQueryFnData,\n TError,\n TData,\n InfiniteData,\n TQueryKey\n> {\n // Type override\n subscribe!: Subscribable<\n InfiniteQueryObserverListener\n >['subscribe']\n\n // Type override\n getCurrentResult!: ReplaceReturnType<\n QueryObserver<\n TQueryFnData,\n TError,\n TData,\n InfiniteData,\n TQueryKey\n >['getCurrentResult'],\n InfiniteQueryObserverResult\n >\n\n // Type override\n protected fetch!: ReplaceReturnType<\n QueryObserver<\n TQueryFnData,\n TError,\n TData,\n InfiniteData,\n TQueryKey\n >['fetch'],\n Promise>\n >\n\n constructor(\n client: QueryClient,\n options: InfiniteQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n ) {\n super(client, options)\n }\n\n protected bindMethods(): void {\n super.bindMethods()\n this.fetchNextPage = this.fetchNextPage.bind(this)\n this.fetchPreviousPage = this.fetchPreviousPage.bind(this)\n }\n\n setOptions(\n options: InfiniteQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n ): void {\n super.setOptions({\n ...options,\n behavior: infiniteQueryBehavior(),\n })\n }\n\n getOptimisticResult(\n options: DefaultedInfiniteQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n ): InfiniteQueryObserverResult {\n options.behavior = infiniteQueryBehavior()\n return super.getOptimisticResult(options) as InfiniteQueryObserverResult<\n TData,\n TError\n >\n }\n\n fetchNextPage(\n options?: FetchNextPageOptions,\n ): Promise> {\n return this.fetch({\n ...options,\n meta: {\n fetchMore: { direction: 'forward' },\n },\n })\n }\n\n fetchPreviousPage(\n options?: FetchPreviousPageOptions,\n ): Promise> {\n return this.fetch({\n ...options,\n meta: {\n fetchMore: { direction: 'backward' },\n },\n })\n }\n\n protected createResult(\n query: Query<\n TQueryFnData,\n TError,\n InfiniteData,\n TQueryKey\n >,\n options: InfiniteQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n ): InfiniteQueryObserverResult {\n const { state } = query\n const parentResult = super.createResult(query, options)\n\n const { isFetching, isRefetching, isError, isRefetchError } = parentResult\n const fetchDirection = state.fetchMeta?.fetchMore?.direction\n\n const isFetchNextPageError = isError && fetchDirection === 'forward'\n const isFetchingNextPage = isFetching && fetchDirection === 'forward'\n\n const isFetchPreviousPageError = isError && fetchDirection === 'backward'\n const isFetchingPreviousPage = isFetching && fetchDirection === 'backward'\n\n const result: InfiniteQueryObserverBaseResult = {\n ...parentResult,\n fetchNextPage: this.fetchNextPage,\n fetchPreviousPage: this.fetchPreviousPage,\n hasNextPage: hasNextPage(options, state.data),\n hasPreviousPage: hasPreviousPage(options, state.data),\n isFetchNextPageError,\n isFetchingNextPage,\n isFetchPreviousPageError,\n isFetchingPreviousPage,\n isRefetchError:\n isRefetchError && !isFetchNextPageError && !isFetchPreviousPageError,\n isRefetching:\n isRefetching && !isFetchingNextPage && !isFetchingPreviousPage,\n }\n\n return result as InfiniteQueryObserverResult\n }\n}\n\ntype ReplaceReturnType<\n TFunction extends (...args: Array) => unknown,\n TReturn,\n> = (...args: Parameters) => TReturn\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,2BAA8B;AAC9B,mCAIO;AAoBA,IAAM,wBAAN,cAMG,mCAMR;AAAA,EA8BA,YACE,QACA,SAOA;AACA,UAAM,QAAQ,OAAO;AAAA,EACvB;AAAA,EAEU,cAAoB;AAC5B,UAAM,YAAY;AAClB,SAAK,gBAAgB,KAAK,cAAc,KAAK,IAAI;AACjD,SAAK,oBAAoB,KAAK,kBAAkB,KAAK,IAAI;AAAA,EAC3D;AAAA,EAEA,WACE,SAOM;AACN,UAAM,WAAW;AAAA,MACf,GAAG;AAAA,MACH,cAAU,oDAAsB;AAAA,IAClC,CAAC;AAAA,EACH;AAAA,EAEA,oBACE,SAO4C;AAC5C,YAAQ,eAAW,oDAAsB;AACzC,WAAO,MAAM,oBAAoB,OAAO;AAAA,EAI1C;AAAA,EAEA,cACE,SACqD;AACrD,WAAO,KAAK,MAAM;AAAA,MAChB,GAAG;AAAA,MACH,MAAM;AAAA,QACJ,WAAW,EAAE,WAAW,UAAU;AAAA,MACpC;AAAA,IACF,CAAC;AAAA,EACH;AAAA,EAEA,kBACE,SACqD;AACrD,WAAO,KAAK,MAAM;AAAA,MAChB,GAAG;AAAA,MACH,MAAM;AAAA,QACJ,WAAW,EAAE,WAAW,WAAW;AAAA,MACrC;AAAA,IACF,CAAC;AAAA,EACH;AAAA,EAEU,aACR,OAMA,SAO4C;AAzJhD;AA0JI,UAAM,EAAE,MAAM,IAAI;AAClB,UAAM,eAAe,MAAM,aAAa,OAAO,OAAO;AAEtD,UAAM,EAAE,YAAY,cAAc,SAAS,eAAe,IAAI;AAC9D,UAAM,kBAAiB,iBAAM,cAAN,mBAAiB,cAAjB,mBAA4B;AAEnD,UAAM,uBAAuB,WAAW,mBAAmB;AAC3D,UAAM,qBAAqB,cAAc,mBAAmB;AAE5D,UAAM,2BAA2B,WAAW,mBAAmB;AAC/D,UAAM,yBAAyB,cAAc,mBAAmB;AAEhE,UAAM,SAAyD;AAAA,MAC7D,GAAG;AAAA,MACH,eAAe,KAAK;AAAA,MACpB,mBAAmB,KAAK;AAAA,MACxB,iBAAa,0CAAY,SAAS,MAAM,IAAI;AAAA,MAC5C,qBAAiB,8CAAgB,SAAS,MAAM,IAAI;AAAA,MACpD;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,gBACE,kBAAkB,CAAC,wBAAwB,CAAC;AAAA,MAC9C,cACE,gBAAgB,CAAC,sBAAsB,CAAC;AAAA,IAC5C;AAEA,WAAO;AAAA,EACT;AACF;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/infiniteQueryObserver.d.cts b/node_modules/@tanstack/query-core/build/legacy/infiniteQueryObserver.d.cts deleted file mode 100644 index 296a938..0000000 --- a/node_modules/@tanstack/query-core/build/legacy/infiniteQueryObserver.d.cts +++ /dev/null @@ -1,20 +0,0 @@ -import { G as DefaultError, a8 as InfiniteData, I as QueryKey, i as QueryObserver, aQ as InfiniteQueryObserverResult, g as QueryClient, aj as InfiniteQueryObserverOptions, ak as DefaultedInfiniteQueryObserverOptions, av as FetchNextPageOptions, aw as FetchPreviousPageOptions, z as Query } from './hydration-uphG6M-i.cjs'; -import { Subscribable } from './subscribable.cjs'; -import './removable.cjs'; - -type InfiniteQueryObserverListener = (result: InfiniteQueryObserverResult) => void; -declare class InfiniteQueryObserver, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown> extends QueryObserver, TQueryKey> { - subscribe: Subscribable>['subscribe']; - getCurrentResult: ReplaceReturnType, TQueryKey>['getCurrentResult'], InfiniteQueryObserverResult>; - protected fetch: ReplaceReturnType, TQueryKey>['fetch'], Promise>>; - constructor(client: QueryClient, options: InfiniteQueryObserverOptions); - protected bindMethods(): void; - setOptions(options: InfiniteQueryObserverOptions): void; - getOptimisticResult(options: DefaultedInfiniteQueryObserverOptions): InfiniteQueryObserverResult; - fetchNextPage(options?: FetchNextPageOptions): Promise>; - fetchPreviousPage(options?: FetchPreviousPageOptions): Promise>; - protected createResult(query: Query, TQueryKey>, options: InfiniteQueryObserverOptions): InfiniteQueryObserverResult; -} -type ReplaceReturnType) => unknown, TReturn> = (...args: Parameters) => TReturn; - -export { InfiniteQueryObserver }; diff --git a/node_modules/@tanstack/query-core/build/legacy/infiniteQueryObserver.d.ts b/node_modules/@tanstack/query-core/build/legacy/infiniteQueryObserver.d.ts deleted file mode 100644 index 96dca65..0000000 --- a/node_modules/@tanstack/query-core/build/legacy/infiniteQueryObserver.d.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { G as DefaultError, a8 as InfiniteData, I as QueryKey, i as QueryObserver, aQ as InfiniteQueryObserverResult, g as QueryClient, aj as InfiniteQueryObserverOptions, ak as DefaultedInfiniteQueryObserverOptions, av as FetchNextPageOptions, aw as FetchPreviousPageOptions, z as Query } from './hydration-BlEVG2Lp.js'; -import { Subscribable } from './subscribable.js'; -import './removable.js'; - -type InfiniteQueryObserverListener = (result: InfiniteQueryObserverResult) => void; -declare class InfiniteQueryObserver, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown> extends QueryObserver, TQueryKey> { - subscribe: Subscribable>['subscribe']; - getCurrentResult: ReplaceReturnType, TQueryKey>['getCurrentResult'], InfiniteQueryObserverResult>; - protected fetch: ReplaceReturnType, TQueryKey>['fetch'], Promise>>; - constructor(client: QueryClient, options: InfiniteQueryObserverOptions); - protected bindMethods(): void; - setOptions(options: InfiniteQueryObserverOptions): void; - getOptimisticResult(options: DefaultedInfiniteQueryObserverOptions): InfiniteQueryObserverResult; - fetchNextPage(options?: FetchNextPageOptions): Promise>; - fetchPreviousPage(options?: FetchPreviousPageOptions): Promise>; - protected createResult(query: Query, TQueryKey>, options: InfiniteQueryObserverOptions): InfiniteQueryObserverResult; -} -type ReplaceReturnType) => unknown, TReturn> = (...args: Parameters) => TReturn; - -export { InfiniteQueryObserver }; diff --git a/node_modules/@tanstack/query-core/build/legacy/infiniteQueryObserver.js b/node_modules/@tanstack/query-core/build/legacy/infiniteQueryObserver.js deleted file mode 100644 index 101797f..0000000 --- a/node_modules/@tanstack/query-core/build/legacy/infiniteQueryObserver.js +++ /dev/null @@ -1,74 +0,0 @@ -import "./chunk-PXG64RU4.js"; - -// src/infiniteQueryObserver.ts -import { QueryObserver } from "./queryObserver.js"; -import { - hasNextPage, - hasPreviousPage, - infiniteQueryBehavior -} from "./infiniteQueryBehavior.js"; -var InfiniteQueryObserver = class extends QueryObserver { - constructor(client, options) { - super(client, options); - } - bindMethods() { - super.bindMethods(); - this.fetchNextPage = this.fetchNextPage.bind(this); - this.fetchPreviousPage = this.fetchPreviousPage.bind(this); - } - setOptions(options) { - super.setOptions({ - ...options, - behavior: infiniteQueryBehavior() - }); - } - getOptimisticResult(options) { - options.behavior = infiniteQueryBehavior(); - return super.getOptimisticResult(options); - } - fetchNextPage(options) { - return this.fetch({ - ...options, - meta: { - fetchMore: { direction: "forward" } - } - }); - } - fetchPreviousPage(options) { - return this.fetch({ - ...options, - meta: { - fetchMore: { direction: "backward" } - } - }); - } - createResult(query, options) { - var _a, _b; - const { state } = query; - const parentResult = super.createResult(query, options); - const { isFetching, isRefetching, isError, isRefetchError } = parentResult; - const fetchDirection = (_b = (_a = state.fetchMeta) == null ? void 0 : _a.fetchMore) == null ? void 0 : _b.direction; - const isFetchNextPageError = isError && fetchDirection === "forward"; - const isFetchingNextPage = isFetching && fetchDirection === "forward"; - const isFetchPreviousPageError = isError && fetchDirection === "backward"; - const isFetchingPreviousPage = isFetching && fetchDirection === "backward"; - const result = { - ...parentResult, - fetchNextPage: this.fetchNextPage, - fetchPreviousPage: this.fetchPreviousPage, - hasNextPage: hasNextPage(options, state.data), - hasPreviousPage: hasPreviousPage(options, state.data), - isFetchNextPageError, - isFetchingNextPage, - isFetchPreviousPageError, - isFetchingPreviousPage, - isRefetchError: isRefetchError && !isFetchNextPageError && !isFetchPreviousPageError, - isRefetching: isRefetching && !isFetchingNextPage && !isFetchingPreviousPage - }; - return result; - } -}; -export { - InfiniteQueryObserver -}; -//# sourceMappingURL=infiniteQueryObserver.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/infiniteQueryObserver.js.map b/node_modules/@tanstack/query-core/build/legacy/infiniteQueryObserver.js.map deleted file mode 100644 index 6893b34..0000000 --- a/node_modules/@tanstack/query-core/build/legacy/infiniteQueryObserver.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/infiniteQueryObserver.ts"],"sourcesContent":["import { QueryObserver } from './queryObserver'\nimport {\n hasNextPage,\n hasPreviousPage,\n infiniteQueryBehavior,\n} from './infiniteQueryBehavior'\nimport type { Subscribable } from './subscribable'\nimport type {\n DefaultError,\n DefaultedInfiniteQueryObserverOptions,\n FetchNextPageOptions,\n FetchPreviousPageOptions,\n InfiniteData,\n InfiniteQueryObserverBaseResult,\n InfiniteQueryObserverOptions,\n InfiniteQueryObserverResult,\n QueryKey,\n} from './types'\nimport type { QueryClient } from './queryClient'\nimport type { Query } from './query'\n\ntype InfiniteQueryObserverListener = (\n result: InfiniteQueryObserverResult,\n) => void\n\nexport class InfiniteQueryObserver<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = InfiniteData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n> extends QueryObserver<\n TQueryFnData,\n TError,\n TData,\n InfiniteData,\n TQueryKey\n> {\n // Type override\n subscribe!: Subscribable<\n InfiniteQueryObserverListener\n >['subscribe']\n\n // Type override\n getCurrentResult!: ReplaceReturnType<\n QueryObserver<\n TQueryFnData,\n TError,\n TData,\n InfiniteData,\n TQueryKey\n >['getCurrentResult'],\n InfiniteQueryObserverResult\n >\n\n // Type override\n protected fetch!: ReplaceReturnType<\n QueryObserver<\n TQueryFnData,\n TError,\n TData,\n InfiniteData,\n TQueryKey\n >['fetch'],\n Promise>\n >\n\n constructor(\n client: QueryClient,\n options: InfiniteQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n ) {\n super(client, options)\n }\n\n protected bindMethods(): void {\n super.bindMethods()\n this.fetchNextPage = this.fetchNextPage.bind(this)\n this.fetchPreviousPage = this.fetchPreviousPage.bind(this)\n }\n\n setOptions(\n options: InfiniteQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n ): void {\n super.setOptions({\n ...options,\n behavior: infiniteQueryBehavior(),\n })\n }\n\n getOptimisticResult(\n options: DefaultedInfiniteQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n ): InfiniteQueryObserverResult {\n options.behavior = infiniteQueryBehavior()\n return super.getOptimisticResult(options) as InfiniteQueryObserverResult<\n TData,\n TError\n >\n }\n\n fetchNextPage(\n options?: FetchNextPageOptions,\n ): Promise> {\n return this.fetch({\n ...options,\n meta: {\n fetchMore: { direction: 'forward' },\n },\n })\n }\n\n fetchPreviousPage(\n options?: FetchPreviousPageOptions,\n ): Promise> {\n return this.fetch({\n ...options,\n meta: {\n fetchMore: { direction: 'backward' },\n },\n })\n }\n\n protected createResult(\n query: Query<\n TQueryFnData,\n TError,\n InfiniteData,\n TQueryKey\n >,\n options: InfiniteQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n ): InfiniteQueryObserverResult {\n const { state } = query\n const parentResult = super.createResult(query, options)\n\n const { isFetching, isRefetching, isError, isRefetchError } = parentResult\n const fetchDirection = state.fetchMeta?.fetchMore?.direction\n\n const isFetchNextPageError = isError && fetchDirection === 'forward'\n const isFetchingNextPage = isFetching && fetchDirection === 'forward'\n\n const isFetchPreviousPageError = isError && fetchDirection === 'backward'\n const isFetchingPreviousPage = isFetching && fetchDirection === 'backward'\n\n const result: InfiniteQueryObserverBaseResult = {\n ...parentResult,\n fetchNextPage: this.fetchNextPage,\n fetchPreviousPage: this.fetchPreviousPage,\n hasNextPage: hasNextPage(options, state.data),\n hasPreviousPage: hasPreviousPage(options, state.data),\n isFetchNextPageError,\n isFetchingNextPage,\n isFetchPreviousPageError,\n isFetchingPreviousPage,\n isRefetchError:\n isRefetchError && !isFetchNextPageError && !isFetchPreviousPageError,\n isRefetching:\n isRefetching && !isFetchingNextPage && !isFetchingPreviousPage,\n }\n\n return result as InfiniteQueryObserverResult\n }\n}\n\ntype ReplaceReturnType<\n TFunction extends (...args: Array) => unknown,\n TReturn,\n> = (...args: Parameters) => TReturn\n"],"mappings":";;;AAAA,SAAS,qBAAqB;AAC9B;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAoBA,IAAM,wBAAN,cAMG,cAMR;AAAA,EA8BA,YACE,QACA,SAOA;AACA,UAAM,QAAQ,OAAO;AAAA,EACvB;AAAA,EAEU,cAAoB;AAC5B,UAAM,YAAY;AAClB,SAAK,gBAAgB,KAAK,cAAc,KAAK,IAAI;AACjD,SAAK,oBAAoB,KAAK,kBAAkB,KAAK,IAAI;AAAA,EAC3D;AAAA,EAEA,WACE,SAOM;AACN,UAAM,WAAW;AAAA,M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/@tanstack/query-core/build/legacy/mutation.cjs b/node_modules/@tanstack/query-core/build/legacy/mutation.cjs deleted file mode 100644 index 145965c..0000000 --- a/node_modules/@tanstack/query-core/build/legacy/mutation.cjs +++ /dev/null @@ -1,333 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __typeError = (msg) => { - throw TypeError(msg); -}; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg); -var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj)); -var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value); -var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value); -var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method); - -// src/mutation.ts -var mutation_exports = {}; -__export(mutation_exports, { - Mutation: () => Mutation, - getDefaultState: () => getDefaultState -}); -module.exports = __toCommonJS(mutation_exports); -var import_notifyManager = require("./notifyManager.cjs"); -var import_removable = require("./removable.cjs"); -var import_retryer = require("./retryer.cjs"); -var _client, _observers, _mutationCache, _retryer, _Mutation_instances, dispatch_fn; -var Mutation = class extends import_removable.Removable { - constructor(config) { - super(); - __privateAdd(this, _Mutation_instances); - __privateAdd(this, _client); - __privateAdd(this, _observers); - __privateAdd(this, _mutationCache); - __privateAdd(this, _retryer); - __privateSet(this, _client, config.client); - this.mutationId = config.mutationId; - __privateSet(this, _mutationCache, config.mutationCache); - __privateSet(this, _observers, []); - this.state = config.state || getDefaultState(); - this.setOptions(config.options); - this.scheduleGc(); - } - setOptions(options) { - this.options = options; - this.updateGcTime(this.options.gcTime); - } - get meta() { - return this.options.meta; - } - addObserver(observer) { - if (!__privateGet(this, _observers).includes(observer)) { - __privateGet(this, _observers).push(observer); - this.clearGcTimeout(); - __privateGet(this, _mutationCache).notify({ - type: "observerAdded", - mutation: this, - observer - }); - } - } - removeObserver(observer) { - __privateSet(this, _observers, __privateGet(this, _observers).filter((x) => x !== observer)); - this.scheduleGc(); - __privateGet(this, _mutationCache).notify({ - type: "observerRemoved", - mutation: this, - observer - }); - } - optionalRemove() { - if (!__privateGet(this, _observers).length) { - if (this.state.status === "pending") { - this.scheduleGc(); - } else { - __privateGet(this, _mutationCache).remove(this); - } - } - } - continue() { - var _a; - return ((_a = __privateGet(this, _retryer)) == null ? void 0 : _a.continue()) ?? // continuing a mutation assumes that variables are set, mutation must have been dehydrated before - this.execute(this.state.variables); - } - async execute(variables) { - var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r; - const onContinue = () => { - __privateMethod(this, _Mutation_instances, dispatch_fn).call(this, { type: "continue" }); - }; - const mutationFnContext = { - client: __privateGet(this, _client), - meta: this.options.meta, - mutationKey: this.options.mutationKey - }; - __privateSet(this, _retryer, (0, import_retryer.createRetryer)({ - fn: () => { - if (!this.options.mutationFn) { - return Promise.reject(new Error("No mutationFn found")); - } - return this.options.mutationFn(variables, mutationFnContext); - }, - onFail: (failureCount, error) => { - __privateMethod(this, _Mutation_instances, dispatch_fn).call(this, { type: "failed", failureCount, error }); - }, - onPause: () => { - __privateMethod(this, _Mutation_instances, dispatch_fn).call(this, { type: "pause" }); - }, - onContinue, - retry: this.options.retry ?? 0, - retryDelay: this.options.retryDelay, - networkMode: this.options.networkMode, - canRun: () => __privateGet(this, _mutationCache).canRun(this) - })); - const restored = this.state.status === "pending"; - const isPaused = !__privateGet(this, _retryer).canStart(); - try { - if (restored) { - onContinue(); - } else { - __privateMethod(this, _Mutation_instances, dispatch_fn).call(this, { type: "pending", variables, isPaused }); - if (__privateGet(this, _mutationCache).config.onMutate) { - await __privateGet(this, _mutationCache).config.onMutate( - variables, - this, - mutationFnContext - ); - } - const context = await ((_b = (_a = this.options).onMutate) == null ? void 0 : _b.call( - _a, - variables, - mutationFnContext - )); - if (context !== this.state.context) { - __privateMethod(this, _Mutation_instances, dispatch_fn).call(this, { - type: "pending", - context, - variables, - isPaused - }); - } - } - const data = await __privateGet(this, _retryer).start(); - await ((_d = (_c = __privateGet(this, _mutationCache).config).onSuccess) == null ? void 0 : _d.call( - _c, - data, - variables, - this.state.context, - this, - mutationFnContext - )); - await ((_f = (_e = this.options).onSuccess) == null ? void 0 : _f.call( - _e, - data, - variables, - this.state.context, - mutationFnContext - )); - await ((_h = (_g = __privateGet(this, _mutationCache).config).onSettled) == null ? void 0 : _h.call( - _g, - data, - null, - this.state.variables, - this.state.context, - this, - mutationFnContext - )); - await ((_j = (_i = this.options).onSettled) == null ? void 0 : _j.call( - _i, - data, - null, - variables, - this.state.context, - mutationFnContext - )); - __privateMethod(this, _Mutation_instances, dispatch_fn).call(this, { type: "success", data }); - return data; - } catch (error) { - try { - await ((_l = (_k = __privateGet(this, _mutationCache).config).onError) == null ? void 0 : _l.call( - _k, - error, - variables, - this.state.context, - this, - mutationFnContext - )); - } catch (e) { - void Promise.reject(e); - } - try { - await ((_n = (_m = this.options).onError) == null ? void 0 : _n.call( - _m, - error, - variables, - this.state.context, - mutationFnContext - )); - } catch (e) { - void Promise.reject(e); - } - try { - await ((_p = (_o = __privateGet(this, _mutationCache).config).onSettled) == null ? void 0 : _p.call( - _o, - void 0, - error, - this.state.variables, - this.state.context, - this, - mutationFnContext - )); - } catch (e) { - void Promise.reject(e); - } - try { - await ((_r = (_q = this.options).onSettled) == null ? void 0 : _r.call( - _q, - void 0, - error, - variables, - this.state.context, - mutationFnContext - )); - } catch (e) { - void Promise.reject(e); - } - __privateMethod(this, _Mutation_instances, dispatch_fn).call(this, { type: "error", error }); - throw error; - } finally { - __privateGet(this, _mutationCache).runNext(this); - } - } -}; -_client = new WeakMap(); -_observers = new WeakMap(); -_mutationCache = new WeakMap(); -_retryer = new WeakMap(); -_Mutation_instances = new WeakSet(); -dispatch_fn = function(action) { - const reducer = (state) => { - switch (action.type) { - case "failed": - return { - ...state, - failureCount: action.failureCount, - failureReason: action.error - }; - case "pause": - return { - ...state, - isPaused: true - }; - case "continue": - return { - ...state, - isPaused: false - }; - case "pending": - return { - ...state, - context: action.context, - data: void 0, - failureCount: 0, - failureReason: null, - error: null, - isPaused: action.isPaused, - status: "pending", - variables: action.variables, - submittedAt: Date.now() - }; - case "success": - return { - ...state, - data: action.data, - failureCount: 0, - failureReason: null, - error: null, - status: "success", - isPaused: false - }; - case "error": - return { - ...state, - data: void 0, - error: action.error, - failureCount: state.failureCount + 1, - failureReason: action.error, - isPaused: false, - status: "error" - }; - } - }; - this.state = reducer(this.state); - import_notifyManager.notifyManager.batch(() => { - __privateGet(this, _observers).forEach((observer) => { - observer.onMutationUpdate(action); - }); - __privateGet(this, _mutationCache).notify({ - mutation: this, - type: "updated", - action - }); - }); -}; -function getDefaultState() { - return { - context: void 0, - data: void 0, - error: null, - failureCount: 0, - failureReason: null, - isPaused: false, - status: "idle", - variables: void 0, - submittedAt: 0 - }; -} -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - Mutation, - getDefaultState -}); -//# sourceMappingURL=mutation.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/mutation.cjs.map b/node_modules/@tanstack/query-core/build/legacy/mutation.cjs.map deleted file mode 100644 index 6ddca83..0000000 --- a/node_modules/@tanstack/query-core/build/legacy/mutation.cjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/mutation.ts"],"sourcesContent":["import { notifyManager } from './notifyManager'\nimport { Removable } from './removable'\nimport { createRetryer } from './retryer'\nimport type {\n DefaultError,\n MutationFunctionContext,\n MutationMeta,\n MutationOptions,\n MutationStatus,\n} from './types'\nimport type { MutationCache } from './mutationCache'\nimport type { MutationObserver } from './mutationObserver'\nimport type { Retryer } from './retryer'\nimport type { QueryClient } from './queryClient'\n\n// TYPES\n\ninterface MutationConfig {\n client: QueryClient\n mutationId: number\n mutationCache: MutationCache\n options: MutationOptions\n state?: MutationState\n}\n\nexport interface MutationState<\n TData = unknown,\n TError = DefaultError,\n TVariables = unknown,\n TOnMutateResult = unknown,\n> {\n context: TOnMutateResult | undefined\n data: TData | undefined\n error: TError | null\n failureCount: number\n failureReason: TError | null\n isPaused: boolean\n status: MutationStatus\n variables: TVariables | undefined\n submittedAt: number\n}\n\ninterface FailedAction {\n type: 'failed'\n failureCount: number\n error: TError | null\n}\n\ninterface PendingAction {\n type: 'pending'\n isPaused: boolean\n variables?: TVariables\n context?: TOnMutateResult\n}\n\ninterface SuccessAction {\n type: 'success'\n data: TData\n}\n\ninterface ErrorAction {\n type: 'error'\n error: TError\n}\n\ninterface PauseAction {\n type: 'pause'\n}\n\ninterface ContinueAction {\n type: 'continue'\n}\n\nexport type Action =\n | ContinueAction\n | ErrorAction\n | FailedAction\n | PendingAction\n | PauseAction\n | SuccessAction\n\n// CLASS\n\nexport class Mutation<\n TData = unknown,\n TError = DefaultError,\n TVariables = unknown,\n TOnMutateResult = unknown,\n> extends Removable {\n state: MutationState\n options!: MutationOptions\n readonly mutationId: number\n\n #client: QueryClient\n #observers: Array<\n MutationObserver\n >\n #mutationCache: MutationCache\n #retryer?: Retryer\n\n constructor(\n config: MutationConfig,\n ) {\n super()\n\n this.#client = config.client\n this.mutationId = config.mutationId\n this.#mutationCache = config.mutationCache\n this.#observers = []\n this.state = config.state || getDefaultState()\n\n this.setOptions(config.options)\n this.scheduleGc()\n }\n\n setOptions(\n options: MutationOptions,\n ): void {\n this.options = options\n\n this.updateGcTime(this.options.gcTime)\n }\n\n get meta(): MutationMeta | undefined {\n return this.options.meta\n }\n\n addObserver(observer: MutationObserver): void {\n if (!this.#observers.includes(observer)) {\n this.#observers.push(observer)\n\n // Stop the mutation from being garbage collected\n this.clearGcTimeout()\n\n this.#mutationCache.notify({\n type: 'observerAdded',\n mutation: this,\n observer,\n })\n }\n }\n\n removeObserver(observer: MutationObserver): void {\n this.#observers = this.#observers.filter((x) => x !== observer)\n\n this.scheduleGc()\n\n this.#mutationCache.notify({\n type: 'observerRemoved',\n mutation: this,\n observer,\n })\n }\n\n protected optionalRemove() {\n if (!this.#observers.length) {\n if (this.state.status === 'pending') {\n this.scheduleGc()\n } else {\n this.#mutationCache.remove(this)\n }\n }\n }\n\n continue(): Promise {\n return (\n this.#retryer?.continue() ??\n // continuing a mutation assumes that variables are set, mutation must have been dehydrated before\n this.execute(this.state.variables!)\n )\n }\n\n async execute(variables: TVariables): Promise {\n const onContinue = () => {\n this.#dispatch({ type: 'continue' })\n }\n\n const mutationFnContext = {\n client: this.#client,\n meta: this.options.meta,\n mutationKey: this.options.mutationKey,\n } satisfies MutationFunctionContext\n\n this.#retryer = createRetryer({\n fn: () => {\n if (!this.options.mutationFn) {\n return Promise.reject(new Error('No mutationFn found'))\n }\n\n return this.options.mutationFn(variables, mutationFnContext)\n },\n onFail: (failureCount, error) => {\n this.#dispatch({ type: 'failed', failureCount, error })\n },\n onPause: () => {\n this.#dispatch({ type: 'pause' })\n },\n onContinue,\n retry: this.options.retry ?? 0,\n retryDelay: this.options.retryDelay,\n networkMode: this.options.networkMode,\n canRun: () => this.#mutationCache.canRun(this),\n })\n\n const restored = this.state.status === 'pending'\n const isPaused = !this.#retryer.canStart()\n\n try {\n if (restored) {\n // Dispatch continue action to unpause restored mutation\n onContinue()\n } else {\n this.#dispatch({ type: 'pending', variables, isPaused })\n // Notify cache callback\n if (this.#mutationCache.config.onMutate) {\n await this.#mutationCache.config.onMutate(\n variables,\n this as Mutation,\n mutationFnContext,\n )\n }\n const context = await this.options.onMutate?.(\n variables,\n mutationFnContext,\n )\n if (context !== this.state.context) {\n this.#dispatch({\n type: 'pending',\n context,\n variables,\n isPaused,\n })\n }\n }\n const data = await this.#retryer.start()\n\n // Notify cache callback\n await this.#mutationCache.config.onSuccess?.(\n data,\n variables,\n this.state.context,\n this as Mutation,\n mutationFnContext,\n )\n\n await this.options.onSuccess?.(\n data,\n variables,\n this.state.context!,\n mutationFnContext,\n )\n\n // Notify cache callback\n await this.#mutationCache.config.onSettled?.(\n data,\n null,\n this.state.variables,\n this.state.context,\n this as Mutation,\n mutationFnContext,\n )\n\n await this.options.onSettled?.(\n data,\n null,\n variables,\n this.state.context,\n mutationFnContext,\n )\n\n this.#dispatch({ type: 'success', data })\n return data\n } catch (error) {\n try {\n // Notify cache callback\n await this.#mutationCache.config.onError?.(\n error as any,\n variables,\n this.state.context,\n this as Mutation,\n mutationFnContext,\n )\n } catch (e) {\n void Promise.reject(e)\n }\n\n try {\n await this.options.onError?.(\n error as TError,\n variables,\n this.state.context,\n mutationFnContext,\n )\n } catch (e) {\n void Promise.reject(e)\n }\n\n try {\n // Notify cache callback\n await this.#mutationCache.config.onSettled?.(\n undefined,\n error as any,\n this.state.variables,\n this.state.context,\n this as Mutation,\n mutationFnContext,\n )\n } catch (e) {\n void Promise.reject(e)\n }\n\n try {\n await this.options.onSettled?.(\n undefined,\n error as TError,\n variables,\n this.state.context,\n mutationFnContext,\n )\n } catch (e) {\n void Promise.reject(e)\n }\n\n this.#dispatch({ type: 'error', error: error as TError })\n throw error\n } finally {\n this.#mutationCache.runNext(this)\n }\n }\n\n #dispatch(action: Action): void {\n const reducer = (\n state: MutationState,\n ): MutationState => {\n switch (action.type) {\n case 'failed':\n return {\n ...state,\n failureCount: action.failureCount,\n failureReason: action.error,\n }\n case 'pause':\n return {\n ...state,\n isPaused: true,\n }\n case 'continue':\n return {\n ...state,\n isPaused: false,\n }\n case 'pending':\n return {\n ...state,\n context: action.context,\n data: undefined,\n failureCount: 0,\n failureReason: null,\n error: null,\n isPaused: action.isPaused,\n status: 'pending',\n variables: action.variables,\n submittedAt: Date.now(),\n }\n case 'success':\n return {\n ...state,\n data: action.data,\n failureCount: 0,\n failureReason: null,\n error: null,\n status: 'success',\n isPaused: false,\n }\n case 'error':\n return {\n ...state,\n data: undefined,\n error: action.error,\n failureCount: state.failureCount + 1,\n failureReason: action.error,\n isPaused: false,\n status: 'error',\n }\n }\n }\n this.state = reducer(this.state)\n\n notifyManager.batch(() => {\n this.#observers.forEach((observer) => {\n observer.onMutationUpdate(action)\n })\n this.#mutationCache.notify({\n mutation: this,\n type: 'updated',\n action,\n })\n })\n }\n}\n\nexport function getDefaultState<\n TData,\n TError,\n TVariables,\n TOnMutateResult,\n>(): MutationState {\n return {\n context: undefined,\n data: undefined,\n error: null,\n failureCount: 0,\n failureReason: null,\n isPaused: false,\n status: 'idle',\n variables: undefined,\n submittedAt: 0,\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,2BAA8B;AAC9B,uBAA0B;AAC1B,qBAA8B;AAF9B;AAmFO,IAAM,WAAN,cAKG,2BAAU;AAAA,EAYlB,YACE,QACA;AACA,UAAM;AApBH;AAUL;AACA;AAGA;AACA;AAOE,uBAAK,SAAU,OAAO;AACtB,SAAK,aAAa,OAAO;AACzB,uBAAK,gBAAiB,OAAO;AAC7B,uBAAK,YAAa,CAAC;AACnB,SAAK,QAAQ,OAAO,SAAS,gBAAgB;AAE7C,SAAK,WAAW,OAAO,OAAO;AAC9B,SAAK,WAAW;AAAA,EAClB;AAAA,EAEA,WACE,SACM;AACN,SAAK,UAAU;AAEf,SAAK,aAAa,KAAK,QAAQ,MAAM;AAAA,EACvC;AAAA,EAEA,IAAI,OAAiC;AACnC,WAAO,KAAK,QAAQ;AAAA,EACtB;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;AAC7D,SAAO;AAAA,IACL,SAAS;AAAA,IACT,MAAM;AAAA,IACN,OAAO;AAAA,IACP,cAAc;AAAA,IACd,eAAe;AAAA,IACf,UAAU;AAAA,IACV,QAAQ;AAAA,IACR,WAAW;AAAA,IACX,aAAa;AAAA,EACf;AACF;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/mutation.d.cts b/node_modules/@tanstack/query-core/build/legacy/mutation.d.cts deleted file mode 100644 index 6d5c5fa..0000000 --- a/node_modules/@tanstack/query-core/build/legacy/mutation.d.cts +++ /dev/null @@ -1,3 +0,0 @@ -import './removable.cjs'; -export { bj as Action, x as Mutation, y as MutationState, bk as getDefaultState } from './hydration-uphG6M-i.cjs'; -import './subscribable.cjs'; diff --git a/node_modules/@tanstack/query-core/build/legacy/mutation.d.ts b/node_modules/@tanstack/query-core/build/legacy/mutation.d.ts deleted file mode 100644 index 61bcecc..0000000 --- a/node_modules/@tanstack/query-core/build/legacy/mutation.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import './removable.js'; -export { bj as Action, x as Mutation, y as MutationState, bk as getDefaultState } from './hydration-BlEVG2Lp.js'; -import './subscribable.js'; diff --git a/node_modules/@tanstack/query-core/build/legacy/mutation.js b/node_modules/@tanstack/query-core/build/legacy/mutation.js deleted file mode 100644 index c686ebd..0000000 --- a/node_modules/@tanstack/query-core/build/legacy/mutation.js +++ /dev/null @@ -1,306 +0,0 @@ -import { - __privateAdd, - __privateGet, - __privateMethod, - __privateSet -} from "./chunk-PXG64RU4.js"; - -// src/mutation.ts -import { notifyManager } from "./notifyManager.js"; -import { Removable } from "./removable.js"; -import { createRetryer } from "./retryer.js"; -var _client, _observers, _mutationCache, _retryer, _Mutation_instances, dispatch_fn; -var Mutation = class extends Removable { - constructor(config) { - super(); - __privateAdd(this, _Mutation_instances); - __privateAdd(this, _client); - __privateAdd(this, _observers); - __privateAdd(this, _mutationCache); - __privateAdd(this, _retryer); - __privateSet(this, _client, config.client); - this.mutationId = config.mutationId; - __privateSet(this, _mutationCache, config.mutationCache); - __privateSet(this, _observers, []); - this.state = config.state || getDefaultState(); - this.setOptions(config.options); - this.scheduleGc(); - } - setOptions(options) { - this.options = options; - this.updateGcTime(this.options.gcTime); - } - get meta() { - return this.options.meta; - } - addObserver(observer) { - if (!__privateGet(this, _observers).includes(observer)) { - __privateGet(this, _observers).push(observer); - this.clearGcTimeout(); - __privateGet(this, _mutationCache).notify({ - type: "observerAdded", - mutation: this, - observer - }); - } - } - removeObserver(observer) { - __privateSet(this, _observers, __privateGet(this, _observers).filter((x) => x !== observer)); - this.scheduleGc(); - __privateGet(this, _mutationCache).notify({ - type: "observerRemoved", - mutation: this, - observer - }); - } - optionalRemove() { - if (!__privateGet(this, _observers).length) { - if (this.state.status === "pending") { - this.scheduleGc(); - } else { - __privateGet(this, _mutationCache).remove(this); - } - } - } - continue() { - var _a; - return ((_a = __privateGet(this, _retryer)) == null ? void 0 : _a.continue()) ?? // continuing a mutation assumes that variables are set, mutation must have been dehydrated before - this.execute(this.state.variables); - } - async execute(variables) { - var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r; - const onContinue = () => { - __privateMethod(this, _Mutation_instances, dispatch_fn).call(this, { type: "continue" }); - }; - const mutationFnContext = { - client: __privateGet(this, _client), - meta: this.options.meta, - mutationKey: this.options.mutationKey - }; - __privateSet(this, _retryer, createRetryer({ - fn: () => { - if (!this.options.mutationFn) { - return Promise.reject(new Error("No mutationFn found")); - } - return this.options.mutationFn(variables, mutationFnContext); - }, - onFail: (failureCount, error) => { - __privateMethod(this, _Mutation_instances, dispatch_fn).call(this, { type: "failed", failureCount, error }); - }, - onPause: () => { - __privateMethod(this, _Mutation_instances, dispatch_fn).call(this, { type: "pause" }); - }, - onContinue, - retry: this.options.retry ?? 0, - retryDelay: this.options.retryDelay, - networkMode: this.options.networkMode, - canRun: () => __privateGet(this, _mutationCache).canRun(this) - })); - const restored = this.state.status === "pending"; - const isPaused = !__privateGet(this, _retryer).canStart(); - try { - if (restored) { - onContinue(); - } else { - __privateMethod(this, _Mutation_instances, dispatch_fn).call(this, { type: "pending", variables, isPaused }); - if (__privateGet(this, _mutationCache).config.onMutate) { - await __privateGet(this, _mutationCache).config.onMutate( - variables, - this, - mutationFnContext - ); - } - const context = await ((_b = (_a = this.options).onMutate) == null ? void 0 : _b.call( - _a, - variables, - mutationFnContext - )); - if (context !== this.state.context) { - __privateMethod(this, _Mutation_instances, dispatch_fn).call(this, { - type: "pending", - context, - variables, - isPaused - }); - } - } - const data = await __privateGet(this, _retryer).start(); - await ((_d = (_c = __privateGet(this, _mutationCache).config).onSuccess) == null ? void 0 : _d.call( - _c, - data, - variables, - this.state.context, - this, - mutationFnContext - )); - await ((_f = (_e = this.options).onSuccess) == null ? void 0 : _f.call( - _e, - data, - variables, - this.state.context, - mutationFnContext - )); - await ((_h = (_g = __privateGet(this, _mutationCache).config).onSettled) == null ? void 0 : _h.call( - _g, - data, - null, - this.state.variables, - this.state.context, - this, - mutationFnContext - )); - await ((_j = (_i = this.options).onSettled) == null ? void 0 : _j.call( - _i, - data, - null, - variables, - this.state.context, - mutationFnContext - )); - __privateMethod(this, _Mutation_instances, dispatch_fn).call(this, { type: "success", data }); - return data; - } catch (error) { - try { - await ((_l = (_k = __privateGet(this, _mutationCache).config).onError) == null ? void 0 : _l.call( - _k, - error, - variables, - this.state.context, - this, - mutationFnContext - )); - } catch (e) { - void Promise.reject(e); - } - try { - await ((_n = (_m = this.options).onError) == null ? void 0 : _n.call( - _m, - error, - variables, - this.state.context, - mutationFnContext - )); - } catch (e) { - void Promise.reject(e); - } - try { - await ((_p = (_o = __privateGet(this, _mutationCache).config).onSettled) == null ? void 0 : _p.call( - _o, - void 0, - error, - this.state.variables, - this.state.context, - this, - mutationFnContext - )); - } catch (e) { - void Promise.reject(e); - } - try { - await ((_r = (_q = this.options).onSettled) == null ? void 0 : _r.call( - _q, - void 0, - error, - variables, - this.state.context, - mutationFnContext - )); - } catch (e) { - void Promise.reject(e); - } - __privateMethod(this, _Mutation_instances, dispatch_fn).call(this, { type: "error", error }); - throw error; - } finally { - __privateGet(this, _mutationCache).runNext(this); - } - } -}; -_client = new WeakMap(); -_observers = new WeakMap(); -_mutationCache = new WeakMap(); -_retryer = new WeakMap(); -_Mutation_instances = new WeakSet(); -dispatch_fn = function(action) { - const reducer = (state) => { - switch (action.type) { - case "failed": - return { - ...state, - failureCount: action.failureCount, - failureReason: action.error - }; - case "pause": - return { - ...state, - isPaused: true - }; - case "continue": - return { - ...state, - isPaused: false - }; - case "pending": - return { - ...state, - context: action.context, - data: void 0, - failureCount: 0, - failureReason: null, - error: null, - isPaused: action.isPaused, - status: "pending", - variables: action.variables, - submittedAt: Date.now() - }; - case "success": - return { - ...state, - data: action.data, - failureCount: 0, - failureReason: null, - error: null, - status: "success", - isPaused: false - }; - case "error": - return { - ...state, - data: void 0, - error: action.error, - failureCount: state.failureCount + 1, - failureReason: action.error, - isPaused: false, - status: "error" - }; - } - }; - this.state = reducer(this.state); - notifyManager.batch(() => { - __privateGet(this, _observers).forEach((observer) => { - observer.onMutationUpdate(action); - }); - __privateGet(this, _mutationCache).notify({ - mutation: this, - type: "updated", - action - }); - }); -}; -function getDefaultState() { - return { - context: void 0, - data: void 0, - error: null, - failureCount: 0, - failureReason: null, - isPaused: false, - status: "idle", - variables: void 0, - submittedAt: 0 - }; -} -export { - Mutation, - getDefaultState -}; -//# sourceMappingURL=mutation.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/mutation.js.map b/node_modules/@tanstack/query-core/build/legacy/mutation.js.map deleted file mode 100644 index 0748406..0000000 --- a/node_modules/@tanstack/query-core/build/legacy/mutation.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/mutation.ts"],"sourcesContent":["import { notifyManager } from './notifyManager'\nimport { Removable } from './removable'\nimport { createRetryer } from './retryer'\nimport type {\n DefaultError,\n MutationFunctionContext,\n MutationMeta,\n MutationOptions,\n MutationStatus,\n} from './types'\nimport type { MutationCache } from './mutationCache'\nimport type { MutationObserver } from './mutationObserver'\nimport type { Retryer } from './retryer'\nimport type { QueryClient } from './queryClient'\n\n// TYPES\n\ninterface MutationConfig {\n client: QueryClient\n mutationId: number\n mutationCache: MutationCache\n options: MutationOptions\n state?: MutationState\n}\n\nexport interface MutationState<\n TData = unknown,\n TError = DefaultError,\n TVariables = unknown,\n TOnMutateResult = unknown,\n> {\n context: TOnMutateResult | undefined\n data: TData | undefined\n error: TError | null\n failureCount: number\n failureReason: TError | null\n isPaused: boolean\n status: MutationStatus\n variables: TVariables | undefined\n submittedAt: number\n}\n\ninterface FailedAction {\n type: 'failed'\n failureCount: number\n error: TError | null\n}\n\ninterface PendingAction {\n type: 'pending'\n isPaused: boolean\n variables?: TVariables\n context?: TOnMutateResult\n}\n\ninterface SuccessAction {\n type: 'success'\n data: TData\n}\n\ninterface ErrorAction {\n type: 'error'\n error: TError\n}\n\ninterface PauseAction {\n type: 'pause'\n}\n\ninterface ContinueAction {\n type: 'continue'\n}\n\nexport type Action =\n | ContinueAction\n | ErrorAction\n | FailedAction\n | PendingAction\n | PauseAction\n | SuccessAction\n\n// CLASS\n\nexport class Mutation<\n TData = unknown,\n TError = DefaultError,\n TVariables = unknown,\n TOnMutateResult = unknown,\n> extends Removable {\n state: MutationState\n options!: MutationOptions\n readonly mutationId: number\n\n #client: QueryClient\n #observers: Array<\n MutationObserver\n >\n #mutationCache: MutationCache\n #retryer?: Retryer\n\n constructor(\n config: MutationConfig,\n ) {\n super()\n\n this.#client = config.client\n this.mutationId = config.mutationId\n this.#mutationCache = config.mutationCache\n this.#observers = []\n this.state = config.state || getDefaultState()\n\n this.setOptions(config.options)\n this.scheduleGc()\n }\n\n setOptions(\n options: MutationOptions,\n ): void {\n this.options = options\n\n this.updateGcTime(this.options.gcTime)\n }\n\n get meta(): MutationMeta | undefined {\n return this.options.meta\n }\n\n addObserver(observer: MutationObserver): void {\n if (!this.#observers.includes(observer)) {\n this.#observers.push(observer)\n\n // Stop the mutation from being garbage collected\n this.clearGcTimeout()\n\n this.#mutationCache.notify({\n type: 'observerAdded',\n mutation: this,\n observer,\n })\n }\n }\n\n removeObserver(observer: MutationObserver): void {\n this.#observers = this.#observers.filter((x) => x !== observer)\n\n this.scheduleGc()\n\n this.#mutationCache.notify({\n type: 'observerRemoved',\n mutation: this,\n observer,\n })\n }\n\n protected optionalRemove() {\n if (!this.#observers.length) {\n if (this.state.status === 'pending') {\n this.scheduleGc()\n } else {\n this.#mutationCache.remove(this)\n }\n }\n }\n\n continue(): Promise {\n return (\n this.#retryer?.continue() ??\n // continuing a mutation assumes that variables are set, mutation must have been dehydrated before\n this.execute(this.state.variables!)\n )\n }\n\n async execute(variables: TVariables): Promise {\n const onContinue = () => {\n this.#dispatch({ type: 'continue' })\n }\n\n const mutationFnContext = {\n client: this.#client,\n meta: this.options.meta,\n mutationKey: this.options.mutationKey,\n } satisfies MutationFunctionContext\n\n this.#retryer = createRetryer({\n fn: () => {\n if (!this.options.mutationFn) {\n return Promise.reject(new Error('No mutationFn found'))\n }\n\n return this.options.mutationFn(variables, mutationFnContext)\n },\n onFail: (failureCount, error) => {\n this.#dispatch({ type: 'failed', failureCount, error })\n },\n onPause: () => {\n this.#dispatch({ type: 'pause' })\n },\n onContinue,\n retry: this.options.retry ?? 0,\n retryDelay: this.options.retryDelay,\n networkMode: this.options.networkMode,\n canRun: () => this.#mutationCache.canRun(this),\n })\n\n const restored = this.state.status === 'pending'\n const isPaused = !this.#retryer.canStart()\n\n try {\n if (restored) {\n // Dispatch continue action to unpause restored mutation\n onContinue()\n } else {\n this.#dispatch({ type: 'pending', variables, isPaused })\n // Notify cache callback\n if (this.#mutationCache.config.onMutate) {\n await this.#mutationCache.config.onMutate(\n variables,\n this as Mutation,\n mutationFnContext,\n )\n }\n const context = await this.options.onMutate?.(\n variables,\n mutationFnContext,\n )\n if (context !== this.state.context) {\n this.#dispatch({\n type: 'pending',\n context,\n variables,\n isPaused,\n })\n }\n }\n const data = await this.#retryer.start()\n\n // Notify cache callback\n await this.#mutationCache.config.onSuccess?.(\n data,\n variables,\n this.state.context,\n this as Mutation,\n mutationFnContext,\n )\n\n await this.options.onSuccess?.(\n data,\n variables,\n this.state.context!,\n mutationFnContext,\n )\n\n // Notify cache callback\n await this.#mutationCache.config.onSettled?.(\n data,\n null,\n this.state.variables,\n this.state.context,\n this as Mutation,\n mutationFnContext,\n )\n\n await this.options.onSettled?.(\n data,\n null,\n variables,\n this.state.context,\n mutationFnContext,\n )\n\n this.#dispatch({ type: 'success', data })\n return data\n } catch (error) {\n try {\n // Notify cache callback\n await this.#mutationCache.config.onError?.(\n error as any,\n variables,\n this.state.context,\n this as Mutation,\n mutationFnContext,\n )\n } catch (e) {\n void Promise.reject(e)\n }\n\n try {\n await this.options.onError?.(\n error as TError,\n variables,\n this.state.context,\n mutationFnContext,\n )\n } catch (e) {\n void Promise.reject(e)\n }\n\n try {\n // Notify cache callback\n await this.#mutationCache.config.onSettled?.(\n undefined,\n error as any,\n this.state.variables,\n this.state.context,\n this as Mutation,\n mutationFnContext,\n )\n } catch (e) {\n void Promise.reject(e)\n }\n\n try {\n await this.options.onSettled?.(\n undefined,\n error as TError,\n variables,\n this.state.context,\n mutationFnContext,\n )\n } catch (e) {\n void Promise.reject(e)\n }\n\n this.#dispatch({ type: 'error', error: error as TError })\n throw error\n } finally {\n this.#mutationCache.runNext(this)\n }\n }\n\n #dispatch(action: Action): void {\n const reducer = (\n state: MutationState,\n ): MutationState => {\n switch (action.type) {\n case 'failed':\n return {\n ...state,\n failureCount: action.failureCount,\n failureReason: action.error,\n }\n case 'pause':\n return {\n ...state,\n isPaused: true,\n }\n case 'continue':\n return {\n ...state,\n isPaused: false,\n }\n case 'pending':\n return {\n ...state,\n context: action.context,\n data: undefined,\n failureCount: 0,\n failureReason: null,\n error: null,\n isPaused: action.isPaused,\n status: 'pending',\n variables: action.variables,\n submittedAt: Date.now(),\n }\n case 'success':\n return {\n ...state,\n data: action.data,\n failureCount: 0,\n failureReason: null,\n error: null,\n status: 'success',\n isPaused: false,\n }\n case 'error':\n return {\n ...state,\n data: undefined,\n error: action.error,\n failureCount: state.failureCount + 1,\n failureReason: action.error,\n isPaused: false,\n status: 'error',\n }\n }\n }\n this.state = reducer(this.state)\n\n notifyManager.batch(() => {\n this.#observers.forEach((observer) => {\n observer.onMutationUpdate(action)\n })\n this.#mutationCache.notify({\n mutation: this,\n type: 'updated',\n action,\n })\n })\n }\n}\n\nexport function getDefaultState<\n TData,\n TError,\n TVariables,\n TOnMutateResult,\n>(): MutationState {\n return {\n context: undefined,\n data: undefined,\n error: null,\n failureCount: 0,\n failureReason: null,\n isPaused: false,\n status: 'idle',\n variables: undefined,\n submittedAt: 0,\n }\n}\n"],"mappings":";;;;;;;;AAAA,SAAS,qBAAqB;AAC9B,SAAS,iBAAiB;AAC1B,SAAS,qBAAqB;AAF9B;AAmFO,IAAM,WAAN,cAKG,UAAU;AAAA,EAYlB,YACE,QACA;AACA,UAAM;AApBH;AAUL;AACA;AAGA;AACA;AAOE,uBAAK,SAAU,OAAO;AACtB,SAAK,aAAa,OAAO;AACzB,uBAAK,gBAAiB,OAAO;AAC7B,uBAAK,YAAa,CAAC;AACnB,SAAK,QAAQ,OAAO,SAAS,gBAAgB;AAE7C,SAAK,WAAW,OAAO,OAAO;AAC9B,SAAK,WAAW;AAAA,EAClB;AAAA,EAEA,WACE,SACM;AACN,SAAK,UAAU;AAEf,SAAK,aAAa,KAAK,QAAQ,MAAM;AAAA,EACvC;AAAA,EAEA,IAAI,OAAiC;AACnC,WAAO,KAAK,QAAQ;AAAA,EACtB;AAAA,EAEA,YAAY,UAAsD;AAChE,QAAI,CAAC,mBAAK,YAAW,SAAS,QAAQ,GAAG;AACvC,yBAAK,YAAW,KAAK,QAAQ;AAG7B,WAAK,eAAe;AAEpB,yBAAK,gBAAe,OAAO;AAAA,QACzB,MAAM;AAAA,QACN,UAAU;AAAA,QACV;AAAA,M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_modules/@tanstack/query-core/build/legacy/mutationCache.cjs b/node_modules/@tanstack/query-core/build/legacy/mutationCache.cjs deleted file mode 100644 index 1c62401..0000000 --- a/node_modules/@tanstack/query-core/build/legacy/mutationCache.cjs +++ /dev/null @@ -1,170 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __typeError = (msg) => { - throw TypeError(msg); -}; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg); -var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj)); -var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value); -var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value); -var __privateWrapper = (obj, member, setter, getter) => ({ - set _(value) { - __privateSet(obj, member, value, setter); - }, - get _() { - return __privateGet(obj, member, getter); - } -}); - -// src/mutationCache.ts -var mutationCache_exports = {}; -__export(mutationCache_exports, { - MutationCache: () => MutationCache -}); -module.exports = __toCommonJS(mutationCache_exports); -var import_notifyManager = require("./notifyManager.cjs"); -var import_mutation = require("./mutation.cjs"); -var import_utils = require("./utils.cjs"); -var import_subscribable = require("./subscribable.cjs"); -var _mutations, _scopes, _mutationId; -var MutationCache = class extends import_subscribable.Subscribable { - constructor(config = {}) { - super(); - this.config = config; - __privateAdd(this, _mutations); - __privateAdd(this, _scopes); - __privateAdd(this, _mutationId); - __privateSet(this, _mutations, /* @__PURE__ */ new Set()); - __privateSet(this, _scopes, /* @__PURE__ */ new Map()); - __privateSet(this, _mutationId, 0); - } - build(client, options, state) { - const mutation = new import_mutation.Mutation({ - client, - mutationCache: this, - mutationId: ++__privateWrapper(this, _mutationId)._, - options: client.defaultMutationOptions(options), - state - }); - this.add(mutation); - return mutation; - } - add(mutation) { - __privateGet(this, _mutations).add(mutation); - const scope = scopeFor(mutation); - if (typeof scope === "string") { - const scopedMutations = __privateGet(this, _scopes).get(scope); - if (scopedMutations) { - scopedMutations.push(mutation); - } else { - __privateGet(this, _scopes).set(scope, [mutation]); - } - } - this.notify({ type: "added", mutation }); - } - remove(mutation) { - if (__privateGet(this, _mutations).delete(mutation)) { - const scope = scopeFor(mutation); - if (typeof scope === "string") { - const scopedMutations = __privateGet(this, _scopes).get(scope); - if (scopedMutations) { - if (scopedMutations.length > 1) { - const index = scopedMutations.indexOf(mutation); - if (index !== -1) { - scopedMutations.splice(index, 1); - } - } else if (scopedMutations[0] === mutation) { - __privateGet(this, _scopes).delete(scope); - } - } - } - } - this.notify({ type: "removed", mutation }); - } - canRun(mutation) { - const scope = scopeFor(mutation); - if (typeof scope === "string") { - const mutationsWithSameScope = __privateGet(this, _scopes).get(scope); - const firstPendingMutation = mutationsWithSameScope == null ? void 0 : mutationsWithSameScope.find( - (m) => m.state.status === "pending" - ); - return !firstPendingMutation || firstPendingMutation === mutation; - } else { - return true; - } - } - runNext(mutation) { - var _a; - const scope = scopeFor(mutation); - if (typeof scope === "string") { - const foundMutation = (_a = __privateGet(this, _scopes).get(scope)) == null ? void 0 : _a.find((m) => m !== mutation && m.state.isPaused); - return (foundMutation == null ? void 0 : foundMutation.continue()) ?? Promise.resolve(); - } else { - return Promise.resolve(); - } - } - clear() { - import_notifyManager.notifyManager.batch(() => { - __privateGet(this, _mutations).forEach((mutation) => { - this.notify({ type: "removed", mutation }); - }); - __privateGet(this, _mutations).clear(); - __privateGet(this, _scopes).clear(); - }); - } - getAll() { - return Array.from(__privateGet(this, _mutations)); - } - find(filters) { - const defaultedFilters = { exact: true, ...filters }; - return this.getAll().find( - (mutation) => (0, import_utils.matchMutation)(defaultedFilters, mutation) - ); - } - findAll(filters = {}) { - return this.getAll().filter((mutation) => (0, import_utils.matchMutation)(filters, mutation)); - } - notify(event) { - import_notifyManager.notifyManager.batch(() => { - this.listeners.forEach((listener) => { - listener(event); - }); - }); - } - resumePausedMutations() { - const pausedMutations = this.getAll().filter((x) => x.state.isPaused); - return import_notifyManager.notifyManager.batch( - () => Promise.all( - pausedMutations.map((mutation) => mutation.continue().catch(import_utils.noop)) - ) - ); - } -}; -_mutations = new WeakMap(); -_scopes = new WeakMap(); -_mutationId = new WeakMap(); -function scopeFor(mutation) { - var _a; - return (_a = mutation.options.scope) == null ? void 0 : _a.id; -} -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - MutationCache -}); -//# sourceMappingURL=mutationCache.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/mutationCache.cjs.map b/node_modules/@tanstack/query-core/build/legacy/mutationCache.cjs.map deleted file mode 100644 index 7451f5f..0000000 --- a/node_modules/@tanstack/query-core/build/legacy/mutationCache.cjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/mutationCache.ts"],"sourcesContent":["import { notifyManager } from './notifyManager'\nimport { Mutation } from './mutation'\nimport { matchMutation, noop } from './utils'\nimport { Subscribable } from './subscribable'\nimport type { MutationObserver } from './mutationObserver'\nimport type {\n DefaultError,\n MutationFunctionContext,\n MutationOptions,\n NotifyEvent,\n} from './types'\nimport type { QueryClient } from './queryClient'\nimport type { Action, MutationState } from './mutation'\nimport type { MutationFilters } from './utils'\n\n// TYPES\n\ninterface MutationCacheConfig {\n onError?: (\n error: DefaultError,\n variables: unknown,\n onMutateResult: unknown,\n mutation: Mutation,\n context: MutationFunctionContext,\n ) => Promise | unknown\n onSuccess?: (\n data: unknown,\n variables: unknown,\n onMutateResult: unknown,\n mutation: Mutation,\n context: MutationFunctionContext,\n ) => Promise | unknown\n onMutate?: (\n variables: unknown,\n mutation: Mutation,\n context: MutationFunctionContext,\n ) => Promise | unknown\n onSettled?: (\n data: unknown | undefined,\n error: DefaultError | null,\n variables: unknown,\n onMutateResult: unknown,\n mutation: Mutation,\n context: MutationFunctionContext,\n ) => Promise | unknown\n}\n\ninterface NotifyEventMutationAdded extends NotifyEvent {\n type: 'added'\n mutation: Mutation\n}\ninterface NotifyEventMutationRemoved extends NotifyEvent {\n type: 'removed'\n mutation: Mutation\n}\n\ninterface NotifyEventMutationObserverAdded extends NotifyEvent {\n type: 'observerAdded'\n mutation: Mutation\n observer: MutationObserver\n}\n\ninterface NotifyEventMutationObserverRemoved extends NotifyEvent {\n type: 'observerRemoved'\n mutation: Mutation\n observer: MutationObserver\n}\n\ninterface NotifyEventMutationObserverOptionsUpdated extends NotifyEvent {\n type: 'observerOptionsUpdated'\n mutation?: Mutation\n observer: MutationObserver\n}\n\ninterface NotifyEventMutationUpdated extends NotifyEvent {\n type: 'updated'\n mutation: Mutation\n action: Action\n}\n\nexport type MutationCacheNotifyEvent =\n | NotifyEventMutationAdded\n | NotifyEventMutationRemoved\n | NotifyEventMutationObserverAdded\n | NotifyEventMutationObserverRemoved\n | NotifyEventMutationObserverOptionsUpdated\n | NotifyEventMutationUpdated\n\ntype MutationCacheListener = (event: MutationCacheNotifyEvent) => void\n\n// CLASS\n\nexport class MutationCache extends Subscribable {\n #mutations: Set>\n #scopes: Map>>\n #mutationId: number\n\n constructor(public config: MutationCacheConfig = {}) {\n super()\n this.#mutations = new Set()\n this.#scopes = new Map()\n this.#mutationId = 0\n }\n\n build(\n client: QueryClient,\n options: MutationOptions,\n state?: MutationState,\n ): Mutation {\n const mutation = new Mutation({\n client,\n mutationCache: this,\n mutationId: ++this.#mutationId,\n options: client.defaultMutationOptions(options),\n state,\n })\n\n this.add(mutation)\n\n return mutation\n }\n\n add(mutation: Mutation): void {\n this.#mutations.add(mutation)\n const scope = scopeFor(mutation)\n if (typeof scope === 'string') {\n const scopedMutations = this.#scopes.get(scope)\n if (scopedMutations) {\n scopedMutations.push(mutation)\n } else {\n this.#scopes.set(scope, [mutation])\n }\n }\n this.notify({ type: 'added', mutation })\n }\n\n remove(mutation: Mutation): void {\n if (this.#mutations.delete(mutation)) {\n const scope = scopeFor(mutation)\n if (typeof scope === 'string') {\n const scopedMutations = this.#scopes.get(scope)\n if (scopedMutations) {\n if (scopedMutations.length > 1) {\n const index = scopedMutations.indexOf(mutation)\n if (index !== -1) {\n scopedMutations.splice(index, 1)\n }\n } else if (scopedMutations[0] === mutation) {\n this.#scopes.delete(scope)\n }\n }\n }\n }\n\n // Currently we notify the removal even if the mutation was already removed.\n // Consider making this an error or not notifying of the removal depending on the desired semantics.\n this.notify({ type: 'removed', mutation })\n }\n\n canRun(mutation: Mutation): boolean {\n const scope = scopeFor(mutation)\n if (typeof scope === 'string') {\n const mutationsWithSameScope = this.#scopes.get(scope)\n const firstPendingMutation = mutationsWithSameScope?.find(\n (m) => m.state.status === 'pending',\n )\n // we can run if there is no current pending mutation (start use-case)\n // or if WE are the first pending mutation (continue use-case)\n return !firstPendingMutation || firstPendingMutation === mutation\n } else {\n // For unscoped mutations there are never any pending mutations in front of the\n // current mutation\n return true\n }\n }\n\n runNext(mutation: Mutation): Promise {\n const scope = scopeFor(mutation)\n if (typeof scope === 'string') {\n const foundMutation = this.#scopes\n .get(scope)\n ?.find((m) => m !== mutation && m.state.isPaused)\n\n return foundMutation?.continue() ?? Promise.resolve()\n } else {\n return Promise.resolve()\n }\n }\n\n clear(): void {\n notifyManager.batch(() => {\n this.#mutations.forEach((mutation) => {\n this.notify({ type: 'removed', mutation })\n })\n this.#mutations.clear()\n this.#scopes.clear()\n })\n }\n\n getAll(): Array {\n return Array.from(this.#mutations)\n }\n\n find<\n TData = unknown,\n TError = DefaultError,\n TVariables = any,\n TOnMutateResult = unknown,\n >(\n filters: MutationFilters,\n ): Mutation | undefined {\n const defaultedFilters = { exact: true, ...filters }\n\n return this.getAll().find((mutation) =>\n matchMutation(defaultedFilters, mutation),\n ) as Mutation | undefined\n }\n\n findAll(filters: MutationFilters = {}): Array {\n return this.getAll().filter((mutation) => matchMutation(filters, mutation))\n }\n\n notify(event: MutationCacheNotifyEvent) {\n notifyManager.batch(() => {\n this.listeners.forEach((listener) => {\n listener(event)\n })\n })\n }\n\n resumePausedMutations(): Promise {\n const pausedMutations = this.getAll().filter((x) => x.state.isPaused)\n\n return notifyManager.batch(() =>\n Promise.all(\n pausedMutations.map((mutation) => mutation.continue().catch(noop)),\n ),\n )\n }\n}\n\nfunction scopeFor(mutation: Mutation) {\n return mutation.options.scope?.id\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,2BAA8B;AAC9B,sBAAyB;AACzB,mBAAoC;AACpC,0BAA6B;AAH7B;AA4FO,IAAM,gBAAN,cAA4B,iCAAoC;AAAA,EAKrE,YAAmB,SAA8B,CAAC,GAAG;AACnD,UAAM;AADW;AAJnB;AACA;AACA;AAIE,uBAAK,YAAa,oBAAI,IAAI;AAC1B,uBAAK,SAAU,oBAAI,IAAI;AACvB,uBAAK,aAAc;AAAA,EACrB;AAAA,EAEA,MACE,QACA,SACA,OACsD;AACtD,UAAM,WAAW,IAAI,yBAAS;AAAA,MAC5B;AAAA,MACA,eAAe;AAAA,MACf,YAAmB,EAAL,uBAAK,aAAL;AAAA,MACd,SAAS,OAAO,uBAAuB,OAAO;AAAA,MAC9C;AAAA,IACF,CAAC;AAED,SAAK,IAAI,QAAQ;AAEjB,WAAO;AAAA,EACT;AAAA,EAEA,IAAI,UAA8C;AAChD,uBAAK,YAAW,IAAI,QAAQ;AAC5B,UAAM,QAAQ,SAAS,QAAQ;AAC/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SAAS,UAAwC;AAjP1D;AAkPE,UAAO,cAAS,QAAQ,UAAjB,mBAAwB;AACjC;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/mutationCache.d.cts b/node_modules/@tanstack/query-core/build/legacy/mutationCache.d.cts deleted file mode 100644 index ce18321..0000000 --- a/node_modules/@tanstack/query-core/build/legacy/mutationCache.d.cts +++ /dev/null @@ -1,3 +0,0 @@ -export { M as MutationCache, c as MutationCacheNotifyEvent } from './hydration-uphG6M-i.cjs'; -import './subscribable.cjs'; -import './removable.cjs'; diff --git a/node_modules/@tanstack/query-core/build/legacy/mutationCache.d.ts b/node_modules/@tanstack/query-core/build/legacy/mutationCache.d.ts deleted file mode 100644 index 67f1bfe..0000000 --- a/node_modules/@tanstack/query-core/build/legacy/mutationCache.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export { M as MutationCache, c as MutationCacheNotifyEvent } from './hydration-BlEVG2Lp.js'; -import './subscribable.js'; -import './removable.js'; diff --git a/node_modules/@tanstack/query-core/build/legacy/mutationCache.js b/node_modules/@tanstack/query-core/build/legacy/mutationCache.js deleted file mode 100644 index 1ec509b..0000000 --- a/node_modules/@tanstack/query-core/build/legacy/mutationCache.js +++ /dev/null @@ -1,137 +0,0 @@ -import { - __privateAdd, - __privateGet, - __privateSet, - __privateWrapper -} from "./chunk-PXG64RU4.js"; - -// src/mutationCache.ts -import { notifyManager } from "./notifyManager.js"; -import { Mutation } from "./mutation.js"; -import { matchMutation, noop } from "./utils.js"; -import { Subscribable } from "./subscribable.js"; -var _mutations, _scopes, _mutationId; -var MutationCache = class extends Subscribable { - constructor(config = {}) { - super(); - this.config = config; - __privateAdd(this, _mutations); - __privateAdd(this, _scopes); - __privateAdd(this, _mutationId); - __privateSet(this, _mutations, /* @__PURE__ */ new Set()); - __privateSet(this, _scopes, /* @__PURE__ */ new Map()); - __privateSet(this, _mutationId, 0); - } - build(client, options, state) { - const mutation = new Mutation({ - client, - mutationCache: this, - mutationId: ++__privateWrapper(this, _mutationId)._, - options: client.defaultMutationOptions(options), - state - }); - this.add(mutation); - return mutation; - } - add(mutation) { - __privateGet(this, _mutations).add(mutation); - const scope = scopeFor(mutation); - if (typeof scope === "string") { - const scopedMutations = __privateGet(this, _scopes).get(scope); - if (scopedMutations) { - scopedMutations.push(mutation); - } else { - __privateGet(this, _scopes).set(scope, [mutation]); - } - } - this.notify({ type: "added", mutation }); - } - remove(mutation) { - if (__privateGet(this, _mutations).delete(mutation)) { - const scope = scopeFor(mutation); - if (typeof scope === "string") { - const scopedMutations = __privateGet(this, _scopes).get(scope); - if (scopedMutations) { - if (scopedMutations.length > 1) { - const index = scopedMutations.indexOf(mutation); - if (index !== -1) { - scopedMutations.splice(index, 1); - } - } else if (scopedMutations[0] === mutation) { - __privateGet(this, _scopes).delete(scope); - } - } - } - } - this.notify({ type: "removed", mutation }); - } - canRun(mutation) { - const scope = scopeFor(mutation); - if (typeof scope === "string") { - const mutationsWithSameScope = __privateGet(this, _scopes).get(scope); - const firstPendingMutation = mutationsWithSameScope == null ? void 0 : mutationsWithSameScope.find( - (m) => m.state.status === "pending" - ); - return !firstPendingMutation || firstPendingMutation === mutation; - } else { - return true; - } - } - runNext(mutation) { - var _a; - const scope = scopeFor(mutation); - if (typeof scope === "string") { - const foundMutation = (_a = __privateGet(this, _scopes).get(scope)) == null ? void 0 : _a.find((m) => m !== mutation && m.state.isPaused); - return (foundMutation == null ? void 0 : foundMutation.continue()) ?? Promise.resolve(); - } else { - return Promise.resolve(); - } - } - clear() { - notifyManager.batch(() => { - __privateGet(this, _mutations).forEach((mutation) => { - this.notify({ type: "removed", mutation }); - }); - __privateGet(this, _mutations).clear(); - __privateGet(this, _scopes).clear(); - }); - } - getAll() { - return Array.from(__privateGet(this, _mutations)); - } - find(filters) { - const defaultedFilters = { exact: true, ...filters }; - return this.getAll().find( - (mutation) => matchMutation(defaultedFilters, mutation) - ); - } - findAll(filters = {}) { - return this.getAll().filter((mutation) => matchMutation(filters, mutation)); - } - notify(event) { - notifyManager.batch(() => { - this.listeners.forEach((listener) => { - listener(event); - }); - }); - } - resumePausedMutations() { - const pausedMutations = this.getAll().filter((x) => x.state.isPaused); - return notifyManager.batch( - () => Promise.all( - pausedMutations.map((mutation) => mutation.continue().catch(noop)) - ) - ); - } -}; -_mutations = new WeakMap(); -_scopes = new WeakMap(); -_mutationId = new WeakMap(); -function scopeFor(mutation) { - var _a; - return (_a = mutation.options.scope) == null ? void 0 : _a.id; -} -export { - MutationCache -}; -//# sourceMappingURL=mutationCache.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/mutationCache.js.map b/node_modules/@tanstack/query-core/build/legacy/mutationCache.js.map deleted file mode 100644 index baf4014..0000000 --- a/node_modules/@tanstack/query-core/build/legacy/mutationCache.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/mutationCache.ts"],"sourcesContent":["import { notifyManager } from './notifyManager'\nimport { Mutation } from './mutation'\nimport { matchMutation, noop } from './utils'\nimport { Subscribable } from './subscribable'\nimport type { MutationObserver } from './mutationObserver'\nimport type {\n DefaultError,\n MutationFunctionContext,\n MutationOptions,\n NotifyEvent,\n} from './types'\nimport type { QueryClient } from './queryClient'\nimport type { Action, MutationState } from './mutation'\nimport type { MutationFilters } from './utils'\n\n// TYPES\n\ninterface MutationCacheConfig {\n onError?: (\n error: DefaultError,\n variables: unknown,\n onMutateResult: unknown,\n mutation: Mutation,\n context: MutationFunctionContext,\n ) => Promise | unknown\n onSuccess?: (\n data: unknown,\n variables: unknown,\n onMutateResult: unknown,\n mutation: Mutation,\n context: MutationFunctionContext,\n ) => Promise | unknown\n onMutate?: (\n variables: unknown,\n mutation: Mutation,\n context: MutationFunctionContext,\n ) => Promise | unknown\n onSettled?: (\n data: unknown | undefined,\n error: DefaultError | null,\n variables: unknown,\n onMutateResult: unknown,\n mutation: Mutation,\n context: MutationFunctionContext,\n ) => Promise | unknown\n}\n\ninterface NotifyEventMutationAdded extends NotifyEvent {\n type: 'added'\n mutation: Mutation\n}\ninterface NotifyEventMutationRemoved extends NotifyEvent {\n type: 'removed'\n mutation: Mutation\n}\n\ninterface NotifyEventMutationObserverAdded extends NotifyEvent {\n type: 'observerAdded'\n mutation: Mutation\n observer: MutationObserver\n}\n\ninterface NotifyEventMutationObserverRemoved extends NotifyEvent {\n type: 'observerRemoved'\n mutation: Mutation\n observer: MutationObserver\n}\n\ninterface NotifyEventMutationObserverOptionsUpdated extends NotifyEvent {\n type: 'observerOptionsUpdated'\n mutation?: Mutation\n observer: MutationObserver\n}\n\ninterface NotifyEventMutationUpdated extends NotifyEvent {\n type: 'updated'\n mutation: Mutation\n action: Action\n}\n\nexport type MutationCacheNotifyEvent =\n | NotifyEventMutationAdded\n | NotifyEventMutationRemoved\n | NotifyEventMutationObserverAdded\n | NotifyEventMutationObserverRemoved\n | NotifyEventMutationObserverOptionsUpdated\n | NotifyEventMutationUpdated\n\ntype MutationCacheListener = (event: MutationCacheNotifyEvent) => void\n\n// CLASS\n\nexport class MutationCache extends Subscribable {\n #mutations: Set>\n #scopes: Map>>\n #mutationId: number\n\n constructor(public config: MutationCacheConfig = {}) {\n super()\n this.#mutations = new Set()\n this.#scopes = new Map()\n this.#mutationId = 0\n }\n\n build(\n client: QueryClient,\n options: MutationOptions,\n state?: MutationState,\n ): Mutation {\n const mutation = new Mutation({\n client,\n mutationCache: this,\n mutationId: ++this.#mutationId,\n options: client.defaultMutationOptions(options),\n state,\n })\n\n this.add(mutation)\n\n return mutation\n }\n\n add(mutation: Mutation): void {\n this.#mutations.add(mutation)\n const scope = scopeFor(mutation)\n if (typeof scope === 'string') {\n const scopedMutations = this.#scopes.get(scope)\n if (scopedMutations) {\n scopedMutations.push(mutation)\n } else {\n this.#scopes.set(scope, [mutation])\n }\n }\n this.notify({ type: 'added', mutation })\n }\n\n remove(mutation: Mutation): void {\n if (this.#mutations.delete(mutation)) {\n const scope = scopeFor(mutation)\n if (typeof scope === 'string') {\n const scopedMutations = this.#scopes.get(scope)\n if (scopedMutations) {\n if (scopedMutations.length > 1) {\n const index = scopedMutations.indexOf(mutation)\n if (index !== -1) {\n scopedMutations.splice(index, 1)\n }\n } else if (scopedMutations[0] === mutation) {\n this.#scopes.delete(scope)\n }\n }\n }\n }\n\n // Currently we notify the removal even if the mutation was already removed.\n // Consider making this an error or not notifying of the removal depending on the desired semantics.\n this.notify({ type: 'removed', mutation })\n }\n\n canRun(mutation: Mutation): boolean {\n const scope = scopeFor(mutation)\n if (typeof scope === 'string') {\n const mutationsWithSameScope = this.#scopes.get(scope)\n const firstPendingMutation = mutationsWithSameScope?.find(\n (m) => m.state.status === 'pending',\n )\n // we can run if there is no current pending mutation (start use-case)\n // or if WE are the first pending mutation (continue use-case)\n return !firstPendingMutation || firstPendingMutation === mutation\n } else {\n // For unscoped mutations there are never any pending mutations in front of the\n // current mutation\n return true\n }\n }\n\n runNext(mutation: Mutation): Promise {\n const scope = scopeFor(mutation)\n if (typeof scope === 'string') {\n const foundMutation = this.#scopes\n .get(scope)\n ?.find((m) => m !== mutation && m.state.isPaused)\n\n return foundMutation?.continue() ?? Promise.resolve()\n } else {\n return Promise.resolve()\n }\n }\n\n clear(): void {\n notifyManager.batch(() => {\n this.#mutations.forEach((mutation) => {\n this.notify({ type: 'removed', mutation })\n })\n this.#mutations.clear()\n this.#scopes.clear()\n })\n }\n\n getAll(): Array {\n return Array.from(this.#mutations)\n }\n\n find<\n TData = unknown,\n TError = DefaultError,\n TVariables = any,\n TOnMutateResult = unknown,\n >(\n filters: MutationFilters,\n ): Mutation | undefined {\n const defaultedFilters = { exact: true, ...filters }\n\n return this.getAll().find((mutation) =>\n matchMutation(defaultedFilters, mutation),\n ) as Mutation | undefined\n }\n\n findAll(filters: MutationFilters = {}): Array {\n return this.getAll().filter((mutation) => matchMutation(filters, mutation))\n }\n\n notify(event: MutationCacheNotifyEvent) {\n notifyManager.batch(() => {\n this.listeners.forEach((listener) => {\n listener(event)\n })\n })\n }\n\n resumePausedMutations(): Promise {\n const pausedMutations = this.getAll().filter((x) => x.state.isPaused)\n\n return notifyManager.batch(() =>\n Promise.all(\n pausedMutations.map((mutation) => mutation.continue().catch(noop)),\n ),\n )\n }\n}\n\nfunction scopeFor(mutation: Mutation) {\n return mutation.options.scope?.id\n}\n"],"mappings":";;;;;;;;AAAA,SAAS,qBAAqB;AAC9B,SAAS,gBAAgB;AACzB,SAAS,eAAe,YAAY;AACpC,SAAS,oBAAoB;AAH7B;AA4FO,IAAM,gBAAN,cAA4B,aAAoC;AAAA,EAKrE,YAAmB,SAA8B,CAAC,GAAG;AACnD,UAAM;AADW;AAJnB;AACA;AACA;AAIE,uBAAK,YAAa,oBAAI,IAAI;AAC1B,uBAAK,SAAU,oBAAI,IAAI;AACvB,uBAAK,aAAc;AAAA,EACrB;AAAA,EAEA,MACE,QACA,SACA,OACsD;AACtD,UAAM,WAAW,IAAI,SAAS;AAAA,MAC5B;AAAA,MACA,eAAe;AAAA,MACf,YAAmB,EAAL,uBAAK,aAAL;AAAA,MACd,SAAS,OAAO,uBAAuB,OAAO;AAAA,MAC9C;AAAA,IACF,CAAC;AAED,SAAK,IAAI,QAAQ;AAEjB,WAAO;AAAA,EACT;AAAA,EAEA,IAAI,UAA8C;AAChD,uBAAK,YAAW,IAAI,QAAQ;AAC5B,UAAM,QAAQ,SAAS,QAAQ;AAC/B,QAAI,OAAO,UAAU,UAAU;AAC7B,YAAM,kBAAkB,mBAAK,SAAQ,IAAI,KAAK;AAC9C,UAAI,iBAAiB;AACnB,wBAAgB,KAAK,QAAQ;AAAA,MAC/B,OAAO;AACL,2BAAK,SAAQ,IAAI,OAAO,CAAC,QAAQ,CAAC;AAAA,MACpC;AAAA,IACF;AACA,SAAK,OAAO,EAAE,MAAM,SAAS,SAAS,CAAC;AAAA,EACzC;AAAA,EAEA,OAAO,UAA8C;AACnD,QAAI,mBAAK,YAAW,OAAO,QAAQ,GAAG;AACpC,YAAM,QAAQ,SAAS,QAAQ;AAC/B,UAAI,OAAO,UAA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,CAAC;AAAA,EACH;AAAA,EAEA,SAA0B;AACxB,WAAO,MAAM,KAAK,mBAAK,WAAU;AAAA,EACnC;AAAA,EAEA,KAME,SACkE;AAClE,UAAM,mBAAmB,EAAE,OAAO,MAAM,GAAG,QAAQ;AAEnD,WAAO,KAAK,OAAO,EAAE;AAAA,MAAK,CAAC,aACzB,cAAc,kBAAkB,QAAQ;AAAA,IAC1C;AAAA,EACF;AAAA,EAEA,QAAQ,UAA2B,CAAC,GAAoB;AACtD,WAAO,KAAK,OAAO,EAAE,OAAO,CAAC,aAAa,cAAc,SAAS,QAAQ,CAAC;AAAA,EAC5E;AAAA,EAEA,OAAO,OAAiC;AACtC,kBAAc,MAAM,MAAM;AACxB,WAAK,UAAU,QAAQ,CAAC,aAAa;AACnC,iBAAS,KAAK;AAAA,MAChB,CAAC;AAAA,IACH,CAAC;AAAA,EACH;AAAA,EAEA,wBAA0C;AACxC,UAAM,kBAAkB,KAAK,OAAO,EAAE,OAAO,CAAC,MAAM,EAAE,MAAM,QAAQ;AAEpE,WAAO,cAAc;AAAA,MAAM,MACzB,QAAQ;AAAA,QACN,gBAAgB,IAAI,CAAC,aAAa,SAAS,SAAS,EAAE,MAAM,IAAI,CAAC;AAAA,MACnE;AAAA,IACF;AAAA,EACF;AACF;AAlJE;AACA;AACA;AAkJF,SAAS,SAAS,UAAwC;AAjP1D;AAkPE,UAAO,cAAS,QAAQ,UAAjB,mBAAwB;AACjC;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/mutationObserver.cjs b/node_modules/@tanstack/query-core/build/legacy/mutationObserver.cjs deleted file mode 100644 index b0f8183..0000000 --- a/node_modules/@tanstack/query-core/build/legacy/mutationObserver.cjs +++ /dev/null @@ -1,190 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __typeError = (msg) => { - throw TypeError(msg); -}; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg); -var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj)); -var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value); -var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value); -var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method); - -// src/mutationObserver.ts -var mutationObserver_exports = {}; -__export(mutationObserver_exports, { - MutationObserver: () => MutationObserver -}); -module.exports = __toCommonJS(mutationObserver_exports); -var import_mutation = require("./mutation.cjs"); -var import_notifyManager = require("./notifyManager.cjs"); -var import_subscribable = require("./subscribable.cjs"); -var import_utils = require("./utils.cjs"); -var _client, _currentResult, _currentMutation, _mutateOptions, _MutationObserver_instances, updateResult_fn, notify_fn; -var MutationObserver = class extends import_subscribable.Subscribable { - constructor(client, options) { - super(); - __privateAdd(this, _MutationObserver_instances); - __privateAdd(this, _client); - __privateAdd(this, _currentResult); - __privateAdd(this, _currentMutation); - __privateAdd(this, _mutateOptions); - __privateSet(this, _client, client); - this.setOptions(options); - this.bindMethods(); - __privateMethod(this, _MutationObserver_instances, updateResult_fn).call(this); - } - bindMethods() { - this.mutate = this.mutate.bind(this); - this.reset = this.reset.bind(this); - } - setOptions(options) { - var _a; - const prevOptions = this.options; - this.options = __privateGet(this, _client).defaultMutationOptions(options); - if (!(0, import_utils.shallowEqualObjects)(this.options, prevOptions)) { - __privateGet(this, _client).getMutationCache().notify({ - type: "observerOptionsUpdated", - mutation: __privateGet(this, _currentMutation), - observer: this - }); - } - if ((prevOptions == null ? void 0 : prevOptions.mutationKey) && this.options.mutationKey && (0, import_utils.hashKey)(prevOptions.mutationKey) !== (0, import_utils.hashKey)(this.options.mutationKey)) { - this.reset(); - } else if (((_a = __privateGet(this, _currentMutation)) == null ? void 0 : _a.state.status) === "pending") { - __privateGet(this, _currentMutation).setOptions(this.options); - } - } - onUnsubscribe() { - var _a; - if (!this.hasListeners()) { - (_a = __privateGet(this, _currentMutation)) == null ? void 0 : _a.removeObserver(this); - } - } - onMutationUpdate(action) { - __privateMethod(this, _MutationObserver_instances, updateResult_fn).call(this); - __privateMethod(this, _MutationObserver_instances, notify_fn).call(this, action); - } - getCurrentResult() { - return __privateGet(this, _currentResult); - } - reset() { - var _a; - (_a = __privateGet(this, _currentMutation)) == null ? void 0 : _a.removeObserver(this); - __privateSet(this, _currentMutation, void 0); - __privateMethod(this, _MutationObserver_instances, updateResult_fn).call(this); - __privateMethod(this, _MutationObserver_instances, notify_fn).call(this); - } - mutate(variables, options) { - var _a; - __privateSet(this, _mutateOptions, options); - (_a = __privateGet(this, _currentMutation)) == null ? void 0 : _a.removeObserver(this); - __privateSet(this, _currentMutation, __privateGet(this, _client).getMutationCache().build(__privateGet(this, _client), this.options)); - __privateGet(this, _currentMutation).addObserver(this); - return __privateGet(this, _currentMutation).execute(variables); - } -}; -_client = new WeakMap(); -_currentResult = new WeakMap(); -_currentMutation = new WeakMap(); -_mutateOptions = new WeakMap(); -_MutationObserver_instances = new WeakSet(); -updateResult_fn = function() { - var _a; - const state = ((_a = __privateGet(this, _currentMutation)) == null ? void 0 : _a.state) ?? (0, import_mutation.getDefaultState)(); - __privateSet(this, _currentResult, { - ...state, - isPending: state.status === "pending", - isSuccess: state.status === "success", - isError: state.status === "error", - isIdle: state.status === "idle", - mutate: this.mutate, - reset: this.reset - }); -}; -notify_fn = function(action) { - import_notifyManager.notifyManager.batch(() => { - var _a, _b, _c, _d, _e, _f, _g, _h; - if (__privateGet(this, _mutateOptions) && this.hasListeners()) { - const variables = __privateGet(this, _currentResult).variables; - const onMutateResult = __privateGet(this, _currentResult).context; - const context = { - client: __privateGet(this, _client), - meta: this.options.meta, - mutationKey: this.options.mutationKey - }; - if ((action == null ? void 0 : action.type) === "success") { - try { - (_b = (_a = __privateGet(this, _mutateOptions)).onSuccess) == null ? void 0 : _b.call( - _a, - action.data, - variables, - onMutateResult, - context - ); - } catch (e) { - void Promise.reject(e); - } - try { - (_d = (_c = __privateGet(this, _mutateOptions)).onSettled) == null ? void 0 : _d.call( - _c, - action.data, - null, - variables, - onMutateResult, - context - ); - } catch (e) { - void Promise.reject(e); - } - } else if ((action == null ? void 0 : action.type) === "error") { - try { - (_f = (_e = __privateGet(this, _mutateOptions)).onError) == null ? void 0 : _f.call( - _e, - action.error, - variables, - onMutateResult, - context - ); - } catch (e) { - void Promise.reject(e); - } - try { - (_h = (_g = __privateGet(this, _mutateOptions)).onSettled) == null ? void 0 : _h.call( - _g, - void 0, - action.error, - variables, - onMutateResult, - context - ); - } catch (e) { - void Promise.reject(e); - } - } - } - this.listeners.forEach((listener) => { - listener(__privateGet(this, _currentResult)); - }); - }); -}; -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - MutationObserver -}); -//# sourceMappingURL=mutationObserver.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/mutationObserver.cjs.map b/node_modules/@tanstack/query-core/build/legacy/mutationObserver.cjs.map deleted file mode 100644 index c5f2f62..0000000 --- a/node_modules/@tanstack/query-core/build/legacy/mutationObserver.cjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/mutationObserver.ts"],"sourcesContent":["import { getDefaultState } from './mutation'\nimport { notifyManager } from './notifyManager'\nimport { Subscribable } from './subscribable'\nimport { hashKey, shallowEqualObjects } from './utils'\nimport type { QueryClient } from './queryClient'\nimport type {\n DefaultError,\n MutateOptions,\n MutationFunctionContext,\n MutationObserverOptions,\n MutationObserverResult,\n} from './types'\nimport type { Action, Mutation } from './mutation'\n\n// TYPES\n\ntype MutationObserverListener = (\n result: MutationObserverResult,\n) => void\n\n// CLASS\n\nexport class MutationObserver<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n> extends Subscribable<\n MutationObserverListener\n> {\n options!: MutationObserverOptions\n\n #client: QueryClient\n #currentResult: MutationObserverResult<\n TData,\n TError,\n TVariables,\n TOnMutateResult\n > = undefined!\n #currentMutation?: Mutation\n #mutateOptions?: MutateOptions\n\n constructor(\n client: QueryClient,\n options: MutationObserverOptions<\n TData,\n TError,\n TVariables,\n TOnMutateResult\n >,\n ) {\n super()\n\n this.#client = client\n this.setOptions(options)\n this.bindMethods()\n this.#updateResult()\n }\n\n protected bindMethods(): void {\n this.mutate = this.mutate.bind(this)\n this.reset = this.reset.bind(this)\n }\n\n setOptions(\n options: MutationObserverOptions<\n TData,\n TError,\n TVariables,\n TOnMutateResult\n >,\n ) {\n const prevOptions = this.options as\n | MutationObserverOptions\n | undefined\n this.options = this.#client.defaultMutationOptions(options)\n if (!shallowEqualObjects(this.options, prevOptions)) {\n this.#client.getMutationCache().notify({\n type: 'observerOptionsUpdated',\n mutation: this.#currentMutation,\n observer: this,\n })\n }\n\n if (\n prevOptions?.mutationKey &&\n this.options.mutationKey &&\n hashKey(prevOptions.mutationKey) !== hashKey(this.options.mutationKey)\n ) {\n this.reset()\n } else if (this.#currentMutation?.state.status === 'pending') {\n this.#currentMutation.setOptions(this.options)\n }\n }\n\n protected onUnsubscribe(): void {\n if (!this.hasListeners()) {\n this.#currentMutation?.removeObserver(this)\n }\n }\n\n onMutationUpdate(\n action: Action,\n ): void {\n this.#updateResult()\n\n this.#notify(action)\n }\n\n getCurrentResult(): MutationObserverResult<\n TData,\n TError,\n TVariables,\n TOnMutateResult\n > {\n return this.#currentResult\n }\n\n reset(): void {\n // reset needs to remove the observer from the mutation because there is no way to \"get it back\"\n // another mutate call will yield a new mutation!\n this.#currentMutation?.removeObserver(this)\n this.#currentMutation = undefined\n this.#updateResult()\n this.#notify()\n }\n\n mutate(\n variables: TVariables,\n options?: MutateOptions,\n ): Promise {\n this.#mutateOptions = options\n\n this.#currentMutation?.removeObserver(this)\n\n this.#currentMutation = this.#client\n .getMutationCache()\n .build(this.#client, this.options)\n\n this.#currentMutation.addObserver(this)\n\n return this.#currentMutation.execute(variables)\n }\n\n #updateResult(): void {\n const state =\n this.#currentMutation?.state ??\n getDefaultState()\n\n this.#currentResult = {\n ...state,\n isPending: state.status === 'pending',\n isSuccess: state.status === 'success',\n isError: state.status === 'error',\n isIdle: state.status === 'idle',\n mutate: this.mutate,\n reset: this.reset,\n } as MutationObserverResult\n }\n\n #notify(action?: Action): void {\n notifyManager.batch(() => {\n // First trigger the mutate callbacks\n if (this.#mutateOptions && this.hasListeners()) {\n const variables = this.#currentResult.variables!\n const onMutateResult = this.#currentResult.context\n\n const context = {\n client: this.#client,\n meta: this.options.meta,\n mutationKey: this.options.mutationKey,\n } satisfies MutationFunctionContext\n\n if (action?.type === 'success') {\n try {\n this.#mutateOptions.onSuccess?.(\n action.data,\n variables,\n onMutateResult,\n context,\n )\n } catch (e) {\n void Promise.reject(e)\n }\n try {\n this.#mutateOptions.onSettled?.(\n action.data,\n null,\n variables,\n onMutateResult,\n context,\n )\n } catch (e) {\n void Promise.reject(e)\n }\n } else if (action?.type === 'error') {\n try {\n this.#mutateOptions.onError?.(\n action.error,\n variables,\n onMutateResult,\n context,\n )\n } catch (e) {\n void Promise.reject(e)\n }\n try {\n this.#mutateOptions.onSettled?.(\n undefined,\n action.error,\n variables,\n onMutateResult,\n context,\n )\n } catch (e) {\n void Promise.reject(e)\n }\n }\n }\n\n // Then trigger the listeners\n this.listeners.forEach((listener) => {\n listener(this.#currentResult)\n })\n })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CAAC;AAAA,QACvB;AACA,YAAI;AACF,yCAAK,iBAAe,cAApB;AAAA;AAAA,YACE,OAAO;AAAA,YACP;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA;AAAA,QAEJ,SAAS,GAAG;AACV,eAAK,QAAQ,OAAO,CAAC;AAAA,QACvB;AAAA,MACF,YAAW,iCAAQ,UAAS,SAAS;AACnC,YAAI;AACF,yCAAK,iBAAe,YAApB;AAAA;AAAA,YACE,OAAO;AAAA,YACP;AAAA,YACA;AAAA,YACA;AAAA;AAAA,QAEJ,SAAS,GAAG;AACV,eAAK,QAAQ,OAAO,CAAC;AAAA,QACvB;AACA,YAAI;AACF,yCAAK,iBAAe,cAApB;AAAA;AAAA,YACE;AAAA,YACA,OAAO;AAAA,YACP;AAAA,YACA;AAAA,YACA;AAAA;AAAA,QAEJ,SAAS,GAAG;AACV,eAAK,QAAQ,OAAO,CAAC;AAAA,QACvB;AAAA,MACF;AAAA,IACF;AAGA,SAAK,UAAU,QAAQ,CAAC,aAAa;AACnC,eAAS,mBAAK,eAAc;AAAA,IAC9B,CAAC;AAAA,EACH,CAAC;AACH;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/mutationObserver.d.cts b/node_modules/@tanstack/query-core/build/legacy/mutationObserver.d.cts deleted file mode 100644 index 04a9d2d..0000000 --- a/node_modules/@tanstack/query-core/build/legacy/mutationObserver.d.cts +++ /dev/null @@ -1,3 +0,0 @@ -import './subscribable.cjs'; -export { e as MutationObserver } from './hydration-uphG6M-i.cjs'; -import './removable.cjs'; diff --git a/node_modules/@tanstack/query-core/build/legacy/mutationObserver.d.ts b/node_modules/@tanstack/query-core/build/legacy/mutationObserver.d.ts deleted file mode 100644 index 1700476..0000000 --- a/node_modules/@tanstack/query-core/build/legacy/mutationObserver.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import './subscribable.js'; -export { e as MutationObserver } from './hydration-BlEVG2Lp.js'; -import './removable.js'; diff --git a/node_modules/@tanstack/query-core/build/legacy/mutationObserver.js b/node_modules/@tanstack/query-core/build/legacy/mutationObserver.js deleted file mode 100644 index c3817fa..0000000 --- a/node_modules/@tanstack/query-core/build/legacy/mutationObserver.js +++ /dev/null @@ -1,164 +0,0 @@ -import { - __privateAdd, - __privateGet, - __privateMethod, - __privateSet -} from "./chunk-PXG64RU4.js"; - -// src/mutationObserver.ts -import { getDefaultState } from "./mutation.js"; -import { notifyManager } from "./notifyManager.js"; -import { Subscribable } from "./subscribable.js"; -import { hashKey, shallowEqualObjects } from "./utils.js"; -var _client, _currentResult, _currentMutation, _mutateOptions, _MutationObserver_instances, updateResult_fn, notify_fn; -var MutationObserver = class extends Subscribable { - constructor(client, options) { - super(); - __privateAdd(this, _MutationObserver_instances); - __privateAdd(this, _client); - __privateAdd(this, _currentResult); - __privateAdd(this, _currentMutation); - __privateAdd(this, _mutateOptions); - __privateSet(this, _client, client); - this.setOptions(options); - this.bindMethods(); - __privateMethod(this, _MutationObserver_instances, updateResult_fn).call(this); - } - bindMethods() { - this.mutate = this.mutate.bind(this); - this.reset = this.reset.bind(this); - } - setOptions(options) { - var _a; - const prevOptions = this.options; - this.options = __privateGet(this, _client).defaultMutationOptions(options); - if (!shallowEqualObjects(this.options, prevOptions)) { - __privateGet(this, _client).getMutationCache().notify({ - type: "observerOptionsUpdated", - mutation: __privateGet(this, _currentMutation), - observer: this - }); - } - if ((prevOptions == null ? void 0 : prevOptions.mutationKey) && this.options.mutationKey && hashKey(prevOptions.mutationKey) !== hashKey(this.options.mutationKey)) { - this.reset(); - } else if (((_a = __privateGet(this, _currentMutation)) == null ? void 0 : _a.state.status) === "pending") { - __privateGet(this, _currentMutation).setOptions(this.options); - } - } - onUnsubscribe() { - var _a; - if (!this.hasListeners()) { - (_a = __privateGet(this, _currentMutation)) == null ? void 0 : _a.removeObserver(this); - } - } - onMutationUpdate(action) { - __privateMethod(this, _MutationObserver_instances, updateResult_fn).call(this); - __privateMethod(this, _MutationObserver_instances, notify_fn).call(this, action); - } - getCurrentResult() { - return __privateGet(this, _currentResult); - } - reset() { - var _a; - (_a = __privateGet(this, _currentMutation)) == null ? void 0 : _a.removeObserver(this); - __privateSet(this, _currentMutation, void 0); - __privateMethod(this, _MutationObserver_instances, updateResult_fn).call(this); - __privateMethod(this, _MutationObserver_instances, notify_fn).call(this); - } - mutate(variables, options) { - var _a; - __privateSet(this, _mutateOptions, options); - (_a = __privateGet(this, _currentMutation)) == null ? void 0 : _a.removeObserver(this); - __privateSet(this, _currentMutation, __privateGet(this, _client).getMutationCache().build(__privateGet(this, _client), this.options)); - __privateGet(this, _currentMutation).addObserver(this); - return __privateGet(this, _currentMutation).execute(variables); - } -}; -_client = new WeakMap(); -_currentResult = new WeakMap(); -_currentMutation = new WeakMap(); -_mutateOptions = new WeakMap(); -_MutationObserver_instances = new WeakSet(); -updateResult_fn = function() { - var _a; - const state = ((_a = __privateGet(this, _currentMutation)) == null ? void 0 : _a.state) ?? getDefaultState(); - __privateSet(this, _currentResult, { - ...state, - isPending: state.status === "pending", - isSuccess: state.status === "success", - isError: state.status === "error", - isIdle: state.status === "idle", - mutate: this.mutate, - reset: this.reset - }); -}; -notify_fn = function(action) { - notifyManager.batch(() => { - var _a, _b, _c, _d, _e, _f, _g, _h; - if (__privateGet(this, _mutateOptions) && this.hasListeners()) { - const variables = __privateGet(this, _currentResult).variables; - const onMutateResult = __privateGet(this, _currentResult).context; - const context = { - client: __privateGet(this, _client), - meta: this.options.meta, - mutationKey: this.options.mutationKey - }; - if ((action == null ? void 0 : action.type) === "success") { - try { - (_b = (_a = __privateGet(this, _mutateOptions)).onSuccess) == null ? void 0 : _b.call( - _a, - action.data, - variables, - onMutateResult, - context - ); - } catch (e) { - void Promise.reject(e); - } - try { - (_d = (_c = __privateGet(this, _mutateOptions)).onSettled) == null ? void 0 : _d.call( - _c, - action.data, - null, - variables, - onMutateResult, - context - ); - } catch (e) { - void Promise.reject(e); - } - } else if ((action == null ? void 0 : action.type) === "error") { - try { - (_f = (_e = __privateGet(this, _mutateOptions)).onError) == null ? void 0 : _f.call( - _e, - action.error, - variables, - onMutateResult, - context - ); - } catch (e) { - void Promise.reject(e); - } - try { - (_h = (_g = __privateGet(this, _mutateOptions)).onSettled) == null ? void 0 : _h.call( - _g, - void 0, - action.error, - variables, - onMutateResult, - context - ); - } catch (e) { - void Promise.reject(e); - } - } - } - this.listeners.forEach((listener) => { - listener(__privateGet(this, _currentResult)); - }); - }); -}; -export { - MutationObserver -}; -//# sourceMappingURL=mutationObserver.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/mutationObserver.js.map b/node_modules/@tanstack/query-core/build/legacy/mutationObserver.js.map deleted file mode 100644 index 7d6566e..0000000 --- a/node_modules/@tanstack/query-core/build/legacy/mutationObserver.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/mutationObserver.ts"],"sourcesContent":["import { getDefaultState } from './mutation'\nimport { notifyManager } from './notifyManager'\nimport { Subscribable } from './subscribable'\nimport { hashKey, shallowEqualObjects } from './utils'\nimport type { QueryClient } from './queryClient'\nimport type {\n DefaultError,\n MutateOptions,\n MutationFunctionContext,\n MutationObserverOptions,\n MutationObserverResult,\n} from './types'\nimport type { Action, Mutation } from './mutation'\n\n// TYPES\n\ntype MutationObserverListener = (\n result: MutationObserverResult,\n) => void\n\n// CLASS\n\nexport class MutationObserver<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n> extends Subscribable<\n MutationObserverListener\n> {\n options!: MutationObserverOptions\n\n #client: QueryClient\n #currentResult: MutationObserverResult<\n TData,\n TError,\n TVariables,\n TOnMutateResult\n > = undefined!\n #currentMutation?: Mutation\n #mutateOptions?: MutateOptions\n\n constructor(\n client: QueryClient,\n options: MutationObserverOptions<\n TData,\n TError,\n TVariables,\n TOnMutateResult\n >,\n ) {\n super()\n\n this.#client = client\n this.setOptions(options)\n this.bindMethods()\n this.#updateResult()\n }\n\n protected bindMethods(): void {\n this.mutate = this.mutate.bind(this)\n this.reset = this.reset.bind(this)\n }\n\n setOptions(\n options: MutationObserverOptions<\n TData,\n TError,\n TVariables,\n TOnMutateResult\n >,\n ) {\n const prevOptions = this.options as\n | MutationObserverOptions\n | undefined\n this.options = this.#client.defaultMutationOptions(options)\n if (!shallowEqualObjects(this.options, prevOptions)) {\n this.#client.getMutationCache().notify({\n type: 'observerOptionsUpdated',\n mutation: this.#currentMutation,\n observer: this,\n })\n }\n\n if (\n prevOptions?.mutationKey &&\n this.options.mutationKey &&\n hashKey(prevOptions.mutationKey) !== hashKey(this.options.mutationKey)\n ) {\n this.reset()\n } else if (this.#currentMutation?.state.status === 'pending') {\n this.#currentMutation.setOptions(this.options)\n }\n }\n\n protected onUnsubscribe(): void {\n if (!this.hasListeners()) {\n this.#currentMutation?.removeObserver(this)\n }\n }\n\n onMutationUpdate(\n action: Action,\n ): void {\n this.#updateResult()\n\n this.#notify(action)\n }\n\n getCurrentResult(): MutationObserverResult<\n TData,\n TError,\n TVariables,\n TOnMutateResult\n > {\n return this.#currentResult\n }\n\n reset(): void {\n // reset needs to remove the observer from the mutation because there is no way to \"get it back\"\n // another mutate call will yield a new mutation!\n this.#currentMutation?.removeObserver(this)\n this.#currentMutation = undefined\n this.#updateResult()\n this.#notify()\n }\n\n mutate(\n variables: TVariables,\n options?: MutateOptions,\n ): Promise {\n this.#mutateOptions = options\n\n this.#currentMutation?.removeObserver(this)\n\n this.#currentMutation = this.#client\n .getMutationCache()\n .build(this.#client, this.options)\n\n this.#currentMutation.addObserver(this)\n\n return this.#currentMutation.execute(variables)\n }\n\n #updateResult(): void {\n const state =\n this.#currentMutation?.state ??\n getDefaultState()\n\n this.#currentResult = {\n ...state,\n isPending: state.status === 'pending',\n isSuccess: state.status === 'success',\n isError: state.status === 'error',\n isIdle: state.status === 'idle',\n mutate: this.mutate,\n reset: this.reset,\n } as MutationObserverResult\n }\n\n #notify(action?: Action): void {\n notifyManager.batch(() => {\n // First trigger the mutate callbacks\n if (this.#mutateOptions && this.hasListeners()) {\n const variables = this.#currentResult.variables!\n const onMutateResult = this.#currentResult.context\n\n const context = {\n client: this.#client,\n meta: this.options.meta,\n mutationKey: this.options.mutationKey,\n } satisfies MutationFunctionContext\n\n if (action?.type === 'success') {\n try {\n this.#mutateOptions.onSuccess?.(\n action.data,\n variables,\n onMutateResult,\n context,\n )\n } catch (e) {\n void Promise.reject(e)\n }\n try {\n this.#mutateOptions.onSettled?.(\n action.data,\n null,\n variables,\n onMutateResult,\n context,\n )\n } catch (e) {\n void Promise.reject(e)\n }\n } else if (action?.type === 'error') {\n try {\n this.#mutateOptions.onError?.(\n action.error,\n variables,\n onMutateResult,\n context,\n )\n } catch (e) {\n void Promise.reject(e)\n }\n try {\n this.#mutateOptions.onSettled?.(\n undefined,\n action.error,\n variables,\n onMutateResult,\n context,\n )\n } catch (e) {\n void Promise.reject(e)\n }\n }\n }\n\n // Then trigger the listeners\n this.listeners.forEach((listener) => {\n listener(this.#currentResult)\n })\n })\n }\n}\n"],"mappings":";;;;;;;;AAAA,SAAS,uBAAuB;AAChC,SAAS,qBAAqB;AAC9B,SAAS,oBAAoB;AAC7B,SAAS,SAAS,2BAA2B;AAH7C;AAsBO,IAAM,mBAAN,cAKG,aAER;AAAA,EAaA,YACE,QACA,SAMA;AACA,UAAM;AA7BH;AAUL;AACA;AAMA;AACA;AAaE,uBAAK,SAAU;AACf,SAAK,WAAW,OAAO;AACvB,SAAK,YAAY;AACjB,0BAAK,8CAAL;AAAA,EACF;AAAA,EAEU,cAAoB;AAC5B,SAAK,SAAS,KAAK,OAAO,KAAK,IAAI;AACnC,SAAK,QAAQ,KAAK,MAAM,KAAK,IAAI;AAAA,EACnC;AAAA,EAEA,WACE,SAMA;AAvEJ;AAwEI,UAAM,cAAc,KAAK;AAGzB,SAAK,UAAU,mBAAK,SAAQ,uBAAuB,OAAO;AAC1D,QAAI,CAAC,oBAAoB,KAAK,SAAS,WAAW,GAAG;AACnD,yBAAK,SAAQ,iBAAiB,EAAE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AAc;AAAA,IAC9B,CAAC;AAAA,EACH,CAAC;AACH;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/notifyManager.cjs b/node_modules/@tanstack/query-core/build/legacy/notifyManager.cjs deleted file mode 100644 index 355a2c1..0000000 --- a/node_modules/@tanstack/query-core/build/legacy/notifyManager.cjs +++ /dev/null @@ -1,113 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// src/notifyManager.ts -var notifyManager_exports = {}; -__export(notifyManager_exports, { - createNotifyManager: () => createNotifyManager, - defaultScheduler: () => defaultScheduler, - notifyManager: () => notifyManager -}); -module.exports = __toCommonJS(notifyManager_exports); -var import_timeoutManager = require("./timeoutManager.cjs"); -var defaultScheduler = import_timeoutManager.systemSetTimeoutZero; -function createNotifyManager() { - let queue = []; - let transactions = 0; - let notifyFn = (callback) => { - callback(); - }; - let batchNotifyFn = (callback) => { - callback(); - }; - let scheduleFn = defaultScheduler; - const schedule = (callback) => { - if (transactions) { - queue.push(callback); - } else { - scheduleFn(() => { - notifyFn(callback); - }); - } - }; - const flush = () => { - const originalQueue = queue; - queue = []; - if (originalQueue.length) { - scheduleFn(() => { - batchNotifyFn(() => { - originalQueue.forEach((callback) => { - notifyFn(callback); - }); - }); - }); - } - }; - return { - batch: (callback) => { - let result; - transactions++; - try { - result = callback(); - } finally { - transactions--; - if (!transactions) { - flush(); - } - } - return result; - }, - /** - * All calls to the wrapped function will be batched. - */ - batchCalls: (callback) => { - return (...args) => { - schedule(() => { - callback(...args); - }); - }; - }, - schedule, - /** - * Use this method to set a custom notify function. - * This can be used to for example wrap notifications with `React.act` while running tests. - */ - setNotifyFunction: (fn) => { - notifyFn = fn; - }, - /** - * Use this method to set a custom function to batch notifications together into a single tick. - * By default React Query will use the batch function provided by ReactDOM or React Native. - */ - setBatchNotifyFunction: (fn) => { - batchNotifyFn = fn; - }, - setScheduler: (fn) => { - scheduleFn = fn; - } - }; -} -var notifyManager = createNotifyManager(); -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - createNotifyManager, - defaultScheduler, - notifyManager -}); -//# sourceMappingURL=notifyManager.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/notifyManager.cjs.map b/node_modules/@tanstack/query-core/build/legacy/notifyManager.cjs.map deleted file mode 100644 index 1756c4b..0000000 --- a/node_modules/@tanstack/query-core/build/legacy/notifyManager.cjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/notifyManager.ts"],"sourcesContent":["// TYPES\n\nimport { systemSetTimeoutZero } from './timeoutManager'\n\ntype NotifyCallback = () => void\n\ntype NotifyFunction = (callback: () => void) => void\n\ntype BatchNotifyFunction = (callback: () => void) => void\n\ntype BatchCallsCallback> = (...args: T) => void\n\ntype ScheduleFunction = (callback: () => void) => void\n\nexport const defaultScheduler: ScheduleFunction = systemSetTimeoutZero\n\nexport function createNotifyManager() {\n let queue: Array = []\n let transactions = 0\n let notifyFn: NotifyFunction = (callback) => {\n callback()\n }\n let batchNotifyFn: BatchNotifyFunction = (callback: () => void) => {\n callback()\n }\n let scheduleFn = defaultScheduler\n\n const schedule = (callback: NotifyCallback): void => {\n if (transactions) {\n queue.push(callback)\n } else {\n scheduleFn(() => {\n notifyFn(callback)\n })\n }\n }\n const flush = (): void => {\n const originalQueue = queue\n queue = []\n if (originalQueue.length) {\n scheduleFn(() => {\n batchNotifyFn(() => {\n originalQueue.forEach((callback) => {\n notifyFn(callback)\n })\n })\n })\n }\n }\n\n return {\n batch: (callback: () => T): T => {\n let result\n transactions++\n try {\n result = callback()\n } finally {\n transactions--\n if (!transactions) {\n flush()\n }\n }\n return result\n },\n /**\n * All calls to the wrapped function will be batched.\n */\n batchCalls: >(\n callback: BatchCallsCallback,\n ): BatchCallsCallback => {\n return (...args) => {\n schedule(() => {\n callback(...args)\n })\n }\n },\n schedule,\n /**\n * Use this method to set a custom notify function.\n * This can be used to for example wrap notifications with `React.act` while running tests.\n */\n setNotifyFunction: (fn: NotifyFunction) => {\n notifyFn = fn\n },\n /**\n * Use this method to set a custom function to batch notifications together into a single tick.\n * By default React Query will use the batch function provided by ReactDOM or React Native.\n */\n setBatchNotifyFunction: (fn: BatchNotifyFunction) => {\n batchNotifyFn = fn\n },\n setScheduler: (fn: ScheduleFunction) => {\n scheduleFn = fn\n },\n } as const\n}\n\n// SINGLETON\nexport const notifyManager = createNotifyManager()\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,4BAAqC;AAY9B,IAAM,mBAAqC;AAE3C,SAAS,sBAAsB;AACpC,MAAI,QAA+B,CAAC;AACpC,MAAI,eAAe;AACnB,MAAI,WAA2B,CAAC,aAAa;AAC3C,aAAS;AAAA,EACX;AACA,MAAI,gBAAqC,CAAC,aAAyB;AACjE,aAAS;AAAA,EACX;AACA,MAAI,aAAa;AAEjB,QAAM,WAAW,CAAC,aAAmC;AACnD,QAAI,cAAc;AAChB,YAAM,KAAK,QAAQ;AAAA,IACrB,OAAO;AACL,iBAAW,MAAM;AACf,iBAAS,QAAQ;AAAA,MACnB,CAAC;AAAA,IACH;AAAA,EACF;AACA,QAAM,QAAQ,MAAY;AACxB,UAAM,gBAAgB;AACtB,YAAQ,CAAC;AACT,QAAI,cAAc,QAAQ;AACxB,iBAAW,MAAM;AACf,sBAAc,MAAM;AAClB,wBAAc,QAAQ,CAAC,aAAa;AAClC,qBAAS,QAAQ;AAAA,UACnB,CAAC;AAAA,QACH,CAAC;AAAA,MACH,CAAC;AAAA,IACH;AAAA,EACF;AAEA,SAAO;AAAA,IACL,OAAO,CAAI,aAAyB;AAClC,UAAI;AACJ;AACA,UAAI;AACF,iBAAS,SAAS;AAAA,MACpB,UAAE;AACA;AACA,YAAI,CAAC,cAAc;AACjB,gBAAM;AAAA,QACR;AAAA,MACF;AACA,aAAO;AAAA,IACT;AAAA;AAAA;AAAA;AAAA,IAIA,YAAY,CACV,aAC0B;AAC1B,aAAO,IAAI,SAAS;AAClB,iBAAS,MAAM;AACb,mBAAS,GAAG,IAAI;AAAA,QAClB,CAAC;AAAA,MACH;AAAA,IACF;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA,IAKA,mBAAmB,CAAC,OAAuB;AACzC,iBAAW;AAAA,IACb;AAAA;AAAA;AAAA;AAAA;AAAA,IAKA,wBAAwB,CAAC,OAA4B;AACnD,sBAAgB;AAAA,IAClB;AAAA,IACA,cAAc,CAAC,OAAyB;AACtC,mBAAa;AAAA,IACf;AAAA,EACF;AACF;AAGO,IAAM,gBAAgB,oBAAoB;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/notifyManager.d.cts b/node_modules/@tanstack/query-core/build/legacy/notifyManager.d.cts deleted file mode 100644 index bd4a370..0000000 --- a/node_modules/@tanstack/query-core/build/legacy/notifyManager.d.cts +++ /dev/null @@ -1,46 +0,0 @@ -type NotifyCallback = () => void; -type NotifyFunction = (callback: () => void) => void; -type BatchNotifyFunction = (callback: () => void) => void; -type BatchCallsCallback> = (...args: T) => void; -type ScheduleFunction = (callback: () => void) => void; -declare const defaultScheduler: ScheduleFunction; -declare function createNotifyManager(): { - readonly batch: (callback: () => T) => T; - /** - * All calls to the wrapped function will be batched. - */ - readonly batchCalls: >(callback: BatchCallsCallback) => BatchCallsCallback; - readonly schedule: (callback: NotifyCallback) => void; - /** - * Use this method to set a custom notify function. - * This can be used to for example wrap notifications with `React.act` while running tests. - */ - readonly setNotifyFunction: (fn: NotifyFunction) => void; - /** - * Use this method to set a custom function to batch notifications together into a single tick. - * By default React Query will use the batch function provided by ReactDOM or React Native. - */ - readonly setBatchNotifyFunction: (fn: BatchNotifyFunction) => void; - readonly setScheduler: (fn: ScheduleFunction) => void; -}; -declare const notifyManager: { - readonly batch: (callback: () => T) => T; - /** - * All calls to the wrapped function will be batched. - */ - readonly batchCalls: >(callback: BatchCallsCallback) => BatchCallsCallback; - readonly schedule: (callback: NotifyCallback) => void; - /** - * Use this method to set a custom notify function. - * This can be used to for example wrap notifications with `React.act` while running tests. - */ - readonly setNotifyFunction: (fn: NotifyFunction) => void; - /** - * Use this method to set a custom function to batch notifications together into a single tick. - * By default React Query will use the batch function provided by ReactDOM or React Native. - */ - readonly setBatchNotifyFunction: (fn: BatchNotifyFunction) => void; - readonly setScheduler: (fn: ScheduleFunction) => void; -}; - -export { createNotifyManager, defaultScheduler, notifyManager }; diff --git a/node_modules/@tanstack/query-core/build/legacy/notifyManager.d.ts b/node_modules/@tanstack/query-core/build/legacy/notifyManager.d.ts deleted file mode 100644 index bd4a370..0000000 --- a/node_modules/@tanstack/query-core/build/legacy/notifyManager.d.ts +++ /dev/null @@ -1,46 +0,0 @@ -type NotifyCallback = () => void; -type NotifyFunction = (callback: () => void) => void; -type BatchNotifyFunction = (callback: () => void) => void; -type BatchCallsCallback> = (...args: T) => void; -type ScheduleFunction = (callback: () => void) => void; -declare const defaultScheduler: ScheduleFunction; -declare function createNotifyManager(): { - readonly batch: (callback: () => T) => T; - /** - * All calls to the wrapped function will be batched. - */ - readonly batchCalls: >(callback: BatchCallsCallback) => BatchCallsCallback; - readonly schedule: (callback: NotifyCallback) => void; - /** - * Use this method to set a custom notify function. - * This can be used to for example wrap notifications with `React.act` while running tests. - */ - readonly setNotifyFunction: (fn: NotifyFunction) => void; - /** - * Use this method to set a custom function to batch notifications together into a single tick. - * By default React Query will use the batch function provided by ReactDOM or React Native. - */ - readonly setBatchNotifyFunction: (fn: BatchNotifyFunction) => void; - readonly setScheduler: (fn: ScheduleFunction) => void; -}; -declare const notifyManager: { - readonly batch: (callback: () => T) => T; - /** - * All calls to the wrapped function will be batched. - */ - readonly batchCalls: >(callback: BatchCallsCallback) => BatchCallsCallback; - readonly schedule: (callback: NotifyCallback) => void; - /** - * Use this method to set a custom notify function. - * This can be used to for example wrap notifications with `React.act` while running tests. - */ - readonly setNotifyFunction: (fn: NotifyFunction) => void; - /** - * Use this method to set a custom function to batch notifications together into a single tick. - * By default React Query will use the batch function provided by ReactDOM or React Native. - */ - readonly setBatchNotifyFunction: (fn: BatchNotifyFunction) => void; - readonly setScheduler: (fn: ScheduleFunction) => void; -}; - -export { createNotifyManager, defaultScheduler, notifyManager }; diff --git a/node_modules/@tanstack/query-core/build/legacy/notifyManager.js b/node_modules/@tanstack/query-core/build/legacy/notifyManager.js deleted file mode 100644 index 6d95cab..0000000 --- a/node_modules/@tanstack/query-core/build/legacy/notifyManager.js +++ /dev/null @@ -1,88 +0,0 @@ -import "./chunk-PXG64RU4.js"; - -// src/notifyManager.ts -import { systemSetTimeoutZero } from "./timeoutManager.js"; -var defaultScheduler = systemSetTimeoutZero; -function createNotifyManager() { - let queue = []; - let transactions = 0; - let notifyFn = (callback) => { - callback(); - }; - let batchNotifyFn = (callback) => { - callback(); - }; - let scheduleFn = defaultScheduler; - const schedule = (callback) => { - if (transactions) { - queue.push(callback); - } else { - scheduleFn(() => { - notifyFn(callback); - }); - } - }; - const flush = () => { - const originalQueue = queue; - queue = []; - if (originalQueue.length) { - scheduleFn(() => { - batchNotifyFn(() => { - originalQueue.forEach((callback) => { - notifyFn(callback); - }); - }); - }); - } - }; - return { - batch: (callback) => { - let result; - transactions++; - try { - result = callback(); - } finally { - transactions--; - if (!transactions) { - flush(); - } - } - return result; - }, - /** - * All calls to the wrapped function will be batched. - */ - batchCalls: (callback) => { - return (...args) => { - schedule(() => { - callback(...args); - }); - }; - }, - schedule, - /** - * Use this method to set a custom notify function. - * This can be used to for example wrap notifications with `React.act` while running tests. - */ - setNotifyFunction: (fn) => { - notifyFn = fn; - }, - /** - * Use this method to set a custom function to batch notifications together into a single tick. - * By default React Query will use the batch function provided by ReactDOM or React Native. - */ - setBatchNotifyFunction: (fn) => { - batchNotifyFn = fn; - }, - setScheduler: (fn) => { - scheduleFn = fn; - } - }; -} -var notifyManager = createNotifyManager(); -export { - createNotifyManager, - defaultScheduler, - notifyManager -}; -//# sourceMappingURL=notifyManager.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/notifyManager.js.map b/node_modules/@tanstack/query-core/build/legacy/notifyManager.js.map deleted file mode 100644 index b7d2523..0000000 --- a/node_modules/@tanstack/query-core/build/legacy/notifyManager.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/notifyManager.ts"],"sourcesContent":["// TYPES\n\nimport { systemSetTimeoutZero } from './timeoutManager'\n\ntype NotifyCallback = () => void\n\ntype NotifyFunction = (callback: () => void) => void\n\ntype BatchNotifyFunction = (callback: () => void) => void\n\ntype BatchCallsCallback> = (...args: T) => void\n\ntype ScheduleFunction = (callback: () => void) => void\n\nexport const defaultScheduler: ScheduleFunction = systemSetTimeoutZero\n\nexport function createNotifyManager() {\n let queue: Array = []\n let transactions = 0\n let notifyFn: NotifyFunction = (callback) => {\n callback()\n }\n let batchNotifyFn: BatchNotifyFunction = (callback: () => void) => {\n callback()\n }\n let scheduleFn = defaultScheduler\n\n const schedule = (callback: NotifyCallback): void => {\n if (transactions) {\n queue.push(callback)\n } else {\n scheduleFn(() => {\n notifyFn(callback)\n })\n }\n }\n const flush = (): void => {\n const originalQueue = queue\n queue = []\n if (originalQueue.length) {\n scheduleFn(() => {\n batchNotifyFn(() => {\n originalQueue.forEach((callback) => {\n notifyFn(callback)\n })\n })\n })\n }\n }\n\n return {\n batch: (callback: () => T): T => {\n let result\n transactions++\n try {\n result = callback()\n } finally {\n transactions--\n if (!transactions) {\n flush()\n }\n }\n return result\n },\n /**\n * All calls to the wrapped function will be batched.\n */\n batchCalls: >(\n callback: BatchCallsCallback,\n ): BatchCallsCallback => {\n return (...args) => {\n schedule(() => {\n callback(...args)\n })\n }\n },\n schedule,\n /**\n * Use this method to set a custom notify function.\n * This can be used to for example wrap notifications with `React.act` while running tests.\n */\n setNotifyFunction: (fn: NotifyFunction) => {\n notifyFn = fn\n },\n /**\n * Use this method to set a custom function to batch notifications together into a single tick.\n * By default React Query will use the batch function provided by ReactDOM or React Native.\n */\n setBatchNotifyFunction: (fn: BatchNotifyFunction) => {\n batchNotifyFn = fn\n },\n setScheduler: (fn: ScheduleFunction) => {\n scheduleFn = fn\n },\n } as const\n}\n\n// SINGLETON\nexport const notifyManager = createNotifyManager()\n"],"mappings":";;;AAEA,SAAS,4BAA4B;AAY9B,IAAM,mBAAqC;AAE3C,SAAS,sBAAsB;AACpC,MAAI,QAA+B,CAAC;AACpC,MAAI,eAAe;AACnB,MAAI,WAA2B,CAAC,aAAa;AAC3C,aAAS;AAAA,EACX;AACA,MAAI,gBAAqC,CAAC,aAAyB;AACjE,aAAS;AAAA,EACX;AACA,MAAI,aAAa;AAEjB,QAAM,WAAW,CAAC,aAAmC;AACnD,QAAI,cAAc;AAChB,YAAM,KAAK,QAAQ;AAAA,IACrB,OAAO;AACL,iBAAW,MAAM;AACf,iBAAS,QAAQ;AAAA,MACnB,CAAC;AAAA,IACH;AAAA,EACF;AACA,QAAM,QAAQ,MAAY;AACxB,UAAM,gBAAgB;AACtB,YAAQ,CAAC;AACT,QAAI,cAAc,QAAQ;AACxB,iBAAW,MAAM;AACf,sBAAc,MAAM;AAClB,wBAAc,QAAQ,CAAC,aAAa;AAClC,qBAAS,QAAQ;AAAA,UACnB,CAAC;AAAA,QACH,CAAC;AAAA,MACH,CAAC;AAAA,IACH;AAAA,EACF;AAEA,SAAO;AAAA,IACL,OAAO,CAAI,aAAyB;AAClC,UAAI;AACJ;AACA,UAAI;AACF,iBAAS,SAAS;AAAA,MACpB,UAAE;AACA;AACA,YAAI,CAAC,cAAc;AACjB,gBAAM;AAAA,QACR;AAAA,MACF;AACA,aAAO;AAAA,IACT;AAAA;AAAA;AAAA;AAAA,IAIA,YAAY,CACV,aAC0B;AAC1B,aAAO,IAAI,SAAS;AAClB,iBAAS,MAAM;AACb,mBAAS,GAAG,IAAI;AAAA,QAClB,CAAC;AAAA,MACH;AAAA,IACF;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA,IAKA,mBAAmB,CAAC,OAAuB;AACzC,iBAAW;AAAA,IACb;AAAA;AAAA;AAAA;AAAA;AAAA,IAKA,wBAAwB,CAAC,OAA4B;AACnD,sBAAgB;AAAA,IAClB;AAAA,IACA,cAAc,CAAC,OAAyB;AACtC,mBAAa;AAAA,IACf;AAAA,EACF;AACF;AAGO,IAAM,gBAAgB,oBAAoB;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/onlineManager.cjs b/node_modules/@tanstack/query-core/build/legacy/onlineManager.cjs deleted file mode 100644 index ebbff3d..0000000 --- a/node_modules/@tanstack/query-core/build/legacy/onlineManager.cjs +++ /dev/null @@ -1,97 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __typeError = (msg) => { - throw TypeError(msg); -}; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg); -var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj)); -var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value); -var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value); - -// src/onlineManager.ts -var onlineManager_exports = {}; -__export(onlineManager_exports, { - OnlineManager: () => OnlineManager, - onlineManager: () => onlineManager -}); -module.exports = __toCommonJS(onlineManager_exports); -var import_subscribable = require("./subscribable.cjs"); -var import_utils = require("./utils.cjs"); -var _online, _cleanup, _setup; -var OnlineManager = class extends import_subscribable.Subscribable { - constructor() { - super(); - __privateAdd(this, _online, true); - __privateAdd(this, _cleanup); - __privateAdd(this, _setup); - __privateSet(this, _setup, (onOnline) => { - if (!import_utils.isServer && window.addEventListener) { - const onlineListener = () => onOnline(true); - const offlineListener = () => onOnline(false); - window.addEventListener("online", onlineListener, false); - window.addEventListener("offline", offlineListener, false); - return () => { - window.removeEventListener("online", onlineListener); - window.removeEventListener("offline", offlineListener); - }; - } - return; - }); - } - onSubscribe() { - if (!__privateGet(this, _cleanup)) { - this.setEventListener(__privateGet(this, _setup)); - } - } - onUnsubscribe() { - var _a; - if (!this.hasListeners()) { - (_a = __privateGet(this, _cleanup)) == null ? void 0 : _a.call(this); - __privateSet(this, _cleanup, void 0); - } - } - setEventListener(setup) { - var _a; - __privateSet(this, _setup, setup); - (_a = __privateGet(this, _cleanup)) == null ? void 0 : _a.call(this); - __privateSet(this, _cleanup, setup(this.setOnline.bind(this))); - } - setOnline(online) { - const changed = __privateGet(this, _online) !== online; - if (changed) { - __privateSet(this, _online, online); - this.listeners.forEach((listener) => { - listener(online); - }); - } - } - isOnline() { - return __privateGet(this, _online); - } -}; -_online = new WeakMap(); -_cleanup = new WeakMap(); -_setup = new WeakMap(); -var onlineManager = new OnlineManager(); -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - OnlineManager, - onlineManager -}); -//# sourceMappingURL=onlineManager.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/onlineManager.cjs.map b/node_modules/@tanstack/query-core/build/legacy/onlineManager.cjs.map deleted file mode 100644 index 808ee31..0000000 --- a/node_modules/@tanstack/query-core/build/legacy/onlineManager.cjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/onlineManager.ts"],"sourcesContent":["import { Subscribable } from './subscribable'\nimport { isServer } from './utils'\n\ntype Listener = (online: boolean) => void\ntype SetupFn = (setOnline: Listener) => (() => void) | undefined\n\nexport class OnlineManager extends Subscribable {\n #online = true\n #cleanup?: () => void\n\n #setup: SetupFn\n\n constructor() {\n super()\n this.#setup = (onOnline) => {\n // addEventListener does not exist in React Native, but window does\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n if (!isServer && window.addEventListener) {\n const onlineListener = () => onOnline(true)\n const offlineListener = () => onOnline(false)\n // Listen to online\n window.addEventListener('online', onlineListener, false)\n window.addEventListener('offline', offlineListener, false)\n\n return () => {\n // Be sure to unsubscribe if a new handler is set\n window.removeEventListener('online', onlineListener)\n window.removeEventListener('offline', offlineListener)\n }\n }\n\n return\n }\n }\n\n protected onSubscribe(): void {\n if (!this.#cleanup) {\n this.setEventListener(this.#setup)\n }\n }\n\n protected onUnsubscribe() {\n if (!this.hasListeners()) {\n this.#cleanup?.()\n this.#cleanup = undefined\n }\n }\n\n setEventListener(setup: SetupFn): void {\n this.#setup = setup\n this.#cleanup?.()\n this.#cleanup = setup(this.setOnline.bind(this))\n }\n\n setOnline(online: boolean): void {\n const changed = this.#online !== online\n\n if (changed) {\n this.#online = online\n this.listeners.forEach((listener) => {\n listener(online)\n })\n }\n }\n\n isOnline(): boolean {\n return this.#online\n }\n}\n\nexport const onlineManager = new OnlineManager()\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;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git a/node_modules/@tanstack/query-core/build/legacy/onlineManager.d.cts b/node_modules/@tanstack/query-core/build/legacy/onlineManager.d.cts deleted file mode 100644 index dde932b..0000000 --- a/node_modules/@tanstack/query-core/build/legacy/onlineManager.d.cts +++ /dev/null @@ -1,16 +0,0 @@ -import { Subscribable } from './subscribable.cjs'; - -type Listener = (online: boolean) => void; -type SetupFn = (setOnline: Listener) => (() => void) | undefined; -declare class OnlineManager extends Subscribable { - #private; - constructor(); - protected onSubscribe(): void; - protected onUnsubscribe(): void; - setEventListener(setup: SetupFn): void; - setOnline(online: boolean): void; - isOnline(): boolean; -} -declare const onlineManager: OnlineManager; - -export { OnlineManager, onlineManager }; diff --git a/node_modules/@tanstack/query-core/build/legacy/onlineManager.d.ts b/node_modules/@tanstack/query-core/build/legacy/onlineManager.d.ts deleted file mode 100644 index 4362a5c..0000000 --- a/node_modules/@tanstack/query-core/build/legacy/onlineManager.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { Subscribable } from './subscribable.js'; - -type Listener = (online: boolean) => void; -type SetupFn = (setOnline: Listener) => (() => void) | undefined; -declare class OnlineManager extends Subscribable { - #private; - constructor(); - protected onSubscribe(): void; - protected onUnsubscribe(): void; - setEventListener(setup: SetupFn): void; - setOnline(online: boolean): void; - isOnline(): boolean; -} -declare const onlineManager: OnlineManager; - -export { OnlineManager, onlineManager }; diff --git a/node_modules/@tanstack/query-core/build/legacy/onlineManager.js b/node_modules/@tanstack/query-core/build/legacy/onlineManager.js deleted file mode 100644 index 97c49dc..0000000 --- a/node_modules/@tanstack/query-core/build/legacy/onlineManager.js +++ /dev/null @@ -1,70 +0,0 @@ -import { - __privateAdd, - __privateGet, - __privateSet -} from "./chunk-PXG64RU4.js"; - -// src/onlineManager.ts -import { Subscribable } from "./subscribable.js"; -import { isServer } from "./utils.js"; -var _online, _cleanup, _setup; -var OnlineManager = class extends Subscribable { - constructor() { - super(); - __privateAdd(this, _online, true); - __privateAdd(this, _cleanup); - __privateAdd(this, _setup); - __privateSet(this, _setup, (onOnline) => { - if (!isServer && window.addEventListener) { - const onlineListener = () => onOnline(true); - const offlineListener = () => onOnline(false); - window.addEventListener("online", onlineListener, false); - window.addEventListener("offline", offlineListener, false); - return () => { - window.removeEventListener("online", onlineListener); - window.removeEventListener("offline", offlineListener); - }; - } - return; - }); - } - onSubscribe() { - if (!__privateGet(this, _cleanup)) { - this.setEventListener(__privateGet(this, _setup)); - } - } - onUnsubscribe() { - var _a; - if (!this.hasListeners()) { - (_a = __privateGet(this, _cleanup)) == null ? void 0 : _a.call(this); - __privateSet(this, _cleanup, void 0); - } - } - setEventListener(setup) { - var _a; - __privateSet(this, _setup, setup); - (_a = __privateGet(this, _cleanup)) == null ? void 0 : _a.call(this); - __privateSet(this, _cleanup, setup(this.setOnline.bind(this))); - } - setOnline(online) { - const changed = __privateGet(this, _online) !== online; - if (changed) { - __privateSet(this, _online, online); - this.listeners.forEach((listener) => { - listener(online); - }); - } - } - isOnline() { - return __privateGet(this, _online); - } -}; -_online = new WeakMap(); -_cleanup = new WeakMap(); -_setup = new WeakMap(); -var onlineManager = new OnlineManager(); -export { - OnlineManager, - onlineManager -}; -//# sourceMappingURL=onlineManager.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/onlineManager.js.map b/node_modules/@tanstack/query-core/build/legacy/onlineManager.js.map deleted file mode 100644 index 92e725d..0000000 --- a/node_modules/@tanstack/query-core/build/legacy/onlineManager.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/onlineManager.ts"],"sourcesContent":["import { Subscribable } from './subscribable'\nimport { isServer } from './utils'\n\ntype Listener = (online: boolean) => void\ntype SetupFn = (setOnline: Listener) => (() => void) | undefined\n\nexport class OnlineManager extends Subscribable {\n #online = true\n #cleanup?: () => void\n\n #setup: SetupFn\n\n constructor() {\n super()\n this.#setup = (onOnline) => {\n // addEventListener does not exist in React Native, but window does\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n if (!isServer && window.addEventListener) {\n const onlineListener = () => onOnline(true)\n const offlineListener = () => onOnline(false)\n // Listen to online\n window.addEventListener('online', onlineListener, false)\n window.addEventListener('offline', offlineListener, false)\n\n return () => {\n // Be sure to unsubscribe if a new handler is set\n window.removeEventListener('online', onlineListener)\n window.removeEventListener('offline', offlineListener)\n }\n }\n\n return\n }\n }\n\n protected onSubscribe(): void {\n if (!this.#cleanup) {\n this.setEventListener(this.#setup)\n }\n }\n\n protected onUnsubscribe() {\n if (!this.hasListeners()) {\n this.#cleanup?.()\n this.#cleanup = undefined\n }\n }\n\n setEventListener(setup: SetupFn): void {\n this.#setup = setup\n this.#cleanup?.()\n this.#cleanup = setup(this.setOnline.bind(this))\n }\n\n setOnline(online: boolean): void {\n const changed = this.#online !== online\n\n if (changed) {\n this.#online = online\n this.listeners.forEach((listener) => {\n listener(online)\n })\n }\n }\n\n isOnline(): boolean {\n return this.#online\n }\n}\n\nexport const onlineManager = new OnlineManager()\n"],"mappings":";;;;;;;AAAA,SAAS,oBAAoB;AAC7B,SAAS,gBAAgB;AADzB;AAMO,IAAM,gBAAN,cAA4B,aAAuB;AAAA,EAMxD,cAAc;AACZ,UAAM;AANR,gCAAU;AACV;AAEA;AAIE,uBAAK,QAAS,CAAC,aAAa;AAG1B,UAAI,CAAC,YAAY,OAAO,kBAAkB;AACxC,cAAM,iBAAiB,MAAM,SAAS,IAAI;AAC1C,cAAM,kBAAkB,MAAM,SAAS,KAAK;AAE5C,eAAO,iBAAiB,UAAU,gBAAgB,KAAK;AACvD,eAAO,iBAAiB,WAAW,iBAAiB,KAAK;AAEzD,eAAO,MAAM;AAEX,iBAAO,oBAAoB,UAAU,cAAc;AACnD,iBAAO,oBAAoB,WAAW,eAAe;AAAA,QACvD;AAAA,MACF;AAEA;AAAA,IACF;AAAA,EACF;AAAA,EAEU,cAAoB;AAC5B,QAAI,CAAC,mBAAK,WAAU;AAClB,WAAK,iBAAiB,mBAAK,OAAM;AAAA,IACnC;AAAA,EACF;AAAA,EAEU,gBAAgB;AAzC5B;AA0CI,QAAI,CAAC,KAAK,aAAa,GAAG;AACxB,+BAAK,cAAL;AACA,yBAAK,UAAW;AAAA,IAClB;AAAA,EACF;AAAA,EAEA,iBAAiB,OAAsB;AAhDzC;AAiDI,uBAAK,QAAS;AACd,6BAAK,cAAL;AACA,uBAAK,UAAW,MAAM,KAAK,UAAU,KAAK,IAAI,CAAC;AAAA,EACjD;AAAA,EAEA,UAAU,QAAuB;AAC/B,UAAM,UAAU,mBAAK,aAAY;AAEjC,QAAI,SAAS;AACX,yBAAK,SAAU;AACf,WAAK,UAAU,QAAQ,CAAC,aAAa;AACnC,iBAAS,MAAM;AAAA,MACjB,CAAC;AAAA,IACH;AAAA,EACF;AAAA,EAEA,WAAoB;AAClB,WAAO,mBAAK;AAAA,EACd;AACF;AA7DE;AACA;AAEA;AA4DK,IAAM,gBAAgB,IAAI,cAAc;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/queriesObserver.cjs b/node_modules/@tanstack/query-core/build/legacy/queriesObserver.cjs deleted file mode 100644 index e3a3584..0000000 --- a/node_modules/@tanstack/query-core/build/legacy/queriesObserver.cjs +++ /dev/null @@ -1,260 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __typeError = (msg) => { - throw TypeError(msg); -}; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg); -var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj)); -var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value); -var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value); -var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method); - -// src/queriesObserver.ts -var queriesObserver_exports = {}; -__export(queriesObserver_exports, { - QueriesObserver: () => QueriesObserver -}); -module.exports = __toCommonJS(queriesObserver_exports); -var import_notifyManager = require("./notifyManager.cjs"); -var import_queryObserver = require("./queryObserver.cjs"); -var import_subscribable = require("./subscribable.cjs"); -var import_utils = require("./utils.cjs"); -function difference(array1, array2) { - const excludeSet = new Set(array2); - return array1.filter((x) => !excludeSet.has(x)); -} -function replaceAt(array, index, value) { - const copy = array.slice(0); - copy[index] = value; - return copy; -} -var _client, _result, _queries, _options, _observers, _combinedResult, _lastCombine, _lastResult, _lastQueryHashes, _observerMatches, _QueriesObserver_instances, trackResult_fn, combineResult_fn, findMatchingObservers_fn, onUpdate_fn, notify_fn; -var QueriesObserver = class extends import_subscribable.Subscribable { - constructor(client, queries, options) { - super(); - __privateAdd(this, _QueriesObserver_instances); - __privateAdd(this, _client); - __privateAdd(this, _result); - __privateAdd(this, _queries); - __privateAdd(this, _options); - __privateAdd(this, _observers); - __privateAdd(this, _combinedResult); - __privateAdd(this, _lastCombine); - __privateAdd(this, _lastResult); - __privateAdd(this, _lastQueryHashes); - __privateAdd(this, _observerMatches, []); - __privateSet(this, _client, client); - __privateSet(this, _options, options); - __privateSet(this, _queries, []); - __privateSet(this, _observers, []); - __privateSet(this, _result, []); - this.setQueries(queries); - } - onSubscribe() { - if (this.listeners.size === 1) { - __privateGet(this, _observers).forEach((observer) => { - observer.subscribe((result) => { - __privateMethod(this, _QueriesObserver_instances, onUpdate_fn).call(this, observer, result); - }); - }); - } - } - onUnsubscribe() { - if (!this.listeners.size) { - this.destroy(); - } - } - destroy() { - this.listeners = /* @__PURE__ */ new Set(); - __privateGet(this, _observers).forEach((observer) => { - observer.destroy(); - }); - } - setQueries(queries, options) { - __privateSet(this, _queries, queries); - __privateSet(this, _options, options); - if (process.env.NODE_ENV !== "production") { - const queryHashes = queries.map( - (query) => __privateGet(this, _client).defaultQueryOptions(query).queryHash - ); - if (new Set(queryHashes).size !== queryHashes.length) { - console.warn( - "[QueriesObserver]: Duplicate Queries found. This might result in unexpected behavior." - ); - } - } - import_notifyManager.notifyManager.batch(() => { - const prevObservers = __privateGet(this, _observers); - const newObserverMatches = __privateMethod(this, _QueriesObserver_instances, findMatchingObservers_fn).call(this, __privateGet(this, _queries)); - newObserverMatches.forEach( - (match) => match.observer.setOptions(match.defaultedQueryOptions) - ); - const newObservers = newObserverMatches.map((match) => match.observer); - const newResult = newObservers.map( - (observer) => observer.getCurrentResult() - ); - const hasLengthChange = prevObservers.length !== newObservers.length; - const hasIndexChange = newObservers.some( - (observer, index) => observer !== prevObservers[index] - ); - const hasStructuralChange = hasLengthChange || hasIndexChange; - const hasResultChange = hasStructuralChange ? true : newResult.some((result, index) => { - const prev = __privateGet(this, _result)[index]; - return !prev || !(0, import_utils.shallowEqualObjects)(result, prev); - }); - if (!hasStructuralChange && !hasResultChange) return; - if (hasStructuralChange) { - __privateSet(this, _observerMatches, newObserverMatches); - __privateSet(this, _observers, newObservers); - } - __privateSet(this, _result, newResult); - if (!this.hasListeners()) return; - if (hasStructuralChange) { - difference(prevObservers, newObservers).forEach((observer) => { - observer.destroy(); - }); - difference(newObservers, prevObservers).forEach((observer) => { - observer.subscribe((result) => { - __privateMethod(this, _QueriesObserver_instances, onUpdate_fn).call(this, observer, result); - }); - }); - } - __privateMethod(this, _QueriesObserver_instances, notify_fn).call(this); - }); - } - getCurrentResult() { - return __privateGet(this, _result); - } - getQueries() { - return __privateGet(this, _observers).map((observer) => observer.getCurrentQuery()); - } - getObservers() { - return __privateGet(this, _observers); - } - getOptimisticResult(queries, combine) { - const matches = __privateMethod(this, _QueriesObserver_instances, findMatchingObservers_fn).call(this, queries); - const result = matches.map( - (match) => match.observer.getOptimisticResult(match.defaultedQueryOptions) - ); - const queryHashes = matches.map( - (match) => match.defaultedQueryOptions.queryHash - ); - return [ - result, - (r) => { - return __privateMethod(this, _QueriesObserver_instances, combineResult_fn).call(this, r ?? result, combine, queryHashes); - }, - () => { - return __privateMethod(this, _QueriesObserver_instances, trackResult_fn).call(this, result, matches); - } - ]; - } -}; -_client = new WeakMap(); -_result = new WeakMap(); -_queries = new WeakMap(); -_options = new WeakMap(); -_observers = new WeakMap(); -_combinedResult = new WeakMap(); -_lastCombine = new WeakMap(); -_lastResult = new WeakMap(); -_lastQueryHashes = new WeakMap(); -_observerMatches = new WeakMap(); -_QueriesObserver_instances = new WeakSet(); -trackResult_fn = function(result, matches) { - return matches.map((match, index) => { - const observerResult = result[index]; - return !match.defaultedQueryOptions.notifyOnChangeProps ? match.observer.trackResult(observerResult, (accessedProp) => { - matches.forEach((m) => { - m.observer.trackProp(accessedProp); - }); - }) : observerResult; - }); -}; -combineResult_fn = function(input, combine, queryHashes) { - if (combine) { - const lastHashes = __privateGet(this, _lastQueryHashes); - const queryHashesChanged = queryHashes !== void 0 && lastHashes !== void 0 && (lastHashes.length !== queryHashes.length || queryHashes.some((hash, i) => hash !== lastHashes[i])); - if (!__privateGet(this, _combinedResult) || __privateGet(this, _result) !== __privateGet(this, _lastResult) || queryHashesChanged || combine !== __privateGet(this, _lastCombine)) { - __privateSet(this, _lastCombine, combine); - __privateSet(this, _lastResult, __privateGet(this, _result)); - if (queryHashes !== void 0) { - __privateSet(this, _lastQueryHashes, queryHashes); - } - __privateSet(this, _combinedResult, (0, import_utils.replaceEqualDeep)( - __privateGet(this, _combinedResult), - combine(input) - )); - } - return __privateGet(this, _combinedResult); - } - return input; -}; -findMatchingObservers_fn = function(queries) { - const prevObserversMap = /* @__PURE__ */ new Map(); - __privateGet(this, _observers).forEach((observer) => { - const key = observer.options.queryHash; - if (!key) return; - const previousObservers = prevObserversMap.get(key); - if (previousObservers) { - previousObservers.push(observer); - } else { - prevObserversMap.set(key, [observer]); - } - }); - const observers = []; - queries.forEach((options) => { - var _a; - const defaultedOptions = __privateGet(this, _client).defaultQueryOptions(options); - const match = (_a = prevObserversMap.get(defaultedOptions.queryHash)) == null ? void 0 : _a.shift(); - const observer = match ?? new import_queryObserver.QueryObserver(__privateGet(this, _client), defaultedOptions); - observers.push({ - defaultedQueryOptions: defaultedOptions, - observer - }); - }); - return observers; -}; -onUpdate_fn = function(observer, result) { - const index = __privateGet(this, _observers).indexOf(observer); - if (index !== -1) { - __privateSet(this, _result, replaceAt(__privateGet(this, _result), index, result)); - __privateMethod(this, _QueriesObserver_instances, notify_fn).call(this); - } -}; -notify_fn = function() { - var _a; - if (this.hasListeners()) { - const previousResult = __privateGet(this, _combinedResult); - const newTracked = __privateMethod(this, _QueriesObserver_instances, trackResult_fn).call(this, __privateGet(this, _result), __privateGet(this, _observerMatches)); - const newResult = __privateMethod(this, _QueriesObserver_instances, combineResult_fn).call(this, newTracked, (_a = __privateGet(this, _options)) == null ? void 0 : _a.combine); - if (previousResult !== newResult) { - import_notifyManager.notifyManager.batch(() => { - this.listeners.forEach((listener) => { - listener(__privateGet(this, _result)); - }); - }); - } - } -}; -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - QueriesObserver -}); -//# sourceMappingURL=queriesObserver.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/queriesObserver.cjs.map b/node_modules/@tanstack/query-core/build/legacy/queriesObserver.cjs.map deleted file mode 100644 index da13e46..0000000 --- a/node_modules/@tanstack/query-core/build/legacy/queriesObserver.cjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/queriesObserver.ts"],"sourcesContent":["import { notifyManager } from './notifyManager'\nimport { QueryObserver } from './queryObserver'\nimport { Subscribable } from './subscribable'\nimport { replaceEqualDeep, shallowEqualObjects } from './utils'\nimport type {\n DefaultedQueryObserverOptions,\n QueryObserverOptions,\n QueryObserverResult,\n} from './types'\nimport type { QueryClient } from './queryClient'\n\nfunction difference(array1: Array, array2: Array): Array {\n const excludeSet = new Set(array2)\n return array1.filter((x) => !excludeSet.has(x))\n}\n\nfunction replaceAt(array: Array, index: number, value: T): Array {\n const copy = array.slice(0)\n copy[index] = value\n return copy\n}\n\ntype QueriesObserverListener = (result: Array) => void\n\ntype CombineFn = (\n result: Array,\n) => TCombinedResult\n\nexport interface QueriesObserverOptions<\n TCombinedResult = Array,\n> {\n combine?: CombineFn\n}\n\nexport class QueriesObserver<\n TCombinedResult = Array,\n> extends Subscribable {\n #client: QueryClient\n #result!: Array\n #queries: Array\n #options?: QueriesObserverOptions\n #observers: Array\n #combinedResult?: TCombinedResult\n #lastCombine?: CombineFn\n #lastResult?: Array\n #lastQueryHashes?: Array\n #observerMatches: Array = []\n\n constructor(\n client: QueryClient,\n queries: Array>,\n options?: QueriesObserverOptions,\n ) {\n super()\n\n this.#client = client\n this.#options = options\n this.#queries = []\n this.#observers = []\n this.#result = []\n\n this.setQueries(queries)\n }\n\n protected onSubscribe(): void {\n if (this.listeners.size === 1) {\n this.#observers.forEach((observer) => {\n observer.subscribe((result) => {\n this.#onUpdate(observer, result)\n })\n })\n }\n }\n\n protected onUnsubscribe(): void {\n if (!this.listeners.size) {\n this.destroy()\n }\n }\n\n destroy(): void {\n this.listeners = new Set()\n this.#observers.forEach((observer) => {\n observer.destroy()\n })\n }\n\n setQueries(\n queries: Array,\n options?: QueriesObserverOptions,\n ): void {\n this.#queries = queries\n this.#options = options\n\n if (process.env.NODE_ENV !== 'production') {\n const queryHashes = queries.map(\n (query) => this.#client.defaultQueryOptions(query).queryHash,\n )\n if (new Set(queryHashes).size !== queryHashes.length) {\n console.warn(\n '[QueriesObserver]: Duplicate Queries found. This might result in unexpected behavior.',\n )\n }\n }\n\n notifyManager.batch(() => {\n const prevObservers = this.#observers\n\n const newObserverMatches = this.#findMatchingObservers(this.#queries)\n\n // set options for the new observers to notify of changes\n newObserverMatches.forEach((match) =>\n match.observer.setOptions(match.defaultedQueryOptions),\n )\n\n const newObservers = newObserverMatches.map((match) => match.observer)\n const newResult = newObservers.map((observer) =>\n observer.getCurrentResult(),\n )\n\n const hasLengthChange = prevObservers.length !== newObservers.length\n const hasIndexChange = newObservers.some(\n (observer, index) => observer !== prevObservers[index],\n )\n const hasStructuralChange = hasLengthChange || hasIndexChange\n\n const hasResultChange = hasStructuralChange\n ? true\n : newResult.some((result, index) => {\n const prev = this.#result[index]\n return !prev || !shallowEqualObjects(result, prev)\n })\n\n if (!hasStructuralChange && !hasResultChange) return\n\n if (hasStructuralChange) {\n this.#observerMatches = newObserverMatches\n this.#observers = newObservers\n }\n\n this.#result = newResult\n\n if (!this.hasListeners()) return\n\n if (hasStructuralChange) {\n difference(prevObservers, newObservers).forEach((observer) => {\n observer.destroy()\n })\n difference(newObservers, prevObservers).forEach((observer) => {\n observer.subscribe((result) => {\n this.#onUpdate(observer, result)\n })\n })\n }\n\n this.#notify()\n })\n }\n\n getCurrentResult(): Array {\n return this.#result\n }\n\n getQueries() {\n return this.#observers.map((observer) => observer.getCurrentQuery())\n }\n\n getObservers() {\n return this.#observers\n }\n\n getOptimisticResult(\n queries: Array,\n combine: CombineFn | undefined,\n ): [\n rawResult: Array,\n combineResult: (r?: Array) => TCombinedResult,\n trackResult: () => Array,\n ] {\n const matches = this.#findMatchingObservers(queries)\n const result = matches.map((match) =>\n match.observer.getOptimisticResult(match.defaultedQueryOptions),\n )\n const queryHashes = matches.map(\n (match) => match.defaultedQueryOptions.queryHash,\n )\n\n return [\n result,\n (r?: Array) => {\n return this.#combineResult(r ?? result, combine, queryHashes)\n },\n () => {\n return this.#trackResult(result, matches)\n },\n ]\n }\n\n #trackResult(\n result: Array,\n matches: Array,\n ) {\n return matches.map((match, index) => {\n const observerResult = result[index]!\n return !match.defaultedQueryOptions.notifyOnChangeProps\n ? match.observer.trackResult(observerResult, (accessedProp) => {\n // track property on all observers to ensure proper (synchronized) tracking (#7000)\n matches.forEach((m) => {\n m.observer.trackProp(accessedProp)\n })\n })\n : observerResult\n })\n }\n\n #combineResult(\n input: Array,\n combine: CombineFn | undefined,\n queryHashes?: Array,\n ): TCombinedResult {\n if (combine) {\n const lastHashes = this.#lastQueryHashes\n const queryHashesChanged =\n queryHashes !== undefined &&\n lastHashes !== undefined &&\n (lastHashes.length !== queryHashes.length ||\n queryHashes.some((hash, i) => hash !== lastHashes[i]))\n\n if (\n !this.#combinedResult ||\n this.#result !== this.#lastResult ||\n queryHashesChanged ||\n combine !== this.#lastCombine\n ) {\n this.#lastCombine = combine\n this.#lastResult = this.#result\n\n if (queryHashes !== undefined) {\n this.#lastQueryHashes = queryHashes\n }\n this.#combinedResult = replaceEqualDeep(\n this.#combinedResult,\n combine(input),\n )\n }\n\n return this.#combinedResult\n }\n return input as any\n }\n\n #findMatchingObservers(\n queries: Array,\n ): Array {\n const prevObserversMap = new Map>()\n\n this.#observers.forEach((observer) => {\n const key = observer.options.queryHash\n if (!key) return\n\n const previousObservers = prevObserversMap.get(key)\n\n if (previousObservers) {\n previousObservers.push(observer)\n } else {\n prevObserversMap.set(key, [observer])\n }\n })\n\n const observers: Array = []\n\n queries.forEach((options) => {\n const defaultedOptions = this.#client.defaultQueryOptions(options)\n const match = prevObserversMap.get(defaultedOptions.queryHash)?.shift()\n const observer =\n match ?? new QueryObserver(this.#client, defaultedOptions)\n\n observers.push({\n defaultedQueryOptions: defaultedOptions,\n observer,\n })\n })\n\n return observers\n }\n\n #onUpdate(observer: QueryObserver, result: QueryObserverResult): void {\n const index = this.#observers.indexOf(observer)\n if (index !== -1) {\n this.#result = replaceAt(this.#result, index, result)\n this.#notify()\n }\n }\n\n #notify(): void {\n if (this.hasListeners()) {\n const previousResult = this.#combinedResult\n const newTracked = this.#trackResult(this.#result, this.#observerMatches)\n const newResult = this.#combineResult(newTracked, this.#options?.combine)\n\n if (previousResult !== newResult) {\n notifyManager.batch(() => {\n this.listeners.forEach((listener) => {\n listener(this.#result)\n })\n })\n }\n }\n }\n}\n\ntype QueryObserverMatch = {\n defaultedQueryOptions: DefaultedQueryObserverOptions\n observer: QueryObserver\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,2BAA8B;AAC9B,2BAA8B;AAC9B,0BAA6B;AAC7B,mBAAsD;AAQtD,SAAS,WAAc,QAAkB,QAA4B;AACnE,QAAM,aAAa,IAAI,IAAI,MAAM;AACjC,SAAO,OAAO,OAAO,CAAC,MAAM,CAAC,WAAW,IAAI,CAAC,CAAC;AAChD;AAEA,SAAS,UAAa,OAAiB,OAAe,OAAoB;AACxE,QAAM,OAAO,MAAM,MAAM,CAAC;AAC1B,OAAK,KAAK,IAAI;AACd,SAAO;AACT;AApBA;AAkCO,IAAM,kBAAN,cAEG,iCAAsC;AAAA,EAY9C,YACE,QACA,SACA,SACA;AACA,UAAM;AAnBH;AAGL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yCAA8C,CAAC;AAS7C,uBAAK,SAAU;AACf,uBAAK,UAAW;AAChB,uBAAK,UAAW,CAAC;AACjB,uBAAK,YAAa,CAAC;AACnB,uBAAK,SAAU,CAAC;AAEhB,SAAK,WAAW,OAAO;AAAA,EACzB;AAAA,EAEU,cAAoB;AAC5B,QAAI,KAAK,UAAU,SAAS,GAAG;AAC7B,yBAAK,YAAW,QAAQ,CAAC,aAAa;AACpC,iBAAS,UAAU,CAAC,WAAW;AAC7B,gCAAK,yCAAL,WAAe,UAAU;AAAA,QAC3B,CAAC;AAAA,MACH,CAAC;AAAA,IACH;AAAA,EACF;AAAA,EAEU,gBAAsB;AAC9B,QAAI,CAAC,KAAK,UAAU,MAAM;AACxB,WAAK,QAAQ;AAAA,IACf;AAAA,EACF;AAAA,EAEA,UAAgB;A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,KAAK;AAAA,MACb,uBAAuB;AAAA,MACvB;AAAA,IACF,CAAC;AAAA,EACH,CAAC;AAED,SAAO;AACT;AAEA,cAAS,SAAC,UAAyB,QAAmC;AACpE,QAAM,QAAQ,mBAAK,YAAW,QAAQ,QAAQ;AAC9C,MAAI,UAAU,IAAI;AAChB,uBAAK,SAAU,UAAU,mBAAK,UAAS,OAAO,MAAM;AACpD,0BAAK,uCAAL;AAAA,EACF;AACF;AAEA,YAAO,WAAS;AAtSlB;AAuSI,MAAI,KAAK,aAAa,GAAG;AACvB,UAAM,iBAAiB,mBAAK;AAC5B,UAAM,aAAa,sBAAK,4CAAL,WAAkB,mBAAK,UAAS,mBAAK;AACxD,UAAM,YAAY,sBAAK,8CAAL,WAAoB,aAAY,wBAAK,cAAL,mBAAe;AAEjE,QAAI,mBAAmB,WAAW;AAChC,yCAAc,MAAM,MAAM;AACxB,aAAK,UAAU,QAAQ,CAAC,aAAa;AACnC,mBAAS,mBAAK,QAAO;AAAA,QACvB,CAAC;AAAA,MACH,CAAC;AAAA,IACH;AAAA,EACF;AACF;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/queriesObserver.d.cts b/node_modules/@tanstack/query-core/build/legacy/queriesObserver.d.cts deleted file mode 100644 index cc16e52..0000000 --- a/node_modules/@tanstack/query-core/build/legacy/queriesObserver.d.cts +++ /dev/null @@ -1,27 +0,0 @@ -import { aH as QueryObserverResult, g as QueryClient, ag as QueryObserverOptions, z as Query, i as QueryObserver } from './hydration-uphG6M-i.cjs'; -import { Subscribable } from './subscribable.cjs'; -import './removable.cjs'; - -type QueriesObserverListener = (result: Array) => void; -type CombineFn = (result: Array) => TCombinedResult; -interface QueriesObserverOptions> { - combine?: CombineFn; -} -declare class QueriesObserver> extends Subscribable { - #private; - constructor(client: QueryClient, queries: Array>, options?: QueriesObserverOptions); - protected onSubscribe(): void; - protected onUnsubscribe(): void; - destroy(): void; - setQueries(queries: Array, options?: QueriesObserverOptions): void; - getCurrentResult(): Array; - getQueries(): Query[]; - getObservers(): QueryObserver[]; - getOptimisticResult(queries: Array, combine: CombineFn | undefined): [ - rawResult: Array, - combineResult: (r?: Array) => TCombinedResult, - trackResult: () => Array - ]; -} - -export { QueriesObserver, type QueriesObserverOptions }; diff --git a/node_modules/@tanstack/query-core/build/legacy/queriesObserver.d.ts b/node_modules/@tanstack/query-core/build/legacy/queriesObserver.d.ts deleted file mode 100644 index 82a6b8f..0000000 --- a/node_modules/@tanstack/query-core/build/legacy/queriesObserver.d.ts +++ /dev/null @@ -1,27 +0,0 @@ -import { aH as QueryObserverResult, g as QueryClient, ag as QueryObserverOptions, z as Query, i as QueryObserver } from './hydration-BlEVG2Lp.js'; -import { Subscribable } from './subscribable.js'; -import './removable.js'; - -type QueriesObserverListener = (result: Array) => void; -type CombineFn = (result: Array) => TCombinedResult; -interface QueriesObserverOptions> { - combine?: CombineFn; -} -declare class QueriesObserver> extends Subscribable { - #private; - constructor(client: QueryClient, queries: Array>, options?: QueriesObserverOptions); - protected onSubscribe(): void; - protected onUnsubscribe(): void; - destroy(): void; - setQueries(queries: Array, options?: QueriesObserverOptions): void; - getCurrentResult(): Array; - getQueries(): Query[]; - getObservers(): QueryObserver[]; - getOptimisticResult(queries: Array, combine: CombineFn | undefined): [ - rawResult: Array, - combineResult: (r?: Array) => TCombinedResult, - trackResult: () => Array - ]; -} - -export { QueriesObserver, type QueriesObserverOptions }; diff --git a/node_modules/@tanstack/query-core/build/legacy/queriesObserver.js b/node_modules/@tanstack/query-core/build/legacy/queriesObserver.js deleted file mode 100644 index 38026fe..0000000 --- a/node_modules/@tanstack/query-core/build/legacy/queriesObserver.js +++ /dev/null @@ -1,234 +0,0 @@ -import { - __privateAdd, - __privateGet, - __privateMethod, - __privateSet -} from "./chunk-PXG64RU4.js"; - -// src/queriesObserver.ts -import { notifyManager } from "./notifyManager.js"; -import { QueryObserver } from "./queryObserver.js"; -import { Subscribable } from "./subscribable.js"; -import { replaceEqualDeep, shallowEqualObjects } from "./utils.js"; -function difference(array1, array2) { - const excludeSet = new Set(array2); - return array1.filter((x) => !excludeSet.has(x)); -} -function replaceAt(array, index, value) { - const copy = array.slice(0); - copy[index] = value; - return copy; -} -var _client, _result, _queries, _options, _observers, _combinedResult, _lastCombine, _lastResult, _lastQueryHashes, _observerMatches, _QueriesObserver_instances, trackResult_fn, combineResult_fn, findMatchingObservers_fn, onUpdate_fn, notify_fn; -var QueriesObserver = class extends Subscribable { - constructor(client, queries, options) { - super(); - __privateAdd(this, _QueriesObserver_instances); - __privateAdd(this, _client); - __privateAdd(this, _result); - __privateAdd(this, _queries); - __privateAdd(this, _options); - __privateAdd(this, _observers); - __privateAdd(this, _combinedResult); - __privateAdd(this, _lastCombine); - __privateAdd(this, _lastResult); - __privateAdd(this, _lastQueryHashes); - __privateAdd(this, _observerMatches, []); - __privateSet(this, _client, client); - __privateSet(this, _options, options); - __privateSet(this, _queries, []); - __privateSet(this, _observers, []); - __privateSet(this, _result, []); - this.setQueries(queries); - } - onSubscribe() { - if (this.listeners.size === 1) { - __privateGet(this, _observers).forEach((observer) => { - observer.subscribe((result) => { - __privateMethod(this, _QueriesObserver_instances, onUpdate_fn).call(this, observer, result); - }); - }); - } - } - onUnsubscribe() { - if (!this.listeners.size) { - this.destroy(); - } - } - destroy() { - this.listeners = /* @__PURE__ */ new Set(); - __privateGet(this, _observers).forEach((observer) => { - observer.destroy(); - }); - } - setQueries(queries, options) { - __privateSet(this, _queries, queries); - __privateSet(this, _options, options); - if (process.env.NODE_ENV !== "production") { - const queryHashes = queries.map( - (query) => __privateGet(this, _client).defaultQueryOptions(query).queryHash - ); - if (new Set(queryHashes).size !== queryHashes.length) { - console.warn( - "[QueriesObserver]: Duplicate Queries found. This might result in unexpected behavior." - ); - } - } - notifyManager.batch(() => { - const prevObservers = __privateGet(this, _observers); - const newObserverMatches = __privateMethod(this, _QueriesObserver_instances, findMatchingObservers_fn).call(this, __privateGet(this, _queries)); - newObserverMatches.forEach( - (match) => match.observer.setOptions(match.defaultedQueryOptions) - ); - const newObservers = newObserverMatches.map((match) => match.observer); - const newResult = newObservers.map( - (observer) => observer.getCurrentResult() - ); - const hasLengthChange = prevObservers.length !== newObservers.length; - const hasIndexChange = newObservers.some( - (observer, index) => observer !== prevObservers[index] - ); - const hasStructuralChange = hasLengthChange || hasIndexChange; - const hasResultChange = hasStructuralChange ? true : newResult.some((result, index) => { - const prev = __privateGet(this, _result)[index]; - return !prev || !shallowEqualObjects(result, prev); - }); - if (!hasStructuralChange && !hasResultChange) return; - if (hasStructuralChange) { - __privateSet(this, _observerMatches, newObserverMatches); - __privateSet(this, _observers, newObservers); - } - __privateSet(this, _result, newResult); - if (!this.hasListeners()) return; - if (hasStructuralChange) { - difference(prevObservers, newObservers).forEach((observer) => { - observer.destroy(); - }); - difference(newObservers, prevObservers).forEach((observer) => { - observer.subscribe((result) => { - __privateMethod(this, _QueriesObserver_instances, onUpdate_fn).call(this, observer, result); - }); - }); - } - __privateMethod(this, _QueriesObserver_instances, notify_fn).call(this); - }); - } - getCurrentResult() { - return __privateGet(this, _result); - } - getQueries() { - return __privateGet(this, _observers).map((observer) => observer.getCurrentQuery()); - } - getObservers() { - return __privateGet(this, _observers); - } - getOptimisticResult(queries, combine) { - const matches = __privateMethod(this, _QueriesObserver_instances, findMatchingObservers_fn).call(this, queries); - const result = matches.map( - (match) => match.observer.getOptimisticResult(match.defaultedQueryOptions) - ); - const queryHashes = matches.map( - (match) => match.defaultedQueryOptions.queryHash - ); - return [ - result, - (r) => { - return __privateMethod(this, _QueriesObserver_instances, combineResult_fn).call(this, r ?? result, combine, queryHashes); - }, - () => { - return __privateMethod(this, _QueriesObserver_instances, trackResult_fn).call(this, result, matches); - } - ]; - } -}; -_client = new WeakMap(); -_result = new WeakMap(); -_queries = new WeakMap(); -_options = new WeakMap(); -_observers = new WeakMap(); -_combinedResult = new WeakMap(); -_lastCombine = new WeakMap(); -_lastResult = new WeakMap(); -_lastQueryHashes = new WeakMap(); -_observerMatches = new WeakMap(); -_QueriesObserver_instances = new WeakSet(); -trackResult_fn = function(result, matches) { - return matches.map((match, index) => { - const observerResult = result[index]; - return !match.defaultedQueryOptions.notifyOnChangeProps ? match.observer.trackResult(observerResult, (accessedProp) => { - matches.forEach((m) => { - m.observer.trackProp(accessedProp); - }); - }) : observerResult; - }); -}; -combineResult_fn = function(input, combine, queryHashes) { - if (combine) { - const lastHashes = __privateGet(this, _lastQueryHashes); - const queryHashesChanged = queryHashes !== void 0 && lastHashes !== void 0 && (lastHashes.length !== queryHashes.length || queryHashes.some((hash, i) => hash !== lastHashes[i])); - if (!__privateGet(this, _combinedResult) || __privateGet(this, _result) !== __privateGet(this, _lastResult) || queryHashesChanged || combine !== __privateGet(this, _lastCombine)) { - __privateSet(this, _lastCombine, combine); - __privateSet(this, _lastResult, __privateGet(this, _result)); - if (queryHashes !== void 0) { - __privateSet(this, _lastQueryHashes, queryHashes); - } - __privateSet(this, _combinedResult, replaceEqualDeep( - __privateGet(this, _combinedResult), - combine(input) - )); - } - return __privateGet(this, _combinedResult); - } - return input; -}; -findMatchingObservers_fn = function(queries) { - const prevObserversMap = /* @__PURE__ */ new Map(); - __privateGet(this, _observers).forEach((observer) => { - const key = observer.options.queryHash; - if (!key) return; - const previousObservers = prevObserversMap.get(key); - if (previousObservers) { - previousObservers.push(observer); - } else { - prevObserversMap.set(key, [observer]); - } - }); - const observers = []; - queries.forEach((options) => { - var _a; - const defaultedOptions = __privateGet(this, _client).defaultQueryOptions(options); - const match = (_a = prevObserversMap.get(defaultedOptions.queryHash)) == null ? void 0 : _a.shift(); - const observer = match ?? new QueryObserver(__privateGet(this, _client), defaultedOptions); - observers.push({ - defaultedQueryOptions: defaultedOptions, - observer - }); - }); - return observers; -}; -onUpdate_fn = function(observer, result) { - const index = __privateGet(this, _observers).indexOf(observer); - if (index !== -1) { - __privateSet(this, _result, replaceAt(__privateGet(this, _result), index, result)); - __privateMethod(this, _QueriesObserver_instances, notify_fn).call(this); - } -}; -notify_fn = function() { - var _a; - if (this.hasListeners()) { - const previousResult = __privateGet(this, _combinedResult); - const newTracked = __privateMethod(this, _QueriesObserver_instances, trackResult_fn).call(this, __privateGet(this, _result), __privateGet(this, _observerMatches)); - const newResult = __privateMethod(this, _QueriesObserver_instances, combineResult_fn).call(this, newTracked, (_a = __privateGet(this, _options)) == null ? void 0 : _a.combine); - if (previousResult !== newResult) { - notifyManager.batch(() => { - this.listeners.forEach((listener) => { - listener(__privateGet(this, _result)); - }); - }); - } - } -}; -export { - QueriesObserver -}; -//# sourceMappingURL=queriesObserver.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/queriesObserver.js.map b/node_modules/@tanstack/query-core/build/legacy/queriesObserver.js.map deleted file mode 100644 index 7ca9b2f..0000000 --- a/node_modules/@tanstack/query-core/build/legacy/queriesObserver.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/queriesObserver.ts"],"sourcesContent":["import { notifyManager } from './notifyManager'\nimport { QueryObserver } from './queryObserver'\nimport { Subscribable } from './subscribable'\nimport { replaceEqualDeep, shallowEqualObjects } from './utils'\nimport type {\n DefaultedQueryObserverOptions,\n QueryObserverOptions,\n QueryObserverResult,\n} from './types'\nimport type { QueryClient } from './queryClient'\n\nfunction difference(array1: Array, array2: Array): Array {\n const excludeSet = new Set(array2)\n return array1.filter((x) => !excludeSet.has(x))\n}\n\nfunction replaceAt(array: Array, index: number, value: T): Array {\n const copy = array.slice(0)\n copy[index] = value\n return copy\n}\n\ntype QueriesObserverListener = (result: Array) => void\n\ntype CombineFn = (\n result: Array,\n) => TCombinedResult\n\nexport interface QueriesObserverOptions<\n TCombinedResult = Array,\n> {\n combine?: CombineFn\n}\n\nexport class QueriesObserver<\n TCombinedResult = Array,\n> extends Subscribable {\n #client: QueryClient\n #result!: Array\n #queries: Array\n #options?: QueriesObserverOptions\n #observers: Array\n #combinedResult?: TCombinedResult\n #lastCombine?: CombineFn\n #lastResult?: Array\n #lastQueryHashes?: Array\n #observerMatches: Array = []\n\n constructor(\n client: QueryClient,\n queries: Array>,\n options?: QueriesObserverOptions,\n ) {\n super()\n\n this.#client = client\n this.#options = options\n this.#queries = []\n this.#observers = []\n this.#result = []\n\n this.setQueries(queries)\n }\n\n protected onSubscribe(): void {\n if (this.listeners.size === 1) {\n this.#observers.forEach((observer) => {\n observer.subscribe((result) => {\n this.#onUpdate(observer, result)\n })\n })\n }\n }\n\n protected onUnsubscribe(): void {\n if (!this.listeners.size) {\n this.destroy()\n }\n }\n\n destroy(): void {\n this.listeners = new Set()\n this.#observers.forEach((observer) => {\n observer.destroy()\n })\n }\n\n setQueries(\n queries: Array,\n options?: QueriesObserverOptions,\n ): void {\n this.#queries = queries\n this.#options = options\n\n if (process.env.NODE_ENV !== 'production') {\n const queryHashes = queries.map(\n (query) => this.#client.defaultQueryOptions(query).queryHash,\n )\n if (new Set(queryHashes).size !== queryHashes.length) {\n console.warn(\n '[QueriesObserver]: Duplicate Queries found. This might result in unexpected behavior.',\n )\n }\n }\n\n notifyManager.batch(() => {\n const prevObservers = this.#observers\n\n const newObserverMatches = this.#findMatchingObservers(this.#queries)\n\n // set options for the new observers to notify of changes\n newObserverMatches.forEach((match) =>\n match.observer.setOptions(match.defaultedQueryOptions),\n )\n\n const newObservers = newObserverMatches.map((match) => match.observer)\n const newResult = newObservers.map((observer) =>\n observer.getCurrentResult(),\n )\n\n const hasLengthChange = prevObservers.length !== newObservers.length\n const hasIndexChange = newObservers.some(\n (observer, index) => observer !== prevObservers[index],\n )\n const hasStructuralChange = hasLengthChange || hasIndexChange\n\n const hasResultChange = hasStructuralChange\n ? true\n : newResult.some((result, index) => {\n const prev = this.#result[index]\n return !prev || !shallowEqualObjects(result, prev)\n })\n\n if (!hasStructuralChange && !hasResultChange) return\n\n if (hasStructuralChange) {\n this.#observerMatches = newObserverMatches\n this.#observers = newObservers\n }\n\n this.#result = newResult\n\n if (!this.hasListeners()) return\n\n if (hasStructuralChange) {\n difference(prevObservers, newObservers).forEach((observer) => {\n observer.destroy()\n })\n difference(newObservers, prevObservers).forEach((observer) => {\n observer.subscribe((result) => {\n this.#onUpdate(observer, result)\n })\n })\n }\n\n this.#notify()\n })\n }\n\n getCurrentResult(): Array {\n return this.#result\n }\n\n getQueries() {\n return this.#observers.map((observer) => observer.getCurrentQuery())\n }\n\n getObservers() {\n return this.#observers\n }\n\n getOptimisticResult(\n queries: Array,\n combine: CombineFn | undefined,\n ): [\n rawResult: Array,\n combineResult: (r?: Array) => TCombinedResult,\n trackResult: () => Array,\n ] {\n const matches = this.#findMatchingObservers(queries)\n const result = matches.map((match) =>\n match.observer.getOptimisticResult(match.defaultedQueryOptions),\n )\n const queryHashes = matches.map(\n (match) => match.defaultedQueryOptions.queryHash,\n )\n\n return [\n result,\n (r?: Array) => {\n return this.#combineResult(r ?? result, combine, queryHashes)\n },\n () => {\n return this.#trackResult(result, matches)\n },\n ]\n }\n\n #trackResult(\n result: Array,\n matches: Array,\n ) {\n return matches.map((match, index) => {\n const observerResult = result[index]!\n return !match.defaultedQueryOptions.notifyOnChangeProps\n ? match.observer.trackResult(observerResult, (accessedProp) => {\n // track property on all observers to ensure proper (synchronized) tracking (#7000)\n matches.forEach((m) => {\n m.observer.trackProp(accessedProp)\n })\n })\n : observerResult\n })\n }\n\n #combineResult(\n input: Array,\n combine: CombineFn | undefined,\n queryHashes?: Array,\n ): TCombinedResult {\n if (combine) {\n const lastHashes = this.#lastQueryHashes\n const queryHashesChanged =\n queryHashes !== undefined &&\n lastHashes !== undefined &&\n (lastHashes.length !== queryHashes.length ||\n queryHashes.some((hash, i) => hash !== lastHashes[i]))\n\n if (\n !this.#combinedResult ||\n this.#result !== this.#lastResult ||\n queryHashesChanged ||\n combine !== this.#lastCombine\n ) {\n this.#lastCombine = combine\n this.#lastResult = this.#result\n\n if (queryHashes !== undefined) {\n this.#lastQueryHashes = queryHashes\n }\n this.#combinedResult = replaceEqualDeep(\n this.#combinedResult,\n combine(input),\n )\n }\n\n return this.#combinedResult\n }\n return input as any\n }\n\n #findMatchingObservers(\n queries: Array,\n ): Array {\n const prevObserversMap = new Map>()\n\n this.#observers.forEach((observer) => {\n const key = observer.options.queryHash\n if (!key) return\n\n const previousObservers = prevObserversMap.get(key)\n\n if (previousObservers) {\n previousObservers.push(observer)\n } else {\n prevObserversMap.set(key, [observer])\n }\n })\n\n const observers: Array = []\n\n queries.forEach((options) => {\n const defaultedOptions = this.#client.defaultQueryOptions(options)\n const match = prevObserversMap.get(defaultedOptions.queryHash)?.shift()\n const observer =\n match ?? new QueryObserver(this.#client, defaultedOptions)\n\n observers.push({\n defaultedQueryOptions: defaultedOptions,\n observer,\n })\n })\n\n return observers\n }\n\n #onUpdate(observer: QueryObserver, result: QueryObserverResult): void {\n const index = this.#observers.indexOf(observer)\n if (index !== -1) {\n this.#result = replaceAt(this.#result, index, result)\n this.#notify()\n }\n }\n\n #notify(): void {\n if (this.hasListeners()) {\n const previousResult = this.#combinedResult\n const newTracked = this.#trackResult(this.#result, this.#observerMatches)\n const newResult = this.#combineResult(newTracked, this.#options?.combine)\n\n if (previousResult !== newResult) {\n notifyManager.batch(() => {\n this.listeners.forEach((listener) => {\n listener(this.#result)\n })\n })\n }\n }\n }\n}\n\ntype QueryObserverMatch = {\n defaultedQueryOptions: DefaultedQueryObserverOptions\n observer: QueryObserver\n}\n"],"mappings":";;;;;;;;AAAA,SAAS,qBAAqB;AAC9B,SAAS,qBAAqB;AAC9B,SAAS,oBAAoB;AAC7B,SAAS,kBAAkB,2BAA2B;AAQtD,SAAS,WAAc,QAAkB,QAA4B;AACnE,QAAM,aAAa,IAAI,IAAI,MAAM;AACjC,SAAO,OAAO,OAAO,CAAC,MAAM,CAAC,WAAW,IAAI,CAAC,CAAC;AAChD;AAEA,SAAS,UAAa,OAAiB,OAAe,OAAoB;AACxE,QAAM,OAAO,MAAM,MAAM,CAAC;AAC1B,OAAK,KAAK,IAAI;AACd,SAAO;AACT;AApBA;AAkCO,IAAM,kBAAN,cAEG,aAAsC;A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A,MACH,CAAC;AAAA,IACH;AAAA,EACF;AACF;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/query.cjs b/node_modules/@tanstack/query-core/build/legacy/query.cjs deleted file mode 100644 index 6033f4e..0000000 --- a/node_modules/@tanstack/query-core/build/legacy/query.cjs +++ /dev/null @@ -1,478 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __typeError = (msg) => { - throw TypeError(msg); -}; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg); -var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj)); -var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value); -var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value); -var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method); - -// src/query.ts -var query_exports = {}; -__export(query_exports, { - Query: () => Query, - fetchState: () => fetchState -}); -module.exports = __toCommonJS(query_exports); -var import_utils = require("./utils.cjs"); -var import_notifyManager = require("./notifyManager.cjs"); -var import_retryer = require("./retryer.cjs"); -var import_removable = require("./removable.cjs"); -var _initialState, _revertState, _cache, _client, _retryer, _defaultOptions, _abortSignalConsumed, _Query_instances, dispatch_fn; -var Query = class extends import_removable.Removable { - constructor(config) { - super(); - __privateAdd(this, _Query_instances); - __privateAdd(this, _initialState); - __privateAdd(this, _revertState); - __privateAdd(this, _cache); - __privateAdd(this, _client); - __privateAdd(this, _retryer); - __privateAdd(this, _defaultOptions); - __privateAdd(this, _abortSignalConsumed); - __privateSet(this, _abortSignalConsumed, false); - __privateSet(this, _defaultOptions, config.defaultOptions); - this.setOptions(config.options); - this.observers = []; - __privateSet(this, _client, config.client); - __privateSet(this, _cache, __privateGet(this, _client).getQueryCache()); - this.queryKey = config.queryKey; - this.queryHash = config.queryHash; - __privateSet(this, _initialState, getDefaultState(this.options)); - this.state = config.state ?? __privateGet(this, _initialState); - this.scheduleGc(); - } - get meta() { - return this.options.meta; - } - get promise() { - var _a; - return (_a = __privateGet(this, _retryer)) == null ? void 0 : _a.promise; - } - setOptions(options) { - this.options = { ...__privateGet(this, _defaultOptions), ...options }; - this.updateGcTime(this.options.gcTime); - if (this.state && this.state.data === void 0) { - const defaultState = getDefaultState(this.options); - if (defaultState.data !== void 0) { - this.setState( - successState(defaultState.data, defaultState.dataUpdatedAt) - ); - __privateSet(this, _initialState, defaultState); - } - } - } - optionalRemove() { - if (!this.observers.length && this.state.fetchStatus === "idle") { - __privateGet(this, _cache).remove(this); - } - } - setData(newData, options) { - const data = (0, import_utils.replaceData)(this.state.data, newData, this.options); - __privateMethod(this, _Query_instances, dispatch_fn).call(this, { - data, - type: "success", - dataUpdatedAt: options == null ? void 0 : options.updatedAt, - manual: options == null ? void 0 : options.manual - }); - return data; - } - setState(state, setStateOptions) { - __privateMethod(this, _Query_instances, dispatch_fn).call(this, { type: "setState", state, setStateOptions }); - } - cancel(options) { - var _a, _b; - const promise = (_a = __privateGet(this, _retryer)) == null ? void 0 : _a.promise; - (_b = __privateGet(this, _retryer)) == null ? void 0 : _b.cancel(options); - return promise ? promise.then(import_utils.noop).catch(import_utils.noop) : Promise.resolve(); - } - destroy() { - super.destroy(); - this.cancel({ silent: true }); - } - reset() { - this.destroy(); - this.setState(__privateGet(this, _initialState)); - } - isActive() { - return this.observers.some( - (observer) => (0, import_utils.resolveEnabled)(observer.options.enabled, this) !== false - ); - } - isDisabled() { - if (this.getObserversCount() > 0) { - return !this.isActive(); - } - return this.options.queryFn === import_utils.skipToken || this.state.dataUpdateCount + this.state.errorUpdateCount === 0; - } - isStatic() { - if (this.getObserversCount() > 0) { - return this.observers.some( - (observer) => (0, import_utils.resolveStaleTime)(observer.options.staleTime, this) === "static" - ); - } - return false; - } - isStale() { - if (this.getObserversCount() > 0) { - return this.observers.some( - (observer) => observer.getCurrentResult().isStale - ); - } - return this.state.data === void 0 || this.state.isInvalidated; - } - isStaleByTime(staleTime = 0) { - if (this.state.data === void 0) { - return true; - } - if (staleTime === "static") { - return false; - } - if (this.state.isInvalidated) { - return true; - } - return !(0, import_utils.timeUntilStale)(this.state.dataUpdatedAt, staleTime); - } - onFocus() { - var _a; - const observer = this.observers.find((x) => x.shouldFetchOnWindowFocus()); - observer == null ? void 0 : observer.refetch({ cancelRefetch: false }); - (_a = __privateGet(this, _retryer)) == null ? void 0 : _a.continue(); - } - onOnline() { - var _a; - const observer = this.observers.find((x) => x.shouldFetchOnReconnect()); - observer == null ? void 0 : observer.refetch({ cancelRefetch: false }); - (_a = __privateGet(this, _retryer)) == null ? void 0 : _a.continue(); - } - addObserver(observer) { - if (!this.observers.includes(observer)) { - this.observers.push(observer); - this.clearGcTimeout(); - __privateGet(this, _cache).notify({ type: "observerAdded", query: this, observer }); - } - } - removeObserver(observer) { - if (this.observers.includes(observer)) { - this.observers = this.observers.filter((x) => x !== observer); - if (!this.observers.length) { - if (__privateGet(this, _retryer)) { - if (__privateGet(this, _abortSignalConsumed)) { - __privateGet(this, _retryer).cancel({ revert: true }); - } else { - __privateGet(this, _retryer).cancelRetry(); - } - } - this.scheduleGc(); - } - __privateGet(this, _cache).notify({ type: "observerRemoved", query: this, observer }); - } - } - getObserversCount() { - return this.observers.length; - } - invalidate() { - if (!this.state.isInvalidated) { - __privateMethod(this, _Query_instances, dispatch_fn).call(this, { type: "invalidate" }); - } - } - async fetch(options, fetchOptions) { - var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l; - if (this.state.fetchStatus !== "idle" && // If the promise in the retryer is already rejected, we have to definitely - // re-start the fetch; there is a chance that the query is still in a - // pending state when that happens - ((_a = __privateGet(this, _retryer)) == null ? void 0 : _a.status()) !== "rejected") { - if (this.state.data !== void 0 && (fetchOptions == null ? void 0 : fetchOptions.cancelRefetch)) { - this.cancel({ silent: true }); - } else if (__privateGet(this, _retryer)) { - __privateGet(this, _retryer).continueRetry(); - return __privateGet(this, _retryer).promise; - } - } - if (options) { - this.setOptions(options); - } - if (!this.options.queryFn) { - const observer = this.observers.find((x) => x.options.queryFn); - if (observer) { - this.setOptions(observer.options); - } - } - if (process.env.NODE_ENV !== "production") { - if (!Array.isArray(this.options.queryKey)) { - console.error( - `As of v4, queryKey needs to be an Array. If you are using a string like 'repoData', please change it to an Array, e.g. ['repoData']` - ); - } - } - const abortController = new AbortController(); - const addSignalProperty = (object) => { - Object.defineProperty(object, "signal", { - enumerable: true, - get: () => { - __privateSet(this, _abortSignalConsumed, true); - return abortController.signal; - } - }); - }; - const fetchFn = () => { - const queryFn = (0, import_utils.ensureQueryFn)(this.options, fetchOptions); - const createQueryFnContext = () => { - const queryFnContext2 = { - client: __privateGet(this, _client), - queryKey: this.queryKey, - meta: this.meta - }; - addSignalProperty(queryFnContext2); - return queryFnContext2; - }; - const queryFnContext = createQueryFnContext(); - __privateSet(this, _abortSignalConsumed, false); - if (this.options.persister) { - return this.options.persister( - queryFn, - queryFnContext, - this - ); - } - return queryFn(queryFnContext); - }; - const createFetchContext = () => { - const context2 = { - fetchOptions, - options: this.options, - queryKey: this.queryKey, - client: __privateGet(this, _client), - state: this.state, - fetchFn - }; - addSignalProperty(context2); - return context2; - }; - const context = createFetchContext(); - (_b = this.options.behavior) == null ? void 0 : _b.onFetch(context, this); - __privateSet(this, _revertState, this.state); - if (this.state.fetchStatus === "idle" || this.state.fetchMeta !== ((_c = context.fetchOptions) == null ? void 0 : _c.meta)) { - __privateMethod(this, _Query_instances, dispatch_fn).call(this, { type: "fetch", meta: (_d = context.fetchOptions) == null ? void 0 : _d.meta }); - } - __privateSet(this, _retryer, (0, import_retryer.createRetryer)({ - initialPromise: fetchOptions == null ? void 0 : fetchOptions.initialPromise, - fn: context.fetchFn, - onCancel: (error) => { - if (error instanceof import_retryer.CancelledError && error.revert) { - this.setState({ - ...__privateGet(this, _revertState), - fetchStatus: "idle" - }); - } - abortController.abort(); - }, - onFail: (failureCount, error) => { - __privateMethod(this, _Query_instances, dispatch_fn).call(this, { type: "failed", failureCount, error }); - }, - onPause: () => { - __privateMethod(this, _Query_instances, dispatch_fn).call(this, { type: "pause" }); - }, - onContinue: () => { - __privateMethod(this, _Query_instances, dispatch_fn).call(this, { type: "continue" }); - }, - retry: context.options.retry, - retryDelay: context.options.retryDelay, - networkMode: context.options.networkMode, - canRun: () => true - })); - try { - const data = await __privateGet(this, _retryer).start(); - if (data === void 0) { - if (process.env.NODE_ENV !== "production") { - console.error( - `Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}` - ); - } - throw new Error(`${this.queryHash} data is undefined`); - } - this.setData(data); - (_f = (_e = __privateGet(this, _cache).config).onSuccess) == null ? void 0 : _f.call(_e, data, this); - (_h = (_g = __privateGet(this, _cache).config).onSettled) == null ? void 0 : _h.call( - _g, - data, - this.state.error, - this - ); - return data; - } catch (error) { - if (error instanceof import_retryer.CancelledError) { - if (error.silent) { - return __privateGet(this, _retryer).promise; - } else if (error.revert) { - if (this.state.data === void 0) { - throw error; - } - return this.state.data; - } - } - __privateMethod(this, _Query_instances, dispatch_fn).call(this, { - type: "error", - error - }); - (_j = (_i = __privateGet(this, _cache).config).onError) == null ? void 0 : _j.call( - _i, - error, - this - ); - (_l = (_k = __privateGet(this, _cache).config).onSettled) == null ? void 0 : _l.call( - _k, - this.state.data, - error, - this - ); - throw error; - } finally { - this.scheduleGc(); - } - } -}; -_initialState = new WeakMap(); -_revertState = new WeakMap(); -_cache = new WeakMap(); -_client = new WeakMap(); -_retryer = new WeakMap(); -_defaultOptions = new WeakMap(); -_abortSignalConsumed = new WeakMap(); -_Query_instances = new WeakSet(); -dispatch_fn = function(action) { - const reducer = (state) => { - switch (action.type) { - case "failed": - return { - ...state, - fetchFailureCount: action.failureCount, - fetchFailureReason: action.error - }; - case "pause": - return { - ...state, - fetchStatus: "paused" - }; - case "continue": - return { - ...state, - fetchStatus: "fetching" - }; - case "fetch": - return { - ...state, - ...fetchState(state.data, this.options), - fetchMeta: action.meta ?? null - }; - case "success": - const newState = { - ...state, - ...successState(action.data, action.dataUpdatedAt), - dataUpdateCount: state.dataUpdateCount + 1, - ...!action.manual && { - fetchStatus: "idle", - fetchFailureCount: 0, - fetchFailureReason: null - } - }; - __privateSet(this, _revertState, action.manual ? newState : void 0); - return newState; - case "error": - const error = action.error; - return { - ...state, - error, - errorUpdateCount: state.errorUpdateCount + 1, - errorUpdatedAt: Date.now(), - fetchFailureCount: state.fetchFailureCount + 1, - fetchFailureReason: error, - fetchStatus: "idle", - status: "error", - // flag existing data as invalidated if we get a background error - // note that "no data" always means stale so we can set unconditionally here - isInvalidated: true - }; - case "invalidate": - return { - ...state, - isInvalidated: true - }; - case "setState": - return { - ...state, - ...action.state - }; - } - }; - this.state = reducer(this.state); - import_notifyManager.notifyManager.batch(() => { - this.observers.forEach((observer) => { - observer.onQueryUpdate(); - }); - __privateGet(this, _cache).notify({ query: this, type: "updated", action }); - }); -}; -function fetchState(data, options) { - return { - fetchFailureCount: 0, - fetchFailureReason: null, - fetchStatus: (0, import_retryer.canFetch)(options.networkMode) ? "fetching" : "paused", - ...data === void 0 && { - error: null, - status: "pending" - } - }; -} -function successState(data, dataUpdatedAt) { - return { - data, - dataUpdatedAt: dataUpdatedAt ?? Date.now(), - error: null, - isInvalidated: false, - status: "success" - }; -} -function getDefaultState(options) { - const data = typeof options.initialData === "function" ? options.initialData() : options.initialData; - const hasData = data !== void 0; - const initialDataUpdatedAt = hasData ? typeof options.initialDataUpdatedAt === "function" ? options.initialDataUpdatedAt() : options.initialDataUpdatedAt : 0; - return { - data, - dataUpdateCount: 0, - dataUpdatedAt: hasData ? initialDataUpdatedAt ?? Date.now() : 0, - error: null, - errorUpdateCount: 0, - errorUpdatedAt: 0, - fetchFailureCount: 0, - fetchFailureReason: null, - fetchMeta: null, - isInvalidated: false, - status: hasData ? "success" : "pending", - fetchStatus: "idle" - }; -} -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - Query, - fetchState -}); -//# sourceMappingURL=query.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/query.cjs.map b/node_modules/@tanstack/query-core/build/legacy/query.cjs.map deleted file mode 100644 index 5784850..0000000 --- a/node_modules/@tanstack/query-core/build/legacy/query.cjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/query.ts"],"sourcesContent":["import {\n ensureQueryFn,\n noop,\n replaceData,\n resolveEnabled,\n resolveStaleTime,\n skipToken,\n timeUntilStale,\n} from './utils'\nimport { notifyManager } from './notifyManager'\nimport { CancelledError, canFetch, createRetryer } from './retryer'\nimport { Removable } from './removable'\nimport type { QueryCache } from './queryCache'\nimport type { QueryClient } from './queryClient'\nimport type {\n CancelOptions,\n DefaultError,\n FetchStatus,\n InitialDataFunction,\n OmitKeyof,\n QueryFunctionContext,\n QueryKey,\n QueryMeta,\n QueryOptions,\n QueryStatus,\n SetDataOptions,\n StaleTime,\n} from './types'\nimport type { QueryObserver } from './queryObserver'\nimport type { Retryer } from './retryer'\n\n// TYPES\n\ninterface QueryConfig<\n TQueryFnData,\n TError,\n TData,\n TQueryKey extends QueryKey = QueryKey,\n> {\n client: QueryClient\n queryKey: TQueryKey\n queryHash: string\n options?: QueryOptions\n defaultOptions?: QueryOptions\n state?: QueryState\n}\n\nexport interface QueryState {\n data: TData | undefined\n dataUpdateCount: number\n dataUpdatedAt: number\n error: TError | null\n errorUpdateCount: number\n errorUpdatedAt: number\n fetchFailureCount: number\n fetchFailureReason: TError | null\n fetchMeta: FetchMeta | null\n isInvalidated: boolean\n status: QueryStatus\n fetchStatus: FetchStatus\n}\n\nexport interface FetchContext<\n TQueryFnData,\n TError,\n TData,\n TQueryKey extends QueryKey = QueryKey,\n> {\n fetchFn: () => unknown | Promise\n fetchOptions?: FetchOptions\n signal: AbortSignal\n options: QueryOptions\n client: QueryClient\n queryKey: TQueryKey\n state: QueryState\n}\n\nexport interface QueryBehavior<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> {\n onFetch: (\n context: FetchContext,\n query: Query,\n ) => void\n}\n\nexport type FetchDirection = 'forward' | 'backward'\n\nexport interface FetchMeta {\n fetchMore?: { direction: FetchDirection }\n}\n\nexport interface FetchOptions {\n cancelRefetch?: boolean\n meta?: FetchMeta\n initialPromise?: Promise\n}\n\ninterface FailedAction {\n type: 'failed'\n failureCount: number\n error: TError\n}\n\ninterface FetchAction {\n type: 'fetch'\n meta?: FetchMeta\n}\n\ninterface SuccessAction {\n data: TData | undefined\n type: 'success'\n dataUpdatedAt?: number\n manual?: boolean\n}\n\ninterface ErrorAction {\n type: 'error'\n error: TError\n}\n\ninterface InvalidateAction {\n type: 'invalidate'\n}\n\ninterface PauseAction {\n type: 'pause'\n}\n\ninterface ContinueAction {\n type: 'continue'\n}\n\ninterface SetStateAction {\n type: 'setState'\n state: Partial>\n setStateOptions?: SetStateOptions\n}\n\nexport type Action =\n | ContinueAction\n | ErrorAction\n | FailedAction\n | FetchAction\n | InvalidateAction\n | PauseAction\n | SetStateAction\n | SuccessAction\n\nexport interface SetStateOptions {\n meta?: any\n}\n\n// CLASS\n\nexport class Query<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> extends Removable {\n queryKey: TQueryKey\n queryHash: string\n options!: QueryOptions\n state: QueryState\n\n #initialState: QueryState\n #revertState?: QueryState\n #cache: QueryCache\n #client: QueryClient\n #retryer?: Retryer\n observers: Array>\n #defaultOptions?: QueryOptions\n #abortSignalConsumed: boolean\n\n constructor(config: QueryConfig) {\n super()\n\n this.#abortSignalConsumed = false\n this.#defaultOptions = config.defaultOptions\n this.setOptions(config.options)\n this.observers = []\n this.#client = config.client\n this.#cache = this.#client.getQueryCache()\n this.queryKey = config.queryKey\n this.queryHash = config.queryHash\n this.#initialState = getDefaultState(this.options)\n this.state = config.state ?? this.#initialState\n this.scheduleGc()\n }\n get meta(): QueryMeta | undefined {\n return this.options.meta\n }\n\n get promise(): Promise | undefined {\n return this.#retryer?.promise\n }\n\n setOptions(\n options?: QueryOptions,\n ): void {\n this.options = { ...this.#defaultOptions, ...options }\n\n this.updateGcTime(this.options.gcTime)\n\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n if (this.state && this.state.data === undefined) {\n const defaultState = getDefaultState(this.options)\n if (defaultState.data !== undefined) {\n this.setState(\n successState(defaultState.data, defaultState.dataUpdatedAt),\n )\n this.#initialState = defaultState\n }\n }\n }\n\n protected optionalRemove() {\n if (!this.observers.length && this.state.fetchStatus === 'idle') {\n this.#cache.remove(this)\n }\n }\n\n setData(\n newData: TData,\n options?: SetDataOptions & { manual: boolean },\n ): TData {\n const data = replaceData(this.state.data, newData, this.options)\n\n // Set data and mark it as cached\n this.#dispatch({\n data,\n type: 'success',\n dataUpdatedAt: options?.updatedAt,\n manual: options?.manual,\n })\n\n return data\n }\n\n setState(\n state: Partial>,\n setStateOptions?: SetStateOptions,\n ): void {\n this.#dispatch({ type: 'setState', state, setStateOptions })\n }\n\n cancel(options?: CancelOptions): Promise {\n const promise = this.#retryer?.promise\n this.#retryer?.cancel(options)\n return promise ? promise.then(noop).catch(noop) : Promise.resolve()\n }\n\n destroy(): void {\n super.destroy()\n\n this.cancel({ silent: true })\n }\n\n reset(): void {\n this.destroy()\n this.setState(this.#initialState)\n }\n\n isActive(): boolean {\n return this.observers.some(\n (observer) => resolveEnabled(observer.options.enabled, this) !== false,\n )\n }\n\n isDisabled(): boolean {\n if (this.getObserversCount() > 0) {\n return !this.isActive()\n }\n // if a query has no observers, it should still be considered disabled if it never attempted a fetch\n return (\n this.options.queryFn === skipToken ||\n this.state.dataUpdateCount + this.state.errorUpdateCount === 0\n )\n }\n\n isStatic(): boolean {\n if (this.getObserversCount() > 0) {\n return this.observers.some(\n (observer) =>\n resolveStaleTime(observer.options.staleTime, this) === 'static',\n )\n }\n\n return false\n }\n\n isStale(): boolean {\n // check observers first, their `isStale` has the source of truth\n // calculated with `isStaleByTime` and it takes `enabled` into account\n if (this.getObserversCount() > 0) {\n return this.observers.some(\n (observer) => observer.getCurrentResult().isStale,\n )\n }\n\n return this.state.data === undefined || this.state.isInvalidated\n }\n\n isStaleByTime(staleTime: StaleTime = 0): boolean {\n // no data is always stale\n if (this.state.data === undefined) {\n return true\n }\n // static is never stale\n if (staleTime === 'static') {\n return false\n }\n // if the query is invalidated, it is stale\n if (this.state.isInvalidated) {\n return true\n }\n\n return !timeUntilStale(this.state.dataUpdatedAt, staleTime)\n }\n\n onFocus(): void {\n const observer = this.observers.find((x) => x.shouldFetchOnWindowFocus())\n\n observer?.refetch({ cancelRefetch: false })\n\n // Continue fetch if currently paused\n this.#retryer?.continue()\n }\n\n onOnline(): void {\n const observer = this.observers.find((x) => x.shouldFetchOnReconnect())\n\n observer?.refetch({ cancelRefetch: false })\n\n // Continue fetch if currently paused\n this.#retryer?.continue()\n }\n\n addObserver(observer: QueryObserver): void {\n if (!this.observers.includes(observer)) {\n this.observers.push(observer)\n\n // Stop the query from being garbage collected\n this.clearGcTimeout()\n\n this.#cache.notify({ type: 'observerAdded', query: this, observer })\n }\n }\n\n removeObserver(observer: QueryObserver): void {\n if (this.observers.includes(observer)) {\n this.observers = this.observers.filter((x) => x !== observer)\n\n if (!this.observers.length) {\n // If the transport layer does not support cancellation\n // we'll let the query continue so the result can be cached\n if (this.#retryer) {\n if (this.#abortSignalConsumed) {\n this.#retryer.cancel({ revert: true })\n } else {\n this.#retryer.cancelRetry()\n }\n }\n\n this.scheduleGc()\n }\n\n this.#cache.notify({ type: 'observerRemoved', query: this, observer })\n }\n }\n\n getObserversCount(): number {\n return this.observers.length\n }\n\n invalidate(): void {\n if (!this.state.isInvalidated) {\n this.#dispatch({ type: 'invalidate' })\n }\n }\n\n async fetch(\n options?: QueryOptions,\n fetchOptions?: FetchOptions,\n ): Promise {\n if (\n this.state.fetchStatus !== 'idle' &&\n // If the promise in the retryer is already rejected, we have to definitely\n // re-start the fetch; there is a chance that the query is still in a\n // pending state when that happens\n this.#retryer?.status() !== 'rejected'\n ) {\n if (this.state.data !== undefined && fetchOptions?.cancelRefetch) {\n // Silently cancel current fetch if the user wants to cancel refetch\n this.cancel({ silent: true })\n } else if (this.#retryer) {\n // make sure that retries that were potentially cancelled due to unmounts can continue\n this.#retryer.continueRetry()\n // Return current promise if we are already fetching\n return this.#retryer.promise\n }\n }\n\n // Update config if passed, otherwise the config from the last execution is used\n if (options) {\n this.setOptions(options)\n }\n\n // Use the options from the first observer with a query function if no function is found.\n // This can happen when the query is hydrated or created with setQueryData.\n if (!this.options.queryFn) {\n const observer = this.observers.find((x) => x.options.queryFn)\n if (observer) {\n this.setOptions(observer.options)\n }\n }\n\n if (process.env.NODE_ENV !== 'production') {\n if (!Array.isArray(this.options.queryKey)) {\n console.error(\n `As of v4, queryKey needs to be an Array. If you are using a string like 'repoData', please change it to an Array, e.g. ['repoData']`,\n )\n }\n }\n\n const abortController = new AbortController()\n\n // Adds an enumerable signal property to the object that\n // which sets abortSignalConsumed to true when the signal\n // is read.\n const addSignalProperty = (object: unknown) => {\n Object.defineProperty(object, 'signal', {\n enumerable: true,\n get: () => {\n this.#abortSignalConsumed = true\n return abortController.signal\n },\n })\n }\n\n // Create fetch function\n const fetchFn = () => {\n const queryFn = ensureQueryFn(this.options, fetchOptions)\n\n // Create query function context\n const createQueryFnContext = (): QueryFunctionContext => {\n const queryFnContext: OmitKeyof<\n QueryFunctionContext,\n 'signal'\n > = {\n client: this.#client,\n queryKey: this.queryKey,\n meta: this.meta,\n }\n addSignalProperty(queryFnContext)\n return queryFnContext as QueryFunctionContext\n }\n\n const queryFnContext = createQueryFnContext()\n\n this.#abortSignalConsumed = false\n if (this.options.persister) {\n return this.options.persister(\n queryFn,\n queryFnContext,\n this as unknown as Query,\n )\n }\n\n return queryFn(queryFnContext)\n }\n\n // Trigger behavior hook\n const createFetchContext = (): FetchContext<\n TQueryFnData,\n TError,\n TData,\n TQueryKey\n > => {\n const context: OmitKeyof<\n FetchContext,\n 'signal'\n > = {\n fetchOptions,\n options: this.options,\n queryKey: this.queryKey,\n client: this.#client,\n state: this.state,\n fetchFn,\n }\n\n addSignalProperty(context)\n return context as FetchContext\n }\n\n const context = createFetchContext()\n\n this.options.behavior?.onFetch(context, this as unknown as Query)\n\n // Store state in case the current fetch needs to be reverted\n this.#revertState = this.state\n\n // Set to fetching state if not already in it\n if (\n this.state.fetchStatus === 'idle' ||\n this.state.fetchMeta !== context.fetchOptions?.meta\n ) {\n this.#dispatch({ type: 'fetch', meta: context.fetchOptions?.meta })\n }\n\n // Try to fetch the data\n this.#retryer = createRetryer({\n initialPromise: fetchOptions?.initialPromise as\n | Promise\n | undefined,\n fn: context.fetchFn as () => Promise,\n onCancel: (error) => {\n if (error instanceof CancelledError && error.revert) {\n this.setState({\n ...this.#revertState,\n fetchStatus: 'idle' as const,\n })\n }\n abortController.abort()\n },\n onFail: (failureCount, error) => {\n this.#dispatch({ type: 'failed', failureCount, error })\n },\n onPause: () => {\n this.#dispatch({ type: 'pause' })\n },\n onContinue: () => {\n this.#dispatch({ type: 'continue' })\n },\n retry: context.options.retry,\n retryDelay: context.options.retryDelay,\n networkMode: context.options.networkMode,\n canRun: () => true,\n })\n\n try {\n const data = await this.#retryer.start()\n // this is more of a runtime guard\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n if (data === undefined) {\n if (process.env.NODE_ENV !== 'production') {\n console.error(\n `Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}`,\n )\n }\n throw new Error(`${this.queryHash} data is undefined`)\n }\n\n this.setData(data)\n\n // Notify cache callback\n this.#cache.config.onSuccess?.(data, this as Query)\n this.#cache.config.onSettled?.(\n data,\n this.state.error as any,\n this as Query,\n )\n return data\n } catch (error) {\n if (error instanceof CancelledError) {\n if (error.silent) {\n // silent cancellation implies a new fetch is going to be started,\n // so we piggyback onto that promise\n return this.#retryer.promise\n } else if (error.revert) {\n // transform error into reverted state data\n // if the initial fetch was cancelled, we have no data, so we have\n // to get reject with a CancelledError\n if (this.state.data === undefined) {\n throw error\n }\n return this.state.data\n }\n }\n this.#dispatch({\n type: 'error',\n error: error as TError,\n })\n\n // Notify cache callback\n this.#cache.config.onError?.(\n error as any,\n this as Query,\n )\n this.#cache.config.onSettled?.(\n this.state.data,\n error as any,\n this as Query,\n )\n\n throw error // rethrow the error for further handling\n } finally {\n // Schedule query gc after fetching\n this.scheduleGc()\n }\n }\n\n #dispatch(action: Action): void {\n const reducer = (\n state: QueryState,\n ): QueryState => {\n switch (action.type) {\n case 'failed':\n return {\n ...state,\n fetchFailureCount: action.failureCount,\n fetchFailureReason: action.error,\n }\n case 'pause':\n return {\n ...state,\n fetchStatus: 'paused',\n }\n case 'continue':\n return {\n ...state,\n fetchStatus: 'fetching',\n }\n case 'fetch':\n return {\n ...state,\n ...fetchState(state.data, this.options),\n fetchMeta: action.meta ?? null,\n }\n case 'success':\n const newState = {\n ...state,\n ...successState(action.data, action.dataUpdatedAt),\n dataUpdateCount: state.dataUpdateCount + 1,\n ...(!action.manual && {\n fetchStatus: 'idle' as const,\n fetchFailureCount: 0,\n fetchFailureReason: null,\n }),\n }\n // If fetching ends successfully, we don't need revertState as a fallback anymore.\n // For manual updates, capture the state to revert to it in case of a cancellation.\n this.#revertState = action.manual ? newState : undefined\n\n return newState\n case 'error':\n const error = action.error\n return {\n ...state,\n error,\n errorUpdateCount: state.errorUpdateCount + 1,\n errorUpdatedAt: Date.now(),\n fetchFailureCount: state.fetchFailureCount + 1,\n fetchFailureReason: error,\n fetchStatus: 'idle',\n status: 'error',\n // flag existing data as invalidated if we get a background error\n // note that \"no data\" always means stale so we can set unconditionally here\n isInvalidated: true,\n }\n case 'invalidate':\n return {\n ...state,\n isInvalidated: true,\n }\n case 'setState':\n return {\n ...state,\n ...action.state,\n }\n }\n }\n\n this.state = reducer(this.state)\n\n notifyManager.batch(() => {\n this.observers.forEach((observer) => {\n observer.onQueryUpdate()\n })\n\n this.#cache.notify({ query: this, type: 'updated', action })\n })\n }\n}\n\nexport function fetchState<\n TQueryFnData,\n TError,\n TData,\n TQueryKey extends QueryKey,\n>(\n data: TData | undefined,\n options: QueryOptions,\n) {\n return {\n fetchFailureCount: 0,\n fetchFailureReason: null,\n fetchStatus: canFetch(options.networkMode) ? 'fetching' : 'paused',\n ...(data === undefined &&\n ({\n error: null,\n status: 'pending',\n } as const)),\n } as const\n}\n\nfunction successState(data: TData | undefined, dataUpdatedAt?: number) {\n return {\n data,\n dataUpdatedAt: dataUpdatedAt ?? Date.now(),\n error: null,\n isInvalidated: false,\n status: 'success' as const,\n }\n}\n\nfunction getDefaultState<\n TQueryFnData,\n TError,\n TData,\n TQueryKey extends QueryKey,\n>(\n options: QueryOptions,\n): QueryState {\n const data =\n typeof options.initialData === 'function'\n ? (options.initialData as InitialDataFunction)()\n : options.initialData\n\n const hasData = data !== undefined\n\n const initialDataUpdatedAt = hasData\n ? typeof options.initialDataUpdatedAt === 'function'\n ? options.initialDataUpdatedAt()\n : options.initialDataUpdatedAt\n : 0\n\n return {\n data,\n dataUpdateCount: 0,\n dataUpdatedAt: hasData ? (initialDataUpdatedAt ?? Date.now()) : 0,\n error: null,\n errorUpdateCount: 0,\n errorUpdatedAt: 0,\n fetchFailureCount: 0,\n fetchFailureRe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ACL;AAAA,IACA,iBAAiB;AAAA,IACjB,eAAe,UAAW,wBAAwB,KAAK,IAAI,IAAK;AAAA,IAChE,OAAO;AAAA,IACP,kBAAkB;AAAA,IAClB,gBAAgB;AAAA,IAChB,mBAAmB;AAAA,IACnB,oBAAoB;AAAA,IACpB,WAAW;AAAA,IACX,eAAe;AAAA,IACf,QAAQ,UAAU,YAAY;AAAA,IAC9B,aAAa;AAAA,EACf;AACF;","names":["queryFnContext","context"]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/query.d.cts b/node_modules/@tanstack/query-core/build/legacy/query.d.cts deleted file mode 100644 index c5cd428..0000000 --- a/node_modules/@tanstack/query-core/build/legacy/query.d.cts +++ /dev/null @@ -1,3 +0,0 @@ -import './removable.cjs'; -export { bg as Action, bc as FetchContext, bd as FetchDirection, be as FetchMeta, bf as FetchOptions, z as Query, bb as QueryBehavior, A as QueryState, bh as SetStateOptions, bi as fetchState } from './hydration-uphG6M-i.cjs'; -import './subscribable.cjs'; diff --git a/node_modules/@tanstack/query-core/build/legacy/query.d.ts b/node_modules/@tanstack/query-core/build/legacy/query.d.ts deleted file mode 100644 index 2a8a1e0..0000000 --- a/node_modules/@tanstack/query-core/build/legacy/query.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import './removable.js'; -export { bg as Action, bc as FetchContext, bd as FetchDirection, be as FetchMeta, bf as FetchOptions, z as Query, bb as QueryBehavior, A as QueryState, bh as SetStateOptions, bi as fetchState } from './hydration-BlEVG2Lp.js'; -import './subscribable.js'; diff --git a/node_modules/@tanstack/query-core/build/legacy/query.js b/node_modules/@tanstack/query-core/build/legacy/query.js deleted file mode 100644 index 66fe122..0000000 --- a/node_modules/@tanstack/query-core/build/legacy/query.js +++ /dev/null @@ -1,459 +0,0 @@ -import { - __privateAdd, - __privateGet, - __privateMethod, - __privateSet -} from "./chunk-PXG64RU4.js"; - -// src/query.ts -import { - ensureQueryFn, - noop, - replaceData, - resolveEnabled, - resolveStaleTime, - skipToken, - timeUntilStale -} from "./utils.js"; -import { notifyManager } from "./notifyManager.js"; -import { CancelledError, canFetch, createRetryer } from "./retryer.js"; -import { Removable } from "./removable.js"; -var _initialState, _revertState, _cache, _client, _retryer, _defaultOptions, _abortSignalConsumed, _Query_instances, dispatch_fn; -var Query = class extends Removable { - constructor(config) { - super(); - __privateAdd(this, _Query_instances); - __privateAdd(this, _initialState); - __privateAdd(this, _revertState); - __privateAdd(this, _cache); - __privateAdd(this, _client); - __privateAdd(this, _retryer); - __privateAdd(this, _defaultOptions); - __privateAdd(this, _abortSignalConsumed); - __privateSet(this, _abortSignalConsumed, false); - __privateSet(this, _defaultOptions, config.defaultOptions); - this.setOptions(config.options); - this.observers = []; - __privateSet(this, _client, config.client); - __privateSet(this, _cache, __privateGet(this, _client).getQueryCache()); - this.queryKey = config.queryKey; - this.queryHash = config.queryHash; - __privateSet(this, _initialState, getDefaultState(this.options)); - this.state = config.state ?? __privateGet(this, _initialState); - this.scheduleGc(); - } - get meta() { - return this.options.meta; - } - get promise() { - var _a; - return (_a = __privateGet(this, _retryer)) == null ? void 0 : _a.promise; - } - setOptions(options) { - this.options = { ...__privateGet(this, _defaultOptions), ...options }; - this.updateGcTime(this.options.gcTime); - if (this.state && this.state.data === void 0) { - const defaultState = getDefaultState(this.options); - if (defaultState.data !== void 0) { - this.setState( - successState(defaultState.data, defaultState.dataUpdatedAt) - ); - __privateSet(this, _initialState, defaultState); - } - } - } - optionalRemove() { - if (!this.observers.length && this.state.fetchStatus === "idle") { - __privateGet(this, _cache).remove(this); - } - } - setData(newData, options) { - const data = replaceData(this.state.data, newData, this.options); - __privateMethod(this, _Query_instances, dispatch_fn).call(this, { - data, - type: "success", - dataUpdatedAt: options == null ? void 0 : options.updatedAt, - manual: options == null ? void 0 : options.manual - }); - return data; - } - setState(state, setStateOptions) { - __privateMethod(this, _Query_instances, dispatch_fn).call(this, { type: "setState", state, setStateOptions }); - } - cancel(options) { - var _a, _b; - const promise = (_a = __privateGet(this, _retryer)) == null ? void 0 : _a.promise; - (_b = __privateGet(this, _retryer)) == null ? void 0 : _b.cancel(options); - return promise ? promise.then(noop).catch(noop) : Promise.resolve(); - } - destroy() { - super.destroy(); - this.cancel({ silent: true }); - } - reset() { - this.destroy(); - this.setState(__privateGet(this, _initialState)); - } - isActive() { - return this.observers.some( - (observer) => resolveEnabled(observer.options.enabled, this) !== false - ); - } - isDisabled() { - if (this.getObserversCount() > 0) { - return !this.isActive(); - } - return this.options.queryFn === skipToken || this.state.dataUpdateCount + this.state.errorUpdateCount === 0; - } - isStatic() { - if (this.getObserversCount() > 0) { - return this.observers.some( - (observer) => resolveStaleTime(observer.options.staleTime, this) === "static" - ); - } - return false; - } - isStale() { - if (this.getObserversCount() > 0) { - return this.observers.some( - (observer) => observer.getCurrentResult().isStale - ); - } - return this.state.data === void 0 || this.state.isInvalidated; - } - isStaleByTime(staleTime = 0) { - if (this.state.data === void 0) { - return true; - } - if (staleTime === "static") { - return false; - } - if (this.state.isInvalidated) { - return true; - } - return !timeUntilStale(this.state.dataUpdatedAt, staleTime); - } - onFocus() { - var _a; - const observer = this.observers.find((x) => x.shouldFetchOnWindowFocus()); - observer == null ? void 0 : observer.refetch({ cancelRefetch: false }); - (_a = __privateGet(this, _retryer)) == null ? void 0 : _a.continue(); - } - onOnline() { - var _a; - const observer = this.observers.find((x) => x.shouldFetchOnReconnect()); - observer == null ? void 0 : observer.refetch({ cancelRefetch: false }); - (_a = __privateGet(this, _retryer)) == null ? void 0 : _a.continue(); - } - addObserver(observer) { - if (!this.observers.includes(observer)) { - this.observers.push(observer); - this.clearGcTimeout(); - __privateGet(this, _cache).notify({ type: "observerAdded", query: this, observer }); - } - } - removeObserver(observer) { - if (this.observers.includes(observer)) { - this.observers = this.observers.filter((x) => x !== observer); - if (!this.observers.length) { - if (__privateGet(this, _retryer)) { - if (__privateGet(this, _abortSignalConsumed)) { - __privateGet(this, _retryer).cancel({ revert: true }); - } else { - __privateGet(this, _retryer).cancelRetry(); - } - } - this.scheduleGc(); - } - __privateGet(this, _cache).notify({ type: "observerRemoved", query: this, observer }); - } - } - getObserversCount() { - return this.observers.length; - } - invalidate() { - if (!this.state.isInvalidated) { - __privateMethod(this, _Query_instances, dispatch_fn).call(this, { type: "invalidate" }); - } - } - async fetch(options, fetchOptions) { - var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l; - if (this.state.fetchStatus !== "idle" && // If the promise in the retryer is already rejected, we have to definitely - // re-start the fetch; there is a chance that the query is still in a - // pending state when that happens - ((_a = __privateGet(this, _retryer)) == null ? void 0 : _a.status()) !== "rejected") { - if (this.state.data !== void 0 && (fetchOptions == null ? void 0 : fetchOptions.cancelRefetch)) { - this.cancel({ silent: true }); - } else if (__privateGet(this, _retryer)) { - __privateGet(this, _retryer).continueRetry(); - return __privateGet(this, _retryer).promise; - } - } - if (options) { - this.setOptions(options); - } - if (!this.options.queryFn) { - const observer = this.observers.find((x) => x.options.queryFn); - if (observer) { - this.setOptions(observer.options); - } - } - if (process.env.NODE_ENV !== "production") { - if (!Array.isArray(this.options.queryKey)) { - console.error( - `As of v4, queryKey needs to be an Array. If you are using a string like 'repoData', please change it to an Array, e.g. ['repoData']` - ); - } - } - const abortController = new AbortController(); - const addSignalProperty = (object) => { - Object.defineProperty(object, "signal", { - enumerable: true, - get: () => { - __privateSet(this, _abortSignalConsumed, true); - return abortController.signal; - } - }); - }; - const fetchFn = () => { - const queryFn = ensureQueryFn(this.options, fetchOptions); - const createQueryFnContext = () => { - const queryFnContext2 = { - client: __privateGet(this, _client), - queryKey: this.queryKey, - meta: this.meta - }; - addSignalProperty(queryFnContext2); - return queryFnContext2; - }; - const queryFnContext = createQueryFnContext(); - __privateSet(this, _abortSignalConsumed, false); - if (this.options.persister) { - return this.options.persister( - queryFn, - queryFnContext, - this - ); - } - return queryFn(queryFnContext); - }; - const createFetchContext = () => { - const context2 = { - fetchOptions, - options: this.options, - queryKey: this.queryKey, - client: __privateGet(this, _client), - state: this.state, - fetchFn - }; - addSignalProperty(context2); - return context2; - }; - const context = createFetchContext(); - (_b = this.options.behavior) == null ? void 0 : _b.onFetch(context, this); - __privateSet(this, _revertState, this.state); - if (this.state.fetchStatus === "idle" || this.state.fetchMeta !== ((_c = context.fetchOptions) == null ? void 0 : _c.meta)) { - __privateMethod(this, _Query_instances, dispatch_fn).call(this, { type: "fetch", meta: (_d = context.fetchOptions) == null ? void 0 : _d.meta }); - } - __privateSet(this, _retryer, createRetryer({ - initialPromise: fetchOptions == null ? void 0 : fetchOptions.initialPromise, - fn: context.fetchFn, - onCancel: (error) => { - if (error instanceof CancelledError && error.revert) { - this.setState({ - ...__privateGet(this, _revertState), - fetchStatus: "idle" - }); - } - abortController.abort(); - }, - onFail: (failureCount, error) => { - __privateMethod(this, _Query_instances, dispatch_fn).call(this, { type: "failed", failureCount, error }); - }, - onPause: () => { - __privateMethod(this, _Query_instances, dispatch_fn).call(this, { type: "pause" }); - }, - onContinue: () => { - __privateMethod(this, _Query_instances, dispatch_fn).call(this, { type: "continue" }); - }, - retry: context.options.retry, - retryDelay: context.options.retryDelay, - networkMode: context.options.networkMode, - canRun: () => true - })); - try { - const data = await __privateGet(this, _retryer).start(); - if (data === void 0) { - if (process.env.NODE_ENV !== "production") { - console.error( - `Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}` - ); - } - throw new Error(`${this.queryHash} data is undefined`); - } - this.setData(data); - (_f = (_e = __privateGet(this, _cache).config).onSuccess) == null ? void 0 : _f.call(_e, data, this); - (_h = (_g = __privateGet(this, _cache).config).onSettled) == null ? void 0 : _h.call( - _g, - data, - this.state.error, - this - ); - return data; - } catch (error) { - if (error instanceof CancelledError) { - if (error.silent) { - return __privateGet(this, _retryer).promise; - } else if (error.revert) { - if (this.state.data === void 0) { - throw error; - } - return this.state.data; - } - } - __privateMethod(this, _Query_instances, dispatch_fn).call(this, { - type: "error", - error - }); - (_j = (_i = __privateGet(this, _cache).config).onError) == null ? void 0 : _j.call( - _i, - error, - this - ); - (_l = (_k = __privateGet(this, _cache).config).onSettled) == null ? void 0 : _l.call( - _k, - this.state.data, - error, - this - ); - throw error; - } finally { - this.scheduleGc(); - } - } -}; -_initialState = new WeakMap(); -_revertState = new WeakMap(); -_cache = new WeakMap(); -_client = new WeakMap(); -_retryer = new WeakMap(); -_defaultOptions = new WeakMap(); -_abortSignalConsumed = new WeakMap(); -_Query_instances = new WeakSet(); -dispatch_fn = function(action) { - const reducer = (state) => { - switch (action.type) { - case "failed": - return { - ...state, - fetchFailureCount: action.failureCount, - fetchFailureReason: action.error - }; - case "pause": - return { - ...state, - fetchStatus: "paused" - }; - case "continue": - return { - ...state, - fetchStatus: "fetching" - }; - case "fetch": - return { - ...state, - ...fetchState(state.data, this.options), - fetchMeta: action.meta ?? null - }; - case "success": - const newState = { - ...state, - ...successState(action.data, action.dataUpdatedAt), - dataUpdateCount: state.dataUpdateCount + 1, - ...!action.manual && { - fetchStatus: "idle", - fetchFailureCount: 0, - fetchFailureReason: null - } - }; - __privateSet(this, _revertState, action.manual ? newState : void 0); - return newState; - case "error": - const error = action.error; - return { - ...state, - error, - errorUpdateCount: state.errorUpdateCount + 1, - errorUpdatedAt: Date.now(), - fetchFailureCount: state.fetchFailureCount + 1, - fetchFailureReason: error, - fetchStatus: "idle", - status: "error", - // flag existing data as invalidated if we get a background error - // note that "no data" always means stale so we can set unconditionally here - isInvalidated: true - }; - case "invalidate": - return { - ...state, - isInvalidated: true - }; - case "setState": - return { - ...state, - ...action.state - }; - } - }; - this.state = reducer(this.state); - notifyManager.batch(() => { - this.observers.forEach((observer) => { - observer.onQueryUpdate(); - }); - __privateGet(this, _cache).notify({ query: this, type: "updated", action }); - }); -}; -function fetchState(data, options) { - return { - fetchFailureCount: 0, - fetchFailureReason: null, - fetchStatus: canFetch(options.networkMode) ? "fetching" : "paused", - ...data === void 0 && { - error: null, - status: "pending" - } - }; -} -function successState(data, dataUpdatedAt) { - return { - data, - dataUpdatedAt: dataUpdatedAt ?? Date.now(), - error: null, - isInvalidated: false, - status: "success" - }; -} -function getDefaultState(options) { - const data = typeof options.initialData === "function" ? options.initialData() : options.initialData; - const hasData = data !== void 0; - const initialDataUpdatedAt = hasData ? typeof options.initialDataUpdatedAt === "function" ? options.initialDataUpdatedAt() : options.initialDataUpdatedAt : 0; - return { - data, - dataUpdateCount: 0, - dataUpdatedAt: hasData ? initialDataUpdatedAt ?? Date.now() : 0, - error: null, - errorUpdateCount: 0, - errorUpdatedAt: 0, - fetchFailureCount: 0, - fetchFailureReason: null, - fetchMeta: null, - isInvalidated: false, - status: hasData ? "success" : "pending", - fetchStatus: "idle" - }; -} -export { - Query, - fetchState -}; -//# sourceMappingURL=query.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/query.js.map b/node_modules/@tanstack/query-core/build/legacy/query.js.map deleted file mode 100644 index 11e670b..0000000 --- a/node_modules/@tanstack/query-core/build/legacy/query.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/query.ts"],"sourcesContent":["import {\n ensureQueryFn,\n noop,\n replaceData,\n resolveEnabled,\n resolveStaleTime,\n skipToken,\n timeUntilStale,\n} from './utils'\nimport { notifyManager } from './notifyManager'\nimport { CancelledError, canFetch, createRetryer } from './retryer'\nimport { Removable } from './removable'\nimport type { QueryCache } from './queryCache'\nimport type { QueryClient } from './queryClient'\nimport type {\n CancelOptions,\n DefaultError,\n FetchStatus,\n InitialDataFunction,\n OmitKeyof,\n QueryFunctionContext,\n QueryKey,\n QueryMeta,\n QueryOptions,\n QueryStatus,\n SetDataOptions,\n StaleTime,\n} from './types'\nimport type { QueryObserver } from './queryObserver'\nimport type { Retryer } from './retryer'\n\n// TYPES\n\ninterface QueryConfig<\n TQueryFnData,\n TError,\n TData,\n TQueryKey extends QueryKey = QueryKey,\n> {\n client: QueryClient\n queryKey: TQueryKey\n queryHash: string\n options?: QueryOptions\n defaultOptions?: QueryOptions\n state?: QueryState\n}\n\nexport interface QueryState {\n data: TData | undefined\n dataUpdateCount: number\n dataUpdatedAt: number\n error: TError | null\n errorUpdateCount: number\n errorUpdatedAt: number\n fetchFailureCount: number\n fetchFailureReason: TError | null\n fetchMeta: FetchMeta | null\n isInvalidated: boolean\n status: QueryStatus\n fetchStatus: FetchStatus\n}\n\nexport interface FetchContext<\n TQueryFnData,\n TError,\n TData,\n TQueryKey extends QueryKey = QueryKey,\n> {\n fetchFn: () => unknown | Promise\n fetchOptions?: FetchOptions\n signal: AbortSignal\n options: QueryOptions\n client: QueryClient\n queryKey: TQueryKey\n state: QueryState\n}\n\nexport interface QueryBehavior<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> {\n onFetch: (\n context: FetchContext,\n query: Query,\n ) => void\n}\n\nexport type FetchDirection = 'forward' | 'backward'\n\nexport interface FetchMeta {\n fetchMore?: { direction: FetchDirection }\n}\n\nexport interface FetchOptions {\n cancelRefetch?: boolean\n meta?: FetchMeta\n initialPromise?: Promise\n}\n\ninterface FailedAction {\n type: 'failed'\n failureCount: number\n error: TError\n}\n\ninterface FetchAction {\n type: 'fetch'\n meta?: FetchMeta\n}\n\ninterface SuccessAction {\n data: TData | undefined\n type: 'success'\n dataUpdatedAt?: number\n manual?: boolean\n}\n\ninterface ErrorAction {\n type: 'error'\n error: TError\n}\n\ninterface InvalidateAction {\n type: 'invalidate'\n}\n\ninterface PauseAction {\n type: 'pause'\n}\n\ninterface ContinueAction {\n type: 'continue'\n}\n\ninterface SetStateAction {\n type: 'setState'\n state: Partial>\n setStateOptions?: SetStateOptions\n}\n\nexport type Action =\n | ContinueAction\n | ErrorAction\n | FailedAction\n | FetchAction\n | InvalidateAction\n | PauseAction\n | SetStateAction\n | SuccessAction\n\nexport interface SetStateOptions {\n meta?: any\n}\n\n// CLASS\n\nexport class Query<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> extends Removable {\n queryKey: TQueryKey\n queryHash: string\n options!: QueryOptions\n state: QueryState\n\n #initialState: QueryState\n #revertState?: QueryState\n #cache: QueryCache\n #client: QueryClient\n #retryer?: Retryer\n observers: Array>\n #defaultOptions?: QueryOptions\n #abortSignalConsumed: boolean\n\n constructor(config: QueryConfig) {\n super()\n\n this.#abortSignalConsumed = false\n this.#defaultOptions = config.defaultOptions\n this.setOptions(config.options)\n this.observers = []\n this.#client = config.client\n this.#cache = this.#client.getQueryCache()\n this.queryKey = config.queryKey\n this.queryHash = config.queryHash\n this.#initialState = getDefaultState(this.options)\n this.state = config.state ?? this.#initialState\n this.scheduleGc()\n }\n get meta(): QueryMeta | undefined {\n return this.options.meta\n }\n\n get promise(): Promise | undefined {\n return this.#retryer?.promise\n }\n\n setOptions(\n options?: QueryOptions,\n ): void {\n this.options = { ...this.#defaultOptions, ...options }\n\n this.updateGcTime(this.options.gcTime)\n\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n if (this.state && this.state.data === undefined) {\n const defaultState = getDefaultState(this.options)\n if (defaultState.data !== undefined) {\n this.setState(\n successState(defaultState.data, defaultState.dataUpdatedAt),\n )\n this.#initialState = defaultState\n }\n }\n }\n\n protected optionalRemove() {\n if (!this.observers.length && this.state.fetchStatus === 'idle') {\n this.#cache.remove(this)\n }\n }\n\n setData(\n newData: TData,\n options?: SetDataOptions & { manual: boolean },\n ): TData {\n const data = replaceData(this.state.data, newData, this.options)\n\n // Set data and mark it as cached\n this.#dispatch({\n data,\n type: 'success',\n dataUpdatedAt: options?.updatedAt,\n manual: options?.manual,\n })\n\n return data\n }\n\n setState(\n state: Partial>,\n setStateOptions?: SetStateOptions,\n ): void {\n this.#dispatch({ type: 'setState', state, setStateOptions })\n }\n\n cancel(options?: CancelOptions): Promise {\n const promise = this.#retryer?.promise\n this.#retryer?.cancel(options)\n return promise ? promise.then(noop).catch(noop) : Promise.resolve()\n }\n\n destroy(): void {\n super.destroy()\n\n this.cancel({ silent: true })\n }\n\n reset(): void {\n this.destroy()\n this.setState(this.#initialState)\n }\n\n isActive(): boolean {\n return this.observers.some(\n (observer) => resolveEnabled(observer.options.enabled, this) !== false,\n )\n }\n\n isDisabled(): boolean {\n if (this.getObserversCount() > 0) {\n return !this.isActive()\n }\n // if a query has no observers, it should still be considered disabled if it never attempted a fetch\n return (\n this.options.queryFn === skipToken ||\n this.state.dataUpdateCount + this.state.errorUpdateCount === 0\n )\n }\n\n isStatic(): boolean {\n if (this.getObserversCount() > 0) {\n return this.observers.some(\n (observer) =>\n resolveStaleTime(observer.options.staleTime, this) === 'static',\n )\n }\n\n return false\n }\n\n isStale(): boolean {\n // check observers first, their `isStale` has the source of truth\n // calculated with `isStaleByTime` and it takes `enabled` into account\n if (this.getObserversCount() > 0) {\n return this.observers.some(\n (observer) => observer.getCurrentResult().isStale,\n )\n }\n\n return this.state.data === undefined || this.state.isInvalidated\n }\n\n isStaleByTime(staleTime: StaleTime = 0): boolean {\n // no data is always stale\n if (this.state.data === undefined) {\n return true\n }\n // static is never stale\n if (staleTime === 'static') {\n return false\n }\n // if the query is invalidated, it is stale\n if (this.state.isInvalidated) {\n return true\n }\n\n return !timeUntilStale(this.state.dataUpdatedAt, staleTime)\n }\n\n onFocus(): void {\n const observer = this.observers.find((x) => x.shouldFetchOnWindowFocus())\n\n observer?.refetch({ cancelRefetch: false })\n\n // Continue fetch if currently paused\n this.#retryer?.continue()\n }\n\n onOnline(): void {\n const observer = this.observers.find((x) => x.shouldFetchOnReconnect())\n\n observer?.refetch({ cancelRefetch: false })\n\n // Continue fetch if currently paused\n this.#retryer?.continue()\n }\n\n addObserver(observer: QueryObserver): void {\n if (!this.observers.includes(observer)) {\n this.observers.push(observer)\n\n // Stop the query from being garbage collected\n this.clearGcTimeout()\n\n this.#cache.notify({ type: 'observerAdded', query: this, observer })\n }\n }\n\n removeObserver(observer: QueryObserver): void {\n if (this.observers.includes(observer)) {\n this.observers = this.observers.filter((x) => x !== observer)\n\n if (!this.observers.length) {\n // If the transport layer does not support cancellation\n // we'll let the query continue so the result can be cached\n if (this.#retryer) {\n if (this.#abortSignalConsumed) {\n this.#retryer.cancel({ revert: true })\n } else {\n this.#retryer.cancelRetry()\n }\n }\n\n this.scheduleGc()\n }\n\n this.#cache.notify({ type: 'observerRemoved', query: this, observer })\n }\n }\n\n getObserversCount(): number {\n return this.observers.length\n }\n\n invalidate(): void {\n if (!this.state.isInvalidated) {\n this.#dispatch({ type: 'invalidate' })\n }\n }\n\n async fetch(\n options?: QueryOptions,\n fetchOptions?: FetchOptions,\n ): Promise {\n if (\n this.state.fetchStatus !== 'idle' &&\n // If the promise in the retryer is already rejected, we have to definitely\n // re-start the fetch; there is a chance that the query is still in a\n // pending state when that happens\n this.#retryer?.status() !== 'rejected'\n ) {\n if (this.state.data !== undefined && fetchOptions?.cancelRefetch) {\n // Silently cancel current fetch if the user wants to cancel refetch\n this.cancel({ silent: true })\n } else if (this.#retryer) {\n // make sure that retries that were potentially cancelled due to unmounts can continue\n this.#retryer.continueRetry()\n // Return current promise if we are already fetching\n return this.#retryer.promise\n }\n }\n\n // Update config if passed, otherwise the config from the last execution is used\n if (options) {\n this.setOptions(options)\n }\n\n // Use the options from the first observer with a query function if no function is found.\n // This can happen when the query is hydrated or created with setQueryData.\n if (!this.options.queryFn) {\n const observer = this.observers.find((x) => x.options.queryFn)\n if (observer) {\n this.setOptions(observer.options)\n }\n }\n\n if (process.env.NODE_ENV !== 'production') {\n if (!Array.isArray(this.options.queryKey)) {\n console.error(\n `As of v4, queryKey needs to be an Array. If you are using a string like 'repoData', please change it to an Array, e.g. ['repoData']`,\n )\n }\n }\n\n const abortController = new AbortController()\n\n // Adds an enumerable signal property to the object that\n // which sets abortSignalConsumed to true when the signal\n // is read.\n const addSignalProperty = (object: unknown) => {\n Object.defineProperty(object, 'signal', {\n enumerable: true,\n get: () => {\n this.#abortSignalConsumed = true\n return abortController.signal\n },\n })\n }\n\n // Create fetch function\n const fetchFn = () => {\n const queryFn = ensureQueryFn(this.options, fetchOptions)\n\n // Create query function context\n const createQueryFnContext = (): QueryFunctionContext => {\n const queryFnContext: OmitKeyof<\n QueryFunctionContext,\n 'signal'\n > = {\n client: this.#client,\n queryKey: this.queryKey,\n meta: this.meta,\n }\n addSignalProperty(queryFnContext)\n return queryFnContext as QueryFunctionContext\n }\n\n const queryFnContext = createQueryFnContext()\n\n this.#abortSignalConsumed = false\n if (this.options.persister) {\n return this.options.persister(\n queryFn,\n queryFnContext,\n this as unknown as Query,\n )\n }\n\n return queryFn(queryFnContext)\n }\n\n // Trigger behavior hook\n const createFetchContext = (): FetchContext<\n TQueryFnData,\n TError,\n TData,\n TQueryKey\n > => {\n const context: OmitKeyof<\n FetchContext,\n 'signal'\n > = {\n fetchOptions,\n options: this.options,\n queryKey: this.queryKey,\n client: this.#client,\n state: this.state,\n fetchFn,\n }\n\n addSignalProperty(context)\n return context as FetchContext\n }\n\n const context = createFetchContext()\n\n this.options.behavior?.onFetch(context, this as unknown as Query)\n\n // Store state in case the current fetch needs to be reverted\n this.#revertState = this.state\n\n // Set to fetching state if not already in it\n if (\n this.state.fetchStatus === 'idle' ||\n this.state.fetchMeta !== context.fetchOptions?.meta\n ) {\n this.#dispatch({ type: 'fetch', meta: context.fetchOptions?.meta })\n }\n\n // Try to fetch the data\n this.#retryer = createRetryer({\n initialPromise: fetchOptions?.initialPromise as\n | Promise\n | undefined,\n fn: context.fetchFn as () => Promise,\n onCancel: (error) => {\n if (error instanceof CancelledError && error.revert) {\n this.setState({\n ...this.#revertState,\n fetchStatus: 'idle' as const,\n })\n }\n abortController.abort()\n },\n onFail: (failureCount, error) => {\n this.#dispatch({ type: 'failed', failureCount, error })\n },\n onPause: () => {\n this.#dispatch({ type: 'pause' })\n },\n onContinue: () => {\n this.#dispatch({ type: 'continue' })\n },\n retry: context.options.retry,\n retryDelay: context.options.retryDelay,\n networkMode: context.options.networkMode,\n canRun: () => true,\n })\n\n try {\n const data = await this.#retryer.start()\n // this is more of a runtime guard\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n if (data === undefined) {\n if (process.env.NODE_ENV !== 'production') {\n console.error(\n `Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}`,\n )\n }\n throw new Error(`${this.queryHash} data is undefined`)\n }\n\n this.setData(data)\n\n // Notify cache callback\n this.#cache.config.onSuccess?.(data, this as Query)\n this.#cache.config.onSettled?.(\n data,\n this.state.error as any,\n this as Query,\n )\n return data\n } catch (error) {\n if (error instanceof CancelledError) {\n if (error.silent) {\n // silent cancellation implies a new fetch is going to be started,\n // so we piggyback onto that promise\n return this.#retryer.promise\n } else if (error.revert) {\n // transform error into reverted state data\n // if the initial fetch was cancelled, we have no data, so we have\n // to get reject with a CancelledError\n if (this.state.data === undefined) {\n throw error\n }\n return this.state.data\n }\n }\n this.#dispatch({\n type: 'error',\n error: error as TError,\n })\n\n // Notify cache callback\n this.#cache.config.onError?.(\n error as any,\n this as Query,\n )\n this.#cache.config.onSettled?.(\n this.state.data,\n error as any,\n this as Query,\n )\n\n throw error // rethrow the error for further handling\n } finally {\n // Schedule query gc after fetching\n this.scheduleGc()\n }\n }\n\n #dispatch(action: Action): void {\n const reducer = (\n state: QueryState,\n ): QueryState => {\n switch (action.type) {\n case 'failed':\n return {\n ...state,\n fetchFailureCount: action.failureCount,\n fetchFailureReason: action.error,\n }\n case 'pause':\n return {\n ...state,\n fetchStatus: 'paused',\n }\n case 'continue':\n return {\n ...state,\n fetchStatus: 'fetching',\n }\n case 'fetch':\n return {\n ...state,\n ...fetchState(state.data, this.options),\n fetchMeta: action.meta ?? null,\n }\n case 'success':\n const newState = {\n ...state,\n ...successState(action.data, action.dataUpdatedAt),\n dataUpdateCount: state.dataUpdateCount + 1,\n ...(!action.manual && {\n fetchStatus: 'idle' as const,\n fetchFailureCount: 0,\n fetchFailureReason: null,\n }),\n }\n // If fetching ends successfully, we don't need revertState as a fallback anymore.\n // For manual updates, capture the state to revert to it in case of a cancellation.\n this.#revertState = action.manual ? newState : undefined\n\n return newState\n case 'error':\n const error = action.error\n return {\n ...state,\n error,\n errorUpdateCount: state.errorUpdateCount + 1,\n errorUpdatedAt: Date.now(),\n fetchFailureCount: state.fetchFailureCount + 1,\n fetchFailureReason: error,\n fetchStatus: 'idle',\n status: 'error',\n // flag existing data as invalidated if we get a background error\n // note that \"no data\" always means stale so we can set unconditionally here\n isInvalidated: true,\n }\n case 'invalidate':\n return {\n ...state,\n isInvalidated: true,\n }\n case 'setState':\n return {\n ...state,\n ...action.state,\n }\n }\n }\n\n this.state = reducer(this.state)\n\n notifyManager.batch(() => {\n this.observers.forEach((observer) => {\n observer.onQueryUpdate()\n })\n\n this.#cache.notify({ query: this, type: 'updated', action })\n })\n }\n}\n\nexport function fetchState<\n TQueryFnData,\n TError,\n TData,\n TQueryKey extends QueryKey,\n>(\n data: TData | undefined,\n options: QueryOptions,\n) {\n return {\n fetchFailureCount: 0,\n fetchFailureReason: null,\n fetchStatus: canFetch(options.networkMode) ? 'fetching' : 'paused',\n ...(data === undefined &&\n ({\n error: null,\n status: 'pending',\n } as const)),\n } as const\n}\n\nfunction successState(data: TData | undefined, dataUpdatedAt?: number) {\n return {\n data,\n dataUpdatedAt: dataUpdatedAt ?? Date.now(),\n error: null,\n isInvalidated: false,\n status: 'success' as const,\n }\n}\n\nfunction getDefaultState<\n TQueryFnData,\n TError,\n TData,\n TQueryKey extends QueryKey,\n>(\n options: QueryOptions,\n): QueryState {\n const data =\n typeof options.initialData === 'function'\n ? (options.initialData as InitialDataFunction)()\n : options.initialData\n\n const hasData = data !== undefined\n\n const initialDataUpdatedAt = hasData\n ? typeof options.initialDataUpdatedAt === 'function'\n ? options.initialDataUpdatedAt()\n : options.initialDataUpdatedAt\n : 0\n\n return {\n data,\n dataUpdateCount: 0,\n dataUpdatedAt: hasData ? (initialDataUpdatedAt ?? Date.now()) : 0,\n error: null,\n errorUpdateCount: 0,\n errorUpdatedAt: 0,\n fetchFailureCount: 0,\n fetchFailureReason: null,\n fetchMeta: null,\n isInv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AAO;AAAA,IACL;AAAA,IACA,iBAAiB;AAAA,IACjB,eAAe,UAAW,wBAAwB,KAAK,IAAI,IAAK;AAAA,IAChE,OAAO;AAAA,IACP,kBAAkB;AAAA,IAClB,gBAAgB;AAAA,IAChB,mBAAmB;AAAA,IACnB,oBAAoB;AAAA,IACpB,WAAW;AAAA,IACX,eAAe;AAAA,IACf,QAAQ,UAAU,YAAY;AAAA,IAC9B,aAAa;AAAA,EACf;AACF;","names":["queryFnContext","context"]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/queryCache.cjs b/node_modules/@tanstack/query-core/build/legacy/queryCache.cjs deleted file mode 100644 index 69cac78..0000000 --- a/node_modules/@tanstack/query-core/build/legacy/queryCache.cjs +++ /dev/null @@ -1,131 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __typeError = (msg) => { - throw TypeError(msg); -}; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg); -var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj)); -var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value); -var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value); - -// src/queryCache.ts -var queryCache_exports = {}; -__export(queryCache_exports, { - QueryCache: () => QueryCache -}); -module.exports = __toCommonJS(queryCache_exports); -var import_utils = require("./utils.cjs"); -var import_query = require("./query.cjs"); -var import_notifyManager = require("./notifyManager.cjs"); -var import_subscribable = require("./subscribable.cjs"); -var _queries; -var QueryCache = class extends import_subscribable.Subscribable { - constructor(config = {}) { - super(); - this.config = config; - __privateAdd(this, _queries); - __privateSet(this, _queries, /* @__PURE__ */ new Map()); - } - build(client, options, state) { - const queryKey = options.queryKey; - const queryHash = options.queryHash ?? (0, import_utils.hashQueryKeyByOptions)(queryKey, options); - let query = this.get(queryHash); - if (!query) { - query = new import_query.Query({ - client, - queryKey, - queryHash, - options: client.defaultQueryOptions(options), - state, - defaultOptions: client.getQueryDefaults(queryKey) - }); - this.add(query); - } - return query; - } - add(query) { - if (!__privateGet(this, _queries).has(query.queryHash)) { - __privateGet(this, _queries).set(query.queryHash, query); - this.notify({ - type: "added", - query - }); - } - } - remove(query) { - const queryInMap = __privateGet(this, _queries).get(query.queryHash); - if (queryInMap) { - query.destroy(); - if (queryInMap === query) { - __privateGet(this, _queries).delete(query.queryHash); - } - this.notify({ type: "removed", query }); - } - } - clear() { - import_notifyManager.notifyManager.batch(() => { - this.getAll().forEach((query) => { - this.remove(query); - }); - }); - } - get(queryHash) { - return __privateGet(this, _queries).get(queryHash); - } - getAll() { - return [...__privateGet(this, _queries).values()]; - } - find(filters) { - const defaultedFilters = { exact: true, ...filters }; - return this.getAll().find( - (query) => (0, import_utils.matchQuery)(defaultedFilters, query) - ); - } - findAll(filters = {}) { - const queries = this.getAll(); - return Object.keys(filters).length > 0 ? queries.filter((query) => (0, import_utils.matchQuery)(filters, query)) : queries; - } - notify(event) { - import_notifyManager.notifyManager.batch(() => { - this.listeners.forEach((listener) => { - listener(event); - }); - }); - } - onFocus() { - import_notifyManager.notifyManager.batch(() => { - this.getAll().forEach((query) => { - query.onFocus(); - }); - }); - } - onOnline() { - import_notifyManager.notifyManager.batch(() => { - this.getAll().forEach((query) => { - query.onOnline(); - }); - }); - } -}; -_queries = new WeakMap(); -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - QueryCache -}); -//# sourceMappingURL=queryCache.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/queryCache.cjs.map b/node_modules/@tanstack/query-core/build/legacy/queryCache.cjs.map deleted file mode 100644 index 1e85002..0000000 --- a/node_modules/@tanstack/query-core/build/legacy/queryCache.cjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/queryCache.ts"],"sourcesContent":["import { hashQueryKeyByOptions, matchQuery } from './utils'\nimport { Query } from './query'\nimport { notifyManager } from './notifyManager'\nimport { Subscribable } from './subscribable'\nimport type { QueryFilters } from './utils'\nimport type { Action, QueryState } from './query'\nimport type {\n DefaultError,\n NotifyEvent,\n QueryKey,\n QueryOptions,\n WithRequired,\n} from './types'\nimport type { QueryClient } from './queryClient'\nimport type { QueryObserver } from './queryObserver'\n\n// TYPES\n\ninterface QueryCacheConfig {\n onError?: (\n error: DefaultError,\n query: Query,\n ) => void\n onSuccess?: (data: unknown, query: Query) => void\n onSettled?: (\n data: unknown | undefined,\n error: DefaultError | null,\n query: Query,\n ) => void\n}\n\ninterface NotifyEventQueryAdded extends NotifyEvent {\n type: 'added'\n query: Query\n}\n\ninterface NotifyEventQueryRemoved extends NotifyEvent {\n type: 'removed'\n query: Query\n}\n\ninterface NotifyEventQueryUpdated extends NotifyEvent {\n type: 'updated'\n query: Query\n action: Action\n}\n\ninterface NotifyEventQueryObserverAdded extends NotifyEvent {\n type: 'observerAdded'\n query: Query\n observer: QueryObserver\n}\n\ninterface NotifyEventQueryObserverRemoved extends NotifyEvent {\n type: 'observerRemoved'\n query: Query\n observer: QueryObserver\n}\n\ninterface NotifyEventQueryObserverResultsUpdated extends NotifyEvent {\n type: 'observerResultsUpdated'\n query: Query\n}\n\ninterface NotifyEventQueryObserverOptionsUpdated extends NotifyEvent {\n type: 'observerOptionsUpdated'\n query: Query\n observer: QueryObserver\n}\n\nexport type QueryCacheNotifyEvent =\n | NotifyEventQueryAdded\n | NotifyEventQueryRemoved\n | NotifyEventQueryUpdated\n | NotifyEventQueryObserverAdded\n | NotifyEventQueryObserverRemoved\n | NotifyEventQueryObserverResultsUpdated\n | NotifyEventQueryObserverOptionsUpdated\n\ntype QueryCacheListener = (event: QueryCacheNotifyEvent) => void\n\nexport interface QueryStore {\n has: (queryHash: string) => boolean\n set: (queryHash: string, query: Query) => void\n get: (queryHash: string) => Query | undefined\n delete: (queryHash: string) => void\n values: () => IterableIterator\n}\n\n// CLASS\n\nexport class QueryCache extends Subscribable {\n #queries: QueryStore\n\n constructor(public config: QueryCacheConfig = {}) {\n super()\n this.#queries = new Map()\n }\n\n build<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n >(\n client: QueryClient,\n options: WithRequired<\n QueryOptions,\n 'queryKey'\n >,\n state?: QueryState,\n ): Query {\n const queryKey = options.queryKey\n const queryHash =\n options.queryHash ?? hashQueryKeyByOptions(queryKey, options)\n let query = this.get(queryHash)\n\n if (!query) {\n query = new Query({\n client,\n queryKey,\n queryHash,\n options: client.defaultQueryOptions(options),\n state,\n defaultOptions: client.getQueryDefaults(queryKey),\n })\n this.add(query)\n }\n\n return query\n }\n\n add(query: Query): void {\n if (!this.#queries.has(query.queryHash)) {\n this.#queries.set(query.queryHash, query)\n\n this.notify({\n type: 'added',\n query,\n })\n }\n }\n\n remove(query: Query): void {\n const queryInMap = this.#queries.get(query.queryHash)\n\n if (queryInMap) {\n query.destroy()\n\n if (queryInMap === query) {\n this.#queries.delete(query.queryHash)\n }\n\n this.notify({ type: 'removed', query })\n }\n }\n\n clear(): void {\n notifyManager.batch(() => {\n this.getAll().forEach((query) => {\n this.remove(query)\n })\n })\n }\n\n get<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n >(\n queryHash: string,\n ): Query | undefined {\n return this.#queries.get(queryHash) as\n | Query\n | undefined\n }\n\n getAll(): Array {\n return [...this.#queries.values()]\n }\n\n find(\n filters: WithRequired,\n ): Query | undefined {\n const defaultedFilters = { exact: true, ...filters }\n\n return this.getAll().find((query) =>\n matchQuery(defaultedFilters, query),\n ) as Query | undefined\n }\n\n findAll(filters: QueryFilters = {}): Array {\n const queries = this.getAll()\n return Object.keys(filters).length > 0\n ? queries.filter((query) => matchQuery(filters, query))\n : queries\n }\n\n notify(event: QueryCacheNotifyEvent): void {\n notifyManager.batch(() => {\n this.listeners.forEach((listener) => {\n listener(event)\n })\n })\n }\n\n onFocus(): void {\n notifyManager.batch(() => {\n this.getAll().forEach((query) => {\n query.onFocus()\n })\n })\n }\n\n onOnline(): void {\n notifyManager.batch(() => {\n this.getAll().forEach((query) => {\n query.onOnline()\n })\n })\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAkD;AAClD,mBAAsB;AACtB,2BAA8B;AAC9B,0BAA6B;AAH7B;AA2FO,IAAM,aAAN,cAAyB,iCAAiC;AAAA,EAG/D,YAAmB,SAA2B,CAAC,GAAG;AAChD,UAAM;AADW;AAFnB;AAIE,uBAAK,UAAW,oBAAI,IAAmB;AAAA,EACzC;AAAA,EAEA,MAME,QACA,SAIA,OAC+C;AAC/C,UAAM,WAAW,QAAQ;AACzB,UAAM,YACJ,QAAQ,iBAAa,oCAAsB,UAAU,OAAO;AAC9D,QAAI,QAAQ,KAAK,IAA4C,SAAS;AAEtE,QAAI,CAAC,OAAO;AACV,cAAQ,IAAI,mBAAM;AAAA,QAChB;AAAA,QACA;AAAA,QACA;AAAA,QACA,SAAS,OAAO,oBAAoB,OAAO;AAAA,QAC3C;AAAA,QACA,gBAAgB,OAAO,iBAAiB,QAAQ;AAAA,MAClD,CAAC;AACD,WAAK,IAAI,KAAK;AAAA,IAChB;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,QAAQ,CAAC,aAAa;AACnC,iBAAS,KAAK;AAAA,MAChB,CAAC;AAAA,IACH,CAAC;AAAA,EACH;AAAA,EAEA,UAAgB;AACd,uCAAc,MAAM,MAAM;AACxB,WAAK,OAAO,EAAE,QAAQ,CAAC,UAAU;AAC/B,cAAM,QAAQ;AAAA,MAChB,CAAC;AAAA,IACH,CAAC;AAAA,EACH;AAAA,EAEA,WAAiB;AACf,uCAAc,MAAM,MAAM;AACxB,WAAK,OAAO,EAAE,QAAQ,CAAC,UAAU;AAC/B,cAAM,SAAS;AAAA,MACjB,CAAC;AAAA,IACH,CAAC;AAAA,EACH;AACF;AAlIE;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/queryCache.d.cts b/node_modules/@tanstack/query-core/build/legacy/queryCache.d.cts deleted file mode 100644 index 7c0bfb5..0000000 --- a/node_modules/@tanstack/query-core/build/legacy/queryCache.d.cts +++ /dev/null @@ -1,3 +0,0 @@ -export { Q as QueryCache, f as QueryCacheNotifyEvent, bB as QueryStore } from './hydration-uphG6M-i.cjs'; -import './subscribable.cjs'; -import './removable.cjs'; diff --git a/node_modules/@tanstack/query-core/build/legacy/queryCache.d.ts b/node_modules/@tanstack/query-core/build/legacy/queryCache.d.ts deleted file mode 100644 index 3e9dd5f..0000000 --- a/node_modules/@tanstack/query-core/build/legacy/queryCache.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export { Q as QueryCache, f as QueryCacheNotifyEvent, bB as QueryStore } from './hydration-BlEVG2Lp.js'; -import './subscribable.js'; -import './removable.js'; diff --git a/node_modules/@tanstack/query-core/build/legacy/queryCache.js b/node_modules/@tanstack/query-core/build/legacy/queryCache.js deleted file mode 100644 index eade2d6..0000000 --- a/node_modules/@tanstack/query-core/build/legacy/queryCache.js +++ /dev/null @@ -1,105 +0,0 @@ -import { - __privateAdd, - __privateGet, - __privateSet -} from "./chunk-PXG64RU4.js"; - -// src/queryCache.ts -import { hashQueryKeyByOptions, matchQuery } from "./utils.js"; -import { Query } from "./query.js"; -import { notifyManager } from "./notifyManager.js"; -import { Subscribable } from "./subscribable.js"; -var _queries; -var QueryCache = class extends Subscribable { - constructor(config = {}) { - super(); - this.config = config; - __privateAdd(this, _queries); - __privateSet(this, _queries, /* @__PURE__ */ new Map()); - } - build(client, options, state) { - const queryKey = options.queryKey; - const queryHash = options.queryHash ?? hashQueryKeyByOptions(queryKey, options); - let query = this.get(queryHash); - if (!query) { - query = new Query({ - client, - queryKey, - queryHash, - options: client.defaultQueryOptions(options), - state, - defaultOptions: client.getQueryDefaults(queryKey) - }); - this.add(query); - } - return query; - } - add(query) { - if (!__privateGet(this, _queries).has(query.queryHash)) { - __privateGet(this, _queries).set(query.queryHash, query); - this.notify({ - type: "added", - query - }); - } - } - remove(query) { - const queryInMap = __privateGet(this, _queries).get(query.queryHash); - if (queryInMap) { - query.destroy(); - if (queryInMap === query) { - __privateGet(this, _queries).delete(query.queryHash); - } - this.notify({ type: "removed", query }); - } - } - clear() { - notifyManager.batch(() => { - this.getAll().forEach((query) => { - this.remove(query); - }); - }); - } - get(queryHash) { - return __privateGet(this, _queries).get(queryHash); - } - getAll() { - return [...__privateGet(this, _queries).values()]; - } - find(filters) { - const defaultedFilters = { exact: true, ...filters }; - return this.getAll().find( - (query) => matchQuery(defaultedFilters, query) - ); - } - findAll(filters = {}) { - const queries = this.getAll(); - return Object.keys(filters).length > 0 ? queries.filter((query) => matchQuery(filters, query)) : queries; - } - notify(event) { - notifyManager.batch(() => { - this.listeners.forEach((listener) => { - listener(event); - }); - }); - } - onFocus() { - notifyManager.batch(() => { - this.getAll().forEach((query) => { - query.onFocus(); - }); - }); - } - onOnline() { - notifyManager.batch(() => { - this.getAll().forEach((query) => { - query.onOnline(); - }); - }); - } -}; -_queries = new WeakMap(); -export { - QueryCache -}; -//# sourceMappingURL=queryCache.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/queryCache.js.map b/node_modules/@tanstack/query-core/build/legacy/queryCache.js.map deleted file mode 100644 index 49cb764..0000000 --- a/node_modules/@tanstack/query-core/build/legacy/queryCache.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/queryCache.ts"],"sourcesContent":["import { hashQueryKeyByOptions, matchQuery } from './utils'\nimport { Query } from './query'\nimport { notifyManager } from './notifyManager'\nimport { Subscribable } from './subscribable'\nimport type { QueryFilters } from './utils'\nimport type { Action, QueryState } from './query'\nimport type {\n DefaultError,\n NotifyEvent,\n QueryKey,\n QueryOptions,\n WithRequired,\n} from './types'\nimport type { QueryClient } from './queryClient'\nimport type { QueryObserver } from './queryObserver'\n\n// TYPES\n\ninterface QueryCacheConfig {\n onError?: (\n error: DefaultError,\n query: Query,\n ) => void\n onSuccess?: (data: unknown, query: Query) => void\n onSettled?: (\n data: unknown | undefined,\n error: DefaultError | null,\n query: Query,\n ) => void\n}\n\ninterface NotifyEventQueryAdded extends NotifyEvent {\n type: 'added'\n query: Query\n}\n\ninterface NotifyEventQueryRemoved extends NotifyEvent {\n type: 'removed'\n query: Query\n}\n\ninterface NotifyEventQueryUpdated extends NotifyEvent {\n type: 'updated'\n query: Query\n action: Action\n}\n\ninterface NotifyEventQueryObserverAdded extends NotifyEvent {\n type: 'observerAdded'\n query: Query\n observer: QueryObserver\n}\n\ninterface NotifyEventQueryObserverRemoved extends NotifyEvent {\n type: 'observerRemoved'\n query: Query\n observer: QueryObserver\n}\n\ninterface NotifyEventQueryObserverResultsUpdated extends NotifyEvent {\n type: 'observerResultsUpdated'\n query: Query\n}\n\ninterface NotifyEventQueryObserverOptionsUpdated extends NotifyEvent {\n type: 'observerOptionsUpdated'\n query: Query\n observer: QueryObserver\n}\n\nexport type QueryCacheNotifyEvent =\n | NotifyEventQueryAdded\n | NotifyEventQueryRemoved\n | NotifyEventQueryUpdated\n | NotifyEventQueryObserverAdded\n | NotifyEventQueryObserverRemoved\n | NotifyEventQueryObserverResultsUpdated\n | NotifyEventQueryObserverOptionsUpdated\n\ntype QueryCacheListener = (event: QueryCacheNotifyEvent) => void\n\nexport interface QueryStore {\n has: (queryHash: string) => boolean\n set: (queryHash: string, query: Query) => void\n get: (queryHash: string) => Query | undefined\n delete: (queryHash: string) => void\n values: () => IterableIterator\n}\n\n// CLASS\n\nexport class QueryCache extends Subscribable {\n #queries: QueryStore\n\n constructor(public config: QueryCacheConfig = {}) {\n super()\n this.#queries = new Map()\n }\n\n build<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n >(\n client: QueryClient,\n options: WithRequired<\n QueryOptions,\n 'queryKey'\n >,\n state?: QueryState,\n ): Query {\n const queryKey = options.queryKey\n const queryHash =\n options.queryHash ?? hashQueryKeyByOptions(queryKey, options)\n let query = this.get(queryHash)\n\n if (!query) {\n query = new Query({\n client,\n queryKey,\n queryHash,\n options: client.defaultQueryOptions(options),\n state,\n defaultOptions: client.getQueryDefaults(queryKey),\n })\n this.add(query)\n }\n\n return query\n }\n\n add(query: Query): void {\n if (!this.#queries.has(query.queryHash)) {\n this.#queries.set(query.queryHash, query)\n\n this.notify({\n type: 'added',\n query,\n })\n }\n }\n\n remove(query: Query): void {\n const queryInMap = this.#queries.get(query.queryHash)\n\n if (queryInMap) {\n query.destroy()\n\n if (queryInMap === query) {\n this.#queries.delete(query.queryHash)\n }\n\n this.notify({ type: 'removed', query })\n }\n }\n\n clear(): void {\n notifyManager.batch(() => {\n this.getAll().forEach((query) => {\n this.remove(query)\n })\n })\n }\n\n get<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n >(\n queryHash: string,\n ): Query | undefined {\n return this.#queries.get(queryHash) as\n | Query\n | undefined\n }\n\n getAll(): Array {\n return [...this.#queries.values()]\n }\n\n find(\n filters: WithRequired,\n ): Query | undefined {\n const defaultedFilters = { exact: true, ...filters }\n\n return this.getAll().find((query) =>\n matchQuery(defaultedFilters, query),\n ) as Query | undefined\n }\n\n findAll(filters: QueryFilters = {}): Array {\n const queries = this.getAll()\n return Object.keys(filters).length > 0\n ? queries.filter((query) => matchQuery(filters, query))\n : queries\n }\n\n notify(event: QueryCacheNotifyEvent): void {\n notifyManager.batch(() => {\n this.listeners.forEach((listener) => {\n listener(event)\n })\n })\n }\n\n onFocus(): void {\n notifyManager.batch(() => {\n this.getAll().forEach((query) => {\n query.onFocus()\n })\n })\n }\n\n onOnline(): void {\n notifyManager.batch(() => {\n this.getAll().forEach((query) => {\n query.onOnline()\n })\n })\n }\n}\n"],"mappings":";;;;;;;AAAA,SAAS,uBAAuB,kBAAkB;AAClD,SAAS,aAAa;AACtB,SAAS,qBAAqB;AAC9B,SAAS,oBAAoB;AAH7B;AA2FO,IAAM,aAAN,cAAyB,aAAiC;AAAA,EAG/D,YAAmB,SAA2B,CAAC,GAAG;AAChD,UAAM;AADW;AAFnB;AAIE,uBAAK,UAAW,oBAAI,IAAmB;AAAA,EACzC;AAAA,EAEA,MAME,QACA,SAIA,OAC+C;AAC/C,UAAM,WAAW,QAAQ;AACzB,UAAM,YACJ,QAAQ,aAAa,sBAAsB,UAAU,OAAO;AAC9D,QAAI,QAAQ,KAAK,IAA4C,SAAS;AAEtE,QAAI,CAAC,OAAO;AACV,cAAQ,IAAI,MAAM;AAAA,QAChB;AAAA,QACA;AAAA,QACA;AAAA,QACA,SAAS,OAAO,oBAAoB,OAAO;AAAA,QAC3C;AAAA,QACA,gBAAgB,OAAO,iBAAiB,QAAQ;AAAA,MAClD,CAAC;AACD,WAAK,IAAI,KAAK;AAAA,IAChB;AAEA,WAAO;AAAA,EACT;AAAA,EAEA,IAAI,OAAwC;AAC1C,QAAI,CAAC,mBAAK,UAAS,IAAI,MAAM,SAAS,GAAG;AACvC,yBAAK,UAAS,IAAI,MAAM,WAAW,KAAK;AAExC,WAAK,OAAO;AAAA,QACV,MAAM;AAAA,QACN;AAAA,MACF,CAAC;AAAA,IACH;AAAA,EACF;AAAA,EAEA,OAAO,OAAwC;AAC7C,UAA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AAM,MAAM;AACxB,WAAK,OAAO,EAAE,QAAQ,CAAC,UAAU;AAC/B,cAAM,SAAS;AAAA,MACjB,CAAC;AAAA,IACH,CAAC;AAAA,EACH;AACF;AAlIE;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/queryClient.cjs b/node_modules/@tanstack/query-core/build/legacy/queryClient.cjs deleted file mode 100644 index b3d749e..0000000 --- a/node_modules/@tanstack/query-core/build/legacy/queryClient.cjs +++ /dev/null @@ -1,349 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __typeError = (msg) => { - throw TypeError(msg); -}; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg); -var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj)); -var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value); -var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value); -var __privateWrapper = (obj, member, setter, getter) => ({ - set _(value) { - __privateSet(obj, member, value, setter); - }, - get _() { - return __privateGet(obj, member, getter); - } -}); - -// src/queryClient.ts -var queryClient_exports = {}; -__export(queryClient_exports, { - QueryClient: () => QueryClient -}); -module.exports = __toCommonJS(queryClient_exports); -var import_utils = require("./utils.cjs"); -var import_queryCache = require("./queryCache.cjs"); -var import_mutationCache = require("./mutationCache.cjs"); -var import_focusManager = require("./focusManager.cjs"); -var import_onlineManager = require("./onlineManager.cjs"); -var import_notifyManager = require("./notifyManager.cjs"); -var import_infiniteQueryBehavior = require("./infiniteQueryBehavior.cjs"); -var _queryCache, _mutationCache, _defaultOptions, _queryDefaults, _mutationDefaults, _mountCount, _unsubscribeFocus, _unsubscribeOnline; -var QueryClient = class { - constructor(config = {}) { - __privateAdd(this, _queryCache); - __privateAdd(this, _mutationCache); - __privateAdd(this, _defaultOptions); - __privateAdd(this, _queryDefaults); - __privateAdd(this, _mutationDefaults); - __privateAdd(this, _mountCount); - __privateAdd(this, _unsubscribeFocus); - __privateAdd(this, _unsubscribeOnline); - __privateSet(this, _queryCache, config.queryCache || new import_queryCache.QueryCache()); - __privateSet(this, _mutationCache, config.mutationCache || new import_mutationCache.MutationCache()); - __privateSet(this, _defaultOptions, config.defaultOptions || {}); - __privateSet(this, _queryDefaults, /* @__PURE__ */ new Map()); - __privateSet(this, _mutationDefaults, /* @__PURE__ */ new Map()); - __privateSet(this, _mountCount, 0); - } - mount() { - __privateWrapper(this, _mountCount)._++; - if (__privateGet(this, _mountCount) !== 1) return; - __privateSet(this, _unsubscribeFocus, import_focusManager.focusManager.subscribe(async (focused) => { - if (focused) { - await this.resumePausedMutations(); - __privateGet(this, _queryCache).onFocus(); - } - })); - __privateSet(this, _unsubscribeOnline, import_onlineManager.onlineManager.subscribe(async (online) => { - if (online) { - await this.resumePausedMutations(); - __privateGet(this, _queryCache).onOnline(); - } - })); - } - unmount() { - var _a, _b; - __privateWrapper(this, _mountCount)._--; - if (__privateGet(this, _mountCount) !== 0) return; - (_a = __privateGet(this, _unsubscribeFocus)) == null ? void 0 : _a.call(this); - __privateSet(this, _unsubscribeFocus, void 0); - (_b = __privateGet(this, _unsubscribeOnline)) == null ? void 0 : _b.call(this); - __privateSet(this, _unsubscribeOnline, void 0); - } - isFetching(filters) { - return __privateGet(this, _queryCache).findAll({ ...filters, fetchStatus: "fetching" }).length; - } - isMutating(filters) { - return __privateGet(this, _mutationCache).findAll({ ...filters, status: "pending" }).length; - } - /** - * Imperative (non-reactive) way to retrieve data for a QueryKey. - * Should only be used in callbacks or functions where reading the latest data is necessary, e.g. for optimistic updates. - * - * Hint: Do not use this function inside a component, because it won't receive updates. - * Use `useQuery` to create a `QueryObserver` that subscribes to changes. - */ - getQueryData(queryKey) { - var _a; - const options = this.defaultQueryOptions({ queryKey }); - return (_a = __privateGet(this, _queryCache).get(options.queryHash)) == null ? void 0 : _a.state.data; - } - ensureQueryData(options) { - const defaultedOptions = this.defaultQueryOptions(options); - const query = __privateGet(this, _queryCache).build(this, defaultedOptions); - const cachedData = query.state.data; - if (cachedData === void 0) { - return this.fetchQuery(options); - } - if (options.revalidateIfStale && query.isStaleByTime((0, import_utils.resolveStaleTime)(defaultedOptions.staleTime, query))) { - void this.prefetchQuery(defaultedOptions); - } - return Promise.resolve(cachedData); - } - getQueriesData(filters) { - return __privateGet(this, _queryCache).findAll(filters).map(({ queryKey, state }) => { - const data = state.data; - return [queryKey, data]; - }); - } - setQueryData(queryKey, updater, options) { - const defaultedOptions = this.defaultQueryOptions({ queryKey }); - const query = __privateGet(this, _queryCache).get( - defaultedOptions.queryHash - ); - const prevData = query == null ? void 0 : query.state.data; - const data = (0, import_utils.functionalUpdate)(updater, prevData); - if (data === void 0) { - return void 0; - } - return __privateGet(this, _queryCache).build(this, defaultedOptions).setData(data, { ...options, manual: true }); - } - setQueriesData(filters, updater, options) { - return import_notifyManager.notifyManager.batch( - () => __privateGet(this, _queryCache).findAll(filters).map(({ queryKey }) => [ - queryKey, - this.setQueryData(queryKey, updater, options) - ]) - ); - } - getQueryState(queryKey) { - var _a; - const options = this.defaultQueryOptions({ queryKey }); - return (_a = __privateGet(this, _queryCache).get( - options.queryHash - )) == null ? void 0 : _a.state; - } - removeQueries(filters) { - const queryCache = __privateGet(this, _queryCache); - import_notifyManager.notifyManager.batch(() => { - queryCache.findAll(filters).forEach((query) => { - queryCache.remove(query); - }); - }); - } - resetQueries(filters, options) { - const queryCache = __privateGet(this, _queryCache); - return import_notifyManager.notifyManager.batch(() => { - queryCache.findAll(filters).forEach((query) => { - query.reset(); - }); - return this.refetchQueries( - { - type: "active", - ...filters - }, - options - ); - }); - } - cancelQueries(filters, cancelOptions = {}) { - const defaultedCancelOptions = { revert: true, ...cancelOptions }; - const promises = import_notifyManager.notifyManager.batch( - () => __privateGet(this, _queryCache).findAll(filters).map((query) => query.cancel(defaultedCancelOptions)) - ); - return Promise.all(promises).then(import_utils.noop).catch(import_utils.noop); - } - invalidateQueries(filters, options = {}) { - return import_notifyManager.notifyManager.batch(() => { - __privateGet(this, _queryCache).findAll(filters).forEach((query) => { - query.invalidate(); - }); - if ((filters == null ? void 0 : filters.refetchType) === "none") { - return Promise.resolve(); - } - return this.refetchQueries( - { - ...filters, - type: (filters == null ? void 0 : filters.refetchType) ?? (filters == null ? void 0 : filters.type) ?? "active" - }, - options - ); - }); - } - refetchQueries(filters, options = {}) { - const fetchOptions = { - ...options, - cancelRefetch: options.cancelRefetch ?? true - }; - const promises = import_notifyManager.notifyManager.batch( - () => __privateGet(this, _queryCache).findAll(filters).filter((query) => !query.isDisabled() && !query.isStatic()).map((query) => { - let promise = query.fetch(void 0, fetchOptions); - if (!fetchOptions.throwOnError) { - promise = promise.catch(import_utils.noop); - } - return query.state.fetchStatus === "paused" ? Promise.resolve() : promise; - }) - ); - return Promise.all(promises).then(import_utils.noop); - } - fetchQuery(options) { - const defaultedOptions = this.defaultQueryOptions(options); - if (defaultedOptions.retry === void 0) { - defaultedOptions.retry = false; - } - const query = __privateGet(this, _queryCache).build(this, defaultedOptions); - return query.isStaleByTime( - (0, import_utils.resolveStaleTime)(defaultedOptions.staleTime, query) - ) ? query.fetch(defaultedOptions) : Promise.resolve(query.state.data); - } - prefetchQuery(options) { - return this.fetchQuery(options).then(import_utils.noop).catch(import_utils.noop); - } - fetchInfiniteQuery(options) { - options.behavior = (0, import_infiniteQueryBehavior.infiniteQueryBehavior)(options.pages); - return this.fetchQuery(options); - } - prefetchInfiniteQuery(options) { - return this.fetchInfiniteQuery(options).then(import_utils.noop).catch(import_utils.noop); - } - ensureInfiniteQueryData(options) { - options.behavior = (0, import_infiniteQueryBehavior.infiniteQueryBehavior)(options.pages); - return this.ensureQueryData(options); - } - resumePausedMutations() { - if (import_onlineManager.onlineManager.isOnline()) { - return __privateGet(this, _mutationCache).resumePausedMutations(); - } - return Promise.resolve(); - } - getQueryCache() { - return __privateGet(this, _queryCache); - } - getMutationCache() { - return __privateGet(this, _mutationCache); - } - getDefaultOptions() { - return __privateGet(this, _defaultOptions); - } - setDefaultOptions(options) { - __privateSet(this, _defaultOptions, options); - } - setQueryDefaults(queryKey, options) { - __privateGet(this, _queryDefaults).set((0, import_utils.hashKey)(queryKey), { - queryKey, - defaultOptions: options - }); - } - getQueryDefaults(queryKey) { - const defaults = [...__privateGet(this, _queryDefaults).values()]; - const result = {}; - defaults.forEach((queryDefault) => { - if ((0, import_utils.partialMatchKey)(queryKey, queryDefault.queryKey)) { - Object.assign(result, queryDefault.defaultOptions); - } - }); - return result; - } - setMutationDefaults(mutationKey, options) { - __privateGet(this, _mutationDefaults).set((0, import_utils.hashKey)(mutationKey), { - mutationKey, - defaultOptions: options - }); - } - getMutationDefaults(mutationKey) { - const defaults = [...__privateGet(this, _mutationDefaults).values()]; - const result = {}; - defaults.forEach((queryDefault) => { - if ((0, import_utils.partialMatchKey)(mutationKey, queryDefault.mutationKey)) { - Object.assign(result, queryDefault.defaultOptions); - } - }); - return result; - } - defaultQueryOptions(options) { - if (options._defaulted) { - return options; - } - const defaultedOptions = { - ...__privateGet(this, _defaultOptions).queries, - ...this.getQueryDefaults(options.queryKey), - ...options, - _defaulted: true - }; - if (!defaultedOptions.queryHash) { - defaultedOptions.queryHash = (0, import_utils.hashQueryKeyByOptions)( - defaultedOptions.queryKey, - defaultedOptions - ); - } - if (defaultedOptions.refetchOnReconnect === void 0) { - defaultedOptions.refetchOnReconnect = defaultedOptions.networkMode !== "always"; - } - if (defaultedOptions.throwOnError === void 0) { - defaultedOptions.throwOnError = !!defaultedOptions.suspense; - } - if (!defaultedOptions.networkMode && defaultedOptions.persister) { - defaultedOptions.networkMode = "offlineFirst"; - } - if (defaultedOptions.queryFn === import_utils.skipToken) { - defaultedOptions.enabled = false; - } - return defaultedOptions; - } - defaultMutationOptions(options) { - if (options == null ? void 0 : options._defaulted) { - return options; - } - return { - ...__privateGet(this, _defaultOptions).mutations, - ...(options == null ? void 0 : options.mutationKey) && this.getMutationDefaults(options.mutationKey), - ...options, - _defaulted: true - }; - } - clear() { - __privateGet(this, _queryCache).clear(); - __privateGet(this, _mutationCache).clear(); - } -}; -_queryCache = new WeakMap(); -_mutationCache = new WeakMap(); -_defaultOptions = new WeakMap(); -_queryDefaults = new WeakMap(); -_mutationDefaults = new WeakMap(); -_mountCount = new WeakMap(); -_unsubscribeFocus = new WeakMap(); -_unsubscribeOnline = new WeakMap(); -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - QueryClient -}); -//# sourceMappingURL=queryClient.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/queryClient.cjs.map b/node_modules/@tanstack/query-core/build/legacy/queryClient.cjs.map deleted file mode 100644 index 1b49836..0000000 --- a/node_modules/@tanstack/query-core/build/legacy/queryClient.cjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/queryClient.ts"],"sourcesContent":["import {\n functionalUpdate,\n hashKey,\n hashQueryKeyByOptions,\n noop,\n partialMatchKey,\n resolveStaleTime,\n skipToken,\n} from './utils'\nimport { QueryCache } from './queryCache'\nimport { MutationCache } from './mutationCache'\nimport { focusManager } from './focusManager'\nimport { onlineManager } from './onlineManager'\nimport { notifyManager } from './notifyManager'\nimport { infiniteQueryBehavior } from './infiniteQueryBehavior'\nimport type {\n CancelOptions,\n DefaultError,\n DefaultOptions,\n DefaultedQueryObserverOptions,\n EnsureInfiniteQueryDataOptions,\n EnsureQueryDataOptions,\n FetchInfiniteQueryOptions,\n FetchQueryOptions,\n InferDataFromTag,\n InferErrorFromTag,\n InfiniteData,\n InvalidateOptions,\n InvalidateQueryFilters,\n MutationKey,\n MutationObserverOptions,\n MutationOptions,\n NoInfer,\n OmitKeyof,\n QueryClientConfig,\n QueryKey,\n QueryObserverOptions,\n QueryOptions,\n RefetchOptions,\n RefetchQueryFilters,\n ResetOptions,\n SetDataOptions,\n} from './types'\nimport type { QueryState } from './query'\nimport type { MutationFilters, QueryFilters, Updater } from './utils'\n\n// TYPES\n\ninterface QueryDefaults {\n queryKey: QueryKey\n defaultOptions: OmitKeyof, 'queryKey'>\n}\n\ninterface MutationDefaults {\n mutationKey: MutationKey\n defaultOptions: MutationOptions\n}\n\n// CLASS\n\nexport class QueryClient {\n #queryCache: QueryCache\n #mutationCache: MutationCache\n #defaultOptions: DefaultOptions\n #queryDefaults: Map\n #mutationDefaults: Map\n #mountCount: number\n #unsubscribeFocus?: () => void\n #unsubscribeOnline?: () => void\n\n constructor(config: QueryClientConfig = {}) {\n this.#queryCache = config.queryCache || new QueryCache()\n this.#mutationCache = config.mutationCache || new MutationCache()\n this.#defaultOptions = config.defaultOptions || {}\n this.#queryDefaults = new Map()\n this.#mutationDefaults = new Map()\n this.#mountCount = 0\n }\n\n mount(): void {\n this.#mountCount++\n if (this.#mountCount !== 1) return\n\n this.#unsubscribeFocus = focusManager.subscribe(async (focused) => {\n if (focused) {\n await this.resumePausedMutations()\n this.#queryCache.onFocus()\n }\n })\n this.#unsubscribeOnline = onlineManager.subscribe(async (online) => {\n if (online) {\n await this.resumePausedMutations()\n this.#queryCache.onOnline()\n }\n })\n }\n\n unmount(): void {\n this.#mountCount--\n if (this.#mountCount !== 0) return\n\n this.#unsubscribeFocus?.()\n this.#unsubscribeFocus = undefined\n\n this.#unsubscribeOnline?.()\n this.#unsubscribeOnline = undefined\n }\n\n isFetching = QueryFilters>(\n filters?: TQueryFilters,\n ): number {\n return this.#queryCache.findAll({ ...filters, fetchStatus: 'fetching' })\n .length\n }\n\n isMutating<\n TMutationFilters extends MutationFilters = MutationFilters,\n >(filters?: TMutationFilters): number {\n return this.#mutationCache.findAll({ ...filters, status: 'pending' }).length\n }\n\n /**\n * Imperative (non-reactive) way to retrieve data for a QueryKey.\n * Should only be used in callbacks or functions where reading the latest data is necessary, e.g. for optimistic updates.\n *\n * Hint: Do not use this function inside a component, because it won't receive updates.\n * Use `useQuery` to create a `QueryObserver` that subscribes to changes.\n */\n getQueryData<\n TQueryFnData = unknown,\n TTaggedQueryKey extends QueryKey = QueryKey,\n TInferredQueryFnData = InferDataFromTag,\n >(queryKey: TTaggedQueryKey): TInferredQueryFnData | undefined {\n const options = this.defaultQueryOptions({ queryKey })\n\n return this.#queryCache.get(options.queryHash)?.state\n .data\n }\n\n ensureQueryData<\n TQueryFnData,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n >(\n options: EnsureQueryDataOptions,\n ): Promise {\n const defaultedOptions = this.defaultQueryOptions(options)\n const query = this.#queryCache.build(this, defaultedOptions)\n const cachedData = query.state.data\n\n if (cachedData === undefined) {\n return this.fetchQuery(options)\n }\n\n if (\n options.revalidateIfStale &&\n query.isStaleByTime(resolveStaleTime(defaultedOptions.staleTime, query))\n ) {\n void this.prefetchQuery(defaultedOptions)\n }\n\n return Promise.resolve(cachedData)\n }\n\n getQueriesData<\n TQueryFnData = unknown,\n TQueryFilters extends QueryFilters = QueryFilters,\n >(filters: TQueryFilters): Array<[QueryKey, TQueryFnData | undefined]> {\n return this.#queryCache.findAll(filters).map(({ queryKey, state }) => {\n const data = state.data as TQueryFnData | undefined\n return [queryKey, data]\n })\n }\n\n setQueryData<\n TQueryFnData = unknown,\n TTaggedQueryKey extends QueryKey = QueryKey,\n TInferredQueryFnData = InferDataFromTag,\n >(\n queryKey: TTaggedQueryKey,\n updater: Updater<\n NoInfer | undefined,\n NoInfer | undefined\n >,\n options?: SetDataOptions,\n ): NoInfer | undefined {\n const defaultedOptions = this.defaultQueryOptions<\n any,\n any,\n unknown,\n any,\n QueryKey\n >({ queryKey })\n\n const query = this.#queryCache.get(\n defaultedOptions.queryHash,\n )\n const prevData = query?.state.data\n const data = functionalUpdate(updater, prevData)\n\n if (data === undefined) {\n return undefined\n }\n\n return this.#queryCache\n .build(this, defaultedOptions)\n .setData(data, { ...options, manual: true })\n }\n\n setQueriesData<\n TQueryFnData,\n TQueryFilters extends QueryFilters = QueryFilters,\n >(\n filters: TQueryFilters,\n updater: Updater<\n NoInfer | undefined,\n NoInfer | undefined\n >,\n options?: SetDataOptions,\n ): Array<[QueryKey, TQueryFnData | undefined]> {\n return notifyManager.batch(() =>\n this.#queryCache\n .findAll(filters)\n .map(({ queryKey }) => [\n queryKey,\n this.setQueryData(queryKey, updater, options),\n ]),\n )\n }\n\n getQueryState<\n TQueryFnData = unknown,\n TError = DefaultError,\n TTaggedQueryKey extends QueryKey = QueryKey,\n TInferredQueryFnData = InferDataFromTag,\n TInferredError = InferErrorFromTag,\n >(\n queryKey: TTaggedQueryKey,\n ): QueryState | undefined {\n const options = this.defaultQueryOptions({ queryKey })\n return this.#queryCache.get(\n options.queryHash,\n )?.state\n }\n\n removeQueries(\n filters?: QueryFilters,\n ): void {\n const queryCache = this.#queryCache\n notifyManager.batch(() => {\n queryCache.findAll(filters).forEach((query) => {\n queryCache.remove(query)\n })\n })\n }\n\n resetQueries(\n filters?: QueryFilters,\n options?: ResetOptions,\n ): Promise {\n const queryCache = this.#queryCache\n\n return notifyManager.batch(() => {\n queryCache.findAll(filters).forEach((query) => {\n query.reset()\n })\n return this.refetchQueries(\n {\n type: 'active',\n ...filters,\n },\n options,\n )\n })\n }\n\n cancelQueries(\n filters?: QueryFilters,\n cancelOptions: CancelOptions = {},\n ): Promise {\n const defaultedCancelOptions = { revert: true, ...cancelOptions }\n\n const promises = notifyManager.batch(() =>\n this.#queryCache\n .findAll(filters)\n .map((query) => query.cancel(defaultedCancelOptions)),\n )\n\n return Promise.all(promises).then(noop).catch(noop)\n }\n\n invalidateQueries(\n filters?: InvalidateQueryFilters,\n options: InvalidateOptions = {},\n ): Promise {\n return notifyManager.batch(() => {\n this.#queryCache.findAll(filters).forEach((query) => {\n query.invalidate()\n })\n\n if (filters?.refetchType === 'none') {\n return Promise.resolve()\n }\n return this.refetchQueries(\n {\n ...filters,\n type: filters?.refetchType ?? filters?.type ?? 'active',\n },\n options,\n )\n })\n }\n\n refetchQueries(\n filters?: RefetchQueryFilters,\n options: RefetchOptions = {},\n ): Promise {\n const fetchOptions = {\n ...options,\n cancelRefetch: options.cancelRefetch ?? true,\n }\n const promises = notifyManager.batch(() =>\n this.#queryCache\n .findAll(filters)\n .filter((query) => !query.isDisabled() && !query.isStatic())\n .map((query) => {\n let promise = query.fetch(undefined, fetchOptions)\n if (!fetchOptions.throwOnError) {\n promise = promise.catch(noop)\n }\n return query.state.fetchStatus === 'paused'\n ? Promise.resolve()\n : promise\n }),\n )\n\n return Promise.all(promises).then(noop)\n }\n\n fetchQuery<\n TQueryFnData,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = never,\n >(\n options: FetchQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n ): Promise {\n const defaultedOptions = this.defaultQueryOptions(options)\n\n // https://github.com/tannerlinsley/react-query/issues/652\n if (defaultedOptions.retry === undefined) {\n defaultedOptions.retry = false\n }\n\n const query = this.#queryCache.build(this, defaultedOptions)\n\n return query.isStaleByTime(\n resolveStaleTime(defaultedOptions.staleTime, query),\n )\n ? query.fetch(defaultedOptions)\n : Promise.resolve(query.state.data as TData)\n }\n\n prefetchQuery<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n >(\n options: FetchQueryOptions,\n ): Promise {\n return this.fetchQuery(options).then(noop).catch(noop)\n }\n\n fetchInfiniteQuery<\n TQueryFnData,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n >(\n options: FetchInfiniteQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n ): Promise> {\n options.behavior = infiniteQueryBehavior<\n TQueryFnData,\n TError,\n TData,\n TPageParam\n >(options.pages)\n return this.fetchQuery(options as any)\n }\n\n prefetchInfiniteQuery<\n TQueryFnData,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n >(\n options: FetchInfiniteQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n ): Promise {\n return this.fetchInfiniteQuery(options).then(noop).catch(noop)\n }\n\n ensureInfiniteQueryData<\n TQueryFnData,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n >(\n options: EnsureInfiniteQueryDataOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n ): Promise> {\n options.behavior = infiniteQueryBehavior<\n TQueryFnData,\n TError,\n TData,\n TPageParam\n >(options.pages)\n\n return this.ensureQueryData(options as any)\n }\n\n resumePausedMutations(): Promise {\n if (onlineManager.isOnline()) {\n return this.#mutationCache.resumePausedMutations()\n }\n return Promise.resolve()\n }\n\n getQueryCache(): QueryCache {\n return this.#queryCache\n }\n\n getMutationCache(): MutationCache {\n return this.#mutationCache\n }\n\n getDefaultOptions(): DefaultOptions {\n return this.#defaultOptions\n }\n\n setDefaultOptions(options: DefaultOptions): void {\n this.#defaultOptions = options\n }\n\n setQueryDefaults<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryData = TQueryFnData,\n >(\n queryKey: QueryKey,\n options: Partial<\n OmitKeyof<\n QueryObserverOptions,\n 'queryKey'\n >\n >,\n ): void {\n this.#queryDefaults.set(hashKey(queryKey), {\n queryKey,\n defaultOptions: options,\n })\n }\n\n getQueryDefaults(\n queryKey: QueryKey,\n ): OmitKeyof, 'queryKey'> {\n const defaults = [...this.#queryDefaults.values()]\n\n const result: OmitKeyof<\n QueryObserverOptions,\n 'queryKey'\n > = {}\n\n defaults.forEach((queryDefault) => {\n if (partialMatchKey(queryKey, queryDefault.queryKey)) {\n Object.assign(result, queryDefault.defaultOptions)\n }\n })\n return result\n }\n\n setMutationDefaults<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n >(\n mutationKey: MutationKey,\n options: OmitKeyof<\n MutationObserverOptions,\n 'mutationKey'\n >,\n ): void {\n this.#mutationDefaults.set(hashKey(mutationKey), {\n mutationKey,\n defaultOptions: options,\n })\n }\n\n getMutationDefaults(\n mutationKey: MutationKey,\n ): OmitKeyof, 'mutationKey'> {\n const defaults = [...this.#mutationDefaults.values()]\n\n const result: OmitKeyof<\n MutationObserverOptions,\n 'mutationKey'\n > = {}\n\n defaults.forEach((queryDefault) => {\n if (partialMatchKey(mutationKey, queryDefault.mutationKey)) {\n Object.assign(result, queryDefault.defaultOptions)\n }\n })\n\n return result\n }\n\n defaultQueryOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = never,\n >(\n options:\n | QueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey,\n TPageParam\n >\n | DefaultedQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >,\n ): DefaultedQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n > {\n if (options._defaulted) {\n return options as DefaultedQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >\n }\n\n const defaultedOptions = {\n ...this.#defaultOptions.queries,\n ...this.getQueryDefaults(options.queryKey),\n ...options,\n _defaulted: true,\n }\n\n if (!defaultedOptions.queryHash) {\n defaultedOptions.queryHash = hashQueryKeyByOptions(\n defaultedOptions.queryKey,\n defaultedOptions,\n )\n }\n\n // dependent default values\n if (defaultedOptions.refetchOnReconnect === undefined) {\n defaultedOptions.refetchOnReconnect =\n defaultedOptions.networkMode !== 'always'\n }\n if (defaultedOptions.throwOnError === undefined) {\n defaultedOptions.throwOnError = !!defaultedOptions.suspense\n }\n\n if (!defaultedOptions.networkMode && defaultedOptions.persister) {\n defaultedOptions.networkMode = 'offlineFirst'\n }\n\n if (defaultedOptions.queryFn === skipToken) {\n defaultedOptions.enabled = false\n }\n\n return defaultedOptions as DefaultedQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >\n }\n\n defaultMutationOptions>(\n options?: T,\n ): T {\n if (options?._defaulted) {\n return options\n }\n return {\n ...this.#defaultOptions.mutations,\n ...(options?.mutationKey &&\n this.getMutationDefaults(options.mutationKey)),\n ...options,\n _defaulted: true,\n } as T\n }\n\n clear(): void {\n this.#queryCache.clear()\n this.#mutationCache.clear()\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAQO;AACP,wBAA2B;AAC3B,2BAA8B;AAC9B,0BAA6B;AAC7B,2BAA8B;AAC9B,2BAA8B;AAC9B,mCAAsC;AAdtC;AA4DO,IAAM,cAAN,MAAkB;AAAA,EAUvB,YAAY,SAA4B,CAAC,GAAG;AAT5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGE,uBAAK,aAAc,OAAO,cAAc,IAAI,6BAAW;AACvD,uBAAK,gBAAiB,OAAO,iBAAiB,IAAI,mCAAc;AAChE,uBAAK,iBAAkB,OAAO,kBAAkB,CAAC;AACjD,uBAAK,gBAAiB,oBAAI,IAAI;AAC9B,uBAAK,mBAAoB,oBAAI,IAAI;AACj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BAAK,iBAAgB;AAAA,MACxB,GAAG,KAAK,iBAAiB,QAAQ,QAAQ;AAAA,MACzC,GAAG;AAAA,MACH,YAAY;AAAA,IACd;AAEA,QAAI,CAAC,iBAAiB,WAAW;AAC/B,uBAAiB,gBAAY;AAAA,QAC3B,iBAAiB;AAAA,QACjB;AAAA,MACF;AAAA,IACF;AAGA,QAAI,iBAAiB,uBAAuB,QAAW;AACrD,uBAAiB,qBACf,iBAAiB,gBAAgB;AAAA,IACrC;AACA,QAAI,iBAAiB,iBAAiB,QAAW;AAC/C,uBAAiB,eAAe,CAAC,CAAC,iBAAiB;AAAA,IACrD;AAEA,QAAI,CAAC,iBAAiB,eAAe,iBAAiB,WAAW;AAC/D,uBAAiB,cAAc;AAAA,IACjC;AAEA,QAAI,iBAAiB,YAAY,wBAAW;AAC1C,uBAAiB,UAAU;AAAA,IAC7B;AAEA,WAAO;AAAA,EAOT;AAAA,EAEA,uBACE,SACG;AACH,QAAI,mCAAS,YAAY;AACvB,aAAO;AAAA,IACT;AACA,WAAO;AAAA,MACL,GAAG,mBAAK,iBAAgB;AAAA,MACxB,IAAI,mCAAS,gBACX,KAAK,oBAAoB,QAAQ,WAAW;AAAA,MAC9C,GAAG;AAAA,MACH,YAAY;AAAA,IACd;AAAA,EACF;AAAA,EAEA,QAAc;AACZ,uBAAK,aAAY,MAAM;AACvB,uBAAK,gBAAe,MAAM;AAAA,EAC5B;AACF;AA1kBE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/queryClient.d.cts b/node_modules/@tanstack/query-core/build/legacy/queryClient.d.cts deleted file mode 100644 index bd14fb2..0000000 --- a/node_modules/@tanstack/query-core/build/legacy/queryClient.d.cts +++ /dev/null @@ -1,3 +0,0 @@ -export { g as QueryClient } from './hydration-uphG6M-i.cjs'; -import './removable.cjs'; -import './subscribable.cjs'; diff --git a/node_modules/@tanstack/query-core/build/legacy/queryClient.d.ts b/node_modules/@tanstack/query-core/build/legacy/queryClient.d.ts deleted file mode 100644 index 73366c7..0000000 --- a/node_modules/@tanstack/query-core/build/legacy/queryClient.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export { g as QueryClient } from './hydration-BlEVG2Lp.js'; -import './removable.js'; -import './subscribable.js'; diff --git a/node_modules/@tanstack/query-core/build/legacy/queryClient.js b/node_modules/@tanstack/query-core/build/legacy/queryClient.js deleted file mode 100644 index f816889..0000000 --- a/node_modules/@tanstack/query-core/build/legacy/queryClient.js +++ /dev/null @@ -1,324 +0,0 @@ -import { - __privateAdd, - __privateGet, - __privateSet, - __privateWrapper -} from "./chunk-PXG64RU4.js"; - -// src/queryClient.ts -import { - functionalUpdate, - hashKey, - hashQueryKeyByOptions, - noop, - partialMatchKey, - resolveStaleTime, - skipToken -} from "./utils.js"; -import { QueryCache } from "./queryCache.js"; -import { MutationCache } from "./mutationCache.js"; -import { focusManager } from "./focusManager.js"; -import { onlineManager } from "./onlineManager.js"; -import { notifyManager } from "./notifyManager.js"; -import { infiniteQueryBehavior } from "./infiniteQueryBehavior.js"; -var _queryCache, _mutationCache, _defaultOptions, _queryDefaults, _mutationDefaults, _mountCount, _unsubscribeFocus, _unsubscribeOnline; -var QueryClient = class { - constructor(config = {}) { - __privateAdd(this, _queryCache); - __privateAdd(this, _mutationCache); - __privateAdd(this, _defaultOptions); - __privateAdd(this, _queryDefaults); - __privateAdd(this, _mutationDefaults); - __privateAdd(this, _mountCount); - __privateAdd(this, _unsubscribeFocus); - __privateAdd(this, _unsubscribeOnline); - __privateSet(this, _queryCache, config.queryCache || new QueryCache()); - __privateSet(this, _mutationCache, config.mutationCache || new MutationCache()); - __privateSet(this, _defaultOptions, config.defaultOptions || {}); - __privateSet(this, _queryDefaults, /* @__PURE__ */ new Map()); - __privateSet(this, _mutationDefaults, /* @__PURE__ */ new Map()); - __privateSet(this, _mountCount, 0); - } - mount() { - __privateWrapper(this, _mountCount)._++; - if (__privateGet(this, _mountCount) !== 1) return; - __privateSet(this, _unsubscribeFocus, focusManager.subscribe(async (focused) => { - if (focused) { - await this.resumePausedMutations(); - __privateGet(this, _queryCache).onFocus(); - } - })); - __privateSet(this, _unsubscribeOnline, onlineManager.subscribe(async (online) => { - if (online) { - await this.resumePausedMutations(); - __privateGet(this, _queryCache).onOnline(); - } - })); - } - unmount() { - var _a, _b; - __privateWrapper(this, _mountCount)._--; - if (__privateGet(this, _mountCount) !== 0) return; - (_a = __privateGet(this, _unsubscribeFocus)) == null ? void 0 : _a.call(this); - __privateSet(this, _unsubscribeFocus, void 0); - (_b = __privateGet(this, _unsubscribeOnline)) == null ? void 0 : _b.call(this); - __privateSet(this, _unsubscribeOnline, void 0); - } - isFetching(filters) { - return __privateGet(this, _queryCache).findAll({ ...filters, fetchStatus: "fetching" }).length; - } - isMutating(filters) { - return __privateGet(this, _mutationCache).findAll({ ...filters, status: "pending" }).length; - } - /** - * Imperative (non-reactive) way to retrieve data for a QueryKey. - * Should only be used in callbacks or functions where reading the latest data is necessary, e.g. for optimistic updates. - * - * Hint: Do not use this function inside a component, because it won't receive updates. - * Use `useQuery` to create a `QueryObserver` that subscribes to changes. - */ - getQueryData(queryKey) { - var _a; - const options = this.defaultQueryOptions({ queryKey }); - return (_a = __privateGet(this, _queryCache).get(options.queryHash)) == null ? void 0 : _a.state.data; - } - ensureQueryData(options) { - const defaultedOptions = this.defaultQueryOptions(options); - const query = __privateGet(this, _queryCache).build(this, defaultedOptions); - const cachedData = query.state.data; - if (cachedData === void 0) { - return this.fetchQuery(options); - } - if (options.revalidateIfStale && query.isStaleByTime(resolveStaleTime(defaultedOptions.staleTime, query))) { - void this.prefetchQuery(defaultedOptions); - } - return Promise.resolve(cachedData); - } - getQueriesData(filters) { - return __privateGet(this, _queryCache).findAll(filters).map(({ queryKey, state }) => { - const data = state.data; - return [queryKey, data]; - }); - } - setQueryData(queryKey, updater, options) { - const defaultedOptions = this.defaultQueryOptions({ queryKey }); - const query = __privateGet(this, _queryCache).get( - defaultedOptions.queryHash - ); - const prevData = query == null ? void 0 : query.state.data; - const data = functionalUpdate(updater, prevData); - if (data === void 0) { - return void 0; - } - return __privateGet(this, _queryCache).build(this, defaultedOptions).setData(data, { ...options, manual: true }); - } - setQueriesData(filters, updater, options) { - return notifyManager.batch( - () => __privateGet(this, _queryCache).findAll(filters).map(({ queryKey }) => [ - queryKey, - this.setQueryData(queryKey, updater, options) - ]) - ); - } - getQueryState(queryKey) { - var _a; - const options = this.defaultQueryOptions({ queryKey }); - return (_a = __privateGet(this, _queryCache).get( - options.queryHash - )) == null ? void 0 : _a.state; - } - removeQueries(filters) { - const queryCache = __privateGet(this, _queryCache); - notifyManager.batch(() => { - queryCache.findAll(filters).forEach((query) => { - queryCache.remove(query); - }); - }); - } - resetQueries(filters, options) { - const queryCache = __privateGet(this, _queryCache); - return notifyManager.batch(() => { - queryCache.findAll(filters).forEach((query) => { - query.reset(); - }); - return this.refetchQueries( - { - type: "active", - ...filters - }, - options - ); - }); - } - cancelQueries(filters, cancelOptions = {}) { - const defaultedCancelOptions = { revert: true, ...cancelOptions }; - const promises = notifyManager.batch( - () => __privateGet(this, _queryCache).findAll(filters).map((query) => query.cancel(defaultedCancelOptions)) - ); - return Promise.all(promises).then(noop).catch(noop); - } - invalidateQueries(filters, options = {}) { - return notifyManager.batch(() => { - __privateGet(this, _queryCache).findAll(filters).forEach((query) => { - query.invalidate(); - }); - if ((filters == null ? void 0 : filters.refetchType) === "none") { - return Promise.resolve(); - } - return this.refetchQueries( - { - ...filters, - type: (filters == null ? void 0 : filters.refetchType) ?? (filters == null ? void 0 : filters.type) ?? "active" - }, - options - ); - }); - } - refetchQueries(filters, options = {}) { - const fetchOptions = { - ...options, - cancelRefetch: options.cancelRefetch ?? true - }; - const promises = notifyManager.batch( - () => __privateGet(this, _queryCache).findAll(filters).filter((query) => !query.isDisabled() && !query.isStatic()).map((query) => { - let promise = query.fetch(void 0, fetchOptions); - if (!fetchOptions.throwOnError) { - promise = promise.catch(noop); - } - return query.state.fetchStatus === "paused" ? Promise.resolve() : promise; - }) - ); - return Promise.all(promises).then(noop); - } - fetchQuery(options) { - const defaultedOptions = this.defaultQueryOptions(options); - if (defaultedOptions.retry === void 0) { - defaultedOptions.retry = false; - } - const query = __privateGet(this, _queryCache).build(this, defaultedOptions); - return query.isStaleByTime( - resolveStaleTime(defaultedOptions.staleTime, query) - ) ? query.fetch(defaultedOptions) : Promise.resolve(query.state.data); - } - prefetchQuery(options) { - return this.fetchQuery(options).then(noop).catch(noop); - } - fetchInfiniteQuery(options) { - options.behavior = infiniteQueryBehavior(options.pages); - return this.fetchQuery(options); - } - prefetchInfiniteQuery(options) { - return this.fetchInfiniteQuery(options).then(noop).catch(noop); - } - ensureInfiniteQueryData(options) { - options.behavior = infiniteQueryBehavior(options.pages); - return this.ensureQueryData(options); - } - resumePausedMutations() { - if (onlineManager.isOnline()) { - return __privateGet(this, _mutationCache).resumePausedMutations(); - } - return Promise.resolve(); - } - getQueryCache() { - return __privateGet(this, _queryCache); - } - getMutationCache() { - return __privateGet(this, _mutationCache); - } - getDefaultOptions() { - return __privateGet(this, _defaultOptions); - } - setDefaultOptions(options) { - __privateSet(this, _defaultOptions, options); - } - setQueryDefaults(queryKey, options) { - __privateGet(this, _queryDefaults).set(hashKey(queryKey), { - queryKey, - defaultOptions: options - }); - } - getQueryDefaults(queryKey) { - const defaults = [...__privateGet(this, _queryDefaults).values()]; - const result = {}; - defaults.forEach((queryDefault) => { - if (partialMatchKey(queryKey, queryDefault.queryKey)) { - Object.assign(result, queryDefault.defaultOptions); - } - }); - return result; - } - setMutationDefaults(mutationKey, options) { - __privateGet(this, _mutationDefaults).set(hashKey(mutationKey), { - mutationKey, - defaultOptions: options - }); - } - getMutationDefaults(mutationKey) { - const defaults = [...__privateGet(this, _mutationDefaults).values()]; - const result = {}; - defaults.forEach((queryDefault) => { - if (partialMatchKey(mutationKey, queryDefault.mutationKey)) { - Object.assign(result, queryDefault.defaultOptions); - } - }); - return result; - } - defaultQueryOptions(options) { - if (options._defaulted) { - return options; - } - const defaultedOptions = { - ...__privateGet(this, _defaultOptions).queries, - ...this.getQueryDefaults(options.queryKey), - ...options, - _defaulted: true - }; - if (!defaultedOptions.queryHash) { - defaultedOptions.queryHash = hashQueryKeyByOptions( - defaultedOptions.queryKey, - defaultedOptions - ); - } - if (defaultedOptions.refetchOnReconnect === void 0) { - defaultedOptions.refetchOnReconnect = defaultedOptions.networkMode !== "always"; - } - if (defaultedOptions.throwOnError === void 0) { - defaultedOptions.throwOnError = !!defaultedOptions.suspense; - } - if (!defaultedOptions.networkMode && defaultedOptions.persister) { - defaultedOptions.networkMode = "offlineFirst"; - } - if (defaultedOptions.queryFn === skipToken) { - defaultedOptions.enabled = false; - } - return defaultedOptions; - } - defaultMutationOptions(options) { - if (options == null ? void 0 : options._defaulted) { - return options; - } - return { - ...__privateGet(this, _defaultOptions).mutations, - ...(options == null ? void 0 : options.mutationKey) && this.getMutationDefaults(options.mutationKey), - ...options, - _defaulted: true - }; - } - clear() { - __privateGet(this, _queryCache).clear(); - __privateGet(this, _mutationCache).clear(); - } -}; -_queryCache = new WeakMap(); -_mutationCache = new WeakMap(); -_defaultOptions = new WeakMap(); -_queryDefaults = new WeakMap(); -_mutationDefaults = new WeakMap(); -_mountCount = new WeakMap(); -_unsubscribeFocus = new WeakMap(); -_unsubscribeOnline = new WeakMap(); -export { - QueryClient -}; -//# sourceMappingURL=queryClient.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/queryClient.js.map b/node_modules/@tanstack/query-core/build/legacy/queryClient.js.map deleted file mode 100644 index d72ccf5..0000000 --- a/node_modules/@tanstack/query-core/build/legacy/queryClient.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/queryClient.ts"],"sourcesContent":["import {\n functionalUpdate,\n hashKey,\n hashQueryKeyByOptions,\n noop,\n partialMatchKey,\n resolveStaleTime,\n skipToken,\n} from './utils'\nimport { QueryCache } from './queryCache'\nimport { MutationCache } from './mutationCache'\nimport { focusManager } from './focusManager'\nimport { onlineManager } from './onlineManager'\nimport { notifyManager } from './notifyManager'\nimport { infiniteQueryBehavior } from './infiniteQueryBehavior'\nimport type {\n CancelOptions,\n DefaultError,\n DefaultOptions,\n DefaultedQueryObserverOptions,\n EnsureInfiniteQueryDataOptions,\n EnsureQueryDataOptions,\n FetchInfiniteQueryOptions,\n FetchQueryOptions,\n InferDataFromTag,\n InferErrorFromTag,\n InfiniteData,\n InvalidateOptions,\n InvalidateQueryFilters,\n MutationKey,\n MutationObserverOptions,\n MutationOptions,\n NoInfer,\n OmitKeyof,\n QueryClientConfig,\n QueryKey,\n QueryObserverOptions,\n QueryOptions,\n RefetchOptions,\n RefetchQueryFilters,\n ResetOptions,\n SetDataOptions,\n} from './types'\nimport type { QueryState } from './query'\nimport type { MutationFilters, QueryFilters, Updater } from './utils'\n\n// TYPES\n\ninterface QueryDefaults {\n queryKey: QueryKey\n defaultOptions: OmitKeyof, 'queryKey'>\n}\n\ninterface MutationDefaults {\n mutationKey: MutationKey\n defaultOptions: MutationOptions\n}\n\n// CLASS\n\nexport class QueryClient {\n #queryCache: QueryCache\n #mutationCache: MutationCache\n #defaultOptions: DefaultOptions\n #queryDefaults: Map\n #mutationDefaults: Map\n #mountCount: number\n #unsubscribeFocus?: () => void\n #unsubscribeOnline?: () => void\n\n constructor(config: QueryClientConfig = {}) {\n this.#queryCache = config.queryCache || new QueryCache()\n this.#mutationCache = config.mutationCache || new MutationCache()\n this.#defaultOptions = config.defaultOptions || {}\n this.#queryDefaults = new Map()\n this.#mutationDefaults = new Map()\n this.#mountCount = 0\n }\n\n mount(): void {\n this.#mountCount++\n if (this.#mountCount !== 1) return\n\n this.#unsubscribeFocus = focusManager.subscribe(async (focused) => {\n if (focused) {\n await this.resumePausedMutations()\n this.#queryCache.onFocus()\n }\n })\n this.#unsubscribeOnline = onlineManager.subscribe(async (online) => {\n if (online) {\n await this.resumePausedMutations()\n this.#queryCache.onOnline()\n }\n })\n }\n\n unmount(): void {\n this.#mountCount--\n if (this.#mountCount !== 0) return\n\n this.#unsubscribeFocus?.()\n this.#unsubscribeFocus = undefined\n\n this.#unsubscribeOnline?.()\n this.#unsubscribeOnline = undefined\n }\n\n isFetching = QueryFilters>(\n filters?: TQueryFilters,\n ): number {\n return this.#queryCache.findAll({ ...filters, fetchStatus: 'fetching' })\n .length\n }\n\n isMutating<\n TMutationFilters extends MutationFilters = MutationFilters,\n >(filters?: TMutationFilters): number {\n return this.#mutationCache.findAll({ ...filters, status: 'pending' }).length\n }\n\n /**\n * Imperative (non-reactive) way to retrieve data for a QueryKey.\n * Should only be used in callbacks or functions where reading the latest data is necessary, e.g. for optimistic updates.\n *\n * Hint: Do not use this function inside a component, because it won't receive updates.\n * Use `useQuery` to create a `QueryObserver` that subscribes to changes.\n */\n getQueryData<\n TQueryFnData = unknown,\n TTaggedQueryKey extends QueryKey = QueryKey,\n TInferredQueryFnData = InferDataFromTag,\n >(queryKey: TTaggedQueryKey): TInferredQueryFnData | undefined {\n const options = this.defaultQueryOptions({ queryKey })\n\n return this.#queryCache.get(options.queryHash)?.state\n .data\n }\n\n ensureQueryData<\n TQueryFnData,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n >(\n options: EnsureQueryDataOptions,\n ): Promise {\n const defaultedOptions = this.defaultQueryOptions(options)\n const query = this.#queryCache.build(this, defaultedOptions)\n const cachedData = query.state.data\n\n if (cachedData === undefined) {\n return this.fetchQuery(options)\n }\n\n if (\n options.revalidateIfStale &&\n query.isStaleByTime(resolveStaleTime(defaultedOptions.staleTime, query))\n ) {\n void this.prefetchQuery(defaultedOptions)\n }\n\n return Promise.resolve(cachedData)\n }\n\n getQueriesData<\n TQueryFnData = unknown,\n TQueryFilters extends QueryFilters = QueryFilters,\n >(filters: TQueryFilters): Array<[QueryKey, TQueryFnData | undefined]> {\n return this.#queryCache.findAll(filters).map(({ queryKey, state }) => {\n const data = state.data as TQueryFnData | undefined\n return [queryKey, data]\n })\n }\n\n setQueryData<\n TQueryFnData = unknown,\n TTaggedQueryKey extends QueryKey = QueryKey,\n TInferredQueryFnData = InferDataFromTag,\n >(\n queryKey: TTaggedQueryKey,\n updater: Updater<\n NoInfer | undefined,\n NoInfer | undefined\n >,\n options?: SetDataOptions,\n ): NoInfer | undefined {\n const defaultedOptions = this.defaultQueryOptions<\n any,\n any,\n unknown,\n any,\n QueryKey\n >({ queryKey })\n\n const query = this.#queryCache.get(\n defaultedOptions.queryHash,\n )\n const prevData = query?.state.data\n const data = functionalUpdate(updater, prevData)\n\n if (data === undefined) {\n return undefined\n }\n\n return this.#queryCache\n .build(this, defaultedOptions)\n .setData(data, { ...options, manual: true })\n }\n\n setQueriesData<\n TQueryFnData,\n TQueryFilters extends QueryFilters = QueryFilters,\n >(\n filters: TQueryFilters,\n updater: Updater<\n NoInfer | undefined,\n NoInfer | undefined\n >,\n options?: SetDataOptions,\n ): Array<[QueryKey, TQueryFnData | undefined]> {\n return notifyManager.batch(() =>\n this.#queryCache\n .findAll(filters)\n .map(({ queryKey }) => [\n queryKey,\n this.setQueryData(queryKey, updater, options),\n ]),\n )\n }\n\n getQueryState<\n TQueryFnData = unknown,\n TError = DefaultError,\n TTaggedQueryKey extends QueryKey = QueryKey,\n TInferredQueryFnData = InferDataFromTag,\n TInferredError = InferErrorFromTag,\n >(\n queryKey: TTaggedQueryKey,\n ): QueryState | undefined {\n const options = this.defaultQueryOptions({ queryKey })\n return this.#queryCache.get(\n options.queryHash,\n )?.state\n }\n\n removeQueries(\n filters?: QueryFilters,\n ): void {\n const queryCache = this.#queryCache\n notifyManager.batch(() => {\n queryCache.findAll(filters).forEach((query) => {\n queryCache.remove(query)\n })\n })\n }\n\n resetQueries(\n filters?: QueryFilters,\n options?: ResetOptions,\n ): Promise {\n const queryCache = this.#queryCache\n\n return notifyManager.batch(() => {\n queryCache.findAll(filters).forEach((query) => {\n query.reset()\n })\n return this.refetchQueries(\n {\n type: 'active',\n ...filters,\n },\n options,\n )\n })\n }\n\n cancelQueries(\n filters?: QueryFilters,\n cancelOptions: CancelOptions = {},\n ): Promise {\n const defaultedCancelOptions = { revert: true, ...cancelOptions }\n\n const promises = notifyManager.batch(() =>\n this.#queryCache\n .findAll(filters)\n .map((query) => query.cancel(defaultedCancelOptions)),\n )\n\n return Promise.all(promises).then(noop).catch(noop)\n }\n\n invalidateQueries(\n filters?: InvalidateQueryFilters,\n options: InvalidateOptions = {},\n ): Promise {\n return notifyManager.batch(() => {\n this.#queryCache.findAll(filters).forEach((query) => {\n query.invalidate()\n })\n\n if (filters?.refetchType === 'none') {\n return Promise.resolve()\n }\n return this.refetchQueries(\n {\n ...filters,\n type: filters?.refetchType ?? filters?.type ?? 'active',\n },\n options,\n )\n })\n }\n\n refetchQueries(\n filters?: RefetchQueryFilters,\n options: RefetchOptions = {},\n ): Promise {\n const fetchOptions = {\n ...options,\n cancelRefetch: options.cancelRefetch ?? true,\n }\n const promises = notifyManager.batch(() =>\n this.#queryCache\n .findAll(filters)\n .filter((query) => !query.isDisabled() && !query.isStatic())\n .map((query) => {\n let promise = query.fetch(undefined, fetchOptions)\n if (!fetchOptions.throwOnError) {\n promise = promise.catch(noop)\n }\n return query.state.fetchStatus === 'paused'\n ? Promise.resolve()\n : promise\n }),\n )\n\n return Promise.all(promises).then(noop)\n }\n\n fetchQuery<\n TQueryFnData,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = never,\n >(\n options: FetchQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n ): Promise {\n const defaultedOptions = this.defaultQueryOptions(options)\n\n // https://github.com/tannerlinsley/react-query/issues/652\n if (defaultedOptions.retry === undefined) {\n defaultedOptions.retry = false\n }\n\n const query = this.#queryCache.build(this, defaultedOptions)\n\n return query.isStaleByTime(\n resolveStaleTime(defaultedOptions.staleTime, query),\n )\n ? query.fetch(defaultedOptions)\n : Promise.resolve(query.state.data as TData)\n }\n\n prefetchQuery<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n >(\n options: FetchQueryOptions,\n ): Promise {\n return this.fetchQuery(options).then(noop).catch(noop)\n }\n\n fetchInfiniteQuery<\n TQueryFnData,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n >(\n options: FetchInfiniteQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n ): Promise> {\n options.behavior = infiniteQueryBehavior<\n TQueryFnData,\n TError,\n TData,\n TPageParam\n >(options.pages)\n return this.fetchQuery(options as any)\n }\n\n prefetchInfiniteQuery<\n TQueryFnData,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n >(\n options: FetchInfiniteQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n ): Promise {\n return this.fetchInfiniteQuery(options).then(noop).catch(noop)\n }\n\n ensureInfiniteQueryData<\n TQueryFnData,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n >(\n options: EnsureInfiniteQueryDataOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n ): Promise> {\n options.behavior = infiniteQueryBehavior<\n TQueryFnData,\n TError,\n TData,\n TPageParam\n >(options.pages)\n\n return this.ensureQueryData(options as any)\n }\n\n resumePausedMutations(): Promise {\n if (onlineManager.isOnline()) {\n return this.#mutationCache.resumePausedMutations()\n }\n return Promise.resolve()\n }\n\n getQueryCache(): QueryCache {\n return this.#queryCache\n }\n\n getMutationCache(): MutationCache {\n return this.#mutationCache\n }\n\n getDefaultOptions(): DefaultOptions {\n return this.#defaultOptions\n }\n\n setDefaultOptions(options: DefaultOptions): void {\n this.#defaultOptions = options\n }\n\n setQueryDefaults<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryData = TQueryFnData,\n >(\n queryKey: QueryKey,\n options: Partial<\n OmitKeyof<\n QueryObserverOptions,\n 'queryKey'\n >\n >,\n ): void {\n this.#queryDefaults.set(hashKey(queryKey), {\n queryKey,\n defaultOptions: options,\n })\n }\n\n getQueryDefaults(\n queryKey: QueryKey,\n ): OmitKeyof, 'queryKey'> {\n const defaults = [...this.#queryDefaults.values()]\n\n const result: OmitKeyof<\n QueryObserverOptions,\n 'queryKey'\n > = {}\n\n defaults.forEach((queryDefault) => {\n if (partialMatchKey(queryKey, queryDefault.queryKey)) {\n Object.assign(result, queryDefault.defaultOptions)\n }\n })\n return result\n }\n\n setMutationDefaults<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n >(\n mutationKey: MutationKey,\n options: OmitKeyof<\n MutationObserverOptions,\n 'mutationKey'\n >,\n ): void {\n this.#mutationDefaults.set(hashKey(mutationKey), {\n mutationKey,\n defaultOptions: options,\n })\n }\n\n getMutationDefaults(\n mutationKey: MutationKey,\n ): OmitKeyof, 'mutationKey'> {\n const defaults = [...this.#mutationDefaults.values()]\n\n const result: OmitKeyof<\n MutationObserverOptions,\n 'mutationKey'\n > = {}\n\n defaults.forEach((queryDefault) => {\n if (partialMatchKey(mutationKey, queryDefault.mutationKey)) {\n Object.assign(result, queryDefault.defaultOptions)\n }\n })\n\n return result\n }\n\n defaultQueryOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = never,\n >(\n options:\n | QueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey,\n TPageParam\n >\n | DefaultedQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >,\n ): DefaultedQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n > {\n if (options._defaulted) {\n return options as DefaultedQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >\n }\n\n const defaultedOptions = {\n ...this.#defaultOptions.queries,\n ...this.getQueryDefaults(options.queryKey),\n ...options,\n _defaulted: true,\n }\n\n if (!defaultedOptions.queryHash) {\n defaultedOptions.queryHash = hashQueryKeyByOptions(\n defaultedOptions.queryKey,\n defaultedOptions,\n )\n }\n\n // dependent default values\n if (defaultedOptions.refetchOnReconnect === undefined) {\n defaultedOptions.refetchOnReconnect =\n defaultedOptions.networkMode !== 'always'\n }\n if (defaultedOptions.throwOnError === undefined) {\n defaultedOptions.throwOnError = !!defaultedOptions.suspense\n }\n\n if (!defaultedOptions.networkMode && defaultedOptions.persister) {\n defaultedOptions.networkMode = 'offlineFirst'\n }\n\n if (defaultedOptions.queryFn === skipToken) {\n defaultedOptions.enabled = false\n }\n\n return defaultedOptions as DefaultedQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >\n }\n\n defaultMutationOptions>(\n options?: T,\n ): T {\n if (options?._defaulted) {\n return options\n }\n return {\n ...this.#defaultOptions.mutations,\n ...(options?.mutationKey &&\n this.getMutationDefaults(options.mutationKey)),\n ...options,\n _defaulted: true,\n } as T\n }\n\n clear(): void {\n this.#queryCache.clear()\n this.#mutationCache.clear()\n }\n}\n"],"mappings":";;;;;;;;AAAA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,kBAAkB;AAC3B,SAAS,qBAAqB;AAC9B,SAAS,oBAAoB;AAC7B,SAAS,qBAAqB;AAC9B,SAAS,qBAAqB;AAC9B,SAAS,6BAA6B;AAdtC;AA4DO,IAAM,cAAN,MAAkB;AAAA,EAUvB,YAAY,SAA4B,CAAC,GAAG;AAT5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGE,uBAAK,aAAc,OAAO,cAAc,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;AAAA,IACF,CAAC;AAED,WAAO;AAAA,EACT;AAAA,EAEA,oBAQE,SAsBA;AACA,QAAI,QAAQ,YAAY;AACtB,aAAO;AAAA,IAOT;AAEA,UAAM,mBAAmB;AAAA,MACvB,GAAG,mBAAK,iBAAgB;AAAA,MACxB,GAAG,KAAK,iBAAiB,QAAQ,QAAQ;AAAA,MACzC,GAAG;AAAA,MACH,YAAY;AAAA,IACd;AAEA,QAAI,CAAC,iBAAiB,WAAW;AAC/B,uBAAiB,YAAY;AAAA,QAC3B,iBAAiB;AAAA,QACjB;AAAA,MACF;AAAA,IACF;AAGA,QAAI,iBAAiB,uBAAuB,QAAW;AACrD,uBAAiB,qBACf,iBAAiB,gBAAgB;AAAA,IACrC;AACA,QAAI,iBAAiB,iBAAiB,QAAW;AAC/C,uBAAiB,eAAe,CAAC,CAAC,iBAAiB;AAAA,IACrD;AAEA,QAAI,CAAC,iBAAiB,eAAe,iBAAiB,WAAW;AAC/D,uBAAiB,cAAc;AAAA,IACjC;AAEA,QAAI,iBAAiB,YAAY,WAAW;AAC1C,uBAAiB,UAAU;AAAA,IAC7B;AAEA,WAAO;AAAA,EAOT;AAAA,EAEA,uBACE,SACG;AACH,QAAI,mCAAS,YAAY;AACvB,aAAO;AAAA,IACT;AACA,WAAO;AAAA,MACL,GAAG,mBAAK,iBAAgB;AAAA,MACxB,IAAI,mCAAS,gBACX,KAAK,oBAAoB,QAAQ,WAAW;AAAA,MAC9C,GAAG;AAAA,MACH,YAAY;AAAA,IACd;AAAA,EACF;AAAA,EAEA,QAAc;AACZ,uBAAK,aAAY,MAAM;AACvB,uBAAK,gBAAe,MAAM;AAAA,EAC5B;AACF;AA1kBE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/queryObserver.cjs b/node_modules/@tanstack/query-core/build/legacy/queryObserver.cjs deleted file mode 100644 index ac652b7..0000000 --- a/node_modules/@tanstack/query-core/build/legacy/queryObserver.cjs +++ /dev/null @@ -1,515 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __typeError = (msg) => { - throw TypeError(msg); -}; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg); -var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj)); -var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value); -var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value); -var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method); - -// src/queryObserver.ts -var queryObserver_exports = {}; -__export(queryObserver_exports, { - QueryObserver: () => QueryObserver -}); -module.exports = __toCommonJS(queryObserver_exports); -var import_focusManager = require("./focusManager.cjs"); -var import_notifyManager = require("./notifyManager.cjs"); -var import_query = require("./query.cjs"); -var import_subscribable = require("./subscribable.cjs"); -var import_thenable = require("./thenable.cjs"); -var import_utils = require("./utils.cjs"); -var import_timeoutManager = require("./timeoutManager.cjs"); -var _client, _currentQuery, _currentQueryInitialState, _currentResult, _currentResultState, _currentResultOptions, _currentThenable, _selectError, _selectFn, _selectResult, _lastQueryWithDefinedData, _staleTimeoutId, _refetchIntervalId, _currentRefetchInterval, _trackedProps, _QueryObserver_instances, executeFetch_fn, updateStaleTimeout_fn, computeRefetchInterval_fn, updateRefetchInterval_fn, updateTimers_fn, clearStaleTimeout_fn, clearRefetchInterval_fn, updateQuery_fn, notify_fn; -var QueryObserver = class extends import_subscribable.Subscribable { - constructor(client, options) { - super(); - this.options = options; - __privateAdd(this, _QueryObserver_instances); - __privateAdd(this, _client); - __privateAdd(this, _currentQuery); - __privateAdd(this, _currentQueryInitialState); - __privateAdd(this, _currentResult); - __privateAdd(this, _currentResultState); - __privateAdd(this, _currentResultOptions); - __privateAdd(this, _currentThenable); - __privateAdd(this, _selectError); - __privateAdd(this, _selectFn); - __privateAdd(this, _selectResult); - // This property keeps track of the last query with defined data. - // It will be used to pass the previous data and query to the placeholder function between renders. - __privateAdd(this, _lastQueryWithDefinedData); - __privateAdd(this, _staleTimeoutId); - __privateAdd(this, _refetchIntervalId); - __privateAdd(this, _currentRefetchInterval); - __privateAdd(this, _trackedProps, /* @__PURE__ */ new Set()); - __privateSet(this, _client, client); - __privateSet(this, _selectError, null); - __privateSet(this, _currentThenable, (0, import_thenable.pendingThenable)()); - this.bindMethods(); - this.setOptions(options); - } - bindMethods() { - this.refetch = this.refetch.bind(this); - } - onSubscribe() { - if (this.listeners.size === 1) { - __privateGet(this, _currentQuery).addObserver(this); - if (shouldFetchOnMount(__privateGet(this, _currentQuery), this.options)) { - __privateMethod(this, _QueryObserver_instances, executeFetch_fn).call(this); - } else { - this.updateResult(); - } - __privateMethod(this, _QueryObserver_instances, updateTimers_fn).call(this); - } - } - onUnsubscribe() { - if (!this.hasListeners()) { - this.destroy(); - } - } - shouldFetchOnReconnect() { - return shouldFetchOn( - __privateGet(this, _currentQuery), - this.options, - this.options.refetchOnReconnect - ); - } - shouldFetchOnWindowFocus() { - return shouldFetchOn( - __privateGet(this, _currentQuery), - this.options, - this.options.refetchOnWindowFocus - ); - } - destroy() { - this.listeners = /* @__PURE__ */ new Set(); - __privateMethod(this, _QueryObserver_instances, clearStaleTimeout_fn).call(this); - __privateMethod(this, _QueryObserver_instances, clearRefetchInterval_fn).call(this); - __privateGet(this, _currentQuery).removeObserver(this); - } - setOptions(options) { - const prevOptions = this.options; - const prevQuery = __privateGet(this, _currentQuery); - this.options = __privateGet(this, _client).defaultQueryOptions(options); - if (this.options.enabled !== void 0 && typeof this.options.enabled !== "boolean" && typeof this.options.enabled !== "function" && typeof (0, import_utils.resolveEnabled)(this.options.enabled, __privateGet(this, _currentQuery)) !== "boolean") { - throw new Error( - "Expected enabled to be a boolean or a callback that returns a boolean" - ); - } - __privateMethod(this, _QueryObserver_instances, updateQuery_fn).call(this); - __privateGet(this, _currentQuery).setOptions(this.options); - if (prevOptions._defaulted && !(0, import_utils.shallowEqualObjects)(this.options, prevOptions)) { - __privateGet(this, _client).getQueryCache().notify({ - type: "observerOptionsUpdated", - query: __privateGet(this, _currentQuery), - observer: this - }); - } - const mounted = this.hasListeners(); - if (mounted && shouldFetchOptionally( - __privateGet(this, _currentQuery), - prevQuery, - this.options, - prevOptions - )) { - __privateMethod(this, _QueryObserver_instances, executeFetch_fn).call(this); - } - this.updateResult(); - if (mounted && (__privateGet(this, _currentQuery) !== prevQuery || (0, import_utils.resolveEnabled)(this.options.enabled, __privateGet(this, _currentQuery)) !== (0, import_utils.resolveEnabled)(prevOptions.enabled, __privateGet(this, _currentQuery)) || (0, import_utils.resolveStaleTime)(this.options.staleTime, __privateGet(this, _currentQuery)) !== (0, import_utils.resolveStaleTime)(prevOptions.staleTime, __privateGet(this, _currentQuery)))) { - __privateMethod(this, _QueryObserver_instances, updateStaleTimeout_fn).call(this); - } - const nextRefetchInterval = __privateMethod(this, _QueryObserver_instances, computeRefetchInterval_fn).call(this); - if (mounted && (__privateGet(this, _currentQuery) !== prevQuery || (0, import_utils.resolveEnabled)(this.options.enabled, __privateGet(this, _currentQuery)) !== (0, import_utils.resolveEnabled)(prevOptions.enabled, __privateGet(this, _currentQuery)) || nextRefetchInterval !== __privateGet(this, _currentRefetchInterval))) { - __privateMethod(this, _QueryObserver_instances, updateRefetchInterval_fn).call(this, nextRefetchInterval); - } - } - getOptimisticResult(options) { - const query = __privateGet(this, _client).getQueryCache().build(__privateGet(this, _client), options); - const result = this.createResult(query, options); - if (shouldAssignObserverCurrentProperties(this, result)) { - __privateSet(this, _currentResult, result); - __privateSet(this, _currentResultOptions, this.options); - __privateSet(this, _currentResultState, __privateGet(this, _currentQuery).state); - } - return result; - } - getCurrentResult() { - return __privateGet(this, _currentResult); - } - trackResult(result, onPropTracked) { - return new Proxy(result, { - get: (target, key) => { - this.trackProp(key); - onPropTracked == null ? void 0 : onPropTracked(key); - if (key === "promise") { - this.trackProp("data"); - if (!this.options.experimental_prefetchInRender && __privateGet(this, _currentThenable).status === "pending") { - __privateGet(this, _currentThenable).reject( - new Error( - "experimental_prefetchInRender feature flag is not enabled" - ) - ); - } - } - return Reflect.get(target, key); - } - }); - } - trackProp(key) { - __privateGet(this, _trackedProps).add(key); - } - getCurrentQuery() { - return __privateGet(this, _currentQuery); - } - refetch({ ...options } = {}) { - return this.fetch({ - ...options - }); - } - fetchOptimistic(options) { - const defaultedOptions = __privateGet(this, _client).defaultQueryOptions(options); - const query = __privateGet(this, _client).getQueryCache().build(__privateGet(this, _client), defaultedOptions); - return query.fetch().then(() => this.createResult(query, defaultedOptions)); - } - fetch(fetchOptions) { - return __privateMethod(this, _QueryObserver_instances, executeFetch_fn).call(this, { - ...fetchOptions, - cancelRefetch: fetchOptions.cancelRefetch ?? true - }).then(() => { - this.updateResult(); - return __privateGet(this, _currentResult); - }); - } - createResult(query, options) { - var _a; - const prevQuery = __privateGet(this, _currentQuery); - const prevOptions = this.options; - const prevResult = __privateGet(this, _currentResult); - const prevResultState = __privateGet(this, _currentResultState); - const prevResultOptions = __privateGet(this, _currentResultOptions); - const queryChange = query !== prevQuery; - const queryInitialState = queryChange ? query.state : __privateGet(this, _currentQueryInitialState); - const { state } = query; - let newState = { ...state }; - let isPlaceholderData = false; - let data; - if (options._optimisticResults) { - const mounted = this.hasListeners(); - const fetchOnMount = !mounted && shouldFetchOnMount(query, options); - const fetchOptionally = mounted && shouldFetchOptionally(query, prevQuery, options, prevOptions); - if (fetchOnMount || fetchOptionally) { - newState = { - ...newState, - ...(0, import_query.fetchState)(state.data, query.options) - }; - } - if (options._optimisticResults === "isRestoring") { - newState.fetchStatus = "idle"; - } - } - let { error, errorUpdatedAt, status } = newState; - data = newState.data; - let skipSelect = false; - if (options.placeholderData !== void 0 && data === void 0 && status === "pending") { - let placeholderData; - if ((prevResult == null ? void 0 : prevResult.isPlaceholderData) && options.placeholderData === (prevResultOptions == null ? void 0 : prevResultOptions.placeholderData)) { - placeholderData = prevResult.data; - skipSelect = true; - } else { - placeholderData = typeof options.placeholderData === "function" ? options.placeholderData( - (_a = __privateGet(this, _lastQueryWithDefinedData)) == null ? void 0 : _a.state.data, - __privateGet(this, _lastQueryWithDefinedData) - ) : options.placeholderData; - } - if (placeholderData !== void 0) { - status = "success"; - data = (0, import_utils.replaceData)( - prevResult == null ? void 0 : prevResult.data, - placeholderData, - options - ); - isPlaceholderData = true; - } - } - if (options.select && data !== void 0 && !skipSelect) { - if (prevResult && data === (prevResultState == null ? void 0 : prevResultState.data) && options.select === __privateGet(this, _selectFn)) { - data = __privateGet(this, _selectResult); - } else { - try { - __privateSet(this, _selectFn, options.select); - data = options.select(data); - data = (0, import_utils.replaceData)(prevResult == null ? void 0 : prevResult.data, data, options); - __privateSet(this, _selectResult, data); - __privateSet(this, _selectError, null); - } catch (selectError) { - __privateSet(this, _selectError, selectError); - } - } - } - if (__privateGet(this, _selectError)) { - error = __privateGet(this, _selectError); - data = __privateGet(this, _selectResult); - errorUpdatedAt = Date.now(); - status = "error"; - } - const isFetching = newState.fetchStatus === "fetching"; - const isPending = status === "pending"; - const isError = status === "error"; - const isLoading = isPending && isFetching; - const hasData = data !== void 0; - const result = { - status, - fetchStatus: newState.fetchStatus, - isPending, - isSuccess: status === "success", - isError, - isInitialLoading: isLoading, - isLoading, - data, - dataUpdatedAt: newState.dataUpdatedAt, - error, - errorUpdatedAt, - failureCount: newState.fetchFailureCount, - failureReason: newState.fetchFailureReason, - errorUpdateCount: newState.errorUpdateCount, - isFetched: newState.dataUpdateCount > 0 || newState.errorUpdateCount > 0, - isFetchedAfterMount: newState.dataUpdateCount > queryInitialState.dataUpdateCount || newState.errorUpdateCount > queryInitialState.errorUpdateCount, - isFetching, - isRefetching: isFetching && !isPending, - isLoadingError: isError && !hasData, - isPaused: newState.fetchStatus === "paused", - isPlaceholderData, - isRefetchError: isError && hasData, - isStale: isStale(query, options), - refetch: this.refetch, - promise: __privateGet(this, _currentThenable), - isEnabled: (0, import_utils.resolveEnabled)(options.enabled, query) !== false - }; - const nextResult = result; - if (this.options.experimental_prefetchInRender) { - const hasResultData = nextResult.data !== void 0; - const isErrorWithoutData = nextResult.status === "error" && !hasResultData; - const finalizeThenableIfPossible = (thenable) => { - if (isErrorWithoutData) { - thenable.reject(nextResult.error); - } else if (hasResultData) { - thenable.resolve(nextResult.data); - } - }; - const recreateThenable = () => { - const pending = __privateSet(this, _currentThenable, nextResult.promise = (0, import_thenable.pendingThenable)()); - finalizeThenableIfPossible(pending); - }; - const prevThenable = __privateGet(this, _currentThenable); - switch (prevThenable.status) { - case "pending": - if (query.queryHash === prevQuery.queryHash) { - finalizeThenableIfPossible(prevThenable); - } - break; - case "fulfilled": - if (isErrorWithoutData || nextResult.data !== prevThenable.value) { - recreateThenable(); - } - break; - case "rejected": - if (!isErrorWithoutData || nextResult.error !== prevThenable.reason) { - recreateThenable(); - } - break; - } - } - return nextResult; - } - updateResult() { - const prevResult = __privateGet(this, _currentResult); - const nextResult = this.createResult(__privateGet(this, _currentQuery), this.options); - __privateSet(this, _currentResultState, __privateGet(this, _currentQuery).state); - __privateSet(this, _currentResultOptions, this.options); - if (__privateGet(this, _currentResultState).data !== void 0) { - __privateSet(this, _lastQueryWithDefinedData, __privateGet(this, _currentQuery)); - } - if ((0, import_utils.shallowEqualObjects)(nextResult, prevResult)) { - return; - } - __privateSet(this, _currentResult, nextResult); - const shouldNotifyListeners = () => { - if (!prevResult) { - return true; - } - const { notifyOnChangeProps } = this.options; - const notifyOnChangePropsValue = typeof notifyOnChangeProps === "function" ? notifyOnChangeProps() : notifyOnChangeProps; - if (notifyOnChangePropsValue === "all" || !notifyOnChangePropsValue && !__privateGet(this, _trackedProps).size) { - return true; - } - const includedProps = new Set( - notifyOnChangePropsValue ?? __privateGet(this, _trackedProps) - ); - if (this.options.throwOnError) { - includedProps.add("error"); - } - return Object.keys(__privateGet(this, _currentResult)).some((key) => { - const typedKey = key; - const changed = __privateGet(this, _currentResult)[typedKey] !== prevResult[typedKey]; - return changed && includedProps.has(typedKey); - }); - }; - __privateMethod(this, _QueryObserver_instances, notify_fn).call(this, { listeners: shouldNotifyListeners() }); - } - onQueryUpdate() { - this.updateResult(); - if (this.hasListeners()) { - __privateMethod(this, _QueryObserver_instances, updateTimers_fn).call(this); - } - } -}; -_client = new WeakMap(); -_currentQuery = new WeakMap(); -_currentQueryInitialState = new WeakMap(); -_currentResult = new WeakMap(); -_currentResultState = new WeakMap(); -_currentResultOptions = new WeakMap(); -_currentThenable = new WeakMap(); -_selectError = new WeakMap(); -_selectFn = new WeakMap(); -_selectResult = new WeakMap(); -_lastQueryWithDefinedData = new WeakMap(); -_staleTimeoutId = new WeakMap(); -_refetchIntervalId = new WeakMap(); -_currentRefetchInterval = new WeakMap(); -_trackedProps = new WeakMap(); -_QueryObserver_instances = new WeakSet(); -executeFetch_fn = function(fetchOptions) { - __privateMethod(this, _QueryObserver_instances, updateQuery_fn).call(this); - let promise = __privateGet(this, _currentQuery).fetch( - this.options, - fetchOptions - ); - if (!(fetchOptions == null ? void 0 : fetchOptions.throwOnError)) { - promise = promise.catch(import_utils.noop); - } - return promise; -}; -updateStaleTimeout_fn = function() { - __privateMethod(this, _QueryObserver_instances, clearStaleTimeout_fn).call(this); - const staleTime = (0, import_utils.resolveStaleTime)( - this.options.staleTime, - __privateGet(this, _currentQuery) - ); - if (import_utils.isServer || __privateGet(this, _currentResult).isStale || !(0, import_utils.isValidTimeout)(staleTime)) { - return; - } - const time = (0, import_utils.timeUntilStale)(__privateGet(this, _currentResult).dataUpdatedAt, staleTime); - const timeout = time + 1; - __privateSet(this, _staleTimeoutId, import_timeoutManager.timeoutManager.setTimeout(() => { - if (!__privateGet(this, _currentResult).isStale) { - this.updateResult(); - } - }, timeout)); -}; -computeRefetchInterval_fn = function() { - return (typeof this.options.refetchInterval === "function" ? this.options.refetchInterval(__privateGet(this, _currentQuery)) : this.options.refetchInterval) ?? false; -}; -updateRefetchInterval_fn = function(nextInterval) { - __privateMethod(this, _QueryObserver_instances, clearRefetchInterval_fn).call(this); - __privateSet(this, _currentRefetchInterval, nextInterval); - if (import_utils.isServer || (0, import_utils.resolveEnabled)(this.options.enabled, __privateGet(this, _currentQuery)) === false || !(0, import_utils.isValidTimeout)(__privateGet(this, _currentRefetchInterval)) || __privateGet(this, _currentRefetchInterval) === 0) { - return; - } - __privateSet(this, _refetchIntervalId, import_timeoutManager.timeoutManager.setInterval(() => { - if (this.options.refetchIntervalInBackground || import_focusManager.focusManager.isFocused()) { - __privateMethod(this, _QueryObserver_instances, executeFetch_fn).call(this); - } - }, __privateGet(this, _currentRefetchInterval))); -}; -updateTimers_fn = function() { - __privateMethod(this, _QueryObserver_instances, updateStaleTimeout_fn).call(this); - __privateMethod(this, _QueryObserver_instances, updateRefetchInterval_fn).call(this, __privateMethod(this, _QueryObserver_instances, computeRefetchInterval_fn).call(this)); -}; -clearStaleTimeout_fn = function() { - if (__privateGet(this, _staleTimeoutId)) { - import_timeoutManager.timeoutManager.clearTimeout(__privateGet(this, _staleTimeoutId)); - __privateSet(this, _staleTimeoutId, void 0); - } -}; -clearRefetchInterval_fn = function() { - if (__privateGet(this, _refetchIntervalId)) { - import_timeoutManager.timeoutManager.clearInterval(__privateGet(this, _refetchIntervalId)); - __privateSet(this, _refetchIntervalId, void 0); - } -}; -updateQuery_fn = function() { - const query = __privateGet(this, _client).getQueryCache().build(__privateGet(this, _client), this.options); - if (query === __privateGet(this, _currentQuery)) { - return; - } - const prevQuery = __privateGet(this, _currentQuery); - __privateSet(this, _currentQuery, query); - __privateSet(this, _currentQueryInitialState, query.state); - if (this.hasListeners()) { - prevQuery == null ? void 0 : prevQuery.removeObserver(this); - query.addObserver(this); - } -}; -notify_fn = function(notifyOptions) { - import_notifyManager.notifyManager.batch(() => { - if (notifyOptions.listeners) { - this.listeners.forEach((listener) => { - listener(__privateGet(this, _currentResult)); - }); - } - __privateGet(this, _client).getQueryCache().notify({ - query: __privateGet(this, _currentQuery), - type: "observerResultsUpdated" - }); - }); -}; -function shouldLoadOnMount(query, options) { - return (0, import_utils.resolveEnabled)(options.enabled, query) !== false && query.state.data === void 0 && !(query.state.status === "error" && options.retryOnMount === false); -} -function shouldFetchOnMount(query, options) { - return shouldLoadOnMount(query, options) || query.state.data !== void 0 && shouldFetchOn(query, options, options.refetchOnMount); -} -function shouldFetchOn(query, options, field) { - if ((0, import_utils.resolveEnabled)(options.enabled, query) !== false && (0, import_utils.resolveStaleTime)(options.staleTime, query) !== "static") { - const value = typeof field === "function" ? field(query) : field; - return value === "always" || value !== false && isStale(query, options); - } - return false; -} -function shouldFetchOptionally(query, prevQuery, options, prevOptions) { - return (query !== prevQuery || (0, import_utils.resolveEnabled)(prevOptions.enabled, query) === false) && (!options.suspense || query.state.status !== "error") && isStale(query, options); -} -function isStale(query, options) { - return (0, import_utils.resolveEnabled)(options.enabled, query) !== false && query.isStaleByTime((0, import_utils.resolveStaleTime)(options.staleTime, query)); -} -function shouldAssignObserverCurrentProperties(observer, optimisticResult) { - if (!(0, import_utils.shallowEqualObjects)(observer.getCurrentResult(), optimisticResult)) { - return true; - } - return false; -} -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - QueryObserver -}); -//# sourceMappingURL=queryObserver.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/queryObserver.cjs.map b/node_modules/@tanstack/query-core/build/legacy/queryObserver.cjs.map deleted file mode 100644 index 3c03c8c..0000000 --- a/node_modules/@tanstack/query-core/build/legacy/queryObserver.cjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/queryObserver.ts"],"sourcesContent":["import { focusManager } from './focusManager'\nimport { notifyManager } from './notifyManager'\nimport { fetchState } from './query'\nimport { Subscribable } from './subscribable'\nimport { pendingThenable } from './thenable'\nimport {\n isServer,\n isValidTimeout,\n noop,\n replaceData,\n resolveEnabled,\n resolveStaleTime,\n shallowEqualObjects,\n timeUntilStale,\n} from './utils'\nimport { timeoutManager } from './timeoutManager'\nimport type { ManagedTimerId } from './timeoutManager'\nimport type { FetchOptions, Query, QueryState } from './query'\nimport type { QueryClient } from './queryClient'\nimport type { PendingThenable, Thenable } from './thenable'\nimport type {\n DefaultError,\n DefaultedQueryObserverOptions,\n PlaceholderDataFunction,\n QueryKey,\n QueryObserverBaseResult,\n QueryObserverOptions,\n QueryObserverResult,\n RefetchOptions,\n} from './types'\n\ntype QueryObserverListener = (\n result: QueryObserverResult,\n) => void\n\ninterface ObserverFetchOptions extends FetchOptions {\n throwOnError?: boolean\n}\n\nexport class QueryObserver<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> extends Subscribable> {\n #client: QueryClient\n #currentQuery: Query = undefined!\n #currentQueryInitialState: QueryState = undefined!\n #currentResult: QueryObserverResult = undefined!\n #currentResultState?: QueryState\n #currentResultOptions?: QueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >\n #currentThenable: Thenable\n #selectError: TError | null\n #selectFn?: (data: TQueryData) => TData\n #selectResult?: TData\n // This property keeps track of the last query with defined data.\n // It will be used to pass the previous data and query to the placeholder function between renders.\n #lastQueryWithDefinedData?: Query\n #staleTimeoutId?: ManagedTimerId\n #refetchIntervalId?: ManagedTimerId\n #currentRefetchInterval?: number | false\n #trackedProps = new Set()\n\n constructor(\n client: QueryClient,\n public options: QueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >,\n ) {\n super()\n\n this.#client = client\n this.#selectError = null\n this.#currentThenable = pendingThenable()\n\n this.bindMethods()\n this.setOptions(options)\n }\n\n protected bindMethods(): void {\n this.refetch = this.refetch.bind(this)\n }\n\n protected onSubscribe(): void {\n if (this.listeners.size === 1) {\n this.#currentQuery.addObserver(this)\n\n if (shouldFetchOnMount(this.#currentQuery, this.options)) {\n this.#executeFetch()\n } else {\n this.updateResult()\n }\n\n this.#updateTimers()\n }\n }\n\n protected onUnsubscribe(): void {\n if (!this.hasListeners()) {\n this.destroy()\n }\n }\n\n shouldFetchOnReconnect(): boolean {\n return shouldFetchOn(\n this.#currentQuery,\n this.options,\n this.options.refetchOnReconnect,\n )\n }\n\n shouldFetchOnWindowFocus(): boolean {\n return shouldFetchOn(\n this.#currentQuery,\n this.options,\n this.options.refetchOnWindowFocus,\n )\n }\n\n destroy(): void {\n this.listeners = new Set()\n this.#clearStaleTimeout()\n this.#clearRefetchInterval()\n this.#currentQuery.removeObserver(this)\n }\n\n setOptions(\n options: QueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >,\n ): void {\n const prevOptions = this.options\n const prevQuery = this.#currentQuery\n\n this.options = this.#client.defaultQueryOptions(options)\n\n if (\n this.options.enabled !== undefined &&\n typeof this.options.enabled !== 'boolean' &&\n typeof this.options.enabled !== 'function' &&\n typeof resolveEnabled(this.options.enabled, this.#currentQuery) !==\n 'boolean'\n ) {\n throw new Error(\n 'Expected enabled to be a boolean or a callback that returns a boolean',\n )\n }\n\n this.#updateQuery()\n this.#currentQuery.setOptions(this.options)\n\n if (\n prevOptions._defaulted &&\n !shallowEqualObjects(this.options, prevOptions)\n ) {\n this.#client.getQueryCache().notify({\n type: 'observerOptionsUpdated',\n query: this.#currentQuery,\n observer: this,\n })\n }\n\n const mounted = this.hasListeners()\n\n // Fetch if there are subscribers\n if (\n mounted &&\n shouldFetchOptionally(\n this.#currentQuery,\n prevQuery,\n this.options,\n prevOptions,\n )\n ) {\n this.#executeFetch()\n }\n\n // Update result\n this.updateResult()\n\n // Update stale interval if needed\n if (\n mounted &&\n (this.#currentQuery !== prevQuery ||\n resolveEnabled(this.options.enabled, this.#currentQuery) !==\n resolveEnabled(prevOptions.enabled, this.#currentQuery) ||\n resolveStaleTime(this.options.staleTime, this.#currentQuery) !==\n resolveStaleTime(prevOptions.staleTime, this.#currentQuery))\n ) {\n this.#updateStaleTimeout()\n }\n\n const nextRefetchInterval = this.#computeRefetchInterval()\n\n // Update refetch interval if needed\n if (\n mounted &&\n (this.#currentQuery !== prevQuery ||\n resolveEnabled(this.options.enabled, this.#currentQuery) !==\n resolveEnabled(prevOptions.enabled, this.#currentQuery) ||\n nextRefetchInterval !== this.#currentRefetchInterval)\n ) {\n this.#updateRefetchInterval(nextRefetchInterval)\n }\n }\n\n getOptimisticResult(\n options: DefaultedQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >,\n ): QueryObserverResult {\n const query = this.#client.getQueryCache().build(this.#client, options)\n\n const result = this.createResult(query, options)\n\n if (shouldAssignObserverCurrentProperties(this, result)) {\n // this assigns the optimistic result to the current Observer\n // because if the query function changes, useQuery will be performing\n // an effect where it would fetch again.\n // When the fetch finishes, we perform a deep data cloning in order\n // to reuse objects references. This deep data clone is performed against\n // the `observer.currentResult.data` property\n // When QueryKey changes, we refresh the query and get new `optimistic`\n // result, while we leave the `observer.currentResult`, so when new data\n // arrives, it finds the old `observer.currentResult` which is related\n // to the old QueryKey. Which means that currentResult and selectData are\n // out of sync already.\n // To solve this, we move the cursor of the currentResult every time\n // an observer reads an optimistic value.\n\n // When keeping the previous data, the result doesn't change until new\n // data arrives.\n this.#currentResult = result\n this.#currentResultOptions = this.options\n this.#currentResultState = this.#currentQuery.state\n }\n return result\n }\n\n getCurrentResult(): QueryObserverResult {\n return this.#currentResult\n }\n\n trackResult(\n result: QueryObserverResult,\n onPropTracked?: (key: keyof QueryObserverResult) => void,\n ): QueryObserverResult {\n return new Proxy(result, {\n get: (target, key) => {\n this.trackProp(key as keyof QueryObserverResult)\n onPropTracked?.(key as keyof QueryObserverResult)\n if (key === 'promise') {\n this.trackProp('data')\n if (\n !this.options.experimental_prefetchInRender &&\n this.#currentThenable.status === 'pending'\n ) {\n this.#currentThenable.reject(\n new Error(\n 'experimental_prefetchInRender feature flag is not enabled',\n ),\n )\n }\n }\n return Reflect.get(target, key)\n },\n })\n }\n\n trackProp(key: keyof QueryObserverResult) {\n this.#trackedProps.add(key)\n }\n\n getCurrentQuery(): Query {\n return this.#currentQuery\n }\n\n refetch({ ...options }: RefetchOptions = {}): Promise<\n QueryObserverResult\n > {\n return this.fetch({\n ...options,\n })\n }\n\n fetchOptimistic(\n options: QueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >,\n ): Promise> {\n const defaultedOptions = this.#client.defaultQueryOptions(options)\n\n const query = this.#client\n .getQueryCache()\n .build(this.#client, defaultedOptions)\n\n return query.fetch().then(() => this.createResult(query, defaultedOptions))\n }\n\n protected fetch(\n fetchOptions: ObserverFetchOptions,\n ): Promise> {\n return this.#executeFetch({\n ...fetchOptions,\n cancelRefetch: fetchOptions.cancelRefetch ?? true,\n }).then(() => {\n this.updateResult()\n return this.#currentResult\n })\n }\n\n #executeFetch(\n fetchOptions?: Omit,\n ): Promise {\n // Make sure we reference the latest query as the current one might have been removed\n this.#updateQuery()\n\n // Fetch\n let promise: Promise = this.#currentQuery.fetch(\n this.options,\n fetchOptions,\n )\n\n if (!fetchOptions?.throwOnError) {\n promise = promise.catch(noop)\n }\n\n return promise\n }\n\n #updateStaleTimeout(): void {\n this.#clearStaleTimeout()\n const staleTime = resolveStaleTime(\n this.options.staleTime,\n this.#currentQuery,\n )\n\n if (isServer || this.#currentResult.isStale || !isValidTimeout(staleTime)) {\n return\n }\n\n const time = timeUntilStale(this.#currentResult.dataUpdatedAt, staleTime)\n\n // The timeout is sometimes triggered 1 ms before the stale time expiration.\n // To mitigate this issue we always add 1 ms to the timeout.\n const timeout = time + 1\n\n this.#staleTimeoutId = timeoutManager.setTimeout(() => {\n if (!this.#currentResult.isStale) {\n this.updateResult()\n }\n }, timeout)\n }\n\n #computeRefetchInterval() {\n return (\n (typeof this.options.refetchInterval === 'function'\n ? this.options.refetchInterval(this.#currentQuery)\n : this.options.refetchInterval) ?? false\n )\n }\n\n #updateRefetchInterval(nextInterval: number | false): void {\n this.#clearRefetchInterval()\n\n this.#currentRefetchInterval = nextInterval\n\n if (\n isServer ||\n resolveEnabled(this.options.enabled, this.#currentQuery) === false ||\n !isValidTimeout(this.#currentRefetchInterval) ||\n this.#currentRefetchInterval === 0\n ) {\n return\n }\n\n this.#refetchIntervalId = timeoutManager.setInterval(() => {\n if (\n this.options.refetchIntervalInBackground ||\n focusManager.isFocused()\n ) {\n this.#executeFetch()\n }\n }, this.#currentRefetchInterval)\n }\n\n #updateTimers(): void {\n this.#updateStaleTimeout()\n this.#updateRefetchInterval(this.#computeRefetchInterval())\n }\n\n #clearStaleTimeout(): void {\n if (this.#staleTimeoutId) {\n timeoutManager.clearTimeout(this.#staleTimeoutId)\n this.#staleTimeoutId = undefined\n }\n }\n\n #clearRefetchInterval(): void {\n if (this.#refetchIntervalId) {\n timeoutManager.clearInterval(this.#refetchIntervalId)\n this.#refetchIntervalId = undefined\n }\n }\n\n protected createResult(\n query: Query,\n options: QueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >,\n ): QueryObserverResult {\n const prevQuery = this.#currentQuery\n const prevOptions = this.options\n const prevResult = this.#currentResult as\n | QueryObserverResult\n | undefined\n const prevResultState = this.#currentResultState\n const prevResultOptions = this.#currentResultOptions\n const queryChange = query !== prevQuery\n const queryInitialState = queryChange\n ? query.state\n : this.#currentQueryInitialState\n\n const { state } = query\n let newState = { ...state }\n let isPlaceholderData = false\n let data: TData | undefined\n\n // Optimistically set result in fetching state if needed\n if (options._optimisticResults) {\n const mounted = this.hasListeners()\n\n const fetchOnMount = !mounted && shouldFetchOnMount(query, options)\n\n const fetchOptionally =\n mounted && shouldFetchOptionally(query, prevQuery, options, prevOptions)\n\n if (fetchOnMount || fetchOptionally) {\n newState = {\n ...newState,\n ...fetchState(state.data, query.options),\n }\n }\n if (options._optimisticResults === 'isRestoring') {\n newState.fetchStatus = 'idle'\n }\n }\n\n let { error, errorUpdatedAt, status } = newState\n\n // Per default, use query data\n data = newState.data as unknown as TData\n let skipSelect = false\n\n // use placeholderData if needed\n if (\n options.placeholderData !== undefined &&\n data === undefined &&\n status === 'pending'\n ) {\n let placeholderData\n\n // Memoize placeholder data\n if (\n prevResult?.isPlaceholderData &&\n options.placeholderData === prevResultOptions?.placeholderData\n ) {\n placeholderData = prevResult.data\n // we have to skip select when reading this memoization\n // because prevResult.data is already \"selected\"\n skipSelect = true\n } else {\n // compute placeholderData\n placeholderData =\n typeof options.placeholderData === 'function'\n ? (\n options.placeholderData as unknown as PlaceholderDataFunction\n )(\n this.#lastQueryWithDefinedData?.state.data,\n this.#lastQueryWithDefinedData as any,\n )\n : options.placeholderData\n }\n\n if (placeholderData !== undefined) {\n status = 'success'\n data = replaceData(\n prevResult?.data,\n placeholderData as unknown,\n options,\n ) as TData\n isPlaceholderData = true\n }\n }\n\n // Select data if needed\n // this also runs placeholderData through the select function\n if (options.select && data !== undefined && !skipSelect) {\n // Memoize select result\n if (\n prevResult &&\n data === prevResultState?.data &&\n options.select === this.#selectFn\n ) {\n data = this.#selectResult\n } else {\n try {\n this.#selectFn = options.select\n data = options.select(data as any)\n data = replaceData(prevResult?.data, data, options)\n this.#selectResult = data\n this.#selectError = null\n } catch (selectError) {\n this.#selectError = selectError as TError\n }\n }\n }\n\n if (this.#selectError) {\n error = this.#selectError\n data = this.#selectResult\n errorUpdatedAt = Date.now()\n status = 'error'\n }\n\n const isFetching = newState.fetchStatus === 'fetching'\n const isPending = status === 'pending'\n const isError = status === 'error'\n\n const isLoading = isPending && isFetching\n const hasData = data !== undefined\n\n const result: QueryObserverBaseResult = {\n status,\n fetchStatus: newState.fetchStatus,\n isPending,\n isSuccess: status === 'success',\n isError,\n isInitialLoading: isLoading,\n isLoading,\n data,\n dataUpdatedAt: newState.dataUpdatedAt,\n error,\n errorUpdatedAt,\n failureCount: newState.fetchFailureCount,\n failureReason: newState.fetchFailureReason,\n errorUpdateCount: newState.errorUpdateCount,\n isFetched: newState.dataUpdateCount > 0 || newState.errorUpdateCount > 0,\n isFetchedAfterMount:\n newState.dataUpdateCount > queryInitialState.dataUpdateCount ||\n newState.errorUpdateCount > queryInitialState.errorUpdateCount,\n isFetching,\n isRefetching: isFetching && !isPending,\n isLoadingError: isError && !hasData,\n isPaused: newState.fetchStatus === 'paused',\n isPlaceholderData,\n isRefetchError: isError && hasData,\n isStale: isStale(query, options),\n refetch: this.refetch,\n promise: this.#currentThenable,\n isEnabled: resolveEnabled(options.enabled, query) !== false,\n }\n\n const nextResult = result as QueryObserverResult\n\n if (this.options.experimental_prefetchInRender) {\n const hasResultData = nextResult.data !== undefined\n const isErrorWithoutData = nextResult.status === 'error' && !hasResultData\n const finalizeThenableIfPossible = (thenable: PendingThenable) => {\n if (isErrorWithoutData) {\n thenable.reject(nextResult.error)\n } else if (hasResultData) {\n thenable.resolve(nextResult.data as TData)\n }\n }\n\n /**\n * Create a new thenable and result promise when the results have changed\n */\n const recreateThenable = () => {\n const pending =\n (this.#currentThenable =\n nextResult.promise =\n pendingThenable())\n\n finalizeThenableIfPossible(pending)\n }\n\n const prevThenable = this.#currentThenable\n switch (prevThenable.status) {\n case 'pending':\n // Finalize the previous thenable if it was pending\n // and we are still observing the same query\n if (query.queryHash === prevQuery.queryHash) {\n finalizeThenableIfPossible(prevThenable)\n }\n break\n case 'fulfilled':\n if (isErrorWithoutData || nextResult.data !== prevThenable.value) {\n recreateThenable()\n }\n break\n case 'rejected':\n if (!isErrorWithoutData || nextResult.error !== prevThenable.reason) {\n recreateThenable()\n }\n break\n }\n }\n\n return nextResult\n }\n\n updateResult(): void {\n const prevResult = this.#currentResult as\n | QueryObserverResult\n | undefined\n\n const nextResult = this.createResult(this.#currentQuery, this.options)\n\n this.#currentResultState = this.#currentQuery.state\n this.#currentResultOptions = this.options\n\n if (this.#currentResultState.data !== undefined) {\n this.#lastQueryWithDefinedData = this.#currentQuery\n }\n\n // Only notify and update result if something has changed\n if (shallowEqualObjects(nextResult, prevResult)) {\n return\n }\n\n this.#currentResult = nextResult\n\n const shouldNotifyListeners = (): boolean => {\n if (!prevResult) {\n return true\n }\n\n const { notifyOnChangeProps } = this.options\n const notifyOnChangePropsValue =\n typeof notifyOnChangeProps === 'function'\n ? notifyOnChangeProps()\n : notifyOnChangeProps\n\n if (\n notifyOnChangePropsValue === 'all' ||\n (!notifyOnChangePropsValue && !this.#trackedProps.size)\n ) {\n return true\n }\n\n const includedProps = new Set(\n notifyOnChangePropsValue ?? this.#trackedProps,\n )\n\n if (this.options.throwOnError) {\n includedProps.add('error')\n }\n\n return Object.keys(this.#currentResult).some((key) => {\n const typedKey = key as keyof QueryObserverResult\n const changed = this.#currentResult[typedKey] !== prevResult[typedKey]\n\n return changed && includedProps.has(typedKey)\n })\n }\n\n this.#notify({ listeners: shouldNotifyListeners() })\n }\n\n #updateQuery(): void {\n const query = this.#client.getQueryCache().build(this.#client, this.options)\n\n if (query === this.#currentQuery) {\n return\n }\n\n const prevQuery = this.#currentQuery as\n | Query\n | undefined\n this.#currentQuery = query\n this.#currentQueryInitialState = query.state\n\n if (this.hasListeners()) {\n prevQuery?.removeObserver(this)\n query.addObserver(this)\n }\n }\n\n onQueryUpdate(): void {\n this.updateResult()\n\n if (this.hasListeners()) {\n this.#updateTimers()\n }\n }\n\n #notify(notifyOptions: { listeners: boolean }): void {\n notifyManager.batch(() => {\n // First, trigger the listeners\n if (notifyOptions.listeners) {\n this.listeners.forEach((listener) => {\n listener(this.#currentResult)\n })\n }\n\n // Then the cache listeners\n this.#client.getQueryCache().notify({\n query: this.#currentQuery,\n type: 'observerResultsUpdated',\n })\n })\n }\n}\n\nfunction shouldLoadOnMount(\n query: Query,\n options: QueryObserverOptions,\n): boolean {\n return (\n resolveEnabled(options.enabled, query) !== false &&\n query.state.data === undefined &&\n !(query.state.status === 'error' && options.retryOnMount === false)\n )\n}\n\nfunction shouldFetchOnMount(\n query: Query,\n options: QueryObserverOptions,\n): boolean {\n return (\n shouldLoadOnMount(query, options) ||\n (query.state.data !== undefined &&\n shouldFetchOn(query, options, options.refetchOnMount))\n )\n}\n\nfunction shouldFetchOn(\n query: Query,\n options: QueryObserverOptions,\n field: (typeof options)['refetchOnMount'] &\n (typeof options)['refetchOnWindowFocus'] &\n (typeof options)['refetchOnReconnect'],\n) {\n if (\n resolveEnabled(options.enabled, query) !== false &&\n resolveStaleTime(options.staleTime, query) !== 'static'\n ) {\n const value = typeof field === 'function' ? field(query) : field\n\n return value === 'always' || (value !== false && isStale(query, options))\n }\n return false\n}\n\nfunction shouldFetchOptionally(\n query: Query,\n prevQuery: Query,\n options: QueryObserverOptions,\n prevOptions: QueryObserverOptions,\n): boolean {\n return (\n (query !== prevQuery ||\n resolveEnabled(prevOptions.enabled, query) === false) &&\n (!options.suspense || query.state.status !== 'error') &&\n isStale(query, options)\n )\n}\n\nfunction isStale(\n query: Query,\n options: QueryObserverOptions,\n): boolean {\n return (\n resolveEnabled(options.enabled, query) !== false &&\n query.isStaleByTime(resolveStaleTime(options.staleTime, query))\n )\n}\n\n// this function would decide if we will update the observer's 'current'\n// properties after an optimistic reading via getOptimisticResult\nfunction shouldAssignObserverCurrentProperties<\n TQueryFnData = unknown,\n TError = unknown,\n TData = TQueryFnData,\n TQueryData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n observer: QueryObserver,\n optimisticResult: QueryObserverResult,\n) {\n // if the newly created result isn't what the observer is holding as current,\n // then we'll need to update the properties as well\n if (!shallowEqualObjects(observer.getCurrentResult(), optimisticResult)) {\n return true\n }\n\n // basically, just keep previous properties if nothing changed\n return false\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,0BAA6B;AAC7B,2BAA8B;AAC9B,mBAA2B;AAC3B,0BAA6B;AAC7B,sBAAgC;AAChC,mBASO;AACP,4BAA+B;AAf/B;AAuCO,IAAM,gBAAN,cAMG,iCAAmD;AAAA,EAyB3D,YACE,QACO,SAOP;AACA,UAAM;AARC;AAjCJ;AAOL;AACA;AACA;AACA;AACA;AACA;AAOA;AACA;AACA;AACA;AAGA;AAAA;AAAA;AACA;AACA;AACA;AACA,sCAAgB,oBAAI,IAA+B;AAcjD,uBAAK,SAAU;AACf,uBAAK,cAAe;AACpB,uBAAK,sBAAmB,iCAAgB;AAExC,SAAK,YAAY;AACjB,SAAK,WAAW,OAAO;AAAA,EACzB;AAAA,EAEU,cAAoB;AAC5B,SAAK,UAAU,KAAK,QAAQ,KAAK,IAAI;AAAA,EACvC;AAAA,EAEU,cAAoB;AAC5B,QAAI,KAAK,UAAU,SAAS,GAAG;AAC7B,yBAAK,eAAc,YAAY,IAAI;AAEnC,UAAI,mBAAmB,mBAAK,gBAAe,KAAK,OAAO,GAAG;AACxD,8BAAK,2CAAL;AAAA,MACF,OAAO;AACL,aAAK,aAAa;AAAA,MACpB;AAEA,4BAAK,2CAAL;AAAA,IACF;AAAA,EACF;AAAA,EAEU,gBAAsB;AAC9B,QAAI,CAAC,KAAK,aAAa,GAAG;AACxB,WAAK,QAAQ;AAAA,IACf;AAAA,EACF;AAAA,EAEA,yBAAkC;AAChC,WAAO;AAAA,MACL,mBAAK;AAAA,MACL,KAAK;AAAA,MACL,KAAK,QAAQ;AAAA,IACf;AAAA,EACF;AAAA,EAEA,2BAAoC;AAClC,WAAO;AAAA,MACL,mBAAK;AAAA,MACL,KAAK;AAAA,MACL,KAAK,QAAQ;AAAA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C;AACA,UAAM,QAAQ,OAAO,UAAU,aAAa,MAAM,KAAK,IAAI;AAE3D,WAAO,UAAU,YAAa,UAAU,SAAS,QAAQ,OAAO,OAAO;AAAA,EACzE;AACA,SAAO;AACT;AAEA,SAAS,sBACP,OACA,WACA,SACA,aACS;AACT,UACG,UAAU,iBACT,6BAAe,YAAY,SAAS,KAAK,MAAM,WAChD,CAAC,QAAQ,YAAY,MAAM,MAAM,WAAW,YAC7C,QAAQ,OAAO,OAAO;AAE1B;AAEA,SAAS,QACP,OACA,SACS;AACT,aACE,6BAAe,QAAQ,SAAS,KAAK,MAAM,SAC3C,MAAM,kBAAc,+BAAiB,QAAQ,WAAW,KAAK,CAAC;AAElE;AAIA,SAAS,sCAOP,UACA,kBACA;AAGA,MAAI,KAAC,kCAAoB,SAAS,iBAAiB,GAAG,gBAAgB,GAAG;AACvE,WAAO;AAAA,EACT;AAGA,SAAO;AACT;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/queryObserver.d.cts b/node_modules/@tanstack/query-core/build/legacy/queryObserver.d.cts deleted file mode 100644 index 36ba2bd..0000000 --- a/node_modules/@tanstack/query-core/build/legacy/queryObserver.d.cts +++ /dev/null @@ -1,3 +0,0 @@ -import './subscribable.cjs'; -export { i as QueryObserver } from './hydration-uphG6M-i.cjs'; -import './removable.cjs'; diff --git a/node_modules/@tanstack/query-core/build/legacy/queryObserver.d.ts b/node_modules/@tanstack/query-core/build/legacy/queryObserver.d.ts deleted file mode 100644 index ae279c2..0000000 --- a/node_modules/@tanstack/query-core/build/legacy/queryObserver.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import './subscribable.js'; -export { i as QueryObserver } from './hydration-BlEVG2Lp.js'; -import './removable.js'; diff --git a/node_modules/@tanstack/query-core/build/legacy/queryObserver.js b/node_modules/@tanstack/query-core/build/legacy/queryObserver.js deleted file mode 100644 index b6a9574..0000000 --- a/node_modules/@tanstack/query-core/build/legacy/queryObserver.js +++ /dev/null @@ -1,498 +0,0 @@ -import { - __privateAdd, - __privateGet, - __privateMethod, - __privateSet -} from "./chunk-PXG64RU4.js"; - -// src/queryObserver.ts -import { focusManager } from "./focusManager.js"; -import { notifyManager } from "./notifyManager.js"; -import { fetchState } from "./query.js"; -import { Subscribable } from "./subscribable.js"; -import { pendingThenable } from "./thenable.js"; -import { - isServer, - isValidTimeout, - noop, - replaceData, - resolveEnabled, - resolveStaleTime, - shallowEqualObjects, - timeUntilStale -} from "./utils.js"; -import { timeoutManager } from "./timeoutManager.js"; -var _client, _currentQuery, _currentQueryInitialState, _currentResult, _currentResultState, _currentResultOptions, _currentThenable, _selectError, _selectFn, _selectResult, _lastQueryWithDefinedData, _staleTimeoutId, _refetchIntervalId, _currentRefetchInterval, _trackedProps, _QueryObserver_instances, executeFetch_fn, updateStaleTimeout_fn, computeRefetchInterval_fn, updateRefetchInterval_fn, updateTimers_fn, clearStaleTimeout_fn, clearRefetchInterval_fn, updateQuery_fn, notify_fn; -var QueryObserver = class extends Subscribable { - constructor(client, options) { - super(); - this.options = options; - __privateAdd(this, _QueryObserver_instances); - __privateAdd(this, _client); - __privateAdd(this, _currentQuery); - __privateAdd(this, _currentQueryInitialState); - __privateAdd(this, _currentResult); - __privateAdd(this, _currentResultState); - __privateAdd(this, _currentResultOptions); - __privateAdd(this, _currentThenable); - __privateAdd(this, _selectError); - __privateAdd(this, _selectFn); - __privateAdd(this, _selectResult); - // This property keeps track of the last query with defined data. - // It will be used to pass the previous data and query to the placeholder function between renders. - __privateAdd(this, _lastQueryWithDefinedData); - __privateAdd(this, _staleTimeoutId); - __privateAdd(this, _refetchIntervalId); - __privateAdd(this, _currentRefetchInterval); - __privateAdd(this, _trackedProps, /* @__PURE__ */ new Set()); - __privateSet(this, _client, client); - __privateSet(this, _selectError, null); - __privateSet(this, _currentThenable, pendingThenable()); - this.bindMethods(); - this.setOptions(options); - } - bindMethods() { - this.refetch = this.refetch.bind(this); - } - onSubscribe() { - if (this.listeners.size === 1) { - __privateGet(this, _currentQuery).addObserver(this); - if (shouldFetchOnMount(__privateGet(this, _currentQuery), this.options)) { - __privateMethod(this, _QueryObserver_instances, executeFetch_fn).call(this); - } else { - this.updateResult(); - } - __privateMethod(this, _QueryObserver_instances, updateTimers_fn).call(this); - } - } - onUnsubscribe() { - if (!this.hasListeners()) { - this.destroy(); - } - } - shouldFetchOnReconnect() { - return shouldFetchOn( - __privateGet(this, _currentQuery), - this.options, - this.options.refetchOnReconnect - ); - } - shouldFetchOnWindowFocus() { - return shouldFetchOn( - __privateGet(this, _currentQuery), - this.options, - this.options.refetchOnWindowFocus - ); - } - destroy() { - this.listeners = /* @__PURE__ */ new Set(); - __privateMethod(this, _QueryObserver_instances, clearStaleTimeout_fn).call(this); - __privateMethod(this, _QueryObserver_instances, clearRefetchInterval_fn).call(this); - __privateGet(this, _currentQuery).removeObserver(this); - } - setOptions(options) { - const prevOptions = this.options; - const prevQuery = __privateGet(this, _currentQuery); - this.options = __privateGet(this, _client).defaultQueryOptions(options); - if (this.options.enabled !== void 0 && typeof this.options.enabled !== "boolean" && typeof this.options.enabled !== "function" && typeof resolveEnabled(this.options.enabled, __privateGet(this, _currentQuery)) !== "boolean") { - throw new Error( - "Expected enabled to be a boolean or a callback that returns a boolean" - ); - } - __privateMethod(this, _QueryObserver_instances, updateQuery_fn).call(this); - __privateGet(this, _currentQuery).setOptions(this.options); - if (prevOptions._defaulted && !shallowEqualObjects(this.options, prevOptions)) { - __privateGet(this, _client).getQueryCache().notify({ - type: "observerOptionsUpdated", - query: __privateGet(this, _currentQuery), - observer: this - }); - } - const mounted = this.hasListeners(); - if (mounted && shouldFetchOptionally( - __privateGet(this, _currentQuery), - prevQuery, - this.options, - prevOptions - )) { - __privateMethod(this, _QueryObserver_instances, executeFetch_fn).call(this); - } - this.updateResult(); - if (mounted && (__privateGet(this, _currentQuery) !== prevQuery || resolveEnabled(this.options.enabled, __privateGet(this, _currentQuery)) !== resolveEnabled(prevOptions.enabled, __privateGet(this, _currentQuery)) || resolveStaleTime(this.options.staleTime, __privateGet(this, _currentQuery)) !== resolveStaleTime(prevOptions.staleTime, __privateGet(this, _currentQuery)))) { - __privateMethod(this, _QueryObserver_instances, updateStaleTimeout_fn).call(this); - } - const nextRefetchInterval = __privateMethod(this, _QueryObserver_instances, computeRefetchInterval_fn).call(this); - if (mounted && (__privateGet(this, _currentQuery) !== prevQuery || resolveEnabled(this.options.enabled, __privateGet(this, _currentQuery)) !== resolveEnabled(prevOptions.enabled, __privateGet(this, _currentQuery)) || nextRefetchInterval !== __privateGet(this, _currentRefetchInterval))) { - __privateMethod(this, _QueryObserver_instances, updateRefetchInterval_fn).call(this, nextRefetchInterval); - } - } - getOptimisticResult(options) { - const query = __privateGet(this, _client).getQueryCache().build(__privateGet(this, _client), options); - const result = this.createResult(query, options); - if (shouldAssignObserverCurrentProperties(this, result)) { - __privateSet(this, _currentResult, result); - __privateSet(this, _currentResultOptions, this.options); - __privateSet(this, _currentResultState, __privateGet(this, _currentQuery).state); - } - return result; - } - getCurrentResult() { - return __privateGet(this, _currentResult); - } - trackResult(result, onPropTracked) { - return new Proxy(result, { - get: (target, key) => { - this.trackProp(key); - onPropTracked == null ? void 0 : onPropTracked(key); - if (key === "promise") { - this.trackProp("data"); - if (!this.options.experimental_prefetchInRender && __privateGet(this, _currentThenable).status === "pending") { - __privateGet(this, _currentThenable).reject( - new Error( - "experimental_prefetchInRender feature flag is not enabled" - ) - ); - } - } - return Reflect.get(target, key); - } - }); - } - trackProp(key) { - __privateGet(this, _trackedProps).add(key); - } - getCurrentQuery() { - return __privateGet(this, _currentQuery); - } - refetch({ ...options } = {}) { - return this.fetch({ - ...options - }); - } - fetchOptimistic(options) { - const defaultedOptions = __privateGet(this, _client).defaultQueryOptions(options); - const query = __privateGet(this, _client).getQueryCache().build(__privateGet(this, _client), defaultedOptions); - return query.fetch().then(() => this.createResult(query, defaultedOptions)); - } - fetch(fetchOptions) { - return __privateMethod(this, _QueryObserver_instances, executeFetch_fn).call(this, { - ...fetchOptions, - cancelRefetch: fetchOptions.cancelRefetch ?? true - }).then(() => { - this.updateResult(); - return __privateGet(this, _currentResult); - }); - } - createResult(query, options) { - var _a; - const prevQuery = __privateGet(this, _currentQuery); - const prevOptions = this.options; - const prevResult = __privateGet(this, _currentResult); - const prevResultState = __privateGet(this, _currentResultState); - const prevResultOptions = __privateGet(this, _currentResultOptions); - const queryChange = query !== prevQuery; - const queryInitialState = queryChange ? query.state : __privateGet(this, _currentQueryInitialState); - const { state } = query; - let newState = { ...state }; - let isPlaceholderData = false; - let data; - if (options._optimisticResults) { - const mounted = this.hasListeners(); - const fetchOnMount = !mounted && shouldFetchOnMount(query, options); - const fetchOptionally = mounted && shouldFetchOptionally(query, prevQuery, options, prevOptions); - if (fetchOnMount || fetchOptionally) { - newState = { - ...newState, - ...fetchState(state.data, query.options) - }; - } - if (options._optimisticResults === "isRestoring") { - newState.fetchStatus = "idle"; - } - } - let { error, errorUpdatedAt, status } = newState; - data = newState.data; - let skipSelect = false; - if (options.placeholderData !== void 0 && data === void 0 && status === "pending") { - let placeholderData; - if ((prevResult == null ? void 0 : prevResult.isPlaceholderData) && options.placeholderData === (prevResultOptions == null ? void 0 : prevResultOptions.placeholderData)) { - placeholderData = prevResult.data; - skipSelect = true; - } else { - placeholderData = typeof options.placeholderData === "function" ? options.placeholderData( - (_a = __privateGet(this, _lastQueryWithDefinedData)) == null ? void 0 : _a.state.data, - __privateGet(this, _lastQueryWithDefinedData) - ) : options.placeholderData; - } - if (placeholderData !== void 0) { - status = "success"; - data = replaceData( - prevResult == null ? void 0 : prevResult.data, - placeholderData, - options - ); - isPlaceholderData = true; - } - } - if (options.select && data !== void 0 && !skipSelect) { - if (prevResult && data === (prevResultState == null ? void 0 : prevResultState.data) && options.select === __privateGet(this, _selectFn)) { - data = __privateGet(this, _selectResult); - } else { - try { - __privateSet(this, _selectFn, options.select); - data = options.select(data); - data = replaceData(prevResult == null ? void 0 : prevResult.data, data, options); - __privateSet(this, _selectResult, data); - __privateSet(this, _selectError, null); - } catch (selectError) { - __privateSet(this, _selectError, selectError); - } - } - } - if (__privateGet(this, _selectError)) { - error = __privateGet(this, _selectError); - data = __privateGet(this, _selectResult); - errorUpdatedAt = Date.now(); - status = "error"; - } - const isFetching = newState.fetchStatus === "fetching"; - const isPending = status === "pending"; - const isError = status === "error"; - const isLoading = isPending && isFetching; - const hasData = data !== void 0; - const result = { - status, - fetchStatus: newState.fetchStatus, - isPending, - isSuccess: status === "success", - isError, - isInitialLoading: isLoading, - isLoading, - data, - dataUpdatedAt: newState.dataUpdatedAt, - error, - errorUpdatedAt, - failureCount: newState.fetchFailureCount, - failureReason: newState.fetchFailureReason, - errorUpdateCount: newState.errorUpdateCount, - isFetched: newState.dataUpdateCount > 0 || newState.errorUpdateCount > 0, - isFetchedAfterMount: newState.dataUpdateCount > queryInitialState.dataUpdateCount || newState.errorUpdateCount > queryInitialState.errorUpdateCount, - isFetching, - isRefetching: isFetching && !isPending, - isLoadingError: isError && !hasData, - isPaused: newState.fetchStatus === "paused", - isPlaceholderData, - isRefetchError: isError && hasData, - isStale: isStale(query, options), - refetch: this.refetch, - promise: __privateGet(this, _currentThenable), - isEnabled: resolveEnabled(options.enabled, query) !== false - }; - const nextResult = result; - if (this.options.experimental_prefetchInRender) { - const hasResultData = nextResult.data !== void 0; - const isErrorWithoutData = nextResult.status === "error" && !hasResultData; - const finalizeThenableIfPossible = (thenable) => { - if (isErrorWithoutData) { - thenable.reject(nextResult.error); - } else if (hasResultData) { - thenable.resolve(nextResult.data); - } - }; - const recreateThenable = () => { - const pending = __privateSet(this, _currentThenable, nextResult.promise = pendingThenable()); - finalizeThenableIfPossible(pending); - }; - const prevThenable = __privateGet(this, _currentThenable); - switch (prevThenable.status) { - case "pending": - if (query.queryHash === prevQuery.queryHash) { - finalizeThenableIfPossible(prevThenable); - } - break; - case "fulfilled": - if (isErrorWithoutData || nextResult.data !== prevThenable.value) { - recreateThenable(); - } - break; - case "rejected": - if (!isErrorWithoutData || nextResult.error !== prevThenable.reason) { - recreateThenable(); - } - break; - } - } - return nextResult; - } - updateResult() { - const prevResult = __privateGet(this, _currentResult); - const nextResult = this.createResult(__privateGet(this, _currentQuery), this.options); - __privateSet(this, _currentResultState, __privateGet(this, _currentQuery).state); - __privateSet(this, _currentResultOptions, this.options); - if (__privateGet(this, _currentResultState).data !== void 0) { - __privateSet(this, _lastQueryWithDefinedData, __privateGet(this, _currentQuery)); - } - if (shallowEqualObjects(nextResult, prevResult)) { - return; - } - __privateSet(this, _currentResult, nextResult); - const shouldNotifyListeners = () => { - if (!prevResult) { - return true; - } - const { notifyOnChangeProps } = this.options; - const notifyOnChangePropsValue = typeof notifyOnChangeProps === "function" ? notifyOnChangeProps() : notifyOnChangeProps; - if (notifyOnChangePropsValue === "all" || !notifyOnChangePropsValue && !__privateGet(this, _trackedProps).size) { - return true; - } - const includedProps = new Set( - notifyOnChangePropsValue ?? __privateGet(this, _trackedProps) - ); - if (this.options.throwOnError) { - includedProps.add("error"); - } - return Object.keys(__privateGet(this, _currentResult)).some((key) => { - const typedKey = key; - const changed = __privateGet(this, _currentResult)[typedKey] !== prevResult[typedKey]; - return changed && includedProps.has(typedKey); - }); - }; - __privateMethod(this, _QueryObserver_instances, notify_fn).call(this, { listeners: shouldNotifyListeners() }); - } - onQueryUpdate() { - this.updateResult(); - if (this.hasListeners()) { - __privateMethod(this, _QueryObserver_instances, updateTimers_fn).call(this); - } - } -}; -_client = new WeakMap(); -_currentQuery = new WeakMap(); -_currentQueryInitialState = new WeakMap(); -_currentResult = new WeakMap(); -_currentResultState = new WeakMap(); -_currentResultOptions = new WeakMap(); -_currentThenable = new WeakMap(); -_selectError = new WeakMap(); -_selectFn = new WeakMap(); -_selectResult = new WeakMap(); -_lastQueryWithDefinedData = new WeakMap(); -_staleTimeoutId = new WeakMap(); -_refetchIntervalId = new WeakMap(); -_currentRefetchInterval = new WeakMap(); -_trackedProps = new WeakMap(); -_QueryObserver_instances = new WeakSet(); -executeFetch_fn = function(fetchOptions) { - __privateMethod(this, _QueryObserver_instances, updateQuery_fn).call(this); - let promise = __privateGet(this, _currentQuery).fetch( - this.options, - fetchOptions - ); - if (!(fetchOptions == null ? void 0 : fetchOptions.throwOnError)) { - promise = promise.catch(noop); - } - return promise; -}; -updateStaleTimeout_fn = function() { - __privateMethod(this, _QueryObserver_instances, clearStaleTimeout_fn).call(this); - const staleTime = resolveStaleTime( - this.options.staleTime, - __privateGet(this, _currentQuery) - ); - if (isServer || __privateGet(this, _currentResult).isStale || !isValidTimeout(staleTime)) { - return; - } - const time = timeUntilStale(__privateGet(this, _currentResult).dataUpdatedAt, staleTime); - const timeout = time + 1; - __privateSet(this, _staleTimeoutId, timeoutManager.setTimeout(() => { - if (!__privateGet(this, _currentResult).isStale) { - this.updateResult(); - } - }, timeout)); -}; -computeRefetchInterval_fn = function() { - return (typeof this.options.refetchInterval === "function" ? this.options.refetchInterval(__privateGet(this, _currentQuery)) : this.options.refetchInterval) ?? false; -}; -updateRefetchInterval_fn = function(nextInterval) { - __privateMethod(this, _QueryObserver_instances, clearRefetchInterval_fn).call(this); - __privateSet(this, _currentRefetchInterval, nextInterval); - if (isServer || resolveEnabled(this.options.enabled, __privateGet(this, _currentQuery)) === false || !isValidTimeout(__privateGet(this, _currentRefetchInterval)) || __privateGet(this, _currentRefetchInterval) === 0) { - return; - } - __privateSet(this, _refetchIntervalId, timeoutManager.setInterval(() => { - if (this.options.refetchIntervalInBackground || focusManager.isFocused()) { - __privateMethod(this, _QueryObserver_instances, executeFetch_fn).call(this); - } - }, __privateGet(this, _currentRefetchInterval))); -}; -updateTimers_fn = function() { - __privateMethod(this, _QueryObserver_instances, updateStaleTimeout_fn).call(this); - __privateMethod(this, _QueryObserver_instances, updateRefetchInterval_fn).call(this, __privateMethod(this, _QueryObserver_instances, computeRefetchInterval_fn).call(this)); -}; -clearStaleTimeout_fn = function() { - if (__privateGet(this, _staleTimeoutId)) { - timeoutManager.clearTimeout(__privateGet(this, _staleTimeoutId)); - __privateSet(this, _staleTimeoutId, void 0); - } -}; -clearRefetchInterval_fn = function() { - if (__privateGet(this, _refetchIntervalId)) { - timeoutManager.clearInterval(__privateGet(this, _refetchIntervalId)); - __privateSet(this, _refetchIntervalId, void 0); - } -}; -updateQuery_fn = function() { - const query = __privateGet(this, _client).getQueryCache().build(__privateGet(this, _client), this.options); - if (query === __privateGet(this, _currentQuery)) { - return; - } - const prevQuery = __privateGet(this, _currentQuery); - __privateSet(this, _currentQuery, query); - __privateSet(this, _currentQueryInitialState, query.state); - if (this.hasListeners()) { - prevQuery == null ? void 0 : prevQuery.removeObserver(this); - query.addObserver(this); - } -}; -notify_fn = function(notifyOptions) { - notifyManager.batch(() => { - if (notifyOptions.listeners) { - this.listeners.forEach((listener) => { - listener(__privateGet(this, _currentResult)); - }); - } - __privateGet(this, _client).getQueryCache().notify({ - query: __privateGet(this, _currentQuery), - type: "observerResultsUpdated" - }); - }); -}; -function shouldLoadOnMount(query, options) { - return resolveEnabled(options.enabled, query) !== false && query.state.data === void 0 && !(query.state.status === "error" && options.retryOnMount === false); -} -function shouldFetchOnMount(query, options) { - return shouldLoadOnMount(query, options) || query.state.data !== void 0 && shouldFetchOn(query, options, options.refetchOnMount); -} -function shouldFetchOn(query, options, field) { - if (resolveEnabled(options.enabled, query) !== false && resolveStaleTime(options.staleTime, query) !== "static") { - const value = typeof field === "function" ? field(query) : field; - return value === "always" || value !== false && isStale(query, options); - } - return false; -} -function shouldFetchOptionally(query, prevQuery, options, prevOptions) { - return (query !== prevQuery || resolveEnabled(prevOptions.enabled, query) === false) && (!options.suspense || query.state.status !== "error") && isStale(query, options); -} -function isStale(query, options) { - return resolveEnabled(options.enabled, query) !== false && query.isStaleByTime(resolveStaleTime(options.staleTime, query)); -} -function shouldAssignObserverCurrentProperties(observer, optimisticResult) { - if (!shallowEqualObjects(observer.getCurrentResult(), optimisticResult)) { - return true; - } - return false; -} -export { - QueryObserver -}; -//# sourceMappingURL=queryObserver.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/queryObserver.js.map b/node_modules/@tanstack/query-core/build/legacy/queryObserver.js.map deleted file mode 100644 index df93f52..0000000 --- a/node_modules/@tanstack/query-core/build/legacy/queryObserver.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/queryObserver.ts"],"sourcesContent":["import { focusManager } from './focusManager'\nimport { notifyManager } from './notifyManager'\nimport { fetchState } from './query'\nimport { Subscribable } from './subscribable'\nimport { pendingThenable } from './thenable'\nimport {\n isServer,\n isValidTimeout,\n noop,\n replaceData,\n resolveEnabled,\n resolveStaleTime,\n shallowEqualObjects,\n timeUntilStale,\n} from './utils'\nimport { timeoutManager } from './timeoutManager'\nimport type { ManagedTimerId } from './timeoutManager'\nimport type { FetchOptions, Query, QueryState } from './query'\nimport type { QueryClient } from './queryClient'\nimport type { PendingThenable, Thenable } from './thenable'\nimport type {\n DefaultError,\n DefaultedQueryObserverOptions,\n PlaceholderDataFunction,\n QueryKey,\n QueryObserverBaseResult,\n QueryObserverOptions,\n QueryObserverResult,\n RefetchOptions,\n} from './types'\n\ntype QueryObserverListener = (\n result: QueryObserverResult,\n) => void\n\ninterface ObserverFetchOptions extends FetchOptions {\n throwOnError?: boolean\n}\n\nexport class QueryObserver<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> extends Subscribable> {\n #client: QueryClient\n #currentQuery: Query = undefined!\n #currentQueryInitialState: QueryState = undefined!\n #currentResult: QueryObserverResult = undefined!\n #currentResultState?: QueryState\n #currentResultOptions?: QueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >\n #currentThenable: Thenable\n #selectError: TError | null\n #selectFn?: (data: TQueryData) => TData\n #selectResult?: TData\n // This property keeps track of the last query with defined data.\n // It will be used to pass the previous data and query to the placeholder function between renders.\n #lastQueryWithDefinedData?: Query\n #staleTimeoutId?: ManagedTimerId\n #refetchIntervalId?: ManagedTimerId\n #currentRefetchInterval?: number | false\n #trackedProps = new Set()\n\n constructor(\n client: QueryClient,\n public options: QueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >,\n ) {\n super()\n\n this.#client = client\n this.#selectError = null\n this.#currentThenable = pendingThenable()\n\n this.bindMethods()\n this.setOptions(options)\n }\n\n protected bindMethods(): void {\n this.refetch = this.refetch.bind(this)\n }\n\n protected onSubscribe(): void {\n if (this.listeners.size === 1) {\n this.#currentQuery.addObserver(this)\n\n if (shouldFetchOnMount(this.#currentQuery, this.options)) {\n this.#executeFetch()\n } else {\n this.updateResult()\n }\n\n this.#updateTimers()\n }\n }\n\n protected onUnsubscribe(): void {\n if (!this.hasListeners()) {\n this.destroy()\n }\n }\n\n shouldFetchOnReconnect(): boolean {\n return shouldFetchOn(\n this.#currentQuery,\n this.options,\n this.options.refetchOnReconnect,\n )\n }\n\n shouldFetchOnWindowFocus(): boolean {\n return shouldFetchOn(\n this.#currentQuery,\n this.options,\n this.options.refetchOnWindowFocus,\n )\n }\n\n destroy(): void {\n this.listeners = new Set()\n this.#clearStaleTimeout()\n this.#clearRefetchInterval()\n this.#currentQuery.removeObserver(this)\n }\n\n setOptions(\n options: QueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >,\n ): void {\n const prevOptions = this.options\n const prevQuery = this.#currentQuery\n\n this.options = this.#client.defaultQueryOptions(options)\n\n if (\n this.options.enabled !== undefined &&\n typeof this.options.enabled !== 'boolean' &&\n typeof this.options.enabled !== 'function' &&\n typeof resolveEnabled(this.options.enabled, this.#currentQuery) !==\n 'boolean'\n ) {\n throw new Error(\n 'Expected enabled to be a boolean or a callback that returns a boolean',\n )\n }\n\n this.#updateQuery()\n this.#currentQuery.setOptions(this.options)\n\n if (\n prevOptions._defaulted &&\n !shallowEqualObjects(this.options, prevOptions)\n ) {\n this.#client.getQueryCache().notify({\n type: 'observerOptionsUpdated',\n query: this.#currentQuery,\n observer: this,\n })\n }\n\n const mounted = this.hasListeners()\n\n // Fetch if there are subscribers\n if (\n mounted &&\n shouldFetchOptionally(\n this.#currentQuery,\n prevQuery,\n this.options,\n prevOptions,\n )\n ) {\n this.#executeFetch()\n }\n\n // Update result\n this.updateResult()\n\n // Update stale interval if needed\n if (\n mounted &&\n (this.#currentQuery !== prevQuery ||\n resolveEnabled(this.options.enabled, this.#currentQuery) !==\n resolveEnabled(prevOptions.enabled, this.#currentQuery) ||\n resolveStaleTime(this.options.staleTime, this.#currentQuery) !==\n resolveStaleTime(prevOptions.staleTime, this.#currentQuery))\n ) {\n this.#updateStaleTimeout()\n }\n\n const nextRefetchInterval = this.#computeRefetchInterval()\n\n // Update refetch interval if needed\n if (\n mounted &&\n (this.#currentQuery !== prevQuery ||\n resolveEnabled(this.options.enabled, this.#currentQuery) !==\n resolveEnabled(prevOptions.enabled, this.#currentQuery) ||\n nextRefetchInterval !== this.#currentRefetchInterval)\n ) {\n this.#updateRefetchInterval(nextRefetchInterval)\n }\n }\n\n getOptimisticResult(\n options: DefaultedQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >,\n ): QueryObserverResult {\n const query = this.#client.getQueryCache().build(this.#client, options)\n\n const result = this.createResult(query, options)\n\n if (shouldAssignObserverCurrentProperties(this, result)) {\n // this assigns the optimistic result to the current Observer\n // because if the query function changes, useQuery will be performing\n // an effect where it would fetch again.\n // When the fetch finishes, we perform a deep data cloning in order\n // to reuse objects references. This deep data clone is performed against\n // the `observer.currentResult.data` property\n // When QueryKey changes, we refresh the query and get new `optimistic`\n // result, while we leave the `observer.currentResult`, so when new data\n // arrives, it finds the old `observer.currentResult` which is related\n // to the old QueryKey. Which means that currentResult and selectData are\n // out of sync already.\n // To solve this, we move the cursor of the currentResult every time\n // an observer reads an optimistic value.\n\n // When keeping the previous data, the result doesn't change until new\n // data arrives.\n this.#currentResult = result\n this.#currentResultOptions = this.options\n this.#currentResultState = this.#currentQuery.state\n }\n return result\n }\n\n getCurrentResult(): QueryObserverResult {\n return this.#currentResult\n }\n\n trackResult(\n result: QueryObserverResult,\n onPropTracked?: (key: keyof QueryObserverResult) => void,\n ): QueryObserverResult {\n return new Proxy(result, {\n get: (target, key) => {\n this.trackProp(key as keyof QueryObserverResult)\n onPropTracked?.(key as keyof QueryObserverResult)\n if (key === 'promise') {\n this.trackProp('data')\n if (\n !this.options.experimental_prefetchInRender &&\n this.#currentThenable.status === 'pending'\n ) {\n this.#currentThenable.reject(\n new Error(\n 'experimental_prefetchInRender feature flag is not enabled',\n ),\n )\n }\n }\n return Reflect.get(target, key)\n },\n })\n }\n\n trackProp(key: keyof QueryObserverResult) {\n this.#trackedProps.add(key)\n }\n\n getCurrentQuery(): Query {\n return this.#currentQuery\n }\n\n refetch({ ...options }: RefetchOptions = {}): Promise<\n QueryObserverResult\n > {\n return this.fetch({\n ...options,\n })\n }\n\n fetchOptimistic(\n options: QueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >,\n ): Promise> {\n const defaultedOptions = this.#client.defaultQueryOptions(options)\n\n const query = this.#client\n .getQueryCache()\n .build(this.#client, defaultedOptions)\n\n return query.fetch().then(() => this.createResult(query, defaultedOptions))\n }\n\n protected fetch(\n fetchOptions: ObserverFetchOptions,\n ): Promise> {\n return this.#executeFetch({\n ...fetchOptions,\n cancelRefetch: fetchOptions.cancelRefetch ?? true,\n }).then(() => {\n this.updateResult()\n return this.#currentResult\n })\n }\n\n #executeFetch(\n fetchOptions?: Omit,\n ): Promise {\n // Make sure we reference the latest query as the current one might have been removed\n this.#updateQuery()\n\n // Fetch\n let promise: Promise = this.#currentQuery.fetch(\n this.options,\n fetchOptions,\n )\n\n if (!fetchOptions?.throwOnError) {\n promise = promise.catch(noop)\n }\n\n return promise\n }\n\n #updateStaleTimeout(): void {\n this.#clearStaleTimeout()\n const staleTime = resolveStaleTime(\n this.options.staleTime,\n this.#currentQuery,\n )\n\n if (isServer || this.#currentResult.isStale || !isValidTimeout(staleTime)) {\n return\n }\n\n const time = timeUntilStale(this.#currentResult.dataUpdatedAt, staleTime)\n\n // The timeout is sometimes triggered 1 ms before the stale time expiration.\n // To mitigate this issue we always add 1 ms to the timeout.\n const timeout = time + 1\n\n this.#staleTimeoutId = timeoutManager.setTimeout(() => {\n if (!this.#currentResult.isStale) {\n this.updateResult()\n }\n }, timeout)\n }\n\n #computeRefetchInterval() {\n return (\n (typeof this.options.refetchInterval === 'function'\n ? this.options.refetchInterval(this.#currentQuery)\n : this.options.refetchInterval) ?? false\n )\n }\n\n #updateRefetchInterval(nextInterval: number | false): void {\n this.#clearRefetchInterval()\n\n this.#currentRefetchInterval = nextInterval\n\n if (\n isServer ||\n resolveEnabled(this.options.enabled, this.#currentQuery) === false ||\n !isValidTimeout(this.#currentRefetchInterval) ||\n this.#currentRefetchInterval === 0\n ) {\n return\n }\n\n this.#refetchIntervalId = timeoutManager.setInterval(() => {\n if (\n this.options.refetchIntervalInBackground ||\n focusManager.isFocused()\n ) {\n this.#executeFetch()\n }\n }, this.#currentRefetchInterval)\n }\n\n #updateTimers(): void {\n this.#updateStaleTimeout()\n this.#updateRefetchInterval(this.#computeRefetchInterval())\n }\n\n #clearStaleTimeout(): void {\n if (this.#staleTimeoutId) {\n timeoutManager.clearTimeout(this.#staleTimeoutId)\n this.#staleTimeoutId = undefined\n }\n }\n\n #clearRefetchInterval(): void {\n if (this.#refetchIntervalId) {\n timeoutManager.clearInterval(this.#refetchIntervalId)\n this.#refetchIntervalId = undefined\n }\n }\n\n protected createResult(\n query: Query,\n options: QueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >,\n ): QueryObserverResult {\n const prevQuery = this.#currentQuery\n const prevOptions = this.options\n const prevResult = this.#currentResult as\n | QueryObserverResult\n | undefined\n const prevResultState = this.#currentResultState\n const prevResultOptions = this.#currentResultOptions\n const queryChange = query !== prevQuery\n const queryInitialState = queryChange\n ? query.state\n : this.#currentQueryInitialState\n\n const { state } = query\n let newState = { ...state }\n let isPlaceholderData = false\n let data: TData | undefined\n\n // Optimistically set result in fetching state if needed\n if (options._optimisticResults) {\n const mounted = this.hasListeners()\n\n const fetchOnMount = !mounted && shouldFetchOnMount(query, options)\n\n const fetchOptionally =\n mounted && shouldFetchOptionally(query, prevQuery, options, prevOptions)\n\n if (fetchOnMount || fetchOptionally) {\n newState = {\n ...newState,\n ...fetchState(state.data, query.options),\n }\n }\n if (options._optimisticResults === 'isRestoring') {\n newState.fetchStatus = 'idle'\n }\n }\n\n let { error, errorUpdatedAt, status } = newState\n\n // Per default, use query data\n data = newState.data as unknown as TData\n let skipSelect = false\n\n // use placeholderData if needed\n if (\n options.placeholderData !== undefined &&\n data === undefined &&\n status === 'pending'\n ) {\n let placeholderData\n\n // Memoize placeholder data\n if (\n prevResult?.isPlaceholderData &&\n options.placeholderData === prevResultOptions?.placeholderData\n ) {\n placeholderData = prevResult.data\n // we have to skip select when reading this memoization\n // because prevResult.data is already \"selected\"\n skipSelect = true\n } else {\n // compute placeholderData\n placeholderData =\n typeof options.placeholderData === 'function'\n ? (\n options.placeholderData as unknown as PlaceholderDataFunction\n )(\n this.#lastQueryWithDefinedData?.state.data,\n this.#lastQueryWithDefinedData as any,\n )\n : options.placeholderData\n }\n\n if (placeholderData !== undefined) {\n status = 'success'\n data = replaceData(\n prevResult?.data,\n placeholderData as unknown,\n options,\n ) as TData\n isPlaceholderData = true\n }\n }\n\n // Select data if needed\n // this also runs placeholderData through the select function\n if (options.select && data !== undefined && !skipSelect) {\n // Memoize select result\n if (\n prevResult &&\n data === prevResultState?.data &&\n options.select === this.#selectFn\n ) {\n data = this.#selectResult\n } else {\n try {\n this.#selectFn = options.select\n data = options.select(data as any)\n data = replaceData(prevResult?.data, data, options)\n this.#selectResult = data\n this.#selectError = null\n } catch (selectError) {\n this.#selectError = selectError as TError\n }\n }\n }\n\n if (this.#selectError) {\n error = this.#selectError\n data = this.#selectResult\n errorUpdatedAt = Date.now()\n status = 'error'\n }\n\n const isFetching = newState.fetchStatus === 'fetching'\n const isPending = status === 'pending'\n const isError = status === 'error'\n\n const isLoading = isPending && isFetching\n const hasData = data !== undefined\n\n const result: QueryObserverBaseResult = {\n status,\n fetchStatus: newState.fetchStatus,\n isPending,\n isSuccess: status === 'success',\n isError,\n isInitialLoading: isLoading,\n isLoading,\n data,\n dataUpdatedAt: newState.dataUpdatedAt,\n error,\n errorUpdatedAt,\n failureCount: newState.fetchFailureCount,\n failureReason: newState.fetchFailureReason,\n errorUpdateCount: newState.errorUpdateCount,\n isFetched: newState.dataUpdateCount > 0 || newState.errorUpdateCount > 0,\n isFetchedAfterMount:\n newState.dataUpdateCount > queryInitialState.dataUpdateCount ||\n newState.errorUpdateCount > queryInitialState.errorUpdateCount,\n isFetching,\n isRefetching: isFetching && !isPending,\n isLoadingError: isError && !hasData,\n isPaused: newState.fetchStatus === 'paused',\n isPlaceholderData,\n isRefetchError: isError && hasData,\n isStale: isStale(query, options),\n refetch: this.refetch,\n promise: this.#currentThenable,\n isEnabled: resolveEnabled(options.enabled, query) !== false,\n }\n\n const nextResult = result as QueryObserverResult\n\n if (this.options.experimental_prefetchInRender) {\n const hasResultData = nextResult.data !== undefined\n const isErrorWithoutData = nextResult.status === 'error' && !hasResultData\n const finalizeThenableIfPossible = (thenable: PendingThenable) => {\n if (isErrorWithoutData) {\n thenable.reject(nextResult.error)\n } else if (hasResultData) {\n thenable.resolve(nextResult.data as TData)\n }\n }\n\n /**\n * Create a new thenable and result promise when the results have changed\n */\n const recreateThenable = () => {\n const pending =\n (this.#currentThenable =\n nextResult.promise =\n pendingThenable())\n\n finalizeThenableIfPossible(pending)\n }\n\n const prevThenable = this.#currentThenable\n switch (prevThenable.status) {\n case 'pending':\n // Finalize the previous thenable if it was pending\n // and we are still observing the same query\n if (query.queryHash === prevQuery.queryHash) {\n finalizeThenableIfPossible(prevThenable)\n }\n break\n case 'fulfilled':\n if (isErrorWithoutData || nextResult.data !== prevThenable.value) {\n recreateThenable()\n }\n break\n case 'rejected':\n if (!isErrorWithoutData || nextResult.error !== prevThenable.reason) {\n recreateThenable()\n }\n break\n }\n }\n\n return nextResult\n }\n\n updateResult(): void {\n const prevResult = this.#currentResult as\n | QueryObserverResult\n | undefined\n\n const nextResult = this.createResult(this.#currentQuery, this.options)\n\n this.#currentResultState = this.#currentQuery.state\n this.#currentResultOptions = this.options\n\n if (this.#currentResultState.data !== undefined) {\n this.#lastQueryWithDefinedData = this.#currentQuery\n }\n\n // Only notify and update result if something has changed\n if (shallowEqualObjects(nextResult, prevResult)) {\n return\n }\n\n this.#currentResult = nextResult\n\n const shouldNotifyListeners = (): boolean => {\n if (!prevResult) {\n return true\n }\n\n const { notifyOnChangeProps } = this.options\n const notifyOnChangePropsValue =\n typeof notifyOnChangeProps === 'function'\n ? notifyOnChangeProps()\n : notifyOnChangeProps\n\n if (\n notifyOnChangePropsValue === 'all' ||\n (!notifyOnChangePropsValue && !this.#trackedProps.size)\n ) {\n return true\n }\n\n const includedProps = new Set(\n notifyOnChangePropsValue ?? this.#trackedProps,\n )\n\n if (this.options.throwOnError) {\n includedProps.add('error')\n }\n\n return Object.keys(this.#currentResult).some((key) => {\n const typedKey = key as keyof QueryObserverResult\n const changed = this.#currentResult[typedKey] !== prevResult[typedKey]\n\n return changed && includedProps.has(typedKey)\n })\n }\n\n this.#notify({ listeners: shouldNotifyListeners() })\n }\n\n #updateQuery(): void {\n const query = this.#client.getQueryCache().build(this.#client, this.options)\n\n if (query === this.#currentQuery) {\n return\n }\n\n const prevQuery = this.#currentQuery as\n | Query\n | undefined\n this.#currentQuery = query\n this.#currentQueryInitialState = query.state\n\n if (this.hasListeners()) {\n prevQuery?.removeObserver(this)\n query.addObserver(this)\n }\n }\n\n onQueryUpdate(): void {\n this.updateResult()\n\n if (this.hasListeners()) {\n this.#updateTimers()\n }\n }\n\n #notify(notifyOptions: { listeners: boolean }): void {\n notifyManager.batch(() => {\n // First, trigger the listeners\n if (notifyOptions.listeners) {\n this.listeners.forEach((listener) => {\n listener(this.#currentResult)\n })\n }\n\n // Then the cache listeners\n this.#client.getQueryCache().notify({\n query: this.#currentQuery,\n type: 'observerResultsUpdated',\n })\n })\n }\n}\n\nfunction shouldLoadOnMount(\n query: Query,\n options: QueryObserverOptions,\n): boolean {\n return (\n resolveEnabled(options.enabled, query) !== false &&\n query.state.data === undefined &&\n !(query.state.status === 'error' && options.retryOnMount === false)\n )\n}\n\nfunction shouldFetchOnMount(\n query: Query,\n options: QueryObserverOptions,\n): boolean {\n return (\n shouldLoadOnMount(query, options) ||\n (query.state.data !== undefined &&\n shouldFetchOn(query, options, options.refetchOnMount))\n )\n}\n\nfunction shouldFetchOn(\n query: Query,\n options: QueryObserverOptions,\n field: (typeof options)['refetchOnMount'] &\n (typeof options)['refetchOnWindowFocus'] &\n (typeof options)['refetchOnReconnect'],\n) {\n if (\n resolveEnabled(options.enabled, query) !== false &&\n resolveStaleTime(options.staleTime, query) !== 'static'\n ) {\n const value = typeof field === 'function' ? field(query) : field\n\n return value === 'always' || (value !== false && isStale(query, options))\n }\n return false\n}\n\nfunction shouldFetchOptionally(\n query: Query,\n prevQuery: Query,\n options: QueryObserverOptions,\n prevOptions: QueryObserverOptions,\n): boolean {\n return (\n (query !== prevQuery ||\n resolveEnabled(prevOptions.enabled, query) === false) &&\n (!options.suspense || query.state.status !== 'error') &&\n isStale(query, options)\n )\n}\n\nfunction isStale(\n query: Query,\n options: QueryObserverOptions,\n): boolean {\n return (\n resolveEnabled(options.enabled, query) !== false &&\n query.isStaleByTime(resolveStaleTime(options.staleTime, query))\n )\n}\n\n// this function would decide if we will update the observer's 'current'\n// properties after an optimistic reading via getOptimisticResult\nfunction shouldAssignObserverCurrentProperties<\n TQueryFnData = unknown,\n TError = unknown,\n TData = TQueryFnData,\n TQueryData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n observer: QueryObserver,\n optimisticResult: QueryObserverResult,\n) {\n // if the newly created result isn't what the observer is holding as current,\n // then we'll need to update the properties as well\n if (!shallowEqualObjects(observer.getCurrentResult(), optimisticResult)) {\n return true\n }\n\n // basically, just keep previous properties if nothing changed\n return false\n}\n"],"mappings":";;;;;;;;AAAA,SAAS,oBAAoB;AAC7B,SAAS,qBAAqB;AAC9B,SAAS,kBAAkB;AAC3B,SAAS,oBAAoB;AAC7B,SAAS,uBAAuB;AAChC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,sBAAsB;AAf/B;AAuCO,IAAM,gBAAN,cAMG,aAAmD;AAAA,EAyB3D,YACE,QACO,SAOP;AACA,UAAM;AARC;AAjCJ;AAOL;AACA;AACA;AACA;AACA;AACA;AAOA;AACA;AACA;AACA;AAGA;AAAA;AAAA;AACA;AACA;AACA;AACA,sCAAgB,oBAAI,IAA+B;AAcjD,uBAAK,SAAU;AACf,uBAAK,cAAe;AACpB,uBAAK,kBAAmB,gBAAgB;AAExC,SAAK,YAAY;AACjB,SAAK,WAAW,OAAO;AAAA,EACzB;AAAA,EAEU,cAAoB;AAC5B,SAAK,UAAU,KAAK,QAAQ,KAAK,IAAI;AAAA,EACvC;AAAA,EAEU,cAAoB;AAC5B,QAAI,KAAK,UAAU,SAAS,GAAG;AAC7B,yBAAK,eAAc,YAAY,IAAI;AAEnC,UAAI,mBAAmB,mBAAK,gBAAe,KAAK,OAAO,GAAG;AACxD,8BAAK,2CAAL;AAAA,MACF,OAAO;AACL,aAAK,aAAa;AAAA,MACpB;AAEA,4BAAK,2CAAL;AAAA,IACF;AAAA,EACF;AAAA,EAEU,gBAAsB;AAC9B,QAAI,CAAC,KAAK,aAAa,GAAG;AACxB,WAAK,QAAQ;AAAA,IACf;AAAA,EACF;AAAA,EAEA,yBAAkC;AAChC,WAAO;AAAA,MACL,mBAAK;AAAA,MACL,KAAK;AAAA,MACL,KAAK,QAAQ;AAAA,IACf;AAAA,EAC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AAQ,SAAS,KAAK,MAAM,SAC3C,iBAAiB,QAAQ,WAAW,KAAK,MAAM,UAC/C;AACA,UAAM,QAAQ,OAAO,UAAU,aAAa,MAAM,KAAK,IAAI;AAE3D,WAAO,UAAU,YAAa,UAAU,SAAS,QAAQ,OAAO,OAAO;AAAA,EACzE;AACA,SAAO;AACT;AAEA,SAAS,sBACP,OACA,WACA,SACA,aACS;AACT,UACG,UAAU,aACT,eAAe,YAAY,SAAS,KAAK,MAAM,WAChD,CAAC,QAAQ,YAAY,MAAM,MAAM,WAAW,YAC7C,QAAQ,OAAO,OAAO;AAE1B;AAEA,SAAS,QACP,OACA,SACS;AACT,SACE,eAAe,QAAQ,SAAS,KAAK,MAAM,SAC3C,MAAM,cAAc,iBAAiB,QAAQ,WAAW,KAAK,CAAC;AAElE;AAIA,SAAS,sCAOP,UACA,kBACA;AAGA,MAAI,CAAC,oBAAoB,SAAS,iBAAiB,GAAG,gBAAgB,GAAG;AACvE,WAAO;AAAA,EACT;AAGA,SAAO;AACT;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/removable.cjs b/node_modules/@tanstack/query-core/build/legacy/removable.cjs deleted file mode 100644 index 92cc203..0000000 --- a/node_modules/@tanstack/query-core/build/legacy/removable.cjs +++ /dev/null @@ -1,69 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __typeError = (msg) => { - throw TypeError(msg); -}; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg); -var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj)); -var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value); -var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value); - -// src/removable.ts -var removable_exports = {}; -__export(removable_exports, { - Removable: () => Removable -}); -module.exports = __toCommonJS(removable_exports); -var import_timeoutManager = require("./timeoutManager.cjs"); -var import_utils = require("./utils.cjs"); -var _gcTimeout; -var Removable = class { - constructor() { - __privateAdd(this, _gcTimeout); - } - destroy() { - this.clearGcTimeout(); - } - scheduleGc() { - this.clearGcTimeout(); - if ((0, import_utils.isValidTimeout)(this.gcTime)) { - __privateSet(this, _gcTimeout, import_timeoutManager.timeoutManager.setTimeout(() => { - this.optionalRemove(); - }, this.gcTime)); - } - } - updateGcTime(newGcTime) { - this.gcTime = Math.max( - this.gcTime || 0, - newGcTime ?? (import_utils.isServer ? Infinity : 5 * 60 * 1e3) - ); - } - clearGcTimeout() { - if (__privateGet(this, _gcTimeout)) { - import_timeoutManager.timeoutManager.clearTimeout(__privateGet(this, _gcTimeout)); - __privateSet(this, _gcTimeout, void 0); - } - } -}; -_gcTimeout = new WeakMap(); -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - Removable -}); -//# sourceMappingURL=removable.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/removable.cjs.map b/node_modules/@tanstack/query-core/build/legacy/removable.cjs.map deleted file mode 100644 index c67604a..0000000 --- a/node_modules/@tanstack/query-core/build/legacy/removable.cjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/removable.ts"],"sourcesContent":["import { timeoutManager } from './timeoutManager'\nimport { isServer, isValidTimeout } from './utils'\nimport type { ManagedTimerId } from './timeoutManager'\n\nexport abstract class Removable {\n gcTime!: number\n #gcTimeout?: ManagedTimerId\n\n destroy(): void {\n this.clearGcTimeout()\n }\n\n protected scheduleGc(): void {\n this.clearGcTimeout()\n\n if (isValidTimeout(this.gcTime)) {\n this.#gcTimeout = timeoutManager.setTimeout(() => {\n this.optionalRemove()\n }, this.gcTime)\n }\n }\n\n protected updateGcTime(newGcTime: number | undefined): void {\n // Default to 5 minutes (Infinity for server-side) if no gcTime is set\n this.gcTime = Math.max(\n this.gcTime || 0,\n newGcTime ?? (isServer ? Infinity : 5 * 60 * 1000),\n )\n }\n\n protected clearGcTimeout() {\n if (this.#gcTimeout) {\n timeoutManager.clearTimeout(this.#gcTimeout)\n this.#gcTimeout = undefined\n }\n }\n\n protected abstract optionalRemove(): void\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,4BAA+B;AAC/B,mBAAyC;AADzC;AAIO,IAAe,YAAf,MAAyB;AAAA,EAAzB;AAEL;AAAA;AAAA,EAEA,UAAgB;AACd,SAAK,eAAe;AAAA,EACtB;AAAA,EAEU,aAAmB;AAC3B,SAAK,eAAe;AAEpB,YAAI,6BAAe,KAAK,MAAM,GAAG;AAC/B,yBAAK,YAAa,qCAAe,WAAW,MAAM;AAChD,aAAK,eAAe;AAAA,MACtB,GAAG,KAAK,MAAM;AAAA,IAChB;AAAA,EACF;AAAA,EAEU,aAAa,WAAqC;AAE1D,SAAK,SAAS,KAAK;AAAA,MACjB,KAAK,UAAU;AAAA,MACf,cAAc,wBAAW,WAAW,IAAI,KAAK;AAAA,IAC/C;AAAA,EACF;AAAA,EAEU,iBAAiB;AACzB,QAAI,mBAAK,aAAY;AACnB,2CAAe,aAAa,mBAAK,WAAU;AAC3C,yBAAK,YAAa;AAAA,IACpB;AAAA,EACF;AAGF;AAhCE;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/removable.d.cts b/node_modules/@tanstack/query-core/build/legacy/removable.d.cts deleted file mode 100644 index 7b82525..0000000 --- a/node_modules/@tanstack/query-core/build/legacy/removable.d.cts +++ /dev/null @@ -1,11 +0,0 @@ -declare abstract class Removable { - #private; - gcTime: number; - destroy(): void; - protected scheduleGc(): void; - protected updateGcTime(newGcTime: number | undefined): void; - protected clearGcTimeout(): void; - protected abstract optionalRemove(): void; -} - -export { Removable }; diff --git a/node_modules/@tanstack/query-core/build/legacy/removable.d.ts b/node_modules/@tanstack/query-core/build/legacy/removable.d.ts deleted file mode 100644 index 7b82525..0000000 --- a/node_modules/@tanstack/query-core/build/legacy/removable.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -declare abstract class Removable { - #private; - gcTime: number; - destroy(): void; - protected scheduleGc(): void; - protected updateGcTime(newGcTime: number | undefined): void; - protected clearGcTimeout(): void; - protected abstract optionalRemove(): void; -} - -export { Removable }; diff --git a/node_modules/@tanstack/query-core/build/legacy/removable.js b/node_modules/@tanstack/query-core/build/legacy/removable.js deleted file mode 100644 index e110bdf..0000000 --- a/node_modules/@tanstack/query-core/build/legacy/removable.js +++ /dev/null @@ -1,43 +0,0 @@ -import { - __privateAdd, - __privateGet, - __privateSet -} from "./chunk-PXG64RU4.js"; - -// src/removable.ts -import { timeoutManager } from "./timeoutManager.js"; -import { isServer, isValidTimeout } from "./utils.js"; -var _gcTimeout; -var Removable = class { - constructor() { - __privateAdd(this, _gcTimeout); - } - destroy() { - this.clearGcTimeout(); - } - scheduleGc() { - this.clearGcTimeout(); - if (isValidTimeout(this.gcTime)) { - __privateSet(this, _gcTimeout, timeoutManager.setTimeout(() => { - this.optionalRemove(); - }, this.gcTime)); - } - } - updateGcTime(newGcTime) { - this.gcTime = Math.max( - this.gcTime || 0, - newGcTime ?? (isServer ? Infinity : 5 * 60 * 1e3) - ); - } - clearGcTimeout() { - if (__privateGet(this, _gcTimeout)) { - timeoutManager.clearTimeout(__privateGet(this, _gcTimeout)); - __privateSet(this, _gcTimeout, void 0); - } - } -}; -_gcTimeout = new WeakMap(); -export { - Removable -}; -//# sourceMappingURL=removable.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/removable.js.map b/node_modules/@tanstack/query-core/build/legacy/removable.js.map deleted file mode 100644 index 9eb36ce..0000000 --- a/node_modules/@tanstack/query-core/build/legacy/removable.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/removable.ts"],"sourcesContent":["import { timeoutManager } from './timeoutManager'\nimport { isServer, isValidTimeout } from './utils'\nimport type { ManagedTimerId } from './timeoutManager'\n\nexport abstract class Removable {\n gcTime!: number\n #gcTimeout?: ManagedTimerId\n\n destroy(): void {\n this.clearGcTimeout()\n }\n\n protected scheduleGc(): void {\n this.clearGcTimeout()\n\n if (isValidTimeout(this.gcTime)) {\n this.#gcTimeout = timeoutManager.setTimeout(() => {\n this.optionalRemove()\n }, this.gcTime)\n }\n }\n\n protected updateGcTime(newGcTime: number | undefined): void {\n // Default to 5 minutes (Infinity for server-side) if no gcTime is set\n this.gcTime = Math.max(\n this.gcTime || 0,\n newGcTime ?? (isServer ? Infinity : 5 * 60 * 1000),\n )\n }\n\n protected clearGcTimeout() {\n if (this.#gcTimeout) {\n timeoutManager.clearTimeout(this.#gcTimeout)\n this.#gcTimeout = undefined\n }\n }\n\n protected abstract optionalRemove(): void\n}\n"],"mappings":";;;;;;;AAAA,SAAS,sBAAsB;AAC/B,SAAS,UAAU,sBAAsB;AADzC;AAIO,IAAe,YAAf,MAAyB;AAAA,EAAzB;AAEL;AAAA;AAAA,EAEA,UAAgB;AACd,SAAK,eAAe;AAAA,EACtB;AAAA,EAEU,aAAmB;AAC3B,SAAK,eAAe;AAEpB,QAAI,eAAe,KAAK,MAAM,GAAG;AAC/B,yBAAK,YAAa,eAAe,WAAW,MAAM;AAChD,aAAK,eAAe;AAAA,MACtB,GAAG,KAAK,MAAM;AAAA,IAChB;AAAA,EACF;AAAA,EAEU,aAAa,WAAqC;AAE1D,SAAK,SAAS,KAAK;AAAA,MACjB,KAAK,UAAU;AAAA,MACf,cAAc,WAAW,WAAW,IAAI,KAAK;AAAA,IAC/C;AAAA,EACF;AAAA,EAEU,iBAAiB;AACzB,QAAI,mBAAK,aAAY;AACnB,qBAAe,aAAa,mBAAK,WAAU;AAC3C,yBAAK,YAAa;AAAA,IACpB;AAAA,EACF;AAGF;AAhCE;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/retryer.cjs b/node_modules/@tanstack/query-core/build/legacy/retryer.cjs deleted file mode 100644 index 4efcc15..0000000 --- a/node_modules/@tanstack/query-core/build/legacy/retryer.cjs +++ /dev/null @@ -1,165 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// src/retryer.ts -var retryer_exports = {}; -__export(retryer_exports, { - CancelledError: () => CancelledError, - canFetch: () => canFetch, - createRetryer: () => createRetryer, - isCancelledError: () => isCancelledError -}); -module.exports = __toCommonJS(retryer_exports); -var import_focusManager = require("./focusManager.cjs"); -var import_onlineManager = require("./onlineManager.cjs"); -var import_thenable = require("./thenable.cjs"); -var import_utils = require("./utils.cjs"); -function defaultRetryDelay(failureCount) { - return Math.min(1e3 * 2 ** failureCount, 3e4); -} -function canFetch(networkMode) { - return (networkMode ?? "online") === "online" ? import_onlineManager.onlineManager.isOnline() : true; -} -var CancelledError = class extends Error { - constructor(options) { - super("CancelledError"); - this.revert = options == null ? void 0 : options.revert; - this.silent = options == null ? void 0 : options.silent; - } -}; -function isCancelledError(value) { - return value instanceof CancelledError; -} -function createRetryer(config) { - let isRetryCancelled = false; - let failureCount = 0; - let continueFn; - const thenable = (0, import_thenable.pendingThenable)(); - const isResolved = () => thenable.status !== "pending"; - const cancel = (cancelOptions) => { - var _a; - if (!isResolved()) { - const error = new CancelledError(cancelOptions); - reject(error); - (_a = config.onCancel) == null ? void 0 : _a.call(config, error); - } - }; - const cancelRetry = () => { - isRetryCancelled = true; - }; - const continueRetry = () => { - isRetryCancelled = false; - }; - const canContinue = () => import_focusManager.focusManager.isFocused() && (config.networkMode === "always" || import_onlineManager.onlineManager.isOnline()) && config.canRun(); - const canStart = () => canFetch(config.networkMode) && config.canRun(); - const resolve = (value) => { - if (!isResolved()) { - continueFn == null ? void 0 : continueFn(); - thenable.resolve(value); - } - }; - const reject = (value) => { - if (!isResolved()) { - continueFn == null ? void 0 : continueFn(); - thenable.reject(value); - } - }; - const pause = () => { - return new Promise((continueResolve) => { - var _a; - continueFn = (value) => { - if (isResolved() || canContinue()) { - continueResolve(value); - } - }; - (_a = config.onPause) == null ? void 0 : _a.call(config); - }).then(() => { - var _a; - continueFn = void 0; - if (!isResolved()) { - (_a = config.onContinue) == null ? void 0 : _a.call(config); - } - }); - }; - const run = () => { - if (isResolved()) { - return; - } - let promiseOrValue; - const initialPromise = failureCount === 0 ? config.initialPromise : void 0; - try { - promiseOrValue = initialPromise ?? config.fn(); - } catch (error) { - promiseOrValue = Promise.reject(error); - } - Promise.resolve(promiseOrValue).then(resolve).catch((error) => { - var _a; - if (isResolved()) { - return; - } - const retry = config.retry ?? (import_utils.isServer ? 0 : 3); - const retryDelay = config.retryDelay ?? defaultRetryDelay; - const delay = typeof retryDelay === "function" ? retryDelay(failureCount, error) : retryDelay; - const shouldRetry = retry === true || typeof retry === "number" && failureCount < retry || typeof retry === "function" && retry(failureCount, error); - if (isRetryCancelled || !shouldRetry) { - reject(error); - return; - } - failureCount++; - (_a = config.onFail) == null ? void 0 : _a.call(config, failureCount, error); - (0, import_utils.sleep)(delay).then(() => { - return canContinue() ? void 0 : pause(); - }).then(() => { - if (isRetryCancelled) { - reject(error); - } else { - run(); - } - }); - }); - }; - return { - promise: thenable, - status: () => thenable.status, - cancel, - continue: () => { - continueFn == null ? void 0 : continueFn(); - return thenable; - }, - cancelRetry, - continueRetry, - canStart, - start: () => { - if (canStart()) { - run(); - } else { - pause().then(run); - } - return thenable; - } - }; -} -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - CancelledError, - canFetch, - createRetryer, - isCancelledError -}); -//# sourceMappingURL=retryer.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/retryer.cjs.map b/node_modules/@tanstack/query-core/build/legacy/retryer.cjs.map deleted file mode 100644 index c935efd..0000000 --- a/node_modules/@tanstack/query-core/build/legacy/retryer.cjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/retryer.ts"],"sourcesContent":["import { focusManager } from './focusManager'\nimport { onlineManager } from './onlineManager'\nimport { pendingThenable } from './thenable'\nimport { isServer, sleep } from './utils'\nimport type { Thenable } from './thenable'\nimport type { CancelOptions, DefaultError, NetworkMode } from './types'\n\n// TYPES\n\ninterface RetryerConfig {\n fn: () => TData | Promise\n initialPromise?: Promise\n onCancel?: (error: TError) => void\n onFail?: (failureCount: number, error: TError) => void\n onPause?: () => void\n onContinue?: () => void\n retry?: RetryValue\n retryDelay?: RetryDelayValue\n networkMode: NetworkMode | undefined\n canRun: () => boolean\n}\n\nexport interface Retryer {\n promise: Promise\n cancel: (cancelOptions?: CancelOptions) => void\n continue: () => Promise\n cancelRetry: () => void\n continueRetry: () => void\n canStart: () => boolean\n start: () => Promise\n status: () => 'pending' | 'resolved' | 'rejected'\n}\n\nexport type RetryValue = boolean | number | ShouldRetryFunction\n\ntype ShouldRetryFunction = (\n failureCount: number,\n error: TError,\n) => boolean\n\nexport type RetryDelayValue = number | RetryDelayFunction\n\ntype RetryDelayFunction = (\n failureCount: number,\n error: TError,\n) => number\n\nfunction defaultRetryDelay(failureCount: number) {\n return Math.min(1000 * 2 ** failureCount, 30000)\n}\n\nexport function canFetch(networkMode: NetworkMode | undefined): boolean {\n return (networkMode ?? 'online') === 'online'\n ? onlineManager.isOnline()\n : true\n}\n\nexport class CancelledError extends Error {\n revert?: boolean\n silent?: boolean\n constructor(options?: CancelOptions) {\n super('CancelledError')\n this.revert = options?.revert\n this.silent = options?.silent\n }\n}\n\n/**\n * @deprecated Use instanceof `CancelledError` instead.\n */\nexport function isCancelledError(value: any): value is CancelledError {\n return value instanceof CancelledError\n}\n\nexport function createRetryer(\n config: RetryerConfig,\n): Retryer {\n let isRetryCancelled = false\n let failureCount = 0\n let continueFn: ((value?: unknown) => void) | undefined\n\n const thenable = pendingThenable()\n\n const isResolved = () =>\n (thenable.status as Thenable['status']) !== 'pending'\n\n const cancel = (cancelOptions?: CancelOptions): void => {\n if (!isResolved()) {\n const error = new CancelledError(cancelOptions) as TError\n reject(error)\n\n config.onCancel?.(error)\n }\n }\n const cancelRetry = () => {\n isRetryCancelled = true\n }\n\n const continueRetry = () => {\n isRetryCancelled = false\n }\n\n const canContinue = () =>\n focusManager.isFocused() &&\n (config.networkMode === 'always' || onlineManager.isOnline()) &&\n config.canRun()\n\n const canStart = () => canFetch(config.networkMode) && config.canRun()\n\n const resolve = (value: any) => {\n if (!isResolved()) {\n continueFn?.()\n thenable.resolve(value)\n }\n }\n\n const reject = (value: any) => {\n if (!isResolved()) {\n continueFn?.()\n thenable.reject(value)\n }\n }\n\n const pause = () => {\n return new Promise((continueResolve) => {\n continueFn = (value) => {\n if (isResolved() || canContinue()) {\n continueResolve(value)\n }\n }\n config.onPause?.()\n }).then(() => {\n continueFn = undefined\n if (!isResolved()) {\n config.onContinue?.()\n }\n })\n }\n\n // Create loop function\n const run = () => {\n // Do nothing if already resolved\n if (isResolved()) {\n return\n }\n\n let promiseOrValue: any\n\n // we can re-use config.initialPromise on the first call of run()\n const initialPromise =\n failureCount === 0 ? config.initialPromise : undefined\n\n // Execute query\n try {\n promiseOrValue = initialPromise ?? config.fn()\n } catch (error) {\n promiseOrValue = Promise.reject(error)\n }\n\n Promise.resolve(promiseOrValue)\n .then(resolve)\n .catch((error) => {\n // Stop if the fetch is already resolved\n if (isResolved()) {\n return\n }\n\n // Do we need to retry the request?\n const retry = config.retry ?? (isServer ? 0 : 3)\n const retryDelay = config.retryDelay ?? defaultRetryDelay\n const delay =\n typeof retryDelay === 'function'\n ? retryDelay(failureCount, error)\n : retryDelay\n const shouldRetry =\n retry === true ||\n (typeof retry === 'number' && failureCount < retry) ||\n (typeof retry === 'function' && retry(failureCount, error))\n\n if (isRetryCancelled || !shouldRetry) {\n // We are done if the query does not need to be retried\n reject(error)\n return\n }\n\n failureCount++\n\n // Notify on fail\n config.onFail?.(failureCount, error)\n\n // Delay\n sleep(delay)\n // Pause if the document is not visible or when the device is offline\n .then(() => {\n return canContinue() ? undefined : pause()\n })\n .then(() => {\n if (isRetryCancelled) {\n reject(error)\n } else {\n run()\n }\n })\n })\n }\n\n return {\n promise: thenable,\n status: () => thenable.status,\n cancel,\n continue: () => {\n continueFn?.()\n return thenable\n },\n cancelRetry,\n continueRetry,\n canStart,\n start: () => {\n // Start loop\n if (canStart()) {\n run()\n } else {\n pause().then(run)\n }\n return thenable\n },\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,0BAA6B;AAC7B,2BAA8B;AAC9B,sBAAgC;AAChC,mBAAgC;AA4ChC,SAAS,kBAAkB,cAAsB;AAC/C,SAAO,KAAK,IAAI,MAAO,KAAK,cAAc,GAAK;AACjD;AAEO,SAAS,SAAS,aAA+C;AACtE,UAAQ,eAAe,cAAc,WACjC,mCAAc,SAAS,IACvB;AACN;AAEO,I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AAI,SAAS,GAAG;AACd,YAAI;AAAA,MACN,OAAO;AACL,cAAM,EAAE,KAAK,GAAG;AAAA,MAClB;AACA,aAAO;AAAA,IACT;AAAA,EACF;AACF;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/retryer.d.cts b/node_modules/@tanstack/query-core/build/legacy/retryer.d.cts deleted file mode 100644 index d348311..0000000 --- a/node_modules/@tanstack/query-core/build/legacy/retryer.d.cts +++ /dev/null @@ -1,3 +0,0 @@ -export { C as CancelledError, bE as RetryDelayValue, bD as RetryValue, bC as Retryer, bF as canFetch, bG as createRetryer, j as isCancelledError } from './hydration-uphG6M-i.cjs'; -import './removable.cjs'; -import './subscribable.cjs'; diff --git a/node_modules/@tanstack/query-core/build/legacy/retryer.d.ts b/node_modules/@tanstack/query-core/build/legacy/retryer.d.ts deleted file mode 100644 index 87ee12a..0000000 --- a/node_modules/@tanstack/query-core/build/legacy/retryer.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export { C as CancelledError, bE as RetryDelayValue, bD as RetryValue, bC as Retryer, bF as canFetch, bG as createRetryer, j as isCancelledError } from './hydration-BlEVG2Lp.js'; -import './removable.js'; -import './subscribable.js'; diff --git a/node_modules/@tanstack/query-core/build/legacy/retryer.js b/node_modules/@tanstack/query-core/build/legacy/retryer.js deleted file mode 100644 index ae8322b..0000000 --- a/node_modules/@tanstack/query-core/build/legacy/retryer.js +++ /dev/null @@ -1,139 +0,0 @@ -import "./chunk-PXG64RU4.js"; - -// src/retryer.ts -import { focusManager } from "./focusManager.js"; -import { onlineManager } from "./onlineManager.js"; -import { pendingThenable } from "./thenable.js"; -import { isServer, sleep } from "./utils.js"; -function defaultRetryDelay(failureCount) { - return Math.min(1e3 * 2 ** failureCount, 3e4); -} -function canFetch(networkMode) { - return (networkMode ?? "online") === "online" ? onlineManager.isOnline() : true; -} -var CancelledError = class extends Error { - constructor(options) { - super("CancelledError"); - this.revert = options == null ? void 0 : options.revert; - this.silent = options == null ? void 0 : options.silent; - } -}; -function isCancelledError(value) { - return value instanceof CancelledError; -} -function createRetryer(config) { - let isRetryCancelled = false; - let failureCount = 0; - let continueFn; - const thenable = pendingThenable(); - const isResolved = () => thenable.status !== "pending"; - const cancel = (cancelOptions) => { - var _a; - if (!isResolved()) { - const error = new CancelledError(cancelOptions); - reject(error); - (_a = config.onCancel) == null ? void 0 : _a.call(config, error); - } - }; - const cancelRetry = () => { - isRetryCancelled = true; - }; - const continueRetry = () => { - isRetryCancelled = false; - }; - const canContinue = () => focusManager.isFocused() && (config.networkMode === "always" || onlineManager.isOnline()) && config.canRun(); - const canStart = () => canFetch(config.networkMode) && config.canRun(); - const resolve = (value) => { - if (!isResolved()) { - continueFn == null ? void 0 : continueFn(); - thenable.resolve(value); - } - }; - const reject = (value) => { - if (!isResolved()) { - continueFn == null ? void 0 : continueFn(); - thenable.reject(value); - } - }; - const pause = () => { - return new Promise((continueResolve) => { - var _a; - continueFn = (value) => { - if (isResolved() || canContinue()) { - continueResolve(value); - } - }; - (_a = config.onPause) == null ? void 0 : _a.call(config); - }).then(() => { - var _a; - continueFn = void 0; - if (!isResolved()) { - (_a = config.onContinue) == null ? void 0 : _a.call(config); - } - }); - }; - const run = () => { - if (isResolved()) { - return; - } - let promiseOrValue; - const initialPromise = failureCount === 0 ? config.initialPromise : void 0; - try { - promiseOrValue = initialPromise ?? config.fn(); - } catch (error) { - promiseOrValue = Promise.reject(error); - } - Promise.resolve(promiseOrValue).then(resolve).catch((error) => { - var _a; - if (isResolved()) { - return; - } - const retry = config.retry ?? (isServer ? 0 : 3); - const retryDelay = config.retryDelay ?? defaultRetryDelay; - const delay = typeof retryDelay === "function" ? retryDelay(failureCount, error) : retryDelay; - const shouldRetry = retry === true || typeof retry === "number" && failureCount < retry || typeof retry === "function" && retry(failureCount, error); - if (isRetryCancelled || !shouldRetry) { - reject(error); - return; - } - failureCount++; - (_a = config.onFail) == null ? void 0 : _a.call(config, failureCount, error); - sleep(delay).then(() => { - return canContinue() ? void 0 : pause(); - }).then(() => { - if (isRetryCancelled) { - reject(error); - } else { - run(); - } - }); - }); - }; - return { - promise: thenable, - status: () => thenable.status, - cancel, - continue: () => { - continueFn == null ? void 0 : continueFn(); - return thenable; - }, - cancelRetry, - continueRetry, - canStart, - start: () => { - if (canStart()) { - run(); - } else { - pause().then(run); - } - return thenable; - } - }; -} -export { - CancelledError, - canFetch, - createRetryer, - isCancelledError -}; -//# sourceMappingURL=retryer.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/retryer.js.map b/node_modules/@tanstack/query-core/build/legacy/retryer.js.map deleted file mode 100644 index 152827d..0000000 --- a/node_modules/@tanstack/query-core/build/legacy/retryer.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/retryer.ts"],"sourcesContent":["import { focusManager } from './focusManager'\nimport { onlineManager } from './onlineManager'\nimport { pendingThenable } from './thenable'\nimport { isServer, sleep } from './utils'\nimport type { Thenable } from './thenable'\nimport type { CancelOptions, DefaultError, NetworkMode } from './types'\n\n// TYPES\n\ninterface RetryerConfig {\n fn: () => TData | Promise\n initialPromise?: Promise\n onCancel?: (error: TError) => void\n onFail?: (failureCount: number, error: TError) => void\n onPause?: () => void\n onContinue?: () => void\n retry?: RetryValue\n retryDelay?: RetryDelayValue\n networkMode: NetworkMode | undefined\n canRun: () => boolean\n}\n\nexport interface Retryer {\n promise: Promise\n cancel: (cancelOptions?: CancelOptions) => void\n continue: () => Promise\n cancelRetry: () => void\n continueRetry: () => void\n canStart: () => boolean\n start: () => Promise\n status: () => 'pending' | 'resolved' | 'rejected'\n}\n\nexport type RetryValue = boolean | number | ShouldRetryFunction\n\ntype ShouldRetryFunction = (\n failureCount: number,\n error: TError,\n) => boolean\n\nexport type RetryDelayValue = number | RetryDelayFunction\n\ntype RetryDelayFunction = (\n failureCount: number,\n error: TError,\n) => number\n\nfunction defaultRetryDelay(failureCount: number) {\n return Math.min(1000 * 2 ** failureCount, 30000)\n}\n\nexport function canFetch(networkMode: NetworkMode | undefined): boolean {\n return (networkMode ?? 'online') === 'online'\n ? onlineManager.isOnline()\n : true\n}\n\nexport class CancelledError extends Error {\n revert?: boolean\n silent?: boolean\n constructor(options?: CancelOptions) {\n super('CancelledError')\n this.revert = options?.revert\n this.silent = options?.silent\n }\n}\n\n/**\n * @deprecated Use instanceof `CancelledError` instead.\n */\nexport function isCancelledError(value: any): value is CancelledError {\n return value instanceof CancelledError\n}\n\nexport function createRetryer(\n config: RetryerConfig,\n): Retryer {\n let isRetryCancelled = false\n let failureCount = 0\n let continueFn: ((value?: unknown) => void) | undefined\n\n const thenable = pendingThenable()\n\n const isResolved = () =>\n (thenable.status as Thenable['status']) !== 'pending'\n\n const cancel = (cancelOptions?: CancelOptions): void => {\n if (!isResolved()) {\n const error = new CancelledError(cancelOptions) as TError\n reject(error)\n\n config.onCancel?.(error)\n }\n }\n const cancelRetry = () => {\n isRetryCancelled = true\n }\n\n const continueRetry = () => {\n isRetryCancelled = false\n }\n\n const canContinue = () =>\n focusManager.isFocused() &&\n (config.networkMode === 'always' || onlineManager.isOnline()) &&\n config.canRun()\n\n const canStart = () => canFetch(config.networkMode) && config.canRun()\n\n const resolve = (value: any) => {\n if (!isResolved()) {\n continueFn?.()\n thenable.resolve(value)\n }\n }\n\n const reject = (value: any) => {\n if (!isResolved()) {\n continueFn?.()\n thenable.reject(value)\n }\n }\n\n const pause = () => {\n return new Promise((continueResolve) => {\n continueFn = (value) => {\n if (isResolved() || canContinue()) {\n continueResolve(value)\n }\n }\n config.onPause?.()\n }).then(() => {\n continueFn = undefined\n if (!isResolved()) {\n config.onContinue?.()\n }\n })\n }\n\n // Create loop function\n const run = () => {\n // Do nothing if already resolved\n if (isResolved()) {\n return\n }\n\n let promiseOrValue: any\n\n // we can re-use config.initialPromise on the first call of run()\n const initialPromise =\n failureCount === 0 ? config.initialPromise : undefined\n\n // Execute query\n try {\n promiseOrValue = initialPromise ?? config.fn()\n } catch (error) {\n promiseOrValue = Promise.reject(error)\n }\n\n Promise.resolve(promiseOrValue)\n .then(resolve)\n .catch((error) => {\n // Stop if the fetch is already resolved\n if (isResolved()) {\n return\n }\n\n // Do we need to retry the request?\n const retry = config.retry ?? (isServer ? 0 : 3)\n const retryDelay = config.retryDelay ?? defaultRetryDelay\n const delay =\n typeof retryDelay === 'function'\n ? retryDelay(failureCount, error)\n : retryDelay\n const shouldRetry =\n retry === true ||\n (typeof retry === 'number' && failureCount < retry) ||\n (typeof retry === 'function' && retry(failureCount, error))\n\n if (isRetryCancelled || !shouldRetry) {\n // We are done if the query does not need to be retried\n reject(error)\n return\n }\n\n failureCount++\n\n // Notify on fail\n config.onFail?.(failureCount, error)\n\n // Delay\n sleep(delay)\n // Pause if the document is not visible or when the device is offline\n .then(() => {\n return canContinue() ? undefined : pause()\n })\n .then(() => {\n if (isRetryCancelled) {\n reject(error)\n } else {\n run()\n }\n })\n })\n }\n\n return {\n promise: thenable,\n status: () => thenable.status,\n cancel,\n continue: () => {\n continueFn?.()\n return thenable\n },\n cancelRetry,\n continueRetry,\n canStart,\n start: () => {\n // Start loop\n if (canStart()) {\n run()\n } else {\n pause().then(run)\n }\n return thenable\n },\n }\n}\n"],"mappings":";;;AAAA,SAAS,oBAAoB;AAC7B,SAAS,qBAAqB;AAC9B,SAAS,uBAAuB;AAChC,SAAS,UAAU,aAAa;AA4ChC,SAAS,kBAAkB,cAAsB;AAC/C,SAAO,KAAK,IAAI,MAAO,KAAK,cAAc,GAAK;AACjD;AAEO,SAAS,SAAS,aAA+C;AACtE,UAAQ,eAAe,cAAc,WACjC,cAAc,SAAS,IACvB;AACN;AAEO,IAAM,iBAAN,cAA6B,MAAM;AAAA,EAGxC,YAAY,SAAyB;AACnC,UAAM,gBAAgB;AACtB,SAAK,SAAS,mCAAS;AACvB,SAAK,SAAS,mCAAS;AAAA,EACzB;AACF;AAKO,SAAS,iBAAiB,OAAqC;AACpE,SAAO,iBAAiB;AAC1B;AAEO,SAAS,cACd,QACgB;AAChB,MAAI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iBAAiB;AAG/C,QAAI;AACF,uBAAiB,kBAAkB,OAAO,GAAG;AAAA,IAC/C,SAAS,OAAO;AACd,uBAAiB,QAAQ,OAAO,KAAK;AAAA,IACvC;AAEA,YAAQ,QAAQ,cAAc,EAC3B,KAAK,OAAO,EACZ,MAAM,CAAC,UAAU;AAjKxB;AAmKQ,UAAI,WAAW,GAAG;AAChB;AAAA,MACF;AAGA,YAAM,QAAQ,OAAO,UAAU,WAAW,IAAI;AAC9C,YAAM,aAAa,OAAO,cAAc;AACxC,YAAM,QACJ,OAAO,eAAe,aAClB,WAAW,cAAc,KAAK,IAC9B;AACN,YAAM,cACJ,UAAU,QACT,OAAO,UAAU,YAAY,eAAe,SAC5C,OAAO,UAAU,cAAc,MAAM,cAAc,KAAK;AAE3D,UAAI,oBAAoB,CAAC,aAAa;AAEpC,eAAO,KAAK;AACZ;AAAA,MACF;AAEA;AAGA,mBAAO,WAAP,gCAAgB,cAAc;AAG9B,YAAM,KAAK,EAER,KAAK,MAAM;AACV,eAAO,YAAY,IAAI,SAAY,MAAM;AAAA,MAC3C,CAAC,EACA,KAAK,MAAM;AACV,YAAI,kBAAkB;AACpB,iBAAO,KAAK;AAAA,QACd,OAAO;AACL,cAAI;AAAA,QACN;AAAA,MACF,CAAC;AAAA,IACL,CAAC;AAAA,EACL;AAEA,SAAO;AAAA,IACL,SAAS;AAAA,IACT,QAAQ,MAAM,SAAS;AAAA,IACvB;AAAA,IACA,UAAU,MAAM;AACd;AACA,aAAO;AAAA,IACT;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,OAAO,MAAM;AAEX,UAAI,SAAS,GAAG;AACd,YAAI;AAAA,MACN,OAAO;AACL,cAAM,EAAE,KAAK,GAAG;AAAA,MAClB;AACA,aAAO;AAAA,IACT;AAAA,EACF;AACF;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/streamedQuery.cjs b/node_modules/@tanstack/query-core/build/legacy/streamedQuery.cjs deleted file mode 100644 index 5752fe9..0000000 --- a/node_modules/@tanstack/query-core/build/legacy/streamedQuery.cjs +++ /dev/null @@ -1,82 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// src/streamedQuery.ts -var streamedQuery_exports = {}; -__export(streamedQuery_exports, { - streamedQuery: () => streamedQuery -}); -module.exports = __toCommonJS(streamedQuery_exports); -var import_utils = require("./utils.cjs"); -function streamedQuery({ - streamFn, - refetchMode = "reset", - reducer = (items, chunk) => (0, import_utils.addToEnd)(items, chunk), - initialValue = [] -}) { - return async (context) => { - const query = context.client.getQueryCache().find({ queryKey: context.queryKey, exact: true }); - const isRefetch = !!query && query.state.data !== void 0; - if (isRefetch && refetchMode === "reset") { - query.setState({ - status: "pending", - data: void 0, - error: null, - fetchStatus: "fetching" - }); - } - let result = initialValue; - let cancelled = false; - const streamFnContext = (0, import_utils.addConsumeAwareSignal)( - { - client: context.client, - meta: context.meta, - queryKey: context.queryKey, - pageParam: context.pageParam, - direction: context.direction - }, - () => context.signal, - () => cancelled = true - ); - const stream = await streamFn(streamFnContext); - const isReplaceRefetch = isRefetch && refetchMode === "replace"; - for await (const chunk of stream) { - if (cancelled) { - break; - } - if (isReplaceRefetch) { - result = reducer(result, chunk); - } else { - context.client.setQueryData( - context.queryKey, - (prev) => reducer(prev === void 0 ? initialValue : prev, chunk) - ); - } - } - if (isReplaceRefetch && !cancelled) { - context.client.setQueryData(context.queryKey, result); - } - return context.client.getQueryData(context.queryKey) ?? initialValue; - }; -} -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - streamedQuery -}); -//# sourceMappingURL=streamedQuery.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/streamedQuery.cjs.map b/node_modules/@tanstack/query-core/build/legacy/streamedQuery.cjs.map deleted file mode 100644 index 37ef7ac..0000000 --- a/node_modules/@tanstack/query-core/build/legacy/streamedQuery.cjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/streamedQuery.ts"],"sourcesContent":["import { addConsumeAwareSignal, addToEnd } from './utils'\nimport type {\n OmitKeyof,\n QueryFunction,\n QueryFunctionContext,\n QueryKey,\n} from './types'\n\ntype BaseStreamedQueryParams = {\n streamFn: (\n context: QueryFunctionContext,\n ) => AsyncIterable | Promise>\n refetchMode?: 'append' | 'reset' | 'replace'\n}\n\ntype SimpleStreamedQueryParams<\n TQueryFnData,\n TQueryKey extends QueryKey,\n> = BaseStreamedQueryParams & {\n reducer?: never\n initialValue?: never\n}\n\ntype ReducibleStreamedQueryParams<\n TQueryFnData,\n TData,\n TQueryKey extends QueryKey,\n> = BaseStreamedQueryParams & {\n reducer: (acc: TData, chunk: TQueryFnData) => TData\n initialValue: TData\n}\n\ntype StreamedQueryParams =\n | SimpleStreamedQueryParams\n | ReducibleStreamedQueryParams\n\n/**\n * This is a helper function to create a query function that streams data from an AsyncIterable.\n * Data will be an Array of all the chunks received.\n * The query will be in a 'pending' state until the first chunk of data is received, but will go to 'success' after that.\n * The query will stay in fetchStatus 'fetching' until the stream ends.\n * @param queryFn - The function that returns an AsyncIterable to stream data from.\n * @param refetchMode - Defines how re-fetches are handled.\n * Defaults to `'reset'`, erases all data and puts the query back into `pending` state.\n * Set to `'append'` to append new data to the existing data.\n * Set to `'replace'` to write all data to the cache once the stream ends.\n * @param reducer - A function to reduce the streamed chunks into the final data.\n * Defaults to a function that appends chunks to the end of the array.\n * @param initialValue - Initial value to be used while the first chunk is being fetched, and returned if the stream yields no values.\n */\nexport function streamedQuery<\n TQueryFnData = unknown,\n TData = Array,\n TQueryKey extends QueryKey = QueryKey,\n>({\n streamFn,\n refetchMode = 'reset',\n reducer = (items, chunk) =>\n addToEnd(items as Array, chunk) as TData,\n initialValue = [] as TData,\n}: StreamedQueryParams): QueryFunction<\n TData,\n TQueryKey\n> {\n return async (context) => {\n const query = context.client\n .getQueryCache()\n .find({ queryKey: context.queryKey, exact: true })\n const isRefetch = !!query && query.state.data !== undefined\n if (isRefetch && refetchMode === 'reset') {\n query.setState({\n status: 'pending',\n data: undefined,\n error: null,\n fetchStatus: 'fetching',\n })\n }\n\n let result = initialValue\n\n let cancelled: boolean = false as boolean\n const streamFnContext = addConsumeAwareSignal<\n OmitKeyof\n >(\n {\n client: context.client,\n meta: context.meta,\n queryKey: context.queryKey,\n pageParam: context.pageParam,\n direction: context.direction,\n },\n () => context.signal,\n () => (cancelled = true),\n )\n\n const stream = await streamFn(streamFnContext)\n\n const isReplaceRefetch = isRefetch && refetchMode === 'replace'\n\n for await (const chunk of stream) {\n if (cancelled) {\n break\n }\n\n if (isReplaceRefetch) {\n // don't append to the cache directly when replace-refetching\n result = reducer(result, chunk)\n } else {\n context.client.setQueryData(context.queryKey, (prev) =>\n reducer(prev === undefined ? initialValue : prev, chunk),\n )\n }\n }\n\n // finalize result: replace-refetching needs to write to the cache\n if (isReplaceRefetch && !cancelled) {\n context.client.setQueryData(context.queryKey, result)\n }\n\n return context.client.getQueryData(context.queryKey) ?? initialValue\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAgD;AAkDzC,SAAS,cAId;AAAA,EACA;AAAA,EACA,cAAc;AAAA,EACd,UAAU,CAAC,OAAO,cAChB,uBAAS,OAA8B,KAAK;AAAA,EAC9C,eAAe,CAAC;AAClB,GAGE;AACA,SAAO,OAAO,YAAY;AACxB,UAAM,QAAQ,QAAQ,OACnB,cAAc,EACd,KAAK,EAAE,UAAU,QAAQ,UAAU,OAAO,KAAK,CAAC;AACnD,UAAM,YAAY,CAAC,CAAC,SAAS,MAAM,MAAM,SAAS;AAClD,QAAI,aAAa,gBAAgB,SAAS;AACxC,YAAM,SAAS;AAAA,QACb,QAAQ;AAAA,QACR,MAAM;AAAA,QACN,OAAO;AAAA,QACP,aAAa;AAAA,MACf,CAAC;AAAA,IACH;AAEA,QAAI,SAAS;AAEb,QAAI,YAAqB;AACzB,UAAM,sBAAkB;AAAA,MAGtB;AAAA,QACE,QAAQ,QAAQ;AAAA,QAChB,MAAM,QAAQ;AAAA,QACd,UAAU,QAAQ;AAAA,QAClB,WAAW,QAAQ;AAAA,QACnB,WAAW,QAAQ;AAAA,MACrB;AAAA,MACA,MAAM,QAAQ;AAAA,MACd,MAAO,YAAY;AAAA,IACrB;AAEA,UAAM,SAAS,MAAM,SAAS,eAAe;AAE7C,UAAM,mBAAmB,aAAa,gBAAgB;AAEtD,qBAAiB,SAAS,QAAQ;AAChC,UAAI,WAAW;AACb;AAAA,MACF;AAEA,UAAI,kBAAkB;AAEpB,iBAAS,QAAQ,QAAQ,KAAK;AAAA,MAChC,OAAO;AACL,gBAAQ,OAAO;AAAA,UAAoB,QAAQ;AAAA,UAAU,CAAC,SACpD,QAAQ,SAAS,SAAY,eAAe,MAAM,KAAK;AAAA,QACzD;AAAA,MACF;AAAA,IACF;AAGA,QAAI,oBAAoB,CAAC,WAAW;AAClC,cAAQ,OAAO,aAAoB,QAAQ,UAAU,MAAM;AAAA,IAC7D;AAEA,WAAO,QAAQ,OAAO,aAAa,QAAQ,QAAQ,KAAK;AAAA,EAC1D;AACF;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/streamedQuery.d.cts b/node_modules/@tanstack/query-core/build/legacy/streamedQuery.d.cts deleted file mode 100644 index c133466..0000000 --- a/node_modules/@tanstack/query-core/build/legacy/streamedQuery.d.cts +++ /dev/null @@ -1,34 +0,0 @@ -import { I as QueryKey, a1 as QueryFunctionContext, Y as QueryFunction } from './hydration-uphG6M-i.cjs'; -import './removable.cjs'; -import './subscribable.cjs'; - -type BaseStreamedQueryParams = { - streamFn: (context: QueryFunctionContext) => AsyncIterable | Promise>; - refetchMode?: 'append' | 'reset' | 'replace'; -}; -type SimpleStreamedQueryParams = BaseStreamedQueryParams & { - reducer?: never; - initialValue?: never; -}; -type ReducibleStreamedQueryParams = BaseStreamedQueryParams & { - reducer: (acc: TData, chunk: TQueryFnData) => TData; - initialValue: TData; -}; -type StreamedQueryParams = SimpleStreamedQueryParams | ReducibleStreamedQueryParams; -/** - * This is a helper function to create a query function that streams data from an AsyncIterable. - * Data will be an Array of all the chunks received. - * The query will be in a 'pending' state until the first chunk of data is received, but will go to 'success' after that. - * The query will stay in fetchStatus 'fetching' until the stream ends. - * @param queryFn - The function that returns an AsyncIterable to stream data from. - * @param refetchMode - Defines how re-fetches are handled. - * Defaults to `'reset'`, erases all data and puts the query back into `pending` state. - * Set to `'append'` to append new data to the existing data. - * Set to `'replace'` to write all data to the cache once the stream ends. - * @param reducer - A function to reduce the streamed chunks into the final data. - * Defaults to a function that appends chunks to the end of the array. - * @param initialValue - Initial value to be used while the first chunk is being fetched, and returned if the stream yields no values. - */ -declare function streamedQuery, TQueryKey extends QueryKey = QueryKey>({ streamFn, refetchMode, reducer, initialValue, }: StreamedQueryParams): QueryFunction; - -export { streamedQuery }; diff --git a/node_modules/@tanstack/query-core/build/legacy/streamedQuery.d.ts b/node_modules/@tanstack/query-core/build/legacy/streamedQuery.d.ts deleted file mode 100644 index 44d3ec4..0000000 --- a/node_modules/@tanstack/query-core/build/legacy/streamedQuery.d.ts +++ /dev/null @@ -1,34 +0,0 @@ -import { I as QueryKey, a1 as QueryFunctionContext, Y as QueryFunction } from './hydration-BlEVG2Lp.js'; -import './removable.js'; -import './subscribable.js'; - -type BaseStreamedQueryParams = { - streamFn: (context: QueryFunctionContext) => AsyncIterable | Promise>; - refetchMode?: 'append' | 'reset' | 'replace'; -}; -type SimpleStreamedQueryParams = BaseStreamedQueryParams & { - reducer?: never; - initialValue?: never; -}; -type ReducibleStreamedQueryParams = BaseStreamedQueryParams & { - reducer: (acc: TData, chunk: TQueryFnData) => TData; - initialValue: TData; -}; -type StreamedQueryParams = SimpleStreamedQueryParams | ReducibleStreamedQueryParams; -/** - * This is a helper function to create a query function that streams data from an AsyncIterable. - * Data will be an Array of all the chunks received. - * The query will be in a 'pending' state until the first chunk of data is received, but will go to 'success' after that. - * The query will stay in fetchStatus 'fetching' until the stream ends. - * @param queryFn - The function that returns an AsyncIterable to stream data from. - * @param refetchMode - Defines how re-fetches are handled. - * Defaults to `'reset'`, erases all data and puts the query back into `pending` state. - * Set to `'append'` to append new data to the existing data. - * Set to `'replace'` to write all data to the cache once the stream ends. - * @param reducer - A function to reduce the streamed chunks into the final data. - * Defaults to a function that appends chunks to the end of the array. - * @param initialValue - Initial value to be used while the first chunk is being fetched, and returned if the stream yields no values. - */ -declare function streamedQuery, TQueryKey extends QueryKey = QueryKey>({ streamFn, refetchMode, reducer, initialValue, }: StreamedQueryParams): QueryFunction; - -export { streamedQuery }; diff --git a/node_modules/@tanstack/query-core/build/legacy/streamedQuery.js b/node_modules/@tanstack/query-core/build/legacy/streamedQuery.js deleted file mode 100644 index 0c273aa..0000000 --- a/node_modules/@tanstack/query-core/build/legacy/streamedQuery.js +++ /dev/null @@ -1,59 +0,0 @@ -import "./chunk-PXG64RU4.js"; - -// src/streamedQuery.ts -import { addConsumeAwareSignal, addToEnd } from "./utils.js"; -function streamedQuery({ - streamFn, - refetchMode = "reset", - reducer = (items, chunk) => addToEnd(items, chunk), - initialValue = [] -}) { - return async (context) => { - const query = context.client.getQueryCache().find({ queryKey: context.queryKey, exact: true }); - const isRefetch = !!query && query.state.data !== void 0; - if (isRefetch && refetchMode === "reset") { - query.setState({ - status: "pending", - data: void 0, - error: null, - fetchStatus: "fetching" - }); - } - let result = initialValue; - let cancelled = false; - const streamFnContext = addConsumeAwareSignal( - { - client: context.client, - meta: context.meta, - queryKey: context.queryKey, - pageParam: context.pageParam, - direction: context.direction - }, - () => context.signal, - () => cancelled = true - ); - const stream = await streamFn(streamFnContext); - const isReplaceRefetch = isRefetch && refetchMode === "replace"; - for await (const chunk of stream) { - if (cancelled) { - break; - } - if (isReplaceRefetch) { - result = reducer(result, chunk); - } else { - context.client.setQueryData( - context.queryKey, - (prev) => reducer(prev === void 0 ? initialValue : prev, chunk) - ); - } - } - if (isReplaceRefetch && !cancelled) { - context.client.setQueryData(context.queryKey, result); - } - return context.client.getQueryData(context.queryKey) ?? initialValue; - }; -} -export { - streamedQuery -}; -//# sourceMappingURL=streamedQuery.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/streamedQuery.js.map b/node_modules/@tanstack/query-core/build/legacy/streamedQuery.js.map deleted file mode 100644 index 6fd1c35..0000000 --- a/node_modules/@tanstack/query-core/build/legacy/streamedQuery.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/streamedQuery.ts"],"sourcesContent":["import { addConsumeAwareSignal, addToEnd } from './utils'\nimport type {\n OmitKeyof,\n QueryFunction,\n QueryFunctionContext,\n QueryKey,\n} from './types'\n\ntype BaseStreamedQueryParams = {\n streamFn: (\n context: QueryFunctionContext,\n ) => AsyncIterable | Promise>\n refetchMode?: 'append' | 'reset' | 'replace'\n}\n\ntype SimpleStreamedQueryParams<\n TQueryFnData,\n TQueryKey extends QueryKey,\n> = BaseStreamedQueryParams & {\n reducer?: never\n initialValue?: never\n}\n\ntype ReducibleStreamedQueryParams<\n TQueryFnData,\n TData,\n TQueryKey extends QueryKey,\n> = BaseStreamedQueryParams & {\n reducer: (acc: TData, chunk: TQueryFnData) => TData\n initialValue: TData\n}\n\ntype StreamedQueryParams =\n | SimpleStreamedQueryParams\n | ReducibleStreamedQueryParams\n\n/**\n * This is a helper function to create a query function that streams data from an AsyncIterable.\n * Data will be an Array of all the chunks received.\n * The query will be in a 'pending' state until the first chunk of data is received, but will go to 'success' after that.\n * The query will stay in fetchStatus 'fetching' until the stream ends.\n * @param queryFn - The function that returns an AsyncIterable to stream data from.\n * @param refetchMode - Defines how re-fetches are handled.\n * Defaults to `'reset'`, erases all data and puts the query back into `pending` state.\n * Set to `'append'` to append new data to the existing data.\n * Set to `'replace'` to write all data to the cache once the stream ends.\n * @param reducer - A function to reduce the streamed chunks into the final data.\n * Defaults to a function that appends chunks to the end of the array.\n * @param initialValue - Initial value to be used while the first chunk is being fetched, and returned if the stream yields no values.\n */\nexport function streamedQuery<\n TQueryFnData = unknown,\n TData = Array,\n TQueryKey extends QueryKey = QueryKey,\n>({\n streamFn,\n refetchMode = 'reset',\n reducer = (items, chunk) =>\n addToEnd(items as Array, chunk) as TData,\n initialValue = [] as TData,\n}: StreamedQueryParams): QueryFunction<\n TData,\n TQueryKey\n> {\n return async (context) => {\n const query = context.client\n .getQueryCache()\n .find({ queryKey: context.queryKey, exact: true })\n const isRefetch = !!query && query.state.data !== undefined\n if (isRefetch && refetchMode === 'reset') {\n query.setState({\n status: 'pending',\n data: undefined,\n error: null,\n fetchStatus: 'fetching',\n })\n }\n\n let result = initialValue\n\n let cancelled: boolean = false as boolean\n const streamFnContext = addConsumeAwareSignal<\n OmitKeyof\n >(\n {\n client: context.client,\n meta: context.meta,\n queryKey: context.queryKey,\n pageParam: context.pageParam,\n direction: context.direction,\n },\n () => context.signal,\n () => (cancelled = true),\n )\n\n const stream = await streamFn(streamFnContext)\n\n const isReplaceRefetch = isRefetch && refetchMode === 'replace'\n\n for await (const chunk of stream) {\n if (cancelled) {\n break\n }\n\n if (isReplaceRefetch) {\n // don't append to the cache directly when replace-refetching\n result = reducer(result, chunk)\n } else {\n context.client.setQueryData(context.queryKey, (prev) =>\n reducer(prev === undefined ? initialValue : prev, chunk),\n )\n }\n }\n\n // finalize result: replace-refetching needs to write to the cache\n if (isReplaceRefetch && !cancelled) {\n context.client.set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AQ,UAAU,MAAM;AAAA,IAC7D;AAEA,WAAO,QAAQ,OAAO,aAAa,QAAQ,QAAQ,KAAK;AAAA,EAC1D;AACF;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/subscribable.cjs b/node_modules/@tanstack/query-core/build/legacy/subscribable.cjs deleted file mode 100644 index c402602..0000000 --- a/node_modules/@tanstack/query-core/build/legacy/subscribable.cjs +++ /dev/null @@ -1,51 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// src/subscribable.ts -var subscribable_exports = {}; -__export(subscribable_exports, { - Subscribable: () => Subscribable -}); -module.exports = __toCommonJS(subscribable_exports); -var Subscribable = class { - constructor() { - this.listeners = /* @__PURE__ */ new Set(); - this.subscribe = this.subscribe.bind(this); - } - subscribe(listener) { - this.listeners.add(listener); - this.onSubscribe(); - return () => { - this.listeners.delete(listener); - this.onUnsubscribe(); - }; - } - hasListeners() { - return this.listeners.size > 0; - } - onSubscribe() { - } - onUnsubscribe() { - } -}; -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - Subscribable -}); -//# sourceMappingURL=subscribable.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/subscribable.cjs.map b/node_modules/@tanstack/query-core/build/legacy/subscribable.cjs.map deleted file mode 100644 index 43f8336..0000000 --- a/node_modules/@tanstack/query-core/build/legacy/subscribable.cjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/subscribable.ts"],"sourcesContent":["export class Subscribable {\n protected listeners = new Set()\n\n constructor() {\n this.subscribe = this.subscribe.bind(this)\n }\n\n subscribe(listener: TListener): () => void {\n this.listeners.add(listener)\n\n this.onSubscribe()\n\n return () => {\n this.listeners.delete(listener)\n this.onUnsubscribe()\n }\n }\n\n hasListeners(): boolean {\n return this.listeners.size > 0\n }\n\n protected onSubscribe(): void {\n // Do nothing\n }\n\n protected onUnsubscribe(): void {\n // Do nothing\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAO,IAAM,eAAN,MAA+C;AAAA,EAGpD,cAAc;AAFd,SAAU,YAAY,oBAAI,IAAe;AAGvC,SAAK,YAAY,KAAK,UAAU,KAAK,IAAI;AAAA,EAC3C;AAAA,EAEA,UAAU,UAAiC;AACzC,SAAK,UAAU,IAAI,QAAQ;AAE3B,SAAK,YAAY;AAEjB,WAAO,MAAM;AACX,WAAK,UAAU,OAAO,QAAQ;AAC9B,WAAK,cAAc;AAAA,IACrB;AAAA,EACF;AAAA,EAEA,eAAwB;AACtB,WAAO,KAAK,UAAU,OAAO;AAAA,EAC/B;AAAA,EAEU,cAAoB;AAAA,EAE9B;AAAA,EAEU,gBAAsB;AAAA,EAEhC;AACF;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/subscribable.d.cts b/node_modules/@tanstack/query-core/build/legacy/subscribable.d.cts deleted file mode 100644 index 5ac4d3d..0000000 --- a/node_modules/@tanstack/query-core/build/legacy/subscribable.d.cts +++ /dev/null @@ -1,10 +0,0 @@ -declare class Subscribable { - protected listeners: Set; - constructor(); - subscribe(listener: TListener): () => void; - hasListeners(): boolean; - protected onSubscribe(): void; - protected onUnsubscribe(): void; -} - -export { Subscribable }; diff --git a/node_modules/@tanstack/query-core/build/legacy/subscribable.d.ts b/node_modules/@tanstack/query-core/build/legacy/subscribable.d.ts deleted file mode 100644 index 5ac4d3d..0000000 --- a/node_modules/@tanstack/query-core/build/legacy/subscribable.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -declare class Subscribable { - protected listeners: Set; - constructor(); - subscribe(listener: TListener): () => void; - hasListeners(): boolean; - protected onSubscribe(): void; - protected onUnsubscribe(): void; -} - -export { Subscribable }; diff --git a/node_modules/@tanstack/query-core/build/legacy/subscribable.js b/node_modules/@tanstack/query-core/build/legacy/subscribable.js deleted file mode 100644 index d701fe9..0000000 --- a/node_modules/@tanstack/query-core/build/legacy/subscribable.js +++ /dev/null @@ -1,28 +0,0 @@ -import "./chunk-PXG64RU4.js"; - -// src/subscribable.ts -var Subscribable = class { - constructor() { - this.listeners = /* @__PURE__ */ new Set(); - this.subscribe = this.subscribe.bind(this); - } - subscribe(listener) { - this.listeners.add(listener); - this.onSubscribe(); - return () => { - this.listeners.delete(listener); - this.onUnsubscribe(); - }; - } - hasListeners() { - return this.listeners.size > 0; - } - onSubscribe() { - } - onUnsubscribe() { - } -}; -export { - Subscribable -}; -//# sourceMappingURL=subscribable.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/subscribable.js.map b/node_modules/@tanstack/query-core/build/legacy/subscribable.js.map deleted file mode 100644 index ae0fe0d..0000000 --- a/node_modules/@tanstack/query-core/build/legacy/subscribable.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/subscribable.ts"],"sourcesContent":["export class Subscribable {\n protected listeners = new Set()\n\n constructor() {\n this.subscribe = this.subscribe.bind(this)\n }\n\n subscribe(listener: TListener): () => void {\n this.listeners.add(listener)\n\n this.onSubscribe()\n\n return () => {\n this.listeners.delete(listener)\n this.onUnsubscribe()\n }\n }\n\n hasListeners(): boolean {\n return this.listeners.size > 0\n }\n\n protected onSubscribe(): void {\n // Do nothing\n }\n\n protected onUnsubscribe(): void {\n // Do nothing\n }\n}\n"],"mappings":";;;AAAO,IAAM,eAAN,MAA+C;AAAA,EAGpD,cAAc;AAFd,SAAU,YAAY,oBAAI,IAAe;AAGvC,SAAK,YAAY,KAAK,UAAU,KAAK,IAAI;AAAA,EAC3C;AAAA,EAEA,UAAU,UAAiC;AACzC,SAAK,UAAU,IAAI,QAAQ;AAE3B,SAAK,YAAY;AAEjB,WAAO,MAAM;AACX,WAAK,UAAU,OAAO,QAAQ;AAC9B,WAAK,cAAc;AAAA,IACrB;AAAA,EACF;AAAA,EAEA,eAAwB;AACtB,WAAO,KAAK,UAAU,OAAO;AAAA,EAC/B;AAAA,EAEU,cAAoB;AAAA,EAE9B;AAAA,EAEU,gBAAsB;AAAA,EAEhC;AACF;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/thenable.cjs b/node_modules/@tanstack/query-core/build/legacy/thenable.cjs deleted file mode 100644 index 21e4d9b..0000000 --- a/node_modules/@tanstack/query-core/build/legacy/thenable.cjs +++ /dev/null @@ -1,76 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// src/thenable.ts -var thenable_exports = {}; -__export(thenable_exports, { - pendingThenable: () => pendingThenable, - tryResolveSync: () => tryResolveSync -}); -module.exports = __toCommonJS(thenable_exports); -var import_utils = require("./utils.cjs"); -function pendingThenable() { - let resolve; - let reject; - const thenable = new Promise((_resolve, _reject) => { - resolve = _resolve; - reject = _reject; - }); - thenable.status = "pending"; - thenable.catch(() => { - }); - function finalize(data) { - Object.assign(thenable, data); - delete thenable.resolve; - delete thenable.reject; - } - thenable.resolve = (value) => { - finalize({ - status: "fulfilled", - value - }); - resolve(value); - }; - thenable.reject = (reason) => { - finalize({ - status: "rejected", - reason - }); - reject(reason); - }; - return thenable; -} -function tryResolveSync(promise) { - var _a; - let data; - (_a = promise.then((result) => { - data = result; - return result; - }, import_utils.noop)) == null ? void 0 : _a.catch(import_utils.noop); - if (data !== void 0) { - return { data }; - } - return void 0; -} -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - pendingThenable, - tryResolveSync -}); -//# sourceMappingURL=thenable.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/thenable.cjs.map b/node_modules/@tanstack/query-core/build/legacy/thenable.cjs.map deleted file mode 100644 index ba93a14..0000000 --- a/node_modules/@tanstack/query-core/build/legacy/thenable.cjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/thenable.ts"],"sourcesContent":["/**\n * Thenable types which matches React's types for promises\n *\n * React seemingly uses `.status`, `.value` and `.reason` properties on a promises to optimistically unwrap data from promises\n *\n * @see https://github.com/facebook/react/blob/main/packages/shared/ReactTypes.js#L112-L138\n * @see https://github.com/facebook/react/blob/4f604941569d2e8947ce1460a0b2997e835f37b9/packages/react-debug-tools/src/ReactDebugHooks.js#L224-L227\n */\n\nimport { noop } from './utils'\n\ninterface Fulfilled {\n status: 'fulfilled'\n value: T\n}\ninterface Rejected {\n status: 'rejected'\n reason: unknown\n}\ninterface Pending {\n status: 'pending'\n\n /**\n * Resolve the promise with a value.\n * Will remove the `resolve` and `reject` properties from the promise.\n */\n resolve: (value: T) => void\n /**\n * Reject the promise with a reason.\n * Will remove the `resolve` and `reject` properties from the promise.\n */\n reject: (reason: unknown) => void\n}\n\nexport type FulfilledThenable = Promise & Fulfilled\nexport type RejectedThenable = Promise & Rejected\nexport type PendingThenable = Promise & Pending\n\nexport type Thenable =\n | FulfilledThenable\n | RejectedThenable\n | PendingThenable\n\nexport function pendingThenable(): PendingThenable {\n let resolve: Pending['resolve']\n let reject: Pending['reject']\n // this could use `Promise.withResolvers()` in the future\n const thenable = new Promise((_resolve, _reject) => {\n resolve = _resolve\n reject = _reject\n }) as PendingThenable\n\n thenable.status = 'pending'\n thenable.catch(() => {\n // prevent unhandled rejection errors\n })\n\n function finalize(data: Fulfilled | Rejected) {\n Object.assign(thenable, data)\n\n // clear pending props props to avoid calling them twice\n delete (thenable as Partial>).resolve\n delete (thenable as Partial>).reject\n }\n\n thenable.resolve = (value) => {\n finalize({\n status: 'fulfilled',\n value,\n })\n\n resolve(value)\n }\n thenable.reject = (reason) => {\n finalize({\n status: 'rejected',\n reason,\n })\n\n reject(reason)\n }\n\n return thenable\n}\n\n/**\n * This function takes a Promise-like input and detects whether the data\n * is synchronously available or not.\n *\n * It does not inspect .status, .value or .reason properties of the promise,\n * as those are not always available, and the .status of React's promises\n * should not be considered part of the public API.\n */\nexport function tryResolveSync(promise: Promise | Thenable) {\n let data: unknown\n\n promise\n .then((result) => {\n data = result\n return result\n }, noop)\n // .catch can be unavailable on certain kinds of thenable's\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n ?.catch(noop)\n\n if (data !== undefined) {\n return { data }\n }\n\n return undefined\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASA,mBAAqB;AAkCd,SAAS,kBAAyC;AACvD,MAAI;AACJ,MAAI;AAEJ,QAAM,WAAW,IAAI,QAAQ,CAAC,UAAU,YAAY;AAClD,cAAU;AACV,aAAS;AAAA,EACX,CAAC;AAED,WAAS,SAAS;AAClB,WAAS,MAAM,MAAM;AAAA,EAErB,CAAC;AAED,WAAS,SAAS,MAA+B;AAC/C,WAAO,OAAO,UAAU,IAAI;AAG5B,WAAQ,SAAyC;AACjD,WAAQ,SAAyC;AAAA,EACnD;AAEA,WAAS,UAAU,CAAC,UAAU;AAC5B,aAAS;AAAA,MACP,QAAQ;AAAA,MACR;AAAA,IACF,CAAC;AAED,YAAQ,KAAK;AAAA,EACf;AACA,WAAS,SAAS,CAAC,WAAW;AAC5B,aAAS;AAAA,MACP,QAAQ;AAAA,MACR;AAAA,IACF,CAAC;AAED,WAAO,MAAM;AAAA,EACf;AAEA,SAAO;AACT;AAUO,SAAS,eAAe,SAA+C;AA7F9E;AA8FE,MAAI;AAEJ,gBACG,KAAK,CAAC,WAAW;AAChB,WAAO;AACP,WAAO;AAAA,EACT,GAAG,iBAAI,MAJT,mBAOI,MAAM;AAEV,MAAI,SAAS,QAAW;AACtB,WAAO,EAAE,KAAK;AAAA,EAChB;AAEA,SAAO;AACT;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/thenable.d.cts b/node_modules/@tanstack/query-core/build/legacy/thenable.d.cts deleted file mode 100644 index 2378593..0000000 --- a/node_modules/@tanstack/query-core/build/legacy/thenable.d.cts +++ /dev/null @@ -1,47 +0,0 @@ -/** - * Thenable types which matches React's types for promises - * - * React seemingly uses `.status`, `.value` and `.reason` properties on a promises to optimistically unwrap data from promises - * - * @see https://github.com/facebook/react/blob/main/packages/shared/ReactTypes.js#L112-L138 - * @see https://github.com/facebook/react/blob/4f604941569d2e8947ce1460a0b2997e835f37b9/packages/react-debug-tools/src/ReactDebugHooks.js#L224-L227 - */ -interface Fulfilled { - status: 'fulfilled'; - value: T; -} -interface Rejected { - status: 'rejected'; - reason: unknown; -} -interface Pending { - status: 'pending'; - /** - * Resolve the promise with a value. - * Will remove the `resolve` and `reject` properties from the promise. - */ - resolve: (value: T) => void; - /** - * Reject the promise with a reason. - * Will remove the `resolve` and `reject` properties from the promise. - */ - reject: (reason: unknown) => void; -} -type FulfilledThenable = Promise & Fulfilled; -type RejectedThenable = Promise & Rejected; -type PendingThenable = Promise & Pending; -type Thenable = FulfilledThenable | RejectedThenable | PendingThenable; -declare function pendingThenable(): PendingThenable; -/** - * This function takes a Promise-like input and detects whether the data - * is synchronously available or not. - * - * It does not inspect .status, .value or .reason properties of the promise, - * as those are not always available, and the .status of React's promises - * should not be considered part of the public API. - */ -declare function tryResolveSync(promise: Promise | Thenable): { - data: {} | null; -} | undefined; - -export { type FulfilledThenable, type PendingThenable, type RejectedThenable, type Thenable, pendingThenable, tryResolveSync }; diff --git a/node_modules/@tanstack/query-core/build/legacy/thenable.d.ts b/node_modules/@tanstack/query-core/build/legacy/thenable.d.ts deleted file mode 100644 index 2378593..0000000 --- a/node_modules/@tanstack/query-core/build/legacy/thenable.d.ts +++ /dev/null @@ -1,47 +0,0 @@ -/** - * Thenable types which matches React's types for promises - * - * React seemingly uses `.status`, `.value` and `.reason` properties on a promises to optimistically unwrap data from promises - * - * @see https://github.com/facebook/react/blob/main/packages/shared/ReactTypes.js#L112-L138 - * @see https://github.com/facebook/react/blob/4f604941569d2e8947ce1460a0b2997e835f37b9/packages/react-debug-tools/src/ReactDebugHooks.js#L224-L227 - */ -interface Fulfilled { - status: 'fulfilled'; - value: T; -} -interface Rejected { - status: 'rejected'; - reason: unknown; -} -interface Pending { - status: 'pending'; - /** - * Resolve the promise with a value. - * Will remove the `resolve` and `reject` properties from the promise. - */ - resolve: (value: T) => void; - /** - * Reject the promise with a reason. - * Will remove the `resolve` and `reject` properties from the promise. - */ - reject: (reason: unknown) => void; -} -type FulfilledThenable = Promise & Fulfilled; -type RejectedThenable = Promise & Rejected; -type PendingThenable = Promise & Pending; -type Thenable = FulfilledThenable | RejectedThenable | PendingThenable; -declare function pendingThenable(): PendingThenable; -/** - * This function takes a Promise-like input and detects whether the data - * is synchronously available or not. - * - * It does not inspect .status, .value or .reason properties of the promise, - * as those are not always available, and the .status of React's promises - * should not be considered part of the public API. - */ -declare function tryResolveSync(promise: Promise | Thenable): { - data: {} | null; -} | undefined; - -export { type FulfilledThenable, type PendingThenable, type RejectedThenable, type Thenable, pendingThenable, tryResolveSync }; diff --git a/node_modules/@tanstack/query-core/build/legacy/thenable.js b/node_modules/@tanstack/query-core/build/legacy/thenable.js deleted file mode 100644 index 4307dae..0000000 --- a/node_modules/@tanstack/query-core/build/legacy/thenable.js +++ /dev/null @@ -1,52 +0,0 @@ -import "./chunk-PXG64RU4.js"; - -// src/thenable.ts -import { noop } from "./utils.js"; -function pendingThenable() { - let resolve; - let reject; - const thenable = new Promise((_resolve, _reject) => { - resolve = _resolve; - reject = _reject; - }); - thenable.status = "pending"; - thenable.catch(() => { - }); - function finalize(data) { - Object.assign(thenable, data); - delete thenable.resolve; - delete thenable.reject; - } - thenable.resolve = (value) => { - finalize({ - status: "fulfilled", - value - }); - resolve(value); - }; - thenable.reject = (reason) => { - finalize({ - status: "rejected", - reason - }); - reject(reason); - }; - return thenable; -} -function tryResolveSync(promise) { - var _a; - let data; - (_a = promise.then((result) => { - data = result; - return result; - }, noop)) == null ? void 0 : _a.catch(noop); - if (data !== void 0) { - return { data }; - } - return void 0; -} -export { - pendingThenable, - tryResolveSync -}; -//# sourceMappingURL=thenable.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/thenable.js.map b/node_modules/@tanstack/query-core/build/legacy/thenable.js.map deleted file mode 100644 index acc7747..0000000 --- a/node_modules/@tanstack/query-core/build/legacy/thenable.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/thenable.ts"],"sourcesContent":["/**\n * Thenable types which matches React's types for promises\n *\n * React seemingly uses `.status`, `.value` and `.reason` properties on a promises to optimistically unwrap data from promises\n *\n * @see https://github.com/facebook/react/blob/main/packages/shared/ReactTypes.js#L112-L138\n * @see https://github.com/facebook/react/blob/4f604941569d2e8947ce1460a0b2997e835f37b9/packages/react-debug-tools/src/ReactDebugHooks.js#L224-L227\n */\n\nimport { noop } from './utils'\n\ninterface Fulfilled {\n status: 'fulfilled'\n value: T\n}\ninterface Rejected {\n status: 'rejected'\n reason: unknown\n}\ninterface Pending {\n status: 'pending'\n\n /**\n * Resolve the promise with a value.\n * Will remove the `resolve` and `reject` properties from the promise.\n */\n resolve: (value: T) => void\n /**\n * Reject the promise with a reason.\n * Will remove the `resolve` and `reject` properties from the promise.\n */\n reject: (reason: unknown) => void\n}\n\nexport type FulfilledThenable = Promise & Fulfilled\nexport type RejectedThenable = Promise & Rejected\nexport type PendingThenable = Promise & Pending\n\nexport type Thenable =\n | FulfilledThenable\n | RejectedThenable\n | PendingThenable\n\nexport function pendingThenable(): PendingThenable {\n let resolve: Pending['resolve']\n let reject: Pending['reject']\n // this could use `Promise.withResolvers()` in the future\n const thenable = new Promise((_resolve, _reject) => {\n resolve = _resolve\n reject = _reject\n }) as PendingThenable\n\n thenable.status = 'pending'\n thenable.catch(() => {\n // prevent unhandled rejection errors\n })\n\n function finalize(data: Fulfilled | Rejected) {\n Object.assign(thenable, data)\n\n // clear pending props props to avoid calling them twice\n delete (thenable as Partial>).resolve\n delete (thenable as Partial>).reject\n }\n\n thenable.resolve = (value) => {\n finalize({\n status: 'fulfilled',\n value,\n })\n\n resolve(value)\n }\n thenable.reject = (reason) => {\n finalize({\n status: 'rejected',\n reason,\n })\n\n reject(reason)\n }\n\n return thenable\n}\n\n/**\n * This function takes a Promise-like input and detects whether the data\n * is synchronously available or not.\n *\n * It does not inspect .status, .value or .reason properties of the promise,\n * as those are not always available, and the .status of React's promises\n * should not be considered part of the public API.\n */\nexport function tryResolveSync(promise: Promise | Thenable) {\n let data: unknown\n\n promise\n .then((result) => {\n data = result\n return result\n }, noop)\n // .catch can be unavailable on certain kinds of thenable's\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n ?.catch(noop)\n\n if (data !== undefined) {\n return { data }\n }\n\n return undefined\n}\n"],"mappings":";;;AASA,SAAS,YAAY;AAkCd,SAAS,kBAAyC;AACvD,MAAI;AACJ,MAAI;AAEJ,QAAM,WAAW,IAAI,QAAQ,CAAC,UAAU,YAAY;AAClD,cAAU;AACV,aAAS;AAAA,EACX,CAAC;AAED,WAAS,SAAS;AAClB,WAAS,MAAM,MAAM;AAAA,EAErB,CAAC;AAED,WAAS,SAAS,MAA+B;AAC/C,WAAO,OAAO,UAAU,IAAI;AAG5B,WAAQ,SAAyC;AACjD,WAAQ,SAAyC;AAAA,EACnD;AAEA,WAAS,UAAU,CAAC,UAAU;AAC5B,aAAS;AAAA,MACP,QAAQ;AAAA,MACR;AAAA,IACF,CAAC;AAED,YAAQ,KAAK;AAAA,EACf;AACA,WAAS,SAAS,CAAC,WAAW;AAC5B,aAAS;AAAA,MACP,QAAQ;AAAA,MACR;AAAA,IACF,CAAC;AAED,WAAO,MAAM;AAAA,EACf;AAEA,SAAO;AACT;AAUO,SAAS,eAAe,SAA+C;AA7F9E;AA8FE,MAAI;AAEJ,gBACG,KAAK,CAAC,WAAW;AAChB,WAAO;AACP,WAAO;AAAA,EACT,GAAG,IAAI,MAJT,mBAOI,MAAM;AAEV,MAAI,SAAS,QAAW;AACtB,WAAO,EAAE,KAAK;AAAA,EAChB;AAEA,SAAO;AACT;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/timeoutManager.cjs b/node_modules/@tanstack/query-core/build/legacy/timeoutManager.cjs deleted file mode 100644 index d66648d..0000000 --- a/node_modules/@tanstack/query-core/build/legacy/timeoutManager.cjs +++ /dev/null @@ -1,110 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __typeError = (msg) => { - throw TypeError(msg); -}; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg); -var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj)); -var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value); -var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value); - -// src/timeoutManager.ts -var timeoutManager_exports = {}; -__export(timeoutManager_exports, { - TimeoutManager: () => TimeoutManager, - defaultTimeoutProvider: () => defaultTimeoutProvider, - systemSetTimeoutZero: () => systemSetTimeoutZero, - timeoutManager: () => timeoutManager -}); -module.exports = __toCommonJS(timeoutManager_exports); -var defaultTimeoutProvider = { - // We need the wrapper function syntax below instead of direct references to - // global setTimeout etc. - // - // BAD: `setTimeout: setTimeout` - // GOOD: `setTimeout: (cb, delay) => setTimeout(cb, delay)` - // - // If we use direct references here, then anything that wants to spy on or - // replace the global setTimeout (like tests) won't work since we'll already - // have a hard reference to the original implementation at the time when this - // file was imported. - setTimeout: (callback, delay) => setTimeout(callback, delay), - clearTimeout: (timeoutId) => clearTimeout(timeoutId), - setInterval: (callback, delay) => setInterval(callback, delay), - clearInterval: (intervalId) => clearInterval(intervalId) -}; -var _provider, _providerCalled; -var TimeoutManager = class { - constructor() { - // We cannot have TimeoutManager as we must instantiate it with a concrete - // type at app boot; and if we leave that type, then any new timer provider - // would need to support ReturnType, which is infeasible. - // - // We settle for type safety for the TimeoutProvider type, and accept that - // this class is unsafe internally to allow for extension. - __privateAdd(this, _provider, defaultTimeoutProvider); - __privateAdd(this, _providerCalled, false); - } - setTimeoutProvider(provider) { - if (process.env.NODE_ENV !== "production") { - if (__privateGet(this, _providerCalled) && provider !== __privateGet(this, _provider)) { - console.error( - `[timeoutManager]: Switching provider after calls to previous provider might result in unexpected behavior.`, - { previous: __privateGet(this, _provider), provider } - ); - } - } - __privateSet(this, _provider, provider); - if (process.env.NODE_ENV !== "production") { - __privateSet(this, _providerCalled, false); - } - } - setTimeout(callback, delay) { - if (process.env.NODE_ENV !== "production") { - __privateSet(this, _providerCalled, true); - } - return __privateGet(this, _provider).setTimeout(callback, delay); - } - clearTimeout(timeoutId) { - __privateGet(this, _provider).clearTimeout(timeoutId); - } - setInterval(callback, delay) { - if (process.env.NODE_ENV !== "production") { - __privateSet(this, _providerCalled, true); - } - return __privateGet(this, _provider).setInterval(callback, delay); - } - clearInterval(intervalId) { - __privateGet(this, _provider).clearInterval(intervalId); - } -}; -_provider = new WeakMap(); -_providerCalled = new WeakMap(); -var timeoutManager = new TimeoutManager(); -function systemSetTimeoutZero(callback) { - setTimeout(callback, 0); -} -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - TimeoutManager, - defaultTimeoutProvider, - systemSetTimeoutZero, - timeoutManager -}); -//# sourceMappingURL=timeoutManager.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/timeoutManager.cjs.map b/node_modules/@tanstack/query-core/build/legacy/timeoutManager.cjs.map deleted file mode 100644 index bca77c2..0000000 --- a/node_modules/@tanstack/query-core/build/legacy/timeoutManager.cjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/timeoutManager.ts"],"sourcesContent":["/**\n * {@link TimeoutManager} does not support passing arguments to the callback.\n *\n * `(_: void)` is the argument type inferred by TypeScript's default typings for\n * `setTimeout(cb, number)`.\n * If we don't accept a single void argument, then\n * `new Promise(resolve => timeoutManager.setTimeout(resolve, N))` is a type error.\n */\nexport type TimeoutCallback = (_: void) => void\n\n/**\n * Wrapping `setTimeout` is awkward from a typing perspective because platform\n * typings may extend the return type of `setTimeout`. For example, NodeJS\n * typings add `NodeJS.Timeout`; but a non-default `timeoutManager` may not be\n * able to return such a type.\n */\nexport type ManagedTimerId = number | { [Symbol.toPrimitive]: () => number }\n\n/**\n * Backend for timer functions.\n */\nexport type TimeoutProvider =\n {\n readonly setTimeout: (callback: TimeoutCallback, delay: number) => TTimerId\n readonly clearTimeout: (timeoutId: TTimerId | undefined) => void\n\n readonly setInterval: (callback: TimeoutCallback, delay: number) => TTimerId\n readonly clearInterval: (intervalId: TTimerId | undefined) => void\n }\n\nexport const defaultTimeoutProvider: TimeoutProvider<\n ReturnType\n> = {\n // We need the wrapper function syntax below instead of direct references to\n // global setTimeout etc.\n //\n // BAD: `setTimeout: setTimeout`\n // GOOD: `setTimeout: (cb, delay) => setTimeout(cb, delay)`\n //\n // If we use direct references here, then anything that wants to spy on or\n // replace the global setTimeout (like tests) won't work since we'll already\n // have a hard reference to the original implementation at the time when this\n // file was imported.\n setTimeout: (callback, delay) => setTimeout(callback, delay),\n clearTimeout: (timeoutId) => clearTimeout(timeoutId),\n\n setInterval: (callback, delay) => setInterval(callback, delay),\n clearInterval: (intervalId) => clearInterval(intervalId),\n}\n\n/**\n * Allows customization of how timeouts are created.\n *\n * @tanstack/query-core makes liberal use of timeouts to implement `staleTime`\n * and `gcTime`. The default TimeoutManager provider uses the platform's global\n * `setTimeout` implementation, which is known to have scalability issues with\n * thousands of timeouts on the event loop.\n *\n * If you hit this limitation, consider providing a custom TimeoutProvider that\n * coalesces timeouts.\n */\nexport class TimeoutManager implements Omit {\n // We cannot have TimeoutManager as we must instantiate it with a concrete\n // type at app boot; and if we leave that type, then any new timer provider\n // would need to support ReturnType, which is infeasible.\n //\n // We settle for type safety for the TimeoutProvider type, and accept that\n // this class is unsafe internally to allow for extension.\n #provider: TimeoutProvider = defaultTimeoutProvider\n #providerCalled = false\n\n setTimeoutProvider(\n provider: TimeoutProvider,\n ): void {\n if (process.env.NODE_ENV !== 'production') {\n if (this.#providerCalled && provider !== this.#provider) {\n // After changing providers, `clearTimeout` will not work as expected for\n // timeouts from the previous provider.\n //\n // Since they may allocate the same timeout ID, clearTimeout may cancel an\n // arbitrary different timeout, or unexpected no-op.\n //\n // We could protect against this by mixing the timeout ID bits\n // deterministically with some per-provider bits.\n //\n // We could internally queue `setTimeout` calls to `TimeoutManager` until\n // some API call to set the initial provider.\n console.error(\n `[timeoutManager]: Switching provider after calls to previous provider might result in unexpected behavior.`,\n { previous: this.#provider, provider },\n )\n }\n }\n\n this.#provider = provider\n if (process.env.NODE_ENV !== 'production') {\n this.#providerCalled = false\n }\n }\n\n setTimeout(callback: TimeoutCallback, delay: number): ManagedTimerId {\n if (process.env.NODE_ENV !== 'production') {\n this.#providerCalled = true\n }\n return this.#provider.setTimeout(callback, delay)\n }\n\n clearTimeout(timeoutId: ManagedTimerId | undefined): void {\n this.#provider.clearTimeout(timeoutId)\n }\n\n setInterval(callback: TimeoutCallback, delay: number): ManagedTimerId {\n if (process.env.NODE_ENV !== 'production') {\n this.#providerCalled = true\n }\n return this.#provider.setInterval(callback, delay)\n }\n\n clearInterval(intervalId: ManagedTimerId | undefined): void {\n this.#provider.clearInterval(intervalId)\n }\n}\n\nexport const timeoutManager = new TimeoutManager()\n\n/**\n * In many cases code wants to delay to the next event loop tick; this is not\n * mediated by {@link timeoutManager}.\n *\n * This function is provided to make auditing the `tanstack/query-core` for\n * incorrect use of system `setTimeout` easier.\n */\nexport function systemSetTimeoutZero(callback: TimeoutCallback): void {\n setTimeout(callback, 0)\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA8BO,IAAM,yBAET;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAWF,YAAY,CAAC,UAAU,UAAU,WAAW,UAAU,KAAK;AAAA,EAC3D,cAAc,CAAC,cAAc,aAAa,SAAS;AAAA,EAEnD,aAAa,CAAC,UAAU,UAAU,YAAY,UAAU,KAAK;AAAA,EAC7D,eAAe,CAAC,eAAe,cAAc,UAAU;AACzD;AAhDA;AA6DO,IAAM,iBAAN,MAA8D;AAAA,EAA9D;AAOL;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kCAAkC;AAClC,wCAAkB;AAAA;AAAA,EAElB,mBACE,UACM;AACN,QAAI,QAAQ,IAAI,aAAa,cAAc;AACzC,UAAI,mBAAK,oBAAmB,aAAa,mBAAK,YAAW;AAYvD,gBAAQ;AAAA,UACN;AAAA,UACA,EAAE,UAAU,mBAAK,YAAW,SAAS;AAAA,QACvC;AAAA,MACF;AAAA,IACF;AAEA,uBAAK,WAAY;AACjB,QAAI,QAAQ,IAAI,aAAa,cAAc;AACzC,yBAAK,iBAAkB;AAAA,IACzB;AAAA,EACF;AAAA,EAEA,WAAW,UAA2B,OAA+B;AACnE,QAAI,QAAQ,IAAI,aAAa,cAAc;AACzC,yBAAK,iBAAkB;AAAA,IACzB;AACA,WAAO,mBAAK,WAAU,WAAW,UAAU,KAAK;AAAA,EAClD;AAAA,EAEA,aAAa,WAA6C;AACxD,uBAAK,WAAU,aAAa,SAAS;AAAA,EACvC;AAAA,EAEA,YAAY,UAA2B,OAA+B;AACpE,QAAI,QAAQ,IAAI,aAAa,cAAc;AACzC,yBAAK,iBAAkB;AAAA,IACzB;AACA,WAAO,mBAAK,WAAU,YAAY,UAAU,KAAK;AAAA,EACnD;AAAA,EAEA,cAAc,YAA8C;AAC1D,uBAAK,WAAU,cAAc,UAAU;AAAA,EACzC;AACF;AArDE;AACA;AAsDK,IAAM,iBAAiB,IAAI,eAAe;AAS1C,SAAS,qBAAqB,UAAiC;AACpE,aAAW,UAAU,CAAC;AACxB;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/timeoutManager.d.cts b/node_modules/@tanstack/query-core/build/legacy/timeoutManager.d.cts deleted file mode 100644 index f85f6f9..0000000 --- a/node_modules/@tanstack/query-core/build/legacy/timeoutManager.d.cts +++ /dev/null @@ -1,58 +0,0 @@ -/** - * {@link TimeoutManager} does not support passing arguments to the callback. - * - * `(_: void)` is the argument type inferred by TypeScript's default typings for - * `setTimeout(cb, number)`. - * If we don't accept a single void argument, then - * `new Promise(resolve => timeoutManager.setTimeout(resolve, N))` is a type error. - */ -type TimeoutCallback = (_: void) => void; -/** - * Wrapping `setTimeout` is awkward from a typing perspective because platform - * typings may extend the return type of `setTimeout`. For example, NodeJS - * typings add `NodeJS.Timeout`; but a non-default `timeoutManager` may not be - * able to return such a type. - */ -type ManagedTimerId = number | { - [Symbol.toPrimitive]: () => number; -}; -/** - * Backend for timer functions. - */ -type TimeoutProvider = { - readonly setTimeout: (callback: TimeoutCallback, delay: number) => TTimerId; - readonly clearTimeout: (timeoutId: TTimerId | undefined) => void; - readonly setInterval: (callback: TimeoutCallback, delay: number) => TTimerId; - readonly clearInterval: (intervalId: TTimerId | undefined) => void; -}; -declare const defaultTimeoutProvider: TimeoutProvider>; -/** - * Allows customization of how timeouts are created. - * - * @tanstack/query-core makes liberal use of timeouts to implement `staleTime` - * and `gcTime`. The default TimeoutManager provider uses the platform's global - * `setTimeout` implementation, which is known to have scalability issues with - * thousands of timeouts on the event loop. - * - * If you hit this limitation, consider providing a custom TimeoutProvider that - * coalesces timeouts. - */ -declare class TimeoutManager implements Omit { - #private; - setTimeoutProvider(provider: TimeoutProvider): void; - setTimeout(callback: TimeoutCallback, delay: number): ManagedTimerId; - clearTimeout(timeoutId: ManagedTimerId | undefined): void; - setInterval(callback: TimeoutCallback, delay: number): ManagedTimerId; - clearInterval(intervalId: ManagedTimerId | undefined): void; -} -declare const timeoutManager: TimeoutManager; -/** - * In many cases code wants to delay to the next event loop tick; this is not - * mediated by {@link timeoutManager}. - * - * This function is provided to make auditing the `tanstack/query-core` for - * incorrect use of system `setTimeout` easier. - */ -declare function systemSetTimeoutZero(callback: TimeoutCallback): void; - -export { type ManagedTimerId, type TimeoutCallback, TimeoutManager, type TimeoutProvider, defaultTimeoutProvider, systemSetTimeoutZero, timeoutManager }; diff --git a/node_modules/@tanstack/query-core/build/legacy/timeoutManager.d.ts b/node_modules/@tanstack/query-core/build/legacy/timeoutManager.d.ts deleted file mode 100644 index f85f6f9..0000000 --- a/node_modules/@tanstack/query-core/build/legacy/timeoutManager.d.ts +++ /dev/null @@ -1,58 +0,0 @@ -/** - * {@link TimeoutManager} does not support passing arguments to the callback. - * - * `(_: void)` is the argument type inferred by TypeScript's default typings for - * `setTimeout(cb, number)`. - * If we don't accept a single void argument, then - * `new Promise(resolve => timeoutManager.setTimeout(resolve, N))` is a type error. - */ -type TimeoutCallback = (_: void) => void; -/** - * Wrapping `setTimeout` is awkward from a typing perspective because platform - * typings may extend the return type of `setTimeout`. For example, NodeJS - * typings add `NodeJS.Timeout`; but a non-default `timeoutManager` may not be - * able to return such a type. - */ -type ManagedTimerId = number | { - [Symbol.toPrimitive]: () => number; -}; -/** - * Backend for timer functions. - */ -type TimeoutProvider = { - readonly setTimeout: (callback: TimeoutCallback, delay: number) => TTimerId; - readonly clearTimeout: (timeoutId: TTimerId | undefined) => void; - readonly setInterval: (callback: TimeoutCallback, delay: number) => TTimerId; - readonly clearInterval: (intervalId: TTimerId | undefined) => void; -}; -declare const defaultTimeoutProvider: TimeoutProvider>; -/** - * Allows customization of how timeouts are created. - * - * @tanstack/query-core makes liberal use of timeouts to implement `staleTime` - * and `gcTime`. The default TimeoutManager provider uses the platform's global - * `setTimeout` implementation, which is known to have scalability issues with - * thousands of timeouts on the event loop. - * - * If you hit this limitation, consider providing a custom TimeoutProvider that - * coalesces timeouts. - */ -declare class TimeoutManager implements Omit { - #private; - setTimeoutProvider(provider: TimeoutProvider): void; - setTimeout(callback: TimeoutCallback, delay: number): ManagedTimerId; - clearTimeout(timeoutId: ManagedTimerId | undefined): void; - setInterval(callback: TimeoutCallback, delay: number): ManagedTimerId; - clearInterval(intervalId: ManagedTimerId | undefined): void; -} -declare const timeoutManager: TimeoutManager; -/** - * In many cases code wants to delay to the next event loop tick; this is not - * mediated by {@link timeoutManager}. - * - * This function is provided to make auditing the `tanstack/query-core` for - * incorrect use of system `setTimeout` easier. - */ -declare function systemSetTimeoutZero(callback: TimeoutCallback): void; - -export { type ManagedTimerId, type TimeoutCallback, TimeoutManager, type TimeoutProvider, defaultTimeoutProvider, systemSetTimeoutZero, timeoutManager }; diff --git a/node_modules/@tanstack/query-core/build/legacy/timeoutManager.js b/node_modules/@tanstack/query-core/build/legacy/timeoutManager.js deleted file mode 100644 index 4df6d36..0000000 --- a/node_modules/@tanstack/query-core/build/legacy/timeoutManager.js +++ /dev/null @@ -1,81 +0,0 @@ -import { - __privateAdd, - __privateGet, - __privateSet -} from "./chunk-PXG64RU4.js"; - -// src/timeoutManager.ts -var defaultTimeoutProvider = { - // We need the wrapper function syntax below instead of direct references to - // global setTimeout etc. - // - // BAD: `setTimeout: setTimeout` - // GOOD: `setTimeout: (cb, delay) => setTimeout(cb, delay)` - // - // If we use direct references here, then anything that wants to spy on or - // replace the global setTimeout (like tests) won't work since we'll already - // have a hard reference to the original implementation at the time when this - // file was imported. - setTimeout: (callback, delay) => setTimeout(callback, delay), - clearTimeout: (timeoutId) => clearTimeout(timeoutId), - setInterval: (callback, delay) => setInterval(callback, delay), - clearInterval: (intervalId) => clearInterval(intervalId) -}; -var _provider, _providerCalled; -var TimeoutManager = class { - constructor() { - // We cannot have TimeoutManager as we must instantiate it with a concrete - // type at app boot; and if we leave that type, then any new timer provider - // would need to support ReturnType, which is infeasible. - // - // We settle for type safety for the TimeoutProvider type, and accept that - // this class is unsafe internally to allow for extension. - __privateAdd(this, _provider, defaultTimeoutProvider); - __privateAdd(this, _providerCalled, false); - } - setTimeoutProvider(provider) { - if (process.env.NODE_ENV !== "production") { - if (__privateGet(this, _providerCalled) && provider !== __privateGet(this, _provider)) { - console.error( - `[timeoutManager]: Switching provider after calls to previous provider might result in unexpected behavior.`, - { previous: __privateGet(this, _provider), provider } - ); - } - } - __privateSet(this, _provider, provider); - if (process.env.NODE_ENV !== "production") { - __privateSet(this, _providerCalled, false); - } - } - setTimeout(callback, delay) { - if (process.env.NODE_ENV !== "production") { - __privateSet(this, _providerCalled, true); - } - return __privateGet(this, _provider).setTimeout(callback, delay); - } - clearTimeout(timeoutId) { - __privateGet(this, _provider).clearTimeout(timeoutId); - } - setInterval(callback, delay) { - if (process.env.NODE_ENV !== "production") { - __privateSet(this, _providerCalled, true); - } - return __privateGet(this, _provider).setInterval(callback, delay); - } - clearInterval(intervalId) { - __privateGet(this, _provider).clearInterval(intervalId); - } -}; -_provider = new WeakMap(); -_providerCalled = new WeakMap(); -var timeoutManager = new TimeoutManager(); -function systemSetTimeoutZero(callback) { - setTimeout(callback, 0); -} -export { - TimeoutManager, - defaultTimeoutProvider, - systemSetTimeoutZero, - timeoutManager -}; -//# sourceMappingURL=timeoutManager.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/timeoutManager.js.map b/node_modules/@tanstack/query-core/build/legacy/timeoutManager.js.map deleted file mode 100644 index 3e11048..0000000 --- a/node_modules/@tanstack/query-core/build/legacy/timeoutManager.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/timeoutManager.ts"],"sourcesContent":["/**\n * {@link TimeoutManager} does not support passing arguments to the callback.\n *\n * `(_: void)` is the argument type inferred by TypeScript's default typings for\n * `setTimeout(cb, number)`.\n * If we don't accept a single void argument, then\n * `new Promise(resolve => timeoutManager.setTimeout(resolve, N))` is a type error.\n */\nexport type TimeoutCallback = (_: void) => void\n\n/**\n * Wrapping `setTimeout` is awkward from a typing perspective because platform\n * typings may extend the return type of `setTimeout`. For example, NodeJS\n * typings add `NodeJS.Timeout`; but a non-default `timeoutManager` may not be\n * able to return such a type.\n */\nexport type ManagedTimerId = number | { [Symbol.toPrimitive]: () => number }\n\n/**\n * Backend for timer functions.\n */\nexport type TimeoutProvider =\n {\n readonly setTimeout: (callback: TimeoutCallback, delay: number) => TTimerId\n readonly clearTimeout: (timeoutId: TTimerId | undefined) => void\n\n readonly setInterval: (callback: TimeoutCallback, delay: number) => TTimerId\n readonly clearInterval: (intervalId: TTimerId | undefined) => void\n }\n\nexport const defaultTimeoutProvider: TimeoutProvider<\n ReturnType\n> = {\n // We need the wrapper function syntax below instead of direct references to\n // global setTimeout etc.\n //\n // BAD: `setTimeout: setTimeout`\n // GOOD: `setTimeout: (cb, delay) => setTimeout(cb, delay)`\n //\n // If we use direct references here, then anything that wants to spy on or\n // replace the global setTimeout (like tests) won't work since we'll already\n // have a hard reference to the original implementation at the time when this\n // file was imported.\n setTimeout: (callback, delay) => setTimeout(callback, delay),\n clearTimeout: (timeoutId) => clearTimeout(timeoutId),\n\n setInterval: (callback, delay) => setInterval(callback, delay),\n clearInterval: (intervalId) => clearInterval(intervalId),\n}\n\n/**\n * Allows customization of how timeouts are created.\n *\n * @tanstack/query-core makes liberal use of timeouts to implement `staleTime`\n * and `gcTime`. The default TimeoutManager provider uses the platform's global\n * `setTimeout` implementation, which is known to have scalability issues with\n * thousands of timeouts on the event loop.\n *\n * If you hit this limitation, consider providing a custom TimeoutProvider that\n * coalesces timeouts.\n */\nexport class TimeoutManager implements Omit {\n // We cannot have TimeoutManager as we must instantiate it with a concrete\n // type at app boot; and if we leave that type, then any new timer provider\n // would need to support ReturnType, which is infeasible.\n //\n // We settle for type safety for the TimeoutProvider type, and accept that\n // this class is unsafe internally to allow for extension.\n #provider: TimeoutProvider = defaultTimeoutProvider\n #providerCalled = false\n\n setTimeoutProvider(\n provider: TimeoutProvider,\n ): void {\n if (process.env.NODE_ENV !== 'production') {\n if (this.#providerCalled && provider !== this.#provider) {\n // After changing providers, `clearTimeout` will not work as expected for\n // timeouts from the previous provider.\n //\n // Since they may allocate the same timeout ID, clearTimeout may cancel an\n // arbitrary different timeout, or unexpected no-op.\n //\n // We could protect against this by mixing the timeout ID bits\n // deterministically with some per-provider bits.\n //\n // We could internally queue `setTimeout` calls to `TimeoutManager` until\n // some API call to set the initial provider.\n console.error(\n `[timeoutManager]: Switching provider after calls to previous provider might result in unexpected behavior.`,\n { previous: this.#provider, provider },\n )\n }\n }\n\n this.#provider = provider\n if (process.env.NODE_ENV !== 'production') {\n this.#providerCalled = false\n }\n }\n\n setTimeout(callback: TimeoutCallback, delay: number): ManagedTimerId {\n if (process.env.NODE_ENV !== 'production') {\n this.#providerCalled = true\n }\n return this.#provider.setTimeout(callback, delay)\n }\n\n clearTimeout(timeoutId: ManagedTimerId | undefined): void {\n this.#provider.clearTimeout(timeoutId)\n }\n\n setInterval(callback: TimeoutCallback, delay: number): ManagedTimerId {\n if (process.env.NODE_ENV !== 'production') {\n this.#providerCalled = true\n }\n return this.#provider.setInterval(callback, delay)\n }\n\n clearInterval(intervalId: ManagedTimerId | undefined): void {\n this.#provider.clearInterval(intervalId)\n }\n}\n\nexport const timeoutManager = new TimeoutManager()\n\n/**\n * In many cases code wants to delay to the next event loop tick; this is not\n * mediated by {@link timeoutManager}.\n *\n * This function is provided to make auditing the `tanstack/query-core` for\n * incorrect use of system `setTimeout` easier.\n */\nexport function systemSetTimeoutZero(callback: TimeoutCallback): void {\n setTimeout(callback, 0)\n}\n"],"mappings":";;;;;;;AA8BO,IAAM,yBAET;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAWF,YAAY,CAAC,UAAU,UAAU,WAAW,UAAU,KAAK;AAAA,EAC3D,cAAc,CAAC,cAAc,aAAa,SAAS;AAAA,EAEnD,aAAa,CAAC,UAAU,UAAU,YAAY,UAAU,KAAK;AAAA,EAC7D,eAAe,CAAC,eAAe,cAAc,UAAU;AACzD;AAhDA;AA6DO,IAAM,iBAAN,MAA8D;AAAA,EAA9D;AAOL;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kCAAkC;AAClC,wCAAkB;AAAA;AAAA,EAElB,mBACE,UACM;AACN,QAAI,QAAQ,IAAI,aAAa,cAAc;AACzC,UAAI,mBAAK,oBAAmB,aAAa,mBAAK,YAAW;AAYvD,gBAAQ;AAAA,UACN;AAAA,UACA,EAAE,UAAU,mBAAK,YAAW,SAAS;AAAA,QACvC;AAAA,MACF;AAAA,IACF;AAEA,uBAAK,WAAY;AACjB,QAAI,QAAQ,IAAI,aAAa,cAAc;AACzC,yBAAK,iBAAkB;AAAA,IACzB;AAAA,EACF;AAAA,EAEA,WAAW,UAA2B,OAA+B;AACnE,QAAI,QAAQ,IAAI,aAAa,cAAc;AACzC,yBAAK,iBAAkB;AAAA,IACzB;AACA,WAAO,mBAAK,WAAU,WAAW,UAAU,KAAK;AAAA,EAClD;AAAA,EAEA,aAAa,WAA6C;AACxD,uBAAK,WAAU,aAAa,SAAS;AAAA,EACvC;AAAA,EAEA,YAAY,UAA2B,OAA+B;AACpE,QAAI,QAAQ,IAAI,aAAa,cAAc;AACzC,yBAAK,iBAAkB;AAAA,IACzB;AACA,WAAO,mBAAK,WAAU,YAAY,UAAU,KAAK;AAAA,EACnD;AAAA,EAEA,cAAc,YAA8C;AAC1D,uBAAK,WAAU,cAAc,UAAU;AAAA,EACzC;AACF;AArDE;AACA;AAsDK,IAAM,iBAAiB,IAAI,eAAe;AAS1C,SAAS,qBAAqB,UAAiC;AACpE,aAAW,UAAU,CAAC;AACxB;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/types.cjs b/node_modules/@tanstack/query-core/build/legacy/types.cjs deleted file mode 100644 index b948e7c..0000000 --- a/node_modules/@tanstack/query-core/build/legacy/types.cjs +++ /dev/null @@ -1,37 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// src/types.ts -var types_exports = {}; -__export(types_exports, { - dataTagErrorSymbol: () => dataTagErrorSymbol, - dataTagSymbol: () => dataTagSymbol, - unsetMarker: () => unsetMarker -}); -module.exports = __toCommonJS(types_exports); -var dataTagSymbol = /* @__PURE__ */ Symbol("dataTagSymbol"); -var dataTagErrorSymbol = /* @__PURE__ */ Symbol("dataTagErrorSymbol"); -var unsetMarker = /* @__PURE__ */ Symbol("unsetMarker"); -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - dataTagErrorSymbol, - dataTagSymbol, - unsetMarker -}); -//# sourceMappingURL=types.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/types.cjs.map b/node_modules/@tanstack/query-core/build/legacy/types.cjs.map deleted file mode 100644 index 21fe50b..0000000 --- a/node_modules/@tanstack/query-core/build/legacy/types.cjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/types.ts"],"sourcesContent":["/* istanbul ignore file */\n\nimport type { QueryClient } from './queryClient'\nimport type { DehydrateOptions, HydrateOptions } from './hydration'\nimport type { MutationState } from './mutation'\nimport type { FetchDirection, Query, QueryBehavior } from './query'\nimport type { RetryDelayValue, RetryValue } from './retryer'\nimport type { QueryFilters, QueryTypeFilter, SkipToken } from './utils'\nimport type { QueryCache } from './queryCache'\nimport type { MutationCache } from './mutationCache'\n\nexport type NonUndefinedGuard = T extends undefined ? never : T\n\nexport type DistributiveOmit<\n TObject,\n TKey extends keyof TObject,\n> = TObject extends any ? Omit : never\n\nexport type OmitKeyof<\n TObject,\n TKey extends TStrictly extends 'safely'\n ?\n | keyof TObject\n | (string & Record)\n | (number & Record)\n | (symbol & Record)\n : keyof TObject,\n TStrictly extends 'strictly' | 'safely' = 'strictly',\n> = Omit\n\nexport type Override = {\n [AKey in keyof TTargetA]: AKey extends keyof TTargetB\n ? TTargetB[AKey]\n : TTargetA[AKey]\n}\n\nexport type NoInfer = [T][T extends any ? 0 : never]\n\nexport interface Register {\n // defaultError: Error\n // queryMeta: Record\n // mutationMeta: Record\n // queryKey: ReadonlyArray\n // mutationKey: ReadonlyArray\n}\n\nexport type DefaultError = Register extends {\n defaultError: infer TError\n}\n ? TError\n : Error\n\nexport type QueryKey = Register extends {\n queryKey: infer TQueryKey\n}\n ? TQueryKey extends ReadonlyArray\n ? TQueryKey\n : TQueryKey extends Array\n ? TQueryKey\n : ReadonlyArray\n : ReadonlyArray\n\nexport const dataTagSymbol = Symbol('dataTagSymbol')\nexport type dataTagSymbol = typeof dataTagSymbol\nexport const dataTagErrorSymbol = Symbol('dataTagErrorSymbol')\nexport type dataTagErrorSymbol = typeof dataTagErrorSymbol\nexport const unsetMarker = Symbol('unsetMarker')\nexport type UnsetMarker = typeof unsetMarker\nexport type AnyDataTag = {\n [dataTagSymbol]: any\n [dataTagErrorSymbol]: any\n}\nexport type DataTag<\n TType,\n TValue,\n TError = UnsetMarker,\n> = TType extends AnyDataTag\n ? TType\n : TType & {\n [dataTagSymbol]: TValue\n [dataTagErrorSymbol]: TError\n }\n\nexport type InferDataFromTag =\n TTaggedQueryKey extends DataTag\n ? TaggedValue\n : TQueryFnData\n\nexport type InferErrorFromTag =\n TTaggedQueryKey extends DataTag\n ? TaggedError extends UnsetMarker\n ? TError\n : TaggedError\n : TError\n\nexport type QueryFunction<\n T = unknown,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = never,\n> = (context: QueryFunctionContext) => T | Promise\n\nexport type StaleTime = number | 'static'\n\nexport type StaleTimeFunction<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> =\n | StaleTime\n | ((query: Query) => StaleTime)\n\nexport type Enabled<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> =\n | boolean\n | ((query: Query) => boolean)\n\nexport type QueryPersister<\n T = unknown,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = never,\n> = [TPageParam] extends [never]\n ? (\n queryFn: QueryFunction,\n context: QueryFunctionContext,\n query: Query,\n ) => T | Promise\n : (\n queryFn: QueryFunction,\n context: QueryFunctionContext,\n query: Query,\n ) => T | Promise\n\nexport type QueryFunctionContext<\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = never,\n> = [TPageParam] extends [never]\n ? {\n client: QueryClient\n queryKey: TQueryKey\n signal: AbortSignal\n meta: QueryMeta | undefined\n pageParam?: unknown\n /**\n * @deprecated\n * if you want access to the direction, you can add it to the pageParam\n */\n direction?: unknown\n }\n : {\n client: QueryClient\n queryKey: TQueryKey\n signal: AbortSignal\n pageParam: TPageParam\n /**\n * @deprecated\n * if you want access to the direction, you can add it to the pageParam\n */\n direction: FetchDirection\n meta: QueryMeta | undefined\n }\n\nexport type InitialDataFunction = () => T | undefined\n\ntype NonFunctionGuard = T extends Function ? never : T\n\nexport type PlaceholderDataFunction<\n TQueryFnData = unknown,\n TError = DefaultError,\n TQueryData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> = (\n previousData: TQueryData | undefined,\n previousQuery: Query | undefined,\n) => TQueryData | undefined\n\nexport type QueriesPlaceholderDataFunction = (\n previousData: undefined,\n previousQuery: undefined,\n) => TQueryData | undefined\n\nexport type QueryKeyHashFunction = (\n queryKey: TQueryKey,\n) => string\n\nexport type GetPreviousPageParamFunction = (\n firstPage: TQueryFnData,\n allPages: Array,\n firstPageParam: TPageParam,\n allPageParams: Array,\n) => TPageParam | undefined | null\n\nexport type GetNextPageParamFunction = (\n lastPage: TQueryFnData,\n allPages: Array,\n lastPageParam: TPageParam,\n allPageParams: Array,\n) => TPageParam | undefined | null\n\nexport interface InfiniteData {\n pages: Array\n pageParams: Array\n}\n\nexport type QueryMeta = Register extends {\n queryMeta: infer TQueryMeta\n}\n ? TQueryMeta extends Record\n ? TQueryMeta\n : Record\n : Record\n\nexport type NetworkMode = 'online' | 'always' | 'offlineFirst'\n\nexport type NotifyOnChangeProps =\n | Array\n | 'all'\n | undefined\n | (() => Array | 'all' | undefined)\n\nexport interface QueryOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = never,\n> {\n /**\n * If `false`, failed queries will not retry by default.\n * If `true`, failed queries will retry infinitely., failureCount: num\n * If set to an integer number, e.g. 3, failed queries will retry until the failed query count meets that number.\n * If set to a function `(failureCount, error) => boolean` failed queries will retry until the function returns false.\n */\n retry?: RetryValue\n retryDelay?: RetryDelayValue\n networkMode?: NetworkMode\n /**\n * The time in milliseconds that unused/inactive cache data remains in memory.\n * When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration.\n * When different garbage collection times are specified, the longest one will be used.\n * Setting it to `Infinity` will disable garbage collection.\n */\n gcTime?: number\n queryFn?: QueryFunction | SkipToken\n persister?: QueryPersister<\n NoInfer,\n NoInfer,\n NoInfer\n >\n queryHash?: string\n queryKey?: TQueryKey\n queryKeyHashFn?: QueryKeyHashFunction\n initialData?: TData | InitialDataFunction\n initialDataUpdatedAt?: number | (() => number | undefined)\n behavior?: QueryBehavior\n /**\n * Set this to `false` to disable structural sharing between query results.\n * Set this to a function which accepts the old and new data and returns resolved data of the same type to implement custom structural sharing logic.\n * Defaults to `true`.\n */\n structuralSharing?:\n | boolean\n | ((oldData: unknown | undefined, newData: unknown) => unknown)\n _defaulted?: boolean\n /**\n * Additional payload to be stored on each query.\n * Use this property to pass information that can be used in other places.\n */\n meta?: QueryMeta\n /**\n * Maximum number of pages to store in the data of an infinite query.\n */\n maxPages?: number\n}\n\nexport interface InitialPageParam {\n initialPageParam: TPageParam\n}\n\nexport interface InfiniteQueryPageParamsOptions<\n TQueryFnData = unknown,\n TPageParam = unknown,\n> extends InitialPageParam {\n /**\n * This function can be set to automatically get the previous cursor for infinite queries.\n * The result will also be used to determine the value of `hasPreviousPage`.\n */\n getPreviousPageParam?: GetPreviousPageParamFunction\n /**\n * This function can be set to automatically get the next cursor for infinite queries.\n * The result will also be used to determine the value of `hasNextPage`.\n */\n getNextPageParam: GetNextPageParamFunction\n}\n\nexport type ThrowOnError<\n TQueryFnData,\n TError,\n TQueryData,\n TQueryKey extends QueryKey,\n> =\n | boolean\n | ((\n error: TError,\n query: Query,\n ) => boolean)\n\nexport interface QueryObserverOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = never,\n> extends WithRequired<\n QueryOptions,\n 'queryKey'\n> {\n /**\n * Set this to `false` or a function that returns `false` to disable automatic refetching when the query mounts or changes query keys.\n * To refetch the query, use the `refetch` method returned from the `useQuery` instance.\n * Accepts a boolean or function that returns a boolean.\n * Defaults to `true`.\n */\n enabled?: Enabled\n /**\n * The time in milliseconds after data is considered stale.\n * If set to `Infinity`, the data will never be considered stale.\n * If set to a function, the function will be executed with the query to compute a `staleTime`.\n * Defaults to `0`.\n */\n staleTime?: StaleTimeFunction\n /**\n * If set to a number, the query will continuously refetch at this frequency in milliseconds.\n * If set to a function, the function will be executed with the latest data and query to compute a frequency\n * Defaults to `false`.\n */\n refetchInterval?:\n | number\n | false\n | ((\n query: Query,\n ) => number | false | undefined)\n /**\n * If set to `true`, the query will continue to refetch while their tab/window is in the background.\n * Defaults to `false`.\n */\n refetchIntervalInBackground?: boolean\n /**\n * If set to `true`, the query will refetch on window focus if the data is stale.\n * If set to `false`, the query will not refetch on window focus.\n * If set to `'always'`, the query will always refetch on window focus.\n * If set to a function, the function will be executed with the latest data and query to compute the value.\n * Defaults to `true`.\n */\n refetchOnWindowFocus?:\n | boolean\n | 'always'\n | ((\n query: Query,\n ) => boolean | 'always')\n /**\n * If set to `true`, the query will refetch on reconnect if the data is stale.\n * If set to `false`, the query will not refetch on reconnect.\n * If set to `'always'`, the query will always refetch on reconnect.\n * If set to a function, the function will be executed with the latest data and query to compute the value.\n * Defaults to the value of `networkOnline` (`true`)\n */\n refetchOnReconnect?:\n | boolean\n | 'always'\n | ((\n query: Query,\n ) => boolean | 'always')\n /**\n * If set to `true`, the query will refetch on mount if the data is stale.\n * If set to `false`, will disable additional instances of a query to trigger background refetch.\n * If set to `'always'`, the query will always refetch on mount.\n * If set to a function, the function will be executed with the latest data and query to compute the value\n * Defaults to `true`.\n */\n refetchOnMount?:\n | boolean\n | 'always'\n | ((\n query: Query,\n ) => boolean | 'always')\n /**\n * If set to `false`, the query will not be retried on mount if it contains an error.\n * Defaults to `true`.\n */\n retryOnMount?: boolean\n /**\n * If set, the component will only re-render if any of the listed properties change.\n * When set to `['data', 'error']`, the component will only re-render when the `data` or `error` properties change.\n * When set to `'all'`, the component will re-render whenever a query is updated.\n * When set to a function, the function will be executed to compute the list of properties.\n * By default, access to properties will be tracked, and the component will only re-render when one of the tracked properties change.\n */\n notifyOnChangeProps?: NotifyOnChangeProps\n /**\n * Whether errors should be thrown instead of setting the `error` property.\n * If set to `true` or `suspense` is `true`, all errors will be thrown to the error boundary.\n * If set to `false` and `suspense` is `false`, errors are returned as state.\n * If set to a function, it will be passed the error and the query, and it should return a boolean indicating whether to show the error in an error boundary (`true`) or return the error as state (`false`).\n * Defaults to `false`.\n */\n throwOnError?: ThrowOnError\n /**\n * This option can be used to transform or select a part of the data returned by the query function.\n */\n select?: (data: TQueryData) => TData\n /**\n * If set to `true`, the query will suspend when `status === 'pending'`\n * and throw errors when `status === 'error'`.\n * Defaults to `false`.\n */\n suspense?: boolean\n /**\n * If set, this value will be used as the placeholder data for this particular query observer while the query is still in the `loading` data and no initialData has been provided.\n */\n placeholderData?:\n | NonFunctionGuard\n | PlaceholderDataFunction<\n NonFunctionGuard,\n TError,\n NonFunctionGuard,\n TQueryKey\n >\n\n _optimisticResults?: 'optimistic' | 'isRestoring'\n\n /**\n * Enable prefetching during rendering\n */\n experimental_prefetchInRender?: boolean\n}\n\nexport type WithRequired = TTarget & {\n [_ in TKey]: {}\n}\n\nexport type DefaultedQueryObserverOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> = WithRequired<\n QueryObserverOptions,\n 'throwOnError' | 'refetchOnReconnect' | 'queryHash'\n>\n\nexport interface InfiniteQueryObserverOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n>\n extends\n QueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n InfiniteData,\n TQueryKey,\n TPageParam\n >,\n InfiniteQueryPageParamsOptions {}\n\nexport type DefaultedInfiniteQueryObserverOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n> = WithRequired<\n InfiniteQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n 'throwOnError' | 'refetchOnReconnect' | 'queryHash'\n>\n\nexport interface FetchQueryOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = never,\n> extends WithRequired<\n QueryOptions,\n 'queryKey'\n> {\n initialPageParam?: never\n /**\n * The time in milliseconds after data is considered stale.\n * If the data is fresh it will be returned from the cache.\n */\n staleTime?: StaleTimeFunction\n}\n\nexport interface EnsureQueryDataOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = never,\n> extends FetchQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n> {\n revalidateIfStale?: boolean\n}\n\nexport type EnsureInfiniteQueryDataOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n> = FetchInfiniteQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n> & {\n revalidateIfStale?: boolean\n}\n\ntype FetchInfiniteQueryPages =\n | { pages?: never }\n | {\n pages: number\n getNextPageParam: GetNextPageParamFunction\n }\n\nexport type FetchInfiniteQueryOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n> = Omit<\n FetchQueryOptions<\n TQueryFnData,\n TError,\n InfiniteData,\n TQueryKey,\n TPageParam\n >,\n 'initialPageParam'\n> &\n InitialPageParam &\n FetchInfiniteQueryPages\n\nexport interface ResultOptions {\n throwOnError?: boolean\n}\n\nexport interface RefetchOptions extends ResultOptions {\n /**\n * If set to `true`, a currently running request will be cancelled before a new request is made\n *\n * If set to `false`, no refetch will be made if there is already a request running.\n *\n * Defaults to `true`.\n */\n cancelRefetch?: boolean\n}\n\nexport interface InvalidateQueryFilters<\n TQueryKey extends QueryKey = QueryKey,\n> extends QueryFilters {\n refetchType?: QueryTypeFilter | 'none'\n}\n\nexport interface RefetchQueryFilters<\n TQueryKey extends QueryKey = QueryKey,\n> extends QueryFilters {}\n\nexport interface InvalidateOptions extends RefetchOptions {}\nexport interface ResetOptions extends RefetchOptions {}\n\nexport interface FetchNextPageOptions extends ResultOptions {\n /**\n * If set to `true`, calling `fetchNextPage` repeatedly will invoke `queryFn` every time,\n * whether the previous invocation has resolved or not. Also, the result from previous invocations will be ignored.\n *\n * If set to `false`, calling `fetchNextPage` repeatedly won't have any effect until the first invocation has resolved.\n *\n * Defaults to `true`.\n */\n cancelRefetch?: boolean\n}\n\nexport interface FetchPreviousPageOptions extends ResultOptions {\n /**\n * If set to `true`, calling `fetchPreviousPage` repeatedly will invoke `queryFn` every time,\n * whether the previous invocation has resolved or not. Also, the result from previous invocations will be ignored.\n *\n * If set to `false`, calling `fetchPreviousPage` repeatedly won't have any effect until the first invocation has resolved.\n *\n * Defaults to `true`.\n */\n cancelRefetch?: boolean\n}\n\nexport type QueryStatus = 'pending' | 'error' | 'success'\nexport type FetchStatus = 'fetching' | 'paused' | 'idle'\n\nexport interface QueryObserverBaseResult<\n TData = unknown,\n TError = DefaultError,\n> {\n /**\n * The last successfully resolved data for the query.\n */\n data: TData | undefined\n /**\n * The timestamp for when the query most recently returned the `status` as `\"success\"`.\n */\n dataUpdatedAt: number\n /**\n * The error object for the query, if an error was thrown.\n * - Defaults to `null`.\n */\n error: TError | null\n /**\n * The timestamp for when the query most recently returned the `status` as `\"error\"`.\n */\n errorUpdatedAt: number\n /**\n * The failure count for the query.\n * - Incremented every time the query fails.\n * - Reset to `0` when the query succeeds.\n */\n failureCount: number\n /**\n * The failure reason for the query retry.\n * - Reset to `null` when the query succeeds.\n */\n failureReason: TError | null\n /**\n * The sum of all errors.\n */\n errorUpdateCount: number\n /**\n * A derived boolean from the `status` variable, provided for convenience.\n * - `true` if the query attempt resulted in an error.\n */\n isError: boolean\n /**\n * Will be `true` if the query has been fetched.\n */\n isFetched: boolean\n /**\n * Will be `true` if the query has been fetched after the component mounted.\n * - This property can be used to not show any previously cached data.\n */\n isFetchedAfterMount: boolean\n /**\n * A derived boolean from the `fetchStatus` variable, provided for convenience.\n * - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch.\n */\n isFetching: boolean\n /**\n * Is `true` whenever the first fetch for a query is in-flight.\n * - Is the same as `isFetching && isPending`.\n */\n isLoading: boolean\n /**\n * Will be `pending` if there's no cached data and no query attempt was finished yet.\n */\n isPending: boolean\n /**\n * Will be `true` if the query failed while fetching for the first time.\n */\n isLoadingError: boolean\n /**\n * @deprecated `isInitialLoading` is being deprecated in favor of `isLoading`\n * and will be removed in the next major version.\n */\n isInitialLoading: boolean\n /**\n * A derived boolean from the `fetchStatus` variable, provided for convenience.\n * - The query wanted to fetch, but has been `paused`.\n */\n isPaused: boolean\n /**\n * Will be `true` if the data shown is the placeholder data.\n */\n isPlaceholderData: boolean\n /**\n * Will be `true` if the query failed while refetching.\n */\n isRefetchError: boolean\n /**\n * Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`.\n * - Is the same as `isFetching && !isPending`.\n */\n isRefetching: boolean\n /**\n * Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`.\n */\n isStale: boolean\n /**\n * A derived boolean from the `status` variable, provided for convenience.\n * - `true` if the query has received a response with no errors and is ready to display its data.\n */\n isSuccess: boolean\n /**\n * `true` if this observer is enabled, `false` otherwise.\n */\n isEnabled: boolean\n /**\n * A function to manually refetch the query.\n */\n refetch: (\n options?: RefetchOptions,\n ) => Promise>\n /**\n * The status of the query.\n * - Will be:\n * - `pending` if there's no cached data and no query attempt was finished yet.\n * - `error` if the query attempt resulted in an error.\n * - `success` if the query has received a response with no errors and is ready to display its data.\n */\n status: QueryStatus\n /**\n * The fetch status of the query.\n * - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch.\n * - `paused`: The query wanted to fetch, but has been `paused`.\n * - `idle`: The query is not fetching.\n * - See [Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information.\n */\n fetchStatus: FetchStatus\n /**\n * A stable promise that will be resolved with the data of the query.\n * Requires the `experimental_prefetchInRender` feature flag to be enabled.\n * @example\n *\n * ### Enabling the feature flag\n * ```ts\n * const client = new QueryClient({\n * defaultOptions: {\n * queries: {\n * experimental_prefetchInRender: true,\n * },\n * },\n * })\n * ```\n *\n * ### Usage\n * ```tsx\n * import { useQuery } from '@tanstack/react-query'\n * import React from 'react'\n * import { fetchTodos, type Todo } from './api'\n *\n * function TodoList({ query }: { query: UseQueryResult }) {\n * const data = React.use(query.promise)\n *\n * return (\n *
    \n * {data.map(todo => (\n *
  • {todo.title}
  • \n * ))}\n *
\n * )\n * }\n *\n * export function App() {\n * const query = useQuery({ queryKey: ['todos'], queryFn: fetchTodos })\n *\n * return (\n * <>\n *

Todos

\n * Loading...}>\n * \n * \n * \n * )\n * }\n * ```\n */\n promise: Promise\n}\n\nexport interface QueryObserverPendingResult<\n TData = unknown,\n TError = DefaultError,\n> extends QueryObserverBaseResult {\n data: undefined\n error: null\n isError: false\n isPending: true\n isLoadingError: false\n isRefetchError: false\n isSuccess: false\n isPlaceholderData: false\n status: 'pending'\n}\n\nexport interface QueryObserverLoadingResult<\n TData = unknown,\n TError = DefaultError,\n> extends QueryObserverBaseResult {\n data: undefined\n error: null\n isError: false\n isPending: true\n isLoading: true\n isLoadingError: false\n isRefetchError: false\n isSuccess: false\n isPlaceholderData: false\n status: 'pending'\n}\n\nexport interface QueryObserverLoadingErrorResult<\n TData = unknown,\n TError = DefaultError,\n> extends QueryObserverBaseResult {\n data: undefined\n error: TError\n isError: true\n isPending: false\n isLoading: false\n isLoadingError: true\n isRefetchError: false\n isSuccess: false\n isPlaceholderData: false\n status: 'error'\n}\n\nexport interface QueryObserverRefetchErrorResult<\n TData = unknown,\n TError = DefaultError,\n> extends QueryObserverBaseResult {\n data: TData\n error: TError\n isError: true\n isPending: false\n isLoading: false\n isLoadingError: false\n isRefetchError: true\n isSuccess: false\n isPlaceholderData: false\n status: 'error'\n}\n\nexport interface QueryObserverSuccessResult<\n TData = unknown,\n TError = DefaultError,\n> extends QueryObserverBaseResult {\n data: TData\n error: null\n isError: false\n isPending: false\n isLoading: false\n isLoadingError: false\n isRefetchError: false\n isSuccess: true\n isPlaceholderData: false\n status: 'success'\n}\n\nexport interface QueryObserverPlaceholderResult<\n TData = unknown,\n TError = DefaultError,\n> extends QueryObserverBaseResult {\n data: TData\n isError: false\n error: null\n isPending: false\n isLoading: false\n isLoadingError: false\n isRefetchError: false\n isSuccess: true\n isPlaceholderData: true\n status: 'success'\n}\n\nexport type DefinedQueryObserverResult<\n TData = unknown,\n TError = DefaultError,\n> =\n | QueryObserverRefetchErrorResult\n | QueryObserverSuccessResult\n\nexport type QueryObserverResult =\n | DefinedQueryObserverResult\n | QueryObserverLoadingErrorResult\n | QueryObserverLoadingResult\n | QueryObserverPendingResult\n | QueryObserverPlaceholderResult\n\nexport interface InfiniteQueryObserverBaseResult<\n TData = unknown,\n TError = DefaultError,\n> extends QueryObserverBaseResult {\n /**\n * This function allows you to fetch the next \"page\" of results.\n */\n fetchNextPage: (\n options?: FetchNextPageOptions,\n ) => Promise>\n /**\n * This function allows you to fetch the previous \"page\" of results.\n */\n fetchPreviousPage: (\n options?: FetchPreviousPageOptions,\n ) => Promise>\n /**\n * Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option).\n */\n hasNextPage: boolean\n /**\n * Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option).\n */\n hasPreviousPage: boolean\n /**\n * Will be `true` if the query failed while fetching the next page.\n */\n isFetchNextPageError: boolean\n /**\n * Will be `true` while fetching the next page with `fetchNextPage`.\n */\n isFetchingNextPage: boolean\n /**\n * Will be `true` if the query failed while fetching the previous page.\n */\n isFetchPreviousPageError: boolean\n /**\n * Will be `true` while fetching the previous page with `fetchPreviousPage`.\n */\n isFetchingPreviousPage: boolean\n}\n\nexport interface InfiniteQueryObserverPendingResult<\n TData = unknown,\n TError = DefaultError,\n> extends InfiniteQueryObserverBaseResult {\n data: undefined\n error: null\n isError: false\n isPending: true\n isLoadingError: false\n isRefetchError: false\n isFetchNextPageError: false\n isFetchPreviousPageError: false\n isSuccess: false\n isPlaceholderData: false\n status: 'pending'\n}\n\nexport interface InfiniteQueryObserverLoadingResult<\n TData = unknown,\n TError = DefaultError,\n> extends InfiniteQueryObserverBaseResult {\n data: undefined\n error: null\n isError: false\n isPending: true\n isLoading: true\n isLoadingError: false\n isRefetchError: false\n isFetchNextPageError: false\n isFetchPreviousPageError: false\n isSuccess: false\n isPlaceholderData: false\n status: 'pending'\n}\n\nexport interface InfiniteQueryObserverLoadingErrorResult<\n TData = unknown,\n TError = DefaultError,\n> extends InfiniteQueryObserverBaseResult {\n data: undefined\n error: TError\n isError: true\n isPending: false\n isLoading: false\n isLoadingError: true\n isRefetchError: false\n isFetchNextPageError: false\n isFetchPreviousPageError: false\n isSuccess: false\n isPlaceholderData: false\n status: 'error'\n}\n\nexport interface InfiniteQueryObserverRefetchErrorResult<\n TData = unknown,\n TError = DefaultError,\n> extends InfiniteQueryObserverBaseResult {\n data: TData\n error: TError\n isError: true\n isPending: false\n isLoading: false\n isLoadingError: false\n isRefetchError: true\n isSuccess: false\n isPlaceholderData: false\n status: 'error'\n}\n\nexport interface InfiniteQueryObserverSuccessResult<\n TData = unknown,\n TError = DefaultError,\n> extends InfiniteQueryObserverBaseResult {\n data: TData\n error: null\n isError: false\n isPending: false\n isLoading: false\n isLoadingError: false\n isRefetchError: false\n isFetchNextPageError: false\n isFetchPreviousPageError: false\n isSuccess: true\n isPlaceholderData: false\n status: 'success'\n}\n\nexport interface InfiniteQueryObserverPlaceholderResult<\n TData = unknown,\n TError = DefaultError,\n> extends InfiniteQueryObserverBaseResult {\n data: TData\n isError: false\n error: null\n isPending: false\n isLoading: false\n isLoadingError: false\n isRefetchError: false\n isSuccess: true\n isPlaceholderData: true\n isFetchNextPageError: false\n isFetchPreviousPageError: false\n status: 'success'\n}\n\nexport type DefinedInfiniteQueryObserverResult<\n TData = unknown,\n TError = DefaultError,\n> =\n | InfiniteQueryObserverRefetchErrorResult\n | InfiniteQueryObserverSuccessResult\n\nexport type InfiniteQueryObserverResult<\n TData = unknown,\n TError = DefaultError,\n> =\n | DefinedInfiniteQueryObserverResult\n | InfiniteQueryObserverLoadingErrorResult\n | InfiniteQueryObserverLoadingResult\n | InfiniteQueryObserverPendingResult\n | InfiniteQueryObserverPlaceholderResult\n\nexport type MutationKey = Register extends {\n mutationKey: infer TMutationKey\n}\n ? TMutationKey extends ReadonlyArray\n ? TMutationKey\n : TMutationKey extends Array\n ? TMutationKey\n : ReadonlyArray\n : ReadonlyArray\n\nexport type MutationStatus = 'idle' | 'pending' | 'success' | 'error'\n\nexport type MutationScope = {\n id: string\n}\n\nexport type MutationMeta = Register extends {\n mutationMeta: infer TMutationMeta\n}\n ? TMutationMeta extends Record\n ? TMutationMeta\n : Record\n : Record\n\nexport type MutationFunctionContext = {\n client: QueryClient\n meta: MutationMeta | undefined\n mutationKey?: MutationKey\n}\n\nexport type MutationFunction = (\n variables: TVariables,\n context: MutationFunctionContext,\n) => Promise\n\nexport interface MutationOptions<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n> {\n mutationFn?: MutationFunction\n mutationKey?: MutationKey\n onMutate?: (\n variables: TVariables,\n context: MutationFunctionContext,\n ) => Promise | TOnMutateResult\n onSuccess?: (\n data: TData,\n variables: TVariables,\n onMutateResult: TOnMutateResult,\n context: MutationFunctionContext,\n ) => Promise | unknown\n onError?: (\n error: TError,\n variables: TVariables,\n onMutateResult: TOnMutateResult | undefined,\n context: MutationFunctionContext,\n ) => Promise | unknown\n onSettled?: (\n data: TData | undefined,\n error: TError | null,\n variables: TVariables,\n onMutateResult: TOnMutateResult | undefined,\n context: MutationFunctionContext,\n ) => Promise | unknown\n retry?: RetryValue\n retryDelay?: RetryDelayValue\n networkMode?: NetworkMode\n gcTime?: number\n _defaulted?: boolean\n meta?: MutationMeta\n scope?: MutationScope\n}\n\nexport interface MutationObserverOptions<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n> extends MutationOptions {\n throwOnError?: boolean | ((error: TError) => boolean)\n}\n\nexport interface MutateOptions<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n> {\n onSuccess?: (\n data: TData,\n variables: TVariables,\n onMutateResult: TOnMutateResult | undefined,\n context: MutationFunctionContext,\n ) => void\n onError?: (\n error: TError,\n variables: TVariables,\n onMutateResult: TOnMutateResult | undefined,\n context: MutationFunctionContext,\n ) => void\n onSettled?: (\n data: TData | undefined,\n error: TError | null,\n variables: TVariables,\n onMutateResult: TOnMutateResult | undefined,\n context: MutationFunctionContext,\n ) => void\n}\n\nexport type MutateFunction<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n> = (\n variables: TVariables,\n options?: MutateOptions,\n) => Promise\n\nexport interface MutationObserverBaseResult<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n> extends MutationState {\n /**\n * The last successfully resolved data for the mutation.\n */\n data: TData | undefined\n /**\n * The variables object passed to the `mutationFn`.\n */\n variables: TVariables | undefined\n /**\n * The error object for the mutation, if an error was encountered.\n * - Defaults to `null`.\n */\n error: TError | null\n /**\n * A boolean variable derived from `status`.\n * - `true` if the last mutation attempt resulted in an error.\n */\n isError: boolean\n /**\n * A boolean variable derived from `status`.\n * - `true` if the mutation is in its initial state prior to executing.\n */\n isIdle: boolean\n /**\n * A boolean variable derived from `status`.\n * - `true` if the mutation is currently executing.\n */\n isPending: boolean\n /**\n * A boolean variable derived from `status`.\n * - `true` if the last mutation attempt was successful.\n */\n isSuccess: boolean\n /**\n * The status of the mutation.\n * - Will be:\n * - `idle` initial status prior to the mutation function executing.\n * - `pending` if the mutation is currently executing.\n * - `error` if the last mutation attempt resulted in an error.\n * - `success` if the last mutation attempt was successful.\n */\n status: MutationStatus\n /**\n * The mutation function you can call with variables to trigger the mutation and optionally hooks on additional callback options.\n * @param variables - The variables object to pass to the `mutationFn`.\n * @param options.onSuccess - This function will fire when the mutation is successful and will be passed the mutation's result.\n * @param options.onError - This function will fire if the mutation encounters an error and will be passed the error.\n * @param options.onSettled - This function will fire when the mutation is either successfully fetched or encounters an error and be passed either the data or error.\n * @remarks\n * - If you make multiple requests, `onSuccess` will fire only after the latest call you've made.\n * - All the callback functions (`onSuccess`, `onError`, `onSettled`) are void functions, and the returned value will be ignored.\n */\n mutate: MutateFunction\n /**\n * A function to clean the mutation internal state (i.e., it resets the mutation to its initial state).\n */\n reset: () => void\n}\n\nexport interface MutationObserverIdleResult<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n> extends MutationObserverBaseResult<\n TData,\n TError,\n TVariables,\n TOnMutateResult\n> {\n data: undefined\n variables: undefined\n error: null\n isError: false\n isIdle: true\n isPending: false\n isSuccess: false\n status: 'idle'\n}\n\nexport interface MutationObserverLoadingResult<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n> extends MutationObserverBaseResult<\n TData,\n TError,\n TVariables,\n TOnMutateResult\n> {\n data: undefined\n variables: TVariables\n error: null\n isError: false\n isIdle: false\n isPending: true\n isSuccess: false\n status: 'pending'\n}\n\nexport interface MutationObserverErrorResult<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n> extends MutationObserverBaseResult<\n TData,\n TError,\n TVariables,\n TOnMutateResult\n> {\n data: undefined\n error: TError\n variables: TVariables\n isError: true\n isIdle: false\n isPending: false\n isSuccess: false\n status: 'error'\n}\n\nexport interface MutationObserverSuccessResult<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n> extends MutationObserverBaseResult<\n TData,\n TError,\n TVariables,\n TOnMutateResult\n> {\n data: TData\n error: null\n variables: TVariables\n isError: false\n isIdle: false\n isPending: false\n isSuccess: true\n status: 'success'\n}\n\nexport type MutationObserverResult<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n> =\n | MutationObserverIdleResult\n | MutationObserverLoadingResult\n | MutationObserverErrorResult\n | MutationObserverSuccessResult\n\nexport interface QueryClientConfig {\n queryCache?: QueryCache\n mutationCache?: MutationCache\n defaultOptions?: DefaultOptions\n}\n\nexport interface DefaultOptions {\n queries?: OmitKeyof<\n QueryObserverOptions,\n 'suspense' | 'queryKey'\n >\n mutations?: MutationObserverOptions\n hydrate?: HydrateOptions['defaultOptions']\n dehydrate?: DehydrateOptions\n}\n\nexport interface CancelOptions {\n revert?: boolean\n silent?: boolean\n}\n\nexport interface SetDataOptions {\n updatedAt?: number\n}\n\nexport type NotifyEventType =\n | 'added'\n | 'removed'\n | 'updated'\n | 'observerAdded'\n | 'observerRemoved'\n | 'observerResultsUpdated'\n | 'observerOptionsUpdated'\n\nexport interface NotifyEvent {\n type: NotifyEventType\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA8DO,IAAM,gBAAgB,uBAAO,eAAe;AAE5C,IAAM,qBAAqB,uBAAO,oBAAoB;AAEtD,IAAM,cAAc,uBAAO,aAAa;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/types.d.cts b/node_modules/@tanstack/query-core/build/legacy/types.d.cts deleted file mode 100644 index c613caa..0000000 --- a/node_modules/@tanstack/query-core/build/legacy/types.d.cts +++ /dev/null @@ -1,3 +0,0 @@ -export { T as AnyDataTag, b7 as CancelOptions, V as DataTag, G as DefaultError, b6 as DefaultOptions, ak as DefaultedInfiniteQueryObserverOptions, ai as DefaultedQueryObserverOptions, aP as DefinedInfiniteQueryObserverResult, aG as DefinedQueryObserverResult, B as DistributiveOmit, $ as Enabled, an as EnsureInfiniteQueryDataOptions, am as EnsureQueryDataOptions, ao as FetchInfiniteQueryOptions, av as FetchNextPageOptions, aw as FetchPreviousPageOptions, al as FetchQueryOptions, ay as FetchStatus, a7 as GetNextPageParamFunction, a6 as GetPreviousPageParamFunction, W as InferDataFromTag, X as InferErrorFromTag, a8 as InfiniteData, aI as InfiniteQueryObserverBaseResult, aL as InfiniteQueryObserverLoadingErrorResult, aK as InfiniteQueryObserverLoadingResult, aj as InfiniteQueryObserverOptions, aJ as InfiniteQueryObserverPendingResult, aO as InfiniteQueryObserverPlaceholderResult, aM as InfiniteQueryObserverRefetchErrorResult, aQ as InfiniteQueryObserverResult, aN as InfiniteQueryObserverSuccessResult, ae as InfiniteQueryPageParamsOptions, a2 as InitialDataFunction, ad as InitialPageParam, at as InvalidateOptions, ar as InvalidateQueryFilters, a_ as MutateFunction, aZ as MutateOptions, aW as MutationFunction, aV as MutationFunctionContext, aR as MutationKey, aU as MutationMeta, a$ as MutationObserverBaseResult, b2 as MutationObserverErrorResult, b0 as MutationObserverIdleResult, b1 as MutationObserverLoadingResult, aY as MutationObserverOptions, b4 as MutationObserverResult, b3 as MutationObserverSuccessResult, aX as MutationOptions, aT as MutationScope, aS as MutationStatus, aa as NetworkMode, F as NoInfer, N as NonUndefinedGuard, ba as NotifyEvent, b9 as NotifyEventType, ab as NotifyOnChangeProps, O as OmitKeyof, E as Override, a3 as PlaceholderDataFunction, a4 as QueriesPlaceholderDataFunction, b5 as QueryClientConfig, Y as QueryFunction, a1 as QueryFunctionContext, I as QueryKey, a5 as QueryKeyHashFunction, a9 as QueryMeta, az as QueryObserverBaseResult, aC as QueryObserverLoadingErrorResult, aB as QueryObserverLoadingResult, ag as QueryObserverOptions, aA as QueryObserverPendingResult, aF as QueryObserverPlaceholderResult, aD as QueryObserverRefetchErrorResult, aH as QueryObserverResult, aE as QueryObserverSuccessResult, ac as QueryOptions, a0 as QueryPersister, ax as QueryStatus, aq as RefetchOptions, as as RefetchQueryFilters, R as Register, au as ResetOptions, ap as ResultOptions, b8 as SetDataOptions, Z as StaleTime, _ as StaleTimeFunction, af as ThrowOnError, P as UnsetMarker, ah as WithRequired, K as dataTagErrorSymbol, J as dataTagSymbol, L as unsetMarker } from './hydration-uphG6M-i.cjs'; -import './removable.cjs'; -import './subscribable.cjs'; diff --git a/node_modules/@tanstack/query-core/build/legacy/types.d.ts b/node_modules/@tanstack/query-core/build/legacy/types.d.ts deleted file mode 100644 index f951ea6..0000000 --- a/node_modules/@tanstack/query-core/build/legacy/types.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export { T as AnyDataTag, b7 as CancelOptions, V as DataTag, G as DefaultError, b6 as DefaultOptions, ak as DefaultedInfiniteQueryObserverOptions, ai as DefaultedQueryObserverOptions, aP as DefinedInfiniteQueryObserverResult, aG as DefinedQueryObserverResult, B as DistributiveOmit, $ as Enabled, an as EnsureInfiniteQueryDataOptions, am as EnsureQueryDataOptions, ao as FetchInfiniteQueryOptions, av as FetchNextPageOptions, aw as FetchPreviousPageOptions, al as FetchQueryOptions, ay as FetchStatus, a7 as GetNextPageParamFunction, a6 as GetPreviousPageParamFunction, W as InferDataFromTag, X as InferErrorFromTag, a8 as InfiniteData, aI as InfiniteQueryObserverBaseResult, aL as InfiniteQueryObserverLoadingErrorResult, aK as InfiniteQueryObserverLoadingResult, aj as InfiniteQueryObserverOptions, aJ as InfiniteQueryObserverPendingResult, aO as InfiniteQueryObserverPlaceholderResult, aM as InfiniteQueryObserverRefetchErrorResult, aQ as InfiniteQueryObserverResult, aN as InfiniteQueryObserverSuccessResult, ae as InfiniteQueryPageParamsOptions, a2 as InitialDataFunction, ad as InitialPageParam, at as InvalidateOptions, ar as InvalidateQueryFilters, a_ as MutateFunction, aZ as MutateOptions, aW as MutationFunction, aV as MutationFunctionContext, aR as MutationKey, aU as MutationMeta, a$ as MutationObserverBaseResult, b2 as MutationObserverErrorResult, b0 as MutationObserverIdleResult, b1 as MutationObserverLoadingResult, aY as MutationObserverOptions, b4 as MutationObserverResult, b3 as MutationObserverSuccessResult, aX as MutationOptions, aT as MutationScope, aS as MutationStatus, aa as NetworkMode, F as NoInfer, N as NonUndefinedGuard, ba as NotifyEvent, b9 as NotifyEventType, ab as NotifyOnChangeProps, O as OmitKeyof, E as Override, a3 as PlaceholderDataFunction, a4 as QueriesPlaceholderDataFunction, b5 as QueryClientConfig, Y as QueryFunction, a1 as QueryFunctionContext, I as QueryKey, a5 as QueryKeyHashFunction, a9 as QueryMeta, az as QueryObserverBaseResult, aC as QueryObserverLoadingErrorResult, aB as QueryObserverLoadingResult, ag as QueryObserverOptions, aA as QueryObserverPendingResult, aF as QueryObserverPlaceholderResult, aD as QueryObserverRefetchErrorResult, aH as QueryObserverResult, aE as QueryObserverSuccessResult, ac as QueryOptions, a0 as QueryPersister, ax as QueryStatus, aq as RefetchOptions, as as RefetchQueryFilters, R as Register, au as ResetOptions, ap as ResultOptions, b8 as SetDataOptions, Z as StaleTime, _ as StaleTimeFunction, af as ThrowOnError, P as UnsetMarker, ah as WithRequired, K as dataTagErrorSymbol, J as dataTagSymbol, L as unsetMarker } from './hydration-BlEVG2Lp.js'; -import './removable.js'; -import './subscribable.js'; diff --git a/node_modules/@tanstack/query-core/build/legacy/types.js b/node_modules/@tanstack/query-core/build/legacy/types.js deleted file mode 100644 index e52a8fc..0000000 --- a/node_modules/@tanstack/query-core/build/legacy/types.js +++ /dev/null @@ -1,12 +0,0 @@ -import "./chunk-PXG64RU4.js"; - -// src/types.ts -var dataTagSymbol = /* @__PURE__ */ Symbol("dataTagSymbol"); -var dataTagErrorSymbol = /* @__PURE__ */ Symbol("dataTagErrorSymbol"); -var unsetMarker = /* @__PURE__ */ Symbol("unsetMarker"); -export { - dataTagErrorSymbol, - dataTagSymbol, - unsetMarker -}; -//# sourceMappingURL=types.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/types.js.map b/node_modules/@tanstack/query-core/build/legacy/types.js.map deleted file mode 100644 index da7b523..0000000 --- a/node_modules/@tanstack/query-core/build/legacy/types.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/types.ts"],"sourcesContent":["/* istanbul ignore file */\n\nimport type { QueryClient } from './queryClient'\nimport type { DehydrateOptions, HydrateOptions } from './hydration'\nimport type { MutationState } from './mutation'\nimport type { FetchDirection, Query, QueryBehavior } from './query'\nimport type { RetryDelayValue, RetryValue } from './retryer'\nimport type { QueryFilters, QueryTypeFilter, SkipToken } from './utils'\nimport type { QueryCache } from './queryCache'\nimport type { MutationCache } from './mutationCache'\n\nexport type NonUndefinedGuard = T extends undefined ? never : T\n\nexport type DistributiveOmit<\n TObject,\n TKey extends keyof TObject,\n> = TObject extends any ? Omit : never\n\nexport type OmitKeyof<\n TObject,\n TKey extends TStrictly extends 'safely'\n ?\n | keyof TObject\n | (string & Record)\n | (number & Record)\n | (symbol & Record)\n : keyof TObject,\n TStrictly extends 'strictly' | 'safely' = 'strictly',\n> = Omit\n\nexport type Override = {\n [AKey in keyof TTargetA]: AKey extends keyof TTargetB\n ? TTargetB[AKey]\n : TTargetA[AKey]\n}\n\nexport type NoInfer = [T][T extends any ? 0 : never]\n\nexport interface Register {\n // defaultError: Error\n // queryMeta: Record\n // mutationMeta: Record\n // queryKey: ReadonlyArray\n // mutationKey: ReadonlyArray\n}\n\nexport type DefaultError = Register extends {\n defaultError: infer TError\n}\n ? TError\n : Error\n\nexport type QueryKey = Register extends {\n queryKey: infer TQueryKey\n}\n ? TQueryKey extends ReadonlyArray\n ? TQueryKey\n : TQueryKey extends Array\n ? TQueryKey\n : ReadonlyArray\n : ReadonlyArray\n\nexport const dataTagSymbol = Symbol('dataTagSymbol')\nexport type dataTagSymbol = typeof dataTagSymbol\nexport const dataTagErrorSymbol = Symbol('dataTagErrorSymbol')\nexport type dataTagErrorSymbol = typeof dataTagErrorSymbol\nexport const unsetMarker = Symbol('unsetMarker')\nexport type UnsetMarker = typeof unsetMarker\nexport type AnyDataTag = {\n [dataTagSymbol]: any\n [dataTagErrorSymbol]: any\n}\nexport type DataTag<\n TType,\n TValue,\n TError = UnsetMarker,\n> = TType extends AnyDataTag\n ? TType\n : TType & {\n [dataTagSymbol]: TValue\n [dataTagErrorSymbol]: TError\n }\n\nexport type InferDataFromTag =\n TTaggedQueryKey extends DataTag\n ? TaggedValue\n : TQueryFnData\n\nexport type InferErrorFromTag =\n TTaggedQueryKey extends DataTag\n ? TaggedError extends UnsetMarker\n ? TError\n : TaggedError\n : TError\n\nexport type QueryFunction<\n T = unknown,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = never,\n> = (context: QueryFunctionContext) => T | Promise\n\nexport type StaleTime = number | 'static'\n\nexport type StaleTimeFunction<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> =\n | StaleTime\n | ((query: Query) => StaleTime)\n\nexport type Enabled<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> =\n | boolean\n | ((query: Query) => boolean)\n\nexport type QueryPersister<\n T = unknown,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = never,\n> = [TPageParam] extends [never]\n ? (\n queryFn: QueryFunction,\n context: QueryFunctionContext,\n query: Query,\n ) => T | Promise\n : (\n queryFn: QueryFunction,\n context: QueryFunctionContext,\n query: Query,\n ) => T | Promise\n\nexport type QueryFunctionContext<\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = never,\n> = [TPageParam] extends [never]\n ? {\n client: QueryClient\n queryKey: TQueryKey\n signal: AbortSignal\n meta: QueryMeta | undefined\n pageParam?: unknown\n /**\n * @deprecated\n * if you want access to the direction, you can add it to the pageParam\n */\n direction?: unknown\n }\n : {\n client: QueryClient\n queryKey: TQueryKey\n signal: AbortSignal\n pageParam: TPageParam\n /**\n * @deprecated\n * if you want access to the direction, you can add it to the pageParam\n */\n direction: FetchDirection\n meta: QueryMeta | undefined\n }\n\nexport type InitialDataFunction = () => T | undefined\n\ntype NonFunctionGuard = T extends Function ? never : T\n\nexport type PlaceholderDataFunction<\n TQueryFnData = unknown,\n TError = DefaultError,\n TQueryData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> = (\n previousData: TQueryData | undefined,\n previousQuery: Query | undefined,\n) => TQueryData | undefined\n\nexport type QueriesPlaceholderDataFunction = (\n previousData: undefined,\n previousQuery: undefined,\n) => TQueryData | undefined\n\nexport type QueryKeyHashFunction = (\n queryKey: TQueryKey,\n) => string\n\nexport type GetPreviousPageParamFunction = (\n firstPage: TQueryFnData,\n allPages: Array,\n firstPageParam: TPageParam,\n allPageParams: Array,\n) => TPageParam | undefined | null\n\nexport type GetNextPageParamFunction = (\n lastPage: TQueryFnData,\n allPages: Array,\n lastPageParam: TPageParam,\n allPageParams: Array,\n) => TPageParam | undefined | null\n\nexport interface InfiniteData {\n pages: Array\n pageParams: Array\n}\n\nexport type QueryMeta = Register extends {\n queryMeta: infer TQueryMeta\n}\n ? TQueryMeta extends Record\n ? TQueryMeta\n : Record\n : Record\n\nexport type NetworkMode = 'online' | 'always' | 'offlineFirst'\n\nexport type NotifyOnChangeProps =\n | Array\n | 'all'\n | undefined\n | (() => Array | 'all' | undefined)\n\nexport interface QueryOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = never,\n> {\n /**\n * If `false`, failed queries will not retry by default.\n * If `true`, failed queries will retry infinitely., failureCount: num\n * If set to an integer number, e.g. 3, failed queries will retry until the failed query count meets that number.\n * If set to a function `(failureCount, error) => boolean` failed queries will retry until the function returns false.\n */\n retry?: RetryValue\n retryDelay?: RetryDelayValue\n networkMode?: NetworkMode\n /**\n * The time in milliseconds that unused/inactive cache data remains in memory.\n * When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration.\n * When different garbage collection times are specified, the longest one will be used.\n * Setting it to `Infinity` will disable garbage collection.\n */\n gcTime?: number\n queryFn?: QueryFunction | SkipToken\n persister?: QueryPersister<\n NoInfer,\n NoInfer,\n NoInfer\n >\n queryHash?: string\n queryKey?: TQueryKey\n queryKeyHashFn?: QueryKeyHashFunction\n initialData?: TData | InitialDataFunction\n initialDataUpdatedAt?: number | (() => number | undefined)\n behavior?: QueryBehavior\n /**\n * Set this to `false` to disable structural sharing between query results.\n * Set this to a function which accepts the old and new data and returns resolved data of the same type to implement custom structural sharing logic.\n * Defaults to `true`.\n */\n structuralSharing?:\n | boolean\n | ((oldData: unknown | undefined, newData: unknown) => unknown)\n _defaulted?: boolean\n /**\n * Additional payload to be stored on each query.\n * Use this property to pass information that can be used in other places.\n */\n meta?: QueryMeta\n /**\n * Maximum number of pages to store in the data of an infinite query.\n */\n maxPages?: number\n}\n\nexport interface InitialPageParam {\n initialPageParam: TPageParam\n}\n\nexport interface InfiniteQueryPageParamsOptions<\n TQueryFnData = unknown,\n TPageParam = unknown,\n> extends InitialPageParam {\n /**\n * This function can be set to automatically get the previous cursor for infinite queries.\n * The result will also be used to determine the value of `hasPreviousPage`.\n */\n getPreviousPageParam?: GetPreviousPageParamFunction\n /**\n * This function can be set to automatically get the next cursor for infinite queries.\n * The result will also be used to determine the value of `hasNextPage`.\n */\n getNextPageParam: GetNextPageParamFunction\n}\n\nexport type ThrowOnError<\n TQueryFnData,\n TError,\n TQueryData,\n TQueryKey extends QueryKey,\n> =\n | boolean\n | ((\n error: TError,\n query: Query,\n ) => boolean)\n\nexport interface QueryObserverOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = never,\n> extends WithRequired<\n QueryOptions,\n 'queryKey'\n> {\n /**\n * Set this to `false` or a function that returns `false` to disable automatic refetching when the query mounts or changes query keys.\n * To refetch the query, use the `refetch` method returned from the `useQuery` instance.\n * Accepts a boolean or function that returns a boolean.\n * Defaults to `true`.\n */\n enabled?: Enabled\n /**\n * The time in milliseconds after data is considered stale.\n * If set to `Infinity`, the data will never be considered stale.\n * If set to a function, the function will be executed with the query to compute a `staleTime`.\n * Defaults to `0`.\n */\n staleTime?: StaleTimeFunction\n /**\n * If set to a number, the query will continuously refetch at this frequency in milliseconds.\n * If set to a function, the function will be executed with the latest data and query to compute a frequency\n * Defaults to `false`.\n */\n refetchInterval?:\n | number\n | false\n | ((\n query: Query,\n ) => number | false | undefined)\n /**\n * If set to `true`, the query will continue to refetch while their tab/window is in the background.\n * Defaults to `false`.\n */\n refetchIntervalInBackground?: boolean\n /**\n * If set to `true`, the query will refetch on window focus if the data is stale.\n * If set to `false`, the query will not refetch on window focus.\n * If set to `'always'`, the query will always refetch on window focus.\n * If set to a function, the function will be executed with the latest data and query to compute the value.\n * Defaults to `true`.\n */\n refetchOnWindowFocus?:\n | boolean\n | 'always'\n | ((\n query: Query,\n ) => boolean | 'always')\n /**\n * If set to `true`, the query will refetch on reconnect if the data is stale.\n * If set to `false`, the query will not refetch on reconnect.\n * If set to `'always'`, the query will always refetch on reconnect.\n * If set to a function, the function will be executed with the latest data and query to compute the value.\n * Defaults to the value of `networkOnline` (`true`)\n */\n refetchOnReconnect?:\n | boolean\n | 'always'\n | ((\n query: Query,\n ) => boolean | 'always')\n /**\n * If set to `true`, the query will refetch on mount if the data is stale.\n * If set to `false`, will disable additional instances of a query to trigger background refetch.\n * If set to `'always'`, the query will always refetch on mount.\n * If set to a function, the function will be executed with the latest data and query to compute the value\n * Defaults to `true`.\n */\n refetchOnMount?:\n | boolean\n | 'always'\n | ((\n query: Query,\n ) => boolean | 'always')\n /**\n * If set to `false`, the query will not be retried on mount if it contains an error.\n * Defaults to `true`.\n */\n retryOnMount?: boolean\n /**\n * If set, the component will only re-render if any of the listed properties change.\n * When set to `['data', 'error']`, the component will only re-render when the `data` or `error` properties change.\n * When set to `'all'`, the component will re-render whenever a query is updated.\n * When set to a function, the function will be executed to compute the list of properties.\n * By default, access to properties will be tracked, and the component will only re-render when one of the tracked properties change.\n */\n notifyOnChangeProps?: NotifyOnChangeProps\n /**\n * Whether errors should be thrown instead of setting the `error` property.\n * If set to `true` or `suspense` is `true`, all errors will be thrown to the error boundary.\n * If set to `false` and `suspense` is `false`, errors are returned as state.\n * If set to a function, it will be passed the error and the query, and it should return a boolean indicating whether to show the error in an error boundary (`true`) or return the error as state (`false`).\n * Defaults to `false`.\n */\n throwOnError?: ThrowOnError\n /**\n * This option can be used to transform or select a part of the data returned by the query function.\n */\n select?: (data: TQueryData) => TData\n /**\n * If set to `true`, the query will suspend when `status === 'pending'`\n * and throw errors when `status === 'error'`.\n * Defaults to `false`.\n */\n suspense?: boolean\n /**\n * If set, this value will be used as the placeholder data for this particular query observer while the query is still in the `loading` data and no initialData has been provided.\n */\n placeholderData?:\n | NonFunctionGuard\n | PlaceholderDataFunction<\n NonFunctionGuard,\n TError,\n NonFunctionGuard,\n TQueryKey\n >\n\n _optimisticResults?: 'optimistic' | 'isRestoring'\n\n /**\n * Enable prefetching during rendering\n */\n experimental_prefetchInRender?: boolean\n}\n\nexport type WithRequired = TTarget & {\n [_ in TKey]: {}\n}\n\nexport type DefaultedQueryObserverOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> = WithRequired<\n QueryObserverOptions,\n 'throwOnError' | 'refetchOnReconnect' | 'queryHash'\n>\n\nexport interface InfiniteQueryObserverOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n>\n extends\n QueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n InfiniteData,\n TQueryKey,\n TPageParam\n >,\n InfiniteQueryPageParamsOptions {}\n\nexport type DefaultedInfiniteQueryObserverOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n> = WithRequired<\n InfiniteQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n 'throwOnError' | 'refetchOnReconnect' | 'queryHash'\n>\n\nexport interface FetchQueryOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = never,\n> extends WithRequired<\n QueryOptions,\n 'queryKey'\n> {\n initialPageParam?: never\n /**\n * The time in milliseconds after data is considered stale.\n * If the data is fresh it will be returned from the cache.\n */\n staleTime?: StaleTimeFunction\n}\n\nexport interface EnsureQueryDataOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = never,\n> extends FetchQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n> {\n revalidateIfStale?: boolean\n}\n\nexport type EnsureInfiniteQueryDataOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n> = FetchInfiniteQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n> & {\n revalidateIfStale?: boolean\n}\n\ntype FetchInfiniteQueryPages =\n | { pages?: never }\n | {\n pages: number\n getNextPageParam: GetNextPageParamFunction\n }\n\nexport type FetchInfiniteQueryOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n> = Omit<\n FetchQueryOptions<\n TQueryFnData,\n TError,\n InfiniteData,\n TQueryKey,\n TPageParam\n >,\n 'initialPageParam'\n> &\n InitialPageParam &\n FetchInfiniteQueryPages\n\nexport interface ResultOptions {\n throwOnError?: boolean\n}\n\nexport interface RefetchOptions extends ResultOptions {\n /**\n * If set to `true`, a currently running request will be cancelled before a new request is made\n *\n * If set to `false`, no refetch will be made if there is already a request running.\n *\n * Defaults to `true`.\n */\n cancelRefetch?: boolean\n}\n\nexport interface InvalidateQueryFilters<\n TQueryKey extends QueryKey = QueryKey,\n> extends QueryFilters {\n refetchType?: QueryTypeFilter | 'none'\n}\n\nexport interface RefetchQueryFilters<\n TQueryKey extends QueryKey = QueryKey,\n> extends QueryFilters {}\n\nexport interface InvalidateOptions extends RefetchOptions {}\nexport interface ResetOptions extends RefetchOptions {}\n\nexport interface FetchNextPageOptions extends ResultOptions {\n /**\n * If set to `true`, calling `fetchNextPage` repeatedly will invoke `queryFn` every time,\n * whether the previous invocation has resolved or not. Also, the result from previous invocations will be ignored.\n *\n * If set to `false`, calling `fetchNextPage` repeatedly won't have any effect until the first invocation has resolved.\n *\n * Defaults to `true`.\n */\n cancelRefetch?: boolean\n}\n\nexport interface FetchPreviousPageOptions extends ResultOptions {\n /**\n * If set to `true`, calling `fetchPreviousPage` repeatedly will invoke `queryFn` every time,\n * whether the previous invocation has resolved or not. Also, the result from previous invocations will be ignored.\n *\n * If set to `false`, calling `fetchPreviousPage` repeatedly won't have any effect until the first invocation has resolved.\n *\n * Defaults to `true`.\n */\n cancelRefetch?: boolean\n}\n\nexport type QueryStatus = 'pending' | 'error' | 'success'\nexport type FetchStatus = 'fetching' | 'paused' | 'idle'\n\nexport interface QueryObserverBaseResult<\n TData = unknown,\n TError = DefaultError,\n> {\n /**\n * The last successfully resolved data for the query.\n */\n data: TData | undefined\n /**\n * The timestamp for when the query most recently returned the `status` as `\"success\"`.\n */\n dataUpdatedAt: number\n /**\n * The error object for the query, if an error was thrown.\n * - Defaults to `null`.\n */\n error: TError | null\n /**\n * The timestamp for when the query most recently returned the `status` as `\"error\"`.\n */\n errorUpdatedAt: number\n /**\n * The failure count for the query.\n * - Incremented every time the query fails.\n * - Reset to `0` when the query succeeds.\n */\n failureCount: number\n /**\n * The failure reason for the query retry.\n * - Reset to `null` when the query succeeds.\n */\n failureReason: TError | null\n /**\n * The sum of all errors.\n */\n errorUpdateCount: number\n /**\n * A derived boolean from the `status` variable, provided for convenience.\n * - `true` if the query attempt resulted in an error.\n */\n isError: boolean\n /**\n * Will be `true` if the query has been fetched.\n */\n isFetched: boolean\n /**\n * Will be `true` if the query has been fetched after the component mounted.\n * - This property can be used to not show any previously cached data.\n */\n isFetchedAfterMount: boolean\n /**\n * A derived boolean from the `fetchStatus` variable, provided for convenience.\n * - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch.\n */\n isFetching: boolean\n /**\n * Is `true` whenever the first fetch for a query is in-flight.\n * - Is the same as `isFetching && isPending`.\n */\n isLoading: boolean\n /**\n * Will be `pending` if there's no cached data and no query attempt was finished yet.\n */\n isPending: boolean\n /**\n * Will be `true` if the query failed while fetching for the first time.\n */\n isLoadingError: boolean\n /**\n * @deprecated `isInitialLoading` is being deprecated in favor of `isLoading`\n * and will be removed in the next major version.\n */\n isInitialLoading: boolean\n /**\n * A derived boolean from the `fetchStatus` variable, provided for convenience.\n * - The query wanted to fetch, but has been `paused`.\n */\n isPaused: boolean\n /**\n * Will be `true` if the data shown is the placeholder data.\n */\n isPlaceholderData: boolean\n /**\n * Will be `true` if the query failed while refetching.\n */\n isRefetchError: boolean\n /**\n * Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`.\n * - Is the same as `isFetching && !isPending`.\n */\n isRefetching: boolean\n /**\n * Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`.\n */\n isStale: boolean\n /**\n * A derived boolean from the `status` variable, provided for convenience.\n * - `true` if the query has received a response with no errors and is ready to display its data.\n */\n isSuccess: boolean\n /**\n * `true` if this observer is enabled, `false` otherwise.\n */\n isEnabled: boolean\n /**\n * A function to manually refetch the query.\n */\n refetch: (\n options?: RefetchOptions,\n ) => Promise>\n /**\n * The status of the query.\n * - Will be:\n * - `pending` if there's no cached data and no query attempt was finished yet.\n * - `error` if the query attempt resulted in an error.\n * - `success` if the query has received a response with no errors and is ready to display its data.\n */\n status: QueryStatus\n /**\n * The fetch status of the query.\n * - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch.\n * - `paused`: The query wanted to fetch, but has been `paused`.\n * - `idle`: The query is not fetching.\n * - See [Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information.\n */\n fetchStatus: FetchStatus\n /**\n * A stable promise that will be resolved with the data of the query.\n * Requires the `experimental_prefetchInRender` feature flag to be enabled.\n * @example\n *\n * ### Enabling the feature flag\n * ```ts\n * const client = new QueryClient({\n * defaultOptions: {\n * queries: {\n * experimental_prefetchInRender: true,\n * },\n * },\n * })\n * ```\n *\n * ### Usage\n * ```tsx\n * import { useQuery } from '@tanstack/react-query'\n * import React from 'react'\n * import { fetchTodos, type Todo } from './api'\n *\n * function TodoList({ query }: { query: UseQueryResult }) {\n * const data = React.use(query.promise)\n *\n * return (\n *
    \n * {data.map(todo => (\n *
  • {todo.title}
  • \n * ))}\n *
\n * )\n * }\n *\n * export function App() {\n * const query = useQuery({ queryKey: ['todos'], queryFn: fetchTodos })\n *\n * return (\n * <>\n *

Todos

\n * Loading...}>\n * \n * \n * \n * )\n * }\n * ```\n */\n promise: Promise\n}\n\nexport interface QueryObserverPendingResult<\n TData = unknown,\n TError = DefaultError,\n> extends QueryObserverBaseResult {\n data: undefined\n error: null\n isError: false\n isPending: true\n isLoadingError: false\n isRefetchError: false\n isSuccess: false\n isPlaceholderData: false\n status: 'pending'\n}\n\nexport interface QueryObserverLoadingResult<\n TData = unknown,\n TError = DefaultError,\n> extends QueryObserverBaseResult {\n data: undefined\n error: null\n isError: false\n isPending: true\n isLoading: true\n isLoadingError: false\n isRefetchError: false\n isSuccess: false\n isPlaceholderData: false\n status: 'pending'\n}\n\nexport interface QueryObserverLoadingErrorResult<\n TData = unknown,\n TError = DefaultError,\n> extends QueryObserverBaseResult {\n data: undefined\n error: TError\n isError: true\n isPending: false\n isLoading: false\n isLoadingError: true\n isRefetchError: false\n isSuccess: false\n isPlaceholderData: false\n status: 'error'\n}\n\nexport interface QueryObserverRefetchErrorResult<\n TData = unknown,\n TError = DefaultError,\n> extends QueryObserverBaseResult {\n data: TData\n error: TError\n isError: true\n isPending: false\n isLoading: false\n isLoadingError: false\n isRefetchError: true\n isSuccess: false\n isPlaceholderData: false\n status: 'error'\n}\n\nexport interface QueryObserverSuccessResult<\n TData = unknown,\n TError = DefaultError,\n> extends QueryObserverBaseResult {\n data: TData\n error: null\n isError: false\n isPending: false\n isLoading: false\n isLoadingError: false\n isRefetchError: false\n isSuccess: true\n isPlaceholderData: false\n status: 'success'\n}\n\nexport interface QueryObserverPlaceholderResult<\n TData = unknown,\n TError = DefaultError,\n> extends QueryObserverBaseResult {\n data: TData\n isError: false\n error: null\n isPending: false\n isLoading: false\n isLoadingError: false\n isRefetchError: false\n isSuccess: true\n isPlaceholderData: true\n status: 'success'\n}\n\nexport type DefinedQueryObserverResult<\n TData = unknown,\n TError = DefaultError,\n> =\n | QueryObserverRefetchErrorResult\n | QueryObserverSuccessResult\n\nexport type QueryObserverResult =\n | DefinedQueryObserverResult\n | QueryObserverLoadingErrorResult\n | QueryObserverLoadingResult\n | QueryObserverPendingResult\n | QueryObserverPlaceholderResult\n\nexport interface InfiniteQueryObserverBaseResult<\n TData = unknown,\n TError = DefaultError,\n> extends QueryObserverBaseResult {\n /**\n * This function allows you to fetch the next \"page\" of results.\n */\n fetchNextPage: (\n options?: FetchNextPageOptions,\n ) => Promise>\n /**\n * This function allows you to fetch the previous \"page\" of results.\n */\n fetchPreviousPage: (\n options?: FetchPreviousPageOptions,\n ) => Promise>\n /**\n * Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option).\n */\n hasNextPage: boolean\n /**\n * Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option).\n */\n hasPreviousPage: boolean\n /**\n * Will be `true` if the query failed while fetching the next page.\n */\n isFetchNextPageError: boolean\n /**\n * Will be `true` while fetching the next page with `fetchNextPage`.\n */\n isFetchingNextPage: boolean\n /**\n * Will be `true` if the query failed while fetching the previous page.\n */\n isFetchPreviousPageError: boolean\n /**\n * Will be `true` while fetching the previous page with `fetchPreviousPage`.\n */\n isFetchingPreviousPage: boolean\n}\n\nexport interface InfiniteQueryObserverPendingResult<\n TData = unknown,\n TError = DefaultError,\n> extends InfiniteQueryObserverBaseResult {\n data: undefined\n error: null\n isError: false\n isPending: true\n isLoadingError: false\n isRefetchError: false\n isFetchNextPageError: false\n isFetchPreviousPageError: false\n isSuccess: false\n isPlaceholderData: false\n status: 'pending'\n}\n\nexport interface InfiniteQueryObserverLoadingResult<\n TData = unknown,\n TError = DefaultError,\n> extends InfiniteQueryObserverBaseResult {\n data: undefined\n error: null\n isError: false\n isPending: true\n isLoading: true\n isLoadingError: false\n isRefetchError: false\n isFetchNextPageError: false\n isFetchPreviousPageError: false\n isSuccess: false\n isPlaceholderData: false\n status: 'pending'\n}\n\nexport interface InfiniteQueryObserverLoadingErrorResult<\n TData = unknown,\n TError = DefaultError,\n> extends InfiniteQueryObserverBaseResult {\n data: undefined\n error: TError\n isError: true\n isPending: false\n isLoading: false\n isLoadingError: true\n isRefetchError: false\n isFetchNextPageError: false\n isFetchPreviousPageError: false\n isSuccess: false\n isPlaceholderData: false\n status: 'error'\n}\n\nexport interface InfiniteQueryObserverRefetchErrorResult<\n TData = unknown,\n TError = DefaultError,\n> extends InfiniteQueryObserverBaseResult {\n data: TData\n error: TError\n isError: true\n isPending: false\n isLoading: false\n isLoadingError: false\n isRefetchError: true\n isSuccess: false\n isPlaceholderData: false\n status: 'error'\n}\n\nexport interface InfiniteQueryObserverSuccessResult<\n TData = unknown,\n TError = DefaultError,\n> extends InfiniteQueryObserverBaseResult {\n data: TData\n error: null\n isError: false\n isPending: false\n isLoading: false\n isLoadingError: false\n isRefetchError: false\n isFetchNextPageError: false\n isFetchPreviousPageError: false\n isSuccess: true\n isPlaceholderData: false\n status: 'success'\n}\n\nexport interface InfiniteQueryObserverPlaceholderResult<\n TData = unknown,\n TError = DefaultError,\n> extends InfiniteQueryObserverBaseResult {\n data: TData\n isError: false\n error: null\n isPending: false\n isLoading: false\n isLoadingError: false\n isRefetchError: false\n isSuccess: true\n isPlaceholderData: true\n isFetchNextPageError: false\n isFetchPreviousPageError: false\n status: 'success'\n}\n\nexport type DefinedInfiniteQueryObserverResult<\n TData = unknown,\n TError = DefaultError,\n> =\n | InfiniteQueryObserverRefetchErrorResult\n | InfiniteQueryObserverSuccessResult\n\nexport type InfiniteQueryObserverResult<\n TData = unknown,\n TError = DefaultError,\n> =\n | DefinedInfiniteQueryObserverResult\n | InfiniteQueryObserverLoadingErrorResult\n | InfiniteQueryObserverLoadingResult\n | InfiniteQueryObserverPendingResult\n | InfiniteQueryObserverPlaceholderResult\n\nexport type MutationKey = Register extends {\n mutationKey: infer TMutationKey\n}\n ? TMutationKey extends ReadonlyArray\n ? TMutationKey\n : TMutationKey extends Array\n ? TMutationKey\n : ReadonlyArray\n : ReadonlyArray\n\nexport type MutationStatus = 'idle' | 'pending' | 'success' | 'error'\n\nexport type MutationScope = {\n id: string\n}\n\nexport type MutationMeta = Register extends {\n mutationMeta: infer TMutationMeta\n}\n ? TMutationMeta extends Record\n ? TMutationMeta\n : Record\n : Record\n\nexport type MutationFunctionContext = {\n client: QueryClient\n meta: MutationMeta | undefined\n mutationKey?: MutationKey\n}\n\nexport type MutationFunction = (\n variables: TVariables,\n context: MutationFunctionContext,\n) => Promise\n\nexport interface MutationOptions<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n> {\n mutationFn?: MutationFunction\n mutationKey?: MutationKey\n onMutate?: (\n variables: TVariables,\n context: MutationFunctionContext,\n ) => Promise | TOnMutateResult\n onSuccess?: (\n data: TData,\n variables: TVariables,\n onMutateResult: TOnMutateResult,\n context: MutationFunctionContext,\n ) => Promise | unknown\n onError?: (\n error: TError,\n variables: TVariables,\n onMutateResult: TOnMutateResult | undefined,\n context: MutationFunctionContext,\n ) => Promise | unknown\n onSettled?: (\n data: TData | undefined,\n error: TError | null,\n variables: TVariables,\n onMutateResult: TOnMutateResult | undefined,\n context: MutationFunctionContext,\n ) => Promise | unknown\n retry?: RetryValue\n retryDelay?: RetryDelayValue\n networkMode?: NetworkMode\n gcTime?: number\n _defaulted?: boolean\n meta?: MutationMeta\n scope?: MutationScope\n}\n\nexport interface MutationObserverOptions<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n> extends MutationOptions {\n throwOnError?: boolean | ((error: TError) => boolean)\n}\n\nexport interface MutateOptions<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n> {\n onSuccess?: (\n data: TData,\n variables: TVariables,\n onMutateResult: TOnMutateResult | undefined,\n context: MutationFunctionContext,\n ) => void\n onError?: (\n error: TError,\n variables: TVariables,\n onMutateResult: TOnMutateResult | undefined,\n context: MutationFunctionContext,\n ) => void\n onSettled?: (\n data: TData | undefined,\n error: TError | null,\n variables: TVariables,\n onMutateResult: TOnMutateResult | undefined,\n context: MutationFunctionContext,\n ) => void\n}\n\nexport type MutateFunction<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n> = (\n variables: TVariables,\n options?: MutateOptions,\n) => Promise\n\nexport interface MutationObserverBaseResult<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n> extends MutationState {\n /**\n * The last successfully resolved data for the mutation.\n */\n data: TData | undefined\n /**\n * The variables object passed to the `mutationFn`.\n */\n variables: TVariables | undefined\n /**\n * The error object for the mutation, if an error was encountered.\n * - Defaults to `null`.\n */\n error: TError | null\n /**\n * A boolean variable derived from `status`.\n * - `true` if the last mutation attempt resulted in an error.\n */\n isError: boolean\n /**\n * A boolean variable derived from `status`.\n * - `true` if the mutation is in its initial state prior to executing.\n */\n isIdle: boolean\n /**\n * A boolean variable derived from `status`.\n * - `true` if the mutation is currently executing.\n */\n isPending: boolean\n /**\n * A boolean variable derived from `status`.\n * - `true` if the last mutation attempt was successful.\n */\n isSuccess: boolean\n /**\n * The status of the mutation.\n * - Will be:\n * - `idle` initial status prior to the mutation function executing.\n * - `pending` if the mutation is currently executing.\n * - `error` if the last mutation attempt resulted in an error.\n * - `success` if the last mutation attempt was successful.\n */\n status: MutationStatus\n /**\n * The mutation function you can call with variables to trigger the mutation and optionally hooks on additional callback options.\n * @param variables - The variables object to pass to the `mutationFn`.\n * @param options.onSuccess - This function will fire when the mutation is successful and will be passed the mutation's result.\n * @param options.onError - This function will fire if the mutation encounters an error and will be passed the error.\n * @param options.onSettled - This function will fire when the mutation is either successfully fetched or encounters an error and be passed either the data or error.\n * @remarks\n * - If you make multiple requests, `onSuccess` will fire only after the latest call you've made.\n * - All the callback functions (`onSuccess`, `onError`, `onSettled`) are void functions, and the returned value will be ignored.\n */\n mutate: MutateFunction\n /**\n * A function to clean the mutation internal state (i.e., it resets the mutation to its initial state).\n */\n reset: () => void\n}\n\nexport interface MutationObserverIdleResult<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n> extends MutationObserverBaseResult<\n TData,\n TError,\n TVariables,\n TOnMutateResult\n> {\n data: undefined\n variables: undefined\n error: null\n isError: false\n isIdle: true\n isPending: false\n isSuccess: false\n status: 'idle'\n}\n\nexport interface MutationObserverLoadingResult<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n> extends MutationObserverBaseResult<\n TData,\n TError,\n TVariables,\n TOnMutateResult\n> {\n data: undefined\n variables: TVariables\n error: null\n isError: false\n isIdle: false\n isPending: true\n isSuccess: false\n status: 'pending'\n}\n\nexport interface MutationObserverErrorResult<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n> extends MutationObserverBaseResult<\n TData,\n TError,\n TVariables,\n TOnMutateResult\n> {\n data: undefined\n error: TError\n variables: TVariables\n isError: true\n isIdle: false\n isPending: false\n isSuccess: false\n status: 'error'\n}\n\nexport interface MutationObserverSuccessResult<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n> extends MutationObserverBaseResult<\n TData,\n TError,\n TVariables,\n TOnMutateResult\n> {\n data: TData\n error: null\n variables: TVariables\n isError: false\n isIdle: false\n isPending: false\n isSuccess: true\n status: 'success'\n}\n\nexport type MutationObserverResult<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n> =\n | MutationObserverIdleResult\n | MutationObserverLoadingResult\n | MutationObserverErrorResult\n | MutationObserverSuccessResult\n\nexport interface QueryClientConfig {\n queryCache?: QueryCache\n mutationCache?: MutationCache\n defaultOptions?: DefaultOptions\n}\n\nexport interface DefaultOptions {\n queries?: OmitKeyof<\n QueryObserverOptions,\n 'suspense' | 'queryKey'\n >\n mutations?: MutationObserverOptions\n hydrate?: HydrateOptions['defaultOptions']\n dehydrate?: DehydrateOptions\n}\n\nexport interface CancelOptions {\n revert?: boolean\n silent?: boolean\n}\n\nexport interface SetDataOptions {\n updatedAt?: number\n}\n\nexport type NotifyEventType =\n | 'added'\n | 'removed'\n | 'updated'\n | 'observerAdded'\n | 'observerRemoved'\n | 'observerResultsUpdated'\n | 'observerOptionsUpdated'\n\nexport interface NotifyEvent {\n type: NotifyEventType\n}\n"],"mappings":";;;AA8DO,IAAM,gBAAgB,uBAAO,eAAe;AAE5C,IAAM,qBAAqB,uBAAO,oBAAoB;AAEtD,IAAM,cAAc,uBAAO,aAAa;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/utils.cjs b/node_modules/@tanstack/query-core/build/legacy/utils.cjs deleted file mode 100644 index 70b2c69..0000000 --- a/node_modules/@tanstack/query-core/build/legacy/utils.cjs +++ /dev/null @@ -1,330 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// src/utils.ts -var utils_exports = {}; -__export(utils_exports, { - addConsumeAwareSignal: () => addConsumeAwareSignal, - addToEnd: () => addToEnd, - addToStart: () => addToStart, - ensureQueryFn: () => ensureQueryFn, - functionalUpdate: () => functionalUpdate, - hashKey: () => hashKey, - hashQueryKeyByOptions: () => hashQueryKeyByOptions, - isPlainArray: () => isPlainArray, - isPlainObject: () => isPlainObject, - isServer: () => isServer, - isValidTimeout: () => isValidTimeout, - keepPreviousData: () => keepPreviousData, - matchMutation: () => matchMutation, - matchQuery: () => matchQuery, - noop: () => noop, - partialMatchKey: () => partialMatchKey, - replaceData: () => replaceData, - replaceEqualDeep: () => replaceEqualDeep, - resolveEnabled: () => resolveEnabled, - resolveStaleTime: () => resolveStaleTime, - shallowEqualObjects: () => shallowEqualObjects, - shouldThrowError: () => shouldThrowError, - skipToken: () => skipToken, - sleep: () => sleep, - timeUntilStale: () => timeUntilStale -}); -module.exports = __toCommonJS(utils_exports); -var import_timeoutManager = require("./timeoutManager.cjs"); -var isServer = typeof window === "undefined" || "Deno" in globalThis; -function noop() { -} -function functionalUpdate(updater, input) { - return typeof updater === "function" ? updater(input) : updater; -} -function isValidTimeout(value) { - return typeof value === "number" && value >= 0 && value !== Infinity; -} -function timeUntilStale(updatedAt, staleTime) { - return Math.max(updatedAt + (staleTime || 0) - Date.now(), 0); -} -function resolveStaleTime(staleTime, query) { - return typeof staleTime === "function" ? staleTime(query) : staleTime; -} -function resolveEnabled(enabled, query) { - return typeof enabled === "function" ? enabled(query) : enabled; -} -function matchQuery(filters, query) { - const { - type = "all", - exact, - fetchStatus, - predicate, - queryKey, - stale - } = filters; - if (queryKey) { - if (exact) { - if (query.queryHash !== hashQueryKeyByOptions(queryKey, query.options)) { - return false; - } - } else if (!partialMatchKey(query.queryKey, queryKey)) { - return false; - } - } - if (type !== "all") { - const isActive = query.isActive(); - if (type === "active" && !isActive) { - return false; - } - if (type === "inactive" && isActive) { - return false; - } - } - if (typeof stale === "boolean" && query.isStale() !== stale) { - return false; - } - if (fetchStatus && fetchStatus !== query.state.fetchStatus) { - return false; - } - if (predicate && !predicate(query)) { - return false; - } - return true; -} -function matchMutation(filters, mutation) { - const { exact, status, predicate, mutationKey } = filters; - if (mutationKey) { - if (!mutation.options.mutationKey) { - return false; - } - if (exact) { - if (hashKey(mutation.options.mutationKey) !== hashKey(mutationKey)) { - return false; - } - } else if (!partialMatchKey(mutation.options.mutationKey, mutationKey)) { - return false; - } - } - if (status && mutation.state.status !== status) { - return false; - } - if (predicate && !predicate(mutation)) { - return false; - } - return true; -} -function hashQueryKeyByOptions(queryKey, options) { - const hashFn = (options == null ? void 0 : options.queryKeyHashFn) || hashKey; - return hashFn(queryKey); -} -function hashKey(queryKey) { - return JSON.stringify( - queryKey, - (_, val) => isPlainObject(val) ? Object.keys(val).sort().reduce((result, key) => { - result[key] = val[key]; - return result; - }, {}) : val - ); -} -function partialMatchKey(a, b) { - if (a === b) { - return true; - } - if (typeof a !== typeof b) { - return false; - } - if (a && b && typeof a === "object" && typeof b === "object") { - return Object.keys(b).every((key) => partialMatchKey(a[key], b[key])); - } - return false; -} -var hasOwn = Object.prototype.hasOwnProperty; -function replaceEqualDeep(a, b, depth = 0) { - if (a === b) { - return a; - } - if (depth > 500) return b; - const array = isPlainArray(a) && isPlainArray(b); - if (!array && !(isPlainObject(a) && isPlainObject(b))) return b; - const aItems = array ? a : Object.keys(a); - const aSize = aItems.length; - const bItems = array ? b : Object.keys(b); - const bSize = bItems.length; - const copy = array ? new Array(bSize) : {}; - let equalItems = 0; - for (let i = 0; i < bSize; i++) { - const key = array ? i : bItems[i]; - const aItem = a[key]; - const bItem = b[key]; - if (aItem === bItem) { - copy[key] = aItem; - if (array ? i < aSize : hasOwn.call(a, key)) equalItems++; - continue; - } - if (aItem === null || bItem === null || typeof aItem !== "object" || typeof bItem !== "object") { - copy[key] = bItem; - continue; - } - const v = replaceEqualDeep(aItem, bItem, depth + 1); - copy[key] = v; - if (v === aItem) equalItems++; - } - return aSize === bSize && equalItems === aSize ? a : copy; -} -function shallowEqualObjects(a, b) { - if (!b || Object.keys(a).length !== Object.keys(b).length) { - return false; - } - for (const key in a) { - if (a[key] !== b[key]) { - return false; - } - } - return true; -} -function isPlainArray(value) { - return Array.isArray(value) && value.length === Object.keys(value).length; -} -function isPlainObject(o) { - if (!hasObjectPrototype(o)) { - return false; - } - const ctor = o.constructor; - if (ctor === void 0) { - return true; - } - const prot = ctor.prototype; - if (!hasObjectPrototype(prot)) { - return false; - } - if (!prot.hasOwnProperty("isPrototypeOf")) { - return false; - } - if (Object.getPrototypeOf(o) !== Object.prototype) { - return false; - } - return true; -} -function hasObjectPrototype(o) { - return Object.prototype.toString.call(o) === "[object Object]"; -} -function sleep(timeout) { - return new Promise((resolve) => { - import_timeoutManager.timeoutManager.setTimeout(resolve, timeout); - }); -} -function replaceData(prevData, data, options) { - if (typeof options.structuralSharing === "function") { - return options.structuralSharing(prevData, data); - } else if (options.structuralSharing !== false) { - if (process.env.NODE_ENV !== "production") { - try { - return replaceEqualDeep(prevData, data); - } catch (error) { - console.error( - `Structural sharing requires data to be JSON serializable. To fix this, turn off structuralSharing or return JSON-serializable data from your queryFn. [${options.queryHash}]: ${error}` - ); - throw error; - } - } - return replaceEqualDeep(prevData, data); - } - return data; -} -function keepPreviousData(previousData) { - return previousData; -} -function addToEnd(items, item, max = 0) { - const newItems = [...items, item]; - return max && newItems.length > max ? newItems.slice(1) : newItems; -} -function addToStart(items, item, max = 0) { - const newItems = [item, ...items]; - return max && newItems.length > max ? newItems.slice(0, -1) : newItems; -} -var skipToken = /* @__PURE__ */ Symbol(); -function ensureQueryFn(options, fetchOptions) { - if (process.env.NODE_ENV !== "production") { - if (options.queryFn === skipToken) { - console.error( - `Attempted to invoke queryFn when set to skipToken. This is likely a configuration error. Query hash: '${options.queryHash}'` - ); - } - } - if (!options.queryFn && (fetchOptions == null ? void 0 : fetchOptions.initialPromise)) { - return () => fetchOptions.initialPromise; - } - if (!options.queryFn || options.queryFn === skipToken) { - return () => Promise.reject(new Error(`Missing queryFn: '${options.queryHash}'`)); - } - return options.queryFn; -} -function shouldThrowError(throwOnError, params) { - if (typeof throwOnError === "function") { - return throwOnError(...params); - } - return !!throwOnError; -} -function addConsumeAwareSignal(object, getSignal, onCancelled) { - let consumed = false; - let signal; - Object.defineProperty(object, "signal", { - enumerable: true, - get: () => { - signal ?? (signal = getSignal()); - if (consumed) { - return signal; - } - consumed = true; - if (signal.aborted) { - onCancelled(); - } else { - signal.addEventListener("abort", onCancelled, { once: true }); - } - return signal; - } - }); - return object; -} -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - addConsumeAwareSignal, - addToEnd, - addToStart, - ensureQueryFn, - functionalUpdate, - hashKey, - hashQueryKeyByOptions, - isPlainArray, - isPlainObject, - isServer, - isValidTimeout, - keepPreviousData, - matchMutation, - matchQuery, - noop, - partialMatchKey, - replaceData, - replaceEqualDeep, - resolveEnabled, - resolveStaleTime, - shallowEqualObjects, - shouldThrowError, - skipToken, - sleep, - timeUntilStale -}); -//# sourceMappingURL=utils.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/utils.cjs.map b/node_modules/@tanstack/query-core/build/legacy/utils.cjs.map deleted file mode 100644 index fbfc03e..0000000 --- a/node_modules/@tanstack/query-core/build/legacy/utils.cjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/utils.ts"],"sourcesContent":["import { timeoutManager } from './timeoutManager'\nimport type {\n DefaultError,\n Enabled,\n FetchStatus,\n MutationKey,\n MutationStatus,\n QueryFunction,\n QueryKey,\n QueryOptions,\n StaleTime,\n StaleTimeFunction,\n} from './types'\nimport type { Mutation } from './mutation'\nimport type { FetchOptions, Query } from './query'\n\n// TYPES\n\ntype DropLast> = T extends readonly [\n ...infer R,\n unknown,\n]\n ? readonly [...R]\n : never\n\ntype TuplePrefixes> = T extends readonly []\n ? readonly []\n : TuplePrefixes> | T\n\nexport interface QueryFilters {\n /**\n * Filter to active queries, inactive queries or all queries\n */\n type?: QueryTypeFilter\n /**\n * Match query key exactly\n */\n exact?: boolean\n /**\n * Include queries matching this predicate function\n */\n predicate?: (query: Query) => boolean\n /**\n * Include queries matching this query key\n */\n queryKey?: TQueryKey | TuplePrefixes\n /**\n * Include or exclude stale queries\n */\n stale?: boolean\n /**\n * Include queries matching their fetchStatus\n */\n fetchStatus?: FetchStatus\n}\n\nexport interface MutationFilters<\n TData = unknown,\n TError = DefaultError,\n TVariables = unknown,\n TOnMutateResult = unknown,\n> {\n /**\n * Match mutation key exactly\n */\n exact?: boolean\n /**\n * Include mutations matching this predicate function\n */\n predicate?: (\n mutation: Mutation,\n ) => boolean\n /**\n * Include mutations matching this mutation key\n */\n mutationKey?: TuplePrefixes\n /**\n * Filter by mutation status\n */\n status?: MutationStatus\n}\n\nexport type Updater = TOutput | ((input: TInput) => TOutput)\n\nexport type QueryTypeFilter = 'all' | 'active' | 'inactive'\n\n// UTILS\n\nexport const isServer = typeof window === 'undefined' || 'Deno' in globalThis\n\nexport function noop(): void\nexport function noop(): undefined\nexport function noop() {}\n\nexport function functionalUpdate(\n updater: Updater,\n input: TInput,\n): TOutput {\n return typeof updater === 'function'\n ? (updater as (_: TInput) => TOutput)(input)\n : updater\n}\n\nexport function isValidTimeout(value: unknown): value is number {\n return typeof value === 'number' && value >= 0 && value !== Infinity\n}\n\nexport function timeUntilStale(updatedAt: number, staleTime?: number): number {\n return Math.max(updatedAt + (staleTime || 0) - Date.now(), 0)\n}\n\nexport function resolveStaleTime<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n staleTime:\n | undefined\n | StaleTimeFunction,\n query: Query,\n): StaleTime | undefined {\n return typeof staleTime === 'function' ? staleTime(query) : staleTime\n}\n\nexport function resolveEnabled<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n enabled: undefined | Enabled,\n query: Query,\n): boolean | undefined {\n return typeof enabled === 'function' ? enabled(query) : enabled\n}\n\nexport function matchQuery(\n filters: QueryFilters,\n query: Query,\n): boolean {\n const {\n type = 'all',\n exact,\n fetchStatus,\n predicate,\n queryKey,\n stale,\n } = filters\n\n if (queryKey) {\n if (exact) {\n if (query.queryHash !== hashQueryKeyByOptions(queryKey, query.options)) {\n return false\n }\n } else if (!partialMatchKey(query.queryKey, queryKey)) {\n return false\n }\n }\n\n if (type !== 'all') {\n const isActive = query.isActive()\n if (type === 'active' && !isActive) {\n return false\n }\n if (type === 'inactive' && isActive) {\n return false\n }\n }\n\n if (typeof stale === 'boolean' && query.isStale() !== stale) {\n return false\n }\n\n if (fetchStatus && fetchStatus !== query.state.fetchStatus) {\n return false\n }\n\n if (predicate && !predicate(query)) {\n return false\n }\n\n return true\n}\n\nexport function matchMutation(\n filters: MutationFilters,\n mutation: Mutation,\n): boolean {\n const { exact, status, predicate, mutationKey } = filters\n if (mutationKey) {\n if (!mutation.options.mutationKey) {\n return false\n }\n if (exact) {\n if (hashKey(mutation.options.mutationKey) !== hashKey(mutationKey)) {\n return false\n }\n } else if (!partialMatchKey(mutation.options.mutationKey, mutationKey)) {\n return false\n }\n }\n\n if (status && mutation.state.status !== status) {\n return false\n }\n\n if (predicate && !predicate(mutation)) {\n return false\n }\n\n return true\n}\n\nexport function hashQueryKeyByOptions(\n queryKey: TQueryKey,\n options?: Pick, 'queryKeyHashFn'>,\n): string {\n const hashFn = options?.queryKeyHashFn || hashKey\n return hashFn(queryKey)\n}\n\n/**\n * Default query & mutation keys hash function.\n * Hashes the value into a stable hash.\n */\nexport function hashKey(queryKey: QueryKey | MutationKey): string {\n return JSON.stringify(queryKey, (_, val) =>\n isPlainObject(val)\n ? Object.keys(val)\n .sort()\n .reduce((result, key) => {\n result[key] = val[key]\n return result\n }, {} as any)\n : val,\n )\n}\n\n/**\n * Checks if key `b` partially matches with key `a`.\n */\nexport function partialMatchKey(a: QueryKey, b: QueryKey): boolean\nexport function partialMatchKey(a: any, b: any): boolean {\n if (a === b) {\n return true\n }\n\n if (typeof a !== typeof b) {\n return false\n }\n\n if (a && b && typeof a === 'object' && typeof b === 'object') {\n return Object.keys(b).every((key) => partialMatchKey(a[key], b[key]))\n }\n\n return false\n}\n\nconst hasOwn = Object.prototype.hasOwnProperty\n\n/**\n * This function returns `a` if `b` is deeply equal.\n * If not, it will replace any deeply equal children of `b` with those of `a`.\n * This can be used for structural sharing between JSON values for example.\n */\nexport function replaceEqualDeep(a: unknown, b: T, depth?: number): T\nexport function replaceEqualDeep(a: any, b: any, depth = 0): any {\n if (a === b) {\n return a\n }\n\n if (depth > 500) return b\n\n const array = isPlainArray(a) && isPlainArray(b)\n\n if (!array && !(isPlainObject(a) && isPlainObject(b))) return b\n\n const aItems = array ? a : Object.keys(a)\n const aSize = aItems.length\n const bItems = array ? b : Object.keys(b)\n const bSize = bItems.length\n const copy: any = array ? new Array(bSize) : {}\n\n let equalItems = 0\n\n for (let i = 0; i < bSize; i++) {\n const key: any = array ? i : bItems[i]\n const aItem = a[key]\n const bItem = b[key]\n\n if (aItem === bItem) {\n copy[key] = aItem\n if (array ? i < aSize : hasOwn.call(a, key)) equalItems++\n continue\n }\n\n if (\n aItem === null ||\n bItem === null ||\n typeof aItem !== 'object' ||\n typeof bItem !== 'object'\n ) {\n copy[key] = bItem\n continue\n }\n\n const v = replaceEqualDeep(aItem, bItem, depth + 1)\n copy[key] = v\n if (v === aItem) equalItems++\n }\n\n return aSize === bSize && equalItems === aSize ? a : copy\n}\n\n/**\n * Shallow compare objects.\n */\nexport function shallowEqualObjects>(\n a: T,\n b: T | undefined,\n): boolean {\n if (!b || Object.keys(a).length !== Object.keys(b).length) {\n return false\n }\n\n for (const key in a) {\n if (a[key] !== b[key]) {\n return false\n }\n }\n\n return true\n}\n\nexport function isPlainArray(value: unknown): value is Array {\n return Array.isArray(value) && value.length === Object.keys(value).length\n}\n\n// Copied from: https://github.com/jonschlinkert/is-plain-object\nexport function isPlainObject(o: any): o is Record {\n if (!hasObjectPrototype(o)) {\n return false\n }\n\n // If has no constructor\n const ctor = o.constructor\n if (ctor === undefined) {\n return true\n }\n\n // If has modified prototype\n const prot = ctor.prototype\n if (!hasObjectPrototype(prot)) {\n return false\n }\n\n // If constructor does not have an Object-specific method\n if (!prot.hasOwnProperty('isPrototypeOf')) {\n return false\n }\n\n // Handles Objects created by Object.create()\n if (Object.getPrototypeOf(o) !== Object.prototype) {\n return false\n }\n\n // Most likely a plain Object\n return true\n}\n\nfunction hasObjectPrototype(o: any): boolean {\n return Object.prototype.toString.call(o) === '[object Object]'\n}\n\nexport function sleep(timeout: number): Promise {\n return new Promise((resolve) => {\n timeoutManager.setTimeout(resolve, timeout)\n })\n}\n\nexport function replaceData<\n TData,\n TOptions extends QueryOptions,\n>(prevData: TData | undefined, data: TData, options: TOptions): TData {\n if (typeof options.structuralSharing === 'function') {\n return options.structuralSharing(prevData, data) as TData\n } else if (options.structuralSharing !== false) {\n if (process.env.NODE_ENV !== 'production') {\n try {\n return replaceEqualDeep(prevData, data)\n } catch (error) {\n console.error(\n `Structural sharing requires data to be JSON serializable. To fix this, turn off structuralSharing or return JSON-serializable data from your queryFn. [${options.queryHash}]: ${error}`,\n )\n\n // Prevent the replaceEqualDeep from being called again down below.\n throw error\n }\n }\n // Structurally share data between prev and new data if needed\n return replaceEqualDeep(prevData, data)\n }\n return data\n}\n\nexport function keepPreviousData(\n previousData: T | undefined,\n): T | undefined {\n return previousData\n}\n\nexport function addToEnd(items: Array, item: T, max = 0): Array {\n const newItems = [...items, item]\n return max && newItems.length > max ? newItems.slice(1) : newItems\n}\n\nexport function addToStart(items: Array, item: T, max = 0): Array {\n const newItems = [item, ...items]\n return max && newItems.length > max ? newItems.slice(0, -1) : newItems\n}\n\nexport const skipToken = Symbol()\nexport type SkipToken = typeof skipToken\n\nexport function ensureQueryFn<\n TQueryFnData = unknown,\n TQueryKey extends QueryKey = QueryKey,\n>(\n options: {\n queryFn?: QueryFunction | SkipToken\n queryHash?: string\n },\n fetchOptions?: FetchOptions,\n): QueryFunction {\n if (process.env.NODE_ENV !== 'production') {\n if (options.queryFn === skipToken) {\n console.error(\n `Attempted to invoke queryFn when set to skipToken. This is likely a configuration error. Query hash: '${options.queryHash}'`,\n )\n }\n }\n\n // if we attempt to retry a fetch that was triggered from an initialPromise\n // when we don't have a queryFn yet, we can't retry, so we just return the already rejected initialPromise\n // if an observer has already mounted, we will be able to retry with that queryFn\n if (!options.queryFn && fetchOptions?.initialPromise) {\n return () => fetchOptions.initialPromise!\n }\n\n if (!options.queryFn || options.queryFn === skipToken) {\n return () =>\n Promise.reject(new Error(`Missing queryFn: '${options.queryHash}'`))\n }\n\n return options.queryFn\n}\n\nexport function shouldThrowError) => boolean>(\n throwOnError: boolean | T | undefined,\n params: Parameters,\n): boolean {\n // Allow throwOnError function to override throwing behavior on a per-error basis\n if (typeof throwOnError === 'function') {\n return throwOnError(...params)\n }\n\n return !!throwOnError\n}\n\nexport function addConsumeAwareSignal(\n object: T,\n getSignal: () => AbortSignal,\n onCancelled: VoidFunction,\n): T & { signal: AbortSignal } {\n let consumed = false\n let signal: AbortSignal | undefined\n\n Object.defineProperty(object, 'signal', {\n enumerable: true,\n get: () => {\n signal ??= getSignal()\n if (consumed) {\n return signal\n }\n\n consumed = true\n if (signal.aborted) {\n onCancelled()\n } else {\n signal.addEventListener('abort', onCancelled, { once: true })\n }\n\n return signal\n },\n })\n\n return object as T & { signal: AbortSignal }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,4BAA+B;AAwFxB,IAAM,WAAW,OAAO,WAAW,eAAe,UAAU;AAI5D,SAAS,OAAO;AAAC;AAEjB,SAAS,iBACd,SACA,OACS;AACT,SAAO,OAAO,YAAY,aACrB,QAAmC,KAAK,IACzC;AACN;AAEO,SAAS,eAAe,OAAiC;AAC9D,SAAO,OAAO,UAAU,YAAY,SAAS,KAAK,UAAU;AAC9D;AAEO,SAAS,eAAe,WAAmB,WAA4B;AAC5E,SAAO,KAAK,IAAI,aAAa,aAAa,KAAK,KAAK,IAAI,GAAG,CAAC;AAC9D;AAEO,SAAS,iBAMd,WAGA,OACuB;AACvB,SAAO,OAAO,cAAc,aAAa,UAAU,KAAK,IAAI;AAC9D;AAEO,SAAS,eAMd,SACA,OACqB;AACrB,SAAO,OAAO,YAAY,aAAa,QAAQ,KAAK,IAAI;AAC1D;AAEO,SAAS,WACd,SACA,OACS;AACT,QAAM;AAAA,IACJ,OAAO;AAAA,IACP;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI;AAEJ,MAAI,UAAU;AACZ,QAAI,OAAO;AACT,UAAI,MAAM,c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AAqB,QAAQ,SAAS,GAAG,CAAC;AAAA,EACvE;AAEA,SAAO,QAAQ;AACjB;AAEO,SAAS,iBACd,cACA,QACS;AAET,MAAI,OAAO,iBAAiB,YAAY;AACtC,WAAO,aAAa,GAAG,MAAM;AAAA,EAC/B;AAEA,SAAO,CAAC,CAAC;AACX;AAEO,SAAS,sBACd,QACA,WACA,aAC6B;AAC7B,MAAI,WAAW;AACf,MAAI;AAEJ,SAAO,eAAe,QAAQ,UAAU;AAAA,IACtC,YAAY;AAAA,IACZ,KAAK,MAAM;AACT,0BAAW,UAAU;AACrB,UAAI,UAAU;AACZ,eAAO;AAAA,MACT;AAEA,iBAAW;AACX,UAAI,OAAO,SAAS;AAClB,oBAAY;AAAA,MACd,OAAO;AACL,eAAO,iBAAiB,SAAS,aAAa,EAAE,MAAM,KAAK,CAAC;AAAA,MAC9D;AAEA,aAAO;AAAA,IACT;AAAA,EACF,CAAC;AAED,SAAO;AACT;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/utils.d.cts b/node_modules/@tanstack/query-core/build/legacy/utils.d.cts deleted file mode 100644 index 502420e..0000000 --- a/node_modules/@tanstack/query-core/build/legacy/utils.d.cts +++ /dev/null @@ -1,3 +0,0 @@ -export { u as MutationFilters, v as QueryFilters, bl as QueryTypeFilter, S as SkipToken, U as Updater, bA as addConsumeAwareSignal, bx as addToEnd, by as addToStart, bz as ensureQueryFn, bm as functionalUpdate, k as hashKey, br as hashQueryKeyByOptions, bt as isPlainArray, bu as isPlainObject, l as isServer, bn as isValidTimeout, m as keepPreviousData, n as matchMutation, o as matchQuery, p as noop, q as partialMatchKey, bw as replaceData, r as replaceEqualDeep, bq as resolveEnabled, bp as resolveStaleTime, bs as shallowEqualObjects, s as shouldThrowError, t as skipToken, bv as sleep, bo as timeUntilStale } from './hydration-uphG6M-i.cjs'; -import './removable.cjs'; -import './subscribable.cjs'; diff --git a/node_modules/@tanstack/query-core/build/legacy/utils.d.ts b/node_modules/@tanstack/query-core/build/legacy/utils.d.ts deleted file mode 100644 index 77dcd04..0000000 --- a/node_modules/@tanstack/query-core/build/legacy/utils.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export { u as MutationFilters, v as QueryFilters, bl as QueryTypeFilter, S as SkipToken, U as Updater, bA as addConsumeAwareSignal, bx as addToEnd, by as addToStart, bz as ensureQueryFn, bm as functionalUpdate, k as hashKey, br as hashQueryKeyByOptions, bt as isPlainArray, bu as isPlainObject, l as isServer, bn as isValidTimeout, m as keepPreviousData, n as matchMutation, o as matchQuery, p as noop, q as partialMatchKey, bw as replaceData, r as replaceEqualDeep, bq as resolveEnabled, bp as resolveStaleTime, bs as shallowEqualObjects, s as shouldThrowError, t as skipToken, bv as sleep, bo as timeUntilStale } from './hydration-BlEVG2Lp.js'; -import './removable.js'; -import './subscribable.js'; diff --git a/node_modules/@tanstack/query-core/build/legacy/utils.js b/node_modules/@tanstack/query-core/build/legacy/utils.js deleted file mode 100644 index 51b9a4c..0000000 --- a/node_modules/@tanstack/query-core/build/legacy/utils.js +++ /dev/null @@ -1,283 +0,0 @@ -import "./chunk-PXG64RU4.js"; - -// src/utils.ts -import { timeoutManager } from "./timeoutManager.js"; -var isServer = typeof window === "undefined" || "Deno" in globalThis; -function noop() { -} -function functionalUpdate(updater, input) { - return typeof updater === "function" ? updater(input) : updater; -} -function isValidTimeout(value) { - return typeof value === "number" && value >= 0 && value !== Infinity; -} -function timeUntilStale(updatedAt, staleTime) { - return Math.max(updatedAt + (staleTime || 0) - Date.now(), 0); -} -function resolveStaleTime(staleTime, query) { - return typeof staleTime === "function" ? staleTime(query) : staleTime; -} -function resolveEnabled(enabled, query) { - return typeof enabled === "function" ? enabled(query) : enabled; -} -function matchQuery(filters, query) { - const { - type = "all", - exact, - fetchStatus, - predicate, - queryKey, - stale - } = filters; - if (queryKey) { - if (exact) { - if (query.queryHash !== hashQueryKeyByOptions(queryKey, query.options)) { - return false; - } - } else if (!partialMatchKey(query.queryKey, queryKey)) { - return false; - } - } - if (type !== "all") { - const isActive = query.isActive(); - if (type === "active" && !isActive) { - return false; - } - if (type === "inactive" && isActive) { - return false; - } - } - if (typeof stale === "boolean" && query.isStale() !== stale) { - return false; - } - if (fetchStatus && fetchStatus !== query.state.fetchStatus) { - return false; - } - if (predicate && !predicate(query)) { - return false; - } - return true; -} -function matchMutation(filters, mutation) { - const { exact, status, predicate, mutationKey } = filters; - if (mutationKey) { - if (!mutation.options.mutationKey) { - return false; - } - if (exact) { - if (hashKey(mutation.options.mutationKey) !== hashKey(mutationKey)) { - return false; - } - } else if (!partialMatchKey(mutation.options.mutationKey, mutationKey)) { - return false; - } - } - if (status && mutation.state.status !== status) { - return false; - } - if (predicate && !predicate(mutation)) { - return false; - } - return true; -} -function hashQueryKeyByOptions(queryKey, options) { - const hashFn = (options == null ? void 0 : options.queryKeyHashFn) || hashKey; - return hashFn(queryKey); -} -function hashKey(queryKey) { - return JSON.stringify( - queryKey, - (_, val) => isPlainObject(val) ? Object.keys(val).sort().reduce((result, key) => { - result[key] = val[key]; - return result; - }, {}) : val - ); -} -function partialMatchKey(a, b) { - if (a === b) { - return true; - } - if (typeof a !== typeof b) { - return false; - } - if (a && b && typeof a === "object" && typeof b === "object") { - return Object.keys(b).every((key) => partialMatchKey(a[key], b[key])); - } - return false; -} -var hasOwn = Object.prototype.hasOwnProperty; -function replaceEqualDeep(a, b, depth = 0) { - if (a === b) { - return a; - } - if (depth > 500) return b; - const array = isPlainArray(a) && isPlainArray(b); - if (!array && !(isPlainObject(a) && isPlainObject(b))) return b; - const aItems = array ? a : Object.keys(a); - const aSize = aItems.length; - const bItems = array ? b : Object.keys(b); - const bSize = bItems.length; - const copy = array ? new Array(bSize) : {}; - let equalItems = 0; - for (let i = 0; i < bSize; i++) { - const key = array ? i : bItems[i]; - const aItem = a[key]; - const bItem = b[key]; - if (aItem === bItem) { - copy[key] = aItem; - if (array ? i < aSize : hasOwn.call(a, key)) equalItems++; - continue; - } - if (aItem === null || bItem === null || typeof aItem !== "object" || typeof bItem !== "object") { - copy[key] = bItem; - continue; - } - const v = replaceEqualDeep(aItem, bItem, depth + 1); - copy[key] = v; - if (v === aItem) equalItems++; - } - return aSize === bSize && equalItems === aSize ? a : copy; -} -function shallowEqualObjects(a, b) { - if (!b || Object.keys(a).length !== Object.keys(b).length) { - return false; - } - for (const key in a) { - if (a[key] !== b[key]) { - return false; - } - } - return true; -} -function isPlainArray(value) { - return Array.isArray(value) && value.length === Object.keys(value).length; -} -function isPlainObject(o) { - if (!hasObjectPrototype(o)) { - return false; - } - const ctor = o.constructor; - if (ctor === void 0) { - return true; - } - const prot = ctor.prototype; - if (!hasObjectPrototype(prot)) { - return false; - } - if (!prot.hasOwnProperty("isPrototypeOf")) { - return false; - } - if (Object.getPrototypeOf(o) !== Object.prototype) { - return false; - } - return true; -} -function hasObjectPrototype(o) { - return Object.prototype.toString.call(o) === "[object Object]"; -} -function sleep(timeout) { - return new Promise((resolve) => { - timeoutManager.setTimeout(resolve, timeout); - }); -} -function replaceData(prevData, data, options) { - if (typeof options.structuralSharing === "function") { - return options.structuralSharing(prevData, data); - } else if (options.structuralSharing !== false) { - if (process.env.NODE_ENV !== "production") { - try { - return replaceEqualDeep(prevData, data); - } catch (error) { - console.error( - `Structural sharing requires data to be JSON serializable. To fix this, turn off structuralSharing or return JSON-serializable data from your queryFn. [${options.queryHash}]: ${error}` - ); - throw error; - } - } - return replaceEqualDeep(prevData, data); - } - return data; -} -function keepPreviousData(previousData) { - return previousData; -} -function addToEnd(items, item, max = 0) { - const newItems = [...items, item]; - return max && newItems.length > max ? newItems.slice(1) : newItems; -} -function addToStart(items, item, max = 0) { - const newItems = [item, ...items]; - return max && newItems.length > max ? newItems.slice(0, -1) : newItems; -} -var skipToken = /* @__PURE__ */ Symbol(); -function ensureQueryFn(options, fetchOptions) { - if (process.env.NODE_ENV !== "production") { - if (options.queryFn === skipToken) { - console.error( - `Attempted to invoke queryFn when set to skipToken. This is likely a configuration error. Query hash: '${options.queryHash}'` - ); - } - } - if (!options.queryFn && (fetchOptions == null ? void 0 : fetchOptions.initialPromise)) { - return () => fetchOptions.initialPromise; - } - if (!options.queryFn || options.queryFn === skipToken) { - return () => Promise.reject(new Error(`Missing queryFn: '${options.queryHash}'`)); - } - return options.queryFn; -} -function shouldThrowError(throwOnError, params) { - if (typeof throwOnError === "function") { - return throwOnError(...params); - } - return !!throwOnError; -} -function addConsumeAwareSignal(object, getSignal, onCancelled) { - let consumed = false; - let signal; - Object.defineProperty(object, "signal", { - enumerable: true, - get: () => { - signal ?? (signal = getSignal()); - if (consumed) { - return signal; - } - consumed = true; - if (signal.aborted) { - onCancelled(); - } else { - signal.addEventListener("abort", onCancelled, { once: true }); - } - return signal; - } - }); - return object; -} -export { - addConsumeAwareSignal, - addToEnd, - addToStart, - ensureQueryFn, - functionalUpdate, - hashKey, - hashQueryKeyByOptions, - isPlainArray, - isPlainObject, - isServer, - isValidTimeout, - keepPreviousData, - matchMutation, - matchQuery, - noop, - partialMatchKey, - replaceData, - replaceEqualDeep, - resolveEnabled, - resolveStaleTime, - shallowEqualObjects, - shouldThrowError, - skipToken, - sleep, - timeUntilStale -}; -//# sourceMappingURL=utils.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/legacy/utils.js.map b/node_modules/@tanstack/query-core/build/legacy/utils.js.map deleted file mode 100644 index 95c6207..0000000 --- a/node_modules/@tanstack/query-core/build/legacy/utils.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/utils.ts"],"sourcesContent":["import { timeoutManager } from './timeoutManager'\nimport type {\n DefaultError,\n Enabled,\n FetchStatus,\n MutationKey,\n MutationStatus,\n QueryFunction,\n QueryKey,\n QueryOptions,\n StaleTime,\n StaleTimeFunction,\n} from './types'\nimport type { Mutation } from './mutation'\nimport type { FetchOptions, Query } from './query'\n\n// TYPES\n\ntype DropLast> = T extends readonly [\n ...infer R,\n unknown,\n]\n ? readonly [...R]\n : never\n\ntype TuplePrefixes> = T extends readonly []\n ? readonly []\n : TuplePrefixes> | T\n\nexport interface QueryFilters {\n /**\n * Filter to active queries, inactive queries or all queries\n */\n type?: QueryTypeFilter\n /**\n * Match query key exactly\n */\n exact?: boolean\n /**\n * Include queries matching this predicate function\n */\n predicate?: (query: Query) => boolean\n /**\n * Include queries matching this query key\n */\n queryKey?: TQueryKey | TuplePrefixes\n /**\n * Include or exclude stale queries\n */\n stale?: boolean\n /**\n * Include queries matching their fetchStatus\n */\n fetchStatus?: FetchStatus\n}\n\nexport interface MutationFilters<\n TData = unknown,\n TError = DefaultError,\n TVariables = unknown,\n TOnMutateResult = unknown,\n> {\n /**\n * Match mutation key exactly\n */\n exact?: boolean\n /**\n * Include mutations matching this predicate function\n */\n predicate?: (\n mutation: Mutation,\n ) => boolean\n /**\n * Include mutations matching this mutation key\n */\n mutationKey?: TuplePrefixes\n /**\n * Filter by mutation status\n */\n status?: MutationStatus\n}\n\nexport type Updater = TOutput | ((input: TInput) => TOutput)\n\nexport type QueryTypeFilter = 'all' | 'active' | 'inactive'\n\n// UTILS\n\nexport const isServer = typeof window === 'undefined' || 'Deno' in globalThis\n\nexport function noop(): void\nexport function noop(): undefined\nexport function noop() {}\n\nexport function functionalUpdate(\n updater: Updater,\n input: TInput,\n): TOutput {\n return typeof updater === 'function'\n ? (updater as (_: TInput) => TOutput)(input)\n : updater\n}\n\nexport function isValidTimeout(value: unknown): value is number {\n return typeof value === 'number' && value >= 0 && value !== Infinity\n}\n\nexport function timeUntilStale(updatedAt: number, staleTime?: number): number {\n return Math.max(updatedAt + (staleTime || 0) - Date.now(), 0)\n}\n\nexport function resolveStaleTime<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n staleTime:\n | undefined\n | StaleTimeFunction,\n query: Query,\n): StaleTime | undefined {\n return typeof staleTime === 'function' ? staleTime(query) : staleTime\n}\n\nexport function resolveEnabled<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n enabled: undefined | Enabled,\n query: Query,\n): boolean | undefined {\n return typeof enabled === 'function' ? enabled(query) : enabled\n}\n\nexport function matchQuery(\n filters: QueryFilters,\n query: Query,\n): boolean {\n const {\n type = 'all',\n exact,\n fetchStatus,\n predicate,\n queryKey,\n stale,\n } = filters\n\n if (queryKey) {\n if (exact) {\n if (query.queryHash !== hashQueryKeyByOptions(queryKey, query.options)) {\n return false\n }\n } else if (!partialMatchKey(query.queryKey, queryKey)) {\n return false\n }\n }\n\n if (type !== 'all') {\n const isActive = query.isActive()\n if (type === 'active' && !isActive) {\n return false\n }\n if (type === 'inactive' && isActive) {\n return false\n }\n }\n\n if (typeof stale === 'boolean' && query.isStale() !== stale) {\n return false\n }\n\n if (fetchStatus && fetchStatus !== query.state.fetchStatus) {\n return false\n }\n\n if (predicate && !predicate(query)) {\n return false\n }\n\n return true\n}\n\nexport function matchMutation(\n filters: MutationFilters,\n mutation: Mutation,\n): boolean {\n const { exact, status, predicate, mutationKey } = filters\n if (mutationKey) {\n if (!mutation.options.mutationKey) {\n return false\n }\n if (exact) {\n if (hashKey(mutation.options.mutationKey) !== hashKey(mutationKey)) {\n return false\n }\n } else if (!partialMatchKey(mutation.options.mutationKey, mutationKey)) {\n return false\n }\n }\n\n if (status && mutation.state.status !== status) {\n return false\n }\n\n if (predicate && !predicate(mutation)) {\n return false\n }\n\n return true\n}\n\nexport function hashQueryKeyByOptions(\n queryKey: TQueryKey,\n options?: Pick, 'queryKeyHashFn'>,\n): string {\n const hashFn = options?.queryKeyHashFn || hashKey\n return hashFn(queryKey)\n}\n\n/**\n * Default query & mutation keys hash function.\n * Hashes the value into a stable hash.\n */\nexport function hashKey(queryKey: QueryKey | MutationKey): string {\n return JSON.stringify(queryKey, (_, val) =>\n isPlainObject(val)\n ? Object.keys(val)\n .sort()\n .reduce((result, key) => {\n result[key] = val[key]\n return result\n }, {} as any)\n : val,\n )\n}\n\n/**\n * Checks if key `b` partially matches with key `a`.\n */\nexport function partialMatchKey(a: QueryKey, b: QueryKey): boolean\nexport function partialMatchKey(a: any, b: any): boolean {\n if (a === b) {\n return true\n }\n\n if (typeof a !== typeof b) {\n return false\n }\n\n if (a && b && typeof a === 'object' && typeof b === 'object') {\n return Object.keys(b).every((key) => partialMatchKey(a[key], b[key]))\n }\n\n return false\n}\n\nconst hasOwn = Object.prototype.hasOwnProperty\n\n/**\n * This function returns `a` if `b` is deeply equal.\n * If not, it will replace any deeply equal children of `b` with those of `a`.\n * This can be used for structural sharing between JSON values for example.\n */\nexport function replaceEqualDeep(a: unknown, b: T, depth?: number): T\nexport function replaceEqualDeep(a: any, b: any, depth = 0): any {\n if (a === b) {\n return a\n }\n\n if (depth > 500) return b\n\n const array = isPlainArray(a) && isPlainArray(b)\n\n if (!array && !(isPlainObject(a) && isPlainObject(b))) return b\n\n const aItems = array ? a : Object.keys(a)\n const aSize = aItems.length\n const bItems = array ? b : Object.keys(b)\n const bSize = bItems.length\n const copy: any = array ? new Array(bSize) : {}\n\n let equalItems = 0\n\n for (let i = 0; i < bSize; i++) {\n const key: any = array ? i : bItems[i]\n const aItem = a[key]\n const bItem = b[key]\n\n if (aItem === bItem) {\n copy[key] = aItem\n if (array ? i < aSize : hasOwn.call(a, key)) equalItems++\n continue\n }\n\n if (\n aItem === null ||\n bItem === null ||\n typeof aItem !== 'object' ||\n typeof bItem !== 'object'\n ) {\n copy[key] = bItem\n continue\n }\n\n const v = replaceEqualDeep(aItem, bItem, depth + 1)\n copy[key] = v\n if (v === aItem) equalItems++\n }\n\n return aSize === bSize && equalItems === aSize ? a : copy\n}\n\n/**\n * Shallow compare objects.\n */\nexport function shallowEqualObjects>(\n a: T,\n b: T | undefined,\n): boolean {\n if (!b || Object.keys(a).length !== Object.keys(b).length) {\n return false\n }\n\n for (const key in a) {\n if (a[key] !== b[key]) {\n return false\n }\n }\n\n return true\n}\n\nexport function isPlainArray(value: unknown): value is Array {\n return Array.isArray(value) && value.length === Object.keys(value).length\n}\n\n// Copied from: https://github.com/jonschlinkert/is-plain-object\nexport function isPlainObject(o: any): o is Record {\n if (!hasObjectPrototype(o)) {\n return false\n }\n\n // If has no constructor\n const ctor = o.constructor\n if (ctor === undefined) {\n return true\n }\n\n // If has modified prototype\n const prot = ctor.prototype\n if (!hasObjectPrototype(prot)) {\n return false\n }\n\n // If constructor does not have an Object-specific method\n if (!prot.hasOwnProperty('isPrototypeOf')) {\n return false\n }\n\n // Handles Objects created by Object.create()\n if (Object.getPrototypeOf(o) !== Object.prototype) {\n return false\n }\n\n // Most likely a plain Object\n return true\n}\n\nfunction hasObjectPrototype(o: any): boolean {\n return Object.prototype.toString.call(o) === '[object Object]'\n}\n\nexport function sleep(timeout: number): Promise {\n return new Promise((resolve) => {\n timeoutManager.setTimeout(resolve, timeout)\n })\n}\n\nexport function replaceData<\n TData,\n TOptions extends QueryOptions,\n>(prevData: TData | undefined, data: TData, options: TOptions): TData {\n if (typeof options.structuralSharing === 'function') {\n return options.structuralSharing(prevData, data) as TData\n } else if (options.structuralSharing !== false) {\n if (process.env.NODE_ENV !== 'production') {\n try {\n return replaceEqualDeep(prevData, data)\n } catch (error) {\n console.error(\n `Structural sharing requires data to be JSON serializable. To fix this, turn off structuralSharing or return JSON-serializable data from your queryFn. [${options.queryHash}]: ${error}`,\n )\n\n // Prevent the replaceEqualDeep from being called again down below.\n throw error\n }\n }\n // Structurally share data between prev and new data if needed\n return replaceEqualDeep(prevData, data)\n }\n return data\n}\n\nexport function keepPreviousData(\n previousData: T | undefined,\n): T | undefined {\n return previousData\n}\n\nexport function addToEnd(items: Array, item: T, max = 0): Array {\n const newItems = [...items, item]\n return max && newItems.length > max ? newItems.slice(1) : newItems\n}\n\nexport function addToStart(items: Array, item: T, max = 0): Array {\n const newItems = [item, ...items]\n return max && newItems.length > max ? newItems.slice(0, -1) : newItems\n}\n\nexport const skipToken = Symbol()\nexport type SkipToken = typeof skipToken\n\nexport function ensureQueryFn<\n TQueryFnData = unknown,\n TQueryKey extends QueryKey = QueryKey,\n>(\n options: {\n queryFn?: QueryFunction | SkipToken\n queryHash?: string\n },\n fetchOptions?: FetchOptions,\n): QueryFunction {\n if (process.env.NODE_ENV !== 'production') {\n if (options.queryFn === skipToken) {\n console.error(\n `Attempted to invoke queryFn when set to skipToken. This is likely a configuration error. Query hash: '${options.queryHash}'`,\n )\n }\n }\n\n // if we attempt to retry a fetch that was triggered from an initialPromise\n // when we don't have a queryFn yet, we can't retry, so we just return the already rejected initialPromise\n // if an observer has already mounted, we will be able to retry with that queryFn\n if (!options.queryFn && fetchOptions?.initialPromise) {\n return () => fetchOptions.initialPromise!\n }\n\n if (!options.queryFn || options.queryFn === skipToken) {\n return () =>\n Promise.reject(new Error(`Missing queryFn: '${options.queryHash}'`))\n }\n\n return options.queryFn\n}\n\nexport function shouldThrowError) => boolean>(\n throwOnError: boolean | T | undefined,\n params: Parameters,\n): boolean {\n // Allow throwOnError function to override throwing behavior on a per-error basis\n if (typeof throwOnError === 'function') {\n return throwOnError(...params)\n }\n\n return !!throwOnError\n}\n\nexport function addConsumeAwareSignal(\n object: T,\n getSignal: () => AbortSignal,\n onCancelled: VoidFunction,\n): T & { signal: AbortSignal } {\n let consumed = false\n let signal: AbortSignal | undefined\n\n Object.defineProperty(object, 'signal', {\n enumerable: true,\n get: () => {\n signal ??= getSignal()\n if (consumed) {\n return signal\n }\n\n consumed = true\n if (signal.aborted) {\n onCancelled()\n } else {\n signal.addEventListener('abort', onCancelled, { once: true })\n }\n\n return signal\n },\n })\n\n return object as T & { signal: AbortSignal }\n}\n"],"mappings":";;;AAAA,SAAS,sBAAsB;AAwFxB,IAAM,WAAW,OAAO,WAAW,eAAe,UAAU;AAI5D,SAAS,OAAO;AAAC;AAEjB,SAAS,iBACd,SACA,OACS;AACT,SAAO,OAAO,YAAY,aACrB,QAAmC,KAAK,IACzC;AACN;AAEO,SAAS,eAAe,OAAiC;AAC9D,SAAO,OAAO,UAAU,YAAY,SAAS,KAAK,UAAU;AAC9D;AAEO,SAAS,eAAe,WAAmB,WAA4B;AAC5E,SAAO,KAAK,IAAI,aAAa,aAAa,KAAK,KAAK,IAAI,GAAG,CAAC;AAC9D;AAEO,SAAS,iBAMd,WAGA,OACuB;AACvB,SAAO,OAAO,cAAc,aAAa,UAAU,KAAK,IAAI;AAC9D;AAEO,SAAS,eAMd,SACA,OACqB;AACrB,SAAO,OAAO,YAAY,aAAa,QAAQ,KAAK,IAAI;AAC1D;AAEO,SAAS,WACd,SACA,OACS;AACT,QAAM;AAAA,IACJ,OAAO;AAAA,IACP;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI;AAEJ,MAAI,UAAU;AACZ,QAAI,OAAO;AACT,UAAI,MAAM,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BAAqB,QAAQ,SAAS,GAAG,CAAC;AAAA,EACvE;AAEA,SAAO,QAAQ;AACjB;AAEO,SAAS,iBACd,cACA,QACS;AAET,MAAI,OAAO,iBAAiB,YAAY;AACtC,WAAO,aAAa,GAAG,MAAM;AAAA,EAC/B;AAEA,SAAO,CAAC,CAAC;AACX;AAEO,SAAS,sBACd,QACA,WACA,aAC6B;AAC7B,MAAI,WAAW;AACf,MAAI;AAEJ,SAAO,eAAe,QAAQ,UAAU;AAAA,IACtC,YAAY;AAAA,IACZ,KAAK,MAAM;AACT,0BAAW,UAAU;AACrB,UAAI,UAAU;AACZ,eAAO;AAAA,MACT;AAEA,iBAAW;AACX,UAAI,OAAO,SAAS;AAClB,oBAAY;AAAA,MACd,OAAO;AACL,eAAO,iBAAiB,SAAS,aAAa,EAAE,MAAM,KAAK,CAAC;AAAA,MAC9D;AAEA,aAAO;AAAA,IACT;AAAA,EACF,CAAC;AAED,SAAO;AACT;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/focusManager.cjs b/node_modules/@tanstack/query-core/build/modern/focusManager.cjs deleted file mode 100644 index 7e872d0..0000000 --- a/node_modules/@tanstack/query-core/build/modern/focusManager.cjs +++ /dev/null @@ -1,94 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// src/focusManager.ts -var focusManager_exports = {}; -__export(focusManager_exports, { - FocusManager: () => FocusManager, - focusManager: () => focusManager -}); -module.exports = __toCommonJS(focusManager_exports); -var import_subscribable = require("./subscribable.cjs"); -var import_utils = require("./utils.cjs"); -var FocusManager = class extends import_subscribable.Subscribable { - #focused; - #cleanup; - #setup; - constructor() { - super(); - this.#setup = (onFocus) => { - if (!import_utils.isServer && window.addEventListener) { - const listener = () => onFocus(); - window.addEventListener("visibilitychange", listener, false); - return () => { - window.removeEventListener("visibilitychange", listener); - }; - } - return; - }; - } - onSubscribe() { - if (!this.#cleanup) { - this.setEventListener(this.#setup); - } - } - onUnsubscribe() { - if (!this.hasListeners()) { - this.#cleanup?.(); - this.#cleanup = void 0; - } - } - setEventListener(setup) { - this.#setup = setup; - this.#cleanup?.(); - this.#cleanup = setup((focused) => { - if (typeof focused === "boolean") { - this.setFocused(focused); - } else { - this.onFocus(); - } - }); - } - setFocused(focused) { - const changed = this.#focused !== focused; - if (changed) { - this.#focused = focused; - this.onFocus(); - } - } - onFocus() { - const isFocused = this.isFocused(); - this.listeners.forEach((listener) => { - listener(isFocused); - }); - } - isFocused() { - if (typeof this.#focused === "boolean") { - return this.#focused; - } - return globalThis.document?.visibilityState !== "hidden"; - } -}; -var focusManager = new FocusManager(); -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - FocusManager, - focusManager -}); -//# sourceMappingURL=focusManager.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/focusManager.cjs.map b/node_modules/@tanstack/query-core/build/modern/focusManager.cjs.map deleted file mode 100644 index 515417b..0000000 --- a/node_modules/@tanstack/query-core/build/modern/focusManager.cjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/focusManager.ts"],"sourcesContent":["import { Subscribable } from './subscribable'\nimport { isServer } from './utils'\n\ntype Listener = (focused: boolean) => void\n\ntype SetupFn = (\n setFocused: (focused?: boolean) => void,\n) => (() => void) | undefined\n\nexport class FocusManager extends Subscribable {\n #focused?: boolean\n #cleanup?: () => void\n\n #setup: SetupFn\n\n constructor() {\n super()\n this.#setup = (onFocus) => {\n // addEventListener does not exist in React Native, but window does\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n if (!isServer && window.addEventListener) {\n const listener = () => onFocus()\n // Listen to visibilitychange\n window.addEventListener('visibilitychange', listener, false)\n\n return () => {\n // Be sure to unsubscribe if a new handler is set\n window.removeEventListener('visibilitychange', listener)\n }\n }\n return\n }\n }\n\n protected onSubscribe(): void {\n if (!this.#cleanup) {\n this.setEventListener(this.#setup)\n }\n }\n\n protected onUnsubscribe() {\n if (!this.hasListeners()) {\n this.#cleanup?.()\n this.#cleanup = undefined\n }\n }\n\n setEventListener(setup: SetupFn): void {\n this.#setup = setup\n this.#cleanup?.()\n this.#cleanup = setup((focused) => {\n if (typeof focused === 'boolean') {\n this.setFocused(focused)\n } else {\n this.onFocus()\n }\n })\n }\n\n setFocused(focused?: boolean): void {\n const changed = this.#focused !== focused\n if (changed) {\n this.#focused = focused\n this.onFocus()\n }\n }\n\n onFocus(): void {\n const isFocused = this.isFocused()\n this.listeners.forEach((listener) => {\n listener(isFocused)\n })\n }\n\n isFocused(): boolean {\n if (typeof this.#focused === 'boolean') {\n return this.#focused\n }\n\n // document global can be unavailable in react native\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n return globalThis.document?.visibilityState !== 'hidden'\n }\n}\n\nexport const focusManager = new FocusManager()\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,0BAA6B;AAC7B,mBAAyB;AAQlB,IAAM,eAAN,cAA2B,iCAAuB;AAAA,EACvD;AAAA,EACA;AAAA,EAEA;AAAA,EAEA,cAAc;AACZ,UAAM;AACN,SAAK,SAAS,CAAC,YAAY;AAGzB,UAAI,CAAC,yBAAY,OAAO,kBAAkB;AACxC,cAAM,WAAW,MAAM,QAAQ;AAE/B,eAAO,iBAAiB,oBAAoB,UAAU,KAAK;AAE3D,eAAO,MAAM;AAEX,iBAAO,oBAAoB,oBAAoB,QAAQ;AAAA,QACzD;AAAA,MACF;AACA;AAAA,IACF;AAAA,EACF;AAAA,EAEU,cAAoB;AAC5B,QAAI,CAAC,KAAK,UAAU;AAClB,WAAK,iBAAiB,KAAK,MAAM;AAAA,IACnC;AAAA,EACF;AAAA,EAEU,gBAAgB;AACxB,QAAI,CAAC,KAAK,aAAa,GAAG;AACxB,WAAK,WAAW;AAChB,WAAK,WAAW;AAAA,IAClB;AAAA,EACF;AAAA,EAEA,iBAAiB,OAAsB;AACrC,SAAK,SAAS;AACd,SAAK,WAAW;AAChB,SAAK,WAAW,MAAM,CAAC,YAAY;AACjC,UAAI,OAAO,YAAY,WAAW;AAChC,aAAK,WAAW,OAAO;AAAA,MACzB,OAAO;AACL,aAAK,QAAQ;AAAA,MACf;AAAA,IACF,CAAC;AAAA,EACH;AAAA,EAEA,WAAW,SAAyB;AAClC,UAAM,UAAU,KAAK,aAAa;AAClC,QAAI,SAAS;AACX,WAAK,WAAW;AAChB,WAAK,QAAQ;AAAA,IACf;AAAA,EACF;AAAA,EAEA,UAAgB;AACd,UAAM,YAAY,KAAK,UAAU;AACjC,SAAK,UAAU,QAAQ,CAAC,aAAa;AACnC,eAAS,SAAS;AAAA,IACpB,CAAC;AAAA,EACH;AAAA,EAEA,YAAqB;AACnB,QAAI,OAAO,KAAK,aAAa,WAAW;AACtC,aAAO,KAAK;AAAA,IACd;AAIA,WAAO,WAAW,UAAU,oBAAoB;AAAA,EAClD;AACF;AAEO,IAAM,eAAe,IAAI,aAAa;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/focusManager.d.cts b/node_modules/@tanstack/query-core/build/modern/focusManager.d.cts deleted file mode 100644 index c0f57ac..0000000 --- a/node_modules/@tanstack/query-core/build/modern/focusManager.d.cts +++ /dev/null @@ -1,17 +0,0 @@ -import { Subscribable } from './subscribable.cjs'; - -type Listener = (focused: boolean) => void; -type SetupFn = (setFocused: (focused?: boolean) => void) => (() => void) | undefined; -declare class FocusManager extends Subscribable { - #private; - constructor(); - protected onSubscribe(): void; - protected onUnsubscribe(): void; - setEventListener(setup: SetupFn): void; - setFocused(focused?: boolean): void; - onFocus(): void; - isFocused(): boolean; -} -declare const focusManager: FocusManager; - -export { FocusManager, focusManager }; diff --git a/node_modules/@tanstack/query-core/build/modern/focusManager.d.ts b/node_modules/@tanstack/query-core/build/modern/focusManager.d.ts deleted file mode 100644 index da33a8b..0000000 --- a/node_modules/@tanstack/query-core/build/modern/focusManager.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { Subscribable } from './subscribable.js'; - -type Listener = (focused: boolean) => void; -type SetupFn = (setFocused: (focused?: boolean) => void) => (() => void) | undefined; -declare class FocusManager extends Subscribable { - #private; - constructor(); - protected onSubscribe(): void; - protected onUnsubscribe(): void; - setEventListener(setup: SetupFn): void; - setFocused(focused?: boolean): void; - onFocus(): void; - isFocused(): boolean; -} -declare const focusManager: FocusManager; - -export { FocusManager, focusManager }; diff --git a/node_modules/@tanstack/query-core/build/modern/focusManager.js b/node_modules/@tanstack/query-core/build/modern/focusManager.js deleted file mode 100644 index ec16206..0000000 --- a/node_modules/@tanstack/query-core/build/modern/focusManager.js +++ /dev/null @@ -1,68 +0,0 @@ -// src/focusManager.ts -import { Subscribable } from "./subscribable.js"; -import { isServer } from "./utils.js"; -var FocusManager = class extends Subscribable { - #focused; - #cleanup; - #setup; - constructor() { - super(); - this.#setup = (onFocus) => { - if (!isServer && window.addEventListener) { - const listener = () => onFocus(); - window.addEventListener("visibilitychange", listener, false); - return () => { - window.removeEventListener("visibilitychange", listener); - }; - } - return; - }; - } - onSubscribe() { - if (!this.#cleanup) { - this.setEventListener(this.#setup); - } - } - onUnsubscribe() { - if (!this.hasListeners()) { - this.#cleanup?.(); - this.#cleanup = void 0; - } - } - setEventListener(setup) { - this.#setup = setup; - this.#cleanup?.(); - this.#cleanup = setup((focused) => { - if (typeof focused === "boolean") { - this.setFocused(focused); - } else { - this.onFocus(); - } - }); - } - setFocused(focused) { - const changed = this.#focused !== focused; - if (changed) { - this.#focused = focused; - this.onFocus(); - } - } - onFocus() { - const isFocused = this.isFocused(); - this.listeners.forEach((listener) => { - listener(isFocused); - }); - } - isFocused() { - if (typeof this.#focused === "boolean") { - return this.#focused; - } - return globalThis.document?.visibilityState !== "hidden"; - } -}; -var focusManager = new FocusManager(); -export { - FocusManager, - focusManager -}; -//# sourceMappingURL=focusManager.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/focusManager.js.map b/node_modules/@tanstack/query-core/build/modern/focusManager.js.map deleted file mode 100644 index 028bb44..0000000 --- a/node_modules/@tanstack/query-core/build/modern/focusManager.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/focusManager.ts"],"sourcesContent":["import { Subscribable } from './subscribable'\nimport { isServer } from './utils'\n\ntype Listener = (focused: boolean) => void\n\ntype SetupFn = (\n setFocused: (focused?: boolean) => void,\n) => (() => void) | undefined\n\nexport class FocusManager extends Subscribable {\n #focused?: boolean\n #cleanup?: () => void\n\n #setup: SetupFn\n\n constructor() {\n super()\n this.#setup = (onFocus) => {\n // addEventListener does not exist in React Native, but window does\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n if (!isServer && window.addEventListener) {\n const listener = () => onFocus()\n // Listen to visibilitychange\n window.addEventListener('visibilitychange', listener, false)\n\n return () => {\n // Be sure to unsubscribe if a new handler is set\n window.removeEventListener('visibilitychange', listener)\n }\n }\n return\n }\n }\n\n protected onSubscribe(): void {\n if (!this.#cleanup) {\n this.setEventListener(this.#setup)\n }\n }\n\n protected onUnsubscribe() {\n if (!this.hasListeners()) {\n this.#cleanup?.()\n this.#cleanup = undefined\n }\n }\n\n setEventListener(setup: SetupFn): void {\n this.#setup = setup\n this.#cleanup?.()\n this.#cleanup = setup((focused) => {\n if (typeof focused === 'boolean') {\n this.setFocused(focused)\n } else {\n this.onFocus()\n }\n })\n }\n\n setFocused(focused?: boolean): void {\n const changed = this.#focused !== focused\n if (changed) {\n this.#focused = focused\n this.onFocus()\n }\n }\n\n onFocus(): void {\n const isFocused = this.isFocused()\n this.listeners.forEach((listener) => {\n listener(isFocused)\n })\n }\n\n isFocused(): boolean {\n if (typeof this.#focused === 'boolean') {\n return this.#focused\n }\n\n // document global can be unavailable in react native\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n return globalThis.document?.visibilityState !== 'hidden'\n }\n}\n\nexport const focusManager = new FocusManager()\n"],"mappings":";AAAA,SAAS,oBAAoB;AAC7B,SAAS,gBAAgB;AAQlB,IAAM,eAAN,cAA2B,aAAuB;AAAA,EACvD;AAAA,EACA;AAAA,EAEA;AAAA,EAEA,cAAc;AACZ,UAAM;AACN,SAAK,SAAS,CAAC,YAAY;AAGzB,UAAI,CAAC,YAAY,OAAO,kBAAkB;AACxC,cAAM,WAAW,MAAM,QAAQ;AAE/B,eAAO,iBAAiB,oBAAoB,UAAU,KAAK;AAE3D,eAAO,MAAM;AAEX,iBAAO,oBAAoB,oBAAoB,QAAQ;AAAA,QACzD;AAAA,MACF;AACA;AAAA,IACF;AAAA,EACF;AAAA,EAEU,cAAoB;AAC5B,QAAI,CAAC,KAAK,UAAU;AAClB,WAAK,iBAAiB,KAAK,MAAM;AAAA,IACnC;AAAA,EACF;AAAA,EAEU,gBAAgB;AACxB,QAAI,CAAC,KAAK,aAAa,GAAG;AACxB,WAAK,WAAW;AAChB,WAAK,WAAW;AAAA,IAClB;AAAA,EACF;AAAA,EAEA,iBAAiB,OAAsB;AACrC,SAAK,SAAS;AACd,SAAK,WAAW;AAChB,SAAK,WAAW,MAAM,CAAC,YAAY;AACjC,UAAI,OAAO,YAAY,WAAW;AAChC,aAAK,WAAW,OAAO;AAAA,MACzB,OAAO;AACL,aAAK,QAAQ;AAAA,MACf;AAAA,IACF,CAAC;AAAA,EACH;AAAA,EAEA,WAAW,SAAyB;AAClC,UAAM,UAAU,KAAK,aAAa;AAClC,QAAI,SAAS;AACX,WAAK,WAAW;AAChB,WAAK,QAAQ;AAAA,IACf;AAAA,EACF;AAAA,EAEA,UAAgB;AACd,UAAM,YAAY,KAAK,UAAU;AACjC,SAAK,UAAU,QAAQ,CAAC,aAAa;AACnC,eAAS,SAAS;AAAA,IACpB,CAAC;AAAA,EACH;AAAA,EAEA,YAAqB;AACnB,QAAI,OAAO,KAAK,aAAa,WAAW;AACtC,aAAO,KAAK;AAAA,IACd;AAIA,WAAO,WAAW,UAAU,oBAAoB;AAAA,EAClD;AACF;AAEO,IAAM,eAAe,IAAI,aAAa;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/hydration-BlEVG2Lp.d.ts b/node_modules/@tanstack/query-core/build/modern/hydration-BlEVG2Lp.d.ts deleted file mode 100644 index 8d5a8e3..0000000 --- a/node_modules/@tanstack/query-core/build/modern/hydration-BlEVG2Lp.d.ts +++ /dev/null @@ -1,1384 +0,0 @@ -import { Removable } from './removable.js'; -import { Subscribable } from './subscribable.js'; - -type QueryObserverListener = (result: QueryObserverResult) => void; -interface ObserverFetchOptions extends FetchOptions { - throwOnError?: boolean; -} -declare class QueryObserver extends Subscribable> { - #private; - options: QueryObserverOptions; - constructor(client: QueryClient, options: QueryObserverOptions); - protected bindMethods(): void; - protected onSubscribe(): void; - protected onUnsubscribe(): void; - shouldFetchOnReconnect(): boolean; - shouldFetchOnWindowFocus(): boolean; - destroy(): void; - setOptions(options: QueryObserverOptions): void; - getOptimisticResult(options: DefaultedQueryObserverOptions): QueryObserverResult; - getCurrentResult(): QueryObserverResult; - trackResult(result: QueryObserverResult, onPropTracked?: (key: keyof QueryObserverResult) => void): QueryObserverResult; - trackProp(key: keyof QueryObserverResult): void; - getCurrentQuery(): Query; - refetch({ ...options }?: RefetchOptions): Promise>; - fetchOptimistic(options: QueryObserverOptions): Promise>; - protected fetch(fetchOptions: ObserverFetchOptions): Promise>; - protected createResult(query: Query, options: QueryObserverOptions): QueryObserverResult; - updateResult(): void; - onQueryUpdate(): void; -} - -interface QueryConfig { - client: QueryClient; - queryKey: TQueryKey; - queryHash: string; - options?: QueryOptions; - defaultOptions?: QueryOptions; - state?: QueryState; -} -interface QueryState { - data: TData | undefined; - dataUpdateCount: number; - dataUpdatedAt: number; - error: TError | null; - errorUpdateCount: number; - errorUpdatedAt: number; - fetchFailureCount: number; - fetchFailureReason: TError | null; - fetchMeta: FetchMeta | null; - isInvalidated: boolean; - status: QueryStatus; - fetchStatus: FetchStatus; -} -interface FetchContext { - fetchFn: () => unknown | Promise; - fetchOptions?: FetchOptions; - signal: AbortSignal; - options: QueryOptions; - client: QueryClient; - queryKey: TQueryKey; - state: QueryState; -} -interface QueryBehavior { - onFetch: (context: FetchContext, query: Query) => void; -} -type FetchDirection = 'forward' | 'backward'; -interface FetchMeta { - fetchMore?: { - direction: FetchDirection; - }; -} -interface FetchOptions { - cancelRefetch?: boolean; - meta?: FetchMeta; - initialPromise?: Promise; -} -interface FailedAction$1 { - type: 'failed'; - failureCount: number; - error: TError; -} -interface FetchAction { - type: 'fetch'; - meta?: FetchMeta; -} -interface SuccessAction$1 { - data: TData | undefined; - type: 'success'; - dataUpdatedAt?: number; - manual?: boolean; -} -interface ErrorAction$1 { - type: 'error'; - error: TError; -} -interface InvalidateAction { - type: 'invalidate'; -} -interface PauseAction$1 { - type: 'pause'; -} -interface ContinueAction$1 { - type: 'continue'; -} -interface SetStateAction { - type: 'setState'; - state: Partial>; - setStateOptions?: SetStateOptions; -} -type Action$1 = ContinueAction$1 | ErrorAction$1 | FailedAction$1 | FetchAction | InvalidateAction | PauseAction$1 | SetStateAction | SuccessAction$1; -interface SetStateOptions { - meta?: any; -} -declare class Query extends Removable { - #private; - queryKey: TQueryKey; - queryHash: string; - options: QueryOptions; - state: QueryState; - observers: Array>; - constructor(config: QueryConfig); - get meta(): QueryMeta | undefined; - get promise(): Promise | undefined; - setOptions(options?: QueryOptions): void; - protected optionalRemove(): void; - setData(newData: TData, options?: SetDataOptions & { - manual: boolean; - }): TData; - setState(state: Partial>, setStateOptions?: SetStateOptions): void; - cancel(options?: CancelOptions): Promise; - destroy(): void; - reset(): void; - isActive(): boolean; - isDisabled(): boolean; - isStatic(): boolean; - isStale(): boolean; - isStaleByTime(staleTime?: StaleTime): boolean; - onFocus(): void; - onOnline(): void; - addObserver(observer: QueryObserver): void; - removeObserver(observer: QueryObserver): void; - getObserversCount(): number; - invalidate(): void; - fetch(options?: QueryOptions, fetchOptions?: FetchOptions): Promise; -} -declare function fetchState(data: TData | undefined, options: QueryOptions): { - readonly error?: null | undefined; - readonly status?: "pending" | undefined; - readonly fetchFailureCount: 0; - readonly fetchFailureReason: null; - readonly fetchStatus: "fetching" | "paused"; -}; - -type MutationObserverListener = (result: MutationObserverResult) => void; -declare class MutationObserver extends Subscribable> { - #private; - options: MutationObserverOptions; - constructor(client: QueryClient, options: MutationObserverOptions); - protected bindMethods(): void; - setOptions(options: MutationObserverOptions): void; - protected onUnsubscribe(): void; - onMutationUpdate(action: Action): void; - getCurrentResult(): MutationObserverResult; - reset(): void; - mutate(variables: TVariables, options?: MutateOptions): Promise; -} - -interface MutationCacheConfig { - onError?: (error: DefaultError, variables: unknown, onMutateResult: unknown, mutation: Mutation, context: MutationFunctionContext) => Promise | unknown; - onSuccess?: (data: unknown, variables: unknown, onMutateResult: unknown, mutation: Mutation, context: MutationFunctionContext) => Promise | unknown; - onMutate?: (variables: unknown, mutation: Mutation, context: MutationFunctionContext) => Promise | unknown; - onSettled?: (data: unknown | undefined, error: DefaultError | null, variables: unknown, onMutateResult: unknown, mutation: Mutation, context: MutationFunctionContext) => Promise | unknown; -} -interface NotifyEventMutationAdded extends NotifyEvent { - type: 'added'; - mutation: Mutation; -} -interface NotifyEventMutationRemoved extends NotifyEvent { - type: 'removed'; - mutation: Mutation; -} -interface NotifyEventMutationObserverAdded extends NotifyEvent { - type: 'observerAdded'; - mutation: Mutation; - observer: MutationObserver; -} -interface NotifyEventMutationObserverRemoved extends NotifyEvent { - type: 'observerRemoved'; - mutation: Mutation; - observer: MutationObserver; -} -interface NotifyEventMutationObserverOptionsUpdated extends NotifyEvent { - type: 'observerOptionsUpdated'; - mutation?: Mutation; - observer: MutationObserver; -} -interface NotifyEventMutationUpdated extends NotifyEvent { - type: 'updated'; - mutation: Mutation; - action: Action; -} -type MutationCacheNotifyEvent = NotifyEventMutationAdded | NotifyEventMutationRemoved | NotifyEventMutationObserverAdded | NotifyEventMutationObserverRemoved | NotifyEventMutationObserverOptionsUpdated | NotifyEventMutationUpdated; -type MutationCacheListener = (event: MutationCacheNotifyEvent) => void; -declare class MutationCache extends Subscribable { - #private; - config: MutationCacheConfig; - constructor(config?: MutationCacheConfig); - build(client: QueryClient, options: MutationOptions, state?: MutationState): Mutation; - add(mutation: Mutation): void; - remove(mutation: Mutation): void; - canRun(mutation: Mutation): boolean; - runNext(mutation: Mutation): Promise; - clear(): void; - getAll(): Array; - find(filters: MutationFilters): Mutation | undefined; - findAll(filters?: MutationFilters): Array; - notify(event: MutationCacheNotifyEvent): void; - resumePausedMutations(): Promise; -} - -interface MutationConfig { - client: QueryClient; - mutationId: number; - mutationCache: MutationCache; - options: MutationOptions; - state?: MutationState; -} -interface MutationState { - context: TOnMutateResult | undefined; - data: TData | undefined; - error: TError | null; - failureCount: number; - failureReason: TError | null; - isPaused: boolean; - status: MutationStatus; - variables: TVariables | undefined; - submittedAt: number; -} -interface FailedAction { - type: 'failed'; - failureCount: number; - error: TError | null; -} -interface PendingAction { - type: 'pending'; - isPaused: boolean; - variables?: TVariables; - context?: TOnMutateResult; -} -interface SuccessAction { - type: 'success'; - data: TData; -} -interface ErrorAction { - type: 'error'; - error: TError; -} -interface PauseAction { - type: 'pause'; -} -interface ContinueAction { - type: 'continue'; -} -type Action = ContinueAction | ErrorAction | FailedAction | PendingAction | PauseAction | SuccessAction; -declare class Mutation extends Removable { - #private; - state: MutationState; - options: MutationOptions; - readonly mutationId: number; - constructor(config: MutationConfig); - setOptions(options: MutationOptions): void; - get meta(): MutationMeta | undefined; - addObserver(observer: MutationObserver): void; - removeObserver(observer: MutationObserver): void; - protected optionalRemove(): void; - continue(): Promise; - execute(variables: TVariables): Promise; -} -declare function getDefaultState(): MutationState; - -type DropLast> = T extends readonly [ - ...infer R, - unknown -] ? readonly [...R] : never; -type TuplePrefixes> = T extends readonly [] ? readonly [] : TuplePrefixes> | T; -interface QueryFilters { - /** - * Filter to active queries, inactive queries or all queries - */ - type?: QueryTypeFilter; - /** - * Match query key exactly - */ - exact?: boolean; - /** - * Include queries matching this predicate function - */ - predicate?: (query: Query) => boolean; - /** - * Include queries matching this query key - */ - queryKey?: TQueryKey | TuplePrefixes; - /** - * Include or exclude stale queries - */ - stale?: boolean; - /** - * Include queries matching their fetchStatus - */ - fetchStatus?: FetchStatus; -} -interface MutationFilters { - /** - * Match mutation key exactly - */ - exact?: boolean; - /** - * Include mutations matching this predicate function - */ - predicate?: (mutation: Mutation) => boolean; - /** - * Include mutations matching this mutation key - */ - mutationKey?: TuplePrefixes; - /** - * Filter by mutation status - */ - status?: MutationStatus; -} -type Updater = TOutput | ((input: TInput) => TOutput); -type QueryTypeFilter = 'all' | 'active' | 'inactive'; -declare const isServer: boolean; -declare function noop(): void; -declare function noop(): undefined; -declare function functionalUpdate(updater: Updater, input: TInput): TOutput; -declare function isValidTimeout(value: unknown): value is number; -declare function timeUntilStale(updatedAt: number, staleTime?: number): number; -declare function resolveStaleTime(staleTime: undefined | StaleTimeFunction, query: Query): StaleTime | undefined; -declare function resolveEnabled(enabled: undefined | Enabled, query: Query): boolean | undefined; -declare function matchQuery(filters: QueryFilters, query: Query): boolean; -declare function matchMutation(filters: MutationFilters, mutation: Mutation): boolean; -declare function hashQueryKeyByOptions(queryKey: TQueryKey, options?: Pick, 'queryKeyHashFn'>): string; -/** - * Default query & mutation keys hash function. - * Hashes the value into a stable hash. - */ -declare function hashKey(queryKey: QueryKey | MutationKey): string; -/** - * Checks if key `b` partially matches with key `a`. - */ -declare function partialMatchKey(a: QueryKey, b: QueryKey): boolean; -/** - * This function returns `a` if `b` is deeply equal. - * If not, it will replace any deeply equal children of `b` with those of `a`. - * This can be used for structural sharing between JSON values for example. - */ -declare function replaceEqualDeep(a: unknown, b: T, depth?: number): T; -/** - * Shallow compare objects. - */ -declare function shallowEqualObjects>(a: T, b: T | undefined): boolean; -declare function isPlainArray(value: unknown): value is Array; -declare function isPlainObject(o: any): o is Record; -declare function sleep(timeout: number): Promise; -declare function replaceData>(prevData: TData | undefined, data: TData, options: TOptions): TData; -declare function keepPreviousData(previousData: T | undefined): T | undefined; -declare function addToEnd(items: Array, item: T, max?: number): Array; -declare function addToStart(items: Array, item: T, max?: number): Array; -declare const skipToken: unique symbol; -type SkipToken = typeof skipToken; -declare function ensureQueryFn(options: { - queryFn?: QueryFunction | SkipToken; - queryHash?: string; -}, fetchOptions?: FetchOptions): QueryFunction; -declare function shouldThrowError) => boolean>(throwOnError: boolean | T | undefined, params: Parameters): boolean; -declare function addConsumeAwareSignal(object: T, getSignal: () => AbortSignal, onCancelled: VoidFunction): T & { - signal: AbortSignal; -}; - -interface QueryCacheConfig { - onError?: (error: DefaultError, query: Query) => void; - onSuccess?: (data: unknown, query: Query) => void; - onSettled?: (data: unknown | undefined, error: DefaultError | null, query: Query) => void; -} -interface NotifyEventQueryAdded extends NotifyEvent { - type: 'added'; - query: Query; -} -interface NotifyEventQueryRemoved extends NotifyEvent { - type: 'removed'; - query: Query; -} -interface NotifyEventQueryUpdated extends NotifyEvent { - type: 'updated'; - query: Query; - action: Action$1; -} -interface NotifyEventQueryObserverAdded extends NotifyEvent { - type: 'observerAdded'; - query: Query; - observer: QueryObserver; -} -interface NotifyEventQueryObserverRemoved extends NotifyEvent { - type: 'observerRemoved'; - query: Query; - observer: QueryObserver; -} -interface NotifyEventQueryObserverResultsUpdated extends NotifyEvent { - type: 'observerResultsUpdated'; - query: Query; -} -interface NotifyEventQueryObserverOptionsUpdated extends NotifyEvent { - type: 'observerOptionsUpdated'; - query: Query; - observer: QueryObserver; -} -type QueryCacheNotifyEvent = NotifyEventQueryAdded | NotifyEventQueryRemoved | NotifyEventQueryUpdated | NotifyEventQueryObserverAdded | NotifyEventQueryObserverRemoved | NotifyEventQueryObserverResultsUpdated | NotifyEventQueryObserverOptionsUpdated; -type QueryCacheListener = (event: QueryCacheNotifyEvent) => void; -interface QueryStore { - has: (queryHash: string) => boolean; - set: (queryHash: string, query: Query) => void; - get: (queryHash: string) => Query | undefined; - delete: (queryHash: string) => void; - values: () => IterableIterator; -} -declare class QueryCache extends Subscribable { - #private; - config: QueryCacheConfig; - constructor(config?: QueryCacheConfig); - build(client: QueryClient, options: WithRequired, 'queryKey'>, state?: QueryState): Query; - add(query: Query): void; - remove(query: Query): void; - clear(): void; - get(queryHash: string): Query | undefined; - getAll(): Array; - find(filters: WithRequired): Query | undefined; - findAll(filters?: QueryFilters): Array; - notify(event: QueryCacheNotifyEvent): void; - onFocus(): void; - onOnline(): void; -} - -declare class QueryClient { - #private; - constructor(config?: QueryClientConfig); - mount(): void; - unmount(): void; - isFetching = QueryFilters>(filters?: TQueryFilters): number; - isMutating = MutationFilters>(filters?: TMutationFilters): number; - /** - * Imperative (non-reactive) way to retrieve data for a QueryKey. - * Should only be used in callbacks or functions where reading the latest data is necessary, e.g. for optimistic updates. - * - * Hint: Do not use this function inside a component, because it won't receive updates. - * Use `useQuery` to create a `QueryObserver` that subscribes to changes. - */ - getQueryData>(queryKey: TTaggedQueryKey): TInferredQueryFnData | undefined; - ensureQueryData(options: EnsureQueryDataOptions): Promise; - getQueriesData = QueryFilters>(filters: TQueryFilters): Array<[QueryKey, TQueryFnData | undefined]>; - setQueryData>(queryKey: TTaggedQueryKey, updater: Updater | undefined, NoInfer | undefined>, options?: SetDataOptions): NoInfer | undefined; - setQueriesData = QueryFilters>(filters: TQueryFilters, updater: Updater | undefined, NoInfer | undefined>, options?: SetDataOptions): Array<[QueryKey, TQueryFnData | undefined]>; - getQueryState, TInferredError = InferErrorFromTag>(queryKey: TTaggedQueryKey): QueryState | undefined; - removeQueries(filters?: QueryFilters): void; - resetQueries(filters?: QueryFilters, options?: ResetOptions): Promise; - cancelQueries(filters?: QueryFilters, cancelOptions?: CancelOptions): Promise; - invalidateQueries(filters?: InvalidateQueryFilters, options?: InvalidateOptions): Promise; - refetchQueries(filters?: RefetchQueryFilters, options?: RefetchOptions): Promise; - fetchQuery(options: FetchQueryOptions): Promise; - prefetchQuery(options: FetchQueryOptions): Promise; - fetchInfiniteQuery(options: FetchInfiniteQueryOptions): Promise>; - prefetchInfiniteQuery(options: FetchInfiniteQueryOptions): Promise; - ensureInfiniteQueryData(options: EnsureInfiniteQueryDataOptions): Promise>; - resumePausedMutations(): Promise; - getQueryCache(): QueryCache; - getMutationCache(): MutationCache; - getDefaultOptions(): DefaultOptions; - setDefaultOptions(options: DefaultOptions): void; - setQueryDefaults(queryKey: QueryKey, options: Partial, 'queryKey'>>): void; - getQueryDefaults(queryKey: QueryKey): OmitKeyof, 'queryKey'>; - setMutationDefaults(mutationKey: MutationKey, options: OmitKeyof, 'mutationKey'>): void; - getMutationDefaults(mutationKey: MutationKey): OmitKeyof, 'mutationKey'>; - defaultQueryOptions(options: QueryObserverOptions | DefaultedQueryObserverOptions): DefaultedQueryObserverOptions; - defaultMutationOptions>(options?: T): T; - clear(): void; -} - -interface RetryerConfig { - fn: () => TData | Promise; - initialPromise?: Promise; - onCancel?: (error: TError) => void; - onFail?: (failureCount: number, error: TError) => void; - onPause?: () => void; - onContinue?: () => void; - retry?: RetryValue; - retryDelay?: RetryDelayValue; - networkMode: NetworkMode | undefined; - canRun: () => boolean; -} -interface Retryer { - promise: Promise; - cancel: (cancelOptions?: CancelOptions) => void; - continue: () => Promise; - cancelRetry: () => void; - continueRetry: () => void; - canStart: () => boolean; - start: () => Promise; - status: () => 'pending' | 'resolved' | 'rejected'; -} -type RetryValue = boolean | number | ShouldRetryFunction; -type ShouldRetryFunction = (failureCount: number, error: TError) => boolean; -type RetryDelayValue = number | RetryDelayFunction; -type RetryDelayFunction = (failureCount: number, error: TError) => number; -declare function canFetch(networkMode: NetworkMode | undefined): boolean; -declare class CancelledError extends Error { - revert?: boolean; - silent?: boolean; - constructor(options?: CancelOptions); -} -/** - * @deprecated Use instanceof `CancelledError` instead. - */ -declare function isCancelledError(value: any): value is CancelledError; -declare function createRetryer(config: RetryerConfig): Retryer; - -type NonUndefinedGuard = T extends undefined ? never : T; -type DistributiveOmit = TObject extends any ? Omit : never; -type OmitKeyof) | (number & Record) | (symbol & Record) : keyof TObject, TStrictly extends 'strictly' | 'safely' = 'strictly'> = Omit; -type Override = { - [AKey in keyof TTargetA]: AKey extends keyof TTargetB ? TTargetB[AKey] : TTargetA[AKey]; -}; -type NoInfer = [T][T extends any ? 0 : never]; -interface Register { -} -type DefaultError = Register extends { - defaultError: infer TError; -} ? TError : Error; -type QueryKey = Register extends { - queryKey: infer TQueryKey; -} ? TQueryKey extends ReadonlyArray ? TQueryKey : TQueryKey extends Array ? TQueryKey : ReadonlyArray : ReadonlyArray; -declare const dataTagSymbol: unique symbol; -type dataTagSymbol = typeof dataTagSymbol; -declare const dataTagErrorSymbol: unique symbol; -type dataTagErrorSymbol = typeof dataTagErrorSymbol; -declare const unsetMarker: unique symbol; -type UnsetMarker = typeof unsetMarker; -type AnyDataTag = { - [dataTagSymbol]: any; - [dataTagErrorSymbol]: any; -}; -type DataTag = TType extends AnyDataTag ? TType : TType & { - [dataTagSymbol]: TValue; - [dataTagErrorSymbol]: TError; -}; -type InferDataFromTag = TTaggedQueryKey extends DataTag ? TaggedValue : TQueryFnData; -type InferErrorFromTag = TTaggedQueryKey extends DataTag ? TaggedError extends UnsetMarker ? TError : TaggedError : TError; -type QueryFunction = (context: QueryFunctionContext) => T | Promise; -type StaleTime = number | 'static'; -type StaleTimeFunction = StaleTime | ((query: Query) => StaleTime); -type Enabled = boolean | ((query: Query) => boolean); -type QueryPersister = [TPageParam] extends [never] ? (queryFn: QueryFunction, context: QueryFunctionContext, query: Query) => T | Promise : (queryFn: QueryFunction, context: QueryFunctionContext, query: Query) => T | Promise; -type QueryFunctionContext = [TPageParam] extends [never] ? { - client: QueryClient; - queryKey: TQueryKey; - signal: AbortSignal; - meta: QueryMeta | undefined; - pageParam?: unknown; - /** - * @deprecated - * if you want access to the direction, you can add it to the pageParam - */ - direction?: unknown; -} : { - client: QueryClient; - queryKey: TQueryKey; - signal: AbortSignal; - pageParam: TPageParam; - /** - * @deprecated - * if you want access to the direction, you can add it to the pageParam - */ - direction: FetchDirection; - meta: QueryMeta | undefined; -}; -type InitialDataFunction = () => T | undefined; -type NonFunctionGuard = T extends Function ? never : T; -type PlaceholderDataFunction = (previousData: TQueryData | undefined, previousQuery: Query | undefined) => TQueryData | undefined; -type QueriesPlaceholderDataFunction = (previousData: undefined, previousQuery: undefined) => TQueryData | undefined; -type QueryKeyHashFunction = (queryKey: TQueryKey) => string; -type GetPreviousPageParamFunction = (firstPage: TQueryFnData, allPages: Array, firstPageParam: TPageParam, allPageParams: Array) => TPageParam | undefined | null; -type GetNextPageParamFunction = (lastPage: TQueryFnData, allPages: Array, lastPageParam: TPageParam, allPageParams: Array) => TPageParam | undefined | null; -interface InfiniteData { - pages: Array; - pageParams: Array; -} -type QueryMeta = Register extends { - queryMeta: infer TQueryMeta; -} ? TQueryMeta extends Record ? TQueryMeta : Record : Record; -type NetworkMode = 'online' | 'always' | 'offlineFirst'; -type NotifyOnChangeProps = Array | 'all' | undefined | (() => Array | 'all' | undefined); -interface QueryOptions { - /** - * If `false`, failed queries will not retry by default. - * If `true`, failed queries will retry infinitely., failureCount: num - * If set to an integer number, e.g. 3, failed queries will retry until the failed query count meets that number. - * If set to a function `(failureCount, error) => boolean` failed queries will retry until the function returns false. - */ - retry?: RetryValue; - retryDelay?: RetryDelayValue; - networkMode?: NetworkMode; - /** - * The time in milliseconds that unused/inactive cache data remains in memory. - * When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration. - * When different garbage collection times are specified, the longest one will be used. - * Setting it to `Infinity` will disable garbage collection. - */ - gcTime?: number; - queryFn?: QueryFunction | SkipToken; - persister?: QueryPersister, NoInfer, NoInfer>; - queryHash?: string; - queryKey?: TQueryKey; - queryKeyHashFn?: QueryKeyHashFunction; - initialData?: TData | InitialDataFunction; - initialDataUpdatedAt?: number | (() => number | undefined); - behavior?: QueryBehavior; - /** - * Set this to `false` to disable structural sharing between query results. - * Set this to a function which accepts the old and new data and returns resolved data of the same type to implement custom structural sharing logic. - * Defaults to `true`. - */ - structuralSharing?: boolean | ((oldData: unknown | undefined, newData: unknown) => unknown); - _defaulted?: boolean; - /** - * Additional payload to be stored on each query. - * Use this property to pass information that can be used in other places. - */ - meta?: QueryMeta; - /** - * Maximum number of pages to store in the data of an infinite query. - */ - maxPages?: number; -} -interface InitialPageParam { - initialPageParam: TPageParam; -} -interface InfiniteQueryPageParamsOptions extends InitialPageParam { - /** - * This function can be set to automatically get the previous cursor for infinite queries. - * The result will also be used to determine the value of `hasPreviousPage`. - */ - getPreviousPageParam?: GetPreviousPageParamFunction; - /** - * This function can be set to automatically get the next cursor for infinite queries. - * The result will also be used to determine the value of `hasNextPage`. - */ - getNextPageParam: GetNextPageParamFunction; -} -type ThrowOnError = boolean | ((error: TError, query: Query) => boolean); -interface QueryObserverOptions extends WithRequired, 'queryKey'> { - /** - * Set this to `false` or a function that returns `false` to disable automatic refetching when the query mounts or changes query keys. - * To refetch the query, use the `refetch` method returned from the `useQuery` instance. - * Accepts a boolean or function that returns a boolean. - * Defaults to `true`. - */ - enabled?: Enabled; - /** - * The time in milliseconds after data is considered stale. - * If set to `Infinity`, the data will never be considered stale. - * If set to a function, the function will be executed with the query to compute a `staleTime`. - * Defaults to `0`. - */ - staleTime?: StaleTimeFunction; - /** - * If set to a number, the query will continuously refetch at this frequency in milliseconds. - * If set to a function, the function will be executed with the latest data and query to compute a frequency - * Defaults to `false`. - */ - refetchInterval?: number | false | ((query: Query) => number | false | undefined); - /** - * If set to `true`, the query will continue to refetch while their tab/window is in the background. - * Defaults to `false`. - */ - refetchIntervalInBackground?: boolean; - /** - * If set to `true`, the query will refetch on window focus if the data is stale. - * If set to `false`, the query will not refetch on window focus. - * If set to `'always'`, the query will always refetch on window focus. - * If set to a function, the function will be executed with the latest data and query to compute the value. - * Defaults to `true`. - */ - refetchOnWindowFocus?: boolean | 'always' | ((query: Query) => boolean | 'always'); - /** - * If set to `true`, the query will refetch on reconnect if the data is stale. - * If set to `false`, the query will not refetch on reconnect. - * If set to `'always'`, the query will always refetch on reconnect. - * If set to a function, the function will be executed with the latest data and query to compute the value. - * Defaults to the value of `networkOnline` (`true`) - */ - refetchOnReconnect?: boolean | 'always' | ((query: Query) => boolean | 'always'); - /** - * If set to `true`, the query will refetch on mount if the data is stale. - * If set to `false`, will disable additional instances of a query to trigger background refetch. - * If set to `'always'`, the query will always refetch on mount. - * If set to a function, the function will be executed with the latest data and query to compute the value - * Defaults to `true`. - */ - refetchOnMount?: boolean | 'always' | ((query: Query) => boolean | 'always'); - /** - * If set to `false`, the query will not be retried on mount if it contains an error. - * Defaults to `true`. - */ - retryOnMount?: boolean; - /** - * If set, the component will only re-render if any of the listed properties change. - * When set to `['data', 'error']`, the component will only re-render when the `data` or `error` properties change. - * When set to `'all'`, the component will re-render whenever a query is updated. - * When set to a function, the function will be executed to compute the list of properties. - * By default, access to properties will be tracked, and the component will only re-render when one of the tracked properties change. - */ - notifyOnChangeProps?: NotifyOnChangeProps; - /** - * Whether errors should be thrown instead of setting the `error` property. - * If set to `true` or `suspense` is `true`, all errors will be thrown to the error boundary. - * If set to `false` and `suspense` is `false`, errors are returned as state. - * If set to a function, it will be passed the error and the query, and it should return a boolean indicating whether to show the error in an error boundary (`true`) or return the error as state (`false`). - * Defaults to `false`. - */ - throwOnError?: ThrowOnError; - /** - * This option can be used to transform or select a part of the data returned by the query function. - */ - select?: (data: TQueryData) => TData; - /** - * If set to `true`, the query will suspend when `status === 'pending'` - * and throw errors when `status === 'error'`. - * Defaults to `false`. - */ - suspense?: boolean; - /** - * If set, this value will be used as the placeholder data for this particular query observer while the query is still in the `loading` data and no initialData has been provided. - */ - placeholderData?: NonFunctionGuard | PlaceholderDataFunction, TError, NonFunctionGuard, TQueryKey>; - _optimisticResults?: 'optimistic' | 'isRestoring'; - /** - * Enable prefetching during rendering - */ - experimental_prefetchInRender?: boolean; -} -type WithRequired = TTarget & { - [_ in TKey]: {}; -}; -type DefaultedQueryObserverOptions = WithRequired, 'throwOnError' | 'refetchOnReconnect' | 'queryHash'>; -interface InfiniteQueryObserverOptions extends QueryObserverOptions, TQueryKey, TPageParam>, InfiniteQueryPageParamsOptions { -} -type DefaultedInfiniteQueryObserverOptions = WithRequired, 'throwOnError' | 'refetchOnReconnect' | 'queryHash'>; -interface FetchQueryOptions extends WithRequired, 'queryKey'> { - initialPageParam?: never; - /** - * The time in milliseconds after data is considered stale. - * If the data is fresh it will be returned from the cache. - */ - staleTime?: StaleTimeFunction; -} -interface EnsureQueryDataOptions extends FetchQueryOptions { - revalidateIfStale?: boolean; -} -type EnsureInfiniteQueryDataOptions = FetchInfiniteQueryOptions & { - revalidateIfStale?: boolean; -}; -type FetchInfiniteQueryPages = { - pages?: never; -} | { - pages: number; - getNextPageParam: GetNextPageParamFunction; -}; -type FetchInfiniteQueryOptions = Omit, TQueryKey, TPageParam>, 'initialPageParam'> & InitialPageParam & FetchInfiniteQueryPages; -interface ResultOptions { - throwOnError?: boolean; -} -interface RefetchOptions extends ResultOptions { - /** - * If set to `true`, a currently running request will be cancelled before a new request is made - * - * If set to `false`, no refetch will be made if there is already a request running. - * - * Defaults to `true`. - */ - cancelRefetch?: boolean; -} -interface InvalidateQueryFilters extends QueryFilters { - refetchType?: QueryTypeFilter | 'none'; -} -interface RefetchQueryFilters extends QueryFilters { -} -interface InvalidateOptions extends RefetchOptions { -} -interface ResetOptions extends RefetchOptions { -} -interface FetchNextPageOptions extends ResultOptions { - /** - * If set to `true`, calling `fetchNextPage` repeatedly will invoke `queryFn` every time, - * whether the previous invocation has resolved or not. Also, the result from previous invocations will be ignored. - * - * If set to `false`, calling `fetchNextPage` repeatedly won't have any effect until the first invocation has resolved. - * - * Defaults to `true`. - */ - cancelRefetch?: boolean; -} -interface FetchPreviousPageOptions extends ResultOptions { - /** - * If set to `true`, calling `fetchPreviousPage` repeatedly will invoke `queryFn` every time, - * whether the previous invocation has resolved or not. Also, the result from previous invocations will be ignored. - * - * If set to `false`, calling `fetchPreviousPage` repeatedly won't have any effect until the first invocation has resolved. - * - * Defaults to `true`. - */ - cancelRefetch?: boolean; -} -type QueryStatus = 'pending' | 'error' | 'success'; -type FetchStatus = 'fetching' | 'paused' | 'idle'; -interface QueryObserverBaseResult { - /** - * The last successfully resolved data for the query. - */ - data: TData | undefined; - /** - * The timestamp for when the query most recently returned the `status` as `"success"`. - */ - dataUpdatedAt: number; - /** - * The error object for the query, if an error was thrown. - * - Defaults to `null`. - */ - error: TError | null; - /** - * The timestamp for when the query most recently returned the `status` as `"error"`. - */ - errorUpdatedAt: number; - /** - * The failure count for the query. - * - Incremented every time the query fails. - * - Reset to `0` when the query succeeds. - */ - failureCount: number; - /** - * The failure reason for the query retry. - * - Reset to `null` when the query succeeds. - */ - failureReason: TError | null; - /** - * The sum of all errors. - */ - errorUpdateCount: number; - /** - * A derived boolean from the `status` variable, provided for convenience. - * - `true` if the query attempt resulted in an error. - */ - isError: boolean; - /** - * Will be `true` if the query has been fetched. - */ - isFetched: boolean; - /** - * Will be `true` if the query has been fetched after the component mounted. - * - This property can be used to not show any previously cached data. - */ - isFetchedAfterMount: boolean; - /** - * A derived boolean from the `fetchStatus` variable, provided for convenience. - * - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. - */ - isFetching: boolean; - /** - * Is `true` whenever the first fetch for a query is in-flight. - * - Is the same as `isFetching && isPending`. - */ - isLoading: boolean; - /** - * Will be `pending` if there's no cached data and no query attempt was finished yet. - */ - isPending: boolean; - /** - * Will be `true` if the query failed while fetching for the first time. - */ - isLoadingError: boolean; - /** - * @deprecated `isInitialLoading` is being deprecated in favor of `isLoading` - * and will be removed in the next major version. - */ - isInitialLoading: boolean; - /** - * A derived boolean from the `fetchStatus` variable, provided for convenience. - * - The query wanted to fetch, but has been `paused`. - */ - isPaused: boolean; - /** - * Will be `true` if the data shown is the placeholder data. - */ - isPlaceholderData: boolean; - /** - * Will be `true` if the query failed while refetching. - */ - isRefetchError: boolean; - /** - * Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - * - Is the same as `isFetching && !isPending`. - */ - isRefetching: boolean; - /** - * Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. - */ - isStale: boolean; - /** - * A derived boolean from the `status` variable, provided for convenience. - * - `true` if the query has received a response with no errors and is ready to display its data. - */ - isSuccess: boolean; - /** - * `true` if this observer is enabled, `false` otherwise. - */ - isEnabled: boolean; - /** - * A function to manually refetch the query. - */ - refetch: (options?: RefetchOptions) => Promise>; - /** - * The status of the query. - * - Will be: - * - `pending` if there's no cached data and no query attempt was finished yet. - * - `error` if the query attempt resulted in an error. - * - `success` if the query has received a response with no errors and is ready to display its data. - */ - status: QueryStatus; - /** - * The fetch status of the query. - * - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. - * - `paused`: The query wanted to fetch, but has been `paused`. - * - `idle`: The query is not fetching. - * - See [Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information. - */ - fetchStatus: FetchStatus; - /** - * A stable promise that will be resolved with the data of the query. - * Requires the `experimental_prefetchInRender` feature flag to be enabled. - * @example - * - * ### Enabling the feature flag - * ```ts - * const client = new QueryClient({ - * defaultOptions: { - * queries: { - * experimental_prefetchInRender: true, - * }, - * }, - * }) - * ``` - * - * ### Usage - * ```tsx - * import { useQuery } from '@tanstack/react-query' - * import React from 'react' - * import { fetchTodos, type Todo } from './api' - * - * function TodoList({ query }: { query: UseQueryResult }) { - * const data = React.use(query.promise) - * - * return ( - *
    - * {data.map(todo => ( - *
  • {todo.title}
  • - * ))} - *
- * ) - * } - * - * export function App() { - * const query = useQuery({ queryKey: ['todos'], queryFn: fetchTodos }) - * - * return ( - * <> - *

Todos

- * Loading...}> - * - * - * - * ) - * } - * ``` - */ - promise: Promise; -} -interface QueryObserverPendingResult extends QueryObserverBaseResult { - data: undefined; - error: null; - isError: false; - isPending: true; - isLoadingError: false; - isRefetchError: false; - isSuccess: false; - isPlaceholderData: false; - status: 'pending'; -} -interface QueryObserverLoadingResult extends QueryObserverBaseResult { - data: undefined; - error: null; - isError: false; - isPending: true; - isLoading: true; - isLoadingError: false; - isRefetchError: false; - isSuccess: false; - isPlaceholderData: false; - status: 'pending'; -} -interface QueryObserverLoadingErrorResult extends QueryObserverBaseResult { - data: undefined; - error: TError; - isError: true; - isPending: false; - isLoading: false; - isLoadingError: true; - isRefetchError: false; - isSuccess: false; - isPlaceholderData: false; - status: 'error'; -} -interface QueryObserverRefetchErrorResult extends QueryObserverBaseResult { - data: TData; - error: TError; - isError: true; - isPending: false; - isLoading: false; - isLoadingError: false; - isRefetchError: true; - isSuccess: false; - isPlaceholderData: false; - status: 'error'; -} -interface QueryObserverSuccessResult extends QueryObserverBaseResult { - data: TData; - error: null; - isError: false; - isPending: false; - isLoading: false; - isLoadingError: false; - isRefetchError: false; - isSuccess: true; - isPlaceholderData: false; - status: 'success'; -} -interface QueryObserverPlaceholderResult extends QueryObserverBaseResult { - data: TData; - isError: false; - error: null; - isPending: false; - isLoading: false; - isLoadingError: false; - isRefetchError: false; - isSuccess: true; - isPlaceholderData: true; - status: 'success'; -} -type DefinedQueryObserverResult = QueryObserverRefetchErrorResult | QueryObserverSuccessResult; -type QueryObserverResult = DefinedQueryObserverResult | QueryObserverLoadingErrorResult | QueryObserverLoadingResult | QueryObserverPendingResult | QueryObserverPlaceholderResult; -interface InfiniteQueryObserverBaseResult extends QueryObserverBaseResult { - /** - * This function allows you to fetch the next "page" of results. - */ - fetchNextPage: (options?: FetchNextPageOptions) => Promise>; - /** - * This function allows you to fetch the previous "page" of results. - */ - fetchPreviousPage: (options?: FetchPreviousPageOptions) => Promise>; - /** - * Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). - */ - hasNextPage: boolean; - /** - * Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). - */ - hasPreviousPage: boolean; - /** - * Will be `true` if the query failed while fetching the next page. - */ - isFetchNextPageError: boolean; - /** - * Will be `true` while fetching the next page with `fetchNextPage`. - */ - isFetchingNextPage: boolean; - /** - * Will be `true` if the query failed while fetching the previous page. - */ - isFetchPreviousPageError: boolean; - /** - * Will be `true` while fetching the previous page with `fetchPreviousPage`. - */ - isFetchingPreviousPage: boolean; -} -interface InfiniteQueryObserverPendingResult extends InfiniteQueryObserverBaseResult { - data: undefined; - error: null; - isError: false; - isPending: true; - isLoadingError: false; - isRefetchError: false; - isFetchNextPageError: false; - isFetchPreviousPageError: false; - isSuccess: false; - isPlaceholderData: false; - status: 'pending'; -} -interface InfiniteQueryObserverLoadingResult extends InfiniteQueryObserverBaseResult { - data: undefined; - error: null; - isError: false; - isPending: true; - isLoading: true; - isLoadingError: false; - isRefetchError: false; - isFetchNextPageError: false; - isFetchPreviousPageError: false; - isSuccess: false; - isPlaceholderData: false; - status: 'pending'; -} -interface InfiniteQueryObserverLoadingErrorResult extends InfiniteQueryObserverBaseResult { - data: undefined; - error: TError; - isError: true; - isPending: false; - isLoading: false; - isLoadingError: true; - isRefetchError: false; - isFetchNextPageError: false; - isFetchPreviousPageError: false; - isSuccess: false; - isPlaceholderData: false; - status: 'error'; -} -interface InfiniteQueryObserverRefetchErrorResult extends InfiniteQueryObserverBaseResult { - data: TData; - error: TError; - isError: true; - isPending: false; - isLoading: false; - isLoadingError: false; - isRefetchError: true; - isSuccess: false; - isPlaceholderData: false; - status: 'error'; -} -interface InfiniteQueryObserverSuccessResult extends InfiniteQueryObserverBaseResult { - data: TData; - error: null; - isError: false; - isPending: false; - isLoading: false; - isLoadingError: false; - isRefetchError: false; - isFetchNextPageError: false; - isFetchPreviousPageError: false; - isSuccess: true; - isPlaceholderData: false; - status: 'success'; -} -interface InfiniteQueryObserverPlaceholderResult extends InfiniteQueryObserverBaseResult { - data: TData; - isError: false; - error: null; - isPending: false; - isLoading: false; - isLoadingError: false; - isRefetchError: false; - isSuccess: true; - isPlaceholderData: true; - isFetchNextPageError: false; - isFetchPreviousPageError: false; - status: 'success'; -} -type DefinedInfiniteQueryObserverResult = InfiniteQueryObserverRefetchErrorResult | InfiniteQueryObserverSuccessResult; -type InfiniteQueryObserverResult = DefinedInfiniteQueryObserverResult | InfiniteQueryObserverLoadingErrorResult | InfiniteQueryObserverLoadingResult | InfiniteQueryObserverPendingResult | InfiniteQueryObserverPlaceholderResult; -type MutationKey = Register extends { - mutationKey: infer TMutationKey; -} ? TMutationKey extends ReadonlyArray ? TMutationKey : TMutationKey extends Array ? TMutationKey : ReadonlyArray : ReadonlyArray; -type MutationStatus = 'idle' | 'pending' | 'success' | 'error'; -type MutationScope = { - id: string; -}; -type MutationMeta = Register extends { - mutationMeta: infer TMutationMeta; -} ? TMutationMeta extends Record ? TMutationMeta : Record : Record; -type MutationFunctionContext = { - client: QueryClient; - meta: MutationMeta | undefined; - mutationKey?: MutationKey; -}; -type MutationFunction = (variables: TVariables, context: MutationFunctionContext) => Promise; -interface MutationOptions { - mutationFn?: MutationFunction; - mutationKey?: MutationKey; - onMutate?: (variables: TVariables, context: MutationFunctionContext) => Promise | TOnMutateResult; - onSuccess?: (data: TData, variables: TVariables, onMutateResult: TOnMutateResult, context: MutationFunctionContext) => Promise | unknown; - onError?: (error: TError, variables: TVariables, onMutateResult: TOnMutateResult | undefined, context: MutationFunctionContext) => Promise | unknown; - onSettled?: (data: TData | undefined, error: TError | null, variables: TVariables, onMutateResult: TOnMutateResult | undefined, context: MutationFunctionContext) => Promise | unknown; - retry?: RetryValue; - retryDelay?: RetryDelayValue; - networkMode?: NetworkMode; - gcTime?: number; - _defaulted?: boolean; - meta?: MutationMeta; - scope?: MutationScope; -} -interface MutationObserverOptions extends MutationOptions { - throwOnError?: boolean | ((error: TError) => boolean); -} -interface MutateOptions { - onSuccess?: (data: TData, variables: TVariables, onMutateResult: TOnMutateResult | undefined, context: MutationFunctionContext) => void; - onError?: (error: TError, variables: TVariables, onMutateResult: TOnMutateResult | undefined, context: MutationFunctionContext) => void; - onSettled?: (data: TData | undefined, error: TError | null, variables: TVariables, onMutateResult: TOnMutateResult | undefined, context: MutationFunctionContext) => void; -} -type MutateFunction = (variables: TVariables, options?: MutateOptions) => Promise; -interface MutationObserverBaseResult extends MutationState { - /** - * The last successfully resolved data for the mutation. - */ - data: TData | undefined; - /** - * The variables object passed to the `mutationFn`. - */ - variables: TVariables | undefined; - /** - * The error object for the mutation, if an error was encountered. - * - Defaults to `null`. - */ - error: TError | null; - /** - * A boolean variable derived from `status`. - * - `true` if the last mutation attempt resulted in an error. - */ - isError: boolean; - /** - * A boolean variable derived from `status`. - * - `true` if the mutation is in its initial state prior to executing. - */ - isIdle: boolean; - /** - * A boolean variable derived from `status`. - * - `true` if the mutation is currently executing. - */ - isPending: boolean; - /** - * A boolean variable derived from `status`. - * - `true` if the last mutation attempt was successful. - */ - isSuccess: boolean; - /** - * The status of the mutation. - * - Will be: - * - `idle` initial status prior to the mutation function executing. - * - `pending` if the mutation is currently executing. - * - `error` if the last mutation attempt resulted in an error. - * - `success` if the last mutation attempt was successful. - */ - status: MutationStatus; - /** - * The mutation function you can call with variables to trigger the mutation and optionally hooks on additional callback options. - * @param variables - The variables object to pass to the `mutationFn`. - * @param options.onSuccess - This function will fire when the mutation is successful and will be passed the mutation's result. - * @param options.onError - This function will fire if the mutation encounters an error and will be passed the error. - * @param options.onSettled - This function will fire when the mutation is either successfully fetched or encounters an error and be passed either the data or error. - * @remarks - * - If you make multiple requests, `onSuccess` will fire only after the latest call you've made. - * - All the callback functions (`onSuccess`, `onError`, `onSettled`) are void functions, and the returned value will be ignored. - */ - mutate: MutateFunction; - /** - * A function to clean the mutation internal state (i.e., it resets the mutation to its initial state). - */ - reset: () => void; -} -interface MutationObserverIdleResult extends MutationObserverBaseResult { - data: undefined; - variables: undefined; - error: null; - isError: false; - isIdle: true; - isPending: false; - isSuccess: false; - status: 'idle'; -} -interface MutationObserverLoadingResult extends MutationObserverBaseResult { - data: undefined; - variables: TVariables; - error: null; - isError: false; - isIdle: false; - isPending: true; - isSuccess: false; - status: 'pending'; -} -interface MutationObserverErrorResult extends MutationObserverBaseResult { - data: undefined; - error: TError; - variables: TVariables; - isError: true; - isIdle: false; - isPending: false; - isSuccess: false; - status: 'error'; -} -interface MutationObserverSuccessResult extends MutationObserverBaseResult { - data: TData; - error: null; - variables: TVariables; - isError: false; - isIdle: false; - isPending: false; - isSuccess: true; - status: 'success'; -} -type MutationObserverResult = MutationObserverIdleResult | MutationObserverLoadingResult | MutationObserverErrorResult | MutationObserverSuccessResult; -interface QueryClientConfig { - queryCache?: QueryCache; - mutationCache?: MutationCache; - defaultOptions?: DefaultOptions; -} -interface DefaultOptions { - queries?: OmitKeyof, 'suspense' | 'queryKey'>; - mutations?: MutationObserverOptions; - hydrate?: HydrateOptions['defaultOptions']; - dehydrate?: DehydrateOptions; -} -interface CancelOptions { - revert?: boolean; - silent?: boolean; -} -interface SetDataOptions { - updatedAt?: number; -} -type NotifyEventType = 'added' | 'removed' | 'updated' | 'observerAdded' | 'observerRemoved' | 'observerResultsUpdated' | 'observerOptionsUpdated'; -interface NotifyEvent { - type: NotifyEventType; -} - -type TransformerFn = (data: any) => any; -interface DehydrateOptions { - serializeData?: TransformerFn; - shouldDehydrateMutation?: (mutation: Mutation) => boolean; - shouldDehydrateQuery?: (query: Query) => boolean; - shouldRedactErrors?: (error: unknown) => boolean; -} -interface HydrateOptions { - defaultOptions?: { - deserializeData?: TransformerFn; - queries?: QueryOptions; - mutations?: MutationOptions; - }; -} -interface DehydratedMutation { - mutationKey?: MutationKey; - state: MutationState; - meta?: MutationMeta; - scope?: MutationScope; -} -interface DehydratedQuery { - queryHash: string; - queryKey: QueryKey; - state: QueryState; - promise?: Promise; - meta?: QueryMeta; - dehydratedAt?: number; -} -interface DehydratedState { - mutations: Array; - queries: Array; -} -declare function defaultShouldDehydrateMutation(mutation: Mutation): boolean; -declare function defaultShouldDehydrateQuery(query: Query): boolean; -declare function dehydrate(client: QueryClient, options?: DehydrateOptions): DehydratedState; -declare function hydrate(client: QueryClient, dehydratedState: unknown, options?: HydrateOptions): void; - -export { type Enabled as $, type QueryState as A, type DistributiveOmit as B, CancelledError as C, type DehydratedState as D, type Override as E, type NoInfer as F, type DefaultError as G, type HydrateOptions as H, type QueryKey as I, dataTagSymbol as J, dataTagErrorSymbol as K, unsetMarker as L, MutationCache as M, type NonUndefinedGuard as N, type OmitKeyof as O, type UnsetMarker as P, QueryCache as Q, type Register as R, type SkipToken as S, type AnyDataTag as T, type Updater as U, type DataTag as V, type InferDataFromTag as W, type InferErrorFromTag as X, type QueryFunction as Y, type StaleTime as Z, type StaleTimeFunction as _, defaultShouldDehydrateQuery as a, type MutationObserverBaseResult as a$, type QueryPersister as a0, type QueryFunctionContext as a1, type InitialDataFunction as a2, type PlaceholderDataFunction as a3, type QueriesPlaceholderDataFunction as a4, type QueryKeyHashFunction as a5, type GetPreviousPageParamFunction as a6, type GetNextPageParamFunction as a7, type InfiniteData as a8, type QueryMeta as a9, type QueryObserverPendingResult as aA, type QueryObserverLoadingResult as aB, type QueryObserverLoadingErrorResult as aC, type QueryObserverRefetchErrorResult as aD, type QueryObserverSuccessResult as aE, type QueryObserverPlaceholderResult as aF, type DefinedQueryObserverResult as aG, type QueryObserverResult as aH, type InfiniteQueryObserverBaseResult as aI, type InfiniteQueryObserverPendingResult as aJ, type InfiniteQueryObserverLoadingResult as aK, type InfiniteQueryObserverLoadingErrorResult as aL, type InfiniteQueryObserverRefetchErrorResult as aM, type InfiniteQueryObserverSuccessResult as aN, type InfiniteQueryObserverPlaceholderResult as aO, type DefinedInfiniteQueryObserverResult as aP, type InfiniteQueryObserverResult as aQ, type MutationKey as aR, type MutationStatus as aS, type MutationScope as aT, type MutationMeta as aU, type MutationFunctionContext as aV, type MutationFunction as aW, type MutationOptions as aX, type MutationObserverOptions as aY, type MutateOptions as aZ, type MutateFunction as a_, type NetworkMode as aa, type NotifyOnChangeProps as ab, type QueryOptions as ac, type InitialPageParam as ad, type InfiniteQueryPageParamsOptions as ae, type ThrowOnError as af, type QueryObserverOptions as ag, type WithRequired as ah, type DefaultedQueryObserverOptions as ai, type InfiniteQueryObserverOptions as aj, type DefaultedInfiniteQueryObserverOptions as ak, type FetchQueryOptions as al, type EnsureQueryDataOptions as am, type EnsureInfiniteQueryDataOptions as an, type FetchInfiniteQueryOptions as ao, type ResultOptions as ap, type RefetchOptions as aq, type InvalidateQueryFilters as ar, type RefetchQueryFilters as as, type InvalidateOptions as at, type ResetOptions as au, type FetchNextPageOptions as av, type FetchPreviousPageOptions as aw, type QueryStatus as ax, type FetchStatus as ay, type QueryObserverBaseResult as az, dehydrate as b, type MutationObserverIdleResult as b0, type MutationObserverLoadingResult as b1, type MutationObserverErrorResult as b2, type MutationObserverSuccessResult as b3, type MutationObserverResult as b4, type QueryClientConfig as b5, type DefaultOptions as b6, type CancelOptions as b7, type SetDataOptions as b8, type NotifyEventType as b9, addConsumeAwareSignal as bA, type QueryStore as bB, type Retryer as bC, type RetryValue as bD, type RetryDelayValue as bE, canFetch as bF, createRetryer as bG, type NotifyEvent as ba, type QueryBehavior as bb, type FetchContext as bc, type FetchDirection as bd, type FetchMeta as be, type FetchOptions as bf, type Action$1 as bg, type SetStateOptions as bh, fetchState as bi, type Action as bj, getDefaultState as bk, type QueryTypeFilter as bl, functionalUpdate as bm, isValidTimeout as bn, timeUntilStale as bo, resolveStaleTime as bp, resolveEnabled as bq, hashQueryKeyByOptions as br, shallowEqualObjects as bs, isPlainArray as bt, isPlainObject as bu, sleep as bv, replaceData as bw, addToEnd as bx, addToStart as by, ensureQueryFn as bz, type MutationCacheNotifyEvent as c, defaultShouldDehydrateMutation as d, MutationObserver as e, type QueryCacheNotifyEvent as f, QueryClient as g, hydrate as h, QueryObserver as i, isCancelledError as j, hashKey as k, isServer as l, keepPreviousData as m, matchMutation as n, matchQuery as o, noop as p, partialMatchKey as q, replaceEqualDeep as r, shouldThrowError as s, skipToken as t, type MutationFilters as u, type QueryFilters as v, type DehydrateOptions as w, Mutation as x, type MutationState as y, Query as z }; diff --git a/node_modules/@tanstack/query-core/build/modern/hydration-uphG6M-i.d.cts b/node_modules/@tanstack/query-core/build/modern/hydration-uphG6M-i.d.cts deleted file mode 100644 index fdea1ed..0000000 --- a/node_modules/@tanstack/query-core/build/modern/hydration-uphG6M-i.d.cts +++ /dev/null @@ -1,1384 +0,0 @@ -import { Removable } from './removable.cjs'; -import { Subscribable } from './subscribable.cjs'; - -type QueryObserverListener = (result: QueryObserverResult) => void; -interface ObserverFetchOptions extends FetchOptions { - throwOnError?: boolean; -} -declare class QueryObserver extends Subscribable> { - #private; - options: QueryObserverOptions; - constructor(client: QueryClient, options: QueryObserverOptions); - protected bindMethods(): void; - protected onSubscribe(): void; - protected onUnsubscribe(): void; - shouldFetchOnReconnect(): boolean; - shouldFetchOnWindowFocus(): boolean; - destroy(): void; - setOptions(options: QueryObserverOptions): void; - getOptimisticResult(options: DefaultedQueryObserverOptions): QueryObserverResult; - getCurrentResult(): QueryObserverResult; - trackResult(result: QueryObserverResult, onPropTracked?: (key: keyof QueryObserverResult) => void): QueryObserverResult; - trackProp(key: keyof QueryObserverResult): void; - getCurrentQuery(): Query; - refetch({ ...options }?: RefetchOptions): Promise>; - fetchOptimistic(options: QueryObserverOptions): Promise>; - protected fetch(fetchOptions: ObserverFetchOptions): Promise>; - protected createResult(query: Query, options: QueryObserverOptions): QueryObserverResult; - updateResult(): void; - onQueryUpdate(): void; -} - -interface QueryConfig { - client: QueryClient; - queryKey: TQueryKey; - queryHash: string; - options?: QueryOptions; - defaultOptions?: QueryOptions; - state?: QueryState; -} -interface QueryState { - data: TData | undefined; - dataUpdateCount: number; - dataUpdatedAt: number; - error: TError | null; - errorUpdateCount: number; - errorUpdatedAt: number; - fetchFailureCount: number; - fetchFailureReason: TError | null; - fetchMeta: FetchMeta | null; - isInvalidated: boolean; - status: QueryStatus; - fetchStatus: FetchStatus; -} -interface FetchContext { - fetchFn: () => unknown | Promise; - fetchOptions?: FetchOptions; - signal: AbortSignal; - options: QueryOptions; - client: QueryClient; - queryKey: TQueryKey; - state: QueryState; -} -interface QueryBehavior { - onFetch: (context: FetchContext, query: Query) => void; -} -type FetchDirection = 'forward' | 'backward'; -interface FetchMeta { - fetchMore?: { - direction: FetchDirection; - }; -} -interface FetchOptions { - cancelRefetch?: boolean; - meta?: FetchMeta; - initialPromise?: Promise; -} -interface FailedAction$1 { - type: 'failed'; - failureCount: number; - error: TError; -} -interface FetchAction { - type: 'fetch'; - meta?: FetchMeta; -} -interface SuccessAction$1 { - data: TData | undefined; - type: 'success'; - dataUpdatedAt?: number; - manual?: boolean; -} -interface ErrorAction$1 { - type: 'error'; - error: TError; -} -interface InvalidateAction { - type: 'invalidate'; -} -interface PauseAction$1 { - type: 'pause'; -} -interface ContinueAction$1 { - type: 'continue'; -} -interface SetStateAction { - type: 'setState'; - state: Partial>; - setStateOptions?: SetStateOptions; -} -type Action$1 = ContinueAction$1 | ErrorAction$1 | FailedAction$1 | FetchAction | InvalidateAction | PauseAction$1 | SetStateAction | SuccessAction$1; -interface SetStateOptions { - meta?: any; -} -declare class Query extends Removable { - #private; - queryKey: TQueryKey; - queryHash: string; - options: QueryOptions; - state: QueryState; - observers: Array>; - constructor(config: QueryConfig); - get meta(): QueryMeta | undefined; - get promise(): Promise | undefined; - setOptions(options?: QueryOptions): void; - protected optionalRemove(): void; - setData(newData: TData, options?: SetDataOptions & { - manual: boolean; - }): TData; - setState(state: Partial>, setStateOptions?: SetStateOptions): void; - cancel(options?: CancelOptions): Promise; - destroy(): void; - reset(): void; - isActive(): boolean; - isDisabled(): boolean; - isStatic(): boolean; - isStale(): boolean; - isStaleByTime(staleTime?: StaleTime): boolean; - onFocus(): void; - onOnline(): void; - addObserver(observer: QueryObserver): void; - removeObserver(observer: QueryObserver): void; - getObserversCount(): number; - invalidate(): void; - fetch(options?: QueryOptions, fetchOptions?: FetchOptions): Promise; -} -declare function fetchState(data: TData | undefined, options: QueryOptions): { - readonly error?: null | undefined; - readonly status?: "pending" | undefined; - readonly fetchFailureCount: 0; - readonly fetchFailureReason: null; - readonly fetchStatus: "fetching" | "paused"; -}; - -type MutationObserverListener = (result: MutationObserverResult) => void; -declare class MutationObserver extends Subscribable> { - #private; - options: MutationObserverOptions; - constructor(client: QueryClient, options: MutationObserverOptions); - protected bindMethods(): void; - setOptions(options: MutationObserverOptions): void; - protected onUnsubscribe(): void; - onMutationUpdate(action: Action): void; - getCurrentResult(): MutationObserverResult; - reset(): void; - mutate(variables: TVariables, options?: MutateOptions): Promise; -} - -interface MutationCacheConfig { - onError?: (error: DefaultError, variables: unknown, onMutateResult: unknown, mutation: Mutation, context: MutationFunctionContext) => Promise | unknown; - onSuccess?: (data: unknown, variables: unknown, onMutateResult: unknown, mutation: Mutation, context: MutationFunctionContext) => Promise | unknown; - onMutate?: (variables: unknown, mutation: Mutation, context: MutationFunctionContext) => Promise | unknown; - onSettled?: (data: unknown | undefined, error: DefaultError | null, variables: unknown, onMutateResult: unknown, mutation: Mutation, context: MutationFunctionContext) => Promise | unknown; -} -interface NotifyEventMutationAdded extends NotifyEvent { - type: 'added'; - mutation: Mutation; -} -interface NotifyEventMutationRemoved extends NotifyEvent { - type: 'removed'; - mutation: Mutation; -} -interface NotifyEventMutationObserverAdded extends NotifyEvent { - type: 'observerAdded'; - mutation: Mutation; - observer: MutationObserver; -} -interface NotifyEventMutationObserverRemoved extends NotifyEvent { - type: 'observerRemoved'; - mutation: Mutation; - observer: MutationObserver; -} -interface NotifyEventMutationObserverOptionsUpdated extends NotifyEvent { - type: 'observerOptionsUpdated'; - mutation?: Mutation; - observer: MutationObserver; -} -interface NotifyEventMutationUpdated extends NotifyEvent { - type: 'updated'; - mutation: Mutation; - action: Action; -} -type MutationCacheNotifyEvent = NotifyEventMutationAdded | NotifyEventMutationRemoved | NotifyEventMutationObserverAdded | NotifyEventMutationObserverRemoved | NotifyEventMutationObserverOptionsUpdated | NotifyEventMutationUpdated; -type MutationCacheListener = (event: MutationCacheNotifyEvent) => void; -declare class MutationCache extends Subscribable { - #private; - config: MutationCacheConfig; - constructor(config?: MutationCacheConfig); - build(client: QueryClient, options: MutationOptions, state?: MutationState): Mutation; - add(mutation: Mutation): void; - remove(mutation: Mutation): void; - canRun(mutation: Mutation): boolean; - runNext(mutation: Mutation): Promise; - clear(): void; - getAll(): Array; - find(filters: MutationFilters): Mutation | undefined; - findAll(filters?: MutationFilters): Array; - notify(event: MutationCacheNotifyEvent): void; - resumePausedMutations(): Promise; -} - -interface MutationConfig { - client: QueryClient; - mutationId: number; - mutationCache: MutationCache; - options: MutationOptions; - state?: MutationState; -} -interface MutationState { - context: TOnMutateResult | undefined; - data: TData | undefined; - error: TError | null; - failureCount: number; - failureReason: TError | null; - isPaused: boolean; - status: MutationStatus; - variables: TVariables | undefined; - submittedAt: number; -} -interface FailedAction { - type: 'failed'; - failureCount: number; - error: TError | null; -} -interface PendingAction { - type: 'pending'; - isPaused: boolean; - variables?: TVariables; - context?: TOnMutateResult; -} -interface SuccessAction { - type: 'success'; - data: TData; -} -interface ErrorAction { - type: 'error'; - error: TError; -} -interface PauseAction { - type: 'pause'; -} -interface ContinueAction { - type: 'continue'; -} -type Action = ContinueAction | ErrorAction | FailedAction | PendingAction | PauseAction | SuccessAction; -declare class Mutation extends Removable { - #private; - state: MutationState; - options: MutationOptions; - readonly mutationId: number; - constructor(config: MutationConfig); - setOptions(options: MutationOptions): void; - get meta(): MutationMeta | undefined; - addObserver(observer: MutationObserver): void; - removeObserver(observer: MutationObserver): void; - protected optionalRemove(): void; - continue(): Promise; - execute(variables: TVariables): Promise; -} -declare function getDefaultState(): MutationState; - -type DropLast> = T extends readonly [ - ...infer R, - unknown -] ? readonly [...R] : never; -type TuplePrefixes> = T extends readonly [] ? readonly [] : TuplePrefixes> | T; -interface QueryFilters { - /** - * Filter to active queries, inactive queries or all queries - */ - type?: QueryTypeFilter; - /** - * Match query key exactly - */ - exact?: boolean; - /** - * Include queries matching this predicate function - */ - predicate?: (query: Query) => boolean; - /** - * Include queries matching this query key - */ - queryKey?: TQueryKey | TuplePrefixes; - /** - * Include or exclude stale queries - */ - stale?: boolean; - /** - * Include queries matching their fetchStatus - */ - fetchStatus?: FetchStatus; -} -interface MutationFilters { - /** - * Match mutation key exactly - */ - exact?: boolean; - /** - * Include mutations matching this predicate function - */ - predicate?: (mutation: Mutation) => boolean; - /** - * Include mutations matching this mutation key - */ - mutationKey?: TuplePrefixes; - /** - * Filter by mutation status - */ - status?: MutationStatus; -} -type Updater = TOutput | ((input: TInput) => TOutput); -type QueryTypeFilter = 'all' | 'active' | 'inactive'; -declare const isServer: boolean; -declare function noop(): void; -declare function noop(): undefined; -declare function functionalUpdate(updater: Updater, input: TInput): TOutput; -declare function isValidTimeout(value: unknown): value is number; -declare function timeUntilStale(updatedAt: number, staleTime?: number): number; -declare function resolveStaleTime(staleTime: undefined | StaleTimeFunction, query: Query): StaleTime | undefined; -declare function resolveEnabled(enabled: undefined | Enabled, query: Query): boolean | undefined; -declare function matchQuery(filters: QueryFilters, query: Query): boolean; -declare function matchMutation(filters: MutationFilters, mutation: Mutation): boolean; -declare function hashQueryKeyByOptions(queryKey: TQueryKey, options?: Pick, 'queryKeyHashFn'>): string; -/** - * Default query & mutation keys hash function. - * Hashes the value into a stable hash. - */ -declare function hashKey(queryKey: QueryKey | MutationKey): string; -/** - * Checks if key `b` partially matches with key `a`. - */ -declare function partialMatchKey(a: QueryKey, b: QueryKey): boolean; -/** - * This function returns `a` if `b` is deeply equal. - * If not, it will replace any deeply equal children of `b` with those of `a`. - * This can be used for structural sharing between JSON values for example. - */ -declare function replaceEqualDeep(a: unknown, b: T, depth?: number): T; -/** - * Shallow compare objects. - */ -declare function shallowEqualObjects>(a: T, b: T | undefined): boolean; -declare function isPlainArray(value: unknown): value is Array; -declare function isPlainObject(o: any): o is Record; -declare function sleep(timeout: number): Promise; -declare function replaceData>(prevData: TData | undefined, data: TData, options: TOptions): TData; -declare function keepPreviousData(previousData: T | undefined): T | undefined; -declare function addToEnd(items: Array, item: T, max?: number): Array; -declare function addToStart(items: Array, item: T, max?: number): Array; -declare const skipToken: unique symbol; -type SkipToken = typeof skipToken; -declare function ensureQueryFn(options: { - queryFn?: QueryFunction | SkipToken; - queryHash?: string; -}, fetchOptions?: FetchOptions): QueryFunction; -declare function shouldThrowError) => boolean>(throwOnError: boolean | T | undefined, params: Parameters): boolean; -declare function addConsumeAwareSignal(object: T, getSignal: () => AbortSignal, onCancelled: VoidFunction): T & { - signal: AbortSignal; -}; - -interface QueryCacheConfig { - onError?: (error: DefaultError, query: Query) => void; - onSuccess?: (data: unknown, query: Query) => void; - onSettled?: (data: unknown | undefined, error: DefaultError | null, query: Query) => void; -} -interface NotifyEventQueryAdded extends NotifyEvent { - type: 'added'; - query: Query; -} -interface NotifyEventQueryRemoved extends NotifyEvent { - type: 'removed'; - query: Query; -} -interface NotifyEventQueryUpdated extends NotifyEvent { - type: 'updated'; - query: Query; - action: Action$1; -} -interface NotifyEventQueryObserverAdded extends NotifyEvent { - type: 'observerAdded'; - query: Query; - observer: QueryObserver; -} -interface NotifyEventQueryObserverRemoved extends NotifyEvent { - type: 'observerRemoved'; - query: Query; - observer: QueryObserver; -} -interface NotifyEventQueryObserverResultsUpdated extends NotifyEvent { - type: 'observerResultsUpdated'; - query: Query; -} -interface NotifyEventQueryObserverOptionsUpdated extends NotifyEvent { - type: 'observerOptionsUpdated'; - query: Query; - observer: QueryObserver; -} -type QueryCacheNotifyEvent = NotifyEventQueryAdded | NotifyEventQueryRemoved | NotifyEventQueryUpdated | NotifyEventQueryObserverAdded | NotifyEventQueryObserverRemoved | NotifyEventQueryObserverResultsUpdated | NotifyEventQueryObserverOptionsUpdated; -type QueryCacheListener = (event: QueryCacheNotifyEvent) => void; -interface QueryStore { - has: (queryHash: string) => boolean; - set: (queryHash: string, query: Query) => void; - get: (queryHash: string) => Query | undefined; - delete: (queryHash: string) => void; - values: () => IterableIterator; -} -declare class QueryCache extends Subscribable { - #private; - config: QueryCacheConfig; - constructor(config?: QueryCacheConfig); - build(client: QueryClient, options: WithRequired, 'queryKey'>, state?: QueryState): Query; - add(query: Query): void; - remove(query: Query): void; - clear(): void; - get(queryHash: string): Query | undefined; - getAll(): Array; - find(filters: WithRequired): Query | undefined; - findAll(filters?: QueryFilters): Array; - notify(event: QueryCacheNotifyEvent): void; - onFocus(): void; - onOnline(): void; -} - -declare class QueryClient { - #private; - constructor(config?: QueryClientConfig); - mount(): void; - unmount(): void; - isFetching = QueryFilters>(filters?: TQueryFilters): number; - isMutating = MutationFilters>(filters?: TMutationFilters): number; - /** - * Imperative (non-reactive) way to retrieve data for a QueryKey. - * Should only be used in callbacks or functions where reading the latest data is necessary, e.g. for optimistic updates. - * - * Hint: Do not use this function inside a component, because it won't receive updates. - * Use `useQuery` to create a `QueryObserver` that subscribes to changes. - */ - getQueryData>(queryKey: TTaggedQueryKey): TInferredQueryFnData | undefined; - ensureQueryData(options: EnsureQueryDataOptions): Promise; - getQueriesData = QueryFilters>(filters: TQueryFilters): Array<[QueryKey, TQueryFnData | undefined]>; - setQueryData>(queryKey: TTaggedQueryKey, updater: Updater | undefined, NoInfer | undefined>, options?: SetDataOptions): NoInfer | undefined; - setQueriesData = QueryFilters>(filters: TQueryFilters, updater: Updater | undefined, NoInfer | undefined>, options?: SetDataOptions): Array<[QueryKey, TQueryFnData | undefined]>; - getQueryState, TInferredError = InferErrorFromTag>(queryKey: TTaggedQueryKey): QueryState | undefined; - removeQueries(filters?: QueryFilters): void; - resetQueries(filters?: QueryFilters, options?: ResetOptions): Promise; - cancelQueries(filters?: QueryFilters, cancelOptions?: CancelOptions): Promise; - invalidateQueries(filters?: InvalidateQueryFilters, options?: InvalidateOptions): Promise; - refetchQueries(filters?: RefetchQueryFilters, options?: RefetchOptions): Promise; - fetchQuery(options: FetchQueryOptions): Promise; - prefetchQuery(options: FetchQueryOptions): Promise; - fetchInfiniteQuery(options: FetchInfiniteQueryOptions): Promise>; - prefetchInfiniteQuery(options: FetchInfiniteQueryOptions): Promise; - ensureInfiniteQueryData(options: EnsureInfiniteQueryDataOptions): Promise>; - resumePausedMutations(): Promise; - getQueryCache(): QueryCache; - getMutationCache(): MutationCache; - getDefaultOptions(): DefaultOptions; - setDefaultOptions(options: DefaultOptions): void; - setQueryDefaults(queryKey: QueryKey, options: Partial, 'queryKey'>>): void; - getQueryDefaults(queryKey: QueryKey): OmitKeyof, 'queryKey'>; - setMutationDefaults(mutationKey: MutationKey, options: OmitKeyof, 'mutationKey'>): void; - getMutationDefaults(mutationKey: MutationKey): OmitKeyof, 'mutationKey'>; - defaultQueryOptions(options: QueryObserverOptions | DefaultedQueryObserverOptions): DefaultedQueryObserverOptions; - defaultMutationOptions>(options?: T): T; - clear(): void; -} - -interface RetryerConfig { - fn: () => TData | Promise; - initialPromise?: Promise; - onCancel?: (error: TError) => void; - onFail?: (failureCount: number, error: TError) => void; - onPause?: () => void; - onContinue?: () => void; - retry?: RetryValue; - retryDelay?: RetryDelayValue; - networkMode: NetworkMode | undefined; - canRun: () => boolean; -} -interface Retryer { - promise: Promise; - cancel: (cancelOptions?: CancelOptions) => void; - continue: () => Promise; - cancelRetry: () => void; - continueRetry: () => void; - canStart: () => boolean; - start: () => Promise; - status: () => 'pending' | 'resolved' | 'rejected'; -} -type RetryValue = boolean | number | ShouldRetryFunction; -type ShouldRetryFunction = (failureCount: number, error: TError) => boolean; -type RetryDelayValue = number | RetryDelayFunction; -type RetryDelayFunction = (failureCount: number, error: TError) => number; -declare function canFetch(networkMode: NetworkMode | undefined): boolean; -declare class CancelledError extends Error { - revert?: boolean; - silent?: boolean; - constructor(options?: CancelOptions); -} -/** - * @deprecated Use instanceof `CancelledError` instead. - */ -declare function isCancelledError(value: any): value is CancelledError; -declare function createRetryer(config: RetryerConfig): Retryer; - -type NonUndefinedGuard = T extends undefined ? never : T; -type DistributiveOmit = TObject extends any ? Omit : never; -type OmitKeyof) | (number & Record) | (symbol & Record) : keyof TObject, TStrictly extends 'strictly' | 'safely' = 'strictly'> = Omit; -type Override = { - [AKey in keyof TTargetA]: AKey extends keyof TTargetB ? TTargetB[AKey] : TTargetA[AKey]; -}; -type NoInfer = [T][T extends any ? 0 : never]; -interface Register { -} -type DefaultError = Register extends { - defaultError: infer TError; -} ? TError : Error; -type QueryKey = Register extends { - queryKey: infer TQueryKey; -} ? TQueryKey extends ReadonlyArray ? TQueryKey : TQueryKey extends Array ? TQueryKey : ReadonlyArray : ReadonlyArray; -declare const dataTagSymbol: unique symbol; -type dataTagSymbol = typeof dataTagSymbol; -declare const dataTagErrorSymbol: unique symbol; -type dataTagErrorSymbol = typeof dataTagErrorSymbol; -declare const unsetMarker: unique symbol; -type UnsetMarker = typeof unsetMarker; -type AnyDataTag = { - [dataTagSymbol]: any; - [dataTagErrorSymbol]: any; -}; -type DataTag = TType extends AnyDataTag ? TType : TType & { - [dataTagSymbol]: TValue; - [dataTagErrorSymbol]: TError; -}; -type InferDataFromTag = TTaggedQueryKey extends DataTag ? TaggedValue : TQueryFnData; -type InferErrorFromTag = TTaggedQueryKey extends DataTag ? TaggedError extends UnsetMarker ? TError : TaggedError : TError; -type QueryFunction = (context: QueryFunctionContext) => T | Promise; -type StaleTime = number | 'static'; -type StaleTimeFunction = StaleTime | ((query: Query) => StaleTime); -type Enabled = boolean | ((query: Query) => boolean); -type QueryPersister = [TPageParam] extends [never] ? (queryFn: QueryFunction, context: QueryFunctionContext, query: Query) => T | Promise : (queryFn: QueryFunction, context: QueryFunctionContext, query: Query) => T | Promise; -type QueryFunctionContext = [TPageParam] extends [never] ? { - client: QueryClient; - queryKey: TQueryKey; - signal: AbortSignal; - meta: QueryMeta | undefined; - pageParam?: unknown; - /** - * @deprecated - * if you want access to the direction, you can add it to the pageParam - */ - direction?: unknown; -} : { - client: QueryClient; - queryKey: TQueryKey; - signal: AbortSignal; - pageParam: TPageParam; - /** - * @deprecated - * if you want access to the direction, you can add it to the pageParam - */ - direction: FetchDirection; - meta: QueryMeta | undefined; -}; -type InitialDataFunction = () => T | undefined; -type NonFunctionGuard = T extends Function ? never : T; -type PlaceholderDataFunction = (previousData: TQueryData | undefined, previousQuery: Query | undefined) => TQueryData | undefined; -type QueriesPlaceholderDataFunction = (previousData: undefined, previousQuery: undefined) => TQueryData | undefined; -type QueryKeyHashFunction = (queryKey: TQueryKey) => string; -type GetPreviousPageParamFunction = (firstPage: TQueryFnData, allPages: Array, firstPageParam: TPageParam, allPageParams: Array) => TPageParam | undefined | null; -type GetNextPageParamFunction = (lastPage: TQueryFnData, allPages: Array, lastPageParam: TPageParam, allPageParams: Array) => TPageParam | undefined | null; -interface InfiniteData { - pages: Array; - pageParams: Array; -} -type QueryMeta = Register extends { - queryMeta: infer TQueryMeta; -} ? TQueryMeta extends Record ? TQueryMeta : Record : Record; -type NetworkMode = 'online' | 'always' | 'offlineFirst'; -type NotifyOnChangeProps = Array | 'all' | undefined | (() => Array | 'all' | undefined); -interface QueryOptions { - /** - * If `false`, failed queries will not retry by default. - * If `true`, failed queries will retry infinitely., failureCount: num - * If set to an integer number, e.g. 3, failed queries will retry until the failed query count meets that number. - * If set to a function `(failureCount, error) => boolean` failed queries will retry until the function returns false. - */ - retry?: RetryValue; - retryDelay?: RetryDelayValue; - networkMode?: NetworkMode; - /** - * The time in milliseconds that unused/inactive cache data remains in memory. - * When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration. - * When different garbage collection times are specified, the longest one will be used. - * Setting it to `Infinity` will disable garbage collection. - */ - gcTime?: number; - queryFn?: QueryFunction | SkipToken; - persister?: QueryPersister, NoInfer, NoInfer>; - queryHash?: string; - queryKey?: TQueryKey; - queryKeyHashFn?: QueryKeyHashFunction; - initialData?: TData | InitialDataFunction; - initialDataUpdatedAt?: number | (() => number | undefined); - behavior?: QueryBehavior; - /** - * Set this to `false` to disable structural sharing between query results. - * Set this to a function which accepts the old and new data and returns resolved data of the same type to implement custom structural sharing logic. - * Defaults to `true`. - */ - structuralSharing?: boolean | ((oldData: unknown | undefined, newData: unknown) => unknown); - _defaulted?: boolean; - /** - * Additional payload to be stored on each query. - * Use this property to pass information that can be used in other places. - */ - meta?: QueryMeta; - /** - * Maximum number of pages to store in the data of an infinite query. - */ - maxPages?: number; -} -interface InitialPageParam { - initialPageParam: TPageParam; -} -interface InfiniteQueryPageParamsOptions extends InitialPageParam { - /** - * This function can be set to automatically get the previous cursor for infinite queries. - * The result will also be used to determine the value of `hasPreviousPage`. - */ - getPreviousPageParam?: GetPreviousPageParamFunction; - /** - * This function can be set to automatically get the next cursor for infinite queries. - * The result will also be used to determine the value of `hasNextPage`. - */ - getNextPageParam: GetNextPageParamFunction; -} -type ThrowOnError = boolean | ((error: TError, query: Query) => boolean); -interface QueryObserverOptions extends WithRequired, 'queryKey'> { - /** - * Set this to `false` or a function that returns `false` to disable automatic refetching when the query mounts or changes query keys. - * To refetch the query, use the `refetch` method returned from the `useQuery` instance. - * Accepts a boolean or function that returns a boolean. - * Defaults to `true`. - */ - enabled?: Enabled; - /** - * The time in milliseconds after data is considered stale. - * If set to `Infinity`, the data will never be considered stale. - * If set to a function, the function will be executed with the query to compute a `staleTime`. - * Defaults to `0`. - */ - staleTime?: StaleTimeFunction; - /** - * If set to a number, the query will continuously refetch at this frequency in milliseconds. - * If set to a function, the function will be executed with the latest data and query to compute a frequency - * Defaults to `false`. - */ - refetchInterval?: number | false | ((query: Query) => number | false | undefined); - /** - * If set to `true`, the query will continue to refetch while their tab/window is in the background. - * Defaults to `false`. - */ - refetchIntervalInBackground?: boolean; - /** - * If set to `true`, the query will refetch on window focus if the data is stale. - * If set to `false`, the query will not refetch on window focus. - * If set to `'always'`, the query will always refetch on window focus. - * If set to a function, the function will be executed with the latest data and query to compute the value. - * Defaults to `true`. - */ - refetchOnWindowFocus?: boolean | 'always' | ((query: Query) => boolean | 'always'); - /** - * If set to `true`, the query will refetch on reconnect if the data is stale. - * If set to `false`, the query will not refetch on reconnect. - * If set to `'always'`, the query will always refetch on reconnect. - * If set to a function, the function will be executed with the latest data and query to compute the value. - * Defaults to the value of `networkOnline` (`true`) - */ - refetchOnReconnect?: boolean | 'always' | ((query: Query) => boolean | 'always'); - /** - * If set to `true`, the query will refetch on mount if the data is stale. - * If set to `false`, will disable additional instances of a query to trigger background refetch. - * If set to `'always'`, the query will always refetch on mount. - * If set to a function, the function will be executed with the latest data and query to compute the value - * Defaults to `true`. - */ - refetchOnMount?: boolean | 'always' | ((query: Query) => boolean | 'always'); - /** - * If set to `false`, the query will not be retried on mount if it contains an error. - * Defaults to `true`. - */ - retryOnMount?: boolean; - /** - * If set, the component will only re-render if any of the listed properties change. - * When set to `['data', 'error']`, the component will only re-render when the `data` or `error` properties change. - * When set to `'all'`, the component will re-render whenever a query is updated. - * When set to a function, the function will be executed to compute the list of properties. - * By default, access to properties will be tracked, and the component will only re-render when one of the tracked properties change. - */ - notifyOnChangeProps?: NotifyOnChangeProps; - /** - * Whether errors should be thrown instead of setting the `error` property. - * If set to `true` or `suspense` is `true`, all errors will be thrown to the error boundary. - * If set to `false` and `suspense` is `false`, errors are returned as state. - * If set to a function, it will be passed the error and the query, and it should return a boolean indicating whether to show the error in an error boundary (`true`) or return the error as state (`false`). - * Defaults to `false`. - */ - throwOnError?: ThrowOnError; - /** - * This option can be used to transform or select a part of the data returned by the query function. - */ - select?: (data: TQueryData) => TData; - /** - * If set to `true`, the query will suspend when `status === 'pending'` - * and throw errors when `status === 'error'`. - * Defaults to `false`. - */ - suspense?: boolean; - /** - * If set, this value will be used as the placeholder data for this particular query observer while the query is still in the `loading` data and no initialData has been provided. - */ - placeholderData?: NonFunctionGuard | PlaceholderDataFunction, TError, NonFunctionGuard, TQueryKey>; - _optimisticResults?: 'optimistic' | 'isRestoring'; - /** - * Enable prefetching during rendering - */ - experimental_prefetchInRender?: boolean; -} -type WithRequired = TTarget & { - [_ in TKey]: {}; -}; -type DefaultedQueryObserverOptions = WithRequired, 'throwOnError' | 'refetchOnReconnect' | 'queryHash'>; -interface InfiniteQueryObserverOptions extends QueryObserverOptions, TQueryKey, TPageParam>, InfiniteQueryPageParamsOptions { -} -type DefaultedInfiniteQueryObserverOptions = WithRequired, 'throwOnError' | 'refetchOnReconnect' | 'queryHash'>; -interface FetchQueryOptions extends WithRequired, 'queryKey'> { - initialPageParam?: never; - /** - * The time in milliseconds after data is considered stale. - * If the data is fresh it will be returned from the cache. - */ - staleTime?: StaleTimeFunction; -} -interface EnsureQueryDataOptions extends FetchQueryOptions { - revalidateIfStale?: boolean; -} -type EnsureInfiniteQueryDataOptions = FetchInfiniteQueryOptions & { - revalidateIfStale?: boolean; -}; -type FetchInfiniteQueryPages = { - pages?: never; -} | { - pages: number; - getNextPageParam: GetNextPageParamFunction; -}; -type FetchInfiniteQueryOptions = Omit, TQueryKey, TPageParam>, 'initialPageParam'> & InitialPageParam & FetchInfiniteQueryPages; -interface ResultOptions { - throwOnError?: boolean; -} -interface RefetchOptions extends ResultOptions { - /** - * If set to `true`, a currently running request will be cancelled before a new request is made - * - * If set to `false`, no refetch will be made if there is already a request running. - * - * Defaults to `true`. - */ - cancelRefetch?: boolean; -} -interface InvalidateQueryFilters extends QueryFilters { - refetchType?: QueryTypeFilter | 'none'; -} -interface RefetchQueryFilters extends QueryFilters { -} -interface InvalidateOptions extends RefetchOptions { -} -interface ResetOptions extends RefetchOptions { -} -interface FetchNextPageOptions extends ResultOptions { - /** - * If set to `true`, calling `fetchNextPage` repeatedly will invoke `queryFn` every time, - * whether the previous invocation has resolved or not. Also, the result from previous invocations will be ignored. - * - * If set to `false`, calling `fetchNextPage` repeatedly won't have any effect until the first invocation has resolved. - * - * Defaults to `true`. - */ - cancelRefetch?: boolean; -} -interface FetchPreviousPageOptions extends ResultOptions { - /** - * If set to `true`, calling `fetchPreviousPage` repeatedly will invoke `queryFn` every time, - * whether the previous invocation has resolved or not. Also, the result from previous invocations will be ignored. - * - * If set to `false`, calling `fetchPreviousPage` repeatedly won't have any effect until the first invocation has resolved. - * - * Defaults to `true`. - */ - cancelRefetch?: boolean; -} -type QueryStatus = 'pending' | 'error' | 'success'; -type FetchStatus = 'fetching' | 'paused' | 'idle'; -interface QueryObserverBaseResult { - /** - * The last successfully resolved data for the query. - */ - data: TData | undefined; - /** - * The timestamp for when the query most recently returned the `status` as `"success"`. - */ - dataUpdatedAt: number; - /** - * The error object for the query, if an error was thrown. - * - Defaults to `null`. - */ - error: TError | null; - /** - * The timestamp for when the query most recently returned the `status` as `"error"`. - */ - errorUpdatedAt: number; - /** - * The failure count for the query. - * - Incremented every time the query fails. - * - Reset to `0` when the query succeeds. - */ - failureCount: number; - /** - * The failure reason for the query retry. - * - Reset to `null` when the query succeeds. - */ - failureReason: TError | null; - /** - * The sum of all errors. - */ - errorUpdateCount: number; - /** - * A derived boolean from the `status` variable, provided for convenience. - * - `true` if the query attempt resulted in an error. - */ - isError: boolean; - /** - * Will be `true` if the query has been fetched. - */ - isFetched: boolean; - /** - * Will be `true` if the query has been fetched after the component mounted. - * - This property can be used to not show any previously cached data. - */ - isFetchedAfterMount: boolean; - /** - * A derived boolean from the `fetchStatus` variable, provided for convenience. - * - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. - */ - isFetching: boolean; - /** - * Is `true` whenever the first fetch for a query is in-flight. - * - Is the same as `isFetching && isPending`. - */ - isLoading: boolean; - /** - * Will be `pending` if there's no cached data and no query attempt was finished yet. - */ - isPending: boolean; - /** - * Will be `true` if the query failed while fetching for the first time. - */ - isLoadingError: boolean; - /** - * @deprecated `isInitialLoading` is being deprecated in favor of `isLoading` - * and will be removed in the next major version. - */ - isInitialLoading: boolean; - /** - * A derived boolean from the `fetchStatus` variable, provided for convenience. - * - The query wanted to fetch, but has been `paused`. - */ - isPaused: boolean; - /** - * Will be `true` if the data shown is the placeholder data. - */ - isPlaceholderData: boolean; - /** - * Will be `true` if the query failed while refetching. - */ - isRefetchError: boolean; - /** - * Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - * - Is the same as `isFetching && !isPending`. - */ - isRefetching: boolean; - /** - * Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. - */ - isStale: boolean; - /** - * A derived boolean from the `status` variable, provided for convenience. - * - `true` if the query has received a response with no errors and is ready to display its data. - */ - isSuccess: boolean; - /** - * `true` if this observer is enabled, `false` otherwise. - */ - isEnabled: boolean; - /** - * A function to manually refetch the query. - */ - refetch: (options?: RefetchOptions) => Promise>; - /** - * The status of the query. - * - Will be: - * - `pending` if there's no cached data and no query attempt was finished yet. - * - `error` if the query attempt resulted in an error. - * - `success` if the query has received a response with no errors and is ready to display its data. - */ - status: QueryStatus; - /** - * The fetch status of the query. - * - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. - * - `paused`: The query wanted to fetch, but has been `paused`. - * - `idle`: The query is not fetching. - * - See [Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information. - */ - fetchStatus: FetchStatus; - /** - * A stable promise that will be resolved with the data of the query. - * Requires the `experimental_prefetchInRender` feature flag to be enabled. - * @example - * - * ### Enabling the feature flag - * ```ts - * const client = new QueryClient({ - * defaultOptions: { - * queries: { - * experimental_prefetchInRender: true, - * }, - * }, - * }) - * ``` - * - * ### Usage - * ```tsx - * import { useQuery } from '@tanstack/react-query' - * import React from 'react' - * import { fetchTodos, type Todo } from './api' - * - * function TodoList({ query }: { query: UseQueryResult }) { - * const data = React.use(query.promise) - * - * return ( - *
    - * {data.map(todo => ( - *
  • {todo.title}
  • - * ))} - *
- * ) - * } - * - * export function App() { - * const query = useQuery({ queryKey: ['todos'], queryFn: fetchTodos }) - * - * return ( - * <> - *

Todos

- * Loading...}> - * - * - * - * ) - * } - * ``` - */ - promise: Promise; -} -interface QueryObserverPendingResult extends QueryObserverBaseResult { - data: undefined; - error: null; - isError: false; - isPending: true; - isLoadingError: false; - isRefetchError: false; - isSuccess: false; - isPlaceholderData: false; - status: 'pending'; -} -interface QueryObserverLoadingResult extends QueryObserverBaseResult { - data: undefined; - error: null; - isError: false; - isPending: true; - isLoading: true; - isLoadingError: false; - isRefetchError: false; - isSuccess: false; - isPlaceholderData: false; - status: 'pending'; -} -interface QueryObserverLoadingErrorResult extends QueryObserverBaseResult { - data: undefined; - error: TError; - isError: true; - isPending: false; - isLoading: false; - isLoadingError: true; - isRefetchError: false; - isSuccess: false; - isPlaceholderData: false; - status: 'error'; -} -interface QueryObserverRefetchErrorResult extends QueryObserverBaseResult { - data: TData; - error: TError; - isError: true; - isPending: false; - isLoading: false; - isLoadingError: false; - isRefetchError: true; - isSuccess: false; - isPlaceholderData: false; - status: 'error'; -} -interface QueryObserverSuccessResult extends QueryObserverBaseResult { - data: TData; - error: null; - isError: false; - isPending: false; - isLoading: false; - isLoadingError: false; - isRefetchError: false; - isSuccess: true; - isPlaceholderData: false; - status: 'success'; -} -interface QueryObserverPlaceholderResult extends QueryObserverBaseResult { - data: TData; - isError: false; - error: null; - isPending: false; - isLoading: false; - isLoadingError: false; - isRefetchError: false; - isSuccess: true; - isPlaceholderData: true; - status: 'success'; -} -type DefinedQueryObserverResult = QueryObserverRefetchErrorResult | QueryObserverSuccessResult; -type QueryObserverResult = DefinedQueryObserverResult | QueryObserverLoadingErrorResult | QueryObserverLoadingResult | QueryObserverPendingResult | QueryObserverPlaceholderResult; -interface InfiniteQueryObserverBaseResult extends QueryObserverBaseResult { - /** - * This function allows you to fetch the next "page" of results. - */ - fetchNextPage: (options?: FetchNextPageOptions) => Promise>; - /** - * This function allows you to fetch the previous "page" of results. - */ - fetchPreviousPage: (options?: FetchPreviousPageOptions) => Promise>; - /** - * Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). - */ - hasNextPage: boolean; - /** - * Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). - */ - hasPreviousPage: boolean; - /** - * Will be `true` if the query failed while fetching the next page. - */ - isFetchNextPageError: boolean; - /** - * Will be `true` while fetching the next page with `fetchNextPage`. - */ - isFetchingNextPage: boolean; - /** - * Will be `true` if the query failed while fetching the previous page. - */ - isFetchPreviousPageError: boolean; - /** - * Will be `true` while fetching the previous page with `fetchPreviousPage`. - */ - isFetchingPreviousPage: boolean; -} -interface InfiniteQueryObserverPendingResult extends InfiniteQueryObserverBaseResult { - data: undefined; - error: null; - isError: false; - isPending: true; - isLoadingError: false; - isRefetchError: false; - isFetchNextPageError: false; - isFetchPreviousPageError: false; - isSuccess: false; - isPlaceholderData: false; - status: 'pending'; -} -interface InfiniteQueryObserverLoadingResult extends InfiniteQueryObserverBaseResult { - data: undefined; - error: null; - isError: false; - isPending: true; - isLoading: true; - isLoadingError: false; - isRefetchError: false; - isFetchNextPageError: false; - isFetchPreviousPageError: false; - isSuccess: false; - isPlaceholderData: false; - status: 'pending'; -} -interface InfiniteQueryObserverLoadingErrorResult extends InfiniteQueryObserverBaseResult { - data: undefined; - error: TError; - isError: true; - isPending: false; - isLoading: false; - isLoadingError: true; - isRefetchError: false; - isFetchNextPageError: false; - isFetchPreviousPageError: false; - isSuccess: false; - isPlaceholderData: false; - status: 'error'; -} -interface InfiniteQueryObserverRefetchErrorResult extends InfiniteQueryObserverBaseResult { - data: TData; - error: TError; - isError: true; - isPending: false; - isLoading: false; - isLoadingError: false; - isRefetchError: true; - isSuccess: false; - isPlaceholderData: false; - status: 'error'; -} -interface InfiniteQueryObserverSuccessResult extends InfiniteQueryObserverBaseResult { - data: TData; - error: null; - isError: false; - isPending: false; - isLoading: false; - isLoadingError: false; - isRefetchError: false; - isFetchNextPageError: false; - isFetchPreviousPageError: false; - isSuccess: true; - isPlaceholderData: false; - status: 'success'; -} -interface InfiniteQueryObserverPlaceholderResult extends InfiniteQueryObserverBaseResult { - data: TData; - isError: false; - error: null; - isPending: false; - isLoading: false; - isLoadingError: false; - isRefetchError: false; - isSuccess: true; - isPlaceholderData: true; - isFetchNextPageError: false; - isFetchPreviousPageError: false; - status: 'success'; -} -type DefinedInfiniteQueryObserverResult = InfiniteQueryObserverRefetchErrorResult | InfiniteQueryObserverSuccessResult; -type InfiniteQueryObserverResult = DefinedInfiniteQueryObserverResult | InfiniteQueryObserverLoadingErrorResult | InfiniteQueryObserverLoadingResult | InfiniteQueryObserverPendingResult | InfiniteQueryObserverPlaceholderResult; -type MutationKey = Register extends { - mutationKey: infer TMutationKey; -} ? TMutationKey extends ReadonlyArray ? TMutationKey : TMutationKey extends Array ? TMutationKey : ReadonlyArray : ReadonlyArray; -type MutationStatus = 'idle' | 'pending' | 'success' | 'error'; -type MutationScope = { - id: string; -}; -type MutationMeta = Register extends { - mutationMeta: infer TMutationMeta; -} ? TMutationMeta extends Record ? TMutationMeta : Record : Record; -type MutationFunctionContext = { - client: QueryClient; - meta: MutationMeta | undefined; - mutationKey?: MutationKey; -}; -type MutationFunction = (variables: TVariables, context: MutationFunctionContext) => Promise; -interface MutationOptions { - mutationFn?: MutationFunction; - mutationKey?: MutationKey; - onMutate?: (variables: TVariables, context: MutationFunctionContext) => Promise | TOnMutateResult; - onSuccess?: (data: TData, variables: TVariables, onMutateResult: TOnMutateResult, context: MutationFunctionContext) => Promise | unknown; - onError?: (error: TError, variables: TVariables, onMutateResult: TOnMutateResult | undefined, context: MutationFunctionContext) => Promise | unknown; - onSettled?: (data: TData | undefined, error: TError | null, variables: TVariables, onMutateResult: TOnMutateResult | undefined, context: MutationFunctionContext) => Promise | unknown; - retry?: RetryValue; - retryDelay?: RetryDelayValue; - networkMode?: NetworkMode; - gcTime?: number; - _defaulted?: boolean; - meta?: MutationMeta; - scope?: MutationScope; -} -interface MutationObserverOptions extends MutationOptions { - throwOnError?: boolean | ((error: TError) => boolean); -} -interface MutateOptions { - onSuccess?: (data: TData, variables: TVariables, onMutateResult: TOnMutateResult | undefined, context: MutationFunctionContext) => void; - onError?: (error: TError, variables: TVariables, onMutateResult: TOnMutateResult | undefined, context: MutationFunctionContext) => void; - onSettled?: (data: TData | undefined, error: TError | null, variables: TVariables, onMutateResult: TOnMutateResult | undefined, context: MutationFunctionContext) => void; -} -type MutateFunction = (variables: TVariables, options?: MutateOptions) => Promise; -interface MutationObserverBaseResult extends MutationState { - /** - * The last successfully resolved data for the mutation. - */ - data: TData | undefined; - /** - * The variables object passed to the `mutationFn`. - */ - variables: TVariables | undefined; - /** - * The error object for the mutation, if an error was encountered. - * - Defaults to `null`. - */ - error: TError | null; - /** - * A boolean variable derived from `status`. - * - `true` if the last mutation attempt resulted in an error. - */ - isError: boolean; - /** - * A boolean variable derived from `status`. - * - `true` if the mutation is in its initial state prior to executing. - */ - isIdle: boolean; - /** - * A boolean variable derived from `status`. - * - `true` if the mutation is currently executing. - */ - isPending: boolean; - /** - * A boolean variable derived from `status`. - * - `true` if the last mutation attempt was successful. - */ - isSuccess: boolean; - /** - * The status of the mutation. - * - Will be: - * - `idle` initial status prior to the mutation function executing. - * - `pending` if the mutation is currently executing. - * - `error` if the last mutation attempt resulted in an error. - * - `success` if the last mutation attempt was successful. - */ - status: MutationStatus; - /** - * The mutation function you can call with variables to trigger the mutation and optionally hooks on additional callback options. - * @param variables - The variables object to pass to the `mutationFn`. - * @param options.onSuccess - This function will fire when the mutation is successful and will be passed the mutation's result. - * @param options.onError - This function will fire if the mutation encounters an error and will be passed the error. - * @param options.onSettled - This function will fire when the mutation is either successfully fetched or encounters an error and be passed either the data or error. - * @remarks - * - If you make multiple requests, `onSuccess` will fire only after the latest call you've made. - * - All the callback functions (`onSuccess`, `onError`, `onSettled`) are void functions, and the returned value will be ignored. - */ - mutate: MutateFunction; - /** - * A function to clean the mutation internal state (i.e., it resets the mutation to its initial state). - */ - reset: () => void; -} -interface MutationObserverIdleResult extends MutationObserverBaseResult { - data: undefined; - variables: undefined; - error: null; - isError: false; - isIdle: true; - isPending: false; - isSuccess: false; - status: 'idle'; -} -interface MutationObserverLoadingResult extends MutationObserverBaseResult { - data: undefined; - variables: TVariables; - error: null; - isError: false; - isIdle: false; - isPending: true; - isSuccess: false; - status: 'pending'; -} -interface MutationObserverErrorResult extends MutationObserverBaseResult { - data: undefined; - error: TError; - variables: TVariables; - isError: true; - isIdle: false; - isPending: false; - isSuccess: false; - status: 'error'; -} -interface MutationObserverSuccessResult extends MutationObserverBaseResult { - data: TData; - error: null; - variables: TVariables; - isError: false; - isIdle: false; - isPending: false; - isSuccess: true; - status: 'success'; -} -type MutationObserverResult = MutationObserverIdleResult | MutationObserverLoadingResult | MutationObserverErrorResult | MutationObserverSuccessResult; -interface QueryClientConfig { - queryCache?: QueryCache; - mutationCache?: MutationCache; - defaultOptions?: DefaultOptions; -} -interface DefaultOptions { - queries?: OmitKeyof, 'suspense' | 'queryKey'>; - mutations?: MutationObserverOptions; - hydrate?: HydrateOptions['defaultOptions']; - dehydrate?: DehydrateOptions; -} -interface CancelOptions { - revert?: boolean; - silent?: boolean; -} -interface SetDataOptions { - updatedAt?: number; -} -type NotifyEventType = 'added' | 'removed' | 'updated' | 'observerAdded' | 'observerRemoved' | 'observerResultsUpdated' | 'observerOptionsUpdated'; -interface NotifyEvent { - type: NotifyEventType; -} - -type TransformerFn = (data: any) => any; -interface DehydrateOptions { - serializeData?: TransformerFn; - shouldDehydrateMutation?: (mutation: Mutation) => boolean; - shouldDehydrateQuery?: (query: Query) => boolean; - shouldRedactErrors?: (error: unknown) => boolean; -} -interface HydrateOptions { - defaultOptions?: { - deserializeData?: TransformerFn; - queries?: QueryOptions; - mutations?: MutationOptions; - }; -} -interface DehydratedMutation { - mutationKey?: MutationKey; - state: MutationState; - meta?: MutationMeta; - scope?: MutationScope; -} -interface DehydratedQuery { - queryHash: string; - queryKey: QueryKey; - state: QueryState; - promise?: Promise; - meta?: QueryMeta; - dehydratedAt?: number; -} -interface DehydratedState { - mutations: Array; - queries: Array; -} -declare function defaultShouldDehydrateMutation(mutation: Mutation): boolean; -declare function defaultShouldDehydrateQuery(query: Query): boolean; -declare function dehydrate(client: QueryClient, options?: DehydrateOptions): DehydratedState; -declare function hydrate(client: QueryClient, dehydratedState: unknown, options?: HydrateOptions): void; - -export { type Enabled as $, type QueryState as A, type DistributiveOmit as B, CancelledError as C, type DehydratedState as D, type Override as E, type NoInfer as F, type DefaultError as G, type HydrateOptions as H, type QueryKey as I, dataTagSymbol as J, dataTagErrorSymbol as K, unsetMarker as L, MutationCache as M, type NonUndefinedGuard as N, type OmitKeyof as O, type UnsetMarker as P, QueryCache as Q, type Register as R, type SkipToken as S, type AnyDataTag as T, type Updater as U, type DataTag as V, type InferDataFromTag as W, type InferErrorFromTag as X, type QueryFunction as Y, type StaleTime as Z, type StaleTimeFunction as _, defaultShouldDehydrateQuery as a, type MutationObserverBaseResult as a$, type QueryPersister as a0, type QueryFunctionContext as a1, type InitialDataFunction as a2, type PlaceholderDataFunction as a3, type QueriesPlaceholderDataFunction as a4, type QueryKeyHashFunction as a5, type GetPreviousPageParamFunction as a6, type GetNextPageParamFunction as a7, type InfiniteData as a8, type QueryMeta as a9, type QueryObserverPendingResult as aA, type QueryObserverLoadingResult as aB, type QueryObserverLoadingErrorResult as aC, type QueryObserverRefetchErrorResult as aD, type QueryObserverSuccessResult as aE, type QueryObserverPlaceholderResult as aF, type DefinedQueryObserverResult as aG, type QueryObserverResult as aH, type InfiniteQueryObserverBaseResult as aI, type InfiniteQueryObserverPendingResult as aJ, type InfiniteQueryObserverLoadingResult as aK, type InfiniteQueryObserverLoadingErrorResult as aL, type InfiniteQueryObserverRefetchErrorResult as aM, type InfiniteQueryObserverSuccessResult as aN, type InfiniteQueryObserverPlaceholderResult as aO, type DefinedInfiniteQueryObserverResult as aP, type InfiniteQueryObserverResult as aQ, type MutationKey as aR, type MutationStatus as aS, type MutationScope as aT, type MutationMeta as aU, type MutationFunctionContext as aV, type MutationFunction as aW, type MutationOptions as aX, type MutationObserverOptions as aY, type MutateOptions as aZ, type MutateFunction as a_, type NetworkMode as aa, type NotifyOnChangeProps as ab, type QueryOptions as ac, type InitialPageParam as ad, type InfiniteQueryPageParamsOptions as ae, type ThrowOnError as af, type QueryObserverOptions as ag, type WithRequired as ah, type DefaultedQueryObserverOptions as ai, type InfiniteQueryObserverOptions as aj, type DefaultedInfiniteQueryObserverOptions as ak, type FetchQueryOptions as al, type EnsureQueryDataOptions as am, type EnsureInfiniteQueryDataOptions as an, type FetchInfiniteQueryOptions as ao, type ResultOptions as ap, type RefetchOptions as aq, type InvalidateQueryFilters as ar, type RefetchQueryFilters as as, type InvalidateOptions as at, type ResetOptions as au, type FetchNextPageOptions as av, type FetchPreviousPageOptions as aw, type QueryStatus as ax, type FetchStatus as ay, type QueryObserverBaseResult as az, dehydrate as b, type MutationObserverIdleResult as b0, type MutationObserverLoadingResult as b1, type MutationObserverErrorResult as b2, type MutationObserverSuccessResult as b3, type MutationObserverResult as b4, type QueryClientConfig as b5, type DefaultOptions as b6, type CancelOptions as b7, type SetDataOptions as b8, type NotifyEventType as b9, addConsumeAwareSignal as bA, type QueryStore as bB, type Retryer as bC, type RetryValue as bD, type RetryDelayValue as bE, canFetch as bF, createRetryer as bG, type NotifyEvent as ba, type QueryBehavior as bb, type FetchContext as bc, type FetchDirection as bd, type FetchMeta as be, type FetchOptions as bf, type Action$1 as bg, type SetStateOptions as bh, fetchState as bi, type Action as bj, getDefaultState as bk, type QueryTypeFilter as bl, functionalUpdate as bm, isValidTimeout as bn, timeUntilStale as bo, resolveStaleTime as bp, resolveEnabled as bq, hashQueryKeyByOptions as br, shallowEqualObjects as bs, isPlainArray as bt, isPlainObject as bu, sleep as bv, replaceData as bw, addToEnd as bx, addToStart as by, ensureQueryFn as bz, type MutationCacheNotifyEvent as c, defaultShouldDehydrateMutation as d, MutationObserver as e, type QueryCacheNotifyEvent as f, QueryClient as g, hydrate as h, QueryObserver as i, isCancelledError as j, hashKey as k, isServer as l, keepPreviousData as m, matchMutation as n, matchQuery as o, noop as p, partialMatchKey as q, replaceEqualDeep as r, shouldThrowError as s, skipToken as t, type MutationFilters as u, type QueryFilters as v, type DehydrateOptions as w, Mutation as x, type MutationState as y, Query as z }; diff --git a/node_modules/@tanstack/query-core/build/modern/hydration.cjs b/node_modules/@tanstack/query-core/build/modern/hydration.cjs deleted file mode 100644 index f5fd1a2..0000000 --- a/node_modules/@tanstack/query-core/build/modern/hydration.cjs +++ /dev/null @@ -1,173 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// src/hydration.ts -var hydration_exports = {}; -__export(hydration_exports, { - defaultShouldDehydrateMutation: () => defaultShouldDehydrateMutation, - defaultShouldDehydrateQuery: () => defaultShouldDehydrateQuery, - dehydrate: () => dehydrate, - hydrate: () => hydrate -}); -module.exports = __toCommonJS(hydration_exports); -var import_thenable = require("./thenable.cjs"); -var import_utils = require("./utils.cjs"); -function defaultTransformerFn(data) { - return data; -} -function dehydrateMutation(mutation) { - return { - mutationKey: mutation.options.mutationKey, - state: mutation.state, - ...mutation.options.scope && { scope: mutation.options.scope }, - ...mutation.meta && { meta: mutation.meta } - }; -} -function dehydrateQuery(query, serializeData, shouldRedactErrors) { - const dehydratePromise = () => { - const promise = query.promise?.then(serializeData).catch((error) => { - if (!shouldRedactErrors(error)) { - return Promise.reject(error); - } - if (process.env.NODE_ENV !== "production") { - console.error( - `A query that was dehydrated as pending ended up rejecting. [${query.queryHash}]: ${error}; The error will be redacted in production builds` - ); - } - return Promise.reject(new Error("redacted")); - }); - promise?.catch(import_utils.noop); - return promise; - }; - return { - dehydratedAt: Date.now(), - state: { - ...query.state, - ...query.state.data !== void 0 && { - data: serializeData(query.state.data) - } - }, - queryKey: query.queryKey, - queryHash: query.queryHash, - ...query.state.status === "pending" && { - promise: dehydratePromise() - }, - ...query.meta && { meta: query.meta } - }; -} -function defaultShouldDehydrateMutation(mutation) { - return mutation.state.isPaused; -} -function defaultShouldDehydrateQuery(query) { - return query.state.status === "success"; -} -function defaultShouldRedactErrors(_) { - return true; -} -function dehydrate(client, options = {}) { - const filterMutation = options.shouldDehydrateMutation ?? client.getDefaultOptions().dehydrate?.shouldDehydrateMutation ?? defaultShouldDehydrateMutation; - const mutations = client.getMutationCache().getAll().flatMap( - (mutation) => filterMutation(mutation) ? [dehydrateMutation(mutation)] : [] - ); - const filterQuery = options.shouldDehydrateQuery ?? client.getDefaultOptions().dehydrate?.shouldDehydrateQuery ?? defaultShouldDehydrateQuery; - const shouldRedactErrors = options.shouldRedactErrors ?? client.getDefaultOptions().dehydrate?.shouldRedactErrors ?? defaultShouldRedactErrors; - const serializeData = options.serializeData ?? client.getDefaultOptions().dehydrate?.serializeData ?? defaultTransformerFn; - const queries = client.getQueryCache().getAll().flatMap( - (query) => filterQuery(query) ? [dehydrateQuery(query, serializeData, shouldRedactErrors)] : [] - ); - return { mutations, queries }; -} -function hydrate(client, dehydratedState, options) { - if (typeof dehydratedState !== "object" || dehydratedState === null) { - return; - } - const mutationCache = client.getMutationCache(); - const queryCache = client.getQueryCache(); - const deserializeData = options?.defaultOptions?.deserializeData ?? client.getDefaultOptions().hydrate?.deserializeData ?? defaultTransformerFn; - const mutations = dehydratedState.mutations || []; - const queries = dehydratedState.queries || []; - mutations.forEach(({ state, ...mutationOptions }) => { - mutationCache.build( - client, - { - ...client.getDefaultOptions().hydrate?.mutations, - ...options?.defaultOptions?.mutations, - ...mutationOptions - }, - state - ); - }); - queries.forEach( - ({ queryKey, state, queryHash, meta, promise, dehydratedAt }) => { - const syncData = promise ? (0, import_thenable.tryResolveSync)(promise) : void 0; - const rawData = state.data === void 0 ? syncData?.data : state.data; - const data = rawData === void 0 ? rawData : deserializeData(rawData); - let query = queryCache.get(queryHash); - const existingQueryIsPending = query?.state.status === "pending"; - const existingQueryIsFetching = query?.state.fetchStatus === "fetching"; - if (query) { - const hasNewerSyncData = syncData && // We only need this undefined check to handle older dehydration - // payloads that might not have dehydratedAt - dehydratedAt !== void 0 && dehydratedAt > query.state.dataUpdatedAt; - if (state.dataUpdatedAt > query.state.dataUpdatedAt || hasNewerSyncData) { - const { fetchStatus: _ignored, ...serializedState } = state; - query.setState({ - ...serializedState, - data - }); - } - } else { - query = queryCache.build( - client, - { - ...client.getDefaultOptions().hydrate?.queries, - ...options?.defaultOptions?.queries, - queryKey, - queryHash, - meta - }, - // Reset fetch status to idle to avoid - // query being stuck in fetching state upon hydration - { - ...state, - data, - fetchStatus: "idle", - status: data !== void 0 ? "success" : state.status - } - ); - } - if (promise && !existingQueryIsPending && !existingQueryIsFetching && // Only hydrate if dehydration is newer than any existing data, - // this is always true for new queries - (dehydratedAt === void 0 || dehydratedAt > query.state.dataUpdatedAt)) { - query.fetch(void 0, { - // RSC transformed promises are not thenable - initialPromise: Promise.resolve(promise).then(deserializeData) - }).catch(import_utils.noop); - } - } - ); -} -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - defaultShouldDehydrateMutation, - defaultShouldDehydrateQuery, - dehydrate, - hydrate -}); -//# sourceMappingURL=hydration.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/hydration.cjs.map b/node_modules/@tanstack/query-core/build/modern/hydration.cjs.map deleted file mode 100644 index ba920cb..0000000 --- a/node_modules/@tanstack/query-core/build/modern/hydration.cjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/hydration.ts"],"sourcesContent":["import { tryResolveSync } from './thenable'\nimport { noop } from './utils'\nimport type {\n DefaultError,\n MutationKey,\n MutationMeta,\n MutationOptions,\n MutationScope,\n QueryKey,\n QueryMeta,\n QueryOptions,\n} from './types'\nimport type { QueryClient } from './queryClient'\nimport type { Query, QueryState } from './query'\nimport type { Mutation, MutationState } from './mutation'\n\n// TYPES\ntype TransformerFn = (data: any) => any\nfunction defaultTransformerFn(data: any): any {\n return data\n}\n\nexport interface DehydrateOptions {\n serializeData?: TransformerFn\n shouldDehydrateMutation?: (mutation: Mutation) => boolean\n shouldDehydrateQuery?: (query: Query) => boolean\n shouldRedactErrors?: (error: unknown) => boolean\n}\n\nexport interface HydrateOptions {\n defaultOptions?: {\n deserializeData?: TransformerFn\n queries?: QueryOptions\n mutations?: MutationOptions\n }\n}\n\ninterface DehydratedMutation {\n mutationKey?: MutationKey\n state: MutationState\n meta?: MutationMeta\n scope?: MutationScope\n}\n\ninterface DehydratedQuery {\n queryHash: string\n queryKey: QueryKey\n state: QueryState\n promise?: Promise\n meta?: QueryMeta\n // This is only optional because older versions of Query might have dehydrated\n // without it which we need to handle for backwards compatibility.\n // This should be changed to required in the future.\n dehydratedAt?: number\n}\n\nexport interface DehydratedState {\n mutations: Array\n queries: Array\n}\n\n// FUNCTIONS\n\nfunction dehydrateMutation(mutation: Mutation): DehydratedMutation {\n return {\n mutationKey: mutation.options.mutationKey,\n state: mutation.state,\n ...(mutation.options.scope && { scope: mutation.options.scope }),\n ...(mutation.meta && { meta: mutation.meta }),\n }\n}\n\n// Most config is not dehydrated but instead meant to configure again when\n// consuming the de/rehydrated data, typically with useQuery on the client.\n// Sometimes it might make sense to prefetch data on the server and include\n// in the html-payload, but not consume it on the initial render.\nfunction dehydrateQuery(\n query: Query,\n serializeData: TransformerFn,\n shouldRedactErrors: (error: unknown) => boolean,\n): DehydratedQuery {\n const dehydratePromise = () => {\n const promise = query.promise?.then(serializeData).catch((error) => {\n if (!shouldRedactErrors(error)) {\n // Reject original error if it should not be redacted\n return Promise.reject(error)\n }\n // If not in production, log original error before rejecting redacted error\n if (process.env.NODE_ENV !== 'production') {\n console.error(\n `A query that was dehydrated as pending ended up rejecting. [${query.queryHash}]: ${error}; The error will be redacted in production builds`,\n )\n }\n return Promise.reject(new Error('redacted'))\n })\n\n // Avoid unhandled promise rejections\n // We need the promise we dehydrate to reject to get the correct result into\n // the query cache, but we also want to avoid unhandled promise rejections\n // in whatever environment the prefetches are happening in.\n promise?.catch(noop)\n\n return promise\n }\n\n return {\n dehydratedAt: Date.now(),\n state: {\n ...query.state,\n ...(query.state.data !== undefined && {\n data: serializeData(query.state.data),\n }),\n },\n queryKey: query.queryKey,\n queryHash: query.queryHash,\n ...(query.state.status === 'pending' && {\n promise: dehydratePromise(),\n }),\n ...(query.meta && { meta: query.meta }),\n }\n}\n\nexport function defaultShouldDehydrateMutation(mutation: Mutation) {\n return mutation.state.isPaused\n}\n\nexport function defaultShouldDehydrateQuery(query: Query) {\n return query.state.status === 'success'\n}\n\nfunction defaultShouldRedactErrors(_: unknown) {\n return true\n}\n\nexport function dehydrate(\n client: QueryClient,\n options: DehydrateOptions = {},\n): DehydratedState {\n const filterMutation =\n options.shouldDehydrateMutation ??\n client.getDefaultOptions().dehydrate?.shouldDehydrateMutation ??\n defaultShouldDehydrateMutation\n\n const mutations = client\n .getMutationCache()\n .getAll()\n .flatMap((mutation) =>\n filterMutation(mutation) ? [dehydrateMutation(mutation)] : [],\n )\n\n const filterQuery =\n options.shouldDehydrateQuery ??\n client.getDefaultOptions().dehydrate?.shouldDehydrateQuery ??\n defaultShouldDehydrateQuery\n\n const shouldRedactErrors =\n options.shouldRedactErrors ??\n client.getDefaultOptions().dehydrate?.shouldRedactErrors ??\n defaultShouldRedactErrors\n\n const serializeData =\n options.serializeData ??\n client.getDefaultOptions().dehydrate?.serializeData ??\n defaultTransformerFn\n\n const queries = client\n .getQueryCache()\n .getAll()\n .flatMap((query) =>\n filterQuery(query)\n ? [dehydrateQuery(query, serializeData, shouldRedactErrors)]\n : [],\n )\n\n return { mutations, queries }\n}\n\nexport function hydrate(\n client: QueryClient,\n dehydratedState: unknown,\n options?: HydrateOptions,\n): void {\n if (typeof dehydratedState !== 'object' || dehydratedState === null) {\n return\n }\n\n const mutationCache = client.getMutationCache()\n const queryCache = client.getQueryCache()\n const deserializeData =\n options?.defaultOptions?.deserializeData ??\n client.getDefaultOptions().hydrate?.deserializeData ??\n defaultTransformerFn\n\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n const mutations = (dehydratedState as DehydratedState).mutations || []\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n const queries = (dehydratedState as DehydratedState).queries || []\n\n mutations.forEach(({ state, ...mutationOptions }) => {\n mutationCache.build(\n client,\n {\n ...client.getDefaultOptions().hydrate?.mutations,\n ...options?.defaultOptions?.mutations,\n ...mutationOptions,\n },\n state,\n )\n })\n\n queries.forEach(\n ({ queryKey, state, queryHash, meta, promise, dehydratedAt }) => {\n const syncData = promise ? tryResolveSync(promise) : undefined\n const rawData = state.data === undefined ? syncData?.data : state.data\n const data = rawData === undefined ? rawData : deserializeData(rawData)\n\n let query = queryCache.get(queryHash)\n const existingQueryIsPending = query?.state.status === 'pending'\n const existingQueryIsFetching = query?.state.fetchStatus === 'fetching'\n\n // Do not hydrate if an existing query exists with newer data\n if (query) {\n const hasNewerSyncData =\n syncData &&\n // We only need this undefined check to handle older dehydration\n // payloads that might not have dehydratedAt\n dehydratedAt !== undefined &&\n dehydratedAt > query.state.dataUpdatedAt\n if (\n state.dataUpdatedAt > query.state.dataUpdatedAt ||\n hasNewerSyncData\n ) {\n // omit fetchStatus from dehydrated state\n // so that query stays in its current fetchStatus\n const { fetchStatus: _ignored, ...serializedState } = state\n query.setState({\n ...serializedState,\n data,\n })\n }\n } else {\n // Restore query\n query = queryCache.build(\n client,\n {\n ...client.getDefaultOptions().hydrate?.queries,\n ...options?.defaultOptions?.queries,\n queryKey,\n queryHash,\n meta,\n },\n // Reset fetch status to idle to avoid\n // query being stuck in fetching state upon hydration\n {\n ...state,\n data,\n fetchStatus: 'idle',\n status: data !== undefined ? 'success' : state.status,\n },\n )\n }\n\n if (\n promise &&\n !existingQueryIsPending &&\n !existingQueryIsFetching &&\n // Only hydrate if dehydration is newer than any existing data,\n // this is always true for new queries\n (dehydratedAt === undefined || dehydratedAt > query.state.dataUpdatedAt)\n ) {\n // This doesn't actually fetch - it just creates a retryer\n // which will re-use the passed `initialPromise`\n // Note that we need to call these even when data was synchronously\n // available, as we still need to set up the retryer\n query\n .fetch(undefined, {\n // RSC transformed promises are not thenable\n initialPromise: Promise.resolve(promise).then(deserializeData),\n })\n // Avoid unhandled promise rejections\n .catch(noop)\n }\n },\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,sBAA+B;AAC/B,mBAAqB;AAiBrB,SAAS,qBAAqB,MAAgB;AAC5C,SAAO;AACT;AA2CA,SAAS,kBAAkB,UAAwC;AACjE,SAAO;AAAA,IACL,aAAa,SAAS,QAAQ;AAAA,IAC9B,OAAO,SAAS;AAAA,IAChB,GAAI,SAAS,QAAQ,SAAS,EAAE,OAAO,SAAS,QAAQ,MAAM;AAAA,IAC9D,GAAI,SAAS,QAAQ,EAAE,MAAM,SAAS,KAAK;AAAA,EAC7C;AACF;AAMA,SAAS,eACP,OACA,eACA,oBACiB;AACjB,QAAM,mBAAmB,MAAM;AAC7B,UAAM,UAAU,MAAM,SAAS,KAAK,aAAa,EAAE,MAAM,CAAC,UAAU;AAClE,UAAI,CAAC,mBAAmB,KAAK,GAAG;AAE9B,eAAO,QAAQ,OAAO,KAAK;AAAA,MAC7B;AAEA,UAAI,QAAQ,IAAI,aAAa,cAAc;AACzC,gBAAQ;AAAA,UACN,+DAA+D,MAAM,SAAS,MAAM,KAAK;AAAA,QAC3F;AAAA,MACF;AACA,aAAO,QAAQ,OAAO,IAAI,MAAM,UAAU,CAAC;AAAA,IAC7C,CAAC;AAMD,aAAS,MAAM,iBAAI;AAEnB,WAAO;AAAA,EACT;AAEA,SAAO;AAAA,IACL,cAAc,KAAK,IAAI;AAAA,IACvB,OAAO;AAAA,MACL,GAAG,MAAM;AAAA,MACT,GAAI,MA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GAAG;AAAA,YACH;AAAA,YACA,aAAa;AAAA,YACb,QAAQ,SAAS,SAAY,YAAY,MAAM;AAAA,UACjD;AAAA,QACF;AAAA,MACF;AAEA,UACE,WACA,CAAC,0BACD,CAAC;AAAA;AAAA,OAGA,iBAAiB,UAAa,eAAe,MAAM,MAAM,gBAC1D;AAKA,cACG,MAAM,QAAW;AAAA;AAAA,UAEhB,gBAAgB,QAAQ,QAAQ,OAAO,EAAE,KAAK,eAAe;AAAA,QAC/D,CAAC,EAEA,MAAM,iBAAI;AAAA,MACf;AAAA,IACF;AAAA,EACF;AACF;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/hydration.d.cts b/node_modules/@tanstack/query-core/build/modern/hydration.d.cts deleted file mode 100644 index 1681473..0000000 --- a/node_modules/@tanstack/query-core/build/modern/hydration.d.cts +++ /dev/null @@ -1,3 +0,0 @@ -export { w as DehydrateOptions, D as DehydratedState, H as HydrateOptions, d as defaultShouldDehydrateMutation, a as defaultShouldDehydrateQuery, b as dehydrate, h as hydrate } from './hydration-uphG6M-i.cjs'; -import './removable.cjs'; -import './subscribable.cjs'; diff --git a/node_modules/@tanstack/query-core/build/modern/hydration.d.ts b/node_modules/@tanstack/query-core/build/modern/hydration.d.ts deleted file mode 100644 index e507d39..0000000 --- a/node_modules/@tanstack/query-core/build/modern/hydration.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export { w as DehydrateOptions, D as DehydratedState, H as HydrateOptions, d as defaultShouldDehydrateMutation, a as defaultShouldDehydrateQuery, b as dehydrate, h as hydrate } from './hydration-BlEVG2Lp.js'; -import './removable.js'; -import './subscribable.js'; diff --git a/node_modules/@tanstack/query-core/build/modern/hydration.js b/node_modules/@tanstack/query-core/build/modern/hydration.js deleted file mode 100644 index 0e5e5ae..0000000 --- a/node_modules/@tanstack/query-core/build/modern/hydration.js +++ /dev/null @@ -1,145 +0,0 @@ -// src/hydration.ts -import { tryResolveSync } from "./thenable.js"; -import { noop } from "./utils.js"; -function defaultTransformerFn(data) { - return data; -} -function dehydrateMutation(mutation) { - return { - mutationKey: mutation.options.mutationKey, - state: mutation.state, - ...mutation.options.scope && { scope: mutation.options.scope }, - ...mutation.meta && { meta: mutation.meta } - }; -} -function dehydrateQuery(query, serializeData, shouldRedactErrors) { - const dehydratePromise = () => { - const promise = query.promise?.then(serializeData).catch((error) => { - if (!shouldRedactErrors(error)) { - return Promise.reject(error); - } - if (process.env.NODE_ENV !== "production") { - console.error( - `A query that was dehydrated as pending ended up rejecting. [${query.queryHash}]: ${error}; The error will be redacted in production builds` - ); - } - return Promise.reject(new Error("redacted")); - }); - promise?.catch(noop); - return promise; - }; - return { - dehydratedAt: Date.now(), - state: { - ...query.state, - ...query.state.data !== void 0 && { - data: serializeData(query.state.data) - } - }, - queryKey: query.queryKey, - queryHash: query.queryHash, - ...query.state.status === "pending" && { - promise: dehydratePromise() - }, - ...query.meta && { meta: query.meta } - }; -} -function defaultShouldDehydrateMutation(mutation) { - return mutation.state.isPaused; -} -function defaultShouldDehydrateQuery(query) { - return query.state.status === "success"; -} -function defaultShouldRedactErrors(_) { - return true; -} -function dehydrate(client, options = {}) { - const filterMutation = options.shouldDehydrateMutation ?? client.getDefaultOptions().dehydrate?.shouldDehydrateMutation ?? defaultShouldDehydrateMutation; - const mutations = client.getMutationCache().getAll().flatMap( - (mutation) => filterMutation(mutation) ? [dehydrateMutation(mutation)] : [] - ); - const filterQuery = options.shouldDehydrateQuery ?? client.getDefaultOptions().dehydrate?.shouldDehydrateQuery ?? defaultShouldDehydrateQuery; - const shouldRedactErrors = options.shouldRedactErrors ?? client.getDefaultOptions().dehydrate?.shouldRedactErrors ?? defaultShouldRedactErrors; - const serializeData = options.serializeData ?? client.getDefaultOptions().dehydrate?.serializeData ?? defaultTransformerFn; - const queries = client.getQueryCache().getAll().flatMap( - (query) => filterQuery(query) ? [dehydrateQuery(query, serializeData, shouldRedactErrors)] : [] - ); - return { mutations, queries }; -} -function hydrate(client, dehydratedState, options) { - if (typeof dehydratedState !== "object" || dehydratedState === null) { - return; - } - const mutationCache = client.getMutationCache(); - const queryCache = client.getQueryCache(); - const deserializeData = options?.defaultOptions?.deserializeData ?? client.getDefaultOptions().hydrate?.deserializeData ?? defaultTransformerFn; - const mutations = dehydratedState.mutations || []; - const queries = dehydratedState.queries || []; - mutations.forEach(({ state, ...mutationOptions }) => { - mutationCache.build( - client, - { - ...client.getDefaultOptions().hydrate?.mutations, - ...options?.defaultOptions?.mutations, - ...mutationOptions - }, - state - ); - }); - queries.forEach( - ({ queryKey, state, queryHash, meta, promise, dehydratedAt }) => { - const syncData = promise ? tryResolveSync(promise) : void 0; - const rawData = state.data === void 0 ? syncData?.data : state.data; - const data = rawData === void 0 ? rawData : deserializeData(rawData); - let query = queryCache.get(queryHash); - const existingQueryIsPending = query?.state.status === "pending"; - const existingQueryIsFetching = query?.state.fetchStatus === "fetching"; - if (query) { - const hasNewerSyncData = syncData && // We only need this undefined check to handle older dehydration - // payloads that might not have dehydratedAt - dehydratedAt !== void 0 && dehydratedAt > query.state.dataUpdatedAt; - if (state.dataUpdatedAt > query.state.dataUpdatedAt || hasNewerSyncData) { - const { fetchStatus: _ignored, ...serializedState } = state; - query.setState({ - ...serializedState, - data - }); - } - } else { - query = queryCache.build( - client, - { - ...client.getDefaultOptions().hydrate?.queries, - ...options?.defaultOptions?.queries, - queryKey, - queryHash, - meta - }, - // Reset fetch status to idle to avoid - // query being stuck in fetching state upon hydration - { - ...state, - data, - fetchStatus: "idle", - status: data !== void 0 ? "success" : state.status - } - ); - } - if (promise && !existingQueryIsPending && !existingQueryIsFetching && // Only hydrate if dehydration is newer than any existing data, - // this is always true for new queries - (dehydratedAt === void 0 || dehydratedAt > query.state.dataUpdatedAt)) { - query.fetch(void 0, { - // RSC transformed promises are not thenable - initialPromise: Promise.resolve(promise).then(deserializeData) - }).catch(noop); - } - } - ); -} -export { - defaultShouldDehydrateMutation, - defaultShouldDehydrateQuery, - dehydrate, - hydrate -}; -//# sourceMappingURL=hydration.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/hydration.js.map b/node_modules/@tanstack/query-core/build/modern/hydration.js.map deleted file mode 100644 index 98457e7..0000000 --- a/node_modules/@tanstack/query-core/build/modern/hydration.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/hydration.ts"],"sourcesContent":["import { tryResolveSync } from './thenable'\nimport { noop } from './utils'\nimport type {\n DefaultError,\n MutationKey,\n MutationMeta,\n MutationOptions,\n MutationScope,\n QueryKey,\n QueryMeta,\n QueryOptions,\n} from './types'\nimport type { QueryClient } from './queryClient'\nimport type { Query, QueryState } from './query'\nimport type { Mutation, MutationState } from './mutation'\n\n// TYPES\ntype TransformerFn = (data: any) => any\nfunction defaultTransformerFn(data: any): any {\n return data\n}\n\nexport interface DehydrateOptions {\n serializeData?: TransformerFn\n shouldDehydrateMutation?: (mutation: Mutation) => boolean\n shouldDehydrateQuery?: (query: Query) => boolean\n shouldRedactErrors?: (error: unknown) => boolean\n}\n\nexport interface HydrateOptions {\n defaultOptions?: {\n deserializeData?: TransformerFn\n queries?: QueryOptions\n mutations?: MutationOptions\n }\n}\n\ninterface DehydratedMutation {\n mutationKey?: MutationKey\n state: MutationState\n meta?: MutationMeta\n scope?: MutationScope\n}\n\ninterface DehydratedQuery {\n queryHash: string\n queryKey: QueryKey\n state: QueryState\n promise?: Promise\n meta?: QueryMeta\n // This is only optional because older versions of Query might have dehydrated\n // without it which we need to handle for backwards compatibility.\n // This should be changed to required in the future.\n dehydratedAt?: number\n}\n\nexport interface DehydratedState {\n mutations: Array\n queries: Array\n}\n\n// FUNCTIONS\n\nfunction dehydrateMutation(mutation: Mutation): DehydratedMutation {\n return {\n mutationKey: mutation.options.mutationKey,\n state: mutation.state,\n ...(mutation.options.scope && { scope: mutation.options.scope }),\n ...(mutation.meta && { meta: mutation.meta }),\n }\n}\n\n// Most config is not dehydrated but instead meant to configure again when\n// consuming the de/rehydrated data, typically with useQuery on the client.\n// Sometimes it might make sense to prefetch data on the server and include\n// in the html-payload, but not consume it on the initial render.\nfunction dehydrateQuery(\n query: Query,\n serializeData: TransformerFn,\n shouldRedactErrors: (error: unknown) => boolean,\n): DehydratedQuery {\n const dehydratePromise = () => {\n const promise = query.promise?.then(serializeData).catch((error) => {\n if (!shouldRedactErrors(error)) {\n // Reject original error if it should not be redacted\n return Promise.reject(error)\n }\n // If not in production, log original error before rejecting redacted error\n if (process.env.NODE_ENV !== 'production') {\n console.error(\n `A query that was dehydrated as pending ended up rejecting. [${query.queryHash}]: ${error}; The error will be redacted in production builds`,\n )\n }\n return Promise.reject(new Error('redacted'))\n })\n\n // Avoid unhandled promise rejections\n // We need the promise we dehydrate to reject to get the correct result into\n // the query cache, but we also want to avoid unhandled promise rejections\n // in whatever environment the prefetches are happening in.\n promise?.catch(noop)\n\n return promise\n }\n\n return {\n dehydratedAt: Date.now(),\n state: {\n ...query.state,\n ...(query.state.data !== undefined && {\n data: serializeData(query.state.data),\n }),\n },\n queryKey: query.queryKey,\n queryHash: query.queryHash,\n ...(query.state.status === 'pending' && {\n promise: dehydratePromise(),\n }),\n ...(query.meta && { meta: query.meta }),\n }\n}\n\nexport function defaultShouldDehydrateMutation(mutation: Mutation) {\n return mutation.state.isPaused\n}\n\nexport function defaultShouldDehydrateQuery(query: Query) {\n return query.state.status === 'success'\n}\n\nfunction defaultShouldRedactErrors(_: unknown) {\n return true\n}\n\nexport function dehydrate(\n client: QueryClient,\n options: DehydrateOptions = {},\n): DehydratedState {\n const filterMutation =\n options.shouldDehydrateMutation ??\n client.getDefaultOptions().dehydrate?.shouldDehydrateMutation ??\n defaultShouldDehydrateMutation\n\n const mutations = client\n .getMutationCache()\n .getAll()\n .flatMap((mutation) =>\n filterMutation(mutation) ? [dehydrateMutation(mutation)] : [],\n )\n\n const filterQuery =\n options.shouldDehydrateQuery ??\n client.getDefaultOptions().dehydrate?.shouldDehydrateQuery ??\n defaultShouldDehydrateQuery\n\n const shouldRedactErrors =\n options.shouldRedactErrors ??\n client.getDefaultOptions().dehydrate?.shouldRedactErrors ??\n defaultShouldRedactErrors\n\n const serializeData =\n options.serializeData ??\n client.getDefaultOptions().dehydrate?.serializeData ??\n defaultTransformerFn\n\n const queries = client\n .getQueryCache()\n .getAll()\n .flatMap((query) =>\n filterQuery(query)\n ? [dehydrateQuery(query, serializeData, shouldRedactErrors)]\n : [],\n )\n\n return { mutations, queries }\n}\n\nexport function hydrate(\n client: QueryClient,\n dehydratedState: unknown,\n options?: HydrateOptions,\n): void {\n if (typeof dehydratedState !== 'object' || dehydratedState === null) {\n return\n }\n\n const mutationCache = client.getMutationCache()\n const queryCache = client.getQueryCache()\n const deserializeData =\n options?.defaultOptions?.deserializeData ??\n client.getDefaultOptions().hydrate?.deserializeData ??\n defaultTransformerFn\n\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n const mutations = (dehydratedState as DehydratedState).mutations || []\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n const queries = (dehydratedState as DehydratedState).queries || []\n\n mutations.forEach(({ state, ...mutationOptions }) => {\n mutationCache.build(\n client,\n {\n ...client.getDefaultOptions().hydrate?.mutations,\n ...options?.defaultOptions?.mutations,\n ...mutationOptions,\n },\n state,\n )\n })\n\n queries.forEach(\n ({ queryKey, state, queryHash, meta, promise, dehydratedAt }) => {\n const syncData = promise ? tryResolveSync(promise) : undefined\n const rawData = state.data === undefined ? syncData?.data : state.data\n const data = rawData === undefined ? rawData : deserializeData(rawData)\n\n let query = queryCache.get(queryHash)\n const existingQueryIsPending = query?.state.status === 'pending'\n const existingQueryIsFetching = query?.state.fetchStatus === 'fetching'\n\n // Do not hydrate if an existing query exists with newer data\n if (query) {\n const hasNewerSyncData =\n syncData &&\n // We only need this undefined check to handle older dehydration\n // payloads that might not have dehydratedAt\n dehydratedAt !== undefined &&\n dehydratedAt > query.state.dataUpdatedAt\n if (\n state.dataUpdatedAt > query.state.dataUpdatedAt ||\n hasNewerSyncData\n ) {\n // omit fetchStatus from dehydrated state\n // so that query stays in its current fetchStatus\n const { fetchStatus: _ignored, ...serializedState } = state\n query.setState({\n ...serializedState,\n data,\n })\n }\n } else {\n // Restore query\n query = queryCache.build(\n client,\n {\n ...client.getDefaultOptions().hydrate?.queries,\n ...options?.defaultOptions?.queries,\n queryKey,\n queryHash,\n meta,\n },\n // Reset fetch status to idle to avoid\n // query being stuck in fetching state upon hydration\n {\n ...state,\n data,\n fetchStatus: 'idle',\n status: data !== undefined ? 'success' : state.status,\n },\n )\n }\n\n if (\n promise &&\n !existingQueryIsPending &&\n !existingQueryIsFetching &&\n // Only hydrate if dehydration is newer than any existing data,\n // this is always true for new queries\n (dehydratedAt === undefined || dehydratedAt > query.state.dataUpdatedAt)\n ) {\n // This doesn't actually fetch - it just creates a retryer\n // which will re-use the passed `initialPromise`\n // Note that we need to call these even when data was synchronously\n // available, as we still need to set up the retryer\n query\n .fetch(undefined, {\n // RSC transformed promises are not thenable\n initialPromise: Promise.resolve(promise).then(deserializeData),\n })\n // Avoid unhandled promise rejections\n .catch(noop)\n }\n },\n )\n}\n"],"mappings":";AAAA,SAAS,sBAAsB;AAC/B,SAAS,YAAY;AAiBrB,SAAS,qBAAqB,MAAgB;AAC5C,SAAO;AACT;AA2CA,SAAS,kBAAkB,UAAwC;AACjE,SAAO;AAAA,IACL,aAAa,SAAS,QAAQ;AAAA,IAC9B,OAAO,SAAS;AAAA,IAChB,GAAI,SAAS,QAAQ,SAAS,EAAE,OAAO,SAAS,QAAQ,MAAM;AAAA,IAC9D,GAAI,SAAS,QAAQ,EAAE,MAAM,SAAS,KAAK;AAAA,EAC7C;AACF;AAMA,SAAS,eACP,OACA,eACA,oBACiB;AACjB,QAAM,mBAAmB,MAAM;AAC7B,UAAM,UAAU,MAAM,SAAS,KAAK,aAAa,EAAE,MAAM,CAAC,UAAU;AAClE,UAAI,CAAC,mBAAmB,KAAK,GAAG;AAE9B,eAAO,QAAQ,OAAO,KAAK;AAAA,MAC7B;AAEA,UAAI,Q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Aa,UAAU,GAAG,gBAAgB,IAAI;AACtD,gBAAM,SAAS;AAAA,YACb,GAAG;AAAA,YACH;AAAA,UACF,CAAC;AAAA,QACH;AAAA,MACF,OAAO;AAEL,gBAAQ,WAAW;AAAA,UACjB;AAAA,UACA;AAAA,YACE,GAAG,OAAO,kBAAkB,EAAE,SAAS;AAAA,YACvC,GAAG,SAAS,gBAAgB;AAAA,YAC5B;AAAA,YACA;AAAA,YACA;AAAA,UACF;AAAA;AAAA;AAAA,UAGA;AAAA,YACE,GAAG;AAAA,YACH;AAAA,YACA,aAAa;AAAA,YACb,QAAQ,SAAS,SAAY,YAAY,MAAM;AAAA,UACjD;AAAA,QACF;AAAA,MACF;AAEA,UACE,WACA,CAAC,0BACD,CAAC;AAAA;AAAA,OAGA,iBAAiB,UAAa,eAAe,MAAM,MAAM,gBAC1D;AAKA,cACG,MAAM,QAAW;AAAA;AAAA,UAEhB,gBAAgB,QAAQ,QAAQ,OAAO,EAAE,KAAK,eAAe;AAAA,QAC/D,CAAC,EAEA,MAAM,IAAI;AAAA,MACf;AAAA,IACF;AAAA,EACF;AACF;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/index.cjs b/node_modules/@tanstack/query-core/build/modern/index.cjs deleted file mode 100644 index cac316e..0000000 --- a/node_modules/@tanstack/query-core/build/modern/index.cjs +++ /dev/null @@ -1,110 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default")); -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// src/index.ts -var index_exports = {}; -__export(index_exports, { - CancelledError: () => import_retryer.CancelledError, - InfiniteQueryObserver: () => import_infiniteQueryObserver.InfiniteQueryObserver, - Mutation: () => import_mutation.Mutation, - MutationCache: () => import_mutationCache.MutationCache, - MutationObserver: () => import_mutationObserver.MutationObserver, - QueriesObserver: () => import_queriesObserver.QueriesObserver, - Query: () => import_query.Query, - QueryCache: () => import_queryCache.QueryCache, - QueryClient: () => import_queryClient.QueryClient, - QueryObserver: () => import_queryObserver.QueryObserver, - defaultScheduler: () => import_notifyManager.defaultScheduler, - defaultShouldDehydrateMutation: () => import_hydration.defaultShouldDehydrateMutation, - defaultShouldDehydrateQuery: () => import_hydration.defaultShouldDehydrateQuery, - dehydrate: () => import_hydration.dehydrate, - experimental_streamedQuery: () => import_streamedQuery.streamedQuery, - focusManager: () => import_focusManager.focusManager, - hashKey: () => import_utils.hashKey, - hydrate: () => import_hydration.hydrate, - isCancelledError: () => import_retryer.isCancelledError, - isServer: () => import_utils.isServer, - keepPreviousData: () => import_utils.keepPreviousData, - matchMutation: () => import_utils.matchMutation, - matchQuery: () => import_utils.matchQuery, - noop: () => import_utils.noop, - notifyManager: () => import_notifyManager.notifyManager, - onlineManager: () => import_onlineManager.onlineManager, - partialMatchKey: () => import_utils.partialMatchKey, - replaceEqualDeep: () => import_utils.replaceEqualDeep, - shouldThrowError: () => import_utils.shouldThrowError, - skipToken: () => import_utils.skipToken, - timeoutManager: () => import_timeoutManager.timeoutManager -}); -module.exports = __toCommonJS(index_exports); -var import_focusManager = require("./focusManager.cjs"); -var import_hydration = require("./hydration.cjs"); -var import_infiniteQueryObserver = require("./infiniteQueryObserver.cjs"); -var import_mutationCache = require("./mutationCache.cjs"); -var import_mutationObserver = require("./mutationObserver.cjs"); -var import_notifyManager = require("./notifyManager.cjs"); -var import_onlineManager = require("./onlineManager.cjs"); -var import_queriesObserver = require("./queriesObserver.cjs"); -var import_queryCache = require("./queryCache.cjs"); -var import_queryClient = require("./queryClient.cjs"); -var import_queryObserver = require("./queryObserver.cjs"); -var import_retryer = require("./retryer.cjs"); -var import_timeoutManager = require("./timeoutManager.cjs"); -var import_utils = require("./utils.cjs"); -var import_streamedQuery = require("./streamedQuery.cjs"); -var import_mutation = require("./mutation.cjs"); -var import_query = require("./query.cjs"); -__reExport(index_exports, require("./types.cjs"), module.exports); -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - CancelledError, - InfiniteQueryObserver, - Mutation, - MutationCache, - MutationObserver, - QueriesObserver, - Query, - QueryCache, - QueryClient, - QueryObserver, - defaultScheduler, - defaultShouldDehydrateMutation, - defaultShouldDehydrateQuery, - dehydrate, - experimental_streamedQuery, - focusManager, - hashKey, - hydrate, - isCancelledError, - isServer, - keepPreviousData, - matchMutation, - matchQuery, - noop, - notifyManager, - onlineManager, - partialMatchKey, - replaceEqualDeep, - shouldThrowError, - skipToken, - timeoutManager, - ...require("./types.cjs") -}); -//# sourceMappingURL=index.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/index.cjs.map b/node_modules/@tanstack/query-core/build/modern/index.cjs.map deleted file mode 100644 index 239bda0..0000000 --- a/node_modules/@tanstack/query-core/build/modern/index.cjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/index.ts"],"sourcesContent":["/* istanbul ignore file */\n\nexport { focusManager } from './focusManager'\nexport {\n defaultShouldDehydrateMutation,\n defaultShouldDehydrateQuery,\n dehydrate,\n hydrate,\n} from './hydration'\nexport { InfiniteQueryObserver } from './infiniteQueryObserver'\nexport { MutationCache } from './mutationCache'\nexport type { MutationCacheNotifyEvent } from './mutationCache'\nexport { MutationObserver } from './mutationObserver'\nexport { defaultScheduler, notifyManager } from './notifyManager'\nexport { onlineManager } from './onlineManager'\nexport { QueriesObserver } from './queriesObserver'\nexport { QueryCache } from './queryCache'\nexport type { QueryCacheNotifyEvent } from './queryCache'\nexport { QueryClient } from './queryClient'\nexport { QueryObserver } from './queryObserver'\nexport { CancelledError, isCancelledError } from './retryer'\nexport {\n timeoutManager,\n type ManagedTimerId,\n type TimeoutCallback,\n type TimeoutProvider,\n} from './timeoutManager'\nexport {\n hashKey,\n isServer,\n keepPreviousData,\n matchMutation,\n matchQuery,\n noop,\n partialMatchKey,\n replaceEqualDeep,\n shouldThrowError,\n skipToken,\n} from './utils'\nexport type { MutationFilters, QueryFilters, SkipToken, Updater } from './utils'\n\nexport { streamedQuery as experimental_streamedQuery } from './streamedQuery'\n\n// Types\nexport type {\n DehydratedState,\n DehydrateOptions,\n HydrateOptions,\n} from './hydration'\nexport { Mutation } from './mutation'\nexport type { MutationState } from './mutation'\nexport type { QueriesObserverOptions } from './queriesObserver'\nexport { Query } from './query'\nexport type { QueryState } from './query'\nexport * from './types'\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,0BAA6B;AAC7B,uBAKO;AACP,mCAAsC;AACtC,2BAA8B;AAE9B,8BAAiC;AACjC,2BAAgD;AAChD,2BAA8B;AAC9B,6BAAgC;AAChC,wBAA2B;AAE3B,yBAA4B;AAC5B,2BAA8B;AAC9B,qBAAiD;AACjD,4BAKO;AACP,mBAWO;AAGP,2BAA4D;AAQ5D,sBAAyB;AAGzB,mBAAsB;AAEtB,0BAAc,wBAtDd;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/index.d.cts b/node_modules/@tanstack/query-core/build/modern/index.d.cts deleted file mode 100644 index 9d894bb..0000000 --- a/node_modules/@tanstack/query-core/build/modern/index.d.cts +++ /dev/null @@ -1,10 +0,0 @@ -export { focusManager } from './focusManager.cjs'; -export { T as AnyDataTag, b7 as CancelOptions, C as CancelledError, V as DataTag, G as DefaultError, b6 as DefaultOptions, ak as DefaultedInfiniteQueryObserverOptions, ai as DefaultedQueryObserverOptions, aP as DefinedInfiniteQueryObserverResult, aG as DefinedQueryObserverResult, w as DehydrateOptions, D as DehydratedState, B as DistributiveOmit, $ as Enabled, an as EnsureInfiniteQueryDataOptions, am as EnsureQueryDataOptions, ao as FetchInfiniteQueryOptions, av as FetchNextPageOptions, aw as FetchPreviousPageOptions, al as FetchQueryOptions, ay as FetchStatus, a7 as GetNextPageParamFunction, a6 as GetPreviousPageParamFunction, H as HydrateOptions, W as InferDataFromTag, X as InferErrorFromTag, a8 as InfiniteData, aI as InfiniteQueryObserverBaseResult, aL as InfiniteQueryObserverLoadingErrorResult, aK as InfiniteQueryObserverLoadingResult, aj as InfiniteQueryObserverOptions, aJ as InfiniteQueryObserverPendingResult, aO as InfiniteQueryObserverPlaceholderResult, aM as InfiniteQueryObserverRefetchErrorResult, aQ as InfiniteQueryObserverResult, aN as InfiniteQueryObserverSuccessResult, ae as InfiniteQueryPageParamsOptions, a2 as InitialDataFunction, ad as InitialPageParam, at as InvalidateOptions, ar as InvalidateQueryFilters, a_ as MutateFunction, aZ as MutateOptions, x as Mutation, M as MutationCache, c as MutationCacheNotifyEvent, u as MutationFilters, aW as MutationFunction, aV as MutationFunctionContext, aR as MutationKey, aU as MutationMeta, e as MutationObserver, a$ as MutationObserverBaseResult, b2 as MutationObserverErrorResult, b0 as MutationObserverIdleResult, b1 as MutationObserverLoadingResult, aY as MutationObserverOptions, b4 as MutationObserverResult, b3 as MutationObserverSuccessResult, aX as MutationOptions, aT as MutationScope, y as MutationState, aS as MutationStatus, aa as NetworkMode, F as NoInfer, N as NonUndefinedGuard, ba as NotifyEvent, b9 as NotifyEventType, ab as NotifyOnChangeProps, O as OmitKeyof, E as Override, a3 as PlaceholderDataFunction, a4 as QueriesPlaceholderDataFunction, z as Query, Q as QueryCache, f as QueryCacheNotifyEvent, g as QueryClient, b5 as QueryClientConfig, v as QueryFilters, Y as QueryFunction, a1 as QueryFunctionContext, I as QueryKey, a5 as QueryKeyHashFunction, a9 as QueryMeta, i as QueryObserver, az as QueryObserverBaseResult, aC as QueryObserverLoadingErrorResult, aB as QueryObserverLoadingResult, ag as QueryObserverOptions, aA as QueryObserverPendingResult, aF as QueryObserverPlaceholderResult, aD as QueryObserverRefetchErrorResult, aH as QueryObserverResult, aE as QueryObserverSuccessResult, ac as QueryOptions, a0 as QueryPersister, A as QueryState, ax as QueryStatus, aq as RefetchOptions, as as RefetchQueryFilters, R as Register, au as ResetOptions, ap as ResultOptions, b8 as SetDataOptions, S as SkipToken, Z as StaleTime, _ as StaleTimeFunction, af as ThrowOnError, P as UnsetMarker, U as Updater, ah as WithRequired, K as dataTagErrorSymbol, J as dataTagSymbol, d as defaultShouldDehydrateMutation, a as defaultShouldDehydrateQuery, b as dehydrate, k as hashKey, h as hydrate, j as isCancelledError, l as isServer, m as keepPreviousData, n as matchMutation, o as matchQuery, p as noop, q as partialMatchKey, r as replaceEqualDeep, s as shouldThrowError, t as skipToken, L as unsetMarker } from './hydration-uphG6M-i.cjs'; -export { InfiniteQueryObserver } from './infiniteQueryObserver.cjs'; -export { defaultScheduler, notifyManager } from './notifyManager.cjs'; -export { onlineManager } from './onlineManager.cjs'; -export { QueriesObserver, QueriesObserverOptions } from './queriesObserver.cjs'; -export { ManagedTimerId, TimeoutCallback, TimeoutProvider, timeoutManager } from './timeoutManager.cjs'; -export { streamedQuery as experimental_streamedQuery } from './streamedQuery.cjs'; -import './subscribable.cjs'; -import './removable.cjs'; diff --git a/node_modules/@tanstack/query-core/build/modern/index.d.ts b/node_modules/@tanstack/query-core/build/modern/index.d.ts deleted file mode 100644 index 54af14c..0000000 --- a/node_modules/@tanstack/query-core/build/modern/index.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -export { focusManager } from './focusManager.js'; -export { T as AnyDataTag, b7 as CancelOptions, C as CancelledError, V as DataTag, G as DefaultError, b6 as DefaultOptions, ak as DefaultedInfiniteQueryObserverOptions, ai as DefaultedQueryObserverOptions, aP as DefinedInfiniteQueryObserverResult, aG as DefinedQueryObserverResult, w as DehydrateOptions, D as DehydratedState, B as DistributiveOmit, $ as Enabled, an as EnsureInfiniteQueryDataOptions, am as EnsureQueryDataOptions, ao as FetchInfiniteQueryOptions, av as FetchNextPageOptions, aw as FetchPreviousPageOptions, al as FetchQueryOptions, ay as FetchStatus, a7 as GetNextPageParamFunction, a6 as GetPreviousPageParamFunction, H as HydrateOptions, W as InferDataFromTag, X as InferErrorFromTag, a8 as InfiniteData, aI as InfiniteQueryObserverBaseResult, aL as InfiniteQueryObserverLoadingErrorResult, aK as InfiniteQueryObserverLoadingResult, aj as InfiniteQueryObserverOptions, aJ as InfiniteQueryObserverPendingResult, aO as InfiniteQueryObserverPlaceholderResult, aM as InfiniteQueryObserverRefetchErrorResult, aQ as InfiniteQueryObserverResult, aN as InfiniteQueryObserverSuccessResult, ae as InfiniteQueryPageParamsOptions, a2 as InitialDataFunction, ad as InitialPageParam, at as InvalidateOptions, ar as InvalidateQueryFilters, a_ as MutateFunction, aZ as MutateOptions, x as Mutation, M as MutationCache, c as MutationCacheNotifyEvent, u as MutationFilters, aW as MutationFunction, aV as MutationFunctionContext, aR as MutationKey, aU as MutationMeta, e as MutationObserver, a$ as MutationObserverBaseResult, b2 as MutationObserverErrorResult, b0 as MutationObserverIdleResult, b1 as MutationObserverLoadingResult, aY as MutationObserverOptions, b4 as MutationObserverResult, b3 as MutationObserverSuccessResult, aX as MutationOptions, aT as MutationScope, y as MutationState, aS as MutationStatus, aa as NetworkMode, F as NoInfer, N as NonUndefinedGuard, ba as NotifyEvent, b9 as NotifyEventType, ab as NotifyOnChangeProps, O as OmitKeyof, E as Override, a3 as PlaceholderDataFunction, a4 as QueriesPlaceholderDataFunction, z as Query, Q as QueryCache, f as QueryCacheNotifyEvent, g as QueryClient, b5 as QueryClientConfig, v as QueryFilters, Y as QueryFunction, a1 as QueryFunctionContext, I as QueryKey, a5 as QueryKeyHashFunction, a9 as QueryMeta, i as QueryObserver, az as QueryObserverBaseResult, aC as QueryObserverLoadingErrorResult, aB as QueryObserverLoadingResult, ag as QueryObserverOptions, aA as QueryObserverPendingResult, aF as QueryObserverPlaceholderResult, aD as QueryObserverRefetchErrorResult, aH as QueryObserverResult, aE as QueryObserverSuccessResult, ac as QueryOptions, a0 as QueryPersister, A as QueryState, ax as QueryStatus, aq as RefetchOptions, as as RefetchQueryFilters, R as Register, au as ResetOptions, ap as ResultOptions, b8 as SetDataOptions, S as SkipToken, Z as StaleTime, _ as StaleTimeFunction, af as ThrowOnError, P as UnsetMarker, U as Updater, ah as WithRequired, K as dataTagErrorSymbol, J as dataTagSymbol, d as defaultShouldDehydrateMutation, a as defaultShouldDehydrateQuery, b as dehydrate, k as hashKey, h as hydrate, j as isCancelledError, l as isServer, m as keepPreviousData, n as matchMutation, o as matchQuery, p as noop, q as partialMatchKey, r as replaceEqualDeep, s as shouldThrowError, t as skipToken, L as unsetMarker } from './hydration-BlEVG2Lp.js'; -export { InfiniteQueryObserver } from './infiniteQueryObserver.js'; -export { defaultScheduler, notifyManager } from './notifyManager.js'; -export { onlineManager } from './onlineManager.js'; -export { QueriesObserver, QueriesObserverOptions } from './queriesObserver.js'; -export { ManagedTimerId, TimeoutCallback, TimeoutProvider, timeoutManager } from './timeoutManager.js'; -export { streamedQuery as experimental_streamedQuery } from './streamedQuery.js'; -import './subscribable.js'; -import './removable.js'; diff --git a/node_modules/@tanstack/query-core/build/modern/index.js b/node_modules/@tanstack/query-core/build/modern/index.js deleted file mode 100644 index f89f776..0000000 --- a/node_modules/@tanstack/query-core/build/modern/index.js +++ /dev/null @@ -1,71 +0,0 @@ -// src/index.ts -import { focusManager } from "./focusManager.js"; -import { - defaultShouldDehydrateMutation, - defaultShouldDehydrateQuery, - dehydrate, - hydrate -} from "./hydration.js"; -import { InfiniteQueryObserver } from "./infiniteQueryObserver.js"; -import { MutationCache } from "./mutationCache.js"; -import { MutationObserver } from "./mutationObserver.js"; -import { defaultScheduler, notifyManager } from "./notifyManager.js"; -import { onlineManager } from "./onlineManager.js"; -import { QueriesObserver } from "./queriesObserver.js"; -import { QueryCache } from "./queryCache.js"; -import { QueryClient } from "./queryClient.js"; -import { QueryObserver } from "./queryObserver.js"; -import { CancelledError, isCancelledError } from "./retryer.js"; -import { - timeoutManager -} from "./timeoutManager.js"; -import { - hashKey, - isServer, - keepPreviousData, - matchMutation, - matchQuery, - noop, - partialMatchKey, - replaceEqualDeep, - shouldThrowError, - skipToken -} from "./utils.js"; -import { streamedQuery } from "./streamedQuery.js"; -import { Mutation } from "./mutation.js"; -import { Query } from "./query.js"; -export * from "./types.js"; -export { - CancelledError, - InfiniteQueryObserver, - Mutation, - MutationCache, - MutationObserver, - QueriesObserver, - Query, - QueryCache, - QueryClient, - QueryObserver, - defaultScheduler, - defaultShouldDehydrateMutation, - defaultShouldDehydrateQuery, - dehydrate, - streamedQuery as experimental_streamedQuery, - focusManager, - hashKey, - hydrate, - isCancelledError, - isServer, - keepPreviousData, - matchMutation, - matchQuery, - noop, - notifyManager, - onlineManager, - partialMatchKey, - replaceEqualDeep, - shouldThrowError, - skipToken, - timeoutManager -}; -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/index.js.map b/node_modules/@tanstack/query-core/build/modern/index.js.map deleted file mode 100644 index 3f4b520..0000000 --- a/node_modules/@tanstack/query-core/build/modern/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/index.ts"],"sourcesContent":["/* istanbul ignore file */\n\nexport { focusManager } from './focusManager'\nexport {\n defaultShouldDehydrateMutation,\n defaultShouldDehydrateQuery,\n dehydrate,\n hydrate,\n} from './hydration'\nexport { InfiniteQueryObserver } from './infiniteQueryObserver'\nexport { MutationCache } from './mutationCache'\nexport type { MutationCacheNotifyEvent } from './mutationCache'\nexport { MutationObserver } from './mutationObserver'\nexport { defaultScheduler, notifyManager } from './notifyManager'\nexport { onlineManager } from './onlineManager'\nexport { QueriesObserver } from './queriesObserver'\nexport { QueryCache } from './queryCache'\nexport type { QueryCacheNotifyEvent } from './queryCache'\nexport { QueryClient } from './queryClient'\nexport { QueryObserver } from './queryObserver'\nexport { CancelledError, isCancelledError } from './retryer'\nexport {\n timeoutManager,\n type ManagedTimerId,\n type TimeoutCallback,\n type TimeoutProvider,\n} from './timeoutManager'\nexport {\n hashKey,\n isServer,\n keepPreviousData,\n matchMutation,\n matchQuery,\n noop,\n partialMatchKey,\n replaceEqualDeep,\n shouldThrowError,\n skipToken,\n} from './utils'\nexport type { MutationFilters, QueryFilters, SkipToken, Updater } from './utils'\n\nexport { streamedQuery as experimental_streamedQuery } from './streamedQuery'\n\n// Types\nexport type {\n DehydratedState,\n DehydrateOptions,\n HydrateOptions,\n} from './hydration'\nexport { Mutation } from './mutation'\nexport type { MutationState } from './mutation'\nexport type { QueriesObserverOptions } from './queriesObserver'\nexport { Query } from './query'\nexport type { QueryState } from './query'\nexport * from './types'\n"],"mappings":";AAEA,SAAS,oBAAoB;AAC7B;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,6BAA6B;AACtC,SAAS,qBAAqB;AAE9B,SAAS,wBAAwB;AACjC,SAAS,kBAAkB,qBAAqB;AAChD,SAAS,qBAAqB;AAC9B,SAAS,uBAAuB;AAChC,SAAS,kBAAkB;AAE3B,SAAS,mBAAmB;AAC5B,SAAS,qBAAqB;AAC9B,SAAS,gBAAgB,wBAAwB;AACjD;AAAA,EACE;AAAA,OAIK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAGP,SAA0B,qBAAkC;AAQ5D,SAAS,gBAAgB;AAGzB,SAAS,aAAa;AAEtB,cAAc;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/infiniteQueryBehavior.cjs b/node_modules/@tanstack/query-core/build/modern/infiniteQueryBehavior.cjs deleted file mode 100644 index 5753c45..0000000 --- a/node_modules/@tanstack/query-core/build/modern/infiniteQueryBehavior.cjs +++ /dev/null @@ -1,142 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// src/infiniteQueryBehavior.ts -var infiniteQueryBehavior_exports = {}; -__export(infiniteQueryBehavior_exports, { - hasNextPage: () => hasNextPage, - hasPreviousPage: () => hasPreviousPage, - infiniteQueryBehavior: () => infiniteQueryBehavior -}); -module.exports = __toCommonJS(infiniteQueryBehavior_exports); -var import_utils = require("./utils.cjs"); -function infiniteQueryBehavior(pages) { - return { - onFetch: (context, query) => { - const options = context.options; - const direction = context.fetchOptions?.meta?.fetchMore?.direction; - const oldPages = context.state.data?.pages || []; - const oldPageParams = context.state.data?.pageParams || []; - let result = { pages: [], pageParams: [] }; - let currentPage = 0; - const fetchFn = async () => { - let cancelled = false; - const addSignalProperty = (object) => { - (0, import_utils.addConsumeAwareSignal)( - object, - () => context.signal, - () => cancelled = true - ); - }; - const queryFn = (0, import_utils.ensureQueryFn)(context.options, context.fetchOptions); - const fetchPage = async (data, param, previous) => { - if (cancelled) { - return Promise.reject(); - } - if (param == null && data.pages.length) { - return Promise.resolve(data); - } - const createQueryFnContext = () => { - const queryFnContext2 = { - client: context.client, - queryKey: context.queryKey, - pageParam: param, - direction: previous ? "backward" : "forward", - meta: context.options.meta - }; - addSignalProperty(queryFnContext2); - return queryFnContext2; - }; - const queryFnContext = createQueryFnContext(); - const page = await queryFn(queryFnContext); - const { maxPages } = context.options; - const addTo = previous ? import_utils.addToStart : import_utils.addToEnd; - return { - pages: addTo(data.pages, page, maxPages), - pageParams: addTo(data.pageParams, param, maxPages) - }; - }; - if (direction && oldPages.length) { - const previous = direction === "backward"; - const pageParamFn = previous ? getPreviousPageParam : getNextPageParam; - const oldData = { - pages: oldPages, - pageParams: oldPageParams - }; - const param = pageParamFn(options, oldData); - result = await fetchPage(oldData, param, previous); - } else { - const remainingPages = pages ?? oldPages.length; - do { - const param = currentPage === 0 ? oldPageParams[0] ?? options.initialPageParam : getNextPageParam(options, result); - if (currentPage > 0 && param == null) { - break; - } - result = await fetchPage(result, param); - currentPage++; - } while (currentPage < remainingPages); - } - return result; - }; - if (context.options.persister) { - context.fetchFn = () => { - return context.options.persister?.( - fetchFn, - { - client: context.client, - queryKey: context.queryKey, - meta: context.options.meta, - signal: context.signal - }, - query - ); - }; - } else { - context.fetchFn = fetchFn; - } - } - }; -} -function getNextPageParam(options, { pages, pageParams }) { - const lastIndex = pages.length - 1; - return pages.length > 0 ? options.getNextPageParam( - pages[lastIndex], - pages, - pageParams[lastIndex], - pageParams - ) : void 0; -} -function getPreviousPageParam(options, { pages, pageParams }) { - return pages.length > 0 ? options.getPreviousPageParam?.(pages[0], pages, pageParams[0], pageParams) : void 0; -} -function hasNextPage(options, data) { - if (!data) return false; - return getNextPageParam(options, data) != null; -} -function hasPreviousPage(options, data) { - if (!data || !options.getPreviousPageParam) return false; - return getPreviousPageParam(options, data) != null; -} -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - hasNextPage, - hasPreviousPage, - infiniteQueryBehavior -}); -//# sourceMappingURL=infiniteQueryBehavior.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/infiniteQueryBehavior.cjs.map b/node_modules/@tanstack/query-core/build/modern/infiniteQueryBehavior.cjs.map deleted file mode 100644 index 7b629ba..0000000 --- a/node_modules/@tanstack/query-core/build/modern/infiniteQueryBehavior.cjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/infiniteQueryBehavior.ts"],"sourcesContent":["import {\n addConsumeAwareSignal,\n addToEnd,\n addToStart,\n ensureQueryFn,\n} from './utils'\nimport type { QueryBehavior } from './query'\nimport type {\n InfiniteData,\n InfiniteQueryPageParamsOptions,\n OmitKeyof,\n QueryFunctionContext,\n QueryKey,\n} from './types'\n\nexport function infiniteQueryBehavior(\n pages?: number,\n): QueryBehavior> {\n return {\n onFetch: (context, query) => {\n const options = context.options as InfiniteQueryPageParamsOptions\n const direction = context.fetchOptions?.meta?.fetchMore?.direction\n const oldPages = context.state.data?.pages || []\n const oldPageParams = context.state.data?.pageParams || []\n let result: InfiniteData = { pages: [], pageParams: [] }\n let currentPage = 0\n\n const fetchFn = async () => {\n let cancelled = false\n const addSignalProperty = (object: unknown) => {\n addConsumeAwareSignal(\n object,\n () => context.signal,\n () => (cancelled = true),\n )\n }\n\n const queryFn = ensureQueryFn(context.options, context.fetchOptions)\n\n // Create function to fetch a page\n const fetchPage = async (\n data: InfiniteData,\n param: unknown,\n previous?: boolean,\n ): Promise> => {\n if (cancelled) {\n return Promise.reject()\n }\n\n if (param == null && data.pages.length) {\n return Promise.resolve(data)\n }\n\n const createQueryFnContext = () => {\n const queryFnContext: OmitKeyof<\n QueryFunctionContext,\n 'signal'\n > = {\n client: context.client,\n queryKey: context.queryKey,\n pageParam: param,\n direction: previous ? 'backward' : 'forward',\n meta: context.options.meta,\n }\n addSignalProperty(queryFnContext)\n return queryFnContext as QueryFunctionContext\n }\n\n const queryFnContext = createQueryFnContext()\n\n const page = await queryFn(queryFnContext)\n\n const { maxPages } = context.options\n const addTo = previous ? addToStart : addToEnd\n\n return {\n pages: addTo(data.pages, page, maxPages),\n pageParams: addTo(data.pageParams, param, maxPages),\n }\n }\n\n // fetch next / previous page?\n if (direction && oldPages.length) {\n const previous = direction === 'backward'\n const pageParamFn = previous ? getPreviousPageParam : getNextPageParam\n const oldData = {\n pages: oldPages,\n pageParams: oldPageParams,\n }\n const param = pageParamFn(options, oldData)\n\n result = await fetchPage(oldData, param, previous)\n } else {\n const remainingPages = pages ?? oldPages.length\n\n // Fetch all pages\n do {\n const param =\n currentPage === 0\n ? (oldPageParams[0] ?? options.initialPageParam)\n : getNextPageParam(options, result)\n if (currentPage > 0 && param == null) {\n break\n }\n result = await fetchPage(result, param)\n currentPage++\n } while (currentPage < remainingPages)\n }\n\n return result\n }\n if (context.options.persister) {\n context.fetchFn = () => {\n return context.options.persister?.(\n fetchFn as any,\n {\n client: context.client,\n queryKey: context.queryKey,\n meta: context.options.meta,\n signal: context.signal,\n },\n query,\n )\n }\n } else {\n context.fetchFn = fetchFn\n }\n },\n }\n}\n\nfunction getNextPageParam(\n options: InfiniteQueryPageParamsOptions,\n { pages, pageParams }: InfiniteData,\n): unknown | undefined {\n const lastIndex = pages.length - 1\n return pages.length > 0\n ? options.getNextPageParam(\n pages[lastIndex],\n pages,\n pageParams[lastIndex],\n pageParams,\n )\n : undefined\n}\n\nfunction getPreviousPageParam(\n options: InfiniteQueryPageParamsOptions,\n { pages, pageParams }: InfiniteData,\n): unknown | undefined {\n return pages.length > 0\n ? options.getPreviousPageParam?.(pages[0], pages, pageParams[0], pageParams)\n : undefined\n}\n\n/**\n * Checks if there is a next page.\n */\nexport function hasNextPage(\n options: InfiniteQueryPageParamsOptions,\n data?: InfiniteData,\n): boolean {\n if (!data) return false\n return getNextPageParam(options, data) != null\n}\n\n/**\n * Checks if there is a previous page.\n */\nexport function hasPreviousPage(\n options: InfiniteQueryPageParamsOptions,\n data?: InfiniteData,\n): boolean {\n if (!data ||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A,SAAS,qBACP,SACA,EAAE,OAAO,WAAW,GACC;AACrB,SAAO,MAAM,SAAS,IAClB,QAAQ,uBAAuB,MAAM,CAAC,GAAG,OAAO,WAAW,CAAC,GAAG,UAAU,IACzE;AACN;AAKO,SAAS,YACd,SACA,MACS;AACT,MAAI,CAAC,KAAM,QAAO;AAClB,SAAO,iBAAiB,SAAS,IAAI,KAAK;AAC5C;AAKO,SAAS,gBACd,SACA,MACS;AACT,MAAI,CAAC,QAAQ,CAAC,QAAQ,qBAAsB,QAAO;AACnD,SAAO,qBAAqB,SAAS,IAAI,KAAK;AAChD;","names":["queryFnContext"]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/infiniteQueryBehavior.d.cts b/node_modules/@tanstack/query-core/build/modern/infiniteQueryBehavior.d.cts deleted file mode 100644 index 8a7fd8a..0000000 --- a/node_modules/@tanstack/query-core/build/modern/infiniteQueryBehavior.d.cts +++ /dev/null @@ -1,15 +0,0 @@ -import { bb as QueryBehavior, a8 as InfiniteData, ae as InfiniteQueryPageParamsOptions } from './hydration-uphG6M-i.cjs'; -import './removable.cjs'; -import './subscribable.cjs'; - -declare function infiniteQueryBehavior(pages?: number): QueryBehavior>; -/** - * Checks if there is a next page. - */ -declare function hasNextPage(options: InfiniteQueryPageParamsOptions, data?: InfiniteData): boolean; -/** - * Checks if there is a previous page. - */ -declare function hasPreviousPage(options: InfiniteQueryPageParamsOptions, data?: InfiniteData): boolean; - -export { hasNextPage, hasPreviousPage, infiniteQueryBehavior }; diff --git a/node_modules/@tanstack/query-core/build/modern/infiniteQueryBehavior.d.ts b/node_modules/@tanstack/query-core/build/modern/infiniteQueryBehavior.d.ts deleted file mode 100644 index a9a90e2..0000000 --- a/node_modules/@tanstack/query-core/build/modern/infiniteQueryBehavior.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { bb as QueryBehavior, a8 as InfiniteData, ae as InfiniteQueryPageParamsOptions } from './hydration-BlEVG2Lp.js'; -import './removable.js'; -import './subscribable.js'; - -declare function infiniteQueryBehavior(pages?: number): QueryBehavior>; -/** - * Checks if there is a next page. - */ -declare function hasNextPage(options: InfiniteQueryPageParamsOptions, data?: InfiniteData): boolean; -/** - * Checks if there is a previous page. - */ -declare function hasPreviousPage(options: InfiniteQueryPageParamsOptions, data?: InfiniteData): boolean; - -export { hasNextPage, hasPreviousPage, infiniteQueryBehavior }; diff --git a/node_modules/@tanstack/query-core/build/modern/infiniteQueryBehavior.js b/node_modules/@tanstack/query-core/build/modern/infiniteQueryBehavior.js deleted file mode 100644 index 5800419..0000000 --- a/node_modules/@tanstack/query-core/build/modern/infiniteQueryBehavior.js +++ /dev/null @@ -1,120 +0,0 @@ -// src/infiniteQueryBehavior.ts -import { - addConsumeAwareSignal, - addToEnd, - addToStart, - ensureQueryFn -} from "./utils.js"; -function infiniteQueryBehavior(pages) { - return { - onFetch: (context, query) => { - const options = context.options; - const direction = context.fetchOptions?.meta?.fetchMore?.direction; - const oldPages = context.state.data?.pages || []; - const oldPageParams = context.state.data?.pageParams || []; - let result = { pages: [], pageParams: [] }; - let currentPage = 0; - const fetchFn = async () => { - let cancelled = false; - const addSignalProperty = (object) => { - addConsumeAwareSignal( - object, - () => context.signal, - () => cancelled = true - ); - }; - const queryFn = ensureQueryFn(context.options, context.fetchOptions); - const fetchPage = async (data, param, previous) => { - if (cancelled) { - return Promise.reject(); - } - if (param == null && data.pages.length) { - return Promise.resolve(data); - } - const createQueryFnContext = () => { - const queryFnContext2 = { - client: context.client, - queryKey: context.queryKey, - pageParam: param, - direction: previous ? "backward" : "forward", - meta: context.options.meta - }; - addSignalProperty(queryFnContext2); - return queryFnContext2; - }; - const queryFnContext = createQueryFnContext(); - const page = await queryFn(queryFnContext); - const { maxPages } = context.options; - const addTo = previous ? addToStart : addToEnd; - return { - pages: addTo(data.pages, page, maxPages), - pageParams: addTo(data.pageParams, param, maxPages) - }; - }; - if (direction && oldPages.length) { - const previous = direction === "backward"; - const pageParamFn = previous ? getPreviousPageParam : getNextPageParam; - const oldData = { - pages: oldPages, - pageParams: oldPageParams - }; - const param = pageParamFn(options, oldData); - result = await fetchPage(oldData, param, previous); - } else { - const remainingPages = pages ?? oldPages.length; - do { - const param = currentPage === 0 ? oldPageParams[0] ?? options.initialPageParam : getNextPageParam(options, result); - if (currentPage > 0 && param == null) { - break; - } - result = await fetchPage(result, param); - currentPage++; - } while (currentPage < remainingPages); - } - return result; - }; - if (context.options.persister) { - context.fetchFn = () => { - return context.options.persister?.( - fetchFn, - { - client: context.client, - queryKey: context.queryKey, - meta: context.options.meta, - signal: context.signal - }, - query - ); - }; - } else { - context.fetchFn = fetchFn; - } - } - }; -} -function getNextPageParam(options, { pages, pageParams }) { - const lastIndex = pages.length - 1; - return pages.length > 0 ? options.getNextPageParam( - pages[lastIndex], - pages, - pageParams[lastIndex], - pageParams - ) : void 0; -} -function getPreviousPageParam(options, { pages, pageParams }) { - return pages.length > 0 ? options.getPreviousPageParam?.(pages[0], pages, pageParams[0], pageParams) : void 0; -} -function hasNextPage(options, data) { - if (!data) return false; - return getNextPageParam(options, data) != null; -} -function hasPreviousPage(options, data) { - if (!data || !options.getPreviousPageParam) return false; - return getPreviousPageParam(options, data) != null; -} -export { - hasNextPage, - hasPreviousPage, - infiniteQueryBehavior -}; -//# sourceMappingURL=infiniteQueryBehavior.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/infiniteQueryBehavior.js.map b/node_modules/@tanstack/query-core/build/modern/infiniteQueryBehavior.js.map deleted file mode 100644 index 5eb64f5..0000000 --- a/node_modules/@tanstack/query-core/build/modern/infiniteQueryBehavior.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/infiniteQueryBehavior.ts"],"sourcesContent":["import {\n addConsumeAwareSignal,\n addToEnd,\n addToStart,\n ensureQueryFn,\n} from './utils'\nimport type { QueryBehavior } from './query'\nimport type {\n InfiniteData,\n InfiniteQueryPageParamsOptions,\n OmitKeyof,\n QueryFunctionContext,\n QueryKey,\n} from './types'\n\nexport function infiniteQueryBehavior(\n pages?: number,\n): QueryBehavior> {\n return {\n onFetch: (context, query) => {\n const options = context.options as InfiniteQueryPageParamsOptions\n const direction = context.fetchOptions?.meta?.fetchMore?.direction\n const oldPages = context.state.data?.pages || []\n const oldPageParams = context.state.data?.pageParams || []\n let result: InfiniteData = { pages: [], pageParams: [] }\n let currentPage = 0\n\n const fetchFn = async () => {\n let cancelled = false\n const addSignalProperty = (object: unknown) => {\n addConsumeAwareSignal(\n object,\n () => context.signal,\n () => (cancelled = true),\n )\n }\n\n const queryFn = ensureQueryFn(context.options, context.fetchOptions)\n\n // Create function to fetch a page\n const fetchPage = async (\n data: InfiniteData,\n param: unknown,\n previous?: boolean,\n ): Promise> => {\n if (cancelled) {\n return Promise.reject()\n }\n\n if (param == null && data.pages.length) {\n return Promise.resolve(data)\n }\n\n const createQueryFnContext = () => {\n const queryFnContext: OmitKeyof<\n QueryFunctionContext,\n 'signal'\n > = {\n client: context.client,\n queryKey: context.queryKey,\n pageParam: param,\n direction: previous ? 'backward' : 'forward',\n meta: context.options.meta,\n }\n addSignalProperty(queryFnContext)\n return queryFnContext as QueryFunctionContext\n }\n\n const queryFnContext = createQueryFnContext()\n\n const page = await queryFn(queryFnContext)\n\n const { maxPages } = context.options\n const addTo = previous ? addToStart : addToEnd\n\n return {\n pages: addTo(data.pages, page, maxPages),\n pageParams: addTo(data.pageParams, param, maxPages),\n }\n }\n\n // fetch next / previous page?\n if (direction && oldPages.length) {\n const previous = direction === 'backward'\n const pageParamFn = previous ? getPreviousPageParam : getNextPageParam\n const oldData = {\n pages: oldPages,\n pageParams: oldPageParams,\n }\n const param = pageParamFn(options, oldData)\n\n result = await fetchPage(oldData, param, previous)\n } else {\n const remainingPages = pages ?? oldPages.length\n\n // Fetch all pages\n do {\n const param =\n currentPage === 0\n ? (oldPageParams[0] ?? options.initialPageParam)\n : getNextPageParam(options, result)\n if (currentPage > 0 && param == null) {\n break\n }\n result = await fetchPage(result, param)\n currentPage++\n } while (currentPage < remainingPages)\n }\n\n return result\n }\n if (context.options.persister) {\n context.fetchFn = () => {\n return context.options.persister?.(\n fetchFn as any,\n {\n client: context.client,\n queryKey: context.queryKey,\n meta: context.options.meta,\n signal: context.signal,\n },\n query,\n )\n }\n } else {\n context.fetchFn = fetchFn\n }\n },\n }\n}\n\nfunction getNextPageParam(\n options: InfiniteQueryPageParamsOptions,\n { pages, pageParams }: InfiniteData,\n): unknown | undefined {\n const lastIndex = pages.length - 1\n return pages.length > 0\n ? options.getNextPageParam(\n pages[lastIndex],\n pages,\n pageParams[lastIndex],\n pageParams,\n )\n : undefined\n}\n\nfunction getPreviousPageParam(\n options: InfiniteQueryPageParamsOptions,\n { pages, pageParams }: InfiniteData,\n): unknown | undefined {\n return pages.length > 0\n ? options.getPreviousPageParam?.(pages[0], pages, pageParams[0], pageParams)\n : undefined\n}\n\n/**\n * Checks if there is a next page.\n */\nexport function hasNextPage(\n options: InfiniteQueryPageParamsOptions,\n data?: InfiniteData,\n): boolean {\n if (!data) return false\n return getNextPageParam(options, data) != null\n}\n\n/**\n * Checks if there is a previous page.\n */\nexport function hasPreviousPage(\n options: InfiniteQueryPageParamsOptions,\n data?: InfiniteData,\n): boolean {\n if (!data || !options.getPreviousPageParam) return false\n return getPreviousPageParam(options, data) != null\n}\n"],"mappings":";AAAA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAUA,SAAS,sBACd,OACsE;AACtE,SAAO;AAAA,IACL,SAAS,CAAC,SAAS,UAAU;AAC3B,YAAM,UAAU,QAAQ;AACxB,YAAM,YAAY,QAAQ,cAAc,MAAM,WAAW;AACzD,YAAM,WAAW,QAAQ,MAAM,MAAM,SAAS,CAAC;AAC/C,YAAM,gBAAgB,QAAQ,MAAM,MAAM,cAAc,CAAC;AACzD,UAAI,SAAgC,EAAE,OAAO,CAAC,GAAG,YAAY,CAAC,EAAE;AAChE,UAAI,cAAc;AAElB,YAAM,UAAU,YAAY;AAC1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C,KAAK,QAAQ,mBAC7B,iBAAiB,SAAS,MAAM;AACtC,gBAAI,cAAc,KAAK,SAAS,MAAM;AACpC;AAAA,YACF;AACA,qBAAS,MAAM,UAAU,QAAQ,KAAK;AACtC;AAAA,UACF,SAAS,cAAc;AAAA,QACzB;AAEA,eAAO;AAAA,MACT;AACA,UAAI,QAAQ,QAAQ,WAAW;AAC7B,gBAAQ,UAAU,MAAM;AACtB,iBAAO,QAAQ,QAAQ;AAAA,YACrB;AAAA,YACA;AAAA,cACE,QAAQ,QAAQ;AAAA,cAChB,UAAU,QAAQ;AAAA,cAClB,MAAM,QAAQ,QAAQ;AAAA,cACtB,QAAQ,QAAQ;AAAA,YAClB;AAAA,YACA;AAAA,UACF;AAAA,QACF;AAAA,MACF,OAAO;AACL,gBAAQ,UAAU;AAAA,MACpB;AAAA,IACF;AAAA,EACF;AACF;AAEA,SAAS,iBACP,SACA,EAAE,OAAO,WAAW,GACC;AACrB,QAAM,YAAY,MAAM,SAAS;AACjC,SAAO,MAAM,SAAS,IAClB,QAAQ;AAAA,IACN,MAAM,SAAS;AAAA,IACf;AAAA,IACA,WAAW,SAAS;AAAA,IACpB;AAAA,EACF,IACA;AACN;AAEA,SAAS,qBACP,SACA,EAAE,OAAO,WAAW,GACC;AACrB,SAAO,MAAM,SAAS,IAClB,QAAQ,uBAAuB,MAAM,CAAC,GAAG,OAAO,WAAW,CAAC,GAAG,UAAU,IACzE;AACN;AAKO,SAAS,YACd,SACA,MACS;AACT,MAAI,CAAC,KAAM,QAAO;AAClB,SAAO,iBAAiB,SAAS,IAAI,KAAK;AAC5C;AAKO,SAAS,gBACd,SACA,MACS;AACT,MAAI,CAAC,QAAQ,CAAC,QAAQ,qBAAsB,QAAO;AACnD,SAAO,qBAAqB,SAAS,IAAI,KAAK;AAChD;","names":["queryFnContext"]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/infiniteQueryObserver.cjs b/node_modules/@tanstack/query-core/build/modern/infiniteQueryObserver.cjs deleted file mode 100644 index 3e712e9..0000000 --- a/node_modules/@tanstack/query-core/build/modern/infiniteQueryObserver.cjs +++ /dev/null @@ -1,92 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// src/infiniteQueryObserver.ts -var infiniteQueryObserver_exports = {}; -__export(infiniteQueryObserver_exports, { - InfiniteQueryObserver: () => InfiniteQueryObserver -}); -module.exports = __toCommonJS(infiniteQueryObserver_exports); -var import_queryObserver = require("./queryObserver.cjs"); -var import_infiniteQueryBehavior = require("./infiniteQueryBehavior.cjs"); -var InfiniteQueryObserver = class extends import_queryObserver.QueryObserver { - constructor(client, options) { - super(client, options); - } - bindMethods() { - super.bindMethods(); - this.fetchNextPage = this.fetchNextPage.bind(this); - this.fetchPreviousPage = this.fetchPreviousPage.bind(this); - } - setOptions(options) { - super.setOptions({ - ...options, - behavior: (0, import_infiniteQueryBehavior.infiniteQueryBehavior)() - }); - } - getOptimisticResult(options) { - options.behavior = (0, import_infiniteQueryBehavior.infiniteQueryBehavior)(); - return super.getOptimisticResult(options); - } - fetchNextPage(options) { - return this.fetch({ - ...options, - meta: { - fetchMore: { direction: "forward" } - } - }); - } - fetchPreviousPage(options) { - return this.fetch({ - ...options, - meta: { - fetchMore: { direction: "backward" } - } - }); - } - createResult(query, options) { - const { state } = query; - const parentResult = super.createResult(query, options); - const { isFetching, isRefetching, isError, isRefetchError } = parentResult; - const fetchDirection = state.fetchMeta?.fetchMore?.direction; - const isFetchNextPageError = isError && fetchDirection === "forward"; - const isFetchingNextPage = isFetching && fetchDirection === "forward"; - const isFetchPreviousPageError = isError && fetchDirection === "backward"; - const isFetchingPreviousPage = isFetching && fetchDirection === "backward"; - const result = { - ...parentResult, - fetchNextPage: this.fetchNextPage, - fetchPreviousPage: this.fetchPreviousPage, - hasNextPage: (0, import_infiniteQueryBehavior.hasNextPage)(options, state.data), - hasPreviousPage: (0, import_infiniteQueryBehavior.hasPreviousPage)(options, state.data), - isFetchNextPageError, - isFetchingNextPage, - isFetchPreviousPageError, - isFetchingPreviousPage, - isRefetchError: isRefetchError && !isFetchNextPageError && !isFetchPreviousPageError, - isRefetching: isRefetching && !isFetchingNextPage && !isFetchingPreviousPage - }; - return result; - } -}; -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - InfiniteQueryObserver -}); -//# sourceMappingURL=infiniteQueryObserver.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/infiniteQueryObserver.cjs.map b/node_modules/@tanstack/query-core/build/modern/infiniteQueryObserver.cjs.map deleted file mode 100644 index ee42578..0000000 --- a/node_modules/@tanstack/query-core/build/modern/infiniteQueryObserver.cjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/infiniteQueryObserver.ts"],"sourcesContent":["import { QueryObserver } from './queryObserver'\nimport {\n hasNextPage,\n hasPreviousPage,\n infiniteQueryBehavior,\n} from './infiniteQueryBehavior'\nimport type { Subscribable } from './subscribable'\nimport type {\n DefaultError,\n DefaultedInfiniteQueryObserverOptions,\n FetchNextPageOptions,\n FetchPreviousPageOptions,\n InfiniteData,\n InfiniteQueryObserverBaseResult,\n InfiniteQueryObserverOptions,\n InfiniteQueryObserverResult,\n QueryKey,\n} from './types'\nimport type { QueryClient } from './queryClient'\nimport type { Query } from './query'\n\ntype InfiniteQueryObserverListener = (\n result: InfiniteQueryObserverResult,\n) => void\n\nexport class InfiniteQueryObserver<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = InfiniteData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n> extends QueryObserver<\n TQueryFnData,\n TError,\n TData,\n InfiniteData,\n TQueryKey\n> {\n // Type override\n subscribe!: Subscribable<\n InfiniteQueryObserverListener\n >['subscribe']\n\n // Type override\n getCurrentResult!: ReplaceReturnType<\n QueryObserver<\n TQueryFnData,\n TError,\n TData,\n InfiniteData,\n TQueryKey\n >['getCurrentResult'],\n InfiniteQueryObserverResult\n >\n\n // Type override\n protected fetch!: ReplaceReturnType<\n QueryObserver<\n TQueryFnData,\n TError,\n TData,\n InfiniteData,\n TQueryKey\n >['fetch'],\n Promise>\n >\n\n constructor(\n client: QueryClient,\n options: InfiniteQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n ) {\n super(client, options)\n }\n\n protected bindMethods(): void {\n super.bindMethods()\n this.fetchNextPage = this.fetchNextPage.bind(this)\n this.fetchPreviousPage = this.fetchPreviousPage.bind(this)\n }\n\n setOptions(\n options: InfiniteQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n ): void {\n super.setOptions({\n ...options,\n behavior: infiniteQueryBehavior(),\n })\n }\n\n getOptimisticResult(\n options: DefaultedInfiniteQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n ): InfiniteQueryObserverResult {\n options.behavior = infiniteQueryBehavior()\n return super.getOptimisticResult(options) as InfiniteQueryObserverResult<\n TData,\n TError\n >\n }\n\n fetchNextPage(\n options?: FetchNextPageOptions,\n ): Promise> {\n return this.fetch({\n ...options,\n meta: {\n fetchMore: { direction: 'forward' },\n },\n })\n }\n\n fetchPreviousPage(\n options?: FetchPreviousPageOptions,\n ): Promise> {\n return this.fetch({\n ...options,\n meta: {\n fetchMore: { direction: 'backward' },\n },\n })\n }\n\n protected createResult(\n query: Query<\n TQueryFnData,\n TError,\n InfiniteData,\n TQueryKey\n >,\n options: InfiniteQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n ): InfiniteQueryObserverResult {\n const { state } = query\n const parentResult = super.createResult(query, options)\n\n const { isFetching, isRefetching, isError, isRefetchError } = parentResult\n const fetchDirection = state.fetchMeta?.fetchMore?.direction\n\n const isFetchNextPageError = isError && fetchDirection === 'forward'\n const isFetchingNextPage = isFetching && fetchDirection === 'forward'\n\n const isFetchPreviousPageError = isError && fetchDirection === 'backward'\n const isFetchingPreviousPage = isFetching && fetchDirection === 'backward'\n\n const result: InfiniteQueryObserverBaseResult = {\n ...parentResult,\n fetchNextPage: this.fetchNextPage,\n fetchPreviousPage: this.fetchPreviousPage,\n hasNextPage: hasNextPage(options, state.data),\n hasPreviousPage: hasPreviousPage(options, state.data),\n isFetchNextPageError,\n isFetchingNextPage,\n isFetchPreviousPageError,\n isFetchingPreviousPage,\n isRefetchError:\n isRefetchError && !isFetchNextPageError && !isFetchPreviousPageError,\n isRefetching:\n isRefetching && !isFetchingNextPage && !isFetchingPreviousPage,\n }\n\n return result as InfiniteQueryObserverResult\n }\n}\n\ntype ReplaceReturnType<\n TFunction extends (...args: Array) => unknown,\n TReturn,\n> = (...args: Parameters) => TReturn\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,2BAA8B;AAC9B,mCAIO;AAoBA,IAAM,wBAAN,cAMG,mCAMR;AAAA,EA8BA,YACE,QACA,SAOA;AACA,UAAM,QAAQ,OAAO;AAAA,EACvB;AAAA,EAEU,cAAoB;AAC5B,UAAM,YAAY;AAClB,SAAK,gBAAgB,KAAK,cAAc,KAAK,IAAI;AACjD,SAAK,oBAAoB,KAAK,kBAAkB,KAAK,IAAI;AAAA,EAC3D;AAAA,EAEA,WACE,SAOM;AACN,UAAM,WAAW;AAAA,MACf,GAAG;AAAA,MACH,cAAU,oDAAsB;AAAA,IAClC,CAAC;AAAA,EACH;AAAA,EAEA,oBACE,SAO4C;AAC5C,YAAQ,eAAW,oDAAsB;AACzC,WAAO,MAAM,oBAAoB,OAAO;AAAA,EAI1C;AAAA,EAEA,cACE,SACqD;AACrD,WAAO,KAAK,MAAM;AAAA,MAChB,GAAG;AAAA,MACH,MAAM;AAAA,QACJ,WAAW,EAAE,WAAW,UAAU;AAAA,MACpC;AAAA,IACF,CAAC;AAAA,EACH;AAAA,EAEA,kBACE,SACqD;AACrD,WAAO,KAAK,MAAM;AAAA,MAChB,GAAG;AAAA,MACH,MAAM;AAAA,QACJ,WAAW,EAAE,WAAW,WAAW;AAAA,MACrC;AAAA,IACF,CAAC;AAAA,EACH;AAAA,EAEU,aACR,OAMA,SAO4C;AAC5C,UAAM,EAAE,MAAM,IAAI;AAClB,UAAM,eAAe,MAAM,aAAa,OAAO,OAAO;AAEtD,UAAM,EAAE,YAAY,cAAc,SAAS,eAAe,IAAI;AAC9D,UAAM,iBAAiB,MAAM,WAAW,WAAW;AAEnD,UAAM,uBAAuB,WAAW,mBAAmB;AAC3D,UAAM,qBAAqB,cAAc,mBAAmB;AAE5D,UAAM,2BAA2B,WAAW,mBAAmB;AAC/D,UAAM,yBAAyB,cAAc,mBAAmB;AAEhE,UAAM,SAAyD;AAAA,MAC7D,GAAG;AAAA,MACH,eAAe,KAAK;AAAA,MACpB,mBAAmB,KAAK;AAAA,MACxB,iBAAa,0CAAY,SAAS,MAAM,IAAI;AAAA,MAC5C,qBAAiB,8CAAgB,SAAS,MAAM,IAAI;AAAA,MACpD;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,gBACE,kBAAkB,CAAC,wBAAwB,CAAC;AAAA,MAC9C,cACE,gBAAgB,CAAC,sBAAsB,CAAC;AAAA,IAC5C;AAEA,WAAO;AAAA,EACT;AACF;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/infiniteQueryObserver.d.cts b/node_modules/@tanstack/query-core/build/modern/infiniteQueryObserver.d.cts deleted file mode 100644 index 296a938..0000000 --- a/node_modules/@tanstack/query-core/build/modern/infiniteQueryObserver.d.cts +++ /dev/null @@ -1,20 +0,0 @@ -import { G as DefaultError, a8 as InfiniteData, I as QueryKey, i as QueryObserver, aQ as InfiniteQueryObserverResult, g as QueryClient, aj as InfiniteQueryObserverOptions, ak as DefaultedInfiniteQueryObserverOptions, av as FetchNextPageOptions, aw as FetchPreviousPageOptions, z as Query } from './hydration-uphG6M-i.cjs'; -import { Subscribable } from './subscribable.cjs'; -import './removable.cjs'; - -type InfiniteQueryObserverListener = (result: InfiniteQueryObserverResult) => void; -declare class InfiniteQueryObserver, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown> extends QueryObserver, TQueryKey> { - subscribe: Subscribable>['subscribe']; - getCurrentResult: ReplaceReturnType, TQueryKey>['getCurrentResult'], InfiniteQueryObserverResult>; - protected fetch: ReplaceReturnType, TQueryKey>['fetch'], Promise>>; - constructor(client: QueryClient, options: InfiniteQueryObserverOptions); - protected bindMethods(): void; - setOptions(options: InfiniteQueryObserverOptions): void; - getOptimisticResult(options: DefaultedInfiniteQueryObserverOptions): InfiniteQueryObserverResult; - fetchNextPage(options?: FetchNextPageOptions): Promise>; - fetchPreviousPage(options?: FetchPreviousPageOptions): Promise>; - protected createResult(query: Query, TQueryKey>, options: InfiniteQueryObserverOptions): InfiniteQueryObserverResult; -} -type ReplaceReturnType) => unknown, TReturn> = (...args: Parameters) => TReturn; - -export { InfiniteQueryObserver }; diff --git a/node_modules/@tanstack/query-core/build/modern/infiniteQueryObserver.d.ts b/node_modules/@tanstack/query-core/build/modern/infiniteQueryObserver.d.ts deleted file mode 100644 index 96dca65..0000000 --- a/node_modules/@tanstack/query-core/build/modern/infiniteQueryObserver.d.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { G as DefaultError, a8 as InfiniteData, I as QueryKey, i as QueryObserver, aQ as InfiniteQueryObserverResult, g as QueryClient, aj as InfiniteQueryObserverOptions, ak as DefaultedInfiniteQueryObserverOptions, av as FetchNextPageOptions, aw as FetchPreviousPageOptions, z as Query } from './hydration-BlEVG2Lp.js'; -import { Subscribable } from './subscribable.js'; -import './removable.js'; - -type InfiniteQueryObserverListener = (result: InfiniteQueryObserverResult) => void; -declare class InfiniteQueryObserver, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown> extends QueryObserver, TQueryKey> { - subscribe: Subscribable>['subscribe']; - getCurrentResult: ReplaceReturnType, TQueryKey>['getCurrentResult'], InfiniteQueryObserverResult>; - protected fetch: ReplaceReturnType, TQueryKey>['fetch'], Promise>>; - constructor(client: QueryClient, options: InfiniteQueryObserverOptions); - protected bindMethods(): void; - setOptions(options: InfiniteQueryObserverOptions): void; - getOptimisticResult(options: DefaultedInfiniteQueryObserverOptions): InfiniteQueryObserverResult; - fetchNextPage(options?: FetchNextPageOptions): Promise>; - fetchPreviousPage(options?: FetchPreviousPageOptions): Promise>; - protected createResult(query: Query, TQueryKey>, options: InfiniteQueryObserverOptions): InfiniteQueryObserverResult; -} -type ReplaceReturnType) => unknown, TReturn> = (...args: Parameters) => TReturn; - -export { InfiniteQueryObserver }; diff --git a/node_modules/@tanstack/query-core/build/modern/infiniteQueryObserver.js b/node_modules/@tanstack/query-core/build/modern/infiniteQueryObserver.js deleted file mode 100644 index 409d54a..0000000 --- a/node_modules/@tanstack/query-core/build/modern/infiniteQueryObserver.js +++ /dev/null @@ -1,71 +0,0 @@ -// src/infiniteQueryObserver.ts -import { QueryObserver } from "./queryObserver.js"; -import { - hasNextPage, - hasPreviousPage, - infiniteQueryBehavior -} from "./infiniteQueryBehavior.js"; -var InfiniteQueryObserver = class extends QueryObserver { - constructor(client, options) { - super(client, options); - } - bindMethods() { - super.bindMethods(); - this.fetchNextPage = this.fetchNextPage.bind(this); - this.fetchPreviousPage = this.fetchPreviousPage.bind(this); - } - setOptions(options) { - super.setOptions({ - ...options, - behavior: infiniteQueryBehavior() - }); - } - getOptimisticResult(options) { - options.behavior = infiniteQueryBehavior(); - return super.getOptimisticResult(options); - } - fetchNextPage(options) { - return this.fetch({ - ...options, - meta: { - fetchMore: { direction: "forward" } - } - }); - } - fetchPreviousPage(options) { - return this.fetch({ - ...options, - meta: { - fetchMore: { direction: "backward" } - } - }); - } - createResult(query, options) { - const { state } = query; - const parentResult = super.createResult(query, options); - const { isFetching, isRefetching, isError, isRefetchError } = parentResult; - const fetchDirection = state.fetchMeta?.fetchMore?.direction; - const isFetchNextPageError = isError && fetchDirection === "forward"; - const isFetchingNextPage = isFetching && fetchDirection === "forward"; - const isFetchPreviousPageError = isError && fetchDirection === "backward"; - const isFetchingPreviousPage = isFetching && fetchDirection === "backward"; - const result = { - ...parentResult, - fetchNextPage: this.fetchNextPage, - fetchPreviousPage: this.fetchPreviousPage, - hasNextPage: hasNextPage(options, state.data), - hasPreviousPage: hasPreviousPage(options, state.data), - isFetchNextPageError, - isFetchingNextPage, - isFetchPreviousPageError, - isFetchingPreviousPage, - isRefetchError: isRefetchError && !isFetchNextPageError && !isFetchPreviousPageError, - isRefetching: isRefetching && !isFetchingNextPage && !isFetchingPreviousPage - }; - return result; - } -}; -export { - InfiniteQueryObserver -}; -//# sourceMappingURL=infiniteQueryObserver.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/infiniteQueryObserver.js.map b/node_modules/@tanstack/query-core/build/modern/infiniteQueryObserver.js.map deleted file mode 100644 index 11855cf..0000000 --- a/node_modules/@tanstack/query-core/build/modern/infiniteQueryObserver.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/infiniteQueryObserver.ts"],"sourcesContent":["import { QueryObserver } from './queryObserver'\nimport {\n hasNextPage,\n hasPreviousPage,\n infiniteQueryBehavior,\n} from './infiniteQueryBehavior'\nimport type { Subscribable } from './subscribable'\nimport type {\n DefaultError,\n DefaultedInfiniteQueryObserverOptions,\n FetchNextPageOptions,\n FetchPreviousPageOptions,\n InfiniteData,\n InfiniteQueryObserverBaseResult,\n InfiniteQueryObserverOptions,\n InfiniteQueryObserverResult,\n QueryKey,\n} from './types'\nimport type { QueryClient } from './queryClient'\nimport type { Query } from './query'\n\ntype InfiniteQueryObserverListener = (\n result: InfiniteQueryObserverResult,\n) => void\n\nexport class InfiniteQueryObserver<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = InfiniteData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n> extends QueryObserver<\n TQueryFnData,\n TError,\n TData,\n InfiniteData,\n TQueryKey\n> {\n // Type override\n subscribe!: Subscribable<\n InfiniteQueryObserverListener\n >['subscribe']\n\n // Type override\n getCurrentResult!: ReplaceReturnType<\n QueryObserver<\n TQueryFnData,\n TError,\n TData,\n InfiniteData,\n TQueryKey\n >['getCurrentResult'],\n InfiniteQueryObserverResult\n >\n\n // Type override\n protected fetch!: ReplaceReturnType<\n QueryObserver<\n TQueryFnData,\n TError,\n TData,\n InfiniteData,\n TQueryKey\n >['fetch'],\n Promise>\n >\n\n constructor(\n client: QueryClient,\n options: InfiniteQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n ) {\n super(client, options)\n }\n\n protected bindMethods(): void {\n super.bindMethods()\n this.fetchNextPage = this.fetchNextPage.bind(this)\n this.fetchPreviousPage = this.fetchPreviousPage.bind(this)\n }\n\n setOptions(\n options: InfiniteQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n ): void {\n super.setOptions({\n ...options,\n behavior: infiniteQueryBehavior(),\n })\n }\n\n getOptimisticResult(\n options: DefaultedInfiniteQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n ): InfiniteQueryObserverResult {\n options.behavior = infiniteQueryBehavior()\n return super.getOptimisticResult(options) as InfiniteQueryObserverResult<\n TData,\n TError\n >\n }\n\n fetchNextPage(\n options?: FetchNextPageOptions,\n ): Promise> {\n return this.fetch({\n ...options,\n meta: {\n fetchMore: { direction: 'forward' },\n },\n })\n }\n\n fetchPreviousPage(\n options?: FetchPreviousPageOptions,\n ): Promise> {\n return this.fetch({\n ...options,\n meta: {\n fetchMore: { direction: 'backward' },\n },\n })\n }\n\n protected createResult(\n query: Query<\n TQueryFnData,\n TError,\n InfiniteData,\n TQueryKey\n >,\n options: InfiniteQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n ): InfiniteQueryObserverResult {\n const { state } = query\n const parentResult = super.createResult(query, options)\n\n const { isFetching, isRefetching, isError, isRefetchError } = parentResult\n const fetchDirection = state.fetchMeta?.fetchMore?.direction\n\n const isFetchNextPageError = isError && fetchDirection === 'forward'\n const isFetchingNextPage = isFetching && fetchDirection === 'forward'\n\n const isFetchPreviousPageError = isError && fetchDirection === 'backward'\n const isFetchingPreviousPage = isFetching && fetchDirection === 'backward'\n\n const result: InfiniteQueryObserverBaseResult = {\n ...parentResult,\n fetchNextPage: this.fetchNextPage,\n fetchPreviousPage: this.fetchPreviousPage,\n hasNextPage: hasNextPage(options, state.data),\n hasPreviousPage: hasPreviousPage(options, state.data),\n isFetchNextPageError,\n isFetchingNextPage,\n isFetchPreviousPageError,\n isFetchingPreviousPage,\n isRefetchError:\n isRefetchError && !isFetchNextPageError && !isFetchPreviousPageError,\n isRefetching:\n isRefetching && !isFetchingNextPage && !isFetchingPreviousPage,\n }\n\n return result as InfiniteQueryObserverResult\n }\n}\n\ntype ReplaceReturnType<\n TFunction extends (...args: Array) => unknown,\n TReturn,\n> = (...args: Parameters) => TReturn\n"],"mappings":";AAAA,SAAS,qBAAqB;AAC9B;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAoBA,IAAM,wBAAN,cAMG,cAMR;AAAA,EA8BA,YACE,QACA,SAOA;AACA,UAAM,QAAQ,OAAO;AAAA,EACvB;AAAA,EAEU,cAAoB;AAC5B,UAAM,YAAY;AAClB,SAAK,gBAAgB,KAAK,cAAc,KAAK,IAAI;AACjD,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C;AAAA,IAC5C;AAEA,WAAO;AAAA,EACT;AACF;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/mutation.cjs b/node_modules/@tanstack/query-core/build/modern/mutation.cjs deleted file mode 100644 index 36b96e6..0000000 --- a/node_modules/@tanstack/query-core/build/modern/mutation.cjs +++ /dev/null @@ -1,307 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// src/mutation.ts -var mutation_exports = {}; -__export(mutation_exports, { - Mutation: () => Mutation, - getDefaultState: () => getDefaultState -}); -module.exports = __toCommonJS(mutation_exports); -var import_notifyManager = require("./notifyManager.cjs"); -var import_removable = require("./removable.cjs"); -var import_retryer = require("./retryer.cjs"); -var Mutation = class extends import_removable.Removable { - #client; - #observers; - #mutationCache; - #retryer; - constructor(config) { - super(); - this.#client = config.client; - this.mutationId = config.mutationId; - this.#mutationCache = config.mutationCache; - this.#observers = []; - this.state = config.state || getDefaultState(); - this.setOptions(config.options); - this.scheduleGc(); - } - setOptions(options) { - this.options = options; - this.updateGcTime(this.options.gcTime); - } - get meta() { - return this.options.meta; - } - addObserver(observer) { - if (!this.#observers.includes(observer)) { - this.#observers.push(observer); - this.clearGcTimeout(); - this.#mutationCache.notify({ - type: "observerAdded", - mutation: this, - observer - }); - } - } - removeObserver(observer) { - this.#observers = this.#observers.filter((x) => x !== observer); - this.scheduleGc(); - this.#mutationCache.notify({ - type: "observerRemoved", - mutation: this, - observer - }); - } - optionalRemove() { - if (!this.#observers.length) { - if (this.state.status === "pending") { - this.scheduleGc(); - } else { - this.#mutationCache.remove(this); - } - } - } - continue() { - return this.#retryer?.continue() ?? // continuing a mutation assumes that variables are set, mutation must have been dehydrated before - this.execute(this.state.variables); - } - async execute(variables) { - const onContinue = () => { - this.#dispatch({ type: "continue" }); - }; - const mutationFnContext = { - client: this.#client, - meta: this.options.meta, - mutationKey: this.options.mutationKey - }; - this.#retryer = (0, import_retryer.createRetryer)({ - fn: () => { - if (!this.options.mutationFn) { - return Promise.reject(new Error("No mutationFn found")); - } - return this.options.mutationFn(variables, mutationFnContext); - }, - onFail: (failureCount, error) => { - this.#dispatch({ type: "failed", failureCount, error }); - }, - onPause: () => { - this.#dispatch({ type: "pause" }); - }, - onContinue, - retry: this.options.retry ?? 0, - retryDelay: this.options.retryDelay, - networkMode: this.options.networkMode, - canRun: () => this.#mutationCache.canRun(this) - }); - const restored = this.state.status === "pending"; - const isPaused = !this.#retryer.canStart(); - try { - if (restored) { - onContinue(); - } else { - this.#dispatch({ type: "pending", variables, isPaused }); - if (this.#mutationCache.config.onMutate) { - await this.#mutationCache.config.onMutate( - variables, - this, - mutationFnContext - ); - } - const context = await this.options.onMutate?.( - variables, - mutationFnContext - ); - if (context !== this.state.context) { - this.#dispatch({ - type: "pending", - context, - variables, - isPaused - }); - } - } - const data = await this.#retryer.start(); - await this.#mutationCache.config.onSuccess?.( - data, - variables, - this.state.context, - this, - mutationFnContext - ); - await this.options.onSuccess?.( - data, - variables, - this.state.context, - mutationFnContext - ); - await this.#mutationCache.config.onSettled?.( - data, - null, - this.state.variables, - this.state.context, - this, - mutationFnContext - ); - await this.options.onSettled?.( - data, - null, - variables, - this.state.context, - mutationFnContext - ); - this.#dispatch({ type: "success", data }); - return data; - } catch (error) { - try { - await this.#mutationCache.config.onError?.( - error, - variables, - this.state.context, - this, - mutationFnContext - ); - } catch (e) { - void Promise.reject(e); - } - try { - await this.options.onError?.( - error, - variables, - this.state.context, - mutationFnContext - ); - } catch (e) { - void Promise.reject(e); - } - try { - await this.#mutationCache.config.onSettled?.( - void 0, - error, - this.state.variables, - this.state.context, - this, - mutationFnContext - ); - } catch (e) { - void Promise.reject(e); - } - try { - await this.options.onSettled?.( - void 0, - error, - variables, - this.state.context, - mutationFnContext - ); - } catch (e) { - void Promise.reject(e); - } - this.#dispatch({ type: "error", error }); - throw error; - } finally { - this.#mutationCache.runNext(this); - } - } - #dispatch(action) { - const reducer = (state) => { - switch (action.type) { - case "failed": - return { - ...state, - failureCount: action.failureCount, - failureReason: action.error - }; - case "pause": - return { - ...state, - isPaused: true - }; - case "continue": - return { - ...state, - isPaused: false - }; - case "pending": - return { - ...state, - context: action.context, - data: void 0, - failureCount: 0, - failureReason: null, - error: null, - isPaused: action.isPaused, - status: "pending", - variables: action.variables, - submittedAt: Date.now() - }; - case "success": - return { - ...state, - data: action.data, - failureCount: 0, - failureReason: null, - error: null, - status: "success", - isPaused: false - }; - case "error": - return { - ...state, - data: void 0, - error: action.error, - failureCount: state.failureCount + 1, - failureReason: action.error, - isPaused: false, - status: "error" - }; - } - }; - this.state = reducer(this.state); - import_notifyManager.notifyManager.batch(() => { - this.#observers.forEach((observer) => { - observer.onMutationUpdate(action); - }); - this.#mutationCache.notify({ - mutation: this, - type: "updated", - action - }); - }); - } -}; -function getDefaultState() { - return { - context: void 0, - data: void 0, - error: null, - failureCount: 0, - failureReason: null, - isPaused: false, - status: "idle", - variables: void 0, - submittedAt: 0 - }; -} -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - Mutation, - getDefaultState -}); -//# sourceMappingURL=mutation.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/mutation.cjs.map b/node_modules/@tanstack/query-core/build/modern/mutation.cjs.map deleted file mode 100644 index bc0a1bd..0000000 --- a/node_modules/@tanstack/query-core/build/modern/mutation.cjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/mutation.ts"],"sourcesContent":["import { notifyManager } from './notifyManager'\nimport { Removable } from './removable'\nimport { createRetryer } from './retryer'\nimport type {\n DefaultError,\n MutationFunctionContext,\n MutationMeta,\n MutationOptions,\n MutationStatus,\n} from './types'\nimport type { MutationCache } from './mutationCache'\nimport type { MutationObserver } from './mutationObserver'\nimport type { Retryer } from './retryer'\nimport type { QueryClient } from './queryClient'\n\n// TYPES\n\ninterface MutationConfig {\n client: QueryClient\n mutationId: number\n mutationCache: MutationCache\n options: MutationOptions\n state?: MutationState\n}\n\nexport interface MutationState<\n TData = unknown,\n TError = DefaultError,\n TVariables = unknown,\n TOnMutateResult = unknown,\n> {\n context: TOnMutateResult | undefined\n data: TData | undefined\n error: TError | null\n failureCount: number\n failureReason: TError | null\n isPaused: boolean\n status: MutationStatus\n variables: TVariables | undefined\n submittedAt: number\n}\n\ninterface FailedAction {\n type: 'failed'\n failureCount: number\n error: TError | null\n}\n\ninterface PendingAction {\n type: 'pending'\n isPaused: boolean\n variables?: TVariables\n context?: TOnMutateResult\n}\n\ninterface SuccessAction {\n type: 'success'\n data: TData\n}\n\ninterface ErrorAction {\n type: 'error'\n error: TError\n}\n\ninterface PauseAction {\n type: 'pause'\n}\n\ninterface ContinueAction {\n type: 'continue'\n}\n\nexport type Action =\n | ContinueAction\n | ErrorAction\n | FailedAction\n | PendingAction\n | PauseAction\n | SuccessAction\n\n// CLASS\n\nexport class Mutation<\n TData = unknown,\n TError = DefaultError,\n TVariables = unknown,\n TOnMutateResult = unknown,\n> extends Removable {\n state: MutationState\n options!: MutationOptions\n readonly mutationId: number\n\n #client: QueryClient\n #observers: Array<\n MutationObserver\n >\n #mutationCache: MutationCache\n #retryer?: Retryer\n\n constructor(\n config: MutationConfig,\n ) {\n super()\n\n this.#client = config.client\n this.mutationId = config.mutationId\n this.#mutationCache = config.mutationCache\n this.#observers = []\n this.state = config.state || getDefaultState()\n\n this.setOptions(config.options)\n this.scheduleGc()\n }\n\n setOptions(\n options: MutationOptions,\n ): void {\n this.options = options\n\n this.updateGcTime(this.options.gcTime)\n }\n\n get meta(): MutationMeta | undefined {\n return this.options.meta\n }\n\n addObserver(observer: MutationObserver): void {\n if (!this.#observers.includes(observer)) {\n this.#observers.push(observer)\n\n // Stop the mutation from being garbage collected\n this.clearGcTimeout()\n\n this.#mutationCache.notify({\n type: 'observerAdded',\n mutation: this,\n observer,\n })\n }\n }\n\n removeObserver(observer: MutationObserver): void {\n this.#observers = this.#observers.filter((x) => x !== observer)\n\n this.scheduleGc()\n\n this.#mutationCache.notify({\n type: 'observerRemoved',\n mutation: this,\n observer,\n })\n }\n\n protected optionalRemove() {\n if (!this.#observers.length) {\n if (this.state.status === 'pending') {\n this.scheduleGc()\n } else {\n this.#mutationCache.remove(this)\n }\n }\n }\n\n continue(): Promise {\n return (\n this.#retryer?.continue() ??\n // continuing a mutation assumes that variables are set, mutation must have been dehydrated before\n this.execute(this.state.variables!)\n )\n }\n\n async execute(variables: TVariables): Promise {\n const onContinue = () => {\n this.#dispatch({ type: 'continue' })\n }\n\n const mutationFnContext = {\n client: this.#client,\n meta: this.options.meta,\n mutationKey: this.options.mutationKey,\n } satisfies MutationFunctionContext\n\n this.#retryer = createRetryer({\n fn: () => {\n if (!this.options.mutationFn) {\n return Promise.reject(new Error('No mutationFn found'))\n }\n\n return this.options.mutationFn(variables, mutationFnContext)\n },\n onFail: (failureCount, error) => {\n this.#dispatch({ type: 'failed', failureCount, error })\n },\n onPause: () => {\n this.#dispatch({ type: 'pause' })\n },\n onContinue,\n retry: this.options.retry ?? 0,\n retryDelay: this.options.retryDelay,\n networkMode: this.options.networkMode,\n canRun: () => this.#mutationCache.canRun(this),\n })\n\n const restored = this.state.status === 'pending'\n const isPaused = !this.#retryer.canStart()\n\n try {\n if (restored) {\n // Dispatch continue action to unpause restored mutation\n onContinue()\n } else {\n this.#dispatch({ type: 'pending', variables, isPaused })\n // Notify cache callback\n if (this.#mutationCache.config.onMutate) {\n await this.#mutationCache.config.onMutate(\n variables,\n this as Mutation,\n mutationFnContext,\n )\n }\n const context = await this.options.onMutate?.(\n variables,\n mutationFnContext,\n )\n if (context !== this.state.context) {\n this.#dispatch({\n type: 'pending',\n context,\n variables,\n isPaused,\n })\n }\n }\n const data = await this.#retryer.start()\n\n // Notify cache callback\n await this.#mutationCache.config.onSuccess?.(\n data,\n variables,\n this.state.context,\n this as Mutation,\n mutationFnContext,\n )\n\n await this.options.onSuccess?.(\n data,\n variables,\n this.state.context!,\n mutationFnContext,\n )\n\n // Notify cache callback\n await this.#mutationCache.config.onSettled?.(\n data,\n null,\n this.state.variables,\n this.state.context,\n this as Mutation,\n mutationFnContext,\n )\n\n await this.options.onSettled?.(\n data,\n null,\n variables,\n this.state.context,\n mutationFnContext,\n )\n\n this.#dispatch({ type: 'success', data })\n return data\n } catch (error) {\n try {\n // Notify cache callback\n await this.#mutationCache.config.onError?.(\n error as any,\n variables,\n this.state.context,\n this as Mutation,\n mutationFnContext,\n )\n } catch (e) {\n void Promise.reject(e)\n }\n\n try {\n await this.options.onError?.(\n error as TError,\n variables,\n this.state.context,\n mutationFnContext,\n )\n } catch (e) {\n void Promise.reject(e)\n }\n\n try {\n // Notify cache callback\n await this.#mutationCache.config.onSettled?.(\n undefined,\n error as any,\n this.state.variables,\n this.state.context,\n this as Mutation,\n mutationFnContext,\n )\n } catch (e) {\n void Promise.reject(e)\n }\n\n try {\n await this.options.onSettled?.(\n undefined,\n error as TError,\n variables,\n this.state.context,\n mutationFnContext,\n )\n } catch (e) {\n void Promise.reject(e)\n }\n\n this.#dispatch({ type: 'error', error: error as TError })\n throw error\n } finally {\n this.#mutationCache.runNext(this)\n }\n }\n\n #dispatch(action: Action): void {\n const reducer = (\n state: MutationState,\n ): MutationState => {\n switch (action.type) {\n case 'failed':\n return {\n ...state,\n failureCount: action.failureCount,\n failureReason: action.error,\n }\n case 'pause':\n return {\n ...state,\n isPaused: true,\n }\n case 'continue':\n return {\n ...state,\n isPaused: false,\n }\n case 'pending':\n return {\n ...state,\n context: action.context,\n data: undefined,\n failureCount: 0,\n failureReason: null,\n error: null,\n isPaused: action.isPaused,\n status: 'pending',\n variables: action.variables,\n submittedAt: Date.now(),\n }\n case 'success':\n return {\n ...state,\n data: action.data,\n failureCount: 0,\n failureReason: null,\n error: null,\n status: 'success',\n isPaused: false,\n }\n case 'error':\n return {\n ...state,\n data: undefined,\n error: action.error,\n failureCount: state.failureCount + 1,\n failureReason: action.error,\n isPaused: false,\n status: 'error',\n }\n }\n }\n this.state = reducer(this.state)\n\n notifyManager.batch(() => {\n this.#observers.forEach((observer) => {\n observer.onMutationUpdate(action)\n })\n this.#mutationCache.notify({\n mutation: this,\n type: 'updated',\n action,\n })\n })\n }\n}\n\nexport function getDefaultState<\n TData,\n TError,\n TVariables,\n TOnMutateResult,\n>(): MutationState {\n return {\n context: undefined,\n data: undefined,\n error: null,\n failureCount: 0,\n failureReason: null,\n isPaused: false,\n status: 'idle',\n variables: undefined,\n submittedAt: 0,\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,2BAA8B;AAC9B,uBAA0B;AAC1B,qBAA8B;AAiFvB,IAAM,WAAN,cAKG,2BAAU;AAAA,EAKlB;AAAA,EACA;AAAA,EAGA;AAAA,EACA;AAAA,EAEA,YACE,QACA;AACA,UAAM;AAEN,SAAK,UAAU,OAAO;AACtB,SAAK,aAAa,OAAO;AACzB,SAAK,iBAAiB,OAAO;AAC7B,SAAK,aAAa,CAAC;AACnB,SAAK,QAAQ,OAAO,SAAS,gBAAgB;AAE7C,SAAK,WAAW,OAAO,OAAO;AAC9B,SAAK,WAAW;AAAA,EAClB;AAAA,EAEA,WACE,SACM;AACN,SAAK,UAAU;AAEf,SAAK,aAAa,KAAK,QAAQ,MAAM;AAAA,EACvC;AAAA,EAEA,IAAI,OAAiC;AACnC,WAAO,KAAK,QAAQ;AAAA,EACtB;AAAA,EAEA,YA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at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/mutation.d.cts b/node_modules/@tanstack/query-core/build/modern/mutation.d.cts deleted file mode 100644 index 6d5c5fa..0000000 --- a/node_modules/@tanstack/query-core/build/modern/mutation.d.cts +++ /dev/null @@ -1,3 +0,0 @@ -import './removable.cjs'; -export { bj as Action, x as Mutation, y as MutationState, bk as getDefaultState } from './hydration-uphG6M-i.cjs'; -import './subscribable.cjs'; diff --git a/node_modules/@tanstack/query-core/build/modern/mutation.d.ts b/node_modules/@tanstack/query-core/build/modern/mutation.d.ts deleted file mode 100644 index 61bcecc..0000000 --- a/node_modules/@tanstack/query-core/build/modern/mutation.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import './removable.js'; -export { bj as Action, x as Mutation, y as MutationState, bk as getDefaultState } from './hydration-BlEVG2Lp.js'; -import './subscribable.js'; diff --git a/node_modules/@tanstack/query-core/build/modern/mutation.js b/node_modules/@tanstack/query-core/build/modern/mutation.js deleted file mode 100644 index c710461..0000000 --- a/node_modules/@tanstack/query-core/build/modern/mutation.js +++ /dev/null @@ -1,281 +0,0 @@ -// src/mutation.ts -import { notifyManager } from "./notifyManager.js"; -import { Removable } from "./removable.js"; -import { createRetryer } from "./retryer.js"; -var Mutation = class extends Removable { - #client; - #observers; - #mutationCache; - #retryer; - constructor(config) { - super(); - this.#client = config.client; - this.mutationId = config.mutationId; - this.#mutationCache = config.mutationCache; - this.#observers = []; - this.state = config.state || getDefaultState(); - this.setOptions(config.options); - this.scheduleGc(); - } - setOptions(options) { - this.options = options; - this.updateGcTime(this.options.gcTime); - } - get meta() { - return this.options.meta; - } - addObserver(observer) { - if (!this.#observers.includes(observer)) { - this.#observers.push(observer); - this.clearGcTimeout(); - this.#mutationCache.notify({ - type: "observerAdded", - mutation: this, - observer - }); - } - } - removeObserver(observer) { - this.#observers = this.#observers.filter((x) => x !== observer); - this.scheduleGc(); - this.#mutationCache.notify({ - type: "observerRemoved", - mutation: this, - observer - }); - } - optionalRemove() { - if (!this.#observers.length) { - if (this.state.status === "pending") { - this.scheduleGc(); - } else { - this.#mutationCache.remove(this); - } - } - } - continue() { - return this.#retryer?.continue() ?? // continuing a mutation assumes that variables are set, mutation must have been dehydrated before - this.execute(this.state.variables); - } - async execute(variables) { - const onContinue = () => { - this.#dispatch({ type: "continue" }); - }; - const mutationFnContext = { - client: this.#client, - meta: this.options.meta, - mutationKey: this.options.mutationKey - }; - this.#retryer = createRetryer({ - fn: () => { - if (!this.options.mutationFn) { - return Promise.reject(new Error("No mutationFn found")); - } - return this.options.mutationFn(variables, mutationFnContext); - }, - onFail: (failureCount, error) => { - this.#dispatch({ type: "failed", failureCount, error }); - }, - onPause: () => { - this.#dispatch({ type: "pause" }); - }, - onContinue, - retry: this.options.retry ?? 0, - retryDelay: this.options.retryDelay, - networkMode: this.options.networkMode, - canRun: () => this.#mutationCache.canRun(this) - }); - const restored = this.state.status === "pending"; - const isPaused = !this.#retryer.canStart(); - try { - if (restored) { - onContinue(); - } else { - this.#dispatch({ type: "pending", variables, isPaused }); - if (this.#mutationCache.config.onMutate) { - await this.#mutationCache.config.onMutate( - variables, - this, - mutationFnContext - ); - } - const context = await this.options.onMutate?.( - variables, - mutationFnContext - ); - if (context !== this.state.context) { - this.#dispatch({ - type: "pending", - context, - variables, - isPaused - }); - } - } - const data = await this.#retryer.start(); - await this.#mutationCache.config.onSuccess?.( - data, - variables, - this.state.context, - this, - mutationFnContext - ); - await this.options.onSuccess?.( - data, - variables, - this.state.context, - mutationFnContext - ); - await this.#mutationCache.config.onSettled?.( - data, - null, - this.state.variables, - this.state.context, - this, - mutationFnContext - ); - await this.options.onSettled?.( - data, - null, - variables, - this.state.context, - mutationFnContext - ); - this.#dispatch({ type: "success", data }); - return data; - } catch (error) { - try { - await this.#mutationCache.config.onError?.( - error, - variables, - this.state.context, - this, - mutationFnContext - ); - } catch (e) { - void Promise.reject(e); - } - try { - await this.options.onError?.( - error, - variables, - this.state.context, - mutationFnContext - ); - } catch (e) { - void Promise.reject(e); - } - try { - await this.#mutationCache.config.onSettled?.( - void 0, - error, - this.state.variables, - this.state.context, - this, - mutationFnContext - ); - } catch (e) { - void Promise.reject(e); - } - try { - await this.options.onSettled?.( - void 0, - error, - variables, - this.state.context, - mutationFnContext - ); - } catch (e) { - void Promise.reject(e); - } - this.#dispatch({ type: "error", error }); - throw error; - } finally { - this.#mutationCache.runNext(this); - } - } - #dispatch(action) { - const reducer = (state) => { - switch (action.type) { - case "failed": - return { - ...state, - failureCount: action.failureCount, - failureReason: action.error - }; - case "pause": - return { - ...state, - isPaused: true - }; - case "continue": - return { - ...state, - isPaused: false - }; - case "pending": - return { - ...state, - context: action.context, - data: void 0, - failureCount: 0, - failureReason: null, - error: null, - isPaused: action.isPaused, - status: "pending", - variables: action.variables, - submittedAt: Date.now() - }; - case "success": - return { - ...state, - data: action.data, - failureCount: 0, - failureReason: null, - error: null, - status: "success", - isPaused: false - }; - case "error": - return { - ...state, - data: void 0, - error: action.error, - failureCount: state.failureCount + 1, - failureReason: action.error, - isPaused: false, - status: "error" - }; - } - }; - this.state = reducer(this.state); - notifyManager.batch(() => { - this.#observers.forEach((observer) => { - observer.onMutationUpdate(action); - }); - this.#mutationCache.notify({ - mutation: this, - type: "updated", - action - }); - }); - } -}; -function getDefaultState() { - return { - context: void 0, - data: void 0, - error: null, - failureCount: 0, - failureReason: null, - isPaused: false, - status: "idle", - variables: void 0, - submittedAt: 0 - }; -} -export { - Mutation, - getDefaultState -}; -//# sourceMappingURL=mutation.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/mutation.js.map b/node_modules/@tanstack/query-core/build/modern/mutation.js.map deleted file mode 100644 index ab3ed56..0000000 --- a/node_modules/@tanstack/query-core/build/modern/mutation.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/mutation.ts"],"sourcesContent":["import { notifyManager } from './notifyManager'\nimport { Removable } from './removable'\nimport { createRetryer } from './retryer'\nimport type {\n DefaultError,\n MutationFunctionContext,\n MutationMeta,\n MutationOptions,\n MutationStatus,\n} from './types'\nimport type { MutationCache } from './mutationCache'\nimport type { MutationObserver } from './mutationObserver'\nimport type { Retryer } from './retryer'\nimport type { QueryClient } from './queryClient'\n\n// TYPES\n\ninterface MutationConfig {\n client: QueryClient\n mutationId: number\n mutationCache: MutationCache\n options: MutationOptions\n state?: MutationState\n}\n\nexport interface MutationState<\n TData = unknown,\n TError = DefaultError,\n TVariables = unknown,\n TOnMutateResult = unknown,\n> {\n context: TOnMutateResult | undefined\n data: TData | undefined\n error: TError | null\n failureCount: number\n failureReason: TError | null\n isPaused: boolean\n status: MutationStatus\n variables: TVariables | undefined\n submittedAt: number\n}\n\ninterface FailedAction {\n type: 'failed'\n failureCount: number\n error: TError | null\n}\n\ninterface PendingAction {\n type: 'pending'\n isPaused: boolean\n variables?: TVariables\n context?: TOnMutateResult\n}\n\ninterface SuccessAction {\n type: 'success'\n data: TData\n}\n\ninterface ErrorAction {\n type: 'error'\n error: TError\n}\n\ninterface PauseAction {\n type: 'pause'\n}\n\ninterface ContinueAction {\n type: 'continue'\n}\n\nexport type Action =\n | ContinueAction\n | ErrorAction\n | FailedAction\n | PendingAction\n | PauseAction\n | SuccessAction\n\n// CLASS\n\nexport class Mutation<\n TData = unknown,\n TError = DefaultError,\n TVariables = unknown,\n TOnMutateResult = unknown,\n> extends Removable {\n state: MutationState\n options!: MutationOptions\n readonly mutationId: number\n\n #client: QueryClient\n #observers: Array<\n MutationObserver\n >\n #mutationCache: MutationCache\n #retryer?: Retryer\n\n constructor(\n config: MutationConfig,\n ) {\n super()\n\n this.#client = config.client\n this.mutationId = config.mutationId\n this.#mutationCache = config.mutationCache\n this.#observers = []\n this.state = config.state || getDefaultState()\n\n this.setOptions(config.options)\n this.scheduleGc()\n }\n\n setOptions(\n options: MutationOptions,\n ): void {\n this.options = options\n\n this.updateGcTime(this.options.gcTime)\n }\n\n get meta(): MutationMeta | undefined {\n return this.options.meta\n }\n\n addObserver(observer: MutationObserver): void {\n if (!this.#observers.includes(observer)) {\n this.#observers.push(observer)\n\n // Stop the mutation from being garbage collected\n this.clearGcTimeout()\n\n this.#mutationCache.notify({\n type: 'observerAdded',\n mutation: this,\n observer,\n })\n }\n }\n\n removeObserver(observer: MutationObserver): void {\n this.#observers = this.#observers.filter((x) => x !== observer)\n\n this.scheduleGc()\n\n this.#mutationCache.notify({\n type: 'observerRemoved',\n mutation: this,\n observer,\n })\n }\n\n protected optionalRemove() {\n if (!this.#observers.length) {\n if (this.state.status === 'pending') {\n this.scheduleGc()\n } else {\n this.#mutationCache.remove(this)\n }\n }\n }\n\n continue(): Promise {\n return (\n this.#retryer?.continue() ??\n // continuing a mutation assumes that variables are set, mutation must have been dehydrated before\n this.execute(this.state.variables!)\n )\n }\n\n async execute(variables: TVariables): Promise {\n const onContinue = () => {\n this.#dispatch({ type: 'continue' })\n }\n\n const mutationFnContext = {\n client: this.#client,\n meta: this.options.meta,\n mutationKey: this.options.mutationKey,\n } satisfies MutationFunctionContext\n\n this.#retryer = createRetryer({\n fn: () => {\n if (!this.options.mutationFn) {\n return Promise.reject(new Error('No mutationFn found'))\n }\n\n return this.options.mutationFn(variables, mutationFnContext)\n },\n onFail: (failureCount, error) => {\n this.#dispatch({ type: 'failed', failureCount, error })\n },\n onPause: () => {\n this.#dispatch({ type: 'pause' })\n },\n onContinue,\n retry: this.options.retry ?? 0,\n retryDelay: this.options.retryDelay,\n networkMode: this.options.networkMode,\n canRun: () => this.#mutationCache.canRun(this),\n })\n\n const restored = this.state.status === 'pending'\n const isPaused = !this.#retryer.canStart()\n\n try {\n if (restored) {\n // Dispatch continue action to unpause restored mutation\n onContinue()\n } else {\n this.#dispatch({ type: 'pending', variables, isPaused })\n // Notify cache callback\n if (this.#mutationCache.config.onMutate) {\n await this.#mutationCache.config.onMutate(\n variables,\n this as Mutation,\n mutationFnContext,\n )\n }\n const context = await this.options.onMutate?.(\n variables,\n mutationFnContext,\n )\n if (context !== this.state.context) {\n this.#dispatch({\n type: 'pending',\n context,\n variables,\n isPaused,\n })\n }\n }\n const data = await this.#retryer.start()\n\n // Notify cache callback\n await this.#mutationCache.config.onSuccess?.(\n data,\n variables,\n this.state.context,\n this as Mutation,\n mutationFnContext,\n )\n\n await this.options.onSuccess?.(\n data,\n variables,\n this.state.context!,\n mutationFnContext,\n )\n\n // Notify cache callback\n await this.#mutationCache.config.onSettled?.(\n data,\n null,\n this.state.variables,\n this.state.context,\n this as Mutation,\n mutationFnContext,\n )\n\n await this.options.onSettled?.(\n data,\n null,\n variables,\n this.state.context,\n mutationFnContext,\n )\n\n this.#dispatch({ type: 'success', data })\n return data\n } catch (error) {\n try {\n // Notify cache callback\n await this.#mutationCache.config.onError?.(\n error as any,\n variables,\n this.state.context,\n this as Mutation,\n mutationFnContext,\n )\n } catch (e) {\n void Promise.reject(e)\n }\n\n try {\n await this.options.onError?.(\n error as TError,\n variables,\n this.state.context,\n mutationFnContext,\n )\n } catch (e) {\n void Promise.reject(e)\n }\n\n try {\n // Notify cache callback\n await this.#mutationCache.config.onSettled?.(\n undefined,\n error as any,\n this.state.variables,\n this.state.context,\n this as Mutation,\n mutationFnContext,\n )\n } catch (e) {\n void Promise.reject(e)\n }\n\n try {\n await this.options.onSettled?.(\n undefined,\n error as TError,\n variables,\n this.state.context,\n mutationFnContext,\n )\n } catch (e) {\n void Promise.reject(e)\n }\n\n this.#dispatch({ type: 'error', error: error as TError })\n throw error\n } finally {\n this.#mutationCache.runNext(this)\n }\n }\n\n #dispatch(action: Action): void {\n const reducer = (\n state: MutationState,\n ): MutationState => {\n switch (action.type) {\n case 'failed':\n return {\n ...state,\n failureCount: action.failureCount,\n failureReason: action.error,\n }\n case 'pause':\n return {\n ...state,\n isPaused: true,\n }\n case 'continue':\n return {\n ...state,\n isPaused: false,\n }\n case 'pending':\n return {\n ...state,\n context: action.context,\n data: undefined,\n failureCount: 0,\n failureReason: null,\n error: null,\n isPaused: action.isPaused,\n status: 'pending',\n variables: action.variables,\n submittedAt: Date.now(),\n }\n case 'success':\n return {\n ...state,\n data: action.data,\n failureCount: 0,\n failureReason: null,\n error: null,\n status: 'success',\n isPaused: false,\n }\n case 'error':\n return {\n ...state,\n data: undefined,\n error: action.error,\n failureCount: state.failureCount + 1,\n failureReason: action.error,\n isPaused: false,\n status: 'error',\n }\n }\n }\n this.state = reducer(this.state)\n\n notifyManager.batch(() => {\n this.#observers.forEach((observer) => {\n observer.onMutationUpdate(action)\n })\n this.#mutationCache.notify({\n mutation: this,\n type: 'updated',\n action,\n })\n })\n }\n}\n\nexport function getDefaultState<\n TData,\n TError,\n TVariables,\n TOnMutateResult,\n>(): MutationState {\n return {\n context: undefined,\n data: undefined,\n error: null,\n failureCount: 0,\n failureReason: null,\n isPaused: false,\n status: 'idle',\n variables: undefined,\n submittedAt: 0,\n }\n}\n"],"mappings":";AAAA,SAAS,qBAAqB;AAC9B,SAAS,iBAAiB;AAC1B,SAAS,qBAAqB;AAiFvB,IAAM,WAAN,cAKG,UAAU;AAAA,EAKlB;AAAA,EACA;AAAA,EAGA;AAAA,EACA;AAAA,EAEA,YACE,QACA;AACA,UAAM;AAEN,SAAK,UAAU,OAAO;AACtB,SAAK,aAAa,OAAO;AACzB,SAAK,iBAAiB,OAAO;AAC7B,SAAK,aAAa,CAAC;AACnB,SAAK,QAAQ,OAAO,SAAS,gBAAgB;AAE7C,SAAK,WAAW,OAAO,OAAO;AAC9B,SAAK,WAAW;AAAA,EAClB;AAAA,EAEA,WACE,SACM;AACN,SAAK,UAAU;AAEf,SAAK,aAAa,KAAK,QAAQ,MAAM;AAAA,EACvC;AAAA,EAEA,IAAI,OAAiC;AACnC,WAAO,KAAK,QAAQ;AAAA,EACtB;AAAA,EAEA,YAAY,UAAsD;AAChE,QAAI,CAAC,KAAK,WAAW,SAAS,QAAQ,GAAG;AACvC,WAAK,WAAW,KAAK,QAAQ;AAG7B,WAAK,eAAe;AAEpB,WAAK,eAAe,OAAO;AAAA,QACzB,MAAM;AAAA,QACN,UAAU;AAAA,QACV;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A,YACH,SAAS,OAAO;AAAA,YAChB,MAAM;AAAA,YACN,cAAc;AAAA,YACd,eAAe;AAAA,YACf,OAAO;AAAA,YACP,UAAU,OAAO;AAAA,YACjB,QAAQ;AAAA,YACR,WAAW,OAAO;AAAA,YAClB,aAAa,KAAK,IAAI;AAAA,UACxB;AAAA,QACF,KAAK;AACH,iBAAO;AAAA,YACL,GAAG;AAAA,YACH,MAAM,OAAO;AAAA,YACb,cAAc;AAAA,YACd,eAAe;AAAA,YACf,OAAO;AAAA,YACP,QAAQ;AAAA,YACR,UAAU;AAAA,UACZ;AAAA,QACF,KAAK;AACH,iBAAO;AAAA,YACL,GAAG;AAAA,YACH,MAAM;AAAA,YACN,OAAO,OAAO;AAAA,YACd,cAAc,MAAM,eAAe;AAAA,YACnC,eAAe,OAAO;AAAA,YACtB,UAAU;AAAA,YACV,QAAQ;AAAA,UACV;AAAA,MACJ;AAAA,IACF;AACA,SAAK,QAAQ,QAAQ,KAAK,KAAK;AAE/B,kBAAc,MAAM,MAAM;AACxB,WAAK,WAAW,QAAQ,CAAC,aAAa;AACpC,iBAAS,iBAAiB,MAAM;AAAA,MAClC,CAAC;AACD,WAAK,eAAe,OAAO;AAAA,QACzB,UAAU;AAAA,QACV,MAAM;AAAA,QACN;AAAA,MACF,CAAC;AAAA,IACH,CAAC;AAAA,EACH;AACF;AAEO,SAAS,kBAK+C;AAC7D,SAAO;AAAA,IACL,SAAS;AAAA,IACT,MAAM;AAAA,IACN,OAAO;AAAA,IACP,cAAc;AAAA,IACd,eAAe;AAAA,IACf,UAAU;AAAA,IACV,QAAQ;AAAA,IACR,WAAW;AAAA,IACX,aAAa;AAAA,EACf;AACF;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/mutationCache.cjs b/node_modules/@tanstack/query-core/build/modern/mutationCache.cjs deleted file mode 100644 index f939c12..0000000 --- a/node_modules/@tanstack/query-core/build/modern/mutationCache.cjs +++ /dev/null @@ -1,149 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// src/mutationCache.ts -var mutationCache_exports = {}; -__export(mutationCache_exports, { - MutationCache: () => MutationCache -}); -module.exports = __toCommonJS(mutationCache_exports); -var import_notifyManager = require("./notifyManager.cjs"); -var import_mutation = require("./mutation.cjs"); -var import_utils = require("./utils.cjs"); -var import_subscribable = require("./subscribable.cjs"); -var MutationCache = class extends import_subscribable.Subscribable { - constructor(config = {}) { - super(); - this.config = config; - this.#mutations = /* @__PURE__ */ new Set(); - this.#scopes = /* @__PURE__ */ new Map(); - this.#mutationId = 0; - } - #mutations; - #scopes; - #mutationId; - build(client, options, state) { - const mutation = new import_mutation.Mutation({ - client, - mutationCache: this, - mutationId: ++this.#mutationId, - options: client.defaultMutationOptions(options), - state - }); - this.add(mutation); - return mutation; - } - add(mutation) { - this.#mutations.add(mutation); - const scope = scopeFor(mutation); - if (typeof scope === "string") { - const scopedMutations = this.#scopes.get(scope); - if (scopedMutations) { - scopedMutations.push(mutation); - } else { - this.#scopes.set(scope, [mutation]); - } - } - this.notify({ type: "added", mutation }); - } - remove(mutation) { - if (this.#mutations.delete(mutation)) { - const scope = scopeFor(mutation); - if (typeof scope === "string") { - const scopedMutations = this.#scopes.get(scope); - if (scopedMutations) { - if (scopedMutations.length > 1) { - const index = scopedMutations.indexOf(mutation); - if (index !== -1) { - scopedMutations.splice(index, 1); - } - } else if (scopedMutations[0] === mutation) { - this.#scopes.delete(scope); - } - } - } - } - this.notify({ type: "removed", mutation }); - } - canRun(mutation) { - const scope = scopeFor(mutation); - if (typeof scope === "string") { - const mutationsWithSameScope = this.#scopes.get(scope); - const firstPendingMutation = mutationsWithSameScope?.find( - (m) => m.state.status === "pending" - ); - return !firstPendingMutation || firstPendingMutation === mutation; - } else { - return true; - } - } - runNext(mutation) { - const scope = scopeFor(mutation); - if (typeof scope === "string") { - const foundMutation = this.#scopes.get(scope)?.find((m) => m !== mutation && m.state.isPaused); - return foundMutation?.continue() ?? Promise.resolve(); - } else { - return Promise.resolve(); - } - } - clear() { - import_notifyManager.notifyManager.batch(() => { - this.#mutations.forEach((mutation) => { - this.notify({ type: "removed", mutation }); - }); - this.#mutations.clear(); - this.#scopes.clear(); - }); - } - getAll() { - return Array.from(this.#mutations); - } - find(filters) { - const defaultedFilters = { exact: true, ...filters }; - return this.getAll().find( - (mutation) => (0, import_utils.matchMutation)(defaultedFilters, mutation) - ); - } - findAll(filters = {}) { - return this.getAll().filter((mutation) => (0, import_utils.matchMutation)(filters, mutation)); - } - notify(event) { - import_notifyManager.notifyManager.batch(() => { - this.listeners.forEach((listener) => { - listener(event); - }); - }); - } - resumePausedMutations() { - const pausedMutations = this.getAll().filter((x) => x.state.isPaused); - return import_notifyManager.notifyManager.batch( - () => Promise.all( - pausedMutations.map((mutation) => mutation.continue().catch(import_utils.noop)) - ) - ); - } -}; -function scopeFor(mutation) { - return mutation.options.scope?.id; -} -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - MutationCache -}); -//# sourceMappingURL=mutationCache.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/mutationCache.cjs.map b/node_modules/@tanstack/query-core/build/modern/mutationCache.cjs.map deleted file mode 100644 index 2308acf..0000000 --- a/node_modules/@tanstack/query-core/build/modern/mutationCache.cjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/mutationCache.ts"],"sourcesContent":["import { notifyManager } from './notifyManager'\nimport { Mutation } from './mutation'\nimport { matchMutation, noop } from './utils'\nimport { Subscribable } from './subscribable'\nimport type { MutationObserver } from './mutationObserver'\nimport type {\n DefaultError,\n MutationFunctionContext,\n MutationOptions,\n NotifyEvent,\n} from './types'\nimport type { QueryClient } from './queryClient'\nimport type { Action, MutationState } from './mutation'\nimport type { MutationFilters } from './utils'\n\n// TYPES\n\ninterface MutationCacheConfig {\n onError?: (\n error: DefaultError,\n variables: unknown,\n onMutateResult: unknown,\n mutation: Mutation,\n context: MutationFunctionContext,\n ) => Promise | unknown\n onSuccess?: (\n data: unknown,\n variables: unknown,\n onMutateResult: unknown,\n mutation: Mutation,\n context: MutationFunctionContext,\n ) => Promise | unknown\n onMutate?: (\n variables: unknown,\n mutation: Mutation,\n context: MutationFunctionContext,\n ) => Promise | unknown\n onSettled?: (\n data: unknown | undefined,\n error: DefaultError | null,\n variables: unknown,\n onMutateResult: unknown,\n mutation: Mutation,\n context: MutationFunctionContext,\n ) => Promise | unknown\n}\n\ninterface NotifyEventMutationAdded extends NotifyEvent {\n type: 'added'\n mutation: Mutation\n}\ninterface NotifyEventMutationRemoved extends NotifyEvent {\n type: 'removed'\n mutation: Mutation\n}\n\ninterface NotifyEventMutationObserverAdded extends NotifyEvent {\n type: 'observerAdded'\n mutation: Mutation\n observer: MutationObserver\n}\n\ninterface NotifyEventMutationObserverRemoved extends NotifyEvent {\n type: 'observerRemoved'\n mutation: Mutation\n observer: MutationObserver\n}\n\ninterface NotifyEventMutationObserverOptionsUpdated extends NotifyEvent {\n type: 'observerOptionsUpdated'\n mutation?: Mutation\n observer: MutationObserver\n}\n\ninterface NotifyEventMutationUpdated extends NotifyEvent {\n type: 'updated'\n mutation: Mutation\n action: Action\n}\n\nexport type MutationCacheNotifyEvent =\n | NotifyEventMutationAdded\n | NotifyEventMutationRemoved\n | NotifyEventMutationObserverAdded\n | NotifyEventMutationObserverRemoved\n | NotifyEventMutationObserverOptionsUpdated\n | NotifyEventMutationUpdated\n\ntype MutationCacheListener = (event: MutationCacheNotifyEvent) => void\n\n// CLASS\n\nexport class MutationCache extends Subscribable {\n #mutations: Set>\n #scopes: Map>>\n #mutationId: number\n\n constructor(public config: MutationCacheConfig = {}) {\n super()\n this.#mutations = new Set()\n this.#scopes = new Map()\n this.#mutationId = 0\n }\n\n build(\n client: QueryClient,\n options: MutationOptions,\n state?: MutationState,\n ): Mutation {\n const mutation = new Mutation({\n client,\n mutationCache: this,\n mutationId: ++this.#mutationId,\n options: client.defaultMutationOptions(options),\n state,\n })\n\n this.add(mutation)\n\n return mutation\n }\n\n add(mutation: Mutation): void {\n this.#mutations.add(mutation)\n const scope = scopeFor(mutation)\n if (typeof scope === 'string') {\n const scopedMutations = this.#scopes.get(scope)\n if (scopedMutations) {\n scopedMutations.push(mutation)\n } else {\n this.#scopes.set(scope, [mutation])\n }\n }\n this.notify({ type: 'added', mutation })\n }\n\n remove(mutation: Mutation): void {\n if (this.#mutations.delete(mutation)) {\n const scope = scopeFor(mutation)\n if (typeof scope === 'string') {\n const scopedMutations = this.#scopes.get(scope)\n if (scopedMutations) {\n if (scopedMutations.length > 1) {\n const index = scopedMutations.indexOf(mutation)\n if (index !== -1) {\n scopedMutations.splice(index, 1)\n }\n } else if (scopedMutations[0] === mutation) {\n this.#scopes.delete(scope)\n }\n }\n }\n }\n\n // Currently we notify the removal even if the mutation was already removed.\n // Consider making this an error or not notifying of the removal depending on the desired semantics.\n this.notify({ type: 'removed', mutation })\n }\n\n canRun(mutation: Mutation): boolean {\n const scope = scopeFor(mutation)\n if (typeof scope === 'string') {\n const mutationsWithSameScope = this.#scopes.get(scope)\n const firstPendingMutation = mutationsWithSameScope?.find(\n (m) => m.state.status === 'pending',\n )\n // we can run if there is no current pending mutation (start use-case)\n // or if WE are the first pending mutation (continue use-case)\n return !firstPendingMutation || firstPendingMutation === mutation\n } else {\n // For unscoped mutations there are never any pending mutations in front of the\n // current mutation\n return true\n }\n }\n\n runNext(mutation: Mutation): Promise {\n const scope = scopeFor(mutation)\n if (typeof scope === 'string') {\n const foundMutation = this.#scopes\n .get(scope)\n ?.find((m) => m !== mutation && m.state.isPaused)\n\n return foundMutation?.continue() ?? Promise.resolve()\n } else {\n return Promise.resolve()\n }\n }\n\n clear(): void {\n notifyManager.batch(() => {\n this.#mutations.forEach((mutation) => {\n this.notify({ type: 'removed', mutation })\n })\n this.#mutations.clear()\n this.#scopes.clear()\n })\n }\n\n getAll(): Array {\n return Array.from(this.#mutations)\n }\n\n find<\n TData = unknown,\n TError = DefaultError,\n TVariables = any,\n TOnMutateResult = unknown,\n >(\n filters: MutationFilters,\n ): Mutation | undefined {\n const defaultedFilters = { exact: true, ...filters }\n\n return this.getAll().find((mutation) =>\n matchMutation(defaultedFilters, mutation),\n ) as Mutation | undefined\n }\n\n findAll(filters: MutationFilters = {}): Array {\n return this.getAll().filter((mutation) => matchMutation(filters, mutation))\n }\n\n notify(event: MutationCacheNotifyEvent) {\n notifyManager.batch(() => {\n this.listeners.forEach((listener) => {\n listener(event)\n })\n })\n }\n\n resumePausedMutations(): Promise {\n const pausedMutations = this.getAll().filter((x) => x.state.isPaused)\n\n return notifyManager.batch(() =>\n Promise.all(\n pausedMutations.map((mutation) => mutation.continue().catch(noop)),\n ),\n )\n }\n}\n\nfunction scopeFor(mutation: Mutation) {\n return mutation.options.scope?.id\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,2BAA8B;AAC9B,sBAAyB;AACzB,mBAAoC;AACpC,0BAA6B;AAyFtB,IAAM,gBAAN,cAA4B,iCAAoC;AAAA,EAKrE,YAAmB,SAA8B,CAAC,GAAG;AACnD,UAAM;AADW;AAEjB,SAAK,aAAa,oBAAI,IAAI;AAC1B,SAAK,UAAU,oBAAI,IAAI;AACvB,SAAK,cAAc;AAAA,EACrB;AAAA,EATA;AAAA,EACA;AAAA,EACA;AAAA,EASA,MACE,QACA,SACA,OACsD;AAC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H;AAAA,EAEA,wBAA0C;AACxC,UAAM,kBAAkB,KAAK,OAAO,EAAE,OAAO,CAAC,MAAM,EAAE,MAAM,QAAQ;AAEpE,WAAO,mCAAc;AAAA,MAAM,MACzB,QAAQ;AAAA,QACN,gBAAgB,IAAI,CAAC,aAAa,SAAS,SAAS,EAAE,MAAM,iBAAI,CAAC;AAAA,MACnE;AAAA,IACF;AAAA,EACF;AACF;AAEA,SAAS,SAAS,UAAwC;AACxD,SAAO,SAAS,QAAQ,OAAO;AACjC;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/mutationCache.d.cts b/node_modules/@tanstack/query-core/build/modern/mutationCache.d.cts deleted file mode 100644 index ce18321..0000000 --- a/node_modules/@tanstack/query-core/build/modern/mutationCache.d.cts +++ /dev/null @@ -1,3 +0,0 @@ -export { M as MutationCache, c as MutationCacheNotifyEvent } from './hydration-uphG6M-i.cjs'; -import './subscribable.cjs'; -import './removable.cjs'; diff --git a/node_modules/@tanstack/query-core/build/modern/mutationCache.d.ts b/node_modules/@tanstack/query-core/build/modern/mutationCache.d.ts deleted file mode 100644 index 67f1bfe..0000000 --- a/node_modules/@tanstack/query-core/build/modern/mutationCache.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export { M as MutationCache, c as MutationCacheNotifyEvent } from './hydration-BlEVG2Lp.js'; -import './subscribable.js'; -import './removable.js'; diff --git a/node_modules/@tanstack/query-core/build/modern/mutationCache.js b/node_modules/@tanstack/query-core/build/modern/mutationCache.js deleted file mode 100644 index 7067b76..0000000 --- a/node_modules/@tanstack/query-core/build/modern/mutationCache.js +++ /dev/null @@ -1,124 +0,0 @@ -// src/mutationCache.ts -import { notifyManager } from "./notifyManager.js"; -import { Mutation } from "./mutation.js"; -import { matchMutation, noop } from "./utils.js"; -import { Subscribable } from "./subscribable.js"; -var MutationCache = class extends Subscribable { - constructor(config = {}) { - super(); - this.config = config; - this.#mutations = /* @__PURE__ */ new Set(); - this.#scopes = /* @__PURE__ */ new Map(); - this.#mutationId = 0; - } - #mutations; - #scopes; - #mutationId; - build(client, options, state) { - const mutation = new Mutation({ - client, - mutationCache: this, - mutationId: ++this.#mutationId, - options: client.defaultMutationOptions(options), - state - }); - this.add(mutation); - return mutation; - } - add(mutation) { - this.#mutations.add(mutation); - const scope = scopeFor(mutation); - if (typeof scope === "string") { - const scopedMutations = this.#scopes.get(scope); - if (scopedMutations) { - scopedMutations.push(mutation); - } else { - this.#scopes.set(scope, [mutation]); - } - } - this.notify({ type: "added", mutation }); - } - remove(mutation) { - if (this.#mutations.delete(mutation)) { - const scope = scopeFor(mutation); - if (typeof scope === "string") { - const scopedMutations = this.#scopes.get(scope); - if (scopedMutations) { - if (scopedMutations.length > 1) { - const index = scopedMutations.indexOf(mutation); - if (index !== -1) { - scopedMutations.splice(index, 1); - } - } else if (scopedMutations[0] === mutation) { - this.#scopes.delete(scope); - } - } - } - } - this.notify({ type: "removed", mutation }); - } - canRun(mutation) { - const scope = scopeFor(mutation); - if (typeof scope === "string") { - const mutationsWithSameScope = this.#scopes.get(scope); - const firstPendingMutation = mutationsWithSameScope?.find( - (m) => m.state.status === "pending" - ); - return !firstPendingMutation || firstPendingMutation === mutation; - } else { - return true; - } - } - runNext(mutation) { - const scope = scopeFor(mutation); - if (typeof scope === "string") { - const foundMutation = this.#scopes.get(scope)?.find((m) => m !== mutation && m.state.isPaused); - return foundMutation?.continue() ?? Promise.resolve(); - } else { - return Promise.resolve(); - } - } - clear() { - notifyManager.batch(() => { - this.#mutations.forEach((mutation) => { - this.notify({ type: "removed", mutation }); - }); - this.#mutations.clear(); - this.#scopes.clear(); - }); - } - getAll() { - return Array.from(this.#mutations); - } - find(filters) { - const defaultedFilters = { exact: true, ...filters }; - return this.getAll().find( - (mutation) => matchMutation(defaultedFilters, mutation) - ); - } - findAll(filters = {}) { - return this.getAll().filter((mutation) => matchMutation(filters, mutation)); - } - notify(event) { - notifyManager.batch(() => { - this.listeners.forEach((listener) => { - listener(event); - }); - }); - } - resumePausedMutations() { - const pausedMutations = this.getAll().filter((x) => x.state.isPaused); - return notifyManager.batch( - () => Promise.all( - pausedMutations.map((mutation) => mutation.continue().catch(noop)) - ) - ); - } -}; -function scopeFor(mutation) { - return mutation.options.scope?.id; -} -export { - MutationCache -}; -//# sourceMappingURL=mutationCache.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/mutationCache.js.map b/node_modules/@tanstack/query-core/build/modern/mutationCache.js.map deleted file mode 100644 index 6a7f97d..0000000 --- a/node_modules/@tanstack/query-core/build/modern/mutationCache.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/mutationCache.ts"],"sourcesContent":["import { notifyManager } from './notifyManager'\nimport { Mutation } from './mutation'\nimport { matchMutation, noop } from './utils'\nimport { Subscribable } from './subscribable'\nimport type { MutationObserver } from './mutationObserver'\nimport type {\n DefaultError,\n MutationFunctionContext,\n MutationOptions,\n NotifyEvent,\n} from './types'\nimport type { QueryClient } from './queryClient'\nimport type { Action, MutationState } from './mutation'\nimport type { MutationFilters } from './utils'\n\n// TYPES\n\ninterface MutationCacheConfig {\n onError?: (\n error: DefaultError,\n variables: unknown,\n onMutateResult: unknown,\n mutation: Mutation,\n context: MutationFunctionContext,\n ) => Promise | unknown\n onSuccess?: (\n data: unknown,\n variables: unknown,\n onMutateResult: unknown,\n mutation: Mutation,\n context: MutationFunctionContext,\n ) => Promise | unknown\n onMutate?: (\n variables: unknown,\n mutation: Mutation,\n context: MutationFunctionContext,\n ) => Promise | unknown\n onSettled?: (\n data: unknown | undefined,\n error: DefaultError | null,\n variables: unknown,\n onMutateResult: unknown,\n mutation: Mutation,\n context: MutationFunctionContext,\n ) => Promise | unknown\n}\n\ninterface NotifyEventMutationAdded extends NotifyEvent {\n type: 'added'\n mutation: Mutation\n}\ninterface NotifyEventMutationRemoved extends NotifyEvent {\n type: 'removed'\n mutation: Mutation\n}\n\ninterface NotifyEventMutationObserverAdded extends NotifyEvent {\n type: 'observerAdded'\n mutation: Mutation\n observer: MutationObserver\n}\n\ninterface NotifyEventMutationObserverRemoved extends NotifyEvent {\n type: 'observerRemoved'\n mutation: Mutation\n observer: MutationObserver\n}\n\ninterface NotifyEventMutationObserverOptionsUpdated extends NotifyEvent {\n type: 'observerOptionsUpdated'\n mutation?: Mutation\n observer: MutationObserver\n}\n\ninterface NotifyEventMutationUpdated extends NotifyEvent {\n type: 'updated'\n mutation: Mutation\n action: Action\n}\n\nexport type MutationCacheNotifyEvent =\n | NotifyEventMutationAdded\n | NotifyEventMutationRemoved\n | NotifyEventMutationObserverAdded\n | NotifyEventMutationObserverRemoved\n | NotifyEventMutationObserverOptionsUpdated\n | NotifyEventMutationUpdated\n\ntype MutationCacheListener = (event: MutationCacheNotifyEvent) => void\n\n// CLASS\n\nexport class MutationCache extends Subscribable {\n #mutations: Set>\n #scopes: Map>>\n #mutationId: number\n\n constructor(public config: MutationCacheConfig = {}) {\n super()\n this.#mutations = new Set()\n this.#scopes = new Map()\n this.#mutationId = 0\n }\n\n build(\n client: QueryClient,\n options: MutationOptions,\n state?: MutationState,\n ): Mutation {\n const mutation = new Mutation({\n client,\n mutationCache: this,\n mutationId: ++this.#mutationId,\n options: client.defaultMutationOptions(options),\n state,\n })\n\n this.add(mutation)\n\n return mutation\n }\n\n add(mutation: Mutation): void {\n this.#mutations.add(mutation)\n const scope = scopeFor(mutation)\n if (typeof scope === 'string') {\n const scopedMutations = this.#scopes.get(scope)\n if (scopedMutations) {\n scopedMutations.push(mutation)\n } else {\n this.#scopes.set(scope, [mutation])\n }\n }\n this.notify({ type: 'added', mutation })\n }\n\n remove(mutation: Mutation): void {\n if (this.#mutations.delete(mutation)) {\n const scope = scopeFor(mutation)\n if (typeof scope === 'string') {\n const scopedMutations = this.#scopes.get(scope)\n if (scopedMutations) {\n if (scopedMutations.length > 1) {\n const index = scopedMutations.indexOf(mutation)\n if (index !== -1) {\n scopedMutations.splice(index, 1)\n }\n } else if (scopedMutations[0] === mutation) {\n this.#scopes.delete(scope)\n }\n }\n }\n }\n\n // Currently we notify the removal even if the mutation was already removed.\n // Consider making this an error or not notifying of the removal depending on the desired semantics.\n this.notify({ type: 'removed', mutation })\n }\n\n canRun(mutation: Mutation): boolean {\n const scope = scopeFor(mutation)\n if (typeof scope === 'string') {\n const mutationsWithSameScope = this.#scopes.get(scope)\n const firstPendingMutation = mutationsWithSameScope?.find(\n (m) => m.state.status === 'pending',\n )\n // we can run if there is no current pending mutation (start use-case)\n // or if WE are the first pending mutation (continue use-case)\n return !firstPendingMutation || firstPendingMutation === mutation\n } else {\n // For unscoped mutations there are never any pending mutations in front of the\n // current mutation\n return true\n }\n }\n\n runNext(mutation: Mutation): Promise {\n const scope = scopeFor(mutation)\n if (typeof scope === 'string') {\n const foundMutation = this.#scopes\n .get(scope)\n ?.find((m) => m !== mutation && m.state.isPaused)\n\n return foundMutation?.continue() ?? Promise.resolve()\n } else {\n return Promise.resolve()\n }\n }\n\n clear(): void {\n notifyManager.batch(() => {\n this.#mutations.forEach((mutation) => {\n this.notify({ type: 'removed', mutation })\n })\n this.#mutations.clear()\n this.#scopes.clear()\n })\n }\n\n getAll(): Array {\n return Array.from(this.#mutations)\n }\n\n find<\n TData = unknown,\n TError = DefaultError,\n TVariables = any,\n TOnMutateResult = unknown,\n >(\n filters: MutationFilters,\n ): Mutation | undefined {\n const defaultedFilters = { exact: true, ...filters }\n\n return this.getAll().find((mutation) =>\n matchMutation(defaultedFilters, mutation),\n ) as Mutation | undefined\n }\n\n findAll(filters: MutationFilters = {}): Array {\n return this.getAll().filter((mutation) => matchMutation(filters, mutation))\n }\n\n notify(event: MutationCacheNotifyEvent) {\n notifyManager.batch(() => {\n this.listeners.forEach((listener) => {\n listener(event)\n })\n })\n }\n\n resumePausedMutations(): Promise {\n const pausedMutations = this.getAll().filter((x) => x.state.isPaused)\n\n return notifyManager.batch(() =>\n Promise.all(\n pausedMutations.map((mutation) => mutation.continue().catch(noop)),\n ),\n )\n }\n}\n\nfunction scopeFor(mutation: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nD,WAAO,KAAK,OAAO,EAAE;AAAA,MAAK,CAAC,aACzB,cAAc,kBAAkB,QAAQ;AAAA,IAC1C;AAAA,EACF;AAAA,EAEA,QAAQ,UAA2B,CAAC,GAAoB;AACtD,WAAO,KAAK,OAAO,EAAE,OAAO,CAAC,aAAa,cAAc,SAAS,QAAQ,CAAC;AAAA,EAC5E;AAAA,EAEA,OAAO,OAAiC;AACtC,kBAAc,MAAM,MAAM;AACxB,WAAK,UAAU,QAAQ,CAAC,aAAa;AACnC,iBAAS,KAAK;AAAA,MAChB,CAAC;AAAA,IACH,CAAC;AAAA,EACH;AAAA,EAEA,wBAA0C;AACxC,UAAM,kBAAkB,KAAK,OAAO,EAAE,OAAO,CAAC,MAAM,EAAE,MAAM,QAAQ;AAEpE,WAAO,cAAc;AAAA,MAAM,MACzB,QAAQ;AAAA,QACN,gBAAgB,IAAI,CAAC,aAAa,SAAS,SAAS,EAAE,MAAM,IAAI,CAAC;AAAA,MACnE;AAAA,IACF;AAAA,EACF;AACF;AAEA,SAAS,SAAS,UAAwC;AACxD,SAAO,SAAS,QAAQ,OAAO;AACjC;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/mutationObserver.cjs b/node_modules/@tanstack/query-core/build/modern/mutationObserver.cjs deleted file mode 100644 index b7dc73d..0000000 --- a/node_modules/@tanstack/query-core/build/modern/mutationObserver.cjs +++ /dev/null @@ -1,165 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// src/mutationObserver.ts -var mutationObserver_exports = {}; -__export(mutationObserver_exports, { - MutationObserver: () => MutationObserver -}); -module.exports = __toCommonJS(mutationObserver_exports); -var import_mutation = require("./mutation.cjs"); -var import_notifyManager = require("./notifyManager.cjs"); -var import_subscribable = require("./subscribable.cjs"); -var import_utils = require("./utils.cjs"); -var MutationObserver = class extends import_subscribable.Subscribable { - #client; - #currentResult = void 0; - #currentMutation; - #mutateOptions; - constructor(client, options) { - super(); - this.#client = client; - this.setOptions(options); - this.bindMethods(); - this.#updateResult(); - } - bindMethods() { - this.mutate = this.mutate.bind(this); - this.reset = this.reset.bind(this); - } - setOptions(options) { - const prevOptions = this.options; - this.options = this.#client.defaultMutationOptions(options); - if (!(0, import_utils.shallowEqualObjects)(this.options, prevOptions)) { - this.#client.getMutationCache().notify({ - type: "observerOptionsUpdated", - mutation: this.#currentMutation, - observer: this - }); - } - if (prevOptions?.mutationKey && this.options.mutationKey && (0, import_utils.hashKey)(prevOptions.mutationKey) !== (0, import_utils.hashKey)(this.options.mutationKey)) { - this.reset(); - } else if (this.#currentMutation?.state.status === "pending") { - this.#currentMutation.setOptions(this.options); - } - } - onUnsubscribe() { - if (!this.hasListeners()) { - this.#currentMutation?.removeObserver(this); - } - } - onMutationUpdate(action) { - this.#updateResult(); - this.#notify(action); - } - getCurrentResult() { - return this.#currentResult; - } - reset() { - this.#currentMutation?.removeObserver(this); - this.#currentMutation = void 0; - this.#updateResult(); - this.#notify(); - } - mutate(variables, options) { - this.#mutateOptions = options; - this.#currentMutation?.removeObserver(this); - this.#currentMutation = this.#client.getMutationCache().build(this.#client, this.options); - this.#currentMutation.addObserver(this); - return this.#currentMutation.execute(variables); - } - #updateResult() { - const state = this.#currentMutation?.state ?? (0, import_mutation.getDefaultState)(); - this.#currentResult = { - ...state, - isPending: state.status === "pending", - isSuccess: state.status === "success", - isError: state.status === "error", - isIdle: state.status === "idle", - mutate: this.mutate, - reset: this.reset - }; - } - #notify(action) { - import_notifyManager.notifyManager.batch(() => { - if (this.#mutateOptions && this.hasListeners()) { - const variables = this.#currentResult.variables; - const onMutateResult = this.#currentResult.context; - const context = { - client: this.#client, - meta: this.options.meta, - mutationKey: this.options.mutationKey - }; - if (action?.type === "success") { - try { - this.#mutateOptions.onSuccess?.( - action.data, - variables, - onMutateResult, - context - ); - } catch (e) { - void Promise.reject(e); - } - try { - this.#mutateOptions.onSettled?.( - action.data, - null, - variables, - onMutateResult, - context - ); - } catch (e) { - void Promise.reject(e); - } - } else if (action?.type === "error") { - try { - this.#mutateOptions.onError?.( - action.error, - variables, - onMutateResult, - context - ); - } catch (e) { - void Promise.reject(e); - } - try { - this.#mutateOptions.onSettled?.( - void 0, - action.error, - variables, - onMutateResult, - context - ); - } catch (e) { - void Promise.reject(e); - } - } - } - this.listeners.forEach((listener) => { - listener(this.#currentResult); - }); - }); - } -}; -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - MutationObserver -}); -//# sourceMappingURL=mutationObserver.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/mutationObserver.cjs.map b/node_modules/@tanstack/query-core/build/modern/mutationObserver.cjs.map deleted file mode 100644 index 642bf80..0000000 --- a/node_modules/@tanstack/query-core/build/modern/mutationObserver.cjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/mutationObserver.ts"],"sourcesContent":["import { getDefaultState } from './mutation'\nimport { notifyManager } from './notifyManager'\nimport { Subscribable } from './subscribable'\nimport { hashKey, shallowEqualObjects } from './utils'\nimport type { QueryClient } from './queryClient'\nimport type {\n DefaultError,\n MutateOptions,\n MutationFunctionContext,\n MutationObserverOptions,\n MutationObserverResult,\n} from './types'\nimport type { Action, Mutation } from './mutation'\n\n// TYPES\n\ntype MutationObserverListener = (\n result: MutationObserverResult,\n) => void\n\n// CLASS\n\nexport class MutationObserver<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n> extends Subscribable<\n MutationObserverListener\n> {\n options!: MutationObserverOptions\n\n #client: QueryClient\n #currentResult: MutationObserverResult<\n TData,\n TError,\n TVariables,\n TOnMutateResult\n > = undefined!\n #currentMutation?: Mutation\n #mutateOptions?: MutateOptions\n\n constructor(\n client: QueryClient,\n options: MutationObserverOptions<\n TData,\n TError,\n TVariables,\n TOnMutateResult\n >,\n ) {\n super()\n\n this.#client = client\n this.setOptions(options)\n this.bindMethods()\n this.#updateResult()\n }\n\n protected bindMethods(): void {\n this.mutate = this.mutate.bind(this)\n this.reset = this.reset.bind(this)\n }\n\n setOptions(\n options: MutationObserverOptions<\n TData,\n TError,\n TVariables,\n TOnMutateResult\n >,\n ) {\n const prevOptions = this.options as\n | MutationObserverOptions\n | undefined\n this.options = this.#client.defaultMutationOptions(options)\n if (!shallowEqualObjects(this.options, prevOptions)) {\n this.#client.getMutationCache().notify({\n type: 'observerOptionsUpdated',\n mutation: this.#currentMutation,\n observer: this,\n })\n }\n\n if (\n prevOptions?.mutationKey &&\n this.options.mutationKey &&\n hashKey(prevOptions.mutationKey) !== hashKey(this.options.mutationKey)\n ) {\n this.reset()\n } else if (this.#currentMutation?.state.status === 'pending') {\n this.#currentMutation.setOptions(this.options)\n }\n }\n\n protected onUnsubscribe(): void {\n if (!this.hasListeners()) {\n this.#currentMutation?.removeObserver(this)\n }\n }\n\n onMutationUpdate(\n action: Action,\n ): void {\n this.#updateResult()\n\n this.#notify(action)\n }\n\n getCurrentResult(): MutationObserverResult<\n TData,\n TError,\n TVariables,\n TOnMutateResult\n > {\n return this.#currentResult\n }\n\n reset(): void {\n // reset needs to remove the observer from the mutation because there is no way to \"get it back\"\n // another mutate call will yield a new mutation!\n this.#currentMutation?.removeObserver(this)\n this.#currentMutation = undefined\n this.#updateResult()\n this.#notify()\n }\n\n mutate(\n variables: TVariables,\n options?: MutateOptions,\n ): Promise {\n this.#mutateOptions = options\n\n this.#currentMutation?.removeObserver(this)\n\n this.#currentMutation = this.#client\n .getMutationCache()\n .build(this.#client, this.options)\n\n this.#currentMutation.addObserver(this)\n\n return this.#currentMutation.execute(variables)\n }\n\n #updateResult(): void {\n const state =\n this.#currentMutation?.state ??\n getDefaultState()\n\n this.#currentResult = {\n ...state,\n isPending: state.status === 'pending',\n isSuccess: state.status === 'success',\n isError: state.status === 'error',\n isIdle: state.status === 'idle',\n mutate: this.mutate,\n reset: this.reset,\n } as MutationObserverResult\n }\n\n #notify(action?: Action): void {\n notifyManager.batch(() => {\n // First trigger the mutate callbacks\n if (this.#mutateOptions && this.hasListeners()) {\n const variables = this.#currentResult.variables!\n const onMutateResult = this.#currentResult.context\n\n const context = {\n client: this.#client,\n meta: this.options.meta,\n mutationKey: this.options.mutationKey,\n } satisfies MutationFunctionContext\n\n if (action?.type === 'success') {\n try {\n this.#mutateOptions.onSuccess?.(\n action.data,\n variables,\n onMutateResult,\n context,\n )\n } catch (e) {\n void Promise.reject(e)\n }\n try {\n this.#mutateOptions.onSettled?.(\n action.data,\n null,\n variables,\n onMutateResult,\n context,\n )\n } catch (e) {\n void Promise.reject(e)\n }\n } else if (action?.type === 'error') {\n try {\n this.#mutateOptions.onError?.(\n action.error,\n variables,\n onMutateResult,\n context,\n )\n } catch (e) {\n void Promise.reject(e)\n }\n try {\n this.#mutateOptions.onSettled?.(\n undefined,\n action.error,\n variables,\n onMutateResult,\n context,\n )\n } catch (e) {\n void Promise.reject(e)\n }\n }\n }\n\n // Then trigger the listeners\n this.listeners.forEach((listener) => {\n listener(this.#currentResult)\n })\n })\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,sBAAgC;AAChC,2BAA8B;AAC9B,0BAA6B;AAC7B,mBAA6C;AAmBtC,IAAM,mBAAN,cAKG,iCAER;AAAA,EAGA;AAAA,EACA,iBAKI;AAAA,EACJ;AAAA,EACA;AAAA,EAEA,YACE,QACA,SAMA;AACA,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AACF,iBAAK,eAAe;AAAA,cAClB;AAAA,cACA,OAAO;AAAA,cACP;AAAA,cACA;AAAA,cACA;AAAA,YACF;AAAA,UACF,SAAS,GAAG;AACV,iBAAK,QAAQ,OAAO,CAAC;AAAA,UACvB;AAAA,QACF;AAAA,MACF;AAGA,WAAK,UAAU,QAAQ,CAAC,aAAa;AACnC,iBAAS,KAAK,cAAc;AAAA,MAC9B,CAAC;AAAA,IACH,CAAC;AAAA,EACH;AACF;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/mutationObserver.d.cts b/node_modules/@tanstack/query-core/build/modern/mutationObserver.d.cts deleted file mode 100644 index 04a9d2d..0000000 --- a/node_modules/@tanstack/query-core/build/modern/mutationObserver.d.cts +++ /dev/null @@ -1,3 +0,0 @@ -import './subscribable.cjs'; -export { e as MutationObserver } from './hydration-uphG6M-i.cjs'; -import './removable.cjs'; diff --git a/node_modules/@tanstack/query-core/build/modern/mutationObserver.d.ts b/node_modules/@tanstack/query-core/build/modern/mutationObserver.d.ts deleted file mode 100644 index 1700476..0000000 --- a/node_modules/@tanstack/query-core/build/modern/mutationObserver.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import './subscribable.js'; -export { e as MutationObserver } from './hydration-BlEVG2Lp.js'; -import './removable.js'; diff --git a/node_modules/@tanstack/query-core/build/modern/mutationObserver.js b/node_modules/@tanstack/query-core/build/modern/mutationObserver.js deleted file mode 100644 index dd2b2de..0000000 --- a/node_modules/@tanstack/query-core/build/modern/mutationObserver.js +++ /dev/null @@ -1,140 +0,0 @@ -// src/mutationObserver.ts -import { getDefaultState } from "./mutation.js"; -import { notifyManager } from "./notifyManager.js"; -import { Subscribable } from "./subscribable.js"; -import { hashKey, shallowEqualObjects } from "./utils.js"; -var MutationObserver = class extends Subscribable { - #client; - #currentResult = void 0; - #currentMutation; - #mutateOptions; - constructor(client, options) { - super(); - this.#client = client; - this.setOptions(options); - this.bindMethods(); - this.#updateResult(); - } - bindMethods() { - this.mutate = this.mutate.bind(this); - this.reset = this.reset.bind(this); - } - setOptions(options) { - const prevOptions = this.options; - this.options = this.#client.defaultMutationOptions(options); - if (!shallowEqualObjects(this.options, prevOptions)) { - this.#client.getMutationCache().notify({ - type: "observerOptionsUpdated", - mutation: this.#currentMutation, - observer: this - }); - } - if (prevOptions?.mutationKey && this.options.mutationKey && hashKey(prevOptions.mutationKey) !== hashKey(this.options.mutationKey)) { - this.reset(); - } else if (this.#currentMutation?.state.status === "pending") { - this.#currentMutation.setOptions(this.options); - } - } - onUnsubscribe() { - if (!this.hasListeners()) { - this.#currentMutation?.removeObserver(this); - } - } - onMutationUpdate(action) { - this.#updateResult(); - this.#notify(action); - } - getCurrentResult() { - return this.#currentResult; - } - reset() { - this.#currentMutation?.removeObserver(this); - this.#currentMutation = void 0; - this.#updateResult(); - this.#notify(); - } - mutate(variables, options) { - this.#mutateOptions = options; - this.#currentMutation?.removeObserver(this); - this.#currentMutation = this.#client.getMutationCache().build(this.#client, this.options); - this.#currentMutation.addObserver(this); - return this.#currentMutation.execute(variables); - } - #updateResult() { - const state = this.#currentMutation?.state ?? getDefaultState(); - this.#currentResult = { - ...state, - isPending: state.status === "pending", - isSuccess: state.status === "success", - isError: state.status === "error", - isIdle: state.status === "idle", - mutate: this.mutate, - reset: this.reset - }; - } - #notify(action) { - notifyManager.batch(() => { - if (this.#mutateOptions && this.hasListeners()) { - const variables = this.#currentResult.variables; - const onMutateResult = this.#currentResult.context; - const context = { - client: this.#client, - meta: this.options.meta, - mutationKey: this.options.mutationKey - }; - if (action?.type === "success") { - try { - this.#mutateOptions.onSuccess?.( - action.data, - variables, - onMutateResult, - context - ); - } catch (e) { - void Promise.reject(e); - } - try { - this.#mutateOptions.onSettled?.( - action.data, - null, - variables, - onMutateResult, - context - ); - } catch (e) { - void Promise.reject(e); - } - } else if (action?.type === "error") { - try { - this.#mutateOptions.onError?.( - action.error, - variables, - onMutateResult, - context - ); - } catch (e) { - void Promise.reject(e); - } - try { - this.#mutateOptions.onSettled?.( - void 0, - action.error, - variables, - onMutateResult, - context - ); - } catch (e) { - void Promise.reject(e); - } - } - } - this.listeners.forEach((listener) => { - listener(this.#currentResult); - }); - }); - } -}; -export { - MutationObserver -}; -//# sourceMappingURL=mutationObserver.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/mutationObserver.js.map b/node_modules/@tanstack/query-core/build/modern/mutationObserver.js.map deleted file mode 100644 index 154ec66..0000000 --- a/node_modules/@tanstack/query-core/build/modern/mutationObserver.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/mutationObserver.ts"],"sourcesContent":["import { getDefaultState } from './mutation'\nimport { notifyManager } from './notifyManager'\nimport { Subscribable } from './subscribable'\nimport { hashKey, shallowEqualObjects } from './utils'\nimport type { QueryClient } from './queryClient'\nimport type {\n DefaultError,\n MutateOptions,\n MutationFunctionContext,\n MutationObserverOptions,\n MutationObserverResult,\n} from './types'\nimport type { Action, Mutation } from './mutation'\n\n// TYPES\n\ntype MutationObserverListener = (\n result: MutationObserverResult,\n) => void\n\n// CLASS\n\nexport class MutationObserver<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n> extends Subscribable<\n MutationObserverListener\n> {\n options!: MutationObserverOptions\n\n #client: QueryClient\n #currentResult: MutationObserverResult<\n TData,\n TError,\n TVariables,\n TOnMutateResult\n > = undefined!\n #currentMutation?: Mutation\n #mutateOptions?: MutateOptions\n\n constructor(\n client: QueryClient,\n options: MutationObserverOptions<\n TData,\n TError,\n TVariables,\n TOnMutateResult\n >,\n ) {\n super()\n\n this.#client = client\n this.setOptions(options)\n this.bindMethods()\n this.#updateResult()\n }\n\n protected bindMethods(): void {\n this.mutate = this.mutate.bind(this)\n this.reset = this.reset.bind(this)\n }\n\n setOptions(\n options: MutationObserverOptions<\n TData,\n TError,\n TVariables,\n TOnMutateResult\n >,\n ) {\n const prevOptions = this.options as\n | MutationObserverOptions\n | undefined\n this.options = this.#client.defaultMutationOptions(options)\n if (!shallowEqualObjects(this.options, prevOptions)) {\n this.#client.getMutationCache().notify({\n type: 'observerOptionsUpdated',\n mutation: this.#currentMutation,\n observer: this,\n })\n }\n\n if (\n prevOptions?.mutationKey &&\n this.options.mutationKey &&\n hashKey(prevOptions.mutationKey) !== hashKey(this.options.mutationKey)\n ) {\n this.reset()\n } else if (this.#currentMutation?.state.status === 'pending') {\n this.#currentMutation.setOptions(this.options)\n }\n }\n\n protected onUnsubscribe(): void {\n if (!this.hasListeners()) {\n this.#currentMutation?.removeObserver(this)\n }\n }\n\n onMutationUpdate(\n action: Action,\n ): void {\n this.#updateResult()\n\n this.#notify(action)\n }\n\n getCurrentResult(): MutationObserverResult<\n TData,\n TError,\n TVariables,\n TOnMutateResult\n > {\n return this.#currentResult\n }\n\n reset(): void {\n // reset needs to remove the observer from the mutation because there is no way to \"get it back\"\n // another mutate call will yield a new mutation!\n this.#currentMutation?.removeObserver(this)\n this.#currentMutation = undefined\n this.#updateResult()\n this.#notify()\n }\n\n mutate(\n variables: TVariables,\n options?: MutateOptions,\n ): Promise {\n this.#mutateOptions = options\n\n this.#currentMutation?.removeObserver(this)\n\n this.#currentMutation = this.#client\n .getMutationCache()\n .build(this.#client, this.options)\n\n this.#currentMutation.addObserver(this)\n\n return this.#currentMutation.execute(variables)\n }\n\n #updateResult(): void {\n const state =\n this.#currentMutation?.state ??\n getDefaultState()\n\n this.#currentResult = {\n ...state,\n isPending: state.status === 'pending',\n isSuccess: state.status === 'success',\n isError: state.status === 'error',\n isIdle: state.status === 'idle',\n mutate: this.mutate,\n reset: this.reset,\n } as MutationObserverResult\n }\n\n #notify(action?: Action): void {\n notifyManager.batch(() => {\n // First trigger the mutate callbacks\n if (this.#mutateOptions && this.hasListeners()) {\n const variables = this.#currentResult.variables!\n const onMutateResult = this.#currentResult.context\n\n const context = {\n client: this.#client,\n meta: this.options.meta,\n mutationKey: this.options.mutationKey,\n } satisfies MutationFunctionContext\n\n if (action?.type === 'success') {\n try {\n this.#mutateOptions.onSuccess?.(\n action.data,\n variables,\n onMutateResult,\n context,\n )\n } catch (e) {\n void Promise.reject(e)\n }\n try {\n this.#mutateOptions.onSettled?.(\n action.data,\n null,\n variables,\n onMutateResult,\n context,\n )\n } catch (e) {\n void Promise.reject(e)\n }\n } else if (action?.type === 'error') {\n try {\n this.#mutateOptions.onError?.(\n action.error,\n variables,\n onMutateResult,\n context,\n )\n } catch (e) {\n void Promise.reject(e)\n }\n try {\n this.#mutateOptions.onSettled?.(\n undefined,\n action.error,\n variables,\n onMutateResult,\n context,\n )\n } catch (e) {\n void Promise.reject(e)\n }\n }\n }\n\n // Then trigger the listeners\n this.listeners.forEach((listener) => {\n listener(this.#currentResult)\n })\n })\n }\n}\n"],"mappings":";AAAA,SAAS,uBAAuB;AAChC,SAAS,qBAAqB;AAC9B,SAAS,oBAAoB;AAC7B,SAAS,SAAS,2BAA2B;AAmBtC,IAAM,mBAAN,cAKG,aAER;AAAA,EAGA;AAAA,EACA,iBAKI;AAAA,EACJ;AAAA,EACA;AAAA,EAEA,YACE,QACA,SAMA;AACA,UAAM;AAEN,SAAK,UAAU;AACf,SAAK,WAAW,OAAO;AACvB,SAAK,YAAY;AACjB,SAAK,cAAc;AAAA,EACrB;AAAA,EAEU,cAAoB;AAC5B,SAAK,SAAS,KAAK,OAAO,KAAK,IAAI;AACnC,SAAK,QAAQ,KAAK,MAAM,KAAK,IAAI;AAAA,EACnC;AAAA,EAEA,WACE,SAMA;AACA,UAAM,cAAc,KAAK;AAGzB,SAAK,UAAU,KAAK,QAAQ,uBAAuB,OAAO;AAC1D,QAAI,CAAC,oBAAoB,KAAK,SAAS,WAAW,GAAG;AACnD,WAAK,QAAQ,iBAAiB,EAAE,OAAO;AAAA,QACrC,MAAM;AAAA,QACN,UAAU,KAAK;AAAA,QACf,UAAU;AAAA,MACZ,CAAC;AAAA,IACH;AAEA,QACE,aAAa,eACb,KAAK,QAAQ,eACb,QAAQ,YAAY,WAAW,MAAM,QAA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3C,cAAM,UAAU;AAAA,UACd,QAAQ,KAAK;AAAA,UACb,MAAM,KAAK,QAAQ;AAAA,UACnB,aAAa,KAAK,QAAQ;AAAA,QAC5B;AAEA,YAAI,QAAQ,SAAS,WAAW;AAC9B,cAAI;AACF,iBAAK,eAAe;AAAA,cAClB,OAAO;AAAA,cACP;AAAA,cACA;AAAA,cACA;AAAA,YACF;AAAA,UACF,SAAS,GAAG;AACV,iBAAK,QAAQ,OAAO,CAAC;AAAA,UACvB;AACA,cAAI;AACF,iBAAK,eAAe;AAAA,cAClB,OAAO;AAAA,cACP;AAAA,cACA;AAAA,cACA;AAAA,cACA;AAAA,YACF;AAAA,UACF,SAAS,GAAG;AACV,iBAAK,QAAQ,OAAO,CAAC;AAAA,UACvB;AAAA,QACF,WAAW,QAAQ,SAAS,SAAS;AACnC,cAAI;AACF,iBAAK,eAAe;AAAA,cAClB,OAAO;AAAA,cACP;AAAA,cACA;AAAA,cACA;AAAA,YACF;AAAA,UACF,SAAS,GAAG;AACV,iBAAK,QAAQ,OAAO,CAAC;AAAA,UACvB;AACA,cAAI;AACF,iBAAK,eAAe;AAAA,cAClB;AAAA,cACA,OAAO;AAAA,cACP;AAAA,cACA;AAAA,cACA;AAAA,YACF;AAAA,UACF,SAAS,GAAG;AACV,iBAAK,QAAQ,OAAO,CAAC;AAAA,UACvB;AAAA,QACF;AAAA,MACF;AAGA,WAAK,UAAU,QAAQ,CAAC,aAAa;AACnC,iBAAS,KAAK,cAAc;AAAA,MAC9B,CAAC;AAAA,IACH,CAAC;AAAA,EACH;AACF;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/notifyManager.cjs b/node_modules/@tanstack/query-core/build/modern/notifyManager.cjs deleted file mode 100644 index 355a2c1..0000000 --- a/node_modules/@tanstack/query-core/build/modern/notifyManager.cjs +++ /dev/null @@ -1,113 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// src/notifyManager.ts -var notifyManager_exports = {}; -__export(notifyManager_exports, { - createNotifyManager: () => createNotifyManager, - defaultScheduler: () => defaultScheduler, - notifyManager: () => notifyManager -}); -module.exports = __toCommonJS(notifyManager_exports); -var import_timeoutManager = require("./timeoutManager.cjs"); -var defaultScheduler = import_timeoutManager.systemSetTimeoutZero; -function createNotifyManager() { - let queue = []; - let transactions = 0; - let notifyFn = (callback) => { - callback(); - }; - let batchNotifyFn = (callback) => { - callback(); - }; - let scheduleFn = defaultScheduler; - const schedule = (callback) => { - if (transactions) { - queue.push(callback); - } else { - scheduleFn(() => { - notifyFn(callback); - }); - } - }; - const flush = () => { - const originalQueue = queue; - queue = []; - if (originalQueue.length) { - scheduleFn(() => { - batchNotifyFn(() => { - originalQueue.forEach((callback) => { - notifyFn(callback); - }); - }); - }); - } - }; - return { - batch: (callback) => { - let result; - transactions++; - try { - result = callback(); - } finally { - transactions--; - if (!transactions) { - flush(); - } - } - return result; - }, - /** - * All calls to the wrapped function will be batched. - */ - batchCalls: (callback) => { - return (...args) => { - schedule(() => { - callback(...args); - }); - }; - }, - schedule, - /** - * Use this method to set a custom notify function. - * This can be used to for example wrap notifications with `React.act` while running tests. - */ - setNotifyFunction: (fn) => { - notifyFn = fn; - }, - /** - * Use this method to set a custom function to batch notifications together into a single tick. - * By default React Query will use the batch function provided by ReactDOM or React Native. - */ - setBatchNotifyFunction: (fn) => { - batchNotifyFn = fn; - }, - setScheduler: (fn) => { - scheduleFn = fn; - } - }; -} -var notifyManager = createNotifyManager(); -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - createNotifyManager, - defaultScheduler, - notifyManager -}); -//# sourceMappingURL=notifyManager.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/notifyManager.cjs.map b/node_modules/@tanstack/query-core/build/modern/notifyManager.cjs.map deleted file mode 100644 index 1756c4b..0000000 --- a/node_modules/@tanstack/query-core/build/modern/notifyManager.cjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/notifyManager.ts"],"sourcesContent":["// TYPES\n\nimport { systemSetTimeoutZero } from './timeoutManager'\n\ntype NotifyCallback = () => void\n\ntype NotifyFunction = (callback: () => void) => void\n\ntype BatchNotifyFunction = (callback: () => void) => void\n\ntype BatchCallsCallback> = (...args: T) => void\n\ntype ScheduleFunction = (callback: () => void) => void\n\nexport const defaultScheduler: ScheduleFunction = systemSetTimeoutZero\n\nexport function createNotifyManager() {\n let queue: Array = []\n let transactions = 0\n let notifyFn: NotifyFunction = (callback) => {\n callback()\n }\n let batchNotifyFn: BatchNotifyFunction = (callback: () => void) => {\n callback()\n }\n let scheduleFn = defaultScheduler\n\n const schedule = (callback: NotifyCallback): void => {\n if (transactions) {\n queue.push(callback)\n } else {\n scheduleFn(() => {\n notifyFn(callback)\n })\n }\n }\n const flush = (): void => {\n const originalQueue = queue\n queue = []\n if (originalQueue.length) {\n scheduleFn(() => {\n batchNotifyFn(() => {\n originalQueue.forEach((callback) => {\n notifyFn(callback)\n })\n })\n })\n }\n }\n\n return {\n batch: (callback: () => T): T => {\n let result\n transactions++\n try {\n result = callback()\n } finally {\n transactions--\n if (!transactions) {\n flush()\n }\n }\n return result\n },\n /**\n * All calls to the wrapped function will be batched.\n */\n batchCalls: >(\n callback: BatchCallsCallback,\n ): BatchCallsCallback => {\n return (...args) => {\n schedule(() => {\n callback(...args)\n })\n }\n },\n schedule,\n /**\n * Use this method to set a custom notify function.\n * This can be used to for example wrap notifications with `React.act` while running tests.\n */\n setNotifyFunction: (fn: NotifyFunction) => {\n notifyFn = fn\n },\n /**\n * Use this method to set a custom function to batch notifications together into a single tick.\n * By default React Query will use the batch function provided by ReactDOM or React Native.\n */\n setBatchNotifyFunction: (fn: BatchNotifyFunction) => {\n batchNotifyFn = fn\n },\n setScheduler: (fn: ScheduleFunction) => {\n scheduleFn = fn\n },\n } as const\n}\n\n// SINGLETON\nexport const notifyManager = createNotifyManager()\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,4BAAqC;AAY9B,IAAM,mBAAqC;AAE3C,SAAS,sBAAsB;AACpC,MAAI,QAA+B,CAAC;AACpC,MAAI,eAAe;AACnB,MAAI,WAA2B,CAAC,aAAa;AAC3C,aAAS;AAAA,EACX;AACA,MAAI,gBAAqC,CAAC,aAAyB;AACjE,aAAS;AAAA,EACX;AACA,MAAI,aAAa;AAEjB,QAAM,WAAW,CAAC,aAAmC;AACnD,QAAI,cAAc;AAChB,YAAM,KAAK,QAAQ;AAAA,IACrB,OAAO;AACL,iBAAW,MAAM;AACf,iBAAS,QAAQ;AAAA,MACnB,CAAC;AAAA,IACH;AAAA,EACF;AACA,QAAM,QAAQ,MAAY;AACxB,UAAM,gBAAgB;AACtB,YAAQ,CAAC;AACT,QAAI,cAAc,QAAQ;AACxB,iBAAW,MAAM;AACf,sBAAc,MAAM;AAClB,wBAAc,QAAQ,CAAC,aAAa;AAClC,qBAAS,QAAQ;AAAA,UACnB,CAAC;AAAA,QACH,CAAC;AAAA,MACH,CAAC;AAAA,IACH;AAAA,EACF;AAEA,SAAO;AAAA,IACL,OAAO,CAAI,aAAyB;AAClC,UAAI;AACJ;AACA,UAAI;AACF,iBAAS,SAAS;AAAA,MACpB,UAAE;AACA;AACA,YAAI,CAAC,cAAc;AACjB,gBAAM;AAAA,QACR;AAAA,MACF;AACA,aAAO;AAAA,IACT;AAAA;AAAA;AAAA;AAAA,IAIA,YAAY,CACV,aAC0B;AAC1B,aAAO,IAAI,SAAS;AAClB,iBAAS,MAAM;AACb,mBAAS,GAAG,IAAI;AAAA,QAClB,CAAC;AAAA,MACH;AAAA,IACF;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA,IAKA,mBAAmB,CAAC,OAAuB;AACzC,iBAAW;AAAA,IACb;AAAA;AAAA;AAAA;AAAA;AAAA,IAKA,wBAAwB,CAAC,OAA4B;AACnD,sBAAgB;AAAA,IAClB;AAAA,IACA,cAAc,CAAC,OAAyB;AACtC,mBAAa;AAAA,IACf;AAAA,EACF;AACF;AAGO,IAAM,gBAAgB,oBAAoB;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/notifyManager.d.cts b/node_modules/@tanstack/query-core/build/modern/notifyManager.d.cts deleted file mode 100644 index bd4a370..0000000 --- a/node_modules/@tanstack/query-core/build/modern/notifyManager.d.cts +++ /dev/null @@ -1,46 +0,0 @@ -type NotifyCallback = () => void; -type NotifyFunction = (callback: () => void) => void; -type BatchNotifyFunction = (callback: () => void) => void; -type BatchCallsCallback> = (...args: T) => void; -type ScheduleFunction = (callback: () => void) => void; -declare const defaultScheduler: ScheduleFunction; -declare function createNotifyManager(): { - readonly batch: (callback: () => T) => T; - /** - * All calls to the wrapped function will be batched. - */ - readonly batchCalls: >(callback: BatchCallsCallback) => BatchCallsCallback; - readonly schedule: (callback: NotifyCallback) => void; - /** - * Use this method to set a custom notify function. - * This can be used to for example wrap notifications with `React.act` while running tests. - */ - readonly setNotifyFunction: (fn: NotifyFunction) => void; - /** - * Use this method to set a custom function to batch notifications together into a single tick. - * By default React Query will use the batch function provided by ReactDOM or React Native. - */ - readonly setBatchNotifyFunction: (fn: BatchNotifyFunction) => void; - readonly setScheduler: (fn: ScheduleFunction) => void; -}; -declare const notifyManager: { - readonly batch: (callback: () => T) => T; - /** - * All calls to the wrapped function will be batched. - */ - readonly batchCalls: >(callback: BatchCallsCallback) => BatchCallsCallback; - readonly schedule: (callback: NotifyCallback) => void; - /** - * Use this method to set a custom notify function. - * This can be used to for example wrap notifications with `React.act` while running tests. - */ - readonly setNotifyFunction: (fn: NotifyFunction) => void; - /** - * Use this method to set a custom function to batch notifications together into a single tick. - * By default React Query will use the batch function provided by ReactDOM or React Native. - */ - readonly setBatchNotifyFunction: (fn: BatchNotifyFunction) => void; - readonly setScheduler: (fn: ScheduleFunction) => void; -}; - -export { createNotifyManager, defaultScheduler, notifyManager }; diff --git a/node_modules/@tanstack/query-core/build/modern/notifyManager.d.ts b/node_modules/@tanstack/query-core/build/modern/notifyManager.d.ts deleted file mode 100644 index bd4a370..0000000 --- a/node_modules/@tanstack/query-core/build/modern/notifyManager.d.ts +++ /dev/null @@ -1,46 +0,0 @@ -type NotifyCallback = () => void; -type NotifyFunction = (callback: () => void) => void; -type BatchNotifyFunction = (callback: () => void) => void; -type BatchCallsCallback> = (...args: T) => void; -type ScheduleFunction = (callback: () => void) => void; -declare const defaultScheduler: ScheduleFunction; -declare function createNotifyManager(): { - readonly batch: (callback: () => T) => T; - /** - * All calls to the wrapped function will be batched. - */ - readonly batchCalls: >(callback: BatchCallsCallback) => BatchCallsCallback; - readonly schedule: (callback: NotifyCallback) => void; - /** - * Use this method to set a custom notify function. - * This can be used to for example wrap notifications with `React.act` while running tests. - */ - readonly setNotifyFunction: (fn: NotifyFunction) => void; - /** - * Use this method to set a custom function to batch notifications together into a single tick. - * By default React Query will use the batch function provided by ReactDOM or React Native. - */ - readonly setBatchNotifyFunction: (fn: BatchNotifyFunction) => void; - readonly setScheduler: (fn: ScheduleFunction) => void; -}; -declare const notifyManager: { - readonly batch: (callback: () => T) => T; - /** - * All calls to the wrapped function will be batched. - */ - readonly batchCalls: >(callback: BatchCallsCallback) => BatchCallsCallback; - readonly schedule: (callback: NotifyCallback) => void; - /** - * Use this method to set a custom notify function. - * This can be used to for example wrap notifications with `React.act` while running tests. - */ - readonly setNotifyFunction: (fn: NotifyFunction) => void; - /** - * Use this method to set a custom function to batch notifications together into a single tick. - * By default React Query will use the batch function provided by ReactDOM or React Native. - */ - readonly setBatchNotifyFunction: (fn: BatchNotifyFunction) => void; - readonly setScheduler: (fn: ScheduleFunction) => void; -}; - -export { createNotifyManager, defaultScheduler, notifyManager }; diff --git a/node_modules/@tanstack/query-core/build/modern/notifyManager.js b/node_modules/@tanstack/query-core/build/modern/notifyManager.js deleted file mode 100644 index fea08da..0000000 --- a/node_modules/@tanstack/query-core/build/modern/notifyManager.js +++ /dev/null @@ -1,86 +0,0 @@ -// src/notifyManager.ts -import { systemSetTimeoutZero } from "./timeoutManager.js"; -var defaultScheduler = systemSetTimeoutZero; -function createNotifyManager() { - let queue = []; - let transactions = 0; - let notifyFn = (callback) => { - callback(); - }; - let batchNotifyFn = (callback) => { - callback(); - }; - let scheduleFn = defaultScheduler; - const schedule = (callback) => { - if (transactions) { - queue.push(callback); - } else { - scheduleFn(() => { - notifyFn(callback); - }); - } - }; - const flush = () => { - const originalQueue = queue; - queue = []; - if (originalQueue.length) { - scheduleFn(() => { - batchNotifyFn(() => { - originalQueue.forEach((callback) => { - notifyFn(callback); - }); - }); - }); - } - }; - return { - batch: (callback) => { - let result; - transactions++; - try { - result = callback(); - } finally { - transactions--; - if (!transactions) { - flush(); - } - } - return result; - }, - /** - * All calls to the wrapped function will be batched. - */ - batchCalls: (callback) => { - return (...args) => { - schedule(() => { - callback(...args); - }); - }; - }, - schedule, - /** - * Use this method to set a custom notify function. - * This can be used to for example wrap notifications with `React.act` while running tests. - */ - setNotifyFunction: (fn) => { - notifyFn = fn; - }, - /** - * Use this method to set a custom function to batch notifications together into a single tick. - * By default React Query will use the batch function provided by ReactDOM or React Native. - */ - setBatchNotifyFunction: (fn) => { - batchNotifyFn = fn; - }, - setScheduler: (fn) => { - scheduleFn = fn; - } - }; -} -var notifyManager = createNotifyManager(); -export { - createNotifyManager, - defaultScheduler, - notifyManager -}; -//# sourceMappingURL=notifyManager.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/notifyManager.js.map b/node_modules/@tanstack/query-core/build/modern/notifyManager.js.map deleted file mode 100644 index dcc738d..0000000 --- a/node_modules/@tanstack/query-core/build/modern/notifyManager.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/notifyManager.ts"],"sourcesContent":["// TYPES\n\nimport { systemSetTimeoutZero } from './timeoutManager'\n\ntype NotifyCallback = () => void\n\ntype NotifyFunction = (callback: () => void) => void\n\ntype BatchNotifyFunction = (callback: () => void) => void\n\ntype BatchCallsCallback> = (...args: T) => void\n\ntype ScheduleFunction = (callback: () => void) => void\n\nexport const defaultScheduler: ScheduleFunction = systemSetTimeoutZero\n\nexport function createNotifyManager() {\n let queue: Array = []\n let transactions = 0\n let notifyFn: NotifyFunction = (callback) => {\n callback()\n }\n let batchNotifyFn: BatchNotifyFunction = (callback: () => void) => {\n callback()\n }\n let scheduleFn = defaultScheduler\n\n const schedule = (callback: NotifyCallback): void => {\n if (transactions) {\n queue.push(callback)\n } else {\n scheduleFn(() => {\n notifyFn(callback)\n })\n }\n }\n const flush = (): void => {\n const originalQueue = queue\n queue = []\n if (originalQueue.length) {\n scheduleFn(() => {\n batchNotifyFn(() => {\n originalQueue.forEach((callback) => {\n notifyFn(callback)\n })\n })\n })\n }\n }\n\n return {\n batch: (callback: () => T): T => {\n let result\n transactions++\n try {\n result = callback()\n } finally {\n transactions--\n if (!transactions) {\n flush()\n }\n }\n return result\n },\n /**\n * All calls to the wrapped function will be batched.\n */\n batchCalls: >(\n callback: BatchCallsCallback,\n ): BatchCallsCallback => {\n return (...args) => {\n schedule(() => {\n callback(...args)\n })\n }\n },\n schedule,\n /**\n * Use this method to set a custom notify function.\n * This can be used to for example wrap notifications with `React.act` while running tests.\n */\n setNotifyFunction: (fn: NotifyFunction) => {\n notifyFn = fn\n },\n /**\n * Use this method to set a custom function to batch notifications together into a single tick.\n * By default React Query will use the batch function provided by ReactDOM or React Native.\n */\n setBatchNotifyFunction: (fn: BatchNotifyFunction) => {\n batchNotifyFn = fn\n },\n setScheduler: (fn: ScheduleFunction) => {\n scheduleFn = fn\n },\n } as const\n}\n\n// SINGLETON\nexport const notifyManager = createNotifyManager()\n"],"mappings":";AAEA,SAAS,4BAA4B;AAY9B,IAAM,mBAAqC;AAE3C,SAAS,sBAAsB;AACpC,MAAI,QAA+B,CAAC;AACpC,MAAI,eAAe;AACnB,MAAI,WAA2B,CAAC,aAAa;AAC3C,aAAS;AAAA,EACX;AACA,MAAI,gBAAqC,CAAC,aAAyB;AACjE,aAAS;AAAA,EACX;AACA,MAAI,aAAa;AAEjB,QAAM,WAAW,CAAC,aAAmC;AACnD,QAAI,cAAc;AAChB,YAAM,KAAK,QAAQ;AAAA,IACrB,OAAO;AACL,iBAAW,MAAM;AACf,iBAAS,QAAQ;AAAA,MACnB,CAAC;AAAA,IACH;AAAA,EACF;AACA,QAAM,QAAQ,MAAY;AACxB,UAAM,gBAAgB;AACtB,YAAQ,CAAC;AACT,QAAI,cAAc,QAAQ;AACxB,iBAAW,MAAM;AACf,sBAAc,MAAM;AAClB,wBAAc,QAAQ,CAAC,aAAa;AAClC,qBAAS,QAAQ;AAAA,UACnB,CAAC;AAAA,QACH,CAAC;AAAA,MACH,CAAC;AAAA,IACH;AAAA,EACF;AAEA,SAAO;AAAA,IACL,OAAO,CAAI,aAAyB;AAClC,UAAI;AACJ;AACA,UAAI;AACF,iBAAS,SAAS;AAAA,MACpB,UAAE;AACA;AACA,YAAI,CAAC,cAAc;AACjB,gBAAM;AAAA,QACR;AAAA,MACF;AACA,aAAO;AAAA,IACT;AAAA;AAAA;AAAA;AAAA,IAIA,YAAY,CACV,aAC0B;AAC1B,aAAO,IAAI,SAAS;AAClB,iBAAS,MAAM;AACb,mBAAS,GAAG,IAAI;AAAA,QAClB,CAAC;AAAA,MACH;AAAA,IACF;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA,IAKA,mBAAmB,CAAC,OAAuB;AACzC,iBAAW;AAAA,IACb;AAAA;AAAA;AAAA;AAAA;AAAA,IAKA,wBAAwB,CAAC,OAA4B;AACnD,sBAAgB;AAAA,IAClB;AAAA,IACA,cAAc,CAAC,OAAyB;AACtC,mBAAa;AAAA,IACf;AAAA,EACF;AACF;AAGO,IAAM,gBAAgB,oBAAoB;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/onlineManager.cjs b/node_modules/@tanstack/query-core/build/modern/onlineManager.cjs deleted file mode 100644 index 69196cf..0000000 --- a/node_modules/@tanstack/query-core/build/modern/onlineManager.cjs +++ /dev/null @@ -1,84 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// src/onlineManager.ts -var onlineManager_exports = {}; -__export(onlineManager_exports, { - OnlineManager: () => OnlineManager, - onlineManager: () => onlineManager -}); -module.exports = __toCommonJS(onlineManager_exports); -var import_subscribable = require("./subscribable.cjs"); -var import_utils = require("./utils.cjs"); -var OnlineManager = class extends import_subscribable.Subscribable { - #online = true; - #cleanup; - #setup; - constructor() { - super(); - this.#setup = (onOnline) => { - if (!import_utils.isServer && window.addEventListener) { - const onlineListener = () => onOnline(true); - const offlineListener = () => onOnline(false); - window.addEventListener("online", onlineListener, false); - window.addEventListener("offline", offlineListener, false); - return () => { - window.removeEventListener("online", onlineListener); - window.removeEventListener("offline", offlineListener); - }; - } - return; - }; - } - onSubscribe() { - if (!this.#cleanup) { - this.setEventListener(this.#setup); - } - } - onUnsubscribe() { - if (!this.hasListeners()) { - this.#cleanup?.(); - this.#cleanup = void 0; - } - } - setEventListener(setup) { - this.#setup = setup; - this.#cleanup?.(); - this.#cleanup = setup(this.setOnline.bind(this)); - } - setOnline(online) { - const changed = this.#online !== online; - if (changed) { - this.#online = online; - this.listeners.forEach((listener) => { - listener(online); - }); - } - } - isOnline() { - return this.#online; - } -}; -var onlineManager = new OnlineManager(); -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - OnlineManager, - onlineManager -}); -//# sourceMappingURL=onlineManager.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/onlineManager.cjs.map b/node_modules/@tanstack/query-core/build/modern/onlineManager.cjs.map deleted file mode 100644 index 36dae1e..0000000 --- a/node_modules/@tanstack/query-core/build/modern/onlineManager.cjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/onlineManager.ts"],"sourcesContent":["import { Subscribable } from './subscribable'\nimport { isServer } from './utils'\n\ntype Listener = (online: boolean) => void\ntype SetupFn = (setOnline: Listener) => (() => void) | undefined\n\nexport class OnlineManager extends Subscribable {\n #online = true\n #cleanup?: () => void\n\n #setup: SetupFn\n\n constructor() {\n super()\n this.#setup = (onOnline) => {\n // addEventListener does not exist in React Native, but window does\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n if (!isServer && window.addEventListener) {\n const onlineListener = () => onOnline(true)\n const offlineListener = () => onOnline(false)\n // Listen to online\n window.addEventListener('online', onlineListener, false)\n window.addEventListener('offline', offlineListener, false)\n\n return () => {\n // Be sure to unsubscribe if a new handler is set\n window.removeEventListener('online', onlineListener)\n window.removeEventListener('offline', offlineListener)\n }\n }\n\n return\n }\n }\n\n protected onSubscribe(): void {\n if (!this.#cleanup) {\n this.setEventListener(this.#setup)\n }\n }\n\n protected onUnsubscribe() {\n if (!this.hasListeners()) {\n this.#cleanup?.()\n this.#cleanup = undefined\n }\n }\n\n setEventListener(setup: SetupFn): void {\n this.#setup = setup\n this.#cleanup?.()\n this.#cleanup = setup(this.setOnline.bind(this))\n }\n\n setOnline(online: boolean): void {\n const changed = this.#online !== online\n\n if (changed) {\n this.#online = online\n this.listeners.forEach((listener) => {\n listener(online)\n })\n }\n }\n\n isOnline(): boolean {\n return this.#online\n }\n}\n\nexport const onlineManager = new OnlineManager()\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,0BAA6B;AAC7B,mBAAyB;AAKlB,IAAM,gBAAN,cAA4B,iCAAuB;AAAA,EACxD,UAAU;AAAA,EACV;AAAA,EAEA;AAAA,EAEA,cAAc;AACZ,UAAM;AACN,SAAK,SAAS,CAAC,aAAa;AAG1B,UAAI,CAAC,yBAAY,OAAO,kBAAkB;AACxC,cAAM,iBAAiB,MAAM,SAAS,IAAI;AAC1C,cAAM,kBAAkB,MAAM,SAAS,KAAK;AAE5C,eAAO,iBAAiB,UAAU,gBAAgB,KAAK;AACvD,eAAO,iBAAiB,WAAW,iBAAiB,KAAK;AAEzD,eAAO,MAAM;AAEX,iBAAO,oBAAoB,UAAU,cAAc;AACnD,iBAAO,oBAAoB,WAAW,eAAe;AAAA,QACvD;AAAA,MACF;AAEA;AAAA,IACF;AAAA,EACF;AAAA,EAEU,cAAoB;AAC5B,QAAI,CAAC,KAAK,UAAU;AAClB,WAAK,iBAAiB,KAAK,MAAM;AAAA,IACnC;AAAA,EACF;AAAA,EAEU,gBAAgB;AACxB,QAAI,CAAC,KAAK,aAAa,GAAG;AACxB,WAAK,WAAW;AAChB,WAAK,WAAW;AAAA,IAClB;AAAA,EACF;AAAA,EAEA,iBAAiB,OAAsB;AACrC,SAAK,SAAS;AACd,SAAK,WAAW;AAChB,SAAK,WAAW,MAAM,KAAK,UAAU,KAAK,IAAI,CAAC;AAAA,EACjD;AAAA,EAEA,UAAU,QAAuB;AAC/B,UAAM,UAAU,KAAK,YAAY;AAEjC,QAAI,SAAS;AACX,WAAK,UAAU;AACf,WAAK,UAAU,QAAQ,CAAC,aAAa;AACnC,iBAAS,MAAM;AAAA,MACjB,CAAC;AAAA,IACH;AAAA,EACF;AAAA,EAEA,WAAoB;AAClB,WAAO,KAAK;AAAA,EACd;AACF;AAEO,IAAM,gBAAgB,IAAI,cAAc;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/onlineManager.d.cts b/node_modules/@tanstack/query-core/build/modern/onlineManager.d.cts deleted file mode 100644 index dde932b..0000000 --- a/node_modules/@tanstack/query-core/build/modern/onlineManager.d.cts +++ /dev/null @@ -1,16 +0,0 @@ -import { Subscribable } from './subscribable.cjs'; - -type Listener = (online: boolean) => void; -type SetupFn = (setOnline: Listener) => (() => void) | undefined; -declare class OnlineManager extends Subscribable { - #private; - constructor(); - protected onSubscribe(): void; - protected onUnsubscribe(): void; - setEventListener(setup: SetupFn): void; - setOnline(online: boolean): void; - isOnline(): boolean; -} -declare const onlineManager: OnlineManager; - -export { OnlineManager, onlineManager }; diff --git a/node_modules/@tanstack/query-core/build/modern/onlineManager.d.ts b/node_modules/@tanstack/query-core/build/modern/onlineManager.d.ts deleted file mode 100644 index 4362a5c..0000000 --- a/node_modules/@tanstack/query-core/build/modern/onlineManager.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { Subscribable } from './subscribable.js'; - -type Listener = (online: boolean) => void; -type SetupFn = (setOnline: Listener) => (() => void) | undefined; -declare class OnlineManager extends Subscribable { - #private; - constructor(); - protected onSubscribe(): void; - protected onUnsubscribe(): void; - setEventListener(setup: SetupFn): void; - setOnline(online: boolean): void; - isOnline(): boolean; -} -declare const onlineManager: OnlineManager; - -export { OnlineManager, onlineManager }; diff --git a/node_modules/@tanstack/query-core/build/modern/onlineManager.js b/node_modules/@tanstack/query-core/build/modern/onlineManager.js deleted file mode 100644 index 2adb2ad..0000000 --- a/node_modules/@tanstack/query-core/build/modern/onlineManager.js +++ /dev/null @@ -1,58 +0,0 @@ -// src/onlineManager.ts -import { Subscribable } from "./subscribable.js"; -import { isServer } from "./utils.js"; -var OnlineManager = class extends Subscribable { - #online = true; - #cleanup; - #setup; - constructor() { - super(); - this.#setup = (onOnline) => { - if (!isServer && window.addEventListener) { - const onlineListener = () => onOnline(true); - const offlineListener = () => onOnline(false); - window.addEventListener("online", onlineListener, false); - window.addEventListener("offline", offlineListener, false); - return () => { - window.removeEventListener("online", onlineListener); - window.removeEventListener("offline", offlineListener); - }; - } - return; - }; - } - onSubscribe() { - if (!this.#cleanup) { - this.setEventListener(this.#setup); - } - } - onUnsubscribe() { - if (!this.hasListeners()) { - this.#cleanup?.(); - this.#cleanup = void 0; - } - } - setEventListener(setup) { - this.#setup = setup; - this.#cleanup?.(); - this.#cleanup = setup(this.setOnline.bind(this)); - } - setOnline(online) { - const changed = this.#online !== online; - if (changed) { - this.#online = online; - this.listeners.forEach((listener) => { - listener(online); - }); - } - } - isOnline() { - return this.#online; - } -}; -var onlineManager = new OnlineManager(); -export { - OnlineManager, - onlineManager -}; -//# sourceMappingURL=onlineManager.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/onlineManager.js.map b/node_modules/@tanstack/query-core/build/modern/onlineManager.js.map deleted file mode 100644 index 8530d4c..0000000 --- a/node_modules/@tanstack/query-core/build/modern/onlineManager.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/onlineManager.ts"],"sourcesContent":["import { Subscribable } from './subscribable'\nimport { isServer } from './utils'\n\ntype Listener = (online: boolean) => void\ntype SetupFn = (setOnline: Listener) => (() => void) | undefined\n\nexport class OnlineManager extends Subscribable {\n #online = true\n #cleanup?: () => void\n\n #setup: SetupFn\n\n constructor() {\n super()\n this.#setup = (onOnline) => {\n // addEventListener does not exist in React Native, but window does\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n if (!isServer && window.addEventListener) {\n const onlineListener = () => onOnline(true)\n const offlineListener = () => onOnline(false)\n // Listen to online\n window.addEventListener('online', onlineListener, false)\n window.addEventListener('offline', offlineListener, false)\n\n return () => {\n // Be sure to unsubscribe if a new handler is set\n window.removeEventListener('online', onlineListener)\n window.removeEventListener('offline', offlineListener)\n }\n }\n\n return\n }\n }\n\n protected onSubscribe(): void {\n if (!this.#cleanup) {\n this.setEventListener(this.#setup)\n }\n }\n\n protected onUnsubscribe() {\n if (!this.hasListeners()) {\n this.#cleanup?.()\n this.#cleanup = undefined\n }\n }\n\n setEventListener(setup: SetupFn): void {\n this.#setup = setup\n this.#cleanup?.()\n this.#cleanup = setup(this.setOnline.bind(this))\n }\n\n setOnline(online: boolean): void {\n const changed = this.#online !== online\n\n if (changed) {\n this.#online = online\n this.listeners.forEach((listener) => {\n listener(online)\n })\n }\n }\n\n isOnline(): boolean {\n return this.#online\n }\n}\n\nexport const onlineManager = new OnlineManager()\n"],"mappings":";AAAA,SAAS,oBAAoB;AAC7B,SAAS,gBAAgB;AAKlB,IAAM,gBAAN,cAA4B,aAAuB;AAAA,EACxD,UAAU;AAAA,EACV;AAAA,EAEA;AAAA,EAEA,cAAc;AACZ,UAAM;AACN,SAAK,SAAS,CAAC,aAAa;AAG1B,UAAI,CAAC,YAAY,OAAO,kBAAkB;AACxC,cAAM,iBAAiB,MAAM,SAAS,IAAI;AAC1C,cAAM,kBAAkB,MAAM,SAAS,KAAK;AAE5C,eAAO,iBAAiB,UAAU,gBAAgB,KAAK;AACvD,eAAO,iBAAiB,WAAW,iBAAiB,KAAK;AAEzD,eAAO,MAAM;AAEX,iBAAO,oBAAoB,UAAU,cAAc;AACnD,iBAAO,oBAAoB,WAAW,eAAe;AAAA,QACvD;AAAA,MACF;AAEA;AAAA,IACF;AAAA,EACF;AAAA,EAEU,cAAoB;AAC5B,QAAI,CAAC,KAAK,UAAU;AAClB,WAAK,iBAAiB,KAAK,MAAM;AAAA,IACnC;AAAA,EACF;AAAA,EAEU,gBAAgB;AACxB,QAAI,CAAC,KAAK,aAAa,GAAG;AACxB,WAAK,WAAW;AAChB,WAAK,WAAW;AAAA,IAClB;AAAA,EACF;AAAA,EAEA,iBAAiB,OAAsB;AACrC,SAAK,SAAS;AACd,SAAK,WAAW;AAChB,SAAK,WAAW,MAAM,KAAK,UAAU,KAAK,IAAI,CAAC;AAAA,EACjD;AAAA,EAEA,UAAU,QAAuB;AAC/B,UAAM,UAAU,KAAK,YAAY;AAEjC,QAAI,SAAS;AACX,WAAK,UAAU;AACf,WAAK,UAAU,QAAQ,CAAC,aAAa;AACnC,iBAAS,MAAM;AAAA,MACjB,CAAC;AAAA,IACH;AAAA,EACF;AAAA,EAEA,WAAoB;AAClB,WAAO,KAAK;AAAA,EACd;AACF;AAEO,IAAM,gBAAgB,IAAI,cAAc;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/queriesObserver.cjs b/node_modules/@tanstack/query-core/build/modern/queriesObserver.cjs deleted file mode 100644 index c1272d6..0000000 --- a/node_modules/@tanstack/query-core/build/modern/queriesObserver.cjs +++ /dev/null @@ -1,237 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// src/queriesObserver.ts -var queriesObserver_exports = {}; -__export(queriesObserver_exports, { - QueriesObserver: () => QueriesObserver -}); -module.exports = __toCommonJS(queriesObserver_exports); -var import_notifyManager = require("./notifyManager.cjs"); -var import_queryObserver = require("./queryObserver.cjs"); -var import_subscribable = require("./subscribable.cjs"); -var import_utils = require("./utils.cjs"); -function difference(array1, array2) { - const excludeSet = new Set(array2); - return array1.filter((x) => !excludeSet.has(x)); -} -function replaceAt(array, index, value) { - const copy = array.slice(0); - copy[index] = value; - return copy; -} -var QueriesObserver = class extends import_subscribable.Subscribable { - #client; - #result; - #queries; - #options; - #observers; - #combinedResult; - #lastCombine; - #lastResult; - #lastQueryHashes; - #observerMatches = []; - constructor(client, queries, options) { - super(); - this.#client = client; - this.#options = options; - this.#queries = []; - this.#observers = []; - this.#result = []; - this.setQueries(queries); - } - onSubscribe() { - if (this.listeners.size === 1) { - this.#observers.forEach((observer) => { - observer.subscribe((result) => { - this.#onUpdate(observer, result); - }); - }); - } - } - onUnsubscribe() { - if (!this.listeners.size) { - this.destroy(); - } - } - destroy() { - this.listeners = /* @__PURE__ */ new Set(); - this.#observers.forEach((observer) => { - observer.destroy(); - }); - } - setQueries(queries, options) { - this.#queries = queries; - this.#options = options; - if (process.env.NODE_ENV !== "production") { - const queryHashes = queries.map( - (query) => this.#client.defaultQueryOptions(query).queryHash - ); - if (new Set(queryHashes).size !== queryHashes.length) { - console.warn( - "[QueriesObserver]: Duplicate Queries found. This might result in unexpected behavior." - ); - } - } - import_notifyManager.notifyManager.batch(() => { - const prevObservers = this.#observers; - const newObserverMatches = this.#findMatchingObservers(this.#queries); - newObserverMatches.forEach( - (match) => match.observer.setOptions(match.defaultedQueryOptions) - ); - const newObservers = newObserverMatches.map((match) => match.observer); - const newResult = newObservers.map( - (observer) => observer.getCurrentResult() - ); - const hasLengthChange = prevObservers.length !== newObservers.length; - const hasIndexChange = newObservers.some( - (observer, index) => observer !== prevObservers[index] - ); - const hasStructuralChange = hasLengthChange || hasIndexChange; - const hasResultChange = hasStructuralChange ? true : newResult.some((result, index) => { - const prev = this.#result[index]; - return !prev || !(0, import_utils.shallowEqualObjects)(result, prev); - }); - if (!hasStructuralChange && !hasResultChange) return; - if (hasStructuralChange) { - this.#observerMatches = newObserverMatches; - this.#observers = newObservers; - } - this.#result = newResult; - if (!this.hasListeners()) return; - if (hasStructuralChange) { - difference(prevObservers, newObservers).forEach((observer) => { - observer.destroy(); - }); - difference(newObservers, prevObservers).forEach((observer) => { - observer.subscribe((result) => { - this.#onUpdate(observer, result); - }); - }); - } - this.#notify(); - }); - } - getCurrentResult() { - return this.#result; - } - getQueries() { - return this.#observers.map((observer) => observer.getCurrentQuery()); - } - getObservers() { - return this.#observers; - } - getOptimisticResult(queries, combine) { - const matches = this.#findMatchingObservers(queries); - const result = matches.map( - (match) => match.observer.getOptimisticResult(match.defaultedQueryOptions) - ); - const queryHashes = matches.map( - (match) => match.defaultedQueryOptions.queryHash - ); - return [ - result, - (r) => { - return this.#combineResult(r ?? result, combine, queryHashes); - }, - () => { - return this.#trackResult(result, matches); - } - ]; - } - #trackResult(result, matches) { - return matches.map((match, index) => { - const observerResult = result[index]; - return !match.defaultedQueryOptions.notifyOnChangeProps ? match.observer.trackResult(observerResult, (accessedProp) => { - matches.forEach((m) => { - m.observer.trackProp(accessedProp); - }); - }) : observerResult; - }); - } - #combineResult(input, combine, queryHashes) { - if (combine) { - const lastHashes = this.#lastQueryHashes; - const queryHashesChanged = queryHashes !== void 0 && lastHashes !== void 0 && (lastHashes.length !== queryHashes.length || queryHashes.some((hash, i) => hash !== lastHashes[i])); - if (!this.#combinedResult || this.#result !== this.#lastResult || queryHashesChanged || combine !== this.#lastCombine) { - this.#lastCombine = combine; - this.#lastResult = this.#result; - if (queryHashes !== void 0) { - this.#lastQueryHashes = queryHashes; - } - this.#combinedResult = (0, import_utils.replaceEqualDeep)( - this.#combinedResult, - combine(input) - ); - } - return this.#combinedResult; - } - return input; - } - #findMatchingObservers(queries) { - const prevObserversMap = /* @__PURE__ */ new Map(); - this.#observers.forEach((observer) => { - const key = observer.options.queryHash; - if (!key) return; - const previousObservers = prevObserversMap.get(key); - if (previousObservers) { - previousObservers.push(observer); - } else { - prevObserversMap.set(key, [observer]); - } - }); - const observers = []; - queries.forEach((options) => { - const defaultedOptions = this.#client.defaultQueryOptions(options); - const match = prevObserversMap.get(defaultedOptions.queryHash)?.shift(); - const observer = match ?? new import_queryObserver.QueryObserver(this.#client, defaultedOptions); - observers.push({ - defaultedQueryOptions: defaultedOptions, - observer - }); - }); - return observers; - } - #onUpdate(observer, result) { - const index = this.#observers.indexOf(observer); - if (index !== -1) { - this.#result = replaceAt(this.#result, index, result); - this.#notify(); - } - } - #notify() { - if (this.hasListeners()) { - const previousResult = this.#combinedResult; - const newTracked = this.#trackResult(this.#result, this.#observerMatches); - const newResult = this.#combineResult(newTracked, this.#options?.combine); - if (previousResult !== newResult) { - import_notifyManager.notifyManager.batch(() => { - this.listeners.forEach((listener) => { - listener(this.#result); - }); - }); - } - } - } -}; -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - QueriesObserver -}); -//# sourceMappingURL=queriesObserver.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/queriesObserver.cjs.map b/node_modules/@tanstack/query-core/build/modern/queriesObserver.cjs.map deleted file mode 100644 index 81d7d31..0000000 --- a/node_modules/@tanstack/query-core/build/modern/queriesObserver.cjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/queriesObserver.ts"],"sourcesContent":["import { notifyManager } from './notifyManager'\nimport { QueryObserver } from './queryObserver'\nimport { Subscribable } from './subscribable'\nimport { replaceEqualDeep, shallowEqualObjects } from './utils'\nimport type {\n DefaultedQueryObserverOptions,\n QueryObserverOptions,\n QueryObserverResult,\n} from './types'\nimport type { QueryClient } from './queryClient'\n\nfunction difference(array1: Array, array2: Array): Array {\n const excludeSet = new Set(array2)\n return array1.filter((x) => !excludeSet.has(x))\n}\n\nfunction replaceAt(array: Array, index: number, value: T): Array {\n const copy = array.slice(0)\n copy[index] = value\n return copy\n}\n\ntype QueriesObserverListener = (result: Array) => void\n\ntype CombineFn = (\n result: Array,\n) => TCombinedResult\n\nexport interface QueriesObserverOptions<\n TCombinedResult = Array,\n> {\n combine?: CombineFn\n}\n\nexport class QueriesObserver<\n TCombinedResult = Array,\n> extends Subscribable {\n #client: QueryClient\n #result!: Array\n #queries: Array\n #options?: QueriesObserverOptions\n #observers: Array\n #combinedResult?: TCombinedResult\n #lastCombine?: CombineFn\n #lastResult?: Array\n #lastQueryHashes?: Array\n #observerMatches: Array = []\n\n constructor(\n client: QueryClient,\n queries: Array>,\n options?: QueriesObserverOptions,\n ) {\n super()\n\n this.#client = client\n this.#options = options\n this.#queries = []\n this.#observers = []\n this.#result = []\n\n this.setQueries(queries)\n }\n\n protected onSubscribe(): void {\n if (this.listeners.size === 1) {\n this.#observers.forEach((observer) => {\n observer.subscribe((result) => {\n this.#onUpdate(observer, result)\n })\n })\n }\n }\n\n protected onUnsubscribe(): void {\n if (!this.listeners.size) {\n this.destroy()\n }\n }\n\n destroy(): void {\n this.listeners = new Set()\n this.#observers.forEach((observer) => {\n observer.destroy()\n })\n }\n\n setQueries(\n queries: Array,\n options?: QueriesObserverOptions,\n ): void {\n this.#queries = queries\n this.#options = options\n\n if (process.env.NODE_ENV !== 'production') {\n const queryHashes = queries.map(\n (query) => this.#client.defaultQueryOptions(query).queryHash,\n )\n if (new Set(queryHashes).size !== queryHashes.length) {\n console.warn(\n '[QueriesObserver]: Duplicate Queries found. This might result in unexpected behavior.',\n )\n }\n }\n\n notifyManager.batch(() => {\n const prevObservers = this.#observers\n\n const newObserverMatches = this.#findMatchingObservers(this.#queries)\n\n // set options for the new observers to notify of changes\n newObserverMatches.forEach((match) =>\n match.observer.setOptions(match.defaultedQueryOptions),\n )\n\n const newObservers = newObserverMatches.map((match) => match.observer)\n const newResult = newObservers.map((observer) =>\n observer.getCurrentResult(),\n )\n\n const hasLengthChange = prevObservers.length !== newObservers.length\n const hasIndexChange = newObservers.some(\n (observer, index) => observer !== prevObservers[index],\n )\n const hasStructuralChange = hasLengthChange || hasIndexChange\n\n const hasResultChange = hasStructuralChange\n ? true\n : newResult.some((result, index) => {\n const prev = this.#result[index]\n return !prev || !shallowEqualObjects(result, prev)\n })\n\n if (!hasStructuralChange && !hasResultChange) return\n\n if (hasStructuralChange) {\n this.#observerMatches = newObserverMatches\n this.#observers = newObservers\n }\n\n this.#result = newResult\n\n if (!this.hasListeners()) return\n\n if (hasStructuralChange) {\n difference(prevObservers, newObservers).forEach((observer) => {\n observer.destroy()\n })\n difference(newObservers, prevObservers).forEach((observer) => {\n observer.subscribe((result) => {\n this.#onUpdate(observer, result)\n })\n })\n }\n\n this.#notify()\n })\n }\n\n getCurrentResult(): Array {\n return this.#result\n }\n\n getQueries() {\n return this.#observers.map((observer) => observer.getCurrentQuery())\n }\n\n getObservers() {\n return this.#observers\n }\n\n getOptimisticResult(\n queries: Array,\n combine: CombineFn | undefined,\n ): [\n rawResult: Array,\n combineResult: (r?: Array) => TCombinedResult,\n trackResult: () => Array,\n ] {\n const matches = this.#findMatchingObservers(queries)\n const result = matches.map((match) =>\n match.observer.getOptimisticResult(match.defaultedQueryOptions),\n )\n const queryHashes = matches.map(\n (match) => match.defaultedQueryOptions.queryHash,\n )\n\n return [\n result,\n (r?: Array) => {\n return this.#combineResult(r ?? result, combine, queryHashes)\n },\n () => {\n return this.#trackResult(result, matches)\n },\n ]\n }\n\n #trackResult(\n result: Array,\n matches: Array,\n ) {\n return matches.map((match, index) => {\n const observerResult = result[index]!\n return !match.defaultedQueryOptions.notifyOnChangeProps\n ? match.observer.trackResult(observerResult, (accessedProp) => {\n // track property on all observers to ensure proper (synchronized) tracking (#7000)\n matches.forEach((m) => {\n m.observer.trackProp(accessedProp)\n })\n })\n : observerResult\n })\n }\n\n #combineResult(\n input: Array,\n combine: CombineFn | undefined,\n queryHashes?: Array,\n ): TCombinedResult {\n if (combine) {\n const lastHashes = this.#lastQueryHashes\n const queryHashesChanged =\n queryHashes !== undefined &&\n lastHashes !== undefined &&\n (lastHashes.length !== queryHashes.length ||\n queryHashes.some((hash, i) => hash !== lastHashes[i]))\n\n if (\n !this.#combinedResult ||\n this.#result !== this.#lastResult ||\n queryHashesChanged ||\n combine !== this.#lastCombine\n ) {\n this.#lastCombine = combine\n this.#lastResult = this.#result\n\n if (queryHashes !== undefined) {\n this.#lastQueryHashes = queryHashes\n }\n this.#combinedResult = replaceEqualDeep(\n this.#combinedResult,\n combine(input),\n )\n }\n\n return this.#combinedResult\n }\n return input as any\n }\n\n #findMatchingObservers(\n queries: Array,\n ): Array {\n const prevObserversMap = new Map>()\n\n this.#observers.forEach((observer) => {\n const key = observer.options.queryHash\n if (!key) return\n\n const previousObservers = prevObserversMap.get(key)\n\n if (previousObservers) {\n previousObservers.push(observer)\n } else {\n prevObserversMap.set(key, [observer])\n }\n })\n\n const observers: Array = []\n\n queries.forEach((options) => {\n const defaultedOptions = this.#client.defaultQueryOptions(options)\n const match = prevObserversMap.get(defaultedOptions.queryHash)?.shift()\n const observer =\n match ?? new QueryObserver(this.#client, defaultedOptions)\n\n observers.push({\n defaultedQueryOptions: defaultedOptions,\n observer,\n })\n })\n\n return observers\n }\n\n #onUpdate(observer: QueryObserver, result: QueryObserverResult): void {\n const index = this.#observers.indexOf(observer)\n if (index !== -1) {\n this.#result = replaceAt(this.#result, index, result)\n this.#notify()\n }\n }\n\n #notify(): void {\n if (this.hasListeners()) {\n const previousResult = this.#combinedResult\n const newTracked = this.#trackResult(this.#result, this.#observerMatches)\n const newResult = this.#combineResult(newTracked, this.#options?.combine)\n\n if (previousResult !== newResult) {\n notifyManager.batch(() => {\n this.listeners.forEach((listener) => {\n listener(this.#result)\n })\n })\n }\n }\n }\n}\n\ntype QueryObserverMatch = {\n defaultedQueryOptions: DefaultedQueryObserverOptions\n observer: QueryObserver\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,2BAA8B;AAC9B,2BAA8B;AAC9B,0BAA6B;AAC7B,mBAAsD;AAQtD,SAAS,WAAc,QAAkB,QAA4B;AACnE,QAAM,aAAa,IAAI,IAAI,MAAM;AAC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AI,mBAAmB,WAAW;AAChC,2CAAc,MAAM,MAAM;AACxB,eAAK,UAAU,QAAQ,CAAC,aAAa;AACnC,qBAAS,KAAK,OAAO;AAAA,UACvB,CAAC;AAAA,QACH,CAAC;AAAA,MACH;AAAA,IACF;AAAA,EACF;AACF;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/queriesObserver.d.cts b/node_modules/@tanstack/query-core/build/modern/queriesObserver.d.cts deleted file mode 100644 index cc16e52..0000000 --- a/node_modules/@tanstack/query-core/build/modern/queriesObserver.d.cts +++ /dev/null @@ -1,27 +0,0 @@ -import { aH as QueryObserverResult, g as QueryClient, ag as QueryObserverOptions, z as Query, i as QueryObserver } from './hydration-uphG6M-i.cjs'; -import { Subscribable } from './subscribable.cjs'; -import './removable.cjs'; - -type QueriesObserverListener = (result: Array) => void; -type CombineFn = (result: Array) => TCombinedResult; -interface QueriesObserverOptions> { - combine?: CombineFn; -} -declare class QueriesObserver> extends Subscribable { - #private; - constructor(client: QueryClient, queries: Array>, options?: QueriesObserverOptions); - protected onSubscribe(): void; - protected onUnsubscribe(): void; - destroy(): void; - setQueries(queries: Array, options?: QueriesObserverOptions): void; - getCurrentResult(): Array; - getQueries(): Query[]; - getObservers(): QueryObserver[]; - getOptimisticResult(queries: Array, combine: CombineFn | undefined): [ - rawResult: Array, - combineResult: (r?: Array) => TCombinedResult, - trackResult: () => Array - ]; -} - -export { QueriesObserver, type QueriesObserverOptions }; diff --git a/node_modules/@tanstack/query-core/build/modern/queriesObserver.d.ts b/node_modules/@tanstack/query-core/build/modern/queriesObserver.d.ts deleted file mode 100644 index 82a6b8f..0000000 --- a/node_modules/@tanstack/query-core/build/modern/queriesObserver.d.ts +++ /dev/null @@ -1,27 +0,0 @@ -import { aH as QueryObserverResult, g as QueryClient, ag as QueryObserverOptions, z as Query, i as QueryObserver } from './hydration-BlEVG2Lp.js'; -import { Subscribable } from './subscribable.js'; -import './removable.js'; - -type QueriesObserverListener = (result: Array) => void; -type CombineFn = (result: Array) => TCombinedResult; -interface QueriesObserverOptions> { - combine?: CombineFn; -} -declare class QueriesObserver> extends Subscribable { - #private; - constructor(client: QueryClient, queries: Array>, options?: QueriesObserverOptions); - protected onSubscribe(): void; - protected onUnsubscribe(): void; - destroy(): void; - setQueries(queries: Array, options?: QueriesObserverOptions): void; - getCurrentResult(): Array; - getQueries(): Query[]; - getObservers(): QueryObserver[]; - getOptimisticResult(queries: Array, combine: CombineFn | undefined): [ - rawResult: Array, - combineResult: (r?: Array) => TCombinedResult, - trackResult: () => Array - ]; -} - -export { QueriesObserver, type QueriesObserverOptions }; diff --git a/node_modules/@tanstack/query-core/build/modern/queriesObserver.js b/node_modules/@tanstack/query-core/build/modern/queriesObserver.js deleted file mode 100644 index eebdfe6..0000000 --- a/node_modules/@tanstack/query-core/build/modern/queriesObserver.js +++ /dev/null @@ -1,212 +0,0 @@ -// src/queriesObserver.ts -import { notifyManager } from "./notifyManager.js"; -import { QueryObserver } from "./queryObserver.js"; -import { Subscribable } from "./subscribable.js"; -import { replaceEqualDeep, shallowEqualObjects } from "./utils.js"; -function difference(array1, array2) { - const excludeSet = new Set(array2); - return array1.filter((x) => !excludeSet.has(x)); -} -function replaceAt(array, index, value) { - const copy = array.slice(0); - copy[index] = value; - return copy; -} -var QueriesObserver = class extends Subscribable { - #client; - #result; - #queries; - #options; - #observers; - #combinedResult; - #lastCombine; - #lastResult; - #lastQueryHashes; - #observerMatches = []; - constructor(client, queries, options) { - super(); - this.#client = client; - this.#options = options; - this.#queries = []; - this.#observers = []; - this.#result = []; - this.setQueries(queries); - } - onSubscribe() { - if (this.listeners.size === 1) { - this.#observers.forEach((observer) => { - observer.subscribe((result) => { - this.#onUpdate(observer, result); - }); - }); - } - } - onUnsubscribe() { - if (!this.listeners.size) { - this.destroy(); - } - } - destroy() { - this.listeners = /* @__PURE__ */ new Set(); - this.#observers.forEach((observer) => { - observer.destroy(); - }); - } - setQueries(queries, options) { - this.#queries = queries; - this.#options = options; - if (process.env.NODE_ENV !== "production") { - const queryHashes = queries.map( - (query) => this.#client.defaultQueryOptions(query).queryHash - ); - if (new Set(queryHashes).size !== queryHashes.length) { - console.warn( - "[QueriesObserver]: Duplicate Queries found. This might result in unexpected behavior." - ); - } - } - notifyManager.batch(() => { - const prevObservers = this.#observers; - const newObserverMatches = this.#findMatchingObservers(this.#queries); - newObserverMatches.forEach( - (match) => match.observer.setOptions(match.defaultedQueryOptions) - ); - const newObservers = newObserverMatches.map((match) => match.observer); - const newResult = newObservers.map( - (observer) => observer.getCurrentResult() - ); - const hasLengthChange = prevObservers.length !== newObservers.length; - const hasIndexChange = newObservers.some( - (observer, index) => observer !== prevObservers[index] - ); - const hasStructuralChange = hasLengthChange || hasIndexChange; - const hasResultChange = hasStructuralChange ? true : newResult.some((result, index) => { - const prev = this.#result[index]; - return !prev || !shallowEqualObjects(result, prev); - }); - if (!hasStructuralChange && !hasResultChange) return; - if (hasStructuralChange) { - this.#observerMatches = newObserverMatches; - this.#observers = newObservers; - } - this.#result = newResult; - if (!this.hasListeners()) return; - if (hasStructuralChange) { - difference(prevObservers, newObservers).forEach((observer) => { - observer.destroy(); - }); - difference(newObservers, prevObservers).forEach((observer) => { - observer.subscribe((result) => { - this.#onUpdate(observer, result); - }); - }); - } - this.#notify(); - }); - } - getCurrentResult() { - return this.#result; - } - getQueries() { - return this.#observers.map((observer) => observer.getCurrentQuery()); - } - getObservers() { - return this.#observers; - } - getOptimisticResult(queries, combine) { - const matches = this.#findMatchingObservers(queries); - const result = matches.map( - (match) => match.observer.getOptimisticResult(match.defaultedQueryOptions) - ); - const queryHashes = matches.map( - (match) => match.defaultedQueryOptions.queryHash - ); - return [ - result, - (r) => { - return this.#combineResult(r ?? result, combine, queryHashes); - }, - () => { - return this.#trackResult(result, matches); - } - ]; - } - #trackResult(result, matches) { - return matches.map((match, index) => { - const observerResult = result[index]; - return !match.defaultedQueryOptions.notifyOnChangeProps ? match.observer.trackResult(observerResult, (accessedProp) => { - matches.forEach((m) => { - m.observer.trackProp(accessedProp); - }); - }) : observerResult; - }); - } - #combineResult(input, combine, queryHashes) { - if (combine) { - const lastHashes = this.#lastQueryHashes; - const queryHashesChanged = queryHashes !== void 0 && lastHashes !== void 0 && (lastHashes.length !== queryHashes.length || queryHashes.some((hash, i) => hash !== lastHashes[i])); - if (!this.#combinedResult || this.#result !== this.#lastResult || queryHashesChanged || combine !== this.#lastCombine) { - this.#lastCombine = combine; - this.#lastResult = this.#result; - if (queryHashes !== void 0) { - this.#lastQueryHashes = queryHashes; - } - this.#combinedResult = replaceEqualDeep( - this.#combinedResult, - combine(input) - ); - } - return this.#combinedResult; - } - return input; - } - #findMatchingObservers(queries) { - const prevObserversMap = /* @__PURE__ */ new Map(); - this.#observers.forEach((observer) => { - const key = observer.options.queryHash; - if (!key) return; - const previousObservers = prevObserversMap.get(key); - if (previousObservers) { - previousObservers.push(observer); - } else { - prevObserversMap.set(key, [observer]); - } - }); - const observers = []; - queries.forEach((options) => { - const defaultedOptions = this.#client.defaultQueryOptions(options); - const match = prevObserversMap.get(defaultedOptions.queryHash)?.shift(); - const observer = match ?? new QueryObserver(this.#client, defaultedOptions); - observers.push({ - defaultedQueryOptions: defaultedOptions, - observer - }); - }); - return observers; - } - #onUpdate(observer, result) { - const index = this.#observers.indexOf(observer); - if (index !== -1) { - this.#result = replaceAt(this.#result, index, result); - this.#notify(); - } - } - #notify() { - if (this.hasListeners()) { - const previousResult = this.#combinedResult; - const newTracked = this.#trackResult(this.#result, this.#observerMatches); - const newResult = this.#combineResult(newTracked, this.#options?.combine); - if (previousResult !== newResult) { - notifyManager.batch(() => { - this.listeners.forEach((listener) => { - listener(this.#result); - }); - }); - } - } - } -}; -export { - QueriesObserver -}; -//# sourceMappingURL=queriesObserver.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/queriesObserver.js.map b/node_modules/@tanstack/query-core/build/modern/queriesObserver.js.map deleted file mode 100644 index 802b74b..0000000 --- a/node_modules/@tanstack/query-core/build/modern/queriesObserver.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/queriesObserver.ts"],"sourcesContent":["import { notifyManager } from './notifyManager'\nimport { QueryObserver } from './queryObserver'\nimport { Subscribable } from './subscribable'\nimport { replaceEqualDeep, shallowEqualObjects } from './utils'\nimport type {\n DefaultedQueryObserverOptions,\n QueryObserverOptions,\n QueryObserverResult,\n} from './types'\nimport type { QueryClient } from './queryClient'\n\nfunction difference(array1: Array, array2: Array): Array {\n const excludeSet = new Set(array2)\n return array1.filter((x) => !excludeSet.has(x))\n}\n\nfunction replaceAt(array: Array, index: number, value: T): Array {\n const copy = array.slice(0)\n copy[index] = value\n return copy\n}\n\ntype QueriesObserverListener = (result: Array) => void\n\ntype CombineFn = (\n result: Array,\n) => TCombinedResult\n\nexport interface QueriesObserverOptions<\n TCombinedResult = Array,\n> {\n combine?: CombineFn\n}\n\nexport class QueriesObserver<\n TCombinedResult = Array,\n> extends Subscribable {\n #client: QueryClient\n #result!: Array\n #queries: Array\n #options?: QueriesObserverOptions\n #observers: Array\n #combinedResult?: TCombinedResult\n #lastCombine?: CombineFn\n #lastResult?: Array\n #lastQueryHashes?: Array\n #observerMatches: Array = []\n\n constructor(\n client: QueryClient,\n queries: Array>,\n options?: QueriesObserverOptions,\n ) {\n super()\n\n this.#client = client\n this.#options = options\n this.#queries = []\n this.#observers = []\n this.#result = []\n\n this.setQueries(queries)\n }\n\n protected onSubscribe(): void {\n if (this.listeners.size === 1) {\n this.#observers.forEach((observer) => {\n observer.subscribe((result) => {\n this.#onUpdate(observer, result)\n })\n })\n }\n }\n\n protected onUnsubscribe(): void {\n if (!this.listeners.size) {\n this.destroy()\n }\n }\n\n destroy(): void {\n this.listeners = new Set()\n this.#observers.forEach((observer) => {\n observer.destroy()\n })\n }\n\n setQueries(\n queries: Array,\n options?: QueriesObserverOptions,\n ): void {\n this.#queries = queries\n this.#options = options\n\n if (process.env.NODE_ENV !== 'production') {\n const queryHashes = queries.map(\n (query) => this.#client.defaultQueryOptions(query).queryHash,\n )\n if (new Set(queryHashes).size !== queryHashes.length) {\n console.warn(\n '[QueriesObserver]: Duplicate Queries found. This might result in unexpected behavior.',\n )\n }\n }\n\n notifyManager.batch(() => {\n const prevObservers = this.#observers\n\n const newObserverMatches = this.#findMatchingObservers(this.#queries)\n\n // set options for the new observers to notify of changes\n newObserverMatches.forEach((match) =>\n match.observer.setOptions(match.defaultedQueryOptions),\n )\n\n const newObservers = newObserverMatches.map((match) => match.observer)\n const newResult = newObservers.map((observer) =>\n observer.getCurrentResult(),\n )\n\n const hasLengthChange = prevObservers.length !== newObservers.length\n const hasIndexChange = newObservers.some(\n (observer, index) => observer !== prevObservers[index],\n )\n const hasStructuralChange = hasLengthChange || hasIndexChange\n\n const hasResultChange = hasStructuralChange\n ? true\n : newResult.some((result, index) => {\n const prev = this.#result[index]\n return !prev || !shallowEqualObjects(result, prev)\n })\n\n if (!hasStructuralChange && !hasResultChange) return\n\n if (hasStructuralChange) {\n this.#observerMatches = newObserverMatches\n this.#observers = newObservers\n }\n\n this.#result = newResult\n\n if (!this.hasListeners()) return\n\n if (hasStructuralChange) {\n difference(prevObservers, newObservers).forEach((observer) => {\n observer.destroy()\n })\n difference(newObservers, prevObservers).forEach((observer) => {\n observer.subscribe((result) => {\n this.#onUpdate(observer, result)\n })\n })\n }\n\n this.#notify()\n })\n }\n\n getCurrentResult(): Array {\n return this.#result\n }\n\n getQueries() {\n return this.#observers.map((observer) => observer.getCurrentQuery())\n }\n\n getObservers() {\n return this.#observers\n }\n\n getOptimisticResult(\n queries: Array,\n combine: CombineFn | undefined,\n ): [\n rawResult: Array,\n combineResult: (r?: Array) => TCombinedResult,\n trackResult: () => Array,\n ] {\n const matches = this.#findMatchingObservers(queries)\n const result = matches.map((match) =>\n match.observer.getOptimisticResult(match.defaultedQueryOptions),\n )\n const queryHashes = matches.map(\n (match) => match.defaultedQueryOptions.queryHash,\n )\n\n return [\n result,\n (r?: Array) => {\n return this.#combineResult(r ?? result, combine, queryHashes)\n },\n () => {\n return this.#trackResult(result, matches)\n },\n ]\n }\n\n #trackResult(\n result: Array,\n matches: Array,\n ) {\n return matches.map((match, index) => {\n const observerResult = result[index]!\n return !match.defaultedQueryOptions.notifyOnChangeProps\n ? match.observer.trackResult(observerResult, (accessedProp) => {\n // track property on all observers to ensure proper (synchronized) tracking (#7000)\n matches.forEach((m) => {\n m.observer.trackProp(accessedProp)\n })\n })\n : observerResult\n })\n }\n\n #combineResult(\n input: Array,\n combine: CombineFn | undefined,\n queryHashes?: Array,\n ): TCombinedResult {\n if (combine) {\n const lastHashes = this.#lastQueryHashes\n const queryHashesChanged =\n queryHashes !== undefined &&\n lastHashes !== undefined &&\n (lastHashes.length !== queryHashes.length ||\n queryHashes.some((hash, i) => hash !== lastHashes[i]))\n\n if (\n !this.#combinedResult ||\n this.#result !== this.#lastResult ||\n queryHashesChanged ||\n combine !== this.#lastCombine\n ) {\n this.#lastCombine = combine\n this.#lastResult = this.#result\n\n if (queryHashes !== undefined) {\n this.#lastQueryHashes = queryHashes\n }\n this.#combinedResult = replaceEqualDeep(\n this.#combinedResult,\n combine(input),\n )\n }\n\n return this.#combinedResult\n }\n return input as any\n }\n\n #findMatchingObservers(\n queries: Array,\n ): Array {\n const prevObserversMap = new Map>()\n\n this.#observers.forEach((observer) => {\n const key = observer.options.queryHash\n if (!key) return\n\n const previousObservers = prevObserversMap.get(key)\n\n if (previousObservers) {\n previousObservers.push(observer)\n } else {\n prevObserversMap.set(key, [observer])\n }\n })\n\n const observers: Array = []\n\n queries.forEach((options) => {\n const defaultedOptions = this.#client.defaultQueryOptions(options)\n const match = prevObserversMap.get(defaultedOptions.queryHash)?.shift()\n const observer =\n match ?? new QueryObserver(this.#client, defaultedOptions)\n\n observers.push({\n defaultedQueryOptions: defaultedOptions,\n observer,\n })\n })\n\n return observers\n }\n\n #onUpdate(observer: QueryObserver, result: QueryObserverResult): void {\n const index = this.#observers.indexOf(observer)\n if (index !== -1) {\n this.#result = replaceAt(this.#result, index, result)\n this.#notify()\n }\n }\n\n #notify(): void {\n if (this.hasListeners()) {\n const previousResult = this.#combinedResult\n const newTracked = this.#trackResult(this.#result, this.#observerMatches)\n const newResult = this.#combineResult(newTracked, this.#options?.combine)\n\n if (previousResult !== newResult) {\n notifyManager.batch(() => {\n this.listeners.forEach((listener) => {\n listener(this.#result)\n })\n })\n }\n }\n }\n}\n\ntype QueryObserverMatch = {\n defaultedQueryOptions: DefaultedQueryObserverOptions\n observer: QueryObserver\n}\n"],"mappings":";AAAA,SAAS,qBAAqB;AAC9B,SAAS,qBAAqB;AAC9B,SAAS,oBAAoB;AAC7B,SAAS,kBAAkB,2BAA2B;AAQtD,SAAS,WAAc,QAAkB,QAA4B;AACnE,QAAM,aAAa,IAAI,IAAI,MAAM;AACjC,SAAO,OAAO,OAAO,CAAC,MAAM,CAAC,WAAW,IAAI,CAAC,CAAC;AAChD;AAEA,SAAS,UAAa,OAAiB,OAAe,OAAoB;AACxE,QAAM,OAAO,MAAM,MAAM,CAAC;AAC1B,OAAK,KAAK,IAAI;AACd,SAAO;AACT;AAcO,IAAM,kBAAN,cAEG,aAAsC;AAAA,EAC9C;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,mBAA8C,CAAC;AAAA,EAE/C,YACE,QACA,SACA,SACA;AACA,UAAM;AAEN,SAAK,UAAU;AACf,SAAK,WAAW;AAChB,SAAK,WAAW,CAAC;AACjB,SAAK,aAAa,CAAC;AACnB,SAAK,UAAU,CAAC;AAEhB,SAAK,WAAW,OAAO;AAAA,EACzB;AAAA,EAEU,cAAoB;AAC5B,QAAI,KAAK,UAAU,SAAS,GAAG;AAC7B,WAAK,WAAW,QAAQ,CAAC,aAAa;AACpC,iBAAS,UAAU,CAAC,WAAW;AAC7B,eAAK,UAAU,UAAU,MAAM;AAAA,QACjC,CAAC;AAAA,MACH,CAAC;AAAA,IACH;A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AAE3D,gBAAU,KAAK;AAAA,QACb,uBAAuB;AAAA,QACvB;AAAA,MACF,CAAC;AAAA,IACH,CAAC;AAED,WAAO;AAAA,EACT;AAAA,EAEA,UAAU,UAAyB,QAAmC;AACpE,UAAM,QAAQ,KAAK,WAAW,QAAQ,QAAQ;AAC9C,QAAI,UAAU,IAAI;AAChB,WAAK,UAAU,UAAU,KAAK,SAAS,OAAO,MAAM;AACpD,WAAK,QAAQ;AAAA,IACf;AAAA,EACF;AAAA,EAEA,UAAgB;AACd,QAAI,KAAK,aAAa,GAAG;AACvB,YAAM,iBAAiB,KAAK;AAC5B,YAAM,aAAa,KAAK,aAAa,KAAK,SAAS,KAAK,gBAAgB;AACxE,YAAM,YAAY,KAAK,eAAe,YAAY,KAAK,UAAU,OAAO;AAExE,UAAI,mBAAmB,WAAW;AAChC,sBAAc,MAAM,MAAM;AACxB,eAAK,UAAU,QAAQ,CAAC,aAAa;AACnC,qBAAS,KAAK,OAAO;AAAA,UACvB,CAAC;AAAA,QACH,CAAC;AAAA,MACH;AAAA,IACF;AAAA,EACF;AACF;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/query.cjs b/node_modules/@tanstack/query-core/build/modern/query.cjs deleted file mode 100644 index af8c064..0000000 --- a/node_modules/@tanstack/query-core/build/modern/query.cjs +++ /dev/null @@ -1,452 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// src/query.ts -var query_exports = {}; -__export(query_exports, { - Query: () => Query, - fetchState: () => fetchState -}); -module.exports = __toCommonJS(query_exports); -var import_utils = require("./utils.cjs"); -var import_notifyManager = require("./notifyManager.cjs"); -var import_retryer = require("./retryer.cjs"); -var import_removable = require("./removable.cjs"); -var Query = class extends import_removable.Removable { - #initialState; - #revertState; - #cache; - #client; - #retryer; - #defaultOptions; - #abortSignalConsumed; - constructor(config) { - super(); - this.#abortSignalConsumed = false; - this.#defaultOptions = config.defaultOptions; - this.setOptions(config.options); - this.observers = []; - this.#client = config.client; - this.#cache = this.#client.getQueryCache(); - this.queryKey = config.queryKey; - this.queryHash = config.queryHash; - this.#initialState = getDefaultState(this.options); - this.state = config.state ?? this.#initialState; - this.scheduleGc(); - } - get meta() { - return this.options.meta; - } - get promise() { - return this.#retryer?.promise; - } - setOptions(options) { - this.options = { ...this.#defaultOptions, ...options }; - this.updateGcTime(this.options.gcTime); - if (this.state && this.state.data === void 0) { - const defaultState = getDefaultState(this.options); - if (defaultState.data !== void 0) { - this.setState( - successState(defaultState.data, defaultState.dataUpdatedAt) - ); - this.#initialState = defaultState; - } - } - } - optionalRemove() { - if (!this.observers.length && this.state.fetchStatus === "idle") { - this.#cache.remove(this); - } - } - setData(newData, options) { - const data = (0, import_utils.replaceData)(this.state.data, newData, this.options); - this.#dispatch({ - data, - type: "success", - dataUpdatedAt: options?.updatedAt, - manual: options?.manual - }); - return data; - } - setState(state, setStateOptions) { - this.#dispatch({ type: "setState", state, setStateOptions }); - } - cancel(options) { - const promise = this.#retryer?.promise; - this.#retryer?.cancel(options); - return promise ? promise.then(import_utils.noop).catch(import_utils.noop) : Promise.resolve(); - } - destroy() { - super.destroy(); - this.cancel({ silent: true }); - } - reset() { - this.destroy(); - this.setState(this.#initialState); - } - isActive() { - return this.observers.some( - (observer) => (0, import_utils.resolveEnabled)(observer.options.enabled, this) !== false - ); - } - isDisabled() { - if (this.getObserversCount() > 0) { - return !this.isActive(); - } - return this.options.queryFn === import_utils.skipToken || this.state.dataUpdateCount + this.state.errorUpdateCount === 0; - } - isStatic() { - if (this.getObserversCount() > 0) { - return this.observers.some( - (observer) => (0, import_utils.resolveStaleTime)(observer.options.staleTime, this) === "static" - ); - } - return false; - } - isStale() { - if (this.getObserversCount() > 0) { - return this.observers.some( - (observer) => observer.getCurrentResult().isStale - ); - } - return this.state.data === void 0 || this.state.isInvalidated; - } - isStaleByTime(staleTime = 0) { - if (this.state.data === void 0) { - return true; - } - if (staleTime === "static") { - return false; - } - if (this.state.isInvalidated) { - return true; - } - return !(0, import_utils.timeUntilStale)(this.state.dataUpdatedAt, staleTime); - } - onFocus() { - const observer = this.observers.find((x) => x.shouldFetchOnWindowFocus()); - observer?.refetch({ cancelRefetch: false }); - this.#retryer?.continue(); - } - onOnline() { - const observer = this.observers.find((x) => x.shouldFetchOnReconnect()); - observer?.refetch({ cancelRefetch: false }); - this.#retryer?.continue(); - } - addObserver(observer) { - if (!this.observers.includes(observer)) { - this.observers.push(observer); - this.clearGcTimeout(); - this.#cache.notify({ type: "observerAdded", query: this, observer }); - } - } - removeObserver(observer) { - if (this.observers.includes(observer)) { - this.observers = this.observers.filter((x) => x !== observer); - if (!this.observers.length) { - if (this.#retryer) { - if (this.#abortSignalConsumed) { - this.#retryer.cancel({ revert: true }); - } else { - this.#retryer.cancelRetry(); - } - } - this.scheduleGc(); - } - this.#cache.notify({ type: "observerRemoved", query: this, observer }); - } - } - getObserversCount() { - return this.observers.length; - } - invalidate() { - if (!this.state.isInvalidated) { - this.#dispatch({ type: "invalidate" }); - } - } - async fetch(options, fetchOptions) { - if (this.state.fetchStatus !== "idle" && // If the promise in the retryer is already rejected, we have to definitely - // re-start the fetch; there is a chance that the query is still in a - // pending state when that happens - this.#retryer?.status() !== "rejected") { - if (this.state.data !== void 0 && fetchOptions?.cancelRefetch) { - this.cancel({ silent: true }); - } else if (this.#retryer) { - this.#retryer.continueRetry(); - return this.#retryer.promise; - } - } - if (options) { - this.setOptions(options); - } - if (!this.options.queryFn) { - const observer = this.observers.find((x) => x.options.queryFn); - if (observer) { - this.setOptions(observer.options); - } - } - if (process.env.NODE_ENV !== "production") { - if (!Array.isArray(this.options.queryKey)) { - console.error( - `As of v4, queryKey needs to be an Array. If you are using a string like 'repoData', please change it to an Array, e.g. ['repoData']` - ); - } - } - const abortController = new AbortController(); - const addSignalProperty = (object) => { - Object.defineProperty(object, "signal", { - enumerable: true, - get: () => { - this.#abortSignalConsumed = true; - return abortController.signal; - } - }); - }; - const fetchFn = () => { - const queryFn = (0, import_utils.ensureQueryFn)(this.options, fetchOptions); - const createQueryFnContext = () => { - const queryFnContext2 = { - client: this.#client, - queryKey: this.queryKey, - meta: this.meta - }; - addSignalProperty(queryFnContext2); - return queryFnContext2; - }; - const queryFnContext = createQueryFnContext(); - this.#abortSignalConsumed = false; - if (this.options.persister) { - return this.options.persister( - queryFn, - queryFnContext, - this - ); - } - return queryFn(queryFnContext); - }; - const createFetchContext = () => { - const context2 = { - fetchOptions, - options: this.options, - queryKey: this.queryKey, - client: this.#client, - state: this.state, - fetchFn - }; - addSignalProperty(context2); - return context2; - }; - const context = createFetchContext(); - this.options.behavior?.onFetch(context, this); - this.#revertState = this.state; - if (this.state.fetchStatus === "idle" || this.state.fetchMeta !== context.fetchOptions?.meta) { - this.#dispatch({ type: "fetch", meta: context.fetchOptions?.meta }); - } - this.#retryer = (0, import_retryer.createRetryer)({ - initialPromise: fetchOptions?.initialPromise, - fn: context.fetchFn, - onCancel: (error) => { - if (error instanceof import_retryer.CancelledError && error.revert) { - this.setState({ - ...this.#revertState, - fetchStatus: "idle" - }); - } - abortController.abort(); - }, - onFail: (failureCount, error) => { - this.#dispatch({ type: "failed", failureCount, error }); - }, - onPause: () => { - this.#dispatch({ type: "pause" }); - }, - onContinue: () => { - this.#dispatch({ type: "continue" }); - }, - retry: context.options.retry, - retryDelay: context.options.retryDelay, - networkMode: context.options.networkMode, - canRun: () => true - }); - try { - const data = await this.#retryer.start(); - if (data === void 0) { - if (process.env.NODE_ENV !== "production") { - console.error( - `Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}` - ); - } - throw new Error(`${this.queryHash} data is undefined`); - } - this.setData(data); - this.#cache.config.onSuccess?.(data, this); - this.#cache.config.onSettled?.( - data, - this.state.error, - this - ); - return data; - } catch (error) { - if (error instanceof import_retryer.CancelledError) { - if (error.silent) { - return this.#retryer.promise; - } else if (error.revert) { - if (this.state.data === void 0) { - throw error; - } - return this.state.data; - } - } - this.#dispatch({ - type: "error", - error - }); - this.#cache.config.onError?.( - error, - this - ); - this.#cache.config.onSettled?.( - this.state.data, - error, - this - ); - throw error; - } finally { - this.scheduleGc(); - } - } - #dispatch(action) { - const reducer = (state) => { - switch (action.type) { - case "failed": - return { - ...state, - fetchFailureCount: action.failureCount, - fetchFailureReason: action.error - }; - case "pause": - return { - ...state, - fetchStatus: "paused" - }; - case "continue": - return { - ...state, - fetchStatus: "fetching" - }; - case "fetch": - return { - ...state, - ...fetchState(state.data, this.options), - fetchMeta: action.meta ?? null - }; - case "success": - const newState = { - ...state, - ...successState(action.data, action.dataUpdatedAt), - dataUpdateCount: state.dataUpdateCount + 1, - ...!action.manual && { - fetchStatus: "idle", - fetchFailureCount: 0, - fetchFailureReason: null - } - }; - this.#revertState = action.manual ? newState : void 0; - return newState; - case "error": - const error = action.error; - return { - ...state, - error, - errorUpdateCount: state.errorUpdateCount + 1, - errorUpdatedAt: Date.now(), - fetchFailureCount: state.fetchFailureCount + 1, - fetchFailureReason: error, - fetchStatus: "idle", - status: "error", - // flag existing data as invalidated if we get a background error - // note that "no data" always means stale so we can set unconditionally here - isInvalidated: true - }; - case "invalidate": - return { - ...state, - isInvalidated: true - }; - case "setState": - return { - ...state, - ...action.state - }; - } - }; - this.state = reducer(this.state); - import_notifyManager.notifyManager.batch(() => { - this.observers.forEach((observer) => { - observer.onQueryUpdate(); - }); - this.#cache.notify({ query: this, type: "updated", action }); - }); - } -}; -function fetchState(data, options) { - return { - fetchFailureCount: 0, - fetchFailureReason: null, - fetchStatus: (0, import_retryer.canFetch)(options.networkMode) ? "fetching" : "paused", - ...data === void 0 && { - error: null, - status: "pending" - } - }; -} -function successState(data, dataUpdatedAt) { - return { - data, - dataUpdatedAt: dataUpdatedAt ?? Date.now(), - error: null, - isInvalidated: false, - status: "success" - }; -} -function getDefaultState(options) { - const data = typeof options.initialData === "function" ? options.initialData() : options.initialData; - const hasData = data !== void 0; - const initialDataUpdatedAt = hasData ? typeof options.initialDataUpdatedAt === "function" ? options.initialDataUpdatedAt() : options.initialDataUpdatedAt : 0; - return { - data, - dataUpdateCount: 0, - dataUpdatedAt: hasData ? initialDataUpdatedAt ?? Date.now() : 0, - error: null, - errorUpdateCount: 0, - errorUpdatedAt: 0, - fetchFailureCount: 0, - fetchFailureReason: null, - fetchMeta: null, - isInvalidated: false, - status: hasData ? "success" : "pending", - fetchStatus: "idle" - }; -} -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - Query, - fetchState -}); -//# sourceMappingURL=query.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/query.cjs.map b/node_modules/@tanstack/query-core/build/modern/query.cjs.map deleted file mode 100644 index d6942c5..0000000 --- a/node_modules/@tanstack/query-core/build/modern/query.cjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/query.ts"],"sourcesContent":["import {\n ensureQueryFn,\n noop,\n replaceData,\n resolveEnabled,\n resolveStaleTime,\n skipToken,\n timeUntilStale,\n} from './utils'\nimport { notifyManager } from './notifyManager'\nimport { CancelledError, canFetch, createRetryer } from './retryer'\nimport { Removable } from './removable'\nimport type { QueryCache } from './queryCache'\nimport type { QueryClient } from './queryClient'\nimport type {\n CancelOptions,\n DefaultError,\n FetchStatus,\n InitialDataFunction,\n OmitKeyof,\n QueryFunctionContext,\n QueryKey,\n QueryMeta,\n QueryOptions,\n QueryStatus,\n SetDataOptions,\n StaleTime,\n} from './types'\nimport type { QueryObserver } from './queryObserver'\nimport type { Retryer } from './retryer'\n\n// TYPES\n\ninterface QueryConfig<\n TQueryFnData,\n TError,\n TData,\n TQueryKey extends QueryKey = QueryKey,\n> {\n client: QueryClient\n queryKey: TQueryKey\n queryHash: string\n options?: QueryOptions\n defaultOptions?: QueryOptions\n state?: QueryState\n}\n\nexport interface QueryState {\n data: TData | undefined\n dataUpdateCount: number\n dataUpdatedAt: number\n error: TError | null\n errorUpdateCount: number\n errorUpdatedAt: number\n fetchFailureCount: number\n fetchFailureReason: TError | null\n fetchMeta: FetchMeta | null\n isInvalidated: boolean\n status: QueryStatus\n fetchStatus: FetchStatus\n}\n\nexport interface FetchContext<\n TQueryFnData,\n TError,\n TData,\n TQueryKey extends QueryKey = QueryKey,\n> {\n fetchFn: () => unknown | Promise\n fetchOptions?: FetchOptions\n signal: AbortSignal\n options: QueryOptions\n client: QueryClient\n queryKey: TQueryKey\n state: QueryState\n}\n\nexport interface QueryBehavior<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> {\n onFetch: (\n context: FetchContext,\n query: Query,\n ) => void\n}\n\nexport type FetchDirection = 'forward' | 'backward'\n\nexport interface FetchMeta {\n fetchMore?: { direction: FetchDirection }\n}\n\nexport interface FetchOptions {\n cancelRefetch?: boolean\n meta?: FetchMeta\n initialPromise?: Promise\n}\n\ninterface FailedAction {\n type: 'failed'\n failureCount: number\n error: TError\n}\n\ninterface FetchAction {\n type: 'fetch'\n meta?: FetchMeta\n}\n\ninterface SuccessAction {\n data: TData | undefined\n type: 'success'\n dataUpdatedAt?: number\n manual?: boolean\n}\n\ninterface ErrorAction {\n type: 'error'\n error: TError\n}\n\ninterface InvalidateAction {\n type: 'invalidate'\n}\n\ninterface PauseAction {\n type: 'pause'\n}\n\ninterface ContinueAction {\n type: 'continue'\n}\n\ninterface SetStateAction {\n type: 'setState'\n state: Partial>\n setStateOptions?: SetStateOptions\n}\n\nexport type Action =\n | ContinueAction\n | ErrorAction\n | FailedAction\n | FetchAction\n | InvalidateAction\n | PauseAction\n | SetStateAction\n | SuccessAction\n\nexport interface SetStateOptions {\n meta?: any\n}\n\n// CLASS\n\nexport class Query<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> extends Removable {\n queryKey: TQueryKey\n queryHash: string\n options!: QueryOptions\n state: QueryState\n\n #initialState: QueryState\n #revertState?: QueryState\n #cache: QueryCache\n #client: QueryClient\n #retryer?: Retryer\n observers: Array>\n #defaultOptions?: QueryOptions\n #abortSignalConsumed: boolean\n\n constructor(config: QueryConfig) {\n super()\n\n this.#abortSignalConsumed = false\n this.#defaultOptions = config.defaultOptions\n this.setOptions(config.options)\n this.observers = []\n this.#client = config.client\n this.#cache = this.#client.getQueryCache()\n this.queryKey = config.queryKey\n this.queryHash = config.queryHash\n this.#initialState = getDefaultState(this.options)\n this.state = config.state ?? this.#initialState\n this.scheduleGc()\n }\n get meta(): QueryMeta | undefined {\n return this.options.meta\n }\n\n get promise(): Promise | undefined {\n return this.#retryer?.promise\n }\n\n setOptions(\n options?: QueryOptions,\n ): void {\n this.options = { ...this.#defaultOptions, ...options }\n\n this.updateGcTime(this.options.gcTime)\n\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n if (this.state && this.state.data === undefined) {\n const defaultState = getDefaultState(this.options)\n if (defaultState.data !== undefined) {\n this.setState(\n successState(defaultState.data, defaultState.dataUpdatedAt),\n )\n this.#initialState = defaultState\n }\n }\n }\n\n protected optionalRemove() {\n if (!this.observers.length && this.state.fetchStatus === 'idle') {\n this.#cache.remove(this)\n }\n }\n\n setData(\n newData: TData,\n options?: SetDataOptions & { manual: boolean },\n ): TData {\n const data = replaceData(this.state.data, newData, this.options)\n\n // Set data and mark it as cached\n this.#dispatch({\n data,\n type: 'success',\n dataUpdatedAt: options?.updatedAt,\n manual: options?.manual,\n })\n\n return data\n }\n\n setState(\n state: Partial>,\n setStateOptions?: SetStateOptions,\n ): void {\n this.#dispatch({ type: 'setState', state, setStateOptions })\n }\n\n cancel(options?: CancelOptions): Promise {\n const promise = this.#retryer?.promise\n this.#retryer?.cancel(options)\n return promise ? promise.then(noop).catch(noop) : Promise.resolve()\n }\n\n destroy(): void {\n super.destroy()\n\n this.cancel({ silent: true })\n }\n\n reset(): void {\n this.destroy()\n this.setState(this.#initialState)\n }\n\n isActive(): boolean {\n return this.observers.some(\n (observer) => resolveEnabled(observer.options.enabled, this) !== false,\n )\n }\n\n isDisabled(): boolean {\n if (this.getObserversCount() > 0) {\n return !this.isActive()\n }\n // if a query has no observers, it should still be considered disabled if it never attempted a fetch\n return (\n this.options.queryFn === skipToken ||\n this.state.dataUpdateCount + this.state.errorUpdateCount === 0\n )\n }\n\n isStatic(): boolean {\n if (this.getObserversCount() > 0) {\n return this.observers.some(\n (observer) =>\n resolveStaleTime(observer.options.staleTime, this) === 'static',\n )\n }\n\n return false\n }\n\n isStale(): boolean {\n // check observers first, their `isStale` has the source of truth\n // calculated with `isStaleByTime` and it takes `enabled` into account\n if (this.getObserversCount() > 0) {\n return this.observers.some(\n (observer) => observer.getCurrentResult().isStale,\n )\n }\n\n return this.state.data === undefined || this.state.isInvalidated\n }\n\n isStaleByTime(staleTime: StaleTime = 0): boolean {\n // no data is always stale\n if (this.state.data === undefined) {\n return true\n }\n // static is never stale\n if (staleTime === 'static') {\n return false\n }\n // if the query is invalidated, it is stale\n if (this.state.isInvalidated) {\n return true\n }\n\n return !timeUntilStale(this.state.dataUpdatedAt, staleTime)\n }\n\n onFocus(): void {\n const observer = this.observers.find((x) => x.shouldFetchOnWindowFocus())\n\n observer?.refetch({ cancelRefetch: false })\n\n // Continue fetch if currently paused\n this.#retryer?.continue()\n }\n\n onOnline(): void {\n const observer = this.observers.find((x) => x.shouldFetchOnReconnect())\n\n observer?.refetch({ cancelRefetch: false })\n\n // Continue fetch if currently paused\n this.#retryer?.continue()\n }\n\n addObserver(observer: QueryObserver): void {\n if (!this.observers.includes(observer)) {\n this.observers.push(observer)\n\n // Stop the query from being garbage collected\n this.clearGcTimeout()\n\n this.#cache.notify({ type: 'observerAdded', query: this, observer })\n }\n }\n\n removeObserver(observer: QueryObserver): void {\n if (this.observers.includes(observer)) {\n this.observers = this.observers.filter((x) => x !== observer)\n\n if (!this.observers.length) {\n // If the transport layer does not support cancellation\n // we'll let the query continue so the result can be cached\n if (this.#retryer) {\n if (this.#abortSignalConsumed) {\n this.#retryer.cancel({ revert: true })\n } else {\n this.#retryer.cancelRetry()\n }\n }\n\n this.scheduleGc()\n }\n\n this.#cache.notify({ type: 'observerRemoved', query: this, observer })\n }\n }\n\n getObserversCount(): number {\n return this.observers.length\n }\n\n invalidate(): void {\n if (!this.state.isInvalidated) {\n this.#dispatch({ type: 'invalidate' })\n }\n }\n\n async fetch(\n options?: QueryOptions,\n fetchOptions?: FetchOptions,\n ): Promise {\n if (\n this.state.fetchStatus !== 'idle' &&\n // If the promise in the retryer is already rejected, we have to definitely\n // re-start the fetch; there is a chance that the query is still in a\n // pending state when that happens\n this.#retryer?.status() !== 'rejected'\n ) {\n if (this.state.data !== undefined && fetchOptions?.cancelRefetch) {\n // Silently cancel current fetch if the user wants to cancel refetch\n this.cancel({ silent: true })\n } else if (this.#retryer) {\n // make sure that retries that were potentially cancelled due to unmounts can continue\n this.#retryer.continueRetry()\n // Return current promise if we are already fetching\n return this.#retryer.promise\n }\n }\n\n // Update config if passed, otherwise the config from the last execution is used\n if (options) {\n this.setOptions(options)\n }\n\n // Use the options from the first observer with a query function if no function is found.\n // This can happen when the query is hydrated or created with setQueryData.\n if (!this.options.queryFn) {\n const observer = this.observers.find((x) => x.options.queryFn)\n if (observer) {\n this.setOptions(observer.options)\n }\n }\n\n if (process.env.NODE_ENV !== 'production') {\n if (!Array.isArray(this.options.queryKey)) {\n console.error(\n `As of v4, queryKey needs to be an Array. If you are using a string like 'repoData', please change it to an Array, e.g. ['repoData']`,\n )\n }\n }\n\n const abortController = new AbortController()\n\n // Adds an enumerable signal property to the object that\n // which sets abortSignalConsumed to true when the signal\n // is read.\n const addSignalProperty = (object: unknown) => {\n Object.defineProperty(object, 'signal', {\n enumerable: true,\n get: () => {\n this.#abortSignalConsumed = true\n return abortController.signal\n },\n })\n }\n\n // Create fetch function\n const fetchFn = () => {\n const queryFn = ensureQueryFn(this.options, fetchOptions)\n\n // Create query function context\n const createQueryFnContext = (): QueryFunctionContext => {\n const queryFnContext: OmitKeyof<\n QueryFunctionContext,\n 'signal'\n > = {\n client: this.#client,\n queryKey: this.queryKey,\n meta: this.meta,\n }\n addSignalProperty(queryFnContext)\n return queryFnContext as QueryFunctionContext\n }\n\n const queryFnContext = createQueryFnContext()\n\n this.#abortSignalConsumed = false\n if (this.options.persister) {\n return this.options.persister(\n queryFn,\n queryFnContext,\n this as unknown as Query,\n )\n }\n\n return queryFn(queryFnContext)\n }\n\n // Trigger behavior hook\n const createFetchContext = (): FetchContext<\n TQueryFnData,\n TError,\n TData,\n TQueryKey\n > => {\n const context: OmitKeyof<\n FetchContext,\n 'signal'\n > = {\n fetchOptions,\n options: this.options,\n queryKey: this.queryKey,\n client: this.#client,\n state: this.state,\n fetchFn,\n }\n\n addSignalProperty(context)\n return context as FetchContext\n }\n\n const context = createFetchContext()\n\n this.options.behavior?.onFetch(context, this as unknown as Query)\n\n // Store state in case the current fetch needs to be reverted\n this.#revertState = this.state\n\n // Set to fetching state if not already in it\n if (\n this.state.fetchStatus === 'idle' ||\n this.state.fetchMeta !== context.fetchOptions?.meta\n ) {\n this.#dispatch({ type: 'fetch', meta: context.fetchOptions?.meta })\n }\n\n // Try to fetch the data\n this.#retryer = createRetryer({\n initialPromise: fetchOptions?.initialPromise as\n | Promise\n | undefined,\n fn: context.fetchFn as () => Promise,\n onCancel: (error) => {\n if (error instanceof CancelledError && error.revert) {\n this.setState({\n ...this.#revertState,\n fetchStatus: 'idle' as const,\n })\n }\n abortController.abort()\n },\n onFail: (failureCount, error) => {\n this.#dispatch({ type: 'failed', failureCount, error })\n },\n onPause: () => {\n this.#dispatch({ type: 'pause' })\n },\n onContinue: () => {\n this.#dispatch({ type: 'continue' })\n },\n retry: context.options.retry,\n retryDelay: context.options.retryDelay,\n networkMode: context.options.networkMode,\n canRun: () => true,\n })\n\n try {\n const data = await this.#retryer.start()\n // this is more of a runtime guard\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n if (data === undefined) {\n if (process.env.NODE_ENV !== 'production') {\n console.error(\n `Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}`,\n )\n }\n throw new Error(`${this.queryHash} data is undefined`)\n }\n\n this.setData(data)\n\n // Notify cache callback\n this.#cache.config.onSuccess?.(data, this as Query)\n this.#cache.config.onSettled?.(\n data,\n this.state.error as any,\n this as Query,\n )\n return data\n } catch (error) {\n if (error instanceof CancelledError) {\n if (error.silent) {\n // silent cancellation implies a new fetch is going to be started,\n // so we piggyback onto that promise\n return this.#retryer.promise\n } else if (error.revert) {\n // transform error into reverted state data\n // if the initial fetch was cancelled, we have no data, so we have\n // to get reject with a CancelledError\n if (this.state.data === undefined) {\n throw error\n }\n return this.state.data\n }\n }\n this.#dispatch({\n type: 'error',\n error: error as TError,\n })\n\n // Notify cache callback\n this.#cache.config.onError?.(\n error as any,\n this as Query,\n )\n this.#cache.config.onSettled?.(\n this.state.data,\n error as any,\n this as Query,\n )\n\n throw error // rethrow the error for further handling\n } finally {\n // Schedule query gc after fetching\n this.scheduleGc()\n }\n }\n\n #dispatch(action: Action): void {\n const reducer = (\n state: QueryState,\n ): QueryState => {\n switch (action.type) {\n case 'failed':\n return {\n ...state,\n fetchFailureCount: action.failureCount,\n fetchFailureReason: action.error,\n }\n case 'pause':\n return {\n ...state,\n fetchStatus: 'paused',\n }\n case 'continue':\n return {\n ...state,\n fetchStatus: 'fetching',\n }\n case 'fetch':\n return {\n ...state,\n ...fetchState(state.data, this.options),\n fetchMeta: action.meta ?? null,\n }\n case 'success':\n const newState = {\n ...state,\n ...successState(action.data, action.dataUpdatedAt),\n dataUpdateCount: state.dataUpdateCount + 1,\n ...(!action.manual && {\n fetchStatus: 'idle' as const,\n fetchFailureCount: 0,\n fetchFailureReason: null,\n }),\n }\n // If fetching ends successfully, we don't need revertState as a fallback anymore.\n // For manual updates, capture the state to revert to it in case of a cancellation.\n this.#revertState = action.manual ? newState : undefined\n\n return newState\n case 'error':\n const error = action.error\n return {\n ...state,\n error,\n errorUpdateCount: state.errorUpdateCount + 1,\n errorUpdatedAt: Date.now(),\n fetchFailureCount: state.fetchFailureCount + 1,\n fetchFailureReason: error,\n fetchStatus: 'idle',\n status: 'error',\n // flag existing data as invalidated if we get a background error\n // note that \"no data\" always means stale so we can set unconditionally here\n isInvalidated: true,\n }\n case 'invalidate':\n return {\n ...state,\n isInvalidated: true,\n }\n case 'setState':\n return {\n ...state,\n ...action.state,\n }\n }\n }\n\n this.state = reducer(this.state)\n\n notifyManager.batch(() => {\n this.observers.forEach((observer) => {\n observer.onQueryUpdate()\n })\n\n this.#cache.notify({ query: this, type: 'updated', action })\n })\n }\n}\n\nexport function fetchState<\n TQueryFnData,\n TError,\n TData,\n TQueryKey extends QueryKey,\n>(\n data: TData | undefined,\n options: QueryOptions,\n) {\n return {\n fetchFailureCount: 0,\n fetchFailureReason: null,\n fetchStatus: canFetch(options.networkMode) ? 'fetching' : 'paused',\n ...(data === undefined &&\n ({\n error: null,\n status: 'pending',\n } as const)),\n } as const\n}\n\nfunction successState(data: TData | undefined, dataUpdatedAt?: number) {\n return {\n data,\n dataUpdatedAt: dataUpdatedAt ?? Date.now(),\n error: null,\n isInvalidated: false,\n status: 'success' as const,\n }\n}\n\nfunction getDefaultState<\n TQueryFnData,\n TError,\n TData,\n TQueryKey extends QueryKey,\n>(\n options: QueryOptions,\n): QueryState {\n const data =\n typeof options.initialData === 'function'\n ? (options.initialData as InitialDataFunction)()\n : options.initialData\n\n const hasData = data !== undefined\n\n const initialDataUpdatedAt = hasData\n ? typeof options.initialDataUpdatedAt === 'function'\n ? options.initialDataUpdatedAt()\n : options.initialDataUpdatedAt\n : 0\n\n return {\n data,\n dataUpdateCount: 0,\n dataUpdatedAt: hasData ? (initialDataUpdatedAt ?? Date.now()) : 0,\n error: null,\n errorUpdateCount: 0,\n errorUpdatedAt: 0,\n fetchFailureCount: 0,\n fetchFailureReason: null,\n fetchMeta: null,\n isInvalidated: false,\n status: hasData ? 'success' : 'pending',\n fetchStatus: 'idle',\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAQO;AACP,2BAA8B;AAC9B,qBAAwD;AACxD,uBAA0B;AAmJnB,IAAM,QAAN,cAKG,2BAAU;AAAA,EAMlB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EAEA;AAAA,EACA;AAAA,EAEA,YAAY,QAA6D;AACvE,UAAM;AAEN,SAAK,uBAAuB;AAC5B,SAAK,kBAAkB,OAAO;AAC9B,SAAK,WAAW,OAAO,OAAO;AAC9B,SAAK,YAAY,CAAC;AAClB,SAAK,UAAU,OAAO;AACtB,SAAK,SAAS,KAAK,QAAQ,cAAc;AACzC,SAAK,WAAW,OAAO;AACvB,SAAK,YAAY,OAAO;AACxB,SAAK,gBAAgB,gBAAgB,KAAK,OAAO;AACjD,SAAK,QAAQ,OAAO,SAAS,KAAK;AAClC,SAAK,WAAW;AAAA,EAClB;AAAA,EACA,IAAI,OAA8B;AAChC,WAAO,KAAK,QAAQ;AAAA,EACtB;AAAA,EAEA,IAAI,UAAsC;AACxC,WAAO,KAAK,UAAU;AAAA,EACxB;AAAA,EAEA,WACE,SACM;AACN,SAAK,UAAU,EAAE,GAAG,KAAK,iBAAiB,GAAG,QAAQ;AAErD,SAAK,aAAa,KAAK,QAAQ,MAAM;AAGrC,QAAI,KAAK,SAAS,KAAK,MAAM,SAAS,QAAW;AAC/C,YAAM,eAAe,gBAAgB,KAAK,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Q,qBAAqB,IAC7B,QAAQ,uBACV;AAEJ,SAAO;AAAA,IACL;AAAA,IACA,iBAAiB;AAAA,IACjB,eAAe,UAAW,wBAAwB,KAAK,IAAI,IAAK;AAAA,IAChE,OAAO;AAAA,IACP,kBAAkB;AAAA,IAClB,gBAAgB;AAAA,IAChB,mBAAmB;AAAA,IACnB,oBAAoB;AAAA,IACpB,WAAW;AAAA,IACX,eAAe;AAAA,IACf,QAAQ,UAAU,YAAY;AAAA,IAC9B,aAAa;AAAA,EACf;AACF;","names":["queryFnContext","context"]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/query.d.cts b/node_modules/@tanstack/query-core/build/modern/query.d.cts deleted file mode 100644 index c5cd428..0000000 --- a/node_modules/@tanstack/query-core/build/modern/query.d.cts +++ /dev/null @@ -1,3 +0,0 @@ -import './removable.cjs'; -export { bg as Action, bc as FetchContext, bd as FetchDirection, be as FetchMeta, bf as FetchOptions, z as Query, bb as QueryBehavior, A as QueryState, bh as SetStateOptions, bi as fetchState } from './hydration-uphG6M-i.cjs'; -import './subscribable.cjs'; diff --git a/node_modules/@tanstack/query-core/build/modern/query.d.ts b/node_modules/@tanstack/query-core/build/modern/query.d.ts deleted file mode 100644 index 2a8a1e0..0000000 --- a/node_modules/@tanstack/query-core/build/modern/query.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import './removable.js'; -export { bg as Action, bc as FetchContext, bd as FetchDirection, be as FetchMeta, bf as FetchOptions, z as Query, bb as QueryBehavior, A as QueryState, bh as SetStateOptions, bi as fetchState } from './hydration-BlEVG2Lp.js'; -import './subscribable.js'; diff --git a/node_modules/@tanstack/query-core/build/modern/query.js b/node_modules/@tanstack/query-core/build/modern/query.js deleted file mode 100644 index 41b7b03..0000000 --- a/node_modules/@tanstack/query-core/build/modern/query.js +++ /dev/null @@ -1,434 +0,0 @@ -// src/query.ts -import { - ensureQueryFn, - noop, - replaceData, - resolveEnabled, - resolveStaleTime, - skipToken, - timeUntilStale -} from "./utils.js"; -import { notifyManager } from "./notifyManager.js"; -import { CancelledError, canFetch, createRetryer } from "./retryer.js"; -import { Removable } from "./removable.js"; -var Query = class extends Removable { - #initialState; - #revertState; - #cache; - #client; - #retryer; - #defaultOptions; - #abortSignalConsumed; - constructor(config) { - super(); - this.#abortSignalConsumed = false; - this.#defaultOptions = config.defaultOptions; - this.setOptions(config.options); - this.observers = []; - this.#client = config.client; - this.#cache = this.#client.getQueryCache(); - this.queryKey = config.queryKey; - this.queryHash = config.queryHash; - this.#initialState = getDefaultState(this.options); - this.state = config.state ?? this.#initialState; - this.scheduleGc(); - } - get meta() { - return this.options.meta; - } - get promise() { - return this.#retryer?.promise; - } - setOptions(options) { - this.options = { ...this.#defaultOptions, ...options }; - this.updateGcTime(this.options.gcTime); - if (this.state && this.state.data === void 0) { - const defaultState = getDefaultState(this.options); - if (defaultState.data !== void 0) { - this.setState( - successState(defaultState.data, defaultState.dataUpdatedAt) - ); - this.#initialState = defaultState; - } - } - } - optionalRemove() { - if (!this.observers.length && this.state.fetchStatus === "idle") { - this.#cache.remove(this); - } - } - setData(newData, options) { - const data = replaceData(this.state.data, newData, this.options); - this.#dispatch({ - data, - type: "success", - dataUpdatedAt: options?.updatedAt, - manual: options?.manual - }); - return data; - } - setState(state, setStateOptions) { - this.#dispatch({ type: "setState", state, setStateOptions }); - } - cancel(options) { - const promise = this.#retryer?.promise; - this.#retryer?.cancel(options); - return promise ? promise.then(noop).catch(noop) : Promise.resolve(); - } - destroy() { - super.destroy(); - this.cancel({ silent: true }); - } - reset() { - this.destroy(); - this.setState(this.#initialState); - } - isActive() { - return this.observers.some( - (observer) => resolveEnabled(observer.options.enabled, this) !== false - ); - } - isDisabled() { - if (this.getObserversCount() > 0) { - return !this.isActive(); - } - return this.options.queryFn === skipToken || this.state.dataUpdateCount + this.state.errorUpdateCount === 0; - } - isStatic() { - if (this.getObserversCount() > 0) { - return this.observers.some( - (observer) => resolveStaleTime(observer.options.staleTime, this) === "static" - ); - } - return false; - } - isStale() { - if (this.getObserversCount() > 0) { - return this.observers.some( - (observer) => observer.getCurrentResult().isStale - ); - } - return this.state.data === void 0 || this.state.isInvalidated; - } - isStaleByTime(staleTime = 0) { - if (this.state.data === void 0) { - return true; - } - if (staleTime === "static") { - return false; - } - if (this.state.isInvalidated) { - return true; - } - return !timeUntilStale(this.state.dataUpdatedAt, staleTime); - } - onFocus() { - const observer = this.observers.find((x) => x.shouldFetchOnWindowFocus()); - observer?.refetch({ cancelRefetch: false }); - this.#retryer?.continue(); - } - onOnline() { - const observer = this.observers.find((x) => x.shouldFetchOnReconnect()); - observer?.refetch({ cancelRefetch: false }); - this.#retryer?.continue(); - } - addObserver(observer) { - if (!this.observers.includes(observer)) { - this.observers.push(observer); - this.clearGcTimeout(); - this.#cache.notify({ type: "observerAdded", query: this, observer }); - } - } - removeObserver(observer) { - if (this.observers.includes(observer)) { - this.observers = this.observers.filter((x) => x !== observer); - if (!this.observers.length) { - if (this.#retryer) { - if (this.#abortSignalConsumed) { - this.#retryer.cancel({ revert: true }); - } else { - this.#retryer.cancelRetry(); - } - } - this.scheduleGc(); - } - this.#cache.notify({ type: "observerRemoved", query: this, observer }); - } - } - getObserversCount() { - return this.observers.length; - } - invalidate() { - if (!this.state.isInvalidated) { - this.#dispatch({ type: "invalidate" }); - } - } - async fetch(options, fetchOptions) { - if (this.state.fetchStatus !== "idle" && // If the promise in the retryer is already rejected, we have to definitely - // re-start the fetch; there is a chance that the query is still in a - // pending state when that happens - this.#retryer?.status() !== "rejected") { - if (this.state.data !== void 0 && fetchOptions?.cancelRefetch) { - this.cancel({ silent: true }); - } else if (this.#retryer) { - this.#retryer.continueRetry(); - return this.#retryer.promise; - } - } - if (options) { - this.setOptions(options); - } - if (!this.options.queryFn) { - const observer = this.observers.find((x) => x.options.queryFn); - if (observer) { - this.setOptions(observer.options); - } - } - if (process.env.NODE_ENV !== "production") { - if (!Array.isArray(this.options.queryKey)) { - console.error( - `As of v4, queryKey needs to be an Array. If you are using a string like 'repoData', please change it to an Array, e.g. ['repoData']` - ); - } - } - const abortController = new AbortController(); - const addSignalProperty = (object) => { - Object.defineProperty(object, "signal", { - enumerable: true, - get: () => { - this.#abortSignalConsumed = true; - return abortController.signal; - } - }); - }; - const fetchFn = () => { - const queryFn = ensureQueryFn(this.options, fetchOptions); - const createQueryFnContext = () => { - const queryFnContext2 = { - client: this.#client, - queryKey: this.queryKey, - meta: this.meta - }; - addSignalProperty(queryFnContext2); - return queryFnContext2; - }; - const queryFnContext = createQueryFnContext(); - this.#abortSignalConsumed = false; - if (this.options.persister) { - return this.options.persister( - queryFn, - queryFnContext, - this - ); - } - return queryFn(queryFnContext); - }; - const createFetchContext = () => { - const context2 = { - fetchOptions, - options: this.options, - queryKey: this.queryKey, - client: this.#client, - state: this.state, - fetchFn - }; - addSignalProperty(context2); - return context2; - }; - const context = createFetchContext(); - this.options.behavior?.onFetch(context, this); - this.#revertState = this.state; - if (this.state.fetchStatus === "idle" || this.state.fetchMeta !== context.fetchOptions?.meta) { - this.#dispatch({ type: "fetch", meta: context.fetchOptions?.meta }); - } - this.#retryer = createRetryer({ - initialPromise: fetchOptions?.initialPromise, - fn: context.fetchFn, - onCancel: (error) => { - if (error instanceof CancelledError && error.revert) { - this.setState({ - ...this.#revertState, - fetchStatus: "idle" - }); - } - abortController.abort(); - }, - onFail: (failureCount, error) => { - this.#dispatch({ type: "failed", failureCount, error }); - }, - onPause: () => { - this.#dispatch({ type: "pause" }); - }, - onContinue: () => { - this.#dispatch({ type: "continue" }); - }, - retry: context.options.retry, - retryDelay: context.options.retryDelay, - networkMode: context.options.networkMode, - canRun: () => true - }); - try { - const data = await this.#retryer.start(); - if (data === void 0) { - if (process.env.NODE_ENV !== "production") { - console.error( - `Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}` - ); - } - throw new Error(`${this.queryHash} data is undefined`); - } - this.setData(data); - this.#cache.config.onSuccess?.(data, this); - this.#cache.config.onSettled?.( - data, - this.state.error, - this - ); - return data; - } catch (error) { - if (error instanceof CancelledError) { - if (error.silent) { - return this.#retryer.promise; - } else if (error.revert) { - if (this.state.data === void 0) { - throw error; - } - return this.state.data; - } - } - this.#dispatch({ - type: "error", - error - }); - this.#cache.config.onError?.( - error, - this - ); - this.#cache.config.onSettled?.( - this.state.data, - error, - this - ); - throw error; - } finally { - this.scheduleGc(); - } - } - #dispatch(action) { - const reducer = (state) => { - switch (action.type) { - case "failed": - return { - ...state, - fetchFailureCount: action.failureCount, - fetchFailureReason: action.error - }; - case "pause": - return { - ...state, - fetchStatus: "paused" - }; - case "continue": - return { - ...state, - fetchStatus: "fetching" - }; - case "fetch": - return { - ...state, - ...fetchState(state.data, this.options), - fetchMeta: action.meta ?? null - }; - case "success": - const newState = { - ...state, - ...successState(action.data, action.dataUpdatedAt), - dataUpdateCount: state.dataUpdateCount + 1, - ...!action.manual && { - fetchStatus: "idle", - fetchFailureCount: 0, - fetchFailureReason: null - } - }; - this.#revertState = action.manual ? newState : void 0; - return newState; - case "error": - const error = action.error; - return { - ...state, - error, - errorUpdateCount: state.errorUpdateCount + 1, - errorUpdatedAt: Date.now(), - fetchFailureCount: state.fetchFailureCount + 1, - fetchFailureReason: error, - fetchStatus: "idle", - status: "error", - // flag existing data as invalidated if we get a background error - // note that "no data" always means stale so we can set unconditionally here - isInvalidated: true - }; - case "invalidate": - return { - ...state, - isInvalidated: true - }; - case "setState": - return { - ...state, - ...action.state - }; - } - }; - this.state = reducer(this.state); - notifyManager.batch(() => { - this.observers.forEach((observer) => { - observer.onQueryUpdate(); - }); - this.#cache.notify({ query: this, type: "updated", action }); - }); - } -}; -function fetchState(data, options) { - return { - fetchFailureCount: 0, - fetchFailureReason: null, - fetchStatus: canFetch(options.networkMode) ? "fetching" : "paused", - ...data === void 0 && { - error: null, - status: "pending" - } - }; -} -function successState(data, dataUpdatedAt) { - return { - data, - dataUpdatedAt: dataUpdatedAt ?? Date.now(), - error: null, - isInvalidated: false, - status: "success" - }; -} -function getDefaultState(options) { - const data = typeof options.initialData === "function" ? options.initialData() : options.initialData; - const hasData = data !== void 0; - const initialDataUpdatedAt = hasData ? typeof options.initialDataUpdatedAt === "function" ? options.initialDataUpdatedAt() : options.initialDataUpdatedAt : 0; - return { - data, - dataUpdateCount: 0, - dataUpdatedAt: hasData ? initialDataUpdatedAt ?? Date.now() : 0, - error: null, - errorUpdateCount: 0, - errorUpdatedAt: 0, - fetchFailureCount: 0, - fetchFailureReason: null, - fetchMeta: null, - isInvalidated: false, - status: hasData ? "success" : "pending", - fetchStatus: "idle" - }; -} -export { - Query, - fetchState -}; -//# sourceMappingURL=query.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/query.js.map b/node_modules/@tanstack/query-core/build/modern/query.js.map deleted file mode 100644 index ca12f12..0000000 --- a/node_modules/@tanstack/query-core/build/modern/query.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/query.ts"],"sourcesContent":["import {\n ensureQueryFn,\n noop,\n replaceData,\n resolveEnabled,\n resolveStaleTime,\n skipToken,\n timeUntilStale,\n} from './utils'\nimport { notifyManager } from './notifyManager'\nimport { CancelledError, canFetch, createRetryer } from './retryer'\nimport { Removable } from './removable'\nimport type { QueryCache } from './queryCache'\nimport type { QueryClient } from './queryClient'\nimport type {\n CancelOptions,\n DefaultError,\n FetchStatus,\n InitialDataFunction,\n OmitKeyof,\n QueryFunctionContext,\n QueryKey,\n QueryMeta,\n QueryOptions,\n QueryStatus,\n SetDataOptions,\n StaleTime,\n} from './types'\nimport type { QueryObserver } from './queryObserver'\nimport type { Retryer } from './retryer'\n\n// TYPES\n\ninterface QueryConfig<\n TQueryFnData,\n TError,\n TData,\n TQueryKey extends QueryKey = QueryKey,\n> {\n client: QueryClient\n queryKey: TQueryKey\n queryHash: string\n options?: QueryOptions\n defaultOptions?: QueryOptions\n state?: QueryState\n}\n\nexport interface QueryState {\n data: TData | undefined\n dataUpdateCount: number\n dataUpdatedAt: number\n error: TError | null\n errorUpdateCount: number\n errorUpdatedAt: number\n fetchFailureCount: number\n fetchFailureReason: TError | null\n fetchMeta: FetchMeta | null\n isInvalidated: boolean\n status: QueryStatus\n fetchStatus: FetchStatus\n}\n\nexport interface FetchContext<\n TQueryFnData,\n TError,\n TData,\n TQueryKey extends QueryKey = QueryKey,\n> {\n fetchFn: () => unknown | Promise\n fetchOptions?: FetchOptions\n signal: AbortSignal\n options: QueryOptions\n client: QueryClient\n queryKey: TQueryKey\n state: QueryState\n}\n\nexport interface QueryBehavior<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> {\n onFetch: (\n context: FetchContext,\n query: Query,\n ) => void\n}\n\nexport type FetchDirection = 'forward' | 'backward'\n\nexport interface FetchMeta {\n fetchMore?: { direction: FetchDirection }\n}\n\nexport interface FetchOptions {\n cancelRefetch?: boolean\n meta?: FetchMeta\n initialPromise?: Promise\n}\n\ninterface FailedAction {\n type: 'failed'\n failureCount: number\n error: TError\n}\n\ninterface FetchAction {\n type: 'fetch'\n meta?: FetchMeta\n}\n\ninterface SuccessAction {\n data: TData | undefined\n type: 'success'\n dataUpdatedAt?: number\n manual?: boolean\n}\n\ninterface ErrorAction {\n type: 'error'\n error: TError\n}\n\ninterface InvalidateAction {\n type: 'invalidate'\n}\n\ninterface PauseAction {\n type: 'pause'\n}\n\ninterface ContinueAction {\n type: 'continue'\n}\n\ninterface SetStateAction {\n type: 'setState'\n state: Partial>\n setStateOptions?: SetStateOptions\n}\n\nexport type Action =\n | ContinueAction\n | ErrorAction\n | FailedAction\n | FetchAction\n | InvalidateAction\n | PauseAction\n | SetStateAction\n | SuccessAction\n\nexport interface SetStateOptions {\n meta?: any\n}\n\n// CLASS\n\nexport class Query<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> extends Removable {\n queryKey: TQueryKey\n queryHash: string\n options!: QueryOptions\n state: QueryState\n\n #initialState: QueryState\n #revertState?: QueryState\n #cache: QueryCache\n #client: QueryClient\n #retryer?: Retryer\n observers: Array>\n #defaultOptions?: QueryOptions\n #abortSignalConsumed: boolean\n\n constructor(config: QueryConfig) {\n super()\n\n this.#abortSignalConsumed = false\n this.#defaultOptions = config.defaultOptions\n this.setOptions(config.options)\n this.observers = []\n this.#client = config.client\n this.#cache = this.#client.getQueryCache()\n this.queryKey = config.queryKey\n this.queryHash = config.queryHash\n this.#initialState = getDefaultState(this.options)\n this.state = config.state ?? this.#initialState\n this.scheduleGc()\n }\n get meta(): QueryMeta | undefined {\n return this.options.meta\n }\n\n get promise(): Promise | undefined {\n return this.#retryer?.promise\n }\n\n setOptions(\n options?: QueryOptions,\n ): void {\n this.options = { ...this.#defaultOptions, ...options }\n\n this.updateGcTime(this.options.gcTime)\n\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n if (this.state && this.state.data === undefined) {\n const defaultState = getDefaultState(this.options)\n if (defaultState.data !== undefined) {\n this.setState(\n successState(defaultState.data, defaultState.dataUpdatedAt),\n )\n this.#initialState = defaultState\n }\n }\n }\n\n protected optionalRemove() {\n if (!this.observers.length && this.state.fetchStatus === 'idle') {\n this.#cache.remove(this)\n }\n }\n\n setData(\n newData: TData,\n options?: SetDataOptions & { manual: boolean },\n ): TData {\n const data = replaceData(this.state.data, newData, this.options)\n\n // Set data and mark it as cached\n this.#dispatch({\n data,\n type: 'success',\n dataUpdatedAt: options?.updatedAt,\n manual: options?.manual,\n })\n\n return data\n }\n\n setState(\n state: Partial>,\n setStateOptions?: SetStateOptions,\n ): void {\n this.#dispatch({ type: 'setState', state, setStateOptions })\n }\n\n cancel(options?: CancelOptions): Promise {\n const promise = this.#retryer?.promise\n this.#retryer?.cancel(options)\n return promise ? promise.then(noop).catch(noop) : Promise.resolve()\n }\n\n destroy(): void {\n super.destroy()\n\n this.cancel({ silent: true })\n }\n\n reset(): void {\n this.destroy()\n this.setState(this.#initialState)\n }\n\n isActive(): boolean {\n return this.observers.some(\n (observer) => resolveEnabled(observer.options.enabled, this) !== false,\n )\n }\n\n isDisabled(): boolean {\n if (this.getObserversCount() > 0) {\n return !this.isActive()\n }\n // if a query has no observers, it should still be considered disabled if it never attempted a fetch\n return (\n this.options.queryFn === skipToken ||\n this.state.dataUpdateCount + this.state.errorUpdateCount === 0\n )\n }\n\n isStatic(): boolean {\n if (this.getObserversCount() > 0) {\n return this.observers.some(\n (observer) =>\n resolveStaleTime(observer.options.staleTime, this) === 'static',\n )\n }\n\n return false\n }\n\n isStale(): boolean {\n // check observers first, their `isStale` has the source of truth\n // calculated with `isStaleByTime` and it takes `enabled` into account\n if (this.getObserversCount() > 0) {\n return this.observers.some(\n (observer) => observer.getCurrentResult().isStale,\n )\n }\n\n return this.state.data === undefined || this.state.isInvalidated\n }\n\n isStaleByTime(staleTime: StaleTime = 0): boolean {\n // no data is always stale\n if (this.state.data === undefined) {\n return true\n }\n // static is never stale\n if (staleTime === 'static') {\n return false\n }\n // if the query is invalidated, it is stale\n if (this.state.isInvalidated) {\n return true\n }\n\n return !timeUntilStale(this.state.dataUpdatedAt, staleTime)\n }\n\n onFocus(): void {\n const observer = this.observers.find((x) => x.shouldFetchOnWindowFocus())\n\n observer?.refetch({ cancelRefetch: false })\n\n // Continue fetch if currently paused\n this.#retryer?.continue()\n }\n\n onOnline(): void {\n const observer = this.observers.find((x) => x.shouldFetchOnReconnect())\n\n observer?.refetch({ cancelRefetch: false })\n\n // Continue fetch if currently paused\n this.#retryer?.continue()\n }\n\n addObserver(observer: QueryObserver): void {\n if (!this.observers.includes(observer)) {\n this.observers.push(observer)\n\n // Stop the query from being garbage collected\n this.clearGcTimeout()\n\n this.#cache.notify({ type: 'observerAdded', query: this, observer })\n }\n }\n\n removeObserver(observer: QueryObserver): void {\n if (this.observers.includes(observer)) {\n this.observers = this.observers.filter((x) => x !== observer)\n\n if (!this.observers.length) {\n // If the transport layer does not support cancellation\n // we'll let the query continue so the result can be cached\n if (this.#retryer) {\n if (this.#abortSignalConsumed) {\n this.#retryer.cancel({ revert: true })\n } else {\n this.#retryer.cancelRetry()\n }\n }\n\n this.scheduleGc()\n }\n\n this.#cache.notify({ type: 'observerRemoved', query: this, observer })\n }\n }\n\n getObserversCount(): number {\n return this.observers.length\n }\n\n invalidate(): void {\n if (!this.state.isInvalidated) {\n this.#dispatch({ type: 'invalidate' })\n }\n }\n\n async fetch(\n options?: QueryOptions,\n fetchOptions?: FetchOptions,\n ): Promise {\n if (\n this.state.fetchStatus !== 'idle' &&\n // If the promise in the retryer is already rejected, we have to definitely\n // re-start the fetch; there is a chance that the query is still in a\n // pending state when that happens\n this.#retryer?.status() !== 'rejected'\n ) {\n if (this.state.data !== undefined && fetchOptions?.cancelRefetch) {\n // Silently cancel current fetch if the user wants to cancel refetch\n this.cancel({ silent: true })\n } else if (this.#retryer) {\n // make sure that retries that were potentially cancelled due to unmounts can continue\n this.#retryer.continueRetry()\n // Return current promise if we are already fetching\n return this.#retryer.promise\n }\n }\n\n // Update config if passed, otherwise the config from the last execution is used\n if (options) {\n this.setOptions(options)\n }\n\n // Use the options from the first observer with a query function if no function is found.\n // This can happen when the query is hydrated or created with setQueryData.\n if (!this.options.queryFn) {\n const observer = this.observers.find((x) => x.options.queryFn)\n if (observer) {\n this.setOptions(observer.options)\n }\n }\n\n if (process.env.NODE_ENV !== 'production') {\n if (!Array.isArray(this.options.queryKey)) {\n console.error(\n `As of v4, queryKey needs to be an Array. If you are using a string like 'repoData', please change it to an Array, e.g. ['repoData']`,\n )\n }\n }\n\n const abortController = new AbortController()\n\n // Adds an enumerable signal property to the object that\n // which sets abortSignalConsumed to true when the signal\n // is read.\n const addSignalProperty = (object: unknown) => {\n Object.defineProperty(object, 'signal', {\n enumerable: true,\n get: () => {\n this.#abortSignalConsumed = true\n return abortController.signal\n },\n })\n }\n\n // Create fetch function\n const fetchFn = () => {\n const queryFn = ensureQueryFn(this.options, fetchOptions)\n\n // Create query function context\n const createQueryFnContext = (): QueryFunctionContext => {\n const queryFnContext: OmitKeyof<\n QueryFunctionContext,\n 'signal'\n > = {\n client: this.#client,\n queryKey: this.queryKey,\n meta: this.meta,\n }\n addSignalProperty(queryFnContext)\n return queryFnContext as QueryFunctionContext\n }\n\n const queryFnContext = createQueryFnContext()\n\n this.#abortSignalConsumed = false\n if (this.options.persister) {\n return this.options.persister(\n queryFn,\n queryFnContext,\n this as unknown as Query,\n )\n }\n\n return queryFn(queryFnContext)\n }\n\n // Trigger behavior hook\n const createFetchContext = (): FetchContext<\n TQueryFnData,\n TError,\n TData,\n TQueryKey\n > => {\n const context: OmitKeyof<\n FetchContext,\n 'signal'\n > = {\n fetchOptions,\n options: this.options,\n queryKey: this.queryKey,\n client: this.#client,\n state: this.state,\n fetchFn,\n }\n\n addSignalProperty(context)\n return context as FetchContext\n }\n\n const context = createFetchContext()\n\n this.options.behavior?.onFetch(context, this as unknown as Query)\n\n // Store state in case the current fetch needs to be reverted\n this.#revertState = this.state\n\n // Set to fetching state if not already in it\n if (\n this.state.fetchStatus === 'idle' ||\n this.state.fetchMeta !== context.fetchOptions?.meta\n ) {\n this.#dispatch({ type: 'fetch', meta: context.fetchOptions?.meta })\n }\n\n // Try to fetch the data\n this.#retryer = createRetryer({\n initialPromise: fetchOptions?.initialPromise as\n | Promise\n | undefined,\n fn: context.fetchFn as () => Promise,\n onCancel: (error) => {\n if (error instanceof CancelledError && error.revert) {\n this.setState({\n ...this.#revertState,\n fetchStatus: 'idle' as const,\n })\n }\n abortController.abort()\n },\n onFail: (failureCount, error) => {\n this.#dispatch({ type: 'failed', failureCount, error })\n },\n onPause: () => {\n this.#dispatch({ type: 'pause' })\n },\n onContinue: () => {\n this.#dispatch({ type: 'continue' })\n },\n retry: context.options.retry,\n retryDelay: context.options.retryDelay,\n networkMode: context.options.networkMode,\n canRun: () => true,\n })\n\n try {\n const data = await this.#retryer.start()\n // this is more of a runtime guard\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n if (data === undefined) {\n if (process.env.NODE_ENV !== 'production') {\n console.error(\n `Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}`,\n )\n }\n throw new Error(`${this.queryHash} data is undefined`)\n }\n\n this.setData(data)\n\n // Notify cache callback\n this.#cache.config.onSuccess?.(data, this as Query)\n this.#cache.config.onSettled?.(\n data,\n this.state.error as any,\n this as Query,\n )\n return data\n } catch (error) {\n if (error instanceof CancelledError) {\n if (error.silent) {\n // silent cancellation implies a new fetch is going to be started,\n // so we piggyback onto that promise\n return this.#retryer.promise\n } else if (error.revert) {\n // transform error into reverted state data\n // if the initial fetch was cancelled, we have no data, so we have\n // to get reject with a CancelledError\n if (this.state.data === undefined) {\n throw error\n }\n return this.state.data\n }\n }\n this.#dispatch({\n type: 'error',\n error: error as TError,\n })\n\n // Notify cache callback\n this.#cache.config.onError?.(\n error as any,\n this as Query,\n )\n this.#cache.config.onSettled?.(\n this.state.data,\n error as any,\n this as Query,\n )\n\n throw error // rethrow the error for further handling\n } finally {\n // Schedule query gc after fetching\n this.scheduleGc()\n }\n }\n\n #dispatch(action: Action): void {\n const reducer = (\n state: QueryState,\n ): QueryState => {\n switch (action.type) {\n case 'failed':\n return {\n ...state,\n fetchFailureCount: action.failureCount,\n fetchFailureReason: action.error,\n }\n case 'pause':\n return {\n ...state,\n fetchStatus: 'paused',\n }\n case 'continue':\n return {\n ...state,\n fetchStatus: 'fetching',\n }\n case 'fetch':\n return {\n ...state,\n ...fetchState(state.data, this.options),\n fetchMeta: action.meta ?? null,\n }\n case 'success':\n const newState = {\n ...state,\n ...successState(action.data, action.dataUpdatedAt),\n dataUpdateCount: state.dataUpdateCount + 1,\n ...(!action.manual && {\n fetchStatus: 'idle' as const,\n fetchFailureCount: 0,\n fetchFailureReason: null,\n }),\n }\n // If fetching ends successfully, we don't need revertState as a fallback anymore.\n // For manual updates, capture the state to revert to it in case of a cancellation.\n this.#revertState = action.manual ? newState : undefined\n\n return newState\n case 'error':\n const error = action.error\n return {\n ...state,\n error,\n errorUpdateCount: state.errorUpdateCount + 1,\n errorUpdatedAt: Date.now(),\n fetchFailureCount: state.fetchFailureCount + 1,\n fetchFailureReason: error,\n fetchStatus: 'idle',\n status: 'error',\n // flag existing data as invalidated if we get a background error\n // note that \"no data\" always means stale so we can set unconditionally here\n isInvalidated: true,\n }\n case 'invalidate':\n return {\n ...state,\n isInvalidated: true,\n }\n case 'setState':\n return {\n ...state,\n ...action.state,\n }\n }\n }\n\n this.state = reducer(this.state)\n\n notifyManager.batch(() => {\n this.observers.forEach((observer) => {\n observer.onQueryUpdate()\n })\n\n this.#cache.notify({ query: this, type: 'updated', action })\n })\n }\n}\n\nexport function fetchState<\n TQueryFnData,\n TError,\n TData,\n TQueryKey extends QueryKey,\n>(\n data: TData | undefined,\n options: QueryOptions,\n) {\n return {\n fetchFailureCount: 0,\n fetchFailureReason: null,\n fetchStatus: canFetch(options.networkMode) ? 'fetching' : 'paused',\n ...(data === undefined &&\n ({\n error: null,\n status: 'pending',\n } as const)),\n } as const\n}\n\nfunction successState(data: TData | undefined, dataUpdatedAt?: number) {\n return {\n data,\n dataUpdatedAt: dataUpdatedAt ?? Date.now(),\n error: null,\n isInvalidated: false,\n status: 'success' as const,\n }\n}\n\nfunction getDefaultState<\n TQueryFnData,\n TError,\n TData,\n TQueryKey extends QueryKey,\n>(\n options: QueryOptions,\n): QueryState {\n const data =\n typeof options.initialData === 'function'\n ? (options.initialData as InitialDataFunction)()\n : options.initialData\n\n const hasData = data !== undefined\n\n const initialDataUpdatedAt = hasData\n ? typeof options.initialDataUpdatedAt === 'function'\n ? options.initialDataUpdatedAt()\n : options.initialDataUpdatedAt\n : 0\n\n return {\n data,\n dataUpdateCount: 0,\n dataUpdatedAt: hasData ? (initialDataUpdatedAt ?? Date.now()) : 0,\n error: null,\n errorUpdateCount: 0,\n errorUpdatedAt: 0,\n fetchFailureCount: 0,\n fetchFailureReason: null,\n fetchMeta: null,\n isInvalidated: false,\n status: hasData ? 'success' : 'pending',\n fetchStatus: 'idle',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IACf,QAAQ,UAAU,YAAY;AAAA,IAC9B,aAAa;AAAA,EACf;AACF;","names":["queryFnContext","context"]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/queryCache.cjs b/node_modules/@tanstack/query-core/build/modern/queryCache.cjs deleted file mode 100644 index ce63393..0000000 --- a/node_modules/@tanstack/query-core/build/modern/queryCache.cjs +++ /dev/null @@ -1,122 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// src/queryCache.ts -var queryCache_exports = {}; -__export(queryCache_exports, { - QueryCache: () => QueryCache -}); -module.exports = __toCommonJS(queryCache_exports); -var import_utils = require("./utils.cjs"); -var import_query = require("./query.cjs"); -var import_notifyManager = require("./notifyManager.cjs"); -var import_subscribable = require("./subscribable.cjs"); -var QueryCache = class extends import_subscribable.Subscribable { - constructor(config = {}) { - super(); - this.config = config; - this.#queries = /* @__PURE__ */ new Map(); - } - #queries; - build(client, options, state) { - const queryKey = options.queryKey; - const queryHash = options.queryHash ?? (0, import_utils.hashQueryKeyByOptions)(queryKey, options); - let query = this.get(queryHash); - if (!query) { - query = new import_query.Query({ - client, - queryKey, - queryHash, - options: client.defaultQueryOptions(options), - state, - defaultOptions: client.getQueryDefaults(queryKey) - }); - this.add(query); - } - return query; - } - add(query) { - if (!this.#queries.has(query.queryHash)) { - this.#queries.set(query.queryHash, query); - this.notify({ - type: "added", - query - }); - } - } - remove(query) { - const queryInMap = this.#queries.get(query.queryHash); - if (queryInMap) { - query.destroy(); - if (queryInMap === query) { - this.#queries.delete(query.queryHash); - } - this.notify({ type: "removed", query }); - } - } - clear() { - import_notifyManager.notifyManager.batch(() => { - this.getAll().forEach((query) => { - this.remove(query); - }); - }); - } - get(queryHash) { - return this.#queries.get(queryHash); - } - getAll() { - return [...this.#queries.values()]; - } - find(filters) { - const defaultedFilters = { exact: true, ...filters }; - return this.getAll().find( - (query) => (0, import_utils.matchQuery)(defaultedFilters, query) - ); - } - findAll(filters = {}) { - const queries = this.getAll(); - return Object.keys(filters).length > 0 ? queries.filter((query) => (0, import_utils.matchQuery)(filters, query)) : queries; - } - notify(event) { - import_notifyManager.notifyManager.batch(() => { - this.listeners.forEach((listener) => { - listener(event); - }); - }); - } - onFocus() { - import_notifyManager.notifyManager.batch(() => { - this.getAll().forEach((query) => { - query.onFocus(); - }); - }); - } - onOnline() { - import_notifyManager.notifyManager.batch(() => { - this.getAll().forEach((query) => { - query.onOnline(); - }); - }); - } -}; -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - QueryCache -}); -//# sourceMappingURL=queryCache.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/queryCache.cjs.map b/node_modules/@tanstack/query-core/build/modern/queryCache.cjs.map deleted file mode 100644 index 7694aa1..0000000 --- a/node_modules/@tanstack/query-core/build/modern/queryCache.cjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/queryCache.ts"],"sourcesContent":["import { hashQueryKeyByOptions, matchQuery } from './utils'\nimport { Query } from './query'\nimport { notifyManager } from './notifyManager'\nimport { Subscribable } from './subscribable'\nimport type { QueryFilters } from './utils'\nimport type { Action, QueryState } from './query'\nimport type {\n DefaultError,\n NotifyEvent,\n QueryKey,\n QueryOptions,\n WithRequired,\n} from './types'\nimport type { QueryClient } from './queryClient'\nimport type { QueryObserver } from './queryObserver'\n\n// TYPES\n\ninterface QueryCacheConfig {\n onError?: (\n error: DefaultError,\n query: Query,\n ) => void\n onSuccess?: (data: unknown, query: Query) => void\n onSettled?: (\n data: unknown | undefined,\n error: DefaultError | null,\n query: Query,\n ) => void\n}\n\ninterface NotifyEventQueryAdded extends NotifyEvent {\n type: 'added'\n query: Query\n}\n\ninterface NotifyEventQueryRemoved extends NotifyEvent {\n type: 'removed'\n query: Query\n}\n\ninterface NotifyEventQueryUpdated extends NotifyEvent {\n type: 'updated'\n query: Query\n action: Action\n}\n\ninterface NotifyEventQueryObserverAdded extends NotifyEvent {\n type: 'observerAdded'\n query: Query\n observer: QueryObserver\n}\n\ninterface NotifyEventQueryObserverRemoved extends NotifyEvent {\n type: 'observerRemoved'\n query: Query\n observer: QueryObserver\n}\n\ninterface NotifyEventQueryObserverResultsUpdated extends NotifyEvent {\n type: 'observerResultsUpdated'\n query: Query\n}\n\ninterface NotifyEventQueryObserverOptionsUpdated extends NotifyEvent {\n type: 'observerOptionsUpdated'\n query: Query\n observer: QueryObserver\n}\n\nexport type QueryCacheNotifyEvent =\n | NotifyEventQueryAdded\n | NotifyEventQueryRemoved\n | NotifyEventQueryUpdated\n | NotifyEventQueryObserverAdded\n | NotifyEventQueryObserverRemoved\n | NotifyEventQueryObserverResultsUpdated\n | NotifyEventQueryObserverOptionsUpdated\n\ntype QueryCacheListener = (event: QueryCacheNotifyEvent) => void\n\nexport interface QueryStore {\n has: (queryHash: string) => boolean\n set: (queryHash: string, query: Query) => void\n get: (queryHash: string) => Query | undefined\n delete: (queryHash: string) => void\n values: () => IterableIterator\n}\n\n// CLASS\n\nexport class QueryCache extends Subscribable {\n #queries: QueryStore\n\n constructor(public config: QueryCacheConfig = {}) {\n super()\n this.#queries = new Map()\n }\n\n build<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n >(\n client: QueryClient,\n options: WithRequired<\n QueryOptions,\n 'queryKey'\n >,\n state?: QueryState,\n ): Query {\n const queryKey = options.queryKey\n const queryHash =\n options.queryHash ?? hashQueryKeyByOptions(queryKey, options)\n let query = this.get(queryHash)\n\n if (!query) {\n query = new Query({\n client,\n queryKey,\n queryHash,\n options: client.defaultQueryOptions(options),\n state,\n defaultOptions: client.getQueryDefaults(queryKey),\n })\n this.add(query)\n }\n\n return query\n }\n\n add(query: Query): void {\n if (!this.#queries.has(query.queryHash)) {\n this.#queries.set(query.queryHash, query)\n\n this.notify({\n type: 'added',\n query,\n })\n }\n }\n\n remove(query: Query): void {\n const queryInMap = this.#queries.get(query.queryHash)\n\n if (queryInMap) {\n query.destroy()\n\n if (queryInMap === query) {\n this.#queries.delete(query.queryHash)\n }\n\n this.notify({ type: 'removed', query })\n }\n }\n\n clear(): void {\n notifyManager.batch(() => {\n this.getAll().forEach((query) => {\n this.remove(query)\n })\n })\n }\n\n get<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n >(\n queryHash: string,\n ): Query | undefined {\n return this.#queries.get(queryHash) as\n | Query\n | undefined\n }\n\n getAll(): Array {\n return [...this.#queries.values()]\n }\n\n find(\n filters: WithRequired,\n ): Query | undefined {\n const defaultedFilters = { exact: true, ...filters }\n\n return this.getAll().find((query) =>\n matchQuery(defaultedFilters, query),\n ) as Query | undefined\n }\n\n findAll(filters: QueryFilters = {}): Array {\n const queries = this.getAll()\n return Object.keys(filters).length > 0\n ? queries.filter((query) => matchQuery(filters, query))\n : queries\n }\n\n notify(event: QueryCacheNotifyEvent): void {\n notifyManager.batch(() => {\n this.listeners.forEach((listener) => {\n listener(event)\n })\n })\n }\n\n onFocus(): void {\n notifyManager.batch(() => {\n this.getAll().forEach((query) => {\n query.onFocus()\n })\n })\n }\n\n onOnline(): void {\n notifyManager.batch(() => {\n this.getAll().forEach((query) => {\n query.onOnline()\n })\n })\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mB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AEA,IAME,WAC2D;AAC3D,WAAO,KAAK,SAAS,IAAI,SAAS;AAAA,EAGpC;AAAA,EAEA,SAAuB;AACrB,WAAO,CAAC,GAAG,KAAK,SAAS,OAAO,CAAC;AAAA,EACnC;AAAA,EAEA,KACE,SACgD;AAChD,UAAM,mBAAmB,EAAE,OAAO,MAAM,GAAG,QAAQ;AAEnD,WAAO,KAAK,OAAO,EAAE;AAAA,MAAK,CAAC,cACzB,yBAAW,kBAAkB,KAAK;AAAA,IACpC;AAAA,EACF;AAAA,EAEA,QAAQ,UAA6B,CAAC,GAAiB;AACrD,UAAM,UAAU,KAAK,OAAO;AAC5B,WAAO,OAAO,KAAK,OAAO,EAAE,SAAS,IACjC,QAAQ,OAAO,CAAC,cAAU,yBAAW,SAAS,KAAK,CAAC,IACpD;AAAA,EACN;AAAA,EAEA,OAAO,OAAoC;AACzC,uCAAc,MAAM,MAAM;AACxB,WAAK,UAAU,QAAQ,CAAC,aAAa;AACnC,iBAAS,KAAK;AAAA,MAChB,CAAC;AAAA,IACH,CAAC;AAAA,EACH;AAAA,EAEA,UAAgB;AACd,uCAAc,MAAM,MAAM;AACxB,WAAK,OAAO,EAAE,QAAQ,CAAC,UAAU;AAC/B,cAAM,QAAQ;AAAA,MAChB,CAAC;AAAA,IACH,CAAC;AAAA,EACH;AAAA,EAEA,WAAiB;AACf,uCAAc,MAAM,MAAM;AACxB,WAAK,OAAO,EAAE,QAAQ,CAAC,UAAU;AAC/B,cAAM,SAAS;AAAA,MACjB,CAAC;AAAA,IACH,CAAC;AAAA,EACH;AACF;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/queryCache.d.cts b/node_modules/@tanstack/query-core/build/modern/queryCache.d.cts deleted file mode 100644 index 7c0bfb5..0000000 --- a/node_modules/@tanstack/query-core/build/modern/queryCache.d.cts +++ /dev/null @@ -1,3 +0,0 @@ -export { Q as QueryCache, f as QueryCacheNotifyEvent, bB as QueryStore } from './hydration-uphG6M-i.cjs'; -import './subscribable.cjs'; -import './removable.cjs'; diff --git a/node_modules/@tanstack/query-core/build/modern/queryCache.d.ts b/node_modules/@tanstack/query-core/build/modern/queryCache.d.ts deleted file mode 100644 index 3e9dd5f..0000000 --- a/node_modules/@tanstack/query-core/build/modern/queryCache.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export { Q as QueryCache, f as QueryCacheNotifyEvent, bB as QueryStore } from './hydration-BlEVG2Lp.js'; -import './subscribable.js'; -import './removable.js'; diff --git a/node_modules/@tanstack/query-core/build/modern/queryCache.js b/node_modules/@tanstack/query-core/build/modern/queryCache.js deleted file mode 100644 index 07bd9c1..0000000 --- a/node_modules/@tanstack/query-core/build/modern/queryCache.js +++ /dev/null @@ -1,97 +0,0 @@ -// src/queryCache.ts -import { hashQueryKeyByOptions, matchQuery } from "./utils.js"; -import { Query } from "./query.js"; -import { notifyManager } from "./notifyManager.js"; -import { Subscribable } from "./subscribable.js"; -var QueryCache = class extends Subscribable { - constructor(config = {}) { - super(); - this.config = config; - this.#queries = /* @__PURE__ */ new Map(); - } - #queries; - build(client, options, state) { - const queryKey = options.queryKey; - const queryHash = options.queryHash ?? hashQueryKeyByOptions(queryKey, options); - let query = this.get(queryHash); - if (!query) { - query = new Query({ - client, - queryKey, - queryHash, - options: client.defaultQueryOptions(options), - state, - defaultOptions: client.getQueryDefaults(queryKey) - }); - this.add(query); - } - return query; - } - add(query) { - if (!this.#queries.has(query.queryHash)) { - this.#queries.set(query.queryHash, query); - this.notify({ - type: "added", - query - }); - } - } - remove(query) { - const queryInMap = this.#queries.get(query.queryHash); - if (queryInMap) { - query.destroy(); - if (queryInMap === query) { - this.#queries.delete(query.queryHash); - } - this.notify({ type: "removed", query }); - } - } - clear() { - notifyManager.batch(() => { - this.getAll().forEach((query) => { - this.remove(query); - }); - }); - } - get(queryHash) { - return this.#queries.get(queryHash); - } - getAll() { - return [...this.#queries.values()]; - } - find(filters) { - const defaultedFilters = { exact: true, ...filters }; - return this.getAll().find( - (query) => matchQuery(defaultedFilters, query) - ); - } - findAll(filters = {}) { - const queries = this.getAll(); - return Object.keys(filters).length > 0 ? queries.filter((query) => matchQuery(filters, query)) : queries; - } - notify(event) { - notifyManager.batch(() => { - this.listeners.forEach((listener) => { - listener(event); - }); - }); - } - onFocus() { - notifyManager.batch(() => { - this.getAll().forEach((query) => { - query.onFocus(); - }); - }); - } - onOnline() { - notifyManager.batch(() => { - this.getAll().forEach((query) => { - query.onOnline(); - }); - }); - } -}; -export { - QueryCache -}; -//# sourceMappingURL=queryCache.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/queryCache.js.map b/node_modules/@tanstack/query-core/build/modern/queryCache.js.map deleted file mode 100644 index 6b05a5d..0000000 --- a/node_modules/@tanstack/query-core/build/modern/queryCache.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/queryCache.ts"],"sourcesContent":["import { hashQueryKeyByOptions, matchQuery } from './utils'\nimport { Query } from './query'\nimport { notifyManager } from './notifyManager'\nimport { Subscribable } from './subscribable'\nimport type { QueryFilters } from './utils'\nimport type { Action, QueryState } from './query'\nimport type {\n DefaultError,\n NotifyEvent,\n QueryKey,\n QueryOptions,\n WithRequired,\n} from './types'\nimport type { QueryClient } from './queryClient'\nimport type { QueryObserver } from './queryObserver'\n\n// TYPES\n\ninterface QueryCacheConfig {\n onError?: (\n error: DefaultError,\n query: Query,\n ) => void\n onSuccess?: (data: unknown, query: Query) => void\n onSettled?: (\n data: unknown | undefined,\n error: DefaultError | null,\n query: Query,\n ) => void\n}\n\ninterface NotifyEventQueryAdded extends NotifyEvent {\n type: 'added'\n query: Query\n}\n\ninterface NotifyEventQueryRemoved extends NotifyEvent {\n type: 'removed'\n query: Query\n}\n\ninterface NotifyEventQueryUpdated extends NotifyEvent {\n type: 'updated'\n query: Query\n action: Action\n}\n\ninterface NotifyEventQueryObserverAdded extends NotifyEvent {\n type: 'observerAdded'\n query: Query\n observer: QueryObserver\n}\n\ninterface NotifyEventQueryObserverRemoved extends NotifyEvent {\n type: 'observerRemoved'\n query: Query\n observer: QueryObserver\n}\n\ninterface NotifyEventQueryObserverResultsUpdated extends NotifyEvent {\n type: 'observerResultsUpdated'\n query: Query\n}\n\ninterface NotifyEventQueryObserverOptionsUpdated extends NotifyEvent {\n type: 'observerOptionsUpdated'\n query: Query\n observer: QueryObserver\n}\n\nexport type QueryCacheNotifyEvent =\n | NotifyEventQueryAdded\n | NotifyEventQueryRemoved\n | NotifyEventQueryUpdated\n | NotifyEventQueryObserverAdded\n | NotifyEventQueryObserverRemoved\n | NotifyEventQueryObserverResultsUpdated\n | NotifyEventQueryObserverOptionsUpdated\n\ntype QueryCacheListener = (event: QueryCacheNotifyEvent) => void\n\nexport interface QueryStore {\n has: (queryHash: string) => boolean\n set: (queryHash: string, query: Query) => void\n get: (queryHash: string) => Query | undefined\n delete: (queryHash: string) => void\n values: () => IterableIterator\n}\n\n// CLASS\n\nexport class QueryCache extends Subscribable {\n #queries: QueryStore\n\n constructor(public config: QueryCacheConfig = {}) {\n super()\n this.#queries = new Map()\n }\n\n build<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n >(\n client: QueryClient,\n options: WithRequired<\n QueryOptions,\n 'queryKey'\n >,\n state?: QueryState,\n ): Query {\n const queryKey = options.queryKey\n const queryHash =\n options.queryHash ?? hashQueryKeyByOptions(queryKey, options)\n let query = this.get(queryHash)\n\n if (!query) {\n query = new Query({\n client,\n queryKey,\n queryHash,\n options: client.defaultQueryOptions(options),\n state,\n defaultOptions: client.getQueryDefaults(queryKey),\n })\n this.add(query)\n }\n\n return query\n }\n\n add(query: Query): void {\n if (!this.#queries.has(query.queryHash)) {\n this.#queries.set(query.queryHash, query)\n\n this.notify({\n type: 'added',\n query,\n })\n }\n }\n\n remove(query: Query): void {\n const queryInMap = this.#queries.get(query.queryHash)\n\n if (queryInMap) {\n query.destroy()\n\n if (queryInMap === query) {\n this.#queries.delete(query.queryHash)\n }\n\n this.notify({ type: 'removed', query })\n }\n }\n\n clear(): void {\n notifyManager.batch(() => {\n this.getAll().forEach((query) => {\n this.remove(query)\n })\n })\n }\n\n get<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n >(\n queryHash: string,\n ): Query | undefined {\n return this.#queries.get(queryHash) as\n | Query\n | undefined\n }\n\n getAll(): Array {\n return [...this.#queries.values()]\n }\n\n find(\n filters: WithRequired,\n ): Query | undefined {\n const defaultedFilters = { exact: true, ...filters }\n\n return this.getAll().find((query) =>\n matchQuery(defaultedFilters, query),\n ) as Query | undefined\n }\n\n findAll(filters: QueryFilters = {}): Array {\n const queries = this.getAll()\n return Object.keys(filters).length > 0\n ? queries.filter((query) => matchQuery(filters, query))\n : queries\n }\n\n notify(event: QueryCacheNotifyEvent): void {\n notifyManager.batch(() => {\n this.listeners.forEach((listener) => {\n listener(event)\n })\n })\n }\n\n onFocus(): void {\n notifyManager.batch(() => {\n this.getAll().forEach((query) => {\n query.onFocus()\n })\n })\n }\n\n onOnline(): void {\n notifyManager.batch(() => {\n this.getAll().forEach((query) => {\n query.onOnline()\n })\n })\n }\n}\n"],"mappings":";AAAA,SAAS,uBAAuB,kBAAkB;AAClD,SAAS,aAAa;AACtB,SAAS,qBAAqB;AAC9B,SAAS,oBAAoB;AAwFtB,IAAM,aAAN,cAAyB,aAAiC;AAAA,EAG/D,YAAmB,SAA2B,CAAC,GAAG;AAChD,UAAM;AADW;AAEjB,SAAK,WAAW,oBAAI,IAAmB;AAAA,EACzC;AAAA,EALA;AAAA,EAOA,MAME,QACA,SAIA,OAC+C;AAC/C,UAAM,WAAW,QAAQ;AACzB,UAAM,YACJ,QAAQ,aAAa,sBAAsB,UAAU,OAAO;AAC9D,QAAI,QAAQ,KAAK,IAA4C,SAAS;AAEtE,QAAI,CAAC,OAAO;AACV,cAAQ,IAAI,MAAM;AAAA,QAChB;AAAA,QACA;AAAA,QACA;AA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AAQ,OAAO,CAAC,UAAU,WAAW,SAAS,KAAK,CAAC,IACpD;AAAA,EACN;AAAA,EAEA,OAAO,OAAoC;AACzC,kBAAc,MAAM,MAAM;AACxB,WAAK,UAAU,QAAQ,CAAC,aAAa;AACnC,iBAAS,KAAK;AAAA,MAChB,CAAC;AAAA,IACH,CAAC;AAAA,EACH;AAAA,EAEA,UAAgB;AACd,kBAAc,MAAM,MAAM;AACxB,WAAK,OAAO,EAAE,QAAQ,CAAC,UAAU;AAC/B,cAAM,QAAQ;AAAA,MAChB,CAAC;AAAA,IACH,CAAC;AAAA,EACH;AAAA,EAEA,WAAiB;AACf,kBAAc,MAAM,MAAM;AACxB,WAAK,OAAO,EAAE,QAAQ,CAAC,UAAU;AAC/B,cAAM,SAAS;AAAA,MACjB,CAAC;AAAA,IACH,CAAC;AAAA,EACH;AACF;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/queryClient.cjs b/node_modules/@tanstack/query-core/build/modern/queryClient.cjs deleted file mode 100644 index 37e298a..0000000 --- a/node_modules/@tanstack/query-core/build/modern/queryClient.cjs +++ /dev/null @@ -1,322 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// src/queryClient.ts -var queryClient_exports = {}; -__export(queryClient_exports, { - QueryClient: () => QueryClient -}); -module.exports = __toCommonJS(queryClient_exports); -var import_utils = require("./utils.cjs"); -var import_queryCache = require("./queryCache.cjs"); -var import_mutationCache = require("./mutationCache.cjs"); -var import_focusManager = require("./focusManager.cjs"); -var import_onlineManager = require("./onlineManager.cjs"); -var import_notifyManager = require("./notifyManager.cjs"); -var import_infiniteQueryBehavior = require("./infiniteQueryBehavior.cjs"); -var QueryClient = class { - #queryCache; - #mutationCache; - #defaultOptions; - #queryDefaults; - #mutationDefaults; - #mountCount; - #unsubscribeFocus; - #unsubscribeOnline; - constructor(config = {}) { - this.#queryCache = config.queryCache || new import_queryCache.QueryCache(); - this.#mutationCache = config.mutationCache || new import_mutationCache.MutationCache(); - this.#defaultOptions = config.defaultOptions || {}; - this.#queryDefaults = /* @__PURE__ */ new Map(); - this.#mutationDefaults = /* @__PURE__ */ new Map(); - this.#mountCount = 0; - } - mount() { - this.#mountCount++; - if (this.#mountCount !== 1) return; - this.#unsubscribeFocus = import_focusManager.focusManager.subscribe(async (focused) => { - if (focused) { - await this.resumePausedMutations(); - this.#queryCache.onFocus(); - } - }); - this.#unsubscribeOnline = import_onlineManager.onlineManager.subscribe(async (online) => { - if (online) { - await this.resumePausedMutations(); - this.#queryCache.onOnline(); - } - }); - } - unmount() { - this.#mountCount--; - if (this.#mountCount !== 0) return; - this.#unsubscribeFocus?.(); - this.#unsubscribeFocus = void 0; - this.#unsubscribeOnline?.(); - this.#unsubscribeOnline = void 0; - } - isFetching(filters) { - return this.#queryCache.findAll({ ...filters, fetchStatus: "fetching" }).length; - } - isMutating(filters) { - return this.#mutationCache.findAll({ ...filters, status: "pending" }).length; - } - /** - * Imperative (non-reactive) way to retrieve data for a QueryKey. - * Should only be used in callbacks or functions where reading the latest data is necessary, e.g. for optimistic updates. - * - * Hint: Do not use this function inside a component, because it won't receive updates. - * Use `useQuery` to create a `QueryObserver` that subscribes to changes. - */ - getQueryData(queryKey) { - const options = this.defaultQueryOptions({ queryKey }); - return this.#queryCache.get(options.queryHash)?.state.data; - } - ensureQueryData(options) { - const defaultedOptions = this.defaultQueryOptions(options); - const query = this.#queryCache.build(this, defaultedOptions); - const cachedData = query.state.data; - if (cachedData === void 0) { - return this.fetchQuery(options); - } - if (options.revalidateIfStale && query.isStaleByTime((0, import_utils.resolveStaleTime)(defaultedOptions.staleTime, query))) { - void this.prefetchQuery(defaultedOptions); - } - return Promise.resolve(cachedData); - } - getQueriesData(filters) { - return this.#queryCache.findAll(filters).map(({ queryKey, state }) => { - const data = state.data; - return [queryKey, data]; - }); - } - setQueryData(queryKey, updater, options) { - const defaultedOptions = this.defaultQueryOptions({ queryKey }); - const query = this.#queryCache.get( - defaultedOptions.queryHash - ); - const prevData = query?.state.data; - const data = (0, import_utils.functionalUpdate)(updater, prevData); - if (data === void 0) { - return void 0; - } - return this.#queryCache.build(this, defaultedOptions).setData(data, { ...options, manual: true }); - } - setQueriesData(filters, updater, options) { - return import_notifyManager.notifyManager.batch( - () => this.#queryCache.findAll(filters).map(({ queryKey }) => [ - queryKey, - this.setQueryData(queryKey, updater, options) - ]) - ); - } - getQueryState(queryKey) { - const options = this.defaultQueryOptions({ queryKey }); - return this.#queryCache.get( - options.queryHash - )?.state; - } - removeQueries(filters) { - const queryCache = this.#queryCache; - import_notifyManager.notifyManager.batch(() => { - queryCache.findAll(filters).forEach((query) => { - queryCache.remove(query); - }); - }); - } - resetQueries(filters, options) { - const queryCache = this.#queryCache; - return import_notifyManager.notifyManager.batch(() => { - queryCache.findAll(filters).forEach((query) => { - query.reset(); - }); - return this.refetchQueries( - { - type: "active", - ...filters - }, - options - ); - }); - } - cancelQueries(filters, cancelOptions = {}) { - const defaultedCancelOptions = { revert: true, ...cancelOptions }; - const promises = import_notifyManager.notifyManager.batch( - () => this.#queryCache.findAll(filters).map((query) => query.cancel(defaultedCancelOptions)) - ); - return Promise.all(promises).then(import_utils.noop).catch(import_utils.noop); - } - invalidateQueries(filters, options = {}) { - return import_notifyManager.notifyManager.batch(() => { - this.#queryCache.findAll(filters).forEach((query) => { - query.invalidate(); - }); - if (filters?.refetchType === "none") { - return Promise.resolve(); - } - return this.refetchQueries( - { - ...filters, - type: filters?.refetchType ?? filters?.type ?? "active" - }, - options - ); - }); - } - refetchQueries(filters, options = {}) { - const fetchOptions = { - ...options, - cancelRefetch: options.cancelRefetch ?? true - }; - const promises = import_notifyManager.notifyManager.batch( - () => this.#queryCache.findAll(filters).filter((query) => !query.isDisabled() && !query.isStatic()).map((query) => { - let promise = query.fetch(void 0, fetchOptions); - if (!fetchOptions.throwOnError) { - promise = promise.catch(import_utils.noop); - } - return query.state.fetchStatus === "paused" ? Promise.resolve() : promise; - }) - ); - return Promise.all(promises).then(import_utils.noop); - } - fetchQuery(options) { - const defaultedOptions = this.defaultQueryOptions(options); - if (defaultedOptions.retry === void 0) { - defaultedOptions.retry = false; - } - const query = this.#queryCache.build(this, defaultedOptions); - return query.isStaleByTime( - (0, import_utils.resolveStaleTime)(defaultedOptions.staleTime, query) - ) ? query.fetch(defaultedOptions) : Promise.resolve(query.state.data); - } - prefetchQuery(options) { - return this.fetchQuery(options).then(import_utils.noop).catch(import_utils.noop); - } - fetchInfiniteQuery(options) { - options.behavior = (0, import_infiniteQueryBehavior.infiniteQueryBehavior)(options.pages); - return this.fetchQuery(options); - } - prefetchInfiniteQuery(options) { - return this.fetchInfiniteQuery(options).then(import_utils.noop).catch(import_utils.noop); - } - ensureInfiniteQueryData(options) { - options.behavior = (0, import_infiniteQueryBehavior.infiniteQueryBehavior)(options.pages); - return this.ensureQueryData(options); - } - resumePausedMutations() { - if (import_onlineManager.onlineManager.isOnline()) { - return this.#mutationCache.resumePausedMutations(); - } - return Promise.resolve(); - } - getQueryCache() { - return this.#queryCache; - } - getMutationCache() { - return this.#mutationCache; - } - getDefaultOptions() { - return this.#defaultOptions; - } - setDefaultOptions(options) { - this.#defaultOptions = options; - } - setQueryDefaults(queryKey, options) { - this.#queryDefaults.set((0, import_utils.hashKey)(queryKey), { - queryKey, - defaultOptions: options - }); - } - getQueryDefaults(queryKey) { - const defaults = [...this.#queryDefaults.values()]; - const result = {}; - defaults.forEach((queryDefault) => { - if ((0, import_utils.partialMatchKey)(queryKey, queryDefault.queryKey)) { - Object.assign(result, queryDefault.defaultOptions); - } - }); - return result; - } - setMutationDefaults(mutationKey, options) { - this.#mutationDefaults.set((0, import_utils.hashKey)(mutationKey), { - mutationKey, - defaultOptions: options - }); - } - getMutationDefaults(mutationKey) { - const defaults = [...this.#mutationDefaults.values()]; - const result = {}; - defaults.forEach((queryDefault) => { - if ((0, import_utils.partialMatchKey)(mutationKey, queryDefault.mutationKey)) { - Object.assign(result, queryDefault.defaultOptions); - } - }); - return result; - } - defaultQueryOptions(options) { - if (options._defaulted) { - return options; - } - const defaultedOptions = { - ...this.#defaultOptions.queries, - ...this.getQueryDefaults(options.queryKey), - ...options, - _defaulted: true - }; - if (!defaultedOptions.queryHash) { - defaultedOptions.queryHash = (0, import_utils.hashQueryKeyByOptions)( - defaultedOptions.queryKey, - defaultedOptions - ); - } - if (defaultedOptions.refetchOnReconnect === void 0) { - defaultedOptions.refetchOnReconnect = defaultedOptions.networkMode !== "always"; - } - if (defaultedOptions.throwOnError === void 0) { - defaultedOptions.throwOnError = !!defaultedOptions.suspense; - } - if (!defaultedOptions.networkMode && defaultedOptions.persister) { - defaultedOptions.networkMode = "offlineFirst"; - } - if (defaultedOptions.queryFn === import_utils.skipToken) { - defaultedOptions.enabled = false; - } - return defaultedOptions; - } - defaultMutationOptions(options) { - if (options?._defaulted) { - return options; - } - return { - ...this.#defaultOptions.mutations, - ...options?.mutationKey && this.getMutationDefaults(options.mutationKey), - ...options, - _defaulted: true - }; - } - clear() { - this.#queryCache.clear(); - this.#mutationCache.clear(); - } -}; -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - QueryClient -}); -//# sourceMappingURL=queryClient.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/queryClient.cjs.map b/node_modules/@tanstack/query-core/build/modern/queryClient.cjs.map deleted file mode 100644 index 423c8cf..0000000 --- a/node_modules/@tanstack/query-core/build/modern/queryClient.cjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/queryClient.ts"],"sourcesContent":["import {\n functionalUpdate,\n hashKey,\n hashQueryKeyByOptions,\n noop,\n partialMatchKey,\n resolveStaleTime,\n skipToken,\n} from './utils'\nimport { QueryCache } from './queryCache'\nimport { MutationCache } from './mutationCache'\nimport { focusManager } from './focusManager'\nimport { onlineManager } from './onlineManager'\nimport { notifyManager } from './notifyManager'\nimport { infiniteQueryBehavior } from './infiniteQueryBehavior'\nimport type {\n CancelOptions,\n DefaultError,\n DefaultOptions,\n DefaultedQueryObserverOptions,\n EnsureInfiniteQueryDataOptions,\n EnsureQueryDataOptions,\n FetchInfiniteQueryOptions,\n FetchQueryOptions,\n InferDataFromTag,\n InferErrorFromTag,\n InfiniteData,\n InvalidateOptions,\n InvalidateQueryFilters,\n MutationKey,\n MutationObserverOptions,\n MutationOptions,\n NoInfer,\n OmitKeyof,\n QueryClientConfig,\n QueryKey,\n QueryObserverOptions,\n QueryOptions,\n RefetchOptions,\n RefetchQueryFilters,\n ResetOptions,\n SetDataOptions,\n} from './types'\nimport type { QueryState } from './query'\nimport type { MutationFilters, QueryFilters, Updater } from './utils'\n\n// TYPES\n\ninterface QueryDefaults {\n queryKey: QueryKey\n defaultOptions: OmitKeyof, 'queryKey'>\n}\n\ninterface MutationDefaults {\n mutationKey: MutationKey\n defaultOptions: MutationOptions\n}\n\n// CLASS\n\nexport class QueryClient {\n #queryCache: QueryCache\n #mutationCache: MutationCache\n #defaultOptions: DefaultOptions\n #queryDefaults: Map\n #mutationDefaults: Map\n #mountCount: number\n #unsubscribeFocus?: () => void\n #unsubscribeOnline?: () => void\n\n constructor(config: QueryClientConfig = {}) {\n this.#queryCache = config.queryCache || new QueryCache()\n this.#mutationCache = config.mutationCache || new MutationCache()\n this.#defaultOptions = config.defaultOptions || {}\n this.#queryDefaults = new Map()\n this.#mutationDefaults = new Map()\n this.#mountCount = 0\n }\n\n mount(): void {\n this.#mountCount++\n if (this.#mountCount !== 1) return\n\n this.#unsubscribeFocus = focusManager.subscribe(async (focused) => {\n if (focused) {\n await this.resumePausedMutations()\n this.#queryCache.onFocus()\n }\n })\n this.#unsubscribeOnline = onlineManager.subscribe(async (online) => {\n if (online) {\n await this.resumePausedMutations()\n this.#queryCache.onOnline()\n }\n })\n }\n\n unmount(): void {\n this.#mountCount--\n if (this.#mountCount !== 0) return\n\n this.#unsubscribeFocus?.()\n this.#unsubscribeFocus = undefined\n\n this.#unsubscribeOnline?.()\n this.#unsubscribeOnline = undefined\n }\n\n isFetching = QueryFilters>(\n filters?: TQueryFilters,\n ): number {\n return this.#queryCache.findAll({ ...filters, fetchStatus: 'fetching' })\n .length\n }\n\n isMutating<\n TMutationFilters extends MutationFilters = MutationFilters,\n >(filters?: TMutationFilters): number {\n return this.#mutationCache.findAll({ ...filters, status: 'pending' }).length\n }\n\n /**\n * Imperative (non-reactive) way to retrieve data for a QueryKey.\n * Should only be used in callbacks or functions where reading the latest data is necessary, e.g. for optimistic updates.\n *\n * Hint: Do not use this function inside a component, because it won't receive updates.\n * Use `useQuery` to create a `QueryObserver` that subscribes to changes.\n */\n getQueryData<\n TQueryFnData = unknown,\n TTaggedQueryKey extends QueryKey = QueryKey,\n TInferredQueryFnData = InferDataFromTag,\n >(queryKey: TTaggedQueryKey): TInferredQueryFnData | undefined {\n const options = this.defaultQueryOptions({ queryKey })\n\n return this.#queryCache.get(options.queryHash)?.state\n .data\n }\n\n ensureQueryData<\n TQueryFnData,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n >(\n options: EnsureQueryDataOptions,\n ): Promise {\n const defaultedOptions = this.defaultQueryOptions(options)\n const query = this.#queryCache.build(this, defaultedOptions)\n const cachedData = query.state.data\n\n if (cachedData === undefined) {\n return this.fetchQuery(options)\n }\n\n if (\n options.revalidateIfStale &&\n query.isStaleByTime(resolveStaleTime(defaultedOptions.staleTime, query))\n ) {\n void this.prefetchQuery(defaultedOptions)\n }\n\n return Promise.resolve(cachedData)\n }\n\n getQueriesData<\n TQueryFnData = unknown,\n TQueryFilters extends QueryFilters = QueryFilters,\n >(filters: TQueryFilters): Array<[QueryKey, TQueryFnData | undefined]> {\n return this.#queryCache.findAll(filters).map(({ queryKey, state }) => {\n const data = state.data as TQueryFnData | undefined\n return [queryKey, data]\n })\n }\n\n setQueryData<\n TQueryFnData = unknown,\n TTaggedQueryKey extends QueryKey = QueryKey,\n TInferredQueryFnData = InferDataFromTag,\n >(\n queryKey: TTaggedQueryKey,\n updater: Updater<\n NoInfer | undefined,\n NoInfer | undefined\n >,\n options?: SetDataOptions,\n ): NoInfer | undefined {\n const defaultedOptions = this.defaultQueryOptions<\n any,\n any,\n unknown,\n any,\n QueryKey\n >({ queryKey })\n\n const query = this.#queryCache.get(\n defaultedOptions.queryHash,\n )\n const prevData = query?.state.data\n const data = functionalUpdate(updater, prevData)\n\n if (data === undefined) {\n return undefined\n }\n\n return this.#queryCache\n .build(this, defaultedOptions)\n .setData(data, { ...options, manual: true })\n }\n\n setQueriesData<\n TQueryFnData,\n TQueryFilters extends QueryFilters = QueryFilters,\n >(\n filters: TQueryFilters,\n updater: Updater<\n NoInfer | undefined,\n NoInfer | undefined\n >,\n options?: SetDataOptions,\n ): Array<[QueryKey, TQueryFnData | undefined]> {\n return notifyManager.batch(() =>\n this.#queryCache\n .findAll(filters)\n .map(({ queryKey }) => [\n queryKey,\n this.setQueryData(queryKey, updater, options),\n ]),\n )\n }\n\n getQueryState<\n TQueryFnData = unknown,\n TError = DefaultError,\n TTaggedQueryKey extends QueryKey = QueryKey,\n TInferredQueryFnData = InferDataFromTag,\n TInferredError = InferErrorFromTag,\n >(\n queryKey: TTaggedQueryKey,\n ): QueryState | undefined {\n const options = this.defaultQueryOptions({ queryKey })\n return this.#queryCache.get(\n options.queryHash,\n )?.state\n }\n\n removeQueries(\n filters?: QueryFilters,\n ): void {\n const queryCache = this.#queryCache\n notifyManager.batch(() => {\n queryCache.findAll(filters).forEach((query) => {\n queryCache.remove(query)\n })\n })\n }\n\n resetQueries(\n filters?: QueryFilters,\n options?: ResetOptions,\n ): Promise {\n const queryCache = this.#queryCache\n\n return notifyManager.batch(() => {\n queryCache.findAll(filters).forEach((query) => {\n query.reset()\n })\n return this.refetchQueries(\n {\n type: 'active',\n ...filters,\n },\n options,\n )\n })\n }\n\n cancelQueries(\n filters?: QueryFilters,\n cancelOptions: CancelOptions = {},\n ): Promise {\n const defaultedCancelOptions = { revert: true, ...cancelOptions }\n\n const promises = notifyManager.batch(() =>\n this.#queryCache\n .findAll(filters)\n .map((query) => query.cancel(defaultedCancelOptions)),\n )\n\n return Promise.all(promises).then(noop).catch(noop)\n }\n\n invalidateQueries(\n filters?: InvalidateQueryFilters,\n options: InvalidateOptions = {},\n ): Promise {\n return notifyManager.batch(() => {\n this.#queryCache.findAll(filters).forEach((query) => {\n query.invalidate()\n })\n\n if (filters?.refetchType === 'none') {\n return Promise.resolve()\n }\n return this.refetchQueries(\n {\n ...filters,\n type: filters?.refetchType ?? filters?.type ?? 'active',\n },\n options,\n )\n })\n }\n\n refetchQueries(\n filters?: RefetchQueryFilters,\n options: RefetchOptions = {},\n ): Promise {\n const fetchOptions = {\n ...options,\n cancelRefetch: options.cancelRefetch ?? true,\n }\n const promises = notifyManager.batch(() =>\n this.#queryCache\n .findAll(filters)\n .filter((query) => !query.isDisabled() && !query.isStatic())\n .map((query) => {\n let promise = query.fetch(undefined, fetchOptions)\n if (!fetchOptions.throwOnError) {\n promise = promise.catch(noop)\n }\n return query.state.fetchStatus === 'paused'\n ? Promise.resolve()\n : promise\n }),\n )\n\n return Promise.all(promises).then(noop)\n }\n\n fetchQuery<\n TQueryFnData,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = never,\n >(\n options: FetchQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n ): Promise {\n const defaultedOptions = this.defaultQueryOptions(options)\n\n // https://github.com/tannerlinsley/react-query/issues/652\n if (defaultedOptions.retry === undefined) {\n defaultedOptions.retry = false\n }\n\n const query = this.#queryCache.build(this, defaultedOptions)\n\n return query.isStaleByTime(\n resolveStaleTime(defaultedOptions.staleTime, query),\n )\n ? query.fetch(defaultedOptions)\n : Promise.resolve(query.state.data as TData)\n }\n\n prefetchQuery<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n >(\n options: FetchQueryOptions,\n ): Promise {\n return this.fetchQuery(options).then(noop).catch(noop)\n }\n\n fetchInfiniteQuery<\n TQueryFnData,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n >(\n options: FetchInfiniteQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n ): Promise> {\n options.behavior = infiniteQueryBehavior<\n TQueryFnData,\n TError,\n TData,\n TPageParam\n >(options.pages)\n return this.fetchQuery(options as any)\n }\n\n prefetchInfiniteQuery<\n TQueryFnData,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n >(\n options: FetchInfiniteQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n ): Promise {\n return this.fetchInfiniteQuery(options).then(noop).catch(noop)\n }\n\n ensureInfiniteQueryData<\n TQueryFnData,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n >(\n options: EnsureInfiniteQueryDataOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n ): Promise> {\n options.behavior = infiniteQueryBehavior<\n TQueryFnData,\n TError,\n TData,\n TPageParam\n >(options.pages)\n\n return this.ensureQueryData(options as any)\n }\n\n resumePausedMutations(): Promise {\n if (onlineManager.isOnline()) {\n return this.#mutationCache.resumePausedMutations()\n }\n return Promise.resolve()\n }\n\n getQueryCache(): QueryCache {\n return this.#queryCache\n }\n\n getMutationCache(): MutationCache {\n return this.#mutationCache\n }\n\n getDefaultOptions(): DefaultOptions {\n return this.#defaultOptions\n }\n\n setDefaultOptions(options: DefaultOptions): void {\n this.#defaultOptions = options\n }\n\n setQueryDefaults<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryData = TQueryFnData,\n >(\n queryKey: QueryKey,\n options: Partial<\n OmitKeyof<\n QueryObserverOptions,\n 'queryKey'\n >\n >,\n ): void {\n this.#queryDefaults.set(hashKey(queryKey), {\n queryKey,\n defaultOptions: options,\n })\n }\n\n getQueryDefaults(\n queryKey: QueryKey,\n ): OmitKeyof, 'queryKey'> {\n const defaults = [...this.#queryDefaults.values()]\n\n const result: OmitKeyof<\n QueryObserverOptions,\n 'queryKey'\n > = {}\n\n defaults.forEach((queryDefault) => {\n if (partialMatchKey(queryKey, queryDefault.queryKey)) {\n Object.assign(result, queryDefault.defaultOptions)\n }\n })\n return result\n }\n\n setMutationDefaults<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n >(\n mutationKey: MutationKey,\n options: OmitKeyof<\n MutationObserverOptions,\n 'mutationKey'\n >,\n ): void {\n this.#mutationDefaults.set(hashKey(mutationKey), {\n mutationKey,\n defaultOptions: options,\n })\n }\n\n getMutationDefaults(\n mutationKey: MutationKey,\n ): OmitKeyof, 'mutationKey'> {\n const defaults = [...this.#mutationDefaults.values()]\n\n const result: OmitKeyof<\n MutationObserverOptions,\n 'mutationKey'\n > = {}\n\n defaults.forEach((queryDefault) => {\n if (partialMatchKey(mutationKey, queryDefault.mutationKey)) {\n Object.assign(result, queryDefault.defaultOptions)\n }\n })\n\n return result\n }\n\n defaultQueryOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = never,\n >(\n options:\n | QueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey,\n TPageParam\n >\n | DefaultedQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >,\n ): DefaultedQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n > {\n if (options._defaulted) {\n return options as DefaultedQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >\n }\n\n const defaultedOptions = {\n ...this.#defaultOptions.queries,\n ...this.getQueryDefaults(options.queryKey),\n ...options,\n _defaulted: true,\n }\n\n if (!defaultedOptions.queryHash) {\n defaultedOptions.queryHash = hashQueryKeyByOptions(\n defaultedOptions.queryKey,\n defaultedOptions,\n )\n }\n\n // dependent default values\n if (defaultedOptions.refetchOnReconnect === undefined) {\n defaultedOptions.refetchOnReconnect =\n defaultedOptions.networkMode !== 'always'\n }\n if (defaultedOptions.throwOnError === undefined) {\n defaultedOptions.throwOnError = !!defaultedOptions.suspense\n }\n\n if (!defaultedOptions.networkMode && defaultedOptions.persister) {\n defaultedOptions.networkMode = 'offlineFirst'\n }\n\n if (defaultedOptions.queryFn === skipToken) {\n defaultedOptions.enabled = false\n }\n\n return defaultedOptions as DefaultedQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >\n }\n\n defaultMutationOptions>(\n options?: T,\n ): T {\n if (options?._defaulted) {\n return options\n }\n return {\n ...this.#defaultOptions.mutations,\n ...(options?.mutationKey &&\n this.getMutationDefaults(options.mutationKey)),\n ...options,\n _defaulted: true,\n } as T\n }\n\n clear(): void {\n this.#queryCache.clear()\n this.#mutationCache.clear()\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAQO;AACP,wBAA2B;AAC3B,2BAA8B;AAC9B,0BAA6B;AAC7B,2BAA8B;AAC9B,2BAA8B;AAC9B,mCA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C,iBAAiB;AACjC,cAAI,8BAAgB,aAAa,aAAa,WAAW,GAAG;AAC1D,eAAO,OAAO,QAAQ,aAAa,cAAc;AAAA,MACnD;AAAA,IACF,CAAC;AAED,WAAO;AAAA,EACT;AAAA,EAEA,oBAQE,SAsBA;AACA,QAAI,QAAQ,YAAY;AACtB,aAAO;AAAA,IAOT;AAEA,UAAM,mBAAmB;AAAA,MACvB,GAAG,KAAK,gBAAgB;AAAA,MACxB,GAAG,KAAK,iBAAiB,QAAQ,QAAQ;AAAA,MACzC,GAAG;AAAA,MACH,YAAY;AAAA,IACd;AAEA,QAAI,CAAC,iBAAiB,WAAW;AAC/B,uBAAiB,gBAAY;AAAA,QAC3B,iBAAiB;AAAA,QACjB;AAAA,MACF;AAAA,IACF;AAGA,QAAI,iBAAiB,uBAAuB,QAAW;AACrD,uBAAiB,qBACf,iBAAiB,gBAAgB;AAAA,IACrC;AACA,QAAI,iBAAiB,iBAAiB,QAAW;AAC/C,uBAAiB,eAAe,CAAC,CAAC,iBAAiB;AAAA,IACrD;AAEA,QAAI,CAAC,iBAAiB,eAAe,iBAAiB,WAAW;AAC/D,uBAAiB,cAAc;AAAA,IACjC;AAEA,QAAI,iBAAiB,YAAY,wBAAW;AAC1C,uBAAiB,UAAU;AAAA,IAC7B;AAEA,WAAO;AAAA,EAOT;AAAA,EAEA,uBACE,SACG;AACH,QAAI,SAAS,YAAY;AACvB,aAAO;AAAA,IACT;AACA,WAAO;AAAA,MACL,GAAG,KAAK,gBAAgB;AAAA,MACxB,GAAI,SAAS,eACX,KAAK,oBAAoB,QAAQ,WAAW;AAAA,MAC9C,GAAG;AAAA,MACH,YAAY;AAAA,IACd;AAAA,EACF;AAAA,EAEA,QAAc;AACZ,SAAK,YAAY,MAAM;AACvB,SAAK,eAAe,MAAM;AAAA,EAC5B;AACF;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/queryClient.d.cts b/node_modules/@tanstack/query-core/build/modern/queryClient.d.cts deleted file mode 100644 index bd14fb2..0000000 --- a/node_modules/@tanstack/query-core/build/modern/queryClient.d.cts +++ /dev/null @@ -1,3 +0,0 @@ -export { g as QueryClient } from './hydration-uphG6M-i.cjs'; -import './removable.cjs'; -import './subscribable.cjs'; diff --git a/node_modules/@tanstack/query-core/build/modern/queryClient.d.ts b/node_modules/@tanstack/query-core/build/modern/queryClient.d.ts deleted file mode 100644 index 73366c7..0000000 --- a/node_modules/@tanstack/query-core/build/modern/queryClient.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export { g as QueryClient } from './hydration-BlEVG2Lp.js'; -import './removable.js'; -import './subscribable.js'; diff --git a/node_modules/@tanstack/query-core/build/modern/queryClient.js b/node_modules/@tanstack/query-core/build/modern/queryClient.js deleted file mode 100644 index 64a5a5f..0000000 --- a/node_modules/@tanstack/query-core/build/modern/queryClient.js +++ /dev/null @@ -1,305 +0,0 @@ -// src/queryClient.ts -import { - functionalUpdate, - hashKey, - hashQueryKeyByOptions, - noop, - partialMatchKey, - resolveStaleTime, - skipToken -} from "./utils.js"; -import { QueryCache } from "./queryCache.js"; -import { MutationCache } from "./mutationCache.js"; -import { focusManager } from "./focusManager.js"; -import { onlineManager } from "./onlineManager.js"; -import { notifyManager } from "./notifyManager.js"; -import { infiniteQueryBehavior } from "./infiniteQueryBehavior.js"; -var QueryClient = class { - #queryCache; - #mutationCache; - #defaultOptions; - #queryDefaults; - #mutationDefaults; - #mountCount; - #unsubscribeFocus; - #unsubscribeOnline; - constructor(config = {}) { - this.#queryCache = config.queryCache || new QueryCache(); - this.#mutationCache = config.mutationCache || new MutationCache(); - this.#defaultOptions = config.defaultOptions || {}; - this.#queryDefaults = /* @__PURE__ */ new Map(); - this.#mutationDefaults = /* @__PURE__ */ new Map(); - this.#mountCount = 0; - } - mount() { - this.#mountCount++; - if (this.#mountCount !== 1) return; - this.#unsubscribeFocus = focusManager.subscribe(async (focused) => { - if (focused) { - await this.resumePausedMutations(); - this.#queryCache.onFocus(); - } - }); - this.#unsubscribeOnline = onlineManager.subscribe(async (online) => { - if (online) { - await this.resumePausedMutations(); - this.#queryCache.onOnline(); - } - }); - } - unmount() { - this.#mountCount--; - if (this.#mountCount !== 0) return; - this.#unsubscribeFocus?.(); - this.#unsubscribeFocus = void 0; - this.#unsubscribeOnline?.(); - this.#unsubscribeOnline = void 0; - } - isFetching(filters) { - return this.#queryCache.findAll({ ...filters, fetchStatus: "fetching" }).length; - } - isMutating(filters) { - return this.#mutationCache.findAll({ ...filters, status: "pending" }).length; - } - /** - * Imperative (non-reactive) way to retrieve data for a QueryKey. - * Should only be used in callbacks or functions where reading the latest data is necessary, e.g. for optimistic updates. - * - * Hint: Do not use this function inside a component, because it won't receive updates. - * Use `useQuery` to create a `QueryObserver` that subscribes to changes. - */ - getQueryData(queryKey) { - const options = this.defaultQueryOptions({ queryKey }); - return this.#queryCache.get(options.queryHash)?.state.data; - } - ensureQueryData(options) { - const defaultedOptions = this.defaultQueryOptions(options); - const query = this.#queryCache.build(this, defaultedOptions); - const cachedData = query.state.data; - if (cachedData === void 0) { - return this.fetchQuery(options); - } - if (options.revalidateIfStale && query.isStaleByTime(resolveStaleTime(defaultedOptions.staleTime, query))) { - void this.prefetchQuery(defaultedOptions); - } - return Promise.resolve(cachedData); - } - getQueriesData(filters) { - return this.#queryCache.findAll(filters).map(({ queryKey, state }) => { - const data = state.data; - return [queryKey, data]; - }); - } - setQueryData(queryKey, updater, options) { - const defaultedOptions = this.defaultQueryOptions({ queryKey }); - const query = this.#queryCache.get( - defaultedOptions.queryHash - ); - const prevData = query?.state.data; - const data = functionalUpdate(updater, prevData); - if (data === void 0) { - return void 0; - } - return this.#queryCache.build(this, defaultedOptions).setData(data, { ...options, manual: true }); - } - setQueriesData(filters, updater, options) { - return notifyManager.batch( - () => this.#queryCache.findAll(filters).map(({ queryKey }) => [ - queryKey, - this.setQueryData(queryKey, updater, options) - ]) - ); - } - getQueryState(queryKey) { - const options = this.defaultQueryOptions({ queryKey }); - return this.#queryCache.get( - options.queryHash - )?.state; - } - removeQueries(filters) { - const queryCache = this.#queryCache; - notifyManager.batch(() => { - queryCache.findAll(filters).forEach((query) => { - queryCache.remove(query); - }); - }); - } - resetQueries(filters, options) { - const queryCache = this.#queryCache; - return notifyManager.batch(() => { - queryCache.findAll(filters).forEach((query) => { - query.reset(); - }); - return this.refetchQueries( - { - type: "active", - ...filters - }, - options - ); - }); - } - cancelQueries(filters, cancelOptions = {}) { - const defaultedCancelOptions = { revert: true, ...cancelOptions }; - const promises = notifyManager.batch( - () => this.#queryCache.findAll(filters).map((query) => query.cancel(defaultedCancelOptions)) - ); - return Promise.all(promises).then(noop).catch(noop); - } - invalidateQueries(filters, options = {}) { - return notifyManager.batch(() => { - this.#queryCache.findAll(filters).forEach((query) => { - query.invalidate(); - }); - if (filters?.refetchType === "none") { - return Promise.resolve(); - } - return this.refetchQueries( - { - ...filters, - type: filters?.refetchType ?? filters?.type ?? "active" - }, - options - ); - }); - } - refetchQueries(filters, options = {}) { - const fetchOptions = { - ...options, - cancelRefetch: options.cancelRefetch ?? true - }; - const promises = notifyManager.batch( - () => this.#queryCache.findAll(filters).filter((query) => !query.isDisabled() && !query.isStatic()).map((query) => { - let promise = query.fetch(void 0, fetchOptions); - if (!fetchOptions.throwOnError) { - promise = promise.catch(noop); - } - return query.state.fetchStatus === "paused" ? Promise.resolve() : promise; - }) - ); - return Promise.all(promises).then(noop); - } - fetchQuery(options) { - const defaultedOptions = this.defaultQueryOptions(options); - if (defaultedOptions.retry === void 0) { - defaultedOptions.retry = false; - } - const query = this.#queryCache.build(this, defaultedOptions); - return query.isStaleByTime( - resolveStaleTime(defaultedOptions.staleTime, query) - ) ? query.fetch(defaultedOptions) : Promise.resolve(query.state.data); - } - prefetchQuery(options) { - return this.fetchQuery(options).then(noop).catch(noop); - } - fetchInfiniteQuery(options) { - options.behavior = infiniteQueryBehavior(options.pages); - return this.fetchQuery(options); - } - prefetchInfiniteQuery(options) { - return this.fetchInfiniteQuery(options).then(noop).catch(noop); - } - ensureInfiniteQueryData(options) { - options.behavior = infiniteQueryBehavior(options.pages); - return this.ensureQueryData(options); - } - resumePausedMutations() { - if (onlineManager.isOnline()) { - return this.#mutationCache.resumePausedMutations(); - } - return Promise.resolve(); - } - getQueryCache() { - return this.#queryCache; - } - getMutationCache() { - return this.#mutationCache; - } - getDefaultOptions() { - return this.#defaultOptions; - } - setDefaultOptions(options) { - this.#defaultOptions = options; - } - setQueryDefaults(queryKey, options) { - this.#queryDefaults.set(hashKey(queryKey), { - queryKey, - defaultOptions: options - }); - } - getQueryDefaults(queryKey) { - const defaults = [...this.#queryDefaults.values()]; - const result = {}; - defaults.forEach((queryDefault) => { - if (partialMatchKey(queryKey, queryDefault.queryKey)) { - Object.assign(result, queryDefault.defaultOptions); - } - }); - return result; - } - setMutationDefaults(mutationKey, options) { - this.#mutationDefaults.set(hashKey(mutationKey), { - mutationKey, - defaultOptions: options - }); - } - getMutationDefaults(mutationKey) { - const defaults = [...this.#mutationDefaults.values()]; - const result = {}; - defaults.forEach((queryDefault) => { - if (partialMatchKey(mutationKey, queryDefault.mutationKey)) { - Object.assign(result, queryDefault.defaultOptions); - } - }); - return result; - } - defaultQueryOptions(options) { - if (options._defaulted) { - return options; - } - const defaultedOptions = { - ...this.#defaultOptions.queries, - ...this.getQueryDefaults(options.queryKey), - ...options, - _defaulted: true - }; - if (!defaultedOptions.queryHash) { - defaultedOptions.queryHash = hashQueryKeyByOptions( - defaultedOptions.queryKey, - defaultedOptions - ); - } - if (defaultedOptions.refetchOnReconnect === void 0) { - defaultedOptions.refetchOnReconnect = defaultedOptions.networkMode !== "always"; - } - if (defaultedOptions.throwOnError === void 0) { - defaultedOptions.throwOnError = !!defaultedOptions.suspense; - } - if (!defaultedOptions.networkMode && defaultedOptions.persister) { - defaultedOptions.networkMode = "offlineFirst"; - } - if (defaultedOptions.queryFn === skipToken) { - defaultedOptions.enabled = false; - } - return defaultedOptions; - } - defaultMutationOptions(options) { - if (options?._defaulted) { - return options; - } - return { - ...this.#defaultOptions.mutations, - ...options?.mutationKey && this.getMutationDefaults(options.mutationKey), - ...options, - _defaulted: true - }; - } - clear() { - this.#queryCache.clear(); - this.#mutationCache.clear(); - } -}; -export { - QueryClient -}; -//# sourceMappingURL=queryClient.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/queryClient.js.map b/node_modules/@tanstack/query-core/build/modern/queryClient.js.map deleted file mode 100644 index eb99a52..0000000 --- a/node_modules/@tanstack/query-core/build/modern/queryClient.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/queryClient.ts"],"sourcesContent":["import {\n functionalUpdate,\n hashKey,\n hashQueryKeyByOptions,\n noop,\n partialMatchKey,\n resolveStaleTime,\n skipToken,\n} from './utils'\nimport { QueryCache } from './queryCache'\nimport { MutationCache } from './mutationCache'\nimport { focusManager } from './focusManager'\nimport { onlineManager } from './onlineManager'\nimport { notifyManager } from './notifyManager'\nimport { infiniteQueryBehavior } from './infiniteQueryBehavior'\nimport type {\n CancelOptions,\n DefaultError,\n DefaultOptions,\n DefaultedQueryObserverOptions,\n EnsureInfiniteQueryDataOptions,\n EnsureQueryDataOptions,\n FetchInfiniteQueryOptions,\n FetchQueryOptions,\n InferDataFromTag,\n InferErrorFromTag,\n InfiniteData,\n InvalidateOptions,\n InvalidateQueryFilters,\n MutationKey,\n MutationObserverOptions,\n MutationOptions,\n NoInfer,\n OmitKeyof,\n QueryClientConfig,\n QueryKey,\n QueryObserverOptions,\n QueryOptions,\n RefetchOptions,\n RefetchQueryFilters,\n ResetOptions,\n SetDataOptions,\n} from './types'\nimport type { QueryState } from './query'\nimport type { MutationFilters, QueryFilters, Updater } from './utils'\n\n// TYPES\n\ninterface QueryDefaults {\n queryKey: QueryKey\n defaultOptions: OmitKeyof, 'queryKey'>\n}\n\ninterface MutationDefaults {\n mutationKey: MutationKey\n defaultOptions: MutationOptions\n}\n\n// CLASS\n\nexport class QueryClient {\n #queryCache: QueryCache\n #mutationCache: MutationCache\n #defaultOptions: DefaultOptions\n #queryDefaults: Map\n #mutationDefaults: Map\n #mountCount: number\n #unsubscribeFocus?: () => void\n #unsubscribeOnline?: () => void\n\n constructor(config: QueryClientConfig = {}) {\n this.#queryCache = config.queryCache || new QueryCache()\n this.#mutationCache = config.mutationCache || new MutationCache()\n this.#defaultOptions = config.defaultOptions || {}\n this.#queryDefaults = new Map()\n this.#mutationDefaults = new Map()\n this.#mountCount = 0\n }\n\n mount(): void {\n this.#mountCount++\n if (this.#mountCount !== 1) return\n\n this.#unsubscribeFocus = focusManager.subscribe(async (focused) => {\n if (focused) {\n await this.resumePausedMutations()\n this.#queryCache.onFocus()\n }\n })\n this.#unsubscribeOnline = onlineManager.subscribe(async (online) => {\n if (online) {\n await this.resumePausedMutations()\n this.#queryCache.onOnline()\n }\n })\n }\n\n unmount(): void {\n this.#mountCount--\n if (this.#mountCount !== 0) return\n\n this.#unsubscribeFocus?.()\n this.#unsubscribeFocus = undefined\n\n this.#unsubscribeOnline?.()\n this.#unsubscribeOnline = undefined\n }\n\n isFetching = QueryFilters>(\n filters?: TQueryFilters,\n ): number {\n return this.#queryCache.findAll({ ...filters, fetchStatus: 'fetching' })\n .length\n }\n\n isMutating<\n TMutationFilters extends MutationFilters = MutationFilters,\n >(filters?: TMutationFilters): number {\n return this.#mutationCache.findAll({ ...filters, status: 'pending' }).length\n }\n\n /**\n * Imperative (non-reactive) way to retrieve data for a QueryKey.\n * Should only be used in callbacks or functions where reading the latest data is necessary, e.g. for optimistic updates.\n *\n * Hint: Do not use this function inside a component, because it won't receive updates.\n * Use `useQuery` to create a `QueryObserver` that subscribes to changes.\n */\n getQueryData<\n TQueryFnData = unknown,\n TTaggedQueryKey extends QueryKey = QueryKey,\n TInferredQueryFnData = InferDataFromTag,\n >(queryKey: TTaggedQueryKey): TInferredQueryFnData | undefined {\n const options = this.defaultQueryOptions({ queryKey })\n\n return this.#queryCache.get(options.queryHash)?.state\n .data\n }\n\n ensureQueryData<\n TQueryFnData,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n >(\n options: EnsureQueryDataOptions,\n ): Promise {\n const defaultedOptions = this.defaultQueryOptions(options)\n const query = this.#queryCache.build(this, defaultedOptions)\n const cachedData = query.state.data\n\n if (cachedData === undefined) {\n return this.fetchQuery(options)\n }\n\n if (\n options.revalidateIfStale &&\n query.isStaleByTime(resolveStaleTime(defaultedOptions.staleTime, query))\n ) {\n void this.prefetchQuery(defaultedOptions)\n }\n\n return Promise.resolve(cachedData)\n }\n\n getQueriesData<\n TQueryFnData = unknown,\n TQueryFilters extends QueryFilters = QueryFilters,\n >(filters: TQueryFilters): Array<[QueryKey, TQueryFnData | undefined]> {\n return this.#queryCache.findAll(filters).map(({ queryKey, state }) => {\n const data = state.data as TQueryFnData | undefined\n return [queryKey, data]\n })\n }\n\n setQueryData<\n TQueryFnData = unknown,\n TTaggedQueryKey extends QueryKey = QueryKey,\n TInferredQueryFnData = InferDataFromTag,\n >(\n queryKey: TTaggedQueryKey,\n updater: Updater<\n NoInfer | undefined,\n NoInfer | undefined\n >,\n options?: SetDataOptions,\n ): NoInfer | undefined {\n const defaultedOptions = this.defaultQueryOptions<\n any,\n any,\n unknown,\n any,\n QueryKey\n >({ queryKey })\n\n const query = this.#queryCache.get(\n defaultedOptions.queryHash,\n )\n const prevData = query?.state.data\n const data = functionalUpdate(updater, prevData)\n\n if (data === undefined) {\n return undefined\n }\n\n return this.#queryCache\n .build(this, defaultedOptions)\n .setData(data, { ...options, manual: true })\n }\n\n setQueriesData<\n TQueryFnData,\n TQueryFilters extends QueryFilters = QueryFilters,\n >(\n filters: TQueryFilters,\n updater: Updater<\n NoInfer | undefined,\n NoInfer | undefined\n >,\n options?: SetDataOptions,\n ): Array<[QueryKey, TQueryFnData | undefined]> {\n return notifyManager.batch(() =>\n this.#queryCache\n .findAll(filters)\n .map(({ queryKey }) => [\n queryKey,\n this.setQueryData(queryKey, updater, options),\n ]),\n )\n }\n\n getQueryState<\n TQueryFnData = unknown,\n TError = DefaultError,\n TTaggedQueryKey extends QueryKey = QueryKey,\n TInferredQueryFnData = InferDataFromTag,\n TInferredError = InferErrorFromTag,\n >(\n queryKey: TTaggedQueryKey,\n ): QueryState | undefined {\n const options = this.defaultQueryOptions({ queryKey })\n return this.#queryCache.get(\n options.queryHash,\n )?.state\n }\n\n removeQueries(\n filters?: QueryFilters,\n ): void {\n const queryCache = this.#queryCache\n notifyManager.batch(() => {\n queryCache.findAll(filters).forEach((query) => {\n queryCache.remove(query)\n })\n })\n }\n\n resetQueries(\n filters?: QueryFilters,\n options?: ResetOptions,\n ): Promise {\n const queryCache = this.#queryCache\n\n return notifyManager.batch(() => {\n queryCache.findAll(filters).forEach((query) => {\n query.reset()\n })\n return this.refetchQueries(\n {\n type: 'active',\n ...filters,\n },\n options,\n )\n })\n }\n\n cancelQueries(\n filters?: QueryFilters,\n cancelOptions: CancelOptions = {},\n ): Promise {\n const defaultedCancelOptions = { revert: true, ...cancelOptions }\n\n const promises = notifyManager.batch(() =>\n this.#queryCache\n .findAll(filters)\n .map((query) => query.cancel(defaultedCancelOptions)),\n )\n\n return Promise.all(promises).then(noop).catch(noop)\n }\n\n invalidateQueries(\n filters?: InvalidateQueryFilters,\n options: InvalidateOptions = {},\n ): Promise {\n return notifyManager.batch(() => {\n this.#queryCache.findAll(filters).forEach((query) => {\n query.invalidate()\n })\n\n if (filters?.refetchType === 'none') {\n return Promise.resolve()\n }\n return this.refetchQueries(\n {\n ...filters,\n type: filters?.refetchType ?? filters?.type ?? 'active',\n },\n options,\n )\n })\n }\n\n refetchQueries(\n filters?: RefetchQueryFilters,\n options: RefetchOptions = {},\n ): Promise {\n const fetchOptions = {\n ...options,\n cancelRefetch: options.cancelRefetch ?? true,\n }\n const promises = notifyManager.batch(() =>\n this.#queryCache\n .findAll(filters)\n .filter((query) => !query.isDisabled() && !query.isStatic())\n .map((query) => {\n let promise = query.fetch(undefined, fetchOptions)\n if (!fetchOptions.throwOnError) {\n promise = promise.catch(noop)\n }\n return query.state.fetchStatus === 'paused'\n ? Promise.resolve()\n : promise\n }),\n )\n\n return Promise.all(promises).then(noop)\n }\n\n fetchQuery<\n TQueryFnData,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = never,\n >(\n options: FetchQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n ): Promise {\n const defaultedOptions = this.defaultQueryOptions(options)\n\n // https://github.com/tannerlinsley/react-query/issues/652\n if (defaultedOptions.retry === undefined) {\n defaultedOptions.retry = false\n }\n\n const query = this.#queryCache.build(this, defaultedOptions)\n\n return query.isStaleByTime(\n resolveStaleTime(defaultedOptions.staleTime, query),\n )\n ? query.fetch(defaultedOptions)\n : Promise.resolve(query.state.data as TData)\n }\n\n prefetchQuery<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n >(\n options: FetchQueryOptions,\n ): Promise {\n return this.fetchQuery(options).then(noop).catch(noop)\n }\n\n fetchInfiniteQuery<\n TQueryFnData,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n >(\n options: FetchInfiniteQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n ): Promise> {\n options.behavior = infiniteQueryBehavior<\n TQueryFnData,\n TError,\n TData,\n TPageParam\n >(options.pages)\n return this.fetchQuery(options as any)\n }\n\n prefetchInfiniteQuery<\n TQueryFnData,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n >(\n options: FetchInfiniteQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n ): Promise {\n return this.fetchInfiniteQuery(options).then(noop).catch(noop)\n }\n\n ensureInfiniteQueryData<\n TQueryFnData,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n >(\n options: EnsureInfiniteQueryDataOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n ): Promise> {\n options.behavior = infiniteQueryBehavior<\n TQueryFnData,\n TError,\n TData,\n TPageParam\n >(options.pages)\n\n return this.ensureQueryData(options as any)\n }\n\n resumePausedMutations(): Promise {\n if (onlineManager.isOnline()) {\n return this.#mutationCache.resumePausedMutations()\n }\n return Promise.resolve()\n }\n\n getQueryCache(): QueryCache {\n return this.#queryCache\n }\n\n getMutationCache(): MutationCache {\n return this.#mutationCache\n }\n\n getDefaultOptions(): DefaultOptions {\n return this.#defaultOptions\n }\n\n setDefaultOptions(options: DefaultOptions): void {\n this.#defaultOptions = options\n }\n\n setQueryDefaults<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryData = TQueryFnData,\n >(\n queryKey: QueryKey,\n options: Partial<\n OmitKeyof<\n QueryObserverOptions,\n 'queryKey'\n >\n >,\n ): void {\n this.#queryDefaults.set(hashKey(queryKey), {\n queryKey,\n defaultOptions: options,\n })\n }\n\n getQueryDefaults(\n queryKey: QueryKey,\n ): OmitKeyof, 'queryKey'> {\n const defaults = [...this.#queryDefaults.values()]\n\n const result: OmitKeyof<\n QueryObserverOptions,\n 'queryKey'\n > = {}\n\n defaults.forEach((queryDefault) => {\n if (partialMatchKey(queryKey, queryDefault.queryKey)) {\n Object.assign(result, queryDefault.defaultOptions)\n }\n })\n return result\n }\n\n setMutationDefaults<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n >(\n mutationKey: MutationKey,\n options: OmitKeyof<\n MutationObserverOptions,\n 'mutationKey'\n >,\n ): void {\n this.#mutationDefaults.set(hashKey(mutationKey), {\n mutationKey,\n defaultOptions: options,\n })\n }\n\n getMutationDefaults(\n mutationKey: MutationKey,\n ): OmitKeyof, 'mutationKey'> {\n const defaults = [...this.#mutationDefaults.values()]\n\n const result: OmitKeyof<\n MutationObserverOptions,\n 'mutationKey'\n > = {}\n\n defaults.forEach((queryDefault) => {\n if (partialMatchKey(mutationKey, queryDefault.mutationKey)) {\n Object.assign(result, queryDefault.defaultOptions)\n }\n })\n\n return result\n }\n\n defaultQueryOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = never,\n >(\n options:\n | QueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey,\n TPageParam\n >\n | DefaultedQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >,\n ): DefaultedQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n > {\n if (options._defaulted) {\n return options as DefaultedQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >\n }\n\n const defaultedOptions = {\n ...this.#defaultOptions.queries,\n ...this.getQueryDefaults(options.queryKey),\n ...options,\n _defaulted: true,\n }\n\n if (!defaultedOptions.queryHash) {\n defaultedOptions.queryHash = hashQueryKeyByOptions(\n defaultedOptions.queryKey,\n defaultedOptions,\n )\n }\n\n // dependent default values\n if (defaultedOptions.refetchOnReconnect === undefined) {\n defaultedOptions.refetchOnReconnect =\n defaultedOptions.networkMode !== 'always'\n }\n if (defaultedOptions.throwOnError === undefined) {\n defaultedOptions.throwOnError = !!defaultedOptions.suspense\n }\n\n if (!defaultedOptions.networkMode && defaultedOptions.persister) {\n defaultedOptions.networkMode = 'offlineFirst'\n }\n\n if (defaultedOptions.queryFn === skipToken) {\n defaultedOptions.enabled = false\n }\n\n return defaultedOptions as DefaultedQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >\n }\n\n defaultMutationOptions>(\n options?: T,\n ): T {\n if (options?._defaulted) {\n return options\n }\n return {\n ...this.#defaultOptions.mutations,\n ...(options?.mutationKey &&\n this.getMutationDefaults(options.mutationKey)),\n ...options,\n _defaulted: true,\n } as T\n }\n\n clear(): void {\n this.#queryCache.clear()\n this.#mutationCache.clear()\n }\n}\n"],"mappings":";AAAA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,kBAAkB;AAC3B,SAAS,qBAAqB;AAC9B,SAAS,oBAAoB;AAC7B,SAAS,qBAAqB;AAC9B,SAAS,qBAAqB;AAC9B,SAAS,6BAA6B;AA8C/B,IAAM,cAAN,MAAkB;AAAA,EACvB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EAEA,YAAY,SAA4B,CAAC,GAAG;AAC1C,SAAK,cAAc,OAAO,cAAc,IAAI,WAAW;AACvD,SAAK,iBAAiB,OAAO,iBAAiB,IAAI,cAAc;AAChE,SAAK,kBAAkB,OAAO,kBAAkB,CAAC;AACjD,SAAK,iBAAiB,oBAAI,IAAI;AAC9B,SAAK,oBAAoB,oBAAI,IAAI;AACjC,SAAK,cAAc;AAAA,EACrB;AAAA,EAEA,QAAc;AACZ,SAAK;AACL,QAAI,KAAK,gBAAgB,EAAG;AAE5B,SAAK,oBAAoB,aAAa,UAAU,OAAO,YAAY;AACjE,UAAI,SAAS;AACX,cAAM,KAAK,sBAAsB;AACjC,aAAK,YAAY,QAAQ;AAAA,MAC3B;AAAA,IACF,CAAC;AACD,SAAK,qBAAqB,cAAc,UAAU,OAAO,WAAW;AAClE,UAAI,QAAQ;AACV,cAAM,KAAK,sBAAsB;AACjC,aAAK,YAAY,SAAS;AAAA,MAC5B;AAAA,IACF,CAAC;AAAA,EACH;AAAA,EAEA,UAAgB;AACd,SAAK;AACL,QAAI,KAAK,gBAAgB,EAAG;AAE5B,SAAK,oBAAoB;AACzB,SAAK,oBAAoB;AAEzB,SAAK,qBAAqB;AAC1B,SAAK,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AAG,KAAK,gBAAgB;AAAA,MACxB,GAAI,SAAS,eACX,KAAK,oBAAoB,QAAQ,WAAW;AAAA,MAC9C,GAAG;AAAA,MACH,YAAY;AAAA,IACd;AAAA,EACF;AAAA,EAEA,QAAc;AACZ,SAAK,YAAY,MAAM;AACvB,SAAK,eAAe,MAAM;AAAA,EAC5B;AACF;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/queryObserver.cjs b/node_modules/@tanstack/query-core/build/modern/queryObserver.cjs deleted file mode 100644 index 17db827..0000000 --- a/node_modules/@tanstack/query-core/build/modern/queryObserver.cjs +++ /dev/null @@ -1,488 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// src/queryObserver.ts -var queryObserver_exports = {}; -__export(queryObserver_exports, { - QueryObserver: () => QueryObserver -}); -module.exports = __toCommonJS(queryObserver_exports); -var import_focusManager = require("./focusManager.cjs"); -var import_notifyManager = require("./notifyManager.cjs"); -var import_query = require("./query.cjs"); -var import_subscribable = require("./subscribable.cjs"); -var import_thenable = require("./thenable.cjs"); -var import_utils = require("./utils.cjs"); -var import_timeoutManager = require("./timeoutManager.cjs"); -var QueryObserver = class extends import_subscribable.Subscribable { - constructor(client, options) { - super(); - this.options = options; - this.#client = client; - this.#selectError = null; - this.#currentThenable = (0, import_thenable.pendingThenable)(); - this.bindMethods(); - this.setOptions(options); - } - #client; - #currentQuery = void 0; - #currentQueryInitialState = void 0; - #currentResult = void 0; - #currentResultState; - #currentResultOptions; - #currentThenable; - #selectError; - #selectFn; - #selectResult; - // This property keeps track of the last query with defined data. - // It will be used to pass the previous data and query to the placeholder function between renders. - #lastQueryWithDefinedData; - #staleTimeoutId; - #refetchIntervalId; - #currentRefetchInterval; - #trackedProps = /* @__PURE__ */ new Set(); - bindMethods() { - this.refetch = this.refetch.bind(this); - } - onSubscribe() { - if (this.listeners.size === 1) { - this.#currentQuery.addObserver(this); - if (shouldFetchOnMount(this.#currentQuery, this.options)) { - this.#executeFetch(); - } else { - this.updateResult(); - } - this.#updateTimers(); - } - } - onUnsubscribe() { - if (!this.hasListeners()) { - this.destroy(); - } - } - shouldFetchOnReconnect() { - return shouldFetchOn( - this.#currentQuery, - this.options, - this.options.refetchOnReconnect - ); - } - shouldFetchOnWindowFocus() { - return shouldFetchOn( - this.#currentQuery, - this.options, - this.options.refetchOnWindowFocus - ); - } - destroy() { - this.listeners = /* @__PURE__ */ new Set(); - this.#clearStaleTimeout(); - this.#clearRefetchInterval(); - this.#currentQuery.removeObserver(this); - } - setOptions(options) { - const prevOptions = this.options; - const prevQuery = this.#currentQuery; - this.options = this.#client.defaultQueryOptions(options); - if (this.options.enabled !== void 0 && typeof this.options.enabled !== "boolean" && typeof this.options.enabled !== "function" && typeof (0, import_utils.resolveEnabled)(this.options.enabled, this.#currentQuery) !== "boolean") { - throw new Error( - "Expected enabled to be a boolean or a callback that returns a boolean" - ); - } - this.#updateQuery(); - this.#currentQuery.setOptions(this.options); - if (prevOptions._defaulted && !(0, import_utils.shallowEqualObjects)(this.options, prevOptions)) { - this.#client.getQueryCache().notify({ - type: "observerOptionsUpdated", - query: this.#currentQuery, - observer: this - }); - } - const mounted = this.hasListeners(); - if (mounted && shouldFetchOptionally( - this.#currentQuery, - prevQuery, - this.options, - prevOptions - )) { - this.#executeFetch(); - } - this.updateResult(); - if (mounted && (this.#currentQuery !== prevQuery || (0, import_utils.resolveEnabled)(this.options.enabled, this.#currentQuery) !== (0, import_utils.resolveEnabled)(prevOptions.enabled, this.#currentQuery) || (0, import_utils.resolveStaleTime)(this.options.staleTime, this.#currentQuery) !== (0, import_utils.resolveStaleTime)(prevOptions.staleTime, this.#currentQuery))) { - this.#updateStaleTimeout(); - } - const nextRefetchInterval = this.#computeRefetchInterval(); - if (mounted && (this.#currentQuery !== prevQuery || (0, import_utils.resolveEnabled)(this.options.enabled, this.#currentQuery) !== (0, import_utils.resolveEnabled)(prevOptions.enabled, this.#currentQuery) || nextRefetchInterval !== this.#currentRefetchInterval)) { - this.#updateRefetchInterval(nextRefetchInterval); - } - } - getOptimisticResult(options) { - const query = this.#client.getQueryCache().build(this.#client, options); - const result = this.createResult(query, options); - if (shouldAssignObserverCurrentProperties(this, result)) { - this.#currentResult = result; - this.#currentResultOptions = this.options; - this.#currentResultState = this.#currentQuery.state; - } - return result; - } - getCurrentResult() { - return this.#currentResult; - } - trackResult(result, onPropTracked) { - return new Proxy(result, { - get: (target, key) => { - this.trackProp(key); - onPropTracked?.(key); - if (key === "promise") { - this.trackProp("data"); - if (!this.options.experimental_prefetchInRender && this.#currentThenable.status === "pending") { - this.#currentThenable.reject( - new Error( - "experimental_prefetchInRender feature flag is not enabled" - ) - ); - } - } - return Reflect.get(target, key); - } - }); - } - trackProp(key) { - this.#trackedProps.add(key); - } - getCurrentQuery() { - return this.#currentQuery; - } - refetch({ ...options } = {}) { - return this.fetch({ - ...options - }); - } - fetchOptimistic(options) { - const defaultedOptions = this.#client.defaultQueryOptions(options); - const query = this.#client.getQueryCache().build(this.#client, defaultedOptions); - return query.fetch().then(() => this.createResult(query, defaultedOptions)); - } - fetch(fetchOptions) { - return this.#executeFetch({ - ...fetchOptions, - cancelRefetch: fetchOptions.cancelRefetch ?? true - }).then(() => { - this.updateResult(); - return this.#currentResult; - }); - } - #executeFetch(fetchOptions) { - this.#updateQuery(); - let promise = this.#currentQuery.fetch( - this.options, - fetchOptions - ); - if (!fetchOptions?.throwOnError) { - promise = promise.catch(import_utils.noop); - } - return promise; - } - #updateStaleTimeout() { - this.#clearStaleTimeout(); - const staleTime = (0, import_utils.resolveStaleTime)( - this.options.staleTime, - this.#currentQuery - ); - if (import_utils.isServer || this.#currentResult.isStale || !(0, import_utils.isValidTimeout)(staleTime)) { - return; - } - const time = (0, import_utils.timeUntilStale)(this.#currentResult.dataUpdatedAt, staleTime); - const timeout = time + 1; - this.#staleTimeoutId = import_timeoutManager.timeoutManager.setTimeout(() => { - if (!this.#currentResult.isStale) { - this.updateResult(); - } - }, timeout); - } - #computeRefetchInterval() { - return (typeof this.options.refetchInterval === "function" ? this.options.refetchInterval(this.#currentQuery) : this.options.refetchInterval) ?? false; - } - #updateRefetchInterval(nextInterval) { - this.#clearRefetchInterval(); - this.#currentRefetchInterval = nextInterval; - if (import_utils.isServer || (0, import_utils.resolveEnabled)(this.options.enabled, this.#currentQuery) === false || !(0, import_utils.isValidTimeout)(this.#currentRefetchInterval) || this.#currentRefetchInterval === 0) { - return; - } - this.#refetchIntervalId = import_timeoutManager.timeoutManager.setInterval(() => { - if (this.options.refetchIntervalInBackground || import_focusManager.focusManager.isFocused()) { - this.#executeFetch(); - } - }, this.#currentRefetchInterval); - } - #updateTimers() { - this.#updateStaleTimeout(); - this.#updateRefetchInterval(this.#computeRefetchInterval()); - } - #clearStaleTimeout() { - if (this.#staleTimeoutId) { - import_timeoutManager.timeoutManager.clearTimeout(this.#staleTimeoutId); - this.#staleTimeoutId = void 0; - } - } - #clearRefetchInterval() { - if (this.#refetchIntervalId) { - import_timeoutManager.timeoutManager.clearInterval(this.#refetchIntervalId); - this.#refetchIntervalId = void 0; - } - } - createResult(query, options) { - const prevQuery = this.#currentQuery; - const prevOptions = this.options; - const prevResult = this.#currentResult; - const prevResultState = this.#currentResultState; - const prevResultOptions = this.#currentResultOptions; - const queryChange = query !== prevQuery; - const queryInitialState = queryChange ? query.state : this.#currentQueryInitialState; - const { state } = query; - let newState = { ...state }; - let isPlaceholderData = false; - let data; - if (options._optimisticResults) { - const mounted = this.hasListeners(); - const fetchOnMount = !mounted && shouldFetchOnMount(query, options); - const fetchOptionally = mounted && shouldFetchOptionally(query, prevQuery, options, prevOptions); - if (fetchOnMount || fetchOptionally) { - newState = { - ...newState, - ...(0, import_query.fetchState)(state.data, query.options) - }; - } - if (options._optimisticResults === "isRestoring") { - newState.fetchStatus = "idle"; - } - } - let { error, errorUpdatedAt, status } = newState; - data = newState.data; - let skipSelect = false; - if (options.placeholderData !== void 0 && data === void 0 && status === "pending") { - let placeholderData; - if (prevResult?.isPlaceholderData && options.placeholderData === prevResultOptions?.placeholderData) { - placeholderData = prevResult.data; - skipSelect = true; - } else { - placeholderData = typeof options.placeholderData === "function" ? options.placeholderData( - this.#lastQueryWithDefinedData?.state.data, - this.#lastQueryWithDefinedData - ) : options.placeholderData; - } - if (placeholderData !== void 0) { - status = "success"; - data = (0, import_utils.replaceData)( - prevResult?.data, - placeholderData, - options - ); - isPlaceholderData = true; - } - } - if (options.select && data !== void 0 && !skipSelect) { - if (prevResult && data === prevResultState?.data && options.select === this.#selectFn) { - data = this.#selectResult; - } else { - try { - this.#selectFn = options.select; - data = options.select(data); - data = (0, import_utils.replaceData)(prevResult?.data, data, options); - this.#selectResult = data; - this.#selectError = null; - } catch (selectError) { - this.#selectError = selectError; - } - } - } - if (this.#selectError) { - error = this.#selectError; - data = this.#selectResult; - errorUpdatedAt = Date.now(); - status = "error"; - } - const isFetching = newState.fetchStatus === "fetching"; - const isPending = status === "pending"; - const isError = status === "error"; - const isLoading = isPending && isFetching; - const hasData = data !== void 0; - const result = { - status, - fetchStatus: newState.fetchStatus, - isPending, - isSuccess: status === "success", - isError, - isInitialLoading: isLoading, - isLoading, - data, - dataUpdatedAt: newState.dataUpdatedAt, - error, - errorUpdatedAt, - failureCount: newState.fetchFailureCount, - failureReason: newState.fetchFailureReason, - errorUpdateCount: newState.errorUpdateCount, - isFetched: newState.dataUpdateCount > 0 || newState.errorUpdateCount > 0, - isFetchedAfterMount: newState.dataUpdateCount > queryInitialState.dataUpdateCount || newState.errorUpdateCount > queryInitialState.errorUpdateCount, - isFetching, - isRefetching: isFetching && !isPending, - isLoadingError: isError && !hasData, - isPaused: newState.fetchStatus === "paused", - isPlaceholderData, - isRefetchError: isError && hasData, - isStale: isStale(query, options), - refetch: this.refetch, - promise: this.#currentThenable, - isEnabled: (0, import_utils.resolveEnabled)(options.enabled, query) !== false - }; - const nextResult = result; - if (this.options.experimental_prefetchInRender) { - const hasResultData = nextResult.data !== void 0; - const isErrorWithoutData = nextResult.status === "error" && !hasResultData; - const finalizeThenableIfPossible = (thenable) => { - if (isErrorWithoutData) { - thenable.reject(nextResult.error); - } else if (hasResultData) { - thenable.resolve(nextResult.data); - } - }; - const recreateThenable = () => { - const pending = this.#currentThenable = nextResult.promise = (0, import_thenable.pendingThenable)(); - finalizeThenableIfPossible(pending); - }; - const prevThenable = this.#currentThenable; - switch (prevThenable.status) { - case "pending": - if (query.queryHash === prevQuery.queryHash) { - finalizeThenableIfPossible(prevThenable); - } - break; - case "fulfilled": - if (isErrorWithoutData || nextResult.data !== prevThenable.value) { - recreateThenable(); - } - break; - case "rejected": - if (!isErrorWithoutData || nextResult.error !== prevThenable.reason) { - recreateThenable(); - } - break; - } - } - return nextResult; - } - updateResult() { - const prevResult = this.#currentResult; - const nextResult = this.createResult(this.#currentQuery, this.options); - this.#currentResultState = this.#currentQuery.state; - this.#currentResultOptions = this.options; - if (this.#currentResultState.data !== void 0) { - this.#lastQueryWithDefinedData = this.#currentQuery; - } - if ((0, import_utils.shallowEqualObjects)(nextResult, prevResult)) { - return; - } - this.#currentResult = nextResult; - const shouldNotifyListeners = () => { - if (!prevResult) { - return true; - } - const { notifyOnChangeProps } = this.options; - const notifyOnChangePropsValue = typeof notifyOnChangeProps === "function" ? notifyOnChangeProps() : notifyOnChangeProps; - if (notifyOnChangePropsValue === "all" || !notifyOnChangePropsValue && !this.#trackedProps.size) { - return true; - } - const includedProps = new Set( - notifyOnChangePropsValue ?? this.#trackedProps - ); - if (this.options.throwOnError) { - includedProps.add("error"); - } - return Object.keys(this.#currentResult).some((key) => { - const typedKey = key; - const changed = this.#currentResult[typedKey] !== prevResult[typedKey]; - return changed && includedProps.has(typedKey); - }); - }; - this.#notify({ listeners: shouldNotifyListeners() }); - } - #updateQuery() { - const query = this.#client.getQueryCache().build(this.#client, this.options); - if (query === this.#currentQuery) { - return; - } - const prevQuery = this.#currentQuery; - this.#currentQuery = query; - this.#currentQueryInitialState = query.state; - if (this.hasListeners()) { - prevQuery?.removeObserver(this); - query.addObserver(this); - } - } - onQueryUpdate() { - this.updateResult(); - if (this.hasListeners()) { - this.#updateTimers(); - } - } - #notify(notifyOptions) { - import_notifyManager.notifyManager.batch(() => { - if (notifyOptions.listeners) { - this.listeners.forEach((listener) => { - listener(this.#currentResult); - }); - } - this.#client.getQueryCache().notify({ - query: this.#currentQuery, - type: "observerResultsUpdated" - }); - }); - } -}; -function shouldLoadOnMount(query, options) { - return (0, import_utils.resolveEnabled)(options.enabled, query) !== false && query.state.data === void 0 && !(query.state.status === "error" && options.retryOnMount === false); -} -function shouldFetchOnMount(query, options) { - return shouldLoadOnMount(query, options) || query.state.data !== void 0 && shouldFetchOn(query, options, options.refetchOnMount); -} -function shouldFetchOn(query, options, field) { - if ((0, import_utils.resolveEnabled)(options.enabled, query) !== false && (0, import_utils.resolveStaleTime)(options.staleTime, query) !== "static") { - const value = typeof field === "function" ? field(query) : field; - return value === "always" || value !== false && isStale(query, options); - } - return false; -} -function shouldFetchOptionally(query, prevQuery, options, prevOptions) { - return (query !== prevQuery || (0, import_utils.resolveEnabled)(prevOptions.enabled, query) === false) && (!options.suspense || query.state.status !== "error") && isStale(query, options); -} -function isStale(query, options) { - return (0, import_utils.resolveEnabled)(options.enabled, query) !== false && query.isStaleByTime((0, import_utils.resolveStaleTime)(options.staleTime, query)); -} -function shouldAssignObserverCurrentProperties(observer, optimisticResult) { - if (!(0, import_utils.shallowEqualObjects)(observer.getCurrentResult(), optimisticResult)) { - return true; - } - return false; -} -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - QueryObserver -}); -//# sourceMappingURL=queryObserver.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/queryObserver.cjs.map b/node_modules/@tanstack/query-core/build/modern/queryObserver.cjs.map deleted file mode 100644 index 55176d0..0000000 --- a/node_modules/@tanstack/query-core/build/modern/queryObserver.cjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/queryObserver.ts"],"sourcesContent":["import { focusManager } from './focusManager'\nimport { notifyManager } from './notifyManager'\nimport { fetchState } from './query'\nimport { Subscribable } from './subscribable'\nimport { pendingThenable } from './thenable'\nimport {\n isServer,\n isValidTimeout,\n noop,\n replaceData,\n resolveEnabled,\n resolveStaleTime,\n shallowEqualObjects,\n timeUntilStale,\n} from './utils'\nimport { timeoutManager } from './timeoutManager'\nimport type { ManagedTimerId } from './timeoutManager'\nimport type { FetchOptions, Query, QueryState } from './query'\nimport type { QueryClient } from './queryClient'\nimport type { PendingThenable, Thenable } from './thenable'\nimport type {\n DefaultError,\n DefaultedQueryObserverOptions,\n PlaceholderDataFunction,\n QueryKey,\n QueryObserverBaseResult,\n QueryObserverOptions,\n QueryObserverResult,\n RefetchOptions,\n} from './types'\n\ntype QueryObserverListener = (\n result: QueryObserverResult,\n) => void\n\ninterface ObserverFetchOptions extends FetchOptions {\n throwOnError?: boolean\n}\n\nexport class QueryObserver<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> extends Subscribable> {\n #client: QueryClient\n #currentQuery: Query = undefined!\n #currentQueryInitialState: QueryState = undefined!\n #currentResult: QueryObserverResult = undefined!\n #currentResultState?: QueryState\n #currentResultOptions?: QueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >\n #currentThenable: Thenable\n #selectError: TError | null\n #selectFn?: (data: TQueryData) => TData\n #selectResult?: TData\n // This property keeps track of the last query with defined data.\n // It will be used to pass the previous data and query to the placeholder function between renders.\n #lastQueryWithDefinedData?: Query\n #staleTimeoutId?: ManagedTimerId\n #refetchIntervalId?: ManagedTimerId\n #currentRefetchInterval?: number | false\n #trackedProps = new Set()\n\n constructor(\n client: QueryClient,\n public options: QueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >,\n ) {\n super()\n\n this.#client = client\n this.#selectError = null\n this.#currentThenable = pendingThenable()\n\n this.bindMethods()\n this.setOptions(options)\n }\n\n protected bindMethods(): void {\n this.refetch = this.refetch.bind(this)\n }\n\n protected onSubscribe(): void {\n if (this.listeners.size === 1) {\n this.#currentQuery.addObserver(this)\n\n if (shouldFetchOnMount(this.#currentQuery, this.options)) {\n this.#executeFetch()\n } else {\n this.updateResult()\n }\n\n this.#updateTimers()\n }\n }\n\n protected onUnsubscribe(): void {\n if (!this.hasListeners()) {\n this.destroy()\n }\n }\n\n shouldFetchOnReconnect(): boolean {\n return shouldFetchOn(\n this.#currentQuery,\n this.options,\n this.options.refetchOnReconnect,\n )\n }\n\n shouldFetchOnWindowFocus(): boolean {\n return shouldFetchOn(\n this.#currentQuery,\n this.options,\n this.options.refetchOnWindowFocus,\n )\n }\n\n destroy(): void {\n this.listeners = new Set()\n this.#clearStaleTimeout()\n this.#clearRefetchInterval()\n this.#currentQuery.removeObserver(this)\n }\n\n setOptions(\n options: QueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >,\n ): void {\n const prevOptions = this.options\n const prevQuery = this.#currentQuery\n\n this.options = this.#client.defaultQueryOptions(options)\n\n if (\n this.options.enabled !== undefined &&\n typeof this.options.enabled !== 'boolean' &&\n typeof this.options.enabled !== 'function' &&\n typeof resolveEnabled(this.options.enabled, this.#currentQuery) !==\n 'boolean'\n ) {\n throw new Error(\n 'Expected enabled to be a boolean or a callback that returns a boolean',\n )\n }\n\n this.#updateQuery()\n this.#currentQuery.setOptions(this.options)\n\n if (\n prevOptions._defaulted &&\n !shallowEqualObjects(this.options, prevOptions)\n ) {\n this.#client.getQueryCache().notify({\n type: 'observerOptionsUpdated',\n query: this.#currentQuery,\n observer: this,\n })\n }\n\n const mounted = this.hasListeners()\n\n // Fetch if there are subscribers\n if (\n mounted &&\n shouldFetchOptionally(\n this.#currentQuery,\n prevQuery,\n this.options,\n prevOptions,\n )\n ) {\n this.#executeFetch()\n }\n\n // Update result\n this.updateResult()\n\n // Update stale interval if needed\n if (\n mounted &&\n (this.#currentQuery !== prevQuery ||\n resolveEnabled(this.options.enabled, this.#currentQuery) !==\n resolveEnabled(prevOptions.enabled, this.#currentQuery) ||\n resolveStaleTime(this.options.staleTime, this.#currentQuery) !==\n resolveStaleTime(prevOptions.staleTime, this.#currentQuery))\n ) {\n this.#updateStaleTimeout()\n }\n\n const nextRefetchInterval = this.#computeRefetchInterval()\n\n // Update refetch interval if needed\n if (\n mounted &&\n (this.#currentQuery !== prevQuery ||\n resolveEnabled(this.options.enabled, this.#currentQuery) !==\n resolveEnabled(prevOptions.enabled, this.#currentQuery) ||\n nextRefetchInterval !== this.#currentRefetchInterval)\n ) {\n this.#updateRefetchInterval(nextRefetchInterval)\n }\n }\n\n getOptimisticResult(\n options: DefaultedQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >,\n ): QueryObserverResult {\n const query = this.#client.getQueryCache().build(this.#client, options)\n\n const result = this.createResult(query, options)\n\n if (shouldAssignObserverCurrentProperties(this, result)) {\n // this assigns the optimistic result to the current Observer\n // because if the query function changes, useQuery will be performing\n // an effect where it would fetch again.\n // When the fetch finishes, we perform a deep data cloning in order\n // to reuse objects references. This deep data clone is performed against\n // the `observer.currentResult.data` property\n // When QueryKey changes, we refresh the query and get new `optimistic`\n // result, while we leave the `observer.currentResult`, so when new data\n // arrives, it finds the old `observer.currentResult` which is related\n // to the old QueryKey. Which means that currentResult and selectData are\n // out of sync already.\n // To solve this, we move the cursor of the currentResult every time\n // an observer reads an optimistic value.\n\n // When keeping the previous data, the result doesn't change until new\n // data arrives.\n this.#currentResult = result\n this.#currentResultOptions = this.options\n this.#currentResultState = this.#currentQuery.state\n }\n return result\n }\n\n getCurrentResult(): QueryObserverResult {\n return this.#currentResult\n }\n\n trackResult(\n result: QueryObserverResult,\n onPropTracked?: (key: keyof QueryObserverResult) => void,\n ): QueryObserverResult {\n return new Proxy(result, {\n get: (target, key) => {\n this.trackProp(key as keyof QueryObserverResult)\n onPropTracked?.(key as keyof QueryObserverResult)\n if (key === 'promise') {\n this.trackProp('data')\n if (\n !this.options.experimental_prefetchInRender &&\n this.#currentThenable.status === 'pending'\n ) {\n this.#currentThenable.reject(\n new Error(\n 'experimental_prefetchInRender feature flag is not enabled',\n ),\n )\n }\n }\n return Reflect.get(target, key)\n },\n })\n }\n\n trackProp(key: keyof QueryObserverResult) {\n this.#trackedProps.add(key)\n }\n\n getCurrentQuery(): Query {\n return this.#currentQuery\n }\n\n refetch({ ...options }: RefetchOptions = {}): Promise<\n QueryObserverResult\n > {\n return this.fetch({\n ...options,\n })\n }\n\n fetchOptimistic(\n options: QueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >,\n ): Promise> {\n const defaultedOptions = this.#client.defaultQueryOptions(options)\n\n const query = this.#client\n .getQueryCache()\n .build(this.#client, defaultedOptions)\n\n return query.fetch().then(() => this.createResult(query, defaultedOptions))\n }\n\n protected fetch(\n fetchOptions: ObserverFetchOptions,\n ): Promise> {\n return this.#executeFetch({\n ...fetchOptions,\n cancelRefetch: fetchOptions.cancelRefetch ?? true,\n }).then(() => {\n this.updateResult()\n return this.#currentResult\n })\n }\n\n #executeFetch(\n fetchOptions?: Omit,\n ): Promise {\n // Make sure we reference the latest query as the current one might have been removed\n this.#updateQuery()\n\n // Fetch\n let promise: Promise = this.#currentQuery.fetch(\n this.options,\n fetchOptions,\n )\n\n if (!fetchOptions?.throwOnError) {\n promise = promise.catch(noop)\n }\n\n return promise\n }\n\n #updateStaleTimeout(): void {\n this.#clearStaleTimeout()\n const staleTime = resolveStaleTime(\n this.options.staleTime,\n this.#currentQuery,\n )\n\n if (isServer || this.#currentResult.isStale || !isValidTimeout(staleTime)) {\n return\n }\n\n const time = timeUntilStale(this.#currentResult.dataUpdatedAt, staleTime)\n\n // The timeout is sometimes triggered 1 ms before the stale time expiration.\n // To mitigate this issue we always add 1 ms to the timeout.\n const timeout = time + 1\n\n this.#staleTimeoutId = timeoutManager.setTimeout(() => {\n if (!this.#currentResult.isStale) {\n this.updateResult()\n }\n }, timeout)\n }\n\n #computeRefetchInterval() {\n return (\n (typeof this.options.refetchInterval === 'function'\n ? this.options.refetchInterval(this.#currentQuery)\n : this.options.refetchInterval) ?? false\n )\n }\n\n #updateRefetchInterval(nextInterval: number | false): void {\n this.#clearRefetchInterval()\n\n this.#currentRefetchInterval = nextInterval\n\n if (\n isServer ||\n resolveEnabled(this.options.enabled, this.#currentQuery) === false ||\n !isValidTimeout(this.#currentRefetchInterval) ||\n this.#currentRefetchInterval === 0\n ) {\n return\n }\n\n this.#refetchIntervalId = timeoutManager.setInterval(() => {\n if (\n this.options.refetchIntervalInBackground ||\n focusManager.isFocused()\n ) {\n this.#executeFetch()\n }\n }, this.#currentRefetchInterval)\n }\n\n #updateTimers(): void {\n this.#updateStaleTimeout()\n this.#updateRefetchInterval(this.#computeRefetchInterval())\n }\n\n #clearStaleTimeout(): void {\n if (this.#staleTimeoutId) {\n timeoutManager.clearTimeout(this.#staleTimeoutId)\n this.#staleTimeoutId = undefined\n }\n }\n\n #clearRefetchInterval(): void {\n if (this.#refetchIntervalId) {\n timeoutManager.clearInterval(this.#refetchIntervalId)\n this.#refetchIntervalId = undefined\n }\n }\n\n protected createResult(\n query: Query,\n options: QueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >,\n ): QueryObserverResult {\n const prevQuery = this.#currentQuery\n const prevOptions = this.options\n const prevResult = this.#currentResult as\n | QueryObserverResult\n | undefined\n const prevResultState = this.#currentResultState\n const prevResultOptions = this.#currentResultOptions\n const queryChange = query !== prevQuery\n const queryInitialState = queryChange\n ? query.state\n : this.#currentQueryInitialState\n\n const { state } = query\n let newState = { ...state }\n let isPlaceholderData = false\n let data: TData | undefined\n\n // Optimistically set result in fetching state if needed\n if (options._optimisticResults) {\n const mounted = this.hasListeners()\n\n const fetchOnMount = !mounted && shouldFetchOnMount(query, options)\n\n const fetchOptionally =\n mounted && shouldFetchOptionally(query, prevQuery, options, prevOptions)\n\n if (fetchOnMount || fetchOptionally) {\n newState = {\n ...newState,\n ...fetchState(state.data, query.options),\n }\n }\n if (options._optimisticResults === 'isRestoring') {\n newState.fetchStatus = 'idle'\n }\n }\n\n let { error, errorUpdatedAt, status } = newState\n\n // Per default, use query data\n data = newState.data as unknown as TData\n let skipSelect = false\n\n // use placeholderData if needed\n if (\n options.placeholderData !== undefined &&\n data === undefined &&\n status === 'pending'\n ) {\n let placeholderData\n\n // Memoize placeholder data\n if (\n prevResult?.isPlaceholderData &&\n options.placeholderData === prevResultOptions?.placeholderData\n ) {\n placeholderData = prevResult.data\n // we have to skip select when reading this memoization\n // because prevResult.data is already \"selected\"\n skipSelect = true\n } else {\n // compute placeholderData\n placeholderData =\n typeof options.placeholderData === 'function'\n ? (\n options.placeholderData as unknown as PlaceholderDataFunction\n )(\n this.#lastQueryWithDefinedData?.state.data,\n this.#lastQueryWithDefinedData as any,\n )\n : options.placeholderData\n }\n\n if (placeholderData !== undefined) {\n status = 'success'\n data = replaceData(\n prevResult?.data,\n placeholderData as unknown,\n options,\n ) as TData\n isPlaceholderData = true\n }\n }\n\n // Select data if needed\n // this also runs placeholderData through the select function\n if (options.select && data !== undefined && !skipSelect) {\n // Memoize select result\n if (\n prevResult &&\n data === prevResultState?.data &&\n options.select === this.#selectFn\n ) {\n data = this.#selectResult\n } else {\n try {\n this.#selectFn = options.select\n data = options.select(data as any)\n data = replaceData(prevResult?.data, data, options)\n this.#selectResult = data\n this.#selectError = null\n } catch (selectError) {\n this.#selectError = selectError as TError\n }\n }\n }\n\n if (this.#selectError) {\n error = this.#selectError\n data = this.#selectResult\n errorUpdatedAt = Date.now()\n status = 'error'\n }\n\n const isFetching = newState.fetchStatus === 'fetching'\n const isPending = status === 'pending'\n const isError = status === 'error'\n\n const isLoading = isPending && isFetching\n const hasData = data !== undefined\n\n const result: QueryObserverBaseResult = {\n status,\n fetchStatus: newState.fetchStatus,\n isPending,\n isSuccess: status === 'success',\n isError,\n isInitialLoading: isLoading,\n isLoading,\n data,\n dataUpdatedAt: newState.dataUpdatedAt,\n error,\n errorUpdatedAt,\n failureCount: newState.fetchFailureCount,\n failureReason: newState.fetchFailureReason,\n errorUpdateCount: newState.errorUpdateCount,\n isFetched: newState.dataUpdateCount > 0 || newState.errorUpdateCount > 0,\n isFetchedAfterMount:\n newState.dataUpdateCount > queryInitialState.dataUpdateCount ||\n newState.errorUpdateCount > queryInitialState.errorUpdateCount,\n isFetching,\n isRefetching: isFetching && !isPending,\n isLoadingError: isError && !hasData,\n isPaused: newState.fetchStatus === 'paused',\n isPlaceholderData,\n isRefetchError: isError && hasData,\n isStale: isStale(query, options),\n refetch: this.refetch,\n promise: this.#currentThenable,\n isEnabled: resolveEnabled(options.enabled, query) !== false,\n }\n\n const nextResult = result as QueryObserverResult\n\n if (this.options.experimental_prefetchInRender) {\n const hasResultData = nextResult.data !== undefined\n const isErrorWithoutData = nextResult.status === 'error' && !hasResultData\n const finalizeThenableIfPossible = (thenable: PendingThenable) => {\n if (isErrorWithoutData) {\n thenable.reject(nextResult.error)\n } else if (hasResultData) {\n thenable.resolve(nextResult.data as TData)\n }\n }\n\n /**\n * Create a new thenable and result promise when the results have changed\n */\n const recreateThenable = () => {\n const pending =\n (this.#currentThenable =\n nextResult.promise =\n pendingThenable())\n\n finalizeThenableIfPossible(pending)\n }\n\n const prevThenable = this.#currentThenable\n switch (prevThenable.status) {\n case 'pending':\n // Finalize the previous thenable if it was pending\n // and we are still observing the same query\n if (query.queryHash === prevQuery.queryHash) {\n finalizeThenableIfPossible(prevThenable)\n }\n break\n case 'fulfilled':\n if (isErrorWithoutData || nextResult.data !== prevThenable.value) {\n recreateThenable()\n }\n break\n case 'rejected':\n if (!isErrorWithoutData || nextResult.error !== prevThenable.reason) {\n recreateThenable()\n }\n break\n }\n }\n\n return nextResult\n }\n\n updateResult(): void {\n const prevResult = this.#currentResult as\n | QueryObserverResult\n | undefined\n\n const nextResult = this.createResult(this.#currentQuery, this.options)\n\n this.#currentResultState = this.#currentQuery.state\n this.#currentResultOptions = this.options\n\n if (this.#currentResultState.data !== undefined) {\n this.#lastQueryWithDefinedData = this.#currentQuery\n }\n\n // Only notify and update result if something has changed\n if (shallowEqualObjects(nextResult, prevResult)) {\n return\n }\n\n this.#currentResult = nextResult\n\n const shouldNotifyListeners = (): boolean => {\n if (!prevResult) {\n return true\n }\n\n const { notifyOnChangeProps } = this.options\n const notifyOnChangePropsValue =\n typeof notifyOnChangeProps === 'function'\n ? notifyOnChangeProps()\n : notifyOnChangeProps\n\n if (\n notifyOnChangePropsValue === 'all' ||\n (!notifyOnChangePropsValue && !this.#trackedProps.size)\n ) {\n return true\n }\n\n const includedProps = new Set(\n notifyOnChangePropsValue ?? this.#trackedProps,\n )\n\n if (this.options.throwOnError) {\n includedProps.add('error')\n }\n\n return Object.keys(this.#currentResult).some((key) => {\n const typedKey = key as keyof QueryObserverResult\n const changed = this.#currentResult[typedKey] !== prevResult[typedKey]\n\n return changed && includedProps.has(typedKey)\n })\n }\n\n this.#notify({ listeners: shouldNotifyListeners() })\n }\n\n #updateQuery(): void {\n const query = this.#client.getQueryCache().build(this.#client, this.options)\n\n if (query === this.#currentQuery) {\n return\n }\n\n const prevQuery = this.#currentQuery as\n | Query\n | undefined\n this.#currentQuery = query\n this.#currentQueryInitialState = query.state\n\n if (this.hasListeners()) {\n prevQuery?.removeObserver(this)\n query.addObserver(this)\n }\n }\n\n onQueryUpdate(): void {\n this.updateResult()\n\n if (this.hasListeners()) {\n this.#updateTimers()\n }\n }\n\n #notify(notifyOptions: { listeners: boolean }): void {\n notifyManager.batch(() => {\n // First, trigger the listeners\n if (notifyOptions.listeners) {\n this.listeners.forEach((listener) => {\n listener(this.#currentResult)\n })\n }\n\n // Then the cache listeners\n this.#client.getQueryCache().notify({\n query: this.#currentQuery,\n type: 'observerResultsUpdated',\n })\n })\n }\n}\n\nfunction shouldLoadOnMount(\n query: Query,\n options: QueryObserverOptions,\n): boolean {\n return (\n resolveEnabled(options.enabled, query) !== false &&\n query.state.data === undefined &&\n !(query.state.status === 'error' && options.retryOnMount === false)\n )\n}\n\nfunction shouldFetchOnMount(\n query: Query,\n options: QueryObserverOptions,\n): boolean {\n return (\n shouldLoadOnMount(query, options) ||\n (query.state.data !== undefined &&\n shouldFetchOn(query, options, options.refetchOnMount))\n )\n}\n\nfunction shouldFetchOn(\n query: Query,\n options: QueryObserverOptions,\n field: (typeof options)['refetchOnMount'] &\n (typeof options)['refetchOnWindowFocus'] &\n (typeof options)['refetchOnReconnect'],\n) {\n if (\n resolveEnabled(options.enabled, query) !== false &&\n resolveStaleTime(options.staleTime, query) !== 'static'\n ) {\n const value = typeof field === 'function' ? field(query) : field\n\n return value === 'always' || (value !== false && isStale(query, options))\n }\n return false\n}\n\nfunction shouldFetchOptionally(\n query: Query,\n prevQuery: Query,\n options: QueryObserverOptions,\n prevOptions: QueryObserverOptions,\n): boolean {\n return (\n (query !== prevQuery ||\n resolveEnabled(prevOptions.enabled, query) === false) &&\n (!options.suspense || query.state.status !== 'error') &&\n isStale(query, options)\n )\n}\n\nfunction isStale(\n query: Query,\n options: QueryObserverOptions,\n): boolean {\n return (\n resolveEnabled(options.enabled, query) !== false &&\n query.isStaleByTime(resolveStaleTime(options.staleTime, query))\n )\n}\n\n// this function would decide if we will update the observer's 'current'\n// properties after an optimistic reading via getOptimisticResult\nfunction shouldAssignObserverCurrentProperties<\n TQueryFnData = unknown,\n TError = unknown,\n TData = TQueryFnData,\n TQueryData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n observer: QueryObserver,\n optimisticResult: QueryObserverResult,\n) {\n // if the newly created result isn't what the observer is holding as current,\n // then we'll need to update the properties as well\n if (!shallowEqualObjects(observer.getCurrentResult(), optimisticResult)) {\n return true\n }\n\n // basically, just keep previous properties if nothing changed\n return false\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,0BAA6B;AAC7B,2BAA8B;AAC9B,mBAA2B;AAC3B,0BAA6B;AAC7B,sBAAgC;AAChC,mBASO;AACP,4BAA+B;AAwBxB,IAAM,gBAAN,cAMG,iCAAmD;AAAA,EAyB3D,YACE,QACO,SAOP;AACA,UAAM;AARC;AAUP,SAAK,UAAU;AACf,SAAK,eAAe;AACpB,SAAK,uBAAmB,iCAAgB;AAExC,SAAK,YAAY;AACjB,SAAK,WAAW,OAAO;AAAA,EACzB;AAAA,EA1CA;AAAA,EACA,gBAAoE;AAAA,EACpE,4BAA4D;AAAA,EAC5D,iBAAqD;AAAA,EACrD;AAAA,EACA;AAAA,EAOA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA;AAAA;AAAA,EAGA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,gBAAgB,oBAAI,IAA+B;AAAA,EAsBzC,cAAoB;AAC5B,SAAK,UAAU,KAAK,QAAQ,KAAK,IAAI;AAAA,EACvC;AAAA,EAEU,cAAoB;AAC5B,QAAI,KAAK,UAAU,SAAS,GAAG;AAC7B,WAAK,cAAc,YAAY,IAAI;AAEnC,UAAI,mBAAmB,KAAK,eAAe,KAAK,OAAO,GAAG;AACxD,aAAK,cAAc;AAAA,MACrB,OAAO;AACL,aAAK,aAAa;AAAA,MACpB;AAEA,WAAK,cAAc;AAAA,IACrB;AAAA,EACF;AAAA,EAEU,gBAAsB;AAC9B,QAAI,C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,cACP,OACA,SACA,OAGA;AACA,UACE,6BAAe,QAAQ,SAAS,KAAK,MAAM,aAC3C,+BAAiB,QAAQ,WAAW,KAAK,MAAM,UAC/C;AACA,UAAM,QAAQ,OAAO,UAAU,aAAa,MAAM,KAAK,IAAI;AAE3D,WAAO,UAAU,YAAa,UAAU,SAAS,QAAQ,OAAO,OAAO;AAAA,EACzE;AACA,SAAO;AACT;AAEA,SAAS,sBACP,OACA,WACA,SACA,aACS;AACT,UACG,UAAU,iBACT,6BAAe,YAAY,SAAS,KAAK,MAAM,WAChD,CAAC,QAAQ,YAAY,MAAM,MAAM,WAAW,YAC7C,QAAQ,OAAO,OAAO;AAE1B;AAEA,SAAS,QACP,OACA,SACS;AACT,aACE,6BAAe,QAAQ,SAAS,KAAK,MAAM,SAC3C,MAAM,kBAAc,+BAAiB,QAAQ,WAAW,KAAK,CAAC;AAElE;AAIA,SAAS,sCAOP,UACA,kBACA;AAGA,MAAI,KAAC,kCAAoB,SAAS,iBAAiB,GAAG,gBAAgB,GAAG;AACvE,WAAO;AAAA,EACT;AAGA,SAAO;AACT;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/queryObserver.d.cts b/node_modules/@tanstack/query-core/build/modern/queryObserver.d.cts deleted file mode 100644 index 36ba2bd..0000000 --- a/node_modules/@tanstack/query-core/build/modern/queryObserver.d.cts +++ /dev/null @@ -1,3 +0,0 @@ -import './subscribable.cjs'; -export { i as QueryObserver } from './hydration-uphG6M-i.cjs'; -import './removable.cjs'; diff --git a/node_modules/@tanstack/query-core/build/modern/queryObserver.d.ts b/node_modules/@tanstack/query-core/build/modern/queryObserver.d.ts deleted file mode 100644 index ae279c2..0000000 --- a/node_modules/@tanstack/query-core/build/modern/queryObserver.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import './subscribable.js'; -export { i as QueryObserver } from './hydration-BlEVG2Lp.js'; -import './removable.js'; diff --git a/node_modules/@tanstack/query-core/build/modern/queryObserver.js b/node_modules/@tanstack/query-core/build/modern/queryObserver.js deleted file mode 100644 index 279baf4..0000000 --- a/node_modules/@tanstack/query-core/build/modern/queryObserver.js +++ /dev/null @@ -1,472 +0,0 @@ -// src/queryObserver.ts -import { focusManager } from "./focusManager.js"; -import { notifyManager } from "./notifyManager.js"; -import { fetchState } from "./query.js"; -import { Subscribable } from "./subscribable.js"; -import { pendingThenable } from "./thenable.js"; -import { - isServer, - isValidTimeout, - noop, - replaceData, - resolveEnabled, - resolveStaleTime, - shallowEqualObjects, - timeUntilStale -} from "./utils.js"; -import { timeoutManager } from "./timeoutManager.js"; -var QueryObserver = class extends Subscribable { - constructor(client, options) { - super(); - this.options = options; - this.#client = client; - this.#selectError = null; - this.#currentThenable = pendingThenable(); - this.bindMethods(); - this.setOptions(options); - } - #client; - #currentQuery = void 0; - #currentQueryInitialState = void 0; - #currentResult = void 0; - #currentResultState; - #currentResultOptions; - #currentThenable; - #selectError; - #selectFn; - #selectResult; - // This property keeps track of the last query with defined data. - // It will be used to pass the previous data and query to the placeholder function between renders. - #lastQueryWithDefinedData; - #staleTimeoutId; - #refetchIntervalId; - #currentRefetchInterval; - #trackedProps = /* @__PURE__ */ new Set(); - bindMethods() { - this.refetch = this.refetch.bind(this); - } - onSubscribe() { - if (this.listeners.size === 1) { - this.#currentQuery.addObserver(this); - if (shouldFetchOnMount(this.#currentQuery, this.options)) { - this.#executeFetch(); - } else { - this.updateResult(); - } - this.#updateTimers(); - } - } - onUnsubscribe() { - if (!this.hasListeners()) { - this.destroy(); - } - } - shouldFetchOnReconnect() { - return shouldFetchOn( - this.#currentQuery, - this.options, - this.options.refetchOnReconnect - ); - } - shouldFetchOnWindowFocus() { - return shouldFetchOn( - this.#currentQuery, - this.options, - this.options.refetchOnWindowFocus - ); - } - destroy() { - this.listeners = /* @__PURE__ */ new Set(); - this.#clearStaleTimeout(); - this.#clearRefetchInterval(); - this.#currentQuery.removeObserver(this); - } - setOptions(options) { - const prevOptions = this.options; - const prevQuery = this.#currentQuery; - this.options = this.#client.defaultQueryOptions(options); - 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" - ); - } - this.#updateQuery(); - this.#currentQuery.setOptions(this.options); - if (prevOptions._defaulted && !shallowEqualObjects(this.options, prevOptions)) { - this.#client.getQueryCache().notify({ - type: "observerOptionsUpdated", - query: this.#currentQuery, - observer: this - }); - } - const mounted = this.hasListeners(); - if (mounted && shouldFetchOptionally( - this.#currentQuery, - prevQuery, - this.options, - prevOptions - )) { - this.#executeFetch(); - } - this.updateResult(); - 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(); - } - const nextRefetchInterval = this.#computeRefetchInterval(); - if (mounted && (this.#currentQuery !== prevQuery || resolveEnabled(this.options.enabled, this.#currentQuery) !== resolveEnabled(prevOptions.enabled, this.#currentQuery) || nextRefetchInterval !== this.#currentRefetchInterval)) { - this.#updateRefetchInterval(nextRefetchInterval); - } - } - getOptimisticResult(options) { - const query = this.#client.getQueryCache().build(this.#client, options); - const result = this.createResult(query, options); - if (shouldAssignObserverCurrentProperties(this, result)) { - this.#currentResult = result; - this.#currentResultOptions = this.options; - this.#currentResultState = this.#currentQuery.state; - } - return result; - } - getCurrentResult() { - return this.#currentResult; - } - trackResult(result, onPropTracked) { - return new Proxy(result, { - get: (target, key) => { - this.trackProp(key); - onPropTracked?.(key); - if (key === "promise") { - this.trackProp("data"); - if (!this.options.experimental_prefetchInRender && this.#currentThenable.status === "pending") { - this.#currentThenable.reject( - new Error( - "experimental_prefetchInRender feature flag is not enabled" - ) - ); - } - } - return Reflect.get(target, key); - } - }); - } - trackProp(key) { - this.#trackedProps.add(key); - } - getCurrentQuery() { - return this.#currentQuery; - } - refetch({ ...options } = {}) { - return this.fetch({ - ...options - }); - } - fetchOptimistic(options) { - const defaultedOptions = this.#client.defaultQueryOptions(options); - const query = this.#client.getQueryCache().build(this.#client, defaultedOptions); - return query.fetch().then(() => this.createResult(query, defaultedOptions)); - } - fetch(fetchOptions) { - return this.#executeFetch({ - ...fetchOptions, - cancelRefetch: fetchOptions.cancelRefetch ?? true - }).then(() => { - this.updateResult(); - return this.#currentResult; - }); - } - #executeFetch(fetchOptions) { - this.#updateQuery(); - let promise = this.#currentQuery.fetch( - this.options, - fetchOptions - ); - if (!fetchOptions?.throwOnError) { - promise = promise.catch(noop); - } - return promise; - } - #updateStaleTimeout() { - this.#clearStaleTimeout(); - const staleTime = resolveStaleTime( - this.options.staleTime, - this.#currentQuery - ); - if (isServer || this.#currentResult.isStale || !isValidTimeout(staleTime)) { - return; - } - const time = timeUntilStale(this.#currentResult.dataUpdatedAt, staleTime); - const timeout = time + 1; - this.#staleTimeoutId = timeoutManager.setTimeout(() => { - if (!this.#currentResult.isStale) { - this.updateResult(); - } - }, timeout); - } - #computeRefetchInterval() { - return (typeof this.options.refetchInterval === "function" ? this.options.refetchInterval(this.#currentQuery) : this.options.refetchInterval) ?? false; - } - #updateRefetchInterval(nextInterval) { - this.#clearRefetchInterval(); - this.#currentRefetchInterval = nextInterval; - if (isServer || resolveEnabled(this.options.enabled, this.#currentQuery) === false || !isValidTimeout(this.#currentRefetchInterval) || this.#currentRefetchInterval === 0) { - return; - } - this.#refetchIntervalId = timeoutManager.setInterval(() => { - if (this.options.refetchIntervalInBackground || focusManager.isFocused()) { - this.#executeFetch(); - } - }, this.#currentRefetchInterval); - } - #updateTimers() { - this.#updateStaleTimeout(); - this.#updateRefetchInterval(this.#computeRefetchInterval()); - } - #clearStaleTimeout() { - if (this.#staleTimeoutId) { - timeoutManager.clearTimeout(this.#staleTimeoutId); - this.#staleTimeoutId = void 0; - } - } - #clearRefetchInterval() { - if (this.#refetchIntervalId) { - timeoutManager.clearInterval(this.#refetchIntervalId); - this.#refetchIntervalId = void 0; - } - } - createResult(query, options) { - const prevQuery = this.#currentQuery; - const prevOptions = this.options; - const prevResult = this.#currentResult; - const prevResultState = this.#currentResultState; - const prevResultOptions = this.#currentResultOptions; - const queryChange = query !== prevQuery; - const queryInitialState = queryChange ? query.state : this.#currentQueryInitialState; - const { state } = query; - let newState = { ...state }; - let isPlaceholderData = false; - let data; - if (options._optimisticResults) { - const mounted = this.hasListeners(); - const fetchOnMount = !mounted && shouldFetchOnMount(query, options); - const fetchOptionally = mounted && shouldFetchOptionally(query, prevQuery, options, prevOptions); - if (fetchOnMount || fetchOptionally) { - newState = { - ...newState, - ...fetchState(state.data, query.options) - }; - } - if (options._optimisticResults === "isRestoring") { - newState.fetchStatus = "idle"; - } - } - let { error, errorUpdatedAt, status } = newState; - data = newState.data; - let skipSelect = false; - if (options.placeholderData !== void 0 && data === void 0 && status === "pending") { - let placeholderData; - if (prevResult?.isPlaceholderData && options.placeholderData === prevResultOptions?.placeholderData) { - placeholderData = prevResult.data; - skipSelect = true; - } else { - placeholderData = typeof options.placeholderData === "function" ? options.placeholderData( - this.#lastQueryWithDefinedData?.state.data, - this.#lastQueryWithDefinedData - ) : options.placeholderData; - } - if (placeholderData !== void 0) { - status = "success"; - data = replaceData( - prevResult?.data, - placeholderData, - options - ); - isPlaceholderData = true; - } - } - if (options.select && data !== void 0 && !skipSelect) { - if (prevResult && data === prevResultState?.data && options.select === this.#selectFn) { - data = this.#selectResult; - } else { - try { - this.#selectFn = options.select; - data = options.select(data); - data = replaceData(prevResult?.data, data, options); - this.#selectResult = data; - this.#selectError = null; - } catch (selectError) { - this.#selectError = selectError; - } - } - } - if (this.#selectError) { - error = this.#selectError; - data = this.#selectResult; - errorUpdatedAt = Date.now(); - status = "error"; - } - const isFetching = newState.fetchStatus === "fetching"; - const isPending = status === "pending"; - const isError = status === "error"; - const isLoading = isPending && isFetching; - const hasData = data !== void 0; - const result = { - status, - fetchStatus: newState.fetchStatus, - isPending, - isSuccess: status === "success", - isError, - isInitialLoading: isLoading, - isLoading, - data, - dataUpdatedAt: newState.dataUpdatedAt, - error, - errorUpdatedAt, - failureCount: newState.fetchFailureCount, - failureReason: newState.fetchFailureReason, - errorUpdateCount: newState.errorUpdateCount, - isFetched: newState.dataUpdateCount > 0 || newState.errorUpdateCount > 0, - isFetchedAfterMount: newState.dataUpdateCount > queryInitialState.dataUpdateCount || newState.errorUpdateCount > queryInitialState.errorUpdateCount, - isFetching, - isRefetching: isFetching && !isPending, - isLoadingError: isError && !hasData, - isPaused: newState.fetchStatus === "paused", - isPlaceholderData, - isRefetchError: isError && hasData, - isStale: isStale(query, options), - refetch: this.refetch, - promise: this.#currentThenable, - isEnabled: resolveEnabled(options.enabled, query) !== false - }; - const nextResult = result; - if (this.options.experimental_prefetchInRender) { - const hasResultData = nextResult.data !== void 0; - const isErrorWithoutData = nextResult.status === "error" && !hasResultData; - const finalizeThenableIfPossible = (thenable) => { - if (isErrorWithoutData) { - thenable.reject(nextResult.error); - } else if (hasResultData) { - thenable.resolve(nextResult.data); - } - }; - const recreateThenable = () => { - const pending = this.#currentThenable = nextResult.promise = pendingThenable(); - finalizeThenableIfPossible(pending); - }; - const prevThenable = this.#currentThenable; - switch (prevThenable.status) { - case "pending": - if (query.queryHash === prevQuery.queryHash) { - finalizeThenableIfPossible(prevThenable); - } - break; - case "fulfilled": - if (isErrorWithoutData || nextResult.data !== prevThenable.value) { - recreateThenable(); - } - break; - case "rejected": - if (!isErrorWithoutData || nextResult.error !== prevThenable.reason) { - recreateThenable(); - } - break; - } - } - return nextResult; - } - updateResult() { - const prevResult = this.#currentResult; - const nextResult = this.createResult(this.#currentQuery, this.options); - this.#currentResultState = this.#currentQuery.state; - this.#currentResultOptions = this.options; - if (this.#currentResultState.data !== void 0) { - this.#lastQueryWithDefinedData = this.#currentQuery; - } - if (shallowEqualObjects(nextResult, prevResult)) { - return; - } - this.#currentResult = nextResult; - const shouldNotifyListeners = () => { - if (!prevResult) { - return true; - } - const { notifyOnChangeProps } = this.options; - const notifyOnChangePropsValue = typeof notifyOnChangeProps === "function" ? notifyOnChangeProps() : notifyOnChangeProps; - if (notifyOnChangePropsValue === "all" || !notifyOnChangePropsValue && !this.#trackedProps.size) { - return true; - } - const includedProps = new Set( - notifyOnChangePropsValue ?? this.#trackedProps - ); - if (this.options.throwOnError) { - includedProps.add("error"); - } - return Object.keys(this.#currentResult).some((key) => { - const typedKey = key; - const changed = this.#currentResult[typedKey] !== prevResult[typedKey]; - return changed && includedProps.has(typedKey); - }); - }; - this.#notify({ listeners: shouldNotifyListeners() }); - } - #updateQuery() { - const query = this.#client.getQueryCache().build(this.#client, this.options); - if (query === this.#currentQuery) { - return; - } - const prevQuery = this.#currentQuery; - this.#currentQuery = query; - this.#currentQueryInitialState = query.state; - if (this.hasListeners()) { - prevQuery?.removeObserver(this); - query.addObserver(this); - } - } - onQueryUpdate() { - this.updateResult(); - if (this.hasListeners()) { - this.#updateTimers(); - } - } - #notify(notifyOptions) { - notifyManager.batch(() => { - if (notifyOptions.listeners) { - this.listeners.forEach((listener) => { - listener(this.#currentResult); - }); - } - this.#client.getQueryCache().notify({ - query: this.#currentQuery, - type: "observerResultsUpdated" - }); - }); - } -}; -function shouldLoadOnMount(query, options) { - return resolveEnabled(options.enabled, query) !== false && query.state.data === void 0 && !(query.state.status === "error" && options.retryOnMount === false); -} -function shouldFetchOnMount(query, options) { - return shouldLoadOnMount(query, options) || query.state.data !== void 0 && shouldFetchOn(query, options, options.refetchOnMount); -} -function shouldFetchOn(query, options, field) { - if (resolveEnabled(options.enabled, query) !== false && resolveStaleTime(options.staleTime, query) !== "static") { - const value = typeof field === "function" ? field(query) : field; - return value === "always" || value !== false && isStale(query, options); - } - return false; -} -function shouldFetchOptionally(query, prevQuery, options, prevOptions) { - return (query !== prevQuery || resolveEnabled(prevOptions.enabled, query) === false) && (!options.suspense || query.state.status !== "error") && isStale(query, options); -} -function isStale(query, options) { - return resolveEnabled(options.enabled, query) !== false && query.isStaleByTime(resolveStaleTime(options.staleTime, query)); -} -function shouldAssignObserverCurrentProperties(observer, optimisticResult) { - if (!shallowEqualObjects(observer.getCurrentResult(), optimisticResult)) { - return true; - } - return false; -} -export { - QueryObserver -}; -//# sourceMappingURL=queryObserver.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/queryObserver.js.map b/node_modules/@tanstack/query-core/build/modern/queryObserver.js.map deleted file mode 100644 index 8d39b66..0000000 --- a/node_modules/@tanstack/query-core/build/modern/queryObserver.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/queryObserver.ts"],"sourcesContent":["import { focusManager } from './focusManager'\nimport { notifyManager } from './notifyManager'\nimport { fetchState } from './query'\nimport { Subscribable } from './subscribable'\nimport { pendingThenable } from './thenable'\nimport {\n isServer,\n isValidTimeout,\n noop,\n replaceData,\n resolveEnabled,\n resolveStaleTime,\n shallowEqualObjects,\n timeUntilStale,\n} from './utils'\nimport { timeoutManager } from './timeoutManager'\nimport type { ManagedTimerId } from './timeoutManager'\nimport type { FetchOptions, Query, QueryState } from './query'\nimport type { QueryClient } from './queryClient'\nimport type { PendingThenable, Thenable } from './thenable'\nimport type {\n DefaultError,\n DefaultedQueryObserverOptions,\n PlaceholderDataFunction,\n QueryKey,\n QueryObserverBaseResult,\n QueryObserverOptions,\n QueryObserverResult,\n RefetchOptions,\n} from './types'\n\ntype QueryObserverListener = (\n result: QueryObserverResult,\n) => void\n\ninterface ObserverFetchOptions extends FetchOptions {\n throwOnError?: boolean\n}\n\nexport class QueryObserver<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> extends Subscribable> {\n #client: QueryClient\n #currentQuery: Query = undefined!\n #currentQueryInitialState: QueryState = undefined!\n #currentResult: QueryObserverResult = undefined!\n #currentResultState?: QueryState\n #currentResultOptions?: QueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >\n #currentThenable: Thenable\n #selectError: TError | null\n #selectFn?: (data: TQueryData) => TData\n #selectResult?: TData\n // This property keeps track of the last query with defined data.\n // It will be used to pass the previous data and query to the placeholder function between renders.\n #lastQueryWithDefinedData?: Query\n #staleTimeoutId?: ManagedTimerId\n #refetchIntervalId?: ManagedTimerId\n #currentRefetchInterval?: number | false\n #trackedProps = new Set()\n\n constructor(\n client: QueryClient,\n public options: QueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >,\n ) {\n super()\n\n this.#client = client\n this.#selectError = null\n this.#currentThenable = pendingThenable()\n\n this.bindMethods()\n this.setOptions(options)\n }\n\n protected bindMethods(): void {\n this.refetch = this.refetch.bind(this)\n }\n\n protected onSubscribe(): void {\n if (this.listeners.size === 1) {\n this.#currentQuery.addObserver(this)\n\n if (shouldFetchOnMount(this.#currentQuery, this.options)) {\n this.#executeFetch()\n } else {\n this.updateResult()\n }\n\n this.#updateTimers()\n }\n }\n\n protected onUnsubscribe(): void {\n if (!this.hasListeners()) {\n this.destroy()\n }\n }\n\n shouldFetchOnReconnect(): boolean {\n return shouldFetchOn(\n this.#currentQuery,\n this.options,\n this.options.refetchOnReconnect,\n )\n }\n\n shouldFetchOnWindowFocus(): boolean {\n return shouldFetchOn(\n this.#currentQuery,\n this.options,\n this.options.refetchOnWindowFocus,\n )\n }\n\n destroy(): void {\n this.listeners = new Set()\n this.#clearStaleTimeout()\n this.#clearRefetchInterval()\n this.#currentQuery.removeObserver(this)\n }\n\n setOptions(\n options: QueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >,\n ): void {\n const prevOptions = this.options\n const prevQuery = this.#currentQuery\n\n this.options = this.#client.defaultQueryOptions(options)\n\n if (\n this.options.enabled !== undefined &&\n typeof this.options.enabled !== 'boolean' &&\n typeof this.options.enabled !== 'function' &&\n typeof resolveEnabled(this.options.enabled, this.#currentQuery) !==\n 'boolean'\n ) {\n throw new Error(\n 'Expected enabled to be a boolean or a callback that returns a boolean',\n )\n }\n\n this.#updateQuery()\n this.#currentQuery.setOptions(this.options)\n\n if (\n prevOptions._defaulted &&\n !shallowEqualObjects(this.options, prevOptions)\n ) {\n this.#client.getQueryCache().notify({\n type: 'observerOptionsUpdated',\n query: this.#currentQuery,\n observer: this,\n })\n }\n\n const mounted = this.hasListeners()\n\n // Fetch if there are subscribers\n if (\n mounted &&\n shouldFetchOptionally(\n this.#currentQuery,\n prevQuery,\n this.options,\n prevOptions,\n )\n ) {\n this.#executeFetch()\n }\n\n // Update result\n this.updateResult()\n\n // Update stale interval if needed\n if (\n mounted &&\n (this.#currentQuery !== prevQuery ||\n resolveEnabled(this.options.enabled, this.#currentQuery) !==\n resolveEnabled(prevOptions.enabled, this.#currentQuery) ||\n resolveStaleTime(this.options.staleTime, this.#currentQuery) !==\n resolveStaleTime(prevOptions.staleTime, this.#currentQuery))\n ) {\n this.#updateStaleTimeout()\n }\n\n const nextRefetchInterval = this.#computeRefetchInterval()\n\n // Update refetch interval if needed\n if (\n mounted &&\n (this.#currentQuery !== prevQuery ||\n resolveEnabled(this.options.enabled, this.#currentQuery) !==\n resolveEnabled(prevOptions.enabled, this.#currentQuery) ||\n nextRefetchInterval !== this.#currentRefetchInterval)\n ) {\n this.#updateRefetchInterval(nextRefetchInterval)\n }\n }\n\n getOptimisticResult(\n options: DefaultedQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >,\n ): QueryObserverResult {\n const query = this.#client.getQueryCache().build(this.#client, options)\n\n const result = this.createResult(query, options)\n\n if (shouldAssignObserverCurrentProperties(this, result)) {\n // this assigns the optimistic result to the current Observer\n // because if the query function changes, useQuery will be performing\n // an effect where it would fetch again.\n // When the fetch finishes, we perform a deep data cloning in order\n // to reuse objects references. This deep data clone is performed against\n // the `observer.currentResult.data` property\n // When QueryKey changes, we refresh the query and get new `optimistic`\n // result, while we leave the `observer.currentResult`, so when new data\n // arrives, it finds the old `observer.currentResult` which is related\n // to the old QueryKey. Which means that currentResult and selectData are\n // out of sync already.\n // To solve this, we move the cursor of the currentResult every time\n // an observer reads an optimistic value.\n\n // When keeping the previous data, the result doesn't change until new\n // data arrives.\n this.#currentResult = result\n this.#currentResultOptions = this.options\n this.#currentResultState = this.#currentQuery.state\n }\n return result\n }\n\n getCurrentResult(): QueryObserverResult {\n return this.#currentResult\n }\n\n trackResult(\n result: QueryObserverResult,\n onPropTracked?: (key: keyof QueryObserverResult) => void,\n ): QueryObserverResult {\n return new Proxy(result, {\n get: (target, key) => {\n this.trackProp(key as keyof QueryObserverResult)\n onPropTracked?.(key as keyof QueryObserverResult)\n if (key === 'promise') {\n this.trackProp('data')\n if (\n !this.options.experimental_prefetchInRender &&\n this.#currentThenable.status === 'pending'\n ) {\n this.#currentThenable.reject(\n new Error(\n 'experimental_prefetchInRender feature flag is not enabled',\n ),\n )\n }\n }\n return Reflect.get(target, key)\n },\n })\n }\n\n trackProp(key: keyof QueryObserverResult) {\n this.#trackedProps.add(key)\n }\n\n getCurrentQuery(): Query {\n return this.#currentQuery\n }\n\n refetch({ ...options }: RefetchOptions = {}): Promise<\n QueryObserverResult\n > {\n return this.fetch({\n ...options,\n })\n }\n\n fetchOptimistic(\n options: QueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >,\n ): Promise> {\n const defaultedOptions = this.#client.defaultQueryOptions(options)\n\n const query = this.#client\n .getQueryCache()\n .build(this.#client, defaultedOptions)\n\n return query.fetch().then(() => this.createResult(query, defaultedOptions))\n }\n\n protected fetch(\n fetchOptions: ObserverFetchOptions,\n ): Promise> {\n return this.#executeFetch({\n ...fetchOptions,\n cancelRefetch: fetchOptions.cancelRefetch ?? true,\n }).then(() => {\n this.updateResult()\n return this.#currentResult\n })\n }\n\n #executeFetch(\n fetchOptions?: Omit,\n ): Promise {\n // Make sure we reference the latest query as the current one might have been removed\n this.#updateQuery()\n\n // Fetch\n let promise: Promise = this.#currentQuery.fetch(\n this.options,\n fetchOptions,\n )\n\n if (!fetchOptions?.throwOnError) {\n promise = promise.catch(noop)\n }\n\n return promise\n }\n\n #updateStaleTimeout(): void {\n this.#clearStaleTimeout()\n const staleTime = resolveStaleTime(\n this.options.staleTime,\n this.#currentQuery,\n )\n\n if (isServer || this.#currentResult.isStale || !isValidTimeout(staleTime)) {\n return\n }\n\n const time = timeUntilStale(this.#currentResult.dataUpdatedAt, staleTime)\n\n // The timeout is sometimes triggered 1 ms before the stale time expiration.\n // To mitigate this issue we always add 1 ms to the timeout.\n const timeout = time + 1\n\n this.#staleTimeoutId = timeoutManager.setTimeout(() => {\n if (!this.#currentResult.isStale) {\n this.updateResult()\n }\n }, timeout)\n }\n\n #computeRefetchInterval() {\n return (\n (typeof this.options.refetchInterval === 'function'\n ? this.options.refetchInterval(this.#currentQuery)\n : this.options.refetchInterval) ?? false\n )\n }\n\n #updateRefetchInterval(nextInterval: number | false): void {\n this.#clearRefetchInterval()\n\n this.#currentRefetchInterval = nextInterval\n\n if (\n isServer ||\n resolveEnabled(this.options.enabled, this.#currentQuery) === false ||\n !isValidTimeout(this.#currentRefetchInterval) ||\n this.#currentRefetchInterval === 0\n ) {\n return\n }\n\n this.#refetchIntervalId = timeoutManager.setInterval(() => {\n if (\n this.options.refetchIntervalInBackground ||\n focusManager.isFocused()\n ) {\n this.#executeFetch()\n }\n }, this.#currentRefetchInterval)\n }\n\n #updateTimers(): void {\n this.#updateStaleTimeout()\n this.#updateRefetchInterval(this.#computeRefetchInterval())\n }\n\n #clearStaleTimeout(): void {\n if (this.#staleTimeoutId) {\n timeoutManager.clearTimeout(this.#staleTimeoutId)\n this.#staleTimeoutId = undefined\n }\n }\n\n #clearRefetchInterval(): void {\n if (this.#refetchIntervalId) {\n timeoutManager.clearInterval(this.#refetchIntervalId)\n this.#refetchIntervalId = undefined\n }\n }\n\n protected createResult(\n query: Query,\n options: QueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >,\n ): QueryObserverResult {\n const prevQuery = this.#currentQuery\n const prevOptions = this.options\n const prevResult = this.#currentResult as\n | QueryObserverResult\n | undefined\n const prevResultState = this.#currentResultState\n const prevResultOptions = this.#currentResultOptions\n const queryChange = query !== prevQuery\n const queryInitialState = queryChange\n ? query.state\n : this.#currentQueryInitialState\n\n const { state } = query\n let newState = { ...state }\n let isPlaceholderData = false\n let data: TData | undefined\n\n // Optimistically set result in fetching state if needed\n if (options._optimisticResults) {\n const mounted = this.hasListeners()\n\n const fetchOnMount = !mounted && shouldFetchOnMount(query, options)\n\n const fetchOptionally =\n mounted && shouldFetchOptionally(query, prevQuery, options, prevOptions)\n\n if (fetchOnMount || fetchOptionally) {\n newState = {\n ...newState,\n ...fetchState(state.data, query.options),\n }\n }\n if (options._optimisticResults === 'isRestoring') {\n newState.fetchStatus = 'idle'\n }\n }\n\n let { error, errorUpdatedAt, status } = newState\n\n // Per default, use query data\n data = newState.data as unknown as TData\n let skipSelect = false\n\n // use placeholderData if needed\n if (\n options.placeholderData !== undefined &&\n data === undefined &&\n status === 'pending'\n ) {\n let placeholderData\n\n // Memoize placeholder data\n if (\n prevResult?.isPlaceholderData &&\n options.placeholderData === prevResultOptions?.placeholderData\n ) {\n placeholderData = prevResult.data\n // we have to skip select when reading this memoization\n // because prevResult.data is already \"selected\"\n skipSelect = true\n } else {\n // compute placeholderData\n placeholderData =\n typeof options.placeholderData === 'function'\n ? (\n options.placeholderData as unknown as PlaceholderDataFunction\n )(\n this.#lastQueryWithDefinedData?.state.data,\n this.#lastQueryWithDefinedData as any,\n )\n : options.placeholderData\n }\n\n if (placeholderData !== undefined) {\n status = 'success'\n data = replaceData(\n prevResult?.data,\n placeholderData as unknown,\n options,\n ) as TData\n isPlaceholderData = true\n }\n }\n\n // Select data if needed\n // this also runs placeholderData through the select function\n if (options.select && data !== undefined && !skipSelect) {\n // Memoize select result\n if (\n prevResult &&\n data === prevResultState?.data &&\n options.select === this.#selectFn\n ) {\n data = this.#selectResult\n } else {\n try {\n this.#selectFn = options.select\n data = options.select(data as any)\n data = replaceData(prevResult?.data, data, options)\n this.#selectResult = data\n this.#selectError = null\n } catch (selectError) {\n this.#selectError = selectError as TError\n }\n }\n }\n\n if (this.#selectError) {\n error = this.#selectError\n data = this.#selectResult\n errorUpdatedAt = Date.now()\n status = 'error'\n }\n\n const isFetching = newState.fetchStatus === 'fetching'\n const isPending = status === 'pending'\n const isError = status === 'error'\n\n const isLoading = isPending && isFetching\n const hasData = data !== undefined\n\n const result: QueryObserverBaseResult = {\n status,\n fetchStatus: newState.fetchStatus,\n isPending,\n isSuccess: status === 'success',\n isError,\n isInitialLoading: isLoading,\n isLoading,\n data,\n dataUpdatedAt: newState.dataUpdatedAt,\n error,\n errorUpdatedAt,\n failureCount: newState.fetchFailureCount,\n failureReason: newState.fetchFailureReason,\n errorUpdateCount: newState.errorUpdateCount,\n isFetched: newState.dataUpdateCount > 0 || newState.errorUpdateCount > 0,\n isFetchedAfterMount:\n newState.dataUpdateCount > queryInitialState.dataUpdateCount ||\n newState.errorUpdateCount > queryInitialState.errorUpdateCount,\n isFetching,\n isRefetching: isFetching && !isPending,\n isLoadingError: isError && !hasData,\n isPaused: newState.fetchStatus === 'paused',\n isPlaceholderData,\n isRefetchError: isError && hasData,\n isStale: isStale(query, options),\n refetch: this.refetch,\n promise: this.#currentThenable,\n isEnabled: resolveEnabled(options.enabled, query) !== false,\n }\n\n const nextResult = result as QueryObserverResult\n\n if (this.options.experimental_prefetchInRender) {\n const hasResultData = nextResult.data !== undefined\n const isErrorWithoutData = nextResult.status === 'error' && !hasResultData\n const finalizeThenableIfPossible = (thenable: PendingThenable) => {\n if (isErrorWithoutData) {\n thenable.reject(nextResult.error)\n } else if (hasResultData) {\n thenable.resolve(nextResult.data as TData)\n }\n }\n\n /**\n * Create a new thenable and result promise when the results have changed\n */\n const recreateThenable = () => {\n const pending =\n (this.#currentThenable =\n nextResult.promise =\n pendingThenable())\n\n finalizeThenableIfPossible(pending)\n }\n\n const prevThenable = this.#currentThenable\n switch (prevThenable.status) {\n case 'pending':\n // Finalize the previous thenable if it was pending\n // and we are still observing the same query\n if (query.queryHash === prevQuery.queryHash) {\n finalizeThenableIfPossible(prevThenable)\n }\n break\n case 'fulfilled':\n if (isErrorWithoutData || nextResult.data !== prevThenable.value) {\n recreateThenable()\n }\n break\n case 'rejected':\n if (!isErrorWithoutData || nextResult.error !== prevThenable.reason) {\n recreateThenable()\n }\n break\n }\n }\n\n return nextResult\n }\n\n updateResult(): void {\n const prevResult = this.#currentResult as\n | QueryObserverResult\n | undefined\n\n const nextResult = this.createResult(this.#currentQuery, this.options)\n\n this.#currentResultState = this.#currentQuery.state\n this.#currentResultOptions = this.options\n\n if (this.#currentResultState.data !== undefined) {\n this.#lastQueryWithDefinedData = this.#currentQuery\n }\n\n // Only notify and update result if something has changed\n if (shallowEqualObjects(nextResult, prevResult)) {\n return\n }\n\n this.#currentResult = nextResult\n\n const shouldNotifyListeners = (): boolean => {\n if (!prevResult) {\n return true\n }\n\n const { notifyOnChangeProps } = this.options\n const notifyOnChangePropsValue =\n typeof notifyOnChangeProps === 'function'\n ? notifyOnChangeProps()\n : notifyOnChangeProps\n\n if (\n notifyOnChangePropsValue === 'all' ||\n (!notifyOnChangePropsValue && !this.#trackedProps.size)\n ) {\n return true\n }\n\n const includedProps = new Set(\n notifyOnChangePropsValue ?? this.#trackedProps,\n )\n\n if (this.options.throwOnError) {\n includedProps.add('error')\n }\n\n return Object.keys(this.#currentResult).some((key) => {\n const typedKey = key as keyof QueryObserverResult\n const changed = this.#currentResult[typedKey] !== prevResult[typedKey]\n\n return changed && includedProps.has(typedKey)\n })\n }\n\n this.#notify({ listeners: shouldNotifyListeners() })\n }\n\n #updateQuery(): void {\n const query = this.#client.getQueryCache().build(this.#client, this.options)\n\n if (query === this.#currentQuery) {\n return\n }\n\n const prevQuery = this.#currentQuery as\n | Query\n | undefined\n this.#currentQuery = query\n this.#currentQueryInitialState = query.state\n\n if (this.hasListeners()) {\n prevQuery?.removeObserver(this)\n query.addObserver(this)\n }\n }\n\n onQueryUpdate(): void {\n this.updateResult()\n\n if (this.hasListeners()) {\n this.#updateTimers()\n }\n }\n\n #notify(notifyOptions: { listeners: boolean }): void {\n notifyManager.batch(() => {\n // First, trigger the listeners\n if (notifyOptions.listeners) {\n this.listeners.forEach((listener) => {\n listener(this.#currentResult)\n })\n }\n\n // Then the cache listeners\n this.#client.getQueryCache().notify({\n query: this.#currentQuery,\n type: 'observerResultsUpdated',\n })\n })\n }\n}\n\nfunction shouldLoadOnMount(\n query: Query,\n options: QueryObserverOptions,\n): boolean {\n return (\n resolveEnabled(options.enabled, query) !== false &&\n query.state.data === undefined &&\n !(query.state.status === 'error' && options.retryOnMount === false)\n )\n}\n\nfunction shouldFetchOnMount(\n query: Query,\n options: QueryObserverOptions,\n): boolean {\n return (\n shouldLoadOnMount(query, options) ||\n (query.state.data !== undefined &&\n shouldFetchOn(query, options, options.refetchOnMount))\n )\n}\n\nfunction shouldFetchOn(\n query: Query,\n options: QueryObserverOptions,\n field: (typeof options)['refetchOnMount'] &\n (typeof options)['refetchOnWindowFocus'] &\n (typeof options)['refetchOnReconnect'],\n) {\n if (\n resolveEnabled(options.enabled, query) !== false &&\n resolveStaleTime(options.staleTime, query) !== 'static'\n ) {\n const value = typeof field === 'function' ? field(query) : field\n\n return value === 'always' || (value !== false && isStale(query, options))\n }\n return false\n}\n\nfunction shouldFetchOptionally(\n query: Query,\n prevQuery: Query,\n options: QueryObserverOptions,\n prevOptions: QueryObserverOptions,\n): boolean {\n return (\n (query !== prevQuery ||\n resolveEnabled(prevOptions.enabled, query) === false) &&\n (!options.suspense || query.state.status !== 'error') &&\n isStale(query, options)\n )\n}\n\nfunction isStale(\n query: Query,\n options: QueryObserverOptions,\n): boolean {\n return (\n resolveEnabled(options.enabled, query) !== false &&\n query.isStaleByTime(resolveStaleTime(options.staleTime, query))\n )\n}\n\n// this function would decide if we will update the observer's 'current'\n// properties after an optimistic reading via getOptimisticResult\nfunction shouldAssignObserverCurrentProperties<\n TQueryFnData = unknown,\n TError = unknown,\n TData = TQueryFnData,\n TQueryData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n observer: QueryObserver,\n optimisticResult: QueryObserverResult,\n) {\n // if the newly created result isn't what the observer is holding as current,\n // then we'll need to update the properties as well\n if (!shallowEqualObjects(observer.getCurrentResult(), optimisticResult)) {\n return true\n }\n\n // basically, just keep previous properties if nothing changed\n return false\n}\n"],"mappings":";AAAA,SAAS,oBAAoB;AAC7B,SAAS,qBAAqB;AAC9B,SAAS,kBAAkB;AAC3B,SAAS,oBAAoB;AAC7B,SAAS,uBAAuB;AAChC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,sBAAsB;AAwBxB,IAAM,gBAAN,cAMG,aAAmD;AAAA,EAyB3D,YACE,QACO,SAOP;AACA,UAAM;AARC;AAUP,SAAK,UAAU;AACf,SAAK,eAAe;AACpB,SAAK,mBAAmB,gBAAgB;AAExC,SAAK,YAAY;AACjB,SAAK,WAAW,OAAO;AAAA,EACzB;AAAA,EA1CA;AAAA,EACA,gBAAoE;AAAA,EACpE,4BAA4D;AAAA,EAC5D,iBAAqD;AAAA,EACrD;AAAA,EACA;AAAA,EAOA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA;AAAA;AAAA,EAGA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,gBAAgB,oBAAI,IAA+B;AAAA,EAsBzC,cAAoB;AAC5B,SAAK,UAAU,KAAK,QAAQ,KAAK,IAAI;AAAA,EACvC;AAAA,EAEU,cAAoB;AAC5B,QAAI,KAAK,UAAU,SAAS,GAAG;AAC7B,WAAK,cAAc,YAAY,IAAI;AAEnC,UAAI,mBAAmB,KAAK,eAAe,KAAK,OAAO,GAAG;AAC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AACT,SACE,kBAAkB,OAAO,OAAO,KAC/B,MAAM,MAAM,SAAS,UACpB,cAAc,OAAO,SAAS,QAAQ,cAAc;AAE1D;AAEA,SAAS,cACP,OACA,SACA,OAGA;AACA,MACE,eAAe,QAAQ,SAAS,KAAK,MAAM,SAC3C,iBAAiB,QAAQ,WAAW,KAAK,MAAM,UAC/C;AACA,UAAM,QAAQ,OAAO,UAAU,aAAa,MAAM,KAAK,IAAI;AAE3D,WAAO,UAAU,YAAa,UAAU,SAAS,QAAQ,OAAO,OAAO;AAAA,EACzE;AACA,SAAO;AACT;AAEA,SAAS,sBACP,OACA,WACA,SACA,aACS;AACT,UACG,UAAU,aACT,eAAe,YAAY,SAAS,KAAK,MAAM,WAChD,CAAC,QAAQ,YAAY,MAAM,MAAM,WAAW,YAC7C,QAAQ,OAAO,OAAO;AAE1B;AAEA,SAAS,QACP,OACA,SACS;AACT,SACE,eAAe,QAAQ,SAAS,KAAK,MAAM,SAC3C,MAAM,cAAc,iBAAiB,QAAQ,WAAW,KAAK,CAAC;AAElE;AAIA,SAAS,sCAOP,UACA,kBACA;AAGA,MAAI,CAAC,oBAAoB,SAAS,iBAAiB,GAAG,gBAAgB,GAAG;AACvE,WAAO;AAAA,EACT;AAGA,SAAO;AACT;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/removable.cjs b/node_modules/@tanstack/query-core/build/modern/removable.cjs deleted file mode 100644 index facc9da..0000000 --- a/node_modules/@tanstack/query-core/build/modern/removable.cjs +++ /dev/null @@ -1,58 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// src/removable.ts -var removable_exports = {}; -__export(removable_exports, { - Removable: () => Removable -}); -module.exports = __toCommonJS(removable_exports); -var import_timeoutManager = require("./timeoutManager.cjs"); -var import_utils = require("./utils.cjs"); -var Removable = class { - #gcTimeout; - destroy() { - this.clearGcTimeout(); - } - scheduleGc() { - this.clearGcTimeout(); - if ((0, import_utils.isValidTimeout)(this.gcTime)) { - this.#gcTimeout = import_timeoutManager.timeoutManager.setTimeout(() => { - this.optionalRemove(); - }, this.gcTime); - } - } - updateGcTime(newGcTime) { - this.gcTime = Math.max( - this.gcTime || 0, - newGcTime ?? (import_utils.isServer ? Infinity : 5 * 60 * 1e3) - ); - } - clearGcTimeout() { - if (this.#gcTimeout) { - import_timeoutManager.timeoutManager.clearTimeout(this.#gcTimeout); - this.#gcTimeout = void 0; - } - } -}; -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - Removable -}); -//# sourceMappingURL=removable.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/removable.cjs.map b/node_modules/@tanstack/query-core/build/modern/removable.cjs.map deleted file mode 100644 index 1c13757..0000000 --- a/node_modules/@tanstack/query-core/build/modern/removable.cjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/removable.ts"],"sourcesContent":["import { timeoutManager } from './timeoutManager'\nimport { isServer, isValidTimeout } from './utils'\nimport type { ManagedTimerId } from './timeoutManager'\n\nexport abstract class Removable {\n gcTime!: number\n #gcTimeout?: ManagedTimerId\n\n destroy(): void {\n this.clearGcTimeout()\n }\n\n protected scheduleGc(): void {\n this.clearGcTimeout()\n\n if (isValidTimeout(this.gcTime)) {\n this.#gcTimeout = timeoutManager.setTimeout(() => {\n this.optionalRemove()\n }, this.gcTime)\n }\n }\n\n protected updateGcTime(newGcTime: number | undefined): void {\n // Default to 5 minutes (Infinity for server-side) if no gcTime is set\n this.gcTime = Math.max(\n this.gcTime || 0,\n newGcTime ?? (isServer ? Infinity : 5 * 60 * 1000),\n )\n }\n\n protected clearGcTimeout() {\n if (this.#gcTimeout) {\n timeoutManager.clearTimeout(this.#gcTimeout)\n this.#gcTimeout = undefined\n }\n }\n\n protected abstract optionalRemove(): void\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,4BAA+B;AAC/B,mBAAyC;AAGlC,IAAe,YAAf,MAAyB;AAAA,EAE9B;AAAA,EAEA,UAAgB;AACd,SAAK,eAAe;AAAA,EACtB;AAAA,EAEU,aAAmB;AAC3B,SAAK,eAAe;AAEpB,YAAI,6BAAe,KAAK,MAAM,GAAG;AAC/B,WAAK,aAAa,qCAAe,WAAW,MAAM;AAChD,aAAK,eAAe;AAAA,MACtB,GAAG,KAAK,MAAM;AAAA,IAChB;AAAA,EACF;AAAA,EAEU,aAAa,WAAqC;AAE1D,SAAK,SAAS,KAAK;AAAA,MACjB,KAAK,UAAU;AAAA,MACf,cAAc,wBAAW,WAAW,IAAI,KAAK;AAAA,IAC/C;AAAA,EACF;AAAA,EAEU,iBAAiB;AACzB,QAAI,KAAK,YAAY;AACnB,2CAAe,aAAa,KAAK,UAAU;AAC3C,WAAK,aAAa;AAAA,IACpB;AAAA,EACF;AAGF;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/removable.d.cts b/node_modules/@tanstack/query-core/build/modern/removable.d.cts deleted file mode 100644 index 7b82525..0000000 --- a/node_modules/@tanstack/query-core/build/modern/removable.d.cts +++ /dev/null @@ -1,11 +0,0 @@ -declare abstract class Removable { - #private; - gcTime: number; - destroy(): void; - protected scheduleGc(): void; - protected updateGcTime(newGcTime: number | undefined): void; - protected clearGcTimeout(): void; - protected abstract optionalRemove(): void; -} - -export { Removable }; diff --git a/node_modules/@tanstack/query-core/build/modern/removable.d.ts b/node_modules/@tanstack/query-core/build/modern/removable.d.ts deleted file mode 100644 index 7b82525..0000000 --- a/node_modules/@tanstack/query-core/build/modern/removable.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -declare abstract class Removable { - #private; - gcTime: number; - destroy(): void; - protected scheduleGc(): void; - protected updateGcTime(newGcTime: number | undefined): void; - protected clearGcTimeout(): void; - protected abstract optionalRemove(): void; -} - -export { Removable }; diff --git a/node_modules/@tanstack/query-core/build/modern/removable.js b/node_modules/@tanstack/query-core/build/modern/removable.js deleted file mode 100644 index 8eb8f6c..0000000 --- a/node_modules/@tanstack/query-core/build/modern/removable.js +++ /dev/null @@ -1,33 +0,0 @@ -// src/removable.ts -import { timeoutManager } from "./timeoutManager.js"; -import { isServer, isValidTimeout } from "./utils.js"; -var Removable = class { - #gcTimeout; - destroy() { - this.clearGcTimeout(); - } - scheduleGc() { - this.clearGcTimeout(); - if (isValidTimeout(this.gcTime)) { - this.#gcTimeout = timeoutManager.setTimeout(() => { - this.optionalRemove(); - }, this.gcTime); - } - } - updateGcTime(newGcTime) { - this.gcTime = Math.max( - this.gcTime || 0, - newGcTime ?? (isServer ? Infinity : 5 * 60 * 1e3) - ); - } - clearGcTimeout() { - if (this.#gcTimeout) { - timeoutManager.clearTimeout(this.#gcTimeout); - this.#gcTimeout = void 0; - } - } -}; -export { - Removable -}; -//# sourceMappingURL=removable.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/removable.js.map b/node_modules/@tanstack/query-core/build/modern/removable.js.map deleted file mode 100644 index f26eeec..0000000 --- a/node_modules/@tanstack/query-core/build/modern/removable.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/removable.ts"],"sourcesContent":["import { timeoutManager } from './timeoutManager'\nimport { isServer, isValidTimeout } from './utils'\nimport type { ManagedTimerId } from './timeoutManager'\n\nexport abstract class Removable {\n gcTime!: number\n #gcTimeout?: ManagedTimerId\n\n destroy(): void {\n this.clearGcTimeout()\n }\n\n protected scheduleGc(): void {\n this.clearGcTimeout()\n\n if (isValidTimeout(this.gcTime)) {\n this.#gcTimeout = timeoutManager.setTimeout(() => {\n this.optionalRemove()\n }, this.gcTime)\n }\n }\n\n protected updateGcTime(newGcTime: number | undefined): void {\n // Default to 5 minutes (Infinity for server-side) if no gcTime is set\n this.gcTime = Math.max(\n this.gcTime || 0,\n newGcTime ?? (isServer ? Infinity : 5 * 60 * 1000),\n )\n }\n\n protected clearGcTimeout() {\n if (this.#gcTimeout) {\n timeoutManager.clearTimeout(this.#gcTimeout)\n this.#gcTimeout = undefined\n }\n }\n\n protected abstract optionalRemove(): void\n}\n"],"mappings":";AAAA,SAAS,sBAAsB;AAC/B,SAAS,UAAU,sBAAsB;AAGlC,IAAe,YAAf,MAAyB;AAAA,EAE9B;AAAA,EAEA,UAAgB;AACd,SAAK,eAAe;AAAA,EACtB;AAAA,EAEU,aAAmB;AAC3B,SAAK,eAAe;AAEpB,QAAI,eAAe,KAAK,MAAM,GAAG;AAC/B,WAAK,aAAa,eAAe,WAAW,MAAM;AAChD,aAAK,eAAe;AAAA,MACtB,GAAG,KAAK,MAAM;AAAA,IAChB;AAAA,EACF;AAAA,EAEU,aAAa,WAAqC;AAE1D,SAAK,SAAS,KAAK;AAAA,MACjB,KAAK,UAAU;AAAA,MACf,cAAc,WAAW,WAAW,IAAI,KAAK;AAAA,IAC/C;AAAA,EACF;AAAA,EAEU,iBAAiB;AACzB,QAAI,KAAK,YAAY;AACnB,qBAAe,aAAa,KAAK,UAAU;AAC3C,WAAK,aAAa;AAAA,IACpB;AAAA,EACF;AAGF;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/retryer.cjs b/node_modules/@tanstack/query-core/build/modern/retryer.cjs deleted file mode 100644 index 61f9160..0000000 --- a/node_modules/@tanstack/query-core/build/modern/retryer.cjs +++ /dev/null @@ -1,161 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// src/retryer.ts -var retryer_exports = {}; -__export(retryer_exports, { - CancelledError: () => CancelledError, - canFetch: () => canFetch, - createRetryer: () => createRetryer, - isCancelledError: () => isCancelledError -}); -module.exports = __toCommonJS(retryer_exports); -var import_focusManager = require("./focusManager.cjs"); -var import_onlineManager = require("./onlineManager.cjs"); -var import_thenable = require("./thenable.cjs"); -var import_utils = require("./utils.cjs"); -function defaultRetryDelay(failureCount) { - return Math.min(1e3 * 2 ** failureCount, 3e4); -} -function canFetch(networkMode) { - return (networkMode ?? "online") === "online" ? import_onlineManager.onlineManager.isOnline() : true; -} -var CancelledError = class extends Error { - constructor(options) { - super("CancelledError"); - this.revert = options?.revert; - this.silent = options?.silent; - } -}; -function isCancelledError(value) { - return value instanceof CancelledError; -} -function createRetryer(config) { - let isRetryCancelled = false; - let failureCount = 0; - let continueFn; - const thenable = (0, import_thenable.pendingThenable)(); - const isResolved = () => thenable.status !== "pending"; - const cancel = (cancelOptions) => { - if (!isResolved()) { - const error = new CancelledError(cancelOptions); - reject(error); - config.onCancel?.(error); - } - }; - const cancelRetry = () => { - isRetryCancelled = true; - }; - const continueRetry = () => { - isRetryCancelled = false; - }; - const canContinue = () => import_focusManager.focusManager.isFocused() && (config.networkMode === "always" || import_onlineManager.onlineManager.isOnline()) && config.canRun(); - const canStart = () => canFetch(config.networkMode) && config.canRun(); - const resolve = (value) => { - if (!isResolved()) { - continueFn?.(); - thenable.resolve(value); - } - }; - const reject = (value) => { - if (!isResolved()) { - continueFn?.(); - thenable.reject(value); - } - }; - const pause = () => { - return new Promise((continueResolve) => { - continueFn = (value) => { - if (isResolved() || canContinue()) { - continueResolve(value); - } - }; - config.onPause?.(); - }).then(() => { - continueFn = void 0; - if (!isResolved()) { - config.onContinue?.(); - } - }); - }; - const run = () => { - if (isResolved()) { - return; - } - let promiseOrValue; - const initialPromise = failureCount === 0 ? config.initialPromise : void 0; - try { - promiseOrValue = initialPromise ?? config.fn(); - } catch (error) { - promiseOrValue = Promise.reject(error); - } - Promise.resolve(promiseOrValue).then(resolve).catch((error) => { - if (isResolved()) { - return; - } - const retry = config.retry ?? (import_utils.isServer ? 0 : 3); - const retryDelay = config.retryDelay ?? defaultRetryDelay; - const delay = typeof retryDelay === "function" ? retryDelay(failureCount, error) : retryDelay; - const shouldRetry = retry === true || typeof retry === "number" && failureCount < retry || typeof retry === "function" && retry(failureCount, error); - if (isRetryCancelled || !shouldRetry) { - reject(error); - return; - } - failureCount++; - config.onFail?.(failureCount, error); - (0, import_utils.sleep)(delay).then(() => { - return canContinue() ? void 0 : pause(); - }).then(() => { - if (isRetryCancelled) { - reject(error); - } else { - run(); - } - }); - }); - }; - return { - promise: thenable, - status: () => thenable.status, - cancel, - continue: () => { - continueFn?.(); - return thenable; - }, - cancelRetry, - continueRetry, - canStart, - start: () => { - if (canStart()) { - run(); - } else { - pause().then(run); - } - return thenable; - } - }; -} -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - CancelledError, - canFetch, - createRetryer, - isCancelledError -}); -//# sourceMappingURL=retryer.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/retryer.cjs.map b/node_modules/@tanstack/query-core/build/modern/retryer.cjs.map deleted file mode 100644 index eb30576..0000000 --- a/node_modules/@tanstack/query-core/build/modern/retryer.cjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/retryer.ts"],"sourcesContent":["import { focusManager } from './focusManager'\nimport { onlineManager } from './onlineManager'\nimport { pendingThenable } from './thenable'\nimport { isServer, sleep } from './utils'\nimport type { Thenable } from './thenable'\nimport type { CancelOptions, DefaultError, NetworkMode } from './types'\n\n// TYPES\n\ninterface RetryerConfig {\n fn: () => TData | Promise\n initialPromise?: Promise\n onCancel?: (error: TError) => void\n onFail?: (failureCount: number, error: TError) => void\n onPause?: () => void\n onContinue?: () => void\n retry?: RetryValue\n retryDelay?: RetryDelayValue\n networkMode: NetworkMode | undefined\n canRun: () => boolean\n}\n\nexport interface Retryer {\n promise: Promise\n cancel: (cancelOptions?: CancelOptions) => void\n continue: () => Promise\n cancelRetry: () => void\n continueRetry: () => void\n canStart: () => boolean\n start: () => Promise\n status: () => 'pending' | 'resolved' | 'rejected'\n}\n\nexport type RetryValue = boolean | number | ShouldRetryFunction\n\ntype ShouldRetryFunction = (\n failureCount: number,\n error: TError,\n) => boolean\n\nexport type RetryDelayValue = number | RetryDelayFunction\n\ntype RetryDelayFunction = (\n failureCount: number,\n error: TError,\n) => number\n\nfunction defaultRetryDelay(failureCount: number) {\n return Math.min(1000 * 2 ** failureCount, 30000)\n}\n\nexport function canFetch(networkMode: NetworkMode | undefined): boolean {\n return (networkMode ?? 'online') === 'online'\n ? onlineManager.isOnline()\n : true\n}\n\nexport class CancelledError extends Error {\n revert?: boolean\n silent?: boolean\n constructor(options?: CancelOptions) {\n super('CancelledError')\n this.revert = options?.revert\n this.silent = options?.silent\n }\n}\n\n/**\n * @deprecated Use instanceof `CancelledError` instead.\n */\nexport function isCancelledError(value: any): value is CancelledError {\n return value instanceof CancelledError\n}\n\nexport function createRetryer(\n config: RetryerConfig,\n): Retryer {\n let isRetryCancelled = false\n let failureCount = 0\n let continueFn: ((value?: unknown) => void) | undefined\n\n const thenable = pendingThenable()\n\n const isResolved = () =>\n (thenable.status as Thenable['status']) !== 'pending'\n\n const cancel = (cancelOptions?: CancelOptions): void => {\n if (!isResolved()) {\n const error = new CancelledError(cancelOptions) as TError\n reject(error)\n\n config.onCancel?.(error)\n }\n }\n const cancelRetry = () => {\n isRetryCancelled = true\n }\n\n const continueRetry = () => {\n isRetryCancelled = false\n }\n\n const canContinue = () =>\n focusManager.isFocused() &&\n (config.networkMode === 'always' || onlineManager.isOnline()) &&\n config.canRun()\n\n const canStart = () => canFetch(config.networkMode) && config.canRun()\n\n const resolve = (value: any) => {\n if (!isResolved()) {\n continueFn?.()\n thenable.resolve(value)\n }\n }\n\n const reject = (value: any) => {\n if (!isResolved()) {\n continueFn?.()\n thenable.reject(value)\n }\n }\n\n const pause = () => {\n return new Promise((continueResolve) => {\n continueFn = (value) => {\n if (isResolved() || canContinue()) {\n continueResolve(value)\n }\n }\n config.onPause?.()\n }).then(() => {\n continueFn = undefined\n if (!isResolved()) {\n config.onContinue?.()\n }\n })\n }\n\n // Create loop function\n const run = () => {\n // Do nothing if already resolved\n if (isResolved()) {\n return\n }\n\n let promiseOrValue: any\n\n // we can re-use config.initialPromise on the first call of run()\n const initialPromise =\n failureCount === 0 ? config.initialPromise : undefined\n\n // Execute query\n try {\n promiseOrValue = initialPromise ?? config.fn()\n } catch (error) {\n promiseOrValue = Promise.reject(error)\n }\n\n Promise.resolve(promiseOrValue)\n .then(resolve)\n .catch((error) => {\n // Stop if the fetch is already resolved\n if (isResolved()) {\n return\n }\n\n // Do we need to retry the request?\n const retry = config.retry ?? (isServer ? 0 : 3)\n const retryDelay = config.retryDelay ?? defaultRetryDelay\n const delay =\n typeof retryDelay === 'function'\n ? retryDelay(failureCount, error)\n : retryDelay\n const shouldRetry =\n retry === true ||\n (typeof retry === 'number' && failureCount < retry) ||\n (typeof retry === 'function' && retry(failureCount, error))\n\n if (isRetryCancelled || !shouldRetry) {\n // We are done if the query does not need to be retried\n reject(error)\n return\n }\n\n failureCount++\n\n // Notify on fail\n config.onFail?.(failureCount, error)\n\n // Delay\n sleep(delay)\n // Pause if the document is not visible or when the device is offline\n .then(() => {\n return canContinue() ? undefined : pause()\n })\n .then(() => {\n if (isRetryCancelled) {\n reject(error)\n } else {\n run()\n }\n })\n })\n }\n\n return {\n promise: thenable,\n status: () => thenable.status,\n cancel,\n continue: () => {\n continueFn?.()\n return thenable\n },\n cancelRetry,\n continueRetry,\n canStart,\n start: () => {\n // Start loop\n if (canStart()) {\n run()\n } else {\n pause().then(run)\n }\n return thenable\n },\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,0BAA6B;AAC7B,2BAA8B;AAC9B,sBAAgC;AAChC,mBAAgC;AA4ChC,SAAS,kBAAkB,cAAsB;AAC/C,SAAO,KAAK,IAAI,MAAO,KAAK,cAAc,GAAK;AACjD;AAEO,SAAS,SAAS,aAA+C;AACtE,UAAQ,eAAe,cAAc,WACjC,mCAAc,SAAS,IACvB;AACN;AAEO,IAAM,iBAAN,cAA6B,MAAM;AAAA,EAGxC,YAAY,SAAyB;AACnC,UAAM,gBAAgB;AACtB,SAAK,SAAS,SAAS;AACvB,SAAK,SAAS,SAAS;AAAA,EACzB;AACF;AAKO,SAAS,iBAAiB,OAAqC;AACpE,SAAO,iBAAiB;AAC1B;AAEO,SAAS,cACd,QACgB;AAChB,MAAI,mBAAmB;AACvB,MAAI,eAAe;AACnB,MAAI;AAEJ,QAAM,eAAW,iCAAuB;AAExC,QAAM,aAAa,MAChB,SAAS,WAAyC;AAErD,QAAM,SAAS,CAAC,kBAAwC;AACtD,QAAI,CAAC,WAAW,GAAG;AACjB,YAAM,QAAQ,IAAI,eAAe,aAAa;AAC9C,aAAO,KAAK;AAEZ,aAAO,WAAW,KAAK;AAAA,IACzB;AAAA,EACF;AACA,QAAM,cAAc,MAAM;AACxB,uBAAmB;AAAA,EACrB;AAEA,QAAM,gBAAgB,MAAM;AAC1B,uBAAmB;AAAA,EACrB;AAEA,QAAM,cAAc,MAClB,iCAAa,UAAU,MACtB,OAAO,gBAAgB,YAAY,mCAA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Ac,KAAK;AAE3D,UAAI,oBAAoB,CAAC,aAAa;AAEpC,eAAO,KAAK;AACZ;AAAA,MACF;AAEA;AAGA,aAAO,SAAS,cAAc,KAAK;AAGnC,8BAAM,KAAK,EAER,KAAK,MAAM;AACV,eAAO,YAAY,IAAI,SAAY,MAAM;AAAA,MAC3C,CAAC,EACA,KAAK,MAAM;AACV,YAAI,kBAAkB;AACpB,iBAAO,KAAK;AAAA,QACd,OAAO;AACL,cAAI;AAAA,QACN;AAAA,MACF,CAAC;AAAA,IACL,CAAC;AAAA,EACL;AAEA,SAAO;AAAA,IACL,SAAS;AAAA,IACT,QAAQ,MAAM,SAAS;AAAA,IACvB;AAAA,IACA,UAAU,MAAM;AACd,mBAAa;AACb,aAAO;AAAA,IACT;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,OAAO,MAAM;AAEX,UAAI,SAAS,GAAG;AACd,YAAI;AAAA,MACN,OAAO;AACL,cAAM,EAAE,KAAK,GAAG;AAAA,MAClB;AACA,aAAO;AAAA,IACT;AAAA,EACF;AACF;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/retryer.d.cts b/node_modules/@tanstack/query-core/build/modern/retryer.d.cts deleted file mode 100644 index d348311..0000000 --- a/node_modules/@tanstack/query-core/build/modern/retryer.d.cts +++ /dev/null @@ -1,3 +0,0 @@ -export { C as CancelledError, bE as RetryDelayValue, bD as RetryValue, bC as Retryer, bF as canFetch, bG as createRetryer, j as isCancelledError } from './hydration-uphG6M-i.cjs'; -import './removable.cjs'; -import './subscribable.cjs'; diff --git a/node_modules/@tanstack/query-core/build/modern/retryer.d.ts b/node_modules/@tanstack/query-core/build/modern/retryer.d.ts deleted file mode 100644 index 87ee12a..0000000 --- a/node_modules/@tanstack/query-core/build/modern/retryer.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export { C as CancelledError, bE as RetryDelayValue, bD as RetryValue, bC as Retryer, bF as canFetch, bG as createRetryer, j as isCancelledError } from './hydration-BlEVG2Lp.js'; -import './removable.js'; -import './subscribable.js'; diff --git a/node_modules/@tanstack/query-core/build/modern/retryer.js b/node_modules/@tanstack/query-core/build/modern/retryer.js deleted file mode 100644 index 9aec541..0000000 --- a/node_modules/@tanstack/query-core/build/modern/retryer.js +++ /dev/null @@ -1,133 +0,0 @@ -// src/retryer.ts -import { focusManager } from "./focusManager.js"; -import { onlineManager } from "./onlineManager.js"; -import { pendingThenable } from "./thenable.js"; -import { isServer, sleep } from "./utils.js"; -function defaultRetryDelay(failureCount) { - return Math.min(1e3 * 2 ** failureCount, 3e4); -} -function canFetch(networkMode) { - return (networkMode ?? "online") === "online" ? onlineManager.isOnline() : true; -} -var CancelledError = class extends Error { - constructor(options) { - super("CancelledError"); - this.revert = options?.revert; - this.silent = options?.silent; - } -}; -function isCancelledError(value) { - return value instanceof CancelledError; -} -function createRetryer(config) { - let isRetryCancelled = false; - let failureCount = 0; - let continueFn; - const thenable = pendingThenable(); - const isResolved = () => thenable.status !== "pending"; - const cancel = (cancelOptions) => { - if (!isResolved()) { - const error = new CancelledError(cancelOptions); - reject(error); - config.onCancel?.(error); - } - }; - const cancelRetry = () => { - isRetryCancelled = true; - }; - const continueRetry = () => { - isRetryCancelled = false; - }; - const canContinue = () => focusManager.isFocused() && (config.networkMode === "always" || onlineManager.isOnline()) && config.canRun(); - const canStart = () => canFetch(config.networkMode) && config.canRun(); - const resolve = (value) => { - if (!isResolved()) { - continueFn?.(); - thenable.resolve(value); - } - }; - const reject = (value) => { - if (!isResolved()) { - continueFn?.(); - thenable.reject(value); - } - }; - const pause = () => { - return new Promise((continueResolve) => { - continueFn = (value) => { - if (isResolved() || canContinue()) { - continueResolve(value); - } - }; - config.onPause?.(); - }).then(() => { - continueFn = void 0; - if (!isResolved()) { - config.onContinue?.(); - } - }); - }; - const run = () => { - if (isResolved()) { - return; - } - let promiseOrValue; - const initialPromise = failureCount === 0 ? config.initialPromise : void 0; - try { - promiseOrValue = initialPromise ?? config.fn(); - } catch (error) { - promiseOrValue = Promise.reject(error); - } - Promise.resolve(promiseOrValue).then(resolve).catch((error) => { - if (isResolved()) { - return; - } - const retry = config.retry ?? (isServer ? 0 : 3); - const retryDelay = config.retryDelay ?? defaultRetryDelay; - const delay = typeof retryDelay === "function" ? retryDelay(failureCount, error) : retryDelay; - const shouldRetry = retry === true || typeof retry === "number" && failureCount < retry || typeof retry === "function" && retry(failureCount, error); - if (isRetryCancelled || !shouldRetry) { - reject(error); - return; - } - failureCount++; - config.onFail?.(failureCount, error); - sleep(delay).then(() => { - return canContinue() ? void 0 : pause(); - }).then(() => { - if (isRetryCancelled) { - reject(error); - } else { - run(); - } - }); - }); - }; - return { - promise: thenable, - status: () => thenable.status, - cancel, - continue: () => { - continueFn?.(); - return thenable; - }, - cancelRetry, - continueRetry, - canStart, - start: () => { - if (canStart()) { - run(); - } else { - pause().then(run); - } - return thenable; - } - }; -} -export { - CancelledError, - canFetch, - createRetryer, - isCancelledError -}; -//# sourceMappingURL=retryer.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/retryer.js.map b/node_modules/@tanstack/query-core/build/modern/retryer.js.map deleted file mode 100644 index 2682383..0000000 --- a/node_modules/@tanstack/query-core/build/modern/retryer.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/retryer.ts"],"sourcesContent":["import { focusManager } from './focusManager'\nimport { onlineManager } from './onlineManager'\nimport { pendingThenable } from './thenable'\nimport { isServer, sleep } from './utils'\nimport type { Thenable } from './thenable'\nimport type { CancelOptions, DefaultError, NetworkMode } from './types'\n\n// TYPES\n\ninterface RetryerConfig {\n fn: () => TData | Promise\n initialPromise?: Promise\n onCancel?: (error: TError) => void\n onFail?: (failureCount: number, error: TError) => void\n onPause?: () => void\n onContinue?: () => void\n retry?: RetryValue\n retryDelay?: RetryDelayValue\n networkMode: NetworkMode | undefined\n canRun: () => boolean\n}\n\nexport interface Retryer {\n promise: Promise\n cancel: (cancelOptions?: CancelOptions) => void\n continue: () => Promise\n cancelRetry: () => void\n continueRetry: () => void\n canStart: () => boolean\n start: () => Promise\n status: () => 'pending' | 'resolved' | 'rejected'\n}\n\nexport type RetryValue = boolean | number | ShouldRetryFunction\n\ntype ShouldRetryFunction = (\n failureCount: number,\n error: TError,\n) => boolean\n\nexport type RetryDelayValue = number | RetryDelayFunction\n\ntype RetryDelayFunction = (\n failureCount: number,\n error: TError,\n) => number\n\nfunction defaultRetryDelay(failureCount: number) {\n return Math.min(1000 * 2 ** failureCount, 30000)\n}\n\nexport function canFetch(networkMode: NetworkMode | undefined): boolean {\n return (networkMode ?? 'online') === 'online'\n ? onlineManager.isOnline()\n : true\n}\n\nexport class CancelledError extends Error {\n revert?: boolean\n silent?: boolean\n constructor(options?: CancelOptions) {\n super('CancelledError')\n this.revert = options?.revert\n this.silent = options?.silent\n }\n}\n\n/**\n * @deprecated Use instanceof `CancelledError` instead.\n */\nexport function isCancelledError(value: any): value is CancelledError {\n return value instanceof CancelledError\n}\n\nexport function createRetryer(\n config: RetryerConfig,\n): Retryer {\n let isRetryCancelled = false\n let failureCount = 0\n let continueFn: ((value?: unknown) => void) | undefined\n\n const thenable = pendingThenable()\n\n const isResolved = () =>\n (thenable.status as Thenable['status']) !== 'pending'\n\n const cancel = (cancelOptions?: CancelOptions): void => {\n if (!isResolved()) {\n const error = new CancelledError(cancelOptions) as TError\n reject(error)\n\n config.onCancel?.(error)\n }\n }\n const cancelRetry = () => {\n isRetryCancelled = true\n }\n\n const continueRetry = () => {\n isRetryCancelled = false\n }\n\n const canContinue = () =>\n focusManager.isFocused() &&\n (config.networkMode === 'always' || onlineManager.isOnline()) &&\n config.canRun()\n\n const canStart = () => canFetch(config.networkMode) && config.canRun()\n\n const resolve = (value: any) => {\n if (!isResolved()) {\n continueFn?.()\n thenable.resolve(value)\n }\n }\n\n const reject = (value: any) => {\n if (!isResolved()) {\n continueFn?.()\n thenable.reject(value)\n }\n }\n\n const pause = () => {\n return new Promise((continueResolve) => {\n continueFn = (value) => {\n if (isResolved() || canContinue()) {\n continueResolve(value)\n }\n }\n config.onPause?.()\n }).then(() => {\n continueFn = undefined\n if (!isResolved()) {\n config.onContinue?.()\n }\n })\n }\n\n // Create loop function\n const run = () => {\n // Do nothing if already resolved\n if (isResolved()) {\n return\n }\n\n let promiseOrValue: any\n\n // we can re-use config.initialPromise on the first call of run()\n const initialPromise =\n failureCount === 0 ? config.initialPromise : undefined\n\n // Execute query\n try {\n promiseOrValue = initialPromise ?? config.fn()\n } catch (error) {\n promiseOrValue = Promise.reject(error)\n }\n\n Promise.resolve(promiseOrValue)\n .then(resolve)\n .catch((error) => {\n // Stop if the fetch is already resolved\n if (isResolved()) {\n return\n }\n\n // Do we need to retry the request?\n const retry = config.retry ?? (isServer ? 0 : 3)\n const retryDelay = config.retryDelay ?? defaultRetryDelay\n const delay =\n typeof retryDelay === 'function'\n ? retryDelay(failureCount, error)\n : retryDelay\n const shouldRetry =\n retry === true ||\n (typeof retry === 'number' && failureCount < retry) ||\n (typeof retry === 'function' && retry(failureCount, error))\n\n if (isRetryCancelled || !shouldRetry) {\n // We are done if the query does not need to be retried\n reject(error)\n return\n }\n\n failureCount++\n\n // Notify on fail\n config.onFail?.(failureCount, error)\n\n // Delay\n sleep(delay)\n // Pause if the document is not visible or when the device is offline\n .then(() => {\n return canContinue() ? undefined : pause()\n })\n .then(() => {\n if (isRetryCancelled) {\n reject(error)\n } else {\n run()\n }\n })\n })\n }\n\n return {\n promise: thenable,\n status: () => thenable.status,\n cancel,\n continue: () => {\n continueFn?.()\n return thenable\n },\n cancelRetry,\n continueRetry,\n canStart,\n start: () => {\n // Start loop\n if (canStart()) {\n run()\n } else {\n pause().then(run)\n }\n return thenable\n },\n }\n}\n"],"mappings":";AAAA,SAAS,oBAAoB;AAC7B,SAAS,qBAAqB;AAC9B,SAAS,uBAAuB;AAChC,SAAS,UAAU,aAAa;AA4ChC,SAAS,kBAAkB,cAAsB;AAC/C,SAAO,KAAK,IAAI,MAAO,KAAK,cAAc,GA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T;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,OAAO,MAAM;AAEX,UAAI,SAAS,GAAG;AACd,YAAI;AAAA,MACN,OAAO;AACL,cAAM,EAAE,KAAK,GAAG;AAAA,MAClB;AACA,aAAO;AAAA,IACT;AAAA,EACF;AACF;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/streamedQuery.cjs b/node_modules/@tanstack/query-core/build/modern/streamedQuery.cjs deleted file mode 100644 index 5752fe9..0000000 --- a/node_modules/@tanstack/query-core/build/modern/streamedQuery.cjs +++ /dev/null @@ -1,82 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// src/streamedQuery.ts -var streamedQuery_exports = {}; -__export(streamedQuery_exports, { - streamedQuery: () => streamedQuery -}); -module.exports = __toCommonJS(streamedQuery_exports); -var import_utils = require("./utils.cjs"); -function streamedQuery({ - streamFn, - refetchMode = "reset", - reducer = (items, chunk) => (0, import_utils.addToEnd)(items, chunk), - initialValue = [] -}) { - return async (context) => { - const query = context.client.getQueryCache().find({ queryKey: context.queryKey, exact: true }); - const isRefetch = !!query && query.state.data !== void 0; - if (isRefetch && refetchMode === "reset") { - query.setState({ - status: "pending", - data: void 0, - error: null, - fetchStatus: "fetching" - }); - } - let result = initialValue; - let cancelled = false; - const streamFnContext = (0, import_utils.addConsumeAwareSignal)( - { - client: context.client, - meta: context.meta, - queryKey: context.queryKey, - pageParam: context.pageParam, - direction: context.direction - }, - () => context.signal, - () => cancelled = true - ); - const stream = await streamFn(streamFnContext); - const isReplaceRefetch = isRefetch && refetchMode === "replace"; - for await (const chunk of stream) { - if (cancelled) { - break; - } - if (isReplaceRefetch) { - result = reducer(result, chunk); - } else { - context.client.setQueryData( - context.queryKey, - (prev) => reducer(prev === void 0 ? initialValue : prev, chunk) - ); - } - } - if (isReplaceRefetch && !cancelled) { - context.client.setQueryData(context.queryKey, result); - } - return context.client.getQueryData(context.queryKey) ?? initialValue; - }; -} -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - streamedQuery -}); -//# sourceMappingURL=streamedQuery.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/streamedQuery.cjs.map b/node_modules/@tanstack/query-core/build/modern/streamedQuery.cjs.map deleted file mode 100644 index 37ef7ac..0000000 --- a/node_modules/@tanstack/query-core/build/modern/streamedQuery.cjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/streamedQuery.ts"],"sourcesContent":["import { addConsumeAwareSignal, addToEnd } from './utils'\nimport type {\n OmitKeyof,\n QueryFunction,\n QueryFunctionContext,\n QueryKey,\n} from './types'\n\ntype BaseStreamedQueryParams = {\n streamFn: (\n context: QueryFunctionContext,\n ) => AsyncIterable | Promise>\n refetchMode?: 'append' | 'reset' | 'replace'\n}\n\ntype SimpleStreamedQueryParams<\n TQueryFnData,\n TQueryKey extends QueryKey,\n> = BaseStreamedQueryParams & {\n reducer?: never\n initialValue?: never\n}\n\ntype ReducibleStreamedQueryParams<\n TQueryFnData,\n TData,\n TQueryKey extends QueryKey,\n> = BaseStreamedQueryParams & {\n reducer: (acc: TData, chunk: TQueryFnData) => TData\n initialValue: TData\n}\n\ntype StreamedQueryParams =\n | SimpleStreamedQueryParams\n | ReducibleStreamedQueryParams\n\n/**\n * This is a helper function to create a query function that streams data from an AsyncIterable.\n * Data will be an Array of all the chunks received.\n * The query will be in a 'pending' state until the first chunk of data is received, but will go to 'success' after that.\n * The query will stay in fetchStatus 'fetching' until the stream ends.\n * @param queryFn - The function that returns an AsyncIterable to stream data from.\n * @param refetchMode - Defines how re-fetches are handled.\n * Defaults to `'reset'`, erases all data and puts the query back into `pending` state.\n * Set to `'append'` to append new data to the existing data.\n * Set to `'replace'` to write all data to the cache once the stream ends.\n * @param reducer - A function to reduce the streamed chunks into the final data.\n * Defaults to a function that appends chunks to the end of the array.\n * @param initialValue - Initial value to be used while the first chunk is being fetched, and returned if the stream yields no values.\n */\nexport function streamedQuery<\n TQueryFnData = unknown,\n TData = Array,\n TQueryKey extends QueryKey = QueryKey,\n>({\n streamFn,\n refetchMode = 'reset',\n reducer = (items, chunk) =>\n addToEnd(items as Array, chunk) as TData,\n initialValue = [] as TData,\n}: StreamedQueryParams): QueryFunction<\n TData,\n TQueryKey\n> {\n return async (context) => {\n const query = context.client\n .getQueryCache()\n .find({ queryKey: context.queryKey, exact: true })\n const isRefetch = !!query && query.state.data !== undefined\n if (isRefetch && refetchMode === 'reset') {\n query.setState({\n status: 'pending',\n data: undefined,\n error: null,\n fetchStatus: 'fetching',\n })\n }\n\n let result = initialValue\n\n let cancelled: boolean = false as boolean\n const streamFnContext = addConsumeAwareSignal<\n OmitKeyof\n >(\n {\n client: context.client,\n meta: context.meta,\n queryKey: context.queryKey,\n pageParam: context.pageParam,\n direction: context.direction,\n },\n () => context.signal,\n () => (cancelled = true),\n )\n\n const stream = await streamFn(streamFnContext)\n\n const isReplaceRefetch = isRefetch && refetchMode === 'replace'\n\n for await (const chunk of stream) {\n if (cancelled) {\n break\n }\n\n if (isReplaceRefetch) {\n // don't append to the cache directly when replace-refetching\n result = reducer(result, chunk)\n } else {\n context.client.setQueryData(context.queryKey, (prev) =>\n reducer(prev === undefined ? initialValue : prev, chunk),\n )\n }\n }\n\n // finalize result: replace-refetching needs to write to the cache\n if (isReplaceRefetch && !cancelled) {\n context.client.setQueryData(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W;AAClC,cAAQ,OAAO,aAAoB,QAAQ,UAAU,MAAM;AAAA,IAC7D;AAEA,WAAO,QAAQ,OAAO,aAAa,QAAQ,QAAQ,KAAK;AAAA,EAC1D;AACF;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/streamedQuery.d.cts b/node_modules/@tanstack/query-core/build/modern/streamedQuery.d.cts deleted file mode 100644 index c133466..0000000 --- a/node_modules/@tanstack/query-core/build/modern/streamedQuery.d.cts +++ /dev/null @@ -1,34 +0,0 @@ -import { I as QueryKey, a1 as QueryFunctionContext, Y as QueryFunction } from './hydration-uphG6M-i.cjs'; -import './removable.cjs'; -import './subscribable.cjs'; - -type BaseStreamedQueryParams = { - streamFn: (context: QueryFunctionContext) => AsyncIterable | Promise>; - refetchMode?: 'append' | 'reset' | 'replace'; -}; -type SimpleStreamedQueryParams = BaseStreamedQueryParams & { - reducer?: never; - initialValue?: never; -}; -type ReducibleStreamedQueryParams = BaseStreamedQueryParams & { - reducer: (acc: TData, chunk: TQueryFnData) => TData; - initialValue: TData; -}; -type StreamedQueryParams = SimpleStreamedQueryParams | ReducibleStreamedQueryParams; -/** - * This is a helper function to create a query function that streams data from an AsyncIterable. - * Data will be an Array of all the chunks received. - * The query will be in a 'pending' state until the first chunk of data is received, but will go to 'success' after that. - * The query will stay in fetchStatus 'fetching' until the stream ends. - * @param queryFn - The function that returns an AsyncIterable to stream data from. - * @param refetchMode - Defines how re-fetches are handled. - * Defaults to `'reset'`, erases all data and puts the query back into `pending` state. - * Set to `'append'` to append new data to the existing data. - * Set to `'replace'` to write all data to the cache once the stream ends. - * @param reducer - A function to reduce the streamed chunks into the final data. - * Defaults to a function that appends chunks to the end of the array. - * @param initialValue - Initial value to be used while the first chunk is being fetched, and returned if the stream yields no values. - */ -declare function streamedQuery, TQueryKey extends QueryKey = QueryKey>({ streamFn, refetchMode, reducer, initialValue, }: StreamedQueryParams): QueryFunction; - -export { streamedQuery }; diff --git a/node_modules/@tanstack/query-core/build/modern/streamedQuery.d.ts b/node_modules/@tanstack/query-core/build/modern/streamedQuery.d.ts deleted file mode 100644 index 44d3ec4..0000000 --- a/node_modules/@tanstack/query-core/build/modern/streamedQuery.d.ts +++ /dev/null @@ -1,34 +0,0 @@ -import { I as QueryKey, a1 as QueryFunctionContext, Y as QueryFunction } from './hydration-BlEVG2Lp.js'; -import './removable.js'; -import './subscribable.js'; - -type BaseStreamedQueryParams = { - streamFn: (context: QueryFunctionContext) => AsyncIterable | Promise>; - refetchMode?: 'append' | 'reset' | 'replace'; -}; -type SimpleStreamedQueryParams = BaseStreamedQueryParams & { - reducer?: never; - initialValue?: never; -}; -type ReducibleStreamedQueryParams = BaseStreamedQueryParams & { - reducer: (acc: TData, chunk: TQueryFnData) => TData; - initialValue: TData; -}; -type StreamedQueryParams = SimpleStreamedQueryParams | ReducibleStreamedQueryParams; -/** - * This is a helper function to create a query function that streams data from an AsyncIterable. - * Data will be an Array of all the chunks received. - * The query will be in a 'pending' state until the first chunk of data is received, but will go to 'success' after that. - * The query will stay in fetchStatus 'fetching' until the stream ends. - * @param queryFn - The function that returns an AsyncIterable to stream data from. - * @param refetchMode - Defines how re-fetches are handled. - * Defaults to `'reset'`, erases all data and puts the query back into `pending` state. - * Set to `'append'` to append new data to the existing data. - * Set to `'replace'` to write all data to the cache once the stream ends. - * @param reducer - A function to reduce the streamed chunks into the final data. - * Defaults to a function that appends chunks to the end of the array. - * @param initialValue - Initial value to be used while the first chunk is being fetched, and returned if the stream yields no values. - */ -declare function streamedQuery, TQueryKey extends QueryKey = QueryKey>({ streamFn, refetchMode, reducer, initialValue, }: StreamedQueryParams): QueryFunction; - -export { streamedQuery }; diff --git a/node_modules/@tanstack/query-core/build/modern/streamedQuery.js b/node_modules/@tanstack/query-core/build/modern/streamedQuery.js deleted file mode 100644 index 0b32883..0000000 --- a/node_modules/@tanstack/query-core/build/modern/streamedQuery.js +++ /dev/null @@ -1,57 +0,0 @@ -// src/streamedQuery.ts -import { addConsumeAwareSignal, addToEnd } from "./utils.js"; -function streamedQuery({ - streamFn, - refetchMode = "reset", - reducer = (items, chunk) => addToEnd(items, chunk), - initialValue = [] -}) { - return async (context) => { - const query = context.client.getQueryCache().find({ queryKey: context.queryKey, exact: true }); - const isRefetch = !!query && query.state.data !== void 0; - if (isRefetch && refetchMode === "reset") { - query.setState({ - status: "pending", - data: void 0, - error: null, - fetchStatus: "fetching" - }); - } - let result = initialValue; - let cancelled = false; - const streamFnContext = addConsumeAwareSignal( - { - client: context.client, - meta: context.meta, - queryKey: context.queryKey, - pageParam: context.pageParam, - direction: context.direction - }, - () => context.signal, - () => cancelled = true - ); - const stream = await streamFn(streamFnContext); - const isReplaceRefetch = isRefetch && refetchMode === "replace"; - for await (const chunk of stream) { - if (cancelled) { - break; - } - if (isReplaceRefetch) { - result = reducer(result, chunk); - } else { - context.client.setQueryData( - context.queryKey, - (prev) => reducer(prev === void 0 ? initialValue : prev, chunk) - ); - } - } - if (isReplaceRefetch && !cancelled) { - context.client.setQueryData(context.queryKey, result); - } - return context.client.getQueryData(context.queryKey) ?? initialValue; - }; -} -export { - streamedQuery -}; -//# sourceMappingURL=streamedQuery.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/streamedQuery.js.map b/node_modules/@tanstack/query-core/build/modern/streamedQuery.js.map deleted file mode 100644 index a862d01..0000000 --- a/node_modules/@tanstack/query-core/build/modern/streamedQuery.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/streamedQuery.ts"],"sourcesContent":["import { addConsumeAwareSignal, addToEnd } from './utils'\nimport type {\n OmitKeyof,\n QueryFunction,\n QueryFunctionContext,\n QueryKey,\n} from './types'\n\ntype BaseStreamedQueryParams = {\n streamFn: (\n context: QueryFunctionContext,\n ) => AsyncIterable | Promise>\n refetchMode?: 'append' | 'reset' | 'replace'\n}\n\ntype SimpleStreamedQueryParams<\n TQueryFnData,\n TQueryKey extends QueryKey,\n> = BaseStreamedQueryParams & {\n reducer?: never\n initialValue?: never\n}\n\ntype ReducibleStreamedQueryParams<\n TQueryFnData,\n TData,\n TQueryKey extends QueryKey,\n> = BaseStreamedQueryParams & {\n reducer: (acc: TData, chunk: TQueryFnData) => TData\n initialValue: TData\n}\n\ntype StreamedQueryParams =\n | SimpleStreamedQueryParams\n | ReducibleStreamedQueryParams\n\n/**\n * This is a helper function to create a query function that streams data from an AsyncIterable.\n * Data will be an Array of all the chunks received.\n * The query will be in a 'pending' state until the first chunk of data is received, but will go to 'success' after that.\n * The query will stay in fetchStatus 'fetching' until the stream ends.\n * @param queryFn - The function that returns an AsyncIterable to stream data from.\n * @param refetchMode - Defines how re-fetches are handled.\n * Defaults to `'reset'`, erases all data and puts the query back into `pending` state.\n * Set to `'append'` to append new data to the existing data.\n * Set to `'replace'` to write all data to the cache once the stream ends.\n * @param reducer - A function to reduce the streamed chunks into the final data.\n * Defaults to a function that appends chunks to the end of the array.\n * @param initialValue - Initial value to be used while the first chunk is being fetched, and returned if the stream yields no values.\n */\nexport function streamedQuery<\n TQueryFnData = unknown,\n TData = Array,\n TQueryKey extends QueryKey = QueryKey,\n>({\n streamFn,\n refetchMode = 'reset',\n reducer = (items, chunk) =>\n addToEnd(items as Array, chunk) as TData,\n initialValue = [] as TData,\n}: StreamedQueryParams): QueryFunction<\n TData,\n TQueryKey\n> {\n return async (context) => {\n const query = context.client\n .getQueryCache()\n .find({ queryKey: context.queryKey, exact: true })\n const isRefetch = !!query && query.state.data !== undefined\n if (isRefetch && refetchMode === 'reset') {\n query.setState({\n status: 'pending',\n data: undefined,\n error: null,\n fetchStatus: 'fetching',\n })\n }\n\n let result = initialValue\n\n let cancelled: boolean = false as boolean\n const streamFnContext = addConsumeAwareSignal<\n OmitKeyof\n >(\n {\n client: context.client,\n meta: context.meta,\n queryKey: context.queryKey,\n pageParam: context.pageParam,\n direction: context.direction,\n },\n () => context.signal,\n () => (cancelled = true),\n )\n\n const stream = await streamFn(streamFnContext)\n\n const isReplaceRefetch = isRefetch && refetchMode === 'replace'\n\n for await (const chunk of stream) {\n if (cancelled) {\n break\n }\n\n if (isReplaceRefetch) {\n // don't append to the cache directly when replace-refetching\n result = reducer(result, chunk)\n } else {\n context.client.setQueryData(context.queryKey, (prev) =>\n reducer(prev === undefined ? initialValue : prev, chunk),\n )\n }\n }\n\n // finalize result: replace-refetching needs to write to the cache\n if (isReplaceRefetch && !cancelled) {\n context.client.setQueryData(context.queryKey, result)\n }\n\n return context.client.getQueryData(context.queryKey) ?? initialValue\n }\n}\n"],"mappings":";AAAA,SAAS,uBAAuB,gBAAgB;AAkDzC,SAAS,cAId;AAAA,EACA;AAAA,EACA,cAAc;AAAA,EACd,UAAU,CAAC,OAAO,UAChB,SAAS,OAA8B,KAAK;AAAA,EAC9C,eAAe,CAAC;AAClB,GAGE;AACA,SAAO,OAAO,YAAY;AACxB,UAAM,QAAQ,QAAQ,OACnB,cAAc,EACd,KAAK,EAAE,UAAU,QAAQ,UAAU,OAAO,KAAK,CAAC;AACnD,UAAM,YAAY,CAAC,CAAC,SAAS,MAAM,MAAM,SAAS;AAClD,QAAI,aAAa,gBAAgB,SAAS;AACxC,YAAM,SAAS;AAAA,QACb,QAAQ;AAAA,QACR,MAAM;AAAA,QACN,OAAO;AAAA,QACP,aAAa;AAAA,MACf,CAAC;AAAA,IACH;AAEA,QAAI,SAAS;AAEb,QAAI,YAAqB;AACzB,UAAM,kBAAkB;AAAA,MAGtB;AAAA,QACE,QAAQ,QAAQ;AAAA,QAChB,MAAM,QAAQ;AAAA,QACd,UAAU,QAAQ;AAAA,QAClB,WAAW,QAAQ;AAAA,QACnB,WAAW,QAAQ;AAAA,MACrB;AAAA,MACA,MAAM,QAAQ;AAAA,MACd,MAAO,YAAY;AAAA,IACrB;AAEA,UAAM,SAAS,MAAM,SAAS,eAAe;AAE7C,UAAM,mBAAmB,aAAa,gBAAgB;AAEtD,qBAAiB,SAAS,QAAQ;AAChC,UAAI,WAAW;AACb;AAAA,MACF;AAEA,UAAI,kBAAkB;AAEpB,iBAAS,QAAQ,QAAQ,KAAK;AAAA,MAChC,OAAO;AACL,gBAAQ,OAAO;AAAA,UAAoB,QAAQ;AAAA,UAAU,CAAC,SACpD,QAAQ,SAAS,SAAY,eAAe,MAAM,KAAK;AAAA,QACzD;AAAA,MACF;AAAA,IACF;AAGA,QAAI,oBAAoB,CAAC,WAAW;AAClC,cAAQ,OAAO,aAAoB,QAAQ,UAAU,MAAM;AAAA,IAC7D;AAEA,WAAO,QAAQ,OAAO,aAAa,QAAQ,QAAQ,KAAK;AAAA,EAC1D;AACF;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/subscribable.cjs b/node_modules/@tanstack/query-core/build/modern/subscribable.cjs deleted file mode 100644 index c402602..0000000 --- a/node_modules/@tanstack/query-core/build/modern/subscribable.cjs +++ /dev/null @@ -1,51 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// src/subscribable.ts -var subscribable_exports = {}; -__export(subscribable_exports, { - Subscribable: () => Subscribable -}); -module.exports = __toCommonJS(subscribable_exports); -var Subscribable = class { - constructor() { - this.listeners = /* @__PURE__ */ new Set(); - this.subscribe = this.subscribe.bind(this); - } - subscribe(listener) { - this.listeners.add(listener); - this.onSubscribe(); - return () => { - this.listeners.delete(listener); - this.onUnsubscribe(); - }; - } - hasListeners() { - return this.listeners.size > 0; - } - onSubscribe() { - } - onUnsubscribe() { - } -}; -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - Subscribable -}); -//# sourceMappingURL=subscribable.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/subscribable.cjs.map b/node_modules/@tanstack/query-core/build/modern/subscribable.cjs.map deleted file mode 100644 index 43f8336..0000000 --- a/node_modules/@tanstack/query-core/build/modern/subscribable.cjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/subscribable.ts"],"sourcesContent":["export class Subscribable {\n protected listeners = new Set()\n\n constructor() {\n this.subscribe = this.subscribe.bind(this)\n }\n\n subscribe(listener: TListener): () => void {\n this.listeners.add(listener)\n\n this.onSubscribe()\n\n return () => {\n this.listeners.delete(listener)\n this.onUnsubscribe()\n }\n }\n\n hasListeners(): boolean {\n return this.listeners.size > 0\n }\n\n protected onSubscribe(): void {\n // Do nothing\n }\n\n protected onUnsubscribe(): void {\n // Do nothing\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAO,IAAM,eAAN,MAA+C;AAAA,EAGpD,cAAc;AAFd,SAAU,YAAY,oBAAI,IAAe;AAGvC,SAAK,YAAY,KAAK,UAAU,KAAK,IAAI;AAAA,EAC3C;AAAA,EAEA,UAAU,UAAiC;AACzC,SAAK,UAAU,IAAI,QAAQ;AAE3B,SAAK,YAAY;AAEjB,WAAO,MAAM;AACX,WAAK,UAAU,OAAO,QAAQ;AAC9B,WAAK,cAAc;AAAA,IACrB;AAAA,EACF;AAAA,EAEA,eAAwB;AACtB,WAAO,KAAK,UAAU,OAAO;AAAA,EAC/B;AAAA,EAEU,cAAoB;AAAA,EAE9B;AAAA,EAEU,gBAAsB;AAAA,EAEhC;AACF;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/subscribable.d.cts b/node_modules/@tanstack/query-core/build/modern/subscribable.d.cts deleted file mode 100644 index 5ac4d3d..0000000 --- a/node_modules/@tanstack/query-core/build/modern/subscribable.d.cts +++ /dev/null @@ -1,10 +0,0 @@ -declare class Subscribable { - protected listeners: Set; - constructor(); - subscribe(listener: TListener): () => void; - hasListeners(): boolean; - protected onSubscribe(): void; - protected onUnsubscribe(): void; -} - -export { Subscribable }; diff --git a/node_modules/@tanstack/query-core/build/modern/subscribable.d.ts b/node_modules/@tanstack/query-core/build/modern/subscribable.d.ts deleted file mode 100644 index 5ac4d3d..0000000 --- a/node_modules/@tanstack/query-core/build/modern/subscribable.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -declare class Subscribable { - protected listeners: Set; - constructor(); - subscribe(listener: TListener): () => void; - hasListeners(): boolean; - protected onSubscribe(): void; - protected onUnsubscribe(): void; -} - -export { Subscribable }; diff --git a/node_modules/@tanstack/query-core/build/modern/subscribable.js b/node_modules/@tanstack/query-core/build/modern/subscribable.js deleted file mode 100644 index a8516a4..0000000 --- a/node_modules/@tanstack/query-core/build/modern/subscribable.js +++ /dev/null @@ -1,26 +0,0 @@ -// src/subscribable.ts -var Subscribable = class { - constructor() { - this.listeners = /* @__PURE__ */ new Set(); - this.subscribe = this.subscribe.bind(this); - } - subscribe(listener) { - this.listeners.add(listener); - this.onSubscribe(); - return () => { - this.listeners.delete(listener); - this.onUnsubscribe(); - }; - } - hasListeners() { - return this.listeners.size > 0; - } - onSubscribe() { - } - onUnsubscribe() { - } -}; -export { - Subscribable -}; -//# sourceMappingURL=subscribable.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/subscribable.js.map b/node_modules/@tanstack/query-core/build/modern/subscribable.js.map deleted file mode 100644 index 85f855b..0000000 --- a/node_modules/@tanstack/query-core/build/modern/subscribable.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/subscribable.ts"],"sourcesContent":["export class Subscribable {\n protected listeners = new Set()\n\n constructor() {\n this.subscribe = this.subscribe.bind(this)\n }\n\n subscribe(listener: TListener): () => void {\n this.listeners.add(listener)\n\n this.onSubscribe()\n\n return () => {\n this.listeners.delete(listener)\n this.onUnsubscribe()\n }\n }\n\n hasListeners(): boolean {\n return this.listeners.size > 0\n }\n\n protected onSubscribe(): void {\n // Do nothing\n }\n\n protected onUnsubscribe(): void {\n // Do nothing\n }\n}\n"],"mappings":";AAAO,IAAM,eAAN,MAA+C;AAAA,EAGpD,cAAc;AAFd,SAAU,YAAY,oBAAI,IAAe;AAGvC,SAAK,YAAY,KAAK,UAAU,KAAK,IAAI;AAAA,EAC3C;AAAA,EAEA,UAAU,UAAiC;AACzC,SAAK,UAAU,IAAI,QAAQ;AAE3B,SAAK,YAAY;AAEjB,WAAO,MAAM;AACX,WAAK,UAAU,OAAO,QAAQ;AAC9B,WAAK,cAAc;AAAA,IACrB;AAAA,EACF;AAAA,EAEA,eAAwB;AACtB,WAAO,KAAK,UAAU,OAAO;AAAA,EAC/B;AAAA,EAEU,cAAoB;AAAA,EAE9B;AAAA,EAEU,gBAAsB;AAAA,EAEhC;AACF;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/thenable.cjs b/node_modules/@tanstack/query-core/build/modern/thenable.cjs deleted file mode 100644 index 92d10b2..0000000 --- a/node_modules/@tanstack/query-core/build/modern/thenable.cjs +++ /dev/null @@ -1,75 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// src/thenable.ts -var thenable_exports = {}; -__export(thenable_exports, { - pendingThenable: () => pendingThenable, - tryResolveSync: () => tryResolveSync -}); -module.exports = __toCommonJS(thenable_exports); -var import_utils = require("./utils.cjs"); -function pendingThenable() { - let resolve; - let reject; - const thenable = new Promise((_resolve, _reject) => { - resolve = _resolve; - reject = _reject; - }); - thenable.status = "pending"; - thenable.catch(() => { - }); - function finalize(data) { - Object.assign(thenable, data); - delete thenable.resolve; - delete thenable.reject; - } - thenable.resolve = (value) => { - finalize({ - status: "fulfilled", - value - }); - resolve(value); - }; - thenable.reject = (reason) => { - finalize({ - status: "rejected", - reason - }); - reject(reason); - }; - return thenable; -} -function tryResolveSync(promise) { - let data; - promise.then((result) => { - data = result; - return result; - }, import_utils.noop)?.catch(import_utils.noop); - if (data !== void 0) { - return { data }; - } - return void 0; -} -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - pendingThenable, - tryResolveSync -}); -//# sourceMappingURL=thenable.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/thenable.cjs.map b/node_modules/@tanstack/query-core/build/modern/thenable.cjs.map deleted file mode 100644 index 3170760..0000000 --- a/node_modules/@tanstack/query-core/build/modern/thenable.cjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/thenable.ts"],"sourcesContent":["/**\n * Thenable types which matches React's types for promises\n *\n * React seemingly uses `.status`, `.value` and `.reason` properties on a promises to optimistically unwrap data from promises\n *\n * @see https://github.com/facebook/react/blob/main/packages/shared/ReactTypes.js#L112-L138\n * @see https://github.com/facebook/react/blob/4f604941569d2e8947ce1460a0b2997e835f37b9/packages/react-debug-tools/src/ReactDebugHooks.js#L224-L227\n */\n\nimport { noop } from './utils'\n\ninterface Fulfilled {\n status: 'fulfilled'\n value: T\n}\ninterface Rejected {\n status: 'rejected'\n reason: unknown\n}\ninterface Pending {\n status: 'pending'\n\n /**\n * Resolve the promise with a value.\n * Will remove the `resolve` and `reject` properties from the promise.\n */\n resolve: (value: T) => void\n /**\n * Reject the promise with a reason.\n * Will remove the `resolve` and `reject` properties from the promise.\n */\n reject: (reason: unknown) => void\n}\n\nexport type FulfilledThenable = Promise & Fulfilled\nexport type RejectedThenable = Promise & Rejected\nexport type PendingThenable = Promise & Pending\n\nexport type Thenable =\n | FulfilledThenable\n | RejectedThenable\n | PendingThenable\n\nexport function pendingThenable(): PendingThenable {\n let resolve: Pending['resolve']\n let reject: Pending['reject']\n // this could use `Promise.withResolvers()` in the future\n const thenable = new Promise((_resolve, _reject) => {\n resolve = _resolve\n reject = _reject\n }) as PendingThenable\n\n thenable.status = 'pending'\n thenable.catch(() => {\n // prevent unhandled rejection errors\n })\n\n function finalize(data: Fulfilled | Rejected) {\n Object.assign(thenable, data)\n\n // clear pending props props to avoid calling them twice\n delete (thenable as Partial>).resolve\n delete (thenable as Partial>).reject\n }\n\n thenable.resolve = (value) => {\n finalize({\n status: 'fulfilled',\n value,\n })\n\n resolve(value)\n }\n thenable.reject = (reason) => {\n finalize({\n status: 'rejected',\n reason,\n })\n\n reject(reason)\n }\n\n return thenable\n}\n\n/**\n * This function takes a Promise-like input and detects whether the data\n * is synchronously available or not.\n *\n * It does not inspect .status, .value or .reason properties of the promise,\n * as those are not always available, and the .status of React's promises\n * should not be considered part of the public API.\n */\nexport function tryResolveSync(promise: Promise | Thenable) {\n let data: unknown\n\n promise\n .then((result) => {\n data = result\n return result\n }, noop)\n // .catch can be unavailable on certain kinds of thenable's\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n ?.catch(noop)\n\n if (data !== undefined) {\n return { data }\n }\n\n return undefined\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASA,mBAAqB;AAkCd,SAAS,kBAAyC;AACvD,MAAI;AACJ,MAAI;AAEJ,QAAM,WAAW,IAAI,QAAQ,CAAC,UAAU,YAAY;AAClD,cAAU;AACV,aAAS;AAAA,EACX,CAAC;AAED,WAAS,SAAS;AAClB,WAAS,MAAM,MAAM;AAAA,EAErB,CAAC;AAED,WAAS,SAAS,MAA+B;AAC/C,WAAO,OAAO,UAAU,IAAI;AAG5B,WAAQ,SAAyC;AACjD,WAAQ,SAAyC;AAAA,EACnD;AAEA,WAAS,UAAU,CAAC,UAAU;AAC5B,aAAS;AAAA,MACP,QAAQ;AAAA,MACR;AAAA,IACF,CAAC;AAED,YAAQ,KAAK;AAAA,EACf;AACA,WAAS,SAAS,CAAC,WAAW;AAC5B,aAAS;AAAA,MACP,QAAQ;AAAA,MACR;AAAA,IACF,CAAC;AAED,WAAO,MAAM;AAAA,EACf;AAEA,SAAO;AACT;AAUO,SAAS,eAAe,SAA+C;AAC5E,MAAI;AAEJ,UACG,KAAK,CAAC,WAAW;AAChB,WAAO;AACP,WAAO;AAAA,EACT,GAAG,iBAAI,GAGL,MAAM,iBAAI;AAEd,MAAI,SAAS,QAAW;AACtB,WAAO,EAAE,KAAK;AAAA,EAChB;AAEA,SAAO;AACT;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/thenable.d.cts b/node_modules/@tanstack/query-core/build/modern/thenable.d.cts deleted file mode 100644 index 2378593..0000000 --- a/node_modules/@tanstack/query-core/build/modern/thenable.d.cts +++ /dev/null @@ -1,47 +0,0 @@ -/** - * Thenable types which matches React's types for promises - * - * React seemingly uses `.status`, `.value` and `.reason` properties on a promises to optimistically unwrap data from promises - * - * @see https://github.com/facebook/react/blob/main/packages/shared/ReactTypes.js#L112-L138 - * @see https://github.com/facebook/react/blob/4f604941569d2e8947ce1460a0b2997e835f37b9/packages/react-debug-tools/src/ReactDebugHooks.js#L224-L227 - */ -interface Fulfilled { - status: 'fulfilled'; - value: T; -} -interface Rejected { - status: 'rejected'; - reason: unknown; -} -interface Pending { - status: 'pending'; - /** - * Resolve the promise with a value. - * Will remove the `resolve` and `reject` properties from the promise. - */ - resolve: (value: T) => void; - /** - * Reject the promise with a reason. - * Will remove the `resolve` and `reject` properties from the promise. - */ - reject: (reason: unknown) => void; -} -type FulfilledThenable = Promise & Fulfilled; -type RejectedThenable = Promise & Rejected; -type PendingThenable = Promise & Pending; -type Thenable = FulfilledThenable | RejectedThenable | PendingThenable; -declare function pendingThenable(): PendingThenable; -/** - * This function takes a Promise-like input and detects whether the data - * is synchronously available or not. - * - * It does not inspect .status, .value or .reason properties of the promise, - * as those are not always available, and the .status of React's promises - * should not be considered part of the public API. - */ -declare function tryResolveSync(promise: Promise | Thenable): { - data: {} | null; -} | undefined; - -export { type FulfilledThenable, type PendingThenable, type RejectedThenable, type Thenable, pendingThenable, tryResolveSync }; diff --git a/node_modules/@tanstack/query-core/build/modern/thenable.d.ts b/node_modules/@tanstack/query-core/build/modern/thenable.d.ts deleted file mode 100644 index 2378593..0000000 --- a/node_modules/@tanstack/query-core/build/modern/thenable.d.ts +++ /dev/null @@ -1,47 +0,0 @@ -/** - * Thenable types which matches React's types for promises - * - * React seemingly uses `.status`, `.value` and `.reason` properties on a promises to optimistically unwrap data from promises - * - * @see https://github.com/facebook/react/blob/main/packages/shared/ReactTypes.js#L112-L138 - * @see https://github.com/facebook/react/blob/4f604941569d2e8947ce1460a0b2997e835f37b9/packages/react-debug-tools/src/ReactDebugHooks.js#L224-L227 - */ -interface Fulfilled { - status: 'fulfilled'; - value: T; -} -interface Rejected { - status: 'rejected'; - reason: unknown; -} -interface Pending { - status: 'pending'; - /** - * Resolve the promise with a value. - * Will remove the `resolve` and `reject` properties from the promise. - */ - resolve: (value: T) => void; - /** - * Reject the promise with a reason. - * Will remove the `resolve` and `reject` properties from the promise. - */ - reject: (reason: unknown) => void; -} -type FulfilledThenable = Promise & Fulfilled; -type RejectedThenable = Promise & Rejected; -type PendingThenable = Promise & Pending; -type Thenable = FulfilledThenable | RejectedThenable | PendingThenable; -declare function pendingThenable(): PendingThenable; -/** - * This function takes a Promise-like input and detects whether the data - * is synchronously available or not. - * - * It does not inspect .status, .value or .reason properties of the promise, - * as those are not always available, and the .status of React's promises - * should not be considered part of the public API. - */ -declare function tryResolveSync(promise: Promise | Thenable): { - data: {} | null; -} | undefined; - -export { type FulfilledThenable, type PendingThenable, type RejectedThenable, type Thenable, pendingThenable, tryResolveSync }; diff --git a/node_modules/@tanstack/query-core/build/modern/thenable.js b/node_modules/@tanstack/query-core/build/modern/thenable.js deleted file mode 100644 index b5c4f0b..0000000 --- a/node_modules/@tanstack/query-core/build/modern/thenable.js +++ /dev/null @@ -1,49 +0,0 @@ -// src/thenable.ts -import { noop } from "./utils.js"; -function pendingThenable() { - let resolve; - let reject; - const thenable = new Promise((_resolve, _reject) => { - resolve = _resolve; - reject = _reject; - }); - thenable.status = "pending"; - thenable.catch(() => { - }); - function finalize(data) { - Object.assign(thenable, data); - delete thenable.resolve; - delete thenable.reject; - } - thenable.resolve = (value) => { - finalize({ - status: "fulfilled", - value - }); - resolve(value); - }; - thenable.reject = (reason) => { - finalize({ - status: "rejected", - reason - }); - reject(reason); - }; - return thenable; -} -function tryResolveSync(promise) { - let data; - promise.then((result) => { - data = result; - return result; - }, noop)?.catch(noop); - if (data !== void 0) { - return { data }; - } - return void 0; -} -export { - pendingThenable, - tryResolveSync -}; -//# sourceMappingURL=thenable.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/thenable.js.map b/node_modules/@tanstack/query-core/build/modern/thenable.js.map deleted file mode 100644 index 26131bb..0000000 --- a/node_modules/@tanstack/query-core/build/modern/thenable.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/thenable.ts"],"sourcesContent":["/**\n * Thenable types which matches React's types for promises\n *\n * React seemingly uses `.status`, `.value` and `.reason` properties on a promises to optimistically unwrap data from promises\n *\n * @see https://github.com/facebook/react/blob/main/packages/shared/ReactTypes.js#L112-L138\n * @see https://github.com/facebook/react/blob/4f604941569d2e8947ce1460a0b2997e835f37b9/packages/react-debug-tools/src/ReactDebugHooks.js#L224-L227\n */\n\nimport { noop } from './utils'\n\ninterface Fulfilled {\n status: 'fulfilled'\n value: T\n}\ninterface Rejected {\n status: 'rejected'\n reason: unknown\n}\ninterface Pending {\n status: 'pending'\n\n /**\n * Resolve the promise with a value.\n * Will remove the `resolve` and `reject` properties from the promise.\n */\n resolve: (value: T) => void\n /**\n * Reject the promise with a reason.\n * Will remove the `resolve` and `reject` properties from the promise.\n */\n reject: (reason: unknown) => void\n}\n\nexport type FulfilledThenable = Promise & Fulfilled\nexport type RejectedThenable = Promise & Rejected\nexport type PendingThenable = Promise & Pending\n\nexport type Thenable =\n | FulfilledThenable\n | RejectedThenable\n | PendingThenable\n\nexport function pendingThenable(): PendingThenable {\n let resolve: Pending['resolve']\n let reject: Pending['reject']\n // this could use `Promise.withResolvers()` in the future\n const thenable = new Promise((_resolve, _reject) => {\n resolve = _resolve\n reject = _reject\n }) as PendingThenable\n\n thenable.status = 'pending'\n thenable.catch(() => {\n // prevent unhandled rejection errors\n })\n\n function finalize(data: Fulfilled | Rejected) {\n Object.assign(thenable, data)\n\n // clear pending props props to avoid calling them twice\n delete (thenable as Partial>).resolve\n delete (thenable as Partial>).reject\n }\n\n thenable.resolve = (value) => {\n finalize({\n status: 'fulfilled',\n value,\n })\n\n resolve(value)\n }\n thenable.reject = (reason) => {\n finalize({\n status: 'rejected',\n reason,\n })\n\n reject(reason)\n }\n\n return thenable\n}\n\n/**\n * This function takes a Promise-like input and detects whether the data\n * is synchronously available or not.\n *\n * It does not inspect .status, .value or .reason properties of the promise,\n * as those are not always available, and the .status of React's promises\n * should not be considered part of the public API.\n */\nexport function tryResolveSync(promise: Promise | Thenable) {\n let data: unknown\n\n promise\n .then((result) => {\n data = result\n return result\n }, noop)\n // .catch can be unavailable on certain kinds of thenable's\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n ?.catch(noop)\n\n if (data !== undefined) {\n return { data }\n }\n\n return undefined\n}\n"],"mappings":";AASA,SAAS,YAAY;AAkCd,SAAS,kBAAyC;AACvD,MAAI;AACJ,MAAI;AAEJ,QAAM,WAAW,IAAI,QAAQ,CAAC,UAAU,YAAY;AAClD,cAAU;AACV,aAAS;AAAA,EACX,CAAC;AAED,WAAS,SAAS;AAClB,WAAS,MAAM,MAAM;AAAA,EAErB,CAAC;AAED,WAAS,SAAS,MAA+B;AAC/C,WAAO,OAAO,UAAU,IAAI;AAG5B,WAAQ,SAAyC;AACjD,WAAQ,SAAyC;AAAA,EACnD;AAEA,WAAS,UAAU,CAAC,UAAU;AAC5B,aAAS;AAAA,MACP,QAAQ;AAAA,MACR;AAAA,IACF,CAAC;AAED,YAAQ,KAAK;AAAA,EACf;AACA,WAAS,SAAS,CAAC,WAAW;AAC5B,aAAS;AAAA,MACP,QAAQ;AAAA,MACR;AAAA,IACF,CAAC;AAED,WAAO,MAAM;AAAA,EACf;AAEA,SAAO;AACT;AAUO,SAAS,eAAe,SAA+C;AAC5E,MAAI;AAEJ,UACG,KAAK,CAAC,WAAW;AAChB,WAAO;AACP,WAAO;AAAA,EACT,GAAG,IAAI,GAGL,MAAM,IAAI;AAEd,MAAI,SAAS,QAAW;AACtB,WAAO,EAAE,KAAK;AAAA,EAChB;AAEA,SAAO;AACT;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/timeoutManager.cjs b/node_modules/@tanstack/query-core/build/modern/timeoutManager.cjs deleted file mode 100644 index a37e420..0000000 --- a/node_modules/@tanstack/query-core/build/modern/timeoutManager.cjs +++ /dev/null @@ -1,98 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// src/timeoutManager.ts -var timeoutManager_exports = {}; -__export(timeoutManager_exports, { - TimeoutManager: () => TimeoutManager, - defaultTimeoutProvider: () => defaultTimeoutProvider, - systemSetTimeoutZero: () => systemSetTimeoutZero, - timeoutManager: () => timeoutManager -}); -module.exports = __toCommonJS(timeoutManager_exports); -var defaultTimeoutProvider = { - // We need the wrapper function syntax below instead of direct references to - // global setTimeout etc. - // - // BAD: `setTimeout: setTimeout` - // GOOD: `setTimeout: (cb, delay) => setTimeout(cb, delay)` - // - // If we use direct references here, then anything that wants to spy on or - // replace the global setTimeout (like tests) won't work since we'll already - // have a hard reference to the original implementation at the time when this - // file was imported. - setTimeout: (callback, delay) => setTimeout(callback, delay), - clearTimeout: (timeoutId) => clearTimeout(timeoutId), - setInterval: (callback, delay) => setInterval(callback, delay), - clearInterval: (intervalId) => clearInterval(intervalId) -}; -var TimeoutManager = class { - // We cannot have TimeoutManager as we must instantiate it with a concrete - // type at app boot; and if we leave that type, then any new timer provider - // would need to support ReturnType, which is infeasible. - // - // We settle for type safety for the TimeoutProvider type, and accept that - // this class is unsafe internally to allow for extension. - #provider = defaultTimeoutProvider; - #providerCalled = false; - setTimeoutProvider(provider) { - if (process.env.NODE_ENV !== "production") { - if (this.#providerCalled && provider !== this.#provider) { - console.error( - `[timeoutManager]: Switching provider after calls to previous provider might result in unexpected behavior.`, - { previous: this.#provider, provider } - ); - } - } - this.#provider = provider; - if (process.env.NODE_ENV !== "production") { - this.#providerCalled = false; - } - } - setTimeout(callback, delay) { - if (process.env.NODE_ENV !== "production") { - this.#providerCalled = true; - } - return this.#provider.setTimeout(callback, delay); - } - clearTimeout(timeoutId) { - this.#provider.clearTimeout(timeoutId); - } - setInterval(callback, delay) { - if (process.env.NODE_ENV !== "production") { - this.#providerCalled = true; - } - return this.#provider.setInterval(callback, delay); - } - clearInterval(intervalId) { - this.#provider.clearInterval(intervalId); - } -}; -var timeoutManager = new TimeoutManager(); -function systemSetTimeoutZero(callback) { - setTimeout(callback, 0); -} -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - TimeoutManager, - defaultTimeoutProvider, - systemSetTimeoutZero, - timeoutManager -}); -//# sourceMappingURL=timeoutManager.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/timeoutManager.cjs.map b/node_modules/@tanstack/query-core/build/modern/timeoutManager.cjs.map deleted file mode 100644 index d7c8691..0000000 --- a/node_modules/@tanstack/query-core/build/modern/timeoutManager.cjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/timeoutManager.ts"],"sourcesContent":["/**\n * {@link TimeoutManager} does not support passing arguments to the callback.\n *\n * `(_: void)` is the argument type inferred by TypeScript's default typings for\n * `setTimeout(cb, number)`.\n * If we don't accept a single void argument, then\n * `new Promise(resolve => timeoutManager.setTimeout(resolve, N))` is a type error.\n */\nexport type TimeoutCallback = (_: void) => void\n\n/**\n * Wrapping `setTimeout` is awkward from a typing perspective because platform\n * typings may extend the return type of `setTimeout`. For example, NodeJS\n * typings add `NodeJS.Timeout`; but a non-default `timeoutManager` may not be\n * able to return such a type.\n */\nexport type ManagedTimerId = number | { [Symbol.toPrimitive]: () => number }\n\n/**\n * Backend for timer functions.\n */\nexport type TimeoutProvider =\n {\n readonly setTimeout: (callback: TimeoutCallback, delay: number) => TTimerId\n readonly clearTimeout: (timeoutId: TTimerId | undefined) => void\n\n readonly setInterval: (callback: TimeoutCallback, delay: number) => TTimerId\n readonly clearInterval: (intervalId: TTimerId | undefined) => void\n }\n\nexport const defaultTimeoutProvider: TimeoutProvider<\n ReturnType\n> = {\n // We need the wrapper function syntax below instead of direct references to\n // global setTimeout etc.\n //\n // BAD: `setTimeout: setTimeout`\n // GOOD: `setTimeout: (cb, delay) => setTimeout(cb, delay)`\n //\n // If we use direct references here, then anything that wants to spy on or\n // replace the global setTimeout (like tests) won't work since we'll already\n // have a hard reference to the original implementation at the time when this\n // file was imported.\n setTimeout: (callback, delay) => setTimeout(callback, delay),\n clearTimeout: (timeoutId) => clearTimeout(timeoutId),\n\n setInterval: (callback, delay) => setInterval(callback, delay),\n clearInterval: (intervalId) => clearInterval(intervalId),\n}\n\n/**\n * Allows customization of how timeouts are created.\n *\n * @tanstack/query-core makes liberal use of timeouts to implement `staleTime`\n * and `gcTime`. The default TimeoutManager provider uses the platform's global\n * `setTimeout` implementation, which is known to have scalability issues with\n * thousands of timeouts on the event loop.\n *\n * If you hit this limitation, consider providing a custom TimeoutProvider that\n * coalesces timeouts.\n */\nexport class TimeoutManager implements Omit {\n // We cannot have TimeoutManager as we must instantiate it with a concrete\n // type at app boot; and if we leave that type, then any new timer provider\n // would need to support ReturnType, which is infeasible.\n //\n // We settle for type safety for the TimeoutProvider type, and accept that\n // this class is unsafe internally to allow for extension.\n #provider: TimeoutProvider = defaultTimeoutProvider\n #providerCalled = false\n\n setTimeoutProvider(\n provider: TimeoutProvider,\n ): void {\n if (process.env.NODE_ENV !== 'production') {\n if (this.#providerCalled && provider !== this.#provider) {\n // After changing providers, `clearTimeout` will not work as expected for\n // timeouts from the previous provider.\n //\n // Since they may allocate the same timeout ID, clearTimeout may cancel an\n // arbitrary different timeout, or unexpected no-op.\n //\n // We could protect against this by mixing the timeout ID bits\n // deterministically with some per-provider bits.\n //\n // We could internally queue `setTimeout` calls to `TimeoutManager` until\n // some API call to set the initial provider.\n console.error(\n `[timeoutManager]: Switching provider after calls to previous provider might result in unexpected behavior.`,\n { previous: this.#provider, provider },\n )\n }\n }\n\n this.#provider = provider\n if (process.env.NODE_ENV !== 'production') {\n this.#providerCalled = false\n }\n }\n\n setTimeout(callback: TimeoutCallback, delay: number): ManagedTimerId {\n if (process.env.NODE_ENV !== 'production') {\n this.#providerCalled = true\n }\n return this.#provider.setTimeout(callback, delay)\n }\n\n clearTimeout(timeoutId: ManagedTimerId | undefined): void {\n this.#provider.clearTimeout(timeoutId)\n }\n\n setInterval(callback: TimeoutCallback, delay: number): ManagedTimerId {\n if (process.env.NODE_ENV !== 'production') {\n this.#providerCalled = true\n }\n return this.#provider.setInterval(callback, delay)\n }\n\n clearInterval(intervalId: ManagedTimerId | undefined): void {\n this.#provider.clearInterval(intervalId)\n }\n}\n\nexport const timeoutManager = new TimeoutManager()\n\n/**\n * In many cases code wants to delay to the next event loop tick; this is not\n * mediated by {@link timeoutManager}.\n *\n * This function is provided to make auditing the `tanstack/query-core` for\n * incorrect use of system `setTimeout` easier.\n */\nexport function systemSetTimeoutZero(callback: TimeoutCallback): void {\n setTimeout(callback, 0)\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA8BO,IAAM,yBAET;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAWF,YAAY,CAAC,UAAU,UAAU,WAAW,UAAU,KAAK;AAAA,EAC3D,cAAc,CAAC,cAAc,aAAa,SAAS;AAAA,EAEnD,aAAa,CAAC,UAAU,UAAU,YAAY,UAAU,KAAK;AAAA,EAC7D,eAAe,CAAC,eAAe,cAAc,UAAU;AACzD;AAaO,IAAM,iBAAN,MAA8D;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOnE,YAAkC;AAAA,EAClC,kBAAkB;AAAA,EAElB,mBACE,UACM;AACN,QAAI,QAAQ,IAAI,aAAa,cAAc;AACzC,UAAI,KAAK,mBAAmB,aAAa,KAAK,WAAW;AAYvD,gBAAQ;AAAA,UACN;AAAA,UACA,EAAE,UAAU,KAAK,WAAW,SAAS;AAAA,QACvC;AAAA,MACF;AAAA,IACF;AAEA,SAAK,YAAY;AACjB,QAAI,QAAQ,IAAI,aAAa,cAAc;AACzC,WAAK,kBAAkB;AAAA,IACzB;AAAA,EACF;AAAA,EAEA,WAAW,UAA2B,OAA+B;AACnE,QAAI,QAAQ,IAAI,aAAa,cAAc;AACzC,WAAK,kBAAkB;AAAA,IACzB;AACA,WAAO,KAAK,UAAU,WAAW,UAAU,KAAK;AAAA,EAClD;AAAA,EAEA,aAAa,WAA6C;AACxD,SAAK,UAAU,aAAa,SAAS;AAAA,EACvC;AAAA,EAEA,YAAY,UAA2B,OAA+B;AACpE,QAAI,QAAQ,IAAI,aAAa,cAAc;AACzC,WAAK,kBAAkB;AAAA,IACzB;AACA,WAAO,KAAK,UAAU,YAAY,UAAU,KAAK;AAAA,EACnD;AAAA,EAEA,cAAc,YAA8C;AAC1D,SAAK,UAAU,cAAc,UAAU;AAAA,EACzC;AACF;AAEO,IAAM,iBAAiB,IAAI,eAAe;AAS1C,SAAS,qBAAqB,UAAiC;AACpE,aAAW,UAAU,CAAC;AACxB;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/timeoutManager.d.cts b/node_modules/@tanstack/query-core/build/modern/timeoutManager.d.cts deleted file mode 100644 index f85f6f9..0000000 --- a/node_modules/@tanstack/query-core/build/modern/timeoutManager.d.cts +++ /dev/null @@ -1,58 +0,0 @@ -/** - * {@link TimeoutManager} does not support passing arguments to the callback. - * - * `(_: void)` is the argument type inferred by TypeScript's default typings for - * `setTimeout(cb, number)`. - * If we don't accept a single void argument, then - * `new Promise(resolve => timeoutManager.setTimeout(resolve, N))` is a type error. - */ -type TimeoutCallback = (_: void) => void; -/** - * Wrapping `setTimeout` is awkward from a typing perspective because platform - * typings may extend the return type of `setTimeout`. For example, NodeJS - * typings add `NodeJS.Timeout`; but a non-default `timeoutManager` may not be - * able to return such a type. - */ -type ManagedTimerId = number | { - [Symbol.toPrimitive]: () => number; -}; -/** - * Backend for timer functions. - */ -type TimeoutProvider = { - readonly setTimeout: (callback: TimeoutCallback, delay: number) => TTimerId; - readonly clearTimeout: (timeoutId: TTimerId | undefined) => void; - readonly setInterval: (callback: TimeoutCallback, delay: number) => TTimerId; - readonly clearInterval: (intervalId: TTimerId | undefined) => void; -}; -declare const defaultTimeoutProvider: TimeoutProvider>; -/** - * Allows customization of how timeouts are created. - * - * @tanstack/query-core makes liberal use of timeouts to implement `staleTime` - * and `gcTime`. The default TimeoutManager provider uses the platform's global - * `setTimeout` implementation, which is known to have scalability issues with - * thousands of timeouts on the event loop. - * - * If you hit this limitation, consider providing a custom TimeoutProvider that - * coalesces timeouts. - */ -declare class TimeoutManager implements Omit { - #private; - setTimeoutProvider(provider: TimeoutProvider): void; - setTimeout(callback: TimeoutCallback, delay: number): ManagedTimerId; - clearTimeout(timeoutId: ManagedTimerId | undefined): void; - setInterval(callback: TimeoutCallback, delay: number): ManagedTimerId; - clearInterval(intervalId: ManagedTimerId | undefined): void; -} -declare const timeoutManager: TimeoutManager; -/** - * In many cases code wants to delay to the next event loop tick; this is not - * mediated by {@link timeoutManager}. - * - * This function is provided to make auditing the `tanstack/query-core` for - * incorrect use of system `setTimeout` easier. - */ -declare function systemSetTimeoutZero(callback: TimeoutCallback): void; - -export { type ManagedTimerId, type TimeoutCallback, TimeoutManager, type TimeoutProvider, defaultTimeoutProvider, systemSetTimeoutZero, timeoutManager }; diff --git a/node_modules/@tanstack/query-core/build/modern/timeoutManager.d.ts b/node_modules/@tanstack/query-core/build/modern/timeoutManager.d.ts deleted file mode 100644 index f85f6f9..0000000 --- a/node_modules/@tanstack/query-core/build/modern/timeoutManager.d.ts +++ /dev/null @@ -1,58 +0,0 @@ -/** - * {@link TimeoutManager} does not support passing arguments to the callback. - * - * `(_: void)` is the argument type inferred by TypeScript's default typings for - * `setTimeout(cb, number)`. - * If we don't accept a single void argument, then - * `new Promise(resolve => timeoutManager.setTimeout(resolve, N))` is a type error. - */ -type TimeoutCallback = (_: void) => void; -/** - * Wrapping `setTimeout` is awkward from a typing perspective because platform - * typings may extend the return type of `setTimeout`. For example, NodeJS - * typings add `NodeJS.Timeout`; but a non-default `timeoutManager` may not be - * able to return such a type. - */ -type ManagedTimerId = number | { - [Symbol.toPrimitive]: () => number; -}; -/** - * Backend for timer functions. - */ -type TimeoutProvider = { - readonly setTimeout: (callback: TimeoutCallback, delay: number) => TTimerId; - readonly clearTimeout: (timeoutId: TTimerId | undefined) => void; - readonly setInterval: (callback: TimeoutCallback, delay: number) => TTimerId; - readonly clearInterval: (intervalId: TTimerId | undefined) => void; -}; -declare const defaultTimeoutProvider: TimeoutProvider>; -/** - * Allows customization of how timeouts are created. - * - * @tanstack/query-core makes liberal use of timeouts to implement `staleTime` - * and `gcTime`. The default TimeoutManager provider uses the platform's global - * `setTimeout` implementation, which is known to have scalability issues with - * thousands of timeouts on the event loop. - * - * If you hit this limitation, consider providing a custom TimeoutProvider that - * coalesces timeouts. - */ -declare class TimeoutManager implements Omit { - #private; - setTimeoutProvider(provider: TimeoutProvider): void; - setTimeout(callback: TimeoutCallback, delay: number): ManagedTimerId; - clearTimeout(timeoutId: ManagedTimerId | undefined): void; - setInterval(callback: TimeoutCallback, delay: number): ManagedTimerId; - clearInterval(intervalId: ManagedTimerId | undefined): void; -} -declare const timeoutManager: TimeoutManager; -/** - * In many cases code wants to delay to the next event loop tick; this is not - * mediated by {@link timeoutManager}. - * - * This function is provided to make auditing the `tanstack/query-core` for - * incorrect use of system `setTimeout` easier. - */ -declare function systemSetTimeoutZero(callback: TimeoutCallback): void; - -export { type ManagedTimerId, type TimeoutCallback, TimeoutManager, type TimeoutProvider, defaultTimeoutProvider, systemSetTimeoutZero, timeoutManager }; diff --git a/node_modules/@tanstack/query-core/build/modern/timeoutManager.js b/node_modules/@tanstack/query-core/build/modern/timeoutManager.js deleted file mode 100644 index c7d9a79..0000000 --- a/node_modules/@tanstack/query-core/build/modern/timeoutManager.js +++ /dev/null @@ -1,70 +0,0 @@ -// src/timeoutManager.ts -var defaultTimeoutProvider = { - // We need the wrapper function syntax below instead of direct references to - // global setTimeout etc. - // - // BAD: `setTimeout: setTimeout` - // GOOD: `setTimeout: (cb, delay) => setTimeout(cb, delay)` - // - // If we use direct references here, then anything that wants to spy on or - // replace the global setTimeout (like tests) won't work since we'll already - // have a hard reference to the original implementation at the time when this - // file was imported. - setTimeout: (callback, delay) => setTimeout(callback, delay), - clearTimeout: (timeoutId) => clearTimeout(timeoutId), - setInterval: (callback, delay) => setInterval(callback, delay), - clearInterval: (intervalId) => clearInterval(intervalId) -}; -var TimeoutManager = class { - // We cannot have TimeoutManager as we must instantiate it with a concrete - // type at app boot; and if we leave that type, then any new timer provider - // would need to support ReturnType, which is infeasible. - // - // We settle for type safety for the TimeoutProvider type, and accept that - // this class is unsafe internally to allow for extension. - #provider = defaultTimeoutProvider; - #providerCalled = false; - setTimeoutProvider(provider) { - if (process.env.NODE_ENV !== "production") { - if (this.#providerCalled && provider !== this.#provider) { - console.error( - `[timeoutManager]: Switching provider after calls to previous provider might result in unexpected behavior.`, - { previous: this.#provider, provider } - ); - } - } - this.#provider = provider; - if (process.env.NODE_ENV !== "production") { - this.#providerCalled = false; - } - } - setTimeout(callback, delay) { - if (process.env.NODE_ENV !== "production") { - this.#providerCalled = true; - } - return this.#provider.setTimeout(callback, delay); - } - clearTimeout(timeoutId) { - this.#provider.clearTimeout(timeoutId); - } - setInterval(callback, delay) { - if (process.env.NODE_ENV !== "production") { - this.#providerCalled = true; - } - return this.#provider.setInterval(callback, delay); - } - clearInterval(intervalId) { - this.#provider.clearInterval(intervalId); - } -}; -var timeoutManager = new TimeoutManager(); -function systemSetTimeoutZero(callback) { - setTimeout(callback, 0); -} -export { - TimeoutManager, - defaultTimeoutProvider, - systemSetTimeoutZero, - timeoutManager -}; -//# sourceMappingURL=timeoutManager.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/timeoutManager.js.map b/node_modules/@tanstack/query-core/build/modern/timeoutManager.js.map deleted file mode 100644 index fbbdcbf..0000000 --- a/node_modules/@tanstack/query-core/build/modern/timeoutManager.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/timeoutManager.ts"],"sourcesContent":["/**\n * {@link TimeoutManager} does not support passing arguments to the callback.\n *\n * `(_: void)` is the argument type inferred by TypeScript's default typings for\n * `setTimeout(cb, number)`.\n * If we don't accept a single void argument, then\n * `new Promise(resolve => timeoutManager.setTimeout(resolve, N))` is a type error.\n */\nexport type TimeoutCallback = (_: void) => void\n\n/**\n * Wrapping `setTimeout` is awkward from a typing perspective because platform\n * typings may extend the return type of `setTimeout`. For example, NodeJS\n * typings add `NodeJS.Timeout`; but a non-default `timeoutManager` may not be\n * able to return such a type.\n */\nexport type ManagedTimerId = number | { [Symbol.toPrimitive]: () => number }\n\n/**\n * Backend for timer functions.\n */\nexport type TimeoutProvider =\n {\n readonly setTimeout: (callback: TimeoutCallback, delay: number) => TTimerId\n readonly clearTimeout: (timeoutId: TTimerId | undefined) => void\n\n readonly setInterval: (callback: TimeoutCallback, delay: number) => TTimerId\n readonly clearInterval: (intervalId: TTimerId | undefined) => void\n }\n\nexport const defaultTimeoutProvider: TimeoutProvider<\n ReturnType\n> = {\n // We need the wrapper function syntax below instead of direct references to\n // global setTimeout etc.\n //\n // BAD: `setTimeout: setTimeout`\n // GOOD: `setTimeout: (cb, delay) => setTimeout(cb, delay)`\n //\n // If we use direct references here, then anything that wants to spy on or\n // replace the global setTimeout (like tests) won't work since we'll already\n // have a hard reference to the original implementation at the time when this\n // file was imported.\n setTimeout: (callback, delay) => setTimeout(callback, delay),\n clearTimeout: (timeoutId) => clearTimeout(timeoutId),\n\n setInterval: (callback, delay) => setInterval(callback, delay),\n clearInterval: (intervalId) => clearInterval(intervalId),\n}\n\n/**\n * Allows customization of how timeouts are created.\n *\n * @tanstack/query-core makes liberal use of timeouts to implement `staleTime`\n * and `gcTime`. The default TimeoutManager provider uses the platform's global\n * `setTimeout` implementation, which is known to have scalability issues with\n * thousands of timeouts on the event loop.\n *\n * If you hit this limitation, consider providing a custom TimeoutProvider that\n * coalesces timeouts.\n */\nexport class TimeoutManager implements Omit {\n // We cannot have TimeoutManager as we must instantiate it with a concrete\n // type at app boot; and if we leave that type, then any new timer provider\n // would need to support ReturnType, which is infeasible.\n //\n // We settle for type safety for the TimeoutProvider type, and accept that\n // this class is unsafe internally to allow for extension.\n #provider: TimeoutProvider = defaultTimeoutProvider\n #providerCalled = false\n\n setTimeoutProvider(\n provider: TimeoutProvider,\n ): void {\n if (process.env.NODE_ENV !== 'production') {\n if (this.#providerCalled && provider !== this.#provider) {\n // After changing providers, `clearTimeout` will not work as expected for\n // timeouts from the previous provider.\n //\n // Since they may allocate the same timeout ID, clearTimeout may cancel an\n // arbitrary different timeout, or unexpected no-op.\n //\n // We could protect against this by mixing the timeout ID bits\n // deterministically with some per-provider bits.\n //\n // We could internally queue `setTimeout` calls to `TimeoutManager` until\n // some API call to set the initial provider.\n console.error(\n `[timeoutManager]: Switching provider after calls to previous provider might result in unexpected behavior.`,\n { previous: this.#provider, provider },\n )\n }\n }\n\n this.#provider = provider\n if (process.env.NODE_ENV !== 'production') {\n this.#providerCalled = false\n }\n }\n\n setTimeout(callback: TimeoutCallback, delay: number): ManagedTimerId {\n if (process.env.NODE_ENV !== 'production') {\n this.#providerCalled = true\n }\n return this.#provider.setTimeout(callback, delay)\n }\n\n clearTimeout(timeoutId: ManagedTimerId | undefined): void {\n this.#provider.clearTimeout(timeoutId)\n }\n\n setInterval(callback: TimeoutCallback, delay: number): ManagedTimerId {\n if (process.env.NODE_ENV !== 'production') {\n this.#providerCalled = true\n }\n return this.#provider.setInterval(callback, delay)\n }\n\n clearInterval(intervalId: ManagedTimerId | undefined): void {\n this.#provider.clearInterval(intervalId)\n }\n}\n\nexport const timeoutManager = new TimeoutManager()\n\n/**\n * In many cases code wants to delay to the next event loop tick; this is not\n * mediated by {@link timeoutManager}.\n *\n * This function is provided to make auditing the `tanstack/query-core` for\n * incorrect use of system `setTimeout` easier.\n */\nexport function systemSetTimeoutZero(callback: TimeoutCallback): void {\n setTimeout(callback, 0)\n}\n"],"mappings":";AA8BO,IAAM,yBAET;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAWF,YAAY,CAAC,UAAU,UAAU,WAAW,UAAU,KAAK;AAAA,EAC3D,cAAc,CAAC,cAAc,aAAa,SAAS;AAAA,EAEnD,aAAa,CAAC,UAAU,UAAU,YAAY,UAAU,KAAK;AAAA,EAC7D,eAAe,CAAC,eAAe,cAAc,UAAU;AACzD;AAaO,IAAM,iBAAN,MAA8D;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOnE,YAAkC;AAAA,EAClC,kBAAkB;AAAA,EAElB,mBACE,UACM;AACN,QAAI,QAAQ,IAAI,aAAa,cAAc;AACzC,UAAI,KAAK,mBAAmB,aAAa,KAAK,WAAW;AAYvD,gBAAQ;AAAA,UACN;AAAA,UACA,EAAE,UAAU,KAAK,WAAW,SAAS;AAAA,QACvC;AAAA,MACF;AAAA,IACF;AAEA,SAAK,YAAY;AACjB,QAAI,QAAQ,IAAI,aAAa,cAAc;AACzC,WAAK,kBAAkB;AAAA,IACzB;AAAA,EACF;AAAA,EAEA,WAAW,UAA2B,OAA+B;AACnE,QAAI,QAAQ,IAAI,aAAa,cAAc;AACzC,WAAK,kBAAkB;AAAA,IACzB;AACA,WAAO,KAAK,UAAU,WAAW,UAAU,KAAK;AAAA,EAClD;AAAA,EAEA,aAAa,WAA6C;AACxD,SAAK,UAAU,aAAa,SAAS;AAAA,EACvC;AAAA,EAEA,YAAY,UAA2B,OAA+B;AACpE,QAAI,QAAQ,IAAI,aAAa,cAAc;AACzC,WAAK,kBAAkB;AAAA,IACzB;AACA,WAAO,KAAK,UAAU,YAAY,UAAU,KAAK;AAAA,EACnD;AAAA,EAEA,cAAc,YAA8C;AAC1D,SAAK,UAAU,cAAc,UAAU;AAAA,EACzC;AACF;AAEO,IAAM,iBAAiB,IAAI,eAAe;AAS1C,SAAS,qBAAqB,UAAiC;AACpE,aAAW,UAAU,CAAC;AACxB;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/types.cjs b/node_modules/@tanstack/query-core/build/modern/types.cjs deleted file mode 100644 index b948e7c..0000000 --- a/node_modules/@tanstack/query-core/build/modern/types.cjs +++ /dev/null @@ -1,37 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// src/types.ts -var types_exports = {}; -__export(types_exports, { - dataTagErrorSymbol: () => dataTagErrorSymbol, - dataTagSymbol: () => dataTagSymbol, - unsetMarker: () => unsetMarker -}); -module.exports = __toCommonJS(types_exports); -var dataTagSymbol = /* @__PURE__ */ Symbol("dataTagSymbol"); -var dataTagErrorSymbol = /* @__PURE__ */ Symbol("dataTagErrorSymbol"); -var unsetMarker = /* @__PURE__ */ Symbol("unsetMarker"); -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - dataTagErrorSymbol, - dataTagSymbol, - unsetMarker -}); -//# sourceMappingURL=types.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/types.cjs.map b/node_modules/@tanstack/query-core/build/modern/types.cjs.map deleted file mode 100644 index 21fe50b..0000000 --- a/node_modules/@tanstack/query-core/build/modern/types.cjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/types.ts"],"sourcesContent":["/* istanbul ignore file */\n\nimport type { QueryClient } from './queryClient'\nimport type { DehydrateOptions, HydrateOptions } from './hydration'\nimport type { MutationState } from './mutation'\nimport type { FetchDirection, Query, QueryBehavior } from './query'\nimport type { RetryDelayValue, RetryValue } from './retryer'\nimport type { QueryFilters, QueryTypeFilter, SkipToken } from './utils'\nimport type { QueryCache } from './queryCache'\nimport type { MutationCache } from './mutationCache'\n\nexport type NonUndefinedGuard = T extends undefined ? never : T\n\nexport type DistributiveOmit<\n TObject,\n TKey extends keyof TObject,\n> = TObject extends any ? Omit : never\n\nexport type OmitKeyof<\n TObject,\n TKey extends TStrictly extends 'safely'\n ?\n | keyof TObject\n | (string & Record)\n | (number & Record)\n | (symbol & Record)\n : keyof TObject,\n TStrictly extends 'strictly' | 'safely' = 'strictly',\n> = Omit\n\nexport type Override = {\n [AKey in keyof TTargetA]: AKey extends keyof TTargetB\n ? TTargetB[AKey]\n : TTargetA[AKey]\n}\n\nexport type NoInfer = [T][T extends any ? 0 : never]\n\nexport interface Register {\n // defaultError: Error\n // queryMeta: Record\n // mutationMeta: Record\n // queryKey: ReadonlyArray\n // mutationKey: ReadonlyArray\n}\n\nexport type DefaultError = Register extends {\n defaultError: infer TError\n}\n ? TError\n : Error\n\nexport type QueryKey = Register extends {\n queryKey: infer TQueryKey\n}\n ? TQueryKey extends ReadonlyArray\n ? TQueryKey\n : TQueryKey extends Array\n ? TQueryKey\n : ReadonlyArray\n : ReadonlyArray\n\nexport const dataTagSymbol = Symbol('dataTagSymbol')\nexport type dataTagSymbol = typeof dataTagSymbol\nexport const dataTagErrorSymbol = Symbol('dataTagErrorSymbol')\nexport type dataTagErrorSymbol = typeof dataTagErrorSymbol\nexport const unsetMarker = Symbol('unsetMarker')\nexport type UnsetMarker = typeof unsetMarker\nexport type AnyDataTag = {\n [dataTagSymbol]: any\n [dataTagErrorSymbol]: any\n}\nexport type DataTag<\n TType,\n TValue,\n TError = UnsetMarker,\n> = TType extends AnyDataTag\n ? TType\n : TType & {\n [dataTagSymbol]: TValue\n [dataTagErrorSymbol]: TError\n }\n\nexport type InferDataFromTag =\n TTaggedQueryKey extends DataTag\n ? TaggedValue\n : TQueryFnData\n\nexport type InferErrorFromTag =\n TTaggedQueryKey extends DataTag\n ? TaggedError extends UnsetMarker\n ? TError\n : TaggedError\n : TError\n\nexport type QueryFunction<\n T = unknown,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = never,\n> = (context: QueryFunctionContext) => T | Promise\n\nexport type StaleTime = number | 'static'\n\nexport type StaleTimeFunction<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> =\n | StaleTime\n | ((query: Query) => StaleTime)\n\nexport type Enabled<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> =\n | boolean\n | ((query: Query) => boolean)\n\nexport type QueryPersister<\n T = unknown,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = never,\n> = [TPageParam] extends [never]\n ? (\n queryFn: QueryFunction,\n context: QueryFunctionContext,\n query: Query,\n ) => T | Promise\n : (\n queryFn: QueryFunction,\n context: QueryFunctionContext,\n query: Query,\n ) => T | Promise\n\nexport type QueryFunctionContext<\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = never,\n> = [TPageParam] extends [never]\n ? {\n client: QueryClient\n queryKey: TQueryKey\n signal: AbortSignal\n meta: QueryMeta | undefined\n pageParam?: unknown\n /**\n * @deprecated\n * if you want access to the direction, you can add it to the pageParam\n */\n direction?: unknown\n }\n : {\n client: QueryClient\n queryKey: TQueryKey\n signal: AbortSignal\n pageParam: TPageParam\n /**\n * @deprecated\n * if you want access to the direction, you can add it to the pageParam\n */\n direction: FetchDirection\n meta: QueryMeta | undefined\n }\n\nexport type InitialDataFunction = () => T | undefined\n\ntype NonFunctionGuard = T extends Function ? never : T\n\nexport type PlaceholderDataFunction<\n TQueryFnData = unknown,\n TError = DefaultError,\n TQueryData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> = (\n previousData: TQueryData | undefined,\n previousQuery: Query | undefined,\n) => TQueryData | undefined\n\nexport type QueriesPlaceholderDataFunction = (\n previousData: undefined,\n previousQuery: undefined,\n) => TQueryData | undefined\n\nexport type QueryKeyHashFunction = (\n queryKey: TQueryKey,\n) => string\n\nexport type GetPreviousPageParamFunction = (\n firstPage: TQueryFnData,\n allPages: Array,\n firstPageParam: TPageParam,\n allPageParams: Array,\n) => TPageParam | undefined | null\n\nexport type GetNextPageParamFunction = (\n lastPage: TQueryFnData,\n allPages: Array,\n lastPageParam: TPageParam,\n allPageParams: Array,\n) => TPageParam | undefined | null\n\nexport interface InfiniteData {\n pages: Array\n pageParams: Array\n}\n\nexport type QueryMeta = Register extends {\n queryMeta: infer TQueryMeta\n}\n ? TQueryMeta extends Record\n ? TQueryMeta\n : Record\n : Record\n\nexport type NetworkMode = 'online' | 'always' | 'offlineFirst'\n\nexport type NotifyOnChangeProps =\n | Array\n | 'all'\n | undefined\n | (() => Array | 'all' | undefined)\n\nexport interface QueryOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = never,\n> {\n /**\n * If `false`, failed queries will not retry by default.\n * If `true`, failed queries will retry infinitely., failureCount: num\n * If set to an integer number, e.g. 3, failed queries will retry until the failed query count meets that number.\n * If set to a function `(failureCount, error) => boolean` failed queries will retry until the function returns false.\n */\n retry?: RetryValue\n retryDelay?: RetryDelayValue\n networkMode?: NetworkMode\n /**\n * The time in milliseconds that unused/inactive cache data remains in memory.\n * When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration.\n * When different garbage collection times are specified, the longest one will be used.\n * Setting it to `Infinity` will disable garbage collection.\n */\n gcTime?: number\n queryFn?: QueryFunction | SkipToken\n persister?: QueryPersister<\n NoInfer,\n NoInfer,\n NoInfer\n >\n queryHash?: string\n queryKey?: TQueryKey\n queryKeyHashFn?: QueryKeyHashFunction\n initialData?: TData | InitialDataFunction\n initialDataUpdatedAt?: number | (() => number | undefined)\n behavior?: QueryBehavior\n /**\n * Set this to `false` to disable structural sharing between query results.\n * Set this to a function which accepts the old and new data and returns resolved data of the same type to implement custom structural sharing logic.\n * Defaults to `true`.\n */\n structuralSharing?:\n | boolean\n | ((oldData: unknown | undefined, newData: unknown) => unknown)\n _defaulted?: boolean\n /**\n * Additional payload to be stored on each query.\n * Use this property to pass information that can be used in other places.\n */\n meta?: QueryMeta\n /**\n * Maximum number of pages to store in the data of an infinite query.\n */\n maxPages?: number\n}\n\nexport interface InitialPageParam {\n initialPageParam: TPageParam\n}\n\nexport interface InfiniteQueryPageParamsOptions<\n TQueryFnData = unknown,\n TPageParam = unknown,\n> extends InitialPageParam {\n /**\n * This function can be set to automatically get the previous cursor for infinite queries.\n * The result will also be used to determine the value of `hasPreviousPage`.\n */\n getPreviousPageParam?: GetPreviousPageParamFunction\n /**\n * This function can be set to automatically get the next cursor for infinite queries.\n * The result will also be used to determine the value of `hasNextPage`.\n */\n getNextPageParam: GetNextPageParamFunction\n}\n\nexport type ThrowOnError<\n TQueryFnData,\n TError,\n TQueryData,\n TQueryKey extends QueryKey,\n> =\n | boolean\n | ((\n error: TError,\n query: Query,\n ) => boolean)\n\nexport interface QueryObserverOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = never,\n> extends WithRequired<\n QueryOptions,\n 'queryKey'\n> {\n /**\n * Set this to `false` or a function that returns `false` to disable automatic refetching when the query mounts or changes query keys.\n * To refetch the query, use the `refetch` method returned from the `useQuery` instance.\n * Accepts a boolean or function that returns a boolean.\n * Defaults to `true`.\n */\n enabled?: Enabled\n /**\n * The time in milliseconds after data is considered stale.\n * If set to `Infinity`, the data will never be considered stale.\n * If set to a function, the function will be executed with the query to compute a `staleTime`.\n * Defaults to `0`.\n */\n staleTime?: StaleTimeFunction\n /**\n * If set to a number, the query will continuously refetch at this frequency in milliseconds.\n * If set to a function, the function will be executed with the latest data and query to compute a frequency\n * Defaults to `false`.\n */\n refetchInterval?:\n | number\n | false\n | ((\n query: Query,\n ) => number | false | undefined)\n /**\n * If set to `true`, the query will continue to refetch while their tab/window is in the background.\n * Defaults to `false`.\n */\n refetchIntervalInBackground?: boolean\n /**\n * If set to `true`, the query will refetch on window focus if the data is stale.\n * If set to `false`, the query will not refetch on window focus.\n * If set to `'always'`, the query will always refetch on window focus.\n * If set to a function, the function will be executed with the latest data and query to compute the value.\n * Defaults to `true`.\n */\n refetchOnWindowFocus?:\n | boolean\n | 'always'\n | ((\n query: Query,\n ) => boolean | 'always')\n /**\n * If set to `true`, the query will refetch on reconnect if the data is stale.\n * If set to `false`, the query will not refetch on reconnect.\n * If set to `'always'`, the query will always refetch on reconnect.\n * If set to a function, the function will be executed with the latest data and query to compute the value.\n * Defaults to the value of `networkOnline` (`true`)\n */\n refetchOnReconnect?:\n | boolean\n | 'always'\n | ((\n query: Query,\n ) => boolean | 'always')\n /**\n * If set to `true`, the query will refetch on mount if the data is stale.\n * If set to `false`, will disable additional instances of a query to trigger background refetch.\n * If set to `'always'`, the query will always refetch on mount.\n * If set to a function, the function will be executed with the latest data and query to compute the value\n * Defaults to `true`.\n */\n refetchOnMount?:\n | boolean\n | 'always'\n | ((\n query: Query,\n ) => boolean | 'always')\n /**\n * If set to `false`, the query will not be retried on mount if it contains an error.\n * Defaults to `true`.\n */\n retryOnMount?: boolean\n /**\n * If set, the component will only re-render if any of the listed properties change.\n * When set to `['data', 'error']`, the component will only re-render when the `data` or `error` properties change.\n * When set to `'all'`, the component will re-render whenever a query is updated.\n * When set to a function, the function will be executed to compute the list of properties.\n * By default, access to properties will be tracked, and the component will only re-render when one of the tracked properties change.\n */\n notifyOnChangeProps?: NotifyOnChangeProps\n /**\n * Whether errors should be thrown instead of setting the `error` property.\n * If set to `true` or `suspense` is `true`, all errors will be thrown to the error boundary.\n * If set to `false` and `suspense` is `false`, errors are returned as state.\n * If set to a function, it will be passed the error and the query, and it should return a boolean indicating whether to show the error in an error boundary (`true`) or return the error as state (`false`).\n * Defaults to `false`.\n */\n throwOnError?: ThrowOnError\n /**\n * This option can be used to transform or select a part of the data returned by the query function.\n */\n select?: (data: TQueryData) => TData\n /**\n * If set to `true`, the query will suspend when `status === 'pending'`\n * and throw errors when `status === 'error'`.\n * Defaults to `false`.\n */\n suspense?: boolean\n /**\n * If set, this value will be used as the placeholder data for this particular query observer while the query is still in the `loading` data and no initialData has been provided.\n */\n placeholderData?:\n | NonFunctionGuard\n | PlaceholderDataFunction<\n NonFunctionGuard,\n TError,\n NonFunctionGuard,\n TQueryKey\n >\n\n _optimisticResults?: 'optimistic' | 'isRestoring'\n\n /**\n * Enable prefetching during rendering\n */\n experimental_prefetchInRender?: boolean\n}\n\nexport type WithRequired = TTarget & {\n [_ in TKey]: {}\n}\n\nexport type DefaultedQueryObserverOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> = WithRequired<\n QueryObserverOptions,\n 'throwOnError' | 'refetchOnReconnect' | 'queryHash'\n>\n\nexport interface InfiniteQueryObserverOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n>\n extends\n QueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n InfiniteData,\n TQueryKey,\n TPageParam\n >,\n InfiniteQueryPageParamsOptions {}\n\nexport type DefaultedInfiniteQueryObserverOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n> = WithRequired<\n InfiniteQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n 'throwOnError' | 'refetchOnReconnect' | 'queryHash'\n>\n\nexport interface FetchQueryOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = never,\n> extends WithRequired<\n QueryOptions,\n 'queryKey'\n> {\n initialPageParam?: never\n /**\n * The time in milliseconds after data is considered stale.\n * If the data is fresh it will be returned from the cache.\n */\n staleTime?: StaleTimeFunction\n}\n\nexport interface EnsureQueryDataOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = never,\n> extends FetchQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n> {\n revalidateIfStale?: boolean\n}\n\nexport type EnsureInfiniteQueryDataOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n> = FetchInfiniteQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n> & {\n revalidateIfStale?: boolean\n}\n\ntype FetchInfiniteQueryPages =\n | { pages?: never }\n | {\n pages: number\n getNextPageParam: GetNextPageParamFunction\n }\n\nexport type FetchInfiniteQueryOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n> = Omit<\n FetchQueryOptions<\n TQueryFnData,\n TError,\n InfiniteData,\n TQueryKey,\n TPageParam\n >,\n 'initialPageParam'\n> &\n InitialPageParam &\n FetchInfiniteQueryPages\n\nexport interface ResultOptions {\n throwOnError?: boolean\n}\n\nexport interface RefetchOptions extends ResultOptions {\n /**\n * If set to `true`, a currently running request will be cancelled before a new request is made\n *\n * If set to `false`, no refetch will be made if there is already a request running.\n *\n * Defaults to `true`.\n */\n cancelRefetch?: boolean\n}\n\nexport interface InvalidateQueryFilters<\n TQueryKey extends QueryKey = QueryKey,\n> extends QueryFilters {\n refetchType?: QueryTypeFilter | 'none'\n}\n\nexport interface RefetchQueryFilters<\n TQueryKey extends QueryKey = QueryKey,\n> extends QueryFilters {}\n\nexport interface InvalidateOptions extends RefetchOptions {}\nexport interface ResetOptions extends RefetchOptions {}\n\nexport interface FetchNextPageOptions extends ResultOptions {\n /**\n * If set to `true`, calling `fetchNextPage` repeatedly will invoke `queryFn` every time,\n * whether the previous invocation has resolved or not. Also, the result from previous invocations will be ignored.\n *\n * If set to `false`, calling `fetchNextPage` repeatedly won't have any effect until the first invocation has resolved.\n *\n * Defaults to `true`.\n */\n cancelRefetch?: boolean\n}\n\nexport interface FetchPreviousPageOptions extends ResultOptions {\n /**\n * If set to `true`, calling `fetchPreviousPage` repeatedly will invoke `queryFn` every time,\n * whether the previous invocation has resolved or not. Also, the result from previous invocations will be ignored.\n *\n * If set to `false`, calling `fetchPreviousPage` repeatedly won't have any effect until the first invocation has resolved.\n *\n * Defaults to `true`.\n */\n cancelRefetch?: boolean\n}\n\nexport type QueryStatus = 'pending' | 'error' | 'success'\nexport type FetchStatus = 'fetching' | 'paused' | 'idle'\n\nexport interface QueryObserverBaseResult<\n TData = unknown,\n TError = DefaultError,\n> {\n /**\n * The last successfully resolved data for the query.\n */\n data: TData | undefined\n /**\n * The timestamp for when the query most recently returned the `status` as `\"success\"`.\n */\n dataUpdatedAt: number\n /**\n * The error object for the query, if an error was thrown.\n * - Defaults to `null`.\n */\n error: TError | null\n /**\n * The timestamp for when the query most recently returned the `status` as `\"error\"`.\n */\n errorUpdatedAt: number\n /**\n * The failure count for the query.\n * - Incremented every time the query fails.\n * - Reset to `0` when the query succeeds.\n */\n failureCount: number\n /**\n * The failure reason for the query retry.\n * - Reset to `null` when the query succeeds.\n */\n failureReason: TError | null\n /**\n * The sum of all errors.\n */\n errorUpdateCount: number\n /**\n * A derived boolean from the `status` variable, provided for convenience.\n * - `true` if the query attempt resulted in an error.\n */\n isError: boolean\n /**\n * Will be `true` if the query has been fetched.\n */\n isFetched: boolean\n /**\n * Will be `true` if the query has been fetched after the component mounted.\n * - This property can be used to not show any previously cached data.\n */\n isFetchedAfterMount: boolean\n /**\n * A derived boolean from the `fetchStatus` variable, provided for convenience.\n * - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch.\n */\n isFetching: boolean\n /**\n * Is `true` whenever the first fetch for a query is in-flight.\n * - Is the same as `isFetching && isPending`.\n */\n isLoading: boolean\n /**\n * Will be `pending` if there's no cached data and no query attempt was finished yet.\n */\n isPending: boolean\n /**\n * Will be `true` if the query failed while fetching for the first time.\n */\n isLoadingError: boolean\n /**\n * @deprecated `isInitialLoading` is being deprecated in favor of `isLoading`\n * and will be removed in the next major version.\n */\n isInitialLoading: boolean\n /**\n * A derived boolean from the `fetchStatus` variable, provided for convenience.\n * - The query wanted to fetch, but has been `paused`.\n */\n isPaused: boolean\n /**\n * Will be `true` if the data shown is the placeholder data.\n */\n isPlaceholderData: boolean\n /**\n * Will be `true` if the query failed while refetching.\n */\n isRefetchError: boolean\n /**\n * Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`.\n * - Is the same as `isFetching && !isPending`.\n */\n isRefetching: boolean\n /**\n * Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`.\n */\n isStale: boolean\n /**\n * A derived boolean from the `status` variable, provided for convenience.\n * - `true` if the query has received a response with no errors and is ready to display its data.\n */\n isSuccess: boolean\n /**\n * `true` if this observer is enabled, `false` otherwise.\n */\n isEnabled: boolean\n /**\n * A function to manually refetch the query.\n */\n refetch: (\n options?: RefetchOptions,\n ) => Promise>\n /**\n * The status of the query.\n * - Will be:\n * - `pending` if there's no cached data and no query attempt was finished yet.\n * - `error` if the query attempt resulted in an error.\n * - `success` if the query has received a response with no errors and is ready to display its data.\n */\n status: QueryStatus\n /**\n * The fetch status of the query.\n * - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch.\n * - `paused`: The query wanted to fetch, but has been `paused`.\n * - `idle`: The query is not fetching.\n * - See [Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information.\n */\n fetchStatus: FetchStatus\n /**\n * A stable promise that will be resolved with the data of the query.\n * Requires the `experimental_prefetchInRender` feature flag to be enabled.\n * @example\n *\n * ### Enabling the feature flag\n * ```ts\n * const client = new QueryClient({\n * defaultOptions: {\n * queries: {\n * experimental_prefetchInRender: true,\n * },\n * },\n * })\n * ```\n *\n * ### Usage\n * ```tsx\n * import { useQuery } from '@tanstack/react-query'\n * import React from 'react'\n * import { fetchTodos, type Todo } from './api'\n *\n * function TodoList({ query }: { query: UseQueryResult }) {\n * const data = React.use(query.promise)\n *\n * return (\n *
    \n * {data.map(todo => (\n *
  • {todo.title}
  • \n * ))}\n *
\n * )\n * }\n *\n * export function App() {\n * const query = useQuery({ queryKey: ['todos'], queryFn: fetchTodos })\n *\n * return (\n * <>\n *

Todos

\n * Loading...}>\n * \n * \n * \n * )\n * }\n * ```\n */\n promise: Promise\n}\n\nexport interface QueryObserverPendingResult<\n TData = unknown,\n TError = DefaultError,\n> extends QueryObserverBaseResult {\n data: undefined\n error: null\n isError: false\n isPending: true\n isLoadingError: false\n isRefetchError: false\n isSuccess: false\n isPlaceholderData: false\n status: 'pending'\n}\n\nexport interface QueryObserverLoadingResult<\n TData = unknown,\n TError = DefaultError,\n> extends QueryObserverBaseResult {\n data: undefined\n error: null\n isError: false\n isPending: true\n isLoading: true\n isLoadingError: false\n isRefetchError: false\n isSuccess: false\n isPlaceholderData: false\n status: 'pending'\n}\n\nexport interface QueryObserverLoadingErrorResult<\n TData = unknown,\n TError = DefaultError,\n> extends QueryObserverBaseResult {\n data: undefined\n error: TError\n isError: true\n isPending: false\n isLoading: false\n isLoadingError: true\n isRefetchError: false\n isSuccess: false\n isPlaceholderData: false\n status: 'error'\n}\n\nexport interface QueryObserverRefetchErrorResult<\n TData = unknown,\n TError = DefaultError,\n> extends QueryObserverBaseResult {\n data: TData\n error: TError\n isError: true\n isPending: false\n isLoading: false\n isLoadingError: false\n isRefetchError: true\n isSuccess: false\n isPlaceholderData: false\n status: 'error'\n}\n\nexport interface QueryObserverSuccessResult<\n TData = unknown,\n TError = DefaultError,\n> extends QueryObserverBaseResult {\n data: TData\n error: null\n isError: false\n isPending: false\n isLoading: false\n isLoadingError: false\n isRefetchError: false\n isSuccess: true\n isPlaceholderData: false\n status: 'success'\n}\n\nexport interface QueryObserverPlaceholderResult<\n TData = unknown,\n TError = DefaultError,\n> extends QueryObserverBaseResult {\n data: TData\n isError: false\n error: null\n isPending: false\n isLoading: false\n isLoadingError: false\n isRefetchError: false\n isSuccess: true\n isPlaceholderData: true\n status: 'success'\n}\n\nexport type DefinedQueryObserverResult<\n TData = unknown,\n TError = DefaultError,\n> =\n | QueryObserverRefetchErrorResult\n | QueryObserverSuccessResult\n\nexport type QueryObserverResult =\n | DefinedQueryObserverResult\n | QueryObserverLoadingErrorResult\n | QueryObserverLoadingResult\n | QueryObserverPendingResult\n | QueryObserverPlaceholderResult\n\nexport interface InfiniteQueryObserverBaseResult<\n TData = unknown,\n TError = DefaultError,\n> extends QueryObserverBaseResult {\n /**\n * This function allows you to fetch the next \"page\" of results.\n */\n fetchNextPage: (\n options?: FetchNextPageOptions,\n ) => Promise>\n /**\n * This function allows you to fetch the previous \"page\" of results.\n */\n fetchPreviousPage: (\n options?: FetchPreviousPageOptions,\n ) => Promise>\n /**\n * Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option).\n */\n hasNextPage: boolean\n /**\n * Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option).\n */\n hasPreviousPage: boolean\n /**\n * Will be `true` if the query failed while fetching the next page.\n */\n isFetchNextPageError: boolean\n /**\n * Will be `true` while fetching the next page with `fetchNextPage`.\n */\n isFetchingNextPage: boolean\n /**\n * Will be `true` if the query failed while fetching the previous page.\n */\n isFetchPreviousPageError: boolean\n /**\n * Will be `true` while fetching the previous page with `fetchPreviousPage`.\n */\n isFetchingPreviousPage: boolean\n}\n\nexport interface InfiniteQueryObserverPendingResult<\n TData = unknown,\n TError = DefaultError,\n> extends InfiniteQueryObserverBaseResult {\n data: undefined\n error: null\n isError: false\n isPending: true\n isLoadingError: false\n isRefetchError: false\n isFetchNextPageError: false\n isFetchPreviousPageError: false\n isSuccess: false\n isPlaceholderData: false\n status: 'pending'\n}\n\nexport interface InfiniteQueryObserverLoadingResult<\n TData = unknown,\n TError = DefaultError,\n> extends InfiniteQueryObserverBaseResult {\n data: undefined\n error: null\n isError: false\n isPending: true\n isLoading: true\n isLoadingError: false\n isRefetchError: false\n isFetchNextPageError: false\n isFetchPreviousPageError: false\n isSuccess: false\n isPlaceholderData: false\n status: 'pending'\n}\n\nexport interface InfiniteQueryObserverLoadingErrorResult<\n TData = unknown,\n TError = DefaultError,\n> extends InfiniteQueryObserverBaseResult {\n data: undefined\n error: TError\n isError: true\n isPending: false\n isLoading: false\n isLoadingError: true\n isRefetchError: false\n isFetchNextPageError: false\n isFetchPreviousPageError: false\n isSuccess: false\n isPlaceholderData: false\n status: 'error'\n}\n\nexport interface InfiniteQueryObserverRefetchErrorResult<\n TData = unknown,\n TError = DefaultError,\n> extends InfiniteQueryObserverBaseResult {\n data: TData\n error: TError\n isError: true\n isPending: false\n isLoading: false\n isLoadingError: false\n isRefetchError: true\n isSuccess: false\n isPlaceholderData: false\n status: 'error'\n}\n\nexport interface InfiniteQueryObserverSuccessResult<\n TData = unknown,\n TError = DefaultError,\n> extends InfiniteQueryObserverBaseResult {\n data: TData\n error: null\n isError: false\n isPending: false\n isLoading: false\n isLoadingError: false\n isRefetchError: false\n isFetchNextPageError: false\n isFetchPreviousPageError: false\n isSuccess: true\n isPlaceholderData: false\n status: 'success'\n}\n\nexport interface InfiniteQueryObserverPlaceholderResult<\n TData = unknown,\n TError = DefaultError,\n> extends InfiniteQueryObserverBaseResult {\n data: TData\n isError: false\n error: null\n isPending: false\n isLoading: false\n isLoadingError: false\n isRefetchError: false\n isSuccess: true\n isPlaceholderData: true\n isFetchNextPageError: false\n isFetchPreviousPageError: false\n status: 'success'\n}\n\nexport type DefinedInfiniteQueryObserverResult<\n TData = unknown,\n TError = DefaultError,\n> =\n | InfiniteQueryObserverRefetchErrorResult\n | InfiniteQueryObserverSuccessResult\n\nexport type InfiniteQueryObserverResult<\n TData = unknown,\n TError = DefaultError,\n> =\n | DefinedInfiniteQueryObserverResult\n | InfiniteQueryObserverLoadingErrorResult\n | InfiniteQueryObserverLoadingResult\n | InfiniteQueryObserverPendingResult\n | InfiniteQueryObserverPlaceholderResult\n\nexport type MutationKey = Register extends {\n mutationKey: infer TMutationKey\n}\n ? TMutationKey extends ReadonlyArray\n ? TMutationKey\n : TMutationKey extends Array\n ? TMutationKey\n : ReadonlyArray\n : ReadonlyArray\n\nexport type MutationStatus = 'idle' | 'pending' | 'success' | 'error'\n\nexport type MutationScope = {\n id: string\n}\n\nexport type MutationMeta = Register extends {\n mutationMeta: infer TMutationMeta\n}\n ? TMutationMeta extends Record\n ? TMutationMeta\n : Record\n : Record\n\nexport type MutationFunctionContext = {\n client: QueryClient\n meta: MutationMeta | undefined\n mutationKey?: MutationKey\n}\n\nexport type MutationFunction = (\n variables: TVariables,\n context: MutationFunctionContext,\n) => Promise\n\nexport interface MutationOptions<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n> {\n mutationFn?: MutationFunction\n mutationKey?: MutationKey\n onMutate?: (\n variables: TVariables,\n context: MutationFunctionContext,\n ) => Promise | TOnMutateResult\n onSuccess?: (\n data: TData,\n variables: TVariables,\n onMutateResult: TOnMutateResult,\n context: MutationFunctionContext,\n ) => Promise | unknown\n onError?: (\n error: TError,\n variables: TVariables,\n onMutateResult: TOnMutateResult | undefined,\n context: MutationFunctionContext,\n ) => Promise | unknown\n onSettled?: (\n data: TData | undefined,\n error: TError | null,\n variables: TVariables,\n onMutateResult: TOnMutateResult | undefined,\n context: MutationFunctionContext,\n ) => Promise | unknown\n retry?: RetryValue\n retryDelay?: RetryDelayValue\n networkMode?: NetworkMode\n gcTime?: number\n _defaulted?: boolean\n meta?: MutationMeta\n scope?: MutationScope\n}\n\nexport interface MutationObserverOptions<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n> extends MutationOptions {\n throwOnError?: boolean | ((error: TError) => boolean)\n}\n\nexport interface MutateOptions<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n> {\n onSuccess?: (\n data: TData,\n variables: TVariables,\n onMutateResult: TOnMutateResult | undefined,\n context: MutationFunctionContext,\n ) => void\n onError?: (\n error: TError,\n variables: TVariables,\n onMutateResult: TOnMutateResult | undefined,\n context: MutationFunctionContext,\n ) => void\n onSettled?: (\n data: TData | undefined,\n error: TError | null,\n variables: TVariables,\n onMutateResult: TOnMutateResult | undefined,\n context: MutationFunctionContext,\n ) => void\n}\n\nexport type MutateFunction<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n> = (\n variables: TVariables,\n options?: MutateOptions,\n) => Promise\n\nexport interface MutationObserverBaseResult<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n> extends MutationState {\n /**\n * The last successfully resolved data for the mutation.\n */\n data: TData | undefined\n /**\n * The variables object passed to the `mutationFn`.\n */\n variables: TVariables | undefined\n /**\n * The error object for the mutation, if an error was encountered.\n * - Defaults to `null`.\n */\n error: TError | null\n /**\n * A boolean variable derived from `status`.\n * - `true` if the last mutation attempt resulted in an error.\n */\n isError: boolean\n /**\n * A boolean variable derived from `status`.\n * - `true` if the mutation is in its initial state prior to executing.\n */\n isIdle: boolean\n /**\n * A boolean variable derived from `status`.\n * - `true` if the mutation is currently executing.\n */\n isPending: boolean\n /**\n * A boolean variable derived from `status`.\n * - `true` if the last mutation attempt was successful.\n */\n isSuccess: boolean\n /**\n * The status of the mutation.\n * - Will be:\n * - `idle` initial status prior to the mutation function executing.\n * - `pending` if the mutation is currently executing.\n * - `error` if the last mutation attempt resulted in an error.\n * - `success` if the last mutation attempt was successful.\n */\n status: MutationStatus\n /**\n * The mutation function you can call with variables to trigger the mutation and optionally hooks on additional callback options.\n * @param variables - The variables object to pass to the `mutationFn`.\n * @param options.onSuccess - This function will fire when the mutation is successful and will be passed the mutation's result.\n * @param options.onError - This function will fire if the mutation encounters an error and will be passed the error.\n * @param options.onSettled - This function will fire when the mutation is either successfully fetched or encounters an error and be passed either the data or error.\n * @remarks\n * - If you make multiple requests, `onSuccess` will fire only after the latest call you've made.\n * - All the callback functions (`onSuccess`, `onError`, `onSettled`) are void functions, and the returned value will be ignored.\n */\n mutate: MutateFunction\n /**\n * A function to clean the mutation internal state (i.e., it resets the mutation to its initial state).\n */\n reset: () => void\n}\n\nexport interface MutationObserverIdleResult<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n> extends MutationObserverBaseResult<\n TData,\n TError,\n TVariables,\n TOnMutateResult\n> {\n data: undefined\n variables: undefined\n error: null\n isError: false\n isIdle: true\n isPending: false\n isSuccess: false\n status: 'idle'\n}\n\nexport interface MutationObserverLoadingResult<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n> extends MutationObserverBaseResult<\n TData,\n TError,\n TVariables,\n TOnMutateResult\n> {\n data: undefined\n variables: TVariables\n error: null\n isError: false\n isIdle: false\n isPending: true\n isSuccess: false\n status: 'pending'\n}\n\nexport interface MutationObserverErrorResult<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n> extends MutationObserverBaseResult<\n TData,\n TError,\n TVariables,\n TOnMutateResult\n> {\n data: undefined\n error: TError\n variables: TVariables\n isError: true\n isIdle: false\n isPending: false\n isSuccess: false\n status: 'error'\n}\n\nexport interface MutationObserverSuccessResult<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n> extends MutationObserverBaseResult<\n TData,\n TError,\n TVariables,\n TOnMutateResult\n> {\n data: TData\n error: null\n variables: TVariables\n isError: false\n isIdle: false\n isPending: false\n isSuccess: true\n status: 'success'\n}\n\nexport type MutationObserverResult<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n> =\n | MutationObserverIdleResult\n | MutationObserverLoadingResult\n | MutationObserverErrorResult\n | MutationObserverSuccessResult\n\nexport interface QueryClientConfig {\n queryCache?: QueryCache\n mutationCache?: MutationCache\n defaultOptions?: DefaultOptions\n}\n\nexport interface DefaultOptions {\n queries?: OmitKeyof<\n QueryObserverOptions,\n 'suspense' | 'queryKey'\n >\n mutations?: MutationObserverOptions\n hydrate?: HydrateOptions['defaultOptions']\n dehydrate?: DehydrateOptions\n}\n\nexport interface CancelOptions {\n revert?: boolean\n silent?: boolean\n}\n\nexport interface SetDataOptions {\n updatedAt?: number\n}\n\nexport type NotifyEventType =\n | 'added'\n | 'removed'\n | 'updated'\n | 'observerAdded'\n | 'observerRemoved'\n | 'observerResultsUpdated'\n | 'observerOptionsUpdated'\n\nexport interface NotifyEvent {\n type: NotifyEventType\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA8DO,IAAM,gBAAgB,uBAAO,eAAe;AAE5C,IAAM,qBAAqB,uBAAO,oBAAoB;AAEtD,IAAM,cAAc,uBAAO,aAAa;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/types.d.cts b/node_modules/@tanstack/query-core/build/modern/types.d.cts deleted file mode 100644 index c613caa..0000000 --- a/node_modules/@tanstack/query-core/build/modern/types.d.cts +++ /dev/null @@ -1,3 +0,0 @@ -export { T as AnyDataTag, b7 as CancelOptions, V as DataTag, G as DefaultError, b6 as DefaultOptions, ak as DefaultedInfiniteQueryObserverOptions, ai as DefaultedQueryObserverOptions, aP as DefinedInfiniteQueryObserverResult, aG as DefinedQueryObserverResult, B as DistributiveOmit, $ as Enabled, an as EnsureInfiniteQueryDataOptions, am as EnsureQueryDataOptions, ao as FetchInfiniteQueryOptions, av as FetchNextPageOptions, aw as FetchPreviousPageOptions, al as FetchQueryOptions, ay as FetchStatus, a7 as GetNextPageParamFunction, a6 as GetPreviousPageParamFunction, W as InferDataFromTag, X as InferErrorFromTag, a8 as InfiniteData, aI as InfiniteQueryObserverBaseResult, aL as InfiniteQueryObserverLoadingErrorResult, aK as InfiniteQueryObserverLoadingResult, aj as InfiniteQueryObserverOptions, aJ as InfiniteQueryObserverPendingResult, aO as InfiniteQueryObserverPlaceholderResult, aM as InfiniteQueryObserverRefetchErrorResult, aQ as InfiniteQueryObserverResult, aN as InfiniteQueryObserverSuccessResult, ae as InfiniteQueryPageParamsOptions, a2 as InitialDataFunction, ad as InitialPageParam, at as InvalidateOptions, ar as InvalidateQueryFilters, a_ as MutateFunction, aZ as MutateOptions, aW as MutationFunction, aV as MutationFunctionContext, aR as MutationKey, aU as MutationMeta, a$ as MutationObserverBaseResult, b2 as MutationObserverErrorResult, b0 as MutationObserverIdleResult, b1 as MutationObserverLoadingResult, aY as MutationObserverOptions, b4 as MutationObserverResult, b3 as MutationObserverSuccessResult, aX as MutationOptions, aT as MutationScope, aS as MutationStatus, aa as NetworkMode, F as NoInfer, N as NonUndefinedGuard, ba as NotifyEvent, b9 as NotifyEventType, ab as NotifyOnChangeProps, O as OmitKeyof, E as Override, a3 as PlaceholderDataFunction, a4 as QueriesPlaceholderDataFunction, b5 as QueryClientConfig, Y as QueryFunction, a1 as QueryFunctionContext, I as QueryKey, a5 as QueryKeyHashFunction, a9 as QueryMeta, az as QueryObserverBaseResult, aC as QueryObserverLoadingErrorResult, aB as QueryObserverLoadingResult, ag as QueryObserverOptions, aA as QueryObserverPendingResult, aF as QueryObserverPlaceholderResult, aD as QueryObserverRefetchErrorResult, aH as QueryObserverResult, aE as QueryObserverSuccessResult, ac as QueryOptions, a0 as QueryPersister, ax as QueryStatus, aq as RefetchOptions, as as RefetchQueryFilters, R as Register, au as ResetOptions, ap as ResultOptions, b8 as SetDataOptions, Z as StaleTime, _ as StaleTimeFunction, af as ThrowOnError, P as UnsetMarker, ah as WithRequired, K as dataTagErrorSymbol, J as dataTagSymbol, L as unsetMarker } from './hydration-uphG6M-i.cjs'; -import './removable.cjs'; -import './subscribable.cjs'; diff --git a/node_modules/@tanstack/query-core/build/modern/types.d.ts b/node_modules/@tanstack/query-core/build/modern/types.d.ts deleted file mode 100644 index f951ea6..0000000 --- a/node_modules/@tanstack/query-core/build/modern/types.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export { T as AnyDataTag, b7 as CancelOptions, V as DataTag, G as DefaultError, b6 as DefaultOptions, ak as DefaultedInfiniteQueryObserverOptions, ai as DefaultedQueryObserverOptions, aP as DefinedInfiniteQueryObserverResult, aG as DefinedQueryObserverResult, B as DistributiveOmit, $ as Enabled, an as EnsureInfiniteQueryDataOptions, am as EnsureQueryDataOptions, ao as FetchInfiniteQueryOptions, av as FetchNextPageOptions, aw as FetchPreviousPageOptions, al as FetchQueryOptions, ay as FetchStatus, a7 as GetNextPageParamFunction, a6 as GetPreviousPageParamFunction, W as InferDataFromTag, X as InferErrorFromTag, a8 as InfiniteData, aI as InfiniteQueryObserverBaseResult, aL as InfiniteQueryObserverLoadingErrorResult, aK as InfiniteQueryObserverLoadingResult, aj as InfiniteQueryObserverOptions, aJ as InfiniteQueryObserverPendingResult, aO as InfiniteQueryObserverPlaceholderResult, aM as InfiniteQueryObserverRefetchErrorResult, aQ as InfiniteQueryObserverResult, aN as InfiniteQueryObserverSuccessResult, ae as InfiniteQueryPageParamsOptions, a2 as InitialDataFunction, ad as InitialPageParam, at as InvalidateOptions, ar as InvalidateQueryFilters, a_ as MutateFunction, aZ as MutateOptions, aW as MutationFunction, aV as MutationFunctionContext, aR as MutationKey, aU as MutationMeta, a$ as MutationObserverBaseResult, b2 as MutationObserverErrorResult, b0 as MutationObserverIdleResult, b1 as MutationObserverLoadingResult, aY as MutationObserverOptions, b4 as MutationObserverResult, b3 as MutationObserverSuccessResult, aX as MutationOptions, aT as MutationScope, aS as MutationStatus, aa as NetworkMode, F as NoInfer, N as NonUndefinedGuard, ba as NotifyEvent, b9 as NotifyEventType, ab as NotifyOnChangeProps, O as OmitKeyof, E as Override, a3 as PlaceholderDataFunction, a4 as QueriesPlaceholderDataFunction, b5 as QueryClientConfig, Y as QueryFunction, a1 as QueryFunctionContext, I as QueryKey, a5 as QueryKeyHashFunction, a9 as QueryMeta, az as QueryObserverBaseResult, aC as QueryObserverLoadingErrorResult, aB as QueryObserverLoadingResult, ag as QueryObserverOptions, aA as QueryObserverPendingResult, aF as QueryObserverPlaceholderResult, aD as QueryObserverRefetchErrorResult, aH as QueryObserverResult, aE as QueryObserverSuccessResult, ac as QueryOptions, a0 as QueryPersister, ax as QueryStatus, aq as RefetchOptions, as as RefetchQueryFilters, R as Register, au as ResetOptions, ap as ResultOptions, b8 as SetDataOptions, Z as StaleTime, _ as StaleTimeFunction, af as ThrowOnError, P as UnsetMarker, ah as WithRequired, K as dataTagErrorSymbol, J as dataTagSymbol, L as unsetMarker } from './hydration-BlEVG2Lp.js'; -import './removable.js'; -import './subscribable.js'; diff --git a/node_modules/@tanstack/query-core/build/modern/types.js b/node_modules/@tanstack/query-core/build/modern/types.js deleted file mode 100644 index aa05474..0000000 --- a/node_modules/@tanstack/query-core/build/modern/types.js +++ /dev/null @@ -1,10 +0,0 @@ -// src/types.ts -var dataTagSymbol = /* @__PURE__ */ Symbol("dataTagSymbol"); -var dataTagErrorSymbol = /* @__PURE__ */ Symbol("dataTagErrorSymbol"); -var unsetMarker = /* @__PURE__ */ Symbol("unsetMarker"); -export { - dataTagErrorSymbol, - dataTagSymbol, - unsetMarker -}; -//# sourceMappingURL=types.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/types.js.map b/node_modules/@tanstack/query-core/build/modern/types.js.map deleted file mode 100644 index e1d384a..0000000 --- a/node_modules/@tanstack/query-core/build/modern/types.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/types.ts"],"sourcesContent":["/* istanbul ignore file */\n\nimport type { QueryClient } from './queryClient'\nimport type { DehydrateOptions, HydrateOptions } from './hydration'\nimport type { MutationState } from './mutation'\nimport type { FetchDirection, Query, QueryBehavior } from './query'\nimport type { RetryDelayValue, RetryValue } from './retryer'\nimport type { QueryFilters, QueryTypeFilter, SkipToken } from './utils'\nimport type { QueryCache } from './queryCache'\nimport type { MutationCache } from './mutationCache'\n\nexport type NonUndefinedGuard = T extends undefined ? never : T\n\nexport type DistributiveOmit<\n TObject,\n TKey extends keyof TObject,\n> = TObject extends any ? Omit : never\n\nexport type OmitKeyof<\n TObject,\n TKey extends TStrictly extends 'safely'\n ?\n | keyof TObject\n | (string & Record)\n | (number & Record)\n | (symbol & Record)\n : keyof TObject,\n TStrictly extends 'strictly' | 'safely' = 'strictly',\n> = Omit\n\nexport type Override = {\n [AKey in keyof TTargetA]: AKey extends keyof TTargetB\n ? TTargetB[AKey]\n : TTargetA[AKey]\n}\n\nexport type NoInfer = [T][T extends any ? 0 : never]\n\nexport interface Register {\n // defaultError: Error\n // queryMeta: Record\n // mutationMeta: Record\n // queryKey: ReadonlyArray\n // mutationKey: ReadonlyArray\n}\n\nexport type DefaultError = Register extends {\n defaultError: infer TError\n}\n ? TError\n : Error\n\nexport type QueryKey = Register extends {\n queryKey: infer TQueryKey\n}\n ? TQueryKey extends ReadonlyArray\n ? TQueryKey\n : TQueryKey extends Array\n ? TQueryKey\n : ReadonlyArray\n : ReadonlyArray\n\nexport const dataTagSymbol = Symbol('dataTagSymbol')\nexport type dataTagSymbol = typeof dataTagSymbol\nexport const dataTagErrorSymbol = Symbol('dataTagErrorSymbol')\nexport type dataTagErrorSymbol = typeof dataTagErrorSymbol\nexport const unsetMarker = Symbol('unsetMarker')\nexport type UnsetMarker = typeof unsetMarker\nexport type AnyDataTag = {\n [dataTagSymbol]: any\n [dataTagErrorSymbol]: any\n}\nexport type DataTag<\n TType,\n TValue,\n TError = UnsetMarker,\n> = TType extends AnyDataTag\n ? TType\n : TType & {\n [dataTagSymbol]: TValue\n [dataTagErrorSymbol]: TError\n }\n\nexport type InferDataFromTag =\n TTaggedQueryKey extends DataTag\n ? TaggedValue\n : TQueryFnData\n\nexport type InferErrorFromTag =\n TTaggedQueryKey extends DataTag\n ? TaggedError extends UnsetMarker\n ? TError\n : TaggedError\n : TError\n\nexport type QueryFunction<\n T = unknown,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = never,\n> = (context: QueryFunctionContext) => T | Promise\n\nexport type StaleTime = number | 'static'\n\nexport type StaleTimeFunction<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> =\n | StaleTime\n | ((query: Query) => StaleTime)\n\nexport type Enabled<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> =\n | boolean\n | ((query: Query) => boolean)\n\nexport type QueryPersister<\n T = unknown,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = never,\n> = [TPageParam] extends [never]\n ? (\n queryFn: QueryFunction,\n context: QueryFunctionContext,\n query: Query,\n ) => T | Promise\n : (\n queryFn: QueryFunction,\n context: QueryFunctionContext,\n query: Query,\n ) => T | Promise\n\nexport type QueryFunctionContext<\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = never,\n> = [TPageParam] extends [never]\n ? {\n client: QueryClient\n queryKey: TQueryKey\n signal: AbortSignal\n meta: QueryMeta | undefined\n pageParam?: unknown\n /**\n * @deprecated\n * if you want access to the direction, you can add it to the pageParam\n */\n direction?: unknown\n }\n : {\n client: QueryClient\n queryKey: TQueryKey\n signal: AbortSignal\n pageParam: TPageParam\n /**\n * @deprecated\n * if you want access to the direction, you can add it to the pageParam\n */\n direction: FetchDirection\n meta: QueryMeta | undefined\n }\n\nexport type InitialDataFunction = () => T | undefined\n\ntype NonFunctionGuard = T extends Function ? never : T\n\nexport type PlaceholderDataFunction<\n TQueryFnData = unknown,\n TError = DefaultError,\n TQueryData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> = (\n previousData: TQueryData | undefined,\n previousQuery: Query | undefined,\n) => TQueryData | undefined\n\nexport type QueriesPlaceholderDataFunction = (\n previousData: undefined,\n previousQuery: undefined,\n) => TQueryData | undefined\n\nexport type QueryKeyHashFunction = (\n queryKey: TQueryKey,\n) => string\n\nexport type GetPreviousPageParamFunction = (\n firstPage: TQueryFnData,\n allPages: Array,\n firstPageParam: TPageParam,\n allPageParams: Array,\n) => TPageParam | undefined | null\n\nexport type GetNextPageParamFunction = (\n lastPage: TQueryFnData,\n allPages: Array,\n lastPageParam: TPageParam,\n allPageParams: Array,\n) => TPageParam | undefined | null\n\nexport interface InfiniteData {\n pages: Array\n pageParams: Array\n}\n\nexport type QueryMeta = Register extends {\n queryMeta: infer TQueryMeta\n}\n ? TQueryMeta extends Record\n ? TQueryMeta\n : Record\n : Record\n\nexport type NetworkMode = 'online' | 'always' | 'offlineFirst'\n\nexport type NotifyOnChangeProps =\n | Array\n | 'all'\n | undefined\n | (() => Array | 'all' | undefined)\n\nexport interface QueryOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = never,\n> {\n /**\n * If `false`, failed queries will not retry by default.\n * If `true`, failed queries will retry infinitely., failureCount: num\n * If set to an integer number, e.g. 3, failed queries will retry until the failed query count meets that number.\n * If set to a function `(failureCount, error) => boolean` failed queries will retry until the function returns false.\n */\n retry?: RetryValue\n retryDelay?: RetryDelayValue\n networkMode?: NetworkMode\n /**\n * The time in milliseconds that unused/inactive cache data remains in memory.\n * When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration.\n * When different garbage collection times are specified, the longest one will be used.\n * Setting it to `Infinity` will disable garbage collection.\n */\n gcTime?: number\n queryFn?: QueryFunction | SkipToken\n persister?: QueryPersister<\n NoInfer,\n NoInfer,\n NoInfer\n >\n queryHash?: string\n queryKey?: TQueryKey\n queryKeyHashFn?: QueryKeyHashFunction\n initialData?: TData | InitialDataFunction\n initialDataUpdatedAt?: number | (() => number | undefined)\n behavior?: QueryBehavior\n /**\n * Set this to `false` to disable structural sharing between query results.\n * Set this to a function which accepts the old and new data and returns resolved data of the same type to implement custom structural sharing logic.\n * Defaults to `true`.\n */\n structuralSharing?:\n | boolean\n | ((oldData: unknown | undefined, newData: unknown) => unknown)\n _defaulted?: boolean\n /**\n * Additional payload to be stored on each query.\n * Use this property to pass information that can be used in other places.\n */\n meta?: QueryMeta\n /**\n * Maximum number of pages to store in the data of an infinite query.\n */\n maxPages?: number\n}\n\nexport interface InitialPageParam {\n initialPageParam: TPageParam\n}\n\nexport interface InfiniteQueryPageParamsOptions<\n TQueryFnData = unknown,\n TPageParam = unknown,\n> extends InitialPageParam {\n /**\n * This function can be set to automatically get the previous cursor for infinite queries.\n * The result will also be used to determine the value of `hasPreviousPage`.\n */\n getPreviousPageParam?: GetPreviousPageParamFunction\n /**\n * This function can be set to automatically get the next cursor for infinite queries.\n * The result will also be used to determine the value of `hasNextPage`.\n */\n getNextPageParam: GetNextPageParamFunction\n}\n\nexport type ThrowOnError<\n TQueryFnData,\n TError,\n TQueryData,\n TQueryKey extends QueryKey,\n> =\n | boolean\n | ((\n error: TError,\n query: Query,\n ) => boolean)\n\nexport interface QueryObserverOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = never,\n> extends WithRequired<\n QueryOptions,\n 'queryKey'\n> {\n /**\n * Set this to `false` or a function that returns `false` to disable automatic refetching when the query mounts or changes query keys.\n * To refetch the query, use the `refetch` method returned from the `useQuery` instance.\n * Accepts a boolean or function that returns a boolean.\n * Defaults to `true`.\n */\n enabled?: Enabled\n /**\n * The time in milliseconds after data is considered stale.\n * If set to `Infinity`, the data will never be considered stale.\n * If set to a function, the function will be executed with the query to compute a `staleTime`.\n * Defaults to `0`.\n */\n staleTime?: StaleTimeFunction\n /**\n * If set to a number, the query will continuously refetch at this frequency in milliseconds.\n * If set to a function, the function will be executed with the latest data and query to compute a frequency\n * Defaults to `false`.\n */\n refetchInterval?:\n | number\n | false\n | ((\n query: Query,\n ) => number | false | undefined)\n /**\n * If set to `true`, the query will continue to refetch while their tab/window is in the background.\n * Defaults to `false`.\n */\n refetchIntervalInBackground?: boolean\n /**\n * If set to `true`, the query will refetch on window focus if the data is stale.\n * If set to `false`, the query will not refetch on window focus.\n * If set to `'always'`, the query will always refetch on window focus.\n * If set to a function, the function will be executed with the latest data and query to compute the value.\n * Defaults to `true`.\n */\n refetchOnWindowFocus?:\n | boolean\n | 'always'\n | ((\n query: Query,\n ) => boolean | 'always')\n /**\n * If set to `true`, the query will refetch on reconnect if the data is stale.\n * If set to `false`, the query will not refetch on reconnect.\n * If set to `'always'`, the query will always refetch on reconnect.\n * If set to a function, the function will be executed with the latest data and query to compute the value.\n * Defaults to the value of `networkOnline` (`true`)\n */\n refetchOnReconnect?:\n | boolean\n | 'always'\n | ((\n query: Query,\n ) => boolean | 'always')\n /**\n * If set to `true`, the query will refetch on mount if the data is stale.\n * If set to `false`, will disable additional instances of a query to trigger background refetch.\n * If set to `'always'`, the query will always refetch on mount.\n * If set to a function, the function will be executed with the latest data and query to compute the value\n * Defaults to `true`.\n */\n refetchOnMount?:\n | boolean\n | 'always'\n | ((\n query: Query,\n ) => boolean | 'always')\n /**\n * If set to `false`, the query will not be retried on mount if it contains an error.\n * Defaults to `true`.\n */\n retryOnMount?: boolean\n /**\n * If set, the component will only re-render if any of the listed properties change.\n * When set to `['data', 'error']`, the component will only re-render when the `data` or `error` properties change.\n * When set to `'all'`, the component will re-render whenever a query is updated.\n * When set to a function, the function will be executed to compute the list of properties.\n * By default, access to properties will be tracked, and the component will only re-render when one of the tracked properties change.\n */\n notifyOnChangeProps?: NotifyOnChangeProps\n /**\n * Whether errors should be thrown instead of setting the `error` property.\n * If set to `true` or `suspense` is `true`, all errors will be thrown to the error boundary.\n * If set to `false` and `suspense` is `false`, errors are returned as state.\n * If set to a function, it will be passed the error and the query, and it should return a boolean indicating whether to show the error in an error boundary (`true`) or return the error as state (`false`).\n * Defaults to `false`.\n */\n throwOnError?: ThrowOnError\n /**\n * This option can be used to transform or select a part of the data returned by the query function.\n */\n select?: (data: TQueryData) => TData\n /**\n * If set to `true`, the query will suspend when `status === 'pending'`\n * and throw errors when `status === 'error'`.\n * Defaults to `false`.\n */\n suspense?: boolean\n /**\n * If set, this value will be used as the placeholder data for this particular query observer while the query is still in the `loading` data and no initialData has been provided.\n */\n placeholderData?:\n | NonFunctionGuard\n | PlaceholderDataFunction<\n NonFunctionGuard,\n TError,\n NonFunctionGuard,\n TQueryKey\n >\n\n _optimisticResults?: 'optimistic' | 'isRestoring'\n\n /**\n * Enable prefetching during rendering\n */\n experimental_prefetchInRender?: boolean\n}\n\nexport type WithRequired = TTarget & {\n [_ in TKey]: {}\n}\n\nexport type DefaultedQueryObserverOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> = WithRequired<\n QueryObserverOptions,\n 'throwOnError' | 'refetchOnReconnect' | 'queryHash'\n>\n\nexport interface InfiniteQueryObserverOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n>\n extends\n QueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n InfiniteData,\n TQueryKey,\n TPageParam\n >,\n InfiniteQueryPageParamsOptions {}\n\nexport type DefaultedInfiniteQueryObserverOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n> = WithRequired<\n InfiniteQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n 'throwOnError' | 'refetchOnReconnect' | 'queryHash'\n>\n\nexport interface FetchQueryOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = never,\n> extends WithRequired<\n QueryOptions,\n 'queryKey'\n> {\n initialPageParam?: never\n /**\n * The time in milliseconds after data is considered stale.\n * If the data is fresh it will be returned from the cache.\n */\n staleTime?: StaleTimeFunction\n}\n\nexport interface EnsureQueryDataOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = never,\n> extends FetchQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n> {\n revalidateIfStale?: boolean\n}\n\nexport type EnsureInfiniteQueryDataOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n> = FetchInfiniteQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n> & {\n revalidateIfStale?: boolean\n}\n\ntype FetchInfiniteQueryPages =\n | { pages?: never }\n | {\n pages: number\n getNextPageParam: GetNextPageParamFunction\n }\n\nexport type FetchInfiniteQueryOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n> = Omit<\n FetchQueryOptions<\n TQueryFnData,\n TError,\n InfiniteData,\n TQueryKey,\n TPageParam\n >,\n 'initialPageParam'\n> &\n InitialPageParam &\n FetchInfiniteQueryPages\n\nexport interface ResultOptions {\n throwOnError?: boolean\n}\n\nexport interface RefetchOptions extends ResultOptions {\n /**\n * If set to `true`, a currently running request will be cancelled before a new request is made\n *\n * If set to `false`, no refetch will be made if there is already a request running.\n *\n * Defaults to `true`.\n */\n cancelRefetch?: boolean\n}\n\nexport interface InvalidateQueryFilters<\n TQueryKey extends QueryKey = QueryKey,\n> extends QueryFilters {\n refetchType?: QueryTypeFilter | 'none'\n}\n\nexport interface RefetchQueryFilters<\n TQueryKey extends QueryKey = QueryKey,\n> extends QueryFilters {}\n\nexport interface InvalidateOptions extends RefetchOptions {}\nexport interface ResetOptions extends RefetchOptions {}\n\nexport interface FetchNextPageOptions extends ResultOptions {\n /**\n * If set to `true`, calling `fetchNextPage` repeatedly will invoke `queryFn` every time,\n * whether the previous invocation has resolved or not. Also, the result from previous invocations will be ignored.\n *\n * If set to `false`, calling `fetchNextPage` repeatedly won't have any effect until the first invocation has resolved.\n *\n * Defaults to `true`.\n */\n cancelRefetch?: boolean\n}\n\nexport interface FetchPreviousPageOptions extends ResultOptions {\n /**\n * If set to `true`, calling `fetchPreviousPage` repeatedly will invoke `queryFn` every time,\n * whether the previous invocation has resolved or not. Also, the result from previous invocations will be ignored.\n *\n * If set to `false`, calling `fetchPreviousPage` repeatedly won't have any effect until the first invocation has resolved.\n *\n * Defaults to `true`.\n */\n cancelRefetch?: boolean\n}\n\nexport type QueryStatus = 'pending' | 'error' | 'success'\nexport type FetchStatus = 'fetching' | 'paused' | 'idle'\n\nexport interface QueryObserverBaseResult<\n TData = unknown,\n TError = DefaultError,\n> {\n /**\n * The last successfully resolved data for the query.\n */\n data: TData | undefined\n /**\n * The timestamp for when the query most recently returned the `status` as `\"success\"`.\n */\n dataUpdatedAt: number\n /**\n * The error object for the query, if an error was thrown.\n * - Defaults to `null`.\n */\n error: TError | null\n /**\n * The timestamp for when the query most recently returned the `status` as `\"error\"`.\n */\n errorUpdatedAt: number\n /**\n * The failure count for the query.\n * - Incremented every time the query fails.\n * - Reset to `0` when the query succeeds.\n */\n failureCount: number\n /**\n * The failure reason for the query retry.\n * - Reset to `null` when the query succeeds.\n */\n failureReason: TError | null\n /**\n * The sum of all errors.\n */\n errorUpdateCount: number\n /**\n * A derived boolean from the `status` variable, provided for convenience.\n * - `true` if the query attempt resulted in an error.\n */\n isError: boolean\n /**\n * Will be `true` if the query has been fetched.\n */\n isFetched: boolean\n /**\n * Will be `true` if the query has been fetched after the component mounted.\n * - This property can be used to not show any previously cached data.\n */\n isFetchedAfterMount: boolean\n /**\n * A derived boolean from the `fetchStatus` variable, provided for convenience.\n * - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch.\n */\n isFetching: boolean\n /**\n * Is `true` whenever the first fetch for a query is in-flight.\n * - Is the same as `isFetching && isPending`.\n */\n isLoading: boolean\n /**\n * Will be `pending` if there's no cached data and no query attempt was finished yet.\n */\n isPending: boolean\n /**\n * Will be `true` if the query failed while fetching for the first time.\n */\n isLoadingError: boolean\n /**\n * @deprecated `isInitialLoading` is being deprecated in favor of `isLoading`\n * and will be removed in the next major version.\n */\n isInitialLoading: boolean\n /**\n * A derived boolean from the `fetchStatus` variable, provided for convenience.\n * - The query wanted to fetch, but has been `paused`.\n */\n isPaused: boolean\n /**\n * Will be `true` if the data shown is the placeholder data.\n */\n isPlaceholderData: boolean\n /**\n * Will be `true` if the query failed while refetching.\n */\n isRefetchError: boolean\n /**\n * Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`.\n * - Is the same as `isFetching && !isPending`.\n */\n isRefetching: boolean\n /**\n * Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`.\n */\n isStale: boolean\n /**\n * A derived boolean from the `status` variable, provided for convenience.\n * - `true` if the query has received a response with no errors and is ready to display its data.\n */\n isSuccess: boolean\n /**\n * `true` if this observer is enabled, `false` otherwise.\n */\n isEnabled: boolean\n /**\n * A function to manually refetch the query.\n */\n refetch: (\n options?: RefetchOptions,\n ) => Promise>\n /**\n * The status of the query.\n * - Will be:\n * - `pending` if there's no cached data and no query attempt was finished yet.\n * - `error` if the query attempt resulted in an error.\n * - `success` if the query has received a response with no errors and is ready to display its data.\n */\n status: QueryStatus\n /**\n * The fetch status of the query.\n * - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch.\n * - `paused`: The query wanted to fetch, but has been `paused`.\n * - `idle`: The query is not fetching.\n * - See [Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information.\n */\n fetchStatus: FetchStatus\n /**\n * A stable promise that will be resolved with the data of the query.\n * Requires the `experimental_prefetchInRender` feature flag to be enabled.\n * @example\n *\n * ### Enabling the feature flag\n * ```ts\n * const client = new QueryClient({\n * defaultOptions: {\n * queries: {\n * experimental_prefetchInRender: true,\n * },\n * },\n * })\n * ```\n *\n * ### Usage\n * ```tsx\n * import { useQuery } from '@tanstack/react-query'\n * import React from 'react'\n * import { fetchTodos, type Todo } from './api'\n *\n * function TodoList({ query }: { query: UseQueryResult }) {\n * const data = React.use(query.promise)\n *\n * return (\n *
    \n * {data.map(todo => (\n *
  • {todo.title}
  • \n * ))}\n *
\n * )\n * }\n *\n * export function App() {\n * const query = useQuery({ queryKey: ['todos'], queryFn: fetchTodos })\n *\n * return (\n * <>\n *

Todos

\n * Loading...}>\n * \n * \n * \n * )\n * }\n * ```\n */\n promise: Promise\n}\n\nexport interface QueryObserverPendingResult<\n TData = unknown,\n TError = DefaultError,\n> extends QueryObserverBaseResult {\n data: undefined\n error: null\n isError: false\n isPending: true\n isLoadingError: false\n isRefetchError: false\n isSuccess: false\n isPlaceholderData: false\n status: 'pending'\n}\n\nexport interface QueryObserverLoadingResult<\n TData = unknown,\n TError = DefaultError,\n> extends QueryObserverBaseResult {\n data: undefined\n error: null\n isError: false\n isPending: true\n isLoading: true\n isLoadingError: false\n isRefetchError: false\n isSuccess: false\n isPlaceholderData: false\n status: 'pending'\n}\n\nexport interface QueryObserverLoadingErrorResult<\n TData = unknown,\n TError = DefaultError,\n> extends QueryObserverBaseResult {\n data: undefined\n error: TError\n isError: true\n isPending: false\n isLoading: false\n isLoadingError: true\n isRefetchError: false\n isSuccess: false\n isPlaceholderData: false\n status: 'error'\n}\n\nexport interface QueryObserverRefetchErrorResult<\n TData = unknown,\n TError = DefaultError,\n> extends QueryObserverBaseResult {\n data: TData\n error: TError\n isError: true\n isPending: false\n isLoading: false\n isLoadingError: false\n isRefetchError: true\n isSuccess: false\n isPlaceholderData: false\n status: 'error'\n}\n\nexport interface QueryObserverSuccessResult<\n TData = unknown,\n TError = DefaultError,\n> extends QueryObserverBaseResult {\n data: TData\n error: null\n isError: false\n isPending: false\n isLoading: false\n isLoadingError: false\n isRefetchError: false\n isSuccess: true\n isPlaceholderData: false\n status: 'success'\n}\n\nexport interface QueryObserverPlaceholderResult<\n TData = unknown,\n TError = DefaultError,\n> extends QueryObserverBaseResult {\n data: TData\n isError: false\n error: null\n isPending: false\n isLoading: false\n isLoadingError: false\n isRefetchError: false\n isSuccess: true\n isPlaceholderData: true\n status: 'success'\n}\n\nexport type DefinedQueryObserverResult<\n TData = unknown,\n TError = DefaultError,\n> =\n | QueryObserverRefetchErrorResult\n | QueryObserverSuccessResult\n\nexport type QueryObserverResult =\n | DefinedQueryObserverResult\n | QueryObserverLoadingErrorResult\n | QueryObserverLoadingResult\n | QueryObserverPendingResult\n | QueryObserverPlaceholderResult\n\nexport interface InfiniteQueryObserverBaseResult<\n TData = unknown,\n TError = DefaultError,\n> extends QueryObserverBaseResult {\n /**\n * This function allows you to fetch the next \"page\" of results.\n */\n fetchNextPage: (\n options?: FetchNextPageOptions,\n ) => Promise>\n /**\n * This function allows you to fetch the previous \"page\" of results.\n */\n fetchPreviousPage: (\n options?: FetchPreviousPageOptions,\n ) => Promise>\n /**\n * Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option).\n */\n hasNextPage: boolean\n /**\n * Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option).\n */\n hasPreviousPage: boolean\n /**\n * Will be `true` if the query failed while fetching the next page.\n */\n isFetchNextPageError: boolean\n /**\n * Will be `true` while fetching the next page with `fetchNextPage`.\n */\n isFetchingNextPage: boolean\n /**\n * Will be `true` if the query failed while fetching the previous page.\n */\n isFetchPreviousPageError: boolean\n /**\n * Will be `true` while fetching the previous page with `fetchPreviousPage`.\n */\n isFetchingPreviousPage: boolean\n}\n\nexport interface InfiniteQueryObserverPendingResult<\n TData = unknown,\n TError = DefaultError,\n> extends InfiniteQueryObserverBaseResult {\n data: undefined\n error: null\n isError: false\n isPending: true\n isLoadingError: false\n isRefetchError: false\n isFetchNextPageError: false\n isFetchPreviousPageError: false\n isSuccess: false\n isPlaceholderData: false\n status: 'pending'\n}\n\nexport interface InfiniteQueryObserverLoadingResult<\n TData = unknown,\n TError = DefaultError,\n> extends InfiniteQueryObserverBaseResult {\n data: undefined\n error: null\n isError: false\n isPending: true\n isLoading: true\n isLoadingError: false\n isRefetchError: false\n isFetchNextPageError: false\n isFetchPreviousPageError: false\n isSuccess: false\n isPlaceholderData: false\n status: 'pending'\n}\n\nexport interface InfiniteQueryObserverLoadingErrorResult<\n TData = unknown,\n TError = DefaultError,\n> extends InfiniteQueryObserverBaseResult {\n data: undefined\n error: TError\n isError: true\n isPending: false\n isLoading: false\n isLoadingError: true\n isRefetchError: false\n isFetchNextPageError: false\n isFetchPreviousPageError: false\n isSuccess: false\n isPlaceholderData: false\n status: 'error'\n}\n\nexport interface InfiniteQueryObserverRefetchErrorResult<\n TData = unknown,\n TError = DefaultError,\n> extends InfiniteQueryObserverBaseResult {\n data: TData\n error: TError\n isError: true\n isPending: false\n isLoading: false\n isLoadingError: false\n isRefetchError: true\n isSuccess: false\n isPlaceholderData: false\n status: 'error'\n}\n\nexport interface InfiniteQueryObserverSuccessResult<\n TData = unknown,\n TError = DefaultError,\n> extends InfiniteQueryObserverBaseResult {\n data: TData\n error: null\n isError: false\n isPending: false\n isLoading: false\n isLoadingError: false\n isRefetchError: false\n isFetchNextPageError: false\n isFetchPreviousPageError: false\n isSuccess: true\n isPlaceholderData: false\n status: 'success'\n}\n\nexport interface InfiniteQueryObserverPlaceholderResult<\n TData = unknown,\n TError = DefaultError,\n> extends InfiniteQueryObserverBaseResult {\n data: TData\n isError: false\n error: null\n isPending: false\n isLoading: false\n isLoadingError: false\n isRefetchError: false\n isSuccess: true\n isPlaceholderData: true\n isFetchNextPageError: false\n isFetchPreviousPageError: false\n status: 'success'\n}\n\nexport type DefinedInfiniteQueryObserverResult<\n TData = unknown,\n TError = DefaultError,\n> =\n | InfiniteQueryObserverRefetchErrorResult\n | InfiniteQueryObserverSuccessResult\n\nexport type InfiniteQueryObserverResult<\n TData = unknown,\n TError = DefaultError,\n> =\n | DefinedInfiniteQueryObserverResult\n | InfiniteQueryObserverLoadingErrorResult\n | InfiniteQueryObserverLoadingResult\n | InfiniteQueryObserverPendingResult\n | InfiniteQueryObserverPlaceholderResult\n\nexport type MutationKey = Register extends {\n mutationKey: infer TMutationKey\n}\n ? TMutationKey extends ReadonlyArray\n ? TMutationKey\n : TMutationKey extends Array\n ? TMutationKey\n : ReadonlyArray\n : ReadonlyArray\n\nexport type MutationStatus = 'idle' | 'pending' | 'success' | 'error'\n\nexport type MutationScope = {\n id: string\n}\n\nexport type MutationMeta = Register extends {\n mutationMeta: infer TMutationMeta\n}\n ? TMutationMeta extends Record\n ? TMutationMeta\n : Record\n : Record\n\nexport type MutationFunctionContext = {\n client: QueryClient\n meta: MutationMeta | undefined\n mutationKey?: MutationKey\n}\n\nexport type MutationFunction = (\n variables: TVariables,\n context: MutationFunctionContext,\n) => Promise\n\nexport interface MutationOptions<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n> {\n mutationFn?: MutationFunction\n mutationKey?: MutationKey\n onMutate?: (\n variables: TVariables,\n context: MutationFunctionContext,\n ) => Promise | TOnMutateResult\n onSuccess?: (\n data: TData,\n variables: TVariables,\n onMutateResult: TOnMutateResult,\n context: MutationFunctionContext,\n ) => Promise | unknown\n onError?: (\n error: TError,\n variables: TVariables,\n onMutateResult: TOnMutateResult | undefined,\n context: MutationFunctionContext,\n ) => Promise | unknown\n onSettled?: (\n data: TData | undefined,\n error: TError | null,\n variables: TVariables,\n onMutateResult: TOnMutateResult | undefined,\n context: MutationFunctionContext,\n ) => Promise | unknown\n retry?: RetryValue\n retryDelay?: RetryDelayValue\n networkMode?: NetworkMode\n gcTime?: number\n _defaulted?: boolean\n meta?: MutationMeta\n scope?: MutationScope\n}\n\nexport interface MutationObserverOptions<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n> extends MutationOptions {\n throwOnError?: boolean | ((error: TError) => boolean)\n}\n\nexport interface MutateOptions<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n> {\n onSuccess?: (\n data: TData,\n variables: TVariables,\n onMutateResult: TOnMutateResult | undefined,\n context: MutationFunctionContext,\n ) => void\n onError?: (\n error: TError,\n variables: TVariables,\n onMutateResult: TOnMutateResult | undefined,\n context: MutationFunctionContext,\n ) => void\n onSettled?: (\n data: TData | undefined,\n error: TError | null,\n variables: TVariables,\n onMutateResult: TOnMutateResult | undefined,\n context: MutationFunctionContext,\n ) => void\n}\n\nexport type MutateFunction<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n> = (\n variables: TVariables,\n options?: MutateOptions,\n) => Promise\n\nexport interface MutationObserverBaseResult<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n> extends MutationState {\n /**\n * The last successfully resolved data for the mutation.\n */\n data: TData | undefined\n /**\n * The variables object passed to the `mutationFn`.\n */\n variables: TVariables | undefined\n /**\n * The error object for the mutation, if an error was encountered.\n * - Defaults to `null`.\n */\n error: TError | null\n /**\n * A boolean variable derived from `status`.\n * - `true` if the last mutation attempt resulted in an error.\n */\n isError: boolean\n /**\n * A boolean variable derived from `status`.\n * - `true` if the mutation is in its initial state prior to executing.\n */\n isIdle: boolean\n /**\n * A boolean variable derived from `status`.\n * - `true` if the mutation is currently executing.\n */\n isPending: boolean\n /**\n * A boolean variable derived from `status`.\n * - `true` if the last mutation attempt was successful.\n */\n isSuccess: boolean\n /**\n * The status of the mutation.\n * - Will be:\n * - `idle` initial status prior to the mutation function executing.\n * - `pending` if the mutation is currently executing.\n * - `error` if the last mutation attempt resulted in an error.\n * - `success` if the last mutation attempt was successful.\n */\n status: MutationStatus\n /**\n * The mutation function you can call with variables to trigger the mutation and optionally hooks on additional callback options.\n * @param variables - The variables object to pass to the `mutationFn`.\n * @param options.onSuccess - This function will fire when the mutation is successful and will be passed the mutation's result.\n * @param options.onError - This function will fire if the mutation encounters an error and will be passed the error.\n * @param options.onSettled - This function will fire when the mutation is either successfully fetched or encounters an error and be passed either the data or error.\n * @remarks\n * - If you make multiple requests, `onSuccess` will fire only after the latest call you've made.\n * - All the callback functions (`onSuccess`, `onError`, `onSettled`) are void functions, and the returned value will be ignored.\n */\n mutate: MutateFunction\n /**\n * A function to clean the mutation internal state (i.e., it resets the mutation to its initial state).\n */\n reset: () => void\n}\n\nexport interface MutationObserverIdleResult<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n> extends MutationObserverBaseResult<\n TData,\n TError,\n TVariables,\n TOnMutateResult\n> {\n data: undefined\n variables: undefined\n error: null\n isError: false\n isIdle: true\n isPending: false\n isSuccess: false\n status: 'idle'\n}\n\nexport interface MutationObserverLoadingResult<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n> extends MutationObserverBaseResult<\n TData,\n TError,\n TVariables,\n TOnMutateResult\n> {\n data: undefined\n variables: TVariables\n error: null\n isError: false\n isIdle: false\n isPending: true\n isSuccess: false\n status: 'pending'\n}\n\nexport interface MutationObserverErrorResult<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n> extends MutationObserverBaseResult<\n TData,\n TError,\n TVariables,\n TOnMutateResult\n> {\n data: undefined\n error: TError\n variables: TVariables\n isError: true\n isIdle: false\n isPending: false\n isSuccess: false\n status: 'error'\n}\n\nexport interface MutationObserverSuccessResult<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n> extends MutationObserverBaseResult<\n TData,\n TError,\n TVariables,\n TOnMutateResult\n> {\n data: TData\n error: null\n variables: TVariables\n isError: false\n isIdle: false\n isPending: false\n isSuccess: true\n status: 'success'\n}\n\nexport type MutationObserverResult<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n> =\n | MutationObserverIdleResult\n | MutationObserverLoadingResult\n | MutationObserverErrorResult\n | MutationObserverSuccessResult\n\nexport interface QueryClientConfig {\n queryCache?: QueryCache\n mutationCache?: MutationCache\n defaultOptions?: DefaultOptions\n}\n\nexport interface DefaultOptions {\n queries?: OmitKeyof<\n QueryObserverOptions,\n 'suspense' | 'queryKey'\n >\n mutations?: MutationObserverOptions\n hydrate?: HydrateOptions['defaultOptions']\n dehydrate?: DehydrateOptions\n}\n\nexport interface CancelOptions {\n revert?: boolean\n silent?: boolean\n}\n\nexport interface SetDataOptions {\n updatedAt?: number\n}\n\nexport type NotifyEventType =\n | 'added'\n | 'removed'\n | 'updated'\n | 'observerAdded'\n | 'observerRemoved'\n | 'observerResultsUpdated'\n | 'observerOptionsUpdated'\n\nexport interface NotifyEvent {\n type: NotifyEventType\n}\n"],"mappings":";AA8DO,IAAM,gBAAgB,uBAAO,eAAe;AAE5C,IAAM,qBAAqB,uBAAO,oBAAoB;AAEtD,IAAM,cAAc,uBAAO,aAAa;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/utils.cjs b/node_modules/@tanstack/query-core/build/modern/utils.cjs deleted file mode 100644 index 495c37e..0000000 --- a/node_modules/@tanstack/query-core/build/modern/utils.cjs +++ /dev/null @@ -1,330 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// src/utils.ts -var utils_exports = {}; -__export(utils_exports, { - addConsumeAwareSignal: () => addConsumeAwareSignal, - addToEnd: () => addToEnd, - addToStart: () => addToStart, - ensureQueryFn: () => ensureQueryFn, - functionalUpdate: () => functionalUpdate, - hashKey: () => hashKey, - hashQueryKeyByOptions: () => hashQueryKeyByOptions, - isPlainArray: () => isPlainArray, - isPlainObject: () => isPlainObject, - isServer: () => isServer, - isValidTimeout: () => isValidTimeout, - keepPreviousData: () => keepPreviousData, - matchMutation: () => matchMutation, - matchQuery: () => matchQuery, - noop: () => noop, - partialMatchKey: () => partialMatchKey, - replaceData: () => replaceData, - replaceEqualDeep: () => replaceEqualDeep, - resolveEnabled: () => resolveEnabled, - resolveStaleTime: () => resolveStaleTime, - shallowEqualObjects: () => shallowEqualObjects, - shouldThrowError: () => shouldThrowError, - skipToken: () => skipToken, - sleep: () => sleep, - timeUntilStale: () => timeUntilStale -}); -module.exports = __toCommonJS(utils_exports); -var import_timeoutManager = require("./timeoutManager.cjs"); -var isServer = typeof window === "undefined" || "Deno" in globalThis; -function noop() { -} -function functionalUpdate(updater, input) { - return typeof updater === "function" ? updater(input) : updater; -} -function isValidTimeout(value) { - return typeof value === "number" && value >= 0 && value !== Infinity; -} -function timeUntilStale(updatedAt, staleTime) { - return Math.max(updatedAt + (staleTime || 0) - Date.now(), 0); -} -function resolveStaleTime(staleTime, query) { - return typeof staleTime === "function" ? staleTime(query) : staleTime; -} -function resolveEnabled(enabled, query) { - return typeof enabled === "function" ? enabled(query) : enabled; -} -function matchQuery(filters, query) { - const { - type = "all", - exact, - fetchStatus, - predicate, - queryKey, - stale - } = filters; - if (queryKey) { - if (exact) { - if (query.queryHash !== hashQueryKeyByOptions(queryKey, query.options)) { - return false; - } - } else if (!partialMatchKey(query.queryKey, queryKey)) { - return false; - } - } - if (type !== "all") { - const isActive = query.isActive(); - if (type === "active" && !isActive) { - return false; - } - if (type === "inactive" && isActive) { - return false; - } - } - if (typeof stale === "boolean" && query.isStale() !== stale) { - return false; - } - if (fetchStatus && fetchStatus !== query.state.fetchStatus) { - return false; - } - if (predicate && !predicate(query)) { - return false; - } - return true; -} -function matchMutation(filters, mutation) { - const { exact, status, predicate, mutationKey } = filters; - if (mutationKey) { - if (!mutation.options.mutationKey) { - return false; - } - if (exact) { - if (hashKey(mutation.options.mutationKey) !== hashKey(mutationKey)) { - return false; - } - } else if (!partialMatchKey(mutation.options.mutationKey, mutationKey)) { - return false; - } - } - if (status && mutation.state.status !== status) { - return false; - } - if (predicate && !predicate(mutation)) { - return false; - } - return true; -} -function hashQueryKeyByOptions(queryKey, options) { - const hashFn = options?.queryKeyHashFn || hashKey; - return hashFn(queryKey); -} -function hashKey(queryKey) { - return JSON.stringify( - queryKey, - (_, val) => isPlainObject(val) ? Object.keys(val).sort().reduce((result, key) => { - result[key] = val[key]; - return result; - }, {}) : val - ); -} -function partialMatchKey(a, b) { - if (a === b) { - return true; - } - if (typeof a !== typeof b) { - return false; - } - if (a && b && typeof a === "object" && typeof b === "object") { - return Object.keys(b).every((key) => partialMatchKey(a[key], b[key])); - } - return false; -} -var hasOwn = Object.prototype.hasOwnProperty; -function replaceEqualDeep(a, b, depth = 0) { - if (a === b) { - return a; - } - if (depth > 500) return b; - const array = isPlainArray(a) && isPlainArray(b); - if (!array && !(isPlainObject(a) && isPlainObject(b))) return b; - const aItems = array ? a : Object.keys(a); - const aSize = aItems.length; - const bItems = array ? b : Object.keys(b); - const bSize = bItems.length; - const copy = array ? new Array(bSize) : {}; - let equalItems = 0; - for (let i = 0; i < bSize; i++) { - const key = array ? i : bItems[i]; - const aItem = a[key]; - const bItem = b[key]; - if (aItem === bItem) { - copy[key] = aItem; - if (array ? i < aSize : hasOwn.call(a, key)) equalItems++; - continue; - } - if (aItem === null || bItem === null || typeof aItem !== "object" || typeof bItem !== "object") { - copy[key] = bItem; - continue; - } - const v = replaceEqualDeep(aItem, bItem, depth + 1); - copy[key] = v; - if (v === aItem) equalItems++; - } - return aSize === bSize && equalItems === aSize ? a : copy; -} -function shallowEqualObjects(a, b) { - if (!b || Object.keys(a).length !== Object.keys(b).length) { - return false; - } - for (const key in a) { - if (a[key] !== b[key]) { - return false; - } - } - return true; -} -function isPlainArray(value) { - return Array.isArray(value) && value.length === Object.keys(value).length; -} -function isPlainObject(o) { - if (!hasObjectPrototype(o)) { - return false; - } - const ctor = o.constructor; - if (ctor === void 0) { - return true; - } - const prot = ctor.prototype; - if (!hasObjectPrototype(prot)) { - return false; - } - if (!prot.hasOwnProperty("isPrototypeOf")) { - return false; - } - if (Object.getPrototypeOf(o) !== Object.prototype) { - return false; - } - return true; -} -function hasObjectPrototype(o) { - return Object.prototype.toString.call(o) === "[object Object]"; -} -function sleep(timeout) { - return new Promise((resolve) => { - import_timeoutManager.timeoutManager.setTimeout(resolve, timeout); - }); -} -function replaceData(prevData, data, options) { - if (typeof options.structuralSharing === "function") { - return options.structuralSharing(prevData, data); - } else if (options.structuralSharing !== false) { - if (process.env.NODE_ENV !== "production") { - try { - return replaceEqualDeep(prevData, data); - } catch (error) { - console.error( - `Structural sharing requires data to be JSON serializable. To fix this, turn off structuralSharing or return JSON-serializable data from your queryFn. [${options.queryHash}]: ${error}` - ); - throw error; - } - } - return replaceEqualDeep(prevData, data); - } - return data; -} -function keepPreviousData(previousData) { - return previousData; -} -function addToEnd(items, item, max = 0) { - const newItems = [...items, item]; - return max && newItems.length > max ? newItems.slice(1) : newItems; -} -function addToStart(items, item, max = 0) { - const newItems = [item, ...items]; - return max && newItems.length > max ? newItems.slice(0, -1) : newItems; -} -var skipToken = /* @__PURE__ */ Symbol(); -function ensureQueryFn(options, fetchOptions) { - if (process.env.NODE_ENV !== "production") { - if (options.queryFn === skipToken) { - console.error( - `Attempted to invoke queryFn when set to skipToken. This is likely a configuration error. Query hash: '${options.queryHash}'` - ); - } - } - if (!options.queryFn && fetchOptions?.initialPromise) { - return () => fetchOptions.initialPromise; - } - if (!options.queryFn || options.queryFn === skipToken) { - return () => Promise.reject(new Error(`Missing queryFn: '${options.queryHash}'`)); - } - return options.queryFn; -} -function shouldThrowError(throwOnError, params) { - if (typeof throwOnError === "function") { - return throwOnError(...params); - } - return !!throwOnError; -} -function addConsumeAwareSignal(object, getSignal, onCancelled) { - let consumed = false; - let signal; - Object.defineProperty(object, "signal", { - enumerable: true, - get: () => { - signal ??= getSignal(); - if (consumed) { - return signal; - } - consumed = true; - if (signal.aborted) { - onCancelled(); - } else { - signal.addEventListener("abort", onCancelled, { once: true }); - } - return signal; - } - }); - return object; -} -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - addConsumeAwareSignal, - addToEnd, - addToStart, - ensureQueryFn, - functionalUpdate, - hashKey, - hashQueryKeyByOptions, - isPlainArray, - isPlainObject, - isServer, - isValidTimeout, - keepPreviousData, - matchMutation, - matchQuery, - noop, - partialMatchKey, - replaceData, - replaceEqualDeep, - resolveEnabled, - resolveStaleTime, - shallowEqualObjects, - shouldThrowError, - skipToken, - sleep, - timeUntilStale -}); -//# sourceMappingURL=utils.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/utils.cjs.map b/node_modules/@tanstack/query-core/build/modern/utils.cjs.map deleted file mode 100644 index 3be5114..0000000 --- a/node_modules/@tanstack/query-core/build/modern/utils.cjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/utils.ts"],"sourcesContent":["import { timeoutManager } from './timeoutManager'\nimport type {\n DefaultError,\n Enabled,\n FetchStatus,\n MutationKey,\n MutationStatus,\n QueryFunction,\n QueryKey,\n QueryOptions,\n StaleTime,\n StaleTimeFunction,\n} from './types'\nimport type { Mutation } from './mutation'\nimport type { FetchOptions, Query } from './query'\n\n// TYPES\n\ntype DropLast> = T extends readonly [\n ...infer R,\n unknown,\n]\n ? readonly [...R]\n : never\n\ntype TuplePrefixes> = T extends readonly []\n ? readonly []\n : TuplePrefixes> | T\n\nexport interface QueryFilters {\n /**\n * Filter to active queries, inactive queries or all queries\n */\n type?: QueryTypeFilter\n /**\n * Match query key exactly\n */\n exact?: boolean\n /**\n * Include queries matching this predicate function\n */\n predicate?: (query: Query) => boolean\n /**\n * Include queries matching this query key\n */\n queryKey?: TQueryKey | TuplePrefixes\n /**\n * Include or exclude stale queries\n */\n stale?: boolean\n /**\n * Include queries matching their fetchStatus\n */\n fetchStatus?: FetchStatus\n}\n\nexport interface MutationFilters<\n TData = unknown,\n TError = DefaultError,\n TVariables = unknown,\n TOnMutateResult = unknown,\n> {\n /**\n * Match mutation key exactly\n */\n exact?: boolean\n /**\n * Include mutations matching this predicate function\n */\n predicate?: (\n mutation: Mutation,\n ) => boolean\n /**\n * Include mutations matching this mutation key\n */\n mutationKey?: TuplePrefixes\n /**\n * Filter by mutation status\n */\n status?: MutationStatus\n}\n\nexport type Updater = TOutput | ((input: TInput) => TOutput)\n\nexport type QueryTypeFilter = 'all' | 'active' | 'inactive'\n\n// UTILS\n\nexport const isServer = typeof window === 'undefined' || 'Deno' in globalThis\n\nexport function noop(): void\nexport function noop(): undefined\nexport function noop() {}\n\nexport function functionalUpdate(\n updater: Updater,\n input: TInput,\n): TOutput {\n return typeof updater === 'function'\n ? (updater as (_: TInput) => TOutput)(input)\n : updater\n}\n\nexport function isValidTimeout(value: unknown): value is number {\n return typeof value === 'number' && value >= 0 && value !== Infinity\n}\n\nexport function timeUntilStale(updatedAt: number, staleTime?: number): number {\n return Math.max(updatedAt + (staleTime || 0) - Date.now(), 0)\n}\n\nexport function resolveStaleTime<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n staleTime:\n | undefined\n | StaleTimeFunction,\n query: Query,\n): StaleTime | undefined {\n return typeof staleTime === 'function' ? staleTime(query) : staleTime\n}\n\nexport function resolveEnabled<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n enabled: undefined | Enabled,\n query: Query,\n): boolean | undefined {\n return typeof enabled === 'function' ? enabled(query) : enabled\n}\n\nexport function matchQuery(\n filters: QueryFilters,\n query: Query,\n): boolean {\n const {\n type = 'all',\n exact,\n fetchStatus,\n predicate,\n queryKey,\n stale,\n } = filters\n\n if (queryKey) {\n if (exact) {\n if (query.queryHash !== hashQueryKeyByOptions(queryKey, query.options)) {\n return false\n }\n } else if (!partialMatchKey(query.queryKey, queryKey)) {\n return false\n }\n }\n\n if (type !== 'all') {\n const isActive = query.isActive()\n if (type === 'active' && !isActive) {\n return false\n }\n if (type === 'inactive' && isActive) {\n return false\n }\n }\n\n if (typeof stale === 'boolean' && query.isStale() !== stale) {\n return false\n }\n\n if (fetchStatus && fetchStatus !== query.state.fetchStatus) {\n return false\n }\n\n if (predicate && !predicate(query)) {\n return false\n }\n\n return true\n}\n\nexport function matchMutation(\n filters: MutationFilters,\n mutation: Mutation,\n): boolean {\n const { exact, status, predicate, mutationKey } = filters\n if (mutationKey) {\n if (!mutation.options.mutationKey) {\n return false\n }\n if (exact) {\n if (hashKey(mutation.options.mutationKey) !== hashKey(mutationKey)) {\n return false\n }\n } else if (!partialMatchKey(mutation.options.mutationKey, mutationKey)) {\n return false\n }\n }\n\n if (status && mutation.state.status !== status) {\n return false\n }\n\n if (predicate && !predicate(mutation)) {\n return false\n }\n\n return true\n}\n\nexport function hashQueryKeyByOptions(\n queryKey: TQueryKey,\n options?: Pick, 'queryKeyHashFn'>,\n): string {\n const hashFn = options?.queryKeyHashFn || hashKey\n return hashFn(queryKey)\n}\n\n/**\n * Default query & mutation keys hash function.\n * Hashes the value into a stable hash.\n */\nexport function hashKey(queryKey: QueryKey | MutationKey): string {\n return JSON.stringify(queryKey, (_, val) =>\n isPlainObject(val)\n ? Object.keys(val)\n .sort()\n .reduce((result, key) => {\n result[key] = val[key]\n return result\n }, {} as any)\n : val,\n )\n}\n\n/**\n * Checks if key `b` partially matches with key `a`.\n */\nexport function partialMatchKey(a: QueryKey, b: QueryKey): boolean\nexport function partialMatchKey(a: any, b: any): boolean {\n if (a === b) {\n return true\n }\n\n if (typeof a !== typeof b) {\n return false\n }\n\n if (a && b && typeof a === 'object' && typeof b === 'object') {\n return Object.keys(b).every((key) => partialMatchKey(a[key], b[key]))\n }\n\n return false\n}\n\nconst hasOwn = Object.prototype.hasOwnProperty\n\n/**\n * This function returns `a` if `b` is deeply equal.\n * If not, it will replace any deeply equal children of `b` with those of `a`.\n * This can be used for structural sharing between JSON values for example.\n */\nexport function replaceEqualDeep(a: unknown, b: T, depth?: number): T\nexport function replaceEqualDeep(a: any, b: any, depth = 0): any {\n if (a === b) {\n return a\n }\n\n if (depth > 500) return b\n\n const array = isPlainArray(a) && isPlainArray(b)\n\n if (!array && !(isPlainObject(a) && isPlainObject(b))) return b\n\n const aItems = array ? a : Object.keys(a)\n const aSize = aItems.length\n const bItems = array ? b : Object.keys(b)\n const bSize = bItems.length\n const copy: any = array ? new Array(bSize) : {}\n\n let equalItems = 0\n\n for (let i = 0; i < bSize; i++) {\n const key: any = array ? i : bItems[i]\n const aItem = a[key]\n const bItem = b[key]\n\n if (aItem === bItem) {\n copy[key] = aItem\n if (array ? i < aSize : hasOwn.call(a, key)) equalItems++\n continue\n }\n\n if (\n aItem === null ||\n bItem === null ||\n typeof aItem !== 'object' ||\n typeof bItem !== 'object'\n ) {\n copy[key] = bItem\n continue\n }\n\n const v = replaceEqualDeep(aItem, bItem, depth + 1)\n copy[key] = v\n if (v === aItem) equalItems++\n }\n\n return aSize === bSize && equalItems === aSize ? a : copy\n}\n\n/**\n * Shallow compare objects.\n */\nexport function shallowEqualObjects>(\n a: T,\n b: T | undefined,\n): boolean {\n if (!b || Object.keys(a).length !== Object.keys(b).length) {\n return false\n }\n\n for (const key in a) {\n if (a[key] !== b[key]) {\n return false\n }\n }\n\n return true\n}\n\nexport function isPlainArray(value: unknown): value is Array {\n return Array.isArray(value) && value.length === Object.keys(value).length\n}\n\n// Copied from: https://github.com/jonschlinkert/is-plain-object\nexport function isPlainObject(o: any): o is Record {\n if (!hasObjectPrototype(o)) {\n return false\n }\n\n // If has no constructor\n const ctor = o.constructor\n if (ctor === undefined) {\n return true\n }\n\n // If has modified prototype\n const prot = ctor.prototype\n if (!hasObjectPrototype(prot)) {\n return false\n }\n\n // If constructor does not have an Object-specific method\n if (!prot.hasOwnProperty('isPrototypeOf')) {\n return false\n }\n\n // Handles Objects created by Object.create()\n if (Object.getPrototypeOf(o) !== Object.prototype) {\n return false\n }\n\n // Most likely a plain Object\n return true\n}\n\nfunction hasObjectPrototype(o: any): boolean {\n return Object.prototype.toString.call(o) === '[object Object]'\n}\n\nexport function sleep(timeout: number): Promise {\n return new Promise((resolve) => {\n timeoutManager.setTimeout(resolve, timeout)\n })\n}\n\nexport function replaceData<\n TData,\n TOptions extends QueryOptions,\n>(prevData: TData | undefined, data: TData, options: TOptions): TData {\n if (typeof options.structuralSharing === 'function') {\n return options.structuralSharing(prevData, data) as TData\n } else if (options.structuralSharing !== false) {\n if (process.env.NODE_ENV !== 'production') {\n try {\n return replaceEqualDeep(prevData, data)\n } catch (error) {\n console.error(\n `Structural sharing requires data to be JSON serializable. To fix this, turn off structuralSharing or return JSON-serializable data from your queryFn. [${options.queryHash}]: ${error}`,\n )\n\n // Prevent the replaceEqualDeep from being called again down below.\n throw error\n }\n }\n // Structurally share data between prev and new data if needed\n return replaceEqualDeep(prevData, data)\n }\n return data\n}\n\nexport function keepPreviousData(\n previousData: T | undefined,\n): T | undefined {\n return previousData\n}\n\nexport function addToEnd(items: Array, item: T, max = 0): Array {\n const newItems = [...items, item]\n return max && newItems.length > max ? newItems.slice(1) : newItems\n}\n\nexport function addToStart(items: Array, item: T, max = 0): Array {\n const newItems = [item, ...items]\n return max && newItems.length > max ? newItems.slice(0, -1) : newItems\n}\n\nexport const skipToken = Symbol()\nexport type SkipToken = typeof skipToken\n\nexport function ensureQueryFn<\n TQueryFnData = unknown,\n TQueryKey extends QueryKey = QueryKey,\n>(\n options: {\n queryFn?: QueryFunction | SkipToken\n queryHash?: string\n },\n fetchOptions?: FetchOptions,\n): QueryFunction {\n if (process.env.NODE_ENV !== 'production') {\n if (options.queryFn === skipToken) {\n console.error(\n `Attempted to invoke queryFn when set to skipToken. This is likely a configuration error. Query hash: '${options.queryHash}'`,\n )\n }\n }\n\n // if we attempt to retry a fetch that was triggered from an initialPromise\n // when we don't have a queryFn yet, we can't retry, so we just return the already rejected initialPromise\n // if an observer has already mounted, we will be able to retry with that queryFn\n if (!options.queryFn && fetchOptions?.initialPromise) {\n return () => fetchOptions.initialPromise!\n }\n\n if (!options.queryFn || options.queryFn === skipToken) {\n return () =>\n Promise.reject(new Error(`Missing queryFn: '${options.queryHash}'`))\n }\n\n return options.queryFn\n}\n\nexport function shouldThrowError) => boolean>(\n throwOnError: boolean | T | undefined,\n params: Parameters,\n): boolean {\n // Allow throwOnError function to override throwing behavior on a per-error basis\n if (typeof throwOnError === 'function') {\n return throwOnError(...params)\n }\n\n return !!throwOnError\n}\n\nexport function addConsumeAwareSignal(\n object: T,\n getSignal: () => AbortSignal,\n onCancelled: VoidFunction,\n): T & { signal: AbortSignal } {\n let consumed = false\n let signal: AbortSignal | undefined\n\n Object.defineProperty(object, 'signal', {\n enumerable: true,\n get: () => {\n signal ??= getSignal()\n if (consumed) {\n return signal\n }\n\n consumed = true\n if (signal.aborted) {\n onCancelled()\n } else {\n signal.addEventListener('abort', onCancelled, { once: true })\n }\n\n return signal\n },\n })\n\n return object as T & { signal: AbortSignal }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,4BAA+B;AAwFxB,IAAM,WAAW,OAAO,WAAW,eAAe,UAAU;AAI5D,SAAS,OAAO;AAAC;AAEjB,SAAS,iBACd,SACA,OACS;AACT,SAAO,OAAO,YAAY,aACrB,QAAmC,KAAK,IACzC;AACN;AAEO,SAAS,eAAe,OAAiC;AAC9D,SAAO,OAAO,UAAU,YAAY,SAAS,KAAK,UAAU;AAC9D;AAEO,SAAS,eAAe,WAAmB,WAA4B;AAC5E,SAAO,KAAK,IAAI,aAAa,aA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AI;AAChE;AAEO,IAAM,YAAY,uBAAO;AAGzB,SAAS,cAId,SAIA,cACwC;AACxC,MAAI,QAAQ,IAAI,aAAa,cAAc;AACzC,QAAI,QAAQ,YAAY,WAAW;AACjC,cAAQ;AAAA,QACN,yGAAyG,QAAQ,SAAS;AAAA,MAC5H;AAAA,IACF;AAAA,EACF;AAKA,MAAI,CAAC,QAAQ,WAAW,cAAc,gBAAgB;AACpD,WAAO,MAAM,aAAa;AAAA,EAC5B;AAEA,MAAI,CAAC,QAAQ,WAAW,QAAQ,YAAY,WAAW;AACrD,WAAO,MACL,QAAQ,OAAO,IAAI,MAAM,qBAAqB,QAAQ,SAAS,GAAG,CAAC;AAAA,EACvE;AAEA,SAAO,QAAQ;AACjB;AAEO,SAAS,iBACd,cACA,QACS;AAET,MAAI,OAAO,iBAAiB,YAAY;AACtC,WAAO,aAAa,GAAG,MAAM;AAAA,EAC/B;AAEA,SAAO,CAAC,CAAC;AACX;AAEO,SAAS,sBACd,QACA,WACA,aAC6B;AAC7B,MAAI,WAAW;AACf,MAAI;AAEJ,SAAO,eAAe,QAAQ,UAAU;AAAA,IACtC,YAAY;AAAA,IACZ,KAAK,MAAM;AACT,iBAAW,UAAU;AACrB,UAAI,UAAU;AACZ,eAAO;AAAA,MACT;AAEA,iBAAW;AACX,UAAI,OAAO,SAAS;AAClB,oBAAY;AAAA,MACd,OAAO;AACL,eAAO,iBAAiB,SAAS,aAAa,EAAE,MAAM,KAAK,CAAC;AAAA,MAC9D;AAEA,aAAO;AAAA,IACT;AAAA,EACF,CAAC;AAED,SAAO;AACT;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/utils.d.cts b/node_modules/@tanstack/query-core/build/modern/utils.d.cts deleted file mode 100644 index 502420e..0000000 --- a/node_modules/@tanstack/query-core/build/modern/utils.d.cts +++ /dev/null @@ -1,3 +0,0 @@ -export { u as MutationFilters, v as QueryFilters, bl as QueryTypeFilter, S as SkipToken, U as Updater, bA as addConsumeAwareSignal, bx as addToEnd, by as addToStart, bz as ensureQueryFn, bm as functionalUpdate, k as hashKey, br as hashQueryKeyByOptions, bt as isPlainArray, bu as isPlainObject, l as isServer, bn as isValidTimeout, m as keepPreviousData, n as matchMutation, o as matchQuery, p as noop, q as partialMatchKey, bw as replaceData, r as replaceEqualDeep, bq as resolveEnabled, bp as resolveStaleTime, bs as shallowEqualObjects, s as shouldThrowError, t as skipToken, bv as sleep, bo as timeUntilStale } from './hydration-uphG6M-i.cjs'; -import './removable.cjs'; -import './subscribable.cjs'; diff --git a/node_modules/@tanstack/query-core/build/modern/utils.d.ts b/node_modules/@tanstack/query-core/build/modern/utils.d.ts deleted file mode 100644 index 77dcd04..0000000 --- a/node_modules/@tanstack/query-core/build/modern/utils.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export { u as MutationFilters, v as QueryFilters, bl as QueryTypeFilter, S as SkipToken, U as Updater, bA as addConsumeAwareSignal, bx as addToEnd, by as addToStart, bz as ensureQueryFn, bm as functionalUpdate, k as hashKey, br as hashQueryKeyByOptions, bt as isPlainArray, bu as isPlainObject, l as isServer, bn as isValidTimeout, m as keepPreviousData, n as matchMutation, o as matchQuery, p as noop, q as partialMatchKey, bw as replaceData, r as replaceEqualDeep, bq as resolveEnabled, bp as resolveStaleTime, bs as shallowEqualObjects, s as shouldThrowError, t as skipToken, bv as sleep, bo as timeUntilStale } from './hydration-BlEVG2Lp.js'; -import './removable.js'; -import './subscribable.js'; diff --git a/node_modules/@tanstack/query-core/build/modern/utils.js b/node_modules/@tanstack/query-core/build/modern/utils.js deleted file mode 100644 index 8a91036..0000000 --- a/node_modules/@tanstack/query-core/build/modern/utils.js +++ /dev/null @@ -1,281 +0,0 @@ -// src/utils.ts -import { timeoutManager } from "./timeoutManager.js"; -var isServer = typeof window === "undefined" || "Deno" in globalThis; -function noop() { -} -function functionalUpdate(updater, input) { - return typeof updater === "function" ? updater(input) : updater; -} -function isValidTimeout(value) { - return typeof value === "number" && value >= 0 && value !== Infinity; -} -function timeUntilStale(updatedAt, staleTime) { - return Math.max(updatedAt + (staleTime || 0) - Date.now(), 0); -} -function resolveStaleTime(staleTime, query) { - return typeof staleTime === "function" ? staleTime(query) : staleTime; -} -function resolveEnabled(enabled, query) { - return typeof enabled === "function" ? enabled(query) : enabled; -} -function matchQuery(filters, query) { - const { - type = "all", - exact, - fetchStatus, - predicate, - queryKey, - stale - } = filters; - if (queryKey) { - if (exact) { - if (query.queryHash !== hashQueryKeyByOptions(queryKey, query.options)) { - return false; - } - } else if (!partialMatchKey(query.queryKey, queryKey)) { - return false; - } - } - if (type !== "all") { - const isActive = query.isActive(); - if (type === "active" && !isActive) { - return false; - } - if (type === "inactive" && isActive) { - return false; - } - } - if (typeof stale === "boolean" && query.isStale() !== stale) { - return false; - } - if (fetchStatus && fetchStatus !== query.state.fetchStatus) { - return false; - } - if (predicate && !predicate(query)) { - return false; - } - return true; -} -function matchMutation(filters, mutation) { - const { exact, status, predicate, mutationKey } = filters; - if (mutationKey) { - if (!mutation.options.mutationKey) { - return false; - } - if (exact) { - if (hashKey(mutation.options.mutationKey) !== hashKey(mutationKey)) { - return false; - } - } else if (!partialMatchKey(mutation.options.mutationKey, mutationKey)) { - return false; - } - } - if (status && mutation.state.status !== status) { - return false; - } - if (predicate && !predicate(mutation)) { - return false; - } - return true; -} -function hashQueryKeyByOptions(queryKey, options) { - const hashFn = options?.queryKeyHashFn || hashKey; - return hashFn(queryKey); -} -function hashKey(queryKey) { - return JSON.stringify( - queryKey, - (_, val) => isPlainObject(val) ? Object.keys(val).sort().reduce((result, key) => { - result[key] = val[key]; - return result; - }, {}) : val - ); -} -function partialMatchKey(a, b) { - if (a === b) { - return true; - } - if (typeof a !== typeof b) { - return false; - } - if (a && b && typeof a === "object" && typeof b === "object") { - return Object.keys(b).every((key) => partialMatchKey(a[key], b[key])); - } - return false; -} -var hasOwn = Object.prototype.hasOwnProperty; -function replaceEqualDeep(a, b, depth = 0) { - if (a === b) { - return a; - } - if (depth > 500) return b; - const array = isPlainArray(a) && isPlainArray(b); - if (!array && !(isPlainObject(a) && isPlainObject(b))) return b; - const aItems = array ? a : Object.keys(a); - const aSize = aItems.length; - const bItems = array ? b : Object.keys(b); - const bSize = bItems.length; - const copy = array ? new Array(bSize) : {}; - let equalItems = 0; - for (let i = 0; i < bSize; i++) { - const key = array ? i : bItems[i]; - const aItem = a[key]; - const bItem = b[key]; - if (aItem === bItem) { - copy[key] = aItem; - if (array ? i < aSize : hasOwn.call(a, key)) equalItems++; - continue; - } - if (aItem === null || bItem === null || typeof aItem !== "object" || typeof bItem !== "object") { - copy[key] = bItem; - continue; - } - const v = replaceEqualDeep(aItem, bItem, depth + 1); - copy[key] = v; - if (v === aItem) equalItems++; - } - return aSize === bSize && equalItems === aSize ? a : copy; -} -function shallowEqualObjects(a, b) { - if (!b || Object.keys(a).length !== Object.keys(b).length) { - return false; - } - for (const key in a) { - if (a[key] !== b[key]) { - return false; - } - } - return true; -} -function isPlainArray(value) { - return Array.isArray(value) && value.length === Object.keys(value).length; -} -function isPlainObject(o) { - if (!hasObjectPrototype(o)) { - return false; - } - const ctor = o.constructor; - if (ctor === void 0) { - return true; - } - const prot = ctor.prototype; - if (!hasObjectPrototype(prot)) { - return false; - } - if (!prot.hasOwnProperty("isPrototypeOf")) { - return false; - } - if (Object.getPrototypeOf(o) !== Object.prototype) { - return false; - } - return true; -} -function hasObjectPrototype(o) { - return Object.prototype.toString.call(o) === "[object Object]"; -} -function sleep(timeout) { - return new Promise((resolve) => { - timeoutManager.setTimeout(resolve, timeout); - }); -} -function replaceData(prevData, data, options) { - if (typeof options.structuralSharing === "function") { - return options.structuralSharing(prevData, data); - } else if (options.structuralSharing !== false) { - if (process.env.NODE_ENV !== "production") { - try { - return replaceEqualDeep(prevData, data); - } catch (error) { - console.error( - `Structural sharing requires data to be JSON serializable. To fix this, turn off structuralSharing or return JSON-serializable data from your queryFn. [${options.queryHash}]: ${error}` - ); - throw error; - } - } - return replaceEqualDeep(prevData, data); - } - return data; -} -function keepPreviousData(previousData) { - return previousData; -} -function addToEnd(items, item, max = 0) { - const newItems = [...items, item]; - return max && newItems.length > max ? newItems.slice(1) : newItems; -} -function addToStart(items, item, max = 0) { - const newItems = [item, ...items]; - return max && newItems.length > max ? newItems.slice(0, -1) : newItems; -} -var skipToken = /* @__PURE__ */ Symbol(); -function ensureQueryFn(options, fetchOptions) { - if (process.env.NODE_ENV !== "production") { - if (options.queryFn === skipToken) { - console.error( - `Attempted to invoke queryFn when set to skipToken. This is likely a configuration error. Query hash: '${options.queryHash}'` - ); - } - } - if (!options.queryFn && fetchOptions?.initialPromise) { - return () => fetchOptions.initialPromise; - } - if (!options.queryFn || options.queryFn === skipToken) { - return () => Promise.reject(new Error(`Missing queryFn: '${options.queryHash}'`)); - } - return options.queryFn; -} -function shouldThrowError(throwOnError, params) { - if (typeof throwOnError === "function") { - return throwOnError(...params); - } - return !!throwOnError; -} -function addConsumeAwareSignal(object, getSignal, onCancelled) { - let consumed = false; - let signal; - Object.defineProperty(object, "signal", { - enumerable: true, - get: () => { - signal ??= getSignal(); - if (consumed) { - return signal; - } - consumed = true; - if (signal.aborted) { - onCancelled(); - } else { - signal.addEventListener("abort", onCancelled, { once: true }); - } - return signal; - } - }); - return object; -} -export { - addConsumeAwareSignal, - addToEnd, - addToStart, - ensureQueryFn, - functionalUpdate, - hashKey, - hashQueryKeyByOptions, - isPlainArray, - isPlainObject, - isServer, - isValidTimeout, - keepPreviousData, - matchMutation, - matchQuery, - noop, - partialMatchKey, - replaceData, - replaceEqualDeep, - resolveEnabled, - resolveStaleTime, - shallowEqualObjects, - shouldThrowError, - skipToken, - sleep, - timeUntilStale -}; -//# sourceMappingURL=utils.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/build/modern/utils.js.map b/node_modules/@tanstack/query-core/build/modern/utils.js.map deleted file mode 100644 index a2aa3f5..0000000 --- a/node_modules/@tanstack/query-core/build/modern/utils.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/utils.ts"],"sourcesContent":["import { timeoutManager } from './timeoutManager'\nimport type {\n DefaultError,\n Enabled,\n FetchStatus,\n MutationKey,\n MutationStatus,\n QueryFunction,\n QueryKey,\n QueryOptions,\n StaleTime,\n StaleTimeFunction,\n} from './types'\nimport type { Mutation } from './mutation'\nimport type { FetchOptions, Query } from './query'\n\n// TYPES\n\ntype DropLast> = T extends readonly [\n ...infer R,\n unknown,\n]\n ? readonly [...R]\n : never\n\ntype TuplePrefixes> = T extends readonly []\n ? readonly []\n : TuplePrefixes> | T\n\nexport interface QueryFilters {\n /**\n * Filter to active queries, inactive queries or all queries\n */\n type?: QueryTypeFilter\n /**\n * Match query key exactly\n */\n exact?: boolean\n /**\n * Include queries matching this predicate function\n */\n predicate?: (query: Query) => boolean\n /**\n * Include queries matching this query key\n */\n queryKey?: TQueryKey | TuplePrefixes\n /**\n * Include or exclude stale queries\n */\n stale?: boolean\n /**\n * Include queries matching their fetchStatus\n */\n fetchStatus?: FetchStatus\n}\n\nexport interface MutationFilters<\n TData = unknown,\n TError = DefaultError,\n TVariables = unknown,\n TOnMutateResult = unknown,\n> {\n /**\n * Match mutation key exactly\n */\n exact?: boolean\n /**\n * Include mutations matching this predicate function\n */\n predicate?: (\n mutation: Mutation,\n ) => boolean\n /**\n * Include mutations matching this mutation key\n */\n mutationKey?: TuplePrefixes\n /**\n * Filter by mutation status\n */\n status?: MutationStatus\n}\n\nexport type Updater = TOutput | ((input: TInput) => TOutput)\n\nexport type QueryTypeFilter = 'all' | 'active' | 'inactive'\n\n// UTILS\n\nexport const isServer = typeof window === 'undefined' || 'Deno' in globalThis\n\nexport function noop(): void\nexport function noop(): undefined\nexport function noop() {}\n\nexport function functionalUpdate(\n updater: Updater,\n input: TInput,\n): TOutput {\n return typeof updater === 'function'\n ? (updater as (_: TInput) => TOutput)(input)\n : updater\n}\n\nexport function isValidTimeout(value: unknown): value is number {\n return typeof value === 'number' && value >= 0 && value !== Infinity\n}\n\nexport function timeUntilStale(updatedAt: number, staleTime?: number): number {\n return Math.max(updatedAt + (staleTime || 0) - Date.now(), 0)\n}\n\nexport function resolveStaleTime<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n staleTime:\n | undefined\n | StaleTimeFunction,\n query: Query,\n): StaleTime | undefined {\n return typeof staleTime === 'function' ? staleTime(query) : staleTime\n}\n\nexport function resolveEnabled<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n enabled: undefined | Enabled,\n query: Query,\n): boolean | undefined {\n return typeof enabled === 'function' ? enabled(query) : enabled\n}\n\nexport function matchQuery(\n filters: QueryFilters,\n query: Query,\n): boolean {\n const {\n type = 'all',\n exact,\n fetchStatus,\n predicate,\n queryKey,\n stale,\n } = filters\n\n if (queryKey) {\n if (exact) {\n if (query.queryHash !== hashQueryKeyByOptions(queryKey, query.options)) {\n return false\n }\n } else if (!partialMatchKey(query.queryKey, queryKey)) {\n return false\n }\n }\n\n if (type !== 'all') {\n const isActive = query.isActive()\n if (type === 'active' && !isActive) {\n return false\n }\n if (type === 'inactive' && isActive) {\n return false\n }\n }\n\n if (typeof stale === 'boolean' && query.isStale() !== stale) {\n return false\n }\n\n if (fetchStatus && fetchStatus !== query.state.fetchStatus) {\n return false\n }\n\n if (predicate && !predicate(query)) {\n return false\n }\n\n return true\n}\n\nexport function matchMutation(\n filters: MutationFilters,\n mutation: Mutation,\n): boolean {\n const { exact, status, predicate, mutationKey } = filters\n if (mutationKey) {\n if (!mutation.options.mutationKey) {\n return false\n }\n if (exact) {\n if (hashKey(mutation.options.mutationKey) !== hashKey(mutationKey)) {\n return false\n }\n } else if (!partialMatchKey(mutation.options.mutationKey, mutationKey)) {\n return false\n }\n }\n\n if (status && mutation.state.status !== status) {\n return false\n }\n\n if (predicate && !predicate(mutation)) {\n return false\n }\n\n return true\n}\n\nexport function hashQueryKeyByOptions(\n queryKey: TQueryKey,\n options?: Pick, 'queryKeyHashFn'>,\n): string {\n const hashFn = options?.queryKeyHashFn || hashKey\n return hashFn(queryKey)\n}\n\n/**\n * Default query & mutation keys hash function.\n * Hashes the value into a stable hash.\n */\nexport function hashKey(queryKey: QueryKey | MutationKey): string {\n return JSON.stringify(queryKey, (_, val) =>\n isPlainObject(val)\n ? Object.keys(val)\n .sort()\n .reduce((result, key) => {\n result[key] = val[key]\n return result\n }, {} as any)\n : val,\n )\n}\n\n/**\n * Checks if key `b` partially matches with key `a`.\n */\nexport function partialMatchKey(a: QueryKey, b: QueryKey): boolean\nexport function partialMatchKey(a: any, b: any): boolean {\n if (a === b) {\n return true\n }\n\n if (typeof a !== typeof b) {\n return false\n }\n\n if (a && b && typeof a === 'object' && typeof b === 'object') {\n return Object.keys(b).every((key) => partialMatchKey(a[key], b[key]))\n }\n\n return false\n}\n\nconst hasOwn = Object.prototype.hasOwnProperty\n\n/**\n * This function returns `a` if `b` is deeply equal.\n * If not, it will replace any deeply equal children of `b` with those of `a`.\n * This can be used for structural sharing between JSON values for example.\n */\nexport function replaceEqualDeep(a: unknown, b: T, depth?: number): T\nexport function replaceEqualDeep(a: any, b: any, depth = 0): any {\n if (a === b) {\n return a\n }\n\n if (depth > 500) return b\n\n const array = isPlainArray(a) && isPlainArray(b)\n\n if (!array && !(isPlainObject(a) && isPlainObject(b))) return b\n\n const aItems = array ? a : Object.keys(a)\n const aSize = aItems.length\n const bItems = array ? b : Object.keys(b)\n const bSize = bItems.length\n const copy: any = array ? new Array(bSize) : {}\n\n let equalItems = 0\n\n for (let i = 0; i < bSize; i++) {\n const key: any = array ? i : bItems[i]\n const aItem = a[key]\n const bItem = b[key]\n\n if (aItem === bItem) {\n copy[key] = aItem\n if (array ? i < aSize : hasOwn.call(a, key)) equalItems++\n continue\n }\n\n if (\n aItem === null ||\n bItem === null ||\n typeof aItem !== 'object' ||\n typeof bItem !== 'object'\n ) {\n copy[key] = bItem\n continue\n }\n\n const v = replaceEqualDeep(aItem, bItem, depth + 1)\n copy[key] = v\n if (v === aItem) equalItems++\n }\n\n return aSize === bSize && equalItems === aSize ? a : copy\n}\n\n/**\n * Shallow compare objects.\n */\nexport function shallowEqualObjects>(\n a: T,\n b: T | undefined,\n): boolean {\n if (!b || Object.keys(a).length !== Object.keys(b).length) {\n return false\n }\n\n for (const key in a) {\n if (a[key] !== b[key]) {\n return false\n }\n }\n\n return true\n}\n\nexport function isPlainArray(value: unknown): value is Array {\n return Array.isArray(value) && value.length === Object.keys(value).length\n}\n\n// Copied from: https://github.com/jonschlinkert/is-plain-object\nexport function isPlainObject(o: any): o is Record {\n if (!hasObjectPrototype(o)) {\n return false\n }\n\n // If has no constructor\n const ctor = o.constructor\n if (ctor === undefined) {\n return true\n }\n\n // If has modified prototype\n const prot = ctor.prototype\n if (!hasObjectPrototype(prot)) {\n return false\n }\n\n // If constructor does not have an Object-specific method\n if (!prot.hasOwnProperty('isPrototypeOf')) {\n return false\n }\n\n // Handles Objects created by Object.create()\n if (Object.getPrototypeOf(o) !== Object.prototype) {\n return false\n }\n\n // Most likely a plain Object\n return true\n}\n\nfunction hasObjectPrototype(o: any): boolean {\n return Object.prototype.toString.call(o) === '[object Object]'\n}\n\nexport function sleep(timeout: number): Promise {\n return new Promise((resolve) => {\n timeoutManager.setTimeout(resolve, timeout)\n })\n}\n\nexport function replaceData<\n TData,\n TOptions extends QueryOptions,\n>(prevData: TData | undefined, data: TData, options: TOptions): TData {\n if (typeof options.structuralSharing === 'function') {\n return options.structuralSharing(prevData, data) as TData\n } else if (options.structuralSharing !== false) {\n if (process.env.NODE_ENV !== 'production') {\n try {\n return replaceEqualDeep(prevData, data)\n } catch (error) {\n console.error(\n `Structural sharing requires data to be JSON serializable. To fix this, turn off structuralSharing or return JSON-serializable data from your queryFn. [${options.queryHash}]: ${error}`,\n )\n\n // Prevent the replaceEqualDeep from being called again down below.\n throw error\n }\n }\n // Structurally share data between prev and new data if needed\n return replaceEqualDeep(prevData, data)\n }\n return data\n}\n\nexport function keepPreviousData(\n previousData: T | undefined,\n): T | undefined {\n return previousData\n}\n\nexport function addToEnd(items: Array, item: T, max = 0): Array {\n const newItems = [...items, item]\n return max && newItems.length > max ? newItems.slice(1) : newItems\n}\n\nexport function addToStart(items: Array, item: T, max = 0): Array {\n const newItems = [item, ...items]\n return max && newItems.length > max ? newItems.slice(0, -1) : newItems\n}\n\nexport const skipToken = Symbol()\nexport type SkipToken = typeof skipToken\n\nexport function ensureQueryFn<\n TQueryFnData = unknown,\n TQueryKey extends QueryKey = QueryKey,\n>(\n options: {\n queryFn?: QueryFunction | SkipToken\n queryHash?: string\n },\n fetchOptions?: FetchOptions,\n): QueryFunction {\n if (process.env.NODE_ENV !== 'production') {\n if (options.queryFn === skipToken) {\n console.error(\n `Attempted to invoke queryFn when set to skipToken. This is likely a configuration error. Query hash: '${options.queryHash}'`,\n )\n }\n }\n\n // if we attempt to retry a fetch that was triggered from an initialPromise\n // when we don't have a queryFn yet, we can't retry, so we just return the already rejected initialPromise\n // if an observer has already mounted, we will be able to retry with that queryFn\n if (!options.queryFn && fetchOptions?.initialPromise) {\n return () => fetchOptions.initialPromise!\n }\n\n if (!options.queryFn || options.queryFn === skipToken) {\n return () =>\n Promise.reject(new Error(`Missing queryFn: '${options.queryHash}'`))\n }\n\n return options.queryFn\n}\n\nexport function shouldThrowError) => boolean>(\n throwOnError: boolean | T | undefined,\n params: Parameters,\n): boolean {\n // Allow throwOnError function to override throwing behavior on a per-error basis\n if (typeof throwOnError === 'function') {\n return throwOnError(...params)\n }\n\n return !!throwOnError\n}\n\nexport function addConsumeAwareSignal(\n object: T,\n getSignal: () => AbortSignal,\n onCancelled: VoidFunction,\n): T & { signal: AbortSignal } {\n let consumed = false\n let signal: AbortSignal | undefined\n\n Object.defineProperty(object, 'signal', {\n enumerable: true,\n get: () => {\n signal ??= getSignal()\n if (consumed) {\n return signal\n }\n\n consumed = true\n if (signal.aborted) {\n onCancelled()\n } else {\n signal.addEventListener('abort', onCancelled, { once: true })\n }\n\n return signal\n },\n })\n\n return object as T & { signal: AbortSignal }\n}\n"],"mappings":";AAAA,SAAS,sBAAsB;AAwFxB,IAAM,WAAW,OAAO,WAAW,eAAe,UAAU;AAI5D,SAAS,OAAO;AAAC;AAEjB,SAAS,iBACd,SACA,OACS;AACT,SAAO,OAAO,YAAY,aACrB,QAAmC,KAAK,IACzC;AACN;AAEO,SAAS,eAAe,OAAiC;AAC9D,SAAO,OAAO,UAAU,YAAY,SAAS,KAAK,UAAU;AAC9D;AAEO,SAAS,eAAe,WAAmB,WAA4B;AAC5E,SAAO,KAAK,IAAI,aAAa,aAAa,KAAK,KAAK,IAAI,GAAG,CAAC;AAC9D;AAEO,SAAS,iBAMd,WAGA,OACuB;AACvB,SAAO,OAAO,cAAc,aAAa,UAAU,KAAK,IAAI;AAC9D;AAEO,SAAS,eAMd,SACA,OACqB;AACrB,SAAO,OAAO,YAAY,aAAa,QAAQ,KAAK,IAAI;AAC1D;AAEO,SAAS,WACd,SACA,OACS;AACT,QAAM;AAAA,IACJ,OAAO;AAAA,IACP;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI;AAEJ,MAAI,UAAU;AACZ,QAAI,OAAO;AACT,UAAI,MAAM,cAAc,sBAAsB,UAAU,MAAM,OAAO,GAAG;AACtE,eAAO;AAAA,MACT;AAAA,IACF,WAAW,CAAC,gBAAgB,MAAM,UAAU,QAAQ,GAAG;AACrD,aAAO;AAAA,IACT;AAAA,EACF;AAEA,MAAI,SAAS,OAAO;AAClB,UAAM,WAAW,MAAM,SAAS;AAChC,QAAI,SAAS,YAAY,CAAC,UAAU;AAClC,aAAO;AAAA,IACT;AACA,QAAI,SAAS,cAAc,UAAU;AACnC,aAAO;AAAA,IACT;AAAA,EACF;AAEA,MAAI,OAAO,UAAU,aAAa,MAAM,QAAQ,MAAM,OAAO;AAC3D,WAAO;AAAA,EACT;AAEA,MAAI,eAAe,gBAAgB,MAAM,MAAM,aAA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AA,MACd,OAAO;AACL,eAAO,iBAAiB,SAAS,aAAa,EAAE,MAAM,KAAK,CAAC;AAAA,MAC9D;AAEA,aAAO;AAAA,IACT;AAAA,EACF,CAAC;AAED,SAAO;AACT;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/package.json b/node_modules/@tanstack/query-core/package.json deleted file mode 100644 index f23d52c..0000000 --- a/node_modules/@tanstack/query-core/package.json +++ /dev/null @@ -1,65 +0,0 @@ -{ - "name": "@tanstack/query-core", - "version": "5.90.20", - "description": "The framework agnostic core that powers TanStack Query", - "author": "tannerlinsley", - "license": "MIT", - "repository": { - "type": "git", - "url": "git+https://github.com/TanStack/query.git", - "directory": "packages/query-core" - }, - "homepage": "https://tanstack.com/query", - "funding": { - "type": "github", - "url": "https://github.com/sponsors/tannerlinsley" - }, - "type": "module", - "types": "build/legacy/index.d.ts", - "main": "build/legacy/index.cjs", - "module": "build/legacy/index.js", - "react-native": "src/index.ts", - "exports": { - ".": { - "@tanstack/custom-condition": "./src/index.ts", - "import": { - "types": "./build/modern/index.d.ts", - "default": "./build/modern/index.js" - }, - "require": { - "types": "./build/modern/index.d.cts", - "default": "./build/modern/index.cjs" - } - }, - "./package.json": "./package.json" - }, - "sideEffects": false, - "files": [ - "build", - "src", - "!src/__tests__" - ], - "devDependencies": { - "npm-run-all2": "^5.0.0", - "@tanstack/query-test-utils": "0.0.0" - }, - "scripts": { - "clean": "premove ./build ./coverage ./dist-ts", - "compile": "tsc --build", - "test:eslint": "eslint --concurrency=auto ./src", - "test:types": "npm-run-all --serial test:types:*", - "test:types:ts50": "node ../../node_modules/typescript50/lib/tsc.js --build tsconfig.legacy.json", - "test:types:ts51": "node ../../node_modules/typescript51/lib/tsc.js --build tsconfig.legacy.json", - "test:types:ts52": "node ../../node_modules/typescript52/lib/tsc.js --build tsconfig.legacy.json", - "test:types:ts53": "node ../../node_modules/typescript53/lib/tsc.js --build tsconfig.legacy.json", - "test:types:ts54": "node ../../node_modules/typescript54/lib/tsc.js --build tsconfig.legacy.json", - "test:types:ts55": "node ../../node_modules/typescript55/lib/tsc.js --build tsconfig.legacy.json", - "test:types:ts56": "node ../../node_modules/typescript56/lib/tsc.js --build tsconfig.legacy.json", - "test:types:ts57": "node ../../node_modules/typescript57/lib/tsc.js --build tsconfig.legacy.json", - "test:types:tscurrent": "tsc --build", - "test:lib": "vitest", - "test:lib:dev": "pnpm run test:lib --watch", - "test:build": "publint --strict && attw --pack", - "build": "tsup --tsconfig tsconfig.prod.json" - } -} \ No newline at end of file diff --git a/node_modules/@tanstack/query-core/src/focusManager.ts b/node_modules/@tanstack/query-core/src/focusManager.ts deleted file mode 100644 index cb0d859..0000000 --- a/node_modules/@tanstack/query-core/src/focusManager.ts +++ /dev/null @@ -1,86 +0,0 @@ -import { Subscribable } from './subscribable' -import { isServer } from './utils' - -type Listener = (focused: boolean) => void - -type SetupFn = ( - setFocused: (focused?: boolean) => void, -) => (() => void) | undefined - -export class FocusManager extends Subscribable { - #focused?: boolean - #cleanup?: () => void - - #setup: SetupFn - - constructor() { - super() - this.#setup = (onFocus) => { - // addEventListener does not exist in React Native, but window does - // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition - if (!isServer && window.addEventListener) { - const listener = () => onFocus() - // Listen to visibilitychange - window.addEventListener('visibilitychange', listener, false) - - return () => { - // Be sure to unsubscribe if a new handler is set - window.removeEventListener('visibilitychange', listener) - } - } - return - } - } - - protected onSubscribe(): void { - if (!this.#cleanup) { - this.setEventListener(this.#setup) - } - } - - protected onUnsubscribe() { - if (!this.hasListeners()) { - this.#cleanup?.() - this.#cleanup = undefined - } - } - - setEventListener(setup: SetupFn): void { - this.#setup = setup - this.#cleanup?.() - this.#cleanup = setup((focused) => { - if (typeof focused === 'boolean') { - this.setFocused(focused) - } else { - this.onFocus() - } - }) - } - - setFocused(focused?: boolean): void { - const changed = this.#focused !== focused - if (changed) { - this.#focused = focused - this.onFocus() - } - } - - onFocus(): void { - const isFocused = this.isFocused() - this.listeners.forEach((listener) => { - listener(isFocused) - }) - } - - isFocused(): boolean { - if (typeof this.#focused === 'boolean') { - return this.#focused - } - - // document global can be unavailable in react native - // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition - return globalThis.document?.visibilityState !== 'hidden' - } -} - -export const focusManager = new FocusManager() diff --git a/node_modules/@tanstack/query-core/src/hydration.ts b/node_modules/@tanstack/query-core/src/hydration.ts deleted file mode 100644 index c75d8ee..0000000 --- a/node_modules/@tanstack/query-core/src/hydration.ts +++ /dev/null @@ -1,285 +0,0 @@ -import { tryResolveSync } from './thenable' -import { noop } from './utils' -import type { - DefaultError, - MutationKey, - MutationMeta, - MutationOptions, - MutationScope, - QueryKey, - QueryMeta, - QueryOptions, -} from './types' -import type { QueryClient } from './queryClient' -import type { Query, QueryState } from './query' -import type { Mutation, MutationState } from './mutation' - -// TYPES -type TransformerFn = (data: any) => any -function defaultTransformerFn(data: any): any { - return data -} - -export interface DehydrateOptions { - serializeData?: TransformerFn - shouldDehydrateMutation?: (mutation: Mutation) => boolean - shouldDehydrateQuery?: (query: Query) => boolean - shouldRedactErrors?: (error: unknown) => boolean -} - -export interface HydrateOptions { - defaultOptions?: { - deserializeData?: TransformerFn - queries?: QueryOptions - mutations?: MutationOptions - } -} - -interface DehydratedMutation { - mutationKey?: MutationKey - state: MutationState - meta?: MutationMeta - scope?: MutationScope -} - -interface DehydratedQuery { - queryHash: string - queryKey: QueryKey - state: QueryState - promise?: Promise - meta?: QueryMeta - // This is only optional because older versions of Query might have dehydrated - // without it which we need to handle for backwards compatibility. - // This should be changed to required in the future. - dehydratedAt?: number -} - -export interface DehydratedState { - mutations: Array - queries: Array -} - -// FUNCTIONS - -function dehydrateMutation(mutation: Mutation): DehydratedMutation { - return { - mutationKey: mutation.options.mutationKey, - state: mutation.state, - ...(mutation.options.scope && { scope: mutation.options.scope }), - ...(mutation.meta && { meta: mutation.meta }), - } -} - -// Most config is not dehydrated but instead meant to configure again when -// consuming the de/rehydrated data, typically with useQuery on the client. -// Sometimes it might make sense to prefetch data on the server and include -// in the html-payload, but not consume it on the initial render. -function dehydrateQuery( - query: Query, - serializeData: TransformerFn, - shouldRedactErrors: (error: unknown) => boolean, -): DehydratedQuery { - const dehydratePromise = () => { - const promise = query.promise?.then(serializeData).catch((error) => { - if (!shouldRedactErrors(error)) { - // Reject original error if it should not be redacted - return Promise.reject(error) - } - // If not in production, log original error before rejecting redacted error - if (process.env.NODE_ENV !== 'production') { - console.error( - `A query that was dehydrated as pending ended up rejecting. [${query.queryHash}]: ${error}; The error will be redacted in production builds`, - ) - } - return Promise.reject(new Error('redacted')) - }) - - // Avoid unhandled promise rejections - // We need the promise we dehydrate to reject to get the correct result into - // the query cache, but we also want to avoid unhandled promise rejections - // in whatever environment the prefetches are happening in. - promise?.catch(noop) - - return promise - } - - return { - dehydratedAt: Date.now(), - state: { - ...query.state, - ...(query.state.data !== undefined && { - data: serializeData(query.state.data), - }), - }, - queryKey: query.queryKey, - queryHash: query.queryHash, - ...(query.state.status === 'pending' && { - promise: dehydratePromise(), - }), - ...(query.meta && { meta: query.meta }), - } -} - -export function defaultShouldDehydrateMutation(mutation: Mutation) { - return mutation.state.isPaused -} - -export function defaultShouldDehydrateQuery(query: Query) { - return query.state.status === 'success' -} - -function defaultShouldRedactErrors(_: unknown) { - return true -} - -export function dehydrate( - client: QueryClient, - options: DehydrateOptions = {}, -): DehydratedState { - const filterMutation = - options.shouldDehydrateMutation ?? - client.getDefaultOptions().dehydrate?.shouldDehydrateMutation ?? - defaultShouldDehydrateMutation - - const mutations = client - .getMutationCache() - .getAll() - .flatMap((mutation) => - filterMutation(mutation) ? [dehydrateMutation(mutation)] : [], - ) - - const filterQuery = - options.shouldDehydrateQuery ?? - client.getDefaultOptions().dehydrate?.shouldDehydrateQuery ?? - defaultShouldDehydrateQuery - - const shouldRedactErrors = - options.shouldRedactErrors ?? - client.getDefaultOptions().dehydrate?.shouldRedactErrors ?? - defaultShouldRedactErrors - - const serializeData = - options.serializeData ?? - client.getDefaultOptions().dehydrate?.serializeData ?? - defaultTransformerFn - - const queries = client - .getQueryCache() - .getAll() - .flatMap((query) => - filterQuery(query) - ? [dehydrateQuery(query, serializeData, shouldRedactErrors)] - : [], - ) - - return { mutations, queries } -} - -export function hydrate( - client: QueryClient, - dehydratedState: unknown, - options?: HydrateOptions, -): void { - if (typeof dehydratedState !== 'object' || dehydratedState === null) { - return - } - - const mutationCache = client.getMutationCache() - const queryCache = client.getQueryCache() - const deserializeData = - options?.defaultOptions?.deserializeData ?? - client.getDefaultOptions().hydrate?.deserializeData ?? - defaultTransformerFn - - // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition - const mutations = (dehydratedState as DehydratedState).mutations || [] - // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition - const queries = (dehydratedState as DehydratedState).queries || [] - - mutations.forEach(({ state, ...mutationOptions }) => { - mutationCache.build( - client, - { - ...client.getDefaultOptions().hydrate?.mutations, - ...options?.defaultOptions?.mutations, - ...mutationOptions, - }, - state, - ) - }) - - queries.forEach( - ({ queryKey, state, queryHash, meta, promise, dehydratedAt }) => { - const syncData = promise ? tryResolveSync(promise) : undefined - const rawData = state.data === undefined ? syncData?.data : state.data - const data = rawData === undefined ? rawData : deserializeData(rawData) - - let query = queryCache.get(queryHash) - const existingQueryIsPending = query?.state.status === 'pending' - const existingQueryIsFetching = query?.state.fetchStatus === 'fetching' - - // Do not hydrate if an existing query exists with newer data - if (query) { - const hasNewerSyncData = - syncData && - // We only need this undefined check to handle older dehydration - // payloads that might not have dehydratedAt - dehydratedAt !== undefined && - dehydratedAt > query.state.dataUpdatedAt - if ( - state.dataUpdatedAt > query.state.dataUpdatedAt || - hasNewerSyncData - ) { - // omit fetchStatus from dehydrated state - // so that query stays in its current fetchStatus - const { fetchStatus: _ignored, ...serializedState } = state - query.setState({ - ...serializedState, - data, - }) - } - } else { - // Restore query - query = queryCache.build( - client, - { - ...client.getDefaultOptions().hydrate?.queries, - ...options?.defaultOptions?.queries, - queryKey, - queryHash, - meta, - }, - // Reset fetch status to idle to avoid - // query being stuck in fetching state upon hydration - { - ...state, - data, - fetchStatus: 'idle', - status: data !== undefined ? 'success' : state.status, - }, - ) - } - - if ( - promise && - !existingQueryIsPending && - !existingQueryIsFetching && - // Only hydrate if dehydration is newer than any existing data, - // this is always true for new queries - (dehydratedAt === undefined || dehydratedAt > query.state.dataUpdatedAt) - ) { - // This doesn't actually fetch - it just creates a retryer - // which will re-use the passed `initialPromise` - // Note that we need to call these even when data was synchronously - // available, as we still need to set up the retryer - query - .fetch(undefined, { - // RSC transformed promises are not thenable - initialPromise: Promise.resolve(promise).then(deserializeData), - }) - // Avoid unhandled promise rejections - .catch(noop) - } - }, - ) -} diff --git a/node_modules/@tanstack/query-core/src/index.ts b/node_modules/@tanstack/query-core/src/index.ts deleted file mode 100644 index a7763cf..0000000 --- a/node_modules/@tanstack/query-core/src/index.ts +++ /dev/null @@ -1,55 +0,0 @@ -/* istanbul ignore file */ - -export { focusManager } from './focusManager' -export { - defaultShouldDehydrateMutation, - defaultShouldDehydrateQuery, - dehydrate, - hydrate, -} from './hydration' -export { InfiniteQueryObserver } from './infiniteQueryObserver' -export { MutationCache } from './mutationCache' -export type { MutationCacheNotifyEvent } from './mutationCache' -export { MutationObserver } from './mutationObserver' -export { defaultScheduler, notifyManager } from './notifyManager' -export { onlineManager } from './onlineManager' -export { QueriesObserver } from './queriesObserver' -export { QueryCache } from './queryCache' -export type { QueryCacheNotifyEvent } from './queryCache' -export { QueryClient } from './queryClient' -export { QueryObserver } from './queryObserver' -export { CancelledError, isCancelledError } from './retryer' -export { - timeoutManager, - type ManagedTimerId, - type TimeoutCallback, - type TimeoutProvider, -} from './timeoutManager' -export { - hashKey, - isServer, - keepPreviousData, - matchMutation, - matchQuery, - noop, - partialMatchKey, - replaceEqualDeep, - shouldThrowError, - skipToken, -} from './utils' -export type { MutationFilters, QueryFilters, SkipToken, Updater } from './utils' - -export { streamedQuery as experimental_streamedQuery } from './streamedQuery' - -// Types -export type { - DehydratedState, - DehydrateOptions, - HydrateOptions, -} from './hydration' -export { Mutation } from './mutation' -export type { MutationState } from './mutation' -export type { QueriesObserverOptions } from './queriesObserver' -export { Query } from './query' -export type { QueryState } from './query' -export * from './types' diff --git a/node_modules/@tanstack/query-core/src/infiniteQueryBehavior.ts b/node_modules/@tanstack/query-core/src/infiniteQueryBehavior.ts deleted file mode 100644 index af9c50e..0000000 --- a/node_modules/@tanstack/query-core/src/infiniteQueryBehavior.ts +++ /dev/null @@ -1,176 +0,0 @@ -import { - addConsumeAwareSignal, - addToEnd, - addToStart, - ensureQueryFn, -} from './utils' -import type { QueryBehavior } from './query' -import type { - InfiniteData, - InfiniteQueryPageParamsOptions, - OmitKeyof, - QueryFunctionContext, - QueryKey, -} from './types' - -export function infiniteQueryBehavior( - pages?: number, -): QueryBehavior> { - return { - onFetch: (context, query) => { - const options = context.options as InfiniteQueryPageParamsOptions - const direction = context.fetchOptions?.meta?.fetchMore?.direction - const oldPages = context.state.data?.pages || [] - const oldPageParams = context.state.data?.pageParams || [] - let result: InfiniteData = { pages: [], pageParams: [] } - let currentPage = 0 - - const fetchFn = async () => { - let cancelled = false - const addSignalProperty = (object: unknown) => { - addConsumeAwareSignal( - object, - () => context.signal, - () => (cancelled = true), - ) - } - - const queryFn = ensureQueryFn(context.options, context.fetchOptions) - - // Create function to fetch a page - const fetchPage = async ( - data: InfiniteData, - param: unknown, - previous?: boolean, - ): Promise> => { - if (cancelled) { - return Promise.reject() - } - - if (param == null && data.pages.length) { - return Promise.resolve(data) - } - - const createQueryFnContext = () => { - const queryFnContext: OmitKeyof< - QueryFunctionContext, - 'signal' - > = { - client: context.client, - queryKey: context.queryKey, - pageParam: param, - direction: previous ? 'backward' : 'forward', - meta: context.options.meta, - } - addSignalProperty(queryFnContext) - return queryFnContext as QueryFunctionContext - } - - const queryFnContext = createQueryFnContext() - - const page = await queryFn(queryFnContext) - - const { maxPages } = context.options - const addTo = previous ? addToStart : addToEnd - - return { - pages: addTo(data.pages, page, maxPages), - pageParams: addTo(data.pageParams, param, maxPages), - } - } - - // fetch next / previous page? - if (direction && oldPages.length) { - const previous = direction === 'backward' - const pageParamFn = previous ? getPreviousPageParam : getNextPageParam - const oldData = { - pages: oldPages, - pageParams: oldPageParams, - } - const param = pageParamFn(options, oldData) - - result = await fetchPage(oldData, param, previous) - } else { - const remainingPages = pages ?? oldPages.length - - // Fetch all pages - do { - const param = - currentPage === 0 - ? (oldPageParams[0] ?? options.initialPageParam) - : getNextPageParam(options, result) - if (currentPage > 0 && param == null) { - break - } - result = await fetchPage(result, param) - currentPage++ - } while (currentPage < remainingPages) - } - - return result - } - if (context.options.persister) { - context.fetchFn = () => { - return context.options.persister?.( - fetchFn as any, - { - client: context.client, - queryKey: context.queryKey, - meta: context.options.meta, - signal: context.signal, - }, - query, - ) - } - } else { - context.fetchFn = fetchFn - } - }, - } -} - -function getNextPageParam( - options: InfiniteQueryPageParamsOptions, - { pages, pageParams }: InfiniteData, -): unknown | undefined { - const lastIndex = pages.length - 1 - return pages.length > 0 - ? options.getNextPageParam( - pages[lastIndex], - pages, - pageParams[lastIndex], - pageParams, - ) - : undefined -} - -function getPreviousPageParam( - options: InfiniteQueryPageParamsOptions, - { pages, pageParams }: InfiniteData, -): unknown | undefined { - return pages.length > 0 - ? options.getPreviousPageParam?.(pages[0], pages, pageParams[0], pageParams) - : undefined -} - -/** - * Checks if there is a next page. - */ -export function hasNextPage( - options: InfiniteQueryPageParamsOptions, - data?: InfiniteData, -): boolean { - if (!data) return false - return getNextPageParam(options, data) != null -} - -/** - * Checks if there is a previous page. - */ -export function hasPreviousPage( - options: InfiniteQueryPageParamsOptions, - data?: InfiniteData, -): boolean { - if (!data || !options.getPreviousPageParam) return false - return getPreviousPageParam(options, data) != null -} diff --git a/node_modules/@tanstack/query-core/src/infiniteQueryObserver.ts b/node_modules/@tanstack/query-core/src/infiniteQueryObserver.ts deleted file mode 100644 index 1499b13..0000000 --- a/node_modules/@tanstack/query-core/src/infiniteQueryObserver.ts +++ /dev/null @@ -1,190 +0,0 @@ -import { QueryObserver } from './queryObserver' -import { - hasNextPage, - hasPreviousPage, - infiniteQueryBehavior, -} from './infiniteQueryBehavior' -import type { Subscribable } from './subscribable' -import type { - DefaultError, - DefaultedInfiniteQueryObserverOptions, - FetchNextPageOptions, - FetchPreviousPageOptions, - InfiniteData, - InfiniteQueryObserverBaseResult, - InfiniteQueryObserverOptions, - InfiniteQueryObserverResult, - QueryKey, -} from './types' -import type { QueryClient } from './queryClient' -import type { Query } from './query' - -type InfiniteQueryObserverListener = ( - result: InfiniteQueryObserverResult, -) => void - -export class InfiniteQueryObserver< - TQueryFnData = unknown, - TError = DefaultError, - TData = InfiniteData, - TQueryKey extends QueryKey = QueryKey, - TPageParam = unknown, -> extends QueryObserver< - TQueryFnData, - TError, - TData, - InfiniteData, - TQueryKey -> { - // Type override - subscribe!: Subscribable< - InfiniteQueryObserverListener - >['subscribe'] - - // Type override - getCurrentResult!: ReplaceReturnType< - QueryObserver< - TQueryFnData, - TError, - TData, - InfiniteData, - TQueryKey - >['getCurrentResult'], - InfiniteQueryObserverResult - > - - // Type override - protected fetch!: ReplaceReturnType< - QueryObserver< - TQueryFnData, - TError, - TData, - InfiniteData, - TQueryKey - >['fetch'], - Promise> - > - - constructor( - client: QueryClient, - options: InfiniteQueryObserverOptions< - TQueryFnData, - TError, - TData, - TQueryKey, - TPageParam - >, - ) { - super(client, options) - } - - protected bindMethods(): void { - super.bindMethods() - this.fetchNextPage = this.fetchNextPage.bind(this) - this.fetchPreviousPage = this.fetchPreviousPage.bind(this) - } - - setOptions( - options: InfiniteQueryObserverOptions< - TQueryFnData, - TError, - TData, - TQueryKey, - TPageParam - >, - ): void { - super.setOptions({ - ...options, - behavior: infiniteQueryBehavior(), - }) - } - - getOptimisticResult( - options: DefaultedInfiniteQueryObserverOptions< - TQueryFnData, - TError, - TData, - TQueryKey, - TPageParam - >, - ): InfiniteQueryObserverResult { - options.behavior = infiniteQueryBehavior() - return super.getOptimisticResult(options) as InfiniteQueryObserverResult< - TData, - TError - > - } - - fetchNextPage( - options?: FetchNextPageOptions, - ): Promise> { - return this.fetch({ - ...options, - meta: { - fetchMore: { direction: 'forward' }, - }, - }) - } - - fetchPreviousPage( - options?: FetchPreviousPageOptions, - ): Promise> { - return this.fetch({ - ...options, - meta: { - fetchMore: { direction: 'backward' }, - }, - }) - } - - protected createResult( - query: Query< - TQueryFnData, - TError, - InfiniteData, - TQueryKey - >, - options: InfiniteQueryObserverOptions< - TQueryFnData, - TError, - TData, - TQueryKey, - TPageParam - >, - ): InfiniteQueryObserverResult { - const { state } = query - const parentResult = super.createResult(query, options) - - const { isFetching, isRefetching, isError, isRefetchError } = parentResult - const fetchDirection = state.fetchMeta?.fetchMore?.direction - - const isFetchNextPageError = isError && fetchDirection === 'forward' - const isFetchingNextPage = isFetching && fetchDirection === 'forward' - - const isFetchPreviousPageError = isError && fetchDirection === 'backward' - const isFetchingPreviousPage = isFetching && fetchDirection === 'backward' - - const result: InfiniteQueryObserverBaseResult = { - ...parentResult, - fetchNextPage: this.fetchNextPage, - fetchPreviousPage: this.fetchPreviousPage, - hasNextPage: hasNextPage(options, state.data), - hasPreviousPage: hasPreviousPage(options, state.data), - isFetchNextPageError, - isFetchingNextPage, - isFetchPreviousPageError, - isFetchingPreviousPage, - isRefetchError: - isRefetchError && !isFetchNextPageError && !isFetchPreviousPageError, - isRefetching: - isRefetching && !isFetchingNextPage && !isFetchingPreviousPage, - } - - return result as InfiniteQueryObserverResult - } -} - -type ReplaceReturnType< - TFunction extends (...args: Array) => unknown, - TReturn, -> = (...args: Parameters) => TReturn diff --git a/node_modules/@tanstack/query-core/src/mutation.ts b/node_modules/@tanstack/query-core/src/mutation.ts deleted file mode 100644 index 2483b56..0000000 --- a/node_modules/@tanstack/query-core/src/mutation.ts +++ /dev/null @@ -1,419 +0,0 @@ -import { notifyManager } from './notifyManager' -import { Removable } from './removable' -import { createRetryer } from './retryer' -import type { - DefaultError, - MutationFunctionContext, - MutationMeta, - MutationOptions, - MutationStatus, -} from './types' -import type { MutationCache } from './mutationCache' -import type { MutationObserver } from './mutationObserver' -import type { Retryer } from './retryer' -import type { QueryClient } from './queryClient' - -// TYPES - -interface MutationConfig { - client: QueryClient - mutationId: number - mutationCache: MutationCache - options: MutationOptions - state?: MutationState -} - -export interface MutationState< - TData = unknown, - TError = DefaultError, - TVariables = unknown, - TOnMutateResult = unknown, -> { - context: TOnMutateResult | undefined - data: TData | undefined - error: TError | null - failureCount: number - failureReason: TError | null - isPaused: boolean - status: MutationStatus - variables: TVariables | undefined - submittedAt: number -} - -interface FailedAction { - type: 'failed' - failureCount: number - error: TError | null -} - -interface PendingAction { - type: 'pending' - isPaused: boolean - variables?: TVariables - context?: TOnMutateResult -} - -interface SuccessAction { - type: 'success' - data: TData -} - -interface ErrorAction { - type: 'error' - error: TError -} - -interface PauseAction { - type: 'pause' -} - -interface ContinueAction { - type: 'continue' -} - -export type Action = - | ContinueAction - | ErrorAction - | FailedAction - | PendingAction - | PauseAction - | SuccessAction - -// CLASS - -export class Mutation< - TData = unknown, - TError = DefaultError, - TVariables = unknown, - TOnMutateResult = unknown, -> extends Removable { - state: MutationState - options!: MutationOptions - readonly mutationId: number - - #client: QueryClient - #observers: Array< - MutationObserver - > - #mutationCache: MutationCache - #retryer?: Retryer - - constructor( - config: MutationConfig, - ) { - super() - - this.#client = config.client - this.mutationId = config.mutationId - this.#mutationCache = config.mutationCache - this.#observers = [] - this.state = config.state || getDefaultState() - - this.setOptions(config.options) - this.scheduleGc() - } - - setOptions( - options: MutationOptions, - ): void { - this.options = options - - this.updateGcTime(this.options.gcTime) - } - - get meta(): MutationMeta | undefined { - return this.options.meta - } - - addObserver(observer: MutationObserver): void { - if (!this.#observers.includes(observer)) { - this.#observers.push(observer) - - // Stop the mutation from being garbage collected - this.clearGcTimeout() - - this.#mutationCache.notify({ - type: 'observerAdded', - mutation: this, - observer, - }) - } - } - - removeObserver(observer: MutationObserver): void { - this.#observers = this.#observers.filter((x) => x !== observer) - - this.scheduleGc() - - this.#mutationCache.notify({ - type: 'observerRemoved', - mutation: this, - observer, - }) - } - - protected optionalRemove() { - if (!this.#observers.length) { - if (this.state.status === 'pending') { - this.scheduleGc() - } else { - this.#mutationCache.remove(this) - } - } - } - - continue(): Promise { - return ( - this.#retryer?.continue() ?? - // continuing a mutation assumes that variables are set, mutation must have been dehydrated before - this.execute(this.state.variables!) - ) - } - - async execute(variables: TVariables): Promise { - const onContinue = () => { - this.#dispatch({ type: 'continue' }) - } - - const mutationFnContext = { - client: this.#client, - meta: this.options.meta, - mutationKey: this.options.mutationKey, - } satisfies MutationFunctionContext - - this.#retryer = createRetryer({ - fn: () => { - if (!this.options.mutationFn) { - return Promise.reject(new Error('No mutationFn found')) - } - - return this.options.mutationFn(variables, mutationFnContext) - }, - onFail: (failureCount, error) => { - this.#dispatch({ type: 'failed', failureCount, error }) - }, - onPause: () => { - this.#dispatch({ type: 'pause' }) - }, - onContinue, - retry: this.options.retry ?? 0, - retryDelay: this.options.retryDelay, - networkMode: this.options.networkMode, - canRun: () => this.#mutationCache.canRun(this), - }) - - const restored = this.state.status === 'pending' - const isPaused = !this.#retryer.canStart() - - try { - if (restored) { - // Dispatch continue action to unpause restored mutation - onContinue() - } else { - this.#dispatch({ type: 'pending', variables, isPaused }) - // Notify cache callback - if (this.#mutationCache.config.onMutate) { - await this.#mutationCache.config.onMutate( - variables, - this as Mutation, - mutationFnContext, - ) - } - const context = await this.options.onMutate?.( - variables, - mutationFnContext, - ) - if (context !== this.state.context) { - this.#dispatch({ - type: 'pending', - context, - variables, - isPaused, - }) - } - } - const data = await this.#retryer.start() - - // Notify cache callback - await this.#mutationCache.config.onSuccess?.( - data, - variables, - this.state.context, - this as Mutation, - mutationFnContext, - ) - - await this.options.onSuccess?.( - data, - variables, - this.state.context!, - mutationFnContext, - ) - - // Notify cache callback - await this.#mutationCache.config.onSettled?.( - data, - null, - this.state.variables, - this.state.context, - this as Mutation, - mutationFnContext, - ) - - await this.options.onSettled?.( - data, - null, - variables, - this.state.context, - mutationFnContext, - ) - - this.#dispatch({ type: 'success', data }) - return data - } catch (error) { - try { - // Notify cache callback - await this.#mutationCache.config.onError?.( - error as any, - variables, - this.state.context, - this as Mutation, - mutationFnContext, - ) - } catch (e) { - void Promise.reject(e) - } - - try { - await this.options.onError?.( - error as TError, - variables, - this.state.context, - mutationFnContext, - ) - } catch (e) { - void Promise.reject(e) - } - - try { - // Notify cache callback - await this.#mutationCache.config.onSettled?.( - undefined, - error as any, - this.state.variables, - this.state.context, - this as Mutation, - mutationFnContext, - ) - } catch (e) { - void Promise.reject(e) - } - - try { - await this.options.onSettled?.( - undefined, - error as TError, - variables, - this.state.context, - mutationFnContext, - ) - } catch (e) { - void Promise.reject(e) - } - - this.#dispatch({ type: 'error', error: error as TError }) - throw error - } finally { - this.#mutationCache.runNext(this) - } - } - - #dispatch(action: Action): void { - const reducer = ( - state: MutationState, - ): MutationState => { - switch (action.type) { - case 'failed': - return { - ...state, - failureCount: action.failureCount, - failureReason: action.error, - } - case 'pause': - return { - ...state, - isPaused: true, - } - case 'continue': - return { - ...state, - isPaused: false, - } - case 'pending': - return { - ...state, - context: action.context, - data: undefined, - failureCount: 0, - failureReason: null, - error: null, - isPaused: action.isPaused, - status: 'pending', - variables: action.variables, - submittedAt: Date.now(), - } - case 'success': - return { - ...state, - data: action.data, - failureCount: 0, - failureReason: null, - error: null, - status: 'success', - isPaused: false, - } - case 'error': - return { - ...state, - data: undefined, - error: action.error, - failureCount: state.failureCount + 1, - failureReason: action.error, - isPaused: false, - status: 'error', - } - } - } - this.state = reducer(this.state) - - notifyManager.batch(() => { - this.#observers.forEach((observer) => { - observer.onMutationUpdate(action) - }) - this.#mutationCache.notify({ - mutation: this, - type: 'updated', - action, - }) - }) - } -} - -export function getDefaultState< - TData, - TError, - TVariables, - TOnMutateResult, ->(): MutationState { - return { - context: undefined, - data: undefined, - error: null, - failureCount: 0, - failureReason: null, - isPaused: false, - status: 'idle', - variables: undefined, - submittedAt: 0, - } -} diff --git a/node_modules/@tanstack/query-core/src/mutationCache.ts b/node_modules/@tanstack/query-core/src/mutationCache.ts deleted file mode 100644 index d204c90..0000000 --- a/node_modules/@tanstack/query-core/src/mutationCache.ts +++ /dev/null @@ -1,244 +0,0 @@ -import { notifyManager } from './notifyManager' -import { Mutation } from './mutation' -import { matchMutation, noop } from './utils' -import { Subscribable } from './subscribable' -import type { MutationObserver } from './mutationObserver' -import type { - DefaultError, - MutationFunctionContext, - MutationOptions, - NotifyEvent, -} from './types' -import type { QueryClient } from './queryClient' -import type { Action, MutationState } from './mutation' -import type { MutationFilters } from './utils' - -// TYPES - -interface MutationCacheConfig { - onError?: ( - error: DefaultError, - variables: unknown, - onMutateResult: unknown, - mutation: Mutation, - context: MutationFunctionContext, - ) => Promise | unknown - onSuccess?: ( - data: unknown, - variables: unknown, - onMutateResult: unknown, - mutation: Mutation, - context: MutationFunctionContext, - ) => Promise | unknown - onMutate?: ( - variables: unknown, - mutation: Mutation, - context: MutationFunctionContext, - ) => Promise | unknown - onSettled?: ( - data: unknown | undefined, - error: DefaultError | null, - variables: unknown, - onMutateResult: unknown, - mutation: Mutation, - context: MutationFunctionContext, - ) => Promise | unknown -} - -interface NotifyEventMutationAdded extends NotifyEvent { - type: 'added' - mutation: Mutation -} -interface NotifyEventMutationRemoved extends NotifyEvent { - type: 'removed' - mutation: Mutation -} - -interface NotifyEventMutationObserverAdded extends NotifyEvent { - type: 'observerAdded' - mutation: Mutation - observer: MutationObserver -} - -interface NotifyEventMutationObserverRemoved extends NotifyEvent { - type: 'observerRemoved' - mutation: Mutation - observer: MutationObserver -} - -interface NotifyEventMutationObserverOptionsUpdated extends NotifyEvent { - type: 'observerOptionsUpdated' - mutation?: Mutation - observer: MutationObserver -} - -interface NotifyEventMutationUpdated extends NotifyEvent { - type: 'updated' - mutation: Mutation - action: Action -} - -export type MutationCacheNotifyEvent = - | NotifyEventMutationAdded - | NotifyEventMutationRemoved - | NotifyEventMutationObserverAdded - | NotifyEventMutationObserverRemoved - | NotifyEventMutationObserverOptionsUpdated - | NotifyEventMutationUpdated - -type MutationCacheListener = (event: MutationCacheNotifyEvent) => void - -// CLASS - -export class MutationCache extends Subscribable { - #mutations: Set> - #scopes: Map>> - #mutationId: number - - constructor(public config: MutationCacheConfig = {}) { - super() - this.#mutations = new Set() - this.#scopes = new Map() - this.#mutationId = 0 - } - - build( - client: QueryClient, - options: MutationOptions, - state?: MutationState, - ): Mutation { - const mutation = new Mutation({ - client, - mutationCache: this, - mutationId: ++this.#mutationId, - options: client.defaultMutationOptions(options), - state, - }) - - this.add(mutation) - - return mutation - } - - add(mutation: Mutation): void { - this.#mutations.add(mutation) - const scope = scopeFor(mutation) - if (typeof scope === 'string') { - const scopedMutations = this.#scopes.get(scope) - if (scopedMutations) { - scopedMutations.push(mutation) - } else { - this.#scopes.set(scope, [mutation]) - } - } - this.notify({ type: 'added', mutation }) - } - - remove(mutation: Mutation): void { - if (this.#mutations.delete(mutation)) { - const scope = scopeFor(mutation) - if (typeof scope === 'string') { - const scopedMutations = this.#scopes.get(scope) - if (scopedMutations) { - if (scopedMutations.length > 1) { - const index = scopedMutations.indexOf(mutation) - if (index !== -1) { - scopedMutations.splice(index, 1) - } - } else if (scopedMutations[0] === mutation) { - this.#scopes.delete(scope) - } - } - } - } - - // Currently we notify the removal even if the mutation was already removed. - // Consider making this an error or not notifying of the removal depending on the desired semantics. - this.notify({ type: 'removed', mutation }) - } - - canRun(mutation: Mutation): boolean { - const scope = scopeFor(mutation) - if (typeof scope === 'string') { - const mutationsWithSameScope = this.#scopes.get(scope) - const firstPendingMutation = mutationsWithSameScope?.find( - (m) => m.state.status === 'pending', - ) - // we can run if there is no current pending mutation (start use-case) - // or if WE are the first pending mutation (continue use-case) - return !firstPendingMutation || firstPendingMutation === mutation - } else { - // For unscoped mutations there are never any pending mutations in front of the - // current mutation - return true - } - } - - runNext(mutation: Mutation): Promise { - const scope = scopeFor(mutation) - if (typeof scope === 'string') { - const foundMutation = this.#scopes - .get(scope) - ?.find((m) => m !== mutation && m.state.isPaused) - - return foundMutation?.continue() ?? Promise.resolve() - } else { - return Promise.resolve() - } - } - - clear(): void { - notifyManager.batch(() => { - this.#mutations.forEach((mutation) => { - this.notify({ type: 'removed', mutation }) - }) - this.#mutations.clear() - this.#scopes.clear() - }) - } - - getAll(): Array { - return Array.from(this.#mutations) - } - - find< - TData = unknown, - TError = DefaultError, - TVariables = any, - TOnMutateResult = unknown, - >( - filters: MutationFilters, - ): Mutation | undefined { - const defaultedFilters = { exact: true, ...filters } - - return this.getAll().find((mutation) => - matchMutation(defaultedFilters, mutation), - ) as Mutation | undefined - } - - findAll(filters: MutationFilters = {}): Array { - return this.getAll().filter((mutation) => matchMutation(filters, mutation)) - } - - notify(event: MutationCacheNotifyEvent) { - notifyManager.batch(() => { - this.listeners.forEach((listener) => { - listener(event) - }) - }) - } - - resumePausedMutations(): Promise { - const pausedMutations = this.getAll().filter((x) => x.state.isPaused) - - return notifyManager.batch(() => - Promise.all( - pausedMutations.map((mutation) => mutation.continue().catch(noop)), - ), - ) - } -} - -function scopeFor(mutation: Mutation) { - return mutation.options.scope?.id -} diff --git a/node_modules/@tanstack/query-core/src/mutationObserver.ts b/node_modules/@tanstack/query-core/src/mutationObserver.ts deleted file mode 100644 index 2152396..0000000 --- a/node_modules/@tanstack/query-core/src/mutationObserver.ts +++ /dev/null @@ -1,227 +0,0 @@ -import { getDefaultState } from './mutation' -import { notifyManager } from './notifyManager' -import { Subscribable } from './subscribable' -import { hashKey, shallowEqualObjects } from './utils' -import type { QueryClient } from './queryClient' -import type { - DefaultError, - MutateOptions, - MutationFunctionContext, - MutationObserverOptions, - MutationObserverResult, -} from './types' -import type { Action, Mutation } from './mutation' - -// TYPES - -type MutationObserverListener = ( - result: MutationObserverResult, -) => void - -// CLASS - -export class MutationObserver< - TData = unknown, - TError = DefaultError, - TVariables = void, - TOnMutateResult = unknown, -> extends Subscribable< - MutationObserverListener -> { - options!: MutationObserverOptions - - #client: QueryClient - #currentResult: MutationObserverResult< - TData, - TError, - TVariables, - TOnMutateResult - > = undefined! - #currentMutation?: Mutation - #mutateOptions?: MutateOptions - - constructor( - client: QueryClient, - options: MutationObserverOptions< - TData, - TError, - TVariables, - TOnMutateResult - >, - ) { - super() - - this.#client = client - this.setOptions(options) - this.bindMethods() - this.#updateResult() - } - - protected bindMethods(): void { - this.mutate = this.mutate.bind(this) - this.reset = this.reset.bind(this) - } - - setOptions( - options: MutationObserverOptions< - TData, - TError, - TVariables, - TOnMutateResult - >, - ) { - const prevOptions = this.options as - | MutationObserverOptions - | undefined - this.options = this.#client.defaultMutationOptions(options) - if (!shallowEqualObjects(this.options, prevOptions)) { - this.#client.getMutationCache().notify({ - type: 'observerOptionsUpdated', - mutation: this.#currentMutation, - observer: this, - }) - } - - if ( - prevOptions?.mutationKey && - this.options.mutationKey && - hashKey(prevOptions.mutationKey) !== hashKey(this.options.mutationKey) - ) { - this.reset() - } else if (this.#currentMutation?.state.status === 'pending') { - this.#currentMutation.setOptions(this.options) - } - } - - protected onUnsubscribe(): void { - if (!this.hasListeners()) { - this.#currentMutation?.removeObserver(this) - } - } - - onMutationUpdate( - action: Action, - ): void { - this.#updateResult() - - this.#notify(action) - } - - getCurrentResult(): MutationObserverResult< - TData, - TError, - TVariables, - TOnMutateResult - > { - return this.#currentResult - } - - reset(): void { - // reset needs to remove the observer from the mutation because there is no way to "get it back" - // another mutate call will yield a new mutation! - this.#currentMutation?.removeObserver(this) - this.#currentMutation = undefined - this.#updateResult() - this.#notify() - } - - mutate( - variables: TVariables, - options?: MutateOptions, - ): Promise { - this.#mutateOptions = options - - this.#currentMutation?.removeObserver(this) - - this.#currentMutation = this.#client - .getMutationCache() - .build(this.#client, this.options) - - this.#currentMutation.addObserver(this) - - return this.#currentMutation.execute(variables) - } - - #updateResult(): void { - const state = - this.#currentMutation?.state ?? - getDefaultState() - - this.#currentResult = { - ...state, - isPending: state.status === 'pending', - isSuccess: state.status === 'success', - isError: state.status === 'error', - isIdle: state.status === 'idle', - mutate: this.mutate, - reset: this.reset, - } as MutationObserverResult - } - - #notify(action?: Action): void { - notifyManager.batch(() => { - // First trigger the mutate callbacks - if (this.#mutateOptions && this.hasListeners()) { - const variables = this.#currentResult.variables! - const onMutateResult = this.#currentResult.context - - const context = { - client: this.#client, - meta: this.options.meta, - mutationKey: this.options.mutationKey, - } satisfies MutationFunctionContext - - if (action?.type === 'success') { - try { - this.#mutateOptions.onSuccess?.( - action.data, - variables, - onMutateResult, - context, - ) - } catch (e) { - void Promise.reject(e) - } - try { - this.#mutateOptions.onSettled?.( - action.data, - null, - variables, - onMutateResult, - context, - ) - } catch (e) { - void Promise.reject(e) - } - } else if (action?.type === 'error') { - try { - this.#mutateOptions.onError?.( - action.error, - variables, - onMutateResult, - context, - ) - } catch (e) { - void Promise.reject(e) - } - try { - this.#mutateOptions.onSettled?.( - undefined, - action.error, - variables, - onMutateResult, - context, - ) - } catch (e) { - void Promise.reject(e) - } - } - } - - // Then trigger the listeners - this.listeners.forEach((listener) => { - listener(this.#currentResult) - }) - }) - } -} diff --git a/node_modules/@tanstack/query-core/src/notifyManager.ts b/node_modules/@tanstack/query-core/src/notifyManager.ts deleted file mode 100644 index f4deb73..0000000 --- a/node_modules/@tanstack/query-core/src/notifyManager.ts +++ /dev/null @@ -1,99 +0,0 @@ -// TYPES - -import { systemSetTimeoutZero } from './timeoutManager' - -type NotifyCallback = () => void - -type NotifyFunction = (callback: () => void) => void - -type BatchNotifyFunction = (callback: () => void) => void - -type BatchCallsCallback> = (...args: T) => void - -type ScheduleFunction = (callback: () => void) => void - -export const defaultScheduler: ScheduleFunction = systemSetTimeoutZero - -export function createNotifyManager() { - let queue: Array = [] - let transactions = 0 - let notifyFn: NotifyFunction = (callback) => { - callback() - } - let batchNotifyFn: BatchNotifyFunction = (callback: () => void) => { - callback() - } - let scheduleFn = defaultScheduler - - const schedule = (callback: NotifyCallback): void => { - if (transactions) { - queue.push(callback) - } else { - scheduleFn(() => { - notifyFn(callback) - }) - } - } - const flush = (): void => { - const originalQueue = queue - queue = [] - if (originalQueue.length) { - scheduleFn(() => { - batchNotifyFn(() => { - originalQueue.forEach((callback) => { - notifyFn(callback) - }) - }) - }) - } - } - - return { - batch: (callback: () => T): T => { - let result - transactions++ - try { - result = callback() - } finally { - transactions-- - if (!transactions) { - flush() - } - } - return result - }, - /** - * All calls to the wrapped function will be batched. - */ - batchCalls: >( - callback: BatchCallsCallback, - ): BatchCallsCallback => { - return (...args) => { - schedule(() => { - callback(...args) - }) - } - }, - schedule, - /** - * Use this method to set a custom notify function. - * This can be used to for example wrap notifications with `React.act` while running tests. - */ - setNotifyFunction: (fn: NotifyFunction) => { - notifyFn = fn - }, - /** - * Use this method to set a custom function to batch notifications together into a single tick. - * By default React Query will use the batch function provided by ReactDOM or React Native. - */ - setBatchNotifyFunction: (fn: BatchNotifyFunction) => { - batchNotifyFn = fn - }, - setScheduler: (fn: ScheduleFunction) => { - scheduleFn = fn - }, - } as const -} - -// SINGLETON -export const notifyManager = createNotifyManager() diff --git a/node_modules/@tanstack/query-core/src/onlineManager.ts b/node_modules/@tanstack/query-core/src/onlineManager.ts deleted file mode 100644 index daf77d5..0000000 --- a/node_modules/@tanstack/query-core/src/onlineManager.ts +++ /dev/null @@ -1,71 +0,0 @@ -import { Subscribable } from './subscribable' -import { isServer } from './utils' - -type Listener = (online: boolean) => void -type SetupFn = (setOnline: Listener) => (() => void) | undefined - -export class OnlineManager extends Subscribable { - #online = true - #cleanup?: () => void - - #setup: SetupFn - - constructor() { - super() - this.#setup = (onOnline) => { - // addEventListener does not exist in React Native, but window does - // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition - if (!isServer && window.addEventListener) { - const onlineListener = () => onOnline(true) - const offlineListener = () => onOnline(false) - // Listen to online - window.addEventListener('online', onlineListener, false) - window.addEventListener('offline', offlineListener, false) - - return () => { - // Be sure to unsubscribe if a new handler is set - window.removeEventListener('online', onlineListener) - window.removeEventListener('offline', offlineListener) - } - } - - return - } - } - - protected onSubscribe(): void { - if (!this.#cleanup) { - this.setEventListener(this.#setup) - } - } - - protected onUnsubscribe() { - if (!this.hasListeners()) { - this.#cleanup?.() - this.#cleanup = undefined - } - } - - setEventListener(setup: SetupFn): void { - this.#setup = setup - this.#cleanup?.() - this.#cleanup = setup(this.setOnline.bind(this)) - } - - setOnline(online: boolean): void { - const changed = this.#online !== online - - if (changed) { - this.#online = online - this.listeners.forEach((listener) => { - listener(online) - }) - } - } - - isOnline(): boolean { - return this.#online - } -} - -export const onlineManager = new OnlineManager() diff --git a/node_modules/@tanstack/query-core/src/queriesObserver.ts b/node_modules/@tanstack/query-core/src/queriesObserver.ts deleted file mode 100644 index 67dd088..0000000 --- a/node_modules/@tanstack/query-core/src/queriesObserver.ts +++ /dev/null @@ -1,315 +0,0 @@ -import { notifyManager } from './notifyManager' -import { QueryObserver } from './queryObserver' -import { Subscribable } from './subscribable' -import { replaceEqualDeep, shallowEqualObjects } from './utils' -import type { - DefaultedQueryObserverOptions, - QueryObserverOptions, - QueryObserverResult, -} from './types' -import type { QueryClient } from './queryClient' - -function difference(array1: Array, array2: Array): Array { - const excludeSet = new Set(array2) - return array1.filter((x) => !excludeSet.has(x)) -} - -function replaceAt(array: Array, index: number, value: T): Array { - const copy = array.slice(0) - copy[index] = value - return copy -} - -type QueriesObserverListener = (result: Array) => void - -type CombineFn = ( - result: Array, -) => TCombinedResult - -export interface QueriesObserverOptions< - TCombinedResult = Array, -> { - combine?: CombineFn -} - -export class QueriesObserver< - TCombinedResult = Array, -> extends Subscribable { - #client: QueryClient - #result!: Array - #queries: Array - #options?: QueriesObserverOptions - #observers: Array - #combinedResult?: TCombinedResult - #lastCombine?: CombineFn - #lastResult?: Array - #lastQueryHashes?: Array - #observerMatches: Array = [] - - constructor( - client: QueryClient, - queries: Array>, - options?: QueriesObserverOptions, - ) { - super() - - this.#client = client - this.#options = options - this.#queries = [] - this.#observers = [] - this.#result = [] - - this.setQueries(queries) - } - - protected onSubscribe(): void { - if (this.listeners.size === 1) { - this.#observers.forEach((observer) => { - observer.subscribe((result) => { - this.#onUpdate(observer, result) - }) - }) - } - } - - protected onUnsubscribe(): void { - if (!this.listeners.size) { - this.destroy() - } - } - - destroy(): void { - this.listeners = new Set() - this.#observers.forEach((observer) => { - observer.destroy() - }) - } - - setQueries( - queries: Array, - options?: QueriesObserverOptions, - ): void { - this.#queries = queries - this.#options = options - - if (process.env.NODE_ENV !== 'production') { - const queryHashes = queries.map( - (query) => this.#client.defaultQueryOptions(query).queryHash, - ) - if (new Set(queryHashes).size !== queryHashes.length) { - console.warn( - '[QueriesObserver]: Duplicate Queries found. This might result in unexpected behavior.', - ) - } - } - - notifyManager.batch(() => { - const prevObservers = this.#observers - - const newObserverMatches = this.#findMatchingObservers(this.#queries) - - // set options for the new observers to notify of changes - newObserverMatches.forEach((match) => - match.observer.setOptions(match.defaultedQueryOptions), - ) - - const newObservers = newObserverMatches.map((match) => match.observer) - const newResult = newObservers.map((observer) => - observer.getCurrentResult(), - ) - - const hasLengthChange = prevObservers.length !== newObservers.length - const hasIndexChange = newObservers.some( - (observer, index) => observer !== prevObservers[index], - ) - const hasStructuralChange = hasLengthChange || hasIndexChange - - const hasResultChange = hasStructuralChange - ? true - : newResult.some((result, index) => { - const prev = this.#result[index] - return !prev || !shallowEqualObjects(result, prev) - }) - - if (!hasStructuralChange && !hasResultChange) return - - if (hasStructuralChange) { - this.#observerMatches = newObserverMatches - this.#observers = newObservers - } - - this.#result = newResult - - if (!this.hasListeners()) return - - if (hasStructuralChange) { - difference(prevObservers, newObservers).forEach((observer) => { - observer.destroy() - }) - difference(newObservers, prevObservers).forEach((observer) => { - observer.subscribe((result) => { - this.#onUpdate(observer, result) - }) - }) - } - - this.#notify() - }) - } - - getCurrentResult(): Array { - return this.#result - } - - getQueries() { - return this.#observers.map((observer) => observer.getCurrentQuery()) - } - - getObservers() { - return this.#observers - } - - getOptimisticResult( - queries: Array, - combine: CombineFn | undefined, - ): [ - rawResult: Array, - combineResult: (r?: Array) => TCombinedResult, - trackResult: () => Array, - ] { - const matches = this.#findMatchingObservers(queries) - const result = matches.map((match) => - match.observer.getOptimisticResult(match.defaultedQueryOptions), - ) - const queryHashes = matches.map( - (match) => match.defaultedQueryOptions.queryHash, - ) - - return [ - result, - (r?: Array) => { - return this.#combineResult(r ?? result, combine, queryHashes) - }, - () => { - return this.#trackResult(result, matches) - }, - ] - } - - #trackResult( - result: Array, - matches: Array, - ) { - return matches.map((match, index) => { - const observerResult = result[index]! - return !match.defaultedQueryOptions.notifyOnChangeProps - ? match.observer.trackResult(observerResult, (accessedProp) => { - // track property on all observers to ensure proper (synchronized) tracking (#7000) - matches.forEach((m) => { - m.observer.trackProp(accessedProp) - }) - }) - : observerResult - }) - } - - #combineResult( - input: Array, - combine: CombineFn | undefined, - queryHashes?: Array, - ): TCombinedResult { - if (combine) { - const lastHashes = this.#lastQueryHashes - const queryHashesChanged = - queryHashes !== undefined && - lastHashes !== undefined && - (lastHashes.length !== queryHashes.length || - queryHashes.some((hash, i) => hash !== lastHashes[i])) - - if ( - !this.#combinedResult || - this.#result !== this.#lastResult || - queryHashesChanged || - combine !== this.#lastCombine - ) { - this.#lastCombine = combine - this.#lastResult = this.#result - - if (queryHashes !== undefined) { - this.#lastQueryHashes = queryHashes - } - this.#combinedResult = replaceEqualDeep( - this.#combinedResult, - combine(input), - ) - } - - return this.#combinedResult - } - return input as any - } - - #findMatchingObservers( - queries: Array, - ): Array { - const prevObserversMap = new Map>() - - this.#observers.forEach((observer) => { - const key = observer.options.queryHash - if (!key) return - - const previousObservers = prevObserversMap.get(key) - - if (previousObservers) { - previousObservers.push(observer) - } else { - prevObserversMap.set(key, [observer]) - } - }) - - const observers: Array = [] - - queries.forEach((options) => { - const defaultedOptions = this.#client.defaultQueryOptions(options) - const match = prevObserversMap.get(defaultedOptions.queryHash)?.shift() - const observer = - match ?? new QueryObserver(this.#client, defaultedOptions) - - observers.push({ - defaultedQueryOptions: defaultedOptions, - observer, - }) - }) - - return observers - } - - #onUpdate(observer: QueryObserver, result: QueryObserverResult): void { - const index = this.#observers.indexOf(observer) - if (index !== -1) { - this.#result = replaceAt(this.#result, index, result) - this.#notify() - } - } - - #notify(): void { - if (this.hasListeners()) { - const previousResult = this.#combinedResult - const newTracked = this.#trackResult(this.#result, this.#observerMatches) - const newResult = this.#combineResult(newTracked, this.#options?.combine) - - if (previousResult !== newResult) { - notifyManager.batch(() => { - this.listeners.forEach((listener) => { - listener(this.#result) - }) - }) - } - } - } -} - -type QueryObserverMatch = { - defaultedQueryOptions: DefaultedQueryObserverOptions - observer: QueryObserver -} diff --git a/node_modules/@tanstack/query-core/src/query.ts b/node_modules/@tanstack/query-core/src/query.ts deleted file mode 100644 index b29b64c..0000000 --- a/node_modules/@tanstack/query-core/src/query.ts +++ /dev/null @@ -1,756 +0,0 @@ -import { - ensureQueryFn, - noop, - replaceData, - resolveEnabled, - resolveStaleTime, - skipToken, - timeUntilStale, -} from './utils' -import { notifyManager } from './notifyManager' -import { CancelledError, canFetch, createRetryer } from './retryer' -import { Removable } from './removable' -import type { QueryCache } from './queryCache' -import type { QueryClient } from './queryClient' -import type { - CancelOptions, - DefaultError, - FetchStatus, - InitialDataFunction, - OmitKeyof, - QueryFunctionContext, - QueryKey, - QueryMeta, - QueryOptions, - QueryStatus, - SetDataOptions, - StaleTime, -} from './types' -import type { QueryObserver } from './queryObserver' -import type { Retryer } from './retryer' - -// TYPES - -interface QueryConfig< - TQueryFnData, - TError, - TData, - TQueryKey extends QueryKey = QueryKey, -> { - client: QueryClient - queryKey: TQueryKey - queryHash: string - options?: QueryOptions - defaultOptions?: QueryOptions - state?: QueryState -} - -export interface QueryState { - data: TData | undefined - dataUpdateCount: number - dataUpdatedAt: number - error: TError | null - errorUpdateCount: number - errorUpdatedAt: number - fetchFailureCount: number - fetchFailureReason: TError | null - fetchMeta: FetchMeta | null - isInvalidated: boolean - status: QueryStatus - fetchStatus: FetchStatus -} - -export interface FetchContext< - TQueryFnData, - TError, - TData, - TQueryKey extends QueryKey = QueryKey, -> { - fetchFn: () => unknown | Promise - fetchOptions?: FetchOptions - signal: AbortSignal - options: QueryOptions - client: QueryClient - queryKey: TQueryKey - state: QueryState -} - -export interface QueryBehavior< - TQueryFnData = unknown, - TError = DefaultError, - TData = TQueryFnData, - TQueryKey extends QueryKey = QueryKey, -> { - onFetch: ( - context: FetchContext, - query: Query, - ) => void -} - -export type FetchDirection = 'forward' | 'backward' - -export interface FetchMeta { - fetchMore?: { direction: FetchDirection } -} - -export interface FetchOptions { - cancelRefetch?: boolean - meta?: FetchMeta - initialPromise?: Promise -} - -interface FailedAction { - type: 'failed' - failureCount: number - error: TError -} - -interface FetchAction { - type: 'fetch' - meta?: FetchMeta -} - -interface SuccessAction { - data: TData | undefined - type: 'success' - dataUpdatedAt?: number - manual?: boolean -} - -interface ErrorAction { - type: 'error' - error: TError -} - -interface InvalidateAction { - type: 'invalidate' -} - -interface PauseAction { - type: 'pause' -} - -interface ContinueAction { - type: 'continue' -} - -interface SetStateAction { - type: 'setState' - state: Partial> - setStateOptions?: SetStateOptions -} - -export type Action = - | ContinueAction - | ErrorAction - | FailedAction - | FetchAction - | InvalidateAction - | PauseAction - | SetStateAction - | SuccessAction - -export interface SetStateOptions { - meta?: any -} - -// CLASS - -export class Query< - TQueryFnData = unknown, - TError = DefaultError, - TData = TQueryFnData, - TQueryKey extends QueryKey = QueryKey, -> extends Removable { - queryKey: TQueryKey - queryHash: string - options!: QueryOptions - state: QueryState - - #initialState: QueryState - #revertState?: QueryState - #cache: QueryCache - #client: QueryClient - #retryer?: Retryer - observers: Array> - #defaultOptions?: QueryOptions - #abortSignalConsumed: boolean - - constructor(config: QueryConfig) { - super() - - this.#abortSignalConsumed = false - this.#defaultOptions = config.defaultOptions - this.setOptions(config.options) - this.observers = [] - this.#client = config.client - this.#cache = this.#client.getQueryCache() - this.queryKey = config.queryKey - this.queryHash = config.queryHash - this.#initialState = getDefaultState(this.options) - this.state = config.state ?? this.#initialState - this.scheduleGc() - } - get meta(): QueryMeta | undefined { - return this.options.meta - } - - get promise(): Promise | undefined { - return this.#retryer?.promise - } - - setOptions( - options?: QueryOptions, - ): void { - this.options = { ...this.#defaultOptions, ...options } - - this.updateGcTime(this.options.gcTime) - - // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition - if (this.state && this.state.data === undefined) { - const defaultState = getDefaultState(this.options) - if (defaultState.data !== undefined) { - this.setState( - successState(defaultState.data, defaultState.dataUpdatedAt), - ) - this.#initialState = defaultState - } - } - } - - protected optionalRemove() { - if (!this.observers.length && this.state.fetchStatus === 'idle') { - this.#cache.remove(this) - } - } - - setData( - newData: TData, - options?: SetDataOptions & { manual: boolean }, - ): TData { - const data = replaceData(this.state.data, newData, this.options) - - // Set data and mark it as cached - this.#dispatch({ - data, - type: 'success', - dataUpdatedAt: options?.updatedAt, - manual: options?.manual, - }) - - return data - } - - setState( - state: Partial>, - setStateOptions?: SetStateOptions, - ): void { - this.#dispatch({ type: 'setState', state, setStateOptions }) - } - - cancel(options?: CancelOptions): Promise { - const promise = this.#retryer?.promise - this.#retryer?.cancel(options) - return promise ? promise.then(noop).catch(noop) : Promise.resolve() - } - - destroy(): void { - super.destroy() - - this.cancel({ silent: true }) - } - - reset(): void { - this.destroy() - this.setState(this.#initialState) - } - - isActive(): boolean { - return this.observers.some( - (observer) => resolveEnabled(observer.options.enabled, this) !== false, - ) - } - - isDisabled(): boolean { - if (this.getObserversCount() > 0) { - return !this.isActive() - } - // if a query has no observers, it should still be considered disabled if it never attempted a fetch - return ( - this.options.queryFn === skipToken || - this.state.dataUpdateCount + this.state.errorUpdateCount === 0 - ) - } - - isStatic(): boolean { - if (this.getObserversCount() > 0) { - return this.observers.some( - (observer) => - resolveStaleTime(observer.options.staleTime, this) === 'static', - ) - } - - return false - } - - isStale(): boolean { - // check observers first, their `isStale` has the source of truth - // calculated with `isStaleByTime` and it takes `enabled` into account - if (this.getObserversCount() > 0) { - return this.observers.some( - (observer) => observer.getCurrentResult().isStale, - ) - } - - return this.state.data === undefined || this.state.isInvalidated - } - - isStaleByTime(staleTime: StaleTime = 0): boolean { - // no data is always stale - if (this.state.data === undefined) { - return true - } - // static is never stale - if (staleTime === 'static') { - return false - } - // if the query is invalidated, it is stale - if (this.state.isInvalidated) { - return true - } - - return !timeUntilStale(this.state.dataUpdatedAt, staleTime) - } - - onFocus(): void { - const observer = this.observers.find((x) => x.shouldFetchOnWindowFocus()) - - observer?.refetch({ cancelRefetch: false }) - - // Continue fetch if currently paused - this.#retryer?.continue() - } - - onOnline(): void { - const observer = this.observers.find((x) => x.shouldFetchOnReconnect()) - - observer?.refetch({ cancelRefetch: false }) - - // Continue fetch if currently paused - this.#retryer?.continue() - } - - addObserver(observer: QueryObserver): void { - if (!this.observers.includes(observer)) { - this.observers.push(observer) - - // Stop the query from being garbage collected - this.clearGcTimeout() - - this.#cache.notify({ type: 'observerAdded', query: this, observer }) - } - } - - removeObserver(observer: QueryObserver): void { - if (this.observers.includes(observer)) { - this.observers = this.observers.filter((x) => x !== observer) - - if (!this.observers.length) { - // If the transport layer does not support cancellation - // we'll let the query continue so the result can be cached - if (this.#retryer) { - if (this.#abortSignalConsumed) { - this.#retryer.cancel({ revert: true }) - } else { - this.#retryer.cancelRetry() - } - } - - this.scheduleGc() - } - - this.#cache.notify({ type: 'observerRemoved', query: this, observer }) - } - } - - getObserversCount(): number { - return this.observers.length - } - - invalidate(): void { - if (!this.state.isInvalidated) { - this.#dispatch({ type: 'invalidate' }) - } - } - - async fetch( - options?: QueryOptions, - fetchOptions?: FetchOptions, - ): Promise { - if ( - this.state.fetchStatus !== 'idle' && - // If the promise in the retryer is already rejected, we have to definitely - // re-start the fetch; there is a chance that the query is still in a - // pending state when that happens - this.#retryer?.status() !== 'rejected' - ) { - if (this.state.data !== undefined && fetchOptions?.cancelRefetch) { - // Silently cancel current fetch if the user wants to cancel refetch - this.cancel({ silent: true }) - } else if (this.#retryer) { - // make sure that retries that were potentially cancelled due to unmounts can continue - this.#retryer.continueRetry() - // Return current promise if we are already fetching - return this.#retryer.promise - } - } - - // Update config if passed, otherwise the config from the last execution is used - if (options) { - this.setOptions(options) - } - - // Use the options from the first observer with a query function if no function is found. - // This can happen when the query is hydrated or created with setQueryData. - if (!this.options.queryFn) { - const observer = this.observers.find((x) => x.options.queryFn) - if (observer) { - this.setOptions(observer.options) - } - } - - if (process.env.NODE_ENV !== 'production') { - if (!Array.isArray(this.options.queryKey)) { - console.error( - `As of v4, queryKey needs to be an Array. If you are using a string like 'repoData', please change it to an Array, e.g. ['repoData']`, - ) - } - } - - const abortController = new AbortController() - - // Adds an enumerable signal property to the object that - // which sets abortSignalConsumed to true when the signal - // is read. - const addSignalProperty = (object: unknown) => { - Object.defineProperty(object, 'signal', { - enumerable: true, - get: () => { - this.#abortSignalConsumed = true - return abortController.signal - }, - }) - } - - // Create fetch function - const fetchFn = () => { - const queryFn = ensureQueryFn(this.options, fetchOptions) - - // Create query function context - const createQueryFnContext = (): QueryFunctionContext => { - const queryFnContext: OmitKeyof< - QueryFunctionContext, - 'signal' - > = { - client: this.#client, - queryKey: this.queryKey, - meta: this.meta, - } - addSignalProperty(queryFnContext) - return queryFnContext as QueryFunctionContext - } - - const queryFnContext = createQueryFnContext() - - this.#abortSignalConsumed = false - if (this.options.persister) { - return this.options.persister( - queryFn, - queryFnContext, - this as unknown as Query, - ) - } - - return queryFn(queryFnContext) - } - - // Trigger behavior hook - const createFetchContext = (): FetchContext< - TQueryFnData, - TError, - TData, - TQueryKey - > => { - const context: OmitKeyof< - FetchContext, - 'signal' - > = { - fetchOptions, - options: this.options, - queryKey: this.queryKey, - client: this.#client, - state: this.state, - fetchFn, - } - - addSignalProperty(context) - return context as FetchContext - } - - const context = createFetchContext() - - this.options.behavior?.onFetch(context, this as unknown as Query) - - // Store state in case the current fetch needs to be reverted - this.#revertState = this.state - - // Set to fetching state if not already in it - if ( - this.state.fetchStatus === 'idle' || - this.state.fetchMeta !== context.fetchOptions?.meta - ) { - this.#dispatch({ type: 'fetch', meta: context.fetchOptions?.meta }) - } - - // Try to fetch the data - this.#retryer = createRetryer({ - initialPromise: fetchOptions?.initialPromise as - | Promise - | undefined, - fn: context.fetchFn as () => Promise, - onCancel: (error) => { - if (error instanceof CancelledError && error.revert) { - this.setState({ - ...this.#revertState, - fetchStatus: 'idle' as const, - }) - } - abortController.abort() - }, - onFail: (failureCount, error) => { - this.#dispatch({ type: 'failed', failureCount, error }) - }, - onPause: () => { - this.#dispatch({ type: 'pause' }) - }, - onContinue: () => { - this.#dispatch({ type: 'continue' }) - }, - retry: context.options.retry, - retryDelay: context.options.retryDelay, - networkMode: context.options.networkMode, - canRun: () => true, - }) - - try { - const data = await this.#retryer.start() - // this is more of a runtime guard - // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition - if (data === undefined) { - if (process.env.NODE_ENV !== 'production') { - console.error( - `Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}`, - ) - } - throw new Error(`${this.queryHash} data is undefined`) - } - - this.setData(data) - - // Notify cache callback - this.#cache.config.onSuccess?.(data, this as Query) - this.#cache.config.onSettled?.( - data, - this.state.error as any, - this as Query, - ) - return data - } catch (error) { - if (error instanceof CancelledError) { - if (error.silent) { - // silent cancellation implies a new fetch is going to be started, - // so we piggyback onto that promise - return this.#retryer.promise - } else if (error.revert) { - // transform error into reverted state data - // if the initial fetch was cancelled, we have no data, so we have - // to get reject with a CancelledError - if (this.state.data === undefined) { - throw error - } - return this.state.data - } - } - this.#dispatch({ - type: 'error', - error: error as TError, - }) - - // Notify cache callback - this.#cache.config.onError?.( - error as any, - this as Query, - ) - this.#cache.config.onSettled?.( - this.state.data, - error as any, - this as Query, - ) - - throw error // rethrow the error for further handling - } finally { - // Schedule query gc after fetching - this.scheduleGc() - } - } - - #dispatch(action: Action): void { - const reducer = ( - state: QueryState, - ): QueryState => { - switch (action.type) { - case 'failed': - return { - ...state, - fetchFailureCount: action.failureCount, - fetchFailureReason: action.error, - } - case 'pause': - return { - ...state, - fetchStatus: 'paused', - } - case 'continue': - return { - ...state, - fetchStatus: 'fetching', - } - case 'fetch': - return { - ...state, - ...fetchState(state.data, this.options), - fetchMeta: action.meta ?? null, - } - case 'success': - const newState = { - ...state, - ...successState(action.data, action.dataUpdatedAt), - dataUpdateCount: state.dataUpdateCount + 1, - ...(!action.manual && { - fetchStatus: 'idle' as const, - fetchFailureCount: 0, - fetchFailureReason: null, - }), - } - // If fetching ends successfully, we don't need revertState as a fallback anymore. - // For manual updates, capture the state to revert to it in case of a cancellation. - this.#revertState = action.manual ? newState : undefined - - return newState - case 'error': - const error = action.error - return { - ...state, - error, - errorUpdateCount: state.errorUpdateCount + 1, - errorUpdatedAt: Date.now(), - fetchFailureCount: state.fetchFailureCount + 1, - fetchFailureReason: error, - fetchStatus: 'idle', - status: 'error', - // flag existing data as invalidated if we get a background error - // note that "no data" always means stale so we can set unconditionally here - isInvalidated: true, - } - case 'invalidate': - return { - ...state, - isInvalidated: true, - } - case 'setState': - return { - ...state, - ...action.state, - } - } - } - - this.state = reducer(this.state) - - notifyManager.batch(() => { - this.observers.forEach((observer) => { - observer.onQueryUpdate() - }) - - this.#cache.notify({ query: this, type: 'updated', action }) - }) - } -} - -export function fetchState< - TQueryFnData, - TError, - TData, - TQueryKey extends QueryKey, ->( - data: TData | undefined, - options: QueryOptions, -) { - return { - fetchFailureCount: 0, - fetchFailureReason: null, - fetchStatus: canFetch(options.networkMode) ? 'fetching' : 'paused', - ...(data === undefined && - ({ - error: null, - status: 'pending', - } as const)), - } as const -} - -function successState(data: TData | undefined, dataUpdatedAt?: number) { - return { - data, - dataUpdatedAt: dataUpdatedAt ?? Date.now(), - error: null, - isInvalidated: false, - status: 'success' as const, - } -} - -function getDefaultState< - TQueryFnData, - TError, - TData, - TQueryKey extends QueryKey, ->( - options: QueryOptions, -): QueryState { - const data = - typeof options.initialData === 'function' - ? (options.initialData as InitialDataFunction)() - : options.initialData - - const hasData = data !== undefined - - const initialDataUpdatedAt = hasData - ? typeof options.initialDataUpdatedAt === 'function' - ? options.initialDataUpdatedAt() - : options.initialDataUpdatedAt - : 0 - - return { - data, - dataUpdateCount: 0, - dataUpdatedAt: hasData ? (initialDataUpdatedAt ?? Date.now()) : 0, - error: null, - errorUpdateCount: 0, - errorUpdatedAt: 0, - fetchFailureCount: 0, - fetchFailureReason: null, - fetchMeta: null, - isInvalidated: false, - status: hasData ? 'success' : 'pending', - fetchStatus: 'idle', - } -} diff --git a/node_modules/@tanstack/query-core/src/queryCache.ts b/node_modules/@tanstack/query-core/src/queryCache.ts deleted file mode 100644 index dd7123e..0000000 --- a/node_modules/@tanstack/query-core/src/queryCache.ts +++ /dev/null @@ -1,223 +0,0 @@ -import { hashQueryKeyByOptions, matchQuery } from './utils' -import { Query } from './query' -import { notifyManager } from './notifyManager' -import { Subscribable } from './subscribable' -import type { QueryFilters } from './utils' -import type { Action, QueryState } from './query' -import type { - DefaultError, - NotifyEvent, - QueryKey, - QueryOptions, - WithRequired, -} from './types' -import type { QueryClient } from './queryClient' -import type { QueryObserver } from './queryObserver' - -// TYPES - -interface QueryCacheConfig { - onError?: ( - error: DefaultError, - query: Query, - ) => void - onSuccess?: (data: unknown, query: Query) => void - onSettled?: ( - data: unknown | undefined, - error: DefaultError | null, - query: Query, - ) => void -} - -interface NotifyEventQueryAdded extends NotifyEvent { - type: 'added' - query: Query -} - -interface NotifyEventQueryRemoved extends NotifyEvent { - type: 'removed' - query: Query -} - -interface NotifyEventQueryUpdated extends NotifyEvent { - type: 'updated' - query: Query - action: Action -} - -interface NotifyEventQueryObserverAdded extends NotifyEvent { - type: 'observerAdded' - query: Query - observer: QueryObserver -} - -interface NotifyEventQueryObserverRemoved extends NotifyEvent { - type: 'observerRemoved' - query: Query - observer: QueryObserver -} - -interface NotifyEventQueryObserverResultsUpdated extends NotifyEvent { - type: 'observerResultsUpdated' - query: Query -} - -interface NotifyEventQueryObserverOptionsUpdated extends NotifyEvent { - type: 'observerOptionsUpdated' - query: Query - observer: QueryObserver -} - -export type QueryCacheNotifyEvent = - | NotifyEventQueryAdded - | NotifyEventQueryRemoved - | NotifyEventQueryUpdated - | NotifyEventQueryObserverAdded - | NotifyEventQueryObserverRemoved - | NotifyEventQueryObserverResultsUpdated - | NotifyEventQueryObserverOptionsUpdated - -type QueryCacheListener = (event: QueryCacheNotifyEvent) => void - -export interface QueryStore { - has: (queryHash: string) => boolean - set: (queryHash: string, query: Query) => void - get: (queryHash: string) => Query | undefined - delete: (queryHash: string) => void - values: () => IterableIterator -} - -// CLASS - -export class QueryCache extends Subscribable { - #queries: QueryStore - - constructor(public config: QueryCacheConfig = {}) { - super() - this.#queries = new Map() - } - - build< - TQueryFnData = unknown, - TError = DefaultError, - TData = TQueryFnData, - TQueryKey extends QueryKey = QueryKey, - >( - client: QueryClient, - options: WithRequired< - QueryOptions, - 'queryKey' - >, - state?: QueryState, - ): Query { - const queryKey = options.queryKey - const queryHash = - options.queryHash ?? hashQueryKeyByOptions(queryKey, options) - let query = this.get(queryHash) - - if (!query) { - query = new Query({ - client, - queryKey, - queryHash, - options: client.defaultQueryOptions(options), - state, - defaultOptions: client.getQueryDefaults(queryKey), - }) - this.add(query) - } - - return query - } - - add(query: Query): void { - if (!this.#queries.has(query.queryHash)) { - this.#queries.set(query.queryHash, query) - - this.notify({ - type: 'added', - query, - }) - } - } - - remove(query: Query): void { - const queryInMap = this.#queries.get(query.queryHash) - - if (queryInMap) { - query.destroy() - - if (queryInMap === query) { - this.#queries.delete(query.queryHash) - } - - this.notify({ type: 'removed', query }) - } - } - - clear(): void { - notifyManager.batch(() => { - this.getAll().forEach((query) => { - this.remove(query) - }) - }) - } - - get< - TQueryFnData = unknown, - TError = DefaultError, - TData = TQueryFnData, - TQueryKey extends QueryKey = QueryKey, - >( - queryHash: string, - ): Query | undefined { - return this.#queries.get(queryHash) as - | Query - | undefined - } - - getAll(): Array { - return [...this.#queries.values()] - } - - find( - filters: WithRequired, - ): Query | undefined { - const defaultedFilters = { exact: true, ...filters } - - return this.getAll().find((query) => - matchQuery(defaultedFilters, query), - ) as Query | undefined - } - - findAll(filters: QueryFilters = {}): Array { - const queries = this.getAll() - return Object.keys(filters).length > 0 - ? queries.filter((query) => matchQuery(filters, query)) - : queries - } - - notify(event: QueryCacheNotifyEvent): void { - notifyManager.batch(() => { - this.listeners.forEach((listener) => { - listener(event) - }) - }) - } - - onFocus(): void { - notifyManager.batch(() => { - this.getAll().forEach((query) => { - query.onFocus() - }) - }) - } - - onOnline(): void { - notifyManager.batch(() => { - this.getAll().forEach((query) => { - query.onOnline() - }) - }) - } -} diff --git a/node_modules/@tanstack/query-core/src/queryClient.ts b/node_modules/@tanstack/query-core/src/queryClient.ts deleted file mode 100644 index 80cc366..0000000 --- a/node_modules/@tanstack/query-core/src/queryClient.ts +++ /dev/null @@ -1,648 +0,0 @@ -import { - functionalUpdate, - hashKey, - hashQueryKeyByOptions, - noop, - partialMatchKey, - resolveStaleTime, - skipToken, -} from './utils' -import { QueryCache } from './queryCache' -import { MutationCache } from './mutationCache' -import { focusManager } from './focusManager' -import { onlineManager } from './onlineManager' -import { notifyManager } from './notifyManager' -import { infiniteQueryBehavior } from './infiniteQueryBehavior' -import type { - CancelOptions, - DefaultError, - DefaultOptions, - DefaultedQueryObserverOptions, - EnsureInfiniteQueryDataOptions, - EnsureQueryDataOptions, - FetchInfiniteQueryOptions, - FetchQueryOptions, - InferDataFromTag, - InferErrorFromTag, - InfiniteData, - InvalidateOptions, - InvalidateQueryFilters, - MutationKey, - MutationObserverOptions, - MutationOptions, - NoInfer, - OmitKeyof, - QueryClientConfig, - QueryKey, - QueryObserverOptions, - QueryOptions, - RefetchOptions, - RefetchQueryFilters, - ResetOptions, - SetDataOptions, -} from './types' -import type { QueryState } from './query' -import type { MutationFilters, QueryFilters, Updater } from './utils' - -// TYPES - -interface QueryDefaults { - queryKey: QueryKey - defaultOptions: OmitKeyof, 'queryKey'> -} - -interface MutationDefaults { - mutationKey: MutationKey - defaultOptions: MutationOptions -} - -// CLASS - -export class QueryClient { - #queryCache: QueryCache - #mutationCache: MutationCache - #defaultOptions: DefaultOptions - #queryDefaults: Map - #mutationDefaults: Map - #mountCount: number - #unsubscribeFocus?: () => void - #unsubscribeOnline?: () => void - - constructor(config: QueryClientConfig = {}) { - this.#queryCache = config.queryCache || new QueryCache() - this.#mutationCache = config.mutationCache || new MutationCache() - this.#defaultOptions = config.defaultOptions || {} - this.#queryDefaults = new Map() - this.#mutationDefaults = new Map() - this.#mountCount = 0 - } - - mount(): void { - this.#mountCount++ - if (this.#mountCount !== 1) return - - this.#unsubscribeFocus = focusManager.subscribe(async (focused) => { - if (focused) { - await this.resumePausedMutations() - this.#queryCache.onFocus() - } - }) - this.#unsubscribeOnline = onlineManager.subscribe(async (online) => { - if (online) { - await this.resumePausedMutations() - this.#queryCache.onOnline() - } - }) - } - - unmount(): void { - this.#mountCount-- - if (this.#mountCount !== 0) return - - this.#unsubscribeFocus?.() - this.#unsubscribeFocus = undefined - - this.#unsubscribeOnline?.() - this.#unsubscribeOnline = undefined - } - - isFetching = QueryFilters>( - filters?: TQueryFilters, - ): number { - return this.#queryCache.findAll({ ...filters, fetchStatus: 'fetching' }) - .length - } - - isMutating< - TMutationFilters extends MutationFilters = MutationFilters, - >(filters?: TMutationFilters): number { - return this.#mutationCache.findAll({ ...filters, status: 'pending' }).length - } - - /** - * Imperative (non-reactive) way to retrieve data for a QueryKey. - * Should only be used in callbacks or functions where reading the latest data is necessary, e.g. for optimistic updates. - * - * Hint: Do not use this function inside a component, because it won't receive updates. - * Use `useQuery` to create a `QueryObserver` that subscribes to changes. - */ - getQueryData< - TQueryFnData = unknown, - TTaggedQueryKey extends QueryKey = QueryKey, - TInferredQueryFnData = InferDataFromTag, - >(queryKey: TTaggedQueryKey): TInferredQueryFnData | undefined { - const options = this.defaultQueryOptions({ queryKey }) - - return this.#queryCache.get(options.queryHash)?.state - .data - } - - ensureQueryData< - TQueryFnData, - TError = DefaultError, - TData = TQueryFnData, - TQueryKey extends QueryKey = QueryKey, - >( - options: EnsureQueryDataOptions, - ): Promise { - const defaultedOptions = this.defaultQueryOptions(options) - const query = this.#queryCache.build(this, defaultedOptions) - const cachedData = query.state.data - - if (cachedData === undefined) { - return this.fetchQuery(options) - } - - if ( - options.revalidateIfStale && - query.isStaleByTime(resolveStaleTime(defaultedOptions.staleTime, query)) - ) { - void this.prefetchQuery(defaultedOptions) - } - - return Promise.resolve(cachedData) - } - - getQueriesData< - TQueryFnData = unknown, - TQueryFilters extends QueryFilters = QueryFilters, - >(filters: TQueryFilters): Array<[QueryKey, TQueryFnData | undefined]> { - return this.#queryCache.findAll(filters).map(({ queryKey, state }) => { - const data = state.data as TQueryFnData | undefined - return [queryKey, data] - }) - } - - setQueryData< - TQueryFnData = unknown, - TTaggedQueryKey extends QueryKey = QueryKey, - TInferredQueryFnData = InferDataFromTag, - >( - queryKey: TTaggedQueryKey, - updater: Updater< - NoInfer | undefined, - NoInfer | undefined - >, - options?: SetDataOptions, - ): NoInfer | undefined { - const defaultedOptions = this.defaultQueryOptions< - any, - any, - unknown, - any, - QueryKey - >({ queryKey }) - - const query = this.#queryCache.get( - defaultedOptions.queryHash, - ) - const prevData = query?.state.data - const data = functionalUpdate(updater, prevData) - - if (data === undefined) { - return undefined - } - - return this.#queryCache - .build(this, defaultedOptions) - .setData(data, { ...options, manual: true }) - } - - setQueriesData< - TQueryFnData, - TQueryFilters extends QueryFilters = QueryFilters, - >( - filters: TQueryFilters, - updater: Updater< - NoInfer | undefined, - NoInfer | undefined - >, - options?: SetDataOptions, - ): Array<[QueryKey, TQueryFnData | undefined]> { - return notifyManager.batch(() => - this.#queryCache - .findAll(filters) - .map(({ queryKey }) => [ - queryKey, - this.setQueryData(queryKey, updater, options), - ]), - ) - } - - getQueryState< - TQueryFnData = unknown, - TError = DefaultError, - TTaggedQueryKey extends QueryKey = QueryKey, - TInferredQueryFnData = InferDataFromTag, - TInferredError = InferErrorFromTag, - >( - queryKey: TTaggedQueryKey, - ): QueryState | undefined { - const options = this.defaultQueryOptions({ queryKey }) - return this.#queryCache.get( - options.queryHash, - )?.state - } - - removeQueries( - filters?: QueryFilters, - ): void { - const queryCache = this.#queryCache - notifyManager.batch(() => { - queryCache.findAll(filters).forEach((query) => { - queryCache.remove(query) - }) - }) - } - - resetQueries( - filters?: QueryFilters, - options?: ResetOptions, - ): Promise { - const queryCache = this.#queryCache - - return notifyManager.batch(() => { - queryCache.findAll(filters).forEach((query) => { - query.reset() - }) - return this.refetchQueries( - { - type: 'active', - ...filters, - }, - options, - ) - }) - } - - cancelQueries( - filters?: QueryFilters, - cancelOptions: CancelOptions = {}, - ): Promise { - const defaultedCancelOptions = { revert: true, ...cancelOptions } - - const promises = notifyManager.batch(() => - this.#queryCache - .findAll(filters) - .map((query) => query.cancel(defaultedCancelOptions)), - ) - - return Promise.all(promises).then(noop).catch(noop) - } - - invalidateQueries( - filters?: InvalidateQueryFilters, - options: InvalidateOptions = {}, - ): Promise { - return notifyManager.batch(() => { - this.#queryCache.findAll(filters).forEach((query) => { - query.invalidate() - }) - - if (filters?.refetchType === 'none') { - return Promise.resolve() - } - return this.refetchQueries( - { - ...filters, - type: filters?.refetchType ?? filters?.type ?? 'active', - }, - options, - ) - }) - } - - refetchQueries( - filters?: RefetchQueryFilters, - options: RefetchOptions = {}, - ): Promise { - const fetchOptions = { - ...options, - cancelRefetch: options.cancelRefetch ?? true, - } - const promises = notifyManager.batch(() => - this.#queryCache - .findAll(filters) - .filter((query) => !query.isDisabled() && !query.isStatic()) - .map((query) => { - let promise = query.fetch(undefined, fetchOptions) - if (!fetchOptions.throwOnError) { - promise = promise.catch(noop) - } - return query.state.fetchStatus === 'paused' - ? Promise.resolve() - : promise - }), - ) - - return Promise.all(promises).then(noop) - } - - fetchQuery< - TQueryFnData, - TError = DefaultError, - TData = TQueryFnData, - TQueryKey extends QueryKey = QueryKey, - TPageParam = never, - >( - options: FetchQueryOptions< - TQueryFnData, - TError, - TData, - TQueryKey, - TPageParam - >, - ): Promise { - const defaultedOptions = this.defaultQueryOptions(options) - - // https://github.com/tannerlinsley/react-query/issues/652 - if (defaultedOptions.retry === undefined) { - defaultedOptions.retry = false - } - - const query = this.#queryCache.build(this, defaultedOptions) - - return query.isStaleByTime( - resolveStaleTime(defaultedOptions.staleTime, query), - ) - ? query.fetch(defaultedOptions) - : Promise.resolve(query.state.data as TData) - } - - prefetchQuery< - TQueryFnData = unknown, - TError = DefaultError, - TData = TQueryFnData, - TQueryKey extends QueryKey = QueryKey, - >( - options: FetchQueryOptions, - ): Promise { - return this.fetchQuery(options).then(noop).catch(noop) - } - - fetchInfiniteQuery< - TQueryFnData, - TError = DefaultError, - TData = TQueryFnData, - TQueryKey extends QueryKey = QueryKey, - TPageParam = unknown, - >( - options: FetchInfiniteQueryOptions< - TQueryFnData, - TError, - TData, - TQueryKey, - TPageParam - >, - ): Promise> { - options.behavior = infiniteQueryBehavior< - TQueryFnData, - TError, - TData, - TPageParam - >(options.pages) - return this.fetchQuery(options as any) - } - - prefetchInfiniteQuery< - TQueryFnData, - TError = DefaultError, - TData = TQueryFnData, - TQueryKey extends QueryKey = QueryKey, - TPageParam = unknown, - >( - options: FetchInfiniteQueryOptions< - TQueryFnData, - TError, - TData, - TQueryKey, - TPageParam - >, - ): Promise { - return this.fetchInfiniteQuery(options).then(noop).catch(noop) - } - - ensureInfiniteQueryData< - TQueryFnData, - TError = DefaultError, - TData = TQueryFnData, - TQueryKey extends QueryKey = QueryKey, - TPageParam = unknown, - >( - options: EnsureInfiniteQueryDataOptions< - TQueryFnData, - TError, - TData, - TQueryKey, - TPageParam - >, - ): Promise> { - options.behavior = infiniteQueryBehavior< - TQueryFnData, - TError, - TData, - TPageParam - >(options.pages) - - return this.ensureQueryData(options as any) - } - - resumePausedMutations(): Promise { - if (onlineManager.isOnline()) { - return this.#mutationCache.resumePausedMutations() - } - return Promise.resolve() - } - - getQueryCache(): QueryCache { - return this.#queryCache - } - - getMutationCache(): MutationCache { - return this.#mutationCache - } - - getDefaultOptions(): DefaultOptions { - return this.#defaultOptions - } - - setDefaultOptions(options: DefaultOptions): void { - this.#defaultOptions = options - } - - setQueryDefaults< - TQueryFnData = unknown, - TError = DefaultError, - TData = TQueryFnData, - TQueryData = TQueryFnData, - >( - queryKey: QueryKey, - options: Partial< - OmitKeyof< - QueryObserverOptions, - 'queryKey' - > - >, - ): void { - this.#queryDefaults.set(hashKey(queryKey), { - queryKey, - defaultOptions: options, - }) - } - - getQueryDefaults( - queryKey: QueryKey, - ): OmitKeyof, 'queryKey'> { - const defaults = [...this.#queryDefaults.values()] - - const result: OmitKeyof< - QueryObserverOptions, - 'queryKey' - > = {} - - defaults.forEach((queryDefault) => { - if (partialMatchKey(queryKey, queryDefault.queryKey)) { - Object.assign(result, queryDefault.defaultOptions) - } - }) - return result - } - - setMutationDefaults< - TData = unknown, - TError = DefaultError, - TVariables = void, - TOnMutateResult = unknown, - >( - mutationKey: MutationKey, - options: OmitKeyof< - MutationObserverOptions, - 'mutationKey' - >, - ): void { - this.#mutationDefaults.set(hashKey(mutationKey), { - mutationKey, - defaultOptions: options, - }) - } - - getMutationDefaults( - mutationKey: MutationKey, - ): OmitKeyof, 'mutationKey'> { - const defaults = [...this.#mutationDefaults.values()] - - const result: OmitKeyof< - MutationObserverOptions, - 'mutationKey' - > = {} - - defaults.forEach((queryDefault) => { - if (partialMatchKey(mutationKey, queryDefault.mutationKey)) { - Object.assign(result, queryDefault.defaultOptions) - } - }) - - return result - } - - defaultQueryOptions< - TQueryFnData = unknown, - TError = DefaultError, - TData = TQueryFnData, - TQueryData = TQueryFnData, - TQueryKey extends QueryKey = QueryKey, - TPageParam = never, - >( - options: - | QueryObserverOptions< - TQueryFnData, - TError, - TData, - TQueryData, - TQueryKey, - TPageParam - > - | DefaultedQueryObserverOptions< - TQueryFnData, - TError, - TData, - TQueryData, - TQueryKey - >, - ): DefaultedQueryObserverOptions< - TQueryFnData, - TError, - TData, - TQueryData, - TQueryKey - > { - if (options._defaulted) { - return options as DefaultedQueryObserverOptions< - TQueryFnData, - TError, - TData, - TQueryData, - TQueryKey - > - } - - const defaultedOptions = { - ...this.#defaultOptions.queries, - ...this.getQueryDefaults(options.queryKey), - ...options, - _defaulted: true, - } - - if (!defaultedOptions.queryHash) { - defaultedOptions.queryHash = hashQueryKeyByOptions( - defaultedOptions.queryKey, - defaultedOptions, - ) - } - - // dependent default values - if (defaultedOptions.refetchOnReconnect === undefined) { - defaultedOptions.refetchOnReconnect = - defaultedOptions.networkMode !== 'always' - } - if (defaultedOptions.throwOnError === undefined) { - defaultedOptions.throwOnError = !!defaultedOptions.suspense - } - - if (!defaultedOptions.networkMode && defaultedOptions.persister) { - defaultedOptions.networkMode = 'offlineFirst' - } - - if (defaultedOptions.queryFn === skipToken) { - defaultedOptions.enabled = false - } - - return defaultedOptions as DefaultedQueryObserverOptions< - TQueryFnData, - TError, - TData, - TQueryData, - TQueryKey - > - } - - defaultMutationOptions>( - options?: T, - ): T { - if (options?._defaulted) { - return options - } - return { - ...this.#defaultOptions.mutations, - ...(options?.mutationKey && - this.getMutationDefaults(options.mutationKey)), - ...options, - _defaulted: true, - } as T - } - - clear(): void { - this.#queryCache.clear() - this.#mutationCache.clear() - } -} diff --git a/node_modules/@tanstack/query-core/src/queryObserver.ts b/node_modules/@tanstack/query-core/src/queryObserver.ts deleted file mode 100644 index 463407a..0000000 --- a/node_modules/@tanstack/query-core/src/queryObserver.ts +++ /dev/null @@ -1,828 +0,0 @@ -import { focusManager } from './focusManager' -import { notifyManager } from './notifyManager' -import { fetchState } from './query' -import { Subscribable } from './subscribable' -import { pendingThenable } from './thenable' -import { - isServer, - isValidTimeout, - noop, - replaceData, - resolveEnabled, - resolveStaleTime, - shallowEqualObjects, - timeUntilStale, -} from './utils' -import { timeoutManager } from './timeoutManager' -import type { ManagedTimerId } from './timeoutManager' -import type { FetchOptions, Query, QueryState } from './query' -import type { QueryClient } from './queryClient' -import type { PendingThenable, Thenable } from './thenable' -import type { - DefaultError, - DefaultedQueryObserverOptions, - PlaceholderDataFunction, - QueryKey, - QueryObserverBaseResult, - QueryObserverOptions, - QueryObserverResult, - RefetchOptions, -} from './types' - -type QueryObserverListener = ( - result: QueryObserverResult, -) => void - -interface ObserverFetchOptions extends FetchOptions { - throwOnError?: boolean -} - -export class QueryObserver< - TQueryFnData = unknown, - TError = DefaultError, - TData = TQueryFnData, - TQueryData = TQueryFnData, - TQueryKey extends QueryKey = QueryKey, -> extends Subscribable> { - #client: QueryClient - #currentQuery: Query = undefined! - #currentQueryInitialState: QueryState = undefined! - #currentResult: QueryObserverResult = undefined! - #currentResultState?: QueryState - #currentResultOptions?: QueryObserverOptions< - TQueryFnData, - TError, - TData, - TQueryData, - TQueryKey - > - #currentThenable: Thenable - #selectError: TError | null - #selectFn?: (data: TQueryData) => TData - #selectResult?: TData - // This property keeps track of the last query with defined data. - // It will be used to pass the previous data and query to the placeholder function between renders. - #lastQueryWithDefinedData?: Query - #staleTimeoutId?: ManagedTimerId - #refetchIntervalId?: ManagedTimerId - #currentRefetchInterval?: number | false - #trackedProps = new Set() - - constructor( - client: QueryClient, - public options: QueryObserverOptions< - TQueryFnData, - TError, - TData, - TQueryData, - TQueryKey - >, - ) { - super() - - this.#client = client - this.#selectError = null - this.#currentThenable = pendingThenable() - - this.bindMethods() - this.setOptions(options) - } - - protected bindMethods(): void { - this.refetch = this.refetch.bind(this) - } - - protected onSubscribe(): void { - if (this.listeners.size === 1) { - this.#currentQuery.addObserver(this) - - if (shouldFetchOnMount(this.#currentQuery, this.options)) { - this.#executeFetch() - } else { - this.updateResult() - } - - this.#updateTimers() - } - } - - protected onUnsubscribe(): void { - if (!this.hasListeners()) { - this.destroy() - } - } - - shouldFetchOnReconnect(): boolean { - return shouldFetchOn( - this.#currentQuery, - this.options, - this.options.refetchOnReconnect, - ) - } - - shouldFetchOnWindowFocus(): boolean { - return shouldFetchOn( - this.#currentQuery, - this.options, - this.options.refetchOnWindowFocus, - ) - } - - destroy(): void { - this.listeners = new Set() - this.#clearStaleTimeout() - this.#clearRefetchInterval() - this.#currentQuery.removeObserver(this) - } - - setOptions( - options: QueryObserverOptions< - TQueryFnData, - TError, - TData, - TQueryData, - TQueryKey - >, - ): void { - const prevOptions = this.options - const prevQuery = this.#currentQuery - - this.options = this.#client.defaultQueryOptions(options) - - if ( - this.options.enabled !== undefined && - 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', - ) - } - - this.#updateQuery() - this.#currentQuery.setOptions(this.options) - - if ( - prevOptions._defaulted && - !shallowEqualObjects(this.options, prevOptions) - ) { - this.#client.getQueryCache().notify({ - type: 'observerOptionsUpdated', - query: this.#currentQuery, - observer: this, - }) - } - - const mounted = this.hasListeners() - - // Fetch if there are subscribers - if ( - mounted && - shouldFetchOptionally( - this.#currentQuery, - prevQuery, - this.options, - prevOptions, - ) - ) { - this.#executeFetch() - } - - // Update result - this.updateResult() - - // Update stale interval if needed - 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() - } - - const nextRefetchInterval = this.#computeRefetchInterval() - - // Update refetch interval if needed - if ( - mounted && - (this.#currentQuery !== prevQuery || - resolveEnabled(this.options.enabled, this.#currentQuery) !== - resolveEnabled(prevOptions.enabled, this.#currentQuery) || - nextRefetchInterval !== this.#currentRefetchInterval) - ) { - this.#updateRefetchInterval(nextRefetchInterval) - } - } - - getOptimisticResult( - options: DefaultedQueryObserverOptions< - TQueryFnData, - TError, - TData, - TQueryData, - TQueryKey - >, - ): QueryObserverResult { - const query = this.#client.getQueryCache().build(this.#client, options) - - const result = this.createResult(query, options) - - if (shouldAssignObserverCurrentProperties(this, result)) { - // this assigns the optimistic result to the current Observer - // because if the query function changes, useQuery will be performing - // an effect where it would fetch again. - // When the fetch finishes, we perform a deep data cloning in order - // to reuse objects references. This deep data clone is performed against - // the `observer.currentResult.data` property - // When QueryKey changes, we refresh the query and get new `optimistic` - // result, while we leave the `observer.currentResult`, so when new data - // arrives, it finds the old `observer.currentResult` which is related - // to the old QueryKey. Which means that currentResult and selectData are - // out of sync already. - // To solve this, we move the cursor of the currentResult every time - // an observer reads an optimistic value. - - // When keeping the previous data, the result doesn't change until new - // data arrives. - this.#currentResult = result - this.#currentResultOptions = this.options - this.#currentResultState = this.#currentQuery.state - } - return result - } - - getCurrentResult(): QueryObserverResult { - return this.#currentResult - } - - trackResult( - result: QueryObserverResult, - onPropTracked?: (key: keyof QueryObserverResult) => void, - ): QueryObserverResult { - return new Proxy(result, { - get: (target, key) => { - this.trackProp(key as keyof QueryObserverResult) - onPropTracked?.(key as keyof QueryObserverResult) - if (key === 'promise') { - this.trackProp('data') - if ( - !this.options.experimental_prefetchInRender && - this.#currentThenable.status === 'pending' - ) { - this.#currentThenable.reject( - new Error( - 'experimental_prefetchInRender feature flag is not enabled', - ), - ) - } - } - return Reflect.get(target, key) - }, - }) - } - - trackProp(key: keyof QueryObserverResult) { - this.#trackedProps.add(key) - } - - getCurrentQuery(): Query { - return this.#currentQuery - } - - refetch({ ...options }: RefetchOptions = {}): Promise< - QueryObserverResult - > { - return this.fetch({ - ...options, - }) - } - - fetchOptimistic( - options: QueryObserverOptions< - TQueryFnData, - TError, - TData, - TQueryData, - TQueryKey - >, - ): Promise> { - const defaultedOptions = this.#client.defaultQueryOptions(options) - - const query = this.#client - .getQueryCache() - .build(this.#client, defaultedOptions) - - return query.fetch().then(() => this.createResult(query, defaultedOptions)) - } - - protected fetch( - fetchOptions: ObserverFetchOptions, - ): Promise> { - return this.#executeFetch({ - ...fetchOptions, - cancelRefetch: fetchOptions.cancelRefetch ?? true, - }).then(() => { - this.updateResult() - return this.#currentResult - }) - } - - #executeFetch( - fetchOptions?: Omit, - ): Promise { - // Make sure we reference the latest query as the current one might have been removed - this.#updateQuery() - - // Fetch - let promise: Promise = this.#currentQuery.fetch( - this.options, - fetchOptions, - ) - - if (!fetchOptions?.throwOnError) { - promise = promise.catch(noop) - } - - return promise - } - - #updateStaleTimeout(): void { - this.#clearStaleTimeout() - const staleTime = resolveStaleTime( - this.options.staleTime, - this.#currentQuery, - ) - - if (isServer || this.#currentResult.isStale || !isValidTimeout(staleTime)) { - return - } - - const time = timeUntilStale(this.#currentResult.dataUpdatedAt, staleTime) - - // The timeout is sometimes triggered 1 ms before the stale time expiration. - // To mitigate this issue we always add 1 ms to the timeout. - const timeout = time + 1 - - this.#staleTimeoutId = timeoutManager.setTimeout(() => { - if (!this.#currentResult.isStale) { - this.updateResult() - } - }, timeout) - } - - #computeRefetchInterval() { - return ( - (typeof this.options.refetchInterval === 'function' - ? this.options.refetchInterval(this.#currentQuery) - : this.options.refetchInterval) ?? false - ) - } - - #updateRefetchInterval(nextInterval: number | false): void { - this.#clearRefetchInterval() - - this.#currentRefetchInterval = nextInterval - - if ( - isServer || - resolveEnabled(this.options.enabled, this.#currentQuery) === false || - !isValidTimeout(this.#currentRefetchInterval) || - this.#currentRefetchInterval === 0 - ) { - return - } - - this.#refetchIntervalId = timeoutManager.setInterval(() => { - if ( - this.options.refetchIntervalInBackground || - focusManager.isFocused() - ) { - this.#executeFetch() - } - }, this.#currentRefetchInterval) - } - - #updateTimers(): void { - this.#updateStaleTimeout() - this.#updateRefetchInterval(this.#computeRefetchInterval()) - } - - #clearStaleTimeout(): void { - if (this.#staleTimeoutId) { - timeoutManager.clearTimeout(this.#staleTimeoutId) - this.#staleTimeoutId = undefined - } - } - - #clearRefetchInterval(): void { - if (this.#refetchIntervalId) { - timeoutManager.clearInterval(this.#refetchIntervalId) - this.#refetchIntervalId = undefined - } - } - - protected createResult( - query: Query, - options: QueryObserverOptions< - TQueryFnData, - TError, - TData, - TQueryData, - TQueryKey - >, - ): QueryObserverResult { - const prevQuery = this.#currentQuery - const prevOptions = this.options - const prevResult = this.#currentResult as - | QueryObserverResult - | undefined - const prevResultState = this.#currentResultState - const prevResultOptions = this.#currentResultOptions - const queryChange = query !== prevQuery - const queryInitialState = queryChange - ? query.state - : this.#currentQueryInitialState - - const { state } = query - let newState = { ...state } - let isPlaceholderData = false - let data: TData | undefined - - // Optimistically set result in fetching state if needed - if (options._optimisticResults) { - const mounted = this.hasListeners() - - const fetchOnMount = !mounted && shouldFetchOnMount(query, options) - - const fetchOptionally = - mounted && shouldFetchOptionally(query, prevQuery, options, prevOptions) - - if (fetchOnMount || fetchOptionally) { - newState = { - ...newState, - ...fetchState(state.data, query.options), - } - } - if (options._optimisticResults === 'isRestoring') { - newState.fetchStatus = 'idle' - } - } - - let { error, errorUpdatedAt, status } = newState - - // Per default, use query data - data = newState.data as unknown as TData - let skipSelect = false - - // use placeholderData if needed - if ( - options.placeholderData !== undefined && - data === undefined && - status === 'pending' - ) { - let placeholderData - - // Memoize placeholder data - if ( - prevResult?.isPlaceholderData && - options.placeholderData === prevResultOptions?.placeholderData - ) { - placeholderData = prevResult.data - // we have to skip select when reading this memoization - // because prevResult.data is already "selected" - skipSelect = true - } else { - // compute placeholderData - placeholderData = - typeof options.placeholderData === 'function' - ? ( - options.placeholderData as unknown as PlaceholderDataFunction - )( - this.#lastQueryWithDefinedData?.state.data, - this.#lastQueryWithDefinedData as any, - ) - : options.placeholderData - } - - if (placeholderData !== undefined) { - status = 'success' - data = replaceData( - prevResult?.data, - placeholderData as unknown, - options, - ) as TData - isPlaceholderData = true - } - } - - // Select data if needed - // this also runs placeholderData through the select function - if (options.select && data !== undefined && !skipSelect) { - // Memoize select result - if ( - prevResult && - data === prevResultState?.data && - options.select === this.#selectFn - ) { - data = this.#selectResult - } else { - try { - this.#selectFn = options.select - data = options.select(data as any) - data = replaceData(prevResult?.data, data, options) - this.#selectResult = data - this.#selectError = null - } catch (selectError) { - this.#selectError = selectError as TError - } - } - } - - if (this.#selectError) { - error = this.#selectError - data = this.#selectResult - errorUpdatedAt = Date.now() - status = 'error' - } - - const isFetching = newState.fetchStatus === 'fetching' - const isPending = status === 'pending' - const isError = status === 'error' - - const isLoading = isPending && isFetching - const hasData = data !== undefined - - const result: QueryObserverBaseResult = { - status, - fetchStatus: newState.fetchStatus, - isPending, - isSuccess: status === 'success', - isError, - isInitialLoading: isLoading, - isLoading, - data, - dataUpdatedAt: newState.dataUpdatedAt, - error, - errorUpdatedAt, - failureCount: newState.fetchFailureCount, - failureReason: newState.fetchFailureReason, - errorUpdateCount: newState.errorUpdateCount, - isFetched: newState.dataUpdateCount > 0 || newState.errorUpdateCount > 0, - isFetchedAfterMount: - newState.dataUpdateCount > queryInitialState.dataUpdateCount || - newState.errorUpdateCount > queryInitialState.errorUpdateCount, - isFetching, - isRefetching: isFetching && !isPending, - isLoadingError: isError && !hasData, - isPaused: newState.fetchStatus === 'paused', - isPlaceholderData, - isRefetchError: isError && hasData, - isStale: isStale(query, options), - refetch: this.refetch, - promise: this.#currentThenable, - isEnabled: resolveEnabled(options.enabled, query) !== false, - } - - const nextResult = result as QueryObserverResult - - if (this.options.experimental_prefetchInRender) { - const hasResultData = nextResult.data !== undefined - const isErrorWithoutData = nextResult.status === 'error' && !hasResultData - const finalizeThenableIfPossible = (thenable: PendingThenable) => { - if (isErrorWithoutData) { - thenable.reject(nextResult.error) - } else if (hasResultData) { - thenable.resolve(nextResult.data as TData) - } - } - - /** - * Create a new thenable and result promise when the results have changed - */ - const recreateThenable = () => { - const pending = - (this.#currentThenable = - nextResult.promise = - pendingThenable()) - - finalizeThenableIfPossible(pending) - } - - const prevThenable = this.#currentThenable - switch (prevThenable.status) { - case 'pending': - // Finalize the previous thenable if it was pending - // and we are still observing the same query - if (query.queryHash === prevQuery.queryHash) { - finalizeThenableIfPossible(prevThenable) - } - break - case 'fulfilled': - if (isErrorWithoutData || nextResult.data !== prevThenable.value) { - recreateThenable() - } - break - case 'rejected': - if (!isErrorWithoutData || nextResult.error !== prevThenable.reason) { - recreateThenable() - } - break - } - } - - return nextResult - } - - updateResult(): void { - const prevResult = this.#currentResult as - | QueryObserverResult - | undefined - - const nextResult = this.createResult(this.#currentQuery, this.options) - - this.#currentResultState = this.#currentQuery.state - this.#currentResultOptions = this.options - - if (this.#currentResultState.data !== undefined) { - this.#lastQueryWithDefinedData = this.#currentQuery - } - - // Only notify and update result if something has changed - if (shallowEqualObjects(nextResult, prevResult)) { - return - } - - this.#currentResult = nextResult - - const shouldNotifyListeners = (): boolean => { - if (!prevResult) { - return true - } - - const { notifyOnChangeProps } = this.options - const notifyOnChangePropsValue = - typeof notifyOnChangeProps === 'function' - ? notifyOnChangeProps() - : notifyOnChangeProps - - if ( - notifyOnChangePropsValue === 'all' || - (!notifyOnChangePropsValue && !this.#trackedProps.size) - ) { - return true - } - - const includedProps = new Set( - notifyOnChangePropsValue ?? this.#trackedProps, - ) - - if (this.options.throwOnError) { - includedProps.add('error') - } - - return Object.keys(this.#currentResult).some((key) => { - const typedKey = key as keyof QueryObserverResult - const changed = this.#currentResult[typedKey] !== prevResult[typedKey] - - return changed && includedProps.has(typedKey) - }) - } - - this.#notify({ listeners: shouldNotifyListeners() }) - } - - #updateQuery(): void { - const query = this.#client.getQueryCache().build(this.#client, this.options) - - if (query === this.#currentQuery) { - return - } - - const prevQuery = this.#currentQuery as - | Query - | undefined - this.#currentQuery = query - this.#currentQueryInitialState = query.state - - if (this.hasListeners()) { - prevQuery?.removeObserver(this) - query.addObserver(this) - } - } - - onQueryUpdate(): void { - this.updateResult() - - if (this.hasListeners()) { - this.#updateTimers() - } - } - - #notify(notifyOptions: { listeners: boolean }): void { - notifyManager.batch(() => { - // First, trigger the listeners - if (notifyOptions.listeners) { - this.listeners.forEach((listener) => { - listener(this.#currentResult) - }) - } - - // Then the cache listeners - this.#client.getQueryCache().notify({ - query: this.#currentQuery, - type: 'observerResultsUpdated', - }) - }) - } -} - -function shouldLoadOnMount( - query: Query, - options: QueryObserverOptions, -): boolean { - return ( - resolveEnabled(options.enabled, query) !== false && - query.state.data === undefined && - !(query.state.status === 'error' && options.retryOnMount === false) - ) -} - -function shouldFetchOnMount( - query: Query, - options: QueryObserverOptions, -): boolean { - return ( - shouldLoadOnMount(query, options) || - (query.state.data !== undefined && - shouldFetchOn(query, options, options.refetchOnMount)) - ) -} - -function shouldFetchOn( - query: Query, - options: QueryObserverOptions, - field: (typeof options)['refetchOnMount'] & - (typeof options)['refetchOnWindowFocus'] & - (typeof options)['refetchOnReconnect'], -) { - if ( - resolveEnabled(options.enabled, query) !== false && - resolveStaleTime(options.staleTime, query) !== 'static' - ) { - const value = typeof field === 'function' ? field(query) : field - - return value === 'always' || (value !== false && isStale(query, options)) - } - return false -} - -function shouldFetchOptionally( - query: Query, - prevQuery: Query, - options: QueryObserverOptions, - prevOptions: QueryObserverOptions, -): boolean { - return ( - (query !== prevQuery || - resolveEnabled(prevOptions.enabled, query) === false) && - (!options.suspense || query.state.status !== 'error') && - isStale(query, options) - ) -} - -function isStale( - query: Query, - options: QueryObserverOptions, -): boolean { - return ( - resolveEnabled(options.enabled, query) !== false && - query.isStaleByTime(resolveStaleTime(options.staleTime, query)) - ) -} - -// this function would decide if we will update the observer's 'current' -// properties after an optimistic reading via getOptimisticResult -function shouldAssignObserverCurrentProperties< - TQueryFnData = unknown, - TError = unknown, - TData = TQueryFnData, - TQueryData = TQueryFnData, - TQueryKey extends QueryKey = QueryKey, ->( - observer: QueryObserver, - optimisticResult: QueryObserverResult, -) { - // if the newly created result isn't what the observer is holding as current, - // then we'll need to update the properties as well - if (!shallowEqualObjects(observer.getCurrentResult(), optimisticResult)) { - return true - } - - // basically, just keep previous properties if nothing changed - return false -} diff --git a/node_modules/@tanstack/query-core/src/removable.ts b/node_modules/@tanstack/query-core/src/removable.ts deleted file mode 100644 index 8642ab3..0000000 --- a/node_modules/@tanstack/query-core/src/removable.ts +++ /dev/null @@ -1,39 +0,0 @@ -import { timeoutManager } from './timeoutManager' -import { isServer, isValidTimeout } from './utils' -import type { ManagedTimerId } from './timeoutManager' - -export abstract class Removable { - gcTime!: number - #gcTimeout?: ManagedTimerId - - destroy(): void { - this.clearGcTimeout() - } - - protected scheduleGc(): void { - this.clearGcTimeout() - - if (isValidTimeout(this.gcTime)) { - this.#gcTimeout = timeoutManager.setTimeout(() => { - this.optionalRemove() - }, this.gcTime) - } - } - - protected updateGcTime(newGcTime: number | undefined): void { - // Default to 5 minutes (Infinity for server-side) if no gcTime is set - this.gcTime = Math.max( - this.gcTime || 0, - newGcTime ?? (isServer ? Infinity : 5 * 60 * 1000), - ) - } - - protected clearGcTimeout() { - if (this.#gcTimeout) { - timeoutManager.clearTimeout(this.#gcTimeout) - this.#gcTimeout = undefined - } - } - - protected abstract optionalRemove(): void -} diff --git a/node_modules/@tanstack/query-core/src/retryer.ts b/node_modules/@tanstack/query-core/src/retryer.ts deleted file mode 100644 index f4ada85..0000000 --- a/node_modules/@tanstack/query-core/src/retryer.ts +++ /dev/null @@ -1,228 +0,0 @@ -import { focusManager } from './focusManager' -import { onlineManager } from './onlineManager' -import { pendingThenable } from './thenable' -import { isServer, sleep } from './utils' -import type { Thenable } from './thenable' -import type { CancelOptions, DefaultError, NetworkMode } from './types' - -// TYPES - -interface RetryerConfig { - fn: () => TData | Promise - initialPromise?: Promise - onCancel?: (error: TError) => void - onFail?: (failureCount: number, error: TError) => void - onPause?: () => void - onContinue?: () => void - retry?: RetryValue - retryDelay?: RetryDelayValue - networkMode: NetworkMode | undefined - canRun: () => boolean -} - -export interface Retryer { - promise: Promise - cancel: (cancelOptions?: CancelOptions) => void - continue: () => Promise - cancelRetry: () => void - continueRetry: () => void - canStart: () => boolean - start: () => Promise - status: () => 'pending' | 'resolved' | 'rejected' -} - -export type RetryValue = boolean | number | ShouldRetryFunction - -type ShouldRetryFunction = ( - failureCount: number, - error: TError, -) => boolean - -export type RetryDelayValue = number | RetryDelayFunction - -type RetryDelayFunction = ( - failureCount: number, - error: TError, -) => number - -function defaultRetryDelay(failureCount: number) { - return Math.min(1000 * 2 ** failureCount, 30000) -} - -export function canFetch(networkMode: NetworkMode | undefined): boolean { - return (networkMode ?? 'online') === 'online' - ? onlineManager.isOnline() - : true -} - -export class CancelledError extends Error { - revert?: boolean - silent?: boolean - constructor(options?: CancelOptions) { - super('CancelledError') - this.revert = options?.revert - this.silent = options?.silent - } -} - -/** - * @deprecated Use instanceof `CancelledError` instead. - */ -export function isCancelledError(value: any): value is CancelledError { - return value instanceof CancelledError -} - -export function createRetryer( - config: RetryerConfig, -): Retryer { - let isRetryCancelled = false - let failureCount = 0 - let continueFn: ((value?: unknown) => void) | undefined - - const thenable = pendingThenable() - - const isResolved = () => - (thenable.status as Thenable['status']) !== 'pending' - - const cancel = (cancelOptions?: CancelOptions): void => { - if (!isResolved()) { - const error = new CancelledError(cancelOptions) as TError - reject(error) - - config.onCancel?.(error) - } - } - const cancelRetry = () => { - isRetryCancelled = true - } - - const continueRetry = () => { - isRetryCancelled = false - } - - const canContinue = () => - focusManager.isFocused() && - (config.networkMode === 'always' || onlineManager.isOnline()) && - config.canRun() - - const canStart = () => canFetch(config.networkMode) && config.canRun() - - const resolve = (value: any) => { - if (!isResolved()) { - continueFn?.() - thenable.resolve(value) - } - } - - const reject = (value: any) => { - if (!isResolved()) { - continueFn?.() - thenable.reject(value) - } - } - - const pause = () => { - return new Promise((continueResolve) => { - continueFn = (value) => { - if (isResolved() || canContinue()) { - continueResolve(value) - } - } - config.onPause?.() - }).then(() => { - continueFn = undefined - if (!isResolved()) { - config.onContinue?.() - } - }) - } - - // Create loop function - const run = () => { - // Do nothing if already resolved - if (isResolved()) { - return - } - - let promiseOrValue: any - - // we can re-use config.initialPromise on the first call of run() - const initialPromise = - failureCount === 0 ? config.initialPromise : undefined - - // Execute query - try { - promiseOrValue = initialPromise ?? config.fn() - } catch (error) { - promiseOrValue = Promise.reject(error) - } - - Promise.resolve(promiseOrValue) - .then(resolve) - .catch((error) => { - // Stop if the fetch is already resolved - if (isResolved()) { - return - } - - // Do we need to retry the request? - const retry = config.retry ?? (isServer ? 0 : 3) - const retryDelay = config.retryDelay ?? defaultRetryDelay - const delay = - typeof retryDelay === 'function' - ? retryDelay(failureCount, error) - : retryDelay - const shouldRetry = - retry === true || - (typeof retry === 'number' && failureCount < retry) || - (typeof retry === 'function' && retry(failureCount, error)) - - if (isRetryCancelled || !shouldRetry) { - // We are done if the query does not need to be retried - reject(error) - return - } - - failureCount++ - - // Notify on fail - config.onFail?.(failureCount, error) - - // Delay - sleep(delay) - // Pause if the document is not visible or when the device is offline - .then(() => { - return canContinue() ? undefined : pause() - }) - .then(() => { - if (isRetryCancelled) { - reject(error) - } else { - run() - } - }) - }) - } - - return { - promise: thenable, - status: () => thenable.status, - cancel, - continue: () => { - continueFn?.() - return thenable - }, - cancelRetry, - continueRetry, - canStart, - start: () => { - // Start loop - if (canStart()) { - run() - } else { - pause().then(run) - } - return thenable - }, - } -} diff --git a/node_modules/@tanstack/query-core/src/streamedQuery.ts b/node_modules/@tanstack/query-core/src/streamedQuery.ts deleted file mode 100644 index 8fa57c5..0000000 --- a/node_modules/@tanstack/query-core/src/streamedQuery.ts +++ /dev/null @@ -1,122 +0,0 @@ -import { addConsumeAwareSignal, addToEnd } from './utils' -import type { - OmitKeyof, - QueryFunction, - QueryFunctionContext, - QueryKey, -} from './types' - -type BaseStreamedQueryParams = { - streamFn: ( - context: QueryFunctionContext, - ) => AsyncIterable | Promise> - refetchMode?: 'append' | 'reset' | 'replace' -} - -type SimpleStreamedQueryParams< - TQueryFnData, - TQueryKey extends QueryKey, -> = BaseStreamedQueryParams & { - reducer?: never - initialValue?: never -} - -type ReducibleStreamedQueryParams< - TQueryFnData, - TData, - TQueryKey extends QueryKey, -> = BaseStreamedQueryParams & { - reducer: (acc: TData, chunk: TQueryFnData) => TData - initialValue: TData -} - -type StreamedQueryParams = - | SimpleStreamedQueryParams - | ReducibleStreamedQueryParams - -/** - * This is a helper function to create a query function that streams data from an AsyncIterable. - * Data will be an Array of all the chunks received. - * The query will be in a 'pending' state until the first chunk of data is received, but will go to 'success' after that. - * The query will stay in fetchStatus 'fetching' until the stream ends. - * @param queryFn - The function that returns an AsyncIterable to stream data from. - * @param refetchMode - Defines how re-fetches are handled. - * Defaults to `'reset'`, erases all data and puts the query back into `pending` state. - * Set to `'append'` to append new data to the existing data. - * Set to `'replace'` to write all data to the cache once the stream ends. - * @param reducer - A function to reduce the streamed chunks into the final data. - * Defaults to a function that appends chunks to the end of the array. - * @param initialValue - Initial value to be used while the first chunk is being fetched, and returned if the stream yields no values. - */ -export function streamedQuery< - TQueryFnData = unknown, - TData = Array, - TQueryKey extends QueryKey = QueryKey, ->({ - streamFn, - refetchMode = 'reset', - reducer = (items, chunk) => - addToEnd(items as Array, chunk) as TData, - initialValue = [] as TData, -}: StreamedQueryParams): QueryFunction< - TData, - TQueryKey -> { - return async (context) => { - const query = context.client - .getQueryCache() - .find({ queryKey: context.queryKey, exact: true }) - const isRefetch = !!query && query.state.data !== undefined - if (isRefetch && refetchMode === 'reset') { - query.setState({ - status: 'pending', - data: undefined, - error: null, - fetchStatus: 'fetching', - }) - } - - let result = initialValue - - let cancelled: boolean = false as boolean - const streamFnContext = addConsumeAwareSignal< - OmitKeyof - >( - { - client: context.client, - meta: context.meta, - queryKey: context.queryKey, - pageParam: context.pageParam, - direction: context.direction, - }, - () => context.signal, - () => (cancelled = true), - ) - - const stream = await streamFn(streamFnContext) - - const isReplaceRefetch = isRefetch && refetchMode === 'replace' - - for await (const chunk of stream) { - if (cancelled) { - break - } - - if (isReplaceRefetch) { - // don't append to the cache directly when replace-refetching - result = reducer(result, chunk) - } else { - context.client.setQueryData(context.queryKey, (prev) => - reducer(prev === undefined ? initialValue : prev, chunk), - ) - } - } - - // finalize result: replace-refetching needs to write to the cache - if (isReplaceRefetch && !cancelled) { - context.client.setQueryData(context.queryKey, result) - } - - return context.client.getQueryData(context.queryKey) ?? initialValue - } -} diff --git a/node_modules/@tanstack/query-core/src/subscribable.ts b/node_modules/@tanstack/query-core/src/subscribable.ts deleted file mode 100644 index 044efe6..0000000 --- a/node_modules/@tanstack/query-core/src/subscribable.ts +++ /dev/null @@ -1,30 +0,0 @@ -export class Subscribable { - protected listeners = new Set() - - constructor() { - this.subscribe = this.subscribe.bind(this) - } - - subscribe(listener: TListener): () => void { - this.listeners.add(listener) - - this.onSubscribe() - - return () => { - this.listeners.delete(listener) - this.onUnsubscribe() - } - } - - hasListeners(): boolean { - return this.listeners.size > 0 - } - - protected onSubscribe(): void { - // Do nothing - } - - protected onUnsubscribe(): void { - // Do nothing - } -} diff --git a/node_modules/@tanstack/query-core/src/thenable.ts b/node_modules/@tanstack/query-core/src/thenable.ts deleted file mode 100644 index 5e54411..0000000 --- a/node_modules/@tanstack/query-core/src/thenable.ts +++ /dev/null @@ -1,111 +0,0 @@ -/** - * Thenable types which matches React's types for promises - * - * React seemingly uses `.status`, `.value` and `.reason` properties on a promises to optimistically unwrap data from promises - * - * @see https://github.com/facebook/react/blob/main/packages/shared/ReactTypes.js#L112-L138 - * @see https://github.com/facebook/react/blob/4f604941569d2e8947ce1460a0b2997e835f37b9/packages/react-debug-tools/src/ReactDebugHooks.js#L224-L227 - */ - -import { noop } from './utils' - -interface Fulfilled { - status: 'fulfilled' - value: T -} -interface Rejected { - status: 'rejected' - reason: unknown -} -interface Pending { - status: 'pending' - - /** - * Resolve the promise with a value. - * Will remove the `resolve` and `reject` properties from the promise. - */ - resolve: (value: T) => void - /** - * Reject the promise with a reason. - * Will remove the `resolve` and `reject` properties from the promise. - */ - reject: (reason: unknown) => void -} - -export type FulfilledThenable = Promise & Fulfilled -export type RejectedThenable = Promise & Rejected -export type PendingThenable = Promise & Pending - -export type Thenable = - | FulfilledThenable - | RejectedThenable - | PendingThenable - -export function pendingThenable(): PendingThenable { - let resolve: Pending['resolve'] - let reject: Pending['reject'] - // this could use `Promise.withResolvers()` in the future - const thenable = new Promise((_resolve, _reject) => { - resolve = _resolve - reject = _reject - }) as PendingThenable - - thenable.status = 'pending' - thenable.catch(() => { - // prevent unhandled rejection errors - }) - - function finalize(data: Fulfilled | Rejected) { - Object.assign(thenable, data) - - // clear pending props props to avoid calling them twice - delete (thenable as Partial>).resolve - delete (thenable as Partial>).reject - } - - thenable.resolve = (value) => { - finalize({ - status: 'fulfilled', - value, - }) - - resolve(value) - } - thenable.reject = (reason) => { - finalize({ - status: 'rejected', - reason, - }) - - reject(reason) - } - - return thenable -} - -/** - * This function takes a Promise-like input and detects whether the data - * is synchronously available or not. - * - * It does not inspect .status, .value or .reason properties of the promise, - * as those are not always available, and the .status of React's promises - * should not be considered part of the public API. - */ -export function tryResolveSync(promise: Promise | Thenable) { - let data: unknown - - promise - .then((result) => { - data = result - return result - }, noop) - // .catch can be unavailable on certain kinds of thenable's - // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition - ?.catch(noop) - - if (data !== undefined) { - return { data } - } - - return undefined -} diff --git a/node_modules/@tanstack/query-core/src/timeoutManager.ts b/node_modules/@tanstack/query-core/src/timeoutManager.ts deleted file mode 100644 index 97f0870..0000000 --- a/node_modules/@tanstack/query-core/src/timeoutManager.ts +++ /dev/null @@ -1,135 +0,0 @@ -/** - * {@link TimeoutManager} does not support passing arguments to the callback. - * - * `(_: void)` is the argument type inferred by TypeScript's default typings for - * `setTimeout(cb, number)`. - * If we don't accept a single void argument, then - * `new Promise(resolve => timeoutManager.setTimeout(resolve, N))` is a type error. - */ -export type TimeoutCallback = (_: void) => void - -/** - * Wrapping `setTimeout` is awkward from a typing perspective because platform - * typings may extend the return type of `setTimeout`. For example, NodeJS - * typings add `NodeJS.Timeout`; but a non-default `timeoutManager` may not be - * able to return such a type. - */ -export type ManagedTimerId = number | { [Symbol.toPrimitive]: () => number } - -/** - * Backend for timer functions. - */ -export type TimeoutProvider = - { - readonly setTimeout: (callback: TimeoutCallback, delay: number) => TTimerId - readonly clearTimeout: (timeoutId: TTimerId | undefined) => void - - readonly setInterval: (callback: TimeoutCallback, delay: number) => TTimerId - readonly clearInterval: (intervalId: TTimerId | undefined) => void - } - -export const defaultTimeoutProvider: TimeoutProvider< - ReturnType -> = { - // We need the wrapper function syntax below instead of direct references to - // global setTimeout etc. - // - // BAD: `setTimeout: setTimeout` - // GOOD: `setTimeout: (cb, delay) => setTimeout(cb, delay)` - // - // If we use direct references here, then anything that wants to spy on or - // replace the global setTimeout (like tests) won't work since we'll already - // have a hard reference to the original implementation at the time when this - // file was imported. - setTimeout: (callback, delay) => setTimeout(callback, delay), - clearTimeout: (timeoutId) => clearTimeout(timeoutId), - - setInterval: (callback, delay) => setInterval(callback, delay), - clearInterval: (intervalId) => clearInterval(intervalId), -} - -/** - * Allows customization of how timeouts are created. - * - * @tanstack/query-core makes liberal use of timeouts to implement `staleTime` - * and `gcTime`. The default TimeoutManager provider uses the platform's global - * `setTimeout` implementation, which is known to have scalability issues with - * thousands of timeouts on the event loop. - * - * If you hit this limitation, consider providing a custom TimeoutProvider that - * coalesces timeouts. - */ -export class TimeoutManager implements Omit { - // We cannot have TimeoutManager as we must instantiate it with a concrete - // type at app boot; and if we leave that type, then any new timer provider - // would need to support ReturnType, which is infeasible. - // - // We settle for type safety for the TimeoutProvider type, and accept that - // this class is unsafe internally to allow for extension. - #provider: TimeoutProvider = defaultTimeoutProvider - #providerCalled = false - - setTimeoutProvider( - provider: TimeoutProvider, - ): void { - if (process.env.NODE_ENV !== 'production') { - if (this.#providerCalled && provider !== this.#provider) { - // After changing providers, `clearTimeout` will not work as expected for - // timeouts from the previous provider. - // - // Since they may allocate the same timeout ID, clearTimeout may cancel an - // arbitrary different timeout, or unexpected no-op. - // - // We could protect against this by mixing the timeout ID bits - // deterministically with some per-provider bits. - // - // We could internally queue `setTimeout` calls to `TimeoutManager` until - // some API call to set the initial provider. - console.error( - `[timeoutManager]: Switching provider after calls to previous provider might result in unexpected behavior.`, - { previous: this.#provider, provider }, - ) - } - } - - this.#provider = provider - if (process.env.NODE_ENV !== 'production') { - this.#providerCalled = false - } - } - - setTimeout(callback: TimeoutCallback, delay: number): ManagedTimerId { - if (process.env.NODE_ENV !== 'production') { - this.#providerCalled = true - } - return this.#provider.setTimeout(callback, delay) - } - - clearTimeout(timeoutId: ManagedTimerId | undefined): void { - this.#provider.clearTimeout(timeoutId) - } - - setInterval(callback: TimeoutCallback, delay: number): ManagedTimerId { - if (process.env.NODE_ENV !== 'production') { - this.#providerCalled = true - } - return this.#provider.setInterval(callback, delay) - } - - clearInterval(intervalId: ManagedTimerId | undefined): void { - this.#provider.clearInterval(intervalId) - } -} - -export const timeoutManager = new TimeoutManager() - -/** - * In many cases code wants to delay to the next event loop tick; this is not - * mediated by {@link timeoutManager}. - * - * This function is provided to make auditing the `tanstack/query-core` for - * incorrect use of system `setTimeout` easier. - */ -export function systemSetTimeoutZero(callback: TimeoutCallback): void { - setTimeout(callback, 0) -} diff --git a/node_modules/@tanstack/query-core/src/types.ts b/node_modules/@tanstack/query-core/src/types.ts deleted file mode 100644 index 4f3f4ca..0000000 --- a/node_modules/@tanstack/query-core/src/types.ts +++ /dev/null @@ -1,1391 +0,0 @@ -/* istanbul ignore file */ - -import type { QueryClient } from './queryClient' -import type { DehydrateOptions, HydrateOptions } from './hydration' -import type { MutationState } from './mutation' -import type { FetchDirection, Query, QueryBehavior } from './query' -import type { RetryDelayValue, RetryValue } from './retryer' -import type { QueryFilters, QueryTypeFilter, SkipToken } from './utils' -import type { QueryCache } from './queryCache' -import type { MutationCache } from './mutationCache' - -export type NonUndefinedGuard = T extends undefined ? never : T - -export type DistributiveOmit< - TObject, - TKey extends keyof TObject, -> = TObject extends any ? Omit : never - -export type OmitKeyof< - TObject, - TKey extends TStrictly extends 'safely' - ? - | keyof TObject - | (string & Record) - | (number & Record) - | (symbol & Record) - : keyof TObject, - TStrictly extends 'strictly' | 'safely' = 'strictly', -> = Omit - -export type Override = { - [AKey in keyof TTargetA]: AKey extends keyof TTargetB - ? TTargetB[AKey] - : TTargetA[AKey] -} - -export type NoInfer = [T][T extends any ? 0 : never] - -export interface Register { - // defaultError: Error - // queryMeta: Record - // mutationMeta: Record - // queryKey: ReadonlyArray - // mutationKey: ReadonlyArray -} - -export type DefaultError = Register extends { - defaultError: infer TError -} - ? TError - : Error - -export type QueryKey = Register extends { - queryKey: infer TQueryKey -} - ? TQueryKey extends ReadonlyArray - ? TQueryKey - : TQueryKey extends Array - ? TQueryKey - : ReadonlyArray - : ReadonlyArray - -export const dataTagSymbol = Symbol('dataTagSymbol') -export type dataTagSymbol = typeof dataTagSymbol -export const dataTagErrorSymbol = Symbol('dataTagErrorSymbol') -export type dataTagErrorSymbol = typeof dataTagErrorSymbol -export const unsetMarker = Symbol('unsetMarker') -export type UnsetMarker = typeof unsetMarker -export type AnyDataTag = { - [dataTagSymbol]: any - [dataTagErrorSymbol]: any -} -export type DataTag< - TType, - TValue, - TError = UnsetMarker, -> = TType extends AnyDataTag - ? TType - : TType & { - [dataTagSymbol]: TValue - [dataTagErrorSymbol]: TError - } - -export type InferDataFromTag = - TTaggedQueryKey extends DataTag - ? TaggedValue - : TQueryFnData - -export type InferErrorFromTag = - TTaggedQueryKey extends DataTag - ? TaggedError extends UnsetMarker - ? TError - : TaggedError - : TError - -export type QueryFunction< - T = unknown, - TQueryKey extends QueryKey = QueryKey, - TPageParam = never, -> = (context: QueryFunctionContext) => T | Promise - -export type StaleTime = number | 'static' - -export type StaleTimeFunction< - TQueryFnData = unknown, - TError = DefaultError, - TData = TQueryFnData, - TQueryKey extends QueryKey = QueryKey, -> = - | StaleTime - | ((query: Query) => StaleTime) - -export type Enabled< - TQueryFnData = unknown, - TError = DefaultError, - TData = TQueryFnData, - TQueryKey extends QueryKey = QueryKey, -> = - | boolean - | ((query: Query) => boolean) - -export type QueryPersister< - T = unknown, - TQueryKey extends QueryKey = QueryKey, - TPageParam = never, -> = [TPageParam] extends [never] - ? ( - queryFn: QueryFunction, - context: QueryFunctionContext, - query: Query, - ) => T | Promise - : ( - queryFn: QueryFunction, - context: QueryFunctionContext, - query: Query, - ) => T | Promise - -export type QueryFunctionContext< - TQueryKey extends QueryKey = QueryKey, - TPageParam = never, -> = [TPageParam] extends [never] - ? { - client: QueryClient - queryKey: TQueryKey - signal: AbortSignal - meta: QueryMeta | undefined - pageParam?: unknown - /** - * @deprecated - * if you want access to the direction, you can add it to the pageParam - */ - direction?: unknown - } - : { - client: QueryClient - queryKey: TQueryKey - signal: AbortSignal - pageParam: TPageParam - /** - * @deprecated - * if you want access to the direction, you can add it to the pageParam - */ - direction: FetchDirection - meta: QueryMeta | undefined - } - -export type InitialDataFunction = () => T | undefined - -type NonFunctionGuard = T extends Function ? never : T - -export type PlaceholderDataFunction< - TQueryFnData = unknown, - TError = DefaultError, - TQueryData = TQueryFnData, - TQueryKey extends QueryKey = QueryKey, -> = ( - previousData: TQueryData | undefined, - previousQuery: Query | undefined, -) => TQueryData | undefined - -export type QueriesPlaceholderDataFunction = ( - previousData: undefined, - previousQuery: undefined, -) => TQueryData | undefined - -export type QueryKeyHashFunction = ( - queryKey: TQueryKey, -) => string - -export type GetPreviousPageParamFunction = ( - firstPage: TQueryFnData, - allPages: Array, - firstPageParam: TPageParam, - allPageParams: Array, -) => TPageParam | undefined | null - -export type GetNextPageParamFunction = ( - lastPage: TQueryFnData, - allPages: Array, - lastPageParam: TPageParam, - allPageParams: Array, -) => TPageParam | undefined | null - -export interface InfiniteData { - pages: Array - pageParams: Array -} - -export type QueryMeta = Register extends { - queryMeta: infer TQueryMeta -} - ? TQueryMeta extends Record - ? TQueryMeta - : Record - : Record - -export type NetworkMode = 'online' | 'always' | 'offlineFirst' - -export type NotifyOnChangeProps = - | Array - | 'all' - | undefined - | (() => Array | 'all' | undefined) - -export interface QueryOptions< - TQueryFnData = unknown, - TError = DefaultError, - TData = TQueryFnData, - TQueryKey extends QueryKey = QueryKey, - TPageParam = never, -> { - /** - * If `false`, failed queries will not retry by default. - * If `true`, failed queries will retry infinitely., failureCount: num - * If set to an integer number, e.g. 3, failed queries will retry until the failed query count meets that number. - * If set to a function `(failureCount, error) => boolean` failed queries will retry until the function returns false. - */ - retry?: RetryValue - retryDelay?: RetryDelayValue - networkMode?: NetworkMode - /** - * The time in milliseconds that unused/inactive cache data remains in memory. - * When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration. - * When different garbage collection times are specified, the longest one will be used. - * Setting it to `Infinity` will disable garbage collection. - */ - gcTime?: number - queryFn?: QueryFunction | SkipToken - persister?: QueryPersister< - NoInfer, - NoInfer, - NoInfer - > - queryHash?: string - queryKey?: TQueryKey - queryKeyHashFn?: QueryKeyHashFunction - initialData?: TData | InitialDataFunction - initialDataUpdatedAt?: number | (() => number | undefined) - behavior?: QueryBehavior - /** - * Set this to `false` to disable structural sharing between query results. - * Set this to a function which accepts the old and new data and returns resolved data of the same type to implement custom structural sharing logic. - * Defaults to `true`. - */ - structuralSharing?: - | boolean - | ((oldData: unknown | undefined, newData: unknown) => unknown) - _defaulted?: boolean - /** - * Additional payload to be stored on each query. - * Use this property to pass information that can be used in other places. - */ - meta?: QueryMeta - /** - * Maximum number of pages to store in the data of an infinite query. - */ - maxPages?: number -} - -export interface InitialPageParam { - initialPageParam: TPageParam -} - -export interface InfiniteQueryPageParamsOptions< - TQueryFnData = unknown, - TPageParam = unknown, -> extends InitialPageParam { - /** - * This function can be set to automatically get the previous cursor for infinite queries. - * The result will also be used to determine the value of `hasPreviousPage`. - */ - getPreviousPageParam?: GetPreviousPageParamFunction - /** - * This function can be set to automatically get the next cursor for infinite queries. - * The result will also be used to determine the value of `hasNextPage`. - */ - getNextPageParam: GetNextPageParamFunction -} - -export type ThrowOnError< - TQueryFnData, - TError, - TQueryData, - TQueryKey extends QueryKey, -> = - | boolean - | (( - error: TError, - query: Query, - ) => boolean) - -export interface QueryObserverOptions< - TQueryFnData = unknown, - TError = DefaultError, - TData = TQueryFnData, - TQueryData = TQueryFnData, - TQueryKey extends QueryKey = QueryKey, - TPageParam = never, -> extends WithRequired< - QueryOptions, - 'queryKey' -> { - /** - * Set this to `false` or a function that returns `false` to disable automatic refetching when the query mounts or changes query keys. - * To refetch the query, use the `refetch` method returned from the `useQuery` instance. - * Accepts a boolean or function that returns a boolean. - * Defaults to `true`. - */ - enabled?: Enabled - /** - * The time in milliseconds after data is considered stale. - * If set to `Infinity`, the data will never be considered stale. - * If set to a function, the function will be executed with the query to compute a `staleTime`. - * Defaults to `0`. - */ - staleTime?: StaleTimeFunction - /** - * If set to a number, the query will continuously refetch at this frequency in milliseconds. - * If set to a function, the function will be executed with the latest data and query to compute a frequency - * Defaults to `false`. - */ - refetchInterval?: - | number - | false - | (( - query: Query, - ) => number | false | undefined) - /** - * If set to `true`, the query will continue to refetch while their tab/window is in the background. - * Defaults to `false`. - */ - refetchIntervalInBackground?: boolean - /** - * If set to `true`, the query will refetch on window focus if the data is stale. - * If set to `false`, the query will not refetch on window focus. - * If set to `'always'`, the query will always refetch on window focus. - * If set to a function, the function will be executed with the latest data and query to compute the value. - * Defaults to `true`. - */ - refetchOnWindowFocus?: - | boolean - | 'always' - | (( - query: Query, - ) => boolean | 'always') - /** - * If set to `true`, the query will refetch on reconnect if the data is stale. - * If set to `false`, the query will not refetch on reconnect. - * If set to `'always'`, the query will always refetch on reconnect. - * If set to a function, the function will be executed with the latest data and query to compute the value. - * Defaults to the value of `networkOnline` (`true`) - */ - refetchOnReconnect?: - | boolean - | 'always' - | (( - query: Query, - ) => boolean | 'always') - /** - * If set to `true`, the query will refetch on mount if the data is stale. - * If set to `false`, will disable additional instances of a query to trigger background refetch. - * If set to `'always'`, the query will always refetch on mount. - * If set to a function, the function will be executed with the latest data and query to compute the value - * Defaults to `true`. - */ - refetchOnMount?: - | boolean - | 'always' - | (( - query: Query, - ) => boolean | 'always') - /** - * If set to `false`, the query will not be retried on mount if it contains an error. - * Defaults to `true`. - */ - retryOnMount?: boolean - /** - * If set, the component will only re-render if any of the listed properties change. - * When set to `['data', 'error']`, the component will only re-render when the `data` or `error` properties change. - * When set to `'all'`, the component will re-render whenever a query is updated. - * When set to a function, the function will be executed to compute the list of properties. - * By default, access to properties will be tracked, and the component will only re-render when one of the tracked properties change. - */ - notifyOnChangeProps?: NotifyOnChangeProps - /** - * Whether errors should be thrown instead of setting the `error` property. - * If set to `true` or `suspense` is `true`, all errors will be thrown to the error boundary. - * If set to `false` and `suspense` is `false`, errors are returned as state. - * If set to a function, it will be passed the error and the query, and it should return a boolean indicating whether to show the error in an error boundary (`true`) or return the error as state (`false`). - * Defaults to `false`. - */ - throwOnError?: ThrowOnError - /** - * This option can be used to transform or select a part of the data returned by the query function. - */ - select?: (data: TQueryData) => TData - /** - * If set to `true`, the query will suspend when `status === 'pending'` - * and throw errors when `status === 'error'`. - * Defaults to `false`. - */ - suspense?: boolean - /** - * If set, this value will be used as the placeholder data for this particular query observer while the query is still in the `loading` data and no initialData has been provided. - */ - placeholderData?: - | NonFunctionGuard - | PlaceholderDataFunction< - NonFunctionGuard, - TError, - NonFunctionGuard, - TQueryKey - > - - _optimisticResults?: 'optimistic' | 'isRestoring' - - /** - * Enable prefetching during rendering - */ - experimental_prefetchInRender?: boolean -} - -export type WithRequired = TTarget & { - [_ in TKey]: {} -} - -export type DefaultedQueryObserverOptions< - TQueryFnData = unknown, - TError = DefaultError, - TData = TQueryFnData, - TQueryData = TQueryFnData, - TQueryKey extends QueryKey = QueryKey, -> = WithRequired< - QueryObserverOptions, - 'throwOnError' | 'refetchOnReconnect' | 'queryHash' -> - -export interface InfiniteQueryObserverOptions< - TQueryFnData = unknown, - TError = DefaultError, - TData = TQueryFnData, - TQueryKey extends QueryKey = QueryKey, - TPageParam = unknown, -> - extends - QueryObserverOptions< - TQueryFnData, - TError, - TData, - InfiniteData, - TQueryKey, - TPageParam - >, - InfiniteQueryPageParamsOptions {} - -export type DefaultedInfiniteQueryObserverOptions< - TQueryFnData = unknown, - TError = DefaultError, - TData = TQueryFnData, - TQueryKey extends QueryKey = QueryKey, - TPageParam = unknown, -> = WithRequired< - InfiniteQueryObserverOptions< - TQueryFnData, - TError, - TData, - TQueryKey, - TPageParam - >, - 'throwOnError' | 'refetchOnReconnect' | 'queryHash' -> - -export interface FetchQueryOptions< - TQueryFnData = unknown, - TError = DefaultError, - TData = TQueryFnData, - TQueryKey extends QueryKey = QueryKey, - TPageParam = never, -> extends WithRequired< - QueryOptions, - 'queryKey' -> { - initialPageParam?: never - /** - * The time in milliseconds after data is considered stale. - * If the data is fresh it will be returned from the cache. - */ - staleTime?: StaleTimeFunction -} - -export interface EnsureQueryDataOptions< - TQueryFnData = unknown, - TError = DefaultError, - TData = TQueryFnData, - TQueryKey extends QueryKey = QueryKey, - TPageParam = never, -> extends FetchQueryOptions< - TQueryFnData, - TError, - TData, - TQueryKey, - TPageParam -> { - revalidateIfStale?: boolean -} - -export type EnsureInfiniteQueryDataOptions< - TQueryFnData = unknown, - TError = DefaultError, - TData = TQueryFnData, - TQueryKey extends QueryKey = QueryKey, - TPageParam = unknown, -> = FetchInfiniteQueryOptions< - TQueryFnData, - TError, - TData, - TQueryKey, - TPageParam -> & { - revalidateIfStale?: boolean -} - -type FetchInfiniteQueryPages = - | { pages?: never } - | { - pages: number - getNextPageParam: GetNextPageParamFunction - } - -export type FetchInfiniteQueryOptions< - TQueryFnData = unknown, - TError = DefaultError, - TData = TQueryFnData, - TQueryKey extends QueryKey = QueryKey, - TPageParam = unknown, -> = Omit< - FetchQueryOptions< - TQueryFnData, - TError, - InfiniteData, - TQueryKey, - TPageParam - >, - 'initialPageParam' -> & - InitialPageParam & - FetchInfiniteQueryPages - -export interface ResultOptions { - throwOnError?: boolean -} - -export interface RefetchOptions extends ResultOptions { - /** - * If set to `true`, a currently running request will be cancelled before a new request is made - * - * If set to `false`, no refetch will be made if there is already a request running. - * - * Defaults to `true`. - */ - cancelRefetch?: boolean -} - -export interface InvalidateQueryFilters< - TQueryKey extends QueryKey = QueryKey, -> extends QueryFilters { - refetchType?: QueryTypeFilter | 'none' -} - -export interface RefetchQueryFilters< - TQueryKey extends QueryKey = QueryKey, -> extends QueryFilters {} - -export interface InvalidateOptions extends RefetchOptions {} -export interface ResetOptions extends RefetchOptions {} - -export interface FetchNextPageOptions extends ResultOptions { - /** - * If set to `true`, calling `fetchNextPage` repeatedly will invoke `queryFn` every time, - * whether the previous invocation has resolved or not. Also, the result from previous invocations will be ignored. - * - * If set to `false`, calling `fetchNextPage` repeatedly won't have any effect until the first invocation has resolved. - * - * Defaults to `true`. - */ - cancelRefetch?: boolean -} - -export interface FetchPreviousPageOptions extends ResultOptions { - /** - * If set to `true`, calling `fetchPreviousPage` repeatedly will invoke `queryFn` every time, - * whether the previous invocation has resolved or not. Also, the result from previous invocations will be ignored. - * - * If set to `false`, calling `fetchPreviousPage` repeatedly won't have any effect until the first invocation has resolved. - * - * Defaults to `true`. - */ - cancelRefetch?: boolean -} - -export type QueryStatus = 'pending' | 'error' | 'success' -export type FetchStatus = 'fetching' | 'paused' | 'idle' - -export interface QueryObserverBaseResult< - TData = unknown, - TError = DefaultError, -> { - /** - * The last successfully resolved data for the query. - */ - data: TData | undefined - /** - * The timestamp for when the query most recently returned the `status` as `"success"`. - */ - dataUpdatedAt: number - /** - * The error object for the query, if an error was thrown. - * - Defaults to `null`. - */ - error: TError | null - /** - * The timestamp for when the query most recently returned the `status` as `"error"`. - */ - errorUpdatedAt: number - /** - * The failure count for the query. - * - Incremented every time the query fails. - * - Reset to `0` when the query succeeds. - */ - failureCount: number - /** - * The failure reason for the query retry. - * - Reset to `null` when the query succeeds. - */ - failureReason: TError | null - /** - * The sum of all errors. - */ - errorUpdateCount: number - /** - * A derived boolean from the `status` variable, provided for convenience. - * - `true` if the query attempt resulted in an error. - */ - isError: boolean - /** - * Will be `true` if the query has been fetched. - */ - isFetched: boolean - /** - * Will be `true` if the query has been fetched after the component mounted. - * - This property can be used to not show any previously cached data. - */ - isFetchedAfterMount: boolean - /** - * A derived boolean from the `fetchStatus` variable, provided for convenience. - * - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch. - */ - isFetching: boolean - /** - * Is `true` whenever the first fetch for a query is in-flight. - * - Is the same as `isFetching && isPending`. - */ - isLoading: boolean - /** - * Will be `pending` if there's no cached data and no query attempt was finished yet. - */ - isPending: boolean - /** - * Will be `true` if the query failed while fetching for the first time. - */ - isLoadingError: boolean - /** - * @deprecated `isInitialLoading` is being deprecated in favor of `isLoading` - * and will be removed in the next major version. - */ - isInitialLoading: boolean - /** - * A derived boolean from the `fetchStatus` variable, provided for convenience. - * - The query wanted to fetch, but has been `paused`. - */ - isPaused: boolean - /** - * Will be `true` if the data shown is the placeholder data. - */ - isPlaceholderData: boolean - /** - * Will be `true` if the query failed while refetching. - */ - isRefetchError: boolean - /** - * Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`. - * - Is the same as `isFetching && !isPending`. - */ - isRefetching: boolean - /** - * Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`. - */ - isStale: boolean - /** - * A derived boolean from the `status` variable, provided for convenience. - * - `true` if the query has received a response with no errors and is ready to display its data. - */ - isSuccess: boolean - /** - * `true` if this observer is enabled, `false` otherwise. - */ - isEnabled: boolean - /** - * A function to manually refetch the query. - */ - refetch: ( - options?: RefetchOptions, - ) => Promise> - /** - * The status of the query. - * - Will be: - * - `pending` if there's no cached data and no query attempt was finished yet. - * - `error` if the query attempt resulted in an error. - * - `success` if the query has received a response with no errors and is ready to display its data. - */ - status: QueryStatus - /** - * The fetch status of the query. - * - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch. - * - `paused`: The query wanted to fetch, but has been `paused`. - * - `idle`: The query is not fetching. - * - See [Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information. - */ - fetchStatus: FetchStatus - /** - * A stable promise that will be resolved with the data of the query. - * Requires the `experimental_prefetchInRender` feature flag to be enabled. - * @example - * - * ### Enabling the feature flag - * ```ts - * const client = new QueryClient({ - * defaultOptions: { - * queries: { - * experimental_prefetchInRender: true, - * }, - * }, - * }) - * ``` - * - * ### Usage - * ```tsx - * import { useQuery } from '@tanstack/react-query' - * import React from 'react' - * import { fetchTodos, type Todo } from './api' - * - * function TodoList({ query }: { query: UseQueryResult }) { - * const data = React.use(query.promise) - * - * return ( - *
    - * {data.map(todo => ( - *
  • {todo.title}
  • - * ))} - *
- * ) - * } - * - * export function App() { - * const query = useQuery({ queryKey: ['todos'], queryFn: fetchTodos }) - * - * return ( - * <> - *

Todos

- * Loading...}> - * - * - * - * ) - * } - * ``` - */ - promise: Promise -} - -export interface QueryObserverPendingResult< - TData = unknown, - TError = DefaultError, -> extends QueryObserverBaseResult { - data: undefined - error: null - isError: false - isPending: true - isLoadingError: false - isRefetchError: false - isSuccess: false - isPlaceholderData: false - status: 'pending' -} - -export interface QueryObserverLoadingResult< - TData = unknown, - TError = DefaultError, -> extends QueryObserverBaseResult { - data: undefined - error: null - isError: false - isPending: true - isLoading: true - isLoadingError: false - isRefetchError: false - isSuccess: false - isPlaceholderData: false - status: 'pending' -} - -export interface QueryObserverLoadingErrorResult< - TData = unknown, - TError = DefaultError, -> extends QueryObserverBaseResult { - data: undefined - error: TError - isError: true - isPending: false - isLoading: false - isLoadingError: true - isRefetchError: false - isSuccess: false - isPlaceholderData: false - status: 'error' -} - -export interface QueryObserverRefetchErrorResult< - TData = unknown, - TError = DefaultError, -> extends QueryObserverBaseResult { - data: TData - error: TError - isError: true - isPending: false - isLoading: false - isLoadingError: false - isRefetchError: true - isSuccess: false - isPlaceholderData: false - status: 'error' -} - -export interface QueryObserverSuccessResult< - TData = unknown, - TError = DefaultError, -> extends QueryObserverBaseResult { - data: TData - error: null - isError: false - isPending: false - isLoading: false - isLoadingError: false - isRefetchError: false - isSuccess: true - isPlaceholderData: false - status: 'success' -} - -export interface QueryObserverPlaceholderResult< - TData = unknown, - TError = DefaultError, -> extends QueryObserverBaseResult { - data: TData - isError: false - error: null - isPending: false - isLoading: false - isLoadingError: false - isRefetchError: false - isSuccess: true - isPlaceholderData: true - status: 'success' -} - -export type DefinedQueryObserverResult< - TData = unknown, - TError = DefaultError, -> = - | QueryObserverRefetchErrorResult - | QueryObserverSuccessResult - -export type QueryObserverResult = - | DefinedQueryObserverResult - | QueryObserverLoadingErrorResult - | QueryObserverLoadingResult - | QueryObserverPendingResult - | QueryObserverPlaceholderResult - -export interface InfiniteQueryObserverBaseResult< - TData = unknown, - TError = DefaultError, -> extends QueryObserverBaseResult { - /** - * This function allows you to fetch the next "page" of results. - */ - fetchNextPage: ( - options?: FetchNextPageOptions, - ) => Promise> - /** - * This function allows you to fetch the previous "page" of results. - */ - fetchPreviousPage: ( - options?: FetchPreviousPageOptions, - ) => Promise> - /** - * Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option). - */ - hasNextPage: boolean - /** - * Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). - */ - hasPreviousPage: boolean - /** - * Will be `true` if the query failed while fetching the next page. - */ - isFetchNextPageError: boolean - /** - * Will be `true` while fetching the next page with `fetchNextPage`. - */ - isFetchingNextPage: boolean - /** - * Will be `true` if the query failed while fetching the previous page. - */ - isFetchPreviousPageError: boolean - /** - * Will be `true` while fetching the previous page with `fetchPreviousPage`. - */ - isFetchingPreviousPage: boolean -} - -export interface InfiniteQueryObserverPendingResult< - TData = unknown, - TError = DefaultError, -> extends InfiniteQueryObserverBaseResult { - data: undefined - error: null - isError: false - isPending: true - isLoadingError: false - isRefetchError: false - isFetchNextPageError: false - isFetchPreviousPageError: false - isSuccess: false - isPlaceholderData: false - status: 'pending' -} - -export interface InfiniteQueryObserverLoadingResult< - TData = unknown, - TError = DefaultError, -> extends InfiniteQueryObserverBaseResult { - data: undefined - error: null - isError: false - isPending: true - isLoading: true - isLoadingError: false - isRefetchError: false - isFetchNextPageError: false - isFetchPreviousPageError: false - isSuccess: false - isPlaceholderData: false - status: 'pending' -} - -export interface InfiniteQueryObserverLoadingErrorResult< - TData = unknown, - TError = DefaultError, -> extends InfiniteQueryObserverBaseResult { - data: undefined - error: TError - isError: true - isPending: false - isLoading: false - isLoadingError: true - isRefetchError: false - isFetchNextPageError: false - isFetchPreviousPageError: false - isSuccess: false - isPlaceholderData: false - status: 'error' -} - -export interface InfiniteQueryObserverRefetchErrorResult< - TData = unknown, - TError = DefaultError, -> extends InfiniteQueryObserverBaseResult { - data: TData - error: TError - isError: true - isPending: false - isLoading: false - isLoadingError: false - isRefetchError: true - isSuccess: false - isPlaceholderData: false - status: 'error' -} - -export interface InfiniteQueryObserverSuccessResult< - TData = unknown, - TError = DefaultError, -> extends InfiniteQueryObserverBaseResult { - data: TData - error: null - isError: false - isPending: false - isLoading: false - isLoadingError: false - isRefetchError: false - isFetchNextPageError: false - isFetchPreviousPageError: false - isSuccess: true - isPlaceholderData: false - status: 'success' -} - -export interface InfiniteQueryObserverPlaceholderResult< - TData = unknown, - TError = DefaultError, -> extends InfiniteQueryObserverBaseResult { - data: TData - isError: false - error: null - isPending: false - isLoading: false - isLoadingError: false - isRefetchError: false - isSuccess: true - isPlaceholderData: true - isFetchNextPageError: false - isFetchPreviousPageError: false - status: 'success' -} - -export type DefinedInfiniteQueryObserverResult< - TData = unknown, - TError = DefaultError, -> = - | InfiniteQueryObserverRefetchErrorResult - | InfiniteQueryObserverSuccessResult - -export type InfiniteQueryObserverResult< - TData = unknown, - TError = DefaultError, -> = - | DefinedInfiniteQueryObserverResult - | InfiniteQueryObserverLoadingErrorResult - | InfiniteQueryObserverLoadingResult - | InfiniteQueryObserverPendingResult - | InfiniteQueryObserverPlaceholderResult - -export type MutationKey = Register extends { - mutationKey: infer TMutationKey -} - ? TMutationKey extends ReadonlyArray - ? TMutationKey - : TMutationKey extends Array - ? TMutationKey - : ReadonlyArray - : ReadonlyArray - -export type MutationStatus = 'idle' | 'pending' | 'success' | 'error' - -export type MutationScope = { - id: string -} - -export type MutationMeta = Register extends { - mutationMeta: infer TMutationMeta -} - ? TMutationMeta extends Record - ? TMutationMeta - : Record - : Record - -export type MutationFunctionContext = { - client: QueryClient - meta: MutationMeta | undefined - mutationKey?: MutationKey -} - -export type MutationFunction = ( - variables: TVariables, - context: MutationFunctionContext, -) => Promise - -export interface MutationOptions< - TData = unknown, - TError = DefaultError, - TVariables = void, - TOnMutateResult = unknown, -> { - mutationFn?: MutationFunction - mutationKey?: MutationKey - onMutate?: ( - variables: TVariables, - context: MutationFunctionContext, - ) => Promise | TOnMutateResult - onSuccess?: ( - data: TData, - variables: TVariables, - onMutateResult: TOnMutateResult, - context: MutationFunctionContext, - ) => Promise | unknown - onError?: ( - error: TError, - variables: TVariables, - onMutateResult: TOnMutateResult | undefined, - context: MutationFunctionContext, - ) => Promise | unknown - onSettled?: ( - data: TData | undefined, - error: TError | null, - variables: TVariables, - onMutateResult: TOnMutateResult | undefined, - context: MutationFunctionContext, - ) => Promise | unknown - retry?: RetryValue - retryDelay?: RetryDelayValue - networkMode?: NetworkMode - gcTime?: number - _defaulted?: boolean - meta?: MutationMeta - scope?: MutationScope -} - -export interface MutationObserverOptions< - TData = unknown, - TError = DefaultError, - TVariables = void, - TOnMutateResult = unknown, -> extends MutationOptions { - throwOnError?: boolean | ((error: TError) => boolean) -} - -export interface MutateOptions< - TData = unknown, - TError = DefaultError, - TVariables = void, - TOnMutateResult = unknown, -> { - onSuccess?: ( - data: TData, - variables: TVariables, - onMutateResult: TOnMutateResult | undefined, - context: MutationFunctionContext, - ) => void - onError?: ( - error: TError, - variables: TVariables, - onMutateResult: TOnMutateResult | undefined, - context: MutationFunctionContext, - ) => void - onSettled?: ( - data: TData | undefined, - error: TError | null, - variables: TVariables, - onMutateResult: TOnMutateResult | undefined, - context: MutationFunctionContext, - ) => void -} - -export type MutateFunction< - TData = unknown, - TError = DefaultError, - TVariables = void, - TOnMutateResult = unknown, -> = ( - variables: TVariables, - options?: MutateOptions, -) => Promise - -export interface MutationObserverBaseResult< - TData = unknown, - TError = DefaultError, - TVariables = void, - TOnMutateResult = unknown, -> extends MutationState { - /** - * The last successfully resolved data for the mutation. - */ - data: TData | undefined - /** - * The variables object passed to the `mutationFn`. - */ - variables: TVariables | undefined - /** - * The error object for the mutation, if an error was encountered. - * - Defaults to `null`. - */ - error: TError | null - /** - * A boolean variable derived from `status`. - * - `true` if the last mutation attempt resulted in an error. - */ - isError: boolean - /** - * A boolean variable derived from `status`. - * - `true` if the mutation is in its initial state prior to executing. - */ - isIdle: boolean - /** - * A boolean variable derived from `status`. - * - `true` if the mutation is currently executing. - */ - isPending: boolean - /** - * A boolean variable derived from `status`. - * - `true` if the last mutation attempt was successful. - */ - isSuccess: boolean - /** - * The status of the mutation. - * - Will be: - * - `idle` initial status prior to the mutation function executing. - * - `pending` if the mutation is currently executing. - * - `error` if the last mutation attempt resulted in an error. - * - `success` if the last mutation attempt was successful. - */ - status: MutationStatus - /** - * The mutation function you can call with variables to trigger the mutation and optionally hooks on additional callback options. - * @param variables - The variables object to pass to the `mutationFn`. - * @param options.onSuccess - This function will fire when the mutation is successful and will be passed the mutation's result. - * @param options.onError - This function will fire if the mutation encounters an error and will be passed the error. - * @param options.onSettled - This function will fire when the mutation is either successfully fetched or encounters an error and be passed either the data or error. - * @remarks - * - If you make multiple requests, `onSuccess` will fire only after the latest call you've made. - * - All the callback functions (`onSuccess`, `onError`, `onSettled`) are void functions, and the returned value will be ignored. - */ - mutate: MutateFunction - /** - * A function to clean the mutation internal state (i.e., it resets the mutation to its initial state). - */ - reset: () => void -} - -export interface MutationObserverIdleResult< - TData = unknown, - TError = DefaultError, - TVariables = void, - TOnMutateResult = unknown, -> extends MutationObserverBaseResult< - TData, - TError, - TVariables, - TOnMutateResult -> { - data: undefined - variables: undefined - error: null - isError: false - isIdle: true - isPending: false - isSuccess: false - status: 'idle' -} - -export interface MutationObserverLoadingResult< - TData = unknown, - TError = DefaultError, - TVariables = void, - TOnMutateResult = unknown, -> extends MutationObserverBaseResult< - TData, - TError, - TVariables, - TOnMutateResult -> { - data: undefined - variables: TVariables - error: null - isError: false - isIdle: false - isPending: true - isSuccess: false - status: 'pending' -} - -export interface MutationObserverErrorResult< - TData = unknown, - TError = DefaultError, - TVariables = void, - TOnMutateResult = unknown, -> extends MutationObserverBaseResult< - TData, - TError, - TVariables, - TOnMutateResult -> { - data: undefined - error: TError - variables: TVariables - isError: true - isIdle: false - isPending: false - isSuccess: false - status: 'error' -} - -export interface MutationObserverSuccessResult< - TData = unknown, - TError = DefaultError, - TVariables = void, - TOnMutateResult = unknown, -> extends MutationObserverBaseResult< - TData, - TError, - TVariables, - TOnMutateResult -> { - data: TData - error: null - variables: TVariables - isError: false - isIdle: false - isPending: false - isSuccess: true - status: 'success' -} - -export type MutationObserverResult< - TData = unknown, - TError = DefaultError, - TVariables = void, - TOnMutateResult = unknown, -> = - | MutationObserverIdleResult - | MutationObserverLoadingResult - | MutationObserverErrorResult - | MutationObserverSuccessResult - -export interface QueryClientConfig { - queryCache?: QueryCache - mutationCache?: MutationCache - defaultOptions?: DefaultOptions -} - -export interface DefaultOptions { - queries?: OmitKeyof< - QueryObserverOptions, - 'suspense' | 'queryKey' - > - mutations?: MutationObserverOptions - hydrate?: HydrateOptions['defaultOptions'] - dehydrate?: DehydrateOptions -} - -export interface CancelOptions { - revert?: boolean - silent?: boolean -} - -export interface SetDataOptions { - updatedAt?: number -} - -export type NotifyEventType = - | 'added' - | 'removed' - | 'updated' - | 'observerAdded' - | 'observerRemoved' - | 'observerResultsUpdated' - | 'observerOptionsUpdated' - -export interface NotifyEvent { - type: NotifyEventType -} diff --git a/node_modules/@tanstack/query-core/src/utils.ts b/node_modules/@tanstack/query-core/src/utils.ts deleted file mode 100644 index 27d44bc..0000000 --- a/node_modules/@tanstack/query-core/src/utils.ts +++ /dev/null @@ -1,499 +0,0 @@ -import { timeoutManager } from './timeoutManager' -import type { - DefaultError, - Enabled, - FetchStatus, - MutationKey, - MutationStatus, - QueryFunction, - QueryKey, - QueryOptions, - StaleTime, - StaleTimeFunction, -} from './types' -import type { Mutation } from './mutation' -import type { FetchOptions, Query } from './query' - -// TYPES - -type DropLast> = T extends readonly [ - ...infer R, - unknown, -] - ? readonly [...R] - : never - -type TuplePrefixes> = T extends readonly [] - ? readonly [] - : TuplePrefixes> | T - -export interface QueryFilters { - /** - * Filter to active queries, inactive queries or all queries - */ - type?: QueryTypeFilter - /** - * Match query key exactly - */ - exact?: boolean - /** - * Include queries matching this predicate function - */ - predicate?: (query: Query) => boolean - /** - * Include queries matching this query key - */ - queryKey?: TQueryKey | TuplePrefixes - /** - * Include or exclude stale queries - */ - stale?: boolean - /** - * Include queries matching their fetchStatus - */ - fetchStatus?: FetchStatus -} - -export interface MutationFilters< - TData = unknown, - TError = DefaultError, - TVariables = unknown, - TOnMutateResult = unknown, -> { - /** - * Match mutation key exactly - */ - exact?: boolean - /** - * Include mutations matching this predicate function - */ - predicate?: ( - mutation: Mutation, - ) => boolean - /** - * Include mutations matching this mutation key - */ - mutationKey?: TuplePrefixes - /** - * Filter by mutation status - */ - status?: MutationStatus -} - -export type Updater = TOutput | ((input: TInput) => TOutput) - -export type QueryTypeFilter = 'all' | 'active' | 'inactive' - -// UTILS - -export const isServer = typeof window === 'undefined' || 'Deno' in globalThis - -export function noop(): void -export function noop(): undefined -export function noop() {} - -export function functionalUpdate( - updater: Updater, - input: TInput, -): TOutput { - return typeof updater === 'function' - ? (updater as (_: TInput) => TOutput)(input) - : updater -} - -export function isValidTimeout(value: unknown): value is number { - return typeof value === 'number' && value >= 0 && value !== Infinity -} - -export function timeUntilStale(updatedAt: number, staleTime?: number): number { - return Math.max(updatedAt + (staleTime || 0) - Date.now(), 0) -} - -export function resolveStaleTime< - TQueryFnData = unknown, - TError = DefaultError, - TData = TQueryFnData, - TQueryKey extends QueryKey = QueryKey, ->( - staleTime: - | undefined - | StaleTimeFunction, - query: Query, -): StaleTime | undefined { - return typeof staleTime === 'function' ? staleTime(query) : staleTime -} - -export function resolveEnabled< - TQueryFnData = unknown, - TError = DefaultError, - TData = TQueryFnData, - TQueryKey extends QueryKey = QueryKey, ->( - enabled: undefined | Enabled, - query: Query, -): boolean | undefined { - return typeof enabled === 'function' ? enabled(query) : enabled -} - -export function matchQuery( - filters: QueryFilters, - query: Query, -): boolean { - const { - type = 'all', - exact, - fetchStatus, - predicate, - queryKey, - stale, - } = filters - - if (queryKey) { - if (exact) { - if (query.queryHash !== hashQueryKeyByOptions(queryKey, query.options)) { - return false - } - } else if (!partialMatchKey(query.queryKey, queryKey)) { - return false - } - } - - if (type !== 'all') { - const isActive = query.isActive() - if (type === 'active' && !isActive) { - return false - } - if (type === 'inactive' && isActive) { - return false - } - } - - if (typeof stale === 'boolean' && query.isStale() !== stale) { - return false - } - - if (fetchStatus && fetchStatus !== query.state.fetchStatus) { - return false - } - - if (predicate && !predicate(query)) { - return false - } - - return true -} - -export function matchMutation( - filters: MutationFilters, - mutation: Mutation, -): boolean { - const { exact, status, predicate, mutationKey } = filters - if (mutationKey) { - if (!mutation.options.mutationKey) { - return false - } - if (exact) { - if (hashKey(mutation.options.mutationKey) !== hashKey(mutationKey)) { - return false - } - } else if (!partialMatchKey(mutation.options.mutationKey, mutationKey)) { - return false - } - } - - if (status && mutation.state.status !== status) { - return false - } - - if (predicate && !predicate(mutation)) { - return false - } - - return true -} - -export function hashQueryKeyByOptions( - queryKey: TQueryKey, - options?: Pick, 'queryKeyHashFn'>, -): string { - const hashFn = options?.queryKeyHashFn || hashKey - return hashFn(queryKey) -} - -/** - * Default query & mutation keys hash function. - * Hashes the value into a stable hash. - */ -export function hashKey(queryKey: QueryKey | MutationKey): string { - return JSON.stringify(queryKey, (_, val) => - isPlainObject(val) - ? Object.keys(val) - .sort() - .reduce((result, key) => { - result[key] = val[key] - return result - }, {} as any) - : val, - ) -} - -/** - * Checks if key `b` partially matches with key `a`. - */ -export function partialMatchKey(a: QueryKey, b: QueryKey): boolean -export function partialMatchKey(a: any, b: any): boolean { - if (a === b) { - return true - } - - if (typeof a !== typeof b) { - return false - } - - if (a && b && typeof a === 'object' && typeof b === 'object') { - return Object.keys(b).every((key) => partialMatchKey(a[key], b[key])) - } - - return false -} - -const hasOwn = Object.prototype.hasOwnProperty - -/** - * This function returns `a` if `b` is deeply equal. - * If not, it will replace any deeply equal children of `b` with those of `a`. - * This can be used for structural sharing between JSON values for example. - */ -export function replaceEqualDeep(a: unknown, b: T, depth?: number): T -export function replaceEqualDeep(a: any, b: any, depth = 0): any { - if (a === b) { - return a - } - - if (depth > 500) return b - - const array = isPlainArray(a) && isPlainArray(b) - - if (!array && !(isPlainObject(a) && isPlainObject(b))) return b - - const aItems = array ? a : Object.keys(a) - const aSize = aItems.length - const bItems = array ? b : Object.keys(b) - const bSize = bItems.length - const copy: any = array ? new Array(bSize) : {} - - let equalItems = 0 - - for (let i = 0; i < bSize; i++) { - const key: any = array ? i : bItems[i] - const aItem = a[key] - const bItem = b[key] - - if (aItem === bItem) { - copy[key] = aItem - if (array ? i < aSize : hasOwn.call(a, key)) equalItems++ - continue - } - - if ( - aItem === null || - bItem === null || - typeof aItem !== 'object' || - typeof bItem !== 'object' - ) { - copy[key] = bItem - continue - } - - const v = replaceEqualDeep(aItem, bItem, depth + 1) - copy[key] = v - if (v === aItem) equalItems++ - } - - return aSize === bSize && equalItems === aSize ? a : copy -} - -/** - * Shallow compare objects. - */ -export function shallowEqualObjects>( - a: T, - b: T | undefined, -): boolean { - if (!b || Object.keys(a).length !== Object.keys(b).length) { - return false - } - - for (const key in a) { - if (a[key] !== b[key]) { - return false - } - } - - return true -} - -export function isPlainArray(value: unknown): value is Array { - return Array.isArray(value) && value.length === Object.keys(value).length -} - -// Copied from: https://github.com/jonschlinkert/is-plain-object -export function isPlainObject(o: any): o is Record { - if (!hasObjectPrototype(o)) { - return false - } - - // If has no constructor - const ctor = o.constructor - if (ctor === undefined) { - return true - } - - // If has modified prototype - const prot = ctor.prototype - if (!hasObjectPrototype(prot)) { - return false - } - - // If constructor does not have an Object-specific method - if (!prot.hasOwnProperty('isPrototypeOf')) { - return false - } - - // Handles Objects created by Object.create() - if (Object.getPrototypeOf(o) !== Object.prototype) { - return false - } - - // Most likely a plain Object - return true -} - -function hasObjectPrototype(o: any): boolean { - return Object.prototype.toString.call(o) === '[object Object]' -} - -export function sleep(timeout: number): Promise { - return new Promise((resolve) => { - timeoutManager.setTimeout(resolve, timeout) - }) -} - -export function replaceData< - TData, - TOptions extends QueryOptions, ->(prevData: TData | undefined, data: TData, options: TOptions): TData { - if (typeof options.structuralSharing === 'function') { - return options.structuralSharing(prevData, data) as TData - } else if (options.structuralSharing !== false) { - if (process.env.NODE_ENV !== 'production') { - try { - return replaceEqualDeep(prevData, data) - } catch (error) { - console.error( - `Structural sharing requires data to be JSON serializable. To fix this, turn off structuralSharing or return JSON-serializable data from your queryFn. [${options.queryHash}]: ${error}`, - ) - - // Prevent the replaceEqualDeep from being called again down below. - throw error - } - } - // Structurally share data between prev and new data if needed - return replaceEqualDeep(prevData, data) - } - return data -} - -export function keepPreviousData( - previousData: T | undefined, -): T | undefined { - return previousData -} - -export function addToEnd(items: Array, item: T, max = 0): Array { - const newItems = [...items, item] - return max && newItems.length > max ? newItems.slice(1) : newItems -} - -export function addToStart(items: Array, item: T, max = 0): Array { - const newItems = [item, ...items] - return max && newItems.length > max ? newItems.slice(0, -1) : newItems -} - -export const skipToken = Symbol() -export type SkipToken = typeof skipToken - -export function ensureQueryFn< - TQueryFnData = unknown, - TQueryKey extends QueryKey = QueryKey, ->( - options: { - queryFn?: QueryFunction | SkipToken - queryHash?: string - }, - fetchOptions?: FetchOptions, -): QueryFunction { - if (process.env.NODE_ENV !== 'production') { - if (options.queryFn === skipToken) { - console.error( - `Attempted to invoke queryFn when set to skipToken. This is likely a configuration error. Query hash: '${options.queryHash}'`, - ) - } - } - - // if we attempt to retry a fetch that was triggered from an initialPromise - // when we don't have a queryFn yet, we can't retry, so we just return the already rejected initialPromise - // if an observer has already mounted, we will be able to retry with that queryFn - if (!options.queryFn && fetchOptions?.initialPromise) { - return () => fetchOptions.initialPromise! - } - - if (!options.queryFn || options.queryFn === skipToken) { - return () => - Promise.reject(new Error(`Missing queryFn: '${options.queryHash}'`)) - } - - return options.queryFn -} - -export function shouldThrowError) => boolean>( - throwOnError: boolean | T | undefined, - params: Parameters, -): boolean { - // Allow throwOnError function to override throwing behavior on a per-error basis - if (typeof throwOnError === 'function') { - return throwOnError(...params) - } - - return !!throwOnError -} - -export function addConsumeAwareSignal( - object: T, - getSignal: () => AbortSignal, - onCancelled: VoidFunction, -): T & { signal: AbortSignal } { - let consumed = false - let signal: AbortSignal | undefined - - Object.defineProperty(object, 'signal', { - enumerable: true, - get: () => { - signal ??= getSignal() - if (consumed) { - return signal - } - - consumed = true - if (signal.aborted) { - onCancelled() - } else { - signal.addEventListener('abort', onCancelled, { once: true }) - } - - return signal - }, - }) - - return object as T & { signal: AbortSignal } -} diff --git a/node_modules/@tanstack/react-query/LICENSE b/node_modules/@tanstack/react-query/LICENSE deleted file mode 100644 index 1869e21..0000000 --- a/node_modules/@tanstack/react-query/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2021-present Tanner Linsley - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/node_modules/@tanstack/react-query/README.md b/node_modules/@tanstack/react-query/README.md deleted file mode 100644 index 96bffea..0000000 --- a/node_modules/@tanstack/react-query/README.md +++ /dev/null @@ -1,48 +0,0 @@ - - -![TanStack Query Header](https://github.com/TanStack/query/raw/main/media/repo-header.png) - -Hooks for fetching, caching and updating asynchronous data in React - - - #TanStack - - - - - - - - - - semantic-release - - Join the discussion on Github -Best of JS - - - - - Gitpod Ready-to-Code - - -Enjoy this library? Try the entire [TanStack](https://tanstack.com)! [TanStack Table](https://github.com/TanStack/table), [TanStack Router](https://github.com/tanstack/router), [TanStack Virtual](https://github.com/tanstack/virtual), [React Charts](https://github.com/TanStack/react-charts), [React Ranger](https://github.com/TanStack/ranger) - -## Visit [tanstack.com/query](https://tanstack.com/query) for docs, guides, API and more! - -## Quick Features - -- Transport/protocol/backend agnostic data fetching (REST, GraphQL, promises, whatever!) -- Auto Caching + Refetching (stale-while-revalidate, Window Refocus, Polling/Realtime) -- Parallel + Dependent Queries -- Mutations + Reactive Query Refetching -- Multi-layer Cache + Automatic Garbage Collection -- Paginated + Cursor-based Queries -- Load-More + Infinite Scroll Queries w/ Scroll Recovery -- Request Cancellation -- [React Suspense](https://react.dev/reference/react/Suspense) + Fetch-As-You-Render Query Prefetching -- Dedicated Devtools - -### [Become a Sponsor!](https://github.com/sponsors/tannerlinsley/) - - diff --git a/node_modules/@tanstack/react-query/build/codemods/src/utils/index.cjs b/node_modules/@tanstack/react-query/build/codemods/src/utils/index.cjs deleted file mode 100644 index a652e23..0000000 --- a/node_modules/@tanstack/react-query/build/codemods/src/utils/index.cjs +++ /dev/null @@ -1,208 +0,0 @@ -module.exports = ({ root, jscodeshift }) => { - const findImportIdentifierOf = (importSpecifiers, identifier) => { - const specifier = importSpecifiers - .filter((node) => node.value.imported.name === identifier) - .paths() - - if (specifier.length > 0) { - return specifier[0].value.local - } - - return jscodeshift.identifier(identifier) - } - - const findImportSpecifiers = (packageName) => - root - .find(jscodeshift.ImportDeclaration, { - source: { - value: packageName, - }, - }) - .find(jscodeshift.ImportSpecifier, {}) - - const locateImports = ( - identifiers, - packageName = '@tanstack/react-query', - ) => { - const findNamespaceImportIdentifier = () => { - const specifier = root - .find(jscodeshift.ImportDeclaration, { - source: { - value: packageName, - }, - }) - .find(jscodeshift.ImportNamespaceSpecifier) - .paths() - - return specifier.length > 0 ? specifier[0].value.local : null - } - - /** - * First, we search for the namespace import identifier because if we have any, we assume the consumer uses - * namespace imports. In this case, we won't search for named imports at all. - */ - const namespaceImportIdentifier = findNamespaceImportIdentifier() - - if (namespaceImportIdentifier) { - const identifierMap = {} - - for (const identifier of identifiers) { - identifierMap[identifier] = jscodeshift.identifier(identifier) - } - - return { - namespace: namespaceImportIdentifier, - ...identifierMap, - } - } - - const importSpecifiers = findImportSpecifiers(packageName) - const identifierMap = {} - - for (const identifier of identifiers) { - identifierMap[identifier] = findImportIdentifierOf( - importSpecifiers, - identifier, - ) - } - - return { - namespace: null, - ...identifierMap, - } - } - - const findAllMethodCalls = () => - root - // First, we need to find all method calls. - .find(jscodeshift.CallExpression, { - callee: { - type: jscodeshift.MemberExpression.name, - property: { - type: jscodeshift.Identifier.name, - }, - }, - }) - - const findQueryClientIdentifiers = (importIdentifiers) => - root - .find(jscodeshift.VariableDeclarator, {}) - .filter((node) => { - if (node.value.init) { - const initializer = node.value.init - - return ( - isClassInstantiationOf( - initializer, - getSelectorByImports(importIdentifiers, 'QueryClient'), - ) || - isFunctionCallOf( - initializer, - getSelectorByImports(importIdentifiers, 'useQueryClient'), - ) - ) - } - - return false - }) - .paths() - .map((node) => node.value.id.name) - - const isCallExpression = (node) => - jscodeshift.match(node, { type: jscodeshift.CallExpression.name }) - - const isIdentifier = (node) => - jscodeshift.match(node, { type: jscodeshift.Identifier.name }) - - const isMemberExpression = (node) => - jscodeshift.match(node, { type: jscodeshift.MemberExpression.name }) - - const isNewExpression = (node) => - jscodeshift.match(node, { type: jscodeshift.NewExpression.name }) - - const isArrayExpression = (node) => - jscodeshift.match(node, { type: jscodeshift.ArrayExpression.name }) - - const isObjectExpression = (node) => - jscodeshift.match(node, { type: jscodeshift.ObjectExpression.name }) - - const isObjectProperty = (node) => - jscodeshift.match(node, { type: jscodeshift.ObjectProperty.name }) - - const isSpreadElement = (node) => - jscodeshift.match(node, { type: jscodeshift.SpreadElement.name }) - - /** - * @param {import('jscodeshift').Node} node - * @returns {boolean} - */ - const isFunctionDefinition = (node) => { - const isArrowFunctionExpression = jscodeshift.match(node, { - type: jscodeshift.ArrowFunctionExpression.name, - }) - const isFunctionExpression = jscodeshift.match(node, { - type: jscodeshift.FunctionExpression.name, - }) - - return isArrowFunctionExpression || isFunctionExpression - } - - const warn = (message) => { - if (process.env.NODE_ENV !== 'test') { - console.warn(message) - } - } - - const isClassInstantiationOf = (node, selector) => { - if (!isNewExpression(node)) { - return false - } - - const parts = selector.split('.') - - return parts.length === 1 - ? isIdentifier(node.callee) && node.callee.name === parts[0] - : isMemberExpression(node.callee) && - node.callee.object.name === parts[0] && - node.callee.property.name === parts[1] - } - - const isFunctionCallOf = (node, selector) => { - if (!isCallExpression(node)) { - return false - } - - const parts = selector.split('.') - - return parts.length === 1 - ? isIdentifier(node.callee) && node.callee.name === parts[0] - : isMemberExpression(node.callee) && - node.callee.object.name === parts[0] && - node.callee.property.name === parts[1] - } - - const getSelectorByImports = (imports, path) => - imports.namespace - ? `${imports.namespace.name}.${imports[path].name}` - : imports[path].name - - return { - findAllMethodCalls, - getSelectorByImports, - isCallExpression, - isClassInstantiationOf, - isFunctionCallOf, - isIdentifier, - isMemberExpression, - isArrayExpression, - isObjectExpression, - isObjectProperty, - isSpreadElement, - isFunctionDefinition, - locateImports, - warn, - queryClient: { - findQueryClientIdentifiers, - }, - } -} diff --git a/node_modules/@tanstack/react-query/build/codemods/src/utils/transformers/query-cache-transformer.cjs b/node_modules/@tanstack/react-query/build/codemods/src/utils/transformers/query-cache-transformer.cjs deleted file mode 100644 index e20bc01..0000000 --- a/node_modules/@tanstack/react-query/build/codemods/src/utils/transformers/query-cache-transformer.cjs +++ /dev/null @@ -1,124 +0,0 @@ -module.exports = ({ - jscodeshift, - utils, - root, - packageName = '@tanstack/react-query', -}) => { - const isGetQueryCacheMethodCall = ( - initializer, - importIdentifiers, - knownQueryClientIds, - ) => { - const isKnownQueryClient = (node) => - utils.isIdentifier(node) && knownQueryClientIds.includes(node.name) - - const isGetQueryCacheIdentifier = (node) => - utils.isIdentifier(node) && node.name === 'getQueryCache' - - const isValidInitializer = (node) => - utils.isCallExpression(node) && utils.isMemberExpression(node.callee) - - if (isValidInitializer(initializer)) { - const instance = initializer.callee.object - - return ( - isGetQueryCacheIdentifier(initializer.callee.property) && - (isKnownQueryClient(instance) || - utils.isFunctionCallOf( - instance, - utils.getSelectorByImports(importIdentifiers, 'useQueryClient'), - )) - ) - } - - return false - } - - const findQueryCacheInstantiations = ( - importIdentifiers, - knownQueryClientIds, - ) => - root.find(jscodeshift.VariableDeclarator, {}).filter((node) => { - if (node.value.init) { - const initializer = node.value.init - - return ( - utils.isClassInstantiationOf( - initializer, - utils.getSelectorByImports(importIdentifiers, 'QueryCache'), - ) || - isGetQueryCacheMethodCall( - initializer, - importIdentifiers, - knownQueryClientIds, - ) - ) - } - - return false - }) - - const filterQueryCacheMethodCalls = (node) => - utils.isIdentifier(node) && ['find', 'findAll'].includes(node.name) - - const findQueryCacheMethodCalls = (importIdentifiers) => { - /** - * Here we collect all query client instantiations. We have to make aware of them because the query cache can be - * accessed by the query client as well. - */ - const queryClientIdentifiers = - utils.queryClient.findQueryClientIdentifiers(importIdentifiers) - /** - * Here we collect all query cache instantiations. The reason is simple: the methods can be called on query cache - * instances, to locate the possible usages we need to be aware of the identifier names. - */ - const queryCacheIdentifiers = findQueryCacheInstantiations( - importIdentifiers, - queryClientIdentifiers, - ) - .paths() - .map((node) => node.value.id.name) - - return ( - utils - // First, we need to find all method calls. - .findAllMethodCalls() - // Then we narrow the collection to all `fetch` and `fetchAll` methods. - .filter((node) => - filterQueryCacheMethodCalls(node.value.callee.property), - ) - .filter((node) => { - const object = node.value.callee.object - - // If the method is called on a `QueryCache` instance, we keep it in the collection. - if (utils.isIdentifier(object)) { - return queryCacheIdentifiers.includes(object.name) - } - - // If the method is called on a `QueryClient` instance, we keep it in the collection. - if (utils.isCallExpression(object)) { - return isGetQueryCacheMethodCall( - object, - importIdentifiers, - queryClientIdentifiers, - ) - } - - return false - }) - ) - } - - const execute = (replacer) => { - findQueryCacheMethodCalls( - utils.locateImports( - ['QueryCache', 'QueryClient', 'useQueryClient'], - packageName, - ), - ).replaceWith(replacer) - } - - return { - execute, - } -} diff --git a/node_modules/@tanstack/react-query/build/codemods/src/utils/transformers/query-client-transformer.cjs b/node_modules/@tanstack/react-query/build/codemods/src/utils/transformers/query-client-transformer.cjs deleted file mode 100644 index 8282940..0000000 --- a/node_modules/@tanstack/react-query/build/codemods/src/utils/transformers/query-client-transformer.cjs +++ /dev/null @@ -1,53 +0,0 @@ -module.exports = ({ - jscodeshift, - utils, - root, - packageName = '@tanstack/react-query', -}) => { - const filterQueryClientMethodCalls = (node, methods) => - utils.isIdentifier(node) && methods.includes(node.name) - - const findQueryClientMethodCalls = (importIdentifiers, methods) => { - /** - * Here we collect all query client instantiations. We have to make aware of them because some method calls might - * be invoked on these instances. - */ - const queryClientIdentifiers = - utils.queryClient.findQueryClientIdentifiers(importIdentifiers) - - return ( - utils - // First, we need to find all method calls. - .findAllMethodCalls() - // Then we narrow the collection to `QueryClient` methods. - .filter((node) => - filterQueryClientMethodCalls(node.value.callee.property, methods), - ) - .filter((node) => { - const object = node.value.callee.object - - // If the method is called on a `QueryClient` instance, we keep it in the collection. - if (utils.isIdentifier(object)) { - return queryClientIdentifiers.includes(object.name) - } - - // If the method is called on the return value of `useQueryClient` hook, we keep it in the collection. - return utils.isFunctionCallOf( - object, - utils.getSelectorByImports(importIdentifiers, 'useQueryClient'), - ) - }) - ) - } - - const execute = (methods, replacer) => { - findQueryClientMethodCalls( - utils.locateImports(['QueryClient', 'useQueryClient'], packageName), - methods, - ).replaceWith(replacer) - } - - return { - execute, - } -} diff --git a/node_modules/@tanstack/react-query/build/codemods/src/utils/transformers/use-query-like-transformer.cjs b/node_modules/@tanstack/react-query/build/codemods/src/utils/transformers/use-query-like-transformer.cjs deleted file mode 100644 index e364ae0..0000000 --- a/node_modules/@tanstack/react-query/build/codemods/src/utils/transformers/use-query-like-transformer.cjs +++ /dev/null @@ -1,38 +0,0 @@ -module.exports = ({ - jscodeshift, - utils, - root, - packageName = '@tanstack/react-query', -}) => { - const filterUseQueryLikeHookCalls = (node, importIdentifiers, hooks) => { - for (const hook of hooks) { - const selector = utils.getSelectorByImports(importIdentifiers, hook) - - if (utils.isFunctionCallOf(node, selector)) { - return true - } - } - - return false - } - - const findUseQueryLikeHookCalls = (importIdentifiers, hooks) => - root - // First, we need to find all call expressions. - .find(jscodeshift.CallExpression, {}) - // Then we narrow the collection to the `useQuery` like hook calls. - .filter((node) => - filterUseQueryLikeHookCalls(node.value, importIdentifiers, hooks), - ) - - const execute = (hooks, replacer) => { - findUseQueryLikeHookCalls( - utils.locateImports(hooks, packageName), - hooks, - ).replaceWith(replacer) - } - - return { - execute, - } -} diff --git a/node_modules/@tanstack/react-query/build/codemods/src/v4/key-transformation.cjs b/node_modules/@tanstack/react-query/build/codemods/src/v4/key-transformation.cjs deleted file mode 100644 index ad62c08..0000000 --- a/node_modules/@tanstack/react-query/build/codemods/src/v4/key-transformation.cjs +++ /dev/null @@ -1,181 +0,0 @@ -const createUtilsObject = require('../utils/index.cjs') -const createKeyReplacer = require('./utils/replacers/key-replacer.cjs') -const createUseQueryLikeTransformer = require('../utils/transformers/use-query-like-transformer.cjs') -const createQueryClientTransformer = require('../utils/transformers/query-client-transformer.cjs') -const createQueryCacheTransformer = require('../utils/transformers/query-cache-transformer.cjs') - -const transformQueryClientUsages = ({ - jscodeshift, - utils, - root, - filePath, - packageName, -}) => { - const transformer = createQueryClientTransformer({ - jscodeshift, - utils, - root, - packageName, - }) - const replacer = createKeyReplacer({ jscodeshift, root, filePath }) - - transformer.execute( - [ - // Not object syntax-aware methods. - 'getMutationDefaults', - 'getQueriesData', - 'getQueryData', - 'getQueryDefaults', - 'getQueryState', - 'isFetching', - 'setMutationDefaults', - 'setQueriesData', - 'setQueryData', - 'setQueryDefaults', - // Object syntax-aware methods. - 'cancelQueries', - 'fetchInfiniteQuery', - 'fetchQuery', - 'invalidateQueries', - 'prefetchInfiniteQuery', - 'prefetchQuery', - 'refetchQueries', - 'removeQueries', - 'resetQueries', - ], - replacer, - ) -} - -const transformUseQueriesUsages = ({ - jscodeshift, - utils, - root, - packageName, -}) => { - const transformer = createUseQueryLikeTransformer({ - jscodeshift, - utils, - root, - packageName, - }) - const replacer = ({ node }) => { - /** - * When the node doesn't have the 'original' property, that means the codemod has been already applied, - * so we don't need to do any changes. - */ - if (!node.original) { - return node - } - - const newCallExpression = jscodeshift.callExpression(node.original.callee, [ - jscodeshift.objectExpression([ - jscodeshift.property( - 'init', - jscodeshift.identifier('queries'), - node.original.arguments[0], - ), - ]), - ]) - - // TODO: This should be part of one function! - if (node.typeParameters) { - newCallExpression.typeArguments = node.typeParameters - } - - return newCallExpression - } - - transformer.execute(['useQueries'], replacer) -} - -const transformUseQueryLikeUsages = ({ - jscodeshift, - utils, - root, - filePath, - packageName, -}) => { - const transformer = createUseQueryLikeTransformer({ - jscodeshift, - utils, - root, - packageName, - }) - - transformer.execute( - ['useQuery', 'useInfiniteQuery', 'useIsFetching', 'useIsMutating'], - createKeyReplacer({ - jscodeshift, - root, - filePath, - keyName: 'queryKey', - }), - ) - transformer.execute( - ['useMutation'], - createKeyReplacer({ - jscodeshift, - root, - filePath, - keyName: 'mutationKey', - }), - ) -} - -const transformQueryCacheUsages = ({ - jscodeshift, - utils, - root, - filePath, - packageName, -}) => { - const transformer = createQueryCacheTransformer({ - jscodeshift, - utils, - root, - packageName, - }) - const replacer = createKeyReplacer({ jscodeshift, root, filePath }) - - transformer.execute(replacer) -} - -module.exports = (file, api) => { - const jscodeshift = api.jscodeshift - const root = jscodeshift(file.source) - - // TODO: Execute the transformers only when it contains a `react-query` import! - - const utils = createUtilsObject({ root, jscodeshift }) - const filePath = file.path - const packageName = 'react-query' - - // This function transforms usages like `useQuery` and `useMutation`. - transformUseQueryLikeUsages({ - jscodeshift, - utils, - root, - filePath, - packageName, - }) - // This function transforms usages of `useQueries`. - transformUseQueriesUsages({ - jscodeshift, - utils, - root, - packageName, - }) - // This function transforms usages of `QueryClient`. - transformQueryClientUsages({ - jscodeshift, - utils, - root, - filePath, - packageName, - }) - // This function transforms usages of `QueryCache`. - transformQueryCacheUsages({ jscodeshift, utils, root, filePath, packageName }) - - return root.toSource({ quote: 'single', lineTerminator: '\n' }) -} diff --git a/node_modules/@tanstack/react-query/build/codemods/src/v4/replace-import-specifier.cjs b/node_modules/@tanstack/react-query/build/codemods/src/v4/replace-import-specifier.cjs deleted file mode 100644 index 754e2f7..0000000 --- a/node_modules/@tanstack/react-query/build/codemods/src/v4/replace-import-specifier.cjs +++ /dev/null @@ -1,25 +0,0 @@ -module.exports = (file, api) => { - const jscodeshift = api.jscodeshift - const root = jscodeshift(file.source) - - const replacements = [ - { from: 'react-query', to: '@tanstack/react-query' }, - { from: 'react-query/devtools', to: '@tanstack/react-query-devtools' }, - ] - - replacements.forEach(({ from, to }) => { - root - .find(jscodeshift.ImportDeclaration, { - source: { - value: from, - }, - }) - .replaceWith(({ node }) => { - node.source.value = to - - return node - }) - }) - - return root.toSource({ quote: 'single', lineTerminator: '\n' }) -} diff --git a/node_modules/@tanstack/react-query/build/codemods/src/v4/utils/replacers/key-replacer.cjs b/node_modules/@tanstack/react-query/build/codemods/src/v4/utils/replacers/key-replacer.cjs deleted file mode 100644 index 1bd6298..0000000 --- a/node_modules/@tanstack/react-query/build/codemods/src/v4/utils/replacers/key-replacer.cjs +++ /dev/null @@ -1,164 +0,0 @@ -class UnprocessableKeyError extends Error { - constructor(message) { - super(message) - this.name = 'UnprocessableKeyError' - } -} - -module.exports = ({ jscodeshift, root, filePath, keyName = 'queryKey' }) => { - const isArrayExpression = (node) => - jscodeshift.match(node, { type: jscodeshift.ArrayExpression.name }) - - const isStringLiteral = (node) => - jscodeshift.match(node, { type: jscodeshift.StringLiteral.name }) || - jscodeshift.match(node, { type: jscodeshift.Literal.name }) - - const isTemplateLiteral = (node) => - jscodeshift.match(node, { type: jscodeshift.TemplateLiteral.name }) - - const findVariableDeclaration = (node) => { - const declarations = root - .find(jscodeshift.VariableDeclarator, { - id: { - type: jscodeshift.Identifier.name, - name: node.name, - }, - }) - .paths() - - return declarations.length > 0 ? declarations[0] : null - } - - const createKeyValue = (node) => { - // When the node is a string literal we convert it into an array of strings. - if (isStringLiteral(node)) { - return jscodeshift.arrayExpression([ - jscodeshift.stringLiteral(node.value), - ]) - } - - // When the node is a template literal we convert it into an array of template literals. - if (isTemplateLiteral(node)) { - return jscodeshift.arrayExpression([ - jscodeshift.templateLiteral(node.quasis, node.expressions), - ]) - } - - if (jscodeshift.match(node, { type: jscodeshift.Identifier.name })) { - // When the node is an identifier at first, we try to find its declaration, because we will try - // to guess its type. - const variableDeclaration = findVariableDeclaration(node) - - if (!variableDeclaration) { - throw new UnprocessableKeyError( - `In file ${filePath} at line ${node.loc.start.line} the type of identifier \`${node.name}\` couldn't be recognized, so the codemod couldn't be applied. Please migrate manually.`, - ) - } - - const initializer = variableDeclaration.value.init - - // When it's a string, we just wrap it into an array expression. - if (isStringLiteral(initializer) || isTemplateLiteral(initializer)) { - return jscodeshift.arrayExpression([node]) - } - } - - throw new UnprocessableKeyError( - `In file ${filePath} at line ${node.loc.start.line} the type of the \`${keyName}\` couldn't be recognized, so the codemod couldn't be applied. Please migrate manually.`, - ) - } - - const createKeyProperty = (node) => - jscodeshift.property( - 'init', - jscodeshift.identifier(keyName), - createKeyValue(node), - ) - - const getPropertyFromObjectExpression = (objectExpression, propertyName) => - objectExpression.properties.find( - (property) => property.key.name === propertyName, - ) ?? null - - const buildWithTypeArguments = (node, builder) => { - const newNode = builder(node) - - if (node.typeParameters) { - newNode.typeArguments = node.typeParameters - } - - return newNode - } - - return ({ node }) => { - // When the node doesn't have the 'original' property, that means the codemod has been already applied, - // so we don't need to do any changes. - if (!node.original) { - return node - } - - const methodArguments = node.arguments - - // The method call doesn't have any arguments, we have nothing to do in this case. - if (methodArguments.length === 0) { - return node - } - - try { - const [firstArgument, ...restOfTheArguments] = methodArguments - - if ( - jscodeshift.match(firstArgument, { - type: jscodeshift.ObjectExpression.name, - }) - ) { - const originalKey = getPropertyFromObjectExpression( - firstArgument, - keyName, - ) - - if (!originalKey) { - throw new UnprocessableKeyError( - `In file ${filePath} at line ${node.loc.start.line} the \`${keyName}\` couldn't be found. Did you forget to add it?`, - ) - } - - const restOfTheProperties = firstArgument.properties.filter( - (item) => item.key.name !== keyName, - ) - - return buildWithTypeArguments(node, (originalNode) => - jscodeshift.callExpression(originalNode.original.callee, [ - jscodeshift.objectExpression([ - createKeyProperty(originalKey.value), - ...restOfTheProperties, - ]), - ...restOfTheArguments, - ]), - ) - } - - // When the node is an array expression we just simply return it because we want query keys to be arrays. - if (isArrayExpression(firstArgument)) { - return node - } - - return buildWithTypeArguments(node, (originalNode) => - jscodeshift.callExpression(originalNode.original.callee, [ - createKeyValue(firstArgument), - ...restOfTheArguments, - ]), - ) - } catch (error) { - if (error.name === 'UnprocessableKeyError') { - if (process.env.NODE_ENV !== 'test') { - console.warn(error.message) - } - - return node - } - - throw error - } - } -} diff --git a/node_modules/@tanstack/react-query/build/codemods/src/v5/is-loading/is-loading.cjs b/node_modules/@tanstack/react-query/build/codemods/src/v5/is-loading/is-loading.cjs deleted file mode 100644 index eb7f1b0..0000000 --- a/node_modules/@tanstack/react-query/build/codemods/src/v5/is-loading/is-loading.cjs +++ /dev/null @@ -1,244 +0,0 @@ -const createUtilsObject = require('../../utils/index.cjs') -const createUseQueryLikeTransformer = require('../../utils/transformers/use-query-like-transformer.cjs') -const createQueryClientTransformer = require('../../utils/transformers/query-client-transformer.cjs') - -const originalName = 'isLoading' -const newName = 'isPending' - -/** - * @param {import('jscodeshift')} jscodeshift - * @param {Object} utils - * @param {import('jscodeshift').Collection} root - * @param {string} filePath - * @param {{keyName: "mutationKey"|"queryKey", queryClientMethods: ReadonlyArray, hooks: ReadonlyArray}} config - */ -const transformUsages = ({ jscodeshift, utils, root, filePath, config }) => { - /** - * @param {import('jscodeshift').CallExpression | import('jscodeshift').ExpressionStatement} node - * @returns {{start: number, end: number}} - */ - const getNodeLocation = (node) => { - const location = utils.isCallExpression(node) ? node.callee.loc : node.loc - const start = location.start.line - const end = location.end.line - - return { start, end } - } - - /** - * @param {import('jscodeshift').ASTNode} node - * @returns {boolean} - */ - const isObjectExpression = (node) => { - return jscodeshift.match(node, { - type: jscodeshift.ObjectExpression.name, - }) - } - - /** - * @param {import('jscodeshift').ASTNode} node - * @returns {boolean} - */ - const isObjectPattern = (node) => { - return jscodeshift.match(node, { - type: jscodeshift.ObjectPattern.name, - }) - } - - /** - * @param {import('jscodeshift').ASTNode} node - * @returns {boolean} - */ - const isVariableDeclarator = (node) => { - return jscodeshift.match(node, { - type: jscodeshift.VariableDeclarator.name, - }) - } - - /** - * @param {import('jscodeshift').Node} node - * @param {import('jscodeshift').Identifier} identifier - * @returns {Collection} - */ - const findIsLoadingPropertiesOfIdentifier = (node, identifier) => { - return jscodeshift(node).find(jscodeshift.MemberExpression, { - object: { - type: jscodeshift.Identifier.name, - name: identifier.name, - }, - property: { - type: jscodeshift.Identifier.name, - name: originalName, - }, - }) - } - - /** - * @param {import('jscodeshift').ObjectPattern} node - * @returns {import('jscodeshift').ObjectProperty|null} - */ - const findIsLoadingObjectPropertyInObjectPattern = (node) => { - return ( - node.properties.find((property) => - jscodeshift.match(property, { - key: { - type: jscodeshift.Identifier.name, - name: originalName, - }, - }), - ) ?? null - ) - } - - /** - * @param {import('jscodeshift').ObjectPattern} node - * @returns {import('jscodeshift').RestElement|null} - */ - const findRestElementInObjectPattern = (node) => { - return ( - node.properties.find((property) => - jscodeshift.match(property, { - type: jscodeshift.RestElement.name, - }), - ) ?? null - ) - } - - const replacer = (path, transformNode) => { - const node = path.node - const parentNode = path.parentPath.value - const { start, end } = getNodeLocation(node) - - try { - if (!isVariableDeclarator(parentNode)) { - // The parent node is not a variable declarator, the transformation will be skipped. - return node - } - - const lookupNode = path.scope.node - const variableDeclaratorId = parentNode.id - - if (isObjectPattern(variableDeclaratorId)) { - const isLoadingObjectProperty = - findIsLoadingObjectPropertyInObjectPattern(variableDeclaratorId) - - if (isLoadingObjectProperty) { - jscodeshift(lookupNode) - .find(jscodeshift.ObjectProperty, { - key: { - type: jscodeshift.Identifier.name, - name: originalName, - }, - }) - .replaceWith((mutablePath) => { - if (isObjectPattern(mutablePath.parent)) { - const affectedProperty = mutablePath.value.value.shorthand - ? 'value' - : 'key' - - mutablePath.value[affectedProperty].name = newName - - return mutablePath.value - } - - if (isObjectExpression(mutablePath.parent)) { - const affectedProperty = mutablePath.value.value.shorthand - ? 'key' - : 'value' - - mutablePath.value[affectedProperty].name = newName - - return mutablePath.value - } - - return mutablePath.value - }) - - // Renaming all other 'isLoading' references that are object properties. - jscodeshift(lookupNode) - .find(jscodeshift.Identifier, { name: originalName }) - .replaceWith((mutablePath) => { - if ( - !jscodeshift.match(mutablePath.parent, { - type: jscodeshift.ObjectProperty.name, - }) - ) { - mutablePath.value.name = newName - } - - return mutablePath.value - }) - } - - const restElement = findRestElementInObjectPattern(variableDeclaratorId) - - if (restElement) { - findIsLoadingPropertiesOfIdentifier( - lookupNode, - restElement.argument, - ).replaceWith(({ node: mutableNode }) => { - mutableNode.property.name = newName - - return mutableNode - }) - } - - return node - } - - if (utils.isIdentifier(variableDeclaratorId)) { - findIsLoadingPropertiesOfIdentifier( - lookupNode, - variableDeclaratorId, - ).replaceWith(({ node: mutableNode }) => { - mutableNode.property.name = newName - - return mutableNode - }) - - return node - } - - utils.warn( - `The usage in file "${filePath}" at line ${start}:${end} could not be transformed. Please migrate this usage manually.`, - ) - - return node - } catch (error) { - utils.warn( - `An unknown error occurred while processing the "${filePath}" file. Please review this file, because the codemod couldn't be applied.`, - ) - - return node - } - } - - createUseQueryLikeTransformer({ jscodeshift, utils, root }).execute( - config.hooks, - replacer, - ) - - createQueryClientTransformer({ jscodeshift, utils, root }).execute( - config.queryClientMethods, - replacer, - ) -} - -module.exports = (file, api) => { - const jscodeshift = api.jscodeshift - const root = jscodeshift(file.source) - const utils = createUtilsObject({ root, jscodeshift }) - const filePath = file.path - - const dependencies = { jscodeshift, utils, root, filePath } - - transformUsages({ - ...dependencies, - config: { - hooks: ['useQuery', 'useMutation'], - queryClientMethods: [], - }, - }) - - return root.toSource({ quote: 'single', lineTerminator: '\n' }) -} diff --git a/node_modules/@tanstack/react-query/build/codemods/src/v5/keep-previous-data/README.md b/node_modules/@tanstack/react-query/build/codemods/src/v5/keep-previous-data/README.md deleted file mode 100644 index a85f434..0000000 --- a/node_modules/@tanstack/react-query/build/codemods/src/v5/keep-previous-data/README.md +++ /dev/null @@ -1,32 +0,0 @@ -### Intro - -The prerequisite for this code mod is to migrate your usages to the new syntax, so overloads for hooks and `QueryClient` methods shouldn't be available anymore. - -### Affected usages - -Please note, this code mod transforms usages only where the first argument is an object expression. - -The following usage should be transformed by the code mod: - -```ts -const { data } = useQuery({ - queryKey: ['posts'], - queryFn: queryFn, - keepPreviousData: true, -}) -``` - -But the following usage won't be transformed by the code mod, because the first argument an identifier: - -```ts -const hookArgument = { - queryKey: ['posts'], - queryFn: queryFn, - keepPreviousData: true, -} -const { data } = useQuery(hookArgument) -``` - -### Troubleshooting - -In case of any errors, feel free to reach us out via Discord or open an issue. If you open an issue, please provide a code snippet as well, because without a snippet we cannot find the bug in the code mod. diff --git a/node_modules/@tanstack/react-query/build/codemods/src/v5/keep-previous-data/keep-previous-data.cjs b/node_modules/@tanstack/react-query/build/codemods/src/v5/keep-previous-data/keep-previous-data.cjs deleted file mode 100644 index 3f3e3b7..0000000 --- a/node_modules/@tanstack/react-query/build/codemods/src/v5/keep-previous-data/keep-previous-data.cjs +++ /dev/null @@ -1,271 +0,0 @@ -const createUtilsObject = require('../../utils/index.cjs') -const createUseQueryLikeTransformer = require('../../utils/transformers/use-query-like-transformer.cjs') -const createQueryClientTransformer = require('../../utils/transformers/query-client-transformer.cjs') -const AlreadyHasPlaceholderDataProperty = require('./utils/already-has-placeholder-data-property.cjs') - -/** - * @param {import('jscodeshift')} jscodeshift - * @param {Object} utils - * @param {import('jscodeshift').Collection} root - * @param {string} filePath - * @param {{keyName: "mutationKey"|"queryKey", queryClientMethods: ReadonlyArray, hooks: ReadonlyArray}} config - */ -const transformUsages = ({ jscodeshift, utils, root, filePath, config }) => { - /** - * @param {import('jscodeshift').CallExpression | import('jscodeshift').ExpressionStatement} node - * @returns {{start: number, end: number}} - */ - const getNodeLocation = (node) => { - const location = utils.isCallExpression(node) ? node.callee.loc : node.loc - const start = location.start.line - const end = location.end.line - - return { start, end } - } - - /** - * @param {import('jscodeshift').ObjectProperty} objectProperty - * @returns {boolean} - */ - const isKeepPreviousDataObjectProperty = (objectProperty) => { - return jscodeshift.match(objectProperty.key, { - type: jscodeshift.Identifier.name, - name: 'keepPreviousData', - }) - } - - /** - * @param {import('jscodeshift').ObjectProperty} objectProperty - * @returns {boolean} - */ - const isObjectPropertyHasTrueBooleanLiteralValue = (objectProperty) => { - return jscodeshift.match(objectProperty.value, { - type: jscodeshift.BooleanLiteral.name, - value: true, - }) - } - - /** - * @param {import('jscodeshift').ObjectExpression} objectExpression - * @returns {Array} - */ - const filterKeepPreviousDataProperty = (objectExpression) => { - return objectExpression.properties.filter((objectProperty) => { - return !isKeepPreviousDataObjectProperty(objectProperty) - }) - } - - const createPlaceholderDataObjectProperty = () => { - return jscodeshift.objectProperty( - jscodeshift.identifier('placeholderData'), - jscodeshift.identifier('keepPreviousData'), - ) - } - - /** - * @param {import('jscodeshift').ObjectExpression} objectExpression - * @returns {boolean} - */ - const hasPlaceholderDataProperty = (objectExpression) => { - return ( - objectExpression.properties.findIndex((objectProperty) => { - return jscodeshift.match(objectProperty.key, { - type: jscodeshift.Identifier.name, - name: 'placeholderData', - }) - }) !== -1 - ) - } - - /** - * @param {import('jscodeshift').ObjectExpression} objectExpression - * @returns {import('jscodeshift').ObjectProperty | undefined} - */ - const getKeepPreviousDataProperty = (objectExpression) => { - return objectExpression.properties.find(isKeepPreviousDataObjectProperty) - } - - let shouldAddKeepPreviousDataImport = false - - const replacer = (path, resolveTargetArgument, transformNode) => { - const node = path.node - const { start, end } = getNodeLocation(node) - - try { - const targetArgument = resolveTargetArgument(node) - - if (targetArgument && utils.isObjectExpression(targetArgument)) { - const isPlaceholderDataPropertyPresent = - hasPlaceholderDataProperty(targetArgument) - - if (hasPlaceholderDataProperty(targetArgument)) { - throw new AlreadyHasPlaceholderDataProperty(node, filePath) - } - - const keepPreviousDataProperty = - getKeepPreviousDataProperty(targetArgument) - - const keepPreviousDataPropertyHasTrueValue = - isObjectPropertyHasTrueBooleanLiteralValue(keepPreviousDataProperty) - - if (!keepPreviousDataPropertyHasTrueValue) { - utils.warn( - `The usage in file "${filePath}" at line ${start}:${end} already contains a "keepPreviousData" property but its value is not "true". Please migrate this usage manually.`, - ) - - return node - } - - if (keepPreviousDataPropertyHasTrueValue) { - // Removing the `keepPreviousData` property from the object. - const mutableObjectExpressionProperties = - filterKeepPreviousDataProperty(targetArgument) - - if (!isPlaceholderDataPropertyPresent) { - shouldAddKeepPreviousDataImport = true - - // When the `placeholderData` property is not present, the `placeholderData: keepPreviousData` property will be added. - mutableObjectExpressionProperties.push( - createPlaceholderDataObjectProperty(), - ) - } - - return transformNode( - node, - jscodeshift.objectExpression(mutableObjectExpressionProperties), - ) - } - } - - utils.warn( - `The usage in file "${filePath}" at line ${start}:${end} could not be transformed, because the first parameter is not an object expression. Please migrate this usage manually.`, - ) - - return node - } catch (error) { - utils.warn( - error.name === AlreadyHasPlaceholderDataProperty.name - ? error.message - : `An unknown error occurred while processing the "${filePath}" file. Please review this file, because the codemod couldn't be applied.`, - ) - - return node - } - } - - createUseQueryLikeTransformer({ jscodeshift, utils, root }).execute( - config.hooks, - (path) => { - const resolveTargetArgument = (node) => node.arguments[0] ?? null - const transformNode = (node, transformedArgument) => - jscodeshift.callExpression(node.original.callee, [transformedArgument]) - - return replacer(path, resolveTargetArgument, transformNode) - }, - ) - - createQueryClientTransformer({ jscodeshift, utils, root }).execute( - config.queryClientMethods, - (path) => { - const resolveTargetArgument = (node) => node.arguments[1] ?? null - const transformNode = (node, transformedArgument) => { - return jscodeshift.callExpression(node.original.callee, [ - node.arguments[0], - transformedArgument, - ...node.arguments.slice(2, 0), - ]) - } - - return replacer(path, resolveTargetArgument, transformNode) - }, - ) - - const importIdentifierOfQueryClient = utils.getSelectorByImports( - utils.locateImports(['QueryClient']), - 'QueryClient', - ) - - root - .find(jscodeshift.ExpressionStatement, { - expression: { - type: jscodeshift.NewExpression.name, - callee: { - type: jscodeshift.Identifier.name, - name: importIdentifierOfQueryClient, - }, - }, - }) - .filter((path) => path.node.expression) - .replaceWith((path) => { - const resolveTargetArgument = (node) => { - const paths = jscodeshift(node) - .find(jscodeshift.ObjectProperty, { - key: { - type: jscodeshift.Identifier.name, - name: 'keepPreviousData', - }, - }) - .paths() - - return paths.length > 0 ? paths[0].parent.node : null - } - const transformNode = (node, transformedArgument) => { - jscodeshift(node.expression) - .find(jscodeshift.ObjectProperty, { - key: { - type: jscodeshift.Identifier.name, - name: 'queries', - }, - }) - .replaceWith(({ node: mutableNode }) => { - mutableNode.value.properties = transformedArgument.properties - - return mutableNode - }) - - return node - } - - return replacer(path, resolveTargetArgument, transformNode) - }) - - return { shouldAddKeepPreviousDataImport } -} - -module.exports = (file, api) => { - const jscodeshift = api.jscodeshift - const root = jscodeshift(file.source) - const utils = createUtilsObject({ root, jscodeshift }) - const filePath = file.path - - const dependencies = { jscodeshift, utils, root, filePath } - - const { shouldAddKeepPreviousDataImport } = transformUsages({ - ...dependencies, - config: { - hooks: ['useInfiniteQuery', 'useQueries', 'useQuery'], - queryClientMethods: ['setQueryDefaults'], - }, - }) - - if (shouldAddKeepPreviousDataImport) { - root - .find(jscodeshift.ImportDeclaration, { - source: { - value: '@tanstack/react-query', - }, - }) - .replaceWith(({ node: mutableNode }) => { - mutableNode.specifiers = [ - jscodeshift.importSpecifier( - jscodeshift.identifier('keepPreviousData'), - ), - ...mutableNode.specifiers, - ] - - return mutableNode - }) - } - - return root.toSource({ quote: 'single', lineTerminator: '\n' }) -} diff --git a/node_modules/@tanstack/react-query/build/codemods/src/v5/keep-previous-data/utils/already-has-placeholder-data-property.cjs b/node_modules/@tanstack/react-query/build/codemods/src/v5/keep-previous-data/utils/already-has-placeholder-data-property.cjs deleted file mode 100644 index c0bca9c..0000000 --- a/node_modules/@tanstack/react-query/build/codemods/src/v5/keep-previous-data/utils/already-has-placeholder-data-property.cjs +++ /dev/null @@ -1,26 +0,0 @@ -class AlreadyHasPlaceholderDataProperty extends Error { - /** - * @param {import('jscodeshift').CallExpression} callExpression - * @param {string} filePath - */ - constructor(callExpression, filePath) { - super('') - this.message = this.buildMessage(callExpression, filePath) - this.name = 'AlreadyHasPlaceholderDataProperty' - } - - /** - * @param {import('jscodeshift').CallExpression} callExpression - * @param {string} filePath - * @returns {string} - */ - buildMessage(callExpression, filePath) { - const location = callExpression.callee.loc - const start = location.start.line - const end = location.end.line - - return `The usage in file "${filePath}" at line ${start}:${end} already contains a a "placeholderData" property. Please migrate this usage manually.` - } -} - -module.exports = AlreadyHasPlaceholderDataProperty diff --git a/node_modules/@tanstack/react-query/build/codemods/src/v5/remove-overloads/remove-overloads.cjs b/node_modules/@tanstack/react-query/build/codemods/src/v5/remove-overloads/remove-overloads.cjs deleted file mode 100644 index 9a7865b..0000000 --- a/node_modules/@tanstack/react-query/build/codemods/src/v5/remove-overloads/remove-overloads.cjs +++ /dev/null @@ -1,58 +0,0 @@ -const createUtilsObject = require('../../utils/index.cjs') -const transformFilterAwareUsages = require('./transformers/filter-aware-usage-transformer.cjs') -const transformQueryFnAwareUsages = require('./transformers/query-fn-aware-usage-transformer.cjs') - -module.exports = (file, api) => { - const jscodeshift = api.jscodeshift - const root = jscodeshift(file.source) - const utils = createUtilsObject({ root, jscodeshift }) - const filePath = file.path - - const dependencies = { jscodeshift, utils, root, filePath } - - transformFilterAwareUsages({ - ...dependencies, - config: { - keyName: 'queryKey', - fnName: 'queryFn', - queryClientMethods: [ - 'cancelQueries', - 'getQueriesData', - 'invalidateQueries', - 'isFetching', - 'refetchQueries', - 'removeQueries', - 'resetQueries', - // 'setQueriesData', - ], - hooks: ['useIsFetching', 'useQuery'], - }, - }) - - transformFilterAwareUsages({ - ...dependencies, - config: { - keyName: 'mutationKey', - fnName: 'mutationFn', - queryClientMethods: [], - hooks: ['useIsMutating', 'useMutation'], - }, - }) - - transformQueryFnAwareUsages({ - ...dependencies, - config: { - keyName: 'queryKey', - queryClientMethods: [ - 'ensureQueryData', - 'fetchQuery', - 'prefetchQuery', - 'fetchInfiniteQuery', - 'prefetchInfiniteQuery', - ], - hooks: [], - }, - }) - - return root.toSource({ quote: 'single', lineTerminator: '\n' }) -} diff --git a/node_modules/@tanstack/react-query/build/codemods/src/v5/remove-overloads/transformers/filter-aware-usage-transformer.cjs b/node_modules/@tanstack/react-query/build/codemods/src/v5/remove-overloads/transformers/filter-aware-usage-transformer.cjs deleted file mode 100644 index 33e098b..0000000 --- a/node_modules/@tanstack/react-query/build/codemods/src/v5/remove-overloads/transformers/filter-aware-usage-transformer.cjs +++ /dev/null @@ -1,271 +0,0 @@ -const createV5UtilsObject = require('../utils/index.cjs') -const UnknownUsageError = require('../utils/unknown-usage-error.cjs') -const createQueryClientTransformer = require('../../../utils/transformers/query-client-transformer.cjs') -const createQueryCacheTransformer = require('../../../utils/transformers/query-cache-transformer.cjs') -const createUseQueryLikeTransformer = require('../../../utils/transformers/use-query-like-transformer.cjs') - -/** - * @param {import('jscodeshift').api} jscodeshift - * @param {Object} utils - * @param {import('jscodeshift').Collection} root - * @param {string} filePath - * @param {{keyName: "mutationKey"|"queryKey", fnName: "mutationFn"|"queryFn", queryClientMethods: ReadonlyArray, hooks: ReadonlyArray}} config - */ -const transformFilterAwareUsages = ({ - jscodeshift, - utils, - root, - filePath, - config, -}) => { - const v5Utils = createV5UtilsObject({ jscodeshift, utils }) - - /** - * @param {import('jscodeshift').CallExpression} node - * @param {"mutationKey"|"queryKey"} keyName - * @param {"mutationFn"|"queryFn"} fnName - * @returns {boolean} - */ - const canSkipReplacement = (node, keyName, fnName) => { - const callArguments = node.arguments - - const hasKeyOrFnProperty = () => - callArguments[0].properties.some( - (property) => - utils.isObjectProperty(property) && - property.key.name !== keyName && - property.key.name !== fnName, - ) - - /** - * This call has at least one argument. If it's an object expression and contains the "queryKey" or "mutationKey" - * field, the transformation can be skipped, because it's already matching the expected signature. - */ - return ( - callArguments.length > 0 && - utils.isObjectExpression(callArguments[0]) && - hasKeyOrFnProperty() - ) - } - - /** - * This function checks whether the given object property is a spread element or a property that's not named - * "queryKey" or "mutationKey". - * - * @param {import('jscodeshift').ObjectProperty} property - * @returns {boolean} - */ - const predicate = (property) => { - const isSpreadElement = utils.isSpreadElement(property) - const isObjectProperty = utils.isObjectProperty(property) - - return ( - isSpreadElement || - (isObjectProperty && property.key.name !== config.keyName) - ) - } - - const replacer = (path) => { - const node = path.node - - const isFunctionDefinition = (functionArgument) => { - if (utils.isFunctionDefinition(functionArgument)) { - return true - } - - if (utils.isIdentifier(functionArgument)) { - const binding = v5Utils.getBindingFromScope( - path, - functionArgument.name, - filePath, - ) - - const isVariableDeclarator = jscodeshift.match(binding, { - type: jscodeshift.VariableDeclarator.name, - }) - - return isVariableDeclarator && utils.isFunctionDefinition(binding.init) - } - } - - try { - // If the given method/function call matches certain criteria, the node doesn't need to be replaced, this step can be skipped. - if (canSkipReplacement(node, config.keyName, config.fnName)) { - return node - } - - /** - * Here we attempt to determine the first parameter of the function call. - * If it's a function definition, we can create an object property from it (the mutation fn). - */ - const firstArgument = node.arguments[0] - if (isFunctionDefinition(firstArgument)) { - const objectExpression = jscodeshift.objectExpression([ - jscodeshift.property( - 'init', - jscodeshift.identifier(config.fnName), - firstArgument, - ), - ]) - - const secondArgument = node.arguments[1] - - if (secondArgument) { - // If it's an object expression, we can copy the properties from it to the newly created object expression. - if (utils.isObjectExpression(secondArgument)) { - v5Utils.copyPropertiesFromSource( - secondArgument, - objectExpression, - predicate, - ) - } else { - // Otherwise, we simply spread the second argument in the newly created object expression. - objectExpression.properties.push( - jscodeshift.spreadElement(secondArgument), - ) - } - } - - return jscodeshift.callExpression(node.original.callee, [ - objectExpression, - ]) - } - - /** - * If, instead, the first parameter is an array expression or an identifier that references - * an array expression, then we create an object property from it (the query or mutation key). - * - * @type {import('jscodeshift').Property|undefined} - */ - const keyProperty = v5Utils.transformArgumentToKey( - path, - node.arguments[0], - config.keyName, - filePath, - ) - - /** - * The first parameter couldn't be transformed into an object property, so it's time to throw an exception, - * it will notify the consumers that they need to rewrite this usage manually. - */ - if (!keyProperty) { - const secondArgument = - node.arguments.length > 1 ? node.arguments[1] : null - - if (!secondArgument) { - throw new UnknownUsageError(node, filePath) - } - - if (utils.isFunctionDefinition(secondArgument)) { - const originalArguments = node.arguments - const firstArgument = jscodeshift.objectExpression([ - jscodeshift.property( - 'init', - jscodeshift.identifier(config.keyName), - originalArguments[0], - ), - jscodeshift.property( - 'init', - jscodeshift.identifier(config.fnName), - secondArgument, - ), - ]) - - return jscodeshift.callExpression(node.original.callee, [ - firstArgument, - ...originalArguments.slice(2), - ]) - } - } - - const functionArguments = [jscodeshift.objectExpression([keyProperty])] - const secondParameter = node.arguments[1] - - if (secondParameter) { - const createdObjectExpression = functionArguments[0] - - if (isFunctionDefinition(secondParameter)) { - const objectExpression = jscodeshift.objectExpression([ - jscodeshift.property( - 'init', - jscodeshift.identifier(config.keyName), - node.arguments[0], - ), - jscodeshift.property( - 'init', - jscodeshift.identifier(config.fnName), - secondParameter, - ), - ]) - - const thirdArgument = node.arguments[2] - - if (thirdArgument) { - // If it's an object expression, we can copy the properties from it to the newly created object expression. - if (utils.isObjectExpression(thirdArgument)) { - v5Utils.copyPropertiesFromSource( - thirdArgument, - objectExpression, - predicate, - ) - } else { - // Otherwise, we simply spread the third argument in the newly created object expression. - objectExpression.properties.push( - jscodeshift.spreadElement(thirdArgument), - ) - } - } - - return jscodeshift.callExpression(node.original.callee, [ - objectExpression, - ]) - } - - /** - * If it has a second argument, and it's an object expression, then we get the properties from it - * (except the "queryKey" or "mutationKey" properties), because these arguments will also be moved to the - * newly created object expression. - */ - if (utils.isObjectExpression(secondParameter)) { - v5Utils.copyPropertiesFromSource( - secondParameter, - createdObjectExpression, - predicate, - ) - } else { - // Otherwise, we simply spread the second parameter in the newly created object expression. - createdObjectExpression.properties.push( - jscodeshift.spreadElement(secondParameter), - ) - } - } - - // The rest of the function arguments can be simply pushed to the function arguments object so all will be kept. - functionArguments.push(...node.arguments.slice(2)) - - return jscodeshift.callExpression(node.original.callee, functionArguments) - } catch (error) { - utils.warn( - error.name === UnknownUsageError.name - ? error.message - : `An unknown error occurred while processing the "${filePath}" file. Please review this file, because the codemod couldn't be applied.`, - ) - - return node - } - } - - createQueryClientTransformer({ jscodeshift, utils, root }).execute( - config.queryClientMethods, - replacer, - ) - - createUseQueryLikeTransformer({ jscodeshift, utils, root }).execute( - config.hooks, - replacer, - ) - - createQueryCacheTransformer({ jscodeshift, utils, root }).execute(replacer) -} - -module.exports = transformFilterAwareUsages diff --git a/node_modules/@tanstack/react-query/build/codemods/src/v5/remove-overloads/transformers/query-fn-aware-usage-transformer.cjs b/node_modules/@tanstack/react-query/build/codemods/src/v5/remove-overloads/transformers/query-fn-aware-usage-transformer.cjs deleted file mode 100644 index 3f29d41..0000000 --- a/node_modules/@tanstack/react-query/build/codemods/src/v5/remove-overloads/transformers/query-fn-aware-usage-transformer.cjs +++ /dev/null @@ -1,185 +0,0 @@ -const createV5UtilsObject = require('../utils/index.cjs') -const UnknownUsageError = require('../utils/unknown-usage-error.cjs') -const createQueryClientTransformer = require('../../../utils/transformers/query-client-transformer.cjs') - -/** - * @param {import('jscodeshift').api} jscodeshift - * @param {Object} utils - * @param {import('jscodeshift').Collection} root - * @param {string} filePath - * @param {{keyName: "mutationKey"|"queryKey", queryClientMethods: ReadonlyArray, hooks: ReadonlyArray}} config - */ -const transformQueryFnAwareUsages = ({ - jscodeshift, - utils, - root, - filePath, - config, -}) => { - const v5Utils = createV5UtilsObject({ jscodeshift, utils }) - - /** - * @param {import('jscodeshift').CallExpression} node - * @returns {boolean} - */ - const canSkipReplacement = (node) => { - const callArguments = node.arguments - - const hasKeyProperty = () => - callArguments[0].properties.some( - (property) => - utils.isObjectProperty(property) && - [config.keyName, 'queryFn'].includes(property.key.name), - ) - - return ( - callArguments.length > 0 && - utils.isObjectExpression(callArguments[0]) && - hasKeyProperty() - ) - } - - const predicate = (property) => { - const isSpreadElement = utils.isSpreadElement(property) - const isObjectProperty = utils.isObjectProperty(property) - - return ( - isSpreadElement || - (isObjectProperty && property.key.name !== config.keyName) - ) - } - - const transformArgumentToQueryFunction = (path, node) => { - const isIdentifier = utils.isIdentifier(node) - const isFunctionDefinition = utils.isFunctionDefinition(node) - - if (!isIdentifier && !isFunctionDefinition) { - return undefined - } - - if (isFunctionDefinition) { - return jscodeshift.property( - 'init', - jscodeshift.identifier('queryFn'), - node, - ) - } - - const binding = v5Utils.getBindingFromScope(path, node.name, filePath) - const initializer = v5Utils.getInitializerByDeclarator(binding) - - if (!utils.isFunctionDefinition(initializer)) { - return undefined - } - - return jscodeshift.property( - 'init', - jscodeshift.identifier('queryFn'), - binding.id, - ) - } - - const transformArgumentToOptionsObject = (path, node) => { - if (!utils.isIdentifier(node)) { - return undefined - } - - const binding = v5Utils.getBindingFromScope(path, node.name, filePath) - const initializer = v5Utils.getInitializerByDeclarator(binding) - - if (utils.isObjectExpression(initializer)) { - return jscodeshift.spreadElement(binding.id) - } - } - - const replacer = (path) => { - const node = path.node - - try { - // If the given method/function call matches certain criteria, the node doesn't need to be replaced, this step can be skipped. - if (canSkipReplacement(node)) { - return node - } - - const keyProperty = v5Utils.transformArgumentToKey( - path, - node.arguments[0], - config.keyName, - filePath, - ) - - if (!keyProperty) { - throw new UnknownUsageError(node, filePath) - } - - const parameters = [jscodeshift.objectExpression([keyProperty])] - const createdObjectExpression = parameters[0] - const secondParameter = node.arguments[1] - - if (secondParameter) { - const queryFnProperty = transformArgumentToQueryFunction( - path, - secondParameter, - ) - - if (queryFnProperty) { - createdObjectExpression.properties.push(queryFnProperty) - - const thirdParameter = node.arguments[2] - - if (utils.isObjectExpression(thirdParameter)) { - v5Utils.copyPropertiesFromSource( - thirdParameter, - createdObjectExpression, - predicate, - ) - } else { - createdObjectExpression.properties.push( - jscodeshift.spreadElement(thirdParameter), - ) - } - - return jscodeshift.callExpression(node.original.callee, parameters) - } - - const optionsProperty = transformArgumentToOptionsObject( - path, - secondParameter, - ) - - if (optionsProperty) { - createdObjectExpression.properties.push(optionsProperty) - - return jscodeshift.callExpression(node.original.callee, parameters) - } - - if (utils.isObjectExpression(secondParameter)) { - v5Utils.copyPropertiesFromSource( - secondParameter, - createdObjectExpression, - predicate, - ) - } - - return jscodeshift.callExpression(node.original.callee, parameters) - } - - return jscodeshift.callExpression(node.original.callee, parameters) - } catch (error) { - utils.warn( - error.name === UnknownUsageError.name - ? error.message - : `An unknown error occurred while processing the "${filePath}" file. Please review this file, because the codemod couldn't be applied.`, - ) - - return node - } - } - - createQueryClientTransformer({ jscodeshift, utils, root }).execute( - config.queryClientMethods, - replacer, - ) -} - -module.exports = transformQueryFnAwareUsages diff --git a/node_modules/@tanstack/react-query/build/codemods/src/v5/remove-overloads/utils/index.cjs b/node_modules/@tanstack/react-query/build/codemods/src/v5/remove-overloads/utils/index.cjs deleted file mode 100644 index 5e81bf4..0000000 --- a/node_modules/@tanstack/react-query/build/codemods/src/v5/remove-overloads/utils/index.cjs +++ /dev/null @@ -1,123 +0,0 @@ -const UnknownUsageError = require('./unknown-usage-error.cjs') - -module.exports = ({ jscodeshift, utils }) => { - /** - * - * @param {import('jscodeshift').ObjectExpression} source - * @param {import('jscodeshift').ObjectExpression} target - * @param {(node: import('jscodeshift').Node) => boolean} predicate - */ - const copyPropertiesFromSource = (source, target, predicate) => { - source.properties.forEach((property) => { - if (predicate(property)) { - target.properties.push(property) - } - }) - } - - /** - * @param {import('jscodeshift').NodePath} path - * @param {string} argumentName - * @param {string} filePath - * @returns {*} - */ - const getBindingFromScope = (path, argumentName, filePath) => { - /** - * If the current scope contains the declaration then we can use the actual one else we attempt to find the - * binding from above. - */ - const scope = path.scope.declares(argumentName) - ? path.scope - : path.scope.lookup(argumentName) - - /** - * The declaration couldn't be found for some reason, time to move on. We warn the user it needs to be rewritten - * by themselves. - */ - if (!scope) { - return undefined - } - - const binding = scope.bindings[argumentName] - .filter((item) => utils.isIdentifier(item.value)) - .map((item) => item.parentPath.value) - .at(0) - - if (!binding) { - throw new UnknownUsageError(path.node, filePath) - } - - return binding - } - - /** - * @param {import('jscodeshift').VariableDeclarator} binding - * @returns {import('jscodeshift').Node|undefined} - */ - const getInitializerByDeclarator = (binding) => { - const isVariableDeclaration = jscodeshift.match(binding, { - type: jscodeshift.VariableDeclarator.name, - }) - - if (!isVariableDeclaration) { - return undefined - } - - const isTSAsExpression = jscodeshift.match(binding.init, { - type: jscodeshift.TSAsExpression.name, - }) - - return isTSAsExpression ? binding.init.expression : binding.init - } - - /** - * @param {import('jscodeshift').Node} node - * @returns {boolean} - */ - const isArrayExpressionVariable = (node) => - jscodeshift.match(node, { - type: jscodeshift.VariableDeclarator.name, - init: { - type: jscodeshift.ArrayExpression.name, - }, - }) - - /** - * @param {import('jscodeshift').NodePath} path - * @param {import('jscodeshift').Node} node - * @param {"queryKey"|"mutationKey"} keyName - * @param {string} filePath - * @returns {import('jscodeshift').Property|undefined} - */ - const transformArgumentToKey = (path, node, keyName, filePath) => { - // If the first argument is an identifier we have to infer its type if possible. - if (utils.isIdentifier(node)) { - const binding = getBindingFromScope(path, node.name, filePath) - - if (isArrayExpressionVariable(binding)) { - return jscodeshift.property( - 'init', - jscodeshift.identifier(keyName), - jscodeshift.identifier(binding.id.name), - ) - } - } - - // If the first argument is an array, then it matches the following overload: - // methodName(queryKey?: QueryKey, firstObject?: TFirstObject, secondObject?: TSecondObject) - if (utils.isArrayExpression(node)) { - // Then we create the 'queryKey' property based on it, because it will be passed to the first argument - // that should be an object according to the new signature. - return jscodeshift.property('init', jscodeshift.identifier(keyName), node) - } - - return undefined - } - - return { - copyPropertiesFromSource, - getInitializerByDeclarator, - getBindingFromScope, - transformArgumentToKey, - } -} diff --git a/node_modules/@tanstack/react-query/build/codemods/src/v5/remove-overloads/utils/unknown-usage-error.cjs b/node_modules/@tanstack/react-query/build/codemods/src/v5/remove-overloads/utils/unknown-usage-error.cjs deleted file mode 100644 index ff722ff..0000000 --- a/node_modules/@tanstack/react-query/build/codemods/src/v5/remove-overloads/utils/unknown-usage-error.cjs +++ /dev/null @@ -1,27 +0,0 @@ -class UnknownUsageError extends Error { - /** - * @param {import('jscodeshift').CallExpression} callExpression - * @param {string} filePath - */ - constructor(callExpression, filePath) { - super('') - this.message = this.buildMessage(callExpression, filePath) - this.name = 'UnknownUsageError' - } - - /** - * - * @param {import('jscodeshift').CallExpression} callExpression - * @param {string} filePath - * @returns {string} - */ - buildMessage(callExpression, filePath) { - const location = callExpression.callee.loc - const start = location.start.line - const end = location.end.line - - return `The usage in file "${filePath}" at line ${start}:${end} could not be transformed into the new syntax. Please do this manually.` - } -} - -module.exports = UnknownUsageError diff --git a/node_modules/@tanstack/react-query/build/codemods/src/v5/rename-hydrate/rename-hydrate.cjs b/node_modules/@tanstack/react-query/build/codemods/src/v5/rename-hydrate/rename-hydrate.cjs deleted file mode 100644 index 488040d..0000000 --- a/node_modules/@tanstack/react-query/build/codemods/src/v5/rename-hydrate/rename-hydrate.cjs +++ /dev/null @@ -1,55 +0,0 @@ -module.exports = (file, api) => { - const jscodeshift = api.jscodeshift - const root = jscodeshift(file.source) - - const importSpecifiers = root - .find(jscodeshift.ImportDeclaration, { - source: { - value: '@tanstack/react-query', - }, - }) - .find(jscodeshift.ImportSpecifier, { - imported: { - name: 'Hydrate', - }, - }) - - if (importSpecifiers.length > 0) { - const names = { - searched: 'Hydrate', // By default, we want to replace the `Hydrate` usages. - target: 'HydrationBoundary', // We want to replace them with `HydrationBoundary`. - } - - importSpecifiers.replaceWith(({ node: mutableNode }) => { - /** - * When the local and imported names match which means the code doesn't contain import aliases, we need - * to replace only the import specifier. - * @type {boolean} - */ - const usesDefaultImport = - mutableNode.local.name === mutableNode.imported.name - - if (!usesDefaultImport) { - // If the code uses import aliases, we must re-use the alias. - names.searched = mutableNode.local.name - names.target = mutableNode.local.name - } - - // Override the import specifier. - mutableNode.imported.name = 'HydrationBoundary' - - return mutableNode - }) - - root - .findJSXElements(names.searched) - .replaceWith(({ node: mutableNode }) => { - mutableNode.openingElement.name.name = names.target - mutableNode.closingElement.name.name = names.target - - return mutableNode - }) - } - - return root.toSource({ quote: 'single', lineTerminator: '\n' }) -} diff --git a/node_modules/@tanstack/react-query/build/codemods/src/v5/rename-properties/rename-properties.cjs b/node_modules/@tanstack/react-query/build/codemods/src/v5/rename-properties/rename-properties.cjs deleted file mode 100644 index 3213be7..0000000 --- a/node_modules/@tanstack/react-query/build/codemods/src/v5/rename-properties/rename-properties.cjs +++ /dev/null @@ -1,41 +0,0 @@ -module.exports = (file, api) => { - const jscodeshift = api.jscodeshift - const root = jscodeshift(file.source) - - const baseRenameLogic = (kind, from, to) => { - root - .find(kind, (node) => { - return ( - node.computed === false && - (node.key?.name === from || node.key?.value === from) - ) - }) - .replaceWith(({ node: mutableNode }) => { - if (mutableNode.key.name !== undefined) { - mutableNode.key.name = to - } - - if (mutableNode.key.value !== undefined) { - mutableNode.key.value = to - } - - return mutableNode - }) - } - - const renameObjectProperty = (from, to) => { - baseRenameLogic(jscodeshift.ObjectProperty, from, to) - } - - const renameTypeScriptPropertySignature = (from, to) => { - baseRenameLogic(jscodeshift.TSPropertySignature, from, to) - } - - renameObjectProperty('cacheTime', 'gcTime') - renameObjectProperty('useErrorBoundary', 'throwOnError') - - renameTypeScriptPropertySignature('cacheTime', 'gcTime') - renameTypeScriptPropertySignature('useErrorBoundary', 'throwOnError') - - return root.toSource({ quote: 'single', lineTerminator: '\n' }) -} diff --git a/node_modules/@tanstack/react-query/build/legacy/HydrationBoundary.cjs b/node_modules/@tanstack/react-query/build/legacy/HydrationBoundary.cjs deleted file mode 100644 index ac23049..0000000 --- a/node_modules/@tanstack/react-query/build/legacy/HydrationBoundary.cjs +++ /dev/null @@ -1,91 +0,0 @@ -"use strict"; -"use client"; -var __create = Object.create; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __getProtoOf = Object.getPrototypeOf; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( - // If the importer is in node compatibility mode or this is not an ESM - // file that has been converted to a CommonJS file using a Babel- - // compatible transform (i.e. "__esModule" has not been set), then set - // "default" to the CommonJS "module.exports" for node compatibility. - isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, - mod -)); -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// src/HydrationBoundary.tsx -var HydrationBoundary_exports = {}; -__export(HydrationBoundary_exports, { - HydrationBoundary: () => HydrationBoundary -}); -module.exports = __toCommonJS(HydrationBoundary_exports); -var React = __toESM(require("react"), 1); -var import_query_core = require("@tanstack/query-core"); -var import_QueryClientProvider = require("./QueryClientProvider.cjs"); -var HydrationBoundary = ({ - children, - options = {}, - state, - queryClient -}) => { - const client = (0, import_QueryClientProvider.useQueryClient)(queryClient); - const optionsRef = React.useRef(options); - React.useEffect(() => { - optionsRef.current = options; - }); - const hydrationQueue = React.useMemo(() => { - if (state) { - if (typeof state !== "object") { - return; - } - const queryCache = client.getQueryCache(); - const queries = state.queries || []; - const newQueries = []; - const existingQueries = []; - for (const dehydratedQuery of queries) { - const existingQuery = queryCache.get(dehydratedQuery.queryHash); - if (!existingQuery) { - newQueries.push(dehydratedQuery); - } else { - const hydrationIsNewer = dehydratedQuery.state.dataUpdatedAt > existingQuery.state.dataUpdatedAt || dehydratedQuery.promise && existingQuery.state.status !== "pending" && existingQuery.state.fetchStatus !== "fetching" && dehydratedQuery.dehydratedAt !== void 0 && dehydratedQuery.dehydratedAt > existingQuery.state.dataUpdatedAt; - if (hydrationIsNewer) { - existingQueries.push(dehydratedQuery); - } - } - } - if (newQueries.length > 0) { - (0, import_query_core.hydrate)(client, { queries: newQueries }, optionsRef.current); - } - if (existingQueries.length > 0) { - return existingQueries; - } - } - return void 0; - }, [client, state]); - React.useEffect(() => { - if (hydrationQueue) { - (0, import_query_core.hydrate)(client, { queries: hydrationQueue }, optionsRef.current); - } - }, [client, hydrationQueue]); - return children; -}; -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - HydrationBoundary -}); -//# sourceMappingURL=HydrationBoundary.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/HydrationBoundary.cjs.map b/node_modules/@tanstack/react-query/build/legacy/HydrationBoundary.cjs.map deleted file mode 100644 index 7a8d445..0000000 --- a/node_modules/@tanstack/react-query/build/legacy/HydrationBoundary.cjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/HydrationBoundary.tsx"],"sourcesContent":["'use client'\nimport * as React from 'react'\n\nimport { hydrate } from '@tanstack/query-core'\nimport { useQueryClient } from './QueryClientProvider'\nimport type {\n DehydratedState,\n HydrateOptions,\n OmitKeyof,\n QueryClient,\n} from '@tanstack/query-core'\n\nexport interface HydrationBoundaryProps {\n state: DehydratedState | null | undefined\n options?: OmitKeyof & {\n defaultOptions?: OmitKeyof<\n Exclude,\n 'mutations'\n >\n }\n children?: React.ReactNode\n queryClient?: QueryClient\n}\n\nexport const HydrationBoundary = ({\n children,\n options = {},\n state,\n queryClient,\n}: HydrationBoundaryProps) => {\n const client = useQueryClient(queryClient)\n\n const optionsRef = React.useRef(options)\n React.useEffect(() => {\n optionsRef.current = options\n })\n\n // This useMemo is for performance reasons only, everything inside it must\n // be safe to run in every render and code here should be read as \"in render\".\n //\n // This code needs to happen during the render phase, because after initial\n // SSR, hydration needs to happen _before_ children render. Also, if hydrating\n // during a transition, we want to hydrate as much as is safe in render so\n // we can prerender as much as possible.\n //\n // For any queries that already exist in the cache, we want to hold back on\n // hydrating until _after_ the render phase. The reason for this is that during\n // transitions, we don't want the existing queries and observers to update to\n // the new data on the current page, only _after_ the transition is committed.\n // If the transition is aborted, we will have hydrated any _new_ queries, but\n // we throw away the fresh data for any existing ones to avoid unexpectedly\n // updating the UI.\n const hydrationQueue: DehydratedState['queries'] | undefined =\n React.useMemo(() => {\n if (state) {\n if (typeof state !== 'object') {\n return\n }\n\n const queryCache = client.getQueryCache()\n // State is supplied from the outside and we might as well fail\n // gracefully if it has the wrong shape, so while we type `queries`\n // as required, we still provide a fallback.\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n const queries = state.queries || []\n\n const newQueries: DehydratedState['queries'] = []\n const existingQueries: DehydratedState['queries'] = []\n for (const dehydratedQuery of queries) {\n const existingQuery = queryCache.get(dehydratedQuery.queryHash)\n\n if (!existingQuery) {\n newQueries.push(dehydratedQuery)\n } else {\n const hydrationIsNewer =\n dehydratedQuery.state.dataUpdatedAt >\n existingQuery.state.dataUpdatedAt ||\n (dehydratedQuery.promise &&\n existingQuery.state.status !== 'pending' &&\n existingQuery.state.fetchStatus !== 'fetching' &&\n dehydratedQuery.dehydratedAt !== undefined &&\n dehydratedQuery.dehydratedAt >\n existingQuery.state.dataUpdatedAt)\n\n if (hydrationIsNewer) {\n existingQueries.push(dehydratedQuery)\n }\n }\n }\n\n if (newQueries.length > 0) {\n // It's actually fine to call this with queries/state that already exists\n // in the cache, or is older. hydrate() is idempotent for queries.\n // eslint-disable-next-line react-hooks/refs\n hydrate(client, { queries: newQueries }, optionsRef.current)\n }\n if (existingQueries.length > 0) {\n return existingQueries\n }\n }\n return undefined\n }, [client, state])\n\n React.useEffect(() => {\n if (hydrationQueue) {\n hydrate(client, { queries: hydrationQueue }, optionsRef.current)\n }\n }, [client, hydrationQueue])\n\n return children as React.ReactElement\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,YAAuB;AAEvB,wBAAwB;AACxB,iCAA+B;AAoBxB,IAAM,oBAAoB,CAAC;AAAA,EAChC;AAAA,EACA,UAAU,CAAC;AAAA,EACX;AAAA,EACA;AACF,MAA8B;AAC5B,QAAM,aAAS,2CAAe,WAAW;AAEzC,QAAM,aAAmB,aAAO,OAAO;AACvC,EAAM,gBAAU,MAAM;AACpB,eAAW,UAAU;AAAA,EACvB,CAAC;AAiBD,QAAM,iBACE,cAAQ,MAAM;AAClB,QAAI,OAAO;AACT,UAAI,OAAO,UAAU,UAAU;AAC7B;AAAA,MACF;AAEA,YAAM,aAAa,OAAO,cAAc;AAKxC,YAAM,UAAU,MAAM,WAAW,CAAC;AAElC,YAAM,aAAyC,CAAC;AAChD,YAAM,kBAA8C,CAAC;AACrD,iBAAW,mBAAmB,SAAS;AACrC,cAAM,gBAAgB,WAAW,IAAI,gBAAgB,SAAS;AAE9D,YAAI,CAAC,eAAe;AAClB,qBAAW,KAAK,eAAe;AAAA,QACjC,OAAO;AACL,gBAAM,mBACJ,gBAAgB,MAAM,gBACpB,cAAc,MAAM,iBACrB,gBAAgB,WACf,cAAc,MAAM,WAAW,aAC/B,cAAc,MAAM,gBAAgB,cACpC,gBAAgB,iBAAiB,UACjC,gBAAgB,eACd,cAAc,MAAM;AAE1B,cAAI,kBAAkB;AACpB,4BAAgB,KAAK,eAAe;AAAA,UACtC;AAAA,QACF;AAAA,MACF;AAEA,UAAI,WAAW,SAAS,GAAG;AAIzB,uCAAQ,QAAQ,EAAE,SAAS,WAAW,GAAG,WAAW,OAAO;AAAA,MAC7D;AACA,UAAI,gBAAgB,SAAS,GAAG;AAC9B,eAAO;AAAA,MACT;AAAA,IACF;AACA,WAAO;AAAA,EACT,GAAG,CAAC,QAAQ,KAAK,CAAC;AAEpB,EAAM,gBAAU,MAAM;AACpB,QAAI,gBAAgB;AAClB,qCAAQ,QAAQ,EAAE,SAAS,eAAe,GAAG,WAAW,OAAO;AAAA,IACjE;AAAA,EACF,GAAG,CAAC,QAAQ,cAAc,CAAC;AAE3B,SAAO;AACT;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/HydrationBoundary.d.cts b/node_modules/@tanstack/react-query/build/legacy/HydrationBoundary.d.cts deleted file mode 100644 index 39d63fa..0000000 --- a/node_modules/@tanstack/react-query/build/legacy/HydrationBoundary.d.cts +++ /dev/null @@ -1,14 +0,0 @@ -import * as React from 'react'; -import { DehydratedState, OmitKeyof, HydrateOptions, QueryClient } from '@tanstack/query-core'; - -interface HydrationBoundaryProps { - state: DehydratedState | null | undefined; - options?: OmitKeyof & { - defaultOptions?: OmitKeyof, 'mutations'>; - }; - children?: React.ReactNode; - queryClient?: QueryClient; -} -declare const HydrationBoundary: ({ children, options, state, queryClient, }: HydrationBoundaryProps) => React.ReactElement; - -export { HydrationBoundary, type HydrationBoundaryProps }; diff --git a/node_modules/@tanstack/react-query/build/legacy/HydrationBoundary.d.ts b/node_modules/@tanstack/react-query/build/legacy/HydrationBoundary.d.ts deleted file mode 100644 index 39d63fa..0000000 --- a/node_modules/@tanstack/react-query/build/legacy/HydrationBoundary.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -import * as React from 'react'; -import { DehydratedState, OmitKeyof, HydrateOptions, QueryClient } from '@tanstack/query-core'; - -interface HydrationBoundaryProps { - state: DehydratedState | null | undefined; - options?: OmitKeyof & { - defaultOptions?: OmitKeyof, 'mutations'>; - }; - children?: React.ReactNode; - queryClient?: QueryClient; -} -declare const HydrationBoundary: ({ children, options, state, queryClient, }: HydrationBoundaryProps) => React.ReactElement; - -export { HydrationBoundary, type HydrationBoundaryProps }; diff --git a/node_modules/@tanstack/react-query/build/legacy/HydrationBoundary.js b/node_modules/@tanstack/react-query/build/legacy/HydrationBoundary.js deleted file mode 100644 index 4acd78b..0000000 --- a/node_modules/@tanstack/react-query/build/legacy/HydrationBoundary.js +++ /dev/null @@ -1,57 +0,0 @@ -"use client"; - -// src/HydrationBoundary.tsx -import * as React from "react"; -import { hydrate } from "@tanstack/query-core"; -import { useQueryClient } from "./QueryClientProvider.js"; -var HydrationBoundary = ({ - children, - options = {}, - state, - queryClient -}) => { - const client = useQueryClient(queryClient); - const optionsRef = React.useRef(options); - React.useEffect(() => { - optionsRef.current = options; - }); - const hydrationQueue = React.useMemo(() => { - if (state) { - if (typeof state !== "object") { - return; - } - const queryCache = client.getQueryCache(); - const queries = state.queries || []; - const newQueries = []; - const existingQueries = []; - for (const dehydratedQuery of queries) { - const existingQuery = queryCache.get(dehydratedQuery.queryHash); - if (!existingQuery) { - newQueries.push(dehydratedQuery); - } else { - const hydrationIsNewer = dehydratedQuery.state.dataUpdatedAt > existingQuery.state.dataUpdatedAt || dehydratedQuery.promise && existingQuery.state.status !== "pending" && existingQuery.state.fetchStatus !== "fetching" && dehydratedQuery.dehydratedAt !== void 0 && dehydratedQuery.dehydratedAt > existingQuery.state.dataUpdatedAt; - if (hydrationIsNewer) { - existingQueries.push(dehydratedQuery); - } - } - } - if (newQueries.length > 0) { - hydrate(client, { queries: newQueries }, optionsRef.current); - } - if (existingQueries.length > 0) { - return existingQueries; - } - } - return void 0; - }, [client, state]); - React.useEffect(() => { - if (hydrationQueue) { - hydrate(client, { queries: hydrationQueue }, optionsRef.current); - } - }, [client, hydrationQueue]); - return children; -}; -export { - HydrationBoundary -}; -//# sourceMappingURL=HydrationBoundary.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/HydrationBoundary.js.map b/node_modules/@tanstack/react-query/build/legacy/HydrationBoundary.js.map deleted file mode 100644 index 63d8469..0000000 --- a/node_modules/@tanstack/react-query/build/legacy/HydrationBoundary.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/HydrationBoundary.tsx"],"sourcesContent":["'use client'\nimport * as React from 'react'\n\nimport { hydrate } from '@tanstack/query-core'\nimport { useQueryClient } from './QueryClientProvider'\nimport type {\n DehydratedState,\n HydrateOptions,\n OmitKeyof,\n QueryClient,\n} from '@tanstack/query-core'\n\nexport interface HydrationBoundaryProps {\n state: DehydratedState | null | undefined\n options?: OmitKeyof & {\n defaultOptions?: OmitKeyof<\n Exclude,\n 'mutations'\n >\n }\n children?: React.ReactNode\n queryClient?: QueryClient\n}\n\nexport const HydrationBoundary = ({\n children,\n options = {},\n state,\n queryClient,\n}: HydrationBoundaryProps) => {\n const client = useQueryClient(queryClient)\n\n const optionsRef = React.useRef(options)\n React.useEffect(() => {\n optionsRef.current = options\n })\n\n // This useMemo is for performance reasons only, everything inside it must\n // be safe to run in every render and code here should be read as \"in render\".\n //\n // This code needs to happen during the render phase, because after initial\n // SSR, hydration needs to happen _before_ children render. Also, if hydrating\n // during a transition, we want to hydrate as much as is safe in render so\n // we can prerender as much as possible.\n //\n // For any queries that already exist in the cache, we want to hold back on\n // hydrating until _after_ the render phase. The reason for this is that during\n // transitions, we don't want the existing queries and observers to update to\n // the new data on the current page, only _after_ the transition is committed.\n // If the transition is aborted, we will have hydrated any _new_ queries, but\n // we throw away the fresh data for any existing ones to avoid unexpectedly\n // updating the UI.\n const hydrationQueue: DehydratedState['queries'] | undefined =\n React.useMemo(() => {\n if (state) {\n if (typeof state !== 'object') {\n return\n }\n\n const queryCache = client.getQueryCache()\n // State is supplied from the outside and we might as well fail\n // gracefully if it has the wrong shape, so while we type `queries`\n // as required, we still provide a fallback.\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n const queries = state.queries || []\n\n const newQueries: DehydratedState['queries'] = []\n const existingQueries: DehydratedState['queries'] = []\n for (const dehydratedQuery of queries) {\n const existingQuery = queryCache.get(dehydratedQuery.queryHash)\n\n if (!existingQuery) {\n newQueries.push(dehydratedQuery)\n } else {\n const hydrationIsNewer =\n dehydratedQuery.state.dataUpdatedAt >\n existingQuery.state.dataUpdatedAt ||\n (dehydratedQuery.promise &&\n existingQuery.state.status !== 'pending' &&\n existingQuery.state.fetchStatus !== 'fetching' &&\n dehydratedQuery.dehydratedAt !== undefined &&\n dehydratedQuery.dehydratedAt >\n existingQuery.state.dataUpdatedAt)\n\n if (hydrationIsNewer) {\n existingQueries.push(dehydratedQuery)\n }\n }\n }\n\n if (newQueries.length > 0) {\n // It's actually fine to call this with queries/state that already exists\n // in the cache, or is older. hydrate() is idempotent for queries.\n // eslint-disable-next-line react-hooks/refs\n hydrate(client, { queries: newQueries }, optionsRef.current)\n }\n if (existingQueries.length > 0) {\n return existingQueries\n }\n }\n return undefined\n }, [client, state])\n\n React.useEffect(() => {\n if (hydrationQueue) {\n hydrate(client, { queries: hydrationQueue }, optionsRef.current)\n }\n }, [client, hydrationQueue])\n\n return children as React.ReactElement\n}\n"],"mappings":";;;AACA,YAAY,WAAW;AAEvB,SAAS,eAAe;AACxB,SAAS,sBAAsB;AAoBxB,IAAM,oBAAoB,CAAC;AAAA,EAChC;AAAA,EACA,UAAU,CAAC;AAAA,EACX;AAAA,EACA;AACF,MAA8B;AAC5B,QAAM,SAAS,eAAe,WAAW;AAEzC,QAAM,aAAmB,aAAO,OAAO;AACvC,EAAM,gBAAU,MAAM;AACpB,eAAW,UAAU;AAAA,EACvB,CAAC;AAiBD,QAAM,iBACE,cAAQ,MAAM;AAClB,QAAI,OAAO;AACT,UAAI,OAAO,UAAU,UAAU;AAC7B;AAAA,MACF;AAEA,YAAM,aAAa,OAAO,cAAc;AAKxC,YAAM,UAAU,MAAM,WAAW,CAAC;AAElC,YAAM,aAAyC,CAAC;AAChD,YAAM,kBAA8C,CAAC;AACrD,iBAAW,mBAAmB,SAAS;AACrC,cAAM,gBAAgB,WAAW,IAAI,gBAAgB,SAAS;AAE9D,YAAI,CAAC,eAAe;AAClB,qBAAW,KAAK,eAAe;AAAA,QACjC,OAAO;AACL,gBAAM,mBACJ,gBAAgB,MAAM,gBACpB,cAAc,MAAM,iBACrB,gBAAgB,WACf,cAAc,MAAM,WAAW,aAC/B,cAAc,MAAM,gBAAgB,cACpC,gBAAgB,iBAAiB,UACjC,gBAAgB,eACd,cAAc,MAAM;AAE1B,cAAI,kBAAkB;AACpB,4BAAgB,KAAK,eAAe;AAAA,UACtC;AAAA,QACF;AAAA,MACF;AAEA,UAAI,WAAW,SAAS,GAAG;AAIzB,gBAAQ,QAAQ,EAAE,SAAS,WAAW,GAAG,WAAW,OAAO;AAAA,MAC7D;AACA,UAAI,gBAAgB,SAAS,GAAG;AAC9B,eAAO;AAAA,MACT;AAAA,IACF;AACA,WAAO;AAAA,EACT,GAAG,CAAC,QAAQ,KAAK,CAAC;AAEpB,EAAM,gBAAU,MAAM;AACpB,QAAI,gBAAgB;AAClB,cAAQ,QAAQ,EAAE,SAAS,eAAe,GAAG,WAAW,OAAO;AAAA,IACjE;AAAA,EACF,GAAG,CAAC,QAAQ,cAAc,CAAC;AAE3B,SAAO;AACT;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/IsRestoringProvider.cjs b/node_modules/@tanstack/react-query/build/legacy/IsRestoringProvider.cjs deleted file mode 100644 index f607420..0000000 --- a/node_modules/@tanstack/react-query/build/legacy/IsRestoringProvider.cjs +++ /dev/null @@ -1,47 +0,0 @@ -"use strict"; -"use client"; -var __create = Object.create; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __getProtoOf = Object.getPrototypeOf; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( - // If the importer is in node compatibility mode or this is not an ESM - // file that has been converted to a CommonJS file using a Babel- - // compatible transform (i.e. "__esModule" has not been set), then set - // "default" to the CommonJS "module.exports" for node compatibility. - isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, - mod -)); -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// src/IsRestoringProvider.ts -var IsRestoringProvider_exports = {}; -__export(IsRestoringProvider_exports, { - IsRestoringProvider: () => IsRestoringProvider, - useIsRestoring: () => useIsRestoring -}); -module.exports = __toCommonJS(IsRestoringProvider_exports); -var React = __toESM(require("react"), 1); -var IsRestoringContext = React.createContext(false); -var useIsRestoring = () => React.useContext(IsRestoringContext); -var IsRestoringProvider = IsRestoringContext.Provider; -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - IsRestoringProvider, - useIsRestoring -}); -//# sourceMappingURL=IsRestoringProvider.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/IsRestoringProvider.cjs.map b/node_modules/@tanstack/react-query/build/legacy/IsRestoringProvider.cjs.map deleted file mode 100644 index 2c98a9d..0000000 --- a/node_modules/@tanstack/react-query/build/legacy/IsRestoringProvider.cjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/IsRestoringProvider.ts"],"sourcesContent":["'use client'\nimport * as React from 'react'\n\nconst IsRestoringContext = React.createContext(false)\n\nexport const useIsRestoring = () => React.useContext(IsRestoringContext)\nexport const IsRestoringProvider = IsRestoringContext.Provider\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,YAAuB;AAEvB,IAAM,qBAA2B,oBAAc,KAAK;AAE7C,IAAM,iBAAiB,MAAY,iBAAW,kBAAkB;AAChE,IAAM,sBAAsB,mBAAmB;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/IsRestoringProvider.d.cts b/node_modules/@tanstack/react-query/build/legacy/IsRestoringProvider.d.cts deleted file mode 100644 index 08b14ff..0000000 --- a/node_modules/@tanstack/react-query/build/legacy/IsRestoringProvider.d.cts +++ /dev/null @@ -1,6 +0,0 @@ -import * as React from 'react'; - -declare const useIsRestoring: () => boolean; -declare const IsRestoringProvider: React.Provider; - -export { IsRestoringProvider, useIsRestoring }; diff --git a/node_modules/@tanstack/react-query/build/legacy/IsRestoringProvider.d.ts b/node_modules/@tanstack/react-query/build/legacy/IsRestoringProvider.d.ts deleted file mode 100644 index 08b14ff..0000000 --- a/node_modules/@tanstack/react-query/build/legacy/IsRestoringProvider.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import * as React from 'react'; - -declare const useIsRestoring: () => boolean; -declare const IsRestoringProvider: React.Provider; - -export { IsRestoringProvider, useIsRestoring }; diff --git a/node_modules/@tanstack/react-query/build/legacy/IsRestoringProvider.js b/node_modules/@tanstack/react-query/build/legacy/IsRestoringProvider.js deleted file mode 100644 index 374f82e..0000000 --- a/node_modules/@tanstack/react-query/build/legacy/IsRestoringProvider.js +++ /dev/null @@ -1,12 +0,0 @@ -"use client"; - -// src/IsRestoringProvider.ts -import * as React from "react"; -var IsRestoringContext = React.createContext(false); -var useIsRestoring = () => React.useContext(IsRestoringContext); -var IsRestoringProvider = IsRestoringContext.Provider; -export { - IsRestoringProvider, - useIsRestoring -}; -//# sourceMappingURL=IsRestoringProvider.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/IsRestoringProvider.js.map b/node_modules/@tanstack/react-query/build/legacy/IsRestoringProvider.js.map deleted file mode 100644 index a31bfa3..0000000 --- a/node_modules/@tanstack/react-query/build/legacy/IsRestoringProvider.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/IsRestoringProvider.ts"],"sourcesContent":["'use client'\nimport * as React from 'react'\n\nconst IsRestoringContext = React.createContext(false)\n\nexport const useIsRestoring = () => React.useContext(IsRestoringContext)\nexport const IsRestoringProvider = IsRestoringContext.Provider\n"],"mappings":";;;AACA,YAAY,WAAW;AAEvB,IAAM,qBAA2B,oBAAc,KAAK;AAE7C,IAAM,iBAAiB,MAAY,iBAAW,kBAAkB;AAChE,IAAM,sBAAsB,mBAAmB;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/QueryClientProvider.cjs b/node_modules/@tanstack/react-query/build/legacy/QueryClientProvider.cjs deleted file mode 100644 index d91255c..0000000 --- a/node_modules/@tanstack/react-query/build/legacy/QueryClientProvider.cjs +++ /dev/null @@ -1,72 +0,0 @@ -"use strict"; -"use client"; -var __create = Object.create; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __getProtoOf = Object.getPrototypeOf; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( - // If the importer is in node compatibility mode or this is not an ESM - // file that has been converted to a CommonJS file using a Babel- - // compatible transform (i.e. "__esModule" has not been set), then set - // "default" to the CommonJS "module.exports" for node compatibility. - isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, - mod -)); -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// src/QueryClientProvider.tsx -var QueryClientProvider_exports = {}; -__export(QueryClientProvider_exports, { - QueryClientContext: () => QueryClientContext, - QueryClientProvider: () => QueryClientProvider, - useQueryClient: () => useQueryClient -}); -module.exports = __toCommonJS(QueryClientProvider_exports); -var React = __toESM(require("react"), 1); -var import_jsx_runtime = require("react/jsx-runtime"); -var QueryClientContext = React.createContext( - void 0 -); -var useQueryClient = (queryClient) => { - const client = React.useContext(QueryClientContext); - if (queryClient) { - return queryClient; - } - if (!client) { - throw new Error("No QueryClient set, use QueryClientProvider to set one"); - } - return client; -}; -var QueryClientProvider = ({ - client, - children -}) => { - React.useEffect(() => { - client.mount(); - return () => { - client.unmount(); - }; - }, [client]); - return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(QueryClientContext.Provider, { value: client, children }); -}; -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - QueryClientContext, - QueryClientProvider, - useQueryClient -}); -//# sourceMappingURL=QueryClientProvider.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/QueryClientProvider.cjs.map b/node_modules/@tanstack/react-query/build/legacy/QueryClientProvider.cjs.map deleted file mode 100644 index d97eb88..0000000 --- a/node_modules/@tanstack/react-query/build/legacy/QueryClientProvider.cjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/QueryClientProvider.tsx"],"sourcesContent":["'use client'\nimport * as React from 'react'\n\nimport type { QueryClient } from '@tanstack/query-core'\n\nexport const QueryClientContext = React.createContext(\n undefined,\n)\n\nexport const useQueryClient = (queryClient?: QueryClient) => {\n const client = React.useContext(QueryClientContext)\n\n if (queryClient) {\n return queryClient\n }\n\n if (!client) {\n throw new Error('No QueryClient set, use QueryClientProvider to set one')\n }\n\n return client\n}\n\nexport type QueryClientProviderProps = {\n client: QueryClient\n children?: React.ReactNode\n}\n\nexport const QueryClientProvider = ({\n client,\n children,\n}: QueryClientProviderProps): React.JSX.Element => {\n React.useEffect(() => {\n client.mount()\n return () => {\n client.unmount()\n }\n }, [client])\n\n return (\n \n {children}\n \n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,YAAuB;AAuCnB;AAnCG,IAAM,qBAA2B;AAAA,EACtC;AACF;AAEO,IAAM,iBAAiB,CAAC,gBAA8B;AAC3D,QAAM,SAAe,iBAAW,kBAAkB;AAElD,MAAI,aAAa;AACf,WAAO;AAAA,EACT;AAEA,MAAI,CAAC,QAAQ;AACX,UAAM,IAAI,MAAM,wDAAwD;AAAA,EAC1E;AAEA,SAAO;AACT;AAOO,IAAM,sBAAsB,CAAC;AAAA,EAClC;AAAA,EACA;AACF,MAAmD;AACjD,EAAM,gBAAU,MAAM;AACpB,WAAO,MAAM;AACb,WAAO,MAAM;AACX,aAAO,QAAQ;AAAA,IACjB;AAAA,EACF,GAAG,CAAC,MAAM,CAAC;AAEX,SACE,4CAAC,mBAAmB,UAAnB,EAA4B,OAAO,QACjC,UACH;AAEJ;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/QueryClientProvider.d.cts b/node_modules/@tanstack/react-query/build/legacy/QueryClientProvider.d.cts deleted file mode 100644 index 1b1fd69..0000000 --- a/node_modules/@tanstack/react-query/build/legacy/QueryClientProvider.d.cts +++ /dev/null @@ -1,12 +0,0 @@ -import * as React from 'react'; -import { QueryClient } from '@tanstack/query-core'; - -declare const QueryClientContext: React.Context; -declare const useQueryClient: (queryClient?: QueryClient) => QueryClient; -type QueryClientProviderProps = { - client: QueryClient; - children?: React.ReactNode; -}; -declare const QueryClientProvider: ({ client, children, }: QueryClientProviderProps) => React.JSX.Element; - -export { QueryClientContext, QueryClientProvider, type QueryClientProviderProps, useQueryClient }; diff --git a/node_modules/@tanstack/react-query/build/legacy/QueryClientProvider.d.ts b/node_modules/@tanstack/react-query/build/legacy/QueryClientProvider.d.ts deleted file mode 100644 index 1b1fd69..0000000 --- a/node_modules/@tanstack/react-query/build/legacy/QueryClientProvider.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -import * as React from 'react'; -import { QueryClient } from '@tanstack/query-core'; - -declare const QueryClientContext: React.Context; -declare const useQueryClient: (queryClient?: QueryClient) => QueryClient; -type QueryClientProviderProps = { - client: QueryClient; - children?: React.ReactNode; -}; -declare const QueryClientProvider: ({ client, children, }: QueryClientProviderProps) => React.JSX.Element; - -export { QueryClientContext, QueryClientProvider, type QueryClientProviderProps, useQueryClient }; diff --git a/node_modules/@tanstack/react-query/build/legacy/QueryClientProvider.js b/node_modules/@tanstack/react-query/build/legacy/QueryClientProvider.js deleted file mode 100644 index fc4d5f2..0000000 --- a/node_modules/@tanstack/react-query/build/legacy/QueryClientProvider.js +++ /dev/null @@ -1,36 +0,0 @@ -"use client"; - -// src/QueryClientProvider.tsx -import * as React from "react"; -import { jsx } from "react/jsx-runtime"; -var QueryClientContext = React.createContext( - void 0 -); -var useQueryClient = (queryClient) => { - const client = React.useContext(QueryClientContext); - if (queryClient) { - return queryClient; - } - if (!client) { - throw new Error("No QueryClient set, use QueryClientProvider to set one"); - } - return client; -}; -var QueryClientProvider = ({ - client, - children -}) => { - React.useEffect(() => { - client.mount(); - return () => { - client.unmount(); - }; - }, [client]); - return /* @__PURE__ */ jsx(QueryClientContext.Provider, { value: client, children }); -}; -export { - QueryClientContext, - QueryClientProvider, - useQueryClient -}; -//# sourceMappingURL=QueryClientProvider.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/QueryClientProvider.js.map b/node_modules/@tanstack/react-query/build/legacy/QueryClientProvider.js.map deleted file mode 100644 index 44bad03..0000000 --- a/node_modules/@tanstack/react-query/build/legacy/QueryClientProvider.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/QueryClientProvider.tsx"],"sourcesContent":["'use client'\nimport * as React from 'react'\n\nimport type { QueryClient } from '@tanstack/query-core'\n\nexport const QueryClientContext = React.createContext(\n undefined,\n)\n\nexport const useQueryClient = (queryClient?: QueryClient) => {\n const client = React.useContext(QueryClientContext)\n\n if (queryClient) {\n return queryClient\n }\n\n if (!client) {\n throw new Error('No QueryClient set, use QueryClientProvider to set one')\n }\n\n return client\n}\n\nexport type QueryClientProviderProps = {\n client: QueryClient\n children?: React.ReactNode\n}\n\nexport const QueryClientProvider = ({\n client,\n children,\n}: QueryClientProviderProps): React.JSX.Element => {\n React.useEffect(() => {\n client.mount()\n return () => {\n client.unmount()\n }\n }, [client])\n\n return (\n \n {children}\n \n )\n}\n"],"mappings":";;;AACA,YAAY,WAAW;AAuCnB;AAnCG,IAAM,qBAA2B;AAAA,EACtC;AACF;AAEO,IAAM,iBAAiB,CAAC,gBAA8B;AAC3D,QAAM,SAAe,iBAAW,kBAAkB;AAElD,MAAI,aAAa;AACf,WAAO;AAAA,EACT;AAEA,MAAI,CAAC,QAAQ;AACX,UAAM,IAAI,MAAM,wDAAwD;AAAA,EAC1E;AAEA,SAAO;AACT;AAOO,IAAM,sBAAsB,CAAC;AAAA,EAClC;AAAA,EACA;AACF,MAAmD;AACjD,EAAM,gBAAU,MAAM;AACpB,WAAO,MAAM;AACb,WAAO,MAAM;AACX,aAAO,QAAQ;AAAA,IACjB;AAAA,EACF,GAAG,CAAC,MAAM,CAAC;AAEX,SACE,oBAAC,mBAAmB,UAAnB,EAA4B,OAAO,QACjC,UACH;AAEJ;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/QueryErrorResetBoundary.cjs b/node_modules/@tanstack/react-query/build/legacy/QueryErrorResetBoundary.cjs deleted file mode 100644 index 7c86436..0000000 --- a/node_modules/@tanstack/react-query/build/legacy/QueryErrorResetBoundary.cjs +++ /dev/null @@ -1,67 +0,0 @@ -"use strict"; -"use client"; -var __create = Object.create; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __getProtoOf = Object.getPrototypeOf; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( - // If the importer is in node compatibility mode or this is not an ESM - // file that has been converted to a CommonJS file using a Babel- - // compatible transform (i.e. "__esModule" has not been set), then set - // "default" to the CommonJS "module.exports" for node compatibility. - isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, - mod -)); -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// src/QueryErrorResetBoundary.tsx -var QueryErrorResetBoundary_exports = {}; -__export(QueryErrorResetBoundary_exports, { - QueryErrorResetBoundary: () => QueryErrorResetBoundary, - useQueryErrorResetBoundary: () => useQueryErrorResetBoundary -}); -module.exports = __toCommonJS(QueryErrorResetBoundary_exports); -var React = __toESM(require("react"), 1); -var import_jsx_runtime = require("react/jsx-runtime"); -function createValue() { - let isReset = false; - return { - clearReset: () => { - isReset = false; - }, - reset: () => { - isReset = true; - }, - isReset: () => { - return isReset; - } - }; -} -var QueryErrorResetBoundaryContext = React.createContext(createValue()); -var useQueryErrorResetBoundary = () => React.useContext(QueryErrorResetBoundaryContext); -var QueryErrorResetBoundary = ({ - children -}) => { - const [value] = React.useState(() => createValue()); - return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(QueryErrorResetBoundaryContext.Provider, { value, children: typeof children === "function" ? children(value) : children }); -}; -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - QueryErrorResetBoundary, - useQueryErrorResetBoundary -}); -//# sourceMappingURL=QueryErrorResetBoundary.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/QueryErrorResetBoundary.cjs.map b/node_modules/@tanstack/react-query/build/legacy/QueryErrorResetBoundary.cjs.map deleted file mode 100644 index 29c7b08..0000000 --- a/node_modules/@tanstack/react-query/build/legacy/QueryErrorResetBoundary.cjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/QueryErrorResetBoundary.tsx"],"sourcesContent":["'use client'\nimport * as React from 'react'\n\n// CONTEXT\nexport type QueryErrorResetFunction = () => void\nexport type QueryErrorIsResetFunction = () => boolean\nexport type QueryErrorClearResetFunction = () => void\n\nexport interface QueryErrorResetBoundaryValue {\n clearReset: QueryErrorClearResetFunction\n isReset: QueryErrorIsResetFunction\n reset: QueryErrorResetFunction\n}\n\nfunction createValue(): QueryErrorResetBoundaryValue {\n let isReset = false\n return {\n clearReset: () => {\n isReset = false\n },\n reset: () => {\n isReset = true\n },\n isReset: () => {\n return isReset\n },\n }\n}\n\nconst QueryErrorResetBoundaryContext = React.createContext(createValue())\n\n// HOOK\n\nexport const useQueryErrorResetBoundary = () =>\n React.useContext(QueryErrorResetBoundaryContext)\n\n// COMPONENT\n\nexport type QueryErrorResetBoundaryFunction = (\n value: QueryErrorResetBoundaryValue,\n) => React.ReactNode\n\nexport interface QueryErrorResetBoundaryProps {\n children: QueryErrorResetBoundaryFunction | React.ReactNode\n}\n\nexport const QueryErrorResetBoundary = ({\n children,\n}: QueryErrorResetBoundaryProps) => {\n const [value] = React.useState(() => createValue())\n return (\n \n {typeof children === 'function' ? children(value) : children}\n \n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,YAAuB;AAkDnB;AArCJ,SAAS,cAA4C;AACnD,MAAI,UAAU;AACd,SAAO;AAAA,IACL,YAAY,MAAM;AAChB,gBAAU;AAAA,IACZ;AAAA,IACA,OAAO,MAAM;AACX,gBAAU;AAAA,IACZ;AAAA,IACA,SAAS,MAAM;AACb,aAAO;AAAA,IACT;AAAA,EACF;AACF;AAEA,IAAM,iCAAuC,oBAAc,YAAY,CAAC;AAIjE,IAAM,6BAA6B,MAClC,iBAAW,8BAA8B;AAY1C,IAAM,0BAA0B,CAAC;AAAA,EACtC;AACF,MAAoC;AAClC,QAAM,CAAC,KAAK,IAAU,eAAS,MAAM,YAAY,CAAC;AAClD,SACE,4CAAC,+BAA+B,UAA/B,EAAwC,OACtC,iBAAO,aAAa,aAAa,SAAS,KAAK,IAAI,UACtD;AAEJ;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/QueryErrorResetBoundary.d.cts b/node_modules/@tanstack/react-query/build/legacy/QueryErrorResetBoundary.d.cts deleted file mode 100644 index bfb5745..0000000 --- a/node_modules/@tanstack/react-query/build/legacy/QueryErrorResetBoundary.d.cts +++ /dev/null @@ -1,19 +0,0 @@ -import * as react_jsx_runtime from 'react/jsx-runtime'; -import * as React from 'react'; - -type QueryErrorResetFunction = () => void; -type QueryErrorIsResetFunction = () => boolean; -type QueryErrorClearResetFunction = () => void; -interface QueryErrorResetBoundaryValue { - clearReset: QueryErrorClearResetFunction; - isReset: QueryErrorIsResetFunction; - reset: QueryErrorResetFunction; -} -declare const useQueryErrorResetBoundary: () => QueryErrorResetBoundaryValue; -type QueryErrorResetBoundaryFunction = (value: QueryErrorResetBoundaryValue) => React.ReactNode; -interface QueryErrorResetBoundaryProps { - children: QueryErrorResetBoundaryFunction | React.ReactNode; -} -declare const QueryErrorResetBoundary: ({ children, }: QueryErrorResetBoundaryProps) => react_jsx_runtime.JSX.Element; - -export { type QueryErrorClearResetFunction, type QueryErrorIsResetFunction, QueryErrorResetBoundary, type QueryErrorResetBoundaryFunction, type QueryErrorResetBoundaryProps, type QueryErrorResetBoundaryValue, type QueryErrorResetFunction, useQueryErrorResetBoundary }; diff --git a/node_modules/@tanstack/react-query/build/legacy/QueryErrorResetBoundary.d.ts b/node_modules/@tanstack/react-query/build/legacy/QueryErrorResetBoundary.d.ts deleted file mode 100644 index bfb5745..0000000 --- a/node_modules/@tanstack/react-query/build/legacy/QueryErrorResetBoundary.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -import * as react_jsx_runtime from 'react/jsx-runtime'; -import * as React from 'react'; - -type QueryErrorResetFunction = () => void; -type QueryErrorIsResetFunction = () => boolean; -type QueryErrorClearResetFunction = () => void; -interface QueryErrorResetBoundaryValue { - clearReset: QueryErrorClearResetFunction; - isReset: QueryErrorIsResetFunction; - reset: QueryErrorResetFunction; -} -declare const useQueryErrorResetBoundary: () => QueryErrorResetBoundaryValue; -type QueryErrorResetBoundaryFunction = (value: QueryErrorResetBoundaryValue) => React.ReactNode; -interface QueryErrorResetBoundaryProps { - children: QueryErrorResetBoundaryFunction | React.ReactNode; -} -declare const QueryErrorResetBoundary: ({ children, }: QueryErrorResetBoundaryProps) => react_jsx_runtime.JSX.Element; - -export { type QueryErrorClearResetFunction, type QueryErrorIsResetFunction, QueryErrorResetBoundary, type QueryErrorResetBoundaryFunction, type QueryErrorResetBoundaryProps, type QueryErrorResetBoundaryValue, type QueryErrorResetFunction, useQueryErrorResetBoundary }; diff --git a/node_modules/@tanstack/react-query/build/legacy/QueryErrorResetBoundary.js b/node_modules/@tanstack/react-query/build/legacy/QueryErrorResetBoundary.js deleted file mode 100644 index ae56edc..0000000 --- a/node_modules/@tanstack/react-query/build/legacy/QueryErrorResetBoundary.js +++ /dev/null @@ -1,32 +0,0 @@ -"use client"; - -// src/QueryErrorResetBoundary.tsx -import * as React from "react"; -import { jsx } from "react/jsx-runtime"; -function createValue() { - let isReset = false; - return { - clearReset: () => { - isReset = false; - }, - reset: () => { - isReset = true; - }, - isReset: () => { - return isReset; - } - }; -} -var QueryErrorResetBoundaryContext = React.createContext(createValue()); -var useQueryErrorResetBoundary = () => React.useContext(QueryErrorResetBoundaryContext); -var QueryErrorResetBoundary = ({ - children -}) => { - const [value] = React.useState(() => createValue()); - return /* @__PURE__ */ jsx(QueryErrorResetBoundaryContext.Provider, { value, children: typeof children === "function" ? children(value) : children }); -}; -export { - QueryErrorResetBoundary, - useQueryErrorResetBoundary -}; -//# sourceMappingURL=QueryErrorResetBoundary.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/QueryErrorResetBoundary.js.map b/node_modules/@tanstack/react-query/build/legacy/QueryErrorResetBoundary.js.map deleted file mode 100644 index c8b04a7..0000000 --- a/node_modules/@tanstack/react-query/build/legacy/QueryErrorResetBoundary.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/QueryErrorResetBoundary.tsx"],"sourcesContent":["'use client'\nimport * as React from 'react'\n\n// CONTEXT\nexport type QueryErrorResetFunction = () => void\nexport type QueryErrorIsResetFunction = () => boolean\nexport type QueryErrorClearResetFunction = () => void\n\nexport interface QueryErrorResetBoundaryValue {\n clearReset: QueryErrorClearResetFunction\n isReset: QueryErrorIsResetFunction\n reset: QueryErrorResetFunction\n}\n\nfunction createValue(): QueryErrorResetBoundaryValue {\n let isReset = false\n return {\n clearReset: () => {\n isReset = false\n },\n reset: () => {\n isReset = true\n },\n isReset: () => {\n return isReset\n },\n }\n}\n\nconst QueryErrorResetBoundaryContext = React.createContext(createValue())\n\n// HOOK\n\nexport const useQueryErrorResetBoundary = () =>\n React.useContext(QueryErrorResetBoundaryContext)\n\n// COMPONENT\n\nexport type QueryErrorResetBoundaryFunction = (\n value: QueryErrorResetBoundaryValue,\n) => React.ReactNode\n\nexport interface QueryErrorResetBoundaryProps {\n children: QueryErrorResetBoundaryFunction | React.ReactNode\n}\n\nexport const QueryErrorResetBoundary = ({\n children,\n}: QueryErrorResetBoundaryProps) => {\n const [value] = React.useState(() => createValue())\n return (\n \n {typeof children === 'function' ? children(value) : children}\n \n )\n}\n"],"mappings":";;;AACA,YAAY,WAAW;AAkDnB;AArCJ,SAAS,cAA4C;AACnD,MAAI,UAAU;AACd,SAAO;AAAA,IACL,YAAY,MAAM;AAChB,gBAAU;AAAA,IACZ;AAAA,IACA,OAAO,MAAM;AACX,gBAAU;AAAA,IACZ;AAAA,IACA,SAAS,MAAM;AACb,aAAO;AAAA,IACT;AAAA,EACF;AACF;AAEA,IAAM,iCAAuC,oBAAc,YAAY,CAAC;AAIjE,IAAM,6BAA6B,MAClC,iBAAW,8BAA8B;AAY1C,IAAM,0BAA0B,CAAC;AAAA,EACtC;AACF,MAAoC;AAClC,QAAM,CAAC,KAAK,IAAU,eAAS,MAAM,YAAY,CAAC;AAClD,SACE,oBAAC,+BAA+B,UAA/B,EAAwC,OACtC,iBAAO,aAAa,aAAa,SAAS,KAAK,IAAI,UACtD;AAEJ;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/errorBoundaryUtils.cjs b/node_modules/@tanstack/react-query/build/legacy/errorBoundaryUtils.cjs deleted file mode 100644 index ea4cb4f..0000000 --- a/node_modules/@tanstack/react-query/build/legacy/errorBoundaryUtils.cjs +++ /dev/null @@ -1,69 +0,0 @@ -"use strict"; -"use client"; -var __create = Object.create; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __getProtoOf = Object.getPrototypeOf; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( - // If the importer is in node compatibility mode or this is not an ESM - // file that has been converted to a CommonJS file using a Babel- - // compatible transform (i.e. "__esModule" has not been set), then set - // "default" to the CommonJS "module.exports" for node compatibility. - isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, - mod -)); -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// src/errorBoundaryUtils.ts -var errorBoundaryUtils_exports = {}; -__export(errorBoundaryUtils_exports, { - ensurePreventErrorBoundaryRetry: () => ensurePreventErrorBoundaryRetry, - getHasError: () => getHasError, - useClearResetErrorBoundary: () => useClearResetErrorBoundary -}); -module.exports = __toCommonJS(errorBoundaryUtils_exports); -var React = __toESM(require("react"), 1); -var import_query_core = require("@tanstack/query-core"); -var ensurePreventErrorBoundaryRetry = (options, errorResetBoundary, query) => { - const throwOnError = (query == null ? void 0 : query.state.error) && typeof options.throwOnError === "function" ? (0, import_query_core.shouldThrowError)(options.throwOnError, [query.state.error, query]) : options.throwOnError; - if (options.suspense || options.experimental_prefetchInRender || throwOnError) { - if (!errorResetBoundary.isReset()) { - options.retryOnMount = false; - } - } -}; -var useClearResetErrorBoundary = (errorResetBoundary) => { - React.useEffect(() => { - errorResetBoundary.clearReset(); - }, [errorResetBoundary]); -}; -var getHasError = ({ - result, - errorResetBoundary, - throwOnError, - query, - suspense -}) => { - return result.isError && !errorResetBoundary.isReset() && !result.isFetching && query && (suspense && result.data === void 0 || (0, import_query_core.shouldThrowError)(throwOnError, [result.error, query])); -}; -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - ensurePreventErrorBoundaryRetry, - getHasError, - useClearResetErrorBoundary -}); -//# sourceMappingURL=errorBoundaryUtils.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/errorBoundaryUtils.cjs.map b/node_modules/@tanstack/react-query/build/legacy/errorBoundaryUtils.cjs.map deleted file mode 100644 index 99e4380..0000000 --- a/node_modules/@tanstack/react-query/build/legacy/errorBoundaryUtils.cjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/errorBoundaryUtils.ts"],"sourcesContent":["'use client'\nimport * as React from 'react'\nimport { shouldThrowError } from '@tanstack/query-core'\nimport type {\n DefaultedQueryObserverOptions,\n Query,\n QueryKey,\n QueryObserverResult,\n ThrowOnError,\n} from '@tanstack/query-core'\nimport type { QueryErrorResetBoundaryValue } from './QueryErrorResetBoundary'\n\nexport const ensurePreventErrorBoundaryRetry = <\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey extends QueryKey,\n>(\n options: DefaultedQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >,\n errorResetBoundary: QueryErrorResetBoundaryValue,\n query: Query | undefined,\n) => {\n const throwOnError =\n query?.state.error && typeof options.throwOnError === 'function'\n ? shouldThrowError(options.throwOnError, [query.state.error, query])\n : options.throwOnError\n\n if (\n options.suspense ||\n options.experimental_prefetchInRender ||\n throwOnError\n ) {\n // Prevent retrying failed query if the error boundary has not been reset yet\n if (!errorResetBoundary.isReset()) {\n options.retryOnMount = false\n }\n }\n}\n\nexport const useClearResetErrorBoundary = (\n errorResetBoundary: QueryErrorResetBoundaryValue,\n) => {\n React.useEffect(() => {\n errorResetBoundary.clearReset()\n }, [errorResetBoundary])\n}\n\nexport const getHasError = <\n TData,\n TError,\n TQueryFnData,\n TQueryData,\n TQueryKey extends QueryKey,\n>({\n result,\n errorResetBoundary,\n throwOnError,\n query,\n suspense,\n}: {\n result: QueryObserverResult\n errorResetBoundary: QueryErrorResetBoundaryValue\n throwOnError: ThrowOnError\n query: Query | undefined\n suspense: boolean | undefined\n}) => {\n return (\n result.isError &&\n !errorResetBoundary.isReset() &&\n !result.isFetching &&\n query &&\n ((suspense && result.data === undefined) ||\n shouldThrowError(throwOnError, [result.error, query]))\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,YAAuB;AACvB,wBAAiC;AAU1B,IAAM,kCAAkC,CAO7C,SAOA,oBACA,UACG;AACH,QAAM,gBACJ,+BAAO,MAAM,UAAS,OAAO,QAAQ,iBAAiB,iBAClD,oCAAiB,QAAQ,cAAc,CAAC,MAAM,MAAM,OAAO,KAAK,CAAC,IACjE,QAAQ;AAEd,MACE,QAAQ,YACR,QAAQ,iCACR,cACA;AAEA,QAAI,CAAC,mBAAmB,QAAQ,GAAG;AACjC,cAAQ,eAAe;AAAA,IACzB;AAAA,EACF;AACF;AAEO,IAAM,6BAA6B,CACxC,uBACG;AACH,EAAM,gBAAU,MAAM;AACpB,uBAAmB,WAAW;AAAA,EAChC,GAAG,CAAC,kBAAkB,CAAC;AACzB;AAEO,IAAM,cAAc,CAMzB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MAMM;AACJ,SACE,OAAO,WACP,CAAC,mBAAmB,QAAQ,KAC5B,CAAC,OAAO,cACR,UACE,YAAY,OAAO,SAAS,cAC5B,oCAAiB,cAAc,CAAC,OAAO,OAAO,KAAK,CAAC;AAE1D;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/errorBoundaryUtils.d.cts b/node_modules/@tanstack/react-query/build/legacy/errorBoundaryUtils.d.cts deleted file mode 100644 index 1a46fd1..0000000 --- a/node_modules/@tanstack/react-query/build/legacy/errorBoundaryUtils.d.cts +++ /dev/null @@ -1,16 +0,0 @@ -import { QueryKey, DefaultedQueryObserverOptions, Query, QueryObserverResult, ThrowOnError } from '@tanstack/query-core'; -import { QueryErrorResetBoundaryValue } from './QueryErrorResetBoundary.cjs'; -import 'react/jsx-runtime'; -import 'react'; - -declare const ensurePreventErrorBoundaryRetry: (options: DefaultedQueryObserverOptions, errorResetBoundary: QueryErrorResetBoundaryValue, query: Query | undefined) => void; -declare const useClearResetErrorBoundary: (errorResetBoundary: QueryErrorResetBoundaryValue) => void; -declare const getHasError: ({ result, errorResetBoundary, throwOnError, query, suspense, }: { - result: QueryObserverResult; - errorResetBoundary: QueryErrorResetBoundaryValue; - throwOnError: ThrowOnError; - query: Query | undefined; - suspense: boolean | undefined; -}) => boolean | undefined; - -export { ensurePreventErrorBoundaryRetry, getHasError, useClearResetErrorBoundary }; diff --git a/node_modules/@tanstack/react-query/build/legacy/errorBoundaryUtils.d.ts b/node_modules/@tanstack/react-query/build/legacy/errorBoundaryUtils.d.ts deleted file mode 100644 index 3b9fc8b..0000000 --- a/node_modules/@tanstack/react-query/build/legacy/errorBoundaryUtils.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { QueryKey, DefaultedQueryObserverOptions, Query, QueryObserverResult, ThrowOnError } from '@tanstack/query-core'; -import { QueryErrorResetBoundaryValue } from './QueryErrorResetBoundary.js'; -import 'react/jsx-runtime'; -import 'react'; - -declare const ensurePreventErrorBoundaryRetry: (options: DefaultedQueryObserverOptions, errorResetBoundary: QueryErrorResetBoundaryValue, query: Query | undefined) => void; -declare const useClearResetErrorBoundary: (errorResetBoundary: QueryErrorResetBoundaryValue) => void; -declare const getHasError: ({ result, errorResetBoundary, throwOnError, query, suspense, }: { - result: QueryObserverResult; - errorResetBoundary: QueryErrorResetBoundaryValue; - throwOnError: ThrowOnError; - query: Query | undefined; - suspense: boolean | undefined; -}) => boolean | undefined; - -export { ensurePreventErrorBoundaryRetry, getHasError, useClearResetErrorBoundary }; diff --git a/node_modules/@tanstack/react-query/build/legacy/errorBoundaryUtils.js b/node_modules/@tanstack/react-query/build/legacy/errorBoundaryUtils.js deleted file mode 100644 index 6031250..0000000 --- a/node_modules/@tanstack/react-query/build/legacy/errorBoundaryUtils.js +++ /dev/null @@ -1,33 +0,0 @@ -"use client"; - -// src/errorBoundaryUtils.ts -import * as React from "react"; -import { shouldThrowError } from "@tanstack/query-core"; -var ensurePreventErrorBoundaryRetry = (options, errorResetBoundary, query) => { - const throwOnError = (query == null ? void 0 : query.state.error) && typeof options.throwOnError === "function" ? shouldThrowError(options.throwOnError, [query.state.error, query]) : options.throwOnError; - if (options.suspense || options.experimental_prefetchInRender || throwOnError) { - if (!errorResetBoundary.isReset()) { - options.retryOnMount = false; - } - } -}; -var useClearResetErrorBoundary = (errorResetBoundary) => { - React.useEffect(() => { - errorResetBoundary.clearReset(); - }, [errorResetBoundary]); -}; -var getHasError = ({ - result, - errorResetBoundary, - throwOnError, - query, - suspense -}) => { - return result.isError && !errorResetBoundary.isReset() && !result.isFetching && query && (suspense && result.data === void 0 || shouldThrowError(throwOnError, [result.error, query])); -}; -export { - ensurePreventErrorBoundaryRetry, - getHasError, - useClearResetErrorBoundary -}; -//# sourceMappingURL=errorBoundaryUtils.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/errorBoundaryUtils.js.map b/node_modules/@tanstack/react-query/build/legacy/errorBoundaryUtils.js.map deleted file mode 100644 index cb9f9fb..0000000 --- a/node_modules/@tanstack/react-query/build/legacy/errorBoundaryUtils.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/errorBoundaryUtils.ts"],"sourcesContent":["'use client'\nimport * as React from 'react'\nimport { shouldThrowError } from '@tanstack/query-core'\nimport type {\n DefaultedQueryObserverOptions,\n Query,\n QueryKey,\n QueryObserverResult,\n ThrowOnError,\n} from '@tanstack/query-core'\nimport type { QueryErrorResetBoundaryValue } from './QueryErrorResetBoundary'\n\nexport const ensurePreventErrorBoundaryRetry = <\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey extends QueryKey,\n>(\n options: DefaultedQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >,\n errorResetBoundary: QueryErrorResetBoundaryValue,\n query: Query | undefined,\n) => {\n const throwOnError =\n query?.state.error && typeof options.throwOnError === 'function'\n ? shouldThrowError(options.throwOnError, [query.state.error, query])\n : options.throwOnError\n\n if (\n options.suspense ||\n options.experimental_prefetchInRender ||\n throwOnError\n ) {\n // Prevent retrying failed query if the error boundary has not been reset yet\n if (!errorResetBoundary.isReset()) {\n options.retryOnMount = false\n }\n }\n}\n\nexport const useClearResetErrorBoundary = (\n errorResetBoundary: QueryErrorResetBoundaryValue,\n) => {\n React.useEffect(() => {\n errorResetBoundary.clearReset()\n }, [errorResetBoundary])\n}\n\nexport const getHasError = <\n TData,\n TError,\n TQueryFnData,\n TQueryData,\n TQueryKey extends QueryKey,\n>({\n result,\n errorResetBoundary,\n throwOnError,\n query,\n suspense,\n}: {\n result: QueryObserverResult\n errorResetBoundary: QueryErrorResetBoundaryValue\n throwOnError: ThrowOnError\n query: Query | undefined\n suspense: boolean | undefined\n}) => {\n return (\n result.isError &&\n !errorResetBoundary.isReset() &&\n !result.isFetching &&\n query &&\n ((suspense && result.data === undefined) ||\n shouldThrowError(throwOnError, [result.error, query]))\n )\n}\n"],"mappings":";;;AACA,YAAY,WAAW;AACvB,SAAS,wBAAwB;AAU1B,IAAM,kCAAkC,CAO7C,SAOA,oBACA,UACG;AACH,QAAM,gBACJ,+BAAO,MAAM,UAAS,OAAO,QAAQ,iBAAiB,aAClD,iBAAiB,QAAQ,cAAc,CAAC,MAAM,MAAM,OAAO,KAAK,CAAC,IACjE,QAAQ;AAEd,MACE,QAAQ,YACR,QAAQ,iCACR,cACA;AAEA,QAAI,CAAC,mBAAmB,QAAQ,GAAG;AACjC,cAAQ,eAAe;AAAA,IACzB;AAAA,EACF;AACF;AAEO,IAAM,6BAA6B,CACxC,uBACG;AACH,EAAM,gBAAU,MAAM;AACpB,uBAAmB,WAAW;AAAA,EAChC,GAAG,CAAC,kBAAkB,CAAC;AACzB;AAEO,IAAM,cAAc,CAMzB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MAMM;AACJ,SACE,OAAO,WACP,CAAC,mBAAmB,QAAQ,KAC5B,CAAC,OAAO,cACR,UACE,YAAY,OAAO,SAAS,UAC5B,iBAAiB,cAAc,CAAC,OAAO,OAAO,KAAK,CAAC;AAE1D;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/index.cjs b/node_modules/@tanstack/react-query/build/legacy/index.cjs deleted file mode 100644 index 0d7d36f..0000000 --- a/node_modules/@tanstack/react-query/build/legacy/index.cjs +++ /dev/null @@ -1,97 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default")); -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// src/index.ts -var index_exports = {}; -__export(index_exports, { - HydrationBoundary: () => import_HydrationBoundary.HydrationBoundary, - IsRestoringProvider: () => import_IsRestoringProvider.IsRestoringProvider, - QueryClientContext: () => import_QueryClientProvider.QueryClientContext, - QueryClientProvider: () => import_QueryClientProvider.QueryClientProvider, - QueryErrorResetBoundary: () => import_QueryErrorResetBoundary.QueryErrorResetBoundary, - infiniteQueryOptions: () => import_infiniteQueryOptions.infiniteQueryOptions, - mutationOptions: () => import_mutationOptions.mutationOptions, - queryOptions: () => import_queryOptions.queryOptions, - useInfiniteQuery: () => import_useInfiniteQuery.useInfiniteQuery, - useIsFetching: () => import_useIsFetching.useIsFetching, - useIsMutating: () => import_useMutationState.useIsMutating, - useIsRestoring: () => import_IsRestoringProvider.useIsRestoring, - useMutation: () => import_useMutation.useMutation, - useMutationState: () => import_useMutationState.useMutationState, - usePrefetchInfiniteQuery: () => import_usePrefetchInfiniteQuery.usePrefetchInfiniteQuery, - usePrefetchQuery: () => import_usePrefetchQuery.usePrefetchQuery, - useQueries: () => import_useQueries.useQueries, - useQuery: () => import_useQuery.useQuery, - useQueryClient: () => import_QueryClientProvider.useQueryClient, - useQueryErrorResetBoundary: () => import_QueryErrorResetBoundary.useQueryErrorResetBoundary, - useSuspenseInfiniteQuery: () => import_useSuspenseInfiniteQuery.useSuspenseInfiniteQuery, - useSuspenseQueries: () => import_useSuspenseQueries.useSuspenseQueries, - useSuspenseQuery: () => import_useSuspenseQuery.useSuspenseQuery -}); -module.exports = __toCommonJS(index_exports); -__reExport(index_exports, require("@tanstack/query-core"), module.exports); -__reExport(index_exports, require("./types.cjs"), module.exports); -var import_useQueries = require("./useQueries.cjs"); -var import_useQuery = require("./useQuery.cjs"); -var import_useSuspenseQuery = require("./useSuspenseQuery.cjs"); -var import_useSuspenseInfiniteQuery = require("./useSuspenseInfiniteQuery.cjs"); -var import_useSuspenseQueries = require("./useSuspenseQueries.cjs"); -var import_usePrefetchQuery = require("./usePrefetchQuery.cjs"); -var import_usePrefetchInfiniteQuery = require("./usePrefetchInfiniteQuery.cjs"); -var import_queryOptions = require("./queryOptions.cjs"); -var import_infiniteQueryOptions = require("./infiniteQueryOptions.cjs"); -var import_QueryClientProvider = require("./QueryClientProvider.cjs"); -var import_HydrationBoundary = require("./HydrationBoundary.cjs"); -var import_QueryErrorResetBoundary = require("./QueryErrorResetBoundary.cjs"); -var import_useIsFetching = require("./useIsFetching.cjs"); -var import_useMutationState = require("./useMutationState.cjs"); -var import_useMutation = require("./useMutation.cjs"); -var import_mutationOptions = require("./mutationOptions.cjs"); -var import_useInfiniteQuery = require("./useInfiniteQuery.cjs"); -var import_IsRestoringProvider = require("./IsRestoringProvider.cjs"); -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - HydrationBoundary, - IsRestoringProvider, - QueryClientContext, - QueryClientProvider, - QueryErrorResetBoundary, - infiniteQueryOptions, - mutationOptions, - queryOptions, - useInfiniteQuery, - useIsFetching, - useIsMutating, - useIsRestoring, - useMutation, - useMutationState, - usePrefetchInfiniteQuery, - usePrefetchQuery, - useQueries, - useQuery, - useQueryClient, - useQueryErrorResetBoundary, - useSuspenseInfiniteQuery, - useSuspenseQueries, - useSuspenseQuery, - ...require("@tanstack/query-core"), - ...require("./types.cjs") -}); -//# sourceMappingURL=index.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/index.cjs.map b/node_modules/@tanstack/react-query/build/legacy/index.cjs.map deleted file mode 100644 index 3e25ed1..0000000 --- a/node_modules/@tanstack/react-query/build/legacy/index.cjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/index.ts"],"sourcesContent":["/* istanbul ignore file */\n\n// Re-export core\nexport * from '@tanstack/query-core'\n\n// React Query\nexport * from './types'\nexport { useQueries } from './useQueries'\nexport type { QueriesResults, QueriesOptions } from './useQueries'\nexport { useQuery } from './useQuery'\nexport { useSuspenseQuery } from './useSuspenseQuery'\nexport { useSuspenseInfiniteQuery } from './useSuspenseInfiniteQuery'\nexport { useSuspenseQueries } from './useSuspenseQueries'\nexport type {\n SuspenseQueriesResults,\n SuspenseQueriesOptions,\n} from './useSuspenseQueries'\nexport { usePrefetchQuery } from './usePrefetchQuery'\nexport { usePrefetchInfiniteQuery } from './usePrefetchInfiniteQuery'\nexport { queryOptions } from './queryOptions'\nexport type {\n DefinedInitialDataOptions,\n UndefinedInitialDataOptions,\n UnusedSkipTokenOptions,\n} from './queryOptions'\nexport { infiniteQueryOptions } from './infiniteQueryOptions'\nexport type {\n DefinedInitialDataInfiniteOptions,\n UndefinedInitialDataInfiniteOptions,\n UnusedSkipTokenInfiniteOptions,\n} from './infiniteQueryOptions'\nexport {\n QueryClientContext,\n QueryClientProvider,\n useQueryClient,\n} from './QueryClientProvider'\nexport type { QueryClientProviderProps } from './QueryClientProvider'\nexport type { QueryErrorResetBoundaryProps } from './QueryErrorResetBoundary'\nexport { HydrationBoundary } from './HydrationBoundary'\nexport type { HydrationBoundaryProps } from './HydrationBoundary'\nexport type {\n QueryErrorClearResetFunction,\n QueryErrorIsResetFunction,\n QueryErrorResetBoundaryFunction,\n QueryErrorResetFunction,\n} from './QueryErrorResetBoundary'\nexport {\n QueryErrorResetBoundary,\n useQueryErrorResetBoundary,\n} from './QueryErrorResetBoundary'\nexport { useIsFetching } from './useIsFetching'\nexport { useIsMutating, useMutationState } from './useMutationState'\nexport { useMutation } from './useMutation'\nexport { mutationOptions } from './mutationOptions'\nexport { useInfiniteQuery } from './useInfiniteQuery'\nexport { useIsRestoring, IsRestoringProvider } from './IsRestoringProvider'\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,0BAAc,iCAHd;AAMA,0BAAc,wBANd;AAOA,wBAA2B;AAE3B,sBAAyB;AACzB,8BAAiC;AACjC,sCAAyC;AACzC,gCAAmC;AAKnC,8BAAiC;AACjC,sCAAyC;AACzC,0BAA6B;AAM7B,kCAAqC;AAMrC,iCAIO;AAGP,+BAAkC;AAQlC,qCAGO;AACP,2BAA8B;AAC9B,8BAAgD;AAChD,yBAA4B;AAC5B,6BAAgC;AAChC,8BAAiC;AACjC,iCAAoD;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/index.d.cts b/node_modules/@tanstack/react-query/build/legacy/index.d.cts deleted file mode 100644 index 4924b4f..0000000 --- a/node_modules/@tanstack/react-query/build/legacy/index.d.cts +++ /dev/null @@ -1,22 +0,0 @@ -export * from '@tanstack/query-core'; -export { AnyUseBaseQueryOptions, AnyUseInfiniteQueryOptions, AnyUseMutationOptions, AnyUseQueryOptions, AnyUseSuspenseInfiniteQueryOptions, AnyUseSuspenseQueryOptions, DefinedUseInfiniteQueryResult, DefinedUseQueryResult, UseBaseMutationResult, UseBaseQueryOptions, UseBaseQueryResult, UseInfiniteQueryOptions, UseInfiniteQueryResult, UseMutateAsyncFunction, UseMutateFunction, UseMutationOptions, UseMutationResult, UsePrefetchQueryOptions, UseQueryOptions, UseQueryResult, UseSuspenseInfiniteQueryOptions, UseSuspenseInfiniteQueryResult, UseSuspenseQueryOptions, UseSuspenseQueryResult } from './types.cjs'; -export { QueriesOptions, QueriesResults, useQueries } from './useQueries.cjs'; -export { useQuery } from './useQuery.cjs'; -export { useSuspenseQuery } from './useSuspenseQuery.cjs'; -export { useSuspenseInfiniteQuery } from './useSuspenseInfiniteQuery.cjs'; -export { SuspenseQueriesOptions, SuspenseQueriesResults, useSuspenseQueries } from './useSuspenseQueries.cjs'; -export { usePrefetchQuery } from './usePrefetchQuery.cjs'; -export { usePrefetchInfiniteQuery } from './usePrefetchInfiniteQuery.cjs'; -export { DefinedInitialDataOptions, UndefinedInitialDataOptions, UnusedSkipTokenOptions, queryOptions } from './queryOptions.cjs'; -export { DefinedInitialDataInfiniteOptions, UndefinedInitialDataInfiniteOptions, UnusedSkipTokenInfiniteOptions, infiniteQueryOptions } from './infiniteQueryOptions.cjs'; -export { QueryClientContext, QueryClientProvider, QueryClientProviderProps, useQueryClient } from './QueryClientProvider.cjs'; -export { QueryErrorClearResetFunction, QueryErrorIsResetFunction, QueryErrorResetBoundary, QueryErrorResetBoundaryFunction, QueryErrorResetBoundaryProps, QueryErrorResetFunction, useQueryErrorResetBoundary } from './QueryErrorResetBoundary.cjs'; -export { HydrationBoundary, HydrationBoundaryProps } from './HydrationBoundary.cjs'; -export { useIsFetching } from './useIsFetching.cjs'; -export { useIsMutating, useMutationState } from './useMutationState.cjs'; -export { useMutation } from './useMutation.cjs'; -export { mutationOptions } from './mutationOptions.cjs'; -export { useInfiniteQuery } from './useInfiniteQuery.cjs'; -export { IsRestoringProvider, useIsRestoring } from './IsRestoringProvider.cjs'; -import 'react'; -import 'react/jsx-runtime'; diff --git a/node_modules/@tanstack/react-query/build/legacy/index.d.ts b/node_modules/@tanstack/react-query/build/legacy/index.d.ts deleted file mode 100644 index 45dab83..0000000 --- a/node_modules/@tanstack/react-query/build/legacy/index.d.ts +++ /dev/null @@ -1,22 +0,0 @@ -export * from '@tanstack/query-core'; -export { AnyUseBaseQueryOptions, AnyUseInfiniteQueryOptions, AnyUseMutationOptions, AnyUseQueryOptions, AnyUseSuspenseInfiniteQueryOptions, AnyUseSuspenseQueryOptions, DefinedUseInfiniteQueryResult, DefinedUseQueryResult, UseBaseMutationResult, UseBaseQueryOptions, UseBaseQueryResult, UseInfiniteQueryOptions, UseInfiniteQueryResult, UseMutateAsyncFunction, UseMutateFunction, UseMutationOptions, UseMutationResult, UsePrefetchQueryOptions, UseQueryOptions, UseQueryResult, UseSuspenseInfiniteQueryOptions, UseSuspenseInfiniteQueryResult, UseSuspenseQueryOptions, UseSuspenseQueryResult } from './types.js'; -export { QueriesOptions, QueriesResults, useQueries } from './useQueries.js'; -export { useQuery } from './useQuery.js'; -export { useSuspenseQuery } from './useSuspenseQuery.js'; -export { useSuspenseInfiniteQuery } from './useSuspenseInfiniteQuery.js'; -export { SuspenseQueriesOptions, SuspenseQueriesResults, useSuspenseQueries } from './useSuspenseQueries.js'; -export { usePrefetchQuery } from './usePrefetchQuery.js'; -export { usePrefetchInfiniteQuery } from './usePrefetchInfiniteQuery.js'; -export { DefinedInitialDataOptions, UndefinedInitialDataOptions, UnusedSkipTokenOptions, queryOptions } from './queryOptions.js'; -export { DefinedInitialDataInfiniteOptions, UndefinedInitialDataInfiniteOptions, UnusedSkipTokenInfiniteOptions, infiniteQueryOptions } from './infiniteQueryOptions.js'; -export { QueryClientContext, QueryClientProvider, QueryClientProviderProps, useQueryClient } from './QueryClientProvider.js'; -export { QueryErrorClearResetFunction, QueryErrorIsResetFunction, QueryErrorResetBoundary, QueryErrorResetBoundaryFunction, QueryErrorResetBoundaryProps, QueryErrorResetFunction, useQueryErrorResetBoundary } from './QueryErrorResetBoundary.js'; -export { HydrationBoundary, HydrationBoundaryProps } from './HydrationBoundary.js'; -export { useIsFetching } from './useIsFetching.js'; -export { useIsMutating, useMutationState } from './useMutationState.js'; -export { useMutation } from './useMutation.js'; -export { mutationOptions } from './mutationOptions.js'; -export { useInfiniteQuery } from './useInfiniteQuery.js'; -export { IsRestoringProvider, useIsRestoring } from './IsRestoringProvider.js'; -import 'react'; -import 'react/jsx-runtime'; diff --git a/node_modules/@tanstack/react-query/build/legacy/index.js b/node_modules/@tanstack/react-query/build/legacy/index.js deleted file mode 100644 index 66ddb26..0000000 --- a/node_modules/@tanstack/react-query/build/legacy/index.js +++ /dev/null @@ -1,54 +0,0 @@ -// src/index.ts -export * from "@tanstack/query-core"; -export * from "./types.js"; -import { useQueries } from "./useQueries.js"; -import { useQuery } from "./useQuery.js"; -import { useSuspenseQuery } from "./useSuspenseQuery.js"; -import { useSuspenseInfiniteQuery } from "./useSuspenseInfiniteQuery.js"; -import { useSuspenseQueries } from "./useSuspenseQueries.js"; -import { usePrefetchQuery } from "./usePrefetchQuery.js"; -import { usePrefetchInfiniteQuery } from "./usePrefetchInfiniteQuery.js"; -import { queryOptions } from "./queryOptions.js"; -import { infiniteQueryOptions } from "./infiniteQueryOptions.js"; -import { - QueryClientContext, - QueryClientProvider, - useQueryClient -} from "./QueryClientProvider.js"; -import { HydrationBoundary } from "./HydrationBoundary.js"; -import { - QueryErrorResetBoundary, - useQueryErrorResetBoundary -} from "./QueryErrorResetBoundary.js"; -import { useIsFetching } from "./useIsFetching.js"; -import { useIsMutating, useMutationState } from "./useMutationState.js"; -import { useMutation } from "./useMutation.js"; -import { mutationOptions } from "./mutationOptions.js"; -import { useInfiniteQuery } from "./useInfiniteQuery.js"; -import { useIsRestoring, IsRestoringProvider } from "./IsRestoringProvider.js"; -export { - HydrationBoundary, - IsRestoringProvider, - QueryClientContext, - QueryClientProvider, - QueryErrorResetBoundary, - infiniteQueryOptions, - mutationOptions, - queryOptions, - useInfiniteQuery, - useIsFetching, - useIsMutating, - useIsRestoring, - useMutation, - useMutationState, - usePrefetchInfiniteQuery, - usePrefetchQuery, - useQueries, - useQuery, - useQueryClient, - useQueryErrorResetBoundary, - useSuspenseInfiniteQuery, - useSuspenseQueries, - useSuspenseQuery -}; -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/index.js.map b/node_modules/@tanstack/react-query/build/legacy/index.js.map deleted file mode 100644 index e3df051..0000000 --- a/node_modules/@tanstack/react-query/build/legacy/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/index.ts"],"sourcesContent":["/* istanbul ignore file */\n\n// Re-export core\nexport * from '@tanstack/query-core'\n\n// React Query\nexport * from './types'\nexport { useQueries } from './useQueries'\nexport type { QueriesResults, QueriesOptions } from './useQueries'\nexport { useQuery } from './useQuery'\nexport { useSuspenseQuery } from './useSuspenseQuery'\nexport { useSuspenseInfiniteQuery } from './useSuspenseInfiniteQuery'\nexport { useSuspenseQueries } from './useSuspenseQueries'\nexport type {\n SuspenseQueriesResults,\n SuspenseQueriesOptions,\n} from './useSuspenseQueries'\nexport { usePrefetchQuery } from './usePrefetchQuery'\nexport { usePrefetchInfiniteQuery } from './usePrefetchInfiniteQuery'\nexport { queryOptions } from './queryOptions'\nexport type {\n DefinedInitialDataOptions,\n UndefinedInitialDataOptions,\n UnusedSkipTokenOptions,\n} from './queryOptions'\nexport { infiniteQueryOptions } from './infiniteQueryOptions'\nexport type {\n DefinedInitialDataInfiniteOptions,\n UndefinedInitialDataInfiniteOptions,\n UnusedSkipTokenInfiniteOptions,\n} from './infiniteQueryOptions'\nexport {\n QueryClientContext,\n QueryClientProvider,\n useQueryClient,\n} from './QueryClientProvider'\nexport type { QueryClientProviderProps } from './QueryClientProvider'\nexport type { QueryErrorResetBoundaryProps } from './QueryErrorResetBoundary'\nexport { HydrationBoundary } from './HydrationBoundary'\nexport type { HydrationBoundaryProps } from './HydrationBoundary'\nexport type {\n QueryErrorClearResetFunction,\n QueryErrorIsResetFunction,\n QueryErrorResetBoundaryFunction,\n QueryErrorResetFunction,\n} from './QueryErrorResetBoundary'\nexport {\n QueryErrorResetBoundary,\n useQueryErrorResetBoundary,\n} from './QueryErrorResetBoundary'\nexport { useIsFetching } from './useIsFetching'\nexport { useIsMutating, useMutationState } from './useMutationState'\nexport { useMutation } from './useMutation'\nexport { mutationOptions } from './mutationOptions'\nexport { useInfiniteQuery } from './useInfiniteQuery'\nexport { useIsRestoring, IsRestoringProvider } from './IsRestoringProvider'\n"],"mappings":";AAGA,cAAc;AAGd,cAAc;AACd,SAAS,kBAAkB;AAE3B,SAAS,gBAAgB;AACzB,SAAS,wBAAwB;AACjC,SAAS,gCAAgC;AACzC,SAAS,0BAA0B;AAKnC,SAAS,wBAAwB;AACjC,SAAS,gCAAgC;AACzC,SAAS,oBAAoB;AAM7B,SAAS,4BAA4B;AAMrC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAGP,SAAS,yBAAyB;AAQlC;AAAA,EACE;AAAA,EACA;AAAA,OACK;AACP,SAAS,qBAAqB;AAC9B,SAAS,eAAe,wBAAwB;AAChD,SAAS,mBAAmB;AAC5B,SAAS,uBAAuB;AAChC,SAAS,wBAAwB;AACjC,SAAS,gBAAgB,2BAA2B;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/infiniteQueryOptions.cjs b/node_modules/@tanstack/react-query/build/legacy/infiniteQueryOptions.cjs deleted file mode 100644 index d0ce5b1..0000000 --- a/node_modules/@tanstack/react-query/build/legacy/infiniteQueryOptions.cjs +++ /dev/null @@ -1,33 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// src/infiniteQueryOptions.ts -var infiniteQueryOptions_exports = {}; -__export(infiniteQueryOptions_exports, { - infiniteQueryOptions: () => infiniteQueryOptions -}); -module.exports = __toCommonJS(infiniteQueryOptions_exports); -function infiniteQueryOptions(options) { - return options; -} -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - infiniteQueryOptions -}); -//# sourceMappingURL=infiniteQueryOptions.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/infiniteQueryOptions.cjs.map b/node_modules/@tanstack/react-query/build/legacy/infiniteQueryOptions.cjs.map deleted file mode 100644 index b802bf9..0000000 --- a/node_modules/@tanstack/react-query/build/legacy/infiniteQueryOptions.cjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/infiniteQueryOptions.ts"],"sourcesContent":["import type {\n DataTag,\n DefaultError,\n InfiniteData,\n InitialDataFunction,\n NonUndefinedGuard,\n OmitKeyof,\n QueryKey,\n SkipToken,\n} from '@tanstack/query-core'\nimport type { UseInfiniteQueryOptions } from './types'\n\nexport type UndefinedInitialDataInfiniteOptions<\n TQueryFnData,\n TError = DefaultError,\n TData = InfiniteData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n> = UseInfiniteQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n> & {\n initialData?:\n | undefined\n | NonUndefinedGuard>\n | InitialDataFunction<\n NonUndefinedGuard>\n >\n}\n\nexport type UnusedSkipTokenInfiniteOptions<\n TQueryFnData,\n TError = DefaultError,\n TData = InfiniteData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n> = OmitKeyof<\n UseInfiniteQueryOptions,\n 'queryFn'\n> & {\n queryFn?: Exclude<\n UseInfiniteQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >['queryFn'],\n SkipToken | undefined\n >\n}\n\nexport type DefinedInitialDataInfiniteOptions<\n TQueryFnData,\n TError = DefaultError,\n TData = InfiniteData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n> = UseInfiniteQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n> & {\n initialData:\n | NonUndefinedGuard>\n | (() => NonUndefinedGuard>)\n | undefined\n}\n\nexport function infiniteQueryOptions<\n TQueryFnData,\n TError = DefaultError,\n TData = InfiniteData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n>(\n options: DefinedInitialDataInfiniteOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n): DefinedInitialDataInfiniteOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n> & {\n queryKey: DataTag, TError>\n}\n\nexport function infiniteQueryOptions<\n TQueryFnData,\n TError = DefaultError,\n TData = InfiniteData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n>(\n options: UnusedSkipTokenInfiniteOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n): UnusedSkipTokenInfiniteOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n> & {\n queryKey: DataTag, TError>\n}\n\nexport function infiniteQueryOptions<\n TQueryFnData,\n TError = DefaultError,\n TData = InfiniteData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n>(\n options: UndefinedInitialDataInfiniteOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n): UndefinedInitialDataInfiniteOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n> & {\n queryKey: DataTag, TError>\n}\n\nexport function infiniteQueryOptions(options: unknown) {\n return options\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAkJO,SAAS,qBAAqB,SAAkB;AACrD,SAAO;AACT;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/infiniteQueryOptions.d.cts b/node_modules/@tanstack/react-query/build/legacy/infiniteQueryOptions.d.cts deleted file mode 100644 index c363f90..0000000 --- a/node_modules/@tanstack/react-query/build/legacy/infiniteQueryOptions.d.cts +++ /dev/null @@ -1,23 +0,0 @@ -import { DefaultError, InfiniteData, QueryKey, NonUndefinedGuard, InitialDataFunction, OmitKeyof, SkipToken, DataTag } from '@tanstack/query-core'; -import { UseInfiniteQueryOptions } from './types.cjs'; - -type UndefinedInitialDataInfiniteOptions, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown> = UseInfiniteQueryOptions & { - initialData?: undefined | NonUndefinedGuard> | InitialDataFunction>>; -}; -type UnusedSkipTokenInfiniteOptions, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown> = OmitKeyof, 'queryFn'> & { - queryFn?: Exclude['queryFn'], SkipToken | undefined>; -}; -type DefinedInitialDataInfiniteOptions, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown> = UseInfiniteQueryOptions & { - initialData: NonUndefinedGuard> | (() => NonUndefinedGuard>) | undefined; -}; -declare function infiniteQueryOptions, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown>(options: DefinedInitialDataInfiniteOptions): DefinedInitialDataInfiniteOptions & { - queryKey: DataTag, TError>; -}; -declare function infiniteQueryOptions, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown>(options: UnusedSkipTokenInfiniteOptions): UnusedSkipTokenInfiniteOptions & { - queryKey: DataTag, TError>; -}; -declare function infiniteQueryOptions, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown>(options: UndefinedInitialDataInfiniteOptions): UndefinedInitialDataInfiniteOptions & { - queryKey: DataTag, TError>; -}; - -export { type DefinedInitialDataInfiniteOptions, type UndefinedInitialDataInfiniteOptions, type UnusedSkipTokenInfiniteOptions, infiniteQueryOptions }; diff --git a/node_modules/@tanstack/react-query/build/legacy/infiniteQueryOptions.d.ts b/node_modules/@tanstack/react-query/build/legacy/infiniteQueryOptions.d.ts deleted file mode 100644 index a37a4de..0000000 --- a/node_modules/@tanstack/react-query/build/legacy/infiniteQueryOptions.d.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { DefaultError, InfiniteData, QueryKey, NonUndefinedGuard, InitialDataFunction, OmitKeyof, SkipToken, DataTag } from '@tanstack/query-core'; -import { UseInfiniteQueryOptions } from './types.js'; - -type UndefinedInitialDataInfiniteOptions, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown> = UseInfiniteQueryOptions & { - initialData?: undefined | NonUndefinedGuard> | InitialDataFunction>>; -}; -type UnusedSkipTokenInfiniteOptions, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown> = OmitKeyof, 'queryFn'> & { - queryFn?: Exclude['queryFn'], SkipToken | undefined>; -}; -type DefinedInitialDataInfiniteOptions, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown> = UseInfiniteQueryOptions & { - initialData: NonUndefinedGuard> | (() => NonUndefinedGuard>) | undefined; -}; -declare function infiniteQueryOptions, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown>(options: DefinedInitialDataInfiniteOptions): DefinedInitialDataInfiniteOptions & { - queryKey: DataTag, TError>; -}; -declare function infiniteQueryOptions, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown>(options: UnusedSkipTokenInfiniteOptions): UnusedSkipTokenInfiniteOptions & { - queryKey: DataTag, TError>; -}; -declare function infiniteQueryOptions, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown>(options: UndefinedInitialDataInfiniteOptions): UndefinedInitialDataInfiniteOptions & { - queryKey: DataTag, TError>; -}; - -export { type DefinedInitialDataInfiniteOptions, type UndefinedInitialDataInfiniteOptions, type UnusedSkipTokenInfiniteOptions, infiniteQueryOptions }; diff --git a/node_modules/@tanstack/react-query/build/legacy/infiniteQueryOptions.js b/node_modules/@tanstack/react-query/build/legacy/infiniteQueryOptions.js deleted file mode 100644 index bc8d5b0..0000000 --- a/node_modules/@tanstack/react-query/build/legacy/infiniteQueryOptions.js +++ /dev/null @@ -1,8 +0,0 @@ -// src/infiniteQueryOptions.ts -function infiniteQueryOptions(options) { - return options; -} -export { - infiniteQueryOptions -}; -//# sourceMappingURL=infiniteQueryOptions.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/infiniteQueryOptions.js.map b/node_modules/@tanstack/react-query/build/legacy/infiniteQueryOptions.js.map deleted file mode 100644 index fb592fc..0000000 --- a/node_modules/@tanstack/react-query/build/legacy/infiniteQueryOptions.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/infiniteQueryOptions.ts"],"sourcesContent":["import type {\n DataTag,\n DefaultError,\n InfiniteData,\n InitialDataFunction,\n NonUndefinedGuard,\n OmitKeyof,\n QueryKey,\n SkipToken,\n} from '@tanstack/query-core'\nimport type { UseInfiniteQueryOptions } from './types'\n\nexport type UndefinedInitialDataInfiniteOptions<\n TQueryFnData,\n TError = DefaultError,\n TData = InfiniteData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n> = UseInfiniteQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n> & {\n initialData?:\n | undefined\n | NonUndefinedGuard>\n | InitialDataFunction<\n NonUndefinedGuard>\n >\n}\n\nexport type UnusedSkipTokenInfiniteOptions<\n TQueryFnData,\n TError = DefaultError,\n TData = InfiniteData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n> = OmitKeyof<\n UseInfiniteQueryOptions,\n 'queryFn'\n> & {\n queryFn?: Exclude<\n UseInfiniteQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >['queryFn'],\n SkipToken | undefined\n >\n}\n\nexport type DefinedInitialDataInfiniteOptions<\n TQueryFnData,\n TError = DefaultError,\n TData = InfiniteData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n> = UseInfiniteQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n> & {\n initialData:\n | NonUndefinedGuard>\n | (() => NonUndefinedGuard>)\n | undefined\n}\n\nexport function infiniteQueryOptions<\n TQueryFnData,\n TError = DefaultError,\n TData = InfiniteData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n>(\n options: DefinedInitialDataInfiniteOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n): DefinedInitialDataInfiniteOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n> & {\n queryKey: DataTag, TError>\n}\n\nexport function infiniteQueryOptions<\n TQueryFnData,\n TError = DefaultError,\n TData = InfiniteData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n>(\n options: UnusedSkipTokenInfiniteOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n): UnusedSkipTokenInfiniteOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n> & {\n queryKey: DataTag, TError>\n}\n\nexport function infiniteQueryOptions<\n TQueryFnData,\n TError = DefaultError,\n TData = InfiniteData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n>(\n options: UndefinedInitialDataInfiniteOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n): UndefinedInitialDataInfiniteOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n> & {\n queryKey: DataTag, TError>\n}\n\nexport function infiniteQueryOptions(options: unknown) {\n return options\n}\n"],"mappings":";AAkJO,SAAS,qBAAqB,SAAkB;AACrD,SAAO;AACT;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/mutationOptions.cjs b/node_modules/@tanstack/react-query/build/legacy/mutationOptions.cjs deleted file mode 100644 index db3ac10..0000000 --- a/node_modules/@tanstack/react-query/build/legacy/mutationOptions.cjs +++ /dev/null @@ -1,33 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// src/mutationOptions.ts -var mutationOptions_exports = {}; -__export(mutationOptions_exports, { - mutationOptions: () => mutationOptions -}); -module.exports = __toCommonJS(mutationOptions_exports); -function mutationOptions(options) { - return options; -} -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - mutationOptions -}); -//# sourceMappingURL=mutationOptions.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/mutationOptions.cjs.map b/node_modules/@tanstack/react-query/build/legacy/mutationOptions.cjs.map deleted file mode 100644 index 683b965..0000000 --- a/node_modules/@tanstack/react-query/build/legacy/mutationOptions.cjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/mutationOptions.ts"],"sourcesContent":["import type { DefaultError, WithRequired } from '@tanstack/query-core'\nimport type { UseMutationOptions } from './types'\n\nexport function mutationOptions<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n>(\n options: WithRequired<\n UseMutationOptions,\n 'mutationKey'\n >,\n): WithRequired<\n UseMutationOptions,\n 'mutationKey'\n>\nexport function mutationOptions<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n>(\n options: Omit<\n UseMutationOptions,\n 'mutationKey'\n >,\n): Omit<\n UseMutationOptions,\n 'mutationKey'\n>\nexport function mutationOptions<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n>(\n options: UseMutationOptions,\n): UseMutationOptions {\n return options\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AA+BO,SAAS,gBAMd,SACgE;AAChE,SAAO;AACT;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/mutationOptions.d.cts b/node_modules/@tanstack/react-query/build/legacy/mutationOptions.d.cts deleted file mode 100644 index 170edf3..0000000 --- a/node_modules/@tanstack/react-query/build/legacy/mutationOptions.d.cts +++ /dev/null @@ -1,7 +0,0 @@ -import { DefaultError, WithRequired } from '@tanstack/query-core'; -import { UseMutationOptions } from './types.cjs'; - -declare function mutationOptions(options: WithRequired, 'mutationKey'>): WithRequired, 'mutationKey'>; -declare function mutationOptions(options: Omit, 'mutationKey'>): Omit, 'mutationKey'>; - -export { mutationOptions }; diff --git a/node_modules/@tanstack/react-query/build/legacy/mutationOptions.d.ts b/node_modules/@tanstack/react-query/build/legacy/mutationOptions.d.ts deleted file mode 100644 index b080cf2..0000000 --- a/node_modules/@tanstack/react-query/build/legacy/mutationOptions.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { DefaultError, WithRequired } from '@tanstack/query-core'; -import { UseMutationOptions } from './types.js'; - -declare function mutationOptions(options: WithRequired, 'mutationKey'>): WithRequired, 'mutationKey'>; -declare function mutationOptions(options: Omit, 'mutationKey'>): Omit, 'mutationKey'>; - -export { mutationOptions }; diff --git a/node_modules/@tanstack/react-query/build/legacy/mutationOptions.js b/node_modules/@tanstack/react-query/build/legacy/mutationOptions.js deleted file mode 100644 index d40279e..0000000 --- a/node_modules/@tanstack/react-query/build/legacy/mutationOptions.js +++ /dev/null @@ -1,8 +0,0 @@ -// src/mutationOptions.ts -function mutationOptions(options) { - return options; -} -export { - mutationOptions -}; -//# sourceMappingURL=mutationOptions.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/mutationOptions.js.map b/node_modules/@tanstack/react-query/build/legacy/mutationOptions.js.map deleted file mode 100644 index d0a8b6d..0000000 --- a/node_modules/@tanstack/react-query/build/legacy/mutationOptions.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/mutationOptions.ts"],"sourcesContent":["import type { DefaultError, WithRequired } from '@tanstack/query-core'\nimport type { UseMutationOptions } from './types'\n\nexport function mutationOptions<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n>(\n options: WithRequired<\n UseMutationOptions,\n 'mutationKey'\n >,\n): WithRequired<\n UseMutationOptions,\n 'mutationKey'\n>\nexport function mutationOptions<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n>(\n options: Omit<\n UseMutationOptions,\n 'mutationKey'\n >,\n): Omit<\n UseMutationOptions,\n 'mutationKey'\n>\nexport function mutationOptions<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n>(\n options: UseMutationOptions,\n): UseMutationOptions {\n return options\n}\n"],"mappings":";AA+BO,SAAS,gBAMd,SACgE;AAChE,SAAO;AACT;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/queryOptions.cjs b/node_modules/@tanstack/react-query/build/legacy/queryOptions.cjs deleted file mode 100644 index ffda67f..0000000 --- a/node_modules/@tanstack/react-query/build/legacy/queryOptions.cjs +++ /dev/null @@ -1,33 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// src/queryOptions.ts -var queryOptions_exports = {}; -__export(queryOptions_exports, { - queryOptions: () => queryOptions -}); -module.exports = __toCommonJS(queryOptions_exports); -function queryOptions(options) { - return options; -} -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - queryOptions -}); -//# sourceMappingURL=queryOptions.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/queryOptions.cjs.map b/node_modules/@tanstack/react-query/build/legacy/queryOptions.cjs.map deleted file mode 100644 index 426573b..0000000 --- a/node_modules/@tanstack/react-query/build/legacy/queryOptions.cjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/queryOptions.ts"],"sourcesContent":["import type {\n DataTag,\n DefaultError,\n InitialDataFunction,\n NonUndefinedGuard,\n OmitKeyof,\n QueryFunction,\n QueryKey,\n SkipToken,\n} from '@tanstack/query-core'\nimport type { UseQueryOptions } from './types'\n\nexport type UndefinedInitialDataOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> = UseQueryOptions & {\n initialData?:\n | undefined\n | InitialDataFunction>\n | NonUndefinedGuard\n}\n\nexport type UnusedSkipTokenOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> = OmitKeyof<\n UseQueryOptions,\n 'queryFn'\n> & {\n queryFn?: Exclude<\n UseQueryOptions['queryFn'],\n SkipToken | undefined\n >\n}\n\nexport type DefinedInitialDataOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> = Omit, 'queryFn'> & {\n initialData:\n | NonUndefinedGuard\n | (() => NonUndefinedGuard)\n queryFn?: QueryFunction\n}\n\nexport function queryOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n options: DefinedInitialDataOptions,\n): DefinedInitialDataOptions & {\n queryKey: DataTag\n}\n\nexport function queryOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n options: UnusedSkipTokenOptions,\n): UnusedSkipTokenOptions & {\n queryKey: DataTag\n}\n\nexport function queryOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n options: UndefinedInitialDataOptions,\n): UndefinedInitialDataOptions & {\n queryKey: DataTag\n}\n\nexport function queryOptions(options: unknown) {\n return options\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAoFO,SAAS,aAAa,SAAkB;AAC7C,SAAO;AACT;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/queryOptions.d.cts b/node_modules/@tanstack/react-query/build/legacy/queryOptions.d.cts deleted file mode 100644 index 05489f6..0000000 --- a/node_modules/@tanstack/react-query/build/legacy/queryOptions.d.cts +++ /dev/null @@ -1,24 +0,0 @@ -import { DefaultError, QueryKey, NonUndefinedGuard, QueryFunction, InitialDataFunction, OmitKeyof, SkipToken, DataTag } from '@tanstack/query-core'; -import { UseQueryOptions } from './types.cjs'; - -type UndefinedInitialDataOptions = UseQueryOptions & { - initialData?: undefined | InitialDataFunction> | NonUndefinedGuard; -}; -type UnusedSkipTokenOptions = OmitKeyof, 'queryFn'> & { - queryFn?: Exclude['queryFn'], SkipToken | undefined>; -}; -type DefinedInitialDataOptions = Omit, 'queryFn'> & { - initialData: NonUndefinedGuard | (() => NonUndefinedGuard); - queryFn?: QueryFunction; -}; -declare function queryOptions(options: DefinedInitialDataOptions): DefinedInitialDataOptions & { - queryKey: DataTag; -}; -declare function queryOptions(options: UnusedSkipTokenOptions): UnusedSkipTokenOptions & { - queryKey: DataTag; -}; -declare function queryOptions(options: UndefinedInitialDataOptions): UndefinedInitialDataOptions & { - queryKey: DataTag; -}; - -export { type DefinedInitialDataOptions, type UndefinedInitialDataOptions, type UnusedSkipTokenOptions, queryOptions }; diff --git a/node_modules/@tanstack/react-query/build/legacy/queryOptions.d.ts b/node_modules/@tanstack/react-query/build/legacy/queryOptions.d.ts deleted file mode 100644 index 7a93665..0000000 --- a/node_modules/@tanstack/react-query/build/legacy/queryOptions.d.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { DefaultError, QueryKey, NonUndefinedGuard, QueryFunction, InitialDataFunction, OmitKeyof, SkipToken, DataTag } from '@tanstack/query-core'; -import { UseQueryOptions } from './types.js'; - -type UndefinedInitialDataOptions = UseQueryOptions & { - initialData?: undefined | InitialDataFunction> | NonUndefinedGuard; -}; -type UnusedSkipTokenOptions = OmitKeyof, 'queryFn'> & { - queryFn?: Exclude['queryFn'], SkipToken | undefined>; -}; -type DefinedInitialDataOptions = Omit, 'queryFn'> & { - initialData: NonUndefinedGuard | (() => NonUndefinedGuard); - queryFn?: QueryFunction; -}; -declare function queryOptions(options: DefinedInitialDataOptions): DefinedInitialDataOptions & { - queryKey: DataTag; -}; -declare function queryOptions(options: UnusedSkipTokenOptions): UnusedSkipTokenOptions & { - queryKey: DataTag; -}; -declare function queryOptions(options: UndefinedInitialDataOptions): UndefinedInitialDataOptions & { - queryKey: DataTag; -}; - -export { type DefinedInitialDataOptions, type UndefinedInitialDataOptions, type UnusedSkipTokenOptions, queryOptions }; diff --git a/node_modules/@tanstack/react-query/build/legacy/queryOptions.js b/node_modules/@tanstack/react-query/build/legacy/queryOptions.js deleted file mode 100644 index 7fb75ff..0000000 --- a/node_modules/@tanstack/react-query/build/legacy/queryOptions.js +++ /dev/null @@ -1,8 +0,0 @@ -// src/queryOptions.ts -function queryOptions(options) { - return options; -} -export { - queryOptions -}; -//# sourceMappingURL=queryOptions.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/queryOptions.js.map b/node_modules/@tanstack/react-query/build/legacy/queryOptions.js.map deleted file mode 100644 index 4ee7f34..0000000 --- a/node_modules/@tanstack/react-query/build/legacy/queryOptions.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/queryOptions.ts"],"sourcesContent":["import type {\n DataTag,\n DefaultError,\n InitialDataFunction,\n NonUndefinedGuard,\n OmitKeyof,\n QueryFunction,\n QueryKey,\n SkipToken,\n} from '@tanstack/query-core'\nimport type { UseQueryOptions } from './types'\n\nexport type UndefinedInitialDataOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> = UseQueryOptions & {\n initialData?:\n | undefined\n | InitialDataFunction>\n | NonUndefinedGuard\n}\n\nexport type UnusedSkipTokenOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> = OmitKeyof<\n UseQueryOptions,\n 'queryFn'\n> & {\n queryFn?: Exclude<\n UseQueryOptions['queryFn'],\n SkipToken | undefined\n >\n}\n\nexport type DefinedInitialDataOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> = Omit, 'queryFn'> & {\n initialData:\n | NonUndefinedGuard\n | (() => NonUndefinedGuard)\n queryFn?: QueryFunction\n}\n\nexport function queryOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n options: DefinedInitialDataOptions,\n): DefinedInitialDataOptions & {\n queryKey: DataTag\n}\n\nexport function queryOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n options: UnusedSkipTokenOptions,\n): UnusedSkipTokenOptions & {\n queryKey: DataTag\n}\n\nexport function queryOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n options: UndefinedInitialDataOptions,\n): UndefinedInitialDataOptions & {\n queryKey: DataTag\n}\n\nexport function queryOptions(options: unknown) {\n return options\n}\n"],"mappings":";AAoFO,SAAS,aAAa,SAAkB;AAC7C,SAAO;AACT;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/suspense.cjs b/node_modules/@tanstack/react-query/build/legacy/suspense.cjs deleted file mode 100644 index d3745f0..0000000 --- a/node_modules/@tanstack/react-query/build/legacy/suspense.cjs +++ /dev/null @@ -1,58 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// src/suspense.ts -var suspense_exports = {}; -__export(suspense_exports, { - defaultThrowOnError: () => defaultThrowOnError, - ensureSuspenseTimers: () => ensureSuspenseTimers, - fetchOptimistic: () => fetchOptimistic, - shouldSuspend: () => shouldSuspend, - willFetch: () => willFetch -}); -module.exports = __toCommonJS(suspense_exports); -var defaultThrowOnError = (_error, query) => query.state.data === void 0; -var ensureSuspenseTimers = (defaultedOptions) => { - if (defaultedOptions.suspense) { - const MIN_SUSPENSE_TIME_MS = 1e3; - const clamp = (value) => value === "static" ? value : Math.max(value ?? MIN_SUSPENSE_TIME_MS, MIN_SUSPENSE_TIME_MS); - const originalStaleTime = defaultedOptions.staleTime; - defaultedOptions.staleTime = typeof originalStaleTime === "function" ? (...args) => clamp(originalStaleTime(...args)) : clamp(originalStaleTime); - if (typeof defaultedOptions.gcTime === "number") { - defaultedOptions.gcTime = Math.max( - defaultedOptions.gcTime, - MIN_SUSPENSE_TIME_MS - ); - } - } -}; -var willFetch = (result, isRestoring) => result.isLoading && result.isFetching && !isRestoring; -var shouldSuspend = (defaultedOptions, result) => (defaultedOptions == null ? void 0 : defaultedOptions.suspense) && result.isPending; -var fetchOptimistic = (defaultedOptions, observer, errorResetBoundary) => observer.fetchOptimistic(defaultedOptions).catch(() => { - errorResetBoundary.clearReset(); -}); -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - defaultThrowOnError, - ensureSuspenseTimers, - fetchOptimistic, - shouldSuspend, - willFetch -}); -//# sourceMappingURL=suspense.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/suspense.cjs.map b/node_modules/@tanstack/react-query/build/legacy/suspense.cjs.map deleted file mode 100644 index fdf2ecc..0000000 --- a/node_modules/@tanstack/react-query/build/legacy/suspense.cjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/suspense.ts"],"sourcesContent":["import type {\n DefaultError,\n DefaultedQueryObserverOptions,\n Query,\n QueryKey,\n QueryObserver,\n QueryObserverResult,\n} from '@tanstack/query-core'\nimport type { QueryErrorResetBoundaryValue } from './QueryErrorResetBoundary'\n\nexport const defaultThrowOnError = <\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n _error: TError,\n query: Query,\n) => query.state.data === undefined\n\nexport const ensureSuspenseTimers = (\n defaultedOptions: DefaultedQueryObserverOptions,\n) => {\n if (defaultedOptions.suspense) {\n // Handle staleTime to ensure minimum 1000ms in Suspense mode\n // This prevents unnecessary refetching when components remount after suspending\n const MIN_SUSPENSE_TIME_MS = 1000\n\n const clamp = (value: number | 'static' | undefined) =>\n value === 'static'\n ? value\n : Math.max(value ?? MIN_SUSPENSE_TIME_MS, MIN_SUSPENSE_TIME_MS)\n\n const originalStaleTime = defaultedOptions.staleTime\n defaultedOptions.staleTime =\n typeof originalStaleTime === 'function'\n ? (...args) => clamp(originalStaleTime(...args))\n : clamp(originalStaleTime)\n\n if (typeof defaultedOptions.gcTime === 'number') {\n defaultedOptions.gcTime = Math.max(\n defaultedOptions.gcTime,\n MIN_SUSPENSE_TIME_MS,\n )\n }\n }\n}\n\nexport const willFetch = (\n result: QueryObserverResult,\n isRestoring: boolean,\n) => result.isLoading && result.isFetching && !isRestoring\n\nexport const shouldSuspend = (\n defaultedOptions:\n | DefaultedQueryObserverOptions\n | undefined,\n result: QueryObserverResult,\n) => defaultedOptions?.suspense && result.isPending\n\nexport const fetchOptimistic = <\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey extends QueryKey,\n>(\n defaultedOptions: DefaultedQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >,\n observer: QueryObserver,\n errorResetBoundary: QueryErrorResetBoundaryValue,\n) =>\n observer.fetchOptimistic(defaultedOptions).catch(() => {\n errorResetBoundary.clearReset()\n })\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAUO,IAAM,sBAAsB,CAMjC,QACA,UACG,MAAM,MAAM,SAAS;AAEnB,IAAM,uBAAuB,CAClC,qBACG;AACH,MAAI,iBAAiB,UAAU;AAG7B,UAAM,uBAAuB;AAE7B,UAAM,QAAQ,CAAC,UACb,UAAU,WACN,QACA,KAAK,IAAI,SAAS,sBAAsB,oBAAoB;AAElE,UAAM,oBAAoB,iBAAiB;AAC3C,qBAAiB,YACf,OAAO,sBAAsB,aACzB,IAAI,SAAS,MAAM,kBAAkB,GAAG,IAAI,CAAC,IAC7C,MAAM,iBAAiB;AAE7B,QAAI,OAAO,iBAAiB,WAAW,UAAU;AAC/C,uBAAiB,SAAS,KAAK;AAAA,QAC7B,iBAAiB;AAAA,QACjB;AAAA,MACF;AAAA,IACF;AAAA,EACF;AACF;AAEO,IAAM,YAAY,CACvB,QACA,gBACG,OAAO,aAAa,OAAO,cAAc,CAAC;AAExC,IAAM,gBAAgB,CAC3B,kBAGA,YACG,qDAAkB,aAAY,OAAO;AAEnC,IAAM,kBAAkB,CAO7B,kBAOA,UACA,uBAEA,SAAS,gBAAgB,gBAAgB,EAAE,MAAM,MAAM;AACrD,qBAAmB,WAAW;AAChC,CAAC;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/suspense.d.cts b/node_modules/@tanstack/react-query/build/legacy/suspense.d.cts deleted file mode 100644 index da077db..0000000 --- a/node_modules/@tanstack/react-query/build/legacy/suspense.d.cts +++ /dev/null @@ -1,12 +0,0 @@ -import { DefaultError, QueryKey, Query, DefaultedQueryObserverOptions, QueryObserver, QueryObserverResult } from '@tanstack/query-core'; -import { QueryErrorResetBoundaryValue } from './QueryErrorResetBoundary.cjs'; -import 'react/jsx-runtime'; -import 'react'; - -declare const defaultThrowOnError: (_error: TError, query: Query) => boolean; -declare const ensureSuspenseTimers: (defaultedOptions: DefaultedQueryObserverOptions) => void; -declare const willFetch: (result: QueryObserverResult, isRestoring: boolean) => boolean; -declare const shouldSuspend: (defaultedOptions: DefaultedQueryObserverOptions | undefined, result: QueryObserverResult) => boolean | undefined; -declare const fetchOptimistic: (defaultedOptions: DefaultedQueryObserverOptions, observer: QueryObserver, errorResetBoundary: QueryErrorResetBoundaryValue) => Promise>; - -export { defaultThrowOnError, ensureSuspenseTimers, fetchOptimistic, shouldSuspend, willFetch }; diff --git a/node_modules/@tanstack/react-query/build/legacy/suspense.d.ts b/node_modules/@tanstack/react-query/build/legacy/suspense.d.ts deleted file mode 100644 index 954f1fb..0000000 --- a/node_modules/@tanstack/react-query/build/legacy/suspense.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { DefaultError, QueryKey, Query, DefaultedQueryObserverOptions, QueryObserver, QueryObserverResult } from '@tanstack/query-core'; -import { QueryErrorResetBoundaryValue } from './QueryErrorResetBoundary.js'; -import 'react/jsx-runtime'; -import 'react'; - -declare const defaultThrowOnError: (_error: TError, query: Query) => boolean; -declare const ensureSuspenseTimers: (defaultedOptions: DefaultedQueryObserverOptions) => void; -declare const willFetch: (result: QueryObserverResult, isRestoring: boolean) => boolean; -declare const shouldSuspend: (defaultedOptions: DefaultedQueryObserverOptions | undefined, result: QueryObserverResult) => boolean | undefined; -declare const fetchOptimistic: (defaultedOptions: DefaultedQueryObserverOptions, observer: QueryObserver, errorResetBoundary: QueryErrorResetBoundaryValue) => Promise>; - -export { defaultThrowOnError, ensureSuspenseTimers, fetchOptimistic, shouldSuspend, willFetch }; diff --git a/node_modules/@tanstack/react-query/build/legacy/suspense.js b/node_modules/@tanstack/react-query/build/legacy/suspense.js deleted file mode 100644 index c4efc02..0000000 --- a/node_modules/@tanstack/react-query/build/legacy/suspense.js +++ /dev/null @@ -1,29 +0,0 @@ -// src/suspense.ts -var defaultThrowOnError = (_error, query) => query.state.data === void 0; -var ensureSuspenseTimers = (defaultedOptions) => { - if (defaultedOptions.suspense) { - const MIN_SUSPENSE_TIME_MS = 1e3; - const clamp = (value) => value === "static" ? value : Math.max(value ?? MIN_SUSPENSE_TIME_MS, MIN_SUSPENSE_TIME_MS); - const originalStaleTime = defaultedOptions.staleTime; - defaultedOptions.staleTime = typeof originalStaleTime === "function" ? (...args) => clamp(originalStaleTime(...args)) : clamp(originalStaleTime); - if (typeof defaultedOptions.gcTime === "number") { - defaultedOptions.gcTime = Math.max( - defaultedOptions.gcTime, - MIN_SUSPENSE_TIME_MS - ); - } - } -}; -var willFetch = (result, isRestoring) => result.isLoading && result.isFetching && !isRestoring; -var shouldSuspend = (defaultedOptions, result) => (defaultedOptions == null ? void 0 : defaultedOptions.suspense) && result.isPending; -var fetchOptimistic = (defaultedOptions, observer, errorResetBoundary) => observer.fetchOptimistic(defaultedOptions).catch(() => { - errorResetBoundary.clearReset(); -}); -export { - defaultThrowOnError, - ensureSuspenseTimers, - fetchOptimistic, - shouldSuspend, - willFetch -}; -//# sourceMappingURL=suspense.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/suspense.js.map b/node_modules/@tanstack/react-query/build/legacy/suspense.js.map deleted file mode 100644 index c245b02..0000000 --- a/node_modules/@tanstack/react-query/build/legacy/suspense.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/suspense.ts"],"sourcesContent":["import type {\n DefaultError,\n DefaultedQueryObserverOptions,\n Query,\n QueryKey,\n QueryObserver,\n QueryObserverResult,\n} from '@tanstack/query-core'\nimport type { QueryErrorResetBoundaryValue } from './QueryErrorResetBoundary'\n\nexport const defaultThrowOnError = <\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n _error: TError,\n query: Query,\n) => query.state.data === undefined\n\nexport const ensureSuspenseTimers = (\n defaultedOptions: DefaultedQueryObserverOptions,\n) => {\n if (defaultedOptions.suspense) {\n // Handle staleTime to ensure minimum 1000ms in Suspense mode\n // This prevents unnecessary refetching when components remount after suspending\n const MIN_SUSPENSE_TIME_MS = 1000\n\n const clamp = (value: number | 'static' | undefined) =>\n value === 'static'\n ? value\n : Math.max(value ?? MIN_SUSPENSE_TIME_MS, MIN_SUSPENSE_TIME_MS)\n\n const originalStaleTime = defaultedOptions.staleTime\n defaultedOptions.staleTime =\n typeof originalStaleTime === 'function'\n ? (...args) => clamp(originalStaleTime(...args))\n : clamp(originalStaleTime)\n\n if (typeof defaultedOptions.gcTime === 'number') {\n defaultedOptions.gcTime = Math.max(\n defaultedOptions.gcTime,\n MIN_SUSPENSE_TIME_MS,\n )\n }\n }\n}\n\nexport const willFetch = (\n result: QueryObserverResult,\n isRestoring: boolean,\n) => result.isLoading && result.isFetching && !isRestoring\n\nexport const shouldSuspend = (\n defaultedOptions:\n | DefaultedQueryObserverOptions\n | undefined,\n result: QueryObserverResult,\n) => defaultedOptions?.suspense && result.isPending\n\nexport const fetchOptimistic = <\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey extends QueryKey,\n>(\n defaultedOptions: DefaultedQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >,\n observer: QueryObserver,\n errorResetBoundary: QueryErrorResetBoundaryValue,\n) =>\n observer.fetchOptimistic(defaultedOptions).catch(() => {\n errorResetBoundary.clearReset()\n })\n"],"mappings":";AAUO,IAAM,sBAAsB,CAMjC,QACA,UACG,MAAM,MAAM,SAAS;AAEnB,IAAM,uBAAuB,CAClC,qBACG;AACH,MAAI,iBAAiB,UAAU;AAG7B,UAAM,uBAAuB;AAE7B,UAAM,QAAQ,CAAC,UACb,UAAU,WACN,QACA,KAAK,IAAI,SAAS,sBAAsB,oBAAoB;AAElE,UAAM,oBAAoB,iBAAiB;AAC3C,qBAAiB,YACf,OAAO,sBAAsB,aACzB,IAAI,SAAS,MAAM,kBAAkB,GAAG,IAAI,CAAC,IAC7C,MAAM,iBAAiB;AAE7B,QAAI,OAAO,iBAAiB,WAAW,UAAU;AAC/C,uBAAiB,SAAS,KAAK;AAAA,QAC7B,iBAAiB;AAAA,QACjB;AAAA,MACF;AAAA,IACF;AAAA,EACF;AACF;AAEO,IAAM,YAAY,CACvB,QACA,gBACG,OAAO,aAAa,OAAO,cAAc,CAAC;AAExC,IAAM,gBAAgB,CAC3B,kBAGA,YACG,qDAAkB,aAAY,OAAO;AAEnC,IAAM,kBAAkB,CAO7B,kBAOA,UACA,uBAEA,SAAS,gBAAgB,gBAAgB,EAAE,MAAM,MAAM;AACrD,qBAAmB,WAAW;AAChC,CAAC;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/types.cjs b/node_modules/@tanstack/react-query/build/legacy/types.cjs deleted file mode 100644 index d22152b..0000000 --- a/node_modules/@tanstack/react-query/build/legacy/types.cjs +++ /dev/null @@ -1,19 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// src/types.ts -var types_exports = {}; -module.exports = __toCommonJS(types_exports); -//# sourceMappingURL=types.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/types.cjs.map b/node_modules/@tanstack/react-query/build/legacy/types.cjs.map deleted file mode 100644 index 3d02938..0000000 --- a/node_modules/@tanstack/react-query/build/legacy/types.cjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/types.ts"],"sourcesContent":["/* istanbul ignore file */\n\nimport type {\n DefaultError,\n DefinedInfiniteQueryObserverResult,\n DefinedQueryObserverResult,\n DistributiveOmit,\n FetchQueryOptions,\n InfiniteQueryObserverOptions,\n InfiniteQueryObserverResult,\n MutateFunction,\n MutationObserverOptions,\n MutationObserverResult,\n OmitKeyof,\n Override,\n QueryKey,\n QueryObserverOptions,\n QueryObserverResult,\n SkipToken,\n} from '@tanstack/query-core'\n\nexport type AnyUseBaseQueryOptions = UseBaseQueryOptions<\n any,\n any,\n any,\n any,\n any\n>\nexport interface UseBaseQueryOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> extends QueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n> {\n /**\n * Set this to `false` to unsubscribe this observer from updates to the query cache.\n * Defaults to `true`.\n */\n subscribed?: boolean\n}\n\nexport interface UsePrefetchQueryOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> extends OmitKeyof<\n FetchQueryOptions,\n 'queryFn'\n> {\n queryFn?: Exclude<\n FetchQueryOptions['queryFn'],\n SkipToken\n >\n}\n\nexport type AnyUseQueryOptions = UseQueryOptions\nexport interface UseQueryOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> extends OmitKeyof<\n UseBaseQueryOptions,\n 'suspense'\n> {}\n\nexport type AnyUseSuspenseQueryOptions = UseSuspenseQueryOptions<\n any,\n any,\n any,\n any\n>\nexport interface UseSuspenseQueryOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> extends OmitKeyof<\n UseQueryOptions,\n 'queryFn' | 'enabled' | 'throwOnError' | 'placeholderData'\n> {\n queryFn?: Exclude<\n UseQueryOptions['queryFn'],\n SkipToken\n >\n}\n\nexport type AnyUseInfiniteQueryOptions = UseInfiniteQueryOptions<\n any,\n any,\n any,\n any,\n any\n>\nexport interface UseInfiniteQueryOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n> extends OmitKeyof<\n InfiniteQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n 'suspense'\n> {\n /**\n * Set this to `false` to unsubscribe this observer from updates to the query cache.\n * Defaults to `true`.\n */\n subscribed?: boolean\n}\n\nexport type AnyUseSuspenseInfiniteQueryOptions =\n UseSuspenseInfiniteQueryOptions\nexport interface UseSuspenseInfiniteQueryOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n> extends OmitKeyof<\n UseInfiniteQueryOptions,\n 'queryFn' | 'enabled' | 'throwOnError' | 'placeholderData'\n> {\n queryFn?: Exclude<\n UseInfiniteQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >['queryFn'],\n SkipToken\n >\n}\n\nexport type UseBaseQueryResult<\n TData = unknown,\n TError = DefaultError,\n> = QueryObserverResult\n\nexport type UseQueryResult<\n TData = unknown,\n TError = DefaultError,\n> = UseBaseQueryResult\n\nexport type UseSuspenseQueryResult<\n TData = unknown,\n TError = DefaultError,\n> = DistributiveOmit<\n DefinedQueryObserverResult,\n 'isPlaceholderData' | 'promise'\n>\n\nexport type DefinedUseQueryResult<\n TData = unknown,\n TError = DefaultError,\n> = DefinedQueryObserverResult\n\nexport type UseInfiniteQueryResult<\n TData = unknown,\n TError = DefaultError,\n> = InfiniteQueryObserverResult\n\nexport type DefinedUseInfiniteQueryResult<\n TData = unknown,\n TError = DefaultError,\n> = DefinedInfiniteQueryObserverResult\n\nexport type UseSuspenseInfiniteQueryResult<\n TData = unknown,\n TError = DefaultError,\n> = OmitKeyof<\n DefinedInfiniteQueryObserverResult,\n 'isPlaceholderData' | 'promise'\n>\n\nexport type AnyUseMutationOptions = UseMutationOptions\nexport interface UseMutationOptions<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n> extends OmitKeyof<\n MutationObserverOptions,\n '_defaulted'\n> {}\n\nexport type UseMutateFunction<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n> = (\n ...args: Parameters<\n MutateFunction\n >\n) => void\n\nexport type UseMutateAsyncFunction<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n> = MutateFunction\n\nexport type UseBaseMutationResult<\n TData = unknown,\n TError = DefaultError,\n TVariables = unknown,\n TOnMutateResult = unknown,\n> = Override<\n MutationObserverResult,\n { mutate: UseMutateFunction }\n> & {\n mutateAsync: UseMutateAsyncFunction<\n TData,\n TError,\n TVariables,\n TOnMutateResult\n >\n}\n\nexport type UseMutationResult<\n TData = unknown,\n TError = DefaultError,\n TVariables = unknown,\n TOnMutateResult = unknown,\n> = UseBaseMutationResult\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/types.d.cts b/node_modules/@tanstack/react-query/build/legacy/types.d.cts deleted file mode 100644 index e9d55b2..0000000 --- a/node_modules/@tanstack/react-query/build/legacy/types.d.cts +++ /dev/null @@ -1,52 +0,0 @@ -import { DefaultError, QueryKey, QueryObserverOptions, OmitKeyof, InfiniteQueryObserverOptions, MutationObserverOptions, SkipToken, DefinedInfiniteQueryObserverResult, DefinedQueryObserverResult, QueryObserverResult, DistributiveOmit, Override, MutationObserverResult, MutateFunction, InfiniteQueryObserverResult, FetchQueryOptions } from '@tanstack/query-core'; - -type AnyUseBaseQueryOptions = UseBaseQueryOptions; -interface UseBaseQueryOptions extends QueryObserverOptions { - /** - * Set this to `false` to unsubscribe this observer from updates to the query cache. - * Defaults to `true`. - */ - subscribed?: boolean; -} -interface UsePrefetchQueryOptions extends OmitKeyof, 'queryFn'> { - queryFn?: Exclude['queryFn'], SkipToken>; -} -type AnyUseQueryOptions = UseQueryOptions; -interface UseQueryOptions extends OmitKeyof, 'suspense'> { -} -type AnyUseSuspenseQueryOptions = UseSuspenseQueryOptions; -interface UseSuspenseQueryOptions extends OmitKeyof, 'queryFn' | 'enabled' | 'throwOnError' | 'placeholderData'> { - queryFn?: Exclude['queryFn'], SkipToken>; -} -type AnyUseInfiniteQueryOptions = UseInfiniteQueryOptions; -interface UseInfiniteQueryOptions extends OmitKeyof, 'suspense'> { - /** - * Set this to `false` to unsubscribe this observer from updates to the query cache. - * Defaults to `true`. - */ - subscribed?: boolean; -} -type AnyUseSuspenseInfiniteQueryOptions = UseSuspenseInfiniteQueryOptions; -interface UseSuspenseInfiniteQueryOptions extends OmitKeyof, 'queryFn' | 'enabled' | 'throwOnError' | 'placeholderData'> { - queryFn?: Exclude['queryFn'], SkipToken>; -} -type UseBaseQueryResult = QueryObserverResult; -type UseQueryResult = UseBaseQueryResult; -type UseSuspenseQueryResult = DistributiveOmit, 'isPlaceholderData' | 'promise'>; -type DefinedUseQueryResult = DefinedQueryObserverResult; -type UseInfiniteQueryResult = InfiniteQueryObserverResult; -type DefinedUseInfiniteQueryResult = DefinedInfiniteQueryObserverResult; -type UseSuspenseInfiniteQueryResult = OmitKeyof, 'isPlaceholderData' | 'promise'>; -type AnyUseMutationOptions = UseMutationOptions; -interface UseMutationOptions extends OmitKeyof, '_defaulted'> { -} -type UseMutateFunction = (...args: Parameters>) => void; -type UseMutateAsyncFunction = MutateFunction; -type UseBaseMutationResult = Override, { - mutate: UseMutateFunction; -}> & { - mutateAsync: UseMutateAsyncFunction; -}; -type UseMutationResult = UseBaseMutationResult; - -export type { AnyUseBaseQueryOptions, AnyUseInfiniteQueryOptions, AnyUseMutationOptions, AnyUseQueryOptions, AnyUseSuspenseInfiniteQueryOptions, AnyUseSuspenseQueryOptions, DefinedUseInfiniteQueryResult, DefinedUseQueryResult, UseBaseMutationResult, UseBaseQueryOptions, UseBaseQueryResult, UseInfiniteQueryOptions, UseInfiniteQueryResult, UseMutateAsyncFunction, UseMutateFunction, UseMutationOptions, UseMutationResult, UsePrefetchQueryOptions, UseQueryOptions, UseQueryResult, UseSuspenseInfiniteQueryOptions, UseSuspenseInfiniteQueryResult, UseSuspenseQueryOptions, UseSuspenseQueryResult }; diff --git a/node_modules/@tanstack/react-query/build/legacy/types.d.ts b/node_modules/@tanstack/react-query/build/legacy/types.d.ts deleted file mode 100644 index e9d55b2..0000000 --- a/node_modules/@tanstack/react-query/build/legacy/types.d.ts +++ /dev/null @@ -1,52 +0,0 @@ -import { DefaultError, QueryKey, QueryObserverOptions, OmitKeyof, InfiniteQueryObserverOptions, MutationObserverOptions, SkipToken, DefinedInfiniteQueryObserverResult, DefinedQueryObserverResult, QueryObserverResult, DistributiveOmit, Override, MutationObserverResult, MutateFunction, InfiniteQueryObserverResult, FetchQueryOptions } from '@tanstack/query-core'; - -type AnyUseBaseQueryOptions = UseBaseQueryOptions; -interface UseBaseQueryOptions extends QueryObserverOptions { - /** - * Set this to `false` to unsubscribe this observer from updates to the query cache. - * Defaults to `true`. - */ - subscribed?: boolean; -} -interface UsePrefetchQueryOptions extends OmitKeyof, 'queryFn'> { - queryFn?: Exclude['queryFn'], SkipToken>; -} -type AnyUseQueryOptions = UseQueryOptions; -interface UseQueryOptions extends OmitKeyof, 'suspense'> { -} -type AnyUseSuspenseQueryOptions = UseSuspenseQueryOptions; -interface UseSuspenseQueryOptions extends OmitKeyof, 'queryFn' | 'enabled' | 'throwOnError' | 'placeholderData'> { - queryFn?: Exclude['queryFn'], SkipToken>; -} -type AnyUseInfiniteQueryOptions = UseInfiniteQueryOptions; -interface UseInfiniteQueryOptions extends OmitKeyof, 'suspense'> { - /** - * Set this to `false` to unsubscribe this observer from updates to the query cache. - * Defaults to `true`. - */ - subscribed?: boolean; -} -type AnyUseSuspenseInfiniteQueryOptions = UseSuspenseInfiniteQueryOptions; -interface UseSuspenseInfiniteQueryOptions extends OmitKeyof, 'queryFn' | 'enabled' | 'throwOnError' | 'placeholderData'> { - queryFn?: Exclude['queryFn'], SkipToken>; -} -type UseBaseQueryResult = QueryObserverResult; -type UseQueryResult = UseBaseQueryResult; -type UseSuspenseQueryResult = DistributiveOmit, 'isPlaceholderData' | 'promise'>; -type DefinedUseQueryResult = DefinedQueryObserverResult; -type UseInfiniteQueryResult = InfiniteQueryObserverResult; -type DefinedUseInfiniteQueryResult = DefinedInfiniteQueryObserverResult; -type UseSuspenseInfiniteQueryResult = OmitKeyof, 'isPlaceholderData' | 'promise'>; -type AnyUseMutationOptions = UseMutationOptions; -interface UseMutationOptions extends OmitKeyof, '_defaulted'> { -} -type UseMutateFunction = (...args: Parameters>) => void; -type UseMutateAsyncFunction = MutateFunction; -type UseBaseMutationResult = Override, { - mutate: UseMutateFunction; -}> & { - mutateAsync: UseMutateAsyncFunction; -}; -type UseMutationResult = UseBaseMutationResult; - -export type { AnyUseBaseQueryOptions, AnyUseInfiniteQueryOptions, AnyUseMutationOptions, AnyUseQueryOptions, AnyUseSuspenseInfiniteQueryOptions, AnyUseSuspenseQueryOptions, DefinedUseInfiniteQueryResult, DefinedUseQueryResult, UseBaseMutationResult, UseBaseQueryOptions, UseBaseQueryResult, UseInfiniteQueryOptions, UseInfiniteQueryResult, UseMutateAsyncFunction, UseMutateFunction, UseMutationOptions, UseMutationResult, UsePrefetchQueryOptions, UseQueryOptions, UseQueryResult, UseSuspenseInfiniteQueryOptions, UseSuspenseInfiniteQueryResult, UseSuspenseQueryOptions, UseSuspenseQueryResult }; diff --git a/node_modules/@tanstack/react-query/build/legacy/types.js b/node_modules/@tanstack/react-query/build/legacy/types.js deleted file mode 100644 index 5b2306a..0000000 --- a/node_modules/@tanstack/react-query/build/legacy/types.js +++ /dev/null @@ -1 +0,0 @@ -//# sourceMappingURL=types.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/types.js.map b/node_modules/@tanstack/react-query/build/legacy/types.js.map deleted file mode 100644 index 84c51b2..0000000 --- a/node_modules/@tanstack/react-query/build/legacy/types.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/useBaseQuery.cjs b/node_modules/@tanstack/react-query/build/legacy/useBaseQuery.cjs deleted file mode 100644 index a479f54..0000000 --- a/node_modules/@tanstack/react-query/build/legacy/useBaseQuery.cjs +++ /dev/null @@ -1,133 +0,0 @@ -"use strict"; -"use client"; -var __create = Object.create; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __getProtoOf = Object.getPrototypeOf; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( - // If the importer is in node compatibility mode or this is not an ESM - // file that has been converted to a CommonJS file using a Babel- - // compatible transform (i.e. "__esModule" has not been set), then set - // "default" to the CommonJS "module.exports" for node compatibility. - isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, - mod -)); -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// src/useBaseQuery.ts -var useBaseQuery_exports = {}; -__export(useBaseQuery_exports, { - useBaseQuery: () => useBaseQuery -}); -module.exports = __toCommonJS(useBaseQuery_exports); -var React = __toESM(require("react"), 1); -var import_query_core = require("@tanstack/query-core"); -var import_QueryClientProvider = require("./QueryClientProvider.cjs"); -var import_QueryErrorResetBoundary = require("./QueryErrorResetBoundary.cjs"); -var import_errorBoundaryUtils = require("./errorBoundaryUtils.cjs"); -var import_IsRestoringProvider = require("./IsRestoringProvider.cjs"); -var import_suspense = require("./suspense.cjs"); -function useBaseQuery(options, Observer, queryClient) { - var _a, _b, _c, _d; - if (process.env.NODE_ENV !== "production") { - if (typeof options !== "object" || Array.isArray(options)) { - throw new Error( - 'Bad argument type. Starting with v5, only the "Object" form is allowed when calling query related functions. Please use the error stack to find the culprit call. More info here: https://tanstack.com/query/latest/docs/react/guides/migrating-to-v5#supports-a-single-signature-one-object' - ); - } - } - const isRestoring = (0, import_IsRestoringProvider.useIsRestoring)(); - const errorResetBoundary = (0, import_QueryErrorResetBoundary.useQueryErrorResetBoundary)(); - const client = (0, import_QueryClientProvider.useQueryClient)(queryClient); - const defaultedOptions = client.defaultQueryOptions(options); - (_b = (_a = client.getDefaultOptions().queries) == null ? void 0 : _a._experimental_beforeQuery) == null ? void 0 : _b.call( - _a, - defaultedOptions - ); - const query = client.getQueryCache().get(defaultedOptions.queryHash); - if (process.env.NODE_ENV !== "production") { - if (!defaultedOptions.queryFn) { - console.error( - `[${defaultedOptions.queryHash}]: No queryFn was passed as an option, and no default queryFn was found. The queryFn parameter is only optional when using a default queryFn. More info here: https://tanstack.com/query/latest/docs/framework/react/guides/default-query-function` - ); - } - } - defaultedOptions._optimisticResults = isRestoring ? "isRestoring" : "optimistic"; - (0, import_suspense.ensureSuspenseTimers)(defaultedOptions); - (0, import_errorBoundaryUtils.ensurePreventErrorBoundaryRetry)(defaultedOptions, errorResetBoundary, query); - (0, import_errorBoundaryUtils.useClearResetErrorBoundary)(errorResetBoundary); - const isNewCacheEntry = !client.getQueryCache().get(defaultedOptions.queryHash); - const [observer] = React.useState( - () => new Observer( - client, - defaultedOptions - ) - ); - const result = observer.getOptimisticResult(defaultedOptions); - const shouldSubscribe = !isRestoring && options.subscribed !== false; - React.useSyncExternalStore( - React.useCallback( - (onStoreChange) => { - const unsubscribe = shouldSubscribe ? observer.subscribe(import_query_core.notifyManager.batchCalls(onStoreChange)) : import_query_core.noop; - observer.updateResult(); - return unsubscribe; - }, - [observer, shouldSubscribe] - ), - () => observer.getCurrentResult(), - () => observer.getCurrentResult() - ); - React.useEffect(() => { - observer.setOptions(defaultedOptions); - }, [defaultedOptions, observer]); - if ((0, import_suspense.shouldSuspend)(defaultedOptions, result)) { - throw (0, import_suspense.fetchOptimistic)(defaultedOptions, observer, errorResetBoundary); - } - if ((0, import_errorBoundaryUtils.getHasError)({ - result, - errorResetBoundary, - throwOnError: defaultedOptions.throwOnError, - query, - suspense: defaultedOptions.suspense - })) { - throw result.error; - } - ; - (_d = (_c = client.getDefaultOptions().queries) == null ? void 0 : _c._experimental_afterQuery) == null ? void 0 : _d.call( - _c, - defaultedOptions, - result - ); - if (defaultedOptions.experimental_prefetchInRender && !import_query_core.isServer && (0, import_suspense.willFetch)(result, isRestoring)) { - const promise = isNewCacheEntry ? ( - // Fetch immediately on render in order to ensure `.promise` is resolved even if the component is unmounted - (0, import_suspense.fetchOptimistic)(defaultedOptions, observer, errorResetBoundary) - ) : ( - // subscribe to the "cache promise" so that we can finalize the currentThenable once data comes in - query == null ? void 0 : query.promise - ); - promise == null ? void 0 : promise.catch(import_query_core.noop).finally(() => { - observer.updateResult(); - }); - } - return !defaultedOptions.notifyOnChangeProps ? observer.trackResult(result) : result; -} -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - useBaseQuery -}); -//# sourceMappingURL=useBaseQuery.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/useBaseQuery.cjs.map b/node_modules/@tanstack/react-query/build/legacy/useBaseQuery.cjs.map deleted file mode 100644 index 6380c13..0000000 --- a/node_modules/@tanstack/react-query/build/legacy/useBaseQuery.cjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/useBaseQuery.ts"],"sourcesContent":["'use client'\nimport * as React from 'react'\n\nimport { isServer, noop, notifyManager } from '@tanstack/query-core'\nimport { useQueryClient } from './QueryClientProvider'\nimport { useQueryErrorResetBoundary } from './QueryErrorResetBoundary'\nimport {\n ensurePreventErrorBoundaryRetry,\n getHasError,\n useClearResetErrorBoundary,\n} from './errorBoundaryUtils'\nimport { useIsRestoring } from './IsRestoringProvider'\nimport {\n ensureSuspenseTimers,\n fetchOptimistic,\n shouldSuspend,\n willFetch,\n} from './suspense'\nimport type {\n QueryClient,\n QueryKey,\n QueryObserver,\n QueryObserverResult,\n} from '@tanstack/query-core'\nimport type { UseBaseQueryOptions } from './types'\n\nexport function useBaseQuery<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey extends QueryKey,\n>(\n options: UseBaseQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >,\n Observer: typeof QueryObserver,\n queryClient?: QueryClient,\n): QueryObserverResult {\n if (process.env.NODE_ENV !== 'production') {\n if (typeof options !== 'object' || Array.isArray(options)) {\n throw new Error(\n 'Bad argument type. Starting with v5, only the \"Object\" form is allowed when calling query related functions. Please use the error stack to find the culprit call. More info here: https://tanstack.com/query/latest/docs/react/guides/migrating-to-v5#supports-a-single-signature-one-object',\n )\n }\n }\n\n const isRestoring = useIsRestoring()\n const errorResetBoundary = useQueryErrorResetBoundary()\n const client = useQueryClient(queryClient)\n const defaultedOptions = client.defaultQueryOptions(options)\n ;(client.getDefaultOptions().queries as any)?._experimental_beforeQuery?.(\n defaultedOptions,\n )\n\n const query = client\n .getQueryCache()\n .get<\n TQueryFnData,\n TError,\n TQueryData,\n TQueryKey\n >(defaultedOptions.queryHash)\n\n if (process.env.NODE_ENV !== 'production') {\n if (!defaultedOptions.queryFn) {\n console.error(\n `[${defaultedOptions.queryHash}]: No queryFn was passed as an option, and no default queryFn was found. The queryFn parameter is only optional when using a default queryFn. More info here: https://tanstack.com/query/latest/docs/framework/react/guides/default-query-function`,\n )\n }\n }\n\n // Make sure results are optimistically set in fetching state before subscribing or updating options\n defaultedOptions._optimisticResults = isRestoring\n ? 'isRestoring'\n : 'optimistic'\n\n ensureSuspenseTimers(defaultedOptions)\n ensurePreventErrorBoundaryRetry(defaultedOptions, errorResetBoundary, query)\n useClearResetErrorBoundary(errorResetBoundary)\n\n // this needs to be invoked before creating the Observer because that can create a cache entry\n const isNewCacheEntry = !client\n .getQueryCache()\n .get(defaultedOptions.queryHash)\n\n const [observer] = React.useState(\n () =>\n new Observer(\n client,\n defaultedOptions,\n ),\n )\n\n // note: this must be called before useSyncExternalStore\n const result = observer.getOptimisticResult(defaultedOptions)\n\n const shouldSubscribe = !isRestoring && options.subscribed !== false\n React.useSyncExternalStore(\n React.useCallback(\n (onStoreChange) => {\n const unsubscribe = shouldSubscribe\n ? observer.subscribe(notifyManager.batchCalls(onStoreChange))\n : noop\n\n // Update result to make sure we did not miss any query updates\n // between creating the observer and subscribing to it.\n observer.updateResult()\n\n return unsubscribe\n },\n [observer, shouldSubscribe],\n ),\n () => observer.getCurrentResult(),\n () => observer.getCurrentResult(),\n )\n\n React.useEffect(() => {\n observer.setOptions(defaultedOptions)\n }, [defaultedOptions, observer])\n\n // Handle suspense\n if (shouldSuspend(defaultedOptions, result)) {\n throw fetchOptimistic(defaultedOptions, observer, errorResetBoundary)\n }\n\n // Handle error boundary\n if (\n getHasError({\n result,\n errorResetBoundary,\n throwOnError: defaultedOptions.throwOnError,\n query,\n suspense: defaultedOptions.suspense,\n })\n ) {\n throw result.error\n }\n\n ;(client.getDefaultOptions().queries as any)?._experimental_afterQuery?.(\n defaultedOptions,\n result,\n )\n\n if (\n defaultedOptions.experimental_prefetchInRender &&\n !isServer &&\n willFetch(result, isRestoring)\n ) {\n const promise = isNewCacheEntry\n ? // Fetch immediately on render in order to ensure `.promise` is resolved even if the component is unmounted\n fetchOptimistic(defaultedOptions, observer, errorResetBoundary)\n : // subscribe to the \"cache promise\" so that we can finalize the currentThenable once data comes in\n query?.promise\n\n promise?.catch(noop).finally(() => {\n // `.updateResult()` will trigger `.#currentThenable` to finalize\n observer.updateResult()\n })\n }\n\n // Handle result property usage tracking\n return !defaultedOptions.notifyOnChangeProps\n ? observer.trackResult(result)\n : result\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,YAAuB;AAEvB,wBAA8C;AAC9C,iCAA+B;AAC/B,qCAA2C;AAC3C,gCAIO;AACP,iCAA+B;AAC/B,sBAKO;AASA,SAAS,aAOd,SAOA,UACA,aACoC;AA1CtC;AA2CE,MAAI,QAAQ,IAAI,aAAa,cA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W,gBAAgB;AAAA,EACtC,GAAG,CAAC,kBAAkB,QAAQ,CAAC;AAG/B,UAAI,+BAAc,kBAAkB,MAAM,GAAG;AAC3C,cAAM,iCAAgB,kBAAkB,UAAU,kBAAkB;AAAA,EACtE;AAGA,UACE,uCAAY;AAAA,IACV;AAAA,IACA;AAAA,IACA,cAAc,iBAAiB;AAAA,IAC/B;AAAA,IACA,UAAU,iBAAiB;AAAA,EAC7B,CAAC,GACD;AACA,UAAM,OAAO;AAAA,EACf;AAEA;AAAC,GAAC,kBAAO,kBAAkB,EAAE,YAA3B,mBAA4C,6BAA5C;AAAA;AAAA,IACA;AAAA,IACA;AAAA;AAGF,MACE,iBAAiB,iCACjB,CAAC,kCACD,2BAAU,QAAQ,WAAW,GAC7B;AACA,UAAM,UAAU;AAAA;AAAA,UAEZ,iCAAgB,kBAAkB,UAAU,kBAAkB;AAAA;AAAA;AAAA,MAE9D,+BAAO;AAAA;AAEX,uCAAS,MAAM,wBAAM,QAAQ,MAAM;AAEjC,eAAS,aAAa;AAAA,IACxB;AAAA,EACF;AAGA,SAAO,CAAC,iBAAiB,sBACrB,SAAS,YAAY,MAAM,IAC3B;AACN;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/useBaseQuery.d.cts b/node_modules/@tanstack/react-query/build/legacy/useBaseQuery.d.cts deleted file mode 100644 index baa8469..0000000 --- a/node_modules/@tanstack/react-query/build/legacy/useBaseQuery.d.cts +++ /dev/null @@ -1,6 +0,0 @@ -import { QueryKey, QueryObserver, QueryClient, QueryObserverResult } from '@tanstack/query-core'; -import { UseBaseQueryOptions } from './types.cjs'; - -declare function useBaseQuery(options: UseBaseQueryOptions, Observer: typeof QueryObserver, queryClient?: QueryClient): QueryObserverResult; - -export { useBaseQuery }; diff --git a/node_modules/@tanstack/react-query/build/legacy/useBaseQuery.d.ts b/node_modules/@tanstack/react-query/build/legacy/useBaseQuery.d.ts deleted file mode 100644 index 60430b0..0000000 --- a/node_modules/@tanstack/react-query/build/legacy/useBaseQuery.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { QueryKey, QueryObserver, QueryClient, QueryObserverResult } from '@tanstack/query-core'; -import { UseBaseQueryOptions } from './types.js'; - -declare function useBaseQuery(options: UseBaseQueryOptions, Observer: typeof QueryObserver, queryClient?: QueryClient): QueryObserverResult; - -export { useBaseQuery }; diff --git a/node_modules/@tanstack/react-query/build/legacy/useBaseQuery.js b/node_modules/@tanstack/react-query/build/legacy/useBaseQuery.js deleted file mode 100644 index d5c322c..0000000 --- a/node_modules/@tanstack/react-query/build/legacy/useBaseQuery.js +++ /dev/null @@ -1,108 +0,0 @@ -"use client"; - -// src/useBaseQuery.ts -import * as React from "react"; -import { isServer, noop, notifyManager } from "@tanstack/query-core"; -import { useQueryClient } from "./QueryClientProvider.js"; -import { useQueryErrorResetBoundary } from "./QueryErrorResetBoundary.js"; -import { - ensurePreventErrorBoundaryRetry, - getHasError, - useClearResetErrorBoundary -} from "./errorBoundaryUtils.js"; -import { useIsRestoring } from "./IsRestoringProvider.js"; -import { - ensureSuspenseTimers, - fetchOptimistic, - shouldSuspend, - willFetch -} from "./suspense.js"; -function useBaseQuery(options, Observer, queryClient) { - var _a, _b, _c, _d; - if (process.env.NODE_ENV !== "production") { - if (typeof options !== "object" || Array.isArray(options)) { - throw new Error( - 'Bad argument type. Starting with v5, only the "Object" form is allowed when calling query related functions. Please use the error stack to find the culprit call. More info here: https://tanstack.com/query/latest/docs/react/guides/migrating-to-v5#supports-a-single-signature-one-object' - ); - } - } - const isRestoring = useIsRestoring(); - const errorResetBoundary = useQueryErrorResetBoundary(); - const client = useQueryClient(queryClient); - const defaultedOptions = client.defaultQueryOptions(options); - (_b = (_a = client.getDefaultOptions().queries) == null ? void 0 : _a._experimental_beforeQuery) == null ? void 0 : _b.call( - _a, - defaultedOptions - ); - const query = client.getQueryCache().get(defaultedOptions.queryHash); - if (process.env.NODE_ENV !== "production") { - if (!defaultedOptions.queryFn) { - console.error( - `[${defaultedOptions.queryHash}]: No queryFn was passed as an option, and no default queryFn was found. The queryFn parameter is only optional when using a default queryFn. More info here: https://tanstack.com/query/latest/docs/framework/react/guides/default-query-function` - ); - } - } - defaultedOptions._optimisticResults = isRestoring ? "isRestoring" : "optimistic"; - ensureSuspenseTimers(defaultedOptions); - ensurePreventErrorBoundaryRetry(defaultedOptions, errorResetBoundary, query); - useClearResetErrorBoundary(errorResetBoundary); - const isNewCacheEntry = !client.getQueryCache().get(defaultedOptions.queryHash); - const [observer] = React.useState( - () => new Observer( - client, - defaultedOptions - ) - ); - const result = observer.getOptimisticResult(defaultedOptions); - const shouldSubscribe = !isRestoring && options.subscribed !== false; - React.useSyncExternalStore( - React.useCallback( - (onStoreChange) => { - const unsubscribe = shouldSubscribe ? observer.subscribe(notifyManager.batchCalls(onStoreChange)) : noop; - observer.updateResult(); - return unsubscribe; - }, - [observer, shouldSubscribe] - ), - () => observer.getCurrentResult(), - () => observer.getCurrentResult() - ); - React.useEffect(() => { - observer.setOptions(defaultedOptions); - }, [defaultedOptions, observer]); - if (shouldSuspend(defaultedOptions, result)) { - throw fetchOptimistic(defaultedOptions, observer, errorResetBoundary); - } - if (getHasError({ - result, - errorResetBoundary, - throwOnError: defaultedOptions.throwOnError, - query, - suspense: defaultedOptions.suspense - })) { - throw result.error; - } - ; - (_d = (_c = client.getDefaultOptions().queries) == null ? void 0 : _c._experimental_afterQuery) == null ? void 0 : _d.call( - _c, - defaultedOptions, - result - ); - if (defaultedOptions.experimental_prefetchInRender && !isServer && willFetch(result, isRestoring)) { - const promise = isNewCacheEntry ? ( - // Fetch immediately on render in order to ensure `.promise` is resolved even if the component is unmounted - fetchOptimistic(defaultedOptions, observer, errorResetBoundary) - ) : ( - // subscribe to the "cache promise" so that we can finalize the currentThenable once data comes in - query == null ? void 0 : query.promise - ); - promise == null ? void 0 : promise.catch(noop).finally(() => { - observer.updateResult(); - }); - } - return !defaultedOptions.notifyOnChangeProps ? observer.trackResult(result) : result; -} -export { - useBaseQuery -}; -//# sourceMappingURL=useBaseQuery.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/useBaseQuery.js.map b/node_modules/@tanstack/react-query/build/legacy/useBaseQuery.js.map deleted file mode 100644 index cd85130..0000000 --- a/node_modules/@tanstack/react-query/build/legacy/useBaseQuery.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/useBaseQuery.ts"],"sourcesContent":["'use client'\nimport * as React from 'react'\n\nimport { isServer, noop, notifyManager } from '@tanstack/query-core'\nimport { useQueryClient } from './QueryClientProvider'\nimport { useQueryErrorResetBoundary } from './QueryErrorResetBoundary'\nimport {\n ensurePreventErrorBoundaryRetry,\n getHasError,\n useClearResetErrorBoundary,\n} from './errorBoundaryUtils'\nimport { useIsRestoring } from './IsRestoringProvider'\nimport {\n ensureSuspenseTimers,\n fetchOptimistic,\n shouldSuspend,\n willFetch,\n} from './suspense'\nimport type {\n QueryClient,\n QueryKey,\n QueryObserver,\n QueryObserverResult,\n} from '@tanstack/query-core'\nimport type { UseBaseQueryOptions } from './types'\n\nexport function useBaseQuery<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey extends QueryKey,\n>(\n options: UseBaseQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >,\n Observer: typeof QueryObserver,\n queryClient?: QueryClient,\n): QueryObserverResult {\n if (process.env.NODE_ENV !== 'production') {\n if (typeof options !== 'object' || Array.isArray(options)) {\n throw new Error(\n 'Bad argument type. Starting with v5, only the \"Object\" form is allowed when calling query related functions. Please use the error stack to find the culprit call. More info here: https://tanstack.com/query/latest/docs/react/guides/migrating-to-v5#supports-a-single-signature-one-object',\n )\n }\n }\n\n const isRestoring = useIsRestoring()\n const errorResetBoundary = useQueryErrorResetBoundary()\n const client = useQueryClient(queryClient)\n const defaultedOptions = client.defaultQueryOptions(options)\n ;(client.getDefaultOptions().queries as any)?._experimental_beforeQuery?.(\n defaultedOptions,\n )\n\n const query = client\n .getQueryCache()\n .get<\n TQueryFnData,\n TError,\n TQueryData,\n TQueryKey\n >(defaultedOptions.queryHash)\n\n if (process.env.NODE_ENV !== 'production') {\n if (!defaultedOptions.queryFn) {\n console.error(\n `[${defaultedOptions.queryHash}]: No queryFn was passed as an option, and no default queryFn was found. The queryFn parameter is only optional when using a default queryFn. More info here: https://tanstack.com/query/latest/docs/framework/react/guides/default-query-function`,\n )\n }\n }\n\n // Make sure results are optimistically set in fetching state before subscribing or updating options\n defaultedOptions._optimisticResults = isRestoring\n ? 'isRestoring'\n : 'optimistic'\n\n ensureSuspenseTimers(defaultedOptions)\n ensurePreventErrorBoundaryRetry(defaultedOptions, errorResetBoundary, query)\n useClearResetErrorBoundary(errorResetBoundary)\n\n // this needs to be invoked before creating the Observer because that can create a cache entry\n const isNewCacheEntry = !client\n .getQueryCache()\n .get(defaultedOptions.queryHash)\n\n const [observer] = React.useState(\n () =>\n new Observer(\n client,\n defaultedOptions,\n ),\n )\n\n // note: this must be called before useSyncExternalStore\n const result = observer.getOptimisticResult(defaultedOptions)\n\n const shouldSubscribe = !isRestoring && options.subscribed !== false\n React.useSyncExternalStore(\n React.useCallback(\n (onStoreChange) => {\n const unsubscribe = shouldSubscribe\n ? observer.subscribe(notifyManager.batchCalls(onStoreChange))\n : noop\n\n // Update result to make sure we did not miss any query updates\n // between creating the observer and subscribing to it.\n observer.updateResult()\n\n return unsubscribe\n },\n [observer, shouldSubscribe],\n ),\n () => observer.getCurrentResult(),\n () => observer.getCurrentResult(),\n )\n\n React.useEffect(() => {\n observer.setOptions(defaultedOptions)\n }, [defaultedOptions, observer])\n\n // Handle suspense\n if (shouldSuspend(defaultedOptions, result)) {\n throw fetchOptimistic(defaultedOptions, observer, errorResetBoundary)\n }\n\n // Handle error boundary\n if (\n getHasError({\n result,\n errorResetBoundary,\n throwOnError: defaultedOptions.throwOnError,\n query,\n suspense: defaultedOptions.suspense,\n })\n ) {\n throw result.error\n }\n\n ;(client.getDefaultOptions().queries as any)?._experimental_afterQuery?.(\n defaultedOptions,\n result,\n )\n\n if (\n defaultedOptions.experimental_prefetchInRender &&\n !isServer &&\n willFetch(result, isRestoring)\n ) {\n const promise = isNewCacheEntry\n ? // Fetch immediately on render in order to ensure `.promise` is resolved even if the component is unmounted\n fetchOptimistic(defaultedOptions, observer, errorResetBoundary)\n : // subscribe to the \"cache promise\" so that we can finalize the currentThenable once data comes in\n query?.promise\n\n promise?.catch(noop).finally(() => {\n // `.updateResult()` will trigger `.#currentThenable` to finalize\n observer.updateResult()\n })\n }\n\n // Handle result property usage tracking\n return !defaultedOptions.notifyOnChangeProps\n ? observer.trackResult(result)\n : result\n}\n"],"mappings":";;;AACA,YAAY,WAAW;AAEvB,SAAS,UAAU,MAAM,qBAAqB;AAC9C,SAAS,sBAAsB;AAC/B,SAAS,kCAAkC;AAC3C;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,sBAAsB;AAC/B;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AASA,SAAS,aAOd,SAOA,UACA,aACoC;AA1CtC;AA2CE,MAAI,QAAQ,IAAI,aAAa,cAAc;AACzC,QAAI,OAAO,YAAY,YAAY,MAAM,QAAQ,OAAO,GAAG;AACzD,YAAM,IAAI;AAAA,QACR;AAAA,MACF;AAAA,IACF;AAAA,EACF;AAEA,QAAM,cAAc,eAAe;AACnC,QAAM,qBAAqB,2BAA2B;AACtD,QAAM,SAAS,eAAe,WAAW;AACzC,QAAM,mBAAmB,OAAO,oBAAoB,OAAO;AAC1D,GAAC,kBAAO,kBAAkB,EAAE,YAA3B,mBAA4C,8BAA5C;AAAA;AAAA,IACA;AAAA;AAGF,QAAM,QAAQ,OACX,cAAc,EACd,IAKC,iBAAiB,SAAS;AAE9B,MAAI,QAAQ,IAAI,aAAa,cAAc;AACzC,QAAI,CAAC,iBAAiB,SAAS;AAC7B,cAAQ;AAAA,QACN,IAAI,iBAAiB,SAAS;AAAA,MACh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kBAAkB,UAAU,kBAAkB;AAAA;AAAA;AAAA,MAE9D,+BAAO;AAAA;AAEX,uCAAS,MAAM,MAAM,QAAQ,MAAM;AAEjC,eAAS,aAAa;AAAA,IACxB;AAAA,EACF;AAGA,SAAO,CAAC,iBAAiB,sBACrB,SAAS,YAAY,MAAM,IAC3B;AACN;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/useInfiniteQuery.cjs b/node_modules/@tanstack/react-query/build/legacy/useInfiniteQuery.cjs deleted file mode 100644 index e1ae216..0000000 --- a/node_modules/@tanstack/react-query/build/legacy/useInfiniteQuery.cjs +++ /dev/null @@ -1,40 +0,0 @@ -"use strict"; -"use client"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// src/useInfiniteQuery.ts -var useInfiniteQuery_exports = {}; -__export(useInfiniteQuery_exports, { - useInfiniteQuery: () => useInfiniteQuery -}); -module.exports = __toCommonJS(useInfiniteQuery_exports); -var import_query_core = require("@tanstack/query-core"); -var import_useBaseQuery = require("./useBaseQuery.cjs"); -function useInfiniteQuery(options, queryClient) { - return (0, import_useBaseQuery.useBaseQuery)( - options, - import_query_core.InfiniteQueryObserver, - queryClient - ); -} -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - useInfiniteQuery -}); -//# sourceMappingURL=useInfiniteQuery.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/useInfiniteQuery.cjs.map b/node_modules/@tanstack/react-query/build/legacy/useInfiniteQuery.cjs.map deleted file mode 100644 index 66c4cc1..0000000 --- a/node_modules/@tanstack/react-query/build/legacy/useInfiniteQuery.cjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/useInfiniteQuery.ts"],"sourcesContent":["'use client'\nimport { InfiniteQueryObserver } from '@tanstack/query-core'\nimport { useBaseQuery } from './useBaseQuery'\nimport type {\n DefaultError,\n InfiniteData,\n QueryClient,\n QueryKey,\n QueryObserver,\n} from '@tanstack/query-core'\nimport type {\n DefinedUseInfiniteQueryResult,\n UseInfiniteQueryOptions,\n UseInfiniteQueryResult,\n} from './types'\nimport type {\n DefinedInitialDataInfiniteOptions,\n UndefinedInitialDataInfiniteOptions,\n} from './infiniteQueryOptions'\n\nexport function useInfiniteQuery<\n TQueryFnData,\n TError = DefaultError,\n TData = InfiniteData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n>(\n options: DefinedInitialDataInfiniteOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n queryClient?: QueryClient,\n): DefinedUseInfiniteQueryResult\n\nexport function useInfiniteQuery<\n TQueryFnData,\n TError = DefaultError,\n TData = InfiniteData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n>(\n options: UndefinedInitialDataInfiniteOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n queryClient?: QueryClient,\n): UseInfiniteQueryResult\n\nexport function useInfiniteQuery<\n TQueryFnData,\n TError = DefaultError,\n TData = InfiniteData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n>(\n options: UseInfiniteQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n queryClient?: QueryClient,\n): UseInfiniteQueryResult\n\nexport function useInfiniteQuery(\n options: UseInfiniteQueryOptions,\n queryClient?: QueryClient,\n) {\n return useBaseQuery(\n options,\n InfiniteQueryObserver as typeof QueryObserver,\n queryClient,\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,wBAAsC;AACtC,0BAA6B;AAqEtB,SAAS,iBACd,SACA,aACA;AACA,aAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/useInfiniteQuery.d.cts b/node_modules/@tanstack/react-query/build/legacy/useInfiniteQuery.d.cts deleted file mode 100644 index 8401170..0000000 --- a/node_modules/@tanstack/react-query/build/legacy/useInfiniteQuery.d.cts +++ /dev/null @@ -1,9 +0,0 @@ -import { DefaultError, InfiniteData, QueryKey, QueryClient } from '@tanstack/query-core'; -import { DefinedUseInfiniteQueryResult, UseInfiniteQueryResult, UseInfiniteQueryOptions } from './types.cjs'; -import { DefinedInitialDataInfiniteOptions, UndefinedInitialDataInfiniteOptions } from './infiniteQueryOptions.cjs'; - -declare function useInfiniteQuery, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown>(options: DefinedInitialDataInfiniteOptions, queryClient?: QueryClient): DefinedUseInfiniteQueryResult; -declare function useInfiniteQuery, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown>(options: UndefinedInitialDataInfiniteOptions, queryClient?: QueryClient): UseInfiniteQueryResult; -declare function useInfiniteQuery, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown>(options: UseInfiniteQueryOptions, queryClient?: QueryClient): UseInfiniteQueryResult; - -export { useInfiniteQuery }; diff --git a/node_modules/@tanstack/react-query/build/legacy/useInfiniteQuery.d.ts b/node_modules/@tanstack/react-query/build/legacy/useInfiniteQuery.d.ts deleted file mode 100644 index 47bb383..0000000 --- a/node_modules/@tanstack/react-query/build/legacy/useInfiniteQuery.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { DefaultError, InfiniteData, QueryKey, QueryClient } from '@tanstack/query-core'; -import { DefinedUseInfiniteQueryResult, UseInfiniteQueryResult, UseInfiniteQueryOptions } from './types.js'; -import { DefinedInitialDataInfiniteOptions, UndefinedInitialDataInfiniteOptions } from './infiniteQueryOptions.js'; - -declare function useInfiniteQuery, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown>(options: DefinedInitialDataInfiniteOptions, queryClient?: QueryClient): DefinedUseInfiniteQueryResult; -declare function useInfiniteQuery, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown>(options: UndefinedInitialDataInfiniteOptions, queryClient?: QueryClient): UseInfiniteQueryResult; -declare function useInfiniteQuery, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown>(options: UseInfiniteQueryOptions, queryClient?: QueryClient): UseInfiniteQueryResult; - -export { useInfiniteQuery }; diff --git a/node_modules/@tanstack/react-query/build/legacy/useInfiniteQuery.js b/node_modules/@tanstack/react-query/build/legacy/useInfiniteQuery.js deleted file mode 100644 index 2e32e08..0000000 --- a/node_modules/@tanstack/react-query/build/legacy/useInfiniteQuery.js +++ /dev/null @@ -1,16 +0,0 @@ -"use client"; - -// src/useInfiniteQuery.ts -import { InfiniteQueryObserver } from "@tanstack/query-core"; -import { useBaseQuery } from "./useBaseQuery.js"; -function useInfiniteQuery(options, queryClient) { - return useBaseQuery( - options, - InfiniteQueryObserver, - queryClient - ); -} -export { - useInfiniteQuery -}; -//# sourceMappingURL=useInfiniteQuery.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/useInfiniteQuery.js.map b/node_modules/@tanstack/react-query/build/legacy/useInfiniteQuery.js.map deleted file mode 100644 index 4b2fbe4..0000000 --- a/node_modules/@tanstack/react-query/build/legacy/useInfiniteQuery.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/useInfiniteQuery.ts"],"sourcesContent":["'use client'\nimport { InfiniteQueryObserver } from '@tanstack/query-core'\nimport { useBaseQuery } from './useBaseQuery'\nimport type {\n DefaultError,\n InfiniteData,\n QueryClient,\n QueryKey,\n QueryObserver,\n} from '@tanstack/query-core'\nimport type {\n DefinedUseInfiniteQueryResult,\n UseInfiniteQueryOptions,\n UseInfiniteQueryResult,\n} from './types'\nimport type {\n DefinedInitialDataInfiniteOptions,\n UndefinedInitialDataInfiniteOptions,\n} from './infiniteQueryOptions'\n\nexport function useInfiniteQuery<\n TQueryFnData,\n TError = DefaultError,\n TData = InfiniteData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n>(\n options: DefinedInitialDataInfiniteOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n queryClient?: QueryClient,\n): DefinedUseInfiniteQueryResult\n\nexport function useInfiniteQuery<\n TQueryFnData,\n TError = DefaultError,\n TData = InfiniteData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n>(\n options: UndefinedInitialDataInfiniteOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n queryClient?: QueryClient,\n): UseInfiniteQueryResult\n\nexport function useInfiniteQuery<\n TQueryFnData,\n TError = DefaultError,\n TData = InfiniteData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n>(\n options: UseInfiniteQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n queryClient?: QueryClient,\n): UseInfiniteQueryResult\n\nexport function useInfiniteQuery(\n options: UseInfiniteQueryOptions,\n queryClient?: QueryClient,\n) {\n return useBaseQuery(\n options,\n InfiniteQueryObserver as typeof QueryObserver,\n queryClient,\n )\n}\n"],"mappings":";;;AACA,SAAS,6BAA6B;AACtC,SAAS,oBAAoB;AAqEtB,SAAS,iBACd,SACA,aACA;AACA,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/useIsFetching.cjs b/node_modules/@tanstack/react-query/build/legacy/useIsFetching.cjs deleted file mode 100644 index 28660e7..0000000 --- a/node_modules/@tanstack/react-query/build/legacy/useIsFetching.cjs +++ /dev/null @@ -1,56 +0,0 @@ -"use strict"; -"use client"; -var __create = Object.create; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __getProtoOf = Object.getPrototypeOf; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( - // If the importer is in node compatibility mode or this is not an ESM - // file that has been converted to a CommonJS file using a Babel- - // compatible transform (i.e. "__esModule" has not been set), then set - // "default" to the CommonJS "module.exports" for node compatibility. - isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, - mod -)); -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// src/useIsFetching.ts -var useIsFetching_exports = {}; -__export(useIsFetching_exports, { - useIsFetching: () => useIsFetching -}); -module.exports = __toCommonJS(useIsFetching_exports); -var React = __toESM(require("react"), 1); -var import_query_core = require("@tanstack/query-core"); -var import_QueryClientProvider = require("./QueryClientProvider.cjs"); -function useIsFetching(filters, queryClient) { - const client = (0, import_QueryClientProvider.useQueryClient)(queryClient); - const queryCache = client.getQueryCache(); - return React.useSyncExternalStore( - React.useCallback( - (onStoreChange) => queryCache.subscribe(import_query_core.notifyManager.batchCalls(onStoreChange)), - [queryCache] - ), - () => client.isFetching(filters), - () => client.isFetching(filters) - ); -} -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - useIsFetching -}); -//# sourceMappingURL=useIsFetching.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/useIsFetching.cjs.map b/node_modules/@tanstack/react-query/build/legacy/useIsFetching.cjs.map deleted file mode 100644 index 5a58e86..0000000 --- a/node_modules/@tanstack/react-query/build/legacy/useIsFetching.cjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/useIsFetching.ts"],"sourcesContent":["'use client'\nimport * as React from 'react'\nimport { notifyManager } from '@tanstack/query-core'\n\nimport { useQueryClient } from './QueryClientProvider'\nimport type { QueryClient, QueryFilters } from '@tanstack/query-core'\n\nexport function useIsFetching(\n filters?: QueryFilters,\n queryClient?: QueryClient,\n): number {\n const client = useQueryClient(queryClient)\n const queryCache = client.getQueryCache()\n\n return React.useSyncExternalStore(\n React.useCallback(\n (onStoreChange) =>\n queryCache.subscribe(notifyManager.batchCalls(onStoreChange)),\n [queryCache],\n ),\n () => client.isFetching(filters),\n () => client.isFetching(filters),\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,YAAuB;AACvB,wBAA8B;AAE9B,iCAA+B;AAGxB,SAAS,cACd,SACA,aACQ;AACR,QAAM,aAAS,2CAAe,WAAW;AACzC,QAAM,aAAa,OAAO,cAAc;AAExC,SAAa;AAAA,IACL;AAAA,MACJ,CAAC,kBACC,WAAW,UAAU,gCAAc,WAAW,aAAa,CAAC;AAAA,MAC9D,CAAC,UAAU;AAAA,IACb;AAAA,IACA,MAAM,OAAO,WAAW,OAAO;AAAA,IAC/B,MAAM,OAAO,WAAW,OAAO;AAAA,EACjC;AACF;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/useIsFetching.d.cts b/node_modules/@tanstack/react-query/build/legacy/useIsFetching.d.cts deleted file mode 100644 index 832d33f..0000000 --- a/node_modules/@tanstack/react-query/build/legacy/useIsFetching.d.cts +++ /dev/null @@ -1,5 +0,0 @@ -import { QueryFilters, QueryClient } from '@tanstack/query-core'; - -declare function useIsFetching(filters?: QueryFilters, queryClient?: QueryClient): number; - -export { useIsFetching }; diff --git a/node_modules/@tanstack/react-query/build/legacy/useIsFetching.d.ts b/node_modules/@tanstack/react-query/build/legacy/useIsFetching.d.ts deleted file mode 100644 index 832d33f..0000000 --- a/node_modules/@tanstack/react-query/build/legacy/useIsFetching.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { QueryFilters, QueryClient } from '@tanstack/query-core'; - -declare function useIsFetching(filters?: QueryFilters, queryClient?: QueryClient): number; - -export { useIsFetching }; diff --git a/node_modules/@tanstack/react-query/build/legacy/useIsFetching.js b/node_modules/@tanstack/react-query/build/legacy/useIsFetching.js deleted file mode 100644 index acfc67a..0000000 --- a/node_modules/@tanstack/react-query/build/legacy/useIsFetching.js +++ /dev/null @@ -1,22 +0,0 @@ -"use client"; - -// src/useIsFetching.ts -import * as React from "react"; -import { notifyManager } from "@tanstack/query-core"; -import { useQueryClient } from "./QueryClientProvider.js"; -function useIsFetching(filters, queryClient) { - const client = useQueryClient(queryClient); - const queryCache = client.getQueryCache(); - return React.useSyncExternalStore( - React.useCallback( - (onStoreChange) => queryCache.subscribe(notifyManager.batchCalls(onStoreChange)), - [queryCache] - ), - () => client.isFetching(filters), - () => client.isFetching(filters) - ); -} -export { - useIsFetching -}; -//# sourceMappingURL=useIsFetching.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/useIsFetching.js.map b/node_modules/@tanstack/react-query/build/legacy/useIsFetching.js.map deleted file mode 100644 index 9921ab6..0000000 --- a/node_modules/@tanstack/react-query/build/legacy/useIsFetching.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/useIsFetching.ts"],"sourcesContent":["'use client'\nimport * as React from 'react'\nimport { notifyManager } from '@tanstack/query-core'\n\nimport { useQueryClient } from './QueryClientProvider'\nimport type { QueryClient, QueryFilters } from '@tanstack/query-core'\n\nexport function useIsFetching(\n filters?: QueryFilters,\n queryClient?: QueryClient,\n): number {\n const client = useQueryClient(queryClient)\n const queryCache = client.getQueryCache()\n\n return React.useSyncExternalStore(\n React.useCallback(\n (onStoreChange) =>\n queryCache.subscribe(notifyManager.batchCalls(onStoreChange)),\n [queryCache],\n ),\n () => client.isFetching(filters),\n () => client.isFetching(filters),\n )\n}\n"],"mappings":";;;AACA,YAAY,WAAW;AACvB,SAAS,qBAAqB;AAE9B,SAAS,sBAAsB;AAGxB,SAAS,cACd,SACA,aACQ;AACR,QAAM,SAAS,eAAe,WAAW;AACzC,QAAM,aAAa,OAAO,cAAc;AAExC,SAAa;AAAA,IACL;AAAA,MACJ,CAAC,kBACC,WAAW,UAAU,cAAc,WAAW,aAAa,CAAC;AAAA,MAC9D,CAAC,UAAU;AAAA,IACb;AAAA,IACA,MAAM,OAAO,WAAW,OAAO;AAAA,IAC/B,MAAM,OAAO,WAAW,OAAO;AAAA,EACjC;AACF;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/useMutation.cjs b/node_modules/@tanstack/react-query/build/legacy/useMutation.cjs deleted file mode 100644 index 2ae4221..0000000 --- a/node_modules/@tanstack/react-query/build/legacy/useMutation.cjs +++ /dev/null @@ -1,74 +0,0 @@ -"use strict"; -"use client"; -var __create = Object.create; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __getProtoOf = Object.getPrototypeOf; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( - // If the importer is in node compatibility mode or this is not an ESM - // file that has been converted to a CommonJS file using a Babel- - // compatible transform (i.e. "__esModule" has not been set), then set - // "default" to the CommonJS "module.exports" for node compatibility. - isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, - mod -)); -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// src/useMutation.ts -var useMutation_exports = {}; -__export(useMutation_exports, { - useMutation: () => useMutation -}); -module.exports = __toCommonJS(useMutation_exports); -var React = __toESM(require("react"), 1); -var import_query_core = require("@tanstack/query-core"); -var import_QueryClientProvider = require("./QueryClientProvider.cjs"); -function useMutation(options, queryClient) { - const client = (0, import_QueryClientProvider.useQueryClient)(queryClient); - const [observer] = React.useState( - () => new import_query_core.MutationObserver( - client, - options - ) - ); - React.useEffect(() => { - observer.setOptions(options); - }, [observer, options]); - const result = React.useSyncExternalStore( - React.useCallback( - (onStoreChange) => observer.subscribe(import_query_core.notifyManager.batchCalls(onStoreChange)), - [observer] - ), - () => observer.getCurrentResult(), - () => observer.getCurrentResult() - ); - const mutate = React.useCallback( - (variables, mutateOptions) => { - observer.mutate(variables, mutateOptions).catch(import_query_core.noop); - }, - [observer] - ); - if (result.error && (0, import_query_core.shouldThrowError)(observer.options.throwOnError, [result.error])) { - throw result.error; - } - return { ...result, mutate, mutateAsync: result.mutate }; -} -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - useMutation -}); -//# sourceMappingURL=useMutation.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/useMutation.cjs.map b/node_modules/@tanstack/react-query/build/legacy/useMutation.cjs.map deleted file mode 100644 index 23c4d2e..0000000 --- a/node_modules/@tanstack/react-query/build/legacy/useMutation.cjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/useMutation.ts"],"sourcesContent":["'use client'\nimport * as React from 'react'\nimport {\n MutationObserver,\n noop,\n notifyManager,\n shouldThrowError,\n} from '@tanstack/query-core'\nimport { useQueryClient } from './QueryClientProvider'\nimport type {\n UseMutateFunction,\n UseMutationOptions,\n UseMutationResult,\n} from './types'\nimport type { DefaultError, QueryClient } from '@tanstack/query-core'\n\n// HOOK\n\nexport function useMutation<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n>(\n options: UseMutationOptions,\n queryClient?: QueryClient,\n): UseMutationResult {\n const client = useQueryClient(queryClient)\n\n const [observer] = React.useState(\n () =>\n new MutationObserver(\n client,\n options,\n ),\n )\n\n React.useEffect(() => {\n observer.setOptions(options)\n }, [observer, options])\n\n const result = React.useSyncExternalStore(\n React.useCallback(\n (onStoreChange) =>\n observer.subscribe(notifyManager.batchCalls(onStoreChange)),\n [observer],\n ),\n () => observer.getCurrentResult(),\n () => observer.getCurrentResult(),\n )\n\n const mutate = React.useCallback<\n UseMutateFunction\n >(\n (variables, mutateOptions) => {\n observer.mutate(variables, mutateOptions).catch(noop)\n },\n [observer],\n )\n\n if (\n result.error &&\n shouldThrowError(observer.options.throwOnError, [result.error])\n ) {\n throw result.error\n }\n\n return { ...result, mutate, mutateAsync: result.mutate }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,YAAuB;AACvB,wBAKO;AACP,iCAA+B;AAUxB,SAAS,YAMd,SACA,aAC+D;AAC/D,QAAM,aAAS,2CAAe,WAAW;AAEzC,QAAM,CAAC,QAAQ,IAAU;AAAA,IACvB,MACE,IAAI;AAAA,MACF;AAAA,MACA;AAAA,IACF;AAAA,EACJ;AAEA,EAAM,gBAAU,MAAM;AACpB,aAAS,WAAW,OAAO;AAAA,EAC7B,GAAG,CAAC,UAAU,OAAO,CAAC;AAEtB,QAAM,SAAe;AAAA,IACb;AAAA,MACJ,CAAC,kBACC,SAAS,UAAU,gCAAc,WAAW,aAAa,CAAC;AAAA,MAC5D,CAAC,QAAQ;AAAA,IACX;AAAA,IACA,MAAM,SAAS,iBAAiB;AAAA,IAChC,MAAM,SAAS,iBAAiB;AAAA,EAClC;AAEA,QAAM,SAAe;AAAA,IAGnB,CAAC,WAAW,kBAAkB;AAC5B,eAAS,OAAO,WAAW,aAAa,EAAE,MAAM,sBAAI;AAAA,IACtD;AAAA,IACA,CAAC,QAAQ;AAAA,EACX;AAEA,MACE,OAAO,aACP,oCAAiB,SAAS,QAAQ,cAAc,CAAC,OAAO,KAAK,CAAC,GAC9D;AACA,UAAM,OAAO;AAAA,EACf;AAEA,SAAO,EAAE,GAAG,QAAQ,QAAQ,aAAa,OAAO,OAAO;AACzD;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/useMutation.d.cts b/node_modules/@tanstack/react-query/build/legacy/useMutation.d.cts deleted file mode 100644 index 09102dd..0000000 --- a/node_modules/@tanstack/react-query/build/legacy/useMutation.d.cts +++ /dev/null @@ -1,6 +0,0 @@ -import { UseMutationOptions, UseMutationResult } from './types.cjs'; -import { DefaultError, QueryClient } from '@tanstack/query-core'; - -declare function useMutation(options: UseMutationOptions, queryClient?: QueryClient): UseMutationResult; - -export { useMutation }; diff --git a/node_modules/@tanstack/react-query/build/legacy/useMutation.d.ts b/node_modules/@tanstack/react-query/build/legacy/useMutation.d.ts deleted file mode 100644 index 0f29460..0000000 --- a/node_modules/@tanstack/react-query/build/legacy/useMutation.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { UseMutationOptions, UseMutationResult } from './types.js'; -import { DefaultError, QueryClient } from '@tanstack/query-core'; - -declare function useMutation(options: UseMutationOptions, queryClient?: QueryClient): UseMutationResult; - -export { useMutation }; diff --git a/node_modules/@tanstack/react-query/build/legacy/useMutation.js b/node_modules/@tanstack/react-query/build/legacy/useMutation.js deleted file mode 100644 index 8e089c4..0000000 --- a/node_modules/@tanstack/react-query/build/legacy/useMutation.js +++ /dev/null @@ -1,45 +0,0 @@ -"use client"; - -// src/useMutation.ts -import * as React from "react"; -import { - MutationObserver, - noop, - notifyManager, - shouldThrowError -} from "@tanstack/query-core"; -import { useQueryClient } from "./QueryClientProvider.js"; -function useMutation(options, queryClient) { - const client = useQueryClient(queryClient); - const [observer] = React.useState( - () => new MutationObserver( - client, - options - ) - ); - React.useEffect(() => { - observer.setOptions(options); - }, [observer, options]); - const result = React.useSyncExternalStore( - React.useCallback( - (onStoreChange) => observer.subscribe(notifyManager.batchCalls(onStoreChange)), - [observer] - ), - () => observer.getCurrentResult(), - () => observer.getCurrentResult() - ); - const mutate = React.useCallback( - (variables, mutateOptions) => { - observer.mutate(variables, mutateOptions).catch(noop); - }, - [observer] - ); - if (result.error && shouldThrowError(observer.options.throwOnError, [result.error])) { - throw result.error; - } - return { ...result, mutate, mutateAsync: result.mutate }; -} -export { - useMutation -}; -//# sourceMappingURL=useMutation.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/useMutation.js.map b/node_modules/@tanstack/react-query/build/legacy/useMutation.js.map deleted file mode 100644 index 0df164b..0000000 --- a/node_modules/@tanstack/react-query/build/legacy/useMutation.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/useMutation.ts"],"sourcesContent":["'use client'\nimport * as React from 'react'\nimport {\n MutationObserver,\n noop,\n notifyManager,\n shouldThrowError,\n} from '@tanstack/query-core'\nimport { useQueryClient } from './QueryClientProvider'\nimport type {\n UseMutateFunction,\n UseMutationOptions,\n UseMutationResult,\n} from './types'\nimport type { DefaultError, QueryClient } from '@tanstack/query-core'\n\n// HOOK\n\nexport function useMutation<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n>(\n options: UseMutationOptions,\n queryClient?: QueryClient,\n): UseMutationResult {\n const client = useQueryClient(queryClient)\n\n const [observer] = React.useState(\n () =>\n new MutationObserver(\n client,\n options,\n ),\n )\n\n React.useEffect(() => {\n observer.setOptions(options)\n }, [observer, options])\n\n const result = React.useSyncExternalStore(\n React.useCallback(\n (onStoreChange) =>\n observer.subscribe(notifyManager.batchCalls(onStoreChange)),\n [observer],\n ),\n () => observer.getCurrentResult(),\n () => observer.getCurrentResult(),\n )\n\n const mutate = React.useCallback<\n UseMutateFunction\n >(\n (variables, mutateOptions) => {\n observer.mutate(variables, mutateOptions).catch(noop)\n },\n [observer],\n )\n\n if (\n result.error &&\n shouldThrowError(observer.options.throwOnError, [result.error])\n ) {\n throw result.error\n }\n\n return { ...result, mutate, mutateAsync: result.mutate }\n}\n"],"mappings":";;;AACA,YAAY,WAAW;AACvB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,sBAAsB;AAUxB,SAAS,YAMd,SACA,aAC+D;AAC/D,QAAM,SAAS,eAAe,WAAW;AAEzC,QAAM,CAAC,QAAQ,IAAU;AAAA,IACvB,MACE,IAAI;AAAA,MACF;AAAA,MACA;AAAA,IACF;AAAA,EACJ;AAEA,EAAM,gBAAU,MAAM;AACpB,aAAS,WAAW,OAAO;AAAA,EAC7B,GAAG,CAAC,UAAU,OAAO,CAAC;AAEtB,QAAM,SAAe;AAAA,IACb;AAAA,MACJ,CAAC,kBACC,SAAS,UAAU,cAAc,WAAW,aAAa,CAAC;AAAA,MAC5D,CAAC,QAAQ;AAAA,IACX;AAAA,IACA,MAAM,SAAS,iBAAiB;AAAA,IAChC,MAAM,SAAS,iBAAiB;AAAA,EAClC;AAEA,QAAM,SAAe;AAAA,IAGnB,CAAC,WAAW,kBAAkB;AAC5B,eAAS,OAAO,WAAW,aAAa,EAAE,MAAM,IAAI;AAAA,IACtD;AAAA,IACA,CAAC,QAAQ;AAAA,EACX;AAEA,MACE,OAAO,SACP,iBAAiB,SAAS,QAAQ,cAAc,CAAC,OAAO,KAAK,CAAC,GAC9D;AACA,UAAM,OAAO;AAAA,EACf;AAEA,SAAO,EAAE,GAAG,QAAQ,QAAQ,aAAa,OAAO,OAAO;AACzD;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/useMutationState.cjs b/node_modules/@tanstack/react-query/build/legacy/useMutationState.cjs deleted file mode 100644 index b256e68..0000000 --- a/node_modules/@tanstack/react-query/build/legacy/useMutationState.cjs +++ /dev/null @@ -1,86 +0,0 @@ -"use strict"; -"use client"; -var __create = Object.create; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __getProtoOf = Object.getPrototypeOf; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( - // If the importer is in node compatibility mode or this is not an ESM - // file that has been converted to a CommonJS file using a Babel- - // compatible transform (i.e. "__esModule" has not been set), then set - // "default" to the CommonJS "module.exports" for node compatibility. - isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, - mod -)); -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// src/useMutationState.ts -var useMutationState_exports = {}; -__export(useMutationState_exports, { - useIsMutating: () => useIsMutating, - useMutationState: () => useMutationState -}); -module.exports = __toCommonJS(useMutationState_exports); -var React = __toESM(require("react"), 1); -var import_query_core = require("@tanstack/query-core"); -var import_QueryClientProvider = require("./QueryClientProvider.cjs"); -function useIsMutating(filters, queryClient) { - const client = (0, import_QueryClientProvider.useQueryClient)(queryClient); - return useMutationState( - { filters: { ...filters, status: "pending" } }, - client - ).length; -} -function getResult(mutationCache, options) { - return mutationCache.findAll(options.filters).map( - (mutation) => options.select ? options.select(mutation) : mutation.state - ); -} -function useMutationState(options = {}, queryClient) { - const mutationCache = (0, import_QueryClientProvider.useQueryClient)(queryClient).getMutationCache(); - const optionsRef = React.useRef(options); - const result = React.useRef(null); - if (result.current === null) { - result.current = getResult(mutationCache, options); - } - React.useEffect(() => { - optionsRef.current = options; - }); - return React.useSyncExternalStore( - React.useCallback( - (onStoreChange) => mutationCache.subscribe(() => { - const nextResult = (0, import_query_core.replaceEqualDeep)( - result.current, - getResult(mutationCache, optionsRef.current) - ); - if (result.current !== nextResult) { - result.current = nextResult; - import_query_core.notifyManager.schedule(onStoreChange); - } - }), - [mutationCache] - ), - () => result.current, - () => result.current - ); -} -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - useIsMutating, - useMutationState -}); -//# sourceMappingURL=useMutationState.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/useMutationState.cjs.map b/node_modules/@tanstack/react-query/build/legacy/useMutationState.cjs.map deleted file mode 100644 index b43a480..0000000 --- a/node_modules/@tanstack/react-query/build/legacy/useMutationState.cjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/useMutationState.ts"],"sourcesContent":["'use client'\nimport * as React from 'react'\n\nimport { notifyManager, replaceEqualDeep } from '@tanstack/query-core'\nimport { useQueryClient } from './QueryClientProvider'\nimport type {\n Mutation,\n MutationCache,\n MutationFilters,\n MutationState,\n QueryClient,\n} from '@tanstack/query-core'\n\nexport function useIsMutating(\n filters?: MutationFilters,\n queryClient?: QueryClient,\n): number {\n const client = useQueryClient(queryClient)\n return useMutationState(\n { filters: { ...filters, status: 'pending' } },\n client,\n ).length\n}\n\ntype MutationStateOptions = {\n filters?: MutationFilters\n select?: (mutation: Mutation) => TResult\n}\n\nfunction getResult(\n mutationCache: MutationCache,\n options: MutationStateOptions,\n): Array {\n return mutationCache\n .findAll(options.filters)\n .map(\n (mutation): TResult =>\n (options.select ? options.select(mutation) : mutation.state) as TResult,\n )\n}\n\nexport function useMutationState(\n options: MutationStateOptions = {},\n queryClient?: QueryClient,\n): Array {\n const mutationCache = useQueryClient(queryClient).getMutationCache()\n const optionsRef = React.useRef(options)\n const result = React.useRef>(null)\n if (result.current === null) {\n result.current = getResult(mutationCache, options)\n }\n\n React.useEffect(() => {\n optionsRef.current = options\n })\n\n return React.useSyncExternalStore(\n React.useCallback(\n (onStoreChange) =>\n mutationCache.subscribe(() => {\n const nextResult = replaceEqualDeep(\n result.current,\n getResult(mutationCache, optionsRef.current),\n )\n if (result.current !== nextResult) {\n result.current = nextResult\n notifyManager.schedule(onStoreChange)\n }\n }),\n [mutationCache],\n ),\n () => result.current,\n () => result.current,\n )!\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,YAAuB;AAEvB,wBAAgD;AAChD,iCAA+B;AASxB,SAAS,cACd,SACA,aACQ;AACR,QAAM,aAAS,2CAAe,WAAW;AACzC,SAAO;AAAA,IACL,EAAE,SAAS,EAAE,GAAG,SAAS,QAAQ,UAAU,EAAE;AAAA,IAC7C;AAAA,EACF,EAAE;AACJ;AAOA,SAAS,UACP,eACA,SACgB;AAChB,SAAO,cACJ,QAAQ,QAAQ,OAAO,EACvB;AAAA,IACC,CAAC,aACE,QAAQ,SAAS,QAAQ,OAAO,QAAQ,IAAI,SAAS;AAAA,EAC1D;AACJ;AAEO,SAAS,iBACd,UAAyC,CAAC,GAC1C,aACgB;AAChB,QAAM,oBAAgB,2CAAe,WAAW,EAAE,iBAAiB;AACnE,QAAM,aAAmB,aAAO,OAAO;AACvC,QAAM,SAAe,aAAuB,IAAI;AAChD,MAAI,OAAO,YAAY,MAAM;AAC3B,WAAO,UAAU,UAAU,eAAe,OAAO;AAAA,EACnD;AAEA,EAAM,gBAAU,MAAM;AACpB,eAAW,UAAU;AAAA,EACvB,CAAC;AAED,SAAa;AAAA,IACL;AAAA,MACJ,CAAC,kBACC,cAAc,UAAU,MAAM;AAC5B,cAAM,iBAAa;AAAA,UACjB,OAAO;AAAA,UACP,UAAU,eAAe,WAAW,OAAO;AAAA,QAC7C;AACA,YAAI,OAAO,YAAY,YAAY;AACjC,iBAAO,UAAU;AACjB,0CAAc,SAAS,aAAa;AAAA,QACtC;AAAA,MACF,CAAC;AAAA,MACH,CAAC,aAAa;AAAA,IAChB;AAAA,IACA,MAAM,OAAO;AAAA,IACb,MAAM,OAAO;AAAA,EACf;AACF;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/useMutationState.d.cts b/node_modules/@tanstack/react-query/build/legacy/useMutationState.d.cts deleted file mode 100644 index 6f35037..0000000 --- a/node_modules/@tanstack/react-query/build/legacy/useMutationState.d.cts +++ /dev/null @@ -1,10 +0,0 @@ -import { MutationFilters, QueryClient, MutationState, Mutation } from '@tanstack/query-core'; - -declare function useIsMutating(filters?: MutationFilters, queryClient?: QueryClient): number; -type MutationStateOptions = { - filters?: MutationFilters; - select?: (mutation: Mutation) => TResult; -}; -declare function useMutationState(options?: MutationStateOptions, queryClient?: QueryClient): Array; - -export { useIsMutating, useMutationState }; diff --git a/node_modules/@tanstack/react-query/build/legacy/useMutationState.d.ts b/node_modules/@tanstack/react-query/build/legacy/useMutationState.d.ts deleted file mode 100644 index 6f35037..0000000 --- a/node_modules/@tanstack/react-query/build/legacy/useMutationState.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { MutationFilters, QueryClient, MutationState, Mutation } from '@tanstack/query-core'; - -declare function useIsMutating(filters?: MutationFilters, queryClient?: QueryClient): number; -type MutationStateOptions = { - filters?: MutationFilters; - select?: (mutation: Mutation) => TResult; -}; -declare function useMutationState(options?: MutationStateOptions, queryClient?: QueryClient): Array; - -export { useIsMutating, useMutationState }; diff --git a/node_modules/@tanstack/react-query/build/legacy/useMutationState.js b/node_modules/@tanstack/react-query/build/legacy/useMutationState.js deleted file mode 100644 index aa22350..0000000 --- a/node_modules/@tanstack/react-query/build/legacy/useMutationState.js +++ /dev/null @@ -1,51 +0,0 @@ -"use client"; - -// src/useMutationState.ts -import * as React from "react"; -import { notifyManager, replaceEqualDeep } from "@tanstack/query-core"; -import { useQueryClient } from "./QueryClientProvider.js"; -function useIsMutating(filters, queryClient) { - const client = useQueryClient(queryClient); - return useMutationState( - { filters: { ...filters, status: "pending" } }, - client - ).length; -} -function getResult(mutationCache, options) { - return mutationCache.findAll(options.filters).map( - (mutation) => options.select ? options.select(mutation) : mutation.state - ); -} -function useMutationState(options = {}, queryClient) { - const mutationCache = useQueryClient(queryClient).getMutationCache(); - const optionsRef = React.useRef(options); - const result = React.useRef(null); - if (result.current === null) { - result.current = getResult(mutationCache, options); - } - React.useEffect(() => { - optionsRef.current = options; - }); - return React.useSyncExternalStore( - React.useCallback( - (onStoreChange) => mutationCache.subscribe(() => { - const nextResult = replaceEqualDeep( - result.current, - getResult(mutationCache, optionsRef.current) - ); - if (result.current !== nextResult) { - result.current = nextResult; - notifyManager.schedule(onStoreChange); - } - }), - [mutationCache] - ), - () => result.current, - () => result.current - ); -} -export { - useIsMutating, - useMutationState -}; -//# sourceMappingURL=useMutationState.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/useMutationState.js.map b/node_modules/@tanstack/react-query/build/legacy/useMutationState.js.map deleted file mode 100644 index 399a5a1..0000000 --- a/node_modules/@tanstack/react-query/build/legacy/useMutationState.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/useMutationState.ts"],"sourcesContent":["'use client'\nimport * as React from 'react'\n\nimport { notifyManager, replaceEqualDeep } from '@tanstack/query-core'\nimport { useQueryClient } from './QueryClientProvider'\nimport type {\n Mutation,\n MutationCache,\n MutationFilters,\n MutationState,\n QueryClient,\n} from '@tanstack/query-core'\n\nexport function useIsMutating(\n filters?: MutationFilters,\n queryClient?: QueryClient,\n): number {\n const client = useQueryClient(queryClient)\n return useMutationState(\n { filters: { ...filters, status: 'pending' } },\n client,\n ).length\n}\n\ntype MutationStateOptions = {\n filters?: MutationFilters\n select?: (mutation: Mutation) => TResult\n}\n\nfunction getResult(\n mutationCache: MutationCache,\n options: MutationStateOptions,\n): Array {\n return mutationCache\n .findAll(options.filters)\n .map(\n (mutation): TResult =>\n (options.select ? options.select(mutation) : mutation.state) as TResult,\n )\n}\n\nexport function useMutationState(\n options: MutationStateOptions = {},\n queryClient?: QueryClient,\n): Array {\n const mutationCache = useQueryClient(queryClient).getMutationCache()\n const optionsRef = React.useRef(options)\n const result = React.useRef>(null)\n if (result.current === null) {\n result.current = getResult(mutationCache, options)\n }\n\n React.useEffect(() => {\n optionsRef.current = options\n })\n\n return React.useSyncExternalStore(\n React.useCallback(\n (onStoreChange) =>\n mutationCache.subscribe(() => {\n const nextResult = replaceEqualDeep(\n result.current,\n getResult(mutationCache, optionsRef.current),\n )\n if (result.current !== nextResult) {\n result.current = nextResult\n notifyManager.schedule(onStoreChange)\n }\n }),\n [mutationCache],\n ),\n () => result.current,\n () => result.current,\n )!\n}\n"],"mappings":";;;AACA,YAAY,WAAW;AAEvB,SAAS,eAAe,wBAAwB;AAChD,SAAS,sBAAsB;AASxB,SAAS,cACd,SACA,aACQ;AACR,QAAM,SAAS,eAAe,WAAW;AACzC,SAAO;AAAA,IACL,EAAE,SAAS,EAAE,GAAG,SAAS,QAAQ,UAAU,EAAE;AAAA,IAC7C;AAAA,EACF,EAAE;AACJ;AAOA,SAAS,UACP,eACA,SACgB;AAChB,SAAO,cACJ,QAAQ,QAAQ,OAAO,EACvB;AAAA,IACC,CAAC,aACE,QAAQ,SAAS,QAAQ,OAAO,QAAQ,IAAI,SAAS;AAAA,EAC1D;AACJ;AAEO,SAAS,iBACd,UAAyC,CAAC,GAC1C,aACgB;AAChB,QAAM,gBAAgB,eAAe,WAAW,EAAE,iBAAiB;AACnE,QAAM,aAAmB,aAAO,OAAO;AACvC,QAAM,SAAe,aAAuB,IAAI;AAChD,MAAI,OAAO,YAAY,MAAM;AAC3B,WAAO,UAAU,UAAU,eAAe,OAAO;AAAA,EACnD;AAEA,EAAM,gBAAU,MAAM;AACpB,eAAW,UAAU;AAAA,EACvB,CAAC;AAED,SAAa;AAAA,IACL;AAAA,MACJ,CAAC,kBACC,cAAc,UAAU,MAAM;AAC5B,cAAM,aAAa;AAAA,UACjB,OAAO;AAAA,UACP,UAAU,eAAe,WAAW,OAAO;AAAA,QAC7C;AACA,YAAI,OAAO,YAAY,YAAY;AACjC,iBAAO,UAAU;AACjB,wBAAc,SAAS,aAAa;AAAA,QACtC;AAAA,MACF,CAAC;AAAA,MACH,CAAC,aAAa;AAAA,IAChB;AAAA,IACA,MAAM,OAAO;AAAA,IACb,MAAM,OAAO;AAAA,EACf;AACF;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/usePrefetchInfiniteQuery.cjs b/node_modules/@tanstack/react-query/build/legacy/usePrefetchInfiniteQuery.cjs deleted file mode 100644 index 9148196..0000000 --- a/node_modules/@tanstack/react-query/build/legacy/usePrefetchInfiniteQuery.cjs +++ /dev/null @@ -1,37 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// src/usePrefetchInfiniteQuery.tsx -var usePrefetchInfiniteQuery_exports = {}; -__export(usePrefetchInfiniteQuery_exports, { - usePrefetchInfiniteQuery: () => usePrefetchInfiniteQuery -}); -module.exports = __toCommonJS(usePrefetchInfiniteQuery_exports); -var import_QueryClientProvider = require("./QueryClientProvider.cjs"); -function usePrefetchInfiniteQuery(options, queryClient) { - const client = (0, import_QueryClientProvider.useQueryClient)(queryClient); - if (!client.getQueryState(options.queryKey)) { - client.prefetchInfiniteQuery(options); - } -} -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - usePrefetchInfiniteQuery -}); -//# sourceMappingURL=usePrefetchInfiniteQuery.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/usePrefetchInfiniteQuery.cjs.map b/node_modules/@tanstack/react-query/build/legacy/usePrefetchInfiniteQuery.cjs.map deleted file mode 100644 index e912e76..0000000 --- a/node_modules/@tanstack/react-query/build/legacy/usePrefetchInfiniteQuery.cjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/usePrefetchInfiniteQuery.tsx"],"sourcesContent":["import { useQueryClient } from './QueryClientProvider'\nimport type {\n DefaultError,\n FetchInfiniteQueryOptions,\n QueryClient,\n QueryKey,\n} from '@tanstack/query-core'\n\nexport function usePrefetchInfiniteQuery<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n>(\n options: FetchInfiniteQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n queryClient?: QueryClient,\n) {\n const client = useQueryClient(queryClient)\n\n if (!client.getQueryState(options.queryKey)) {\n client.prefetchInfiniteQuery(options)\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,iCAA+B;AAQxB,SAAS,yBAOd,SAOA,aACA;AACA,QAAM,aAAS,2CAAe,WAAW;AAEzC,MAAI,CAAC,OAAO,cAAc,QAAQ,QAAQ,GAAG;AAC3C,WAAO,sBAAsB,OAAO;AAAA,EACtC;AACF;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/usePrefetchInfiniteQuery.d.cts b/node_modules/@tanstack/react-query/build/legacy/usePrefetchInfiniteQuery.d.cts deleted file mode 100644 index aeba2f8..0000000 --- a/node_modules/@tanstack/react-query/build/legacy/usePrefetchInfiniteQuery.d.cts +++ /dev/null @@ -1,5 +0,0 @@ -import { DefaultError, QueryKey, FetchInfiniteQueryOptions, QueryClient } from '@tanstack/query-core'; - -declare function usePrefetchInfiniteQuery(options: FetchInfiniteQueryOptions, queryClient?: QueryClient): void; - -export { usePrefetchInfiniteQuery }; diff --git a/node_modules/@tanstack/react-query/build/legacy/usePrefetchInfiniteQuery.d.ts b/node_modules/@tanstack/react-query/build/legacy/usePrefetchInfiniteQuery.d.ts deleted file mode 100644 index aeba2f8..0000000 --- a/node_modules/@tanstack/react-query/build/legacy/usePrefetchInfiniteQuery.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { DefaultError, QueryKey, FetchInfiniteQueryOptions, QueryClient } from '@tanstack/query-core'; - -declare function usePrefetchInfiniteQuery(options: FetchInfiniteQueryOptions, queryClient?: QueryClient): void; - -export { usePrefetchInfiniteQuery }; diff --git a/node_modules/@tanstack/react-query/build/legacy/usePrefetchInfiniteQuery.js b/node_modules/@tanstack/react-query/build/legacy/usePrefetchInfiniteQuery.js deleted file mode 100644 index bce85f3..0000000 --- a/node_modules/@tanstack/react-query/build/legacy/usePrefetchInfiniteQuery.js +++ /dev/null @@ -1,12 +0,0 @@ -// src/usePrefetchInfiniteQuery.tsx -import { useQueryClient } from "./QueryClientProvider.js"; -function usePrefetchInfiniteQuery(options, queryClient) { - const client = useQueryClient(queryClient); - if (!client.getQueryState(options.queryKey)) { - client.prefetchInfiniteQuery(options); - } -} -export { - usePrefetchInfiniteQuery -}; -//# sourceMappingURL=usePrefetchInfiniteQuery.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/usePrefetchInfiniteQuery.js.map b/node_modules/@tanstack/react-query/build/legacy/usePrefetchInfiniteQuery.js.map deleted file mode 100644 index 20e3042..0000000 --- a/node_modules/@tanstack/react-query/build/legacy/usePrefetchInfiniteQuery.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/usePrefetchInfiniteQuery.tsx"],"sourcesContent":["import { useQueryClient } from './QueryClientProvider'\nimport type {\n DefaultError,\n FetchInfiniteQueryOptions,\n QueryClient,\n QueryKey,\n} from '@tanstack/query-core'\n\nexport function usePrefetchInfiniteQuery<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n>(\n options: FetchInfiniteQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n queryClient?: QueryClient,\n) {\n const client = useQueryClient(queryClient)\n\n if (!client.getQueryState(options.queryKey)) {\n client.prefetchInfiniteQuery(options)\n }\n}\n"],"mappings":";AAAA,SAAS,sBAAsB;AAQxB,SAAS,yBAOd,SAOA,aACA;AACA,QAAM,SAAS,eAAe,WAAW;AAEzC,MAAI,CAAC,OAAO,cAAc,QAAQ,QAAQ,GAAG;AAC3C,WAAO,sBAAsB,OAAO;AAAA,EACtC;AACF;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/usePrefetchQuery.cjs b/node_modules/@tanstack/react-query/build/legacy/usePrefetchQuery.cjs deleted file mode 100644 index a884e0f..0000000 --- a/node_modules/@tanstack/react-query/build/legacy/usePrefetchQuery.cjs +++ /dev/null @@ -1,37 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// src/usePrefetchQuery.tsx -var usePrefetchQuery_exports = {}; -__export(usePrefetchQuery_exports, { - usePrefetchQuery: () => usePrefetchQuery -}); -module.exports = __toCommonJS(usePrefetchQuery_exports); -var import_QueryClientProvider = require("./QueryClientProvider.cjs"); -function usePrefetchQuery(options, queryClient) { - const client = (0, import_QueryClientProvider.useQueryClient)(queryClient); - if (!client.getQueryState(options.queryKey)) { - client.prefetchQuery(options); - } -} -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - usePrefetchQuery -}); -//# sourceMappingURL=usePrefetchQuery.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/usePrefetchQuery.cjs.map b/node_modules/@tanstack/react-query/build/legacy/usePrefetchQuery.cjs.map deleted file mode 100644 index c5571bb..0000000 --- a/node_modules/@tanstack/react-query/build/legacy/usePrefetchQuery.cjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/usePrefetchQuery.tsx"],"sourcesContent":["import { useQueryClient } from './QueryClientProvider'\nimport type { DefaultError, QueryClient, QueryKey } from '@tanstack/query-core'\nimport type { UsePrefetchQueryOptions } from './types'\n\nexport function usePrefetchQuery<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n options: UsePrefetchQueryOptions,\n queryClient?: QueryClient,\n) {\n const client = useQueryClient(queryClient)\n\n if (!client.getQueryState(options.queryKey)) {\n client.prefetchQuery(options)\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,iCAA+B;AAIxB,SAAS,iBAMd,SACA,aACA;AACA,QAAM,aAAS,2CAAe,WAAW;AAEzC,MAAI,CAAC,OAAO,cAAc,QAAQ,QAAQ,GAAG;AAC3C,WAAO,cAAc,OAAO;AAAA,EAC9B;AACF;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/usePrefetchQuery.d.cts b/node_modules/@tanstack/react-query/build/legacy/usePrefetchQuery.d.cts deleted file mode 100644 index 714b71d..0000000 --- a/node_modules/@tanstack/react-query/build/legacy/usePrefetchQuery.d.cts +++ /dev/null @@ -1,6 +0,0 @@ -import { DefaultError, QueryKey, QueryClient } from '@tanstack/query-core'; -import { UsePrefetchQueryOptions } from './types.cjs'; - -declare function usePrefetchQuery(options: UsePrefetchQueryOptions, queryClient?: QueryClient): void; - -export { usePrefetchQuery }; diff --git a/node_modules/@tanstack/react-query/build/legacy/usePrefetchQuery.d.ts b/node_modules/@tanstack/react-query/build/legacy/usePrefetchQuery.d.ts deleted file mode 100644 index 12589eb..0000000 --- a/node_modules/@tanstack/react-query/build/legacy/usePrefetchQuery.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { DefaultError, QueryKey, QueryClient } from '@tanstack/query-core'; -import { UsePrefetchQueryOptions } from './types.js'; - -declare function usePrefetchQuery(options: UsePrefetchQueryOptions, queryClient?: QueryClient): void; - -export { usePrefetchQuery }; diff --git a/node_modules/@tanstack/react-query/build/legacy/usePrefetchQuery.js b/node_modules/@tanstack/react-query/build/legacy/usePrefetchQuery.js deleted file mode 100644 index 63d3292..0000000 --- a/node_modules/@tanstack/react-query/build/legacy/usePrefetchQuery.js +++ /dev/null @@ -1,12 +0,0 @@ -// src/usePrefetchQuery.tsx -import { useQueryClient } from "./QueryClientProvider.js"; -function usePrefetchQuery(options, queryClient) { - const client = useQueryClient(queryClient); - if (!client.getQueryState(options.queryKey)) { - client.prefetchQuery(options); - } -} -export { - usePrefetchQuery -}; -//# sourceMappingURL=usePrefetchQuery.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/usePrefetchQuery.js.map b/node_modules/@tanstack/react-query/build/legacy/usePrefetchQuery.js.map deleted file mode 100644 index b7f1881..0000000 --- a/node_modules/@tanstack/react-query/build/legacy/usePrefetchQuery.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/usePrefetchQuery.tsx"],"sourcesContent":["import { useQueryClient } from './QueryClientProvider'\nimport type { DefaultError, QueryClient, QueryKey } from '@tanstack/query-core'\nimport type { UsePrefetchQueryOptions } from './types'\n\nexport function usePrefetchQuery<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n options: UsePrefetchQueryOptions,\n queryClient?: QueryClient,\n) {\n const client = useQueryClient(queryClient)\n\n if (!client.getQueryState(options.queryKey)) {\n client.prefetchQuery(options)\n }\n}\n"],"mappings":";AAAA,SAAS,sBAAsB;AAIxB,SAAS,iBAMd,SACA,aACA;AACA,QAAM,SAAS,eAAe,WAAW;AAEzC,MAAI,CAAC,OAAO,cAAc,QAAQ,QAAQ,GAAG;AAC3C,WAAO,cAAc,OAAO;AAAA,EAC9B;AACF;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/useQueries.cjs b/node_modules/@tanstack/react-query/build/legacy/useQueries.cjs deleted file mode 100644 index 8833f13..0000000 --- a/node_modules/@tanstack/react-query/build/legacy/useQueries.cjs +++ /dev/null @@ -1,128 +0,0 @@ -"use strict"; -"use client"; -var __create = Object.create; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __getProtoOf = Object.getPrototypeOf; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( - // If the importer is in node compatibility mode or this is not an ESM - // file that has been converted to a CommonJS file using a Babel- - // compatible transform (i.e. "__esModule" has not been set), then set - // "default" to the CommonJS "module.exports" for node compatibility. - isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, - mod -)); -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// src/useQueries.ts -var useQueries_exports = {}; -__export(useQueries_exports, { - useQueries: () => useQueries -}); -module.exports = __toCommonJS(useQueries_exports); -var React = __toESM(require("react"), 1); -var import_query_core = require("@tanstack/query-core"); -var import_QueryClientProvider = require("./QueryClientProvider.cjs"); -var import_IsRestoringProvider = require("./IsRestoringProvider.cjs"); -var import_QueryErrorResetBoundary = require("./QueryErrorResetBoundary.cjs"); -var import_errorBoundaryUtils = require("./errorBoundaryUtils.cjs"); -var import_suspense = require("./suspense.cjs"); -function useQueries({ - queries, - ...options -}, queryClient) { - const client = (0, import_QueryClientProvider.useQueryClient)(queryClient); - const isRestoring = (0, import_IsRestoringProvider.useIsRestoring)(); - const errorResetBoundary = (0, import_QueryErrorResetBoundary.useQueryErrorResetBoundary)(); - const defaultedQueries = React.useMemo( - () => queries.map((opts) => { - const defaultedOptions = client.defaultQueryOptions( - opts - ); - defaultedOptions._optimisticResults = isRestoring ? "isRestoring" : "optimistic"; - return defaultedOptions; - }), - [queries, client, isRestoring] - ); - defaultedQueries.forEach((queryOptions) => { - (0, import_suspense.ensureSuspenseTimers)(queryOptions); - const query = client.getQueryCache().get(queryOptions.queryHash); - (0, import_errorBoundaryUtils.ensurePreventErrorBoundaryRetry)(queryOptions, errorResetBoundary, query); - }); - (0, import_errorBoundaryUtils.useClearResetErrorBoundary)(errorResetBoundary); - const [observer] = React.useState( - () => new import_query_core.QueriesObserver( - client, - defaultedQueries, - options - ) - ); - const [optimisticResult, getCombinedResult, trackResult] = observer.getOptimisticResult( - defaultedQueries, - options.combine - ); - const shouldSubscribe = !isRestoring && options.subscribed !== false; - React.useSyncExternalStore( - React.useCallback( - (onStoreChange) => shouldSubscribe ? observer.subscribe(import_query_core.notifyManager.batchCalls(onStoreChange)) : import_query_core.noop, - [observer, shouldSubscribe] - ), - () => observer.getCurrentResult(), - () => observer.getCurrentResult() - ); - React.useEffect(() => { - observer.setQueries( - defaultedQueries, - options - ); - }, [defaultedQueries, options, observer]); - const shouldAtLeastOneSuspend = optimisticResult.some( - (result, index) => (0, import_suspense.shouldSuspend)(defaultedQueries[index], result) - ); - const suspensePromises = shouldAtLeastOneSuspend ? optimisticResult.flatMap((result, index) => { - const opts = defaultedQueries[index]; - if (opts && (0, import_suspense.shouldSuspend)(opts, result)) { - const queryObserver = new import_query_core.QueryObserver(client, opts); - return (0, import_suspense.fetchOptimistic)(opts, queryObserver, errorResetBoundary); - } - return []; - }) : []; - if (suspensePromises.length > 0) { - throw Promise.all(suspensePromises); - } - const firstSingleResultWhichShouldThrow = optimisticResult.find( - (result, index) => { - const query = defaultedQueries[index]; - return query && (0, import_errorBoundaryUtils.getHasError)({ - result, - errorResetBoundary, - throwOnError: query.throwOnError, - query: client.getQueryCache().get(query.queryHash), - suspense: query.suspense - }); - } - ); - if (firstSingleResultWhichShouldThrow == null ? void 0 : firstSingleResultWhichShouldThrow.error) { - throw firstSingleResultWhichShouldThrow.error; - } - return getCombinedResult(trackResult()); -} -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - useQueries -}); -//# sourceMappingURL=useQueries.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/useQueries.cjs.map b/node_modules/@tanstack/react-query/build/legacy/useQueries.cjs.map deleted file mode 100644 index 0a50572..0000000 --- a/node_modules/@tanstack/react-query/build/legacy/useQueries.cjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/useQueries.ts"],"sourcesContent":["'use client'\nimport * as React from 'react'\n\nimport {\n QueriesObserver,\n QueryObserver,\n noop,\n notifyManager,\n} from '@tanstack/query-core'\nimport { useQueryClient } from './QueryClientProvider'\nimport { useIsRestoring } from './IsRestoringProvider'\nimport { useQueryErrorResetBoundary } from './QueryErrorResetBoundary'\nimport {\n ensurePreventErrorBoundaryRetry,\n getHasError,\n useClearResetErrorBoundary,\n} from './errorBoundaryUtils'\nimport {\n ensureSuspenseTimers,\n fetchOptimistic,\n shouldSuspend,\n} from './suspense'\nimport type {\n DefinedUseQueryResult,\n UseQueryOptions,\n UseQueryResult,\n} from './types'\nimport type {\n DefaultError,\n OmitKeyof,\n QueriesObserverOptions,\n QueriesPlaceholderDataFunction,\n QueryClient,\n QueryFunction,\n QueryKey,\n QueryObserverOptions,\n ThrowOnError,\n} from '@tanstack/query-core'\n\n// This defines the `UseQueryOptions` that are accepted in `QueriesOptions` & `GetOptions`.\n// `placeholderData` function always gets undefined passed\ntype UseQueryOptionsForUseQueries<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> = OmitKeyof<\n UseQueryOptions,\n 'placeholderData' | 'subscribed'\n> & {\n placeholderData?: TQueryFnData | QueriesPlaceholderDataFunction\n}\n\n// Avoid TS depth-limit error in case of large array literal\ntype MAXIMUM_DEPTH = 20\n\n// Widen the type of the symbol to enable type inference even if skipToken is not immutable.\ntype SkipTokenForUseQueries = symbol\n\ntype GetUseQueryOptionsForUseQueries =\n // Part 1: responsible for applying explicit type parameter to function arguments, if object { queryFnData: TQueryFnData, error: TError, data: TData }\n T extends {\n queryFnData: infer TQueryFnData\n error?: infer TError\n data: infer TData\n }\n ? UseQueryOptionsForUseQueries\n : T extends { queryFnData: infer TQueryFnData; error?: infer TError }\n ? UseQueryOptionsForUseQueries\n : T extends { data: infer TData; error?: infer TError }\n ? UseQueryOptionsForUseQueries\n : // Part 2: responsible for applying explicit type parameter to function arguments, if tuple [TQueryFnData, TError, TData]\n T extends [infer TQueryFnData, infer TError, infer TData]\n ? UseQueryOptionsForUseQueries\n : T extends [infer TQueryFnData, infer TError]\n ? UseQueryOptionsForUseQueries\n : T extends [infer TQueryFnData]\n ? UseQueryOptionsForUseQueries\n : // Part 3: responsible for inferring and enforcing type if no explicit parameter was provided\n T extends {\n queryFn?:\n | QueryFunction\n | SkipTokenForUseQueries\n select?: (data: any) => infer TData\n throwOnError?: ThrowOnError\n }\n ? UseQueryOptionsForUseQueries<\n TQueryFnData,\n unknown extends TError ? DefaultError : TError,\n unknown extends TData ? TQueryFnData : TData,\n TQueryKey\n >\n : // Fallback\n UseQueryOptionsForUseQueries\n\n// A defined initialData setting should return a DefinedUseQueryResult rather than UseQueryResult\ntype GetDefinedOrUndefinedQueryResult = T extends {\n initialData?: infer TInitialData\n}\n ? unknown extends TInitialData\n ? UseQueryResult\n : TInitialData extends TData\n ? DefinedUseQueryResult\n : TInitialData extends () => infer TInitialDataResult\n ? unknown extends TInitialDataResult\n ? UseQueryResult\n : TInitialDataResult extends TData\n ? DefinedUseQueryResult\n : UseQueryResult\n : UseQueryResult\n : UseQueryResult\n\ntype GetUseQueryResult =\n // Part 1: responsible for mapping explicit type parameter to function result, if object\n T extends { queryFnData: any; error?: infer TError; data: infer TData }\n ? GetDefinedOrUndefinedQueryResult\n : T extends { queryFnData: infer TQueryFnData; error?: infer TError }\n ? GetDefinedOrUndefinedQueryResult\n : T extends { data: infer TData; error?: infer TError }\n ? GetDefinedOrUndefinedQueryResult\n : // Part 2: responsible for mapping explicit type parameter to function result, if tuple\n T extends [any, infer TError, infer TData]\n ? GetDefinedOrUndefinedQueryResult\n : T extends [infer TQueryFnData, infer TError]\n ? GetDefinedOrUndefinedQueryResult\n : T extends [infer TQueryFnData]\n ? GetDefinedOrUndefinedQueryResult\n : // Part 3: responsible for mapping inferred type to results, if no explicit parameter was provided\n T extends {\n queryFn?:\n | QueryFunction\n | SkipTokenForUseQueries\n select?: (data: any) => infer TData\n throwOnError?: ThrowOnError\n }\n ? GetDefinedOrUndefinedQueryResult<\n T,\n unknown extends TData ? TQueryFnData : TData,\n unknown extends TError ? DefaultError : TError\n >\n : // Fallback\n UseQueryResult\n\n/**\n * QueriesOptions reducer recursively unwraps function arguments to infer/enforce type param\n */\nexport type QueriesOptions<\n T extends Array,\n TResults extends Array = [],\n TDepth extends ReadonlyArray = [],\n> = TDepth['length'] extends MAXIMUM_DEPTH\n ? Array\n : T extends []\n ? []\n : T extends [infer Head]\n ? [...TResults, GetUseQueryOptionsForUseQueries]\n : T extends [infer Head, ...infer Tails]\n ? QueriesOptions<\n [...Tails],\n [...TResults, GetUseQueryOptionsForUseQueries],\n [...TDepth, 1]\n >\n : ReadonlyArray extends T\n ? T\n : // If T is *some* array but we couldn't assign unknown[] to it, then it must hold some known/homogenous type!\n // use this to infer the param types in the case of Array.map() argument\n T extends Array<\n UseQueryOptionsForUseQueries<\n infer TQueryFnData,\n infer TError,\n infer TData,\n infer TQueryKey\n >\n >\n ? Array<\n UseQueryOptionsForUseQueries<\n TQueryFnData,\n TError,\n TData,\n TQueryKey\n >\n >\n : // Fallback\n Array\n\n/**\n * QueriesResults reducer recursively maps type param to results\n */\nexport type QueriesResults<\n T extends Array,\n TResults extends Array = [],\n TDepth extends ReadonlyArray = [],\n> = TDepth['length'] extends MAXIMUM_DEPTH\n ? Array\n : T extends []\n ? []\n : T extends [infer Head]\n ? [...TResults, GetUseQueryResult]\n : T extends [infer Head, ...infer Tails]\n ? QueriesResults<\n [...Tails],\n [...TResults, GetUseQueryResult],\n [...TDepth, 1]\n >\n : { [K in keyof T]: GetUseQueryResult }\n\nexport function useQueries<\n T extends Array,\n TCombinedResult = QueriesResults,\n>(\n {\n queries,\n ...options\n }: {\n queries:\n | readonly [...QueriesOptions]\n | readonly [...{ [K in keyof T]: GetUseQueryOptionsForUseQueries }]\n combine?: (result: QueriesResults) => TCombinedResult\n subscribed?: boolean\n },\n queryClient?: QueryClient,\n): TCombinedResult {\n const client = useQueryClient(queryClient)\n const isRestoring = useIsRestoring()\n const errorResetBoundary = useQueryErrorResetBoundary()\n\n const defaultedQueries = React.useMemo(\n () =>\n queries.map((opts) => {\n const defaultedOptions = client.defaultQueryOptions(\n opts as QueryObserverOptions,\n )\n\n // Make sure the results are already in fetching state before subscribing or updating options\n defaultedOptions._optimisticResults = isRestoring\n ? 'isRestoring'\n : 'optimistic'\n\n return defaultedOptions\n }),\n [queries, client, isRestoring],\n )\n\n defaultedQueries.forEach((queryOptions) => {\n ensureSuspenseTimers(queryOptions)\n const query = client.getQueryCache().get(queryOptions.queryHash)\n ensurePreventErrorBoundaryRetry(queryOptions, errorResetBoundary, query)\n })\n\n useClearResetErrorBoundary(errorResetBoundary)\n\n const [observer] = React.useState(\n () =>\n new QueriesObserver(\n client,\n defaultedQueries,\n options as QueriesObserverOptions,\n ),\n )\n\n // note: this must be called before useSyncExternalStore\n const [optimisticResult, getCombinedResult, trackResult] =\n observer.getOptimisticResult(\n defaultedQueries,\n (options as QueriesObserverOptions).combine,\n )\n\n const shouldSubscribe = !isRestoring && options.subscribed !== false\n React.useSyncExternalStore(\n React.useCallback(\n (onStoreChange) =>\n shouldSubscribe\n ? observer.subscribe(notifyManager.batchCalls(onStoreChange))\n : noop,\n [observer, shouldSubscribe],\n ),\n () => observer.getCurrentResult(),\n () => observer.getCurrentResult(),\n )\n\n React.useEffect(() => {\n observer.setQueries(\n defaultedQueries,\n options as QueriesObserverOptions,\n )\n }, [defaultedQueries, options, observer])\n\n const shouldAtLeastOneSuspend = optimisticResult.some((result, index) =>\n shouldSuspend(defaultedQueries[index], result),\n )\n\n const suspensePromises = shouldAtLeastOneSuspend\n ? optimisticResult.flatMap((result, index) => {\n const opts = defaultedQueries[index]\n\n if (opts && shouldSuspend(opts, result)) {\n const queryObserver = new QueryObserver(client, opts)\n return fetchOptimistic(opts, queryObserver, errorResetBoundary)\n }\n return []\n })\n : []\n\n if (suspensePromises.length > 0) {\n throw Promise.all(suspensePromises)\n }\n const firstSingleResultWhichShouldThrow = optimisticResult.find(\n (result, index) => {\n const query = defaultedQueries[index]\n return (\n query &&\n getHasError({\n result,\n errorResetBoundary,\n throwOnError: query.throwOnError,\n query: client.getQueryCache().get(query.queryHash),\n suspense: query.suspense,\n })\n )\n },\n )\n\n if (firstSingleResultWhichShouldThrow?.error) {\n throw firstSingleResultWhichShouldThrow.error\n }\n\n return getCombinedResult(trackResult())\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,YAAuB;AAEvB,wBAKO;AACP,iCAA+B;AAC/B,iCAA+B;AAC/B,qCAA2C;AAC3C,gCAIO;AACP,sBAIO;AAyLA,SAAS,WAId;AAAA,EACE;AAAA,EACA,GAAG;AACL,GAOA,aACiB;AACjB,QAAM,aAAS,2CAAe,WAAW;AACzC,QAAM,kBAAc,2CAAe;AACnC,QAAM,yBAAqB,2DAA2B;AAEtD,QAAM,mBAAyB;AAAA,IAC7B,MACE,QAAQ,IAAI,CAAC,SAAS;AACpB,YAAM,mBAAmB,OAAO;AAAA,QAC9B;AAAA,MACF;AAGA,uBAAiB,qBAAqB,cAClC,gBACA;AAEJ,aAAO;AAAA,IACT,CAAC;AAAA,IACH,CAAC,SAAS,QAAQ,WAAW;AAAA,EAC/B;AAEA,mBAAiB,QAAQ,CAAC,iBAAiB;AACzC,8CAAqB,YAAY;AACjC,UAAM,QAAQ,OAAO,cAAc,EAAE,IAAI,aAAa,SAAS;AAC/D,mEAAgC,cAAc,oBAAoB,KAAK;AAAA,EACzE,CAAC;AAED,4DAA2B,kBAAkB;AAE7C,QAAM,CAAC,QAAQ,IAAU;AAAA,IACvB,MACE,IAAI;AAAA,MACF;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,EACJ;AAGA,QAAM,CAAC,kBAAkB,mBAAmB,WAAW,IACrD,SAAS;AAAA,IACP;AAAA,IACC,QAAoD;AAAA,EACvD;AAEF,QAAM,kBAAkB,CAAC,eAAe,QAAQ,eAAe;AAC/D,EAAM;AAAA,IACE;AAAA,MACJ,CAAC,kBACC,kBACI,SAAS,UAAU,gCAAc,WAAW,aAAa,CAAC,IAC1D;AAAA,MACN,CAAC,UAAU,eAAe;AAAA,IAC5B;AAAA,IACA,MAAM,SAAS,iBAAiB;AAAA,IAChC,MAAM,SAAS,iBAAiB;AAAA,EAClC;AAEA,EAAM,gBAAU,MAAM;AACpB,aAAS;AAAA,MACP;AAAA,MACA;AAAA,IACF;AAAA,EACF,GAAG,CAAC,kBAAkB,SAAS,QAAQ,CAAC;AAExC,QAAM,0BAA0B,iBAAiB;AAAA,IAAK,CAAC,QAAQ,cAC7D,+BAAc,iBAAiB,KAAK,GAAG,MAAM;AAAA,EAC/C;AAEA,QAAM,mBAAmB,0BACrB,iBAAiB,QAAQ,CAAC,QAAQ,UAAU;AAC1C,UAAM,OAAO,iBAAiB,KAAK;AAEnC,QAAI,YAAQ,+BAAc,MAAM,MAAM,GAAG;AACvC,YAAM,gBAAgB,IAAI,gCAAc,QAAQ,IAAI;AACpD,iBAAO,iCAAgB,MAAM,eAAe,kBAAkB;AAAA,IAChE;AACA,WAAO,CAAC;AAAA,EACV,CAAC,IACD,CAAC;AAEL,MAAI,iBAAiB,SAAS,GAAG;AAC/B,UAAM,QAAQ,IAAI,gBAAgB;AAAA,EACpC;AACA,QAAM,oCAAoC,iBAAiB;AAAA,IACzD,CAAC,QAAQ,UAAU;AACjB,YAAM,QAAQ,iBAAiB,KAAK;AACpC,aACE,aACA,uCAAY;AAAA,QACV;AAAA,QACA;AAAA,QACA,cAAc,MAAM;AAAA,QACpB,OAAO,OAAO,cAAc,EAAE,IAAI,MAAM,SAAS;AAAA,QACjD,UAAU,MAAM;AAAA,MAClB,CAAC;AAAA,IAEL;AAAA,EACF;AAEA,MAAI,uFAAmC,OAAO;AAC5C,UAAM,kCAAkC;AAAA,EAC1C;AAEA,SAAO,kBAAkB,YAAY,CAAC;AACxC;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/useQueries.d.cts b/node_modules/@tanstack/react-query/build/legacy/useQueries.d.cts deleted file mode 100644 index bf88750..0000000 --- a/node_modules/@tanstack/react-query/build/legacy/useQueries.d.cts +++ /dev/null @@ -1,76 +0,0 @@ -import { UseQueryOptions, UseQueryResult, DefinedUseQueryResult } from './types.cjs'; -import { DefaultError, QueryKey, OmitKeyof, QueriesPlaceholderDataFunction, QueryFunction, ThrowOnError, QueryClient } from '@tanstack/query-core'; - -type UseQueryOptionsForUseQueries = OmitKeyof, 'placeholderData' | 'subscribed'> & { - placeholderData?: TQueryFnData | QueriesPlaceholderDataFunction; -}; -type MAXIMUM_DEPTH = 20; -type SkipTokenForUseQueries = symbol; -type GetUseQueryOptionsForUseQueries = T extends { - queryFnData: infer TQueryFnData; - error?: infer TError; - data: infer TData; -} ? UseQueryOptionsForUseQueries : T extends { - queryFnData: infer TQueryFnData; - error?: infer TError; -} ? UseQueryOptionsForUseQueries : T extends { - data: infer TData; - error?: infer TError; -} ? UseQueryOptionsForUseQueries : T extends [infer TQueryFnData, infer TError, infer TData] ? UseQueryOptionsForUseQueries : T extends [infer TQueryFnData, infer TError] ? UseQueryOptionsForUseQueries : T extends [infer TQueryFnData] ? UseQueryOptionsForUseQueries : T extends { - queryFn?: QueryFunction | SkipTokenForUseQueries; - select?: (data: any) => infer TData; - throwOnError?: ThrowOnError; -} ? UseQueryOptionsForUseQueries : UseQueryOptionsForUseQueries; -type GetDefinedOrUndefinedQueryResult = T extends { - initialData?: infer TInitialData; -} ? unknown extends TInitialData ? UseQueryResult : TInitialData extends TData ? DefinedUseQueryResult : TInitialData extends () => infer TInitialDataResult ? unknown extends TInitialDataResult ? UseQueryResult : TInitialDataResult extends TData ? DefinedUseQueryResult : UseQueryResult : UseQueryResult : UseQueryResult; -type GetUseQueryResult = T extends { - queryFnData: any; - error?: infer TError; - data: infer TData; -} ? GetDefinedOrUndefinedQueryResult : T extends { - queryFnData: infer TQueryFnData; - error?: infer TError; -} ? GetDefinedOrUndefinedQueryResult : T extends { - data: infer TData; - error?: infer TError; -} ? GetDefinedOrUndefinedQueryResult : T extends [any, infer TError, infer TData] ? GetDefinedOrUndefinedQueryResult : T extends [infer TQueryFnData, infer TError] ? GetDefinedOrUndefinedQueryResult : T extends [infer TQueryFnData] ? GetDefinedOrUndefinedQueryResult : T extends { - queryFn?: QueryFunction | SkipTokenForUseQueries; - select?: (data: any) => infer TData; - throwOnError?: ThrowOnError; -} ? GetDefinedOrUndefinedQueryResult : UseQueryResult; -/** - * QueriesOptions reducer recursively unwraps function arguments to infer/enforce type param - */ -type QueriesOptions, TResults extends Array = [], TDepth extends ReadonlyArray = []> = TDepth['length'] extends MAXIMUM_DEPTH ? Array : T extends [] ? [] : T extends [infer Head] ? [...TResults, GetUseQueryOptionsForUseQueries] : T extends [infer Head, ...infer Tails] ? QueriesOptions<[ - ...Tails -], [ - ...TResults, - GetUseQueryOptionsForUseQueries -], [ - ...TDepth, - 1 -]> : ReadonlyArray extends T ? T : T extends Array> ? Array> : Array; -/** - * QueriesResults reducer recursively maps type param to results - */ -type QueriesResults, TResults extends Array = [], TDepth extends ReadonlyArray = []> = TDepth['length'] extends MAXIMUM_DEPTH ? Array : T extends [] ? [] : T extends [infer Head] ? [...TResults, GetUseQueryResult] : T extends [infer Head, ...infer Tails] ? QueriesResults<[ - ...Tails -], [ - ...TResults, - GetUseQueryResult -], [ - ...TDepth, - 1 -]> : { - [K in keyof T]: GetUseQueryResult; -}; -declare function useQueries, TCombinedResult = QueriesResults>({ queries, ...options }: { - queries: readonly [...QueriesOptions] | readonly [...{ - [K in keyof T]: GetUseQueryOptionsForUseQueries; - }]; - combine?: (result: QueriesResults) => TCombinedResult; - subscribed?: boolean; -}, queryClient?: QueryClient): TCombinedResult; - -export { type QueriesOptions, type QueriesResults, useQueries }; diff --git a/node_modules/@tanstack/react-query/build/legacy/useQueries.d.ts b/node_modules/@tanstack/react-query/build/legacy/useQueries.d.ts deleted file mode 100644 index 2311f83..0000000 --- a/node_modules/@tanstack/react-query/build/legacy/useQueries.d.ts +++ /dev/null @@ -1,76 +0,0 @@ -import { UseQueryOptions, UseQueryResult, DefinedUseQueryResult } from './types.js'; -import { DefaultError, QueryKey, OmitKeyof, QueriesPlaceholderDataFunction, QueryFunction, ThrowOnError, QueryClient } from '@tanstack/query-core'; - -type UseQueryOptionsForUseQueries = OmitKeyof, 'placeholderData' | 'subscribed'> & { - placeholderData?: TQueryFnData | QueriesPlaceholderDataFunction; -}; -type MAXIMUM_DEPTH = 20; -type SkipTokenForUseQueries = symbol; -type GetUseQueryOptionsForUseQueries = T extends { - queryFnData: infer TQueryFnData; - error?: infer TError; - data: infer TData; -} ? UseQueryOptionsForUseQueries : T extends { - queryFnData: infer TQueryFnData; - error?: infer TError; -} ? UseQueryOptionsForUseQueries : T extends { - data: infer TData; - error?: infer TError; -} ? UseQueryOptionsForUseQueries : T extends [infer TQueryFnData, infer TError, infer TData] ? UseQueryOptionsForUseQueries : T extends [infer TQueryFnData, infer TError] ? UseQueryOptionsForUseQueries : T extends [infer TQueryFnData] ? UseQueryOptionsForUseQueries : T extends { - queryFn?: QueryFunction | SkipTokenForUseQueries; - select?: (data: any) => infer TData; - throwOnError?: ThrowOnError; -} ? UseQueryOptionsForUseQueries : UseQueryOptionsForUseQueries; -type GetDefinedOrUndefinedQueryResult = T extends { - initialData?: infer TInitialData; -} ? unknown extends TInitialData ? UseQueryResult : TInitialData extends TData ? DefinedUseQueryResult : TInitialData extends () => infer TInitialDataResult ? unknown extends TInitialDataResult ? UseQueryResult : TInitialDataResult extends TData ? DefinedUseQueryResult : UseQueryResult : UseQueryResult : UseQueryResult; -type GetUseQueryResult = T extends { - queryFnData: any; - error?: infer TError; - data: infer TData; -} ? GetDefinedOrUndefinedQueryResult : T extends { - queryFnData: infer TQueryFnData; - error?: infer TError; -} ? GetDefinedOrUndefinedQueryResult : T extends { - data: infer TData; - error?: infer TError; -} ? GetDefinedOrUndefinedQueryResult : T extends [any, infer TError, infer TData] ? GetDefinedOrUndefinedQueryResult : T extends [infer TQueryFnData, infer TError] ? GetDefinedOrUndefinedQueryResult : T extends [infer TQueryFnData] ? GetDefinedOrUndefinedQueryResult : T extends { - queryFn?: QueryFunction | SkipTokenForUseQueries; - select?: (data: any) => infer TData; - throwOnError?: ThrowOnError; -} ? GetDefinedOrUndefinedQueryResult : UseQueryResult; -/** - * QueriesOptions reducer recursively unwraps function arguments to infer/enforce type param - */ -type QueriesOptions, TResults extends Array = [], TDepth extends ReadonlyArray = []> = TDepth['length'] extends MAXIMUM_DEPTH ? Array : T extends [] ? [] : T extends [infer Head] ? [...TResults, GetUseQueryOptionsForUseQueries] : T extends [infer Head, ...infer Tails] ? QueriesOptions<[ - ...Tails -], [ - ...TResults, - GetUseQueryOptionsForUseQueries -], [ - ...TDepth, - 1 -]> : ReadonlyArray extends T ? T : T extends Array> ? Array> : Array; -/** - * QueriesResults reducer recursively maps type param to results - */ -type QueriesResults, TResults extends Array = [], TDepth extends ReadonlyArray = []> = TDepth['length'] extends MAXIMUM_DEPTH ? Array : T extends [] ? [] : T extends [infer Head] ? [...TResults, GetUseQueryResult] : T extends [infer Head, ...infer Tails] ? QueriesResults<[ - ...Tails -], [ - ...TResults, - GetUseQueryResult -], [ - ...TDepth, - 1 -]> : { - [K in keyof T]: GetUseQueryResult; -}; -declare function useQueries, TCombinedResult = QueriesResults>({ queries, ...options }: { - queries: readonly [...QueriesOptions] | readonly [...{ - [K in keyof T]: GetUseQueryOptionsForUseQueries; - }]; - combine?: (result: QueriesResults) => TCombinedResult; - subscribed?: boolean; -}, queryClient?: QueryClient): TCombinedResult; - -export { type QueriesOptions, type QueriesResults, useQueries }; diff --git a/node_modules/@tanstack/react-query/build/legacy/useQueries.js b/node_modules/@tanstack/react-query/build/legacy/useQueries.js deleted file mode 100644 index 5a3a6d3..0000000 --- a/node_modules/@tanstack/react-query/build/legacy/useQueries.js +++ /dev/null @@ -1,107 +0,0 @@ -"use client"; - -// src/useQueries.ts -import * as React from "react"; -import { - QueriesObserver, - QueryObserver, - noop, - notifyManager -} from "@tanstack/query-core"; -import { useQueryClient } from "./QueryClientProvider.js"; -import { useIsRestoring } from "./IsRestoringProvider.js"; -import { useQueryErrorResetBoundary } from "./QueryErrorResetBoundary.js"; -import { - ensurePreventErrorBoundaryRetry, - getHasError, - useClearResetErrorBoundary -} from "./errorBoundaryUtils.js"; -import { - ensureSuspenseTimers, - fetchOptimistic, - shouldSuspend -} from "./suspense.js"; -function useQueries({ - queries, - ...options -}, queryClient) { - const client = useQueryClient(queryClient); - const isRestoring = useIsRestoring(); - const errorResetBoundary = useQueryErrorResetBoundary(); - const defaultedQueries = React.useMemo( - () => queries.map((opts) => { - const defaultedOptions = client.defaultQueryOptions( - opts - ); - defaultedOptions._optimisticResults = isRestoring ? "isRestoring" : "optimistic"; - return defaultedOptions; - }), - [queries, client, isRestoring] - ); - defaultedQueries.forEach((queryOptions) => { - ensureSuspenseTimers(queryOptions); - const query = client.getQueryCache().get(queryOptions.queryHash); - ensurePreventErrorBoundaryRetry(queryOptions, errorResetBoundary, query); - }); - useClearResetErrorBoundary(errorResetBoundary); - const [observer] = React.useState( - () => new QueriesObserver( - client, - defaultedQueries, - options - ) - ); - const [optimisticResult, getCombinedResult, trackResult] = observer.getOptimisticResult( - defaultedQueries, - options.combine - ); - const shouldSubscribe = !isRestoring && options.subscribed !== false; - React.useSyncExternalStore( - React.useCallback( - (onStoreChange) => shouldSubscribe ? observer.subscribe(notifyManager.batchCalls(onStoreChange)) : noop, - [observer, shouldSubscribe] - ), - () => observer.getCurrentResult(), - () => observer.getCurrentResult() - ); - React.useEffect(() => { - observer.setQueries( - defaultedQueries, - options - ); - }, [defaultedQueries, options, observer]); - const shouldAtLeastOneSuspend = optimisticResult.some( - (result, index) => shouldSuspend(defaultedQueries[index], result) - ); - const suspensePromises = shouldAtLeastOneSuspend ? optimisticResult.flatMap((result, index) => { - const opts = defaultedQueries[index]; - if (opts && shouldSuspend(opts, result)) { - const queryObserver = new QueryObserver(client, opts); - return fetchOptimistic(opts, queryObserver, errorResetBoundary); - } - return []; - }) : []; - if (suspensePromises.length > 0) { - throw Promise.all(suspensePromises); - } - const firstSingleResultWhichShouldThrow = optimisticResult.find( - (result, index) => { - const query = defaultedQueries[index]; - return query && getHasError({ - result, - errorResetBoundary, - throwOnError: query.throwOnError, - query: client.getQueryCache().get(query.queryHash), - suspense: query.suspense - }); - } - ); - if (firstSingleResultWhichShouldThrow == null ? void 0 : firstSingleResultWhichShouldThrow.error) { - throw firstSingleResultWhichShouldThrow.error; - } - return getCombinedResult(trackResult()); -} -export { - useQueries -}; -//# sourceMappingURL=useQueries.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/useQueries.js.map b/node_modules/@tanstack/react-query/build/legacy/useQueries.js.map deleted file mode 100644 index 112d3e6..0000000 --- a/node_modules/@tanstack/react-query/build/legacy/useQueries.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/useQueries.ts"],"sourcesContent":["'use client'\nimport * as React from 'react'\n\nimport {\n QueriesObserver,\n QueryObserver,\n noop,\n notifyManager,\n} from '@tanstack/query-core'\nimport { useQueryClient } from './QueryClientProvider'\nimport { useIsRestoring } from './IsRestoringProvider'\nimport { useQueryErrorResetBoundary } from './QueryErrorResetBoundary'\nimport {\n ensurePreventErrorBoundaryRetry,\n getHasError,\n useClearResetErrorBoundary,\n} from './errorBoundaryUtils'\nimport {\n ensureSuspenseTimers,\n fetchOptimistic,\n shouldSuspend,\n} from './suspense'\nimport type {\n DefinedUseQueryResult,\n UseQueryOptions,\n UseQueryResult,\n} from './types'\nimport type {\n DefaultError,\n OmitKeyof,\n QueriesObserverOptions,\n QueriesPlaceholderDataFunction,\n QueryClient,\n QueryFunction,\n QueryKey,\n QueryObserverOptions,\n ThrowOnError,\n} from '@tanstack/query-core'\n\n// This defines the `UseQueryOptions` that are accepted in `QueriesOptions` & `GetOptions`.\n// `placeholderData` function always gets undefined passed\ntype UseQueryOptionsForUseQueries<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> = OmitKeyof<\n UseQueryOptions,\n 'placeholderData' | 'subscribed'\n> & {\n placeholderData?: TQueryFnData | QueriesPlaceholderDataFunction\n}\n\n// Avoid TS depth-limit error in case of large array literal\ntype MAXIMUM_DEPTH = 20\n\n// Widen the type of the symbol to enable type inference even if skipToken is not immutable.\ntype SkipTokenForUseQueries = symbol\n\ntype GetUseQueryOptionsForUseQueries =\n // Part 1: responsible for applying explicit type parameter to function arguments, if object { queryFnData: TQueryFnData, error: TError, data: TData }\n T extends {\n queryFnData: infer TQueryFnData\n error?: infer TError\n data: infer TData\n }\n ? UseQueryOptionsForUseQueries\n : T extends { queryFnData: infer TQueryFnData; error?: infer TError }\n ? UseQueryOptionsForUseQueries\n : T extends { data: infer TData; error?: infer TError }\n ? UseQueryOptionsForUseQueries\n : // Part 2: responsible for applying explicit type parameter to function arguments, if tuple [TQueryFnData, TError, TData]\n T extends [infer TQueryFnData, infer TError, infer TData]\n ? UseQueryOptionsForUseQueries\n : T extends [infer TQueryFnData, infer TError]\n ? UseQueryOptionsForUseQueries\n : T extends [infer TQueryFnData]\n ? UseQueryOptionsForUseQueries\n : // Part 3: responsible for inferring and enforcing type if no explicit parameter was provided\n T extends {\n queryFn?:\n | QueryFunction\n | SkipTokenForUseQueries\n select?: (data: any) => infer TData\n throwOnError?: ThrowOnError\n }\n ? UseQueryOptionsForUseQueries<\n TQueryFnData,\n unknown extends TError ? DefaultError : TError,\n unknown extends TData ? TQueryFnData : TData,\n TQueryKey\n >\n : // Fallback\n UseQueryOptionsForUseQueries\n\n// A defined initialData setting should return a DefinedUseQueryResult rather than UseQueryResult\ntype GetDefinedOrUndefinedQueryResult = T extends {\n initialData?: infer TInitialData\n}\n ? unknown extends TInitialData\n ? UseQueryResult\n : TInitialData extends TData\n ? DefinedUseQueryResult\n : TInitialData extends () => infer TInitialDataResult\n ? unknown extends TInitialDataResult\n ? UseQueryResult\n : TInitialDataResult extends TData\n ? DefinedUseQueryResult\n : UseQueryResult\n : UseQueryResult\n : UseQueryResult\n\ntype GetUseQueryResult =\n // Part 1: responsible for mapping explicit type parameter to function result, if object\n T extends { queryFnData: any; error?: infer TError; data: infer TData }\n ? GetDefinedOrUndefinedQueryResult\n : T extends { queryFnData: infer TQueryFnData; error?: infer TError }\n ? GetDefinedOrUndefinedQueryResult\n : T extends { data: infer TData; error?: infer TError }\n ? GetDefinedOrUndefinedQueryResult\n : // Part 2: responsible for mapping explicit type parameter to function result, if tuple\n T extends [any, infer TError, infer TData]\n ? GetDefinedOrUndefinedQueryResult\n : T extends [infer TQueryFnData, infer TError]\n ? GetDefinedOrUndefinedQueryResult\n : T extends [infer TQueryFnData]\n ? GetDefinedOrUndefinedQueryResult\n : // Part 3: responsible for mapping inferred type to results, if no explicit parameter was provided\n T extends {\n queryFn?:\n | QueryFunction\n | SkipTokenForUseQueries\n select?: (data: any) => infer TData\n throwOnError?: ThrowOnError\n }\n ? GetDefinedOrUndefinedQueryResult<\n T,\n unknown extends TData ? TQueryFnData : TData,\n unknown extends TError ? DefaultError : TError\n >\n : // Fallback\n UseQueryResult\n\n/**\n * QueriesOptions reducer recursively unwraps function arguments to infer/enforce type param\n */\nexport type QueriesOptions<\n T extends Array,\n TResults extends Array = [],\n TDepth extends ReadonlyArray = [],\n> = TDepth['length'] extends MAXIMUM_DEPTH\n ? Array\n : T extends []\n ? []\n : T extends [infer Head]\n ? [...TResults, GetUseQueryOptionsForUseQueries]\n : T extends [infer Head, ...infer Tails]\n ? QueriesOptions<\n [...Tails],\n [...TResults, GetUseQueryOptionsForUseQueries],\n [...TDepth, 1]\n >\n : ReadonlyArray extends T\n ? T\n : // If T is *some* array but we couldn't assign unknown[] to it, then it must hold some known/homogenous type!\n // use this to infer the param types in the case of Array.map() argument\n T extends Array<\n UseQueryOptionsForUseQueries<\n infer TQueryFnData,\n infer TError,\n infer TData,\n infer TQueryKey\n >\n >\n ? Array<\n UseQueryOptionsForUseQueries<\n TQueryFnData,\n TError,\n TData,\n TQueryKey\n >\n >\n : // Fallback\n Array\n\n/**\n * QueriesResults reducer recursively maps type param to results\n */\nexport type QueriesResults<\n T extends Array,\n TResults extends Array = [],\n TDepth extends ReadonlyArray = [],\n> = TDepth['length'] extends MAXIMUM_DEPTH\n ? Array\n : T extends []\n ? []\n : T extends [infer Head]\n ? [...TResults, GetUseQueryResult]\n : T extends [infer Head, ...infer Tails]\n ? QueriesResults<\n [...Tails],\n [...TResults, GetUseQueryResult],\n [...TDepth, 1]\n >\n : { [K in keyof T]: GetUseQueryResult }\n\nexport function useQueries<\n T extends Array,\n TCombinedResult = QueriesResults,\n>(\n {\n queries,\n ...options\n }: {\n queries:\n | readonly [...QueriesOptions]\n | readonly [...{ [K in keyof T]: GetUseQueryOptionsForUseQueries }]\n combine?: (result: QueriesResults) => TCombinedResult\n subscribed?: boolean\n },\n queryClient?: QueryClient,\n): TCombinedResult {\n const client = useQueryClient(queryClient)\n const isRestoring = useIsRestoring()\n const errorResetBoundary = useQueryErrorResetBoundary()\n\n const defaultedQueries = React.useMemo(\n () =>\n queries.map((opts) => {\n const defaultedOptions = client.defaultQueryOptions(\n opts as QueryObserverOptions,\n )\n\n // Make sure the results are already in fetching state before subscribing or updating options\n defaultedOptions._optimisticResults = isRestoring\n ? 'isRestoring'\n : 'optimistic'\n\n return defaultedOptions\n }),\n [queries, client, isRestoring],\n )\n\n defaultedQueries.forEach((queryOptions) => {\n ensureSuspenseTimers(queryOptions)\n const query = client.getQueryCache().get(queryOptions.queryHash)\n ensurePreventErrorBoundaryRetry(queryOptions, errorResetBoundary, query)\n })\n\n useClearResetErrorBoundary(errorResetBoundary)\n\n const [observer] = React.useState(\n () =>\n new QueriesObserver(\n client,\n defaultedQueries,\n options as QueriesObserverOptions,\n ),\n )\n\n // note: this must be called before useSyncExternalStore\n const [optimisticResult, getCombinedResult, trackResult] =\n observer.getOptimisticResult(\n defaultedQueries,\n (options as QueriesObserverOptions).combine,\n )\n\n const shouldSubscribe = !isRestoring && options.subscribed !== false\n React.useSyncExternalStore(\n React.useCallback(\n (onStoreChange) =>\n shouldSubscribe\n ? observer.subscribe(notifyManager.batchCalls(onStoreChange))\n : noop,\n [observer, shouldSubscribe],\n ),\n () => observer.getCurrentResult(),\n () => observer.getCurrentResult(),\n )\n\n React.useEffect(() => {\n observer.setQueries(\n defaultedQueries,\n options as QueriesObserverOptions,\n )\n }, [defaultedQueries, options, observer])\n\n const shouldAtLeastOneSuspend = optimisticResult.some((result, index) =>\n shouldSuspend(defaultedQueries[index], result),\n )\n\n const suspensePromises = shouldAtLeastOneSuspend\n ? optimisticResult.flatMap((result, index) => {\n const opts = defaultedQueries[index]\n\n if (opts && shouldSuspend(opts, result)) {\n const queryObserver = new QueryObserver(client, opts)\n return fetchOptimistic(opts, queryObserver, errorResetBoundary)\n }\n return []\n })\n : []\n\n if (suspensePromises.length > 0) {\n throw Promise.all(suspensePromises)\n }\n const firstSingleResultWhichShouldThrow = optimisticResult.find(\n (result, index) => {\n const query = defaultedQueries[index]\n return (\n query &&\n getHasError({\n result,\n errorResetBoundary,\n throwOnError: query.throwOnError,\n query: client.getQueryCache().get(query.queryHash),\n suspense: query.suspense,\n })\n )\n },\n )\n\n if (firstSingleResultWhichShouldThrow?.error) {\n throw firstSingleResultWhichShouldThrow.error\n }\n\n return getCombinedResult(trackResult())\n}\n"],"mappings":";;;AACA,YAAY,WAAW;AAEvB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,sBAAsB;AAC/B,SAAS,sBAAsB;AAC/B,SAAS,kCAAkC;AAC3C;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAyLA,SAAS,WAId;AAAA,EACE;AAAA,EACA,GAAG;AACL,GAOA,aACiB;AACjB,QAAM,SAAS,eAAe,WAAW;AACzC,QAAM,cAAc,eAAe;AACnC,QAAM,qBAAqB,2BAA2B;AAEtD,QAAM,mBAA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;AACvC,YAAM,gBAAgB,IAAI,cAAc,QAAQ,IAAI;AACpD,aAAO,gBAAgB,MAAM,eAAe,kBAAkB;AAAA,IAChE;AACA,WAAO,CAAC;AAAA,EACV,CAAC,IACD,CAAC;AAEL,MAAI,iBAAiB,SAAS,GAAG;AAC/B,UAAM,QAAQ,IAAI,gBAAgB;AAAA,EACpC;AACA,QAAM,oCAAoC,iBAAiB;AAAA,IACzD,CAAC,QAAQ,UAAU;AACjB,YAAM,QAAQ,iBAAiB,KAAK;AACpC,aACE,SACA,YAAY;AAAA,QACV;AAAA,QACA;AAAA,QACA,cAAc,MAAM;AAAA,QACpB,OAAO,OAAO,cAAc,EAAE,IAAI,MAAM,SAAS;AAAA,QACjD,UAAU,MAAM;AAAA,MAClB,CAAC;AAAA,IAEL;AAAA,EACF;AAEA,MAAI,uFAAmC,OAAO;AAC5C,UAAM,kCAAkC;AAAA,EAC1C;AAEA,SAAO,kBAAkB,YAAY,CAAC;AACxC;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/useQuery.cjs b/node_modules/@tanstack/react-query/build/legacy/useQuery.cjs deleted file mode 100644 index 993525b..0000000 --- a/node_modules/@tanstack/react-query/build/legacy/useQuery.cjs +++ /dev/null @@ -1,36 +0,0 @@ -"use strict"; -"use client"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// src/useQuery.ts -var useQuery_exports = {}; -__export(useQuery_exports, { - useQuery: () => useQuery -}); -module.exports = __toCommonJS(useQuery_exports); -var import_query_core = require("@tanstack/query-core"); -var import_useBaseQuery = require("./useBaseQuery.cjs"); -function useQuery(options, queryClient) { - return (0, import_useBaseQuery.useBaseQuery)(options, import_query_core.QueryObserver, queryClient); -} -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - useQuery -}); -//# sourceMappingURL=useQuery.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/useQuery.cjs.map b/node_modules/@tanstack/react-query/build/legacy/useQuery.cjs.map deleted file mode 100644 index 4b0a996..0000000 --- a/node_modules/@tanstack/react-query/build/legacy/useQuery.cjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/useQuery.ts"],"sourcesContent":["'use client'\nimport { QueryObserver } from '@tanstack/query-core'\nimport { useBaseQuery } from './useBaseQuery'\nimport type {\n DefaultError,\n NoInfer,\n QueryClient,\n QueryKey,\n} from '@tanstack/query-core'\nimport type {\n DefinedUseQueryResult,\n UseQueryOptions,\n UseQueryResult,\n} from './types'\nimport type {\n DefinedInitialDataOptions,\n UndefinedInitialDataOptions,\n} from './queryOptions'\n\nexport function useQuery<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n options: DefinedInitialDataOptions,\n queryClient?: QueryClient,\n): DefinedUseQueryResult, TError>\n\nexport function useQuery<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n options: UndefinedInitialDataOptions,\n queryClient?: QueryClient,\n): UseQueryResult, TError>\n\nexport function useQuery<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n options: UseQueryOptions,\n queryClient?: QueryClient,\n): UseQueryResult, TError>\n\nexport function useQuery(options: UseQueryOptions, queryClient?: QueryClient) {\n return useBaseQuery(options, QueryObserver, queryClient)\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,wBAA8B;AAC9B,0BAA6B;AA+CtB,SAAS,SAAS,SAA0B,aAA2B;AAC5E,aAAO,kCAAa,SAAS,iCAAe,WAAW;AACzD;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/useQuery.d.cts b/node_modules/@tanstack/react-query/build/legacy/useQuery.d.cts deleted file mode 100644 index da16840..0000000 --- a/node_modules/@tanstack/react-query/build/legacy/useQuery.d.cts +++ /dev/null @@ -1,9 +0,0 @@ -import { DefaultError, QueryKey, QueryClient, NoInfer } from '@tanstack/query-core'; -import { DefinedUseQueryResult, UseQueryResult, UseQueryOptions } from './types.cjs'; -import { DefinedInitialDataOptions, UndefinedInitialDataOptions } from './queryOptions.cjs'; - -declare function useQuery(options: DefinedInitialDataOptions, queryClient?: QueryClient): DefinedUseQueryResult, TError>; -declare function useQuery(options: UndefinedInitialDataOptions, queryClient?: QueryClient): UseQueryResult, TError>; -declare function useQuery(options: UseQueryOptions, queryClient?: QueryClient): UseQueryResult, TError>; - -export { useQuery }; diff --git a/node_modules/@tanstack/react-query/build/legacy/useQuery.d.ts b/node_modules/@tanstack/react-query/build/legacy/useQuery.d.ts deleted file mode 100644 index 72bc861..0000000 --- a/node_modules/@tanstack/react-query/build/legacy/useQuery.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { DefaultError, QueryKey, QueryClient, NoInfer } from '@tanstack/query-core'; -import { DefinedUseQueryResult, UseQueryResult, UseQueryOptions } from './types.js'; -import { DefinedInitialDataOptions, UndefinedInitialDataOptions } from './queryOptions.js'; - -declare function useQuery(options: DefinedInitialDataOptions, queryClient?: QueryClient): DefinedUseQueryResult, TError>; -declare function useQuery(options: UndefinedInitialDataOptions, queryClient?: QueryClient): UseQueryResult, TError>; -declare function useQuery(options: UseQueryOptions, queryClient?: QueryClient): UseQueryResult, TError>; - -export { useQuery }; diff --git a/node_modules/@tanstack/react-query/build/legacy/useQuery.js b/node_modules/@tanstack/react-query/build/legacy/useQuery.js deleted file mode 100644 index 6173d62..0000000 --- a/node_modules/@tanstack/react-query/build/legacy/useQuery.js +++ /dev/null @@ -1,12 +0,0 @@ -"use client"; - -// src/useQuery.ts -import { QueryObserver } from "@tanstack/query-core"; -import { useBaseQuery } from "./useBaseQuery.js"; -function useQuery(options, queryClient) { - return useBaseQuery(options, QueryObserver, queryClient); -} -export { - useQuery -}; -//# sourceMappingURL=useQuery.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/useQuery.js.map b/node_modules/@tanstack/react-query/build/legacy/useQuery.js.map deleted file mode 100644 index 3f4f63f..0000000 --- a/node_modules/@tanstack/react-query/build/legacy/useQuery.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/useQuery.ts"],"sourcesContent":["'use client'\nimport { QueryObserver } from '@tanstack/query-core'\nimport { useBaseQuery } from './useBaseQuery'\nimport type {\n DefaultError,\n NoInfer,\n QueryClient,\n QueryKey,\n} from '@tanstack/query-core'\nimport type {\n DefinedUseQueryResult,\n UseQueryOptions,\n UseQueryResult,\n} from './types'\nimport type {\n DefinedInitialDataOptions,\n UndefinedInitialDataOptions,\n} from './queryOptions'\n\nexport function useQuery<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n options: DefinedInitialDataOptions,\n queryClient?: QueryClient,\n): DefinedUseQueryResult, TError>\n\nexport function useQuery<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n options: UndefinedInitialDataOptions,\n queryClient?: QueryClient,\n): UseQueryResult, TError>\n\nexport function useQuery<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n options: UseQueryOptions,\n queryClient?: QueryClient,\n): UseQueryResult, TError>\n\nexport function useQuery(options: UseQueryOptions, queryClient?: QueryClient) {\n return useBaseQuery(options, QueryObserver, queryClient)\n}\n"],"mappings":";;;AACA,SAAS,qBAAqB;AAC9B,SAAS,oBAAoB;AA+CtB,SAAS,SAAS,SAA0B,aAA2B;AAC5E,SAAO,aAAa,SAAS,eAAe,WAAW;AACzD;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/useSuspenseInfiniteQuery.cjs b/node_modules/@tanstack/react-query/build/legacy/useSuspenseInfiniteQuery.cjs deleted file mode 100644 index 1d06bb1..0000000 --- a/node_modules/@tanstack/react-query/build/legacy/useSuspenseInfiniteQuery.cjs +++ /dev/null @@ -1,51 +0,0 @@ -"use strict"; -"use client"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// src/useSuspenseInfiniteQuery.ts -var useSuspenseInfiniteQuery_exports = {}; -__export(useSuspenseInfiniteQuery_exports, { - useSuspenseInfiniteQuery: () => useSuspenseInfiniteQuery -}); -module.exports = __toCommonJS(useSuspenseInfiniteQuery_exports); -var import_query_core = require("@tanstack/query-core"); -var import_useBaseQuery = require("./useBaseQuery.cjs"); -var import_suspense = require("./suspense.cjs"); -function useSuspenseInfiniteQuery(options, queryClient) { - if (process.env.NODE_ENV !== "production") { - if (options.queryFn === import_query_core.skipToken) { - console.error("skipToken is not allowed for useSuspenseInfiniteQuery"); - } - } - return (0, import_useBaseQuery.useBaseQuery)( - { - ...options, - enabled: true, - suspense: true, - throwOnError: import_suspense.defaultThrowOnError - }, - import_query_core.InfiniteQueryObserver, - queryClient - ); -} -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - useSuspenseInfiniteQuery -}); -//# sourceMappingURL=useSuspenseInfiniteQuery.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/useSuspenseInfiniteQuery.cjs.map b/node_modules/@tanstack/react-query/build/legacy/useSuspenseInfiniteQuery.cjs.map deleted file mode 100644 index 98d9c0b..0000000 --- a/node_modules/@tanstack/react-query/build/legacy/useSuspenseInfiniteQuery.cjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/useSuspenseInfiniteQuery.ts"],"sourcesContent":["'use client'\nimport { InfiniteQueryObserver, skipToken } from '@tanstack/query-core'\nimport { useBaseQuery } from './useBaseQuery'\nimport { defaultThrowOnError } from './suspense'\nimport type {\n DefaultError,\n InfiniteData,\n InfiniteQueryObserverSuccessResult,\n QueryClient,\n QueryKey,\n QueryObserver,\n} from '@tanstack/query-core'\nimport type {\n UseSuspenseInfiniteQueryOptions,\n UseSuspenseInfiniteQueryResult,\n} from './types'\n\nexport function useSuspenseInfiniteQuery<\n TQueryFnData,\n TError = DefaultError,\n TData = InfiniteData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n>(\n options: UseSuspenseInfiniteQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n queryClient?: QueryClient,\n): UseSuspenseInfiniteQueryResult {\n if (process.env.NODE_ENV !== 'production') {\n if ((options.queryFn as any) === skipToken) {\n console.error('skipToken is not allowed for useSuspenseInfiniteQuery')\n }\n }\n\n return useBaseQuery(\n {\n ...options,\n enabled: true,\n suspense: true,\n throwOnError: defaultThrowOnError,\n },\n InfiniteQueryObserver as typeof QueryObserver,\n queryClient,\n ) as InfiniteQueryObserverSuccessResult\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,wBAAiD;AACjD,0BAA6B;AAC7B,sBAAoC;AAc7B,SAAS,yBAOd,SAOA,aAC+C;AAC/C,MAAI,QAAQ,IAAI,aAAa,cAAc;AACzC,QAAK,QAAQ,YAAoB,6BAAW;AAC1C,cAAQ,MAAM,uDAAuD;AAAA,IACvE;AAAA,EACF;AAEA,aAAO;AAAA,IACL;AAAA,MACE,GAAG;AAAA,MACH,SAAS;AAAA,MACT,UAAU;AAAA,MACV,cAAc;AAAA,IAChB;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/useSuspenseInfiniteQuery.d.cts b/node_modules/@tanstack/react-query/build/legacy/useSuspenseInfiniteQuery.d.cts deleted file mode 100644 index e056e82..0000000 --- a/node_modules/@tanstack/react-query/build/legacy/useSuspenseInfiniteQuery.d.cts +++ /dev/null @@ -1,6 +0,0 @@ -import { DefaultError, InfiniteData, QueryKey, QueryClient } from '@tanstack/query-core'; -import { UseSuspenseInfiniteQueryOptions, UseSuspenseInfiniteQueryResult } from './types.cjs'; - -declare function useSuspenseInfiniteQuery, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown>(options: UseSuspenseInfiniteQueryOptions, queryClient?: QueryClient): UseSuspenseInfiniteQueryResult; - -export { useSuspenseInfiniteQuery }; diff --git a/node_modules/@tanstack/react-query/build/legacy/useSuspenseInfiniteQuery.d.ts b/node_modules/@tanstack/react-query/build/legacy/useSuspenseInfiniteQuery.d.ts deleted file mode 100644 index 42d7b61..0000000 --- a/node_modules/@tanstack/react-query/build/legacy/useSuspenseInfiniteQuery.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { DefaultError, InfiniteData, QueryKey, QueryClient } from '@tanstack/query-core'; -import { UseSuspenseInfiniteQueryOptions, UseSuspenseInfiniteQueryResult } from './types.js'; - -declare function useSuspenseInfiniteQuery, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown>(options: UseSuspenseInfiniteQueryOptions, queryClient?: QueryClient): UseSuspenseInfiniteQueryResult; - -export { useSuspenseInfiniteQuery }; diff --git a/node_modules/@tanstack/react-query/build/legacy/useSuspenseInfiniteQuery.js b/node_modules/@tanstack/react-query/build/legacy/useSuspenseInfiniteQuery.js deleted file mode 100644 index 7c8facf..0000000 --- a/node_modules/@tanstack/react-query/build/legacy/useSuspenseInfiniteQuery.js +++ /dev/null @@ -1,27 +0,0 @@ -"use client"; - -// src/useSuspenseInfiniteQuery.ts -import { InfiniteQueryObserver, skipToken } from "@tanstack/query-core"; -import { useBaseQuery } from "./useBaseQuery.js"; -import { defaultThrowOnError } from "./suspense.js"; -function useSuspenseInfiniteQuery(options, queryClient) { - if (process.env.NODE_ENV !== "production") { - if (options.queryFn === skipToken) { - console.error("skipToken is not allowed for useSuspenseInfiniteQuery"); - } - } - return useBaseQuery( - { - ...options, - enabled: true, - suspense: true, - throwOnError: defaultThrowOnError - }, - InfiniteQueryObserver, - queryClient - ); -} -export { - useSuspenseInfiniteQuery -}; -//# sourceMappingURL=useSuspenseInfiniteQuery.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/useSuspenseInfiniteQuery.js.map b/node_modules/@tanstack/react-query/build/legacy/useSuspenseInfiniteQuery.js.map deleted file mode 100644 index a4937c6..0000000 --- a/node_modules/@tanstack/react-query/build/legacy/useSuspenseInfiniteQuery.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/useSuspenseInfiniteQuery.ts"],"sourcesContent":["'use client'\nimport { InfiniteQueryObserver, skipToken } from '@tanstack/query-core'\nimport { useBaseQuery } from './useBaseQuery'\nimport { defaultThrowOnError } from './suspense'\nimport type {\n DefaultError,\n InfiniteData,\n InfiniteQueryObserverSuccessResult,\n QueryClient,\n QueryKey,\n QueryObserver,\n} from '@tanstack/query-core'\nimport type {\n UseSuspenseInfiniteQueryOptions,\n UseSuspenseInfiniteQueryResult,\n} from './types'\n\nexport function useSuspenseInfiniteQuery<\n TQueryFnData,\n TError = DefaultError,\n TData = InfiniteData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n>(\n options: UseSuspenseInfiniteQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n queryClient?: QueryClient,\n): UseSuspenseInfiniteQueryResult {\n if (process.env.NODE_ENV !== 'production') {\n if ((options.queryFn as any) === skipToken) {\n console.error('skipToken is not allowed for useSuspenseInfiniteQuery')\n }\n }\n\n return useBaseQuery(\n {\n ...options,\n enabled: true,\n suspense: true,\n throwOnError: defaultThrowOnError,\n },\n InfiniteQueryObserver as typeof QueryObserver,\n queryClient,\n ) as InfiniteQueryObserverSuccessResult\n}\n"],"mappings":";;;AACA,SAAS,uBAAuB,iBAAiB;AACjD,SAAS,oBAAoB;AAC7B,SAAS,2BAA2B;AAc7B,SAAS,yBAOd,SAOA,aAC+C;AAC/C,MAAI,QAAQ,IAAI,aAAa,cAAc;AACzC,QAAK,QAAQ,YAAoB,WAAW;AAC1C,cAAQ,MAAM,uDAAuD;AAAA,IACvE;AAAA,EACF;AAEA,SAAO;AAAA,IACL;AAAA,MACE,GAAG;AAAA,MACH,SAAS;AAAA,MACT,UAAU;AAAA,MACV,cAAc;AAAA,IAChB;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/useSuspenseQueries.cjs b/node_modules/@tanstack/react-query/build/legacy/useSuspenseQueries.cjs deleted file mode 100644 index 75f86ef..0000000 --- a/node_modules/@tanstack/react-query/build/legacy/useSuspenseQueries.cjs +++ /dev/null @@ -1,56 +0,0 @@ -"use strict"; -"use client"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// src/useSuspenseQueries.ts -var useSuspenseQueries_exports = {}; -__export(useSuspenseQueries_exports, { - useSuspenseQueries: () => useSuspenseQueries -}); -module.exports = __toCommonJS(useSuspenseQueries_exports); -var import_query_core = require("@tanstack/query-core"); -var import_useQueries = require("./useQueries.cjs"); -var import_suspense = require("./suspense.cjs"); -function useSuspenseQueries(options, queryClient) { - return (0, import_useQueries.useQueries)( - { - ...options, - queries: options.queries.map((query) => { - if (process.env.NODE_ENV !== "production") { - if (query.queryFn === import_query_core.skipToken) { - console.error("skipToken is not allowed for useSuspenseQueries"); - } - } - return { - ...query, - suspense: true, - throwOnError: import_suspense.defaultThrowOnError, - enabled: true, - placeholderData: void 0 - }; - }) - }, - queryClient - ); -} -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - useSuspenseQueries -}); -//# sourceMappingURL=useSuspenseQueries.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/useSuspenseQueries.cjs.map b/node_modules/@tanstack/react-query/build/legacy/useSuspenseQueries.cjs.map deleted file mode 100644 index f8548ca..0000000 --- a/node_modules/@tanstack/react-query/build/legacy/useSuspenseQueries.cjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/useSuspenseQueries.ts"],"sourcesContent":["'use client'\nimport { skipToken } from '@tanstack/query-core'\nimport { useQueries } from './useQueries'\nimport { defaultThrowOnError } from './suspense'\nimport type { UseSuspenseQueryOptions, UseSuspenseQueryResult } from './types'\nimport type {\n DefaultError,\n QueryClient,\n QueryFunction,\n ThrowOnError,\n} from '@tanstack/query-core'\n\n// Avoid TS depth-limit error in case of large array literal\ntype MAXIMUM_DEPTH = 20\n\n// Widen the type of the symbol to enable type inference even if skipToken is not immutable.\ntype SkipTokenForUseQueries = symbol\n\ntype GetUseSuspenseQueryOptions =\n // Part 1: responsible for applying explicit type parameter to function arguments, if object { queryFnData: TQueryFnData, error: TError, data: TData }\n T extends {\n queryFnData: infer TQueryFnData\n error?: infer TError\n data: infer TData\n }\n ? UseSuspenseQueryOptions\n : T extends { queryFnData: infer TQueryFnData; error?: infer TError }\n ? UseSuspenseQueryOptions\n : T extends { data: infer TData; error?: infer TError }\n ? UseSuspenseQueryOptions\n : // Part 2: responsible for applying explicit type parameter to function arguments, if tuple [TQueryFnData, TError, TData]\n T extends [infer TQueryFnData, infer TError, infer TData]\n ? UseSuspenseQueryOptions\n : T extends [infer TQueryFnData, infer TError]\n ? UseSuspenseQueryOptions\n : T extends [infer TQueryFnData]\n ? UseSuspenseQueryOptions\n : // Part 3: responsible for inferring and enforcing type if no explicit parameter was provided\n T extends {\n queryFn?:\n | QueryFunction\n | SkipTokenForUseQueries\n select?: (data: any) => infer TData\n throwOnError?: ThrowOnError\n }\n ? UseSuspenseQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey\n >\n : T extends {\n queryFn?:\n | QueryFunction\n | SkipTokenForUseQueries\n throwOnError?: ThrowOnError\n }\n ? UseSuspenseQueryOptions<\n TQueryFnData,\n TError,\n TQueryFnData,\n TQueryKey\n >\n : // Fallback\n UseSuspenseQueryOptions\n\ntype GetUseSuspenseQueryResult =\n // Part 1: responsible for mapping explicit type parameter to function result, if object\n T extends { queryFnData: any; error?: infer TError; data: infer TData }\n ? UseSuspenseQueryResult\n : T extends { queryFnData: infer TQueryFnData; error?: infer TError }\n ? UseSuspenseQueryResult\n : T extends { data: infer TData; error?: infer TError }\n ? UseSuspenseQueryResult\n : // Part 2: responsible for mapping explicit type parameter to function result, if tuple\n T extends [any, infer TError, infer TData]\n ? UseSuspenseQueryResult\n : T extends [infer TQueryFnData, infer TError]\n ? UseSuspenseQueryResult\n : T extends [infer TQueryFnData]\n ? UseSuspenseQueryResult\n : // Part 3: responsible for mapping inferred type to results, if no explicit parameter was provided\n T extends {\n queryFn?:\n | QueryFunction\n | SkipTokenForUseQueries\n select?: (data: any) => infer TData\n throwOnError?: ThrowOnError\n }\n ? UseSuspenseQueryResult<\n unknown extends TData ? TQueryFnData : TData,\n unknown extends TError ? DefaultError : TError\n >\n : T extends {\n queryFn?:\n | QueryFunction\n | SkipTokenForUseQueries\n throwOnError?: ThrowOnError\n }\n ? UseSuspenseQueryResult<\n TQueryFnData,\n unknown extends TError ? DefaultError : TError\n >\n : // Fallback\n UseSuspenseQueryResult\n\n/**\n * SuspenseQueriesOptions reducer recursively unwraps function arguments to infer/enforce type param\n */\nexport type SuspenseQueriesOptions<\n T extends Array,\n TResults extends Array = [],\n TDepth extends ReadonlyArray = [],\n> = TDepth['length'] extends MAXIMUM_DEPTH\n ? Array\n : T extends []\n ? []\n : T extends [infer Head]\n ? [...TResults, GetUseSuspenseQueryOptions]\n : T extends [infer Head, ...infer Tails]\n ? SuspenseQueriesOptions<\n [...Tails],\n [...TResults, GetUseSuspenseQueryOptions],\n [...TDepth, 1]\n >\n : Array extends T\n ? T\n : // If T is *some* array but we couldn't assign unknown[] to it, then it must hold some known/homogenous type!\n // use this to infer the param types in the case of Array.map() argument\n T extends Array<\n UseSuspenseQueryOptions<\n infer TQueryFnData,\n infer TError,\n infer TData,\n infer TQueryKey\n >\n >\n ? Array<\n UseSuspenseQueryOptions\n >\n : // Fallback\n Array\n\n/**\n * SuspenseQueriesResults reducer recursively maps type param to results\n */\nexport type SuspenseQueriesResults<\n T extends Array,\n TResults extends Array = [],\n TDepth extends ReadonlyArray = [],\n> = TDepth['length'] extends MAXIMUM_DEPTH\n ? Array\n : T extends []\n ? []\n : T extends [infer Head]\n ? [...TResults, GetUseSuspenseQueryResult]\n : T extends [infer Head, ...infer Tails]\n ? SuspenseQueriesResults<\n [...Tails],\n [...TResults, GetUseSuspenseQueryResult],\n [...TDepth, 1]\n >\n : { [K in keyof T]: GetUseSuspenseQueryResult }\n\nexport function useSuspenseQueries<\n T extends Array,\n TCombinedResult = SuspenseQueriesResults,\n>(\n options: {\n queries:\n | readonly [...SuspenseQueriesOptions]\n | readonly [...{ [K in keyof T]: GetUseSuspenseQueryOptions }]\n combine?: (result: SuspenseQueriesResults) => TCombinedResult\n },\n queryClient?: QueryClient,\n): TCombinedResult\n\nexport function useSuspenseQueries<\n T extends Array,\n TCombinedResult = SuspenseQueriesResults,\n>(\n options: {\n queries: readonly [...SuspenseQueriesOptions]\n combine?: (result: SuspenseQueriesResults) => TCombinedResult\n },\n queryClient?: QueryClient,\n): TCombinedResult\n\nexport function useSuspenseQueries(options: any, queryClient?: QueryClient) {\n return useQueries(\n {\n ...options,\n queries: options.queries.map((query: any) => {\n if (process.env.NODE_ENV !== 'production') {\n if (query.queryFn === skipToken) {\n console.error('skipToken is not allowed for useSuspenseQueries')\n }\n }\n\n return {\n ...query,\n suspense: true,\n throwOnError: defaultThrowOnError,\n enabled: true,\n placeholderData: undefined,\n }\n }),\n },\n queryClient,\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,wBAA0B;AAC1B,wBAA2B;AAC3B,sBAAoC;AAyL7B,SAAS,mBAAmB,SAAc,aAA2B;AAC1E,aAAO;AAAA,IACL;AAAA,MACE,GAAG;AAAA,MACH,SAAS,QAAQ,QAAQ,IAAI,CAAC,UAAe;AAC3C,YAAI,QAAQ,IAAI,aAAa,cAAc;AACzC,cAAI,MAAM,YAAY,6BAAW;AAC/B,oBAAQ,MAAM,iDAAiD;AAAA,UACjE;AAAA,QACF;AAEA,eAAO;AAAA,UACL,GAAG;AAAA,UACH,UAAU;AAAA,UACV,cAAc;AAAA,UACd,SAAS;AAAA,UACT,iBAAiB;AAAA,QACnB;AAAA,MACF,CAAC;AAAA,IACH;AAAA,IACA;AAAA,EACF;AACF;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/useSuspenseQueries.d.cts b/node_modules/@tanstack/react-query/build/legacy/useSuspenseQueries.d.cts deleted file mode 100644 index f3f9618..0000000 --- a/node_modules/@tanstack/react-query/build/legacy/useSuspenseQueries.d.cts +++ /dev/null @@ -1,79 +0,0 @@ -import { UseSuspenseQueryOptions, UseSuspenseQueryResult } from './types.cjs'; -import { QueryFunction, ThrowOnError, DefaultError, QueryClient } from '@tanstack/query-core'; - -type MAXIMUM_DEPTH = 20; -type SkipTokenForUseQueries = symbol; -type GetUseSuspenseQueryOptions = T extends { - queryFnData: infer TQueryFnData; - error?: infer TError; - data: infer TData; -} ? UseSuspenseQueryOptions : T extends { - queryFnData: infer TQueryFnData; - error?: infer TError; -} ? UseSuspenseQueryOptions : T extends { - data: infer TData; - error?: infer TError; -} ? UseSuspenseQueryOptions : T extends [infer TQueryFnData, infer TError, infer TData] ? UseSuspenseQueryOptions : T extends [infer TQueryFnData, infer TError] ? UseSuspenseQueryOptions : T extends [infer TQueryFnData] ? UseSuspenseQueryOptions : T extends { - queryFn?: QueryFunction | SkipTokenForUseQueries; - select?: (data: any) => infer TData; - throwOnError?: ThrowOnError; -} ? UseSuspenseQueryOptions : T extends { - queryFn?: QueryFunction | SkipTokenForUseQueries; - throwOnError?: ThrowOnError; -} ? UseSuspenseQueryOptions : UseSuspenseQueryOptions; -type GetUseSuspenseQueryResult = T extends { - queryFnData: any; - error?: infer TError; - data: infer TData; -} ? UseSuspenseQueryResult : T extends { - queryFnData: infer TQueryFnData; - error?: infer TError; -} ? UseSuspenseQueryResult : T extends { - data: infer TData; - error?: infer TError; -} ? UseSuspenseQueryResult : T extends [any, infer TError, infer TData] ? UseSuspenseQueryResult : T extends [infer TQueryFnData, infer TError] ? UseSuspenseQueryResult : T extends [infer TQueryFnData] ? UseSuspenseQueryResult : T extends { - queryFn?: QueryFunction | SkipTokenForUseQueries; - select?: (data: any) => infer TData; - throwOnError?: ThrowOnError; -} ? UseSuspenseQueryResult : T extends { - queryFn?: QueryFunction | SkipTokenForUseQueries; - throwOnError?: ThrowOnError; -} ? UseSuspenseQueryResult : UseSuspenseQueryResult; -/** - * SuspenseQueriesOptions reducer recursively unwraps function arguments to infer/enforce type param - */ -type SuspenseQueriesOptions, TResults extends Array = [], TDepth extends ReadonlyArray = []> = TDepth['length'] extends MAXIMUM_DEPTH ? Array : T extends [] ? [] : T extends [infer Head] ? [...TResults, GetUseSuspenseQueryOptions] : T extends [infer Head, ...infer Tails] ? SuspenseQueriesOptions<[ - ...Tails -], [ - ...TResults, - GetUseSuspenseQueryOptions -], [ - ...TDepth, - 1 -]> : Array extends T ? T : T extends Array> ? Array> : Array; -/** - * SuspenseQueriesResults reducer recursively maps type param to results - */ -type SuspenseQueriesResults, TResults extends Array = [], TDepth extends ReadonlyArray = []> = TDepth['length'] extends MAXIMUM_DEPTH ? Array : T extends [] ? [] : T extends [infer Head] ? [...TResults, GetUseSuspenseQueryResult] : T extends [infer Head, ...infer Tails] ? SuspenseQueriesResults<[ - ...Tails -], [ - ...TResults, - GetUseSuspenseQueryResult -], [ - ...TDepth, - 1 -]> : { - [K in keyof T]: GetUseSuspenseQueryResult; -}; -declare function useSuspenseQueries, TCombinedResult = SuspenseQueriesResults>(options: { - queries: readonly [...SuspenseQueriesOptions] | readonly [...{ - [K in keyof T]: GetUseSuspenseQueryOptions; - }]; - combine?: (result: SuspenseQueriesResults) => TCombinedResult; -}, queryClient?: QueryClient): TCombinedResult; -declare function useSuspenseQueries, TCombinedResult = SuspenseQueriesResults>(options: { - queries: readonly [...SuspenseQueriesOptions]; - combine?: (result: SuspenseQueriesResults) => TCombinedResult; -}, queryClient?: QueryClient): TCombinedResult; - -export { type SuspenseQueriesOptions, type SuspenseQueriesResults, useSuspenseQueries }; diff --git a/node_modules/@tanstack/react-query/build/legacy/useSuspenseQueries.d.ts b/node_modules/@tanstack/react-query/build/legacy/useSuspenseQueries.d.ts deleted file mode 100644 index 300e26f..0000000 --- a/node_modules/@tanstack/react-query/build/legacy/useSuspenseQueries.d.ts +++ /dev/null @@ -1,79 +0,0 @@ -import { UseSuspenseQueryOptions, UseSuspenseQueryResult } from './types.js'; -import { QueryFunction, ThrowOnError, DefaultError, QueryClient } from '@tanstack/query-core'; - -type MAXIMUM_DEPTH = 20; -type SkipTokenForUseQueries = symbol; -type GetUseSuspenseQueryOptions = T extends { - queryFnData: infer TQueryFnData; - error?: infer TError; - data: infer TData; -} ? UseSuspenseQueryOptions : T extends { - queryFnData: infer TQueryFnData; - error?: infer TError; -} ? UseSuspenseQueryOptions : T extends { - data: infer TData; - error?: infer TError; -} ? UseSuspenseQueryOptions : T extends [infer TQueryFnData, infer TError, infer TData] ? UseSuspenseQueryOptions : T extends [infer TQueryFnData, infer TError] ? UseSuspenseQueryOptions : T extends [infer TQueryFnData] ? UseSuspenseQueryOptions : T extends { - queryFn?: QueryFunction | SkipTokenForUseQueries; - select?: (data: any) => infer TData; - throwOnError?: ThrowOnError; -} ? UseSuspenseQueryOptions : T extends { - queryFn?: QueryFunction | SkipTokenForUseQueries; - throwOnError?: ThrowOnError; -} ? UseSuspenseQueryOptions : UseSuspenseQueryOptions; -type GetUseSuspenseQueryResult = T extends { - queryFnData: any; - error?: infer TError; - data: infer TData; -} ? UseSuspenseQueryResult : T extends { - queryFnData: infer TQueryFnData; - error?: infer TError; -} ? UseSuspenseQueryResult : T extends { - data: infer TData; - error?: infer TError; -} ? UseSuspenseQueryResult : T extends [any, infer TError, infer TData] ? UseSuspenseQueryResult : T extends [infer TQueryFnData, infer TError] ? UseSuspenseQueryResult : T extends [infer TQueryFnData] ? UseSuspenseQueryResult : T extends { - queryFn?: QueryFunction | SkipTokenForUseQueries; - select?: (data: any) => infer TData; - throwOnError?: ThrowOnError; -} ? UseSuspenseQueryResult : T extends { - queryFn?: QueryFunction | SkipTokenForUseQueries; - throwOnError?: ThrowOnError; -} ? UseSuspenseQueryResult : UseSuspenseQueryResult; -/** - * SuspenseQueriesOptions reducer recursively unwraps function arguments to infer/enforce type param - */ -type SuspenseQueriesOptions, TResults extends Array = [], TDepth extends ReadonlyArray = []> = TDepth['length'] extends MAXIMUM_DEPTH ? Array : T extends [] ? [] : T extends [infer Head] ? [...TResults, GetUseSuspenseQueryOptions] : T extends [infer Head, ...infer Tails] ? SuspenseQueriesOptions<[ - ...Tails -], [ - ...TResults, - GetUseSuspenseQueryOptions -], [ - ...TDepth, - 1 -]> : Array extends T ? T : T extends Array> ? Array> : Array; -/** - * SuspenseQueriesResults reducer recursively maps type param to results - */ -type SuspenseQueriesResults, TResults extends Array = [], TDepth extends ReadonlyArray = []> = TDepth['length'] extends MAXIMUM_DEPTH ? Array : T extends [] ? [] : T extends [infer Head] ? [...TResults, GetUseSuspenseQueryResult] : T extends [infer Head, ...infer Tails] ? SuspenseQueriesResults<[ - ...Tails -], [ - ...TResults, - GetUseSuspenseQueryResult -], [ - ...TDepth, - 1 -]> : { - [K in keyof T]: GetUseSuspenseQueryResult; -}; -declare function useSuspenseQueries, TCombinedResult = SuspenseQueriesResults>(options: { - queries: readonly [...SuspenseQueriesOptions] | readonly [...{ - [K in keyof T]: GetUseSuspenseQueryOptions; - }]; - combine?: (result: SuspenseQueriesResults) => TCombinedResult; -}, queryClient?: QueryClient): TCombinedResult; -declare function useSuspenseQueries, TCombinedResult = SuspenseQueriesResults>(options: { - queries: readonly [...SuspenseQueriesOptions]; - combine?: (result: SuspenseQueriesResults) => TCombinedResult; -}, queryClient?: QueryClient): TCombinedResult; - -export { type SuspenseQueriesOptions, type SuspenseQueriesResults, useSuspenseQueries }; diff --git a/node_modules/@tanstack/react-query/build/legacy/useSuspenseQueries.js b/node_modules/@tanstack/react-query/build/legacy/useSuspenseQueries.js deleted file mode 100644 index a6f0445..0000000 --- a/node_modules/@tanstack/react-query/build/legacy/useSuspenseQueries.js +++ /dev/null @@ -1,32 +0,0 @@ -"use client"; - -// src/useSuspenseQueries.ts -import { skipToken } from "@tanstack/query-core"; -import { useQueries } from "./useQueries.js"; -import { defaultThrowOnError } from "./suspense.js"; -function useSuspenseQueries(options, queryClient) { - return useQueries( - { - ...options, - queries: options.queries.map((query) => { - if (process.env.NODE_ENV !== "production") { - if (query.queryFn === skipToken) { - console.error("skipToken is not allowed for useSuspenseQueries"); - } - } - return { - ...query, - suspense: true, - throwOnError: defaultThrowOnError, - enabled: true, - placeholderData: void 0 - }; - }) - }, - queryClient - ); -} -export { - useSuspenseQueries -}; -//# sourceMappingURL=useSuspenseQueries.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/useSuspenseQueries.js.map b/node_modules/@tanstack/react-query/build/legacy/useSuspenseQueries.js.map deleted file mode 100644 index ee09004..0000000 --- a/node_modules/@tanstack/react-query/build/legacy/useSuspenseQueries.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/useSuspenseQueries.ts"],"sourcesContent":["'use client'\nimport { skipToken } from '@tanstack/query-core'\nimport { useQueries } from './useQueries'\nimport { defaultThrowOnError } from './suspense'\nimport type { UseSuspenseQueryOptions, UseSuspenseQueryResult } from './types'\nimport type {\n DefaultError,\n QueryClient,\n QueryFunction,\n ThrowOnError,\n} from '@tanstack/query-core'\n\n// Avoid TS depth-limit error in case of large array literal\ntype MAXIMUM_DEPTH = 20\n\n// Widen the type of the symbol to enable type inference even if skipToken is not immutable.\ntype SkipTokenForUseQueries = symbol\n\ntype GetUseSuspenseQueryOptions =\n // Part 1: responsible for applying explicit type parameter to function arguments, if object { queryFnData: TQueryFnData, error: TError, data: TData }\n T extends {\n queryFnData: infer TQueryFnData\n error?: infer TError\n data: infer TData\n }\n ? UseSuspenseQueryOptions\n : T extends { queryFnData: infer TQueryFnData; error?: infer TError }\n ? UseSuspenseQueryOptions\n : T extends { data: infer TData; error?: infer TError }\n ? UseSuspenseQueryOptions\n : // Part 2: responsible for applying explicit type parameter to function arguments, if tuple [TQueryFnData, TError, TData]\n T extends [infer TQueryFnData, infer TError, infer TData]\n ? UseSuspenseQueryOptions\n : T extends [infer TQueryFnData, infer TError]\n ? UseSuspenseQueryOptions\n : T extends [infer TQueryFnData]\n ? UseSuspenseQueryOptions\n : // Part 3: responsible for inferring and enforcing type if no explicit parameter was provided\n T extends {\n queryFn?:\n | QueryFunction\n | SkipTokenForUseQueries\n select?: (data: any) => infer TData\n throwOnError?: ThrowOnError\n }\n ? UseSuspenseQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey\n >\n : T extends {\n queryFn?:\n | QueryFunction\n | SkipTokenForUseQueries\n throwOnError?: ThrowOnError\n }\n ? UseSuspenseQueryOptions<\n TQueryFnData,\n TError,\n TQueryFnData,\n TQueryKey\n >\n : // Fallback\n UseSuspenseQueryOptions\n\ntype GetUseSuspenseQueryResult =\n // Part 1: responsible for mapping explicit type parameter to function result, if object\n T extends { queryFnData: any; error?: infer TError; data: infer TData }\n ? UseSuspenseQueryResult\n : T extends { queryFnData: infer TQueryFnData; error?: infer TError }\n ? UseSuspenseQueryResult\n : T extends { data: infer TData; error?: infer TError }\n ? UseSuspenseQueryResult\n : // Part 2: responsible for mapping explicit type parameter to function result, if tuple\n T extends [any, infer TError, infer TData]\n ? UseSuspenseQueryResult\n : T extends [infer TQueryFnData, infer TError]\n ? UseSuspenseQueryResult\n : T extends [infer TQueryFnData]\n ? UseSuspenseQueryResult\n : // Part 3: responsible for mapping inferred type to results, if no explicit parameter was provided\n T extends {\n queryFn?:\n | QueryFunction\n | SkipTokenForUseQueries\n select?: (data: any) => infer TData\n throwOnError?: ThrowOnError\n }\n ? UseSuspenseQueryResult<\n unknown extends TData ? TQueryFnData : TData,\n unknown extends TError ? DefaultError : TError\n >\n : T extends {\n queryFn?:\n | QueryFunction\n | SkipTokenForUseQueries\n throwOnError?: ThrowOnError\n }\n ? UseSuspenseQueryResult<\n TQueryFnData,\n unknown extends TError ? DefaultError : TError\n >\n : // Fallback\n UseSuspenseQueryResult\n\n/**\n * SuspenseQueriesOptions reducer recursively unwraps function arguments to infer/enforce type param\n */\nexport type SuspenseQueriesOptions<\n T extends Array,\n TResults extends Array = [],\n TDepth extends ReadonlyArray = [],\n> = TDepth['length'] extends MAXIMUM_DEPTH\n ? Array\n : T extends []\n ? []\n : T extends [infer Head]\n ? [...TResults, GetUseSuspenseQueryOptions]\n : T extends [infer Head, ...infer Tails]\n ? SuspenseQueriesOptions<\n [...Tails],\n [...TResults, GetUseSuspenseQueryOptions],\n [...TDepth, 1]\n >\n : Array extends T\n ? T\n : // If T is *some* array but we couldn't assign unknown[] to it, then it must hold some known/homogenous type!\n // use this to infer the param types in the case of Array.map() argument\n T extends Array<\n UseSuspenseQueryOptions<\n infer TQueryFnData,\n infer TError,\n infer TData,\n infer TQueryKey\n >\n >\n ? Array<\n UseSuspenseQueryOptions\n >\n : // Fallback\n Array\n\n/**\n * SuspenseQueriesResults reducer recursively maps type param to results\n */\nexport type SuspenseQueriesResults<\n T extends Array,\n TResults extends Array = [],\n TDepth extends ReadonlyArray = [],\n> = TDepth['length'] extends MAXIMUM_DEPTH\n ? Array\n : T extends []\n ? []\n : T extends [infer Head]\n ? [...TResults, GetUseSuspenseQueryResult]\n : T extends [infer Head, ...infer Tails]\n ? SuspenseQueriesResults<\n [...Tails],\n [...TResults, GetUseSuspenseQueryResult],\n [...TDepth, 1]\n >\n : { [K in keyof T]: GetUseSuspenseQueryResult }\n\nexport function useSuspenseQueries<\n T extends Array,\n TCombinedResult = SuspenseQueriesResults,\n>(\n options: {\n queries:\n | readonly [...SuspenseQueriesOptions]\n | readonly [...{ [K in keyof T]: GetUseSuspenseQueryOptions }]\n combine?: (result: SuspenseQueriesResults) => TCombinedResult\n },\n queryClient?: QueryClient,\n): TCombinedResult\n\nexport function useSuspenseQueries<\n T extends Array,\n TCombinedResult = SuspenseQueriesResults,\n>(\n options: {\n queries: readonly [...SuspenseQueriesOptions]\n combine?: (result: SuspenseQueriesResults) => TCombinedResult\n },\n queryClient?: QueryClient,\n): TCombinedResult\n\nexport function useSuspenseQueries(options: any, queryClient?: QueryClient) {\n return useQueries(\n {\n ...options,\n queries: options.queries.map((query: any) => {\n if (process.env.NODE_ENV !== 'production') {\n if (query.queryFn === skipToken) {\n console.error('skipToken is not allowed for useSuspenseQueries')\n }\n }\n\n return {\n ...query,\n suspense: true,\n throwOnError: defaultThrowOnError,\n enabled: true,\n placeholderData: undefined,\n }\n }),\n },\n queryClient,\n )\n}\n"],"mappings":";;;AACA,SAAS,iBAAiB;AAC1B,SAAS,kBAAkB;AAC3B,SAAS,2BAA2B;AAyL7B,SAAS,mBAAmB,SAAc,aAA2B;AAC1E,SAAO;AAAA,IACL;AAAA,MACE,GAAG;AAAA,MACH,SAAS,QAAQ,QAAQ,IAAI,CAAC,UAAe;AAC3C,YAAI,QAAQ,IAAI,aAAa,cAAc;AACzC,cAAI,MAAM,YAAY,WAAW;AAC/B,oBAAQ,MAAM,iDAAiD;AAAA,UACjE;AAAA,QACF;AAEA,eAAO;AAAA,UACL,GAAG;AAAA,UACH,UAAU;AAAA,UACV,cAAc;AAAA,UACd,SAAS;AAAA,UACT,iBAAiB;AAAA,QACnB;AAAA,MACF,CAAC;AAAA,IACH;AAAA,IACA;AAAA,EACF;AACF;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/useSuspenseQuery.cjs b/node_modules/@tanstack/react-query/build/legacy/useSuspenseQuery.cjs deleted file mode 100644 index dcf18a2..0000000 --- a/node_modules/@tanstack/react-query/build/legacy/useSuspenseQuery.cjs +++ /dev/null @@ -1,52 +0,0 @@ -"use strict"; -"use client"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// src/useSuspenseQuery.ts -var useSuspenseQuery_exports = {}; -__export(useSuspenseQuery_exports, { - useSuspenseQuery: () => useSuspenseQuery -}); -module.exports = __toCommonJS(useSuspenseQuery_exports); -var import_query_core = require("@tanstack/query-core"); -var import_useBaseQuery = require("./useBaseQuery.cjs"); -var import_suspense = require("./suspense.cjs"); -function useSuspenseQuery(options, queryClient) { - if (process.env.NODE_ENV !== "production") { - if (options.queryFn === import_query_core.skipToken) { - console.error("skipToken is not allowed for useSuspenseQuery"); - } - } - return (0, import_useBaseQuery.useBaseQuery)( - { - ...options, - enabled: true, - suspense: true, - throwOnError: import_suspense.defaultThrowOnError, - placeholderData: void 0 - }, - import_query_core.QueryObserver, - queryClient - ); -} -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - useSuspenseQuery -}); -//# sourceMappingURL=useSuspenseQuery.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/useSuspenseQuery.cjs.map b/node_modules/@tanstack/react-query/build/legacy/useSuspenseQuery.cjs.map deleted file mode 100644 index c456860..0000000 --- a/node_modules/@tanstack/react-query/build/legacy/useSuspenseQuery.cjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/useSuspenseQuery.ts"],"sourcesContent":["'use client'\nimport { QueryObserver, skipToken } from '@tanstack/query-core'\nimport { useBaseQuery } from './useBaseQuery'\nimport { defaultThrowOnError } from './suspense'\nimport type { UseSuspenseQueryOptions, UseSuspenseQueryResult } from './types'\nimport type { DefaultError, QueryClient, QueryKey } from '@tanstack/query-core'\n\nexport function useSuspenseQuery<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n options: UseSuspenseQueryOptions,\n queryClient?: QueryClient,\n): UseSuspenseQueryResult {\n if (process.env.NODE_ENV !== 'production') {\n if ((options.queryFn as any) === skipToken) {\n console.error('skipToken is not allowed for useSuspenseQuery')\n }\n }\n\n return useBaseQuery(\n {\n ...options,\n enabled: true,\n suspense: true,\n throwOnError: defaultThrowOnError,\n placeholderData: undefined,\n },\n QueryObserver,\n queryClient,\n ) as UseSuspenseQueryResult\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,wBAAyC;AACzC,0BAA6B;AAC7B,sBAAoC;AAI7B,SAAS,iBAMd,SACA,aACuC;AACvC,MAAI,QAAQ,IAAI,aAAa,cAAc;AACzC,QAAK,QAAQ,YAAoB,6BAAW;AAC1C,cAAQ,MAAM,+CAA+C;AAAA,IAC/D;AAAA,EACF;AAEA,aAAO;AAAA,IACL;AAAA,MACE,GAAG;AAAA,MACH,SAAS;AAAA,MACT,UAAU;AAAA,MACV,cAAc;AAAA,MACd,iBAAiB;AAAA,IACnB;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/useSuspenseQuery.d.cts b/node_modules/@tanstack/react-query/build/legacy/useSuspenseQuery.d.cts deleted file mode 100644 index b2e662e..0000000 --- a/node_modules/@tanstack/react-query/build/legacy/useSuspenseQuery.d.cts +++ /dev/null @@ -1,6 +0,0 @@ -import { UseSuspenseQueryOptions, UseSuspenseQueryResult } from './types.cjs'; -import { DefaultError, QueryKey, QueryClient } from '@tanstack/query-core'; - -declare function useSuspenseQuery(options: UseSuspenseQueryOptions, queryClient?: QueryClient): UseSuspenseQueryResult; - -export { useSuspenseQuery }; diff --git a/node_modules/@tanstack/react-query/build/legacy/useSuspenseQuery.d.ts b/node_modules/@tanstack/react-query/build/legacy/useSuspenseQuery.d.ts deleted file mode 100644 index f53bc83..0000000 --- a/node_modules/@tanstack/react-query/build/legacy/useSuspenseQuery.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { UseSuspenseQueryOptions, UseSuspenseQueryResult } from './types.js'; -import { DefaultError, QueryKey, QueryClient } from '@tanstack/query-core'; - -declare function useSuspenseQuery(options: UseSuspenseQueryOptions, queryClient?: QueryClient): UseSuspenseQueryResult; - -export { useSuspenseQuery }; diff --git a/node_modules/@tanstack/react-query/build/legacy/useSuspenseQuery.js b/node_modules/@tanstack/react-query/build/legacy/useSuspenseQuery.js deleted file mode 100644 index 98296da..0000000 --- a/node_modules/@tanstack/react-query/build/legacy/useSuspenseQuery.js +++ /dev/null @@ -1,28 +0,0 @@ -"use client"; - -// src/useSuspenseQuery.ts -import { QueryObserver, skipToken } from "@tanstack/query-core"; -import { useBaseQuery } from "./useBaseQuery.js"; -import { defaultThrowOnError } from "./suspense.js"; -function useSuspenseQuery(options, queryClient) { - if (process.env.NODE_ENV !== "production") { - if (options.queryFn === skipToken) { - console.error("skipToken is not allowed for useSuspenseQuery"); - } - } - return useBaseQuery( - { - ...options, - enabled: true, - suspense: true, - throwOnError: defaultThrowOnError, - placeholderData: void 0 - }, - QueryObserver, - queryClient - ); -} -export { - useSuspenseQuery -}; -//# sourceMappingURL=useSuspenseQuery.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/legacy/useSuspenseQuery.js.map b/node_modules/@tanstack/react-query/build/legacy/useSuspenseQuery.js.map deleted file mode 100644 index 2d96142..0000000 --- a/node_modules/@tanstack/react-query/build/legacy/useSuspenseQuery.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/useSuspenseQuery.ts"],"sourcesContent":["'use client'\nimport { QueryObserver, skipToken } from '@tanstack/query-core'\nimport { useBaseQuery } from './useBaseQuery'\nimport { defaultThrowOnError } from './suspense'\nimport type { UseSuspenseQueryOptions, UseSuspenseQueryResult } from './types'\nimport type { DefaultError, QueryClient, QueryKey } from '@tanstack/query-core'\n\nexport function useSuspenseQuery<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n options: UseSuspenseQueryOptions,\n queryClient?: QueryClient,\n): UseSuspenseQueryResult {\n if (process.env.NODE_ENV !== 'production') {\n if ((options.queryFn as any) === skipToken) {\n console.error('skipToken is not allowed for useSuspenseQuery')\n }\n }\n\n return useBaseQuery(\n {\n ...options,\n enabled: true,\n suspense: true,\n throwOnError: defaultThrowOnError,\n placeholderData: undefined,\n },\n QueryObserver,\n queryClient,\n ) as UseSuspenseQueryResult\n}\n"],"mappings":";;;AACA,SAAS,eAAe,iBAAiB;AACzC,SAAS,oBAAoB;AAC7B,SAAS,2BAA2B;AAI7B,SAAS,iBAMd,SACA,aACuC;AACvC,MAAI,QAAQ,IAAI,aAAa,cAAc;AACzC,QAAK,QAAQ,YAAoB,WAAW;AAC1C,cAAQ,MAAM,+CAA+C;AAAA,IAC/D;AAAA,EACF;AAEA,SAAO;AAAA,IACL;AAAA,MACE,GAAG;AAAA,MACH,SAAS;AAAA,MACT,UAAU;AAAA,MACV,cAAc;AAAA,MACd,iBAAiB;AAAA,IACnB;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/HydrationBoundary.cjs b/node_modules/@tanstack/react-query/build/modern/HydrationBoundary.cjs deleted file mode 100644 index ac23049..0000000 --- a/node_modules/@tanstack/react-query/build/modern/HydrationBoundary.cjs +++ /dev/null @@ -1,91 +0,0 @@ -"use strict"; -"use client"; -var __create = Object.create; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __getProtoOf = Object.getPrototypeOf; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( - // If the importer is in node compatibility mode or this is not an ESM - // file that has been converted to a CommonJS file using a Babel- - // compatible transform (i.e. "__esModule" has not been set), then set - // "default" to the CommonJS "module.exports" for node compatibility. - isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, - mod -)); -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// src/HydrationBoundary.tsx -var HydrationBoundary_exports = {}; -__export(HydrationBoundary_exports, { - HydrationBoundary: () => HydrationBoundary -}); -module.exports = __toCommonJS(HydrationBoundary_exports); -var React = __toESM(require("react"), 1); -var import_query_core = require("@tanstack/query-core"); -var import_QueryClientProvider = require("./QueryClientProvider.cjs"); -var HydrationBoundary = ({ - children, - options = {}, - state, - queryClient -}) => { - const client = (0, import_QueryClientProvider.useQueryClient)(queryClient); - const optionsRef = React.useRef(options); - React.useEffect(() => { - optionsRef.current = options; - }); - const hydrationQueue = React.useMemo(() => { - if (state) { - if (typeof state !== "object") { - return; - } - const queryCache = client.getQueryCache(); - const queries = state.queries || []; - const newQueries = []; - const existingQueries = []; - for (const dehydratedQuery of queries) { - const existingQuery = queryCache.get(dehydratedQuery.queryHash); - if (!existingQuery) { - newQueries.push(dehydratedQuery); - } else { - const hydrationIsNewer = dehydratedQuery.state.dataUpdatedAt > existingQuery.state.dataUpdatedAt || dehydratedQuery.promise && existingQuery.state.status !== "pending" && existingQuery.state.fetchStatus !== "fetching" && dehydratedQuery.dehydratedAt !== void 0 && dehydratedQuery.dehydratedAt > existingQuery.state.dataUpdatedAt; - if (hydrationIsNewer) { - existingQueries.push(dehydratedQuery); - } - } - } - if (newQueries.length > 0) { - (0, import_query_core.hydrate)(client, { queries: newQueries }, optionsRef.current); - } - if (existingQueries.length > 0) { - return existingQueries; - } - } - return void 0; - }, [client, state]); - React.useEffect(() => { - if (hydrationQueue) { - (0, import_query_core.hydrate)(client, { queries: hydrationQueue }, optionsRef.current); - } - }, [client, hydrationQueue]); - return children; -}; -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - HydrationBoundary -}); -//# sourceMappingURL=HydrationBoundary.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/HydrationBoundary.cjs.map b/node_modules/@tanstack/react-query/build/modern/HydrationBoundary.cjs.map deleted file mode 100644 index 7a8d445..0000000 --- a/node_modules/@tanstack/react-query/build/modern/HydrationBoundary.cjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/HydrationBoundary.tsx"],"sourcesContent":["'use client'\nimport * as React from 'react'\n\nimport { hydrate } from '@tanstack/query-core'\nimport { useQueryClient } from './QueryClientProvider'\nimport type {\n DehydratedState,\n HydrateOptions,\n OmitKeyof,\n QueryClient,\n} from '@tanstack/query-core'\n\nexport interface HydrationBoundaryProps {\n state: DehydratedState | null | undefined\n options?: OmitKeyof & {\n defaultOptions?: OmitKeyof<\n Exclude,\n 'mutations'\n >\n }\n children?: React.ReactNode\n queryClient?: QueryClient\n}\n\nexport const HydrationBoundary = ({\n children,\n options = {},\n state,\n queryClient,\n}: HydrationBoundaryProps) => {\n const client = useQueryClient(queryClient)\n\n const optionsRef = React.useRef(options)\n React.useEffect(() => {\n optionsRef.current = options\n })\n\n // This useMemo is for performance reasons only, everything inside it must\n // be safe to run in every render and code here should be read as \"in render\".\n //\n // This code needs to happen during the render phase, because after initial\n // SSR, hydration needs to happen _before_ children render. Also, if hydrating\n // during a transition, we want to hydrate as much as is safe in render so\n // we can prerender as much as possible.\n //\n // For any queries that already exist in the cache, we want to hold back on\n // hydrating until _after_ the render phase. The reason for this is that during\n // transitions, we don't want the existing queries and observers to update to\n // the new data on the current page, only _after_ the transition is committed.\n // If the transition is aborted, we will have hydrated any _new_ queries, but\n // we throw away the fresh data for any existing ones to avoid unexpectedly\n // updating the UI.\n const hydrationQueue: DehydratedState['queries'] | undefined =\n React.useMemo(() => {\n if (state) {\n if (typeof state !== 'object') {\n return\n }\n\n const queryCache = client.getQueryCache()\n // State is supplied from the outside and we might as well fail\n // gracefully if it has the wrong shape, so while we type `queries`\n // as required, we still provide a fallback.\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n const queries = state.queries || []\n\n const newQueries: DehydratedState['queries'] = []\n const existingQueries: DehydratedState['queries'] = []\n for (const dehydratedQuery of queries) {\n const existingQuery = queryCache.get(dehydratedQuery.queryHash)\n\n if (!existingQuery) {\n newQueries.push(dehydratedQuery)\n } else {\n const hydrationIsNewer =\n dehydratedQuery.state.dataUpdatedAt >\n existingQuery.state.dataUpdatedAt ||\n (dehydratedQuery.promise &&\n existingQuery.state.status !== 'pending' &&\n existingQuery.state.fetchStatus !== 'fetching' &&\n dehydratedQuery.dehydratedAt !== undefined &&\n dehydratedQuery.dehydratedAt >\n existingQuery.state.dataUpdatedAt)\n\n if (hydrationIsNewer) {\n existingQueries.push(dehydratedQuery)\n }\n }\n }\n\n if (newQueries.length > 0) {\n // It's actually fine to call this with queries/state that already exists\n // in the cache, or is older. hydrate() is idempotent for queries.\n // eslint-disable-next-line react-hooks/refs\n hydrate(client, { queries: newQueries }, optionsRef.current)\n }\n if (existingQueries.length > 0) {\n return existingQueries\n }\n }\n return undefined\n }, [client, state])\n\n React.useEffect(() => {\n if (hydrationQueue) {\n hydrate(client, { queries: hydrationQueue }, optionsRef.current)\n }\n }, [client, hydrationQueue])\n\n return children as React.ReactElement\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,YAAuB;AAEvB,wBAAwB;AACxB,iCAA+B;AAoBxB,IAAM,oBAAoB,CAAC;AAAA,EAChC;AAAA,EACA,UAAU,CAAC;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.d.cts b/node_modules/@tanstack/react-query/build/modern/HydrationBoundary.d.cts deleted file mode 100644 index 39d63fa..0000000 --- a/node_modules/@tanstack/react-query/build/modern/HydrationBoundary.d.cts +++ /dev/null @@ -1,14 +0,0 @@ -import * as React from 'react'; -import { DehydratedState, OmitKeyof, HydrateOptions, QueryClient } from '@tanstack/query-core'; - -interface HydrationBoundaryProps { - state: DehydratedState | null | undefined; - options?: OmitKeyof & { - defaultOptions?: OmitKeyof, 'mutations'>; - }; - children?: React.ReactNode; - queryClient?: QueryClient; -} -declare const HydrationBoundary: ({ children, options, state, queryClient, }: HydrationBoundaryProps) => React.ReactElement; - -export { HydrationBoundary, type HydrationBoundaryProps }; diff --git a/node_modules/@tanstack/react-query/build/modern/HydrationBoundary.d.ts b/node_modules/@tanstack/react-query/build/modern/HydrationBoundary.d.ts deleted file mode 100644 index 39d63fa..0000000 --- a/node_modules/@tanstack/react-query/build/modern/HydrationBoundary.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -import * as React from 'react'; -import { DehydratedState, OmitKeyof, HydrateOptions, QueryClient } from '@tanstack/query-core'; - -interface HydrationBoundaryProps { - state: DehydratedState | null | undefined; - options?: OmitKeyof & { - defaultOptions?: OmitKeyof, 'mutations'>; - }; - children?: React.ReactNode; - queryClient?: QueryClient; -} -declare const HydrationBoundary: ({ children, options, state, queryClient, }: HydrationBoundaryProps) => React.ReactElement; - -export { HydrationBoundary, type HydrationBoundaryProps }; diff --git a/node_modules/@tanstack/react-query/build/modern/HydrationBoundary.js b/node_modules/@tanstack/react-query/build/modern/HydrationBoundary.js deleted file mode 100644 index 4acd78b..0000000 --- a/node_modules/@tanstack/react-query/build/modern/HydrationBoundary.js +++ /dev/null @@ -1,57 +0,0 @@ -"use client"; - -// src/HydrationBoundary.tsx -import * as React from "react"; -import { hydrate } from "@tanstack/query-core"; -import { useQueryClient } from "./QueryClientProvider.js"; -var HydrationBoundary = ({ - children, - options = {}, - state, - queryClient -}) => { - const client = useQueryClient(queryClient); - const optionsRef = React.useRef(options); - React.useEffect(() => { - optionsRef.current = options; - }); - const hydrationQueue = React.useMemo(() => { - if (state) { - if (typeof state !== "object") { - return; - } - const queryCache = client.getQueryCache(); - const queries = state.queries || []; - const newQueries = []; - const existingQueries = []; - for (const dehydratedQuery of queries) { - const existingQuery = queryCache.get(dehydratedQuery.queryHash); - if (!existingQuery) { - newQueries.push(dehydratedQuery); - } else { - const hydrationIsNewer = dehydratedQuery.state.dataUpdatedAt > existingQuery.state.dataUpdatedAt || dehydratedQuery.promise && existingQuery.state.status !== "pending" && existingQuery.state.fetchStatus !== "fetching" && dehydratedQuery.dehydratedAt !== void 0 && dehydratedQuery.dehydratedAt > existingQuery.state.dataUpdatedAt; - if (hydrationIsNewer) { - existingQueries.push(dehydratedQuery); - } - } - } - if (newQueries.length > 0) { - hydrate(client, { queries: newQueries }, optionsRef.current); - } - if (existingQueries.length > 0) { - return existingQueries; - } - } - return void 0; - }, [client, state]); - React.useEffect(() => { - if (hydrationQueue) { - hydrate(client, { queries: hydrationQueue }, optionsRef.current); - } - }, [client, hydrationQueue]); - return children; -}; -export { - HydrationBoundary -}; -//# sourceMappingURL=HydrationBoundary.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/HydrationBoundary.js.map b/node_modules/@tanstack/react-query/build/modern/HydrationBoundary.js.map deleted file mode 100644 index 63d8469..0000000 --- a/node_modules/@tanstack/react-query/build/modern/HydrationBoundary.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/HydrationBoundary.tsx"],"sourcesContent":["'use client'\nimport * as React from 'react'\n\nimport { hydrate } from '@tanstack/query-core'\nimport { useQueryClient } from './QueryClientProvider'\nimport type {\n DehydratedState,\n HydrateOptions,\n OmitKeyof,\n QueryClient,\n} from '@tanstack/query-core'\n\nexport interface HydrationBoundaryProps {\n state: DehydratedState | null | undefined\n options?: OmitKeyof & {\n defaultOptions?: OmitKeyof<\n Exclude,\n 'mutations'\n >\n }\n children?: React.ReactNode\n queryClient?: QueryClient\n}\n\nexport const HydrationBoundary = ({\n children,\n options = {},\n state,\n queryClient,\n}: HydrationBoundaryProps) => {\n const client = useQueryClient(queryClient)\n\n const optionsRef = React.useRef(options)\n React.useEffect(() => {\n optionsRef.current = options\n })\n\n // This useMemo is for performance reasons only, everything inside it must\n // be safe to run in every render and code here should be read as \"in render\".\n //\n // This code needs to happen during the render phase, because after initial\n // SSR, hydration needs to happen _before_ children render. Also, if hydrating\n // during a transition, we want to hydrate as much as is safe in render so\n // we can prerender as much as possible.\n //\n // For any queries that already exist in the cache, we want to hold back on\n // hydrating until _after_ the render phase. The reason for this is that during\n // transitions, we don't want the existing queries and observers to update to\n // the new data on the current page, only _after_ the transition is committed.\n // If the transition is aborted, we will have hydrated any _new_ queries, but\n // we throw away the fresh data for any existing ones to avoid unexpectedly\n // updating the UI.\n const hydrationQueue: DehydratedState['queries'] | undefined =\n React.useMemo(() => {\n if (state) {\n if (typeof state !== 'object') {\n return\n }\n\n const queryCache = client.getQueryCache()\n // State is supplied from the outside and we might as well fail\n // gracefully if it has the wrong shape, so while we type `queries`\n // as required, we still provide a fallback.\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n const queries = state.queries || []\n\n const newQueries: DehydratedState['queries'] = []\n const existingQueries: DehydratedState['queries'] = []\n for (const dehydratedQuery of queries) {\n const existingQuery = queryCache.get(dehydratedQuery.queryHash)\n\n if (!existingQuery) {\n newQueries.push(dehydratedQuery)\n } else {\n const hydrationIsNewer =\n dehydratedQuery.state.dataUpdatedAt >\n existingQuery.state.dataUpdatedAt ||\n (dehydratedQuery.promise &&\n existingQuery.state.status !== 'pending' &&\n existingQuery.state.fetchStatus !== 'fetching' &&\n dehydratedQuery.dehydratedAt !== undefined &&\n dehydratedQuery.dehydratedAt >\n existingQuery.state.dataUpdatedAt)\n\n if (hydrationIsNewer) {\n existingQueries.push(dehydratedQuery)\n }\n }\n }\n\n if (newQueries.length > 0) {\n // It's actually fine to call this with queries/state that already exists\n // in the cache, or is older. hydrate() is idempotent for queries.\n // eslint-disable-next-line react-hooks/refs\n hydrate(client, { queries: newQueries }, optionsRef.current)\n }\n if (existingQueries.length > 0) {\n return existingQueries\n }\n }\n return undefined\n }, [client, state])\n\n React.useEffect(() => {\n if (hydrationQueue) {\n hydrate(client, { queries: hydrationQueue }, optionsRef.current)\n }\n }, [client, hydrationQueue])\n\n return children as React.ReactElement\n}\n"],"mappings":";;;AACA,YAAY,WAAW;AAEvB,SAAS,eAAe;AACxB,SAAS,sBAAsB;AAoBxB,IAAM,oBAAoB,CAAC;AAAA,EAChC;AAAA,EACA,UAAU,CAAC;AAAA,EACX;AAAA,EACA;AACF,MAA8B;AAC5B,QAAM,SAAS,eAAe,WAAW;AAEzC,QAAM,aAAmB,aAAO,OAAO;AACvC,EAAM,gBAAU,MAAM;AACpB,eAAW,UAAU;AAAA,EACvB,CAAC;AAiBD,QAAM,iBACE,cAAQ,MAAM;AAClB,QAAI,OAAO;AACT,UAAI,OAAO,UAAU,UAAU;AAC7B;AAAA,MACF;AAEA,YAAM,aAAa,OAAO,cAAc;AAKxC,YAAM,UAAU,MAAM,WAAW,CAAC;AAElC,YAAM,aAAyC,CAAC;AAChD,YAAM,kBAA8C,CAAC;AACrD,iBAAW,mBAAmB,SAAS;AACrC,cAAM,gBAAgB,WAAW,IAAI,gBAAgB,SAAS;AAE9D,YAAI,CAAC,eAAe;AAClB,qBAAW,KAAK,eAAe;AAAA,QACjC,OAAO;AACL,gBAAM,mBACJ,gBAAgB,MAAM,gBACpB,cAAc,MAAM,iBACrB,gBAAgB,WACf,cAAc,MAAM,WAAW,aAC/B,cAAc,MAAM,gBAAgB,cACpC,gBAAgB,iBAAiB,UACjC,gBAAgB,eACd,cAAc,MAAM;AAE1B,cAAI,kBAAkB;AACpB,4BAAgB,KAAK,eAAe;AAAA,UACtC;AAAA,QACF;AAAA,MACF;AAEA,UAAI,WAAW,SAAS,GAAG;AAIzB,gBAAQ,QAAQ,EAAE,SAAS,WAAW,GAAG,WAAW,OAAO;AAAA,MAC7D;AACA,UAAI,gBAAgB,SAAS,GAAG;AAC9B,eAAO;AAAA,MACT;AAAA,IACF;AACA,WAAO;AAAA,EACT,GAAG,CAAC,QAAQ,KAAK,CAAC;AAEpB,EAAM,gBAAU,MAAM;AACpB,QAAI,gBAAgB;AAClB,cAAQ,QAAQ,EAAE,SAAS,eAAe,GAAG,WAAW,OAAO;AAAA,IACjE;AAAA,EACF,GAAG,CAAC,QAAQ,cAAc,CAAC;AAE3B,SAAO;AACT;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/IsRestoringProvider.cjs b/node_modules/@tanstack/react-query/build/modern/IsRestoringProvider.cjs deleted file mode 100644 index f607420..0000000 --- a/node_modules/@tanstack/react-query/build/modern/IsRestoringProvider.cjs +++ /dev/null @@ -1,47 +0,0 @@ -"use strict"; -"use client"; -var __create = Object.create; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __getProtoOf = Object.getPrototypeOf; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( - // If the importer is in node compatibility mode or this is not an ESM - // file that has been converted to a CommonJS file using a Babel- - // compatible transform (i.e. "__esModule" has not been set), then set - // "default" to the CommonJS "module.exports" for node compatibility. - isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, - mod -)); -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// src/IsRestoringProvider.ts -var IsRestoringProvider_exports = {}; -__export(IsRestoringProvider_exports, { - IsRestoringProvider: () => IsRestoringProvider, - useIsRestoring: () => useIsRestoring -}); -module.exports = __toCommonJS(IsRestoringProvider_exports); -var React = __toESM(require("react"), 1); -var IsRestoringContext = React.createContext(false); -var useIsRestoring = () => React.useContext(IsRestoringContext); -var IsRestoringProvider = IsRestoringContext.Provider; -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - IsRestoringProvider, - useIsRestoring -}); -//# sourceMappingURL=IsRestoringProvider.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/IsRestoringProvider.cjs.map b/node_modules/@tanstack/react-query/build/modern/IsRestoringProvider.cjs.map deleted file mode 100644 index 2c98a9d..0000000 --- a/node_modules/@tanstack/react-query/build/modern/IsRestoringProvider.cjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/IsRestoringProvider.ts"],"sourcesContent":["'use client'\nimport * as React from 'react'\n\nconst IsRestoringContext = React.createContext(false)\n\nexport const useIsRestoring = () => React.useContext(IsRestoringContext)\nexport const IsRestoringProvider = IsRestoringContext.Provider\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,YAAuB;AAEvB,IAAM,qBAA2B,oBAAc,KAAK;AAE7C,IAAM,iBAAiB,MAAY,iBAAW,kBAAkB;AAChE,IAAM,sBAAsB,mBAAmB;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/IsRestoringProvider.d.cts b/node_modules/@tanstack/react-query/build/modern/IsRestoringProvider.d.cts deleted file mode 100644 index 08b14ff..0000000 --- a/node_modules/@tanstack/react-query/build/modern/IsRestoringProvider.d.cts +++ /dev/null @@ -1,6 +0,0 @@ -import * as React from 'react'; - -declare const useIsRestoring: () => boolean; -declare const IsRestoringProvider: React.Provider; - -export { IsRestoringProvider, useIsRestoring }; diff --git a/node_modules/@tanstack/react-query/build/modern/IsRestoringProvider.d.ts b/node_modules/@tanstack/react-query/build/modern/IsRestoringProvider.d.ts deleted file mode 100644 index 08b14ff..0000000 --- a/node_modules/@tanstack/react-query/build/modern/IsRestoringProvider.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import * as React from 'react'; - -declare const useIsRestoring: () => boolean; -declare const IsRestoringProvider: React.Provider; - -export { IsRestoringProvider, useIsRestoring }; diff --git a/node_modules/@tanstack/react-query/build/modern/IsRestoringProvider.js b/node_modules/@tanstack/react-query/build/modern/IsRestoringProvider.js deleted file mode 100644 index 374f82e..0000000 --- a/node_modules/@tanstack/react-query/build/modern/IsRestoringProvider.js +++ /dev/null @@ -1,12 +0,0 @@ -"use client"; - -// src/IsRestoringProvider.ts -import * as React from "react"; -var IsRestoringContext = React.createContext(false); -var useIsRestoring = () => React.useContext(IsRestoringContext); -var IsRestoringProvider = IsRestoringContext.Provider; -export { - IsRestoringProvider, - useIsRestoring -}; -//# sourceMappingURL=IsRestoringProvider.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/IsRestoringProvider.js.map b/node_modules/@tanstack/react-query/build/modern/IsRestoringProvider.js.map deleted file mode 100644 index a31bfa3..0000000 --- a/node_modules/@tanstack/react-query/build/modern/IsRestoringProvider.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/IsRestoringProvider.ts"],"sourcesContent":["'use client'\nimport * as React from 'react'\n\nconst IsRestoringContext = React.createContext(false)\n\nexport const useIsRestoring = () => React.useContext(IsRestoringContext)\nexport const IsRestoringProvider = IsRestoringContext.Provider\n"],"mappings":";;;AACA,YAAY,WAAW;AAEvB,IAAM,qBAA2B,oBAAc,KAAK;AAE7C,IAAM,iBAAiB,MAAY,iBAAW,kBAAkB;AAChE,IAAM,sBAAsB,mBAAmB;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/QueryClientProvider.cjs b/node_modules/@tanstack/react-query/build/modern/QueryClientProvider.cjs deleted file mode 100644 index d91255c..0000000 --- a/node_modules/@tanstack/react-query/build/modern/QueryClientProvider.cjs +++ /dev/null @@ -1,72 +0,0 @@ -"use strict"; -"use client"; -var __create = Object.create; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __getProtoOf = Object.getPrototypeOf; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( - // If the importer is in node compatibility mode or this is not an ESM - // file that has been converted to a CommonJS file using a Babel- - // compatible transform (i.e. "__esModule" has not been set), then set - // "default" to the CommonJS "module.exports" for node compatibility. - isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, - mod -)); -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// src/QueryClientProvider.tsx -var QueryClientProvider_exports = {}; -__export(QueryClientProvider_exports, { - QueryClientContext: () => QueryClientContext, - QueryClientProvider: () => QueryClientProvider, - useQueryClient: () => useQueryClient -}); -module.exports = __toCommonJS(QueryClientProvider_exports); -var React = __toESM(require("react"), 1); -var import_jsx_runtime = require("react/jsx-runtime"); -var QueryClientContext = React.createContext( - void 0 -); -var useQueryClient = (queryClient) => { - const client = React.useContext(QueryClientContext); - if (queryClient) { - return queryClient; - } - if (!client) { - throw new Error("No QueryClient set, use QueryClientProvider to set one"); - } - return client; -}; -var QueryClientProvider = ({ - client, - children -}) => { - React.useEffect(() => { - client.mount(); - return () => { - client.unmount(); - }; - }, [client]); - return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(QueryClientContext.Provider, { value: client, children }); -}; -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - QueryClientContext, - QueryClientProvider, - useQueryClient -}); -//# sourceMappingURL=QueryClientProvider.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/QueryClientProvider.cjs.map b/node_modules/@tanstack/react-query/build/modern/QueryClientProvider.cjs.map deleted file mode 100644 index d97eb88..0000000 --- a/node_modules/@tanstack/react-query/build/modern/QueryClientProvider.cjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/QueryClientProvider.tsx"],"sourcesContent":["'use client'\nimport * as React from 'react'\n\nimport type { QueryClient } from '@tanstack/query-core'\n\nexport const QueryClientContext = React.createContext(\n undefined,\n)\n\nexport const useQueryClient = (queryClient?: QueryClient) => {\n const client = React.useContext(QueryClientContext)\n\n if (queryClient) {\n return queryClient\n }\n\n if (!client) {\n throw new Error('No QueryClient set, use QueryClientProvider to set one')\n }\n\n return client\n}\n\nexport type QueryClientProviderProps = {\n client: QueryClient\n children?: React.ReactNode\n}\n\nexport const QueryClientProvider = ({\n client,\n children,\n}: QueryClientProviderProps): React.JSX.Element => {\n React.useEffect(() => {\n client.mount()\n return () => {\n client.unmount()\n }\n }, [client])\n\n return (\n \n {children}\n \n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,YAAuB;AAuCnB;AAnCG,IAAM,qBAA2B;AAAA,EACtC;AACF;AAEO,IAAM,iBAAiB,CAAC,gBAA8B;AAC3D,QAAM,SAAe,iBAAW,kBAAkB;AAElD,MAAI,aAAa;AACf,WAAO;AAAA,EACT;AAEA,MAAI,CAAC,QAAQ;AACX,UAAM,IAAI,MAAM,wDAAwD;AAAA,EAC1E;AAEA,SAAO;AACT;AAOO,IAAM,sBAAsB,CAAC;AAAA,EAClC;AAAA,EACA;AACF,MAAmD;AACjD,EAAM,gBAAU,MAAM;AACpB,WAAO,MAAM;AACb,WAAO,MAAM;AACX,aAAO,QAAQ;AAAA,IACjB;AAAA,EACF,GAAG,CAAC,MAAM,CAAC;AAEX,SACE,4CAAC,mBAAmB,UAAnB,EAA4B,OAAO,QACjC,UACH;AAEJ;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/QueryClientProvider.d.cts b/node_modules/@tanstack/react-query/build/modern/QueryClientProvider.d.cts deleted file mode 100644 index 1b1fd69..0000000 --- a/node_modules/@tanstack/react-query/build/modern/QueryClientProvider.d.cts +++ /dev/null @@ -1,12 +0,0 @@ -import * as React from 'react'; -import { QueryClient } from '@tanstack/query-core'; - -declare const QueryClientContext: React.Context; -declare const useQueryClient: (queryClient?: QueryClient) => QueryClient; -type QueryClientProviderProps = { - client: QueryClient; - children?: React.ReactNode; -}; -declare const QueryClientProvider: ({ client, children, }: QueryClientProviderProps) => React.JSX.Element; - -export { QueryClientContext, QueryClientProvider, type QueryClientProviderProps, useQueryClient }; diff --git a/node_modules/@tanstack/react-query/build/modern/QueryClientProvider.d.ts b/node_modules/@tanstack/react-query/build/modern/QueryClientProvider.d.ts deleted file mode 100644 index 1b1fd69..0000000 --- a/node_modules/@tanstack/react-query/build/modern/QueryClientProvider.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -import * as React from 'react'; -import { QueryClient } from '@tanstack/query-core'; - -declare const QueryClientContext: React.Context; -declare const useQueryClient: (queryClient?: QueryClient) => QueryClient; -type QueryClientProviderProps = { - client: QueryClient; - children?: React.ReactNode; -}; -declare const QueryClientProvider: ({ client, children, }: QueryClientProviderProps) => React.JSX.Element; - -export { QueryClientContext, QueryClientProvider, type QueryClientProviderProps, useQueryClient }; diff --git a/node_modules/@tanstack/react-query/build/modern/QueryClientProvider.js b/node_modules/@tanstack/react-query/build/modern/QueryClientProvider.js deleted file mode 100644 index fc4d5f2..0000000 --- a/node_modules/@tanstack/react-query/build/modern/QueryClientProvider.js +++ /dev/null @@ -1,36 +0,0 @@ -"use client"; - -// src/QueryClientProvider.tsx -import * as React from "react"; -import { jsx } from "react/jsx-runtime"; -var QueryClientContext = React.createContext( - void 0 -); -var useQueryClient = (queryClient) => { - const client = React.useContext(QueryClientContext); - if (queryClient) { - return queryClient; - } - if (!client) { - throw new Error("No QueryClient set, use QueryClientProvider to set one"); - } - return client; -}; -var QueryClientProvider = ({ - client, - children -}) => { - React.useEffect(() => { - client.mount(); - return () => { - client.unmount(); - }; - }, [client]); - return /* @__PURE__ */ jsx(QueryClientContext.Provider, { value: client, children }); -}; -export { - QueryClientContext, - QueryClientProvider, - useQueryClient -}; -//# sourceMappingURL=QueryClientProvider.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/QueryClientProvider.js.map b/node_modules/@tanstack/react-query/build/modern/QueryClientProvider.js.map deleted file mode 100644 index 44bad03..0000000 --- a/node_modules/@tanstack/react-query/build/modern/QueryClientProvider.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/QueryClientProvider.tsx"],"sourcesContent":["'use client'\nimport * as React from 'react'\n\nimport type { QueryClient } from '@tanstack/query-core'\n\nexport const QueryClientContext = React.createContext(\n undefined,\n)\n\nexport const useQueryClient = (queryClient?: QueryClient) => {\n const client = React.useContext(QueryClientContext)\n\n if (queryClient) {\n return queryClient\n }\n\n if (!client) {\n throw new Error('No QueryClient set, use QueryClientProvider to set one')\n }\n\n return client\n}\n\nexport type QueryClientProviderProps = {\n client: QueryClient\n children?: React.ReactNode\n}\n\nexport const QueryClientProvider = ({\n client,\n children,\n}: QueryClientProviderProps): React.JSX.Element => {\n React.useEffect(() => {\n client.mount()\n return () => {\n client.unmount()\n }\n }, [client])\n\n return (\n \n {children}\n \n )\n}\n"],"mappings":";;;AACA,YAAY,WAAW;AAuCnB;AAnCG,IAAM,qBAA2B;AAAA,EACtC;AACF;AAEO,IAAM,iBAAiB,CAAC,gBAA8B;AAC3D,QAAM,SAAe,iBAAW,kBAAkB;AAElD,MAAI,aAAa;AACf,WAAO;AAAA,EACT;AAEA,MAAI,CAAC,QAAQ;AACX,UAAM,IAAI,MAAM,wDAAwD;AAAA,EAC1E;AAEA,SAAO;AACT;AAOO,IAAM,sBAAsB,CAAC;AAAA,EAClC;AAAA,EACA;AACF,MAAmD;AACjD,EAAM,gBAAU,MAAM;AACpB,WAAO,MAAM;AACb,WAAO,MAAM;AACX,aAAO,QAAQ;AAAA,IACjB;AAAA,EACF,GAAG,CAAC,MAAM,CAAC;AAEX,SACE,oBAAC,mBAAmB,UAAnB,EAA4B,OAAO,QACjC,UACH;AAEJ;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/QueryErrorResetBoundary.cjs b/node_modules/@tanstack/react-query/build/modern/QueryErrorResetBoundary.cjs deleted file mode 100644 index 7c86436..0000000 --- a/node_modules/@tanstack/react-query/build/modern/QueryErrorResetBoundary.cjs +++ /dev/null @@ -1,67 +0,0 @@ -"use strict"; -"use client"; -var __create = Object.create; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __getProtoOf = Object.getPrototypeOf; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( - // If the importer is in node compatibility mode or this is not an ESM - // file that has been converted to a CommonJS file using a Babel- - // compatible transform (i.e. "__esModule" has not been set), then set - // "default" to the CommonJS "module.exports" for node compatibility. - isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, - mod -)); -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// src/QueryErrorResetBoundary.tsx -var QueryErrorResetBoundary_exports = {}; -__export(QueryErrorResetBoundary_exports, { - QueryErrorResetBoundary: () => QueryErrorResetBoundary, - useQueryErrorResetBoundary: () => useQueryErrorResetBoundary -}); -module.exports = __toCommonJS(QueryErrorResetBoundary_exports); -var React = __toESM(require("react"), 1); -var import_jsx_runtime = require("react/jsx-runtime"); -function createValue() { - let isReset = false; - return { - clearReset: () => { - isReset = false; - }, - reset: () => { - isReset = true; - }, - isReset: () => { - return isReset; - } - }; -} -var QueryErrorResetBoundaryContext = React.createContext(createValue()); -var useQueryErrorResetBoundary = () => React.useContext(QueryErrorResetBoundaryContext); -var QueryErrorResetBoundary = ({ - children -}) => { - const [value] = React.useState(() => createValue()); - return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(QueryErrorResetBoundaryContext.Provider, { value, children: typeof children === "function" ? children(value) : children }); -}; -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - QueryErrorResetBoundary, - useQueryErrorResetBoundary -}); -//# sourceMappingURL=QueryErrorResetBoundary.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/QueryErrorResetBoundary.cjs.map b/node_modules/@tanstack/react-query/build/modern/QueryErrorResetBoundary.cjs.map deleted file mode 100644 index 29c7b08..0000000 --- a/node_modules/@tanstack/react-query/build/modern/QueryErrorResetBoundary.cjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/QueryErrorResetBoundary.tsx"],"sourcesContent":["'use client'\nimport * as React from 'react'\n\n// CONTEXT\nexport type QueryErrorResetFunction = () => void\nexport type QueryErrorIsResetFunction = () => boolean\nexport type QueryErrorClearResetFunction = () => void\n\nexport interface QueryErrorResetBoundaryValue {\n clearReset: QueryErrorClearResetFunction\n isReset: QueryErrorIsResetFunction\n reset: QueryErrorResetFunction\n}\n\nfunction createValue(): QueryErrorResetBoundaryValue {\n let isReset = false\n return {\n clearReset: () => {\n isReset = false\n },\n reset: () => {\n isReset = true\n },\n isReset: () => {\n return isReset\n },\n }\n}\n\nconst QueryErrorResetBoundaryContext = React.createContext(createValue())\n\n// HOOK\n\nexport const useQueryErrorResetBoundary = () =>\n React.useContext(QueryErrorResetBoundaryContext)\n\n// COMPONENT\n\nexport type QueryErrorResetBoundaryFunction = (\n value: QueryErrorResetBoundaryValue,\n) => React.ReactNode\n\nexport interface QueryErrorResetBoundaryProps {\n children: QueryErrorResetBoundaryFunction | React.ReactNode\n}\n\nexport const QueryErrorResetBoundary = ({\n children,\n}: QueryErrorResetBoundaryProps) => {\n const [value] = React.useState(() => createValue())\n return (\n \n {typeof children === 'function' ? children(value) : children}\n \n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,YAAuB;AAkDnB;AArCJ,SAAS,cAA4C;AACnD,MAAI,UAAU;AACd,SAAO;AAAA,IACL,YAAY,MAAM;AAChB,gBAAU;AAAA,IACZ;AAAA,IACA,OAAO,MAAM;AACX,gBAAU;AAAA,IACZ;AAAA,IACA,SAAS,MAAM;AACb,aAAO;AAAA,IACT;AAAA,EACF;AACF;AAEA,IAAM,iCAAuC,oBAAc,YAAY,CAAC;AAIjE,IAAM,6BAA6B,MAClC,iBAAW,8BAA8B;AAY1C,IAAM,0BAA0B,CAAC;AAAA,EACtC;AACF,MAAoC;AAClC,QAAM,CAAC,KAAK,IAAU,eAAS,MAAM,YAAY,CAAC;AAClD,SACE,4CAAC,+BAA+B,UAA/B,EAAwC,OACtC,iBAAO,aAAa,aAAa,SAAS,KAAK,IAAI,UACtD;AAEJ;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/QueryErrorResetBoundary.d.cts b/node_modules/@tanstack/react-query/build/modern/QueryErrorResetBoundary.d.cts deleted file mode 100644 index bfb5745..0000000 --- a/node_modules/@tanstack/react-query/build/modern/QueryErrorResetBoundary.d.cts +++ /dev/null @@ -1,19 +0,0 @@ -import * as react_jsx_runtime from 'react/jsx-runtime'; -import * as React from 'react'; - -type QueryErrorResetFunction = () => void; -type QueryErrorIsResetFunction = () => boolean; -type QueryErrorClearResetFunction = () => void; -interface QueryErrorResetBoundaryValue { - clearReset: QueryErrorClearResetFunction; - isReset: QueryErrorIsResetFunction; - reset: QueryErrorResetFunction; -} -declare const useQueryErrorResetBoundary: () => QueryErrorResetBoundaryValue; -type QueryErrorResetBoundaryFunction = (value: QueryErrorResetBoundaryValue) => React.ReactNode; -interface QueryErrorResetBoundaryProps { - children: QueryErrorResetBoundaryFunction | React.ReactNode; -} -declare const QueryErrorResetBoundary: ({ children, }: QueryErrorResetBoundaryProps) => react_jsx_runtime.JSX.Element; - -export { type QueryErrorClearResetFunction, type QueryErrorIsResetFunction, QueryErrorResetBoundary, type QueryErrorResetBoundaryFunction, type QueryErrorResetBoundaryProps, type QueryErrorResetBoundaryValue, type QueryErrorResetFunction, useQueryErrorResetBoundary }; diff --git a/node_modules/@tanstack/react-query/build/modern/QueryErrorResetBoundary.d.ts b/node_modules/@tanstack/react-query/build/modern/QueryErrorResetBoundary.d.ts deleted file mode 100644 index bfb5745..0000000 --- a/node_modules/@tanstack/react-query/build/modern/QueryErrorResetBoundary.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -import * as react_jsx_runtime from 'react/jsx-runtime'; -import * as React from 'react'; - -type QueryErrorResetFunction = () => void; -type QueryErrorIsResetFunction = () => boolean; -type QueryErrorClearResetFunction = () => void; -interface QueryErrorResetBoundaryValue { - clearReset: QueryErrorClearResetFunction; - isReset: QueryErrorIsResetFunction; - reset: QueryErrorResetFunction; -} -declare const useQueryErrorResetBoundary: () => QueryErrorResetBoundaryValue; -type QueryErrorResetBoundaryFunction = (value: QueryErrorResetBoundaryValue) => React.ReactNode; -interface QueryErrorResetBoundaryProps { - children: QueryErrorResetBoundaryFunction | React.ReactNode; -} -declare const QueryErrorResetBoundary: ({ children, }: QueryErrorResetBoundaryProps) => react_jsx_runtime.JSX.Element; - -export { type QueryErrorClearResetFunction, type QueryErrorIsResetFunction, QueryErrorResetBoundary, type QueryErrorResetBoundaryFunction, type QueryErrorResetBoundaryProps, type QueryErrorResetBoundaryValue, type QueryErrorResetFunction, useQueryErrorResetBoundary }; diff --git a/node_modules/@tanstack/react-query/build/modern/QueryErrorResetBoundary.js b/node_modules/@tanstack/react-query/build/modern/QueryErrorResetBoundary.js deleted file mode 100644 index ae56edc..0000000 --- a/node_modules/@tanstack/react-query/build/modern/QueryErrorResetBoundary.js +++ /dev/null @@ -1,32 +0,0 @@ -"use client"; - -// src/QueryErrorResetBoundary.tsx -import * as React from "react"; -import { jsx } from "react/jsx-runtime"; -function createValue() { - let isReset = false; - return { - clearReset: () => { - isReset = false; - }, - reset: () => { - isReset = true; - }, - isReset: () => { - return isReset; - } - }; -} -var QueryErrorResetBoundaryContext = React.createContext(createValue()); -var useQueryErrorResetBoundary = () => React.useContext(QueryErrorResetBoundaryContext); -var QueryErrorResetBoundary = ({ - children -}) => { - const [value] = React.useState(() => createValue()); - return /* @__PURE__ */ jsx(QueryErrorResetBoundaryContext.Provider, { value, children: typeof children === "function" ? children(value) : children }); -}; -export { - QueryErrorResetBoundary, - useQueryErrorResetBoundary -}; -//# sourceMappingURL=QueryErrorResetBoundary.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/QueryErrorResetBoundary.js.map b/node_modules/@tanstack/react-query/build/modern/QueryErrorResetBoundary.js.map deleted file mode 100644 index c8b04a7..0000000 --- a/node_modules/@tanstack/react-query/build/modern/QueryErrorResetBoundary.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/QueryErrorResetBoundary.tsx"],"sourcesContent":["'use client'\nimport * as React from 'react'\n\n// CONTEXT\nexport type QueryErrorResetFunction = () => void\nexport type QueryErrorIsResetFunction = () => boolean\nexport type QueryErrorClearResetFunction = () => void\n\nexport interface QueryErrorResetBoundaryValue {\n clearReset: QueryErrorClearResetFunction\n isReset: QueryErrorIsResetFunction\n reset: QueryErrorResetFunction\n}\n\nfunction createValue(): QueryErrorResetBoundaryValue {\n let isReset = false\n return {\n clearReset: () => {\n isReset = false\n },\n reset: () => {\n isReset = true\n },\n isReset: () => {\n return isReset\n },\n }\n}\n\nconst QueryErrorResetBoundaryContext = React.createContext(createValue())\n\n// HOOK\n\nexport const useQueryErrorResetBoundary = () =>\n React.useContext(QueryErrorResetBoundaryContext)\n\n// COMPONENT\n\nexport type QueryErrorResetBoundaryFunction = (\n value: QueryErrorResetBoundaryValue,\n) => React.ReactNode\n\nexport interface QueryErrorResetBoundaryProps {\n children: QueryErrorResetBoundaryFunction | React.ReactNode\n}\n\nexport const QueryErrorResetBoundary = ({\n children,\n}: QueryErrorResetBoundaryProps) => {\n const [value] = React.useState(() => createValue())\n return (\n \n {typeof children === 'function' ? children(value) : children}\n \n )\n}\n"],"mappings":";;;AACA,YAAY,WAAW;AAkDnB;AArCJ,SAAS,cAA4C;AACnD,MAAI,UAAU;AACd,SAAO;AAAA,IACL,YAAY,MAAM;AAChB,gBAAU;AAAA,IACZ;AAAA,IACA,OAAO,MAAM;AACX,gBAAU;AAAA,IACZ;AAAA,IACA,SAAS,MAAM;AACb,aAAO;AAAA,IACT;AAAA,EACF;AACF;AAEA,IAAM,iCAAuC,oBAAc,YAAY,CAAC;AAIjE,IAAM,6BAA6B,MAClC,iBAAW,8BAA8B;AAY1C,IAAM,0BAA0B,CAAC;AAAA,EACtC;AACF,MAAoC;AAClC,QAAM,CAAC,KAAK,IAAU,eAAS,MAAM,YAAY,CAAC;AAClD,SACE,oBAAC,+BAA+B,UAA/B,EAAwC,OACtC,iBAAO,aAAa,aAAa,SAAS,KAAK,IAAI,UACtD;AAEJ;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/errorBoundaryUtils.cjs b/node_modules/@tanstack/react-query/build/modern/errorBoundaryUtils.cjs deleted file mode 100644 index eada8e3..0000000 --- a/node_modules/@tanstack/react-query/build/modern/errorBoundaryUtils.cjs +++ /dev/null @@ -1,69 +0,0 @@ -"use strict"; -"use client"; -var __create = Object.create; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __getProtoOf = Object.getPrototypeOf; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( - // If the importer is in node compatibility mode or this is not an ESM - // file that has been converted to a CommonJS file using a Babel- - // compatible transform (i.e. "__esModule" has not been set), then set - // "default" to the CommonJS "module.exports" for node compatibility. - isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, - mod -)); -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// src/errorBoundaryUtils.ts -var errorBoundaryUtils_exports = {}; -__export(errorBoundaryUtils_exports, { - ensurePreventErrorBoundaryRetry: () => ensurePreventErrorBoundaryRetry, - getHasError: () => getHasError, - useClearResetErrorBoundary: () => useClearResetErrorBoundary -}); -module.exports = __toCommonJS(errorBoundaryUtils_exports); -var React = __toESM(require("react"), 1); -var import_query_core = require("@tanstack/query-core"); -var ensurePreventErrorBoundaryRetry = (options, errorResetBoundary, query) => { - const throwOnError = query?.state.error && typeof options.throwOnError === "function" ? (0, import_query_core.shouldThrowError)(options.throwOnError, [query.state.error, query]) : options.throwOnError; - if (options.suspense || options.experimental_prefetchInRender || throwOnError) { - if (!errorResetBoundary.isReset()) { - options.retryOnMount = false; - } - } -}; -var useClearResetErrorBoundary = (errorResetBoundary) => { - React.useEffect(() => { - errorResetBoundary.clearReset(); - }, [errorResetBoundary]); -}; -var getHasError = ({ - result, - errorResetBoundary, - throwOnError, - query, - suspense -}) => { - return result.isError && !errorResetBoundary.isReset() && !result.isFetching && query && (suspense && result.data === void 0 || (0, import_query_core.shouldThrowError)(throwOnError, [result.error, query])); -}; -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - ensurePreventErrorBoundaryRetry, - getHasError, - useClearResetErrorBoundary -}); -//# sourceMappingURL=errorBoundaryUtils.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/errorBoundaryUtils.cjs.map b/node_modules/@tanstack/react-query/build/modern/errorBoundaryUtils.cjs.map deleted file mode 100644 index a3e5032..0000000 --- a/node_modules/@tanstack/react-query/build/modern/errorBoundaryUtils.cjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/errorBoundaryUtils.ts"],"sourcesContent":["'use client'\nimport * as React from 'react'\nimport { shouldThrowError } from '@tanstack/query-core'\nimport type {\n DefaultedQueryObserverOptions,\n Query,\n QueryKey,\n QueryObserverResult,\n ThrowOnError,\n} from '@tanstack/query-core'\nimport type { QueryErrorResetBoundaryValue } from './QueryErrorResetBoundary'\n\nexport const ensurePreventErrorBoundaryRetry = <\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey extends QueryKey,\n>(\n options: DefaultedQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >,\n errorResetBoundary: QueryErrorResetBoundaryValue,\n query: Query | undefined,\n) => {\n const throwOnError =\n query?.state.error && typeof options.throwOnError === 'function'\n ? shouldThrowError(options.throwOnError, [query.state.error, query])\n : options.throwOnError\n\n if (\n options.suspense ||\n options.experimental_prefetchInRender ||\n throwOnError\n ) {\n // Prevent retrying failed query if the error boundary has not been reset yet\n if (!errorResetBoundary.isReset()) {\n options.retryOnMount = false\n }\n }\n}\n\nexport const useClearResetErrorBoundary = (\n errorResetBoundary: QueryErrorResetBoundaryValue,\n) => {\n React.useEffect(() => {\n errorResetBoundary.clearReset()\n }, [errorResetBoundary])\n}\n\nexport const getHasError = <\n TData,\n TError,\n TQueryFnData,\n TQueryData,\n TQueryKey extends QueryKey,\n>({\n result,\n errorResetBoundary,\n throwOnError,\n query,\n suspense,\n}: {\n result: QueryObserverResult\n errorResetBoundary: QueryErrorResetBoundaryValue\n throwOnError: ThrowOnError\n query: Query | undefined\n suspense: boolean | undefined\n}) => {\n return (\n result.isError &&\n !errorResetBoundary.isReset() &&\n !result.isFetching &&\n query &&\n ((suspense && result.data === undefined) ||\n shouldThrowError(throwOnError, [result.error, query]))\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,YAAuB;AACvB,wBAAiC;AAU1B,IAAM,kCAAkC,CAO7C,SAOA,oBACA,UACG;AACH,QAAM,eACJ,OAAO,MAAM,SAAS,OAAO,QAAQ,iBAAiB,iBAClD,oCAAiB,QAAQ,cAAc,CAAC,MAAM,MAAM,OAAO,KAAK,CAAC,IACjE,QAAQ;AAEd,MACE,QAAQ,YACR,QAAQ,iCACR,cACA;AAEA,QAAI,CAAC,mBAAmB,QAAQ,GAAG;AACjC,cAAQ,eAAe;AAAA,IACzB;AAAA,EACF;AACF;AAEO,IAAM,6BAA6B,CACxC,uBACG;AACH,EAAM,gBAAU,MAAM;AACpB,uBAAmB,WAAW;AAAA,EAChC,GAAG,CAAC,kBAAkB,CAAC;AACzB;AAEO,IAAM,cAAc,CAMzB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MAMM;AACJ,SACE,OAAO,WACP,CAAC,mBAAmB,QAAQ,KAC5B,CAAC,OAAO,cACR,UACE,YAAY,OAAO,SAAS,cAC5B,oCAAiB,cAAc,CAAC,OAAO,OAAO,KAAK,CAAC;AAE1D;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/errorBoundaryUtils.d.cts b/node_modules/@tanstack/react-query/build/modern/errorBoundaryUtils.d.cts deleted file mode 100644 index 1a46fd1..0000000 --- a/node_modules/@tanstack/react-query/build/modern/errorBoundaryUtils.d.cts +++ /dev/null @@ -1,16 +0,0 @@ -import { QueryKey, DefaultedQueryObserverOptions, Query, QueryObserverResult, ThrowOnError } from '@tanstack/query-core'; -import { QueryErrorResetBoundaryValue } from './QueryErrorResetBoundary.cjs'; -import 'react/jsx-runtime'; -import 'react'; - -declare const ensurePreventErrorBoundaryRetry: (options: DefaultedQueryObserverOptions, errorResetBoundary: QueryErrorResetBoundaryValue, query: Query | undefined) => void; -declare const useClearResetErrorBoundary: (errorResetBoundary: QueryErrorResetBoundaryValue) => void; -declare const getHasError: ({ result, errorResetBoundary, throwOnError, query, suspense, }: { - result: QueryObserverResult; - errorResetBoundary: QueryErrorResetBoundaryValue; - throwOnError: ThrowOnError; - query: Query | undefined; - suspense: boolean | undefined; -}) => boolean | undefined; - -export { ensurePreventErrorBoundaryRetry, getHasError, useClearResetErrorBoundary }; diff --git a/node_modules/@tanstack/react-query/build/modern/errorBoundaryUtils.d.ts b/node_modules/@tanstack/react-query/build/modern/errorBoundaryUtils.d.ts deleted file mode 100644 index 3b9fc8b..0000000 --- a/node_modules/@tanstack/react-query/build/modern/errorBoundaryUtils.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { QueryKey, DefaultedQueryObserverOptions, Query, QueryObserverResult, ThrowOnError } from '@tanstack/query-core'; -import { QueryErrorResetBoundaryValue } from './QueryErrorResetBoundary.js'; -import 'react/jsx-runtime'; -import 'react'; - -declare const ensurePreventErrorBoundaryRetry: (options: DefaultedQueryObserverOptions, errorResetBoundary: QueryErrorResetBoundaryValue, query: Query | undefined) => void; -declare const useClearResetErrorBoundary: (errorResetBoundary: QueryErrorResetBoundaryValue) => void; -declare const getHasError: ({ result, errorResetBoundary, throwOnError, query, suspense, }: { - result: QueryObserverResult; - errorResetBoundary: QueryErrorResetBoundaryValue; - throwOnError: ThrowOnError; - query: Query | undefined; - suspense: boolean | undefined; -}) => boolean | undefined; - -export { ensurePreventErrorBoundaryRetry, getHasError, useClearResetErrorBoundary }; diff --git a/node_modules/@tanstack/react-query/build/modern/errorBoundaryUtils.js b/node_modules/@tanstack/react-query/build/modern/errorBoundaryUtils.js deleted file mode 100644 index 548f738..0000000 --- a/node_modules/@tanstack/react-query/build/modern/errorBoundaryUtils.js +++ /dev/null @@ -1,33 +0,0 @@ -"use client"; - -// src/errorBoundaryUtils.ts -import * as React from "react"; -import { shouldThrowError } from "@tanstack/query-core"; -var ensurePreventErrorBoundaryRetry = (options, errorResetBoundary, query) => { - const throwOnError = query?.state.error && typeof options.throwOnError === "function" ? shouldThrowError(options.throwOnError, [query.state.error, query]) : options.throwOnError; - if (options.suspense || options.experimental_prefetchInRender || throwOnError) { - if (!errorResetBoundary.isReset()) { - options.retryOnMount = false; - } - } -}; -var useClearResetErrorBoundary = (errorResetBoundary) => { - React.useEffect(() => { - errorResetBoundary.clearReset(); - }, [errorResetBoundary]); -}; -var getHasError = ({ - result, - errorResetBoundary, - throwOnError, - query, - suspense -}) => { - return result.isError && !errorResetBoundary.isReset() && !result.isFetching && query && (suspense && result.data === void 0 || shouldThrowError(throwOnError, [result.error, query])); -}; -export { - ensurePreventErrorBoundaryRetry, - getHasError, - useClearResetErrorBoundary -}; -//# sourceMappingURL=errorBoundaryUtils.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/errorBoundaryUtils.js.map b/node_modules/@tanstack/react-query/build/modern/errorBoundaryUtils.js.map deleted file mode 100644 index 9a29308..0000000 --- a/node_modules/@tanstack/react-query/build/modern/errorBoundaryUtils.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/errorBoundaryUtils.ts"],"sourcesContent":["'use client'\nimport * as React from 'react'\nimport { shouldThrowError } from '@tanstack/query-core'\nimport type {\n DefaultedQueryObserverOptions,\n Query,\n QueryKey,\n QueryObserverResult,\n ThrowOnError,\n} from '@tanstack/query-core'\nimport type { QueryErrorResetBoundaryValue } from './QueryErrorResetBoundary'\n\nexport const ensurePreventErrorBoundaryRetry = <\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey extends QueryKey,\n>(\n options: DefaultedQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >,\n errorResetBoundary: QueryErrorResetBoundaryValue,\n query: Query | undefined,\n) => {\n const throwOnError =\n query?.state.error && typeof options.throwOnError === 'function'\n ? shouldThrowError(options.throwOnError, [query.state.error, query])\n : options.throwOnError\n\n if (\n options.suspense ||\n options.experimental_prefetchInRender ||\n throwOnError\n ) {\n // Prevent retrying failed query if the error boundary has not been reset yet\n if (!errorResetBoundary.isReset()) {\n options.retryOnMount = false\n }\n }\n}\n\nexport const useClearResetErrorBoundary = (\n errorResetBoundary: QueryErrorResetBoundaryValue,\n) => {\n React.useEffect(() => {\n errorResetBoundary.clearReset()\n }, [errorResetBoundary])\n}\n\nexport const getHasError = <\n TData,\n TError,\n TQueryFnData,\n TQueryData,\n TQueryKey extends QueryKey,\n>({\n result,\n errorResetBoundary,\n throwOnError,\n query,\n suspense,\n}: {\n result: QueryObserverResult\n errorResetBoundary: QueryErrorResetBoundaryValue\n throwOnError: ThrowOnError\n query: Query | undefined\n suspense: boolean | undefined\n}) => {\n return (\n result.isError &&\n !errorResetBoundary.isReset() &&\n !result.isFetching &&\n query &&\n ((suspense && result.data === undefined) ||\n shouldThrowError(throwOnError, [result.error, query]))\n )\n}\n"],"mappings":";;;AACA,YAAY,WAAW;AACvB,SAAS,wBAAwB;AAU1B,IAAM,kCAAkC,CAO7C,SAOA,oBACA,UACG;AACH,QAAM,eACJ,OAAO,MAAM,SAAS,OAAO,QAAQ,iBAAiB,aAClD,iBAAiB,QAAQ,cAAc,CAAC,MAAM,MAAM,OAAO,KAAK,CAAC,IACjE,QAAQ;AAEd,MACE,QAAQ,YACR,QAAQ,iCACR,cACA;AAEA,QAAI,CAAC,mBAAmB,QAAQ,GAAG;AACjC,cAAQ,eAAe;AAAA,IACzB;AAAA,EACF;AACF;AAEO,IAAM,6BAA6B,CACxC,uBACG;AACH,EAAM,gBAAU,MAAM;AACpB,uBAAmB,WAAW;AAAA,EAChC,GAAG,CAAC,kBAAkB,CAAC;AACzB;AAEO,IAAM,cAAc,CAMzB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MAMM;AACJ,SACE,OAAO,WACP,CAAC,mBAAmB,QAAQ,KAC5B,CAAC,OAAO,cACR,UACE,YAAY,OAAO,SAAS,UAC5B,iBAAiB,cAAc,CAAC,OAAO,OAAO,KAAK,CAAC;AAE1D;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/index.cjs b/node_modules/@tanstack/react-query/build/modern/index.cjs deleted file mode 100644 index 0d7d36f..0000000 --- a/node_modules/@tanstack/react-query/build/modern/index.cjs +++ /dev/null @@ -1,97 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default")); -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// src/index.ts -var index_exports = {}; -__export(index_exports, { - HydrationBoundary: () => import_HydrationBoundary.HydrationBoundary, - IsRestoringProvider: () => import_IsRestoringProvider.IsRestoringProvider, - QueryClientContext: () => import_QueryClientProvider.QueryClientContext, - QueryClientProvider: () => import_QueryClientProvider.QueryClientProvider, - QueryErrorResetBoundary: () => import_QueryErrorResetBoundary.QueryErrorResetBoundary, - infiniteQueryOptions: () => import_infiniteQueryOptions.infiniteQueryOptions, - mutationOptions: () => import_mutationOptions.mutationOptions, - queryOptions: () => import_queryOptions.queryOptions, - useInfiniteQuery: () => import_useInfiniteQuery.useInfiniteQuery, - useIsFetching: () => import_useIsFetching.useIsFetching, - useIsMutating: () => import_useMutationState.useIsMutating, - useIsRestoring: () => import_IsRestoringProvider.useIsRestoring, - useMutation: () => import_useMutation.useMutation, - useMutationState: () => import_useMutationState.useMutationState, - usePrefetchInfiniteQuery: () => import_usePrefetchInfiniteQuery.usePrefetchInfiniteQuery, - usePrefetchQuery: () => import_usePrefetchQuery.usePrefetchQuery, - useQueries: () => import_useQueries.useQueries, - useQuery: () => import_useQuery.useQuery, - useQueryClient: () => import_QueryClientProvider.useQueryClient, - useQueryErrorResetBoundary: () => import_QueryErrorResetBoundary.useQueryErrorResetBoundary, - useSuspenseInfiniteQuery: () => import_useSuspenseInfiniteQuery.useSuspenseInfiniteQuery, - useSuspenseQueries: () => import_useSuspenseQueries.useSuspenseQueries, - useSuspenseQuery: () => import_useSuspenseQuery.useSuspenseQuery -}); -module.exports = __toCommonJS(index_exports); -__reExport(index_exports, require("@tanstack/query-core"), module.exports); -__reExport(index_exports, require("./types.cjs"), module.exports); -var import_useQueries = require("./useQueries.cjs"); -var import_useQuery = require("./useQuery.cjs"); -var import_useSuspenseQuery = require("./useSuspenseQuery.cjs"); -var import_useSuspenseInfiniteQuery = require("./useSuspenseInfiniteQuery.cjs"); -var import_useSuspenseQueries = require("./useSuspenseQueries.cjs"); -var import_usePrefetchQuery = require("./usePrefetchQuery.cjs"); -var import_usePrefetchInfiniteQuery = require("./usePrefetchInfiniteQuery.cjs"); -var import_queryOptions = require("./queryOptions.cjs"); -var import_infiniteQueryOptions = require("./infiniteQueryOptions.cjs"); -var import_QueryClientProvider = require("./QueryClientProvider.cjs"); -var import_HydrationBoundary = require("./HydrationBoundary.cjs"); -var import_QueryErrorResetBoundary = require("./QueryErrorResetBoundary.cjs"); -var import_useIsFetching = require("./useIsFetching.cjs"); -var import_useMutationState = require("./useMutationState.cjs"); -var import_useMutation = require("./useMutation.cjs"); -var import_mutationOptions = require("./mutationOptions.cjs"); -var import_useInfiniteQuery = require("./useInfiniteQuery.cjs"); -var import_IsRestoringProvider = require("./IsRestoringProvider.cjs"); -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - HydrationBoundary, - IsRestoringProvider, - QueryClientContext, - QueryClientProvider, - QueryErrorResetBoundary, - infiniteQueryOptions, - mutationOptions, - queryOptions, - useInfiniteQuery, - useIsFetching, - useIsMutating, - useIsRestoring, - useMutation, - useMutationState, - usePrefetchInfiniteQuery, - usePrefetchQuery, - useQueries, - useQuery, - useQueryClient, - useQueryErrorResetBoundary, - useSuspenseInfiniteQuery, - useSuspenseQueries, - useSuspenseQuery, - ...require("@tanstack/query-core"), - ...require("./types.cjs") -}); -//# sourceMappingURL=index.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/index.cjs.map b/node_modules/@tanstack/react-query/build/modern/index.cjs.map deleted file mode 100644 index 3e25ed1..0000000 --- a/node_modules/@tanstack/react-query/build/modern/index.cjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/index.ts"],"sourcesContent":["/* istanbul ignore file */\n\n// Re-export core\nexport * from '@tanstack/query-core'\n\n// React Query\nexport * from './types'\nexport { useQueries } from './useQueries'\nexport type { QueriesResults, QueriesOptions } from './useQueries'\nexport { useQuery } from './useQuery'\nexport { useSuspenseQuery } from './useSuspenseQuery'\nexport { useSuspenseInfiniteQuery } from './useSuspenseInfiniteQuery'\nexport { useSuspenseQueries } from './useSuspenseQueries'\nexport type {\n SuspenseQueriesResults,\n SuspenseQueriesOptions,\n} from './useSuspenseQueries'\nexport { usePrefetchQuery } from './usePrefetchQuery'\nexport { usePrefetchInfiniteQuery } from './usePrefetchInfiniteQuery'\nexport { queryOptions } from './queryOptions'\nexport type {\n DefinedInitialDataOptions,\n UndefinedInitialDataOptions,\n UnusedSkipTokenOptions,\n} from './queryOptions'\nexport { infiniteQueryOptions } from './infiniteQueryOptions'\nexport type {\n DefinedInitialDataInfiniteOptions,\n UndefinedInitialDataInfiniteOptions,\n UnusedSkipTokenInfiniteOptions,\n} from './infiniteQueryOptions'\nexport {\n QueryClientContext,\n QueryClientProvider,\n useQueryClient,\n} from './QueryClientProvider'\nexport type { QueryClientProviderProps } from './QueryClientProvider'\nexport type { QueryErrorResetBoundaryProps } from './QueryErrorResetBoundary'\nexport { HydrationBoundary } from './HydrationBoundary'\nexport type { HydrationBoundaryProps } from './HydrationBoundary'\nexport type {\n QueryErrorClearResetFunction,\n QueryErrorIsResetFunction,\n QueryErrorResetBoundaryFunction,\n QueryErrorResetFunction,\n} from './QueryErrorResetBoundary'\nexport {\n QueryErrorResetBoundary,\n useQueryErrorResetBoundary,\n} from './QueryErrorResetBoundary'\nexport { useIsFetching } from './useIsFetching'\nexport { useIsMutating, useMutationState } from './useMutationState'\nexport { useMutation } from './useMutation'\nexport { mutationOptions } from './mutationOptions'\nexport { useInfiniteQuery } from './useInfiniteQuery'\nexport { useIsRestoring, IsRestoringProvider } from './IsRestoringProvider'\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,0BAAc,iCAHd;AAMA,0BAAc,wBANd;AAOA,wBAA2B;AAE3B,sBAAyB;AACzB,8BAAiC;AACjC,sCAAyC;AACzC,gCAAmC;AAKnC,8BAAiC;AACjC,sCAAyC;AACzC,0BAA6B;AAM7B,kCAAqC;AAMrC,iCAIO;AAGP,+BAAkC;AAQlC,qCAGO;AACP,2BAA8B;AAC9B,8BAAgD;AAChD,yBAA4B;AAC5B,6BAAgC;AAChC,8BAAiC;AACjC,iCAAoD;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/index.d.cts b/node_modules/@tanstack/react-query/build/modern/index.d.cts deleted file mode 100644 index 4924b4f..0000000 --- a/node_modules/@tanstack/react-query/build/modern/index.d.cts +++ /dev/null @@ -1,22 +0,0 @@ -export * from '@tanstack/query-core'; -export { AnyUseBaseQueryOptions, AnyUseInfiniteQueryOptions, AnyUseMutationOptions, AnyUseQueryOptions, AnyUseSuspenseInfiniteQueryOptions, AnyUseSuspenseQueryOptions, DefinedUseInfiniteQueryResult, DefinedUseQueryResult, UseBaseMutationResult, UseBaseQueryOptions, UseBaseQueryResult, UseInfiniteQueryOptions, UseInfiniteQueryResult, UseMutateAsyncFunction, UseMutateFunction, UseMutationOptions, UseMutationResult, UsePrefetchQueryOptions, UseQueryOptions, UseQueryResult, UseSuspenseInfiniteQueryOptions, UseSuspenseInfiniteQueryResult, UseSuspenseQueryOptions, UseSuspenseQueryResult } from './types.cjs'; -export { QueriesOptions, QueriesResults, useQueries } from './useQueries.cjs'; -export { useQuery } from './useQuery.cjs'; -export { useSuspenseQuery } from './useSuspenseQuery.cjs'; -export { useSuspenseInfiniteQuery } from './useSuspenseInfiniteQuery.cjs'; -export { SuspenseQueriesOptions, SuspenseQueriesResults, useSuspenseQueries } from './useSuspenseQueries.cjs'; -export { usePrefetchQuery } from './usePrefetchQuery.cjs'; -export { usePrefetchInfiniteQuery } from './usePrefetchInfiniteQuery.cjs'; -export { DefinedInitialDataOptions, UndefinedInitialDataOptions, UnusedSkipTokenOptions, queryOptions } from './queryOptions.cjs'; -export { DefinedInitialDataInfiniteOptions, UndefinedInitialDataInfiniteOptions, UnusedSkipTokenInfiniteOptions, infiniteQueryOptions } from './infiniteQueryOptions.cjs'; -export { QueryClientContext, QueryClientProvider, QueryClientProviderProps, useQueryClient } from './QueryClientProvider.cjs'; -export { QueryErrorClearResetFunction, QueryErrorIsResetFunction, QueryErrorResetBoundary, QueryErrorResetBoundaryFunction, QueryErrorResetBoundaryProps, QueryErrorResetFunction, useQueryErrorResetBoundary } from './QueryErrorResetBoundary.cjs'; -export { HydrationBoundary, HydrationBoundaryProps } from './HydrationBoundary.cjs'; -export { useIsFetching } from './useIsFetching.cjs'; -export { useIsMutating, useMutationState } from './useMutationState.cjs'; -export { useMutation } from './useMutation.cjs'; -export { mutationOptions } from './mutationOptions.cjs'; -export { useInfiniteQuery } from './useInfiniteQuery.cjs'; -export { IsRestoringProvider, useIsRestoring } from './IsRestoringProvider.cjs'; -import 'react'; -import 'react/jsx-runtime'; diff --git a/node_modules/@tanstack/react-query/build/modern/index.d.ts b/node_modules/@tanstack/react-query/build/modern/index.d.ts deleted file mode 100644 index 45dab83..0000000 --- a/node_modules/@tanstack/react-query/build/modern/index.d.ts +++ /dev/null @@ -1,22 +0,0 @@ -export * from '@tanstack/query-core'; -export { AnyUseBaseQueryOptions, AnyUseInfiniteQueryOptions, AnyUseMutationOptions, AnyUseQueryOptions, AnyUseSuspenseInfiniteQueryOptions, AnyUseSuspenseQueryOptions, DefinedUseInfiniteQueryResult, DefinedUseQueryResult, UseBaseMutationResult, UseBaseQueryOptions, UseBaseQueryResult, UseInfiniteQueryOptions, UseInfiniteQueryResult, UseMutateAsyncFunction, UseMutateFunction, UseMutationOptions, UseMutationResult, UsePrefetchQueryOptions, UseQueryOptions, UseQueryResult, UseSuspenseInfiniteQueryOptions, UseSuspenseInfiniteQueryResult, UseSuspenseQueryOptions, UseSuspenseQueryResult } from './types.js'; -export { QueriesOptions, QueriesResults, useQueries } from './useQueries.js'; -export { useQuery } from './useQuery.js'; -export { useSuspenseQuery } from './useSuspenseQuery.js'; -export { useSuspenseInfiniteQuery } from './useSuspenseInfiniteQuery.js'; -export { SuspenseQueriesOptions, SuspenseQueriesResults, useSuspenseQueries } from './useSuspenseQueries.js'; -export { usePrefetchQuery } from './usePrefetchQuery.js'; -export { usePrefetchInfiniteQuery } from './usePrefetchInfiniteQuery.js'; -export { DefinedInitialDataOptions, UndefinedInitialDataOptions, UnusedSkipTokenOptions, queryOptions } from './queryOptions.js'; -export { DefinedInitialDataInfiniteOptions, UndefinedInitialDataInfiniteOptions, UnusedSkipTokenInfiniteOptions, infiniteQueryOptions } from './infiniteQueryOptions.js'; -export { QueryClientContext, QueryClientProvider, QueryClientProviderProps, useQueryClient } from './QueryClientProvider.js'; -export { QueryErrorClearResetFunction, QueryErrorIsResetFunction, QueryErrorResetBoundary, QueryErrorResetBoundaryFunction, QueryErrorResetBoundaryProps, QueryErrorResetFunction, useQueryErrorResetBoundary } from './QueryErrorResetBoundary.js'; -export { HydrationBoundary, HydrationBoundaryProps } from './HydrationBoundary.js'; -export { useIsFetching } from './useIsFetching.js'; -export { useIsMutating, useMutationState } from './useMutationState.js'; -export { useMutation } from './useMutation.js'; -export { mutationOptions } from './mutationOptions.js'; -export { useInfiniteQuery } from './useInfiniteQuery.js'; -export { IsRestoringProvider, useIsRestoring } from './IsRestoringProvider.js'; -import 'react'; -import 'react/jsx-runtime'; diff --git a/node_modules/@tanstack/react-query/build/modern/index.js b/node_modules/@tanstack/react-query/build/modern/index.js deleted file mode 100644 index 66ddb26..0000000 --- a/node_modules/@tanstack/react-query/build/modern/index.js +++ /dev/null @@ -1,54 +0,0 @@ -// src/index.ts -export * from "@tanstack/query-core"; -export * from "./types.js"; -import { useQueries } from "./useQueries.js"; -import { useQuery } from "./useQuery.js"; -import { useSuspenseQuery } from "./useSuspenseQuery.js"; -import { useSuspenseInfiniteQuery } from "./useSuspenseInfiniteQuery.js"; -import { useSuspenseQueries } from "./useSuspenseQueries.js"; -import { usePrefetchQuery } from "./usePrefetchQuery.js"; -import { usePrefetchInfiniteQuery } from "./usePrefetchInfiniteQuery.js"; -import { queryOptions } from "./queryOptions.js"; -import { infiniteQueryOptions } from "./infiniteQueryOptions.js"; -import { - QueryClientContext, - QueryClientProvider, - useQueryClient -} from "./QueryClientProvider.js"; -import { HydrationBoundary } from "./HydrationBoundary.js"; -import { - QueryErrorResetBoundary, - useQueryErrorResetBoundary -} from "./QueryErrorResetBoundary.js"; -import { useIsFetching } from "./useIsFetching.js"; -import { useIsMutating, useMutationState } from "./useMutationState.js"; -import { useMutation } from "./useMutation.js"; -import { mutationOptions } from "./mutationOptions.js"; -import { useInfiniteQuery } from "./useInfiniteQuery.js"; -import { useIsRestoring, IsRestoringProvider } from "./IsRestoringProvider.js"; -export { - HydrationBoundary, - IsRestoringProvider, - QueryClientContext, - QueryClientProvider, - QueryErrorResetBoundary, - infiniteQueryOptions, - mutationOptions, - queryOptions, - useInfiniteQuery, - useIsFetching, - useIsMutating, - useIsRestoring, - useMutation, - useMutationState, - usePrefetchInfiniteQuery, - usePrefetchQuery, - useQueries, - useQuery, - useQueryClient, - useQueryErrorResetBoundary, - useSuspenseInfiniteQuery, - useSuspenseQueries, - useSuspenseQuery -}; -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/index.js.map b/node_modules/@tanstack/react-query/build/modern/index.js.map deleted file mode 100644 index e3df051..0000000 --- a/node_modules/@tanstack/react-query/build/modern/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/index.ts"],"sourcesContent":["/* istanbul ignore file */\n\n// Re-export core\nexport * from '@tanstack/query-core'\n\n// React Query\nexport * from './types'\nexport { useQueries } from './useQueries'\nexport type { QueriesResults, QueriesOptions } from './useQueries'\nexport { useQuery } from './useQuery'\nexport { useSuspenseQuery } from './useSuspenseQuery'\nexport { useSuspenseInfiniteQuery } from './useSuspenseInfiniteQuery'\nexport { useSuspenseQueries } from './useSuspenseQueries'\nexport type {\n SuspenseQueriesResults,\n SuspenseQueriesOptions,\n} from './useSuspenseQueries'\nexport { usePrefetchQuery } from './usePrefetchQuery'\nexport { usePrefetchInfiniteQuery } from './usePrefetchInfiniteQuery'\nexport { queryOptions } from './queryOptions'\nexport type {\n DefinedInitialDataOptions,\n UndefinedInitialDataOptions,\n UnusedSkipTokenOptions,\n} from './queryOptions'\nexport { infiniteQueryOptions } from './infiniteQueryOptions'\nexport type {\n DefinedInitialDataInfiniteOptions,\n UndefinedInitialDataInfiniteOptions,\n UnusedSkipTokenInfiniteOptions,\n} from './infiniteQueryOptions'\nexport {\n QueryClientContext,\n QueryClientProvider,\n useQueryClient,\n} from './QueryClientProvider'\nexport type { QueryClientProviderProps } from './QueryClientProvider'\nexport type { QueryErrorResetBoundaryProps } from './QueryErrorResetBoundary'\nexport { HydrationBoundary } from './HydrationBoundary'\nexport type { HydrationBoundaryProps } from './HydrationBoundary'\nexport type {\n QueryErrorClearResetFunction,\n QueryErrorIsResetFunction,\n QueryErrorResetBoundaryFunction,\n QueryErrorResetFunction,\n} from './QueryErrorResetBoundary'\nexport {\n QueryErrorResetBoundary,\n useQueryErrorResetBoundary,\n} from './QueryErrorResetBoundary'\nexport { useIsFetching } from './useIsFetching'\nexport { useIsMutating, useMutationState } from './useMutationState'\nexport { useMutation } from './useMutation'\nexport { mutationOptions } from './mutationOptions'\nexport { useInfiniteQuery } from './useInfiniteQuery'\nexport { useIsRestoring, IsRestoringProvider } from './IsRestoringProvider'\n"],"mappings":";AAGA,cAAc;AAGd,cAAc;AACd,SAAS,kBAAkB;AAE3B,SAAS,gBAAgB;AACzB,SAAS,wBAAwB;AACjC,SAAS,gCAAgC;AACzC,SAAS,0BAA0B;AAKnC,SAAS,wBAAwB;AACjC,SAAS,gCAAgC;AACzC,SAAS,oBAAoB;AAM7B,SAAS,4BAA4B;AAMrC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAGP,SAAS,yBAAyB;AAQlC;AAAA,EACE;AAAA,EACA;AAAA,OACK;AACP,SAAS,qBAAqB;AAC9B,SAAS,eAAe,wBAAwB;AAChD,SAAS,mBAAmB;AAC5B,SAAS,uBAAuB;AAChC,SAAS,wBAAwB;AACjC,SAAS,gBAAgB,2BAA2B;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/infiniteQueryOptions.cjs b/node_modules/@tanstack/react-query/build/modern/infiniteQueryOptions.cjs deleted file mode 100644 index d0ce5b1..0000000 --- a/node_modules/@tanstack/react-query/build/modern/infiniteQueryOptions.cjs +++ /dev/null @@ -1,33 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// src/infiniteQueryOptions.ts -var infiniteQueryOptions_exports = {}; -__export(infiniteQueryOptions_exports, { - infiniteQueryOptions: () => infiniteQueryOptions -}); -module.exports = __toCommonJS(infiniteQueryOptions_exports); -function infiniteQueryOptions(options) { - return options; -} -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - infiniteQueryOptions -}); -//# sourceMappingURL=infiniteQueryOptions.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/infiniteQueryOptions.cjs.map b/node_modules/@tanstack/react-query/build/modern/infiniteQueryOptions.cjs.map deleted file mode 100644 index b802bf9..0000000 --- a/node_modules/@tanstack/react-query/build/modern/infiniteQueryOptions.cjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/infiniteQueryOptions.ts"],"sourcesContent":["import type {\n DataTag,\n DefaultError,\n InfiniteData,\n InitialDataFunction,\n NonUndefinedGuard,\n OmitKeyof,\n QueryKey,\n SkipToken,\n} from '@tanstack/query-core'\nimport type { UseInfiniteQueryOptions } from './types'\n\nexport type UndefinedInitialDataInfiniteOptions<\n TQueryFnData,\n TError = DefaultError,\n TData = InfiniteData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n> = UseInfiniteQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n> & {\n initialData?:\n | undefined\n | NonUndefinedGuard>\n | InitialDataFunction<\n NonUndefinedGuard>\n >\n}\n\nexport type UnusedSkipTokenInfiniteOptions<\n TQueryFnData,\n TError = DefaultError,\n TData = InfiniteData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n> = OmitKeyof<\n UseInfiniteQueryOptions,\n 'queryFn'\n> & {\n queryFn?: Exclude<\n UseInfiniteQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >['queryFn'],\n SkipToken | undefined\n >\n}\n\nexport type DefinedInitialDataInfiniteOptions<\n TQueryFnData,\n TError = DefaultError,\n TData = InfiniteData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n> = UseInfiniteQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n> & {\n initialData:\n | NonUndefinedGuard>\n | (() => NonUndefinedGuard>)\n | undefined\n}\n\nexport function infiniteQueryOptions<\n TQueryFnData,\n TError = DefaultError,\n TData = InfiniteData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n>(\n options: DefinedInitialDataInfiniteOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n): DefinedInitialDataInfiniteOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n> & {\n queryKey: DataTag, TError>\n}\n\nexport function infiniteQueryOptions<\n TQueryFnData,\n TError = DefaultError,\n TData = InfiniteData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n>(\n options: UnusedSkipTokenInfiniteOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n): UnusedSkipTokenInfiniteOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n> & {\n queryKey: DataTag, TError>\n}\n\nexport function infiniteQueryOptions<\n TQueryFnData,\n TError = DefaultError,\n TData = InfiniteData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n>(\n options: UndefinedInitialDataInfiniteOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n): UndefinedInitialDataInfiniteOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n> & {\n queryKey: DataTag, TError>\n}\n\nexport function infiniteQueryOptions(options: unknown) {\n return options\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAkJO,SAAS,qBAAqB,SAAkB;AACrD,SAAO;AACT;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/infiniteQueryOptions.d.cts b/node_modules/@tanstack/react-query/build/modern/infiniteQueryOptions.d.cts deleted file mode 100644 index c363f90..0000000 --- a/node_modules/@tanstack/react-query/build/modern/infiniteQueryOptions.d.cts +++ /dev/null @@ -1,23 +0,0 @@ -import { DefaultError, InfiniteData, QueryKey, NonUndefinedGuard, InitialDataFunction, OmitKeyof, SkipToken, DataTag } from '@tanstack/query-core'; -import { UseInfiniteQueryOptions } from './types.cjs'; - -type UndefinedInitialDataInfiniteOptions, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown> = UseInfiniteQueryOptions & { - initialData?: undefined | NonUndefinedGuard> | InitialDataFunction>>; -}; -type UnusedSkipTokenInfiniteOptions, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown> = OmitKeyof, 'queryFn'> & { - queryFn?: Exclude['queryFn'], SkipToken | undefined>; -}; -type DefinedInitialDataInfiniteOptions, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown> = UseInfiniteQueryOptions & { - initialData: NonUndefinedGuard> | (() => NonUndefinedGuard>) | undefined; -}; -declare function infiniteQueryOptions, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown>(options: DefinedInitialDataInfiniteOptions): DefinedInitialDataInfiniteOptions & { - queryKey: DataTag, TError>; -}; -declare function infiniteQueryOptions, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown>(options: UnusedSkipTokenInfiniteOptions): UnusedSkipTokenInfiniteOptions & { - queryKey: DataTag, TError>; -}; -declare function infiniteQueryOptions, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown>(options: UndefinedInitialDataInfiniteOptions): UndefinedInitialDataInfiniteOptions & { - queryKey: DataTag, TError>; -}; - -export { type DefinedInitialDataInfiniteOptions, type UndefinedInitialDataInfiniteOptions, type UnusedSkipTokenInfiniteOptions, infiniteQueryOptions }; diff --git a/node_modules/@tanstack/react-query/build/modern/infiniteQueryOptions.d.ts b/node_modules/@tanstack/react-query/build/modern/infiniteQueryOptions.d.ts deleted file mode 100644 index a37a4de..0000000 --- a/node_modules/@tanstack/react-query/build/modern/infiniteQueryOptions.d.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { DefaultError, InfiniteData, QueryKey, NonUndefinedGuard, InitialDataFunction, OmitKeyof, SkipToken, DataTag } from '@tanstack/query-core'; -import { UseInfiniteQueryOptions } from './types.js'; - -type UndefinedInitialDataInfiniteOptions, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown> = UseInfiniteQueryOptions & { - initialData?: undefined | NonUndefinedGuard> | InitialDataFunction>>; -}; -type UnusedSkipTokenInfiniteOptions, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown> = OmitKeyof, 'queryFn'> & { - queryFn?: Exclude['queryFn'], SkipToken | undefined>; -}; -type DefinedInitialDataInfiniteOptions, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown> = UseInfiniteQueryOptions & { - initialData: NonUndefinedGuard> | (() => NonUndefinedGuard>) | undefined; -}; -declare function infiniteQueryOptions, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown>(options: DefinedInitialDataInfiniteOptions): DefinedInitialDataInfiniteOptions & { - queryKey: DataTag, TError>; -}; -declare function infiniteQueryOptions, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown>(options: UnusedSkipTokenInfiniteOptions): UnusedSkipTokenInfiniteOptions & { - queryKey: DataTag, TError>; -}; -declare function infiniteQueryOptions, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown>(options: UndefinedInitialDataInfiniteOptions): UndefinedInitialDataInfiniteOptions & { - queryKey: DataTag, TError>; -}; - -export { type DefinedInitialDataInfiniteOptions, type UndefinedInitialDataInfiniteOptions, type UnusedSkipTokenInfiniteOptions, infiniteQueryOptions }; diff --git a/node_modules/@tanstack/react-query/build/modern/infiniteQueryOptions.js b/node_modules/@tanstack/react-query/build/modern/infiniteQueryOptions.js deleted file mode 100644 index bc8d5b0..0000000 --- a/node_modules/@tanstack/react-query/build/modern/infiniteQueryOptions.js +++ /dev/null @@ -1,8 +0,0 @@ -// src/infiniteQueryOptions.ts -function infiniteQueryOptions(options) { - return options; -} -export { - infiniteQueryOptions -}; -//# sourceMappingURL=infiniteQueryOptions.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/infiniteQueryOptions.js.map b/node_modules/@tanstack/react-query/build/modern/infiniteQueryOptions.js.map deleted file mode 100644 index fb592fc..0000000 --- a/node_modules/@tanstack/react-query/build/modern/infiniteQueryOptions.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/infiniteQueryOptions.ts"],"sourcesContent":["import type {\n DataTag,\n DefaultError,\n InfiniteData,\n InitialDataFunction,\n NonUndefinedGuard,\n OmitKeyof,\n QueryKey,\n SkipToken,\n} from '@tanstack/query-core'\nimport type { UseInfiniteQueryOptions } from './types'\n\nexport type UndefinedInitialDataInfiniteOptions<\n TQueryFnData,\n TError = DefaultError,\n TData = InfiniteData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n> = UseInfiniteQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n> & {\n initialData?:\n | undefined\n | NonUndefinedGuard>\n | InitialDataFunction<\n NonUndefinedGuard>\n >\n}\n\nexport type UnusedSkipTokenInfiniteOptions<\n TQueryFnData,\n TError = DefaultError,\n TData = InfiniteData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n> = OmitKeyof<\n UseInfiniteQueryOptions,\n 'queryFn'\n> & {\n queryFn?: Exclude<\n UseInfiniteQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >['queryFn'],\n SkipToken | undefined\n >\n}\n\nexport type DefinedInitialDataInfiniteOptions<\n TQueryFnData,\n TError = DefaultError,\n TData = InfiniteData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n> = UseInfiniteQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n> & {\n initialData:\n | NonUndefinedGuard>\n | (() => NonUndefinedGuard>)\n | undefined\n}\n\nexport function infiniteQueryOptions<\n TQueryFnData,\n TError = DefaultError,\n TData = InfiniteData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n>(\n options: DefinedInitialDataInfiniteOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n): DefinedInitialDataInfiniteOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n> & {\n queryKey: DataTag, TError>\n}\n\nexport function infiniteQueryOptions<\n TQueryFnData,\n TError = DefaultError,\n TData = InfiniteData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n>(\n options: UnusedSkipTokenInfiniteOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n): UnusedSkipTokenInfiniteOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n> & {\n queryKey: DataTag, TError>\n}\n\nexport function infiniteQueryOptions<\n TQueryFnData,\n TError = DefaultError,\n TData = InfiniteData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n>(\n options: UndefinedInitialDataInfiniteOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n): UndefinedInitialDataInfiniteOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n> & {\n queryKey: DataTag, TError>\n}\n\nexport function infiniteQueryOptions(options: unknown) {\n return options\n}\n"],"mappings":";AAkJO,SAAS,qBAAqB,SAAkB;AACrD,SAAO;AACT;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/mutationOptions.cjs b/node_modules/@tanstack/react-query/build/modern/mutationOptions.cjs deleted file mode 100644 index db3ac10..0000000 --- a/node_modules/@tanstack/react-query/build/modern/mutationOptions.cjs +++ /dev/null @@ -1,33 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// src/mutationOptions.ts -var mutationOptions_exports = {}; -__export(mutationOptions_exports, { - mutationOptions: () => mutationOptions -}); -module.exports = __toCommonJS(mutationOptions_exports); -function mutationOptions(options) { - return options; -} -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - mutationOptions -}); -//# sourceMappingURL=mutationOptions.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/mutationOptions.cjs.map b/node_modules/@tanstack/react-query/build/modern/mutationOptions.cjs.map deleted file mode 100644 index 683b965..0000000 --- a/node_modules/@tanstack/react-query/build/modern/mutationOptions.cjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/mutationOptions.ts"],"sourcesContent":["import type { DefaultError, WithRequired } from '@tanstack/query-core'\nimport type { UseMutationOptions } from './types'\n\nexport function mutationOptions<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n>(\n options: WithRequired<\n UseMutationOptions,\n 'mutationKey'\n >,\n): WithRequired<\n UseMutationOptions,\n 'mutationKey'\n>\nexport function mutationOptions<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n>(\n options: Omit<\n UseMutationOptions,\n 'mutationKey'\n >,\n): Omit<\n UseMutationOptions,\n 'mutationKey'\n>\nexport function mutationOptions<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n>(\n options: UseMutationOptions,\n): UseMutationOptions {\n return options\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AA+BO,SAAS,gBAMd,SACgE;AAChE,SAAO;AACT;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/mutationOptions.d.cts b/node_modules/@tanstack/react-query/build/modern/mutationOptions.d.cts deleted file mode 100644 index 170edf3..0000000 --- a/node_modules/@tanstack/react-query/build/modern/mutationOptions.d.cts +++ /dev/null @@ -1,7 +0,0 @@ -import { DefaultError, WithRequired } from '@tanstack/query-core'; -import { UseMutationOptions } from './types.cjs'; - -declare function mutationOptions(options: WithRequired, 'mutationKey'>): WithRequired, 'mutationKey'>; -declare function mutationOptions(options: Omit, 'mutationKey'>): Omit, 'mutationKey'>; - -export { mutationOptions }; diff --git a/node_modules/@tanstack/react-query/build/modern/mutationOptions.d.ts b/node_modules/@tanstack/react-query/build/modern/mutationOptions.d.ts deleted file mode 100644 index b080cf2..0000000 --- a/node_modules/@tanstack/react-query/build/modern/mutationOptions.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { DefaultError, WithRequired } from '@tanstack/query-core'; -import { UseMutationOptions } from './types.js'; - -declare function mutationOptions(options: WithRequired, 'mutationKey'>): WithRequired, 'mutationKey'>; -declare function mutationOptions(options: Omit, 'mutationKey'>): Omit, 'mutationKey'>; - -export { mutationOptions }; diff --git a/node_modules/@tanstack/react-query/build/modern/mutationOptions.js b/node_modules/@tanstack/react-query/build/modern/mutationOptions.js deleted file mode 100644 index d40279e..0000000 --- a/node_modules/@tanstack/react-query/build/modern/mutationOptions.js +++ /dev/null @@ -1,8 +0,0 @@ -// src/mutationOptions.ts -function mutationOptions(options) { - return options; -} -export { - mutationOptions -}; -//# sourceMappingURL=mutationOptions.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/mutationOptions.js.map b/node_modules/@tanstack/react-query/build/modern/mutationOptions.js.map deleted file mode 100644 index d0a8b6d..0000000 --- a/node_modules/@tanstack/react-query/build/modern/mutationOptions.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/mutationOptions.ts"],"sourcesContent":["import type { DefaultError, WithRequired } from '@tanstack/query-core'\nimport type { UseMutationOptions } from './types'\n\nexport function mutationOptions<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n>(\n options: WithRequired<\n UseMutationOptions,\n 'mutationKey'\n >,\n): WithRequired<\n UseMutationOptions,\n 'mutationKey'\n>\nexport function mutationOptions<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n>(\n options: Omit<\n UseMutationOptions,\n 'mutationKey'\n >,\n): Omit<\n UseMutationOptions,\n 'mutationKey'\n>\nexport function mutationOptions<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n>(\n options: UseMutationOptions,\n): UseMutationOptions {\n return options\n}\n"],"mappings":";AA+BO,SAAS,gBAMd,SACgE;AAChE,SAAO;AACT;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/queryOptions.cjs b/node_modules/@tanstack/react-query/build/modern/queryOptions.cjs deleted file mode 100644 index ffda67f..0000000 --- a/node_modules/@tanstack/react-query/build/modern/queryOptions.cjs +++ /dev/null @@ -1,33 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// src/queryOptions.ts -var queryOptions_exports = {}; -__export(queryOptions_exports, { - queryOptions: () => queryOptions -}); -module.exports = __toCommonJS(queryOptions_exports); -function queryOptions(options) { - return options; -} -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - queryOptions -}); -//# sourceMappingURL=queryOptions.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/queryOptions.cjs.map b/node_modules/@tanstack/react-query/build/modern/queryOptions.cjs.map deleted file mode 100644 index 426573b..0000000 --- a/node_modules/@tanstack/react-query/build/modern/queryOptions.cjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/queryOptions.ts"],"sourcesContent":["import type {\n DataTag,\n DefaultError,\n InitialDataFunction,\n NonUndefinedGuard,\n OmitKeyof,\n QueryFunction,\n QueryKey,\n SkipToken,\n} from '@tanstack/query-core'\nimport type { UseQueryOptions } from './types'\n\nexport type UndefinedInitialDataOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> = UseQueryOptions & {\n initialData?:\n | undefined\n | InitialDataFunction>\n | NonUndefinedGuard\n}\n\nexport type UnusedSkipTokenOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> = OmitKeyof<\n UseQueryOptions,\n 'queryFn'\n> & {\n queryFn?: Exclude<\n UseQueryOptions['queryFn'],\n SkipToken | undefined\n >\n}\n\nexport type DefinedInitialDataOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> = Omit, 'queryFn'> & {\n initialData:\n | NonUndefinedGuard\n | (() => NonUndefinedGuard)\n queryFn?: QueryFunction\n}\n\nexport function queryOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n options: DefinedInitialDataOptions,\n): DefinedInitialDataOptions & {\n queryKey: DataTag\n}\n\nexport function queryOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n options: UnusedSkipTokenOptions,\n): UnusedSkipTokenOptions & {\n queryKey: DataTag\n}\n\nexport function queryOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n options: UndefinedInitialDataOptions,\n): UndefinedInitialDataOptions & {\n queryKey: DataTag\n}\n\nexport function queryOptions(options: unknown) {\n return options\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAoFO,SAAS,aAAa,SAAkB;AAC7C,SAAO;AACT;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/queryOptions.d.cts b/node_modules/@tanstack/react-query/build/modern/queryOptions.d.cts deleted file mode 100644 index 05489f6..0000000 --- a/node_modules/@tanstack/react-query/build/modern/queryOptions.d.cts +++ /dev/null @@ -1,24 +0,0 @@ -import { DefaultError, QueryKey, NonUndefinedGuard, QueryFunction, InitialDataFunction, OmitKeyof, SkipToken, DataTag } from '@tanstack/query-core'; -import { UseQueryOptions } from './types.cjs'; - -type UndefinedInitialDataOptions = UseQueryOptions & { - initialData?: undefined | InitialDataFunction> | NonUndefinedGuard; -}; -type UnusedSkipTokenOptions = OmitKeyof, 'queryFn'> & { - queryFn?: Exclude['queryFn'], SkipToken | undefined>; -}; -type DefinedInitialDataOptions = Omit, 'queryFn'> & { - initialData: NonUndefinedGuard | (() => NonUndefinedGuard); - queryFn?: QueryFunction; -}; -declare function queryOptions(options: DefinedInitialDataOptions): DefinedInitialDataOptions & { - queryKey: DataTag; -}; -declare function queryOptions(options: UnusedSkipTokenOptions): UnusedSkipTokenOptions & { - queryKey: DataTag; -}; -declare function queryOptions(options: UndefinedInitialDataOptions): UndefinedInitialDataOptions & { - queryKey: DataTag; -}; - -export { type DefinedInitialDataOptions, type UndefinedInitialDataOptions, type UnusedSkipTokenOptions, queryOptions }; diff --git a/node_modules/@tanstack/react-query/build/modern/queryOptions.d.ts b/node_modules/@tanstack/react-query/build/modern/queryOptions.d.ts deleted file mode 100644 index 7a93665..0000000 --- a/node_modules/@tanstack/react-query/build/modern/queryOptions.d.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { DefaultError, QueryKey, NonUndefinedGuard, QueryFunction, InitialDataFunction, OmitKeyof, SkipToken, DataTag } from '@tanstack/query-core'; -import { UseQueryOptions } from './types.js'; - -type UndefinedInitialDataOptions = UseQueryOptions & { - initialData?: undefined | InitialDataFunction> | NonUndefinedGuard; -}; -type UnusedSkipTokenOptions = OmitKeyof, 'queryFn'> & { - queryFn?: Exclude['queryFn'], SkipToken | undefined>; -}; -type DefinedInitialDataOptions = Omit, 'queryFn'> & { - initialData: NonUndefinedGuard | (() => NonUndefinedGuard); - queryFn?: QueryFunction; -}; -declare function queryOptions(options: DefinedInitialDataOptions): DefinedInitialDataOptions & { - queryKey: DataTag; -}; -declare function queryOptions(options: UnusedSkipTokenOptions): UnusedSkipTokenOptions & { - queryKey: DataTag; -}; -declare function queryOptions(options: UndefinedInitialDataOptions): UndefinedInitialDataOptions & { - queryKey: DataTag; -}; - -export { type DefinedInitialDataOptions, type UndefinedInitialDataOptions, type UnusedSkipTokenOptions, queryOptions }; diff --git a/node_modules/@tanstack/react-query/build/modern/queryOptions.js b/node_modules/@tanstack/react-query/build/modern/queryOptions.js deleted file mode 100644 index 7fb75ff..0000000 --- a/node_modules/@tanstack/react-query/build/modern/queryOptions.js +++ /dev/null @@ -1,8 +0,0 @@ -// src/queryOptions.ts -function queryOptions(options) { - return options; -} -export { - queryOptions -}; -//# sourceMappingURL=queryOptions.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/queryOptions.js.map b/node_modules/@tanstack/react-query/build/modern/queryOptions.js.map deleted file mode 100644 index 4ee7f34..0000000 --- a/node_modules/@tanstack/react-query/build/modern/queryOptions.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/queryOptions.ts"],"sourcesContent":["import type {\n DataTag,\n DefaultError,\n InitialDataFunction,\n NonUndefinedGuard,\n OmitKeyof,\n QueryFunction,\n QueryKey,\n SkipToken,\n} from '@tanstack/query-core'\nimport type { UseQueryOptions } from './types'\n\nexport type UndefinedInitialDataOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> = UseQueryOptions & {\n initialData?:\n | undefined\n | InitialDataFunction>\n | NonUndefinedGuard\n}\n\nexport type UnusedSkipTokenOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> = OmitKeyof<\n UseQueryOptions,\n 'queryFn'\n> & {\n queryFn?: Exclude<\n UseQueryOptions['queryFn'],\n SkipToken | undefined\n >\n}\n\nexport type DefinedInitialDataOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> = Omit, 'queryFn'> & {\n initialData:\n | NonUndefinedGuard\n | (() => NonUndefinedGuard)\n queryFn?: QueryFunction\n}\n\nexport function queryOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n options: DefinedInitialDataOptions,\n): DefinedInitialDataOptions & {\n queryKey: DataTag\n}\n\nexport function queryOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n options: UnusedSkipTokenOptions,\n): UnusedSkipTokenOptions & {\n queryKey: DataTag\n}\n\nexport function queryOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n options: UndefinedInitialDataOptions,\n): UndefinedInitialDataOptions & {\n queryKey: DataTag\n}\n\nexport function queryOptions(options: unknown) {\n return options\n}\n"],"mappings":";AAoFO,SAAS,aAAa,SAAkB;AAC7C,SAAO;AACT;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/suspense.cjs b/node_modules/@tanstack/react-query/build/modern/suspense.cjs deleted file mode 100644 index b282a93..0000000 --- a/node_modules/@tanstack/react-query/build/modern/suspense.cjs +++ /dev/null @@ -1,58 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// src/suspense.ts -var suspense_exports = {}; -__export(suspense_exports, { - defaultThrowOnError: () => defaultThrowOnError, - ensureSuspenseTimers: () => ensureSuspenseTimers, - fetchOptimistic: () => fetchOptimistic, - shouldSuspend: () => shouldSuspend, - willFetch: () => willFetch -}); -module.exports = __toCommonJS(suspense_exports); -var defaultThrowOnError = (_error, query) => query.state.data === void 0; -var ensureSuspenseTimers = (defaultedOptions) => { - if (defaultedOptions.suspense) { - const MIN_SUSPENSE_TIME_MS = 1e3; - const clamp = (value) => value === "static" ? value : Math.max(value ?? MIN_SUSPENSE_TIME_MS, MIN_SUSPENSE_TIME_MS); - const originalStaleTime = defaultedOptions.staleTime; - defaultedOptions.staleTime = typeof originalStaleTime === "function" ? (...args) => clamp(originalStaleTime(...args)) : clamp(originalStaleTime); - if (typeof defaultedOptions.gcTime === "number") { - defaultedOptions.gcTime = Math.max( - defaultedOptions.gcTime, - MIN_SUSPENSE_TIME_MS - ); - } - } -}; -var willFetch = (result, isRestoring) => result.isLoading && result.isFetching && !isRestoring; -var shouldSuspend = (defaultedOptions, result) => defaultedOptions?.suspense && result.isPending; -var fetchOptimistic = (defaultedOptions, observer, errorResetBoundary) => observer.fetchOptimistic(defaultedOptions).catch(() => { - errorResetBoundary.clearReset(); -}); -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - defaultThrowOnError, - ensureSuspenseTimers, - fetchOptimistic, - shouldSuspend, - willFetch -}); -//# sourceMappingURL=suspense.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/suspense.cjs.map b/node_modules/@tanstack/react-query/build/modern/suspense.cjs.map deleted file mode 100644 index 2e12a10..0000000 --- a/node_modules/@tanstack/react-query/build/modern/suspense.cjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/suspense.ts"],"sourcesContent":["import type {\n DefaultError,\n DefaultedQueryObserverOptions,\n Query,\n QueryKey,\n QueryObserver,\n QueryObserverResult,\n} from '@tanstack/query-core'\nimport type { QueryErrorResetBoundaryValue } from './QueryErrorResetBoundary'\n\nexport const defaultThrowOnError = <\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n _error: TError,\n query: Query,\n) => query.state.data === undefined\n\nexport const ensureSuspenseTimers = (\n defaultedOptions: DefaultedQueryObserverOptions,\n) => {\n if (defaultedOptions.suspense) {\n // Handle staleTime to ensure minimum 1000ms in Suspense mode\n // This prevents unnecessary refetching when components remount after suspending\n const MIN_SUSPENSE_TIME_MS = 1000\n\n const clamp = (value: number | 'static' | undefined) =>\n value === 'static'\n ? value\n : Math.max(value ?? MIN_SUSPENSE_TIME_MS, MIN_SUSPENSE_TIME_MS)\n\n const originalStaleTime = defaultedOptions.staleTime\n defaultedOptions.staleTime =\n typeof originalStaleTime === 'function'\n ? (...args) => clamp(originalStaleTime(...args))\n : clamp(originalStaleTime)\n\n if (typeof defaultedOptions.gcTime === 'number') {\n defaultedOptions.gcTime = Math.max(\n defaultedOptions.gcTime,\n MIN_SUSPENSE_TIME_MS,\n )\n }\n }\n}\n\nexport const willFetch = (\n result: QueryObserverResult,\n isRestoring: boolean,\n) => result.isLoading && result.isFetching && !isRestoring\n\nexport const shouldSuspend = (\n defaultedOptions:\n | DefaultedQueryObserverOptions\n | undefined,\n result: QueryObserverResult,\n) => defaultedOptions?.suspense && result.isPending\n\nexport const fetchOptimistic = <\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey extends QueryKey,\n>(\n defaultedOptions: DefaultedQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >,\n observer: QueryObserver,\n errorResetBoundary: QueryErrorResetBoundaryValue,\n) =>\n observer.fetchOptimistic(defaultedOptions).catch(() => {\n errorResetBoundary.clearReset()\n })\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAUO,IAAM,sBAAsB,CAMjC,QACA,UACG,MAAM,MAAM,SAAS;AAEnB,IAAM,uBAAuB,CAClC,qBACG;AACH,MAAI,iBAAiB,UAAU;AAG7B,UAAM,uBAAuB;AAE7B,UAAM,QAAQ,CAAC,UACb,UAAU,WACN,QACA,KAAK,IAAI,SAAS,sBAAsB,oBAAoB;AAElE,UAAM,oBAAoB,iBAAiB;AAC3C,qBAAiB,YACf,OAAO,sBAAsB,aACzB,IAAI,SAAS,MAAM,kBAAkB,GAAG,IAAI,CAAC,IAC7C,MAAM,iBAAiB;AAE7B,QAAI,OAAO,iBAAiB,WAAW,UAAU;AAC/C,uBAAiB,SAAS,KAAK;AAAA,QAC7B,iBAAiB;AAAA,QACjB;AAAA,MACF;AAAA,IACF;AAAA,EACF;AACF;AAEO,IAAM,YAAY,CACvB,QACA,gBACG,OAAO,aAAa,OAAO,cAAc,CAAC;AAExC,IAAM,gBAAgB,CAC3B,kBAGA,WACG,kBAAkB,YAAY,OAAO;AAEnC,IAAM,kBAAkB,CAO7B,kBAOA,UACA,uBAEA,SAAS,gBAAgB,gBAAgB,EAAE,MAAM,MAAM;AACrD,qBAAmB,WAAW;AAChC,CAAC;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/suspense.d.cts b/node_modules/@tanstack/react-query/build/modern/suspense.d.cts deleted file mode 100644 index da077db..0000000 --- a/node_modules/@tanstack/react-query/build/modern/suspense.d.cts +++ /dev/null @@ -1,12 +0,0 @@ -import { DefaultError, QueryKey, Query, DefaultedQueryObserverOptions, QueryObserver, QueryObserverResult } from '@tanstack/query-core'; -import { QueryErrorResetBoundaryValue } from './QueryErrorResetBoundary.cjs'; -import 'react/jsx-runtime'; -import 'react'; - -declare const defaultThrowOnError: (_error: TError, query: Query) => boolean; -declare const ensureSuspenseTimers: (defaultedOptions: DefaultedQueryObserverOptions) => void; -declare const willFetch: (result: QueryObserverResult, isRestoring: boolean) => boolean; -declare const shouldSuspend: (defaultedOptions: DefaultedQueryObserverOptions | undefined, result: QueryObserverResult) => boolean | undefined; -declare const fetchOptimistic: (defaultedOptions: DefaultedQueryObserverOptions, observer: QueryObserver, errorResetBoundary: QueryErrorResetBoundaryValue) => Promise>; - -export { defaultThrowOnError, ensureSuspenseTimers, fetchOptimistic, shouldSuspend, willFetch }; diff --git a/node_modules/@tanstack/react-query/build/modern/suspense.d.ts b/node_modules/@tanstack/react-query/build/modern/suspense.d.ts deleted file mode 100644 index 954f1fb..0000000 --- a/node_modules/@tanstack/react-query/build/modern/suspense.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { DefaultError, QueryKey, Query, DefaultedQueryObserverOptions, QueryObserver, QueryObserverResult } from '@tanstack/query-core'; -import { QueryErrorResetBoundaryValue } from './QueryErrorResetBoundary.js'; -import 'react/jsx-runtime'; -import 'react'; - -declare const defaultThrowOnError: (_error: TError, query: Query) => boolean; -declare const ensureSuspenseTimers: (defaultedOptions: DefaultedQueryObserverOptions) => void; -declare const willFetch: (result: QueryObserverResult, isRestoring: boolean) => boolean; -declare const shouldSuspend: (defaultedOptions: DefaultedQueryObserverOptions | undefined, result: QueryObserverResult) => boolean | undefined; -declare const fetchOptimistic: (defaultedOptions: DefaultedQueryObserverOptions, observer: QueryObserver, errorResetBoundary: QueryErrorResetBoundaryValue) => Promise>; - -export { defaultThrowOnError, ensureSuspenseTimers, fetchOptimistic, shouldSuspend, willFetch }; diff --git a/node_modules/@tanstack/react-query/build/modern/suspense.js b/node_modules/@tanstack/react-query/build/modern/suspense.js deleted file mode 100644 index 58d8198..0000000 --- a/node_modules/@tanstack/react-query/build/modern/suspense.js +++ /dev/null @@ -1,29 +0,0 @@ -// src/suspense.ts -var defaultThrowOnError = (_error, query) => query.state.data === void 0; -var ensureSuspenseTimers = (defaultedOptions) => { - if (defaultedOptions.suspense) { - const MIN_SUSPENSE_TIME_MS = 1e3; - const clamp = (value) => value === "static" ? value : Math.max(value ?? MIN_SUSPENSE_TIME_MS, MIN_SUSPENSE_TIME_MS); - const originalStaleTime = defaultedOptions.staleTime; - defaultedOptions.staleTime = typeof originalStaleTime === "function" ? (...args) => clamp(originalStaleTime(...args)) : clamp(originalStaleTime); - if (typeof defaultedOptions.gcTime === "number") { - defaultedOptions.gcTime = Math.max( - defaultedOptions.gcTime, - MIN_SUSPENSE_TIME_MS - ); - } - } -}; -var willFetch = (result, isRestoring) => result.isLoading && result.isFetching && !isRestoring; -var shouldSuspend = (defaultedOptions, result) => defaultedOptions?.suspense && result.isPending; -var fetchOptimistic = (defaultedOptions, observer, errorResetBoundary) => observer.fetchOptimistic(defaultedOptions).catch(() => { - errorResetBoundary.clearReset(); -}); -export { - defaultThrowOnError, - ensureSuspenseTimers, - fetchOptimistic, - shouldSuspend, - willFetch -}; -//# sourceMappingURL=suspense.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/suspense.js.map b/node_modules/@tanstack/react-query/build/modern/suspense.js.map deleted file mode 100644 index 6d16820..0000000 --- a/node_modules/@tanstack/react-query/build/modern/suspense.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/suspense.ts"],"sourcesContent":["import type {\n DefaultError,\n DefaultedQueryObserverOptions,\n Query,\n QueryKey,\n QueryObserver,\n QueryObserverResult,\n} from '@tanstack/query-core'\nimport type { QueryErrorResetBoundaryValue } from './QueryErrorResetBoundary'\n\nexport const defaultThrowOnError = <\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n _error: TError,\n query: Query,\n) => query.state.data === undefined\n\nexport const ensureSuspenseTimers = (\n defaultedOptions: DefaultedQueryObserverOptions,\n) => {\n if (defaultedOptions.suspense) {\n // Handle staleTime to ensure minimum 1000ms in Suspense mode\n // This prevents unnecessary refetching when components remount after suspending\n const MIN_SUSPENSE_TIME_MS = 1000\n\n const clamp = (value: number | 'static' | undefined) =>\n value === 'static'\n ? value\n : Math.max(value ?? MIN_SUSPENSE_TIME_MS, MIN_SUSPENSE_TIME_MS)\n\n const originalStaleTime = defaultedOptions.staleTime\n defaultedOptions.staleTime =\n typeof originalStaleTime === 'function'\n ? (...args) => clamp(originalStaleTime(...args))\n : clamp(originalStaleTime)\n\n if (typeof defaultedOptions.gcTime === 'number') {\n defaultedOptions.gcTime = Math.max(\n defaultedOptions.gcTime,\n MIN_SUSPENSE_TIME_MS,\n )\n }\n }\n}\n\nexport const willFetch = (\n result: QueryObserverResult,\n isRestoring: boolean,\n) => result.isLoading && result.isFetching && !isRestoring\n\nexport const shouldSuspend = (\n defaultedOptions:\n | DefaultedQueryObserverOptions\n | undefined,\n result: QueryObserverResult,\n) => defaultedOptions?.suspense && result.isPending\n\nexport const fetchOptimistic = <\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey extends QueryKey,\n>(\n defaultedOptions: DefaultedQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >,\n observer: QueryObserver,\n errorResetBoundary: QueryErrorResetBoundaryValue,\n) =>\n observer.fetchOptimistic(defaultedOptions).catch(() => {\n errorResetBoundary.clearReset()\n })\n"],"mappings":";AAUO,IAAM,sBAAsB,CAMjC,QACA,UACG,MAAM,MAAM,SAAS;AAEnB,IAAM,uBAAuB,CAClC,qBACG;AACH,MAAI,iBAAiB,UAAU;AAG7B,UAAM,uBAAuB;AAE7B,UAAM,QAAQ,CAAC,UACb,UAAU,WACN,QACA,KAAK,IAAI,SAAS,sBAAsB,oBAAoB;AAElE,UAAM,oBAAoB,iBAAiB;AAC3C,qBAAiB,YACf,OAAO,sBAAsB,aACzB,IAAI,SAAS,MAAM,kBAAkB,GAAG,IAAI,CAAC,IAC7C,MAAM,iBAAiB;AAE7B,QAAI,OAAO,iBAAiB,WAAW,UAAU;AAC/C,uBAAiB,SAAS,KAAK;AAAA,QAC7B,iBAAiB;AAAA,QACjB;AAAA,MACF;AAAA,IACF;AAAA,EACF;AACF;AAEO,IAAM,YAAY,CACvB,QACA,gBACG,OAAO,aAAa,OAAO,cAAc,CAAC;AAExC,IAAM,gBAAgB,CAC3B,kBAGA,WACG,kBAAkB,YAAY,OAAO;AAEnC,IAAM,kBAAkB,CAO7B,kBAOA,UACA,uBAEA,SAAS,gBAAgB,gBAAgB,EAAE,MAAM,MAAM;AACrD,qBAAmB,WAAW;AAChC,CAAC;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/types.cjs b/node_modules/@tanstack/react-query/build/modern/types.cjs deleted file mode 100644 index d22152b..0000000 --- a/node_modules/@tanstack/react-query/build/modern/types.cjs +++ /dev/null @@ -1,19 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// src/types.ts -var types_exports = {}; -module.exports = __toCommonJS(types_exports); -//# sourceMappingURL=types.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/types.cjs.map b/node_modules/@tanstack/react-query/build/modern/types.cjs.map deleted file mode 100644 index 3d02938..0000000 --- a/node_modules/@tanstack/react-query/build/modern/types.cjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/types.ts"],"sourcesContent":["/* istanbul ignore file */\n\nimport type {\n DefaultError,\n DefinedInfiniteQueryObserverResult,\n DefinedQueryObserverResult,\n DistributiveOmit,\n FetchQueryOptions,\n InfiniteQueryObserverOptions,\n InfiniteQueryObserverResult,\n MutateFunction,\n MutationObserverOptions,\n MutationObserverResult,\n OmitKeyof,\n Override,\n QueryKey,\n QueryObserverOptions,\n QueryObserverResult,\n SkipToken,\n} from '@tanstack/query-core'\n\nexport type AnyUseBaseQueryOptions = UseBaseQueryOptions<\n any,\n any,\n any,\n any,\n any\n>\nexport interface UseBaseQueryOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> extends QueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n> {\n /**\n * Set this to `false` to unsubscribe this observer from updates to the query cache.\n * Defaults to `true`.\n */\n subscribed?: boolean\n}\n\nexport interface UsePrefetchQueryOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> extends OmitKeyof<\n FetchQueryOptions,\n 'queryFn'\n> {\n queryFn?: Exclude<\n FetchQueryOptions['queryFn'],\n SkipToken\n >\n}\n\nexport type AnyUseQueryOptions = UseQueryOptions\nexport interface UseQueryOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> extends OmitKeyof<\n UseBaseQueryOptions,\n 'suspense'\n> {}\n\nexport type AnyUseSuspenseQueryOptions = UseSuspenseQueryOptions<\n any,\n any,\n any,\n any\n>\nexport interface UseSuspenseQueryOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> extends OmitKeyof<\n UseQueryOptions,\n 'queryFn' | 'enabled' | 'throwOnError' | 'placeholderData'\n> {\n queryFn?: Exclude<\n UseQueryOptions['queryFn'],\n SkipToken\n >\n}\n\nexport type AnyUseInfiniteQueryOptions = UseInfiniteQueryOptions<\n any,\n any,\n any,\n any,\n any\n>\nexport interface UseInfiniteQueryOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n> extends OmitKeyof<\n InfiniteQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n 'suspense'\n> {\n /**\n * Set this to `false` to unsubscribe this observer from updates to the query cache.\n * Defaults to `true`.\n */\n subscribed?: boolean\n}\n\nexport type AnyUseSuspenseInfiniteQueryOptions =\n UseSuspenseInfiniteQueryOptions\nexport interface UseSuspenseInfiniteQueryOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n> extends OmitKeyof<\n UseInfiniteQueryOptions,\n 'queryFn' | 'enabled' | 'throwOnError' | 'placeholderData'\n> {\n queryFn?: Exclude<\n UseInfiniteQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >['queryFn'],\n SkipToken\n >\n}\n\nexport type UseBaseQueryResult<\n TData = unknown,\n TError = DefaultError,\n> = QueryObserverResult\n\nexport type UseQueryResult<\n TData = unknown,\n TError = DefaultError,\n> = UseBaseQueryResult\n\nexport type UseSuspenseQueryResult<\n TData = unknown,\n TError = DefaultError,\n> = DistributiveOmit<\n DefinedQueryObserverResult,\n 'isPlaceholderData' | 'promise'\n>\n\nexport type DefinedUseQueryResult<\n TData = unknown,\n TError = DefaultError,\n> = DefinedQueryObserverResult\n\nexport type UseInfiniteQueryResult<\n TData = unknown,\n TError = DefaultError,\n> = InfiniteQueryObserverResult\n\nexport type DefinedUseInfiniteQueryResult<\n TData = unknown,\n TError = DefaultError,\n> = DefinedInfiniteQueryObserverResult\n\nexport type UseSuspenseInfiniteQueryResult<\n TData = unknown,\n TError = DefaultError,\n> = OmitKeyof<\n DefinedInfiniteQueryObserverResult,\n 'isPlaceholderData' | 'promise'\n>\n\nexport type AnyUseMutationOptions = UseMutationOptions\nexport interface UseMutationOptions<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n> extends OmitKeyof<\n MutationObserverOptions,\n '_defaulted'\n> {}\n\nexport type UseMutateFunction<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n> = (\n ...args: Parameters<\n MutateFunction\n >\n) => void\n\nexport type UseMutateAsyncFunction<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n> = MutateFunction\n\nexport type UseBaseMutationResult<\n TData = unknown,\n TError = DefaultError,\n TVariables = unknown,\n TOnMutateResult = unknown,\n> = Override<\n MutationObserverResult,\n { mutate: UseMutateFunction }\n> & {\n mutateAsync: UseMutateAsyncFunction<\n TData,\n TError,\n TVariables,\n TOnMutateResult\n >\n}\n\nexport type UseMutationResult<\n TData = unknown,\n TError = DefaultError,\n TVariables = unknown,\n TOnMutateResult = unknown,\n> = UseBaseMutationResult\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/types.d.cts b/node_modules/@tanstack/react-query/build/modern/types.d.cts deleted file mode 100644 index e9d55b2..0000000 --- a/node_modules/@tanstack/react-query/build/modern/types.d.cts +++ /dev/null @@ -1,52 +0,0 @@ -import { DefaultError, QueryKey, QueryObserverOptions, OmitKeyof, InfiniteQueryObserverOptions, MutationObserverOptions, SkipToken, DefinedInfiniteQueryObserverResult, DefinedQueryObserverResult, QueryObserverResult, DistributiveOmit, Override, MutationObserverResult, MutateFunction, InfiniteQueryObserverResult, FetchQueryOptions } from '@tanstack/query-core'; - -type AnyUseBaseQueryOptions = UseBaseQueryOptions; -interface UseBaseQueryOptions extends QueryObserverOptions { - /** - * Set this to `false` to unsubscribe this observer from updates to the query cache. - * Defaults to `true`. - */ - subscribed?: boolean; -} -interface UsePrefetchQueryOptions extends OmitKeyof, 'queryFn'> { - queryFn?: Exclude['queryFn'], SkipToken>; -} -type AnyUseQueryOptions = UseQueryOptions; -interface UseQueryOptions extends OmitKeyof, 'suspense'> { -} -type AnyUseSuspenseQueryOptions = UseSuspenseQueryOptions; -interface UseSuspenseQueryOptions extends OmitKeyof, 'queryFn' | 'enabled' | 'throwOnError' | 'placeholderData'> { - queryFn?: Exclude['queryFn'], SkipToken>; -} -type AnyUseInfiniteQueryOptions = UseInfiniteQueryOptions; -interface UseInfiniteQueryOptions extends OmitKeyof, 'suspense'> { - /** - * Set this to `false` to unsubscribe this observer from updates to the query cache. - * Defaults to `true`. - */ - subscribed?: boolean; -} -type AnyUseSuspenseInfiniteQueryOptions = UseSuspenseInfiniteQueryOptions; -interface UseSuspenseInfiniteQueryOptions extends OmitKeyof, 'queryFn' | 'enabled' | 'throwOnError' | 'placeholderData'> { - queryFn?: Exclude['queryFn'], SkipToken>; -} -type UseBaseQueryResult = QueryObserverResult; -type UseQueryResult = UseBaseQueryResult; -type UseSuspenseQueryResult = DistributiveOmit, 'isPlaceholderData' | 'promise'>; -type DefinedUseQueryResult = DefinedQueryObserverResult; -type UseInfiniteQueryResult = InfiniteQueryObserverResult; -type DefinedUseInfiniteQueryResult = DefinedInfiniteQueryObserverResult; -type UseSuspenseInfiniteQueryResult = OmitKeyof, 'isPlaceholderData' | 'promise'>; -type AnyUseMutationOptions = UseMutationOptions; -interface UseMutationOptions extends OmitKeyof, '_defaulted'> { -} -type UseMutateFunction = (...args: Parameters>) => void; -type UseMutateAsyncFunction = MutateFunction; -type UseBaseMutationResult = Override, { - mutate: UseMutateFunction; -}> & { - mutateAsync: UseMutateAsyncFunction; -}; -type UseMutationResult = UseBaseMutationResult; - -export type { AnyUseBaseQueryOptions, AnyUseInfiniteQueryOptions, AnyUseMutationOptions, AnyUseQueryOptions, AnyUseSuspenseInfiniteQueryOptions, AnyUseSuspenseQueryOptions, DefinedUseInfiniteQueryResult, DefinedUseQueryResult, UseBaseMutationResult, UseBaseQueryOptions, UseBaseQueryResult, UseInfiniteQueryOptions, UseInfiniteQueryResult, UseMutateAsyncFunction, UseMutateFunction, UseMutationOptions, UseMutationResult, UsePrefetchQueryOptions, UseQueryOptions, UseQueryResult, UseSuspenseInfiniteQueryOptions, UseSuspenseInfiniteQueryResult, UseSuspenseQueryOptions, UseSuspenseQueryResult }; diff --git a/node_modules/@tanstack/react-query/build/modern/types.d.ts b/node_modules/@tanstack/react-query/build/modern/types.d.ts deleted file mode 100644 index e9d55b2..0000000 --- a/node_modules/@tanstack/react-query/build/modern/types.d.ts +++ /dev/null @@ -1,52 +0,0 @@ -import { DefaultError, QueryKey, QueryObserverOptions, OmitKeyof, InfiniteQueryObserverOptions, MutationObserverOptions, SkipToken, DefinedInfiniteQueryObserverResult, DefinedQueryObserverResult, QueryObserverResult, DistributiveOmit, Override, MutationObserverResult, MutateFunction, InfiniteQueryObserverResult, FetchQueryOptions } from '@tanstack/query-core'; - -type AnyUseBaseQueryOptions = UseBaseQueryOptions; -interface UseBaseQueryOptions extends QueryObserverOptions { - /** - * Set this to `false` to unsubscribe this observer from updates to the query cache. - * Defaults to `true`. - */ - subscribed?: boolean; -} -interface UsePrefetchQueryOptions extends OmitKeyof, 'queryFn'> { - queryFn?: Exclude['queryFn'], SkipToken>; -} -type AnyUseQueryOptions = UseQueryOptions; -interface UseQueryOptions extends OmitKeyof, 'suspense'> { -} -type AnyUseSuspenseQueryOptions = UseSuspenseQueryOptions; -interface UseSuspenseQueryOptions extends OmitKeyof, 'queryFn' | 'enabled' | 'throwOnError' | 'placeholderData'> { - queryFn?: Exclude['queryFn'], SkipToken>; -} -type AnyUseInfiniteQueryOptions = UseInfiniteQueryOptions; -interface UseInfiniteQueryOptions extends OmitKeyof, 'suspense'> { - /** - * Set this to `false` to unsubscribe this observer from updates to the query cache. - * Defaults to `true`. - */ - subscribed?: boolean; -} -type AnyUseSuspenseInfiniteQueryOptions = UseSuspenseInfiniteQueryOptions; -interface UseSuspenseInfiniteQueryOptions extends OmitKeyof, 'queryFn' | 'enabled' | 'throwOnError' | 'placeholderData'> { - queryFn?: Exclude['queryFn'], SkipToken>; -} -type UseBaseQueryResult = QueryObserverResult; -type UseQueryResult = UseBaseQueryResult; -type UseSuspenseQueryResult = DistributiveOmit, 'isPlaceholderData' | 'promise'>; -type DefinedUseQueryResult = DefinedQueryObserverResult; -type UseInfiniteQueryResult = InfiniteQueryObserverResult; -type DefinedUseInfiniteQueryResult = DefinedInfiniteQueryObserverResult; -type UseSuspenseInfiniteQueryResult = OmitKeyof, 'isPlaceholderData' | 'promise'>; -type AnyUseMutationOptions = UseMutationOptions; -interface UseMutationOptions extends OmitKeyof, '_defaulted'> { -} -type UseMutateFunction = (...args: Parameters>) => void; -type UseMutateAsyncFunction = MutateFunction; -type UseBaseMutationResult = Override, { - mutate: UseMutateFunction; -}> & { - mutateAsync: UseMutateAsyncFunction; -}; -type UseMutationResult = UseBaseMutationResult; - -export type { AnyUseBaseQueryOptions, AnyUseInfiniteQueryOptions, AnyUseMutationOptions, AnyUseQueryOptions, AnyUseSuspenseInfiniteQueryOptions, AnyUseSuspenseQueryOptions, DefinedUseInfiniteQueryResult, DefinedUseQueryResult, UseBaseMutationResult, UseBaseQueryOptions, UseBaseQueryResult, UseInfiniteQueryOptions, UseInfiniteQueryResult, UseMutateAsyncFunction, UseMutateFunction, UseMutationOptions, UseMutationResult, UsePrefetchQueryOptions, UseQueryOptions, UseQueryResult, UseSuspenseInfiniteQueryOptions, UseSuspenseInfiniteQueryResult, UseSuspenseQueryOptions, UseSuspenseQueryResult }; diff --git a/node_modules/@tanstack/react-query/build/modern/types.js b/node_modules/@tanstack/react-query/build/modern/types.js deleted file mode 100644 index 5b2306a..0000000 --- a/node_modules/@tanstack/react-query/build/modern/types.js +++ /dev/null @@ -1 +0,0 @@ -//# sourceMappingURL=types.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/types.js.map b/node_modules/@tanstack/react-query/build/modern/types.js.map deleted file mode 100644 index 84c51b2..0000000 --- a/node_modules/@tanstack/react-query/build/modern/types.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/useBaseQuery.cjs b/node_modules/@tanstack/react-query/build/modern/useBaseQuery.cjs deleted file mode 100644 index 6fc8ff5..0000000 --- a/node_modules/@tanstack/react-query/build/modern/useBaseQuery.cjs +++ /dev/null @@ -1,130 +0,0 @@ -"use strict"; -"use client"; -var __create = Object.create; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __getProtoOf = Object.getPrototypeOf; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( - // If the importer is in node compatibility mode or this is not an ESM - // file that has been converted to a CommonJS file using a Babel- - // compatible transform (i.e. "__esModule" has not been set), then set - // "default" to the CommonJS "module.exports" for node compatibility. - isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, - mod -)); -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// src/useBaseQuery.ts -var useBaseQuery_exports = {}; -__export(useBaseQuery_exports, { - useBaseQuery: () => useBaseQuery -}); -module.exports = __toCommonJS(useBaseQuery_exports); -var React = __toESM(require("react"), 1); -var import_query_core = require("@tanstack/query-core"); -var import_QueryClientProvider = require("./QueryClientProvider.cjs"); -var import_QueryErrorResetBoundary = require("./QueryErrorResetBoundary.cjs"); -var import_errorBoundaryUtils = require("./errorBoundaryUtils.cjs"); -var import_IsRestoringProvider = require("./IsRestoringProvider.cjs"); -var import_suspense = require("./suspense.cjs"); -function useBaseQuery(options, Observer, queryClient) { - if (process.env.NODE_ENV !== "production") { - if (typeof options !== "object" || Array.isArray(options)) { - throw new Error( - 'Bad argument type. Starting with v5, only the "Object" form is allowed when calling query related functions. Please use the error stack to find the culprit call. More info here: https://tanstack.com/query/latest/docs/react/guides/migrating-to-v5#supports-a-single-signature-one-object' - ); - } - } - const isRestoring = (0, import_IsRestoringProvider.useIsRestoring)(); - const errorResetBoundary = (0, import_QueryErrorResetBoundary.useQueryErrorResetBoundary)(); - const client = (0, import_QueryClientProvider.useQueryClient)(queryClient); - const defaultedOptions = client.defaultQueryOptions(options); - client.getDefaultOptions().queries?._experimental_beforeQuery?.( - defaultedOptions - ); - const query = client.getQueryCache().get(defaultedOptions.queryHash); - if (process.env.NODE_ENV !== "production") { - if (!defaultedOptions.queryFn) { - console.error( - `[${defaultedOptions.queryHash}]: No queryFn was passed as an option, and no default queryFn was found. The queryFn parameter is only optional when using a default queryFn. More info here: https://tanstack.com/query/latest/docs/framework/react/guides/default-query-function` - ); - } - } - defaultedOptions._optimisticResults = isRestoring ? "isRestoring" : "optimistic"; - (0, import_suspense.ensureSuspenseTimers)(defaultedOptions); - (0, import_errorBoundaryUtils.ensurePreventErrorBoundaryRetry)(defaultedOptions, errorResetBoundary, query); - (0, import_errorBoundaryUtils.useClearResetErrorBoundary)(errorResetBoundary); - const isNewCacheEntry = !client.getQueryCache().get(defaultedOptions.queryHash); - const [observer] = React.useState( - () => new Observer( - client, - defaultedOptions - ) - ); - const result = observer.getOptimisticResult(defaultedOptions); - const shouldSubscribe = !isRestoring && options.subscribed !== false; - React.useSyncExternalStore( - React.useCallback( - (onStoreChange) => { - const unsubscribe = shouldSubscribe ? observer.subscribe(import_query_core.notifyManager.batchCalls(onStoreChange)) : import_query_core.noop; - observer.updateResult(); - return unsubscribe; - }, - [observer, shouldSubscribe] - ), - () => observer.getCurrentResult(), - () => observer.getCurrentResult() - ); - React.useEffect(() => { - observer.setOptions(defaultedOptions); - }, [defaultedOptions, observer]); - if ((0, import_suspense.shouldSuspend)(defaultedOptions, result)) { - throw (0, import_suspense.fetchOptimistic)(defaultedOptions, observer, errorResetBoundary); - } - if ((0, import_errorBoundaryUtils.getHasError)({ - result, - errorResetBoundary, - throwOnError: defaultedOptions.throwOnError, - query, - suspense: defaultedOptions.suspense - })) { - throw result.error; - } - ; - client.getDefaultOptions().queries?._experimental_afterQuery?.( - defaultedOptions, - result - ); - if (defaultedOptions.experimental_prefetchInRender && !import_query_core.isServer && (0, import_suspense.willFetch)(result, isRestoring)) { - const promise = isNewCacheEntry ? ( - // Fetch immediately on render in order to ensure `.promise` is resolved even if the component is unmounted - (0, import_suspense.fetchOptimistic)(defaultedOptions, observer, errorResetBoundary) - ) : ( - // subscribe to the "cache promise" so that we can finalize the currentThenable once data comes in - query?.promise - ); - promise?.catch(import_query_core.noop).finally(() => { - observer.updateResult(); - }); - } - return !defaultedOptions.notifyOnChangeProps ? observer.trackResult(result) : result; -} -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - useBaseQuery -}); -//# sourceMappingURL=useBaseQuery.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/useBaseQuery.cjs.map b/node_modules/@tanstack/react-query/build/modern/useBaseQuery.cjs.map deleted file mode 100644 index c530f95..0000000 --- a/node_modules/@tanstack/react-query/build/modern/useBaseQuery.cjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/useBaseQuery.ts"],"sourcesContent":["'use client'\nimport * as React from 'react'\n\nimport { isServer, noop, notifyManager } from '@tanstack/query-core'\nimport { useQueryClient } from './QueryClientProvider'\nimport { useQueryErrorResetBoundary } from './QueryErrorResetBoundary'\nimport {\n ensurePreventErrorBoundaryRetry,\n getHasError,\n useClearResetErrorBoundary,\n} from './errorBoundaryUtils'\nimport { useIsRestoring } from './IsRestoringProvider'\nimport {\n ensureSuspenseTimers,\n fetchOptimistic,\n shouldSuspend,\n willFetch,\n} from './suspense'\nimport type {\n QueryClient,\n QueryKey,\n QueryObserver,\n QueryObserverResult,\n} from '@tanstack/query-core'\nimport type { UseBaseQueryOptions } from './types'\n\nexport function useBaseQuery<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey extends QueryKey,\n>(\n options: UseBaseQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >,\n Observer: typeof QueryObserver,\n queryClient?: QueryClient,\n): QueryObserverResult {\n if (process.env.NODE_ENV !== 'production') {\n if (typeof options !== 'object' || Array.isArray(options)) {\n throw new Error(\n 'Bad argument type. Starting with v5, only the \"Object\" form is allowed when calling query related functions. Please use the error stack to find the culprit call. More info here: https://tanstack.com/query/latest/docs/react/guides/migrating-to-v5#supports-a-single-signature-one-object',\n )\n }\n }\n\n const isRestoring = useIsRestoring()\n const errorResetBoundary = useQueryErrorResetBoundary()\n const client = useQueryClient(queryClient)\n const defaultedOptions = client.defaultQueryOptions(options)\n ;(client.getDefaultOptions().queries as any)?._experimental_beforeQuery?.(\n defaultedOptions,\n )\n\n const query = client\n .getQueryCache()\n .get<\n TQueryFnData,\n TError,\n TQueryData,\n TQueryKey\n >(defaultedOptions.queryHash)\n\n if (process.env.NODE_ENV !== 'production') {\n if (!defaultedOptions.queryFn) {\n console.error(\n `[${defaultedOptions.queryHash}]: No queryFn was passed as an option, and no default queryFn was found. The queryFn parameter is only optional when using a default queryFn. More info here: https://tanstack.com/query/latest/docs/framework/react/guides/default-query-function`,\n )\n }\n }\n\n // Make sure results are optimistically set in fetching state before subscribing or updating options\n defaultedOptions._optimisticResults = isRestoring\n ? 'isRestoring'\n : 'optimistic'\n\n ensureSuspenseTimers(defaultedOptions)\n ensurePreventErrorBoundaryRetry(defaultedOptions, errorResetBoundary, query)\n useClearResetErrorBoundary(errorResetBoundary)\n\n // this needs to be invoked before creating the Observer because that can create a cache entry\n const isNewCacheEntry = !client\n .getQueryCache()\n .get(defaultedOptions.queryHash)\n\n const [observer] = React.useState(\n () =>\n new Observer(\n client,\n defaultedOptions,\n ),\n )\n\n // note: this must be called before useSyncExternalStore\n const result = observer.getOptimisticResult(defaultedOptions)\n\n const shouldSubscribe = !isRestoring && options.subscribed !== false\n React.useSyncExternalStore(\n React.useCallback(\n (onStoreChange) => {\n const unsubscribe = shouldSubscribe\n ? observer.subscribe(notifyManager.batchCalls(onStoreChange))\n : noop\n\n // Update result to make sure we did not miss any query updates\n // between creating the observer and subscribing to it.\n observer.updateResult()\n\n return unsubscribe\n },\n [observer, shouldSubscribe],\n ),\n () => observer.getCurrentResult(),\n () => observer.getCurrentResult(),\n )\n\n React.useEffect(() => {\n observer.setOptions(defaultedOptions)\n }, [defaultedOptions, observer])\n\n // Handle suspense\n if (shouldSuspend(defaultedOptions, result)) {\n throw fetchOptimistic(defaultedOptions, observer, errorResetBoundary)\n }\n\n // Handle error boundary\n if (\n getHasError({\n result,\n errorResetBoundary,\n throwOnError: defaultedOptions.throwOnError,\n query,\n suspense: defaultedOptions.suspense,\n })\n ) {\n throw result.error\n }\n\n ;(client.getDefaultOptions().queries as any)?._experimental_afterQuery?.(\n defaultedOptions,\n result,\n )\n\n if (\n defaultedOptions.experimental_prefetchInRender &&\n !isServer &&\n willFetch(result, isRestoring)\n ) {\n const promise = isNewCacheEntry\n ? // Fetch immediately on render in order to ensure `.promise` is resolved even if the component is unmounted\n fetchOptimistic(defaultedOptions, observer, errorResetBoundary)\n : // subscribe to the \"cache promise\" so that we can finalize the currentThenable once data comes in\n query?.promise\n\n promise?.catch(noop).finally(() => {\n // `.updateResult()` will trigger `.#currentThenable` to finalize\n observer.updateResult()\n })\n }\n\n // Handle result property usage tracking\n return !defaultedOptions.notifyOnChangeProps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kBAChB,SAAS,UAAU,gCAAc,WAAW,aAAa,CAAC,IAC1D;AAIJ,iBAAS,aAAa;AAEtB,eAAO;AAAA,MACT;AAAA,MACA,CAAC,UAAU,eAAe;AAAA,IAC5B;AAAA,IACA,MAAM,SAAS,iBAAiB;AAAA,IAChC,MAAM,SAAS,iBAAiB;AAAA,EAClC;AAEA,EAAM,gBAAU,MAAM;AACpB,aAAS,WAAW,gBAAgB;AAAA,EACtC,GAAG,CAAC,kBAAkB,QAAQ,CAAC;AAG/B,UAAI,+BAAc,kBAAkB,MAAM,GAAG;AAC3C,cAAM,iCAAgB,kBAAkB,UAAU,kBAAkB;AAAA,EACtE;AAGA,UACE,uCAAY;AAAA,IACV;AAAA,IACA;AAAA,IACA,cAAc,iBAAiB;AAAA,IAC/B;AAAA,IACA,UAAU,iBAAiB;AAAA,EAC7B,CAAC,GACD;AACA,UAAM,OAAO;AAAA,EACf;AAEA;AAAC,EAAC,OAAO,kBAAkB,EAAE,SAAiB;AAAA,IAC5C;AAAA,IACA;AAAA,EACF;AAEA,MACE,iBAAiB,iCACjB,CAAC,kCACD,2BAAU,QAAQ,WAAW,GAC7B;AACA,UAAM,UAAU;AAAA;AAAA,UAEZ,iCAAgB,kBAAkB,UAAU,kBAAkB;AAAA;AAAA;AAAA,MAE9D,OAAO;AAAA;AAEX,aAAS,MAAM,sBAAI,EAAE,QAAQ,MAAM;AAEjC,eAAS,aAAa;AAAA,IACxB,CAAC;AAAA,EACH;AAGA,SAAO,CAAC,iBAAiB,sBACrB,SAAS,YAAY,MAAM,IAC3B;AACN;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/useBaseQuery.d.cts b/node_modules/@tanstack/react-query/build/modern/useBaseQuery.d.cts deleted file mode 100644 index baa8469..0000000 --- a/node_modules/@tanstack/react-query/build/modern/useBaseQuery.d.cts +++ /dev/null @@ -1,6 +0,0 @@ -import { QueryKey, QueryObserver, QueryClient, QueryObserverResult } from '@tanstack/query-core'; -import { UseBaseQueryOptions } from './types.cjs'; - -declare function useBaseQuery(options: UseBaseQueryOptions, Observer: typeof QueryObserver, queryClient?: QueryClient): QueryObserverResult; - -export { useBaseQuery }; diff --git a/node_modules/@tanstack/react-query/build/modern/useBaseQuery.d.ts b/node_modules/@tanstack/react-query/build/modern/useBaseQuery.d.ts deleted file mode 100644 index 60430b0..0000000 --- a/node_modules/@tanstack/react-query/build/modern/useBaseQuery.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { QueryKey, QueryObserver, QueryClient, QueryObserverResult } from '@tanstack/query-core'; -import { UseBaseQueryOptions } from './types.js'; - -declare function useBaseQuery(options: UseBaseQueryOptions, Observer: typeof QueryObserver, queryClient?: QueryClient): QueryObserverResult; - -export { useBaseQuery }; diff --git a/node_modules/@tanstack/react-query/build/modern/useBaseQuery.js b/node_modules/@tanstack/react-query/build/modern/useBaseQuery.js deleted file mode 100644 index d1c375a..0000000 --- a/node_modules/@tanstack/react-query/build/modern/useBaseQuery.js +++ /dev/null @@ -1,105 +0,0 @@ -"use client"; - -// src/useBaseQuery.ts -import * as React from "react"; -import { isServer, noop, notifyManager } from "@tanstack/query-core"; -import { useQueryClient } from "./QueryClientProvider.js"; -import { useQueryErrorResetBoundary } from "./QueryErrorResetBoundary.js"; -import { - ensurePreventErrorBoundaryRetry, - getHasError, - useClearResetErrorBoundary -} from "./errorBoundaryUtils.js"; -import { useIsRestoring } from "./IsRestoringProvider.js"; -import { - ensureSuspenseTimers, - fetchOptimistic, - shouldSuspend, - willFetch -} from "./suspense.js"; -function useBaseQuery(options, Observer, queryClient) { - if (process.env.NODE_ENV !== "production") { - if (typeof options !== "object" || Array.isArray(options)) { - throw new Error( - 'Bad argument type. Starting with v5, only the "Object" form is allowed when calling query related functions. Please use the error stack to find the culprit call. More info here: https://tanstack.com/query/latest/docs/react/guides/migrating-to-v5#supports-a-single-signature-one-object' - ); - } - } - const isRestoring = useIsRestoring(); - const errorResetBoundary = useQueryErrorResetBoundary(); - const client = useQueryClient(queryClient); - const defaultedOptions = client.defaultQueryOptions(options); - client.getDefaultOptions().queries?._experimental_beforeQuery?.( - defaultedOptions - ); - const query = client.getQueryCache().get(defaultedOptions.queryHash); - if (process.env.NODE_ENV !== "production") { - if (!defaultedOptions.queryFn) { - console.error( - `[${defaultedOptions.queryHash}]: No queryFn was passed as an option, and no default queryFn was found. The queryFn parameter is only optional when using a default queryFn. More info here: https://tanstack.com/query/latest/docs/framework/react/guides/default-query-function` - ); - } - } - defaultedOptions._optimisticResults = isRestoring ? "isRestoring" : "optimistic"; - ensureSuspenseTimers(defaultedOptions); - ensurePreventErrorBoundaryRetry(defaultedOptions, errorResetBoundary, query); - useClearResetErrorBoundary(errorResetBoundary); - const isNewCacheEntry = !client.getQueryCache().get(defaultedOptions.queryHash); - const [observer] = React.useState( - () => new Observer( - client, - defaultedOptions - ) - ); - const result = observer.getOptimisticResult(defaultedOptions); - const shouldSubscribe = !isRestoring && options.subscribed !== false; - React.useSyncExternalStore( - React.useCallback( - (onStoreChange) => { - const unsubscribe = shouldSubscribe ? observer.subscribe(notifyManager.batchCalls(onStoreChange)) : noop; - observer.updateResult(); - return unsubscribe; - }, - [observer, shouldSubscribe] - ), - () => observer.getCurrentResult(), - () => observer.getCurrentResult() - ); - React.useEffect(() => { - observer.setOptions(defaultedOptions); - }, [defaultedOptions, observer]); - if (shouldSuspend(defaultedOptions, result)) { - throw fetchOptimistic(defaultedOptions, observer, errorResetBoundary); - } - if (getHasError({ - result, - errorResetBoundary, - throwOnError: defaultedOptions.throwOnError, - query, - suspense: defaultedOptions.suspense - })) { - throw result.error; - } - ; - client.getDefaultOptions().queries?._experimental_afterQuery?.( - defaultedOptions, - result - ); - if (defaultedOptions.experimental_prefetchInRender && !isServer && willFetch(result, isRestoring)) { - const promise = isNewCacheEntry ? ( - // Fetch immediately on render in order to ensure `.promise` is resolved even if the component is unmounted - fetchOptimistic(defaultedOptions, observer, errorResetBoundary) - ) : ( - // subscribe to the "cache promise" so that we can finalize the currentThenable once data comes in - query?.promise - ); - promise?.catch(noop).finally(() => { - observer.updateResult(); - }); - } - return !defaultedOptions.notifyOnChangeProps ? observer.trackResult(result) : result; -} -export { - useBaseQuery -}; -//# sourceMappingURL=useBaseQuery.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/useBaseQuery.js.map b/node_modules/@tanstack/react-query/build/modern/useBaseQuery.js.map deleted file mode 100644 index 43e2543..0000000 --- a/node_modules/@tanstack/react-query/build/modern/useBaseQuery.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/useBaseQuery.ts"],"sourcesContent":["'use client'\nimport * as React from 'react'\n\nimport { isServer, noop, notifyManager } from '@tanstack/query-core'\nimport { useQueryClient } from './QueryClientProvider'\nimport { useQueryErrorResetBoundary } from './QueryErrorResetBoundary'\nimport {\n ensurePreventErrorBoundaryRetry,\n getHasError,\n useClearResetErrorBoundary,\n} from './errorBoundaryUtils'\nimport { useIsRestoring } from './IsRestoringProvider'\nimport {\n ensureSuspenseTimers,\n fetchOptimistic,\n shouldSuspend,\n willFetch,\n} from './suspense'\nimport type {\n QueryClient,\n QueryKey,\n QueryObserver,\n QueryObserverResult,\n} from '@tanstack/query-core'\nimport type { UseBaseQueryOptions } from './types'\n\nexport function useBaseQuery<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey extends QueryKey,\n>(\n options: UseBaseQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >,\n Observer: typeof QueryObserver,\n queryClient?: QueryClient,\n): QueryObserverResult {\n if (process.env.NODE_ENV !== 'production') {\n if (typeof options !== 'object' || Array.isArray(options)) {\n throw new Error(\n 'Bad argument type. Starting with v5, only the \"Object\" form is allowed when calling query related functions. Please use the error stack to find the culprit call. More info here: https://tanstack.com/query/latest/docs/react/guides/migrating-to-v5#supports-a-single-signature-one-object',\n )\n }\n }\n\n const isRestoring = useIsRestoring()\n const errorResetBoundary = useQueryErrorResetBoundary()\n const client = useQueryClient(queryClient)\n const defaultedOptions = client.defaultQueryOptions(options)\n ;(client.getDefaultOptions().queries as any)?._experimental_beforeQuery?.(\n defaultedOptions,\n )\n\n const query = client\n .getQueryCache()\n .get<\n TQueryFnData,\n TError,\n TQueryData,\n TQueryKey\n >(defaultedOptions.queryHash)\n\n if (process.env.NODE_ENV !== 'production') {\n if (!defaultedOptions.queryFn) {\n console.error(\n `[${defaultedOptions.queryHash}]: No queryFn was passed as an option, and no default queryFn was found. The queryFn parameter is only optional when using a default queryFn. More info here: https://tanstack.com/query/latest/docs/framework/react/guides/default-query-function`,\n )\n }\n }\n\n // Make sure results are optimistically set in fetching state before subscribing or updating options\n defaultedOptions._optimisticResults = isRestoring\n ? 'isRestoring'\n : 'optimistic'\n\n ensureSuspenseTimers(defaultedOptions)\n ensurePreventErrorBoundaryRetry(defaultedOptions, errorResetBoundary, query)\n useClearResetErrorBoundary(errorResetBoundary)\n\n // this needs to be invoked before creating the Observer because that can create a cache entry\n const isNewCacheEntry = !client\n .getQueryCache()\n .get(defaultedOptions.queryHash)\n\n const [observer] = React.useState(\n () =>\n new Observer(\n client,\n defaultedOptions,\n ),\n )\n\n // note: this must be called before useSyncExternalStore\n const result = observer.getOptimisticResult(defaultedOptions)\n\n const shouldSubscribe = !isRestoring && options.subscribed !== false\n React.useSyncExternalStore(\n React.useCallback(\n (onStoreChange) => {\n const unsubscribe = shouldSubscribe\n ? observer.subscribe(notifyManager.batchCalls(onStoreChange))\n : noop\n\n // Update result to make sure we did not miss any query updates\n // between creating the observer and subscribing to it.\n observer.updateResult()\n\n return unsubscribe\n },\n [observer, shouldSubscribe],\n ),\n () => observer.getCurrentResult(),\n () => observer.getCurrentResult(),\n )\n\n React.useEffect(() => {\n observer.setOptions(defaultedOptions)\n }, [defaultedOptions, observer])\n\n // Handle suspense\n if (shouldSuspend(defaultedOptions, result)) {\n throw fetchOptimistic(defaultedOptions, observer, errorResetBoundary)\n }\n\n // Handle error boundary\n if (\n getHasError({\n result,\n errorResetBoundary,\n throwOnError: defaultedOptions.throwOnError,\n query,\n suspense: defaultedOptions.suspense,\n })\n ) {\n throw result.error\n }\n\n ;(client.getDefaultOptions().queries as any)?._experimental_afterQuery?.(\n defaultedOptions,\n result,\n )\n\n if (\n defaultedOptions.experimental_prefetchInRender &&\n !isServer &&\n willFetch(result, isRestoring)\n ) {\n const promise = isNewCacheEntry\n ? // Fetch immediately on render in order to ensure `.promise` is resolved even if the component is unmounted\n fetchOptimistic(defaultedOptions, observer, errorResetBoundary)\n : // subscribe to the \"cache promise\" so that we can finalize the currentThenable once data comes in\n query?.promise\n\n promise?.catch(noop).finally(() => {\n // `.updateResult()` will trigger `.#currentThenable` to finalize\n observer.updateResult()\n })\n }\n\n // Handle result property usage tracking\n return !defaultedOptions.notifyOnChangeProps\n ? observer.trackResult(result)\n : result\n}\n"],"mappings":";;;AACA,YAAY,WAAW;AAEvB,SAAS,UAAU,MAAM,qBAAqB;AAC9C,SAAS,sBAAsB;AAC/B,SAAS,kCAAkC;AAC3C;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,sBAAsB;AAC/B;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AASA,SAAS,aAOd,SAOA,UACA,aACoC;AACpC,MAAI,QAAQ,IAAI,aAAa,cAAc;AACzC,QAAI,OAAO,YAAY,YAAY,MAAM,QAAQ,OAAO,GAAG;AACzD,YAAM,IAAI;AAAA,QACR;AAAA,MACF;AAAA,IACF;AAAA,EACF;AAEA,QAAM,cAAc,eAAe;AACnC,QAAM,qBAAqB,2BAA2B;AACtD,QAAM,SAAS,eAAe,WAAW;AACzC,QAAM,mBAAmB,OAAO,oBAAoB,OAAO;AAC1D,EAAC,OAAO,kBAAkB,EAAE,SAAiB;AAAA,IAC5C;AAAA,EACF;AAEA,QAAM,QAAQ,OACX,cAAc,EACd,IAKC,iBAAiB,SAAS;AAE9B,MAAI,QAAQ,IAAI,aAAa,cAAc;AACz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U,QAAQ,WAAW,GAC7B;AACA,UAAM,UAAU;AAAA;AAAA,MAEZ,gBAAgB,kBAAkB,UAAU,kBAAkB;AAAA;AAAA;AAAA,MAE9D,OAAO;AAAA;AAEX,aAAS,MAAM,IAAI,EAAE,QAAQ,MAAM;AAEjC,eAAS,aAAa;AAAA,IACxB,CAAC;AAAA,EACH;AAGA,SAAO,CAAC,iBAAiB,sBACrB,SAAS,YAAY,MAAM,IAC3B;AACN;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/useInfiniteQuery.cjs b/node_modules/@tanstack/react-query/build/modern/useInfiniteQuery.cjs deleted file mode 100644 index e1ae216..0000000 --- a/node_modules/@tanstack/react-query/build/modern/useInfiniteQuery.cjs +++ /dev/null @@ -1,40 +0,0 @@ -"use strict"; -"use client"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// src/useInfiniteQuery.ts -var useInfiniteQuery_exports = {}; -__export(useInfiniteQuery_exports, { - useInfiniteQuery: () => useInfiniteQuery -}); -module.exports = __toCommonJS(useInfiniteQuery_exports); -var import_query_core = require("@tanstack/query-core"); -var import_useBaseQuery = require("./useBaseQuery.cjs"); -function useInfiniteQuery(options, queryClient) { - return (0, import_useBaseQuery.useBaseQuery)( - options, - import_query_core.InfiniteQueryObserver, - queryClient - ); -} -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - useInfiniteQuery -}); -//# sourceMappingURL=useInfiniteQuery.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/useInfiniteQuery.cjs.map b/node_modules/@tanstack/react-query/build/modern/useInfiniteQuery.cjs.map deleted file mode 100644 index 66c4cc1..0000000 --- a/node_modules/@tanstack/react-query/build/modern/useInfiniteQuery.cjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/useInfiniteQuery.ts"],"sourcesContent":["'use client'\nimport { InfiniteQueryObserver } from '@tanstack/query-core'\nimport { useBaseQuery } from './useBaseQuery'\nimport type {\n DefaultError,\n InfiniteData,\n QueryClient,\n QueryKey,\n QueryObserver,\n} from '@tanstack/query-core'\nimport type {\n DefinedUseInfiniteQueryResult,\n UseInfiniteQueryOptions,\n UseInfiniteQueryResult,\n} from './types'\nimport type {\n DefinedInitialDataInfiniteOptions,\n UndefinedInitialDataInfiniteOptions,\n} from './infiniteQueryOptions'\n\nexport function useInfiniteQuery<\n TQueryFnData,\n TError = DefaultError,\n TData = InfiniteData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n>(\n options: DefinedInitialDataInfiniteOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n queryClient?: QueryClient,\n): DefinedUseInfiniteQueryResult\n\nexport function useInfiniteQuery<\n TQueryFnData,\n TError = DefaultError,\n TData = InfiniteData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n>(\n options: UndefinedInitialDataInfiniteOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n queryClient?: QueryClient,\n): UseInfiniteQueryResult\n\nexport function useInfiniteQuery<\n TQueryFnData,\n TError = DefaultError,\n TData = InfiniteData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n>(\n options: UseInfiniteQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n queryClient?: QueryClient,\n): UseInfiniteQueryResult\n\nexport function useInfiniteQuery(\n options: UseInfiniteQueryOptions,\n queryClient?: QueryClient,\n) {\n return useBaseQuery(\n options,\n InfiniteQueryObserver as typeof QueryObserver,\n queryClient,\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,wBAAsC;AACtC,0BAA6B;AAqEtB,SAAS,iBACd,SACA,aACA;AACA,aAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/useInfiniteQuery.d.cts b/node_modules/@tanstack/react-query/build/modern/useInfiniteQuery.d.cts deleted file mode 100644 index 8401170..0000000 --- a/node_modules/@tanstack/react-query/build/modern/useInfiniteQuery.d.cts +++ /dev/null @@ -1,9 +0,0 @@ -import { DefaultError, InfiniteData, QueryKey, QueryClient } from '@tanstack/query-core'; -import { DefinedUseInfiniteQueryResult, UseInfiniteQueryResult, UseInfiniteQueryOptions } from './types.cjs'; -import { DefinedInitialDataInfiniteOptions, UndefinedInitialDataInfiniteOptions } from './infiniteQueryOptions.cjs'; - -declare function useInfiniteQuery, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown>(options: DefinedInitialDataInfiniteOptions, queryClient?: QueryClient): DefinedUseInfiniteQueryResult; -declare function useInfiniteQuery, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown>(options: UndefinedInitialDataInfiniteOptions, queryClient?: QueryClient): UseInfiniteQueryResult; -declare function useInfiniteQuery, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown>(options: UseInfiniteQueryOptions, queryClient?: QueryClient): UseInfiniteQueryResult; - -export { useInfiniteQuery }; diff --git a/node_modules/@tanstack/react-query/build/modern/useInfiniteQuery.d.ts b/node_modules/@tanstack/react-query/build/modern/useInfiniteQuery.d.ts deleted file mode 100644 index 47bb383..0000000 --- a/node_modules/@tanstack/react-query/build/modern/useInfiniteQuery.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { DefaultError, InfiniteData, QueryKey, QueryClient } from '@tanstack/query-core'; -import { DefinedUseInfiniteQueryResult, UseInfiniteQueryResult, UseInfiniteQueryOptions } from './types.js'; -import { DefinedInitialDataInfiniteOptions, UndefinedInitialDataInfiniteOptions } from './infiniteQueryOptions.js'; - -declare function useInfiniteQuery, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown>(options: DefinedInitialDataInfiniteOptions, queryClient?: QueryClient): DefinedUseInfiniteQueryResult; -declare function useInfiniteQuery, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown>(options: UndefinedInitialDataInfiniteOptions, queryClient?: QueryClient): UseInfiniteQueryResult; -declare function useInfiniteQuery, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown>(options: UseInfiniteQueryOptions, queryClient?: QueryClient): UseInfiniteQueryResult; - -export { useInfiniteQuery }; diff --git a/node_modules/@tanstack/react-query/build/modern/useInfiniteQuery.js b/node_modules/@tanstack/react-query/build/modern/useInfiniteQuery.js deleted file mode 100644 index 2e32e08..0000000 --- a/node_modules/@tanstack/react-query/build/modern/useInfiniteQuery.js +++ /dev/null @@ -1,16 +0,0 @@ -"use client"; - -// src/useInfiniteQuery.ts -import { InfiniteQueryObserver } from "@tanstack/query-core"; -import { useBaseQuery } from "./useBaseQuery.js"; -function useInfiniteQuery(options, queryClient) { - return useBaseQuery( - options, - InfiniteQueryObserver, - queryClient - ); -} -export { - useInfiniteQuery -}; -//# sourceMappingURL=useInfiniteQuery.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/useInfiniteQuery.js.map b/node_modules/@tanstack/react-query/build/modern/useInfiniteQuery.js.map deleted file mode 100644 index 4b2fbe4..0000000 --- a/node_modules/@tanstack/react-query/build/modern/useInfiniteQuery.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/useInfiniteQuery.ts"],"sourcesContent":["'use client'\nimport { InfiniteQueryObserver } from '@tanstack/query-core'\nimport { useBaseQuery } from './useBaseQuery'\nimport type {\n DefaultError,\n InfiniteData,\n QueryClient,\n QueryKey,\n QueryObserver,\n} from '@tanstack/query-core'\nimport type {\n DefinedUseInfiniteQueryResult,\n UseInfiniteQueryOptions,\n UseInfiniteQueryResult,\n} from './types'\nimport type {\n DefinedInitialDataInfiniteOptions,\n UndefinedInitialDataInfiniteOptions,\n} from './infiniteQueryOptions'\n\nexport function useInfiniteQuery<\n TQueryFnData,\n TError = DefaultError,\n TData = InfiniteData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n>(\n options: DefinedInitialDataInfiniteOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n queryClient?: QueryClient,\n): DefinedUseInfiniteQueryResult\n\nexport function useInfiniteQuery<\n TQueryFnData,\n TError = DefaultError,\n TData = InfiniteData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n>(\n options: UndefinedInitialDataInfiniteOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n queryClient?: QueryClient,\n): UseInfiniteQueryResult\n\nexport function useInfiniteQuery<\n TQueryFnData,\n TError = DefaultError,\n TData = InfiniteData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n>(\n options: UseInfiniteQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n queryClient?: QueryClient,\n): UseInfiniteQueryResult\n\nexport function useInfiniteQuery(\n options: UseInfiniteQueryOptions,\n queryClient?: QueryClient,\n) {\n return useBaseQuery(\n options,\n InfiniteQueryObserver as typeof QueryObserver,\n queryClient,\n )\n}\n"],"mappings":";;;AACA,SAAS,6BAA6B;AACtC,SAAS,oBAAoB;AAqEtB,SAAS,iBACd,SACA,aACA;AACA,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/useIsFetching.cjs b/node_modules/@tanstack/react-query/build/modern/useIsFetching.cjs deleted file mode 100644 index 28660e7..0000000 --- a/node_modules/@tanstack/react-query/build/modern/useIsFetching.cjs +++ /dev/null @@ -1,56 +0,0 @@ -"use strict"; -"use client"; -var __create = Object.create; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __getProtoOf = Object.getPrototypeOf; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( - // If the importer is in node compatibility mode or this is not an ESM - // file that has been converted to a CommonJS file using a Babel- - // compatible transform (i.e. "__esModule" has not been set), then set - // "default" to the CommonJS "module.exports" for node compatibility. - isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, - mod -)); -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// src/useIsFetching.ts -var useIsFetching_exports = {}; -__export(useIsFetching_exports, { - useIsFetching: () => useIsFetching -}); -module.exports = __toCommonJS(useIsFetching_exports); -var React = __toESM(require("react"), 1); -var import_query_core = require("@tanstack/query-core"); -var import_QueryClientProvider = require("./QueryClientProvider.cjs"); -function useIsFetching(filters, queryClient) { - const client = (0, import_QueryClientProvider.useQueryClient)(queryClient); - const queryCache = client.getQueryCache(); - return React.useSyncExternalStore( - React.useCallback( - (onStoreChange) => queryCache.subscribe(import_query_core.notifyManager.batchCalls(onStoreChange)), - [queryCache] - ), - () => client.isFetching(filters), - () => client.isFetching(filters) - ); -} -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - useIsFetching -}); -//# sourceMappingURL=useIsFetching.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/useIsFetching.cjs.map b/node_modules/@tanstack/react-query/build/modern/useIsFetching.cjs.map deleted file mode 100644 index 5a58e86..0000000 --- a/node_modules/@tanstack/react-query/build/modern/useIsFetching.cjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/useIsFetching.ts"],"sourcesContent":["'use client'\nimport * as React from 'react'\nimport { notifyManager } from '@tanstack/query-core'\n\nimport { useQueryClient } from './QueryClientProvider'\nimport type { QueryClient, QueryFilters } from '@tanstack/query-core'\n\nexport function useIsFetching(\n filters?: QueryFilters,\n queryClient?: QueryClient,\n): number {\n const client = useQueryClient(queryClient)\n const queryCache = client.getQueryCache()\n\n return React.useSyncExternalStore(\n React.useCallback(\n (onStoreChange) =>\n queryCache.subscribe(notifyManager.batchCalls(onStoreChange)),\n [queryCache],\n ),\n () => client.isFetching(filters),\n () => client.isFetching(filters),\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,YAAuB;AACvB,wBAA8B;AAE9B,iCAA+B;AAGxB,SAAS,cACd,SACA,aACQ;AACR,QAAM,aAAS,2CAAe,WAAW;AACzC,QAAM,aAAa,OAAO,cAAc;AAExC,SAAa;AAAA,IACL;AAAA,MACJ,CAAC,kBACC,WAAW,UAAU,gCAAc,WAAW,aAAa,CAAC;AAAA,MAC9D,CAAC,UAAU;AAAA,IACb;AAAA,IACA,MAAM,OAAO,WAAW,OAAO;AAAA,IAC/B,MAAM,OAAO,WAAW,OAAO;AAAA,EACjC;AACF;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/useIsFetching.d.cts b/node_modules/@tanstack/react-query/build/modern/useIsFetching.d.cts deleted file mode 100644 index 832d33f..0000000 --- a/node_modules/@tanstack/react-query/build/modern/useIsFetching.d.cts +++ /dev/null @@ -1,5 +0,0 @@ -import { QueryFilters, QueryClient } from '@tanstack/query-core'; - -declare function useIsFetching(filters?: QueryFilters, queryClient?: QueryClient): number; - -export { useIsFetching }; diff --git a/node_modules/@tanstack/react-query/build/modern/useIsFetching.d.ts b/node_modules/@tanstack/react-query/build/modern/useIsFetching.d.ts deleted file mode 100644 index 832d33f..0000000 --- a/node_modules/@tanstack/react-query/build/modern/useIsFetching.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { QueryFilters, QueryClient } from '@tanstack/query-core'; - -declare function useIsFetching(filters?: QueryFilters, queryClient?: QueryClient): number; - -export { useIsFetching }; diff --git a/node_modules/@tanstack/react-query/build/modern/useIsFetching.js b/node_modules/@tanstack/react-query/build/modern/useIsFetching.js deleted file mode 100644 index acfc67a..0000000 --- a/node_modules/@tanstack/react-query/build/modern/useIsFetching.js +++ /dev/null @@ -1,22 +0,0 @@ -"use client"; - -// src/useIsFetching.ts -import * as React from "react"; -import { notifyManager } from "@tanstack/query-core"; -import { useQueryClient } from "./QueryClientProvider.js"; -function useIsFetching(filters, queryClient) { - const client = useQueryClient(queryClient); - const queryCache = client.getQueryCache(); - return React.useSyncExternalStore( - React.useCallback( - (onStoreChange) => queryCache.subscribe(notifyManager.batchCalls(onStoreChange)), - [queryCache] - ), - () => client.isFetching(filters), - () => client.isFetching(filters) - ); -} -export { - useIsFetching -}; -//# sourceMappingURL=useIsFetching.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/useIsFetching.js.map b/node_modules/@tanstack/react-query/build/modern/useIsFetching.js.map deleted file mode 100644 index 9921ab6..0000000 --- a/node_modules/@tanstack/react-query/build/modern/useIsFetching.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/useIsFetching.ts"],"sourcesContent":["'use client'\nimport * as React from 'react'\nimport { notifyManager } from '@tanstack/query-core'\n\nimport { useQueryClient } from './QueryClientProvider'\nimport type { QueryClient, QueryFilters } from '@tanstack/query-core'\n\nexport function useIsFetching(\n filters?: QueryFilters,\n queryClient?: QueryClient,\n): number {\n const client = useQueryClient(queryClient)\n const queryCache = client.getQueryCache()\n\n return React.useSyncExternalStore(\n React.useCallback(\n (onStoreChange) =>\n queryCache.subscribe(notifyManager.batchCalls(onStoreChange)),\n [queryCache],\n ),\n () => client.isFetching(filters),\n () => client.isFetching(filters),\n )\n}\n"],"mappings":";;;AACA,YAAY,WAAW;AACvB,SAAS,qBAAqB;AAE9B,SAAS,sBAAsB;AAGxB,SAAS,cACd,SACA,aACQ;AACR,QAAM,SAAS,eAAe,WAAW;AACzC,QAAM,aAAa,OAAO,cAAc;AAExC,SAAa;AAAA,IACL;AAAA,MACJ,CAAC,kBACC,WAAW,UAAU,cAAc,WAAW,aAAa,CAAC;AAAA,MAC9D,CAAC,UAAU;AAAA,IACb;AAAA,IACA,MAAM,OAAO,WAAW,OAAO;AAAA,IAC/B,MAAM,OAAO,WAAW,OAAO;AAAA,EACjC;AACF;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/useMutation.cjs b/node_modules/@tanstack/react-query/build/modern/useMutation.cjs deleted file mode 100644 index 2ae4221..0000000 --- a/node_modules/@tanstack/react-query/build/modern/useMutation.cjs +++ /dev/null @@ -1,74 +0,0 @@ -"use strict"; -"use client"; -var __create = Object.create; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __getProtoOf = Object.getPrototypeOf; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( - // If the importer is in node compatibility mode or this is not an ESM - // file that has been converted to a CommonJS file using a Babel- - // compatible transform (i.e. "__esModule" has not been set), then set - // "default" to the CommonJS "module.exports" for node compatibility. - isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, - mod -)); -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// src/useMutation.ts -var useMutation_exports = {}; -__export(useMutation_exports, { - useMutation: () => useMutation -}); -module.exports = __toCommonJS(useMutation_exports); -var React = __toESM(require("react"), 1); -var import_query_core = require("@tanstack/query-core"); -var import_QueryClientProvider = require("./QueryClientProvider.cjs"); -function useMutation(options, queryClient) { - const client = (0, import_QueryClientProvider.useQueryClient)(queryClient); - const [observer] = React.useState( - () => new import_query_core.MutationObserver( - client, - options - ) - ); - React.useEffect(() => { - observer.setOptions(options); - }, [observer, options]); - const result = React.useSyncExternalStore( - React.useCallback( - (onStoreChange) => observer.subscribe(import_query_core.notifyManager.batchCalls(onStoreChange)), - [observer] - ), - () => observer.getCurrentResult(), - () => observer.getCurrentResult() - ); - const mutate = React.useCallback( - (variables, mutateOptions) => { - observer.mutate(variables, mutateOptions).catch(import_query_core.noop); - }, - [observer] - ); - if (result.error && (0, import_query_core.shouldThrowError)(observer.options.throwOnError, [result.error])) { - throw result.error; - } - return { ...result, mutate, mutateAsync: result.mutate }; -} -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - useMutation -}); -//# sourceMappingURL=useMutation.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/useMutation.cjs.map b/node_modules/@tanstack/react-query/build/modern/useMutation.cjs.map deleted file mode 100644 index 23c4d2e..0000000 --- a/node_modules/@tanstack/react-query/build/modern/useMutation.cjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/useMutation.ts"],"sourcesContent":["'use client'\nimport * as React from 'react'\nimport {\n MutationObserver,\n noop,\n notifyManager,\n shouldThrowError,\n} from '@tanstack/query-core'\nimport { useQueryClient } from './QueryClientProvider'\nimport type {\n UseMutateFunction,\n UseMutationOptions,\n UseMutationResult,\n} from './types'\nimport type { DefaultError, QueryClient } from '@tanstack/query-core'\n\n// HOOK\n\nexport function useMutation<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n>(\n options: UseMutationOptions,\n queryClient?: QueryClient,\n): UseMutationResult {\n const client = useQueryClient(queryClient)\n\n const [observer] = React.useState(\n () =>\n new MutationObserver(\n client,\n options,\n ),\n )\n\n React.useEffect(() => {\n observer.setOptions(options)\n }, [observer, options])\n\n const result = React.useSyncExternalStore(\n React.useCallback(\n (onStoreChange) =>\n observer.subscribe(notifyManager.batchCalls(onStoreChange)),\n [observer],\n ),\n () => observer.getCurrentResult(),\n () => observer.getCurrentResult(),\n )\n\n const mutate = React.useCallback<\n UseMutateFunction\n >(\n (variables, mutateOptions) => {\n observer.mutate(variables, mutateOptions).catch(noop)\n },\n [observer],\n )\n\n if (\n result.error &&\n shouldThrowError(observer.options.throwOnError, [result.error])\n ) {\n throw result.error\n }\n\n return { ...result, mutate, mutateAsync: result.mutate }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,YAAuB;AACvB,wBAKO;AACP,iCAA+B;AAUxB,SAAS,YAMd,SACA,aAC+D;AAC/D,QAAM,aAAS,2CAAe,WAAW;AAEzC,QAAM,CAAC,QAAQ,IAAU;AAAA,IACvB,MACE,IAAI;AAAA,MACF;AAAA,MACA;AAAA,IACF;AAAA,EACJ;AAEA,EAAM,gBAAU,MAAM;AACpB,aAAS,WAAW,OAAO;AAAA,EAC7B,GAAG,CAAC,UAAU,OAAO,CAAC;AAEtB,QAAM,SAAe;AAAA,IACb;AAAA,MACJ,CAAC,kBACC,SAAS,UAAU,gCAAc,WAAW,aAAa,CAAC;AAAA,MAC5D,CAAC,QAAQ;AAAA,IACX;AAAA,IACA,MAAM,SAAS,iBAAiB;AAAA,IAChC,MAAM,SAAS,iBAAiB;AAAA,EAClC;AAEA,QAAM,SAAe;AAAA,IAGnB,CAAC,WAAW,kBAAkB;AAC5B,eAAS,OAAO,WAAW,aAAa,EAAE,MAAM,sBAAI;AAAA,IACtD;AAAA,IACA,CAAC,QAAQ;AAAA,EACX;AAEA,MACE,OAAO,aACP,oCAAiB,SAAS,QAAQ,cAAc,CAAC,OAAO,KAAK,CAAC,GAC9D;AACA,UAAM,OAAO;AAAA,EACf;AAEA,SAAO,EAAE,GAAG,QAAQ,QAAQ,aAAa,OAAO,OAAO;AACzD;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/useMutation.d.cts b/node_modules/@tanstack/react-query/build/modern/useMutation.d.cts deleted file mode 100644 index 09102dd..0000000 --- a/node_modules/@tanstack/react-query/build/modern/useMutation.d.cts +++ /dev/null @@ -1,6 +0,0 @@ -import { UseMutationOptions, UseMutationResult } from './types.cjs'; -import { DefaultError, QueryClient } from '@tanstack/query-core'; - -declare function useMutation(options: UseMutationOptions, queryClient?: QueryClient): UseMutationResult; - -export { useMutation }; diff --git a/node_modules/@tanstack/react-query/build/modern/useMutation.d.ts b/node_modules/@tanstack/react-query/build/modern/useMutation.d.ts deleted file mode 100644 index 0f29460..0000000 --- a/node_modules/@tanstack/react-query/build/modern/useMutation.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { UseMutationOptions, UseMutationResult } from './types.js'; -import { DefaultError, QueryClient } from '@tanstack/query-core'; - -declare function useMutation(options: UseMutationOptions, queryClient?: QueryClient): UseMutationResult; - -export { useMutation }; diff --git a/node_modules/@tanstack/react-query/build/modern/useMutation.js b/node_modules/@tanstack/react-query/build/modern/useMutation.js deleted file mode 100644 index 8e089c4..0000000 --- a/node_modules/@tanstack/react-query/build/modern/useMutation.js +++ /dev/null @@ -1,45 +0,0 @@ -"use client"; - -// src/useMutation.ts -import * as React from "react"; -import { - MutationObserver, - noop, - notifyManager, - shouldThrowError -} from "@tanstack/query-core"; -import { useQueryClient } from "./QueryClientProvider.js"; -function useMutation(options, queryClient) { - const client = useQueryClient(queryClient); - const [observer] = React.useState( - () => new MutationObserver( - client, - options - ) - ); - React.useEffect(() => { - observer.setOptions(options); - }, [observer, options]); - const result = React.useSyncExternalStore( - React.useCallback( - (onStoreChange) => observer.subscribe(notifyManager.batchCalls(onStoreChange)), - [observer] - ), - () => observer.getCurrentResult(), - () => observer.getCurrentResult() - ); - const mutate = React.useCallback( - (variables, mutateOptions) => { - observer.mutate(variables, mutateOptions).catch(noop); - }, - [observer] - ); - if (result.error && shouldThrowError(observer.options.throwOnError, [result.error])) { - throw result.error; - } - return { ...result, mutate, mutateAsync: result.mutate }; -} -export { - useMutation -}; -//# sourceMappingURL=useMutation.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/useMutation.js.map b/node_modules/@tanstack/react-query/build/modern/useMutation.js.map deleted file mode 100644 index 0df164b..0000000 --- a/node_modules/@tanstack/react-query/build/modern/useMutation.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/useMutation.ts"],"sourcesContent":["'use client'\nimport * as React from 'react'\nimport {\n MutationObserver,\n noop,\n notifyManager,\n shouldThrowError,\n} from '@tanstack/query-core'\nimport { useQueryClient } from './QueryClientProvider'\nimport type {\n UseMutateFunction,\n UseMutationOptions,\n UseMutationResult,\n} from './types'\nimport type { DefaultError, QueryClient } from '@tanstack/query-core'\n\n// HOOK\n\nexport function useMutation<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n>(\n options: UseMutationOptions,\n queryClient?: QueryClient,\n): UseMutationResult {\n const client = useQueryClient(queryClient)\n\n const [observer] = React.useState(\n () =>\n new MutationObserver(\n client,\n options,\n ),\n )\n\n React.useEffect(() => {\n observer.setOptions(options)\n }, [observer, options])\n\n const result = React.useSyncExternalStore(\n React.useCallback(\n (onStoreChange) =>\n observer.subscribe(notifyManager.batchCalls(onStoreChange)),\n [observer],\n ),\n () => observer.getCurrentResult(),\n () => observer.getCurrentResult(),\n )\n\n const mutate = React.useCallback<\n UseMutateFunction\n >(\n (variables, mutateOptions) => {\n observer.mutate(variables, mutateOptions).catch(noop)\n },\n [observer],\n )\n\n if (\n result.error &&\n shouldThrowError(observer.options.throwOnError, [result.error])\n ) {\n throw result.error\n }\n\n return { ...result, mutate, mutateAsync: result.mutate }\n}\n"],"mappings":";;;AACA,YAAY,WAAW;AACvB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,sBAAsB;AAUxB,SAAS,YAMd,SACA,aAC+D;AAC/D,QAAM,SAAS,eAAe,WAAW;AAEzC,QAAM,CAAC,QAAQ,IAAU;AAAA,IACvB,MACE,IAAI;AAAA,MACF;AAAA,MACA;AAAA,IACF;AAAA,EACJ;AAEA,EAAM,gBAAU,MAAM;AACpB,aAAS,WAAW,OAAO;AAAA,EAC7B,GAAG,CAAC,UAAU,OAAO,CAAC;AAEtB,QAAM,SAAe;AAAA,IACb;AAAA,MACJ,CAAC,kBACC,SAAS,UAAU,cAAc,WAAW,aAAa,CAAC;AAAA,MAC5D,CAAC,QAAQ;AAAA,IACX;AAAA,IACA,MAAM,SAAS,iBAAiB;AAAA,IAChC,MAAM,SAAS,iBAAiB;AAAA,EAClC;AAEA,QAAM,SAAe;AAAA,IAGnB,CAAC,WAAW,kBAAkB;AAC5B,eAAS,OAAO,WAAW,aAAa,EAAE,MAAM,IAAI;AAAA,IACtD;AAAA,IACA,CAAC,QAAQ;AAAA,EACX;AAEA,MACE,OAAO,SACP,iBAAiB,SAAS,QAAQ,cAAc,CAAC,OAAO,KAAK,CAAC,GAC9D;AACA,UAAM,OAAO;AAAA,EACf;AAEA,SAAO,EAAE,GAAG,QAAQ,QAAQ,aAAa,OAAO,OAAO;AACzD;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/useMutationState.cjs b/node_modules/@tanstack/react-query/build/modern/useMutationState.cjs deleted file mode 100644 index b256e68..0000000 --- a/node_modules/@tanstack/react-query/build/modern/useMutationState.cjs +++ /dev/null @@ -1,86 +0,0 @@ -"use strict"; -"use client"; -var __create = Object.create; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __getProtoOf = Object.getPrototypeOf; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( - // If the importer is in node compatibility mode or this is not an ESM - // file that has been converted to a CommonJS file using a Babel- - // compatible transform (i.e. "__esModule" has not been set), then set - // "default" to the CommonJS "module.exports" for node compatibility. - isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, - mod -)); -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// src/useMutationState.ts -var useMutationState_exports = {}; -__export(useMutationState_exports, { - useIsMutating: () => useIsMutating, - useMutationState: () => useMutationState -}); -module.exports = __toCommonJS(useMutationState_exports); -var React = __toESM(require("react"), 1); -var import_query_core = require("@tanstack/query-core"); -var import_QueryClientProvider = require("./QueryClientProvider.cjs"); -function useIsMutating(filters, queryClient) { - const client = (0, import_QueryClientProvider.useQueryClient)(queryClient); - return useMutationState( - { filters: { ...filters, status: "pending" } }, - client - ).length; -} -function getResult(mutationCache, options) { - return mutationCache.findAll(options.filters).map( - (mutation) => options.select ? options.select(mutation) : mutation.state - ); -} -function useMutationState(options = {}, queryClient) { - const mutationCache = (0, import_QueryClientProvider.useQueryClient)(queryClient).getMutationCache(); - const optionsRef = React.useRef(options); - const result = React.useRef(null); - if (result.current === null) { - result.current = getResult(mutationCache, options); - } - React.useEffect(() => { - optionsRef.current = options; - }); - return React.useSyncExternalStore( - React.useCallback( - (onStoreChange) => mutationCache.subscribe(() => { - const nextResult = (0, import_query_core.replaceEqualDeep)( - result.current, - getResult(mutationCache, optionsRef.current) - ); - if (result.current !== nextResult) { - result.current = nextResult; - import_query_core.notifyManager.schedule(onStoreChange); - } - }), - [mutationCache] - ), - () => result.current, - () => result.current - ); -} -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - useIsMutating, - useMutationState -}); -//# sourceMappingURL=useMutationState.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/useMutationState.cjs.map b/node_modules/@tanstack/react-query/build/modern/useMutationState.cjs.map deleted file mode 100644 index b43a480..0000000 --- a/node_modules/@tanstack/react-query/build/modern/useMutationState.cjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/useMutationState.ts"],"sourcesContent":["'use client'\nimport * as React from 'react'\n\nimport { notifyManager, replaceEqualDeep } from '@tanstack/query-core'\nimport { useQueryClient } from './QueryClientProvider'\nimport type {\n Mutation,\n MutationCache,\n MutationFilters,\n MutationState,\n QueryClient,\n} from '@tanstack/query-core'\n\nexport function useIsMutating(\n filters?: MutationFilters,\n queryClient?: QueryClient,\n): number {\n const client = useQueryClient(queryClient)\n return useMutationState(\n { filters: { ...filters, status: 'pending' } },\n client,\n ).length\n}\n\ntype MutationStateOptions = {\n filters?: MutationFilters\n select?: (mutation: Mutation) => TResult\n}\n\nfunction getResult(\n mutationCache: MutationCache,\n options: MutationStateOptions,\n): Array {\n return mutationCache\n .findAll(options.filters)\n .map(\n (mutation): TResult =>\n (options.select ? options.select(mutation) : mutation.state) as TResult,\n )\n}\n\nexport function useMutationState(\n options: MutationStateOptions = {},\n queryClient?: QueryClient,\n): Array {\n const mutationCache = useQueryClient(queryClient).getMutationCache()\n const optionsRef = React.useRef(options)\n const result = React.useRef>(null)\n if (result.current === null) {\n result.current = getResult(mutationCache, options)\n }\n\n React.useEffect(() => {\n optionsRef.current = options\n })\n\n return React.useSyncExternalStore(\n React.useCallback(\n (onStoreChange) =>\n mutationCache.subscribe(() => {\n const nextResult = replaceEqualDeep(\n result.current,\n getResult(mutationCache, optionsRef.current),\n )\n if (result.current !== nextResult) {\n result.current = nextResult\n notifyManager.schedule(onStoreChange)\n }\n }),\n [mutationCache],\n ),\n () => result.current,\n () => result.current,\n )!\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,YAAuB;AAEvB,wBAAgD;AAChD,iCAA+B;AASxB,SAAS,cACd,SACA,aACQ;AACR,QAAM,aAAS,2CAAe,WAAW;AACzC,SAAO;AAAA,IACL,EAAE,SAAS,EAAE,GAAG,SAAS,QAAQ,UAAU,EAAE;AAAA,IAC7C;AAAA,EACF,EAAE;AACJ;AAOA,SAAS,UACP,eACA,SACgB;AAChB,SAAO,cACJ,QAAQ,QAAQ,OAAO,EACvB;AAAA,IACC,CAAC,aACE,QAAQ,SAAS,QAAQ,OAAO,QAAQ,IAAI,SAAS;AAAA,EAC1D;AACJ;AAEO,SAAS,iBACd,UAAyC,CAAC,GAC1C,aACgB;AAChB,QAAM,oBAAgB,2CAAe,WAAW,EAAE,iBAAiB;AACnE,QAAM,aAAmB,aAAO,OAAO;AACvC,QAAM,SAAe,aAAuB,IAAI;AAChD,MAAI,OAAO,YAAY,MAAM;AAC3B,WAAO,UAAU,UAAU,eAAe,OAAO;AAAA,EACnD;AAEA,EAAM,gBAAU,MAAM;AACpB,eAAW,UAAU;AAAA,EACvB,CAAC;AAED,SAAa;AAAA,IACL;AAAA,MACJ,CAAC,kBACC,cAAc,UAAU,MAAM;AAC5B,cAAM,iBAAa;AAAA,UACjB,OAAO;AAAA,UACP,UAAU,eAAe,WAAW,OAAO;AAAA,QAC7C;AACA,YAAI,OAAO,YAAY,YAAY;AACjC,iBAAO,UAAU;AACjB,0CAAc,SAAS,aAAa;AAAA,QACtC;AAAA,MACF,CAAC;AAAA,MACH,CAAC,aAAa;AAAA,IAChB;AAAA,IACA,MAAM,OAAO;AAAA,IACb,MAAM,OAAO;AAAA,EACf;AACF;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/useMutationState.d.cts b/node_modules/@tanstack/react-query/build/modern/useMutationState.d.cts deleted file mode 100644 index 6f35037..0000000 --- a/node_modules/@tanstack/react-query/build/modern/useMutationState.d.cts +++ /dev/null @@ -1,10 +0,0 @@ -import { MutationFilters, QueryClient, MutationState, Mutation } from '@tanstack/query-core'; - -declare function useIsMutating(filters?: MutationFilters, queryClient?: QueryClient): number; -type MutationStateOptions = { - filters?: MutationFilters; - select?: (mutation: Mutation) => TResult; -}; -declare function useMutationState(options?: MutationStateOptions, queryClient?: QueryClient): Array; - -export { useIsMutating, useMutationState }; diff --git a/node_modules/@tanstack/react-query/build/modern/useMutationState.d.ts b/node_modules/@tanstack/react-query/build/modern/useMutationState.d.ts deleted file mode 100644 index 6f35037..0000000 --- a/node_modules/@tanstack/react-query/build/modern/useMutationState.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { MutationFilters, QueryClient, MutationState, Mutation } from '@tanstack/query-core'; - -declare function useIsMutating(filters?: MutationFilters, queryClient?: QueryClient): number; -type MutationStateOptions = { - filters?: MutationFilters; - select?: (mutation: Mutation) => TResult; -}; -declare function useMutationState(options?: MutationStateOptions, queryClient?: QueryClient): Array; - -export { useIsMutating, useMutationState }; diff --git a/node_modules/@tanstack/react-query/build/modern/useMutationState.js b/node_modules/@tanstack/react-query/build/modern/useMutationState.js deleted file mode 100644 index aa22350..0000000 --- a/node_modules/@tanstack/react-query/build/modern/useMutationState.js +++ /dev/null @@ -1,51 +0,0 @@ -"use client"; - -// src/useMutationState.ts -import * as React from "react"; -import { notifyManager, replaceEqualDeep } from "@tanstack/query-core"; -import { useQueryClient } from "./QueryClientProvider.js"; -function useIsMutating(filters, queryClient) { - const client = useQueryClient(queryClient); - return useMutationState( - { filters: { ...filters, status: "pending" } }, - client - ).length; -} -function getResult(mutationCache, options) { - return mutationCache.findAll(options.filters).map( - (mutation) => options.select ? options.select(mutation) : mutation.state - ); -} -function useMutationState(options = {}, queryClient) { - const mutationCache = useQueryClient(queryClient).getMutationCache(); - const optionsRef = React.useRef(options); - const result = React.useRef(null); - if (result.current === null) { - result.current = getResult(mutationCache, options); - } - React.useEffect(() => { - optionsRef.current = options; - }); - return React.useSyncExternalStore( - React.useCallback( - (onStoreChange) => mutationCache.subscribe(() => { - const nextResult = replaceEqualDeep( - result.current, - getResult(mutationCache, optionsRef.current) - ); - if (result.current !== nextResult) { - result.current = nextResult; - notifyManager.schedule(onStoreChange); - } - }), - [mutationCache] - ), - () => result.current, - () => result.current - ); -} -export { - useIsMutating, - useMutationState -}; -//# sourceMappingURL=useMutationState.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/useMutationState.js.map b/node_modules/@tanstack/react-query/build/modern/useMutationState.js.map deleted file mode 100644 index 399a5a1..0000000 --- a/node_modules/@tanstack/react-query/build/modern/useMutationState.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/useMutationState.ts"],"sourcesContent":["'use client'\nimport * as React from 'react'\n\nimport { notifyManager, replaceEqualDeep } from '@tanstack/query-core'\nimport { useQueryClient } from './QueryClientProvider'\nimport type {\n Mutation,\n MutationCache,\n MutationFilters,\n MutationState,\n QueryClient,\n} from '@tanstack/query-core'\n\nexport function useIsMutating(\n filters?: MutationFilters,\n queryClient?: QueryClient,\n): number {\n const client = useQueryClient(queryClient)\n return useMutationState(\n { filters: { ...filters, status: 'pending' } },\n client,\n ).length\n}\n\ntype MutationStateOptions = {\n filters?: MutationFilters\n select?: (mutation: Mutation) => TResult\n}\n\nfunction getResult(\n mutationCache: MutationCache,\n options: MutationStateOptions,\n): Array {\n return mutationCache\n .findAll(options.filters)\n .map(\n (mutation): TResult =>\n (options.select ? options.select(mutation) : mutation.state) as TResult,\n )\n}\n\nexport function useMutationState(\n options: MutationStateOptions = {},\n queryClient?: QueryClient,\n): Array {\n const mutationCache = useQueryClient(queryClient).getMutationCache()\n const optionsRef = React.useRef(options)\n const result = React.useRef>(null)\n if (result.current === null) {\n result.current = getResult(mutationCache, options)\n }\n\n React.useEffect(() => {\n optionsRef.current = options\n })\n\n return React.useSyncExternalStore(\n React.useCallback(\n (onStoreChange) =>\n mutationCache.subscribe(() => {\n const nextResult = replaceEqualDeep(\n result.current,\n getResult(mutationCache, optionsRef.current),\n )\n if (result.current !== nextResult) {\n result.current = nextResult\n notifyManager.schedule(onStoreChange)\n }\n }),\n [mutationCache],\n ),\n () => result.current,\n () => result.current,\n )!\n}\n"],"mappings":";;;AACA,YAAY,WAAW;AAEvB,SAAS,eAAe,wBAAwB;AAChD,SAAS,sBAAsB;AASxB,SAAS,cACd,SACA,aACQ;AACR,QAAM,SAAS,eAAe,WAAW;AACzC,SAAO;AAAA,IACL,EAAE,SAAS,EAAE,GAAG,SAAS,QAAQ,UAAU,EAAE;AAAA,IAC7C;AAAA,EACF,EAAE;AACJ;AAOA,SAAS,UACP,eACA,SACgB;AAChB,SAAO,cACJ,QAAQ,QAAQ,OAAO,EACvB;AAAA,IACC,CAAC,aACE,QAAQ,SAAS,QAAQ,OAAO,QAAQ,IAAI,SAAS;AAAA,EAC1D;AACJ;AAEO,SAAS,iBACd,UAAyC,CAAC,GAC1C,aACgB;AAChB,QAAM,gBAAgB,eAAe,WAAW,EAAE,iBAAiB;AACnE,QAAM,aAAmB,aAAO,OAAO;AACvC,QAAM,SAAe,aAAuB,IAAI;AAChD,MAAI,OAAO,YAAY,MAAM;AAC3B,WAAO,UAAU,UAAU,eAAe,OAAO;AAAA,EACnD;AAEA,EAAM,gBAAU,MAAM;AACpB,eAAW,UAAU;AAAA,EACvB,CAAC;AAED,SAAa;AAAA,IACL;AAAA,MACJ,CAAC,kBACC,cAAc,UAAU,MAAM;AAC5B,cAAM,aAAa;AAAA,UACjB,OAAO;AAAA,UACP,UAAU,eAAe,WAAW,OAAO;AAAA,QAC7C;AACA,YAAI,OAAO,YAAY,YAAY;AACjC,iBAAO,UAAU;AACjB,wBAAc,SAAS,aAAa;AAAA,QACtC;AAAA,MACF,CAAC;AAAA,MACH,CAAC,aAAa;AAAA,IAChB;AAAA,IACA,MAAM,OAAO;AAAA,IACb,MAAM,OAAO;AAAA,EACf;AACF;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/usePrefetchInfiniteQuery.cjs b/node_modules/@tanstack/react-query/build/modern/usePrefetchInfiniteQuery.cjs deleted file mode 100644 index 9148196..0000000 --- a/node_modules/@tanstack/react-query/build/modern/usePrefetchInfiniteQuery.cjs +++ /dev/null @@ -1,37 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// src/usePrefetchInfiniteQuery.tsx -var usePrefetchInfiniteQuery_exports = {}; -__export(usePrefetchInfiniteQuery_exports, { - usePrefetchInfiniteQuery: () => usePrefetchInfiniteQuery -}); -module.exports = __toCommonJS(usePrefetchInfiniteQuery_exports); -var import_QueryClientProvider = require("./QueryClientProvider.cjs"); -function usePrefetchInfiniteQuery(options, queryClient) { - const client = (0, import_QueryClientProvider.useQueryClient)(queryClient); - if (!client.getQueryState(options.queryKey)) { - client.prefetchInfiniteQuery(options); - } -} -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - usePrefetchInfiniteQuery -}); -//# sourceMappingURL=usePrefetchInfiniteQuery.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/usePrefetchInfiniteQuery.cjs.map b/node_modules/@tanstack/react-query/build/modern/usePrefetchInfiniteQuery.cjs.map deleted file mode 100644 index e912e76..0000000 --- a/node_modules/@tanstack/react-query/build/modern/usePrefetchInfiniteQuery.cjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/usePrefetchInfiniteQuery.tsx"],"sourcesContent":["import { useQueryClient } from './QueryClientProvider'\nimport type {\n DefaultError,\n FetchInfiniteQueryOptions,\n QueryClient,\n QueryKey,\n} from '@tanstack/query-core'\n\nexport function usePrefetchInfiniteQuery<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n>(\n options: FetchInfiniteQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n queryClient?: QueryClient,\n) {\n const client = useQueryClient(queryClient)\n\n if (!client.getQueryState(options.queryKey)) {\n client.prefetchInfiniteQuery(options)\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,iCAA+B;AAQxB,SAAS,yBAOd,SAOA,aACA;AACA,QAAM,aAAS,2CAAe,WAAW;AAEzC,MAAI,CAAC,OAAO,cAAc,QAAQ,QAAQ,GAAG;AAC3C,WAAO,sBAAsB,OAAO;AAAA,EACtC;AACF;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/usePrefetchInfiniteQuery.d.cts b/node_modules/@tanstack/react-query/build/modern/usePrefetchInfiniteQuery.d.cts deleted file mode 100644 index aeba2f8..0000000 --- a/node_modules/@tanstack/react-query/build/modern/usePrefetchInfiniteQuery.d.cts +++ /dev/null @@ -1,5 +0,0 @@ -import { DefaultError, QueryKey, FetchInfiniteQueryOptions, QueryClient } from '@tanstack/query-core'; - -declare function usePrefetchInfiniteQuery(options: FetchInfiniteQueryOptions, queryClient?: QueryClient): void; - -export { usePrefetchInfiniteQuery }; diff --git a/node_modules/@tanstack/react-query/build/modern/usePrefetchInfiniteQuery.d.ts b/node_modules/@tanstack/react-query/build/modern/usePrefetchInfiniteQuery.d.ts deleted file mode 100644 index aeba2f8..0000000 --- a/node_modules/@tanstack/react-query/build/modern/usePrefetchInfiniteQuery.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { DefaultError, QueryKey, FetchInfiniteQueryOptions, QueryClient } from '@tanstack/query-core'; - -declare function usePrefetchInfiniteQuery(options: FetchInfiniteQueryOptions, queryClient?: QueryClient): void; - -export { usePrefetchInfiniteQuery }; diff --git a/node_modules/@tanstack/react-query/build/modern/usePrefetchInfiniteQuery.js b/node_modules/@tanstack/react-query/build/modern/usePrefetchInfiniteQuery.js deleted file mode 100644 index bce85f3..0000000 --- a/node_modules/@tanstack/react-query/build/modern/usePrefetchInfiniteQuery.js +++ /dev/null @@ -1,12 +0,0 @@ -// src/usePrefetchInfiniteQuery.tsx -import { useQueryClient } from "./QueryClientProvider.js"; -function usePrefetchInfiniteQuery(options, queryClient) { - const client = useQueryClient(queryClient); - if (!client.getQueryState(options.queryKey)) { - client.prefetchInfiniteQuery(options); - } -} -export { - usePrefetchInfiniteQuery -}; -//# sourceMappingURL=usePrefetchInfiniteQuery.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/usePrefetchInfiniteQuery.js.map b/node_modules/@tanstack/react-query/build/modern/usePrefetchInfiniteQuery.js.map deleted file mode 100644 index 20e3042..0000000 --- a/node_modules/@tanstack/react-query/build/modern/usePrefetchInfiniteQuery.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/usePrefetchInfiniteQuery.tsx"],"sourcesContent":["import { useQueryClient } from './QueryClientProvider'\nimport type {\n DefaultError,\n FetchInfiniteQueryOptions,\n QueryClient,\n QueryKey,\n} from '@tanstack/query-core'\n\nexport function usePrefetchInfiniteQuery<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n>(\n options: FetchInfiniteQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n queryClient?: QueryClient,\n) {\n const client = useQueryClient(queryClient)\n\n if (!client.getQueryState(options.queryKey)) {\n client.prefetchInfiniteQuery(options)\n }\n}\n"],"mappings":";AAAA,SAAS,sBAAsB;AAQxB,SAAS,yBAOd,SAOA,aACA;AACA,QAAM,SAAS,eAAe,WAAW;AAEzC,MAAI,CAAC,OAAO,cAAc,QAAQ,QAAQ,GAAG;AAC3C,WAAO,sBAAsB,OAAO;AAAA,EACtC;AACF;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/usePrefetchQuery.cjs b/node_modules/@tanstack/react-query/build/modern/usePrefetchQuery.cjs deleted file mode 100644 index a884e0f..0000000 --- a/node_modules/@tanstack/react-query/build/modern/usePrefetchQuery.cjs +++ /dev/null @@ -1,37 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// src/usePrefetchQuery.tsx -var usePrefetchQuery_exports = {}; -__export(usePrefetchQuery_exports, { - usePrefetchQuery: () => usePrefetchQuery -}); -module.exports = __toCommonJS(usePrefetchQuery_exports); -var import_QueryClientProvider = require("./QueryClientProvider.cjs"); -function usePrefetchQuery(options, queryClient) { - const client = (0, import_QueryClientProvider.useQueryClient)(queryClient); - if (!client.getQueryState(options.queryKey)) { - client.prefetchQuery(options); - } -} -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - usePrefetchQuery -}); -//# sourceMappingURL=usePrefetchQuery.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/usePrefetchQuery.cjs.map b/node_modules/@tanstack/react-query/build/modern/usePrefetchQuery.cjs.map deleted file mode 100644 index c5571bb..0000000 --- a/node_modules/@tanstack/react-query/build/modern/usePrefetchQuery.cjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/usePrefetchQuery.tsx"],"sourcesContent":["import { useQueryClient } from './QueryClientProvider'\nimport type { DefaultError, QueryClient, QueryKey } from '@tanstack/query-core'\nimport type { UsePrefetchQueryOptions } from './types'\n\nexport function usePrefetchQuery<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n options: UsePrefetchQueryOptions,\n queryClient?: QueryClient,\n) {\n const client = useQueryClient(queryClient)\n\n if (!client.getQueryState(options.queryKey)) {\n client.prefetchQuery(options)\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,iCAA+B;AAIxB,SAAS,iBAMd,SACA,aACA;AACA,QAAM,aAAS,2CAAe,WAAW;AAEzC,MAAI,CAAC,OAAO,cAAc,QAAQ,QAAQ,GAAG;AAC3C,WAAO,cAAc,OAAO;AAAA,EAC9B;AACF;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/usePrefetchQuery.d.cts b/node_modules/@tanstack/react-query/build/modern/usePrefetchQuery.d.cts deleted file mode 100644 index 714b71d..0000000 --- a/node_modules/@tanstack/react-query/build/modern/usePrefetchQuery.d.cts +++ /dev/null @@ -1,6 +0,0 @@ -import { DefaultError, QueryKey, QueryClient } from '@tanstack/query-core'; -import { UsePrefetchQueryOptions } from './types.cjs'; - -declare function usePrefetchQuery(options: UsePrefetchQueryOptions, queryClient?: QueryClient): void; - -export { usePrefetchQuery }; diff --git a/node_modules/@tanstack/react-query/build/modern/usePrefetchQuery.d.ts b/node_modules/@tanstack/react-query/build/modern/usePrefetchQuery.d.ts deleted file mode 100644 index 12589eb..0000000 --- a/node_modules/@tanstack/react-query/build/modern/usePrefetchQuery.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { DefaultError, QueryKey, QueryClient } from '@tanstack/query-core'; -import { UsePrefetchQueryOptions } from './types.js'; - -declare function usePrefetchQuery(options: UsePrefetchQueryOptions, queryClient?: QueryClient): void; - -export { usePrefetchQuery }; diff --git a/node_modules/@tanstack/react-query/build/modern/usePrefetchQuery.js b/node_modules/@tanstack/react-query/build/modern/usePrefetchQuery.js deleted file mode 100644 index 63d3292..0000000 --- a/node_modules/@tanstack/react-query/build/modern/usePrefetchQuery.js +++ /dev/null @@ -1,12 +0,0 @@ -// src/usePrefetchQuery.tsx -import { useQueryClient } from "./QueryClientProvider.js"; -function usePrefetchQuery(options, queryClient) { - const client = useQueryClient(queryClient); - if (!client.getQueryState(options.queryKey)) { - client.prefetchQuery(options); - } -} -export { - usePrefetchQuery -}; -//# sourceMappingURL=usePrefetchQuery.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/usePrefetchQuery.js.map b/node_modules/@tanstack/react-query/build/modern/usePrefetchQuery.js.map deleted file mode 100644 index b7f1881..0000000 --- a/node_modules/@tanstack/react-query/build/modern/usePrefetchQuery.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/usePrefetchQuery.tsx"],"sourcesContent":["import { useQueryClient } from './QueryClientProvider'\nimport type { DefaultError, QueryClient, QueryKey } from '@tanstack/query-core'\nimport type { UsePrefetchQueryOptions } from './types'\n\nexport function usePrefetchQuery<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n options: UsePrefetchQueryOptions,\n queryClient?: QueryClient,\n) {\n const client = useQueryClient(queryClient)\n\n if (!client.getQueryState(options.queryKey)) {\n client.prefetchQuery(options)\n }\n}\n"],"mappings":";AAAA,SAAS,sBAAsB;AAIxB,SAAS,iBAMd,SACA,aACA;AACA,QAAM,SAAS,eAAe,WAAW;AAEzC,MAAI,CAAC,OAAO,cAAc,QAAQ,QAAQ,GAAG;AAC3C,WAAO,cAAc,OAAO;AAAA,EAC9B;AACF;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/useQueries.cjs b/node_modules/@tanstack/react-query/build/modern/useQueries.cjs deleted file mode 100644 index d3b35aa..0000000 --- a/node_modules/@tanstack/react-query/build/modern/useQueries.cjs +++ /dev/null @@ -1,128 +0,0 @@ -"use strict"; -"use client"; -var __create = Object.create; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __getProtoOf = Object.getPrototypeOf; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( - // If the importer is in node compatibility mode or this is not an ESM - // file that has been converted to a CommonJS file using a Babel- - // compatible transform (i.e. "__esModule" has not been set), then set - // "default" to the CommonJS "module.exports" for node compatibility. - isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, - mod -)); -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// src/useQueries.ts -var useQueries_exports = {}; -__export(useQueries_exports, { - useQueries: () => useQueries -}); -module.exports = __toCommonJS(useQueries_exports); -var React = __toESM(require("react"), 1); -var import_query_core = require("@tanstack/query-core"); -var import_QueryClientProvider = require("./QueryClientProvider.cjs"); -var import_IsRestoringProvider = require("./IsRestoringProvider.cjs"); -var import_QueryErrorResetBoundary = require("./QueryErrorResetBoundary.cjs"); -var import_errorBoundaryUtils = require("./errorBoundaryUtils.cjs"); -var import_suspense = require("./suspense.cjs"); -function useQueries({ - queries, - ...options -}, queryClient) { - const client = (0, import_QueryClientProvider.useQueryClient)(queryClient); - const isRestoring = (0, import_IsRestoringProvider.useIsRestoring)(); - const errorResetBoundary = (0, import_QueryErrorResetBoundary.useQueryErrorResetBoundary)(); - const defaultedQueries = React.useMemo( - () => queries.map((opts) => { - const defaultedOptions = client.defaultQueryOptions( - opts - ); - defaultedOptions._optimisticResults = isRestoring ? "isRestoring" : "optimistic"; - return defaultedOptions; - }), - [queries, client, isRestoring] - ); - defaultedQueries.forEach((queryOptions) => { - (0, import_suspense.ensureSuspenseTimers)(queryOptions); - const query = client.getQueryCache().get(queryOptions.queryHash); - (0, import_errorBoundaryUtils.ensurePreventErrorBoundaryRetry)(queryOptions, errorResetBoundary, query); - }); - (0, import_errorBoundaryUtils.useClearResetErrorBoundary)(errorResetBoundary); - const [observer] = React.useState( - () => new import_query_core.QueriesObserver( - client, - defaultedQueries, - options - ) - ); - const [optimisticResult, getCombinedResult, trackResult] = observer.getOptimisticResult( - defaultedQueries, - options.combine - ); - const shouldSubscribe = !isRestoring && options.subscribed !== false; - React.useSyncExternalStore( - React.useCallback( - (onStoreChange) => shouldSubscribe ? observer.subscribe(import_query_core.notifyManager.batchCalls(onStoreChange)) : import_query_core.noop, - [observer, shouldSubscribe] - ), - () => observer.getCurrentResult(), - () => observer.getCurrentResult() - ); - React.useEffect(() => { - observer.setQueries( - defaultedQueries, - options - ); - }, [defaultedQueries, options, observer]); - const shouldAtLeastOneSuspend = optimisticResult.some( - (result, index) => (0, import_suspense.shouldSuspend)(defaultedQueries[index], result) - ); - const suspensePromises = shouldAtLeastOneSuspend ? optimisticResult.flatMap((result, index) => { - const opts = defaultedQueries[index]; - if (opts && (0, import_suspense.shouldSuspend)(opts, result)) { - const queryObserver = new import_query_core.QueryObserver(client, opts); - return (0, import_suspense.fetchOptimistic)(opts, queryObserver, errorResetBoundary); - } - return []; - }) : []; - if (suspensePromises.length > 0) { - throw Promise.all(suspensePromises); - } - const firstSingleResultWhichShouldThrow = optimisticResult.find( - (result, index) => { - const query = defaultedQueries[index]; - return query && (0, import_errorBoundaryUtils.getHasError)({ - result, - errorResetBoundary, - throwOnError: query.throwOnError, - query: client.getQueryCache().get(query.queryHash), - suspense: query.suspense - }); - } - ); - if (firstSingleResultWhichShouldThrow?.error) { - throw firstSingleResultWhichShouldThrow.error; - } - return getCombinedResult(trackResult()); -} -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - useQueries -}); -//# sourceMappingURL=useQueries.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/useQueries.cjs.map b/node_modules/@tanstack/react-query/build/modern/useQueries.cjs.map deleted file mode 100644 index f0ef75c..0000000 --- a/node_modules/@tanstack/react-query/build/modern/useQueries.cjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/useQueries.ts"],"sourcesContent":["'use client'\nimport * as React from 'react'\n\nimport {\n QueriesObserver,\n QueryObserver,\n noop,\n notifyManager,\n} from '@tanstack/query-core'\nimport { useQueryClient } from './QueryClientProvider'\nimport { useIsRestoring } from './IsRestoringProvider'\nimport { useQueryErrorResetBoundary } from './QueryErrorResetBoundary'\nimport {\n ensurePreventErrorBoundaryRetry,\n getHasError,\n useClearResetErrorBoundary,\n} from './errorBoundaryUtils'\nimport {\n ensureSuspenseTimers,\n fetchOptimistic,\n shouldSuspend,\n} from './suspense'\nimport type {\n DefinedUseQueryResult,\n UseQueryOptions,\n UseQueryResult,\n} from './types'\nimport type {\n DefaultError,\n OmitKeyof,\n QueriesObserverOptions,\n QueriesPlaceholderDataFunction,\n QueryClient,\n QueryFunction,\n QueryKey,\n QueryObserverOptions,\n ThrowOnError,\n} from '@tanstack/query-core'\n\n// This defines the `UseQueryOptions` that are accepted in `QueriesOptions` & `GetOptions`.\n// `placeholderData` function always gets undefined passed\ntype UseQueryOptionsForUseQueries<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> = OmitKeyof<\n UseQueryOptions,\n 'placeholderData' | 'subscribed'\n> & {\n placeholderData?: TQueryFnData | QueriesPlaceholderDataFunction\n}\n\n// Avoid TS depth-limit error in case of large array literal\ntype MAXIMUM_DEPTH = 20\n\n// Widen the type of the symbol to enable type inference even if skipToken is not immutable.\ntype SkipTokenForUseQueries = symbol\n\ntype GetUseQueryOptionsForUseQueries =\n // Part 1: responsible for applying explicit type parameter to function arguments, if object { queryFnData: TQueryFnData, error: TError, data: TData }\n T extends {\n queryFnData: infer TQueryFnData\n error?: infer TError\n data: infer TData\n }\n ? UseQueryOptionsForUseQueries\n : T extends { queryFnData: infer TQueryFnData; error?: infer TError }\n ? UseQueryOptionsForUseQueries\n : T extends { data: infer TData; error?: infer TError }\n ? UseQueryOptionsForUseQueries\n : // Part 2: responsible for applying explicit type parameter to function arguments, if tuple [TQueryFnData, TError, TData]\n T extends [infer TQueryFnData, infer TError, infer TData]\n ? UseQueryOptionsForUseQueries\n : T extends [infer TQueryFnData, infer TError]\n ? UseQueryOptionsForUseQueries\n : T extends [infer TQueryFnData]\n ? UseQueryOptionsForUseQueries\n : // Part 3: responsible for inferring and enforcing type if no explicit parameter was provided\n T extends {\n queryFn?:\n | QueryFunction\n | SkipTokenForUseQueries\n select?: (data: any) => infer TData\n throwOnError?: ThrowOnError\n }\n ? UseQueryOptionsForUseQueries<\n TQueryFnData,\n unknown extends TError ? DefaultError : TError,\n unknown extends TData ? TQueryFnData : TData,\n TQueryKey\n >\n : // Fallback\n UseQueryOptionsForUseQueries\n\n// A defined initialData setting should return a DefinedUseQueryResult rather than UseQueryResult\ntype GetDefinedOrUndefinedQueryResult = T extends {\n initialData?: infer TInitialData\n}\n ? unknown extends TInitialData\n ? UseQueryResult\n : TInitialData extends TData\n ? DefinedUseQueryResult\n : TInitialData extends () => infer TInitialDataResult\n ? unknown extends TInitialDataResult\n ? UseQueryResult\n : TInitialDataResult extends TData\n ? DefinedUseQueryResult\n : UseQueryResult\n : UseQueryResult\n : UseQueryResult\n\ntype GetUseQueryResult =\n // Part 1: responsible for mapping explicit type parameter to function result, if object\n T extends { queryFnData: any; error?: infer TError; data: infer TData }\n ? GetDefinedOrUndefinedQueryResult\n : T extends { queryFnData: infer TQueryFnData; error?: infer TError }\n ? GetDefinedOrUndefinedQueryResult\n : T extends { data: infer TData; error?: infer TError }\n ? GetDefinedOrUndefinedQueryResult\n : // Part 2: responsible for mapping explicit type parameter to function result, if tuple\n T extends [any, infer TError, infer TData]\n ? GetDefinedOrUndefinedQueryResult\n : T extends [infer TQueryFnData, infer TError]\n ? GetDefinedOrUndefinedQueryResult\n : T extends [infer TQueryFnData]\n ? GetDefinedOrUndefinedQueryResult\n : // Part 3: responsible for mapping inferred type to results, if no explicit parameter was provided\n T extends {\n queryFn?:\n | QueryFunction\n | SkipTokenForUseQueries\n select?: (data: any) => infer TData\n throwOnError?: ThrowOnError\n }\n ? GetDefinedOrUndefinedQueryResult<\n T,\n unknown extends TData ? TQueryFnData : TData,\n unknown extends TError ? DefaultError : TError\n >\n : // Fallback\n UseQueryResult\n\n/**\n * QueriesOptions reducer recursively unwraps function arguments to infer/enforce type param\n */\nexport type QueriesOptions<\n T extends Array,\n TResults extends Array = [],\n TDepth extends ReadonlyArray = [],\n> = TDepth['length'] extends MAXIMUM_DEPTH\n ? Array\n : T extends []\n ? []\n : T extends [infer Head]\n ? [...TResults, GetUseQueryOptionsForUseQueries]\n : T extends [infer Head, ...infer Tails]\n ? QueriesOptions<\n [...Tails],\n [...TResults, GetUseQueryOptionsForUseQueries],\n [...TDepth, 1]\n >\n : ReadonlyArray extends T\n ? T\n : // If T is *some* array but we couldn't assign unknown[] to it, then it must hold some known/homogenous type!\n // use this to infer the param types in the case of Array.map() argument\n T extends Array<\n UseQueryOptionsForUseQueries<\n infer TQueryFnData,\n infer TError,\n infer TData,\n infer TQueryKey\n >\n >\n ? Array<\n UseQueryOptionsForUseQueries<\n TQueryFnData,\n TError,\n TData,\n TQueryKey\n >\n >\n : // Fallback\n Array\n\n/**\n * QueriesResults reducer recursively maps type param to results\n */\nexport type QueriesResults<\n T extends Array,\n TResults extends Array = [],\n TDepth extends ReadonlyArray = [],\n> = TDepth['length'] extends MAXIMUM_DEPTH\n ? Array\n : T extends []\n ? []\n : T extends [infer Head]\n ? [...TResults, GetUseQueryResult]\n : T extends [infer Head, ...infer Tails]\n ? QueriesResults<\n [...Tails],\n [...TResults, GetUseQueryResult],\n [...TDepth, 1]\n >\n : { [K in keyof T]: GetUseQueryResult }\n\nexport function useQueries<\n T extends Array,\n TCombinedResult = QueriesResults,\n>(\n {\n queries,\n ...options\n }: {\n queries:\n | readonly [...QueriesOptions]\n | readonly [...{ [K in keyof T]: GetUseQueryOptionsForUseQueries }]\n combine?: (result: QueriesResults) => TCombinedResult\n subscribed?: boolean\n },\n queryClient?: QueryClient,\n): TCombinedResult {\n const client = useQueryClient(queryClient)\n const isRestoring = useIsRestoring()\n const errorResetBoundary = useQueryErrorResetBoundary()\n\n const defaultedQueries = React.useMemo(\n () =>\n queries.map((opts) => {\n const defaultedOptions = client.defaultQueryOptions(\n opts as QueryObserverOptions,\n )\n\n // Make sure the results are already in fetching state before subscribing or updating options\n defaultedOptions._optimisticResults = isRestoring\n ? 'isRestoring'\n : 'optimistic'\n\n return defaultedOptions\n }),\n [queries, client, isRestoring],\n )\n\n defaultedQueries.forEach((queryOptions) => {\n ensureSuspenseTimers(queryOptions)\n const query = client.getQueryCache().get(queryOptions.queryHash)\n ensurePreventErrorBoundaryRetry(queryOptions, errorResetBoundary, query)\n })\n\n useClearResetErrorBoundary(errorResetBoundary)\n\n const [observer] = React.useState(\n () =>\n new QueriesObserver(\n client,\n defaultedQueries,\n options as QueriesObserverOptions,\n ),\n )\n\n // note: this must be called before useSyncExternalStore\n const [optimisticResult, getCombinedResult, trackResult] =\n observer.getOptimisticResult(\n defaultedQueries,\n (options as QueriesObserverOptions).combine,\n )\n\n const shouldSubscribe = !isRestoring && options.subscribed !== false\n React.useSyncExternalStore(\n React.useCallback(\n (onStoreChange) =>\n shouldSubscribe\n ? observer.subscribe(notifyManager.batchCalls(onStoreChange))\n : noop,\n [observer, shouldSubscribe],\n ),\n () => observer.getCurrentResult(),\n () => observer.getCurrentResult(),\n )\n\n React.useEffect(() => {\n observer.setQueries(\n defaultedQueries,\n options as QueriesObserverOptions,\n )\n }, [defaultedQueries, options, observer])\n\n const shouldAtLeastOneSuspend = optimisticResult.some((result, index) =>\n shouldSuspend(defaultedQueries[index], result),\n )\n\n const suspensePromises = shouldAtLeastOneSuspend\n ? optimisticResult.flatMap((result, index) => {\n const opts = defaultedQueries[index]\n\n if (opts && shouldSuspend(opts, result)) {\n const queryObserver = new QueryObserver(client, opts)\n return fetchOptimistic(opts, queryObserver, errorResetBoundary)\n }\n return []\n })\n : []\n\n if (suspensePromises.length > 0) {\n throw Promise.all(suspensePromises)\n }\n const firstSingleResultWhichShouldThrow = optimisticResult.find(\n (result, index) => {\n const query = defaultedQueries[index]\n return (\n query &&\n getHasError({\n result,\n errorResetBoundary,\n throwOnError: query.throwOnError,\n query: client.getQueryCache().get(query.queryHash),\n suspense: query.suspense,\n })\n )\n },\n )\n\n if (firstSingleResultWhichShouldThrow?.error) {\n throw firstSingleResultWhichShouldThrow.error\n }\n\n return getCombinedResult(trackResult())\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,YAAuB;AAEvB,wBAKO;AACP,iCAA+B;AAC/B,iCAA+B;AAC/B,qCAA2C;AAC3C,gCAIO;AACP,sBAIO;AAyLA,SAAS,WAId;AAAA,EACE;AAAA,EACA,GAAG;AACL,GAOA,aACiB;AACjB,QAAM,aAAS,2CAAe,WAAW;AACzC,QAAM,kBAAc,2CAAe;AACnC,QAAM,yBAAqB,2DAA2B;AAEtD,QAAM,mBAAyB;AAAA,IAC7B,MACE,QAAQ,IAAI,CAAC,SAAS;AACpB,YAAM,mBAAmB,OAAO;AAAA,QAC9B;AAAA,MACF;AAGA,uBAAiB,qBAAqB,cAClC,gBACA;AAEJ,aAAO;AAAA,IACT,CAAC;AAAA,IACH,CAAC,SAAS,QAAQ,WAAW;AAAA,EAC/B;AAEA,mBAAiB,QAAQ,CAAC,iBAAiB;AACzC,8CAAqB,YAAY;AACjC,UAAM,QAAQ,OAAO,cAAc,EAAE,IAAI,aAAa,SAAS;AAC/D,mEAAgC,cAAc,oBAAoB,KAAK;AAAA,EACzE,CAAC;AAED,4DAA2B,kBAAkB;AAE7C,QAAM,CAAC,QAAQ,IAAU;AAAA,IACvB,MACE,IAAI;AAAA,MACF;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,EACJ;AAGA,QAAM,CAAC,kBAAkB,mBAAmB,WAAW,IACrD,SAAS;AAAA,IACP;AAAA,IACC,QAAoD;AAAA,EACvD;AAEF,QAAM,kBAAkB,CAAC,eAAe,QAAQ,eAAe;AAC/D,EAAM;AAAA,IACE;AAAA,MACJ,CAAC,kBACC,kBACI,SAAS,UAAU,gCAAc,WAAW,aAAa,CAAC,IAC1D;AAAA,MACN,CAAC,UAAU,eAAe;AAAA,IAC5B;AAAA,IACA,MAAM,SAAS,iBAAiB;AAAA,IAChC,MAAM,SAAS,iBAAiB;AAAA,EAClC;AAEA,EAAM,gBAAU,MAAM;AACpB,aAAS;AAAA,MACP;AAAA,MACA;AAAA,IACF;AAAA,EACF,GAAG,CAAC,kBAAkB,SAAS,QAAQ,CAAC;AAExC,QAAM,0BAA0B,iBAAiB;AAAA,IAAK,CAAC,QAAQ,cAC7D,+BAAc,iBAAiB,KAAK,GAAG,MAAM;AAAA,EAC/C;AAEA,QAAM,mBAAmB,0BACrB,iBAAiB,QAAQ,CAAC,QAAQ,UAAU;AAC1C,UAAM,OAAO,iBAAiB,KAAK;AAEnC,QAAI,YAAQ,+BAAc,MAAM,MAAM,GAAG;AACvC,YAAM,gBAAgB,IAAI,gCAAc,QAAQ,IAAI;AACpD,iBAAO,iCAAgB,MAAM,eAAe,kBAAkB;AAAA,IAChE;AACA,WAAO,CAAC;AAAA,EACV,CAAC,IACD,CAAC;AAEL,MAAI,iBAAiB,SAAS,GAAG;AAC/B,UAAM,QAAQ,IAAI,gBAAgB;AAAA,EACpC;AACA,QAAM,oCAAoC,iBAAiB;AAAA,IACzD,CAAC,QAAQ,UAAU;AACjB,YAAM,QAAQ,iBAAiB,KAAK;AACpC,aACE,aACA,uCAAY;AAAA,QACV;AAAA,QACA;AAAA,QACA,cAAc,MAAM;AAAA,QACpB,OAAO,OAAO,cAAc,EAAE,IAAI,MAAM,SAAS;AAAA,QACjD,UAAU,MAAM;AAAA,MAClB,CAAC;AAAA,IAEL;AAAA,EACF;AAEA,MAAI,mCAAmC,OAAO;AAC5C,UAAM,kCAAkC;AAAA,EAC1C;AAEA,SAAO,kBAAkB,YAAY,CAAC;AACxC;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/useQueries.d.cts b/node_modules/@tanstack/react-query/build/modern/useQueries.d.cts deleted file mode 100644 index bf88750..0000000 --- a/node_modules/@tanstack/react-query/build/modern/useQueries.d.cts +++ /dev/null @@ -1,76 +0,0 @@ -import { UseQueryOptions, UseQueryResult, DefinedUseQueryResult } from './types.cjs'; -import { DefaultError, QueryKey, OmitKeyof, QueriesPlaceholderDataFunction, QueryFunction, ThrowOnError, QueryClient } from '@tanstack/query-core'; - -type UseQueryOptionsForUseQueries = OmitKeyof, 'placeholderData' | 'subscribed'> & { - placeholderData?: TQueryFnData | QueriesPlaceholderDataFunction; -}; -type MAXIMUM_DEPTH = 20; -type SkipTokenForUseQueries = symbol; -type GetUseQueryOptionsForUseQueries = T extends { - queryFnData: infer TQueryFnData; - error?: infer TError; - data: infer TData; -} ? UseQueryOptionsForUseQueries : T extends { - queryFnData: infer TQueryFnData; - error?: infer TError; -} ? UseQueryOptionsForUseQueries : T extends { - data: infer TData; - error?: infer TError; -} ? UseQueryOptionsForUseQueries : T extends [infer TQueryFnData, infer TError, infer TData] ? UseQueryOptionsForUseQueries : T extends [infer TQueryFnData, infer TError] ? UseQueryOptionsForUseQueries : T extends [infer TQueryFnData] ? UseQueryOptionsForUseQueries : T extends { - queryFn?: QueryFunction | SkipTokenForUseQueries; - select?: (data: any) => infer TData; - throwOnError?: ThrowOnError; -} ? UseQueryOptionsForUseQueries : UseQueryOptionsForUseQueries; -type GetDefinedOrUndefinedQueryResult = T extends { - initialData?: infer TInitialData; -} ? unknown extends TInitialData ? UseQueryResult : TInitialData extends TData ? DefinedUseQueryResult : TInitialData extends () => infer TInitialDataResult ? unknown extends TInitialDataResult ? UseQueryResult : TInitialDataResult extends TData ? DefinedUseQueryResult : UseQueryResult : UseQueryResult : UseQueryResult; -type GetUseQueryResult = T extends { - queryFnData: any; - error?: infer TError; - data: infer TData; -} ? GetDefinedOrUndefinedQueryResult : T extends { - queryFnData: infer TQueryFnData; - error?: infer TError; -} ? GetDefinedOrUndefinedQueryResult : T extends { - data: infer TData; - error?: infer TError; -} ? GetDefinedOrUndefinedQueryResult : T extends [any, infer TError, infer TData] ? GetDefinedOrUndefinedQueryResult : T extends [infer TQueryFnData, infer TError] ? GetDefinedOrUndefinedQueryResult : T extends [infer TQueryFnData] ? GetDefinedOrUndefinedQueryResult : T extends { - queryFn?: QueryFunction | SkipTokenForUseQueries; - select?: (data: any) => infer TData; - throwOnError?: ThrowOnError; -} ? GetDefinedOrUndefinedQueryResult : UseQueryResult; -/** - * QueriesOptions reducer recursively unwraps function arguments to infer/enforce type param - */ -type QueriesOptions, TResults extends Array = [], TDepth extends ReadonlyArray = []> = TDepth['length'] extends MAXIMUM_DEPTH ? Array : T extends [] ? [] : T extends [infer Head] ? [...TResults, GetUseQueryOptionsForUseQueries] : T extends [infer Head, ...infer Tails] ? QueriesOptions<[ - ...Tails -], [ - ...TResults, - GetUseQueryOptionsForUseQueries -], [ - ...TDepth, - 1 -]> : ReadonlyArray extends T ? T : T extends Array> ? Array> : Array; -/** - * QueriesResults reducer recursively maps type param to results - */ -type QueriesResults, TResults extends Array = [], TDepth extends ReadonlyArray = []> = TDepth['length'] extends MAXIMUM_DEPTH ? Array : T extends [] ? [] : T extends [infer Head] ? [...TResults, GetUseQueryResult] : T extends [infer Head, ...infer Tails] ? QueriesResults<[ - ...Tails -], [ - ...TResults, - GetUseQueryResult -], [ - ...TDepth, - 1 -]> : { - [K in keyof T]: GetUseQueryResult; -}; -declare function useQueries, TCombinedResult = QueriesResults>({ queries, ...options }: { - queries: readonly [...QueriesOptions] | readonly [...{ - [K in keyof T]: GetUseQueryOptionsForUseQueries; - }]; - combine?: (result: QueriesResults) => TCombinedResult; - subscribed?: boolean; -}, queryClient?: QueryClient): TCombinedResult; - -export { type QueriesOptions, type QueriesResults, useQueries }; diff --git a/node_modules/@tanstack/react-query/build/modern/useQueries.d.ts b/node_modules/@tanstack/react-query/build/modern/useQueries.d.ts deleted file mode 100644 index 2311f83..0000000 --- a/node_modules/@tanstack/react-query/build/modern/useQueries.d.ts +++ /dev/null @@ -1,76 +0,0 @@ -import { UseQueryOptions, UseQueryResult, DefinedUseQueryResult } from './types.js'; -import { DefaultError, QueryKey, OmitKeyof, QueriesPlaceholderDataFunction, QueryFunction, ThrowOnError, QueryClient } from '@tanstack/query-core'; - -type UseQueryOptionsForUseQueries = OmitKeyof, 'placeholderData' | 'subscribed'> & { - placeholderData?: TQueryFnData | QueriesPlaceholderDataFunction; -}; -type MAXIMUM_DEPTH = 20; -type SkipTokenForUseQueries = symbol; -type GetUseQueryOptionsForUseQueries = T extends { - queryFnData: infer TQueryFnData; - error?: infer TError; - data: infer TData; -} ? UseQueryOptionsForUseQueries : T extends { - queryFnData: infer TQueryFnData; - error?: infer TError; -} ? UseQueryOptionsForUseQueries : T extends { - data: infer TData; - error?: infer TError; -} ? UseQueryOptionsForUseQueries : T extends [infer TQueryFnData, infer TError, infer TData] ? UseQueryOptionsForUseQueries : T extends [infer TQueryFnData, infer TError] ? UseQueryOptionsForUseQueries : T extends [infer TQueryFnData] ? UseQueryOptionsForUseQueries : T extends { - queryFn?: QueryFunction | SkipTokenForUseQueries; - select?: (data: any) => infer TData; - throwOnError?: ThrowOnError; -} ? UseQueryOptionsForUseQueries : UseQueryOptionsForUseQueries; -type GetDefinedOrUndefinedQueryResult = T extends { - initialData?: infer TInitialData; -} ? unknown extends TInitialData ? UseQueryResult : TInitialData extends TData ? DefinedUseQueryResult : TInitialData extends () => infer TInitialDataResult ? unknown extends TInitialDataResult ? UseQueryResult : TInitialDataResult extends TData ? DefinedUseQueryResult : UseQueryResult : UseQueryResult : UseQueryResult; -type GetUseQueryResult = T extends { - queryFnData: any; - error?: infer TError; - data: infer TData; -} ? GetDefinedOrUndefinedQueryResult : T extends { - queryFnData: infer TQueryFnData; - error?: infer TError; -} ? GetDefinedOrUndefinedQueryResult : T extends { - data: infer TData; - error?: infer TError; -} ? GetDefinedOrUndefinedQueryResult : T extends [any, infer TError, infer TData] ? GetDefinedOrUndefinedQueryResult : T extends [infer TQueryFnData, infer TError] ? GetDefinedOrUndefinedQueryResult : T extends [infer TQueryFnData] ? GetDefinedOrUndefinedQueryResult : T extends { - queryFn?: QueryFunction | SkipTokenForUseQueries; - select?: (data: any) => infer TData; - throwOnError?: ThrowOnError; -} ? GetDefinedOrUndefinedQueryResult : UseQueryResult; -/** - * QueriesOptions reducer recursively unwraps function arguments to infer/enforce type param - */ -type QueriesOptions, TResults extends Array = [], TDepth extends ReadonlyArray = []> = TDepth['length'] extends MAXIMUM_DEPTH ? Array : T extends [] ? [] : T extends [infer Head] ? [...TResults, GetUseQueryOptionsForUseQueries] : T extends [infer Head, ...infer Tails] ? QueriesOptions<[ - ...Tails -], [ - ...TResults, - GetUseQueryOptionsForUseQueries -], [ - ...TDepth, - 1 -]> : ReadonlyArray extends T ? T : T extends Array> ? Array> : Array; -/** - * QueriesResults reducer recursively maps type param to results - */ -type QueriesResults, TResults extends Array = [], TDepth extends ReadonlyArray = []> = TDepth['length'] extends MAXIMUM_DEPTH ? Array : T extends [] ? [] : T extends [infer Head] ? [...TResults, GetUseQueryResult] : T extends [infer Head, ...infer Tails] ? QueriesResults<[ - ...Tails -], [ - ...TResults, - GetUseQueryResult -], [ - ...TDepth, - 1 -]> : { - [K in keyof T]: GetUseQueryResult; -}; -declare function useQueries, TCombinedResult = QueriesResults>({ queries, ...options }: { - queries: readonly [...QueriesOptions] | readonly [...{ - [K in keyof T]: GetUseQueryOptionsForUseQueries; - }]; - combine?: (result: QueriesResults) => TCombinedResult; - subscribed?: boolean; -}, queryClient?: QueryClient): TCombinedResult; - -export { type QueriesOptions, type QueriesResults, useQueries }; diff --git a/node_modules/@tanstack/react-query/build/modern/useQueries.js b/node_modules/@tanstack/react-query/build/modern/useQueries.js deleted file mode 100644 index ec7ba7d..0000000 --- a/node_modules/@tanstack/react-query/build/modern/useQueries.js +++ /dev/null @@ -1,107 +0,0 @@ -"use client"; - -// src/useQueries.ts -import * as React from "react"; -import { - QueriesObserver, - QueryObserver, - noop, - notifyManager -} from "@tanstack/query-core"; -import { useQueryClient } from "./QueryClientProvider.js"; -import { useIsRestoring } from "./IsRestoringProvider.js"; -import { useQueryErrorResetBoundary } from "./QueryErrorResetBoundary.js"; -import { - ensurePreventErrorBoundaryRetry, - getHasError, - useClearResetErrorBoundary -} from "./errorBoundaryUtils.js"; -import { - ensureSuspenseTimers, - fetchOptimistic, - shouldSuspend -} from "./suspense.js"; -function useQueries({ - queries, - ...options -}, queryClient) { - const client = useQueryClient(queryClient); - const isRestoring = useIsRestoring(); - const errorResetBoundary = useQueryErrorResetBoundary(); - const defaultedQueries = React.useMemo( - () => queries.map((opts) => { - const defaultedOptions = client.defaultQueryOptions( - opts - ); - defaultedOptions._optimisticResults = isRestoring ? "isRestoring" : "optimistic"; - return defaultedOptions; - }), - [queries, client, isRestoring] - ); - defaultedQueries.forEach((queryOptions) => { - ensureSuspenseTimers(queryOptions); - const query = client.getQueryCache().get(queryOptions.queryHash); - ensurePreventErrorBoundaryRetry(queryOptions, errorResetBoundary, query); - }); - useClearResetErrorBoundary(errorResetBoundary); - const [observer] = React.useState( - () => new QueriesObserver( - client, - defaultedQueries, - options - ) - ); - const [optimisticResult, getCombinedResult, trackResult] = observer.getOptimisticResult( - defaultedQueries, - options.combine - ); - const shouldSubscribe = !isRestoring && options.subscribed !== false; - React.useSyncExternalStore( - React.useCallback( - (onStoreChange) => shouldSubscribe ? observer.subscribe(notifyManager.batchCalls(onStoreChange)) : noop, - [observer, shouldSubscribe] - ), - () => observer.getCurrentResult(), - () => observer.getCurrentResult() - ); - React.useEffect(() => { - observer.setQueries( - defaultedQueries, - options - ); - }, [defaultedQueries, options, observer]); - const shouldAtLeastOneSuspend = optimisticResult.some( - (result, index) => shouldSuspend(defaultedQueries[index], result) - ); - const suspensePromises = shouldAtLeastOneSuspend ? optimisticResult.flatMap((result, index) => { - const opts = defaultedQueries[index]; - if (opts && shouldSuspend(opts, result)) { - const queryObserver = new QueryObserver(client, opts); - return fetchOptimistic(opts, queryObserver, errorResetBoundary); - } - return []; - }) : []; - if (suspensePromises.length > 0) { - throw Promise.all(suspensePromises); - } - const firstSingleResultWhichShouldThrow = optimisticResult.find( - (result, index) => { - const query = defaultedQueries[index]; - return query && getHasError({ - result, - errorResetBoundary, - throwOnError: query.throwOnError, - query: client.getQueryCache().get(query.queryHash), - suspense: query.suspense - }); - } - ); - if (firstSingleResultWhichShouldThrow?.error) { - throw firstSingleResultWhichShouldThrow.error; - } - return getCombinedResult(trackResult()); -} -export { - useQueries -}; -//# sourceMappingURL=useQueries.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/useQueries.js.map b/node_modules/@tanstack/react-query/build/modern/useQueries.js.map deleted file mode 100644 index 5aca456..0000000 --- a/node_modules/@tanstack/react-query/build/modern/useQueries.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/useQueries.ts"],"sourcesContent":["'use client'\nimport * as React from 'react'\n\nimport {\n QueriesObserver,\n QueryObserver,\n noop,\n notifyManager,\n} from '@tanstack/query-core'\nimport { useQueryClient } from './QueryClientProvider'\nimport { useIsRestoring } from './IsRestoringProvider'\nimport { useQueryErrorResetBoundary } from './QueryErrorResetBoundary'\nimport {\n ensurePreventErrorBoundaryRetry,\n getHasError,\n useClearResetErrorBoundary,\n} from './errorBoundaryUtils'\nimport {\n ensureSuspenseTimers,\n fetchOptimistic,\n shouldSuspend,\n} from './suspense'\nimport type {\n DefinedUseQueryResult,\n UseQueryOptions,\n UseQueryResult,\n} from './types'\nimport type {\n DefaultError,\n OmitKeyof,\n QueriesObserverOptions,\n QueriesPlaceholderDataFunction,\n QueryClient,\n QueryFunction,\n QueryKey,\n QueryObserverOptions,\n ThrowOnError,\n} from '@tanstack/query-core'\n\n// This defines the `UseQueryOptions` that are accepted in `QueriesOptions` & `GetOptions`.\n// `placeholderData` function always gets undefined passed\ntype UseQueryOptionsForUseQueries<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> = OmitKeyof<\n UseQueryOptions,\n 'placeholderData' | 'subscribed'\n> & {\n placeholderData?: TQueryFnData | QueriesPlaceholderDataFunction\n}\n\n// Avoid TS depth-limit error in case of large array literal\ntype MAXIMUM_DEPTH = 20\n\n// Widen the type of the symbol to enable type inference even if skipToken is not immutable.\ntype SkipTokenForUseQueries = symbol\n\ntype GetUseQueryOptionsForUseQueries =\n // Part 1: responsible for applying explicit type parameter to function arguments, if object { queryFnData: TQueryFnData, error: TError, data: TData }\n T extends {\n queryFnData: infer TQueryFnData\n error?: infer TError\n data: infer TData\n }\n ? UseQueryOptionsForUseQueries\n : T extends { queryFnData: infer TQueryFnData; error?: infer TError }\n ? UseQueryOptionsForUseQueries\n : T extends { data: infer TData; error?: infer TError }\n ? UseQueryOptionsForUseQueries\n : // Part 2: responsible for applying explicit type parameter to function arguments, if tuple [TQueryFnData, TError, TData]\n T extends [infer TQueryFnData, infer TError, infer TData]\n ? UseQueryOptionsForUseQueries\n : T extends [infer TQueryFnData, infer TError]\n ? UseQueryOptionsForUseQueries\n : T extends [infer TQueryFnData]\n ? UseQueryOptionsForUseQueries\n : // Part 3: responsible for inferring and enforcing type if no explicit parameter was provided\n T extends {\n queryFn?:\n | QueryFunction\n | SkipTokenForUseQueries\n select?: (data: any) => infer TData\n throwOnError?: ThrowOnError\n }\n ? UseQueryOptionsForUseQueries<\n TQueryFnData,\n unknown extends TError ? DefaultError : TError,\n unknown extends TData ? TQueryFnData : TData,\n TQueryKey\n >\n : // Fallback\n UseQueryOptionsForUseQueries\n\n// A defined initialData setting should return a DefinedUseQueryResult rather than UseQueryResult\ntype GetDefinedOrUndefinedQueryResult = T extends {\n initialData?: infer TInitialData\n}\n ? unknown extends TInitialData\n ? UseQueryResult\n : TInitialData extends TData\n ? DefinedUseQueryResult\n : TInitialData extends () => infer TInitialDataResult\n ? unknown extends TInitialDataResult\n ? UseQueryResult\n : TInitialDataResult extends TData\n ? DefinedUseQueryResult\n : UseQueryResult\n : UseQueryResult\n : UseQueryResult\n\ntype GetUseQueryResult =\n // Part 1: responsible for mapping explicit type parameter to function result, if object\n T extends { queryFnData: any; error?: infer TError; data: infer TData }\n ? GetDefinedOrUndefinedQueryResult\n : T extends { queryFnData: infer TQueryFnData; error?: infer TError }\n ? GetDefinedOrUndefinedQueryResult\n : T extends { data: infer TData; error?: infer TError }\n ? GetDefinedOrUndefinedQueryResult\n : // Part 2: responsible for mapping explicit type parameter to function result, if tuple\n T extends [any, infer TError, infer TData]\n ? GetDefinedOrUndefinedQueryResult\n : T extends [infer TQueryFnData, infer TError]\n ? GetDefinedOrUndefinedQueryResult\n : T extends [infer TQueryFnData]\n ? GetDefinedOrUndefinedQueryResult\n : // Part 3: responsible for mapping inferred type to results, if no explicit parameter was provided\n T extends {\n queryFn?:\n | QueryFunction\n | SkipTokenForUseQueries\n select?: (data: any) => infer TData\n throwOnError?: ThrowOnError\n }\n ? GetDefinedOrUndefinedQueryResult<\n T,\n unknown extends TData ? TQueryFnData : TData,\n unknown extends TError ? DefaultError : TError\n >\n : // Fallback\n UseQueryResult\n\n/**\n * QueriesOptions reducer recursively unwraps function arguments to infer/enforce type param\n */\nexport type QueriesOptions<\n T extends Array,\n TResults extends Array = [],\n TDepth extends ReadonlyArray = [],\n> = TDepth['length'] extends MAXIMUM_DEPTH\n ? Array\n : T extends []\n ? []\n : T extends [infer Head]\n ? [...TResults, GetUseQueryOptionsForUseQueries]\n : T extends [infer Head, ...infer Tails]\n ? QueriesOptions<\n [...Tails],\n [...TResults, GetUseQueryOptionsForUseQueries],\n [...TDepth, 1]\n >\n : ReadonlyArray extends T\n ? T\n : // If T is *some* array but we couldn't assign unknown[] to it, then it must hold some known/homogenous type!\n // use this to infer the param types in the case of Array.map() argument\n T extends Array<\n UseQueryOptionsForUseQueries<\n infer TQueryFnData,\n infer TError,\n infer TData,\n infer TQueryKey\n >\n >\n ? Array<\n UseQueryOptionsForUseQueries<\n TQueryFnData,\n TError,\n TData,\n TQueryKey\n >\n >\n : // Fallback\n Array\n\n/**\n * QueriesResults reducer recursively maps type param to results\n */\nexport type QueriesResults<\n T extends Array,\n TResults extends Array = [],\n TDepth extends ReadonlyArray = [],\n> = TDepth['length'] extends MAXIMUM_DEPTH\n ? Array\n : T extends []\n ? []\n : T extends [infer Head]\n ? [...TResults, GetUseQueryResult]\n : T extends [infer Head, ...infer Tails]\n ? QueriesResults<\n [...Tails],\n [...TResults, GetUseQueryResult],\n [...TDepth, 1]\n >\n : { [K in keyof T]: GetUseQueryResult }\n\nexport function useQueries<\n T extends Array,\n TCombinedResult = QueriesResults,\n>(\n {\n queries,\n ...options\n }: {\n queries:\n | readonly [...QueriesOptions]\n | readonly [...{ [K in keyof T]: GetUseQueryOptionsForUseQueries }]\n combine?: (result: QueriesResults) => TCombinedResult\n subscribed?: boolean\n },\n queryClient?: QueryClient,\n): TCombinedResult {\n const client = useQueryClient(queryClient)\n const isRestoring = useIsRestoring()\n const errorResetBoundary = useQueryErrorResetBoundary()\n\n const defaultedQueries = React.useMemo(\n () =>\n queries.map((opts) => {\n const defaultedOptions = client.defaultQueryOptions(\n opts as QueryObserverOptions,\n )\n\n // Make sure the results are already in fetching state before subscribing or updating options\n defaultedOptions._optimisticResults = isRestoring\n ? 'isRestoring'\n : 'optimistic'\n\n return defaultedOptions\n }),\n [queries, client, isRestoring],\n )\n\n defaultedQueries.forEach((queryOptions) => {\n ensureSuspenseTimers(queryOptions)\n const query = client.getQueryCache().get(queryOptions.queryHash)\n ensurePreventErrorBoundaryRetry(queryOptions, errorResetBoundary, query)\n })\n\n useClearResetErrorBoundary(errorResetBoundary)\n\n const [observer] = React.useState(\n () =>\n new QueriesObserver(\n client,\n defaultedQueries,\n options as QueriesObserverOptions,\n ),\n )\n\n // note: this must be called before useSyncExternalStore\n const [optimisticResult, getCombinedResult, trackResult] =\n observer.getOptimisticResult(\n defaultedQueries,\n (options as QueriesObserverOptions).combine,\n )\n\n const shouldSubscribe = !isRestoring && options.subscribed !== false\n React.useSyncExternalStore(\n React.useCallback(\n (onStoreChange) =>\n shouldSubscribe\n ? observer.subscribe(notifyManager.batchCalls(onStoreChange))\n : noop,\n [observer, shouldSubscribe],\n ),\n () => observer.getCurrentResult(),\n () => observer.getCurrentResult(),\n )\n\n React.useEffect(() => {\n observer.setQueries(\n defaultedQueries,\n options as QueriesObserverOptions,\n )\n }, [defaultedQueries, options, observer])\n\n const shouldAtLeastOneSuspend = optimisticResult.some((result, index) =>\n shouldSuspend(defaultedQueries[index], result),\n )\n\n const suspensePromises = shouldAtLeastOneSuspend\n ? optimisticResult.flatMap((result, index) => {\n const opts = defaultedQueries[index]\n\n if (opts && shouldSuspend(opts, result)) {\n const queryObserver = new QueryObserver(client, opts)\n return fetchOptimistic(opts, queryObserver, errorResetBoundary)\n }\n return []\n })\n : []\n\n if (suspensePromises.length > 0) {\n throw Promise.all(suspensePromises)\n }\n const firstSingleResultWhichShouldThrow = optimisticResult.find(\n (result, index) => {\n const query = defaultedQueries[index]\n return (\n query &&\n getHasError({\n result,\n errorResetBoundary,\n throwOnError: query.throwOnError,\n query: client.getQueryCache().get(query.queryHash),\n suspense: query.suspense,\n })\n )\n },\n )\n\n if (firstSingleResultWhichShouldThrow?.error) {\n throw firstSingleResultWhichShouldThrow.error\n }\n\n return getCombinedResult(trackResult())\n}\n"],"mappings":";;;AACA,YAAY,WAAW;AAEvB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,sBAAsB;AAC/B,SAAS,sBAAsB;AAC/B,SAAS,kCAAkC;AAC3C;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAyLA,SAAS,WAId;AAAA,EACE;AAAA,EACA,GAAG;AACL,GAOA,aACiB;AACjB,QAAM,SAAS,eAAe,WAAW;AACzC,QAAM,cAAc,eAAe;AACnC,QAAM,qBAAqB,2BAA2B;AAEtD,QAAM,mBAAyB;AAAA,IAC7B,MACE,QAAQ,IAAI,CAAC,SAAS;AACpB,YAAM,mBAAmB,OAAO;AAAA,QAC9B;AAAA,MACF;AAGA,uBAAiB,qBAAqB,cAClC,gBACA;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,IACD,CAAC;AAEL,MAAI,iBAAiB,SAAS,GAAG;AAC/B,UAAM,QAAQ,IAAI,gBAAgB;AAAA,EACpC;AACA,QAAM,oCAAoC,iBAAiB;AAAA,IACzD,CAAC,QAAQ,UAAU;AACjB,YAAM,QAAQ,iBAAiB,KAAK;AACpC,aACE,SACA,YAAY;AAAA,QACV;AAAA,QACA;AAAA,QACA,cAAc,MAAM;AAAA,QACpB,OAAO,OAAO,cAAc,EAAE,IAAI,MAAM,SAAS;AAAA,QACjD,UAAU,MAAM;AAAA,MAClB,CAAC;AAAA,IAEL;AAAA,EACF;AAEA,MAAI,mCAAmC,OAAO;AAC5C,UAAM,kCAAkC;AAAA,EAC1C;AAEA,SAAO,kBAAkB,YAAY,CAAC;AACxC;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/useQuery.cjs b/node_modules/@tanstack/react-query/build/modern/useQuery.cjs deleted file mode 100644 index 993525b..0000000 --- a/node_modules/@tanstack/react-query/build/modern/useQuery.cjs +++ /dev/null @@ -1,36 +0,0 @@ -"use strict"; -"use client"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// src/useQuery.ts -var useQuery_exports = {}; -__export(useQuery_exports, { - useQuery: () => useQuery -}); -module.exports = __toCommonJS(useQuery_exports); -var import_query_core = require("@tanstack/query-core"); -var import_useBaseQuery = require("./useBaseQuery.cjs"); -function useQuery(options, queryClient) { - return (0, import_useBaseQuery.useBaseQuery)(options, import_query_core.QueryObserver, queryClient); -} -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - useQuery -}); -//# sourceMappingURL=useQuery.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/useQuery.cjs.map b/node_modules/@tanstack/react-query/build/modern/useQuery.cjs.map deleted file mode 100644 index 4b0a996..0000000 --- a/node_modules/@tanstack/react-query/build/modern/useQuery.cjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/useQuery.ts"],"sourcesContent":["'use client'\nimport { QueryObserver } from '@tanstack/query-core'\nimport { useBaseQuery } from './useBaseQuery'\nimport type {\n DefaultError,\n NoInfer,\n QueryClient,\n QueryKey,\n} from '@tanstack/query-core'\nimport type {\n DefinedUseQueryResult,\n UseQueryOptions,\n UseQueryResult,\n} from './types'\nimport type {\n DefinedInitialDataOptions,\n UndefinedInitialDataOptions,\n} from './queryOptions'\n\nexport function useQuery<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n options: DefinedInitialDataOptions,\n queryClient?: QueryClient,\n): DefinedUseQueryResult, TError>\n\nexport function useQuery<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n options: UndefinedInitialDataOptions,\n queryClient?: QueryClient,\n): UseQueryResult, TError>\n\nexport function useQuery<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n options: UseQueryOptions,\n queryClient?: QueryClient,\n): UseQueryResult, TError>\n\nexport function useQuery(options: UseQueryOptions, queryClient?: QueryClient) {\n return useBaseQuery(options, QueryObserver, queryClient)\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,wBAA8B;AAC9B,0BAA6B;AA+CtB,SAAS,SAAS,SAA0B,aAA2B;AAC5E,aAAO,kCAAa,SAAS,iCAAe,WAAW;AACzD;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/useQuery.d.cts b/node_modules/@tanstack/react-query/build/modern/useQuery.d.cts deleted file mode 100644 index da16840..0000000 --- a/node_modules/@tanstack/react-query/build/modern/useQuery.d.cts +++ /dev/null @@ -1,9 +0,0 @@ -import { DefaultError, QueryKey, QueryClient, NoInfer } from '@tanstack/query-core'; -import { DefinedUseQueryResult, UseQueryResult, UseQueryOptions } from './types.cjs'; -import { DefinedInitialDataOptions, UndefinedInitialDataOptions } from './queryOptions.cjs'; - -declare function useQuery(options: DefinedInitialDataOptions, queryClient?: QueryClient): DefinedUseQueryResult, TError>; -declare function useQuery(options: UndefinedInitialDataOptions, queryClient?: QueryClient): UseQueryResult, TError>; -declare function useQuery(options: UseQueryOptions, queryClient?: QueryClient): UseQueryResult, TError>; - -export { useQuery }; diff --git a/node_modules/@tanstack/react-query/build/modern/useQuery.d.ts b/node_modules/@tanstack/react-query/build/modern/useQuery.d.ts deleted file mode 100644 index 72bc861..0000000 --- a/node_modules/@tanstack/react-query/build/modern/useQuery.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { DefaultError, QueryKey, QueryClient, NoInfer } from '@tanstack/query-core'; -import { DefinedUseQueryResult, UseQueryResult, UseQueryOptions } from './types.js'; -import { DefinedInitialDataOptions, UndefinedInitialDataOptions } from './queryOptions.js'; - -declare function useQuery(options: DefinedInitialDataOptions, queryClient?: QueryClient): DefinedUseQueryResult, TError>; -declare function useQuery(options: UndefinedInitialDataOptions, queryClient?: QueryClient): UseQueryResult, TError>; -declare function useQuery(options: UseQueryOptions, queryClient?: QueryClient): UseQueryResult, TError>; - -export { useQuery }; diff --git a/node_modules/@tanstack/react-query/build/modern/useQuery.js b/node_modules/@tanstack/react-query/build/modern/useQuery.js deleted file mode 100644 index 6173d62..0000000 --- a/node_modules/@tanstack/react-query/build/modern/useQuery.js +++ /dev/null @@ -1,12 +0,0 @@ -"use client"; - -// src/useQuery.ts -import { QueryObserver } from "@tanstack/query-core"; -import { useBaseQuery } from "./useBaseQuery.js"; -function useQuery(options, queryClient) { - return useBaseQuery(options, QueryObserver, queryClient); -} -export { - useQuery -}; -//# sourceMappingURL=useQuery.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/useQuery.js.map b/node_modules/@tanstack/react-query/build/modern/useQuery.js.map deleted file mode 100644 index 3f4f63f..0000000 --- a/node_modules/@tanstack/react-query/build/modern/useQuery.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/useQuery.ts"],"sourcesContent":["'use client'\nimport { QueryObserver } from '@tanstack/query-core'\nimport { useBaseQuery } from './useBaseQuery'\nimport type {\n DefaultError,\n NoInfer,\n QueryClient,\n QueryKey,\n} from '@tanstack/query-core'\nimport type {\n DefinedUseQueryResult,\n UseQueryOptions,\n UseQueryResult,\n} from './types'\nimport type {\n DefinedInitialDataOptions,\n UndefinedInitialDataOptions,\n} from './queryOptions'\n\nexport function useQuery<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n options: DefinedInitialDataOptions,\n queryClient?: QueryClient,\n): DefinedUseQueryResult, TError>\n\nexport function useQuery<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n options: UndefinedInitialDataOptions,\n queryClient?: QueryClient,\n): UseQueryResult, TError>\n\nexport function useQuery<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n options: UseQueryOptions,\n queryClient?: QueryClient,\n): UseQueryResult, TError>\n\nexport function useQuery(options: UseQueryOptions, queryClient?: QueryClient) {\n return useBaseQuery(options, QueryObserver, queryClient)\n}\n"],"mappings":";;;AACA,SAAS,qBAAqB;AAC9B,SAAS,oBAAoB;AA+CtB,SAAS,SAAS,SAA0B,aAA2B;AAC5E,SAAO,aAAa,SAAS,eAAe,WAAW;AACzD;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/useSuspenseInfiniteQuery.cjs b/node_modules/@tanstack/react-query/build/modern/useSuspenseInfiniteQuery.cjs deleted file mode 100644 index 1d06bb1..0000000 --- a/node_modules/@tanstack/react-query/build/modern/useSuspenseInfiniteQuery.cjs +++ /dev/null @@ -1,51 +0,0 @@ -"use strict"; -"use client"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// src/useSuspenseInfiniteQuery.ts -var useSuspenseInfiniteQuery_exports = {}; -__export(useSuspenseInfiniteQuery_exports, { - useSuspenseInfiniteQuery: () => useSuspenseInfiniteQuery -}); -module.exports = __toCommonJS(useSuspenseInfiniteQuery_exports); -var import_query_core = require("@tanstack/query-core"); -var import_useBaseQuery = require("./useBaseQuery.cjs"); -var import_suspense = require("./suspense.cjs"); -function useSuspenseInfiniteQuery(options, queryClient) { - if (process.env.NODE_ENV !== "production") { - if (options.queryFn === import_query_core.skipToken) { - console.error("skipToken is not allowed for useSuspenseInfiniteQuery"); - } - } - return (0, import_useBaseQuery.useBaseQuery)( - { - ...options, - enabled: true, - suspense: true, - throwOnError: import_suspense.defaultThrowOnError - }, - import_query_core.InfiniteQueryObserver, - queryClient - ); -} -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - useSuspenseInfiniteQuery -}); -//# sourceMappingURL=useSuspenseInfiniteQuery.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/useSuspenseInfiniteQuery.cjs.map b/node_modules/@tanstack/react-query/build/modern/useSuspenseInfiniteQuery.cjs.map deleted file mode 100644 index 98d9c0b..0000000 --- a/node_modules/@tanstack/react-query/build/modern/useSuspenseInfiniteQuery.cjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/useSuspenseInfiniteQuery.ts"],"sourcesContent":["'use client'\nimport { InfiniteQueryObserver, skipToken } from '@tanstack/query-core'\nimport { useBaseQuery } from './useBaseQuery'\nimport { defaultThrowOnError } from './suspense'\nimport type {\n DefaultError,\n InfiniteData,\n InfiniteQueryObserverSuccessResult,\n QueryClient,\n QueryKey,\n QueryObserver,\n} from '@tanstack/query-core'\nimport type {\n UseSuspenseInfiniteQueryOptions,\n UseSuspenseInfiniteQueryResult,\n} from './types'\n\nexport function useSuspenseInfiniteQuery<\n TQueryFnData,\n TError = DefaultError,\n TData = InfiniteData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n>(\n options: UseSuspenseInfiniteQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n queryClient?: QueryClient,\n): UseSuspenseInfiniteQueryResult {\n if (process.env.NODE_ENV !== 'production') {\n if ((options.queryFn as any) === skipToken) {\n console.error('skipToken is not allowed for useSuspenseInfiniteQuery')\n }\n }\n\n return useBaseQuery(\n {\n ...options,\n enabled: true,\n suspense: true,\n throwOnError: defaultThrowOnError,\n },\n InfiniteQueryObserver as typeof QueryObserver,\n queryClient,\n ) as InfiniteQueryObserverSuccessResult\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,wBAAiD;AACjD,0BAA6B;AAC7B,sBAAoC;AAc7B,SAAS,yBAOd,SAOA,aAC+C;AAC/C,MAAI,QAAQ,IAAI,aAAa,cAAc;AACzC,QAAK,QAAQ,YAAoB,6BAAW;AAC1C,cAAQ,MAAM,uDAAuD;AAAA,IACvE;AAAA,EACF;AAEA,aAAO;AAAA,IACL;AAAA,MACE,GAAG;AAAA,MACH,SAAS;AAAA,MACT,UAAU;AAAA,MACV,cAAc;AAAA,IAChB;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/useSuspenseInfiniteQuery.d.cts b/node_modules/@tanstack/react-query/build/modern/useSuspenseInfiniteQuery.d.cts deleted file mode 100644 index e056e82..0000000 --- a/node_modules/@tanstack/react-query/build/modern/useSuspenseInfiniteQuery.d.cts +++ /dev/null @@ -1,6 +0,0 @@ -import { DefaultError, InfiniteData, QueryKey, QueryClient } from '@tanstack/query-core'; -import { UseSuspenseInfiniteQueryOptions, UseSuspenseInfiniteQueryResult } from './types.cjs'; - -declare function useSuspenseInfiniteQuery, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown>(options: UseSuspenseInfiniteQueryOptions, queryClient?: QueryClient): UseSuspenseInfiniteQueryResult; - -export { useSuspenseInfiniteQuery }; diff --git a/node_modules/@tanstack/react-query/build/modern/useSuspenseInfiniteQuery.d.ts b/node_modules/@tanstack/react-query/build/modern/useSuspenseInfiniteQuery.d.ts deleted file mode 100644 index 42d7b61..0000000 --- a/node_modules/@tanstack/react-query/build/modern/useSuspenseInfiniteQuery.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { DefaultError, InfiniteData, QueryKey, QueryClient } from '@tanstack/query-core'; -import { UseSuspenseInfiniteQueryOptions, UseSuspenseInfiniteQueryResult } from './types.js'; - -declare function useSuspenseInfiniteQuery, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown>(options: UseSuspenseInfiniteQueryOptions, queryClient?: QueryClient): UseSuspenseInfiniteQueryResult; - -export { useSuspenseInfiniteQuery }; diff --git a/node_modules/@tanstack/react-query/build/modern/useSuspenseInfiniteQuery.js b/node_modules/@tanstack/react-query/build/modern/useSuspenseInfiniteQuery.js deleted file mode 100644 index 7c8facf..0000000 --- a/node_modules/@tanstack/react-query/build/modern/useSuspenseInfiniteQuery.js +++ /dev/null @@ -1,27 +0,0 @@ -"use client"; - -// src/useSuspenseInfiniteQuery.ts -import { InfiniteQueryObserver, skipToken } from "@tanstack/query-core"; -import { useBaseQuery } from "./useBaseQuery.js"; -import { defaultThrowOnError } from "./suspense.js"; -function useSuspenseInfiniteQuery(options, queryClient) { - if (process.env.NODE_ENV !== "production") { - if (options.queryFn === skipToken) { - console.error("skipToken is not allowed for useSuspenseInfiniteQuery"); - } - } - return useBaseQuery( - { - ...options, - enabled: true, - suspense: true, - throwOnError: defaultThrowOnError - }, - InfiniteQueryObserver, - queryClient - ); -} -export { - useSuspenseInfiniteQuery -}; -//# sourceMappingURL=useSuspenseInfiniteQuery.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/useSuspenseInfiniteQuery.js.map b/node_modules/@tanstack/react-query/build/modern/useSuspenseInfiniteQuery.js.map deleted file mode 100644 index a4937c6..0000000 --- a/node_modules/@tanstack/react-query/build/modern/useSuspenseInfiniteQuery.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/useSuspenseInfiniteQuery.ts"],"sourcesContent":["'use client'\nimport { InfiniteQueryObserver, skipToken } from '@tanstack/query-core'\nimport { useBaseQuery } from './useBaseQuery'\nimport { defaultThrowOnError } from './suspense'\nimport type {\n DefaultError,\n InfiniteData,\n InfiniteQueryObserverSuccessResult,\n QueryClient,\n QueryKey,\n QueryObserver,\n} from '@tanstack/query-core'\nimport type {\n UseSuspenseInfiniteQueryOptions,\n UseSuspenseInfiniteQueryResult,\n} from './types'\n\nexport function useSuspenseInfiniteQuery<\n TQueryFnData,\n TError = DefaultError,\n TData = InfiniteData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n>(\n options: UseSuspenseInfiniteQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n queryClient?: QueryClient,\n): UseSuspenseInfiniteQueryResult {\n if (process.env.NODE_ENV !== 'production') {\n if ((options.queryFn as any) === skipToken) {\n console.error('skipToken is not allowed for useSuspenseInfiniteQuery')\n }\n }\n\n return useBaseQuery(\n {\n ...options,\n enabled: true,\n suspense: true,\n throwOnError: defaultThrowOnError,\n },\n InfiniteQueryObserver as typeof QueryObserver,\n queryClient,\n ) as InfiniteQueryObserverSuccessResult\n}\n"],"mappings":";;;AACA,SAAS,uBAAuB,iBAAiB;AACjD,SAAS,oBAAoB;AAC7B,SAAS,2BAA2B;AAc7B,SAAS,yBAOd,SAOA,aAC+C;AAC/C,MAAI,QAAQ,IAAI,aAAa,cAAc;AACzC,QAAK,QAAQ,YAAoB,WAAW;AAC1C,cAAQ,MAAM,uDAAuD;AAAA,IACvE;AAAA,EACF;AAEA,SAAO;AAAA,IACL;AAAA,MACE,GAAG;AAAA,MACH,SAAS;AAAA,MACT,UAAU;AAAA,MACV,cAAc;AAAA,IAChB;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/useSuspenseQueries.cjs b/node_modules/@tanstack/react-query/build/modern/useSuspenseQueries.cjs deleted file mode 100644 index 75f86ef..0000000 --- a/node_modules/@tanstack/react-query/build/modern/useSuspenseQueries.cjs +++ /dev/null @@ -1,56 +0,0 @@ -"use strict"; -"use client"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// src/useSuspenseQueries.ts -var useSuspenseQueries_exports = {}; -__export(useSuspenseQueries_exports, { - useSuspenseQueries: () => useSuspenseQueries -}); -module.exports = __toCommonJS(useSuspenseQueries_exports); -var import_query_core = require("@tanstack/query-core"); -var import_useQueries = require("./useQueries.cjs"); -var import_suspense = require("./suspense.cjs"); -function useSuspenseQueries(options, queryClient) { - return (0, import_useQueries.useQueries)( - { - ...options, - queries: options.queries.map((query) => { - if (process.env.NODE_ENV !== "production") { - if (query.queryFn === import_query_core.skipToken) { - console.error("skipToken is not allowed for useSuspenseQueries"); - } - } - return { - ...query, - suspense: true, - throwOnError: import_suspense.defaultThrowOnError, - enabled: true, - placeholderData: void 0 - }; - }) - }, - queryClient - ); -} -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - useSuspenseQueries -}); -//# sourceMappingURL=useSuspenseQueries.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/useSuspenseQueries.cjs.map b/node_modules/@tanstack/react-query/build/modern/useSuspenseQueries.cjs.map deleted file mode 100644 index f8548ca..0000000 --- a/node_modules/@tanstack/react-query/build/modern/useSuspenseQueries.cjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/useSuspenseQueries.ts"],"sourcesContent":["'use client'\nimport { skipToken } from '@tanstack/query-core'\nimport { useQueries } from './useQueries'\nimport { defaultThrowOnError } from './suspense'\nimport type { UseSuspenseQueryOptions, UseSuspenseQueryResult } from './types'\nimport type {\n DefaultError,\n QueryClient,\n QueryFunction,\n ThrowOnError,\n} from '@tanstack/query-core'\n\n// Avoid TS depth-limit error in case of large array literal\ntype MAXIMUM_DEPTH = 20\n\n// Widen the type of the symbol to enable type inference even if skipToken is not immutable.\ntype SkipTokenForUseQueries = symbol\n\ntype GetUseSuspenseQueryOptions =\n // Part 1: responsible for applying explicit type parameter to function arguments, if object { queryFnData: TQueryFnData, error: TError, data: TData }\n T extends {\n queryFnData: infer TQueryFnData\n error?: infer TError\n data: infer TData\n }\n ? UseSuspenseQueryOptions\n : T extends { queryFnData: infer TQueryFnData; error?: infer TError }\n ? UseSuspenseQueryOptions\n : T extends { data: infer TData; error?: infer TError }\n ? UseSuspenseQueryOptions\n : // Part 2: responsible for applying explicit type parameter to function arguments, if tuple [TQueryFnData, TError, TData]\n T extends [infer TQueryFnData, infer TError, infer TData]\n ? UseSuspenseQueryOptions\n : T extends [infer TQueryFnData, infer TError]\n ? UseSuspenseQueryOptions\n : T extends [infer TQueryFnData]\n ? UseSuspenseQueryOptions\n : // Part 3: responsible for inferring and enforcing type if no explicit parameter was provided\n T extends {\n queryFn?:\n | QueryFunction\n | SkipTokenForUseQueries\n select?: (data: any) => infer TData\n throwOnError?: ThrowOnError\n }\n ? UseSuspenseQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey\n >\n : T extends {\n queryFn?:\n | QueryFunction\n | SkipTokenForUseQueries\n throwOnError?: ThrowOnError\n }\n ? UseSuspenseQueryOptions<\n TQueryFnData,\n TError,\n TQueryFnData,\n TQueryKey\n >\n : // Fallback\n UseSuspenseQueryOptions\n\ntype GetUseSuspenseQueryResult =\n // Part 1: responsible for mapping explicit type parameter to function result, if object\n T extends { queryFnData: any; error?: infer TError; data: infer TData }\n ? UseSuspenseQueryResult\n : T extends { queryFnData: infer TQueryFnData; error?: infer TError }\n ? UseSuspenseQueryResult\n : T extends { data: infer TData; error?: infer TError }\n ? UseSuspenseQueryResult\n : // Part 2: responsible for mapping explicit type parameter to function result, if tuple\n T extends [any, infer TError, infer TData]\n ? UseSuspenseQueryResult\n : T extends [infer TQueryFnData, infer TError]\n ? UseSuspenseQueryResult\n : T extends [infer TQueryFnData]\n ? UseSuspenseQueryResult\n : // Part 3: responsible for mapping inferred type to results, if no explicit parameter was provided\n T extends {\n queryFn?:\n | QueryFunction\n | SkipTokenForUseQueries\n select?: (data: any) => infer TData\n throwOnError?: ThrowOnError\n }\n ? UseSuspenseQueryResult<\n unknown extends TData ? TQueryFnData : TData,\n unknown extends TError ? DefaultError : TError\n >\n : T extends {\n queryFn?:\n | QueryFunction\n | SkipTokenForUseQueries\n throwOnError?: ThrowOnError\n }\n ? UseSuspenseQueryResult<\n TQueryFnData,\n unknown extends TError ? DefaultError : TError\n >\n : // Fallback\n UseSuspenseQueryResult\n\n/**\n * SuspenseQueriesOptions reducer recursively unwraps function arguments to infer/enforce type param\n */\nexport type SuspenseQueriesOptions<\n T extends Array,\n TResults extends Array = [],\n TDepth extends ReadonlyArray = [],\n> = TDepth['length'] extends MAXIMUM_DEPTH\n ? Array\n : T extends []\n ? []\n : T extends [infer Head]\n ? [...TResults, GetUseSuspenseQueryOptions]\n : T extends [infer Head, ...infer Tails]\n ? SuspenseQueriesOptions<\n [...Tails],\n [...TResults, GetUseSuspenseQueryOptions],\n [...TDepth, 1]\n >\n : Array extends T\n ? T\n : // If T is *some* array but we couldn't assign unknown[] to it, then it must hold some known/homogenous type!\n // use this to infer the param types in the case of Array.map() argument\n T extends Array<\n UseSuspenseQueryOptions<\n infer TQueryFnData,\n infer TError,\n infer TData,\n infer TQueryKey\n >\n >\n ? Array<\n UseSuspenseQueryOptions\n >\n : // Fallback\n Array\n\n/**\n * SuspenseQueriesResults reducer recursively maps type param to results\n */\nexport type SuspenseQueriesResults<\n T extends Array,\n TResults extends Array = [],\n TDepth extends ReadonlyArray = [],\n> = TDepth['length'] extends MAXIMUM_DEPTH\n ? Array\n : T extends []\n ? []\n : T extends [infer Head]\n ? [...TResults, GetUseSuspenseQueryResult]\n : T extends [infer Head, ...infer Tails]\n ? SuspenseQueriesResults<\n [...Tails],\n [...TResults, GetUseSuspenseQueryResult],\n [...TDepth, 1]\n >\n : { [K in keyof T]: GetUseSuspenseQueryResult }\n\nexport function useSuspenseQueries<\n T extends Array,\n TCombinedResult = SuspenseQueriesResults,\n>(\n options: {\n queries:\n | readonly [...SuspenseQueriesOptions]\n | readonly [...{ [K in keyof T]: GetUseSuspenseQueryOptions }]\n combine?: (result: SuspenseQueriesResults) => TCombinedResult\n },\n queryClient?: QueryClient,\n): TCombinedResult\n\nexport function useSuspenseQueries<\n T extends Array,\n TCombinedResult = SuspenseQueriesResults,\n>(\n options: {\n queries: readonly [...SuspenseQueriesOptions]\n combine?: (result: SuspenseQueriesResults) => TCombinedResult\n },\n queryClient?: QueryClient,\n): TCombinedResult\n\nexport function useSuspenseQueries(options: any, queryClient?: QueryClient) {\n return useQueries(\n {\n ...options,\n queries: options.queries.map((query: any) => {\n if (process.env.NODE_ENV !== 'production') {\n if (query.queryFn === skipToken) {\n console.error('skipToken is not allowed for useSuspenseQueries')\n }\n }\n\n return {\n ...query,\n suspense: true,\n throwOnError: defaultThrowOnError,\n enabled: true,\n placeholderData: undefined,\n }\n }),\n },\n queryClient,\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,wBAA0B;AAC1B,wBAA2B;AAC3B,sBAAoC;AAyL7B,SAAS,mBAAmB,SAAc,aAA2B;AAC1E,aAAO;AAAA,IACL;AAAA,MACE,GAAG;AAAA,MACH,SAAS,QAAQ,QAAQ,IAAI,CAAC,UAAe;AAC3C,YAAI,QAAQ,IAAI,aAAa,cAAc;AACzC,cAAI,MAAM,YAAY,6BAAW;AAC/B,oBAAQ,MAAM,iDAAiD;AAAA,UACjE;AAAA,QACF;AAEA,eAAO;AAAA,UACL,GAAG;AAAA,UACH,UAAU;AAAA,UACV,cAAc;AAAA,UACd,SAAS;AAAA,UACT,iBAAiB;AAAA,QACnB;AAAA,MACF,CAAC;AAAA,IACH;AAAA,IACA;AAAA,EACF;AACF;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/useSuspenseQueries.d.cts b/node_modules/@tanstack/react-query/build/modern/useSuspenseQueries.d.cts deleted file mode 100644 index f3f9618..0000000 --- a/node_modules/@tanstack/react-query/build/modern/useSuspenseQueries.d.cts +++ /dev/null @@ -1,79 +0,0 @@ -import { UseSuspenseQueryOptions, UseSuspenseQueryResult } from './types.cjs'; -import { QueryFunction, ThrowOnError, DefaultError, QueryClient } from '@tanstack/query-core'; - -type MAXIMUM_DEPTH = 20; -type SkipTokenForUseQueries = symbol; -type GetUseSuspenseQueryOptions = T extends { - queryFnData: infer TQueryFnData; - error?: infer TError; - data: infer TData; -} ? UseSuspenseQueryOptions : T extends { - queryFnData: infer TQueryFnData; - error?: infer TError; -} ? UseSuspenseQueryOptions : T extends { - data: infer TData; - error?: infer TError; -} ? UseSuspenseQueryOptions : T extends [infer TQueryFnData, infer TError, infer TData] ? UseSuspenseQueryOptions : T extends [infer TQueryFnData, infer TError] ? UseSuspenseQueryOptions : T extends [infer TQueryFnData] ? UseSuspenseQueryOptions : T extends { - queryFn?: QueryFunction | SkipTokenForUseQueries; - select?: (data: any) => infer TData; - throwOnError?: ThrowOnError; -} ? UseSuspenseQueryOptions : T extends { - queryFn?: QueryFunction | SkipTokenForUseQueries; - throwOnError?: ThrowOnError; -} ? UseSuspenseQueryOptions : UseSuspenseQueryOptions; -type GetUseSuspenseQueryResult = T extends { - queryFnData: any; - error?: infer TError; - data: infer TData; -} ? UseSuspenseQueryResult : T extends { - queryFnData: infer TQueryFnData; - error?: infer TError; -} ? UseSuspenseQueryResult : T extends { - data: infer TData; - error?: infer TError; -} ? UseSuspenseQueryResult : T extends [any, infer TError, infer TData] ? UseSuspenseQueryResult : T extends [infer TQueryFnData, infer TError] ? UseSuspenseQueryResult : T extends [infer TQueryFnData] ? UseSuspenseQueryResult : T extends { - queryFn?: QueryFunction | SkipTokenForUseQueries; - select?: (data: any) => infer TData; - throwOnError?: ThrowOnError; -} ? UseSuspenseQueryResult : T extends { - queryFn?: QueryFunction | SkipTokenForUseQueries; - throwOnError?: ThrowOnError; -} ? UseSuspenseQueryResult : UseSuspenseQueryResult; -/** - * SuspenseQueriesOptions reducer recursively unwraps function arguments to infer/enforce type param - */ -type SuspenseQueriesOptions, TResults extends Array = [], TDepth extends ReadonlyArray = []> = TDepth['length'] extends MAXIMUM_DEPTH ? Array : T extends [] ? [] : T extends [infer Head] ? [...TResults, GetUseSuspenseQueryOptions] : T extends [infer Head, ...infer Tails] ? SuspenseQueriesOptions<[ - ...Tails -], [ - ...TResults, - GetUseSuspenseQueryOptions -], [ - ...TDepth, - 1 -]> : Array extends T ? T : T extends Array> ? Array> : Array; -/** - * SuspenseQueriesResults reducer recursively maps type param to results - */ -type SuspenseQueriesResults, TResults extends Array = [], TDepth extends ReadonlyArray = []> = TDepth['length'] extends MAXIMUM_DEPTH ? Array : T extends [] ? [] : T extends [infer Head] ? [...TResults, GetUseSuspenseQueryResult] : T extends [infer Head, ...infer Tails] ? SuspenseQueriesResults<[ - ...Tails -], [ - ...TResults, - GetUseSuspenseQueryResult -], [ - ...TDepth, - 1 -]> : { - [K in keyof T]: GetUseSuspenseQueryResult; -}; -declare function useSuspenseQueries, TCombinedResult = SuspenseQueriesResults>(options: { - queries: readonly [...SuspenseQueriesOptions] | readonly [...{ - [K in keyof T]: GetUseSuspenseQueryOptions; - }]; - combine?: (result: SuspenseQueriesResults) => TCombinedResult; -}, queryClient?: QueryClient): TCombinedResult; -declare function useSuspenseQueries, TCombinedResult = SuspenseQueriesResults>(options: { - queries: readonly [...SuspenseQueriesOptions]; - combine?: (result: SuspenseQueriesResults) => TCombinedResult; -}, queryClient?: QueryClient): TCombinedResult; - -export { type SuspenseQueriesOptions, type SuspenseQueriesResults, useSuspenseQueries }; diff --git a/node_modules/@tanstack/react-query/build/modern/useSuspenseQueries.d.ts b/node_modules/@tanstack/react-query/build/modern/useSuspenseQueries.d.ts deleted file mode 100644 index 300e26f..0000000 --- a/node_modules/@tanstack/react-query/build/modern/useSuspenseQueries.d.ts +++ /dev/null @@ -1,79 +0,0 @@ -import { UseSuspenseQueryOptions, UseSuspenseQueryResult } from './types.js'; -import { QueryFunction, ThrowOnError, DefaultError, QueryClient } from '@tanstack/query-core'; - -type MAXIMUM_DEPTH = 20; -type SkipTokenForUseQueries = symbol; -type GetUseSuspenseQueryOptions = T extends { - queryFnData: infer TQueryFnData; - error?: infer TError; - data: infer TData; -} ? UseSuspenseQueryOptions : T extends { - queryFnData: infer TQueryFnData; - error?: infer TError; -} ? UseSuspenseQueryOptions : T extends { - data: infer TData; - error?: infer TError; -} ? UseSuspenseQueryOptions : T extends [infer TQueryFnData, infer TError, infer TData] ? UseSuspenseQueryOptions : T extends [infer TQueryFnData, infer TError] ? UseSuspenseQueryOptions : T extends [infer TQueryFnData] ? UseSuspenseQueryOptions : T extends { - queryFn?: QueryFunction | SkipTokenForUseQueries; - select?: (data: any) => infer TData; - throwOnError?: ThrowOnError; -} ? UseSuspenseQueryOptions : T extends { - queryFn?: QueryFunction | SkipTokenForUseQueries; - throwOnError?: ThrowOnError; -} ? UseSuspenseQueryOptions : UseSuspenseQueryOptions; -type GetUseSuspenseQueryResult = T extends { - queryFnData: any; - error?: infer TError; - data: infer TData; -} ? UseSuspenseQueryResult : T extends { - queryFnData: infer TQueryFnData; - error?: infer TError; -} ? UseSuspenseQueryResult : T extends { - data: infer TData; - error?: infer TError; -} ? UseSuspenseQueryResult : T extends [any, infer TError, infer TData] ? UseSuspenseQueryResult : T extends [infer TQueryFnData, infer TError] ? UseSuspenseQueryResult : T extends [infer TQueryFnData] ? UseSuspenseQueryResult : T extends { - queryFn?: QueryFunction | SkipTokenForUseQueries; - select?: (data: any) => infer TData; - throwOnError?: ThrowOnError; -} ? UseSuspenseQueryResult : T extends { - queryFn?: QueryFunction | SkipTokenForUseQueries; - throwOnError?: ThrowOnError; -} ? UseSuspenseQueryResult : UseSuspenseQueryResult; -/** - * SuspenseQueriesOptions reducer recursively unwraps function arguments to infer/enforce type param - */ -type SuspenseQueriesOptions, TResults extends Array = [], TDepth extends ReadonlyArray = []> = TDepth['length'] extends MAXIMUM_DEPTH ? Array : T extends [] ? [] : T extends [infer Head] ? [...TResults, GetUseSuspenseQueryOptions] : T extends [infer Head, ...infer Tails] ? SuspenseQueriesOptions<[ - ...Tails -], [ - ...TResults, - GetUseSuspenseQueryOptions -], [ - ...TDepth, - 1 -]> : Array extends T ? T : T extends Array> ? Array> : Array; -/** - * SuspenseQueriesResults reducer recursively maps type param to results - */ -type SuspenseQueriesResults, TResults extends Array = [], TDepth extends ReadonlyArray = []> = TDepth['length'] extends MAXIMUM_DEPTH ? Array : T extends [] ? [] : T extends [infer Head] ? [...TResults, GetUseSuspenseQueryResult] : T extends [infer Head, ...infer Tails] ? SuspenseQueriesResults<[ - ...Tails -], [ - ...TResults, - GetUseSuspenseQueryResult -], [ - ...TDepth, - 1 -]> : { - [K in keyof T]: GetUseSuspenseQueryResult; -}; -declare function useSuspenseQueries, TCombinedResult = SuspenseQueriesResults>(options: { - queries: readonly [...SuspenseQueriesOptions] | readonly [...{ - [K in keyof T]: GetUseSuspenseQueryOptions; - }]; - combine?: (result: SuspenseQueriesResults) => TCombinedResult; -}, queryClient?: QueryClient): TCombinedResult; -declare function useSuspenseQueries, TCombinedResult = SuspenseQueriesResults>(options: { - queries: readonly [...SuspenseQueriesOptions]; - combine?: (result: SuspenseQueriesResults) => TCombinedResult; -}, queryClient?: QueryClient): TCombinedResult; - -export { type SuspenseQueriesOptions, type SuspenseQueriesResults, useSuspenseQueries }; diff --git a/node_modules/@tanstack/react-query/build/modern/useSuspenseQueries.js b/node_modules/@tanstack/react-query/build/modern/useSuspenseQueries.js deleted file mode 100644 index a6f0445..0000000 --- a/node_modules/@tanstack/react-query/build/modern/useSuspenseQueries.js +++ /dev/null @@ -1,32 +0,0 @@ -"use client"; - -// src/useSuspenseQueries.ts -import { skipToken } from "@tanstack/query-core"; -import { useQueries } from "./useQueries.js"; -import { defaultThrowOnError } from "./suspense.js"; -function useSuspenseQueries(options, queryClient) { - return useQueries( - { - ...options, - queries: options.queries.map((query) => { - if (process.env.NODE_ENV !== "production") { - if (query.queryFn === skipToken) { - console.error("skipToken is not allowed for useSuspenseQueries"); - } - } - return { - ...query, - suspense: true, - throwOnError: defaultThrowOnError, - enabled: true, - placeholderData: void 0 - }; - }) - }, - queryClient - ); -} -export { - useSuspenseQueries -}; -//# sourceMappingURL=useSuspenseQueries.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/useSuspenseQueries.js.map b/node_modules/@tanstack/react-query/build/modern/useSuspenseQueries.js.map deleted file mode 100644 index ee09004..0000000 --- a/node_modules/@tanstack/react-query/build/modern/useSuspenseQueries.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/useSuspenseQueries.ts"],"sourcesContent":["'use client'\nimport { skipToken } from '@tanstack/query-core'\nimport { useQueries } from './useQueries'\nimport { defaultThrowOnError } from './suspense'\nimport type { UseSuspenseQueryOptions, UseSuspenseQueryResult } from './types'\nimport type {\n DefaultError,\n QueryClient,\n QueryFunction,\n ThrowOnError,\n} from '@tanstack/query-core'\n\n// Avoid TS depth-limit error in case of large array literal\ntype MAXIMUM_DEPTH = 20\n\n// Widen the type of the symbol to enable type inference even if skipToken is not immutable.\ntype SkipTokenForUseQueries = symbol\n\ntype GetUseSuspenseQueryOptions =\n // Part 1: responsible for applying explicit type parameter to function arguments, if object { queryFnData: TQueryFnData, error: TError, data: TData }\n T extends {\n queryFnData: infer TQueryFnData\n error?: infer TError\n data: infer TData\n }\n ? UseSuspenseQueryOptions\n : T extends { queryFnData: infer TQueryFnData; error?: infer TError }\n ? UseSuspenseQueryOptions\n : T extends { data: infer TData; error?: infer TError }\n ? UseSuspenseQueryOptions\n : // Part 2: responsible for applying explicit type parameter to function arguments, if tuple [TQueryFnData, TError, TData]\n T extends [infer TQueryFnData, infer TError, infer TData]\n ? UseSuspenseQueryOptions\n : T extends [infer TQueryFnData, infer TError]\n ? UseSuspenseQueryOptions\n : T extends [infer TQueryFnData]\n ? UseSuspenseQueryOptions\n : // Part 3: responsible for inferring and enforcing type if no explicit parameter was provided\n T extends {\n queryFn?:\n | QueryFunction\n | SkipTokenForUseQueries\n select?: (data: any) => infer TData\n throwOnError?: ThrowOnError\n }\n ? UseSuspenseQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey\n >\n : T extends {\n queryFn?:\n | QueryFunction\n | SkipTokenForUseQueries\n throwOnError?: ThrowOnError\n }\n ? UseSuspenseQueryOptions<\n TQueryFnData,\n TError,\n TQueryFnData,\n TQueryKey\n >\n : // Fallback\n UseSuspenseQueryOptions\n\ntype GetUseSuspenseQueryResult =\n // Part 1: responsible for mapping explicit type parameter to function result, if object\n T extends { queryFnData: any; error?: infer TError; data: infer TData }\n ? UseSuspenseQueryResult\n : T extends { queryFnData: infer TQueryFnData; error?: infer TError }\n ? UseSuspenseQueryResult\n : T extends { data: infer TData; error?: infer TError }\n ? UseSuspenseQueryResult\n : // Part 2: responsible for mapping explicit type parameter to function result, if tuple\n T extends [any, infer TError, infer TData]\n ? UseSuspenseQueryResult\n : T extends [infer TQueryFnData, infer TError]\n ? UseSuspenseQueryResult\n : T extends [infer TQueryFnData]\n ? UseSuspenseQueryResult\n : // Part 3: responsible for mapping inferred type to results, if no explicit parameter was provided\n T extends {\n queryFn?:\n | QueryFunction\n | SkipTokenForUseQueries\n select?: (data: any) => infer TData\n throwOnError?: ThrowOnError\n }\n ? UseSuspenseQueryResult<\n unknown extends TData ? TQueryFnData : TData,\n unknown extends TError ? DefaultError : TError\n >\n : T extends {\n queryFn?:\n | QueryFunction\n | SkipTokenForUseQueries\n throwOnError?: ThrowOnError\n }\n ? UseSuspenseQueryResult<\n TQueryFnData,\n unknown extends TError ? DefaultError : TError\n >\n : // Fallback\n UseSuspenseQueryResult\n\n/**\n * SuspenseQueriesOptions reducer recursively unwraps function arguments to infer/enforce type param\n */\nexport type SuspenseQueriesOptions<\n T extends Array,\n TResults extends Array = [],\n TDepth extends ReadonlyArray = [],\n> = TDepth['length'] extends MAXIMUM_DEPTH\n ? Array\n : T extends []\n ? []\n : T extends [infer Head]\n ? [...TResults, GetUseSuspenseQueryOptions]\n : T extends [infer Head, ...infer Tails]\n ? SuspenseQueriesOptions<\n [...Tails],\n [...TResults, GetUseSuspenseQueryOptions],\n [...TDepth, 1]\n >\n : Array extends T\n ? T\n : // If T is *some* array but we couldn't assign unknown[] to it, then it must hold some known/homogenous type!\n // use this to infer the param types in the case of Array.map() argument\n T extends Array<\n UseSuspenseQueryOptions<\n infer TQueryFnData,\n infer TError,\n infer TData,\n infer TQueryKey\n >\n >\n ? Array<\n UseSuspenseQueryOptions\n >\n : // Fallback\n Array\n\n/**\n * SuspenseQueriesResults reducer recursively maps type param to results\n */\nexport type SuspenseQueriesResults<\n T extends Array,\n TResults extends Array = [],\n TDepth extends ReadonlyArray = [],\n> = TDepth['length'] extends MAXIMUM_DEPTH\n ? Array\n : T extends []\n ? []\n : T extends [infer Head]\n ? [...TResults, GetUseSuspenseQueryResult]\n : T extends [infer Head, ...infer Tails]\n ? SuspenseQueriesResults<\n [...Tails],\n [...TResults, GetUseSuspenseQueryResult],\n [...TDepth, 1]\n >\n : { [K in keyof T]: GetUseSuspenseQueryResult }\n\nexport function useSuspenseQueries<\n T extends Array,\n TCombinedResult = SuspenseQueriesResults,\n>(\n options: {\n queries:\n | readonly [...SuspenseQueriesOptions]\n | readonly [...{ [K in keyof T]: GetUseSuspenseQueryOptions }]\n combine?: (result: SuspenseQueriesResults) => TCombinedResult\n },\n queryClient?: QueryClient,\n): TCombinedResult\n\nexport function useSuspenseQueries<\n T extends Array,\n TCombinedResult = SuspenseQueriesResults,\n>(\n options: {\n queries: readonly [...SuspenseQueriesOptions]\n combine?: (result: SuspenseQueriesResults) => TCombinedResult\n },\n queryClient?: QueryClient,\n): TCombinedResult\n\nexport function useSuspenseQueries(options: any, queryClient?: QueryClient) {\n return useQueries(\n {\n ...options,\n queries: options.queries.map((query: any) => {\n if (process.env.NODE_ENV !== 'production') {\n if (query.queryFn === skipToken) {\n console.error('skipToken is not allowed for useSuspenseQueries')\n }\n }\n\n return {\n ...query,\n suspense: true,\n throwOnError: defaultThrowOnError,\n enabled: true,\n placeholderData: undefined,\n }\n }),\n },\n queryClient,\n )\n}\n"],"mappings":";;;AACA,SAAS,iBAAiB;AAC1B,SAAS,kBAAkB;AAC3B,SAAS,2BAA2B;AAyL7B,SAAS,mBAAmB,SAAc,aAA2B;AAC1E,SAAO;AAAA,IACL;AAAA,MACE,GAAG;AAAA,MACH,SAAS,QAAQ,QAAQ,IAAI,CAAC,UAAe;AAC3C,YAAI,QAAQ,IAAI,aAAa,cAAc;AACzC,cAAI,MAAM,YAAY,WAAW;AAC/B,oBAAQ,MAAM,iDAAiD;AAAA,UACjE;AAAA,QACF;AAEA,eAAO;AAAA,UACL,GAAG;AAAA,UACH,UAAU;AAAA,UACV,cAAc;AAAA,UACd,SAAS;AAAA,UACT,iBAAiB;AAAA,QACnB;AAAA,MACF,CAAC;AAAA,IACH;AAAA,IACA;AAAA,EACF;AACF;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/useSuspenseQuery.cjs b/node_modules/@tanstack/react-query/build/modern/useSuspenseQuery.cjs deleted file mode 100644 index dcf18a2..0000000 --- a/node_modules/@tanstack/react-query/build/modern/useSuspenseQuery.cjs +++ /dev/null @@ -1,52 +0,0 @@ -"use strict"; -"use client"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// src/useSuspenseQuery.ts -var useSuspenseQuery_exports = {}; -__export(useSuspenseQuery_exports, { - useSuspenseQuery: () => useSuspenseQuery -}); -module.exports = __toCommonJS(useSuspenseQuery_exports); -var import_query_core = require("@tanstack/query-core"); -var import_useBaseQuery = require("./useBaseQuery.cjs"); -var import_suspense = require("./suspense.cjs"); -function useSuspenseQuery(options, queryClient) { - if (process.env.NODE_ENV !== "production") { - if (options.queryFn === import_query_core.skipToken) { - console.error("skipToken is not allowed for useSuspenseQuery"); - } - } - return (0, import_useBaseQuery.useBaseQuery)( - { - ...options, - enabled: true, - suspense: true, - throwOnError: import_suspense.defaultThrowOnError, - placeholderData: void 0 - }, - import_query_core.QueryObserver, - queryClient - ); -} -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - useSuspenseQuery -}); -//# sourceMappingURL=useSuspenseQuery.cjs.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/useSuspenseQuery.cjs.map b/node_modules/@tanstack/react-query/build/modern/useSuspenseQuery.cjs.map deleted file mode 100644 index c456860..0000000 --- a/node_modules/@tanstack/react-query/build/modern/useSuspenseQuery.cjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/useSuspenseQuery.ts"],"sourcesContent":["'use client'\nimport { QueryObserver, skipToken } from '@tanstack/query-core'\nimport { useBaseQuery } from './useBaseQuery'\nimport { defaultThrowOnError } from './suspense'\nimport type { UseSuspenseQueryOptions, UseSuspenseQueryResult } from './types'\nimport type { DefaultError, QueryClient, QueryKey } from '@tanstack/query-core'\n\nexport function useSuspenseQuery<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n options: UseSuspenseQueryOptions,\n queryClient?: QueryClient,\n): UseSuspenseQueryResult {\n if (process.env.NODE_ENV !== 'production') {\n if ((options.queryFn as any) === skipToken) {\n console.error('skipToken is not allowed for useSuspenseQuery')\n }\n }\n\n return useBaseQuery(\n {\n ...options,\n enabled: true,\n suspense: true,\n throwOnError: defaultThrowOnError,\n placeholderData: undefined,\n },\n QueryObserver,\n queryClient,\n ) as UseSuspenseQueryResult\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,wBAAyC;AACzC,0BAA6B;AAC7B,sBAAoC;AAI7B,SAAS,iBAMd,SACA,aACuC;AACvC,MAAI,QAAQ,IAAI,aAAa,cAAc;AACzC,QAAK,QAAQ,YAAoB,6BAAW;AAC1C,cAAQ,MAAM,+CAA+C;AAAA,IAC/D;AAAA,EACF;AAEA,aAAO;AAAA,IACL;AAAA,MACE,GAAG;AAAA,MACH,SAAS;AAAA,MACT,UAAU;AAAA,MACV,cAAc;AAAA,MACd,iBAAiB;AAAA,IACnB;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/useSuspenseQuery.d.cts b/node_modules/@tanstack/react-query/build/modern/useSuspenseQuery.d.cts deleted file mode 100644 index b2e662e..0000000 --- a/node_modules/@tanstack/react-query/build/modern/useSuspenseQuery.d.cts +++ /dev/null @@ -1,6 +0,0 @@ -import { UseSuspenseQueryOptions, UseSuspenseQueryResult } from './types.cjs'; -import { DefaultError, QueryKey, QueryClient } from '@tanstack/query-core'; - -declare function useSuspenseQuery(options: UseSuspenseQueryOptions, queryClient?: QueryClient): UseSuspenseQueryResult; - -export { useSuspenseQuery }; diff --git a/node_modules/@tanstack/react-query/build/modern/useSuspenseQuery.d.ts b/node_modules/@tanstack/react-query/build/modern/useSuspenseQuery.d.ts deleted file mode 100644 index f53bc83..0000000 --- a/node_modules/@tanstack/react-query/build/modern/useSuspenseQuery.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { UseSuspenseQueryOptions, UseSuspenseQueryResult } from './types.js'; -import { DefaultError, QueryKey, QueryClient } from '@tanstack/query-core'; - -declare function useSuspenseQuery(options: UseSuspenseQueryOptions, queryClient?: QueryClient): UseSuspenseQueryResult; - -export { useSuspenseQuery }; diff --git a/node_modules/@tanstack/react-query/build/modern/useSuspenseQuery.js b/node_modules/@tanstack/react-query/build/modern/useSuspenseQuery.js deleted file mode 100644 index 98296da..0000000 --- a/node_modules/@tanstack/react-query/build/modern/useSuspenseQuery.js +++ /dev/null @@ -1,28 +0,0 @@ -"use client"; - -// src/useSuspenseQuery.ts -import { QueryObserver, skipToken } from "@tanstack/query-core"; -import { useBaseQuery } from "./useBaseQuery.js"; -import { defaultThrowOnError } from "./suspense.js"; -function useSuspenseQuery(options, queryClient) { - if (process.env.NODE_ENV !== "production") { - if (options.queryFn === skipToken) { - console.error("skipToken is not allowed for useSuspenseQuery"); - } - } - return useBaseQuery( - { - ...options, - enabled: true, - suspense: true, - throwOnError: defaultThrowOnError, - placeholderData: void 0 - }, - QueryObserver, - queryClient - ); -} -export { - useSuspenseQuery -}; -//# sourceMappingURL=useSuspenseQuery.js.map \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/modern/useSuspenseQuery.js.map b/node_modules/@tanstack/react-query/build/modern/useSuspenseQuery.js.map deleted file mode 100644 index 2d96142..0000000 --- a/node_modules/@tanstack/react-query/build/modern/useSuspenseQuery.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/useSuspenseQuery.ts"],"sourcesContent":["'use client'\nimport { QueryObserver, skipToken } from '@tanstack/query-core'\nimport { useBaseQuery } from './useBaseQuery'\nimport { defaultThrowOnError } from './suspense'\nimport type { UseSuspenseQueryOptions, UseSuspenseQueryResult } from './types'\nimport type { DefaultError, QueryClient, QueryKey } from '@tanstack/query-core'\n\nexport function useSuspenseQuery<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n options: UseSuspenseQueryOptions,\n queryClient?: QueryClient,\n): UseSuspenseQueryResult {\n if (process.env.NODE_ENV !== 'production') {\n if ((options.queryFn as any) === skipToken) {\n console.error('skipToken is not allowed for useSuspenseQuery')\n }\n }\n\n return useBaseQuery(\n {\n ...options,\n enabled: true,\n suspense: true,\n throwOnError: defaultThrowOnError,\n placeholderData: undefined,\n },\n QueryObserver,\n queryClient,\n ) as UseSuspenseQueryResult\n}\n"],"mappings":";;;AACA,SAAS,eAAe,iBAAiB;AACzC,SAAS,oBAAoB;AAC7B,SAAS,2BAA2B;AAI7B,SAAS,iBAMd,SACA,aACuC;AACvC,MAAI,QAAQ,IAAI,aAAa,cAAc;AACzC,QAAK,QAAQ,YAAoB,WAAW;AAC1C,cAAQ,MAAM,+CAA+C;AAAA,IAC/D;AAAA,EACF;AAEA,SAAO;AAAA,IACL;AAAA,MACE,GAAG;AAAA,MACH,SAAS;AAAA,MACT,UAAU;AAAA,MACV,cAAc;AAAA,MACd,iBAAiB;AAAA,IACnB;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;","names":[]} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/build/query-codemods/eslint.config.js b/node_modules/@tanstack/react-query/build/query-codemods/eslint.config.js deleted file mode 100644 index c3c009f..0000000 --- a/node_modules/@tanstack/react-query/build/query-codemods/eslint.config.js +++ /dev/null @@ -1,18 +0,0 @@ -// @ts-check - -import rootConfig from './root.eslint.config.js' - -export default [ - ...rootConfig, - { - rules: { - 'cspell/spellchecker': 'off', - '@typescript-eslint/no-unnecessary-condition': 'off', - 'import/no-duplicates': 'off', - 'import/no-unresolved': 'off', - 'import/order': 'off', - 'no-shadow': 'off', - 'sort-imports': 'off', - }, - }, -] diff --git a/node_modules/@tanstack/react-query/build/query-codemods/package.json b/node_modules/@tanstack/react-query/build/query-codemods/package.json deleted file mode 100644 index fd78665..0000000 --- a/node_modules/@tanstack/react-query/build/query-codemods/package.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "name": "@tanstack/query-codemods", - "private": true, - "description": "Collection of codemods to make the migration easier.", - "author": "Balázs Máté Petró", - "license": "MIT", - "repository": { - "type": "git", - "url": "git+https://github.com/TanStack/query.git", - "directory": "packages/query-codemods" - }, - "homepage": "https://tanstack.com/query", - "funding": { - "type": "github", - "url": "https://github.com/sponsors/tannerlinsley" - }, - "scripts": { - "clean": "premove ./coverage ./dist-ts", - "test:eslint": "eslint --concurrency=auto ./src", - "test:lib": "vitest", - "test:lib:dev": "pnpm run test:lib --watch" - }, - "type": "module", - "exports": { - "./package.json": "./package.json" - }, - "sideEffects": false, - "files": [ - "src", - "!src/jest.config.js", - "!src/**/__testfixtures__", - "!src/**/__tests__" - ], - "devDependencies": { - "@types/jscodeshift": "17.3.0", - "jscodeshift": "17.3.0" - } -} diff --git a/node_modules/@tanstack/react-query/build/query-codemods/root.eslint.config.js b/node_modules/@tanstack/react-query/build/query-codemods/root.eslint.config.js deleted file mode 100644 index d9a08b8..0000000 --- a/node_modules/@tanstack/react-query/build/query-codemods/root.eslint.config.js +++ /dev/null @@ -1,64 +0,0 @@ -// @ts-check - -// @ts-ignore Needed due to moduleResolution Node vs Bundler -import { tanstackConfig } from '@tanstack/eslint-config' -import pluginCspell from '@cspell/eslint-plugin' -import vitest from '@vitest/eslint-plugin' - -export default [ - ...tanstackConfig, - { - name: 'tanstack/temp', - plugins: { - cspell: pluginCspell, - }, - rules: { - 'cspell/spellchecker': [ - 'warn', - { - cspell: { - words: [ - 'Promisable', // Our public interface - 'TSES', // @typescript-eslint package's interface - 'codemod', // We support our codemod - 'combinate', // Library name - 'datatag', // Query options tagging - 'extralight', // Our public interface - 'jscodeshift', - 'refetches', // Query refetch operations - 'retryer', // Our public interface - 'solidjs', // Our target framework - 'tabular-nums', // https://developer.mozilla.org/en-US/docs/Web/CSS/font-variant-numeric - 'tanstack', // Our package scope - 'todos', // Too general word to be caught as error - 'tsqd', // Our public interface (TanStack Query Devtools shorthand) - 'tsup', // We use tsup as builder - 'typecheck', // Field of vite.config.ts - 'vue-demi', // dependency of @tanstack/vue-query - 'ɵkind', // Angular specific - 'ɵproviders', // Angular specific - ], - }, - }, - ], - '@typescript-eslint/no-empty-function': 'off', - '@typescript-eslint/no-unsafe-function-type': 'off', - 'no-case-declarations': 'off', - 'prefer-const': 'off', - }, - }, - { - files: ['**/*.spec.ts*', '**/*.test.ts*', '**/*.test-d.ts*'], - plugins: { vitest }, - rules: { - ...vitest.configs.recommended.rules, - 'vitest/no-standalone-expect': [ - 'error', - { - additionalTestBlockFunctions: ['testIf'], - }, - ], - }, - settings: { vitest: { typecheck: true } }, - }, -] diff --git a/node_modules/@tanstack/react-query/build/query-codemods/tsconfig.json b/node_modules/@tanstack/react-query/build/query-codemods/tsconfig.json deleted file mode 100644 index bcd89cd..0000000 --- a/node_modules/@tanstack/react-query/build/query-codemods/tsconfig.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "extends": "../../tsconfig.json", - "compilerOptions": { - "outDir": "./dist-ts", - "rootDir": "." - }, - "include": ["src", "*.config.*", "package.json"] -} diff --git a/node_modules/@tanstack/react-query/build/query-codemods/vite.config.ts b/node_modules/@tanstack/react-query/build/query-codemods/vite.config.ts deleted file mode 100644 index bd580e8..0000000 --- a/node_modules/@tanstack/react-query/build/query-codemods/vite.config.ts +++ /dev/null @@ -1,30 +0,0 @@ -import { defineConfig } from 'vitest/config' - -import packageJson from './package.json' - -export default defineConfig({ - // fix from https://github.com/vitest-dev/vitest/issues/6992#issuecomment-2509408660 - resolve: { - conditions: ['@tanstack/custom-condition'], - }, - environments: { - ssr: { - resolve: { - conditions: ['@tanstack/custom-condition'], - }, - }, - }, - test: { - name: packageJson.name, - dir: './src', - watch: false, - globals: true, - coverage: { - enabled: true, - provider: 'istanbul', - include: ['src/**/*.{js,ts,cjs,mjs,jsx,tsx}'], - }, - typecheck: { enabled: true }, - restoreMocks: true, - }, -}) diff --git a/node_modules/@tanstack/react-query/package.json b/node_modules/@tanstack/react-query/package.json deleted file mode 100644 index 245d535..0000000 --- a/node_modules/@tanstack/react-query/package.json +++ /dev/null @@ -1,87 +0,0 @@ -{ - "name": "@tanstack/react-query", - "version": "5.90.21", - "description": "Hooks for managing, caching and syncing asynchronous and remote data in React", - "author": "tannerlinsley", - "license": "MIT", - "repository": { - "type": "git", - "url": "git+https://github.com/TanStack/query.git", - "directory": "packages/react-query" - }, - "homepage": "https://tanstack.com/query", - "funding": { - "type": "github", - "url": "https://github.com/sponsors/tannerlinsley" - }, - "type": "module", - "types": "build/legacy/index.d.ts", - "main": "build/legacy/index.cjs", - "module": "build/legacy/index.js", - "react-native": "src/index.ts", - "exports": { - ".": { - "@tanstack/custom-condition": "./src/index.ts", - "import": { - "types": "./build/modern/index.d.ts", - "default": "./build/modern/index.js" - }, - "require": { - "types": "./build/modern/index.d.cts", - "default": "./build/modern/index.cjs" - } - }, - "./package.json": "./package.json" - }, - "sideEffects": false, - "files": [ - "build", - "src", - "!src/__tests__", - "!build/codemods/node_modules", - "!build/codemods/vite.config.ts", - "!build/codemods/**/__testfixtures__", - "!build/codemods/**/__tests__" - ], - "dependencies": { - "@tanstack/query-core": "5.90.20" - }, - "devDependencies": { - "@testing-library/react": "^16.1.0", - "@testing-library/react-render-stream": "^2.0.2", - "@types/react": "^19.2.7", - "@types/react-dom": "^19.2.3", - "@vitejs/plugin-react": "^4.3.4", - "cpy-cli": "^5.0.0", - "npm-run-all2": "^5.0.0", - "react": "^19.2.1", - "react-dom": "^19.2.1", - "react-error-boundary": "^4.1.2", - "@tanstack/query-persist-client-core": "5.91.19", - "@tanstack/query-test-utils": "0.0.0" - }, - "peerDependencies": { - "react": "^18 || ^19" - }, - "scripts": { - "clean": "premove ./build ./coverage ./dist-ts", - "compile": "tsc --build", - "test:eslint": "eslint --concurrency=auto ./src", - "test:types": "npm-run-all --serial test:types:*", - "test:types:ts50": "node ../../node_modules/typescript50/lib/tsc.js --build tsconfig.legacy.json", - "test:types:ts51": "node ../../node_modules/typescript51/lib/tsc.js --build tsconfig.legacy.json", - "test:types:ts52": "node ../../node_modules/typescript52/lib/tsc.js --build tsconfig.legacy.json", - "test:types:ts53": "node ../../node_modules/typescript53/lib/tsc.js --build tsconfig.legacy.json", - "test:types:ts54": "node ../../node_modules/typescript54/lib/tsc.js --build tsconfig.legacy.json", - "test:types:ts55": "node ../../node_modules/typescript55/lib/tsc.js --build tsconfig.legacy.json", - "test:types:ts56": "node ../../node_modules/typescript56/lib/tsc.js --build tsconfig.legacy.json", - "test:types:ts57": "node ../../node_modules/typescript57/lib/tsc.js --build tsconfig.legacy.json", - "test:types:tscurrent": "tsc --build", - "test:lib": "vitest", - "test:lib:dev": "pnpm run test:lib --watch", - "test:build": "publint --strict && attw --pack", - "build": "pnpm build:tsup && pnpm build:codemods", - "build:tsup": "tsup --tsconfig tsconfig.prod.json", - "build:codemods": "cpy ../query-codemods/* ./build/codemods" - } -} \ No newline at end of file diff --git a/node_modules/@tanstack/react-query/src/HydrationBoundary.tsx b/node_modules/@tanstack/react-query/src/HydrationBoundary.tsx deleted file mode 100644 index 901c8e9..0000000 --- a/node_modules/@tanstack/react-query/src/HydrationBoundary.tsx +++ /dev/null @@ -1,111 +0,0 @@ -'use client' -import * as React from 'react' - -import { hydrate } from '@tanstack/query-core' -import { useQueryClient } from './QueryClientProvider' -import type { - DehydratedState, - HydrateOptions, - OmitKeyof, - QueryClient, -} from '@tanstack/query-core' - -export interface HydrationBoundaryProps { - state: DehydratedState | null | undefined - options?: OmitKeyof & { - defaultOptions?: OmitKeyof< - Exclude, - 'mutations' - > - } - children?: React.ReactNode - queryClient?: QueryClient -} - -export const HydrationBoundary = ({ - children, - options = {}, - state, - queryClient, -}: HydrationBoundaryProps) => { - const client = useQueryClient(queryClient) - - const optionsRef = React.useRef(options) - React.useEffect(() => { - optionsRef.current = options - }) - - // This useMemo is for performance reasons only, everything inside it must - // be safe to run in every render and code here should be read as "in render". - // - // This code needs to happen during the render phase, because after initial - // SSR, hydration needs to happen _before_ children render. Also, if hydrating - // during a transition, we want to hydrate as much as is safe in render so - // we can prerender as much as possible. - // - // For any queries that already exist in the cache, we want to hold back on - // hydrating until _after_ the render phase. The reason for this is that during - // transitions, we don't want the existing queries and observers to update to - // the new data on the current page, only _after_ the transition is committed. - // If the transition is aborted, we will have hydrated any _new_ queries, but - // we throw away the fresh data for any existing ones to avoid unexpectedly - // updating the UI. - const hydrationQueue: DehydratedState['queries'] | undefined = - React.useMemo(() => { - if (state) { - if (typeof state !== 'object') { - return - } - - const queryCache = client.getQueryCache() - // State is supplied from the outside and we might as well fail - // gracefully if it has the wrong shape, so while we type `queries` - // as required, we still provide a fallback. - // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition - const queries = state.queries || [] - - const newQueries: DehydratedState['queries'] = [] - const existingQueries: DehydratedState['queries'] = [] - for (const dehydratedQuery of queries) { - const existingQuery = queryCache.get(dehydratedQuery.queryHash) - - if (!existingQuery) { - newQueries.push(dehydratedQuery) - } else { - const hydrationIsNewer = - dehydratedQuery.state.dataUpdatedAt > - existingQuery.state.dataUpdatedAt || - (dehydratedQuery.promise && - existingQuery.state.status !== 'pending' && - existingQuery.state.fetchStatus !== 'fetching' && - dehydratedQuery.dehydratedAt !== undefined && - dehydratedQuery.dehydratedAt > - existingQuery.state.dataUpdatedAt) - - if (hydrationIsNewer) { - existingQueries.push(dehydratedQuery) - } - } - } - - if (newQueries.length > 0) { - // It's actually fine to call this with queries/state that already exists - // in the cache, or is older. hydrate() is idempotent for queries. - // eslint-disable-next-line react-hooks/refs - hydrate(client, { queries: newQueries }, optionsRef.current) - } - if (existingQueries.length > 0) { - return existingQueries - } - } - return undefined - }, [client, state]) - - React.useEffect(() => { - if (hydrationQueue) { - hydrate(client, { queries: hydrationQueue }, optionsRef.current) - } - }, [client, hydrationQueue]) - - return children as React.ReactElement -} diff --git a/node_modules/@tanstack/react-query/src/IsRestoringProvider.ts b/node_modules/@tanstack/react-query/src/IsRestoringProvider.ts deleted file mode 100644 index 7d59c72..0000000 --- a/node_modules/@tanstack/react-query/src/IsRestoringProvider.ts +++ /dev/null @@ -1,7 +0,0 @@ -'use client' -import * as React from 'react' - -const IsRestoringContext = React.createContext(false) - -export const useIsRestoring = () => React.useContext(IsRestoringContext) -export const IsRestoringProvider = IsRestoringContext.Provider diff --git a/node_modules/@tanstack/react-query/src/QueryClientProvider.tsx b/node_modules/@tanstack/react-query/src/QueryClientProvider.tsx deleted file mode 100644 index 7fa1df9..0000000 --- a/node_modules/@tanstack/react-query/src/QueryClientProvider.tsx +++ /dev/null @@ -1,45 +0,0 @@ -'use client' -import * as React from 'react' - -import type { QueryClient } from '@tanstack/query-core' - -export const QueryClientContext = React.createContext( - undefined, -) - -export const useQueryClient = (queryClient?: QueryClient) => { - const client = React.useContext(QueryClientContext) - - if (queryClient) { - return queryClient - } - - if (!client) { - throw new Error('No QueryClient set, use QueryClientProvider to set one') - } - - return client -} - -export type QueryClientProviderProps = { - client: QueryClient - children?: React.ReactNode -} - -export const QueryClientProvider = ({ - client, - children, -}: QueryClientProviderProps): React.JSX.Element => { - React.useEffect(() => { - client.mount() - return () => { - client.unmount() - } - }, [client]) - - return ( - - {children} - - ) -} diff --git a/node_modules/@tanstack/react-query/src/QueryErrorResetBoundary.tsx b/node_modules/@tanstack/react-query/src/QueryErrorResetBoundary.tsx deleted file mode 100644 index 910215b..0000000 --- a/node_modules/@tanstack/react-query/src/QueryErrorResetBoundary.tsx +++ /dev/null @@ -1,56 +0,0 @@ -'use client' -import * as React from 'react' - -// CONTEXT -export type QueryErrorResetFunction = () => void -export type QueryErrorIsResetFunction = () => boolean -export type QueryErrorClearResetFunction = () => void - -export interface QueryErrorResetBoundaryValue { - clearReset: QueryErrorClearResetFunction - isReset: QueryErrorIsResetFunction - reset: QueryErrorResetFunction -} - -function createValue(): QueryErrorResetBoundaryValue { - let isReset = false - return { - clearReset: () => { - isReset = false - }, - reset: () => { - isReset = true - }, - isReset: () => { - return isReset - }, - } -} - -const QueryErrorResetBoundaryContext = React.createContext(createValue()) - -// HOOK - -export const useQueryErrorResetBoundary = () => - React.useContext(QueryErrorResetBoundaryContext) - -// COMPONENT - -export type QueryErrorResetBoundaryFunction = ( - value: QueryErrorResetBoundaryValue, -) => React.ReactNode - -export interface QueryErrorResetBoundaryProps { - children: QueryErrorResetBoundaryFunction | React.ReactNode -} - -export const QueryErrorResetBoundary = ({ - children, -}: QueryErrorResetBoundaryProps) => { - const [value] = React.useState(() => createValue()) - return ( - - {typeof children === 'function' ? children(value) : children} - - ) -} diff --git a/node_modules/@tanstack/react-query/src/errorBoundaryUtils.ts b/node_modules/@tanstack/react-query/src/errorBoundaryUtils.ts deleted file mode 100644 index 734cc74..0000000 --- a/node_modules/@tanstack/react-query/src/errorBoundaryUtils.ts +++ /dev/null @@ -1,82 +0,0 @@ -'use client' -import * as React from 'react' -import { shouldThrowError } from '@tanstack/query-core' -import type { - DefaultedQueryObserverOptions, - Query, - QueryKey, - QueryObserverResult, - ThrowOnError, -} from '@tanstack/query-core' -import type { QueryErrorResetBoundaryValue } from './QueryErrorResetBoundary' - -export const ensurePreventErrorBoundaryRetry = < - TQueryFnData, - TError, - TData, - TQueryData, - TQueryKey extends QueryKey, ->( - options: DefaultedQueryObserverOptions< - TQueryFnData, - TError, - TData, - TQueryData, - TQueryKey - >, - errorResetBoundary: QueryErrorResetBoundaryValue, - query: Query | undefined, -) => { - const throwOnError = - query?.state.error && typeof options.throwOnError === 'function' - ? shouldThrowError(options.throwOnError, [query.state.error, query]) - : options.throwOnError - - if ( - options.suspense || - options.experimental_prefetchInRender || - throwOnError - ) { - // Prevent retrying failed query if the error boundary has not been reset yet - if (!errorResetBoundary.isReset()) { - options.retryOnMount = false - } - } -} - -export const useClearResetErrorBoundary = ( - errorResetBoundary: QueryErrorResetBoundaryValue, -) => { - React.useEffect(() => { - errorResetBoundary.clearReset() - }, [errorResetBoundary]) -} - -export const getHasError = < - TData, - TError, - TQueryFnData, - TQueryData, - TQueryKey extends QueryKey, ->({ - result, - errorResetBoundary, - throwOnError, - query, - suspense, -}: { - result: QueryObserverResult - errorResetBoundary: QueryErrorResetBoundaryValue - throwOnError: ThrowOnError - query: Query | undefined - suspense: boolean | undefined -}) => { - return ( - result.isError && - !errorResetBoundary.isReset() && - !result.isFetching && - query && - ((suspense && result.data === undefined) || - shouldThrowError(throwOnError, [result.error, query])) - ) -} diff --git a/node_modules/@tanstack/react-query/src/index.ts b/node_modules/@tanstack/react-query/src/index.ts deleted file mode 100644 index 36ea8da..0000000 --- a/node_modules/@tanstack/react-query/src/index.ts +++ /dev/null @@ -1,56 +0,0 @@ -/* istanbul ignore file */ - -// Re-export core -export * from '@tanstack/query-core' - -// React Query -export * from './types' -export { useQueries } from './useQueries' -export type { QueriesResults, QueriesOptions } from './useQueries' -export { useQuery } from './useQuery' -export { useSuspenseQuery } from './useSuspenseQuery' -export { useSuspenseInfiniteQuery } from './useSuspenseInfiniteQuery' -export { useSuspenseQueries } from './useSuspenseQueries' -export type { - SuspenseQueriesResults, - SuspenseQueriesOptions, -} from './useSuspenseQueries' -export { usePrefetchQuery } from './usePrefetchQuery' -export { usePrefetchInfiniteQuery } from './usePrefetchInfiniteQuery' -export { queryOptions } from './queryOptions' -export type { - DefinedInitialDataOptions, - UndefinedInitialDataOptions, - UnusedSkipTokenOptions, -} from './queryOptions' -export { infiniteQueryOptions } from './infiniteQueryOptions' -export type { - DefinedInitialDataInfiniteOptions, - UndefinedInitialDataInfiniteOptions, - UnusedSkipTokenInfiniteOptions, -} from './infiniteQueryOptions' -export { - QueryClientContext, - QueryClientProvider, - useQueryClient, -} from './QueryClientProvider' -export type { QueryClientProviderProps } from './QueryClientProvider' -export type { QueryErrorResetBoundaryProps } from './QueryErrorResetBoundary' -export { HydrationBoundary } from './HydrationBoundary' -export type { HydrationBoundaryProps } from './HydrationBoundary' -export type { - QueryErrorClearResetFunction, - QueryErrorIsResetFunction, - QueryErrorResetBoundaryFunction, - QueryErrorResetFunction, -} from './QueryErrorResetBoundary' -export { - QueryErrorResetBoundary, - useQueryErrorResetBoundary, -} from './QueryErrorResetBoundary' -export { useIsFetching } from './useIsFetching' -export { useIsMutating, useMutationState } from './useMutationState' -export { useMutation } from './useMutation' -export { mutationOptions } from './mutationOptions' -export { useInfiniteQuery } from './useInfiniteQuery' -export { useIsRestoring, IsRestoringProvider } from './IsRestoringProvider' diff --git a/node_modules/@tanstack/react-query/src/infiniteQueryOptions.ts b/node_modules/@tanstack/react-query/src/infiniteQueryOptions.ts deleted file mode 100644 index 5e8c371..0000000 --- a/node_modules/@tanstack/react-query/src/infiniteQueryOptions.ts +++ /dev/null @@ -1,149 +0,0 @@ -import type { - DataTag, - DefaultError, - InfiniteData, - InitialDataFunction, - NonUndefinedGuard, - OmitKeyof, - QueryKey, - SkipToken, -} from '@tanstack/query-core' -import type { UseInfiniteQueryOptions } from './types' - -export type UndefinedInitialDataInfiniteOptions< - TQueryFnData, - TError = DefaultError, - TData = InfiniteData, - TQueryKey extends QueryKey = QueryKey, - TPageParam = unknown, -> = UseInfiniteQueryOptions< - TQueryFnData, - TError, - TData, - TQueryKey, - TPageParam -> & { - initialData?: - | undefined - | NonUndefinedGuard> - | InitialDataFunction< - NonUndefinedGuard> - > -} - -export type UnusedSkipTokenInfiniteOptions< - TQueryFnData, - TError = DefaultError, - TData = InfiniteData, - TQueryKey extends QueryKey = QueryKey, - TPageParam = unknown, -> = OmitKeyof< - UseInfiniteQueryOptions, - 'queryFn' -> & { - queryFn?: Exclude< - UseInfiniteQueryOptions< - TQueryFnData, - TError, - TData, - TQueryKey, - TPageParam - >['queryFn'], - SkipToken | undefined - > -} - -export type DefinedInitialDataInfiniteOptions< - TQueryFnData, - TError = DefaultError, - TData = InfiniteData, - TQueryKey extends QueryKey = QueryKey, - TPageParam = unknown, -> = UseInfiniteQueryOptions< - TQueryFnData, - TError, - TData, - TQueryKey, - TPageParam -> & { - initialData: - | NonUndefinedGuard> - | (() => NonUndefinedGuard>) - | undefined -} - -export function infiniteQueryOptions< - TQueryFnData, - TError = DefaultError, - TData = InfiniteData, - TQueryKey extends QueryKey = QueryKey, - TPageParam = unknown, ->( - options: DefinedInitialDataInfiniteOptions< - TQueryFnData, - TError, - TData, - TQueryKey, - TPageParam - >, -): DefinedInitialDataInfiniteOptions< - TQueryFnData, - TError, - TData, - TQueryKey, - TPageParam -> & { - queryKey: DataTag, TError> -} - -export function infiniteQueryOptions< - TQueryFnData, - TError = DefaultError, - TData = InfiniteData, - TQueryKey extends QueryKey = QueryKey, - TPageParam = unknown, ->( - options: UnusedSkipTokenInfiniteOptions< - TQueryFnData, - TError, - TData, - TQueryKey, - TPageParam - >, -): UnusedSkipTokenInfiniteOptions< - TQueryFnData, - TError, - TData, - TQueryKey, - TPageParam -> & { - queryKey: DataTag, TError> -} - -export function infiniteQueryOptions< - TQueryFnData, - TError = DefaultError, - TData = InfiniteData, - TQueryKey extends QueryKey = QueryKey, - TPageParam = unknown, ->( - options: UndefinedInitialDataInfiniteOptions< - TQueryFnData, - TError, - TData, - TQueryKey, - TPageParam - >, -): UndefinedInitialDataInfiniteOptions< - TQueryFnData, - TError, - TData, - TQueryKey, - TPageParam -> & { - queryKey: DataTag, TError> -} - -export function infiniteQueryOptions(options: unknown) { - return options -} diff --git a/node_modules/@tanstack/react-query/src/mutationOptions.ts b/node_modules/@tanstack/react-query/src/mutationOptions.ts deleted file mode 100644 index 1ee3110..0000000 --- a/node_modules/@tanstack/react-query/src/mutationOptions.ts +++ /dev/null @@ -1,41 +0,0 @@ -import type { DefaultError, WithRequired } from '@tanstack/query-core' -import type { UseMutationOptions } from './types' - -export function mutationOptions< - TData = unknown, - TError = DefaultError, - TVariables = void, - TOnMutateResult = unknown, ->( - options: WithRequired< - UseMutationOptions, - 'mutationKey' - >, -): WithRequired< - UseMutationOptions, - 'mutationKey' -> -export function mutationOptions< - TData = unknown, - TError = DefaultError, - TVariables = void, - TOnMutateResult = unknown, ->( - options: Omit< - UseMutationOptions, - 'mutationKey' - >, -): Omit< - UseMutationOptions, - 'mutationKey' -> -export function mutationOptions< - TData = unknown, - TError = DefaultError, - TVariables = void, - TOnMutateResult = unknown, ->( - options: UseMutationOptions, -): UseMutationOptions { - return options -} diff --git a/node_modules/@tanstack/react-query/src/queryOptions.ts b/node_modules/@tanstack/react-query/src/queryOptions.ts deleted file mode 100644 index 644ac26..0000000 --- a/node_modules/@tanstack/react-query/src/queryOptions.ts +++ /dev/null @@ -1,87 +0,0 @@ -import type { - DataTag, - DefaultError, - InitialDataFunction, - NonUndefinedGuard, - OmitKeyof, - QueryFunction, - QueryKey, - SkipToken, -} from '@tanstack/query-core' -import type { UseQueryOptions } from './types' - -export type UndefinedInitialDataOptions< - TQueryFnData = unknown, - TError = DefaultError, - TData = TQueryFnData, - TQueryKey extends QueryKey = QueryKey, -> = UseQueryOptions & { - initialData?: - | undefined - | InitialDataFunction> - | NonUndefinedGuard -} - -export type UnusedSkipTokenOptions< - TQueryFnData = unknown, - TError = DefaultError, - TData = TQueryFnData, - TQueryKey extends QueryKey = QueryKey, -> = OmitKeyof< - UseQueryOptions, - 'queryFn' -> & { - queryFn?: Exclude< - UseQueryOptions['queryFn'], - SkipToken | undefined - > -} - -export type DefinedInitialDataOptions< - TQueryFnData = unknown, - TError = DefaultError, - TData = TQueryFnData, - TQueryKey extends QueryKey = QueryKey, -> = Omit, 'queryFn'> & { - initialData: - | NonUndefinedGuard - | (() => NonUndefinedGuard) - queryFn?: QueryFunction -} - -export function queryOptions< - TQueryFnData = unknown, - TError = DefaultError, - TData = TQueryFnData, - TQueryKey extends QueryKey = QueryKey, ->( - options: DefinedInitialDataOptions, -): DefinedInitialDataOptions & { - queryKey: DataTag -} - -export function queryOptions< - TQueryFnData = unknown, - TError = DefaultError, - TData = TQueryFnData, - TQueryKey extends QueryKey = QueryKey, ->( - options: UnusedSkipTokenOptions, -): UnusedSkipTokenOptions & { - queryKey: DataTag -} - -export function queryOptions< - TQueryFnData = unknown, - TError = DefaultError, - TData = TQueryFnData, - TQueryKey extends QueryKey = QueryKey, ->( - options: UndefinedInitialDataOptions, -): UndefinedInitialDataOptions & { - queryKey: DataTag -} - -export function queryOptions(options: unknown) { - return options -} diff --git a/node_modules/@tanstack/react-query/src/suspense.ts b/node_modules/@tanstack/react-query/src/suspense.ts deleted file mode 100644 index d87569f..0000000 --- a/node_modules/@tanstack/react-query/src/suspense.ts +++ /dev/null @@ -1,80 +0,0 @@ -import type { - DefaultError, - DefaultedQueryObserverOptions, - Query, - QueryKey, - QueryObserver, - QueryObserverResult, -} from '@tanstack/query-core' -import type { QueryErrorResetBoundaryValue } from './QueryErrorResetBoundary' - -export const defaultThrowOnError = < - TQueryFnData = unknown, - TError = DefaultError, - TData = TQueryFnData, - TQueryKey extends QueryKey = QueryKey, ->( - _error: TError, - query: Query, -) => query.state.data === undefined - -export const ensureSuspenseTimers = ( - defaultedOptions: DefaultedQueryObserverOptions, -) => { - if (defaultedOptions.suspense) { - // Handle staleTime to ensure minimum 1000ms in Suspense mode - // This prevents unnecessary refetching when components remount after suspending - const MIN_SUSPENSE_TIME_MS = 1000 - - const clamp = (value: number | 'static' | undefined) => - value === 'static' - ? value - : Math.max(value ?? MIN_SUSPENSE_TIME_MS, MIN_SUSPENSE_TIME_MS) - - const originalStaleTime = defaultedOptions.staleTime - defaultedOptions.staleTime = - typeof originalStaleTime === 'function' - ? (...args) => clamp(originalStaleTime(...args)) - : clamp(originalStaleTime) - - if (typeof defaultedOptions.gcTime === 'number') { - defaultedOptions.gcTime = Math.max( - defaultedOptions.gcTime, - MIN_SUSPENSE_TIME_MS, - ) - } - } -} - -export const willFetch = ( - result: QueryObserverResult, - isRestoring: boolean, -) => result.isLoading && result.isFetching && !isRestoring - -export const shouldSuspend = ( - defaultedOptions: - | DefaultedQueryObserverOptions - | undefined, - result: QueryObserverResult, -) => defaultedOptions?.suspense && result.isPending - -export const fetchOptimistic = < - TQueryFnData, - TError, - TData, - TQueryData, - TQueryKey extends QueryKey, ->( - defaultedOptions: DefaultedQueryObserverOptions< - TQueryFnData, - TError, - TData, - TQueryData, - TQueryKey - >, - observer: QueryObserver, - errorResetBoundary: QueryErrorResetBoundaryValue, -) => - observer.fetchOptimistic(defaultedOptions).catch(() => { - errorResetBoundary.clearReset() - }) diff --git a/node_modules/@tanstack/react-query/src/types.ts b/node_modules/@tanstack/react-query/src/types.ts deleted file mode 100644 index 50df2d3..0000000 --- a/node_modules/@tanstack/react-query/src/types.ts +++ /dev/null @@ -1,242 +0,0 @@ -/* istanbul ignore file */ - -import type { - DefaultError, - DefinedInfiniteQueryObserverResult, - DefinedQueryObserverResult, - DistributiveOmit, - FetchQueryOptions, - InfiniteQueryObserverOptions, - InfiniteQueryObserverResult, - MutateFunction, - MutationObserverOptions, - MutationObserverResult, - OmitKeyof, - Override, - QueryKey, - QueryObserverOptions, - QueryObserverResult, - SkipToken, -} from '@tanstack/query-core' - -export type AnyUseBaseQueryOptions = UseBaseQueryOptions< - any, - any, - any, - any, - any -> -export interface UseBaseQueryOptions< - TQueryFnData = unknown, - TError = DefaultError, - TData = TQueryFnData, - TQueryData = TQueryFnData, - TQueryKey extends QueryKey = QueryKey, -> extends QueryObserverOptions< - TQueryFnData, - TError, - TData, - TQueryData, - TQueryKey -> { - /** - * Set this to `false` to unsubscribe this observer from updates to the query cache. - * Defaults to `true`. - */ - subscribed?: boolean -} - -export interface UsePrefetchQueryOptions< - TQueryFnData = unknown, - TError = DefaultError, - TData = TQueryFnData, - TQueryKey extends QueryKey = QueryKey, -> extends OmitKeyof< - FetchQueryOptions, - 'queryFn' -> { - queryFn?: Exclude< - FetchQueryOptions['queryFn'], - SkipToken - > -} - -export type AnyUseQueryOptions = UseQueryOptions -export interface UseQueryOptions< - TQueryFnData = unknown, - TError = DefaultError, - TData = TQueryFnData, - TQueryKey extends QueryKey = QueryKey, -> extends OmitKeyof< - UseBaseQueryOptions, - 'suspense' -> {} - -export type AnyUseSuspenseQueryOptions = UseSuspenseQueryOptions< - any, - any, - any, - any -> -export interface UseSuspenseQueryOptions< - TQueryFnData = unknown, - TError = DefaultError, - TData = TQueryFnData, - TQueryKey extends QueryKey = QueryKey, -> extends OmitKeyof< - UseQueryOptions, - 'queryFn' | 'enabled' | 'throwOnError' | 'placeholderData' -> { - queryFn?: Exclude< - UseQueryOptions['queryFn'], - SkipToken - > -} - -export type AnyUseInfiniteQueryOptions = UseInfiniteQueryOptions< - any, - any, - any, - any, - any -> -export interface UseInfiniteQueryOptions< - TQueryFnData = unknown, - TError = DefaultError, - TData = TQueryFnData, - TQueryKey extends QueryKey = QueryKey, - TPageParam = unknown, -> extends OmitKeyof< - InfiniteQueryObserverOptions< - TQueryFnData, - TError, - TData, - TQueryKey, - TPageParam - >, - 'suspense' -> { - /** - * Set this to `false` to unsubscribe this observer from updates to the query cache. - * Defaults to `true`. - */ - subscribed?: boolean -} - -export type AnyUseSuspenseInfiniteQueryOptions = - UseSuspenseInfiniteQueryOptions -export interface UseSuspenseInfiniteQueryOptions< - TQueryFnData = unknown, - TError = DefaultError, - TData = TQueryFnData, - TQueryKey extends QueryKey = QueryKey, - TPageParam = unknown, -> extends OmitKeyof< - UseInfiniteQueryOptions, - 'queryFn' | 'enabled' | 'throwOnError' | 'placeholderData' -> { - queryFn?: Exclude< - UseInfiniteQueryOptions< - TQueryFnData, - TError, - TData, - TQueryKey, - TPageParam - >['queryFn'], - SkipToken - > -} - -export type UseBaseQueryResult< - TData = unknown, - TError = DefaultError, -> = QueryObserverResult - -export type UseQueryResult< - TData = unknown, - TError = DefaultError, -> = UseBaseQueryResult - -export type UseSuspenseQueryResult< - TData = unknown, - TError = DefaultError, -> = DistributiveOmit< - DefinedQueryObserverResult, - 'isPlaceholderData' | 'promise' -> - -export type DefinedUseQueryResult< - TData = unknown, - TError = DefaultError, -> = DefinedQueryObserverResult - -export type UseInfiniteQueryResult< - TData = unknown, - TError = DefaultError, -> = InfiniteQueryObserverResult - -export type DefinedUseInfiniteQueryResult< - TData = unknown, - TError = DefaultError, -> = DefinedInfiniteQueryObserverResult - -export type UseSuspenseInfiniteQueryResult< - TData = unknown, - TError = DefaultError, -> = OmitKeyof< - DefinedInfiniteQueryObserverResult, - 'isPlaceholderData' | 'promise' -> - -export type AnyUseMutationOptions = UseMutationOptions -export interface UseMutationOptions< - TData = unknown, - TError = DefaultError, - TVariables = void, - TOnMutateResult = unknown, -> extends OmitKeyof< - MutationObserverOptions, - '_defaulted' -> {} - -export type UseMutateFunction< - TData = unknown, - TError = DefaultError, - TVariables = void, - TOnMutateResult = unknown, -> = ( - ...args: Parameters< - MutateFunction - > -) => void - -export type UseMutateAsyncFunction< - TData = unknown, - TError = DefaultError, - TVariables = void, - TOnMutateResult = unknown, -> = MutateFunction - -export type UseBaseMutationResult< - TData = unknown, - TError = DefaultError, - TVariables = unknown, - TOnMutateResult = unknown, -> = Override< - MutationObserverResult, - { mutate: UseMutateFunction } -> & { - mutateAsync: UseMutateAsyncFunction< - TData, - TError, - TVariables, - TOnMutateResult - > -} - -export type UseMutationResult< - TData = unknown, - TError = DefaultError, - TVariables = unknown, - TOnMutateResult = unknown, -> = UseBaseMutationResult diff --git a/node_modules/@tanstack/react-query/src/useBaseQuery.ts b/node_modules/@tanstack/react-query/src/useBaseQuery.ts deleted file mode 100644 index 2a151fe..0000000 --- a/node_modules/@tanstack/react-query/src/useBaseQuery.ts +++ /dev/null @@ -1,170 +0,0 @@ -'use client' -import * as React from 'react' - -import { isServer, noop, notifyManager } from '@tanstack/query-core' -import { useQueryClient } from './QueryClientProvider' -import { useQueryErrorResetBoundary } from './QueryErrorResetBoundary' -import { - ensurePreventErrorBoundaryRetry, - getHasError, - useClearResetErrorBoundary, -} from './errorBoundaryUtils' -import { useIsRestoring } from './IsRestoringProvider' -import { - ensureSuspenseTimers, - fetchOptimistic, - shouldSuspend, - willFetch, -} from './suspense' -import type { - QueryClient, - QueryKey, - QueryObserver, - QueryObserverResult, -} from '@tanstack/query-core' -import type { UseBaseQueryOptions } from './types' - -export function useBaseQuery< - TQueryFnData, - TError, - TData, - TQueryData, - TQueryKey extends QueryKey, ->( - options: UseBaseQueryOptions< - TQueryFnData, - TError, - TData, - TQueryData, - TQueryKey - >, - Observer: typeof QueryObserver, - queryClient?: QueryClient, -): QueryObserverResult { - if (process.env.NODE_ENV !== 'production') { - if (typeof options !== 'object' || Array.isArray(options)) { - throw new Error( - 'Bad argument type. Starting with v5, only the "Object" form is allowed when calling query related functions. Please use the error stack to find the culprit call. More info here: https://tanstack.com/query/latest/docs/react/guides/migrating-to-v5#supports-a-single-signature-one-object', - ) - } - } - - const isRestoring = useIsRestoring() - const errorResetBoundary = useQueryErrorResetBoundary() - const client = useQueryClient(queryClient) - const defaultedOptions = client.defaultQueryOptions(options) - ;(client.getDefaultOptions().queries as any)?._experimental_beforeQuery?.( - defaultedOptions, - ) - - const query = client - .getQueryCache() - .get< - TQueryFnData, - TError, - TQueryData, - TQueryKey - >(defaultedOptions.queryHash) - - if (process.env.NODE_ENV !== 'production') { - if (!defaultedOptions.queryFn) { - console.error( - `[${defaultedOptions.queryHash}]: No queryFn was passed as an option, and no default queryFn was found. The queryFn parameter is only optional when using a default queryFn. More info here: https://tanstack.com/query/latest/docs/framework/react/guides/default-query-function`, - ) - } - } - - // Make sure results are optimistically set in fetching state before subscribing or updating options - defaultedOptions._optimisticResults = isRestoring - ? 'isRestoring' - : 'optimistic' - - ensureSuspenseTimers(defaultedOptions) - ensurePreventErrorBoundaryRetry(defaultedOptions, errorResetBoundary, query) - useClearResetErrorBoundary(errorResetBoundary) - - // this needs to be invoked before creating the Observer because that can create a cache entry - const isNewCacheEntry = !client - .getQueryCache() - .get(defaultedOptions.queryHash) - - const [observer] = React.useState( - () => - new Observer( - client, - defaultedOptions, - ), - ) - - // note: this must be called before useSyncExternalStore - const result = observer.getOptimisticResult(defaultedOptions) - - const shouldSubscribe = !isRestoring && options.subscribed !== false - React.useSyncExternalStore( - React.useCallback( - (onStoreChange) => { - const unsubscribe = shouldSubscribe - ? observer.subscribe(notifyManager.batchCalls(onStoreChange)) - : noop - - // Update result to make sure we did not miss any query updates - // between creating the observer and subscribing to it. - observer.updateResult() - - return unsubscribe - }, - [observer, shouldSubscribe], - ), - () => observer.getCurrentResult(), - () => observer.getCurrentResult(), - ) - - React.useEffect(() => { - observer.setOptions(defaultedOptions) - }, [defaultedOptions, observer]) - - // Handle suspense - if (shouldSuspend(defaultedOptions, result)) { - throw fetchOptimistic(defaultedOptions, observer, errorResetBoundary) - } - - // Handle error boundary - if ( - getHasError({ - result, - errorResetBoundary, - throwOnError: defaultedOptions.throwOnError, - query, - suspense: defaultedOptions.suspense, - }) - ) { - throw result.error - } - - ;(client.getDefaultOptions().queries as any)?._experimental_afterQuery?.( - defaultedOptions, - result, - ) - - if ( - defaultedOptions.experimental_prefetchInRender && - !isServer && - willFetch(result, isRestoring) - ) { - const promise = isNewCacheEntry - ? // Fetch immediately on render in order to ensure `.promise` is resolved even if the component is unmounted - fetchOptimistic(defaultedOptions, observer, errorResetBoundary) - : // subscribe to the "cache promise" so that we can finalize the currentThenable once data comes in - query?.promise - - promise?.catch(noop).finally(() => { - // `.updateResult()` will trigger `.#currentThenable` to finalize - observer.updateResult() - }) - } - - // Handle result property usage tracking - return !defaultedOptions.notifyOnChangeProps - ? observer.trackResult(result) - : result -} diff --git a/node_modules/@tanstack/react-query/src/useInfiniteQuery.ts b/node_modules/@tanstack/react-query/src/useInfiniteQuery.ts deleted file mode 100644 index 32ebfb7..0000000 --- a/node_modules/@tanstack/react-query/src/useInfiniteQuery.ts +++ /dev/null @@ -1,81 +0,0 @@ -'use client' -import { InfiniteQueryObserver } from '@tanstack/query-core' -import { useBaseQuery } from './useBaseQuery' -import type { - DefaultError, - InfiniteData, - QueryClient, - QueryKey, - QueryObserver, -} from '@tanstack/query-core' -import type { - DefinedUseInfiniteQueryResult, - UseInfiniteQueryOptions, - UseInfiniteQueryResult, -} from './types' -import type { - DefinedInitialDataInfiniteOptions, - UndefinedInitialDataInfiniteOptions, -} from './infiniteQueryOptions' - -export function useInfiniteQuery< - TQueryFnData, - TError = DefaultError, - TData = InfiniteData, - TQueryKey extends QueryKey = QueryKey, - TPageParam = unknown, ->( - options: DefinedInitialDataInfiniteOptions< - TQueryFnData, - TError, - TData, - TQueryKey, - TPageParam - >, - queryClient?: QueryClient, -): DefinedUseInfiniteQueryResult - -export function useInfiniteQuery< - TQueryFnData, - TError = DefaultError, - TData = InfiniteData, - TQueryKey extends QueryKey = QueryKey, - TPageParam = unknown, ->( - options: UndefinedInitialDataInfiniteOptions< - TQueryFnData, - TError, - TData, - TQueryKey, - TPageParam - >, - queryClient?: QueryClient, -): UseInfiniteQueryResult - -export function useInfiniteQuery< - TQueryFnData, - TError = DefaultError, - TData = InfiniteData, - TQueryKey extends QueryKey = QueryKey, - TPageParam = unknown, ->( - options: UseInfiniteQueryOptions< - TQueryFnData, - TError, - TData, - TQueryKey, - TPageParam - >, - queryClient?: QueryClient, -): UseInfiniteQueryResult - -export function useInfiniteQuery( - options: UseInfiniteQueryOptions, - queryClient?: QueryClient, -) { - return useBaseQuery( - options, - InfiniteQueryObserver as typeof QueryObserver, - queryClient, - ) -} diff --git a/node_modules/@tanstack/react-query/src/useIsFetching.ts b/node_modules/@tanstack/react-query/src/useIsFetching.ts deleted file mode 100644 index a625291..0000000 --- a/node_modules/@tanstack/react-query/src/useIsFetching.ts +++ /dev/null @@ -1,24 +0,0 @@ -'use client' -import * as React from 'react' -import { notifyManager } from '@tanstack/query-core' - -import { useQueryClient } from './QueryClientProvider' -import type { QueryClient, QueryFilters } from '@tanstack/query-core' - -export function useIsFetching( - filters?: QueryFilters, - queryClient?: QueryClient, -): number { - const client = useQueryClient(queryClient) - const queryCache = client.getQueryCache() - - return React.useSyncExternalStore( - React.useCallback( - (onStoreChange) => - queryCache.subscribe(notifyManager.batchCalls(onStoreChange)), - [queryCache], - ), - () => client.isFetching(filters), - () => client.isFetching(filters), - ) -} diff --git a/node_modules/@tanstack/react-query/src/useMutation.ts b/node_modules/@tanstack/react-query/src/useMutation.ts deleted file mode 100644 index 2c66eb8..0000000 --- a/node_modules/@tanstack/react-query/src/useMutation.ts +++ /dev/null @@ -1,69 +0,0 @@ -'use client' -import * as React from 'react' -import { - MutationObserver, - noop, - notifyManager, - shouldThrowError, -} from '@tanstack/query-core' -import { useQueryClient } from './QueryClientProvider' -import type { - UseMutateFunction, - UseMutationOptions, - UseMutationResult, -} from './types' -import type { DefaultError, QueryClient } from '@tanstack/query-core' - -// HOOK - -export function useMutation< - TData = unknown, - TError = DefaultError, - TVariables = void, - TOnMutateResult = unknown, ->( - options: UseMutationOptions, - queryClient?: QueryClient, -): UseMutationResult { - const client = useQueryClient(queryClient) - - const [observer] = React.useState( - () => - new MutationObserver( - client, - options, - ), - ) - - React.useEffect(() => { - observer.setOptions(options) - }, [observer, options]) - - const result = React.useSyncExternalStore( - React.useCallback( - (onStoreChange) => - observer.subscribe(notifyManager.batchCalls(onStoreChange)), - [observer], - ), - () => observer.getCurrentResult(), - () => observer.getCurrentResult(), - ) - - const mutate = React.useCallback< - UseMutateFunction - >( - (variables, mutateOptions) => { - observer.mutate(variables, mutateOptions).catch(noop) - }, - [observer], - ) - - if ( - result.error && - shouldThrowError(observer.options.throwOnError, [result.error]) - ) { - throw result.error - } - - return { ...result, mutate, mutateAsync: result.mutate } -} diff --git a/node_modules/@tanstack/react-query/src/useMutationState.ts b/node_modules/@tanstack/react-query/src/useMutationState.ts deleted file mode 100644 index dfd0c41..0000000 --- a/node_modules/@tanstack/react-query/src/useMutationState.ts +++ /dev/null @@ -1,75 +0,0 @@ -'use client' -import * as React from 'react' - -import { notifyManager, replaceEqualDeep } from '@tanstack/query-core' -import { useQueryClient } from './QueryClientProvider' -import type { - Mutation, - MutationCache, - MutationFilters, - MutationState, - QueryClient, -} from '@tanstack/query-core' - -export function useIsMutating( - filters?: MutationFilters, - queryClient?: QueryClient, -): number { - const client = useQueryClient(queryClient) - return useMutationState( - { filters: { ...filters, status: 'pending' } }, - client, - ).length -} - -type MutationStateOptions = { - filters?: MutationFilters - select?: (mutation: Mutation) => TResult -} - -function getResult( - mutationCache: MutationCache, - options: MutationStateOptions, -): Array { - return mutationCache - .findAll(options.filters) - .map( - (mutation): TResult => - (options.select ? options.select(mutation) : mutation.state) as TResult, - ) -} - -export function useMutationState( - options: MutationStateOptions = {}, - queryClient?: QueryClient, -): Array { - const mutationCache = useQueryClient(queryClient).getMutationCache() - const optionsRef = React.useRef(options) - const result = React.useRef>(null) - if (result.current === null) { - result.current = getResult(mutationCache, options) - } - - React.useEffect(() => { - optionsRef.current = options - }) - - return React.useSyncExternalStore( - React.useCallback( - (onStoreChange) => - mutationCache.subscribe(() => { - const nextResult = replaceEqualDeep( - result.current, - getResult(mutationCache, optionsRef.current), - ) - if (result.current !== nextResult) { - result.current = nextResult - notifyManager.schedule(onStoreChange) - } - }), - [mutationCache], - ), - () => result.current, - () => result.current, - )! -} diff --git a/node_modules/@tanstack/react-query/src/usePrefetchInfiniteQuery.tsx b/node_modules/@tanstack/react-query/src/usePrefetchInfiniteQuery.tsx deleted file mode 100644 index 08c2fcd..0000000 --- a/node_modules/@tanstack/react-query/src/usePrefetchInfiniteQuery.tsx +++ /dev/null @@ -1,30 +0,0 @@ -import { useQueryClient } from './QueryClientProvider' -import type { - DefaultError, - FetchInfiniteQueryOptions, - QueryClient, - QueryKey, -} from '@tanstack/query-core' - -export function usePrefetchInfiniteQuery< - TQueryFnData = unknown, - TError = DefaultError, - TData = TQueryFnData, - TQueryKey extends QueryKey = QueryKey, - TPageParam = unknown, ->( - options: FetchInfiniteQueryOptions< - TQueryFnData, - TError, - TData, - TQueryKey, - TPageParam - >, - queryClient?: QueryClient, -) { - const client = useQueryClient(queryClient) - - if (!client.getQueryState(options.queryKey)) { - client.prefetchInfiniteQuery(options) - } -} diff --git a/node_modules/@tanstack/react-query/src/usePrefetchQuery.tsx b/node_modules/@tanstack/react-query/src/usePrefetchQuery.tsx deleted file mode 100644 index 3f508c3..0000000 --- a/node_modules/@tanstack/react-query/src/usePrefetchQuery.tsx +++ /dev/null @@ -1,19 +0,0 @@ -import { useQueryClient } from './QueryClientProvider' -import type { DefaultError, QueryClient, QueryKey } from '@tanstack/query-core' -import type { UsePrefetchQueryOptions } from './types' - -export function usePrefetchQuery< - TQueryFnData = unknown, - TError = DefaultError, - TData = TQueryFnData, - TQueryKey extends QueryKey = QueryKey, ->( - options: UsePrefetchQueryOptions, - queryClient?: QueryClient, -) { - const client = useQueryClient(queryClient) - - if (!client.getQueryState(options.queryKey)) { - client.prefetchQuery(options) - } -} diff --git a/node_modules/@tanstack/react-query/src/useQueries.ts b/node_modules/@tanstack/react-query/src/useQueries.ts deleted file mode 100644 index de17983..0000000 --- a/node_modules/@tanstack/react-query/src/useQueries.ts +++ /dev/null @@ -1,328 +0,0 @@ -'use client' -import * as React from 'react' - -import { - QueriesObserver, - QueryObserver, - noop, - notifyManager, -} from '@tanstack/query-core' -import { useQueryClient } from './QueryClientProvider' -import { useIsRestoring } from './IsRestoringProvider' -import { useQueryErrorResetBoundary } from './QueryErrorResetBoundary' -import { - ensurePreventErrorBoundaryRetry, - getHasError, - useClearResetErrorBoundary, -} from './errorBoundaryUtils' -import { - ensureSuspenseTimers, - fetchOptimistic, - shouldSuspend, -} from './suspense' -import type { - DefinedUseQueryResult, - UseQueryOptions, - UseQueryResult, -} from './types' -import type { - DefaultError, - OmitKeyof, - QueriesObserverOptions, - QueriesPlaceholderDataFunction, - QueryClient, - QueryFunction, - QueryKey, - QueryObserverOptions, - ThrowOnError, -} from '@tanstack/query-core' - -// This defines the `UseQueryOptions` that are accepted in `QueriesOptions` & `GetOptions`. -// `placeholderData` function always gets undefined passed -type UseQueryOptionsForUseQueries< - TQueryFnData = unknown, - TError = DefaultError, - TData = TQueryFnData, - TQueryKey extends QueryKey = QueryKey, -> = OmitKeyof< - UseQueryOptions, - 'placeholderData' | 'subscribed' -> & { - placeholderData?: TQueryFnData | QueriesPlaceholderDataFunction -} - -// Avoid TS depth-limit error in case of large array literal -type MAXIMUM_DEPTH = 20 - -// Widen the type of the symbol to enable type inference even if skipToken is not immutable. -type SkipTokenForUseQueries = symbol - -type GetUseQueryOptionsForUseQueries = - // Part 1: responsible for applying explicit type parameter to function arguments, if object { queryFnData: TQueryFnData, error: TError, data: TData } - T extends { - queryFnData: infer TQueryFnData - error?: infer TError - data: infer TData - } - ? UseQueryOptionsForUseQueries - : T extends { queryFnData: infer TQueryFnData; error?: infer TError } - ? UseQueryOptionsForUseQueries - : T extends { data: infer TData; error?: infer TError } - ? UseQueryOptionsForUseQueries - : // Part 2: responsible for applying explicit type parameter to function arguments, if tuple [TQueryFnData, TError, TData] - T extends [infer TQueryFnData, infer TError, infer TData] - ? UseQueryOptionsForUseQueries - : T extends [infer TQueryFnData, infer TError] - ? UseQueryOptionsForUseQueries - : T extends [infer TQueryFnData] - ? UseQueryOptionsForUseQueries - : // Part 3: responsible for inferring and enforcing type if no explicit parameter was provided - T extends { - queryFn?: - | QueryFunction - | SkipTokenForUseQueries - select?: (data: any) => infer TData - throwOnError?: ThrowOnError - } - ? UseQueryOptionsForUseQueries< - TQueryFnData, - unknown extends TError ? DefaultError : TError, - unknown extends TData ? TQueryFnData : TData, - TQueryKey - > - : // Fallback - UseQueryOptionsForUseQueries - -// A defined initialData setting should return a DefinedUseQueryResult rather than UseQueryResult -type GetDefinedOrUndefinedQueryResult = T extends { - initialData?: infer TInitialData -} - ? unknown extends TInitialData - ? UseQueryResult - : TInitialData extends TData - ? DefinedUseQueryResult - : TInitialData extends () => infer TInitialDataResult - ? unknown extends TInitialDataResult - ? UseQueryResult - : TInitialDataResult extends TData - ? DefinedUseQueryResult - : UseQueryResult - : UseQueryResult - : UseQueryResult - -type GetUseQueryResult = - // Part 1: responsible for mapping explicit type parameter to function result, if object - T extends { queryFnData: any; error?: infer TError; data: infer TData } - ? GetDefinedOrUndefinedQueryResult - : T extends { queryFnData: infer TQueryFnData; error?: infer TError } - ? GetDefinedOrUndefinedQueryResult - : T extends { data: infer TData; error?: infer TError } - ? GetDefinedOrUndefinedQueryResult - : // Part 2: responsible for mapping explicit type parameter to function result, if tuple - T extends [any, infer TError, infer TData] - ? GetDefinedOrUndefinedQueryResult - : T extends [infer TQueryFnData, infer TError] - ? GetDefinedOrUndefinedQueryResult - : T extends [infer TQueryFnData] - ? GetDefinedOrUndefinedQueryResult - : // Part 3: responsible for mapping inferred type to results, if no explicit parameter was provided - T extends { - queryFn?: - | QueryFunction - | SkipTokenForUseQueries - select?: (data: any) => infer TData - throwOnError?: ThrowOnError - } - ? GetDefinedOrUndefinedQueryResult< - T, - unknown extends TData ? TQueryFnData : TData, - unknown extends TError ? DefaultError : TError - > - : // Fallback - UseQueryResult - -/** - * QueriesOptions reducer recursively unwraps function arguments to infer/enforce type param - */ -export type QueriesOptions< - T extends Array, - TResults extends Array = [], - TDepth extends ReadonlyArray = [], -> = TDepth['length'] extends MAXIMUM_DEPTH - ? Array - : T extends [] - ? [] - : T extends [infer Head] - ? [...TResults, GetUseQueryOptionsForUseQueries] - : T extends [infer Head, ...infer Tails] - ? QueriesOptions< - [...Tails], - [...TResults, GetUseQueryOptionsForUseQueries], - [...TDepth, 1] - > - : ReadonlyArray extends T - ? T - : // If T is *some* array but we couldn't assign unknown[] to it, then it must hold some known/homogenous type! - // use this to infer the param types in the case of Array.map() argument - T extends Array< - UseQueryOptionsForUseQueries< - infer TQueryFnData, - infer TError, - infer TData, - infer TQueryKey - > - > - ? Array< - UseQueryOptionsForUseQueries< - TQueryFnData, - TError, - TData, - TQueryKey - > - > - : // Fallback - Array - -/** - * QueriesResults reducer recursively maps type param to results - */ -export type QueriesResults< - T extends Array, - TResults extends Array = [], - TDepth extends ReadonlyArray = [], -> = TDepth['length'] extends MAXIMUM_DEPTH - ? Array - : T extends [] - ? [] - : T extends [infer Head] - ? [...TResults, GetUseQueryResult] - : T extends [infer Head, ...infer Tails] - ? QueriesResults< - [...Tails], - [...TResults, GetUseQueryResult], - [...TDepth, 1] - > - : { [K in keyof T]: GetUseQueryResult } - -export function useQueries< - T extends Array, - TCombinedResult = QueriesResults, ->( - { - queries, - ...options - }: { - queries: - | readonly [...QueriesOptions] - | readonly [...{ [K in keyof T]: GetUseQueryOptionsForUseQueries }] - combine?: (result: QueriesResults) => TCombinedResult - subscribed?: boolean - }, - queryClient?: QueryClient, -): TCombinedResult { - const client = useQueryClient(queryClient) - const isRestoring = useIsRestoring() - const errorResetBoundary = useQueryErrorResetBoundary() - - const defaultedQueries = React.useMemo( - () => - queries.map((opts) => { - const defaultedOptions = client.defaultQueryOptions( - opts as QueryObserverOptions, - ) - - // Make sure the results are already in fetching state before subscribing or updating options - defaultedOptions._optimisticResults = isRestoring - ? 'isRestoring' - : 'optimistic' - - return defaultedOptions - }), - [queries, client, isRestoring], - ) - - defaultedQueries.forEach((queryOptions) => { - ensureSuspenseTimers(queryOptions) - const query = client.getQueryCache().get(queryOptions.queryHash) - ensurePreventErrorBoundaryRetry(queryOptions, errorResetBoundary, query) - }) - - useClearResetErrorBoundary(errorResetBoundary) - - const [observer] = React.useState( - () => - new QueriesObserver( - client, - defaultedQueries, - options as QueriesObserverOptions, - ), - ) - - // note: this must be called before useSyncExternalStore - const [optimisticResult, getCombinedResult, trackResult] = - observer.getOptimisticResult( - defaultedQueries, - (options as QueriesObserverOptions).combine, - ) - - const shouldSubscribe = !isRestoring && options.subscribed !== false - React.useSyncExternalStore( - React.useCallback( - (onStoreChange) => - shouldSubscribe - ? observer.subscribe(notifyManager.batchCalls(onStoreChange)) - : noop, - [observer, shouldSubscribe], - ), - () => observer.getCurrentResult(), - () => observer.getCurrentResult(), - ) - - React.useEffect(() => { - observer.setQueries( - defaultedQueries, - options as QueriesObserverOptions, - ) - }, [defaultedQueries, options, observer]) - - const shouldAtLeastOneSuspend = optimisticResult.some((result, index) => - shouldSuspend(defaultedQueries[index], result), - ) - - const suspensePromises = shouldAtLeastOneSuspend - ? optimisticResult.flatMap((result, index) => { - const opts = defaultedQueries[index] - - if (opts && shouldSuspend(opts, result)) { - const queryObserver = new QueryObserver(client, opts) - return fetchOptimistic(opts, queryObserver, errorResetBoundary) - } - return [] - }) - : [] - - if (suspensePromises.length > 0) { - throw Promise.all(suspensePromises) - } - const firstSingleResultWhichShouldThrow = optimisticResult.find( - (result, index) => { - const query = defaultedQueries[index] - return ( - query && - getHasError({ - result, - errorResetBoundary, - throwOnError: query.throwOnError, - query: client.getQueryCache().get(query.queryHash), - suspense: query.suspense, - }) - ) - }, - ) - - if (firstSingleResultWhichShouldThrow?.error) { - throw firstSingleResultWhichShouldThrow.error - } - - return getCombinedResult(trackResult()) -} diff --git a/node_modules/@tanstack/react-query/src/useQuery.ts b/node_modules/@tanstack/react-query/src/useQuery.ts deleted file mode 100644 index 52d4795..0000000 --- a/node_modules/@tanstack/react-query/src/useQuery.ts +++ /dev/null @@ -1,52 +0,0 @@ -'use client' -import { QueryObserver } from '@tanstack/query-core' -import { useBaseQuery } from './useBaseQuery' -import type { - DefaultError, - NoInfer, - QueryClient, - QueryKey, -} from '@tanstack/query-core' -import type { - DefinedUseQueryResult, - UseQueryOptions, - UseQueryResult, -} from './types' -import type { - DefinedInitialDataOptions, - UndefinedInitialDataOptions, -} from './queryOptions' - -export function useQuery< - TQueryFnData = unknown, - TError = DefaultError, - TData = TQueryFnData, - TQueryKey extends QueryKey = QueryKey, ->( - options: DefinedInitialDataOptions, - queryClient?: QueryClient, -): DefinedUseQueryResult, TError> - -export function useQuery< - TQueryFnData = unknown, - TError = DefaultError, - TData = TQueryFnData, - TQueryKey extends QueryKey = QueryKey, ->( - options: UndefinedInitialDataOptions, - queryClient?: QueryClient, -): UseQueryResult, TError> - -export function useQuery< - TQueryFnData = unknown, - TError = DefaultError, - TData = TQueryFnData, - TQueryKey extends QueryKey = QueryKey, ->( - options: UseQueryOptions, - queryClient?: QueryClient, -): UseQueryResult, TError> - -export function useQuery(options: UseQueryOptions, queryClient?: QueryClient) { - return useBaseQuery(options, QueryObserver, queryClient) -} diff --git a/node_modules/@tanstack/react-query/src/useSuspenseInfiniteQuery.ts b/node_modules/@tanstack/react-query/src/useSuspenseInfiniteQuery.ts deleted file mode 100644 index 3c2fdfd..0000000 --- a/node_modules/@tanstack/react-query/src/useSuspenseInfiniteQuery.ts +++ /dev/null @@ -1,50 +0,0 @@ -'use client' -import { InfiniteQueryObserver, skipToken } from '@tanstack/query-core' -import { useBaseQuery } from './useBaseQuery' -import { defaultThrowOnError } from './suspense' -import type { - DefaultError, - InfiniteData, - InfiniteQueryObserverSuccessResult, - QueryClient, - QueryKey, - QueryObserver, -} from '@tanstack/query-core' -import type { - UseSuspenseInfiniteQueryOptions, - UseSuspenseInfiniteQueryResult, -} from './types' - -export function useSuspenseInfiniteQuery< - TQueryFnData, - TError = DefaultError, - TData = InfiniteData, - TQueryKey extends QueryKey = QueryKey, - TPageParam = unknown, ->( - options: UseSuspenseInfiniteQueryOptions< - TQueryFnData, - TError, - TData, - TQueryKey, - TPageParam - >, - queryClient?: QueryClient, -): UseSuspenseInfiniteQueryResult { - if (process.env.NODE_ENV !== 'production') { - if ((options.queryFn as any) === skipToken) { - console.error('skipToken is not allowed for useSuspenseInfiniteQuery') - } - } - - return useBaseQuery( - { - ...options, - enabled: true, - suspense: true, - throwOnError: defaultThrowOnError, - }, - InfiniteQueryObserver as typeof QueryObserver, - queryClient, - ) as InfiniteQueryObserverSuccessResult -} diff --git a/node_modules/@tanstack/react-query/src/useSuspenseQueries.ts b/node_modules/@tanstack/react-query/src/useSuspenseQueries.ts deleted file mode 100644 index f014095..0000000 --- a/node_modules/@tanstack/react-query/src/useSuspenseQueries.ts +++ /dev/null @@ -1,211 +0,0 @@ -'use client' -import { skipToken } from '@tanstack/query-core' -import { useQueries } from './useQueries' -import { defaultThrowOnError } from './suspense' -import type { UseSuspenseQueryOptions, UseSuspenseQueryResult } from './types' -import type { - DefaultError, - QueryClient, - QueryFunction, - ThrowOnError, -} from '@tanstack/query-core' - -// Avoid TS depth-limit error in case of large array literal -type MAXIMUM_DEPTH = 20 - -// Widen the type of the symbol to enable type inference even if skipToken is not immutable. -type SkipTokenForUseQueries = symbol - -type GetUseSuspenseQueryOptions = - // Part 1: responsible for applying explicit type parameter to function arguments, if object { queryFnData: TQueryFnData, error: TError, data: TData } - T extends { - queryFnData: infer TQueryFnData - error?: infer TError - data: infer TData - } - ? UseSuspenseQueryOptions - : T extends { queryFnData: infer TQueryFnData; error?: infer TError } - ? UseSuspenseQueryOptions - : T extends { data: infer TData; error?: infer TError } - ? UseSuspenseQueryOptions - : // Part 2: responsible for applying explicit type parameter to function arguments, if tuple [TQueryFnData, TError, TData] - T extends [infer TQueryFnData, infer TError, infer TData] - ? UseSuspenseQueryOptions - : T extends [infer TQueryFnData, infer TError] - ? UseSuspenseQueryOptions - : T extends [infer TQueryFnData] - ? UseSuspenseQueryOptions - : // Part 3: responsible for inferring and enforcing type if no explicit parameter was provided - T extends { - queryFn?: - | QueryFunction - | SkipTokenForUseQueries - select?: (data: any) => infer TData - throwOnError?: ThrowOnError - } - ? UseSuspenseQueryOptions< - TQueryFnData, - TError, - TData, - TQueryKey - > - : T extends { - queryFn?: - | QueryFunction - | SkipTokenForUseQueries - throwOnError?: ThrowOnError - } - ? UseSuspenseQueryOptions< - TQueryFnData, - TError, - TQueryFnData, - TQueryKey - > - : // Fallback - UseSuspenseQueryOptions - -type GetUseSuspenseQueryResult = - // Part 1: responsible for mapping explicit type parameter to function result, if object - T extends { queryFnData: any; error?: infer TError; data: infer TData } - ? UseSuspenseQueryResult - : T extends { queryFnData: infer TQueryFnData; error?: infer TError } - ? UseSuspenseQueryResult - : T extends { data: infer TData; error?: infer TError } - ? UseSuspenseQueryResult - : // Part 2: responsible for mapping explicit type parameter to function result, if tuple - T extends [any, infer TError, infer TData] - ? UseSuspenseQueryResult - : T extends [infer TQueryFnData, infer TError] - ? UseSuspenseQueryResult - : T extends [infer TQueryFnData] - ? UseSuspenseQueryResult - : // Part 3: responsible for mapping inferred type to results, if no explicit parameter was provided - T extends { - queryFn?: - | QueryFunction - | SkipTokenForUseQueries - select?: (data: any) => infer TData - throwOnError?: ThrowOnError - } - ? UseSuspenseQueryResult< - unknown extends TData ? TQueryFnData : TData, - unknown extends TError ? DefaultError : TError - > - : T extends { - queryFn?: - | QueryFunction - | SkipTokenForUseQueries - throwOnError?: ThrowOnError - } - ? UseSuspenseQueryResult< - TQueryFnData, - unknown extends TError ? DefaultError : TError - > - : // Fallback - UseSuspenseQueryResult - -/** - * SuspenseQueriesOptions reducer recursively unwraps function arguments to infer/enforce type param - */ -export type SuspenseQueriesOptions< - T extends Array, - TResults extends Array = [], - TDepth extends ReadonlyArray = [], -> = TDepth['length'] extends MAXIMUM_DEPTH - ? Array - : T extends [] - ? [] - : T extends [infer Head] - ? [...TResults, GetUseSuspenseQueryOptions] - : T extends [infer Head, ...infer Tails] - ? SuspenseQueriesOptions< - [...Tails], - [...TResults, GetUseSuspenseQueryOptions], - [...TDepth, 1] - > - : Array extends T - ? T - : // If T is *some* array but we couldn't assign unknown[] to it, then it must hold some known/homogenous type! - // use this to infer the param types in the case of Array.map() argument - T extends Array< - UseSuspenseQueryOptions< - infer TQueryFnData, - infer TError, - infer TData, - infer TQueryKey - > - > - ? Array< - UseSuspenseQueryOptions - > - : // Fallback - Array - -/** - * SuspenseQueriesResults reducer recursively maps type param to results - */ -export type SuspenseQueriesResults< - T extends Array, - TResults extends Array = [], - TDepth extends ReadonlyArray = [], -> = TDepth['length'] extends MAXIMUM_DEPTH - ? Array - : T extends [] - ? [] - : T extends [infer Head] - ? [...TResults, GetUseSuspenseQueryResult] - : T extends [infer Head, ...infer Tails] - ? SuspenseQueriesResults< - [...Tails], - [...TResults, GetUseSuspenseQueryResult], - [...TDepth, 1] - > - : { [K in keyof T]: GetUseSuspenseQueryResult } - -export function useSuspenseQueries< - T extends Array, - TCombinedResult = SuspenseQueriesResults, ->( - options: { - queries: - | readonly [...SuspenseQueriesOptions] - | readonly [...{ [K in keyof T]: GetUseSuspenseQueryOptions }] - combine?: (result: SuspenseQueriesResults) => TCombinedResult - }, - queryClient?: QueryClient, -): TCombinedResult - -export function useSuspenseQueries< - T extends Array, - TCombinedResult = SuspenseQueriesResults, ->( - options: { - queries: readonly [...SuspenseQueriesOptions] - combine?: (result: SuspenseQueriesResults) => TCombinedResult - }, - queryClient?: QueryClient, -): TCombinedResult - -export function useSuspenseQueries(options: any, queryClient?: QueryClient) { - return useQueries( - { - ...options, - queries: options.queries.map((query: any) => { - if (process.env.NODE_ENV !== 'production') { - if (query.queryFn === skipToken) { - console.error('skipToken is not allowed for useSuspenseQueries') - } - } - - return { - ...query, - suspense: true, - throwOnError: defaultThrowOnError, - enabled: true, - placeholderData: undefined, - } - }), - }, - queryClient, - ) -} diff --git a/node_modules/@tanstack/react-query/src/useSuspenseQuery.ts b/node_modules/@tanstack/react-query/src/useSuspenseQuery.ts deleted file mode 100644 index 7dfdb06..0000000 --- a/node_modules/@tanstack/react-query/src/useSuspenseQuery.ts +++ /dev/null @@ -1,34 +0,0 @@ -'use client' -import { QueryObserver, skipToken } from '@tanstack/query-core' -import { useBaseQuery } from './useBaseQuery' -import { defaultThrowOnError } from './suspense' -import type { UseSuspenseQueryOptions, UseSuspenseQueryResult } from './types' -import type { DefaultError, QueryClient, QueryKey } from '@tanstack/query-core' - -export function useSuspenseQuery< - TQueryFnData = unknown, - TError = DefaultError, - TData = TQueryFnData, - TQueryKey extends QueryKey = QueryKey, ->( - options: UseSuspenseQueryOptions, - queryClient?: QueryClient, -): UseSuspenseQueryResult { - if (process.env.NODE_ENV !== 'production') { - if ((options.queryFn as any) === skipToken) { - console.error('skipToken is not allowed for useSuspenseQuery') - } - } - - return useBaseQuery( - { - ...options, - enabled: true, - suspense: true, - throwOnError: defaultThrowOnError, - placeholderData: undefined, - }, - QueryObserver, - queryClient, - ) as UseSuspenseQueryResult -} diff --git a/node_modules/react/LICENSE b/node_modules/react/LICENSE deleted file mode 100644 index b93be90..0000000 --- a/node_modules/react/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) Meta Platforms, Inc. and affiliates. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/node_modules/react/README.md b/node_modules/react/README.md deleted file mode 100644 index 20a855e..0000000 --- a/node_modules/react/README.md +++ /dev/null @@ -1,37 +0,0 @@ -# `react` - -React is a JavaScript library for creating user interfaces. - -The `react` package contains only the functionality necessary to define React components. It is typically used together with a React renderer like `react-dom` for the web, or `react-native` for the native environments. - -**Note:** by default, React will be in development mode. The development version includes extra warnings about common mistakes, whereas the production version includes extra performance optimizations and strips all error messages. Don't forget to use the [production build](https://reactjs.org/docs/optimizing-performance.html#use-the-production-build) when deploying your application. - -## Usage - -```js -import { useState } from 'react'; -import { createRoot } from 'react-dom/client'; - -function Counter() { - const [count, setCount] = useState(0); - return ( - <> -

{count}

- - - ); -} - -const root = createRoot(document.getElementById('root')); -root.render(); -``` - -## Documentation - -See https://react.dev/ - -## API - -See https://react.dev/reference/react diff --git a/node_modules/react/cjs/react-compiler-runtime.development.js b/node_modules/react/cjs/react-compiler-runtime.development.js deleted file mode 100644 index 84ceaac..0000000 --- a/node_modules/react/cjs/react-compiler-runtime.development.js +++ /dev/null @@ -1,24 +0,0 @@ -/** - * @license React - * react-compiler-runtime.development.js - * - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - -"use strict"; -"production" !== process.env.NODE_ENV && - (function () { - var ReactSharedInternals = - require("react").__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE; - exports.c = function (size) { - var dispatcher = ReactSharedInternals.H; - null === dispatcher && - console.error( - "Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\n1. You might have mismatching versions of React and the renderer (such as React DOM)\n2. You might be breaking the Rules of Hooks\n3. You might have more than one copy of React in the same app\nSee https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem." - ); - return dispatcher.useMemoCache(size); - }; - })(); diff --git a/node_modules/react/cjs/react-compiler-runtime.production.js b/node_modules/react/cjs/react-compiler-runtime.production.js deleted file mode 100644 index 4d5ade3..0000000 --- a/node_modules/react/cjs/react-compiler-runtime.production.js +++ /dev/null @@ -1,16 +0,0 @@ -/** - * @license React - * react-compiler-runtime.production.js - * - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - -"use strict"; -var ReactSharedInternals = - require("react").__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE; -exports.c = function (size) { - return ReactSharedInternals.H.useMemoCache(size); -}; diff --git a/node_modules/react/cjs/react-compiler-runtime.profiling.js b/node_modules/react/cjs/react-compiler-runtime.profiling.js deleted file mode 100644 index 9b93257..0000000 --- a/node_modules/react/cjs/react-compiler-runtime.profiling.js +++ /dev/null @@ -1,16 +0,0 @@ -/** - * @license React - * react-compiler-runtime.profiling.js - * - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - -"use strict"; -var ReactSharedInternals = - require("react").__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE; -exports.c = function (size) { - return ReactSharedInternals.H.useMemoCache(size); -}; diff --git a/node_modules/react/cjs/react-jsx-dev-runtime.development.js b/node_modules/react/cjs/react-jsx-dev-runtime.development.js deleted file mode 100644 index 95f9877..0000000 --- a/node_modules/react/cjs/react-jsx-dev-runtime.development.js +++ /dev/null @@ -1,338 +0,0 @@ -/** - * @license React - * react-jsx-dev-runtime.development.js - * - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - -"use strict"; -"production" !== process.env.NODE_ENV && - (function () { - function getComponentNameFromType(type) { - if (null == type) return null; - if ("function" === typeof type) - return type.$$typeof === REACT_CLIENT_REFERENCE - ? null - : type.displayName || type.name || null; - if ("string" === typeof type) return type; - switch (type) { - case REACT_FRAGMENT_TYPE: - return "Fragment"; - case REACT_PROFILER_TYPE: - return "Profiler"; - case REACT_STRICT_MODE_TYPE: - return "StrictMode"; - case REACT_SUSPENSE_TYPE: - return "Suspense"; - case REACT_SUSPENSE_LIST_TYPE: - return "SuspenseList"; - case REACT_ACTIVITY_TYPE: - return "Activity"; - } - if ("object" === typeof type) - switch ( - ("number" === typeof type.tag && - console.error( - "Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue." - ), - type.$$typeof) - ) { - case REACT_PORTAL_TYPE: - return "Portal"; - case REACT_CONTEXT_TYPE: - return type.displayName || "Context"; - case REACT_CONSUMER_TYPE: - return (type._context.displayName || "Context") + ".Consumer"; - case REACT_FORWARD_REF_TYPE: - var innerType = type.render; - type = type.displayName; - type || - ((type = innerType.displayName || innerType.name || ""), - (type = "" !== type ? "ForwardRef(" + type + ")" : "ForwardRef")); - return type; - case REACT_MEMO_TYPE: - return ( - (innerType = type.displayName || null), - null !== innerType - ? innerType - : getComponentNameFromType(type.type) || "Memo" - ); - case REACT_LAZY_TYPE: - innerType = type._payload; - type = type._init; - try { - return getComponentNameFromType(type(innerType)); - } catch (x) {} - } - return null; - } - function testStringCoercion(value) { - return "" + value; - } - function checkKeyStringCoercion(value) { - try { - testStringCoercion(value); - var JSCompiler_inline_result = !1; - } catch (e) { - JSCompiler_inline_result = !0; - } - if (JSCompiler_inline_result) { - JSCompiler_inline_result = console; - var JSCompiler_temp_const = JSCompiler_inline_result.error; - var JSCompiler_inline_result$jscomp$0 = - ("function" === typeof Symbol && - Symbol.toStringTag && - value[Symbol.toStringTag]) || - value.constructor.name || - "Object"; - JSCompiler_temp_const.call( - JSCompiler_inline_result, - "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.", - JSCompiler_inline_result$jscomp$0 - ); - return testStringCoercion(value); - } - } - function getTaskName(type) { - if (type === REACT_FRAGMENT_TYPE) return "<>"; - if ( - "object" === typeof type && - null !== type && - type.$$typeof === REACT_LAZY_TYPE - ) - return "<...>"; - try { - var name = getComponentNameFromType(type); - return name ? "<" + name + ">" : "<...>"; - } catch (x) { - return "<...>"; - } - } - function getOwner() { - var dispatcher = ReactSharedInternals.A; - return null === dispatcher ? null : dispatcher.getOwner(); - } - function UnknownOwner() { - return Error("react-stack-top-frame"); - } - function hasValidKey(config) { - if (hasOwnProperty.call(config, "key")) { - var getter = Object.getOwnPropertyDescriptor(config, "key").get; - if (getter && getter.isReactWarning) return !1; - } - return void 0 !== config.key; - } - function defineKeyPropWarningGetter(props, displayName) { - function warnAboutAccessingKey() { - specialPropKeyWarningShown || - ((specialPropKeyWarningShown = !0), - console.error( - "%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)", - displayName - )); - } - warnAboutAccessingKey.isReactWarning = !0; - Object.defineProperty(props, "key", { - get: warnAboutAccessingKey, - configurable: !0 - }); - } - function elementRefGetterWithDeprecationWarning() { - var componentName = getComponentNameFromType(this.type); - didWarnAboutElementRef[componentName] || - ((didWarnAboutElementRef[componentName] = !0), - console.error( - "Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release." - )); - componentName = this.props.ref; - return void 0 !== componentName ? componentName : null; - } - function ReactElement(type, key, props, owner, debugStack, debugTask) { - var refProp = props.ref; - type = { - $$typeof: REACT_ELEMENT_TYPE, - type: type, - key: key, - props: props, - _owner: owner - }; - null !== (void 0 !== refProp ? refProp : null) - ? Object.defineProperty(type, "ref", { - enumerable: !1, - get: elementRefGetterWithDeprecationWarning - }) - : Object.defineProperty(type, "ref", { enumerable: !1, value: null }); - type._store = {}; - Object.defineProperty(type._store, "validated", { - configurable: !1, - enumerable: !1, - writable: !0, - value: 0 - }); - Object.defineProperty(type, "_debugInfo", { - configurable: !1, - enumerable: !1, - writable: !0, - value: null - }); - Object.defineProperty(type, "_debugStack", { - configurable: !1, - enumerable: !1, - writable: !0, - value: debugStack - }); - Object.defineProperty(type, "_debugTask", { - configurable: !1, - enumerable: !1, - writable: !0, - value: debugTask - }); - Object.freeze && (Object.freeze(type.props), Object.freeze(type)); - return type; - } - function jsxDEVImpl( - type, - config, - maybeKey, - isStaticChildren, - debugStack, - debugTask - ) { - var children = config.children; - if (void 0 !== children) - if (isStaticChildren) - if (isArrayImpl(children)) { - for ( - isStaticChildren = 0; - isStaticChildren < children.length; - isStaticChildren++ - ) - validateChildKeys(children[isStaticChildren]); - Object.freeze && Object.freeze(children); - } else - console.error( - "React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead." - ); - else validateChildKeys(children); - if (hasOwnProperty.call(config, "key")) { - children = getComponentNameFromType(type); - var keys = Object.keys(config).filter(function (k) { - return "key" !== k; - }); - isStaticChildren = - 0 < keys.length - ? "{key: someKey, " + keys.join(": ..., ") + ": ...}" - : "{key: someKey}"; - didWarnAboutKeySpread[children + isStaticChildren] || - ((keys = - 0 < keys.length ? "{" + keys.join(": ..., ") + ": ...}" : "{}"), - console.error( - 'A props object containing a "key" prop is being spread into JSX:\n let props = %s;\n <%s {...props} />\nReact keys must be passed directly to JSX without using spread:\n let props = %s;\n <%s key={someKey} {...props} />', - isStaticChildren, - children, - keys, - children - ), - (didWarnAboutKeySpread[children + isStaticChildren] = !0)); - } - children = null; - void 0 !== maybeKey && - (checkKeyStringCoercion(maybeKey), (children = "" + maybeKey)); - hasValidKey(config) && - (checkKeyStringCoercion(config.key), (children = "" + config.key)); - if ("key" in config) { - maybeKey = {}; - for (var propName in config) - "key" !== propName && (maybeKey[propName] = config[propName]); - } else maybeKey = config; - children && - defineKeyPropWarningGetter( - maybeKey, - "function" === typeof type - ? type.displayName || type.name || "Unknown" - : type - ); - return ReactElement( - type, - children, - maybeKey, - getOwner(), - debugStack, - debugTask - ); - } - function validateChildKeys(node) { - isValidElement(node) - ? node._store && (node._store.validated = 1) - : "object" === typeof node && - null !== node && - node.$$typeof === REACT_LAZY_TYPE && - ("fulfilled" === node._payload.status - ? isValidElement(node._payload.value) && - node._payload.value._store && - (node._payload.value._store.validated = 1) - : node._store && (node._store.validated = 1)); - } - function isValidElement(object) { - return ( - "object" === typeof object && - null !== object && - object.$$typeof === REACT_ELEMENT_TYPE - ); - } - var React = require("react"), - REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"), - REACT_PORTAL_TYPE = Symbol.for("react.portal"), - REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"), - REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"), - REACT_PROFILER_TYPE = Symbol.for("react.profiler"), - REACT_CONSUMER_TYPE = Symbol.for("react.consumer"), - REACT_CONTEXT_TYPE = Symbol.for("react.context"), - REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"), - REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"), - REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"), - REACT_MEMO_TYPE = Symbol.for("react.memo"), - REACT_LAZY_TYPE = Symbol.for("react.lazy"), - REACT_ACTIVITY_TYPE = Symbol.for("react.activity"), - REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference"), - ReactSharedInternals = - React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, - hasOwnProperty = Object.prototype.hasOwnProperty, - isArrayImpl = Array.isArray, - createTask = console.createTask - ? console.createTask - : function () { - return null; - }; - React = { - react_stack_bottom_frame: function (callStackForError) { - return callStackForError(); - } - }; - var specialPropKeyWarningShown; - var didWarnAboutElementRef = {}; - var unknownOwnerDebugStack = React.react_stack_bottom_frame.bind( - React, - UnknownOwner - )(); - var unknownOwnerDebugTask = createTask(getTaskName(UnknownOwner)); - var didWarnAboutKeySpread = {}; - exports.Fragment = REACT_FRAGMENT_TYPE; - exports.jsxDEV = function (type, config, maybeKey, isStaticChildren) { - var trackActualOwner = - 1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++; - return jsxDEVImpl( - type, - config, - maybeKey, - isStaticChildren, - trackActualOwner - ? Error("react-stack-top-frame") - : unknownOwnerDebugStack, - trackActualOwner ? createTask(getTaskName(type)) : unknownOwnerDebugTask - ); - }; - })(); diff --git a/node_modules/react/cjs/react-jsx-dev-runtime.production.js b/node_modules/react/cjs/react-jsx-dev-runtime.production.js deleted file mode 100644 index 22ad886..0000000 --- a/node_modules/react/cjs/react-jsx-dev-runtime.production.js +++ /dev/null @@ -1,14 +0,0 @@ -/** - * @license React - * react-jsx-dev-runtime.production.js - * - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - -"use strict"; -var REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"); -exports.Fragment = REACT_FRAGMENT_TYPE; -exports.jsxDEV = void 0; diff --git a/node_modules/react/cjs/react-jsx-dev-runtime.profiling.js b/node_modules/react/cjs/react-jsx-dev-runtime.profiling.js deleted file mode 100644 index f9e8942..0000000 --- a/node_modules/react/cjs/react-jsx-dev-runtime.profiling.js +++ /dev/null @@ -1,14 +0,0 @@ -/** - * @license React - * react-jsx-dev-runtime.profiling.js - * - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - -"use strict"; -var REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"); -exports.Fragment = REACT_FRAGMENT_TYPE; -exports.jsxDEV = void 0; diff --git a/node_modules/react/cjs/react-jsx-dev-runtime.react-server.development.js b/node_modules/react/cjs/react-jsx-dev-runtime.react-server.development.js deleted file mode 100644 index b79b758..0000000 --- a/node_modules/react/cjs/react-jsx-dev-runtime.react-server.development.js +++ /dev/null @@ -1,370 +0,0 @@ -/** - * @license React - * react-jsx-dev-runtime.react-server.development.js - * - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - -"use strict"; -"production" !== process.env.NODE_ENV && - (function () { - function getComponentNameFromType(type) { - if (null == type) return null; - if ("function" === typeof type) - return type.$$typeof === REACT_CLIENT_REFERENCE - ? null - : type.displayName || type.name || null; - if ("string" === typeof type) return type; - switch (type) { - case REACT_FRAGMENT_TYPE: - return "Fragment"; - case REACT_PROFILER_TYPE: - return "Profiler"; - case REACT_STRICT_MODE_TYPE: - return "StrictMode"; - case REACT_SUSPENSE_TYPE: - return "Suspense"; - case REACT_SUSPENSE_LIST_TYPE: - return "SuspenseList"; - case REACT_ACTIVITY_TYPE: - return "Activity"; - } - if ("object" === typeof type) - switch ( - ("number" === typeof type.tag && - console.error( - "Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue." - ), - type.$$typeof) - ) { - case REACT_PORTAL_TYPE: - return "Portal"; - case REACT_CONTEXT_TYPE: - return type.displayName || "Context"; - case REACT_CONSUMER_TYPE: - return (type._context.displayName || "Context") + ".Consumer"; - case REACT_FORWARD_REF_TYPE: - var innerType = type.render; - type = type.displayName; - type || - ((type = innerType.displayName || innerType.name || ""), - (type = "" !== type ? "ForwardRef(" + type + ")" : "ForwardRef")); - return type; - case REACT_MEMO_TYPE: - return ( - (innerType = type.displayName || null), - null !== innerType - ? innerType - : getComponentNameFromType(type.type) || "Memo" - ); - case REACT_LAZY_TYPE: - innerType = type._payload; - type = type._init; - try { - return getComponentNameFromType(type(innerType)); - } catch (x) {} - } - return null; - } - function testStringCoercion(value) { - return "" + value; - } - function checkKeyStringCoercion(value) { - try { - testStringCoercion(value); - var JSCompiler_inline_result = !1; - } catch (e) { - JSCompiler_inline_result = !0; - } - if (JSCompiler_inline_result) { - JSCompiler_inline_result = console; - var JSCompiler_temp_const = JSCompiler_inline_result.error; - var JSCompiler_inline_result$jscomp$0 = - ("function" === typeof Symbol && - Symbol.toStringTag && - value[Symbol.toStringTag]) || - value.constructor.name || - "Object"; - JSCompiler_temp_const.call( - JSCompiler_inline_result, - "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.", - JSCompiler_inline_result$jscomp$0 - ); - return testStringCoercion(value); - } - } - function getTaskName(type) { - if (type === REACT_FRAGMENT_TYPE) return "<>"; - if ( - "object" === typeof type && - null !== type && - type.$$typeof === REACT_LAZY_TYPE - ) - return "<...>"; - try { - var name = getComponentNameFromType(type); - return name ? "<" + name + ">" : "<...>"; - } catch (x) { - return "<...>"; - } - } - function getOwner() { - var dispatcher = ReactSharedInternalsServer.A; - return null === dispatcher ? null : dispatcher.getOwner(); - } - function UnknownOwner() { - return Error("react-stack-top-frame"); - } - function hasValidKey(config) { - if (hasOwnProperty.call(config, "key")) { - var getter = Object.getOwnPropertyDescriptor(config, "key").get; - if (getter && getter.isReactWarning) return !1; - } - return void 0 !== config.key; - } - function defineKeyPropWarningGetter(props, displayName) { - function warnAboutAccessingKey() { - specialPropKeyWarningShown || - ((specialPropKeyWarningShown = !0), - console.error( - "%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)", - displayName - )); - } - warnAboutAccessingKey.isReactWarning = !0; - Object.defineProperty(props, "key", { - get: warnAboutAccessingKey, - configurable: !0 - }); - } - function elementRefGetterWithDeprecationWarning() { - var componentName = getComponentNameFromType(this.type); - didWarnAboutElementRef[componentName] || - ((didWarnAboutElementRef[componentName] = !0), - console.error( - "Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release." - )); - componentName = this.props.ref; - return void 0 !== componentName ? componentName : null; - } - function ReactElement(type, key, props, owner, debugStack, debugTask) { - var refProp = props.ref; - type = { - $$typeof: REACT_ELEMENT_TYPE, - type: type, - key: key, - props: props, - _owner: owner - }; - null !== (void 0 !== refProp ? refProp : null) - ? Object.defineProperty(type, "ref", { - enumerable: !1, - get: elementRefGetterWithDeprecationWarning - }) - : Object.defineProperty(type, "ref", { enumerable: !1, value: null }); - type._store = {}; - Object.defineProperty(type._store, "validated", { - configurable: !1, - enumerable: !1, - writable: !0, - value: 0 - }); - Object.defineProperty(type, "_debugInfo", { - configurable: !1, - enumerable: !1, - writable: !0, - value: null - }); - Object.defineProperty(type, "_debugStack", { - configurable: !1, - enumerable: !1, - writable: !0, - value: debugStack - }); - Object.defineProperty(type, "_debugTask", { - configurable: !1, - enumerable: !1, - writable: !0, - value: debugTask - }); - Object.freeze && (Object.freeze(type.props), Object.freeze(type)); - return type; - } - function jsxDEVImpl( - type, - config, - maybeKey, - isStaticChildren, - debugStack, - debugTask - ) { - var children = config.children; - if (void 0 !== children) - if (isStaticChildren) - if (isArrayImpl(children)) { - for ( - isStaticChildren = 0; - isStaticChildren < children.length; - isStaticChildren++ - ) - validateChildKeys(children[isStaticChildren]); - Object.freeze && Object.freeze(children); - } else - console.error( - "React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead." - ); - else validateChildKeys(children); - if (hasOwnProperty.call(config, "key")) { - children = getComponentNameFromType(type); - var keys = Object.keys(config).filter(function (k) { - return "key" !== k; - }); - isStaticChildren = - 0 < keys.length - ? "{key: someKey, " + keys.join(": ..., ") + ": ...}" - : "{key: someKey}"; - didWarnAboutKeySpread[children + isStaticChildren] || - ((keys = - 0 < keys.length ? "{" + keys.join(": ..., ") + ": ...}" : "{}"), - console.error( - 'A props object containing a "key" prop is being spread into JSX:\n let props = %s;\n <%s {...props} />\nReact keys must be passed directly to JSX without using spread:\n let props = %s;\n <%s key={someKey} {...props} />', - isStaticChildren, - children, - keys, - children - ), - (didWarnAboutKeySpread[children + isStaticChildren] = !0)); - } - children = null; - void 0 !== maybeKey && - (checkKeyStringCoercion(maybeKey), (children = "" + maybeKey)); - hasValidKey(config) && - (checkKeyStringCoercion(config.key), (children = "" + config.key)); - if ("key" in config) { - maybeKey = {}; - for (var propName in config) - "key" !== propName && (maybeKey[propName] = config[propName]); - } else maybeKey = config; - children && - defineKeyPropWarningGetter( - maybeKey, - "function" === typeof type - ? type.displayName || type.name || "Unknown" - : type - ); - return ReactElement( - type, - children, - maybeKey, - getOwner(), - debugStack, - debugTask - ); - } - function validateChildKeys(node) { - isValidElement(node) - ? node._store && (node._store.validated = 1) - : "object" === typeof node && - null !== node && - node.$$typeof === REACT_LAZY_TYPE && - ("fulfilled" === node._payload.status - ? isValidElement(node._payload.value) && - node._payload.value._store && - (node._payload.value._store.validated = 1) - : node._store && (node._store.validated = 1)); - } - function isValidElement(object) { - return ( - "object" === typeof object && - null !== object && - object.$$typeof === REACT_ELEMENT_TYPE - ); - } - var React = require("react"), - REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"), - REACT_PORTAL_TYPE = Symbol.for("react.portal"), - REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"), - REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"), - REACT_PROFILER_TYPE = Symbol.for("react.profiler"), - REACT_CONSUMER_TYPE = Symbol.for("react.consumer"), - REACT_CONTEXT_TYPE = Symbol.for("react.context"), - REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"), - REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"), - REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"), - REACT_MEMO_TYPE = Symbol.for("react.memo"), - REACT_LAZY_TYPE = Symbol.for("react.lazy"), - REACT_ACTIVITY_TYPE = Symbol.for("react.activity"), - REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference"), - ReactSharedInternalsServer = - React.__SERVER_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE; - if (!ReactSharedInternalsServer) - throw Error( - 'The "react" package in this environment is not configured correctly. The "react-server" condition must be enabled in any environment that runs React Server Components.' - ); - var hasOwnProperty = Object.prototype.hasOwnProperty, - isArrayImpl = Array.isArray, - createTask = console.createTask - ? console.createTask - : function () { - return null; - }; - React = { - react_stack_bottom_frame: function (callStackForError) { - return callStackForError(); - } - }; - var specialPropKeyWarningShown; - var didWarnAboutElementRef = {}; - var unknownOwnerDebugStack = React.react_stack_bottom_frame.bind( - React, - UnknownOwner - )(); - var unknownOwnerDebugTask = createTask(getTaskName(UnknownOwner)); - var didWarnAboutKeySpread = {}; - exports.Fragment = REACT_FRAGMENT_TYPE; - exports.jsx = function (type, config, maybeKey) { - var trackActualOwner = - 1e4 > ReactSharedInternalsServer.recentlyCreatedOwnerStacks++; - return jsxDEVImpl( - type, - config, - maybeKey, - !1, - trackActualOwner - ? Error("react-stack-top-frame") - : unknownOwnerDebugStack, - trackActualOwner ? createTask(getTaskName(type)) : unknownOwnerDebugTask - ); - }; - exports.jsxDEV = function (type, config, maybeKey, isStaticChildren) { - var trackActualOwner = - 1e4 > ReactSharedInternalsServer.recentlyCreatedOwnerStacks++; - return jsxDEVImpl( - type, - config, - maybeKey, - isStaticChildren, - trackActualOwner - ? Error("react-stack-top-frame") - : unknownOwnerDebugStack, - trackActualOwner ? createTask(getTaskName(type)) : unknownOwnerDebugTask - ); - }; - exports.jsxs = function (type, config, maybeKey) { - var trackActualOwner = - 1e4 > ReactSharedInternalsServer.recentlyCreatedOwnerStacks++; - return jsxDEVImpl( - type, - config, - maybeKey, - !0, - trackActualOwner - ? Error("react-stack-top-frame") - : unknownOwnerDebugStack, - trackActualOwner ? createTask(getTaskName(type)) : unknownOwnerDebugTask - ); - }; - })(); diff --git a/node_modules/react/cjs/react-jsx-dev-runtime.react-server.production.js b/node_modules/react/cjs/react-jsx-dev-runtime.react-server.production.js deleted file mode 100644 index 0664121..0000000 --- a/node_modules/react/cjs/react-jsx-dev-runtime.react-server.production.js +++ /dev/null @@ -1,40 +0,0 @@ -/** - * @license React - * react-jsx-dev-runtime.react-server.production.js - * - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - -"use strict"; -var React = require("react"), - REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"), - REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"); -if (!React.__SERVER_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE) - throw Error( - 'The "react" package in this environment is not configured correctly. The "react-server" condition must be enabled in any environment that runs React Server Components.' - ); -function jsxProd(type, config, maybeKey) { - var key = null; - void 0 !== maybeKey && (key = "" + maybeKey); - void 0 !== config.key && (key = "" + config.key); - if ("key" in config) { - maybeKey = {}; - for (var propName in config) - "key" !== propName && (maybeKey[propName] = config[propName]); - } else maybeKey = config; - config = maybeKey.ref; - return { - $$typeof: REACT_ELEMENT_TYPE, - type: type, - key: key, - ref: void 0 !== config ? config : null, - props: maybeKey - }; -} -exports.Fragment = REACT_FRAGMENT_TYPE; -exports.jsx = jsxProd; -exports.jsxDEV = void 0; -exports.jsxs = jsxProd; diff --git a/node_modules/react/cjs/react-jsx-runtime.development.js b/node_modules/react/cjs/react-jsx-runtime.development.js deleted file mode 100644 index 35331a3..0000000 --- a/node_modules/react/cjs/react-jsx-runtime.development.js +++ /dev/null @@ -1,352 +0,0 @@ -/** - * @license React - * react-jsx-runtime.development.js - * - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - -"use strict"; -"production" !== process.env.NODE_ENV && - (function () { - function getComponentNameFromType(type) { - if (null == type) return null; - if ("function" === typeof type) - return type.$$typeof === REACT_CLIENT_REFERENCE - ? null - : type.displayName || type.name || null; - if ("string" === typeof type) return type; - switch (type) { - case REACT_FRAGMENT_TYPE: - return "Fragment"; - case REACT_PROFILER_TYPE: - return "Profiler"; - case REACT_STRICT_MODE_TYPE: - return "StrictMode"; - case REACT_SUSPENSE_TYPE: - return "Suspense"; - case REACT_SUSPENSE_LIST_TYPE: - return "SuspenseList"; - case REACT_ACTIVITY_TYPE: - return "Activity"; - } - if ("object" === typeof type) - switch ( - ("number" === typeof type.tag && - console.error( - "Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue." - ), - type.$$typeof) - ) { - case REACT_PORTAL_TYPE: - return "Portal"; - case REACT_CONTEXT_TYPE: - return type.displayName || "Context"; - case REACT_CONSUMER_TYPE: - return (type._context.displayName || "Context") + ".Consumer"; - case REACT_FORWARD_REF_TYPE: - var innerType = type.render; - type = type.displayName; - type || - ((type = innerType.displayName || innerType.name || ""), - (type = "" !== type ? "ForwardRef(" + type + ")" : "ForwardRef")); - return type; - case REACT_MEMO_TYPE: - return ( - (innerType = type.displayName || null), - null !== innerType - ? innerType - : getComponentNameFromType(type.type) || "Memo" - ); - case REACT_LAZY_TYPE: - innerType = type._payload; - type = type._init; - try { - return getComponentNameFromType(type(innerType)); - } catch (x) {} - } - return null; - } - function testStringCoercion(value) { - return "" + value; - } - function checkKeyStringCoercion(value) { - try { - testStringCoercion(value); - var JSCompiler_inline_result = !1; - } catch (e) { - JSCompiler_inline_result = !0; - } - if (JSCompiler_inline_result) { - JSCompiler_inline_result = console; - var JSCompiler_temp_const = JSCompiler_inline_result.error; - var JSCompiler_inline_result$jscomp$0 = - ("function" === typeof Symbol && - Symbol.toStringTag && - value[Symbol.toStringTag]) || - value.constructor.name || - "Object"; - JSCompiler_temp_const.call( - JSCompiler_inline_result, - "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.", - JSCompiler_inline_result$jscomp$0 - ); - return testStringCoercion(value); - } - } - function getTaskName(type) { - if (type === REACT_FRAGMENT_TYPE) return "<>"; - if ( - "object" === typeof type && - null !== type && - type.$$typeof === REACT_LAZY_TYPE - ) - return "<...>"; - try { - var name = getComponentNameFromType(type); - return name ? "<" + name + ">" : "<...>"; - } catch (x) { - return "<...>"; - } - } - function getOwner() { - var dispatcher = ReactSharedInternals.A; - return null === dispatcher ? null : dispatcher.getOwner(); - } - function UnknownOwner() { - return Error("react-stack-top-frame"); - } - function hasValidKey(config) { - if (hasOwnProperty.call(config, "key")) { - var getter = Object.getOwnPropertyDescriptor(config, "key").get; - if (getter && getter.isReactWarning) return !1; - } - return void 0 !== config.key; - } - function defineKeyPropWarningGetter(props, displayName) { - function warnAboutAccessingKey() { - specialPropKeyWarningShown || - ((specialPropKeyWarningShown = !0), - console.error( - "%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)", - displayName - )); - } - warnAboutAccessingKey.isReactWarning = !0; - Object.defineProperty(props, "key", { - get: warnAboutAccessingKey, - configurable: !0 - }); - } - function elementRefGetterWithDeprecationWarning() { - var componentName = getComponentNameFromType(this.type); - didWarnAboutElementRef[componentName] || - ((didWarnAboutElementRef[componentName] = !0), - console.error( - "Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release." - )); - componentName = this.props.ref; - return void 0 !== componentName ? componentName : null; - } - function ReactElement(type, key, props, owner, debugStack, debugTask) { - var refProp = props.ref; - type = { - $$typeof: REACT_ELEMENT_TYPE, - type: type, - key: key, - props: props, - _owner: owner - }; - null !== (void 0 !== refProp ? refProp : null) - ? Object.defineProperty(type, "ref", { - enumerable: !1, - get: elementRefGetterWithDeprecationWarning - }) - : Object.defineProperty(type, "ref", { enumerable: !1, value: null }); - type._store = {}; - Object.defineProperty(type._store, "validated", { - configurable: !1, - enumerable: !1, - writable: !0, - value: 0 - }); - Object.defineProperty(type, "_debugInfo", { - configurable: !1, - enumerable: !1, - writable: !0, - value: null - }); - Object.defineProperty(type, "_debugStack", { - configurable: !1, - enumerable: !1, - writable: !0, - value: debugStack - }); - Object.defineProperty(type, "_debugTask", { - configurable: !1, - enumerable: !1, - writable: !0, - value: debugTask - }); - Object.freeze && (Object.freeze(type.props), Object.freeze(type)); - return type; - } - function jsxDEVImpl( - type, - config, - maybeKey, - isStaticChildren, - debugStack, - debugTask - ) { - var children = config.children; - if (void 0 !== children) - if (isStaticChildren) - if (isArrayImpl(children)) { - for ( - isStaticChildren = 0; - isStaticChildren < children.length; - isStaticChildren++ - ) - validateChildKeys(children[isStaticChildren]); - Object.freeze && Object.freeze(children); - } else - console.error( - "React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead." - ); - else validateChildKeys(children); - if (hasOwnProperty.call(config, "key")) { - children = getComponentNameFromType(type); - var keys = Object.keys(config).filter(function (k) { - return "key" !== k; - }); - isStaticChildren = - 0 < keys.length - ? "{key: someKey, " + keys.join(": ..., ") + ": ...}" - : "{key: someKey}"; - didWarnAboutKeySpread[children + isStaticChildren] || - ((keys = - 0 < keys.length ? "{" + keys.join(": ..., ") + ": ...}" : "{}"), - console.error( - 'A props object containing a "key" prop is being spread into JSX:\n let props = %s;\n <%s {...props} />\nReact keys must be passed directly to JSX without using spread:\n let props = %s;\n <%s key={someKey} {...props} />', - isStaticChildren, - children, - keys, - children - ), - (didWarnAboutKeySpread[children + isStaticChildren] = !0)); - } - children = null; - void 0 !== maybeKey && - (checkKeyStringCoercion(maybeKey), (children = "" + maybeKey)); - hasValidKey(config) && - (checkKeyStringCoercion(config.key), (children = "" + config.key)); - if ("key" in config) { - maybeKey = {}; - for (var propName in config) - "key" !== propName && (maybeKey[propName] = config[propName]); - } else maybeKey = config; - children && - defineKeyPropWarningGetter( - maybeKey, - "function" === typeof type - ? type.displayName || type.name || "Unknown" - : type - ); - return ReactElement( - type, - children, - maybeKey, - getOwner(), - debugStack, - debugTask - ); - } - function validateChildKeys(node) { - isValidElement(node) - ? node._store && (node._store.validated = 1) - : "object" === typeof node && - null !== node && - node.$$typeof === REACT_LAZY_TYPE && - ("fulfilled" === node._payload.status - ? isValidElement(node._payload.value) && - node._payload.value._store && - (node._payload.value._store.validated = 1) - : node._store && (node._store.validated = 1)); - } - function isValidElement(object) { - return ( - "object" === typeof object && - null !== object && - object.$$typeof === REACT_ELEMENT_TYPE - ); - } - var React = require("react"), - REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"), - REACT_PORTAL_TYPE = Symbol.for("react.portal"), - REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"), - REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"), - REACT_PROFILER_TYPE = Symbol.for("react.profiler"), - REACT_CONSUMER_TYPE = Symbol.for("react.consumer"), - REACT_CONTEXT_TYPE = Symbol.for("react.context"), - REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"), - REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"), - REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"), - REACT_MEMO_TYPE = Symbol.for("react.memo"), - REACT_LAZY_TYPE = Symbol.for("react.lazy"), - REACT_ACTIVITY_TYPE = Symbol.for("react.activity"), - REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference"), - ReactSharedInternals = - React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, - hasOwnProperty = Object.prototype.hasOwnProperty, - isArrayImpl = Array.isArray, - createTask = console.createTask - ? console.createTask - : function () { - return null; - }; - React = { - react_stack_bottom_frame: function (callStackForError) { - return callStackForError(); - } - }; - var specialPropKeyWarningShown; - var didWarnAboutElementRef = {}; - var unknownOwnerDebugStack = React.react_stack_bottom_frame.bind( - React, - UnknownOwner - )(); - var unknownOwnerDebugTask = createTask(getTaskName(UnknownOwner)); - var didWarnAboutKeySpread = {}; - exports.Fragment = REACT_FRAGMENT_TYPE; - exports.jsx = function (type, config, maybeKey) { - var trackActualOwner = - 1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++; - return jsxDEVImpl( - type, - config, - maybeKey, - !1, - trackActualOwner - ? Error("react-stack-top-frame") - : unknownOwnerDebugStack, - trackActualOwner ? createTask(getTaskName(type)) : unknownOwnerDebugTask - ); - }; - exports.jsxs = function (type, config, maybeKey) { - var trackActualOwner = - 1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++; - return jsxDEVImpl( - type, - config, - maybeKey, - !0, - trackActualOwner - ? Error("react-stack-top-frame") - : unknownOwnerDebugStack, - trackActualOwner ? createTask(getTaskName(type)) : unknownOwnerDebugTask - ); - }; - })(); diff --git a/node_modules/react/cjs/react-jsx-runtime.production.js b/node_modules/react/cjs/react-jsx-runtime.production.js deleted file mode 100644 index 12d6088..0000000 --- a/node_modules/react/cjs/react-jsx-runtime.production.js +++ /dev/null @@ -1,34 +0,0 @@ -/** - * @license React - * react-jsx-runtime.production.js - * - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - -"use strict"; -var REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"), - REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"); -function jsxProd(type, config, maybeKey) { - var key = null; - void 0 !== maybeKey && (key = "" + maybeKey); - void 0 !== config.key && (key = "" + config.key); - if ("key" in config) { - maybeKey = {}; - for (var propName in config) - "key" !== propName && (maybeKey[propName] = config[propName]); - } else maybeKey = config; - config = maybeKey.ref; - return { - $$typeof: REACT_ELEMENT_TYPE, - type: type, - key: key, - ref: void 0 !== config ? config : null, - props: maybeKey - }; -} -exports.Fragment = REACT_FRAGMENT_TYPE; -exports.jsx = jsxProd; -exports.jsxs = jsxProd; diff --git a/node_modules/react/cjs/react-jsx-runtime.profiling.js b/node_modules/react/cjs/react-jsx-runtime.profiling.js deleted file mode 100644 index 68a28d6..0000000 --- a/node_modules/react/cjs/react-jsx-runtime.profiling.js +++ /dev/null @@ -1,34 +0,0 @@ -/** - * @license React - * react-jsx-runtime.profiling.js - * - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - -"use strict"; -var REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"), - REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"); -function jsxProd(type, config, maybeKey) { - var key = null; - void 0 !== maybeKey && (key = "" + maybeKey); - void 0 !== config.key && (key = "" + config.key); - if ("key" in config) { - maybeKey = {}; - for (var propName in config) - "key" !== propName && (maybeKey[propName] = config[propName]); - } else maybeKey = config; - config = maybeKey.ref; - return { - $$typeof: REACT_ELEMENT_TYPE, - type: type, - key: key, - ref: void 0 !== config ? config : null, - props: maybeKey - }; -} -exports.Fragment = REACT_FRAGMENT_TYPE; -exports.jsx = jsxProd; -exports.jsxs = jsxProd; diff --git a/node_modules/react/cjs/react-jsx-runtime.react-server.development.js b/node_modules/react/cjs/react-jsx-runtime.react-server.development.js deleted file mode 100644 index 59ee4be..0000000 --- a/node_modules/react/cjs/react-jsx-runtime.react-server.development.js +++ /dev/null @@ -1,370 +0,0 @@ -/** - * @license React - * react-jsx-runtime.react-server.development.js - * - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - -"use strict"; -"production" !== process.env.NODE_ENV && - (function () { - function getComponentNameFromType(type) { - if (null == type) return null; - if ("function" === typeof type) - return type.$$typeof === REACT_CLIENT_REFERENCE - ? null - : type.displayName || type.name || null; - if ("string" === typeof type) return type; - switch (type) { - case REACT_FRAGMENT_TYPE: - return "Fragment"; - case REACT_PROFILER_TYPE: - return "Profiler"; - case REACT_STRICT_MODE_TYPE: - return "StrictMode"; - case REACT_SUSPENSE_TYPE: - return "Suspense"; - case REACT_SUSPENSE_LIST_TYPE: - return "SuspenseList"; - case REACT_ACTIVITY_TYPE: - return "Activity"; - } - if ("object" === typeof type) - switch ( - ("number" === typeof type.tag && - console.error( - "Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue." - ), - type.$$typeof) - ) { - case REACT_PORTAL_TYPE: - return "Portal"; - case REACT_CONTEXT_TYPE: - return type.displayName || "Context"; - case REACT_CONSUMER_TYPE: - return (type._context.displayName || "Context") + ".Consumer"; - case REACT_FORWARD_REF_TYPE: - var innerType = type.render; - type = type.displayName; - type || - ((type = innerType.displayName || innerType.name || ""), - (type = "" !== type ? "ForwardRef(" + type + ")" : "ForwardRef")); - return type; - case REACT_MEMO_TYPE: - return ( - (innerType = type.displayName || null), - null !== innerType - ? innerType - : getComponentNameFromType(type.type) || "Memo" - ); - case REACT_LAZY_TYPE: - innerType = type._payload; - type = type._init; - try { - return getComponentNameFromType(type(innerType)); - } catch (x) {} - } - return null; - } - function testStringCoercion(value) { - return "" + value; - } - function checkKeyStringCoercion(value) { - try { - testStringCoercion(value); - var JSCompiler_inline_result = !1; - } catch (e) { - JSCompiler_inline_result = !0; - } - if (JSCompiler_inline_result) { - JSCompiler_inline_result = console; - var JSCompiler_temp_const = JSCompiler_inline_result.error; - var JSCompiler_inline_result$jscomp$0 = - ("function" === typeof Symbol && - Symbol.toStringTag && - value[Symbol.toStringTag]) || - value.constructor.name || - "Object"; - JSCompiler_temp_const.call( - JSCompiler_inline_result, - "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.", - JSCompiler_inline_result$jscomp$0 - ); - return testStringCoercion(value); - } - } - function getTaskName(type) { - if (type === REACT_FRAGMENT_TYPE) return "<>"; - if ( - "object" === typeof type && - null !== type && - type.$$typeof === REACT_LAZY_TYPE - ) - return "<...>"; - try { - var name = getComponentNameFromType(type); - return name ? "<" + name + ">" : "<...>"; - } catch (x) { - return "<...>"; - } - } - function getOwner() { - var dispatcher = ReactSharedInternalsServer.A; - return null === dispatcher ? null : dispatcher.getOwner(); - } - function UnknownOwner() { - return Error("react-stack-top-frame"); - } - function hasValidKey(config) { - if (hasOwnProperty.call(config, "key")) { - var getter = Object.getOwnPropertyDescriptor(config, "key").get; - if (getter && getter.isReactWarning) return !1; - } - return void 0 !== config.key; - } - function defineKeyPropWarningGetter(props, displayName) { - function warnAboutAccessingKey() { - specialPropKeyWarningShown || - ((specialPropKeyWarningShown = !0), - console.error( - "%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)", - displayName - )); - } - warnAboutAccessingKey.isReactWarning = !0; - Object.defineProperty(props, "key", { - get: warnAboutAccessingKey, - configurable: !0 - }); - } - function elementRefGetterWithDeprecationWarning() { - var componentName = getComponentNameFromType(this.type); - didWarnAboutElementRef[componentName] || - ((didWarnAboutElementRef[componentName] = !0), - console.error( - "Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release." - )); - componentName = this.props.ref; - return void 0 !== componentName ? componentName : null; - } - function ReactElement(type, key, props, owner, debugStack, debugTask) { - var refProp = props.ref; - type = { - $$typeof: REACT_ELEMENT_TYPE, - type: type, - key: key, - props: props, - _owner: owner - }; - null !== (void 0 !== refProp ? refProp : null) - ? Object.defineProperty(type, "ref", { - enumerable: !1, - get: elementRefGetterWithDeprecationWarning - }) - : Object.defineProperty(type, "ref", { enumerable: !1, value: null }); - type._store = {}; - Object.defineProperty(type._store, "validated", { - configurable: !1, - enumerable: !1, - writable: !0, - value: 0 - }); - Object.defineProperty(type, "_debugInfo", { - configurable: !1, - enumerable: !1, - writable: !0, - value: null - }); - Object.defineProperty(type, "_debugStack", { - configurable: !1, - enumerable: !1, - writable: !0, - value: debugStack - }); - Object.defineProperty(type, "_debugTask", { - configurable: !1, - enumerable: !1, - writable: !0, - value: debugTask - }); - Object.freeze && (Object.freeze(type.props), Object.freeze(type)); - return type; - } - function jsxDEVImpl( - type, - config, - maybeKey, - isStaticChildren, - debugStack, - debugTask - ) { - var children = config.children; - if (void 0 !== children) - if (isStaticChildren) - if (isArrayImpl(children)) { - for ( - isStaticChildren = 0; - isStaticChildren < children.length; - isStaticChildren++ - ) - validateChildKeys(children[isStaticChildren]); - Object.freeze && Object.freeze(children); - } else - console.error( - "React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead." - ); - else validateChildKeys(children); - if (hasOwnProperty.call(config, "key")) { - children = getComponentNameFromType(type); - var keys = Object.keys(config).filter(function (k) { - return "key" !== k; - }); - isStaticChildren = - 0 < keys.length - ? "{key: someKey, " + keys.join(": ..., ") + ": ...}" - : "{key: someKey}"; - didWarnAboutKeySpread[children + isStaticChildren] || - ((keys = - 0 < keys.length ? "{" + keys.join(": ..., ") + ": ...}" : "{}"), - console.error( - 'A props object containing a "key" prop is being spread into JSX:\n let props = %s;\n <%s {...props} />\nReact keys must be passed directly to JSX without using spread:\n let props = %s;\n <%s key={someKey} {...props} />', - isStaticChildren, - children, - keys, - children - ), - (didWarnAboutKeySpread[children + isStaticChildren] = !0)); - } - children = null; - void 0 !== maybeKey && - (checkKeyStringCoercion(maybeKey), (children = "" + maybeKey)); - hasValidKey(config) && - (checkKeyStringCoercion(config.key), (children = "" + config.key)); - if ("key" in config) { - maybeKey = {}; - for (var propName in config) - "key" !== propName && (maybeKey[propName] = config[propName]); - } else maybeKey = config; - children && - defineKeyPropWarningGetter( - maybeKey, - "function" === typeof type - ? type.displayName || type.name || "Unknown" - : type - ); - return ReactElement( - type, - children, - maybeKey, - getOwner(), - debugStack, - debugTask - ); - } - function validateChildKeys(node) { - isValidElement(node) - ? node._store && (node._store.validated = 1) - : "object" === typeof node && - null !== node && - node.$$typeof === REACT_LAZY_TYPE && - ("fulfilled" === node._payload.status - ? isValidElement(node._payload.value) && - node._payload.value._store && - (node._payload.value._store.validated = 1) - : node._store && (node._store.validated = 1)); - } - function isValidElement(object) { - return ( - "object" === typeof object && - null !== object && - object.$$typeof === REACT_ELEMENT_TYPE - ); - } - var React = require("react"), - REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"), - REACT_PORTAL_TYPE = Symbol.for("react.portal"), - REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"), - REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"), - REACT_PROFILER_TYPE = Symbol.for("react.profiler"), - REACT_CONSUMER_TYPE = Symbol.for("react.consumer"), - REACT_CONTEXT_TYPE = Symbol.for("react.context"), - REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"), - REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"), - REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"), - REACT_MEMO_TYPE = Symbol.for("react.memo"), - REACT_LAZY_TYPE = Symbol.for("react.lazy"), - REACT_ACTIVITY_TYPE = Symbol.for("react.activity"), - REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference"), - ReactSharedInternalsServer = - React.__SERVER_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE; - if (!ReactSharedInternalsServer) - throw Error( - 'The "react" package in this environment is not configured correctly. The "react-server" condition must be enabled in any environment that runs React Server Components.' - ); - var hasOwnProperty = Object.prototype.hasOwnProperty, - isArrayImpl = Array.isArray, - createTask = console.createTask - ? console.createTask - : function () { - return null; - }; - React = { - react_stack_bottom_frame: function (callStackForError) { - return callStackForError(); - } - }; - var specialPropKeyWarningShown; - var didWarnAboutElementRef = {}; - var unknownOwnerDebugStack = React.react_stack_bottom_frame.bind( - React, - UnknownOwner - )(); - var unknownOwnerDebugTask = createTask(getTaskName(UnknownOwner)); - var didWarnAboutKeySpread = {}; - exports.Fragment = REACT_FRAGMENT_TYPE; - exports.jsx = function (type, config, maybeKey) { - var trackActualOwner = - 1e4 > ReactSharedInternalsServer.recentlyCreatedOwnerStacks++; - return jsxDEVImpl( - type, - config, - maybeKey, - !1, - trackActualOwner - ? Error("react-stack-top-frame") - : unknownOwnerDebugStack, - trackActualOwner ? createTask(getTaskName(type)) : unknownOwnerDebugTask - ); - }; - exports.jsxDEV = function (type, config, maybeKey, isStaticChildren) { - var trackActualOwner = - 1e4 > ReactSharedInternalsServer.recentlyCreatedOwnerStacks++; - return jsxDEVImpl( - type, - config, - maybeKey, - isStaticChildren, - trackActualOwner - ? Error("react-stack-top-frame") - : unknownOwnerDebugStack, - trackActualOwner ? createTask(getTaskName(type)) : unknownOwnerDebugTask - ); - }; - exports.jsxs = function (type, config, maybeKey) { - var trackActualOwner = - 1e4 > ReactSharedInternalsServer.recentlyCreatedOwnerStacks++; - return jsxDEVImpl( - type, - config, - maybeKey, - !0, - trackActualOwner - ? Error("react-stack-top-frame") - : unknownOwnerDebugStack, - trackActualOwner ? createTask(getTaskName(type)) : unknownOwnerDebugTask - ); - }; - })(); diff --git a/node_modules/react/cjs/react-jsx-runtime.react-server.production.js b/node_modules/react/cjs/react-jsx-runtime.react-server.production.js deleted file mode 100644 index 486facb..0000000 --- a/node_modules/react/cjs/react-jsx-runtime.react-server.production.js +++ /dev/null @@ -1,40 +0,0 @@ -/** - * @license React - * react-jsx-runtime.react-server.production.js - * - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - -"use strict"; -var React = require("react"), - REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"), - REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"); -if (!React.__SERVER_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE) - throw Error( - 'The "react" package in this environment is not configured correctly. The "react-server" condition must be enabled in any environment that runs React Server Components.' - ); -function jsxProd(type, config, maybeKey) { - var key = null; - void 0 !== maybeKey && (key = "" + maybeKey); - void 0 !== config.key && (key = "" + config.key); - if ("key" in config) { - maybeKey = {}; - for (var propName in config) - "key" !== propName && (maybeKey[propName] = config[propName]); - } else maybeKey = config; - config = maybeKey.ref; - return { - $$typeof: REACT_ELEMENT_TYPE, - type: type, - key: key, - ref: void 0 !== config ? config : null, - props: maybeKey - }; -} -exports.Fragment = REACT_FRAGMENT_TYPE; -exports.jsx = jsxProd; -exports.jsxDEV = void 0; -exports.jsxs = jsxProd; diff --git a/node_modules/react/cjs/react.development.js b/node_modules/react/cjs/react.development.js deleted file mode 100644 index 8c026f9..0000000 --- a/node_modules/react/cjs/react.development.js +++ /dev/null @@ -1,1284 +0,0 @@ -/** - * @license React - * react.development.js - * - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - -"use strict"; -"production" !== process.env.NODE_ENV && - (function () { - function defineDeprecationWarning(methodName, info) { - Object.defineProperty(Component.prototype, methodName, { - get: function () { - console.warn( - "%s(...) is deprecated in plain JavaScript React classes. %s", - info[0], - info[1] - ); - } - }); - } - function getIteratorFn(maybeIterable) { - if (null === maybeIterable || "object" !== typeof maybeIterable) - return null; - maybeIterable = - (MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL]) || - maybeIterable["@@iterator"]; - return "function" === typeof maybeIterable ? maybeIterable : null; - } - function warnNoop(publicInstance, callerName) { - publicInstance = - ((publicInstance = publicInstance.constructor) && - (publicInstance.displayName || publicInstance.name)) || - "ReactClass"; - var warningKey = publicInstance + "." + callerName; - didWarnStateUpdateForUnmountedComponent[warningKey] || - (console.error( - "Can't call %s on a component that is not yet mounted. This is a no-op, but it might indicate a bug in your application. Instead, assign to `this.state` directly or define a `state = {};` class property with the desired state in the %s component.", - callerName, - publicInstance - ), - (didWarnStateUpdateForUnmountedComponent[warningKey] = !0)); - } - function Component(props, context, updater) { - this.props = props; - this.context = context; - this.refs = emptyObject; - this.updater = updater || ReactNoopUpdateQueue; - } - function ComponentDummy() {} - function PureComponent(props, context, updater) { - this.props = props; - this.context = context; - this.refs = emptyObject; - this.updater = updater || ReactNoopUpdateQueue; - } - function noop() {} - function testStringCoercion(value) { - return "" + value; - } - function checkKeyStringCoercion(value) { - try { - testStringCoercion(value); - var JSCompiler_inline_result = !1; - } catch (e) { - JSCompiler_inline_result = !0; - } - if (JSCompiler_inline_result) { - JSCompiler_inline_result = console; - var JSCompiler_temp_const = JSCompiler_inline_result.error; - var JSCompiler_inline_result$jscomp$0 = - ("function" === typeof Symbol && - Symbol.toStringTag && - value[Symbol.toStringTag]) || - value.constructor.name || - "Object"; - JSCompiler_temp_const.call( - JSCompiler_inline_result, - "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.", - JSCompiler_inline_result$jscomp$0 - ); - return testStringCoercion(value); - } - } - function getComponentNameFromType(type) { - if (null == type) return null; - if ("function" === typeof type) - return type.$$typeof === REACT_CLIENT_REFERENCE - ? null - : type.displayName || type.name || null; - if ("string" === typeof type) return type; - switch (type) { - case REACT_FRAGMENT_TYPE: - return "Fragment"; - case REACT_PROFILER_TYPE: - return "Profiler"; - case REACT_STRICT_MODE_TYPE: - return "StrictMode"; - case REACT_SUSPENSE_TYPE: - return "Suspense"; - case REACT_SUSPENSE_LIST_TYPE: - return "SuspenseList"; - case REACT_ACTIVITY_TYPE: - return "Activity"; - } - if ("object" === typeof type) - switch ( - ("number" === typeof type.tag && - console.error( - "Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue." - ), - type.$$typeof) - ) { - case REACT_PORTAL_TYPE: - return "Portal"; - case REACT_CONTEXT_TYPE: - return type.displayName || "Context"; - case REACT_CONSUMER_TYPE: - return (type._context.displayName || "Context") + ".Consumer"; - case REACT_FORWARD_REF_TYPE: - var innerType = type.render; - type = type.displayName; - type || - ((type = innerType.displayName || innerType.name || ""), - (type = "" !== type ? "ForwardRef(" + type + ")" : "ForwardRef")); - return type; - case REACT_MEMO_TYPE: - return ( - (innerType = type.displayName || null), - null !== innerType - ? innerType - : getComponentNameFromType(type.type) || "Memo" - ); - case REACT_LAZY_TYPE: - innerType = type._payload; - type = type._init; - try { - return getComponentNameFromType(type(innerType)); - } catch (x) {} - } - return null; - } - function getTaskName(type) { - if (type === REACT_FRAGMENT_TYPE) return "<>"; - if ( - "object" === typeof type && - null !== type && - type.$$typeof === REACT_LAZY_TYPE - ) - return "<...>"; - try { - var name = getComponentNameFromType(type); - return name ? "<" + name + ">" : "<...>"; - } catch (x) { - return "<...>"; - } - } - function getOwner() { - var dispatcher = ReactSharedInternals.A; - return null === dispatcher ? null : dispatcher.getOwner(); - } - function UnknownOwner() { - return Error("react-stack-top-frame"); - } - function hasValidKey(config) { - if (hasOwnProperty.call(config, "key")) { - var getter = Object.getOwnPropertyDescriptor(config, "key").get; - if (getter && getter.isReactWarning) return !1; - } - return void 0 !== config.key; - } - function defineKeyPropWarningGetter(props, displayName) { - function warnAboutAccessingKey() { - specialPropKeyWarningShown || - ((specialPropKeyWarningShown = !0), - console.error( - "%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)", - displayName - )); - } - warnAboutAccessingKey.isReactWarning = !0; - Object.defineProperty(props, "key", { - get: warnAboutAccessingKey, - configurable: !0 - }); - } - function elementRefGetterWithDeprecationWarning() { - var componentName = getComponentNameFromType(this.type); - didWarnAboutElementRef[componentName] || - ((didWarnAboutElementRef[componentName] = !0), - console.error( - "Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release." - )); - componentName = this.props.ref; - return void 0 !== componentName ? componentName : null; - } - function ReactElement(type, key, props, owner, debugStack, debugTask) { - var refProp = props.ref; - type = { - $$typeof: REACT_ELEMENT_TYPE, - type: type, - key: key, - props: props, - _owner: owner - }; - null !== (void 0 !== refProp ? refProp : null) - ? Object.defineProperty(type, "ref", { - enumerable: !1, - get: elementRefGetterWithDeprecationWarning - }) - : Object.defineProperty(type, "ref", { enumerable: !1, value: null }); - type._store = {}; - Object.defineProperty(type._store, "validated", { - configurable: !1, - enumerable: !1, - writable: !0, - value: 0 - }); - Object.defineProperty(type, "_debugInfo", { - configurable: !1, - enumerable: !1, - writable: !0, - value: null - }); - Object.defineProperty(type, "_debugStack", { - configurable: !1, - enumerable: !1, - writable: !0, - value: debugStack - }); - Object.defineProperty(type, "_debugTask", { - configurable: !1, - enumerable: !1, - writable: !0, - value: debugTask - }); - Object.freeze && (Object.freeze(type.props), Object.freeze(type)); - return type; - } - function cloneAndReplaceKey(oldElement, newKey) { - newKey = ReactElement( - oldElement.type, - newKey, - oldElement.props, - oldElement._owner, - oldElement._debugStack, - oldElement._debugTask - ); - oldElement._store && - (newKey._store.validated = oldElement._store.validated); - return newKey; - } - function validateChildKeys(node) { - isValidElement(node) - ? node._store && (node._store.validated = 1) - : "object" === typeof node && - null !== node && - node.$$typeof === REACT_LAZY_TYPE && - ("fulfilled" === node._payload.status - ? isValidElement(node._payload.value) && - node._payload.value._store && - (node._payload.value._store.validated = 1) - : node._store && (node._store.validated = 1)); - } - function isValidElement(object) { - return ( - "object" === typeof object && - null !== object && - object.$$typeof === REACT_ELEMENT_TYPE - ); - } - function escape(key) { - var escaperLookup = { "=": "=0", ":": "=2" }; - return ( - "$" + - key.replace(/[=:]/g, function (match) { - return escaperLookup[match]; - }) - ); - } - function getElementKey(element, index) { - return "object" === typeof element && - null !== element && - null != element.key - ? (checkKeyStringCoercion(element.key), escape("" + element.key)) - : index.toString(36); - } - function resolveThenable(thenable) { - switch (thenable.status) { - case "fulfilled": - return thenable.value; - case "rejected": - throw thenable.reason; - default: - switch ( - ("string" === typeof thenable.status - ? thenable.then(noop, noop) - : ((thenable.status = "pending"), - thenable.then( - function (fulfilledValue) { - "pending" === thenable.status && - ((thenable.status = "fulfilled"), - (thenable.value = fulfilledValue)); - }, - function (error) { - "pending" === thenable.status && - ((thenable.status = "rejected"), - (thenable.reason = error)); - } - )), - thenable.status) - ) { - case "fulfilled": - return thenable.value; - case "rejected": - throw thenable.reason; - } - } - throw thenable; - } - function mapIntoArray(children, array, escapedPrefix, nameSoFar, callback) { - var type = typeof children; - if ("undefined" === type || "boolean" === type) children = null; - var invokeCallback = !1; - if (null === children) invokeCallback = !0; - else - switch (type) { - case "bigint": - case "string": - case "number": - invokeCallback = !0; - break; - case "object": - switch (children.$$typeof) { - case REACT_ELEMENT_TYPE: - case REACT_PORTAL_TYPE: - invokeCallback = !0; - break; - case REACT_LAZY_TYPE: - return ( - (invokeCallback = children._init), - mapIntoArray( - invokeCallback(children._payload), - array, - escapedPrefix, - nameSoFar, - callback - ) - ); - } - } - if (invokeCallback) { - invokeCallback = children; - callback = callback(invokeCallback); - var childKey = - "" === nameSoFar ? "." + getElementKey(invokeCallback, 0) : nameSoFar; - isArrayImpl(callback) - ? ((escapedPrefix = ""), - null != childKey && - (escapedPrefix = - childKey.replace(userProvidedKeyEscapeRegex, "$&/") + "/"), - mapIntoArray(callback, array, escapedPrefix, "", function (c) { - return c; - })) - : null != callback && - (isValidElement(callback) && - (null != callback.key && - ((invokeCallback && invokeCallback.key === callback.key) || - checkKeyStringCoercion(callback.key)), - (escapedPrefix = cloneAndReplaceKey( - callback, - escapedPrefix + - (null == callback.key || - (invokeCallback && invokeCallback.key === callback.key) - ? "" - : ("" + callback.key).replace( - userProvidedKeyEscapeRegex, - "$&/" - ) + "/") + - childKey - )), - "" !== nameSoFar && - null != invokeCallback && - isValidElement(invokeCallback) && - null == invokeCallback.key && - invokeCallback._store && - !invokeCallback._store.validated && - (escapedPrefix._store.validated = 2), - (callback = escapedPrefix)), - array.push(callback)); - return 1; - } - invokeCallback = 0; - childKey = "" === nameSoFar ? "." : nameSoFar + ":"; - if (isArrayImpl(children)) - for (var i = 0; i < children.length; i++) - (nameSoFar = children[i]), - (type = childKey + getElementKey(nameSoFar, i)), - (invokeCallback += mapIntoArray( - nameSoFar, - array, - escapedPrefix, - type, - callback - )); - else if (((i = getIteratorFn(children)), "function" === typeof i)) - for ( - i === children.entries && - (didWarnAboutMaps || - console.warn( - "Using Maps as children is not supported. Use an array of keyed ReactElements instead." - ), - (didWarnAboutMaps = !0)), - children = i.call(children), - i = 0; - !(nameSoFar = children.next()).done; - - ) - (nameSoFar = nameSoFar.value), - (type = childKey + getElementKey(nameSoFar, i++)), - (invokeCallback += mapIntoArray( - nameSoFar, - array, - escapedPrefix, - type, - callback - )); - else if ("object" === type) { - if ("function" === typeof children.then) - return mapIntoArray( - resolveThenable(children), - array, - escapedPrefix, - nameSoFar, - callback - ); - array = String(children); - throw Error( - "Objects are not valid as a React child (found: " + - ("[object Object]" === array - ? "object with keys {" + Object.keys(children).join(", ") + "}" - : array) + - "). If you meant to render a collection of children, use an array instead." - ); - } - return invokeCallback; - } - function mapChildren(children, func, context) { - if (null == children) return children; - var result = [], - count = 0; - mapIntoArray(children, result, "", "", function (child) { - return func.call(context, child, count++); - }); - return result; - } - function lazyInitializer(payload) { - if (-1 === payload._status) { - var ioInfo = payload._ioInfo; - null != ioInfo && (ioInfo.start = ioInfo.end = performance.now()); - ioInfo = payload._result; - var thenable = ioInfo(); - thenable.then( - function (moduleObject) { - if (0 === payload._status || -1 === payload._status) { - payload._status = 1; - payload._result = moduleObject; - var _ioInfo = payload._ioInfo; - null != _ioInfo && (_ioInfo.end = performance.now()); - void 0 === thenable.status && - ((thenable.status = "fulfilled"), - (thenable.value = moduleObject)); - } - }, - function (error) { - if (0 === payload._status || -1 === payload._status) { - payload._status = 2; - payload._result = error; - var _ioInfo2 = payload._ioInfo; - null != _ioInfo2 && (_ioInfo2.end = performance.now()); - void 0 === thenable.status && - ((thenable.status = "rejected"), (thenable.reason = error)); - } - } - ); - ioInfo = payload._ioInfo; - if (null != ioInfo) { - ioInfo.value = thenable; - var displayName = thenable.displayName; - "string" === typeof displayName && (ioInfo.name = displayName); - } - -1 === payload._status && - ((payload._status = 0), (payload._result = thenable)); - } - if (1 === payload._status) - return ( - (ioInfo = payload._result), - void 0 === ioInfo && - console.error( - "lazy: Expected the result of a dynamic import() call. Instead received: %s\n\nYour code should look like: \n const MyComponent = lazy(() => import('./MyComponent'))\n\nDid you accidentally put curly braces around the import?", - ioInfo - ), - "default" in ioInfo || - console.error( - "lazy: Expected the result of a dynamic import() call. Instead received: %s\n\nYour code should look like: \n const MyComponent = lazy(() => import('./MyComponent'))", - ioInfo - ), - ioInfo.default - ); - throw payload._result; - } - function resolveDispatcher() { - var dispatcher = ReactSharedInternals.H; - null === dispatcher && - console.error( - "Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\n1. You might have mismatching versions of React and the renderer (such as React DOM)\n2. You might be breaking the Rules of Hooks\n3. You might have more than one copy of React in the same app\nSee https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem." - ); - return dispatcher; - } - function releaseAsyncTransition() { - ReactSharedInternals.asyncTransitions--; - } - function enqueueTask(task) { - if (null === enqueueTaskImpl) - try { - var requireString = ("require" + Math.random()).slice(0, 7); - enqueueTaskImpl = (module && module[requireString]).call( - module, - "timers" - ).setImmediate; - } catch (_err) { - enqueueTaskImpl = function (callback) { - !1 === didWarnAboutMessageChannel && - ((didWarnAboutMessageChannel = !0), - "undefined" === typeof MessageChannel && - console.error( - "This browser does not have a MessageChannel implementation, so enqueuing tasks via await act(async () => ...) will fail. Please file an issue at https://github.com/facebook/react/issues if you encounter this warning." - )); - var channel = new MessageChannel(); - channel.port1.onmessage = callback; - channel.port2.postMessage(void 0); - }; - } - return enqueueTaskImpl(task); - } - function aggregateErrors(errors) { - return 1 < errors.length && "function" === typeof AggregateError - ? new AggregateError(errors) - : errors[0]; - } - function popActScope(prevActQueue, prevActScopeDepth) { - prevActScopeDepth !== actScopeDepth - 1 && - console.error( - "You seem to have overlapping act() calls, this is not supported. Be sure to await previous act() calls before making a new one. " - ); - actScopeDepth = prevActScopeDepth; - } - function recursivelyFlushAsyncActWork(returnValue, resolve, reject) { - var queue = ReactSharedInternals.actQueue; - if (null !== queue) - if (0 !== queue.length) - try { - flushActQueue(queue); - enqueueTask(function () { - return recursivelyFlushAsyncActWork(returnValue, resolve, reject); - }); - return; - } catch (error) { - ReactSharedInternals.thrownErrors.push(error); - } - else ReactSharedInternals.actQueue = null; - 0 < ReactSharedInternals.thrownErrors.length - ? ((queue = aggregateErrors(ReactSharedInternals.thrownErrors)), - (ReactSharedInternals.thrownErrors.length = 0), - reject(queue)) - : resolve(returnValue); - } - function flushActQueue(queue) { - if (!isFlushing) { - isFlushing = !0; - var i = 0; - try { - for (; i < queue.length; i++) { - var callback = queue[i]; - do { - ReactSharedInternals.didUsePromise = !1; - var continuation = callback(!1); - if (null !== continuation) { - if (ReactSharedInternals.didUsePromise) { - queue[i] = callback; - queue.splice(0, i); - return; - } - callback = continuation; - } else break; - } while (1); - } - queue.length = 0; - } catch (error) { - queue.splice(0, i + 1), ReactSharedInternals.thrownErrors.push(error); - } finally { - isFlushing = !1; - } - } - } - "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && - "function" === - typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart && - __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error()); - var REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"), - REACT_PORTAL_TYPE = Symbol.for("react.portal"), - REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"), - REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"), - REACT_PROFILER_TYPE = Symbol.for("react.profiler"), - REACT_CONSUMER_TYPE = Symbol.for("react.consumer"), - REACT_CONTEXT_TYPE = Symbol.for("react.context"), - REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"), - REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"), - REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"), - REACT_MEMO_TYPE = Symbol.for("react.memo"), - REACT_LAZY_TYPE = Symbol.for("react.lazy"), - REACT_ACTIVITY_TYPE = Symbol.for("react.activity"), - MAYBE_ITERATOR_SYMBOL = Symbol.iterator, - didWarnStateUpdateForUnmountedComponent = {}, - ReactNoopUpdateQueue = { - isMounted: function () { - return !1; - }, - enqueueForceUpdate: function (publicInstance) { - warnNoop(publicInstance, "forceUpdate"); - }, - enqueueReplaceState: function (publicInstance) { - warnNoop(publicInstance, "replaceState"); - }, - enqueueSetState: function (publicInstance) { - warnNoop(publicInstance, "setState"); - } - }, - assign = Object.assign, - emptyObject = {}; - Object.freeze(emptyObject); - Component.prototype.isReactComponent = {}; - Component.prototype.setState = function (partialState, callback) { - if ( - "object" !== typeof partialState && - "function" !== typeof partialState && - null != partialState - ) - throw Error( - "takes an object of state variables to update or a function which returns an object of state variables." - ); - this.updater.enqueueSetState(this, partialState, callback, "setState"); - }; - Component.prototype.forceUpdate = function (callback) { - this.updater.enqueueForceUpdate(this, callback, "forceUpdate"); - }; - var deprecatedAPIs = { - isMounted: [ - "isMounted", - "Instead, make sure to clean up subscriptions and pending requests in componentWillUnmount to prevent memory leaks." - ], - replaceState: [ - "replaceState", - "Refactor your code to use setState instead (see https://github.com/facebook/react/issues/3236)." - ] - }; - for (fnName in deprecatedAPIs) - deprecatedAPIs.hasOwnProperty(fnName) && - defineDeprecationWarning(fnName, deprecatedAPIs[fnName]); - ComponentDummy.prototype = Component.prototype; - deprecatedAPIs = PureComponent.prototype = new ComponentDummy(); - deprecatedAPIs.constructor = PureComponent; - assign(deprecatedAPIs, Component.prototype); - deprecatedAPIs.isPureReactComponent = !0; - var isArrayImpl = Array.isArray, - REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference"), - ReactSharedInternals = { - H: null, - A: null, - T: null, - S: null, - actQueue: null, - asyncTransitions: 0, - isBatchingLegacy: !1, - didScheduleLegacyUpdate: !1, - didUsePromise: !1, - thrownErrors: [], - getCurrentStack: null, - recentlyCreatedOwnerStacks: 0 - }, - hasOwnProperty = Object.prototype.hasOwnProperty, - createTask = console.createTask - ? console.createTask - : function () { - return null; - }; - deprecatedAPIs = { - react_stack_bottom_frame: function (callStackForError) { - return callStackForError(); - } - }; - var specialPropKeyWarningShown, didWarnAboutOldJSXRuntime; - var didWarnAboutElementRef = {}; - var unknownOwnerDebugStack = deprecatedAPIs.react_stack_bottom_frame.bind( - deprecatedAPIs, - UnknownOwner - )(); - var unknownOwnerDebugTask = createTask(getTaskName(UnknownOwner)); - var didWarnAboutMaps = !1, - userProvidedKeyEscapeRegex = /\/+/g, - reportGlobalError = - "function" === typeof reportError - ? reportError - : function (error) { - if ( - "object" === typeof window && - "function" === typeof window.ErrorEvent - ) { - var event = new window.ErrorEvent("error", { - bubbles: !0, - cancelable: !0, - message: - "object" === typeof error && - null !== error && - "string" === typeof error.message - ? String(error.message) - : String(error), - error: error - }); - if (!window.dispatchEvent(event)) return; - } else if ( - "object" === typeof process && - "function" === typeof process.emit - ) { - process.emit("uncaughtException", error); - return; - } - console.error(error); - }, - didWarnAboutMessageChannel = !1, - enqueueTaskImpl = null, - actScopeDepth = 0, - didWarnNoAwaitAct = !1, - isFlushing = !1, - queueSeveralMicrotasks = - "function" === typeof queueMicrotask - ? function (callback) { - queueMicrotask(function () { - return queueMicrotask(callback); - }); - } - : enqueueTask; - deprecatedAPIs = Object.freeze({ - __proto__: null, - c: function (size) { - return resolveDispatcher().useMemoCache(size); - } - }); - var fnName = { - map: mapChildren, - forEach: function (children, forEachFunc, forEachContext) { - mapChildren( - children, - function () { - forEachFunc.apply(this, arguments); - }, - forEachContext - ); - }, - count: function (children) { - var n = 0; - mapChildren(children, function () { - n++; - }); - return n; - }, - toArray: function (children) { - return ( - mapChildren(children, function (child) { - return child; - }) || [] - ); - }, - only: function (children) { - if (!isValidElement(children)) - throw Error( - "React.Children.only expected to receive a single React element child." - ); - return children; - } - }; - exports.Activity = REACT_ACTIVITY_TYPE; - exports.Children = fnName; - exports.Component = Component; - exports.Fragment = REACT_FRAGMENT_TYPE; - exports.Profiler = REACT_PROFILER_TYPE; - exports.PureComponent = PureComponent; - exports.StrictMode = REACT_STRICT_MODE_TYPE; - exports.Suspense = REACT_SUSPENSE_TYPE; - exports.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE = - ReactSharedInternals; - exports.__COMPILER_RUNTIME = deprecatedAPIs; - exports.act = function (callback) { - var prevActQueue = ReactSharedInternals.actQueue, - prevActScopeDepth = actScopeDepth; - actScopeDepth++; - var queue = (ReactSharedInternals.actQueue = - null !== prevActQueue ? prevActQueue : []), - didAwaitActCall = !1; - try { - var result = callback(); - } catch (error) { - ReactSharedInternals.thrownErrors.push(error); - } - if (0 < ReactSharedInternals.thrownErrors.length) - throw ( - (popActScope(prevActQueue, prevActScopeDepth), - (callback = aggregateErrors(ReactSharedInternals.thrownErrors)), - (ReactSharedInternals.thrownErrors.length = 0), - callback) - ); - if ( - null !== result && - "object" === typeof result && - "function" === typeof result.then - ) { - var thenable = result; - queueSeveralMicrotasks(function () { - didAwaitActCall || - didWarnNoAwaitAct || - ((didWarnNoAwaitAct = !0), - console.error( - "You called act(async () => ...) without await. This could lead to unexpected testing behaviour, interleaving multiple act calls and mixing their scopes. You should - await act(async () => ...);" - )); - }); - return { - then: function (resolve, reject) { - didAwaitActCall = !0; - thenable.then( - function (returnValue) { - popActScope(prevActQueue, prevActScopeDepth); - if (0 === prevActScopeDepth) { - try { - flushActQueue(queue), - enqueueTask(function () { - return recursivelyFlushAsyncActWork( - returnValue, - resolve, - reject - ); - }); - } catch (error$0) { - ReactSharedInternals.thrownErrors.push(error$0); - } - if (0 < ReactSharedInternals.thrownErrors.length) { - var _thrownError = aggregateErrors( - ReactSharedInternals.thrownErrors - ); - ReactSharedInternals.thrownErrors.length = 0; - reject(_thrownError); - } - } else resolve(returnValue); - }, - function (error) { - popActScope(prevActQueue, prevActScopeDepth); - 0 < ReactSharedInternals.thrownErrors.length - ? ((error = aggregateErrors( - ReactSharedInternals.thrownErrors - )), - (ReactSharedInternals.thrownErrors.length = 0), - reject(error)) - : reject(error); - } - ); - } - }; - } - var returnValue$jscomp$0 = result; - popActScope(prevActQueue, prevActScopeDepth); - 0 === prevActScopeDepth && - (flushActQueue(queue), - 0 !== queue.length && - queueSeveralMicrotasks(function () { - didAwaitActCall || - didWarnNoAwaitAct || - ((didWarnNoAwaitAct = !0), - console.error( - "A component suspended inside an `act` scope, but the `act` call was not awaited. When testing React components that depend on asynchronous data, you must await the result:\n\nawait act(() => ...)" - )); - }), - (ReactSharedInternals.actQueue = null)); - if (0 < ReactSharedInternals.thrownErrors.length) - throw ( - ((callback = aggregateErrors(ReactSharedInternals.thrownErrors)), - (ReactSharedInternals.thrownErrors.length = 0), - callback) - ); - return { - then: function (resolve, reject) { - didAwaitActCall = !0; - 0 === prevActScopeDepth - ? ((ReactSharedInternals.actQueue = queue), - enqueueTask(function () { - return recursivelyFlushAsyncActWork( - returnValue$jscomp$0, - resolve, - reject - ); - })) - : resolve(returnValue$jscomp$0); - } - }; - }; - exports.cache = function (fn) { - return function () { - return fn.apply(null, arguments); - }; - }; - exports.cacheSignal = function () { - return null; - }; - exports.captureOwnerStack = function () { - var getCurrentStack = ReactSharedInternals.getCurrentStack; - return null === getCurrentStack ? null : getCurrentStack(); - }; - exports.cloneElement = function (element, config, children) { - if (null === element || void 0 === element) - throw Error( - "The argument must be a React element, but you passed " + - element + - "." - ); - var props = assign({}, element.props), - key = element.key, - owner = element._owner; - if (null != config) { - var JSCompiler_inline_result; - a: { - if ( - hasOwnProperty.call(config, "ref") && - (JSCompiler_inline_result = Object.getOwnPropertyDescriptor( - config, - "ref" - ).get) && - JSCompiler_inline_result.isReactWarning - ) { - JSCompiler_inline_result = !1; - break a; - } - JSCompiler_inline_result = void 0 !== config.ref; - } - JSCompiler_inline_result && (owner = getOwner()); - hasValidKey(config) && - (checkKeyStringCoercion(config.key), (key = "" + config.key)); - for (propName in config) - !hasOwnProperty.call(config, propName) || - "key" === propName || - "__self" === propName || - "__source" === propName || - ("ref" === propName && void 0 === config.ref) || - (props[propName] = config[propName]); - } - var propName = arguments.length - 2; - if (1 === propName) props.children = children; - else if (1 < propName) { - JSCompiler_inline_result = Array(propName); - for (var i = 0; i < propName; i++) - JSCompiler_inline_result[i] = arguments[i + 2]; - props.children = JSCompiler_inline_result; - } - props = ReactElement( - element.type, - key, - props, - owner, - element._debugStack, - element._debugTask - ); - for (key = 2; key < arguments.length; key++) - validateChildKeys(arguments[key]); - return props; - }; - exports.createContext = function (defaultValue) { - defaultValue = { - $$typeof: REACT_CONTEXT_TYPE, - _currentValue: defaultValue, - _currentValue2: defaultValue, - _threadCount: 0, - Provider: null, - Consumer: null - }; - defaultValue.Provider = defaultValue; - defaultValue.Consumer = { - $$typeof: REACT_CONSUMER_TYPE, - _context: defaultValue - }; - defaultValue._currentRenderer = null; - defaultValue._currentRenderer2 = null; - return defaultValue; - }; - exports.createElement = function (type, config, children) { - for (var i = 2; i < arguments.length; i++) - validateChildKeys(arguments[i]); - i = {}; - var key = null; - if (null != config) - for (propName in (didWarnAboutOldJSXRuntime || - !("__self" in config) || - "key" in config || - ((didWarnAboutOldJSXRuntime = !0), - console.warn( - "Your app (or one of its dependencies) is using an outdated JSX transform. Update to the modern JSX transform for faster performance: https://react.dev/link/new-jsx-transform" - )), - hasValidKey(config) && - (checkKeyStringCoercion(config.key), (key = "" + config.key)), - config)) - hasOwnProperty.call(config, propName) && - "key" !== propName && - "__self" !== propName && - "__source" !== propName && - (i[propName] = config[propName]); - var childrenLength = arguments.length - 2; - if (1 === childrenLength) i.children = children; - else if (1 < childrenLength) { - for ( - var childArray = Array(childrenLength), _i = 0; - _i < childrenLength; - _i++ - ) - childArray[_i] = arguments[_i + 2]; - Object.freeze && Object.freeze(childArray); - i.children = childArray; - } - if (type && type.defaultProps) - for (propName in ((childrenLength = type.defaultProps), childrenLength)) - void 0 === i[propName] && (i[propName] = childrenLength[propName]); - key && - defineKeyPropWarningGetter( - i, - "function" === typeof type - ? type.displayName || type.name || "Unknown" - : type - ); - var propName = 1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++; - return ReactElement( - type, - key, - i, - getOwner(), - propName ? Error("react-stack-top-frame") : unknownOwnerDebugStack, - propName ? createTask(getTaskName(type)) : unknownOwnerDebugTask - ); - }; - exports.createRef = function () { - var refObject = { current: null }; - Object.seal(refObject); - return refObject; - }; - exports.forwardRef = function (render) { - null != render && render.$$typeof === REACT_MEMO_TYPE - ? console.error( - "forwardRef requires a render function but received a `memo` component. Instead of forwardRef(memo(...)), use memo(forwardRef(...))." - ) - : "function" !== typeof render - ? console.error( - "forwardRef requires a render function but was given %s.", - null === render ? "null" : typeof render - ) - : 0 !== render.length && - 2 !== render.length && - console.error( - "forwardRef render functions accept exactly two parameters: props and ref. %s", - 1 === render.length - ? "Did you forget to use the ref parameter?" - : "Any additional parameter will be undefined." - ); - null != render && - null != render.defaultProps && - console.error( - "forwardRef render functions do not support defaultProps. Did you accidentally pass a React component?" - ); - var elementType = { $$typeof: REACT_FORWARD_REF_TYPE, render: render }, - ownName; - Object.defineProperty(elementType, "displayName", { - enumerable: !1, - configurable: !0, - get: function () { - return ownName; - }, - set: function (name) { - ownName = name; - render.name || - render.displayName || - (Object.defineProperty(render, "name", { value: name }), - (render.displayName = name)); - } - }); - return elementType; - }; - exports.isValidElement = isValidElement; - exports.lazy = function (ctor) { - ctor = { _status: -1, _result: ctor }; - var lazyType = { - $$typeof: REACT_LAZY_TYPE, - _payload: ctor, - _init: lazyInitializer - }, - ioInfo = { - name: "lazy", - start: -1, - end: -1, - value: null, - owner: null, - debugStack: Error("react-stack-top-frame"), - debugTask: console.createTask ? console.createTask("lazy()") : null - }; - ctor._ioInfo = ioInfo; - lazyType._debugInfo = [{ awaited: ioInfo }]; - return lazyType; - }; - exports.memo = function (type, compare) { - null == type && - console.error( - "memo: The first argument must be a component. Instead received: %s", - null === type ? "null" : typeof type - ); - compare = { - $$typeof: REACT_MEMO_TYPE, - type: type, - compare: void 0 === compare ? null : compare - }; - var ownName; - Object.defineProperty(compare, "displayName", { - enumerable: !1, - configurable: !0, - get: function () { - return ownName; - }, - set: function (name) { - ownName = name; - type.name || - type.displayName || - (Object.defineProperty(type, "name", { value: name }), - (type.displayName = name)); - } - }); - return compare; - }; - exports.startTransition = function (scope) { - var prevTransition = ReactSharedInternals.T, - currentTransition = {}; - currentTransition._updatedFibers = new Set(); - ReactSharedInternals.T = currentTransition; - try { - var returnValue = scope(), - onStartTransitionFinish = ReactSharedInternals.S; - null !== onStartTransitionFinish && - onStartTransitionFinish(currentTransition, returnValue); - "object" === typeof returnValue && - null !== returnValue && - "function" === typeof returnValue.then && - (ReactSharedInternals.asyncTransitions++, - returnValue.then(releaseAsyncTransition, releaseAsyncTransition), - returnValue.then(noop, reportGlobalError)); - } catch (error) { - reportGlobalError(error); - } finally { - null === prevTransition && - currentTransition._updatedFibers && - ((scope = currentTransition._updatedFibers.size), - currentTransition._updatedFibers.clear(), - 10 < scope && - console.warn( - "Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table." - )), - null !== prevTransition && - null !== currentTransition.types && - (null !== prevTransition.types && - prevTransition.types !== currentTransition.types && - console.error( - "We expected inner Transitions to have transferred the outer types set and that you cannot add to the outer Transition while inside the inner.This is a bug in React." - ), - (prevTransition.types = currentTransition.types)), - (ReactSharedInternals.T = prevTransition); - } - }; - exports.unstable_useCacheRefresh = function () { - return resolveDispatcher().useCacheRefresh(); - }; - exports.use = function (usable) { - return resolveDispatcher().use(usable); - }; - exports.useActionState = function (action, initialState, permalink) { - return resolveDispatcher().useActionState( - action, - initialState, - permalink - ); - }; - exports.useCallback = function (callback, deps) { - return resolveDispatcher().useCallback(callback, deps); - }; - exports.useContext = function (Context) { - var dispatcher = resolveDispatcher(); - Context.$$typeof === REACT_CONSUMER_TYPE && - console.error( - "Calling useContext(Context.Consumer) is not supported and will cause bugs. Did you mean to call useContext(Context) instead?" - ); - return dispatcher.useContext(Context); - }; - exports.useDebugValue = function (value, formatterFn) { - return resolveDispatcher().useDebugValue(value, formatterFn); - }; - exports.useDeferredValue = function (value, initialValue) { - return resolveDispatcher().useDeferredValue(value, initialValue); - }; - exports.useEffect = function (create, deps) { - null == create && - console.warn( - "React Hook useEffect requires an effect callback. Did you forget to pass a callback to the hook?" - ); - return resolveDispatcher().useEffect(create, deps); - }; - exports.useEffectEvent = function (callback) { - return resolveDispatcher().useEffectEvent(callback); - }; - exports.useId = function () { - return resolveDispatcher().useId(); - }; - exports.useImperativeHandle = function (ref, create, deps) { - return resolveDispatcher().useImperativeHandle(ref, create, deps); - }; - exports.useInsertionEffect = function (create, deps) { - null == create && - console.warn( - "React Hook useInsertionEffect requires an effect callback. Did you forget to pass a callback to the hook?" - ); - return resolveDispatcher().useInsertionEffect(create, deps); - }; - exports.useLayoutEffect = function (create, deps) { - null == create && - console.warn( - "React Hook useLayoutEffect requires an effect callback. Did you forget to pass a callback to the hook?" - ); - return resolveDispatcher().useLayoutEffect(create, deps); - }; - exports.useMemo = function (create, deps) { - return resolveDispatcher().useMemo(create, deps); - }; - exports.useOptimistic = function (passthrough, reducer) { - return resolveDispatcher().useOptimistic(passthrough, reducer); - }; - exports.useReducer = function (reducer, initialArg, init) { - return resolveDispatcher().useReducer(reducer, initialArg, init); - }; - exports.useRef = function (initialValue) { - return resolveDispatcher().useRef(initialValue); - }; - exports.useState = function (initialState) { - return resolveDispatcher().useState(initialState); - }; - exports.useSyncExternalStore = function ( - subscribe, - getSnapshot, - getServerSnapshot - ) { - return resolveDispatcher().useSyncExternalStore( - subscribe, - getSnapshot, - getServerSnapshot - ); - }; - exports.useTransition = function () { - return resolveDispatcher().useTransition(); - }; - exports.version = "19.2.4"; - "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && - "function" === - typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && - __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error()); - })(); diff --git a/node_modules/react/cjs/react.production.js b/node_modules/react/cjs/react.production.js deleted file mode 100644 index 28eed1e..0000000 --- a/node_modules/react/cjs/react.production.js +++ /dev/null @@ -1,542 +0,0 @@ -/** - * @license React - * react.production.js - * - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - -"use strict"; -var REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"), - REACT_PORTAL_TYPE = Symbol.for("react.portal"), - REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"), - REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"), - REACT_PROFILER_TYPE = Symbol.for("react.profiler"), - REACT_CONSUMER_TYPE = Symbol.for("react.consumer"), - REACT_CONTEXT_TYPE = Symbol.for("react.context"), - REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"), - REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"), - REACT_MEMO_TYPE = Symbol.for("react.memo"), - REACT_LAZY_TYPE = Symbol.for("react.lazy"), - REACT_ACTIVITY_TYPE = Symbol.for("react.activity"), - MAYBE_ITERATOR_SYMBOL = Symbol.iterator; -function getIteratorFn(maybeIterable) { - if (null === maybeIterable || "object" !== typeof maybeIterable) return null; - maybeIterable = - (MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL]) || - maybeIterable["@@iterator"]; - return "function" === typeof maybeIterable ? maybeIterable : null; -} -var ReactNoopUpdateQueue = { - isMounted: function () { - return !1; - }, - enqueueForceUpdate: function () {}, - enqueueReplaceState: function () {}, - enqueueSetState: function () {} - }, - assign = Object.assign, - emptyObject = {}; -function Component(props, context, updater) { - this.props = props; - this.context = context; - this.refs = emptyObject; - this.updater = updater || ReactNoopUpdateQueue; -} -Component.prototype.isReactComponent = {}; -Component.prototype.setState = function (partialState, callback) { - if ( - "object" !== typeof partialState && - "function" !== typeof partialState && - null != partialState - ) - throw Error( - "takes an object of state variables to update or a function which returns an object of state variables." - ); - this.updater.enqueueSetState(this, partialState, callback, "setState"); -}; -Component.prototype.forceUpdate = function (callback) { - this.updater.enqueueForceUpdate(this, callback, "forceUpdate"); -}; -function ComponentDummy() {} -ComponentDummy.prototype = Component.prototype; -function PureComponent(props, context, updater) { - this.props = props; - this.context = context; - this.refs = emptyObject; - this.updater = updater || ReactNoopUpdateQueue; -} -var pureComponentPrototype = (PureComponent.prototype = new ComponentDummy()); -pureComponentPrototype.constructor = PureComponent; -assign(pureComponentPrototype, Component.prototype); -pureComponentPrototype.isPureReactComponent = !0; -var isArrayImpl = Array.isArray; -function noop() {} -var ReactSharedInternals = { H: null, A: null, T: null, S: null }, - hasOwnProperty = Object.prototype.hasOwnProperty; -function ReactElement(type, key, props) { - var refProp = props.ref; - return { - $$typeof: REACT_ELEMENT_TYPE, - type: type, - key: key, - ref: void 0 !== refProp ? refProp : null, - props: props - }; -} -function cloneAndReplaceKey(oldElement, newKey) { - return ReactElement(oldElement.type, newKey, oldElement.props); -} -function isValidElement(object) { - return ( - "object" === typeof object && - null !== object && - object.$$typeof === REACT_ELEMENT_TYPE - ); -} -function escape(key) { - var escaperLookup = { "=": "=0", ":": "=2" }; - return ( - "$" + - key.replace(/[=:]/g, function (match) { - return escaperLookup[match]; - }) - ); -} -var userProvidedKeyEscapeRegex = /\/+/g; -function getElementKey(element, index) { - return "object" === typeof element && null !== element && null != element.key - ? escape("" + element.key) - : index.toString(36); -} -function resolveThenable(thenable) { - switch (thenable.status) { - case "fulfilled": - return thenable.value; - case "rejected": - throw thenable.reason; - default: - switch ( - ("string" === typeof thenable.status - ? thenable.then(noop, noop) - : ((thenable.status = "pending"), - thenable.then( - function (fulfilledValue) { - "pending" === thenable.status && - ((thenable.status = "fulfilled"), - (thenable.value = fulfilledValue)); - }, - function (error) { - "pending" === thenable.status && - ((thenable.status = "rejected"), (thenable.reason = error)); - } - )), - thenable.status) - ) { - case "fulfilled": - return thenable.value; - case "rejected": - throw thenable.reason; - } - } - throw thenable; -} -function mapIntoArray(children, array, escapedPrefix, nameSoFar, callback) { - var type = typeof children; - if ("undefined" === type || "boolean" === type) children = null; - var invokeCallback = !1; - if (null === children) invokeCallback = !0; - else - switch (type) { - case "bigint": - case "string": - case "number": - invokeCallback = !0; - break; - case "object": - switch (children.$$typeof) { - case REACT_ELEMENT_TYPE: - case REACT_PORTAL_TYPE: - invokeCallback = !0; - break; - case REACT_LAZY_TYPE: - return ( - (invokeCallback = children._init), - mapIntoArray( - invokeCallback(children._payload), - array, - escapedPrefix, - nameSoFar, - callback - ) - ); - } - } - if (invokeCallback) - return ( - (callback = callback(children)), - (invokeCallback = - "" === nameSoFar ? "." + getElementKey(children, 0) : nameSoFar), - isArrayImpl(callback) - ? ((escapedPrefix = ""), - null != invokeCallback && - (escapedPrefix = - invokeCallback.replace(userProvidedKeyEscapeRegex, "$&/") + "/"), - mapIntoArray(callback, array, escapedPrefix, "", function (c) { - return c; - })) - : null != callback && - (isValidElement(callback) && - (callback = cloneAndReplaceKey( - callback, - escapedPrefix + - (null == callback.key || - (children && children.key === callback.key) - ? "" - : ("" + callback.key).replace( - userProvidedKeyEscapeRegex, - "$&/" - ) + "/") + - invokeCallback - )), - array.push(callback)), - 1 - ); - invokeCallback = 0; - var nextNamePrefix = "" === nameSoFar ? "." : nameSoFar + ":"; - if (isArrayImpl(children)) - for (var i = 0; i < children.length; i++) - (nameSoFar = children[i]), - (type = nextNamePrefix + getElementKey(nameSoFar, i)), - (invokeCallback += mapIntoArray( - nameSoFar, - array, - escapedPrefix, - type, - callback - )); - else if (((i = getIteratorFn(children)), "function" === typeof i)) - for ( - children = i.call(children), i = 0; - !(nameSoFar = children.next()).done; - - ) - (nameSoFar = nameSoFar.value), - (type = nextNamePrefix + getElementKey(nameSoFar, i++)), - (invokeCallback += mapIntoArray( - nameSoFar, - array, - escapedPrefix, - type, - callback - )); - else if ("object" === type) { - if ("function" === typeof children.then) - return mapIntoArray( - resolveThenable(children), - array, - escapedPrefix, - nameSoFar, - callback - ); - array = String(children); - throw Error( - "Objects are not valid as a React child (found: " + - ("[object Object]" === array - ? "object with keys {" + Object.keys(children).join(", ") + "}" - : array) + - "). If you meant to render a collection of children, use an array instead." - ); - } - return invokeCallback; -} -function mapChildren(children, func, context) { - if (null == children) return children; - var result = [], - count = 0; - mapIntoArray(children, result, "", "", function (child) { - return func.call(context, child, count++); - }); - return result; -} -function lazyInitializer(payload) { - if (-1 === payload._status) { - var ctor = payload._result; - ctor = ctor(); - ctor.then( - function (moduleObject) { - if (0 === payload._status || -1 === payload._status) - (payload._status = 1), (payload._result = moduleObject); - }, - function (error) { - if (0 === payload._status || -1 === payload._status) - (payload._status = 2), (payload._result = error); - } - ); - -1 === payload._status && ((payload._status = 0), (payload._result = ctor)); - } - if (1 === payload._status) return payload._result.default; - throw payload._result; -} -var reportGlobalError = - "function" === typeof reportError - ? reportError - : function (error) { - if ( - "object" === typeof window && - "function" === typeof window.ErrorEvent - ) { - var event = new window.ErrorEvent("error", { - bubbles: !0, - cancelable: !0, - message: - "object" === typeof error && - null !== error && - "string" === typeof error.message - ? String(error.message) - : String(error), - error: error - }); - if (!window.dispatchEvent(event)) return; - } else if ( - "object" === typeof process && - "function" === typeof process.emit - ) { - process.emit("uncaughtException", error); - return; - } - console.error(error); - }, - Children = { - map: mapChildren, - forEach: function (children, forEachFunc, forEachContext) { - mapChildren( - children, - function () { - forEachFunc.apply(this, arguments); - }, - forEachContext - ); - }, - count: function (children) { - var n = 0; - mapChildren(children, function () { - n++; - }); - return n; - }, - toArray: function (children) { - return ( - mapChildren(children, function (child) { - return child; - }) || [] - ); - }, - only: function (children) { - if (!isValidElement(children)) - throw Error( - "React.Children.only expected to receive a single React element child." - ); - return children; - } - }; -exports.Activity = REACT_ACTIVITY_TYPE; -exports.Children = Children; -exports.Component = Component; -exports.Fragment = REACT_FRAGMENT_TYPE; -exports.Profiler = REACT_PROFILER_TYPE; -exports.PureComponent = PureComponent; -exports.StrictMode = REACT_STRICT_MODE_TYPE; -exports.Suspense = REACT_SUSPENSE_TYPE; -exports.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE = - ReactSharedInternals; -exports.__COMPILER_RUNTIME = { - __proto__: null, - c: function (size) { - return ReactSharedInternals.H.useMemoCache(size); - } -}; -exports.cache = function (fn) { - return function () { - return fn.apply(null, arguments); - }; -}; -exports.cacheSignal = function () { - return null; -}; -exports.cloneElement = function (element, config, children) { - if (null === element || void 0 === element) - throw Error( - "The argument must be a React element, but you passed " + element + "." - ); - var props = assign({}, element.props), - key = element.key; - if (null != config) - for (propName in (void 0 !== config.key && (key = "" + config.key), config)) - !hasOwnProperty.call(config, propName) || - "key" === propName || - "__self" === propName || - "__source" === propName || - ("ref" === propName && void 0 === config.ref) || - (props[propName] = config[propName]); - var propName = arguments.length - 2; - if (1 === propName) props.children = children; - else if (1 < propName) { - for (var childArray = Array(propName), i = 0; i < propName; i++) - childArray[i] = arguments[i + 2]; - props.children = childArray; - } - return ReactElement(element.type, key, props); -}; -exports.createContext = function (defaultValue) { - defaultValue = { - $$typeof: REACT_CONTEXT_TYPE, - _currentValue: defaultValue, - _currentValue2: defaultValue, - _threadCount: 0, - Provider: null, - Consumer: null - }; - defaultValue.Provider = defaultValue; - defaultValue.Consumer = { - $$typeof: REACT_CONSUMER_TYPE, - _context: defaultValue - }; - return defaultValue; -}; -exports.createElement = function (type, config, children) { - var propName, - props = {}, - key = null; - if (null != config) - for (propName in (void 0 !== config.key && (key = "" + config.key), config)) - hasOwnProperty.call(config, propName) && - "key" !== propName && - "__self" !== propName && - "__source" !== propName && - (props[propName] = config[propName]); - var childrenLength = arguments.length - 2; - if (1 === childrenLength) props.children = children; - else if (1 < childrenLength) { - for (var childArray = Array(childrenLength), i = 0; i < childrenLength; i++) - childArray[i] = arguments[i + 2]; - props.children = childArray; - } - if (type && type.defaultProps) - for (propName in ((childrenLength = type.defaultProps), childrenLength)) - void 0 === props[propName] && - (props[propName] = childrenLength[propName]); - return ReactElement(type, key, props); -}; -exports.createRef = function () { - return { current: null }; -}; -exports.forwardRef = function (render) { - return { $$typeof: REACT_FORWARD_REF_TYPE, render: render }; -}; -exports.isValidElement = isValidElement; -exports.lazy = function (ctor) { - return { - $$typeof: REACT_LAZY_TYPE, - _payload: { _status: -1, _result: ctor }, - _init: lazyInitializer - }; -}; -exports.memo = function (type, compare) { - return { - $$typeof: REACT_MEMO_TYPE, - type: type, - compare: void 0 === compare ? null : compare - }; -}; -exports.startTransition = function (scope) { - var prevTransition = ReactSharedInternals.T, - currentTransition = {}; - ReactSharedInternals.T = currentTransition; - try { - var returnValue = scope(), - onStartTransitionFinish = ReactSharedInternals.S; - null !== onStartTransitionFinish && - onStartTransitionFinish(currentTransition, returnValue); - "object" === typeof returnValue && - null !== returnValue && - "function" === typeof returnValue.then && - returnValue.then(noop, reportGlobalError); - } catch (error) { - reportGlobalError(error); - } finally { - null !== prevTransition && - null !== currentTransition.types && - (prevTransition.types = currentTransition.types), - (ReactSharedInternals.T = prevTransition); - } -}; -exports.unstable_useCacheRefresh = function () { - return ReactSharedInternals.H.useCacheRefresh(); -}; -exports.use = function (usable) { - return ReactSharedInternals.H.use(usable); -}; -exports.useActionState = function (action, initialState, permalink) { - return ReactSharedInternals.H.useActionState(action, initialState, permalink); -}; -exports.useCallback = function (callback, deps) { - return ReactSharedInternals.H.useCallback(callback, deps); -}; -exports.useContext = function (Context) { - return ReactSharedInternals.H.useContext(Context); -}; -exports.useDebugValue = function () {}; -exports.useDeferredValue = function (value, initialValue) { - return ReactSharedInternals.H.useDeferredValue(value, initialValue); -}; -exports.useEffect = function (create, deps) { - return ReactSharedInternals.H.useEffect(create, deps); -}; -exports.useEffectEvent = function (callback) { - return ReactSharedInternals.H.useEffectEvent(callback); -}; -exports.useId = function () { - return ReactSharedInternals.H.useId(); -}; -exports.useImperativeHandle = function (ref, create, deps) { - return ReactSharedInternals.H.useImperativeHandle(ref, create, deps); -}; -exports.useInsertionEffect = function (create, deps) { - return ReactSharedInternals.H.useInsertionEffect(create, deps); -}; -exports.useLayoutEffect = function (create, deps) { - return ReactSharedInternals.H.useLayoutEffect(create, deps); -}; -exports.useMemo = function (create, deps) { - return ReactSharedInternals.H.useMemo(create, deps); -}; -exports.useOptimistic = function (passthrough, reducer) { - return ReactSharedInternals.H.useOptimistic(passthrough, reducer); -}; -exports.useReducer = function (reducer, initialArg, init) { - return ReactSharedInternals.H.useReducer(reducer, initialArg, init); -}; -exports.useRef = function (initialValue) { - return ReactSharedInternals.H.useRef(initialValue); -}; -exports.useState = function (initialState) { - return ReactSharedInternals.H.useState(initialState); -}; -exports.useSyncExternalStore = function ( - subscribe, - getSnapshot, - getServerSnapshot -) { - return ReactSharedInternals.H.useSyncExternalStore( - subscribe, - getSnapshot, - getServerSnapshot - ); -}; -exports.useTransition = function () { - return ReactSharedInternals.H.useTransition(); -}; -exports.version = "19.2.4"; diff --git a/node_modules/react/cjs/react.react-server.development.js b/node_modules/react/cjs/react.react-server.development.js deleted file mode 100644 index 43625fb..0000000 --- a/node_modules/react/cjs/react.react-server.development.js +++ /dev/null @@ -1,848 +0,0 @@ -/** - * @license React - * react.react-server.development.js - * - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - -"use strict"; -"production" !== process.env.NODE_ENV && - (function () { - function noop() {} - function getIteratorFn(maybeIterable) { - if (null === maybeIterable || "object" !== typeof maybeIterable) - return null; - maybeIterable = - (MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL]) || - maybeIterable["@@iterator"]; - return "function" === typeof maybeIterable ? maybeIterable : null; - } - function testStringCoercion(value) { - return "" + value; - } - function checkKeyStringCoercion(value) { - try { - testStringCoercion(value); - var JSCompiler_inline_result = !1; - } catch (e) { - JSCompiler_inline_result = !0; - } - if (JSCompiler_inline_result) { - JSCompiler_inline_result = console; - var JSCompiler_temp_const = JSCompiler_inline_result.error; - var JSCompiler_inline_result$jscomp$0 = - ("function" === typeof Symbol && - Symbol.toStringTag && - value[Symbol.toStringTag]) || - value.constructor.name || - "Object"; - JSCompiler_temp_const.call( - JSCompiler_inline_result, - "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.", - JSCompiler_inline_result$jscomp$0 - ); - return testStringCoercion(value); - } - } - function getComponentNameFromType(type) { - if (null == type) return null; - if ("function" === typeof type) - return type.$$typeof === REACT_CLIENT_REFERENCE - ? null - : type.displayName || type.name || null; - if ("string" === typeof type) return type; - switch (type) { - case REACT_FRAGMENT_TYPE: - return "Fragment"; - case REACT_PROFILER_TYPE: - return "Profiler"; - case REACT_STRICT_MODE_TYPE: - return "StrictMode"; - case REACT_SUSPENSE_TYPE: - return "Suspense"; - case REACT_SUSPENSE_LIST_TYPE: - return "SuspenseList"; - case REACT_ACTIVITY_TYPE: - return "Activity"; - } - if ("object" === typeof type) - switch ( - ("number" === typeof type.tag && - console.error( - "Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue." - ), - type.$$typeof) - ) { - case REACT_PORTAL_TYPE: - return "Portal"; - case REACT_CONTEXT_TYPE: - return type.displayName || "Context"; - case REACT_CONSUMER_TYPE: - return (type._context.displayName || "Context") + ".Consumer"; - case REACT_FORWARD_REF_TYPE: - var innerType = type.render; - type = type.displayName; - type || - ((type = innerType.displayName || innerType.name || ""), - (type = "" !== type ? "ForwardRef(" + type + ")" : "ForwardRef")); - return type; - case REACT_MEMO_TYPE: - return ( - (innerType = type.displayName || null), - null !== innerType - ? innerType - : getComponentNameFromType(type.type) || "Memo" - ); - case REACT_LAZY_TYPE: - innerType = type._payload; - type = type._init; - try { - return getComponentNameFromType(type(innerType)); - } catch (x) {} - } - return null; - } - function getTaskName(type) { - if (type === REACT_FRAGMENT_TYPE) return "<>"; - if ( - "object" === typeof type && - null !== type && - type.$$typeof === REACT_LAZY_TYPE - ) - return "<...>"; - try { - var name = getComponentNameFromType(type); - return name ? "<" + name + ">" : "<...>"; - } catch (x) { - return "<...>"; - } - } - function getOwner() { - var dispatcher = ReactSharedInternals.A; - return null === dispatcher ? null : dispatcher.getOwner(); - } - function UnknownOwner() { - return Error("react-stack-top-frame"); - } - function hasValidKey(config) { - if (hasOwnProperty.call(config, "key")) { - var getter = Object.getOwnPropertyDescriptor(config, "key").get; - if (getter && getter.isReactWarning) return !1; - } - return void 0 !== config.key; - } - function defineKeyPropWarningGetter(props, displayName) { - function warnAboutAccessingKey() { - specialPropKeyWarningShown || - ((specialPropKeyWarningShown = !0), - console.error( - "%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)", - displayName - )); - } - warnAboutAccessingKey.isReactWarning = !0; - Object.defineProperty(props, "key", { - get: warnAboutAccessingKey, - configurable: !0 - }); - } - function elementRefGetterWithDeprecationWarning() { - var componentName = getComponentNameFromType(this.type); - didWarnAboutElementRef[componentName] || - ((didWarnAboutElementRef[componentName] = !0), - console.error( - "Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release." - )); - componentName = this.props.ref; - return void 0 !== componentName ? componentName : null; - } - function ReactElement(type, key, props, owner, debugStack, debugTask) { - var refProp = props.ref; - type = { - $$typeof: REACT_ELEMENT_TYPE, - type: type, - key: key, - props: props, - _owner: owner - }; - null !== (void 0 !== refProp ? refProp : null) - ? Object.defineProperty(type, "ref", { - enumerable: !1, - get: elementRefGetterWithDeprecationWarning - }) - : Object.defineProperty(type, "ref", { enumerable: !1, value: null }); - type._store = {}; - Object.defineProperty(type._store, "validated", { - configurable: !1, - enumerable: !1, - writable: !0, - value: 0 - }); - Object.defineProperty(type, "_debugInfo", { - configurable: !1, - enumerable: !1, - writable: !0, - value: null - }); - Object.defineProperty(type, "_debugStack", { - configurable: !1, - enumerable: !1, - writable: !0, - value: debugStack - }); - Object.defineProperty(type, "_debugTask", { - configurable: !1, - enumerable: !1, - writable: !0, - value: debugTask - }); - Object.freeze && (Object.freeze(type.props), Object.freeze(type)); - return type; - } - function cloneAndReplaceKey(oldElement, newKey) { - newKey = ReactElement( - oldElement.type, - newKey, - oldElement.props, - oldElement._owner, - oldElement._debugStack, - oldElement._debugTask - ); - oldElement._store && - (newKey._store.validated = oldElement._store.validated); - return newKey; - } - function validateChildKeys(node) { - isValidElement(node) - ? node._store && (node._store.validated = 1) - : "object" === typeof node && - null !== node && - node.$$typeof === REACT_LAZY_TYPE && - ("fulfilled" === node._payload.status - ? isValidElement(node._payload.value) && - node._payload.value._store && - (node._payload.value._store.validated = 1) - : node._store && (node._store.validated = 1)); - } - function isValidElement(object) { - return ( - "object" === typeof object && - null !== object && - object.$$typeof === REACT_ELEMENT_TYPE - ); - } - function escape(key) { - var escaperLookup = { "=": "=0", ":": "=2" }; - return ( - "$" + - key.replace(/[=:]/g, function (match) { - return escaperLookup[match]; - }) - ); - } - function getElementKey(element, index) { - return "object" === typeof element && - null !== element && - null != element.key - ? (checkKeyStringCoercion(element.key), escape("" + element.key)) - : index.toString(36); - } - function resolveThenable(thenable) { - switch (thenable.status) { - case "fulfilled": - return thenable.value; - case "rejected": - throw thenable.reason; - default: - switch ( - ("string" === typeof thenable.status - ? thenable.then(noop, noop) - : ((thenable.status = "pending"), - thenable.then( - function (fulfilledValue) { - "pending" === thenable.status && - ((thenable.status = "fulfilled"), - (thenable.value = fulfilledValue)); - }, - function (error) { - "pending" === thenable.status && - ((thenable.status = "rejected"), - (thenable.reason = error)); - } - )), - thenable.status) - ) { - case "fulfilled": - return thenable.value; - case "rejected": - throw thenable.reason; - } - } - throw thenable; - } - function mapIntoArray(children, array, escapedPrefix, nameSoFar, callback) { - var type = typeof children; - if ("undefined" === type || "boolean" === type) children = null; - var invokeCallback = !1; - if (null === children) invokeCallback = !0; - else - switch (type) { - case "bigint": - case "string": - case "number": - invokeCallback = !0; - break; - case "object": - switch (children.$$typeof) { - case REACT_ELEMENT_TYPE: - case REACT_PORTAL_TYPE: - invokeCallback = !0; - break; - case REACT_LAZY_TYPE: - return ( - (invokeCallback = children._init), - mapIntoArray( - invokeCallback(children._payload), - array, - escapedPrefix, - nameSoFar, - callback - ) - ); - } - } - if (invokeCallback) { - invokeCallback = children; - callback = callback(invokeCallback); - var childKey = - "" === nameSoFar ? "." + getElementKey(invokeCallback, 0) : nameSoFar; - isArrayImpl(callback) - ? ((escapedPrefix = ""), - null != childKey && - (escapedPrefix = - childKey.replace(userProvidedKeyEscapeRegex, "$&/") + "/"), - mapIntoArray(callback, array, escapedPrefix, "", function (c) { - return c; - })) - : null != callback && - (isValidElement(callback) && - (null != callback.key && - ((invokeCallback && invokeCallback.key === callback.key) || - checkKeyStringCoercion(callback.key)), - (escapedPrefix = cloneAndReplaceKey( - callback, - escapedPrefix + - (null == callback.key || - (invokeCallback && invokeCallback.key === callback.key) - ? "" - : ("" + callback.key).replace( - userProvidedKeyEscapeRegex, - "$&/" - ) + "/") + - childKey - )), - "" !== nameSoFar && - null != invokeCallback && - isValidElement(invokeCallback) && - null == invokeCallback.key && - invokeCallback._store && - !invokeCallback._store.validated && - (escapedPrefix._store.validated = 2), - (callback = escapedPrefix)), - array.push(callback)); - return 1; - } - invokeCallback = 0; - childKey = "" === nameSoFar ? "." : nameSoFar + ":"; - if (isArrayImpl(children)) - for (var i = 0; i < children.length; i++) - (nameSoFar = children[i]), - (type = childKey + getElementKey(nameSoFar, i)), - (invokeCallback += mapIntoArray( - nameSoFar, - array, - escapedPrefix, - type, - callback - )); - else if (((i = getIteratorFn(children)), "function" === typeof i)) - for ( - i === children.entries && - (didWarnAboutMaps || - console.warn( - "Using Maps as children is not supported. Use an array of keyed ReactElements instead." - ), - (didWarnAboutMaps = !0)), - children = i.call(children), - i = 0; - !(nameSoFar = children.next()).done; - - ) - (nameSoFar = nameSoFar.value), - (type = childKey + getElementKey(nameSoFar, i++)), - (invokeCallback += mapIntoArray( - nameSoFar, - array, - escapedPrefix, - type, - callback - )); - else if ("object" === type) { - if ("function" === typeof children.then) - return mapIntoArray( - resolveThenable(children), - array, - escapedPrefix, - nameSoFar, - callback - ); - array = String(children); - throw Error( - "Objects are not valid as a React child (found: " + - ("[object Object]" === array - ? "object with keys {" + Object.keys(children).join(", ") + "}" - : array) + - "). If you meant to render a collection of children, use an array instead." - ); - } - return invokeCallback; - } - function mapChildren(children, func, context) { - if (null == children) return children; - var result = [], - count = 0; - mapIntoArray(children, result, "", "", function (child) { - return func.call(context, child, count++); - }); - return result; - } - function resolveDispatcher() { - var dispatcher = ReactSharedInternals.H; - null === dispatcher && - console.error( - "Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\n1. You might have mismatching versions of React and the renderer (such as React DOM)\n2. You might be breaking the Rules of Hooks\n3. You might have more than one copy of React in the same app\nSee https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem." - ); - return dispatcher; - } - function lazyInitializer(payload) { - if (-1 === payload._status) { - var ioInfo = payload._ioInfo; - null != ioInfo && (ioInfo.start = ioInfo.end = performance.now()); - ioInfo = payload._result; - var thenable = ioInfo(); - thenable.then( - function (moduleObject) { - if (0 === payload._status || -1 === payload._status) { - payload._status = 1; - payload._result = moduleObject; - var _ioInfo = payload._ioInfo; - null != _ioInfo && (_ioInfo.end = performance.now()); - void 0 === thenable.status && - ((thenable.status = "fulfilled"), - (thenable.value = moduleObject)); - } - }, - function (error) { - if (0 === payload._status || -1 === payload._status) { - payload._status = 2; - payload._result = error; - var _ioInfo2 = payload._ioInfo; - null != _ioInfo2 && (_ioInfo2.end = performance.now()); - void 0 === thenable.status && - ((thenable.status = "rejected"), (thenable.reason = error)); - } - } - ); - ioInfo = payload._ioInfo; - if (null != ioInfo) { - ioInfo.value = thenable; - var displayName = thenable.displayName; - "string" === typeof displayName && (ioInfo.name = displayName); - } - -1 === payload._status && - ((payload._status = 0), (payload._result = thenable)); - } - if (1 === payload._status) - return ( - (ioInfo = payload._result), - void 0 === ioInfo && - console.error( - "lazy: Expected the result of a dynamic import() call. Instead received: %s\n\nYour code should look like: \n const MyComponent = lazy(() => import('./MyComponent'))\n\nDid you accidentally put curly braces around the import?", - ioInfo - ), - "default" in ioInfo || - console.error( - "lazy: Expected the result of a dynamic import() call. Instead received: %s\n\nYour code should look like: \n const MyComponent = lazy(() => import('./MyComponent'))", - ioInfo - ), - ioInfo.default - ); - throw payload._result; - } - function createCacheRoot() { - return new WeakMap(); - } - function createCacheNode() { - return { s: 0, v: void 0, o: null, p: null }; - } - var ReactSharedInternals = { - H: null, - A: null, - getCurrentStack: null, - recentlyCreatedOwnerStacks: 0 - }, - isArrayImpl = Array.isArray, - REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"), - REACT_PORTAL_TYPE = Symbol.for("react.portal"), - REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"), - REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"), - REACT_PROFILER_TYPE = Symbol.for("react.profiler"), - REACT_CONSUMER_TYPE = Symbol.for("react.consumer"), - REACT_CONTEXT_TYPE = Symbol.for("react.context"), - REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"), - REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"), - REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"), - REACT_MEMO_TYPE = Symbol.for("react.memo"), - REACT_LAZY_TYPE = Symbol.for("react.lazy"), - REACT_ACTIVITY_TYPE = Symbol.for("react.activity"), - MAYBE_ITERATOR_SYMBOL = Symbol.iterator, - REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference"), - hasOwnProperty = Object.prototype.hasOwnProperty, - assign = Object.assign, - createTask = console.createTask - ? console.createTask - : function () { - return null; - }, - createFakeCallStack = { - react_stack_bottom_frame: function (callStackForError) { - return callStackForError(); - } - }, - specialPropKeyWarningShown, - didWarnAboutOldJSXRuntime; - var didWarnAboutElementRef = {}; - var unknownOwnerDebugStack = - createFakeCallStack.react_stack_bottom_frame.bind( - createFakeCallStack, - UnknownOwner - )(); - var unknownOwnerDebugTask = createTask(getTaskName(UnknownOwner)); - var didWarnAboutMaps = !1, - userProvidedKeyEscapeRegex = /\/+/g; - exports.Children = { - map: mapChildren, - forEach: function (children, forEachFunc, forEachContext) { - mapChildren( - children, - function () { - forEachFunc.apply(this, arguments); - }, - forEachContext - ); - }, - count: function (children) { - var n = 0; - mapChildren(children, function () { - n++; - }); - return n; - }, - toArray: function (children) { - return ( - mapChildren(children, function (child) { - return child; - }) || [] - ); - }, - only: function (children) { - if (!isValidElement(children)) - throw Error( - "React.Children.only expected to receive a single React element child." - ); - return children; - } - }; - exports.Fragment = REACT_FRAGMENT_TYPE; - exports.Profiler = REACT_PROFILER_TYPE; - exports.StrictMode = REACT_STRICT_MODE_TYPE; - exports.Suspense = REACT_SUSPENSE_TYPE; - exports.__SERVER_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE = - ReactSharedInternals; - exports.cache = function (fn) { - return function () { - var dispatcher = ReactSharedInternals.A; - if (!dispatcher) return fn.apply(null, arguments); - var fnMap = dispatcher.getCacheForType(createCacheRoot); - dispatcher = fnMap.get(fn); - void 0 === dispatcher && - ((dispatcher = createCacheNode()), fnMap.set(fn, dispatcher)); - fnMap = 0; - for (var l = arguments.length; fnMap < l; fnMap++) { - var arg = arguments[fnMap]; - if ( - "function" === typeof arg || - ("object" === typeof arg && null !== arg) - ) { - var objectCache = dispatcher.o; - null === objectCache && - (dispatcher.o = objectCache = new WeakMap()); - dispatcher = objectCache.get(arg); - void 0 === dispatcher && - ((dispatcher = createCacheNode()), - objectCache.set(arg, dispatcher)); - } else - (objectCache = dispatcher.p), - null === objectCache && (dispatcher.p = objectCache = new Map()), - (dispatcher = objectCache.get(arg)), - void 0 === dispatcher && - ((dispatcher = createCacheNode()), - objectCache.set(arg, dispatcher)); - } - if (1 === dispatcher.s) return dispatcher.v; - if (2 === dispatcher.s) throw dispatcher.v; - try { - var result = fn.apply(null, arguments); - fnMap = dispatcher; - fnMap.s = 1; - return (fnMap.v = result); - } catch (error) { - throw ( - ((result = dispatcher), (result.s = 2), (result.v = error), error) - ); - } - }; - }; - exports.cacheSignal = function () { - var dispatcher = ReactSharedInternals.A; - return dispatcher ? dispatcher.cacheSignal() : null; - }; - exports.captureOwnerStack = function () { - var getCurrentStack = ReactSharedInternals.getCurrentStack; - return null === getCurrentStack ? null : getCurrentStack(); - }; - exports.cloneElement = function (element, config, children) { - if (null === element || void 0 === element) - throw Error( - "The argument must be a React element, but you passed " + - element + - "." - ); - var props = assign({}, element.props), - key = element.key, - owner = element._owner; - if (null != config) { - var JSCompiler_inline_result; - a: { - if ( - hasOwnProperty.call(config, "ref") && - (JSCompiler_inline_result = Object.getOwnPropertyDescriptor( - config, - "ref" - ).get) && - JSCompiler_inline_result.isReactWarning - ) { - JSCompiler_inline_result = !1; - break a; - } - JSCompiler_inline_result = void 0 !== config.ref; - } - JSCompiler_inline_result && (owner = getOwner()); - hasValidKey(config) && - (checkKeyStringCoercion(config.key), (key = "" + config.key)); - for (propName in config) - !hasOwnProperty.call(config, propName) || - "key" === propName || - "__self" === propName || - "__source" === propName || - ("ref" === propName && void 0 === config.ref) || - (props[propName] = config[propName]); - } - var propName = arguments.length - 2; - if (1 === propName) props.children = children; - else if (1 < propName) { - JSCompiler_inline_result = Array(propName); - for (var i = 0; i < propName; i++) - JSCompiler_inline_result[i] = arguments[i + 2]; - props.children = JSCompiler_inline_result; - } - props = ReactElement( - element.type, - key, - props, - owner, - element._debugStack, - element._debugTask - ); - for (key = 2; key < arguments.length; key++) - validateChildKeys(arguments[key]); - return props; - }; - exports.createElement = function (type, config, children) { - for (var i = 2; i < arguments.length; i++) - validateChildKeys(arguments[i]); - i = {}; - var key = null; - if (null != config) - for (propName in (didWarnAboutOldJSXRuntime || - !("__self" in config) || - "key" in config || - ((didWarnAboutOldJSXRuntime = !0), - console.warn( - "Your app (or one of its dependencies) is using an outdated JSX transform. Update to the modern JSX transform for faster performance: https://react.dev/link/new-jsx-transform" - )), - hasValidKey(config) && - (checkKeyStringCoercion(config.key), (key = "" + config.key)), - config)) - hasOwnProperty.call(config, propName) && - "key" !== propName && - "__self" !== propName && - "__source" !== propName && - (i[propName] = config[propName]); - var childrenLength = arguments.length - 2; - if (1 === childrenLength) i.children = children; - else if (1 < childrenLength) { - for ( - var childArray = Array(childrenLength), _i = 0; - _i < childrenLength; - _i++ - ) - childArray[_i] = arguments[_i + 2]; - Object.freeze && Object.freeze(childArray); - i.children = childArray; - } - if (type && type.defaultProps) - for (propName in ((childrenLength = type.defaultProps), childrenLength)) - void 0 === i[propName] && (i[propName] = childrenLength[propName]); - key && - defineKeyPropWarningGetter( - i, - "function" === typeof type - ? type.displayName || type.name || "Unknown" - : type - ); - var propName = 1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++; - return ReactElement( - type, - key, - i, - getOwner(), - propName ? Error("react-stack-top-frame") : unknownOwnerDebugStack, - propName ? createTask(getTaskName(type)) : unknownOwnerDebugTask - ); - }; - exports.createRef = function () { - var refObject = { current: null }; - Object.seal(refObject); - return refObject; - }; - exports.forwardRef = function (render) { - null != render && render.$$typeof === REACT_MEMO_TYPE - ? console.error( - "forwardRef requires a render function but received a `memo` component. Instead of forwardRef(memo(...)), use memo(forwardRef(...))." - ) - : "function" !== typeof render - ? console.error( - "forwardRef requires a render function but was given %s.", - null === render ? "null" : typeof render - ) - : 0 !== render.length && - 2 !== render.length && - console.error( - "forwardRef render functions accept exactly two parameters: props and ref. %s", - 1 === render.length - ? "Did you forget to use the ref parameter?" - : "Any additional parameter will be undefined." - ); - null != render && - null != render.defaultProps && - console.error( - "forwardRef render functions do not support defaultProps. Did you accidentally pass a React component?" - ); - var elementType = { $$typeof: REACT_FORWARD_REF_TYPE, render: render }, - ownName; - Object.defineProperty(elementType, "displayName", { - enumerable: !1, - configurable: !0, - get: function () { - return ownName; - }, - set: function (name) { - ownName = name; - render.name || - render.displayName || - (Object.defineProperty(render, "name", { value: name }), - (render.displayName = name)); - } - }); - return elementType; - }; - exports.isValidElement = isValidElement; - exports.lazy = function (ctor) { - ctor = { _status: -1, _result: ctor }; - var lazyType = { - $$typeof: REACT_LAZY_TYPE, - _payload: ctor, - _init: lazyInitializer - }, - ioInfo = { - name: "lazy", - start: -1, - end: -1, - value: null, - owner: null, - debugStack: Error("react-stack-top-frame"), - debugTask: console.createTask ? console.createTask("lazy()") : null - }; - ctor._ioInfo = ioInfo; - lazyType._debugInfo = [{ awaited: ioInfo }]; - return lazyType; - }; - exports.memo = function (type, compare) { - null == type && - console.error( - "memo: The first argument must be a component. Instead received: %s", - null === type ? "null" : typeof type - ); - compare = { - $$typeof: REACT_MEMO_TYPE, - type: type, - compare: void 0 === compare ? null : compare - }; - var ownName; - Object.defineProperty(compare, "displayName", { - enumerable: !1, - configurable: !0, - get: function () { - return ownName; - }, - set: function (name) { - ownName = name; - type.name || - type.displayName || - (Object.defineProperty(type, "name", { value: name }), - (type.displayName = name)); - } - }); - return compare; - }; - exports.use = function (usable) { - return resolveDispatcher().use(usable); - }; - exports.useCallback = function (callback, deps) { - return resolveDispatcher().useCallback(callback, deps); - }; - exports.useDebugValue = function (value, formatterFn) { - return resolveDispatcher().useDebugValue(value, formatterFn); - }; - exports.useId = function () { - return resolveDispatcher().useId(); - }; - exports.useMemo = function (create, deps) { - return resolveDispatcher().useMemo(create, deps); - }; - exports.version = "19.2.4"; - })(); diff --git a/node_modules/react/cjs/react.react-server.production.js b/node_modules/react/cjs/react.react-server.production.js deleted file mode 100644 index 30e61f6..0000000 --- a/node_modules/react/cjs/react.react-server.production.js +++ /dev/null @@ -1,423 +0,0 @@ -/** - * @license React - * react.react-server.production.js - * - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - -"use strict"; -var ReactSharedInternals = { H: null, A: null }; -function formatProdErrorMessage(code) { - var url = "https://react.dev/errors/" + code; - if (1 < arguments.length) { - url += "?args[]=" + encodeURIComponent(arguments[1]); - for (var i = 2; i < arguments.length; i++) - url += "&args[]=" + encodeURIComponent(arguments[i]); - } - return ( - "Minified React error #" + - code + - "; visit " + - url + - " for the full message or use the non-minified dev environment for full errors and additional helpful warnings." - ); -} -var isArrayImpl = Array.isArray; -function noop() {} -var REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"), - REACT_PORTAL_TYPE = Symbol.for("react.portal"), - REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"), - REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"), - REACT_PROFILER_TYPE = Symbol.for("react.profiler"), - REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"), - REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"), - REACT_MEMO_TYPE = Symbol.for("react.memo"), - REACT_LAZY_TYPE = Symbol.for("react.lazy"), - MAYBE_ITERATOR_SYMBOL = Symbol.iterator; -function getIteratorFn(maybeIterable) { - if (null === maybeIterable || "object" !== typeof maybeIterable) return null; - maybeIterable = - (MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL]) || - maybeIterable["@@iterator"]; - return "function" === typeof maybeIterable ? maybeIterable : null; -} -var hasOwnProperty = Object.prototype.hasOwnProperty, - assign = Object.assign; -function ReactElement(type, key, props) { - var refProp = props.ref; - return { - $$typeof: REACT_ELEMENT_TYPE, - type: type, - key: key, - ref: void 0 !== refProp ? refProp : null, - props: props - }; -} -function cloneAndReplaceKey(oldElement, newKey) { - return ReactElement(oldElement.type, newKey, oldElement.props); -} -function isValidElement(object) { - return ( - "object" === typeof object && - null !== object && - object.$$typeof === REACT_ELEMENT_TYPE - ); -} -function escape(key) { - var escaperLookup = { "=": "=0", ":": "=2" }; - return ( - "$" + - key.replace(/[=:]/g, function (match) { - return escaperLookup[match]; - }) - ); -} -var userProvidedKeyEscapeRegex = /\/+/g; -function getElementKey(element, index) { - return "object" === typeof element && null !== element && null != element.key - ? escape("" + element.key) - : index.toString(36); -} -function resolveThenable(thenable) { - switch (thenable.status) { - case "fulfilled": - return thenable.value; - case "rejected": - throw thenable.reason; - default: - switch ( - ("string" === typeof thenable.status - ? thenable.then(noop, noop) - : ((thenable.status = "pending"), - thenable.then( - function (fulfilledValue) { - "pending" === thenable.status && - ((thenable.status = "fulfilled"), - (thenable.value = fulfilledValue)); - }, - function (error) { - "pending" === thenable.status && - ((thenable.status = "rejected"), (thenable.reason = error)); - } - )), - thenable.status) - ) { - case "fulfilled": - return thenable.value; - case "rejected": - throw thenable.reason; - } - } - throw thenable; -} -function mapIntoArray(children, array, escapedPrefix, nameSoFar, callback) { - var type = typeof children; - if ("undefined" === type || "boolean" === type) children = null; - var invokeCallback = !1; - if (null === children) invokeCallback = !0; - else - switch (type) { - case "bigint": - case "string": - case "number": - invokeCallback = !0; - break; - case "object": - switch (children.$$typeof) { - case REACT_ELEMENT_TYPE: - case REACT_PORTAL_TYPE: - invokeCallback = !0; - break; - case REACT_LAZY_TYPE: - return ( - (invokeCallback = children._init), - mapIntoArray( - invokeCallback(children._payload), - array, - escapedPrefix, - nameSoFar, - callback - ) - ); - } - } - if (invokeCallback) - return ( - (callback = callback(children)), - (invokeCallback = - "" === nameSoFar ? "." + getElementKey(children, 0) : nameSoFar), - isArrayImpl(callback) - ? ((escapedPrefix = ""), - null != invokeCallback && - (escapedPrefix = - invokeCallback.replace(userProvidedKeyEscapeRegex, "$&/") + "/"), - mapIntoArray(callback, array, escapedPrefix, "", function (c) { - return c; - })) - : null != callback && - (isValidElement(callback) && - (callback = cloneAndReplaceKey( - callback, - escapedPrefix + - (null == callback.key || - (children && children.key === callback.key) - ? "" - : ("" + callback.key).replace( - userProvidedKeyEscapeRegex, - "$&/" - ) + "/") + - invokeCallback - )), - array.push(callback)), - 1 - ); - invokeCallback = 0; - var nextNamePrefix = "" === nameSoFar ? "." : nameSoFar + ":"; - if (isArrayImpl(children)) - for (var i = 0; i < children.length; i++) - (nameSoFar = children[i]), - (type = nextNamePrefix + getElementKey(nameSoFar, i)), - (invokeCallback += mapIntoArray( - nameSoFar, - array, - escapedPrefix, - type, - callback - )); - else if (((i = getIteratorFn(children)), "function" === typeof i)) - for ( - children = i.call(children), i = 0; - !(nameSoFar = children.next()).done; - - ) - (nameSoFar = nameSoFar.value), - (type = nextNamePrefix + getElementKey(nameSoFar, i++)), - (invokeCallback += mapIntoArray( - nameSoFar, - array, - escapedPrefix, - type, - callback - )); - else if ("object" === type) { - if ("function" === typeof children.then) - return mapIntoArray( - resolveThenable(children), - array, - escapedPrefix, - nameSoFar, - callback - ); - array = String(children); - throw Error( - formatProdErrorMessage( - 31, - "[object Object]" === array - ? "object with keys {" + Object.keys(children).join(", ") + "}" - : array - ) - ); - } - return invokeCallback; -} -function mapChildren(children, func, context) { - if (null == children) return children; - var result = [], - count = 0; - mapIntoArray(children, result, "", "", function (child) { - return func.call(context, child, count++); - }); - return result; -} -function lazyInitializer(payload) { - if (-1 === payload._status) { - var ctor = payload._result; - ctor = ctor(); - ctor.then( - function (moduleObject) { - if (0 === payload._status || -1 === payload._status) - (payload._status = 1), (payload._result = moduleObject); - }, - function (error) { - if (0 === payload._status || -1 === payload._status) - (payload._status = 2), (payload._result = error); - } - ); - -1 === payload._status && ((payload._status = 0), (payload._result = ctor)); - } - if (1 === payload._status) return payload._result.default; - throw payload._result; -} -function createCacheRoot() { - return new WeakMap(); -} -function createCacheNode() { - return { s: 0, v: void 0, o: null, p: null }; -} -exports.Children = { - map: mapChildren, - forEach: function (children, forEachFunc, forEachContext) { - mapChildren( - children, - function () { - forEachFunc.apply(this, arguments); - }, - forEachContext - ); - }, - count: function (children) { - var n = 0; - mapChildren(children, function () { - n++; - }); - return n; - }, - toArray: function (children) { - return ( - mapChildren(children, function (child) { - return child; - }) || [] - ); - }, - only: function (children) { - if (!isValidElement(children)) throw Error(formatProdErrorMessage(143)); - return children; - } -}; -exports.Fragment = REACT_FRAGMENT_TYPE; -exports.Profiler = REACT_PROFILER_TYPE; -exports.StrictMode = REACT_STRICT_MODE_TYPE; -exports.Suspense = REACT_SUSPENSE_TYPE; -exports.__SERVER_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE = - ReactSharedInternals; -exports.cache = function (fn) { - return function () { - var dispatcher = ReactSharedInternals.A; - if (!dispatcher) return fn.apply(null, arguments); - var fnMap = dispatcher.getCacheForType(createCacheRoot); - dispatcher = fnMap.get(fn); - void 0 === dispatcher && - ((dispatcher = createCacheNode()), fnMap.set(fn, dispatcher)); - fnMap = 0; - for (var l = arguments.length; fnMap < l; fnMap++) { - var arg = arguments[fnMap]; - if ( - "function" === typeof arg || - ("object" === typeof arg && null !== arg) - ) { - var objectCache = dispatcher.o; - null === objectCache && (dispatcher.o = objectCache = new WeakMap()); - dispatcher = objectCache.get(arg); - void 0 === dispatcher && - ((dispatcher = createCacheNode()), objectCache.set(arg, dispatcher)); - } else - (objectCache = dispatcher.p), - null === objectCache && (dispatcher.p = objectCache = new Map()), - (dispatcher = objectCache.get(arg)), - void 0 === dispatcher && - ((dispatcher = createCacheNode()), - objectCache.set(arg, dispatcher)); - } - if (1 === dispatcher.s) return dispatcher.v; - if (2 === dispatcher.s) throw dispatcher.v; - try { - var result = fn.apply(null, arguments); - fnMap = dispatcher; - fnMap.s = 1; - return (fnMap.v = result); - } catch (error) { - throw ((result = dispatcher), (result.s = 2), (result.v = error), error); - } - }; -}; -exports.cacheSignal = function () { - var dispatcher = ReactSharedInternals.A; - return dispatcher ? dispatcher.cacheSignal() : null; -}; -exports.captureOwnerStack = function () { - return null; -}; -exports.cloneElement = function (element, config, children) { - if (null === element || void 0 === element) - throw Error(formatProdErrorMessage(267, element)); - var props = assign({}, element.props), - key = element.key; - if (null != config) - for (propName in (void 0 !== config.key && (key = "" + config.key), config)) - !hasOwnProperty.call(config, propName) || - "key" === propName || - "__self" === propName || - "__source" === propName || - ("ref" === propName && void 0 === config.ref) || - (props[propName] = config[propName]); - var propName = arguments.length - 2; - if (1 === propName) props.children = children; - else if (1 < propName) { - for (var childArray = Array(propName), i = 0; i < propName; i++) - childArray[i] = arguments[i + 2]; - props.children = childArray; - } - return ReactElement(element.type, key, props); -}; -exports.createElement = function (type, config, children) { - var propName, - props = {}, - key = null; - if (null != config) - for (propName in (void 0 !== config.key && (key = "" + config.key), config)) - hasOwnProperty.call(config, propName) && - "key" !== propName && - "__self" !== propName && - "__source" !== propName && - (props[propName] = config[propName]); - var childrenLength = arguments.length - 2; - if (1 === childrenLength) props.children = children; - else if (1 < childrenLength) { - for (var childArray = Array(childrenLength), i = 0; i < childrenLength; i++) - childArray[i] = arguments[i + 2]; - props.children = childArray; - } - if (type && type.defaultProps) - for (propName in ((childrenLength = type.defaultProps), childrenLength)) - void 0 === props[propName] && - (props[propName] = childrenLength[propName]); - return ReactElement(type, key, props); -}; -exports.createRef = function () { - return { current: null }; -}; -exports.forwardRef = function (render) { - return { $$typeof: REACT_FORWARD_REF_TYPE, render: render }; -}; -exports.isValidElement = isValidElement; -exports.lazy = function (ctor) { - return { - $$typeof: REACT_LAZY_TYPE, - _payload: { _status: -1, _result: ctor }, - _init: lazyInitializer - }; -}; -exports.memo = function (type, compare) { - return { - $$typeof: REACT_MEMO_TYPE, - type: type, - compare: void 0 === compare ? null : compare - }; -}; -exports.use = function (usable) { - return ReactSharedInternals.H.use(usable); -}; -exports.useCallback = function (callback, deps) { - return ReactSharedInternals.H.useCallback(callback, deps); -}; -exports.useDebugValue = function () {}; -exports.useId = function () { - return ReactSharedInternals.H.useId(); -}; -exports.useMemo = function (create, deps) { - return ReactSharedInternals.H.useMemo(create, deps); -}; -exports.version = "19.2.4"; diff --git a/node_modules/react/compiler-runtime.js b/node_modules/react/compiler-runtime.js deleted file mode 100644 index ab6aabb..0000000 --- a/node_modules/react/compiler-runtime.js +++ /dev/null @@ -1,14 +0,0 @@ -/** - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - -'use strict'; - -if (process.env.NODE_ENV === 'production') { - module.exports = require('./cjs/react-compiler-runtime.production.js'); -} else { - module.exports = require('./cjs/react-compiler-runtime.development.js'); -} diff --git a/node_modules/react/index.js b/node_modules/react/index.js deleted file mode 100644 index d830d7a..0000000 --- a/node_modules/react/index.js +++ /dev/null @@ -1,7 +0,0 @@ -'use strict'; - -if (process.env.NODE_ENV === 'production') { - module.exports = require('./cjs/react.production.js'); -} else { - module.exports = require('./cjs/react.development.js'); -} diff --git a/node_modules/react/jsx-dev-runtime.js b/node_modules/react/jsx-dev-runtime.js deleted file mode 100644 index 0a80857..0000000 --- a/node_modules/react/jsx-dev-runtime.js +++ /dev/null @@ -1,7 +0,0 @@ -'use strict'; - -if (process.env.NODE_ENV === 'production') { - module.exports = require('./cjs/react-jsx-dev-runtime.production.js'); -} else { - module.exports = require('./cjs/react-jsx-dev-runtime.development.js'); -} diff --git a/node_modules/react/jsx-dev-runtime.react-server.js b/node_modules/react/jsx-dev-runtime.react-server.js deleted file mode 100644 index d11e6e8..0000000 --- a/node_modules/react/jsx-dev-runtime.react-server.js +++ /dev/null @@ -1,7 +0,0 @@ -'use strict'; - -if (process.env.NODE_ENV === 'production') { - module.exports = require('./cjs/react-jsx-dev-runtime.react-server.production.js'); -} else { - module.exports = require('./cjs/react-jsx-dev-runtime.react-server.development.js'); -} diff --git a/node_modules/react/jsx-runtime.js b/node_modules/react/jsx-runtime.js deleted file mode 100644 index 8679b72..0000000 --- a/node_modules/react/jsx-runtime.js +++ /dev/null @@ -1,7 +0,0 @@ -'use strict'; - -if (process.env.NODE_ENV === 'production') { - module.exports = require('./cjs/react-jsx-runtime.production.js'); -} else { - module.exports = require('./cjs/react-jsx-runtime.development.js'); -} diff --git a/node_modules/react/jsx-runtime.react-server.js b/node_modules/react/jsx-runtime.react-server.js deleted file mode 100644 index 2d23c8c..0000000 --- a/node_modules/react/jsx-runtime.react-server.js +++ /dev/null @@ -1,7 +0,0 @@ -'use strict'; - -if (process.env.NODE_ENV === 'production') { - module.exports = require('./cjs/react-jsx-runtime.react-server.production.js'); -} else { - module.exports = require('./cjs/react-jsx-runtime.react-server.development.js'); -} diff --git a/node_modules/react/package.json b/node_modules/react/package.json deleted file mode 100644 index da45a9d..0000000 --- a/node_modules/react/package.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "name": "react", - "description": "React is a JavaScript library for building user interfaces.", - "keywords": [ - "react" - ], - "version": "19.2.4", - "homepage": "https://react.dev/", - "bugs": "https://github.com/facebook/react/issues", - "license": "MIT", - "files": [ - "LICENSE", - "README.md", - "index.js", - "cjs/", - "compiler-runtime.js", - "jsx-runtime.js", - "jsx-runtime.react-server.js", - "jsx-dev-runtime.js", - "jsx-dev-runtime.react-server.js", - "react.react-server.js" - ], - "main": "index.js", - "exports": { - ".": { - "react-server": "./react.react-server.js", - "default": "./index.js" - }, - "./package.json": "./package.json", - "./jsx-runtime": { - "react-server": "./jsx-runtime.react-server.js", - "default": "./jsx-runtime.js" - }, - "./jsx-dev-runtime": { - "react-server": "./jsx-dev-runtime.react-server.js", - "default": "./jsx-dev-runtime.js" - }, - "./compiler-runtime": { - "react-server": "./compiler-runtime.js", - "default": "./compiler-runtime.js" - } - }, - "repository": { - "type": "git", - "url": "https://github.com/facebook/react.git", - "directory": "packages/react" - }, - "engines": { - "node": ">=0.10.0" - } -} \ No newline at end of file diff --git a/node_modules/react/react.react-server.js b/node_modules/react/react.react-server.js deleted file mode 100644 index c66e3b7..0000000 --- a/node_modules/react/react.react-server.js +++ /dev/null @@ -1,7 +0,0 @@ -'use strict'; - -if (process.env.NODE_ENV === 'production') { - module.exports = require('./cjs/react.react-server.production.js'); -} else { - module.exports = require('./cjs/react.react-server.development.js'); -}