{"version":3,"file":"tanstack_react-query-2v1QyOfn.js","sources":["../../node_modules/.pnpm/@tanstack+react-query@5.59.20_react@18.3.1/node_modules/@tanstack/react-query/build/modern/QueryClientProvider.js","../../node_modules/.pnpm/@tanstack+react-query@5.59.20_react@18.3.1/node_modules/@tanstack/react-query/build/modern/isRestoring.js","../../node_modules/.pnpm/@tanstack+react-query@5.59.20_react@18.3.1/node_modules/@tanstack/react-query/build/modern/QueryErrorResetBoundary.js","../../node_modules/.pnpm/@tanstack+react-query@5.59.20_react@18.3.1/node_modules/@tanstack/react-query/build/modern/utils.js","../../node_modules/.pnpm/@tanstack+react-query@5.59.20_react@18.3.1/node_modules/@tanstack/react-query/build/modern/errorBoundaryUtils.js","../../node_modules/.pnpm/@tanstack+react-query@5.59.20_react@18.3.1/node_modules/@tanstack/react-query/build/modern/suspense.js","../../node_modules/.pnpm/@tanstack+react-query@5.59.20_react@18.3.1/node_modules/@tanstack/react-query/build/modern/useBaseQuery.js","../../node_modules/.pnpm/@tanstack+react-query@5.59.20_react@18.3.1/node_modules/@tanstack/react-query/build/modern/useQuery.js","../../node_modules/.pnpm/@tanstack+react-query@5.59.20_react@18.3.1/node_modules/@tanstack/react-query/build/modern/useMutation.js"],"sourcesContent":["\"use client\";\n\n// src/QueryClientProvider.tsx\nimport * as React from \"react\";\nimport { jsx } from \"react/jsx-runtime\";\nvar QueryClientContext = React.createContext(\n void 0\n);\nvar useQueryClient = (queryClient) => {\n const client = React.useContext(QueryClientContext);\n if (queryClient) {\n return queryClient;\n }\n if (!client) {\n throw new Error(\"No QueryClient set, use QueryClientProvider to set one\");\n }\n return client;\n};\nvar QueryClientProvider = ({\n client,\n children\n}) => {\n React.useEffect(() => {\n client.mount();\n return () => {\n client.unmount();\n };\n }, [client]);\n return /* @__PURE__ */ jsx(QueryClientContext.Provider, { value: client, children });\n};\nexport {\n QueryClientContext,\n QueryClientProvider,\n useQueryClient\n};\n//# sourceMappingURL=QueryClientProvider.js.map","\"use client\";\n\n// src/isRestoring.ts\nimport * as React from \"react\";\nvar IsRestoringContext = React.createContext(false);\nvar useIsRestoring = () => React.useContext(IsRestoringContext);\nvar IsRestoringProvider = IsRestoringContext.Provider;\nexport {\n IsRestoringProvider,\n useIsRestoring\n};\n//# sourceMappingURL=isRestoring.js.map","\"use client\";\n\n// src/QueryErrorResetBoundary.tsx\nimport * as React from \"react\";\nimport { jsx } from \"react/jsx-runtime\";\nfunction createValue() {\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}\nvar QueryErrorResetBoundaryContext = React.createContext(createValue());\nvar useQueryErrorResetBoundary = () => React.useContext(QueryErrorResetBoundaryContext);\nvar QueryErrorResetBoundary = ({\n children\n}) => {\n const [value] = React.useState(() => createValue());\n return /* @__PURE__ */ jsx(QueryErrorResetBoundaryContext.Provider, { value, children: typeof children === \"function\" ? children(value) : children });\n};\nexport {\n QueryErrorResetBoundary,\n useQueryErrorResetBoundary\n};\n//# sourceMappingURL=QueryErrorResetBoundary.js.map","// src/utils.ts\nfunction shouldThrowError(throwError, params) {\n if (typeof throwError === \"function\") {\n return throwError(...params);\n }\n return !!throwError;\n}\nfunction noop() {\n}\nexport {\n noop,\n shouldThrowError\n};\n//# sourceMappingURL=utils.js.map","\"use client\";\n\n// src/errorBoundaryUtils.ts\nimport * as React from \"react\";\nimport { shouldThrowError } from \"./utils.js\";\nvar ensurePreventErrorBoundaryRetry = (options, errorResetBoundary) => {\n if (options.suspense || options.throwOnError || options.experimental_prefetchInRender) {\n if (!errorResetBoundary.isReset()) {\n options.retryOnMount = false;\n }\n }\n};\nvar useClearResetErrorBoundary = (errorResetBoundary) => {\n React.useEffect(() => {\n errorResetBoundary.clearReset();\n }, [errorResetBoundary]);\n};\nvar getHasError = ({\n result,\n errorResetBoundary,\n throwOnError,\n query\n}) => {\n return result.isError && !errorResetBoundary.isReset() && !result.isFetching && query && shouldThrowError(throwOnError, [result.error, query]);\n};\nexport {\n ensurePreventErrorBoundaryRetry,\n getHasError,\n useClearResetErrorBoundary\n};\n//# sourceMappingURL=errorBoundaryUtils.js.map","// src/suspense.ts\nvar defaultThrowOnError = (_error, query) => query.state.data === void 0;\nvar ensureSuspenseTimers = (defaultedOptions) => {\n if (defaultedOptions.suspense) {\n if (defaultedOptions.staleTime === void 0) {\n defaultedOptions.staleTime = 1e3;\n }\n if (typeof defaultedOptions.gcTime === \"number\") {\n defaultedOptions.gcTime = Math.max(defaultedOptions.gcTime, 1e3);\n }\n }\n};\nvar willFetch = (result, isRestoring) => result.isLoading && result.isFetching && !isRestoring;\nvar shouldSuspend = (defaultedOptions, result) => defaultedOptions?.suspense && result.isPending;\nvar fetchOptimistic = (defaultedOptions, observer, errorResetBoundary) => observer.fetchOptimistic(defaultedOptions).catch(() => {\n errorResetBoundary.clearReset();\n});\nexport {\n defaultThrowOnError,\n ensureSuspenseTimers,\n fetchOptimistic,\n shouldSuspend,\n willFetch\n};\n//# sourceMappingURL=suspense.js.map","\"use client\";\n\n// src/useBaseQuery.ts\nimport * as React from \"react\";\nimport { isServer, notifyManager } from \"@tanstack/query-core\";\nimport { useQueryClient } from \"./QueryClientProvider.js\";\nimport { useQueryErrorResetBoundary } from \"./QueryErrorResetBoundary.js\";\nimport {\n ensurePreventErrorBoundaryRetry,\n getHasError,\n useClearResetErrorBoundary\n} from \"./errorBoundaryUtils.js\";\nimport { useIsRestoring } from \"./isRestoring.js\";\nimport {\n ensureSuspenseTimers,\n fetchOptimistic,\n shouldSuspend,\n willFetch\n} from \"./suspense.js\";\nimport { noop } from \"./utils.js\";\nfunction useBaseQuery(options, Observer, queryClient) {\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 const client = useQueryClient(queryClient);\n const isRestoring = useIsRestoring();\n const errorResetBoundary = useQueryErrorResetBoundary();\n const defaultedOptions = client.defaultQueryOptions(options);\n client.getDefaultOptions().queries?._experimental_beforeQuery?.(\n defaultedOptions\n );\n defaultedOptions._optimisticResults = isRestoring ? \"isRestoring\" : \"optimistic\";\n ensureSuspenseTimers(defaultedOptions);\n ensurePreventErrorBoundaryRetry(defaultedOptions, errorResetBoundary);\n useClearResetErrorBoundary(errorResetBoundary);\n const isNewCacheEntry = !client.getQueryCache().get(defaultedOptions.queryHash);\n const [observer] = React.useState(\n () => new Observer(\n client,\n defaultedOptions\n )\n );\n const result = observer.getOptimisticResult(defaultedOptions);\n React.useSyncExternalStore(\n React.useCallback(\n (onStoreChange) => {\n const unsubscribe = isRestoring ? () => void 0 : observer.subscribe(notifyManager.batchCalls(onStoreChange));\n observer.updateResult();\n return unsubscribe;\n },\n [observer, isRestoring]\n ),\n () => observer.getCurrentResult(),\n () => observer.getCurrentResult()\n );\n React.useEffect(() => {\n observer.setOptions(defaultedOptions, { listeners: false });\n }, [defaultedOptions, observer]);\n if (shouldSuspend(defaultedOptions, result)) {\n throw fetchOptimistic(defaultedOptions, observer, errorResetBoundary);\n }\n if (getHasError({\n result,\n errorResetBoundary,\n throwOnError: defaultedOptions.throwOnError,\n query: client.getQueryCache().get(defaultedOptions.queryHash)\n })) {\n throw result.error;\n }\n ;\n client.getDefaultOptions().queries?._experimental_afterQuery?.(\n defaultedOptions,\n result\n );\n if (defaultedOptions.experimental_prefetchInRender && !isServer && willFetch(result, isRestoring)) {\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 ) : (\n // subscribe to the \"cache promise\" so that we can finalize the currentThenable once data comes in\n client.getQueryCache().get(defaultedOptions.queryHash)?.promise\n );\n promise?.catch(noop).finally(() => {\n observer.updateResult();\n });\n }\n return !defaultedOptions.notifyOnChangeProps ? observer.trackResult(result) : result;\n}\nexport {\n useBaseQuery\n};\n//# sourceMappingURL=useBaseQuery.js.map","\"use client\";\n\n// src/useQuery.ts\nimport { QueryObserver } from \"@tanstack/query-core\";\nimport { useBaseQuery } from \"./useBaseQuery.js\";\nfunction useQuery(options, queryClient) {\n return useBaseQuery(options, QueryObserver, queryClient);\n}\nexport {\n useQuery\n};\n//# sourceMappingURL=useQuery.js.map","\"use client\";\n\n// src/useMutation.ts\nimport * as React from \"react\";\nimport { MutationObserver, notifyManager } from \"@tanstack/query-core\";\nimport { useQueryClient } from \"./QueryClientProvider.js\";\nimport { noop, shouldThrowError } from \"./utils.js\";\nfunction useMutation(options, queryClient) {\n const client = useQueryClient(queryClient);\n const [observer] = React.useState(\n () => new MutationObserver(\n client,\n options\n )\n );\n React.useEffect(() => {\n observer.setOptions(options);\n }, [observer, options]);\n const result = React.useSyncExternalStore(\n React.useCallback(\n (onStoreChange) => observer.subscribe(notifyManager.batchCalls(onStoreChange)),\n [observer]\n ),\n () => observer.getCurrentResult(),\n () => observer.getCurrentResult()\n );\n const mutate = React.useCallback(\n (variables, mutateOptions) => {\n observer.mutate(variables, mutateOptions).catch(noop);\n },\n [observer]\n );\n if (result.error && shouldThrowError(observer.options.throwOnError, [result.error])) {\n throw result.error;\n }\n return { ...result, mutate, mutateAsync: result.mutate };\n}\nexport {\n useMutation\n};\n//# sourceMappingURL=useMutation.js.map"],"names":["QueryClientContext","React.createContext","useQueryClient","queryClient","client","React.useContext","QueryClientProvider","children","React.useEffect","jsx","IsRestoringContext","useIsRestoring","createValue","isReset","QueryErrorResetBoundaryContext","useQueryErrorResetBoundary","shouldThrowError","throwError","params","noop","ensurePreventErrorBoundaryRetry","options","errorResetBoundary","useClearResetErrorBoundary","getHasError","result","throwOnError","query","ensureSuspenseTimers","defaultedOptions","willFetch","isRestoring","shouldSuspend","fetchOptimistic","observer","useBaseQuery","Observer","_b","_a","isNewCacheEntry","React.useState","React.useSyncExternalStore","React.useCallback","onStoreChange","unsubscribe","notifyManager","_d","_c","isServer","promise","_e","useQuery","QueryObserver","useMutation","MutationObserver","mutate","variables","mutateOptions"],"mappings":"0HAKA,IAAIA,EAAqBC,EAAmB,cAC1C,MACF,EACIC,EAAkBC,GAAgB,CACpC,MAAMC,EAASC,EAAgB,WAACL,CAAkB,EAIlD,GAAI,CAACI,EACH,MAAM,IAAI,MAAM,wDAAwD,EAE1E,OAAOA,CACT,EACIE,EAAsB,CAAC,CACzB,OAAAF,EACA,SAAAG,CACF,KACEC,EAAAA,UAAgB,KACdJ,EAAO,MAAO,EACP,IAAM,CACXA,EAAO,QAAS,CACjB,GACA,CAACA,CAAM,CAAC,EACYK,EAAAA,IAAIT,EAAmB,SAAU,CAAE,MAAOI,EAAQ,SAAAG,EAAU,GCxBjFG,EAAqBT,EAAmB,cAAC,EAAK,EAC9CU,EAAiB,IAAMN,EAAgB,WAACK,CAAkB,EACpCA,EAAmB,SCD7C,SAASE,GAAc,CACrB,IAAIC,EAAU,GACd,MAAO,CACL,WAAY,IAAM,CAChBA,EAAU,EACX,EACD,MAAO,IAAM,CACXA,EAAU,EACX,EACD,QAAS,IACAA,CAEV,CACH,CACA,IAAIC,EAAiCb,EAAAA,cAAoBW,GAAa,EAClEG,EAA6B,IAAMV,EAAgB,WAACS,CAA8B,ECnBtF,SAASE,EAAiBC,EAAYC,EAAQ,CAC5C,OAAI,OAAOD,GAAe,WACjBA,EAAW,GAAGC,CAAM,EAEtB,CAAC,CAACD,CACX,CACA,SAASE,GAAO,CAChB,CCHA,IAAIC,EAAkC,CAACC,EAASC,IAAuB,EACjED,EAAQ,UAAYA,EAAQ,cAAgBA,EAAQ,iCACjDC,EAAmB,YACtBD,EAAQ,aAAe,IAG7B,EACIE,EAA8BD,GAAuB,CACvDd,EAAAA,UAAgB,IAAM,CACpBc,EAAmB,WAAY,CACnC,EAAK,CAACA,CAAkB,CAAC,CACzB,EACIE,EAAc,CAAC,CACjB,OAAAC,EACA,mBAAAH,EACA,aA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