{"version":3,"file":"useInfiniteQuery-CqsPem3O.js","sources":["../../../node_modules/.pnpm/@tanstack+query-core@5.66.0/node_modules/@tanstack/query-core/build/modern/infiniteQueryObserver.js","../../../node_modules/.pnpm/@tanstack+vue-query@5.66.0_vue@3.5.13_typescript@5.7.3_/node_modules/@tanstack/vue-query/build/modern/useInfiniteQuery.js"],"sourcesContent":["// src/infiniteQueryObserver.ts\nimport { QueryObserver } from \"./queryObserver.js\";\nimport {\n hasNextPage,\n hasPreviousPage,\n infiniteQueryBehavior\n} from \"./infiniteQueryBehavior.js\";\nvar InfiniteQueryObserver = class extends QueryObserver {\n constructor(client, options) {\n super(client, options);\n }\n bindMethods() {\n super.bindMethods();\n this.fetchNextPage = this.fetchNextPage.bind(this);\n this.fetchPreviousPage = this.fetchPreviousPage.bind(this);\n }\n setOptions(options, notifyOptions) {\n super.setOptions(\n {\n ...options,\n behavior: infiniteQueryBehavior()\n },\n notifyOptions\n );\n }\n getOptimisticResult(options) {\n options.behavior = infiniteQueryBehavior();\n return super.getOptimisticResult(options);\n }\n fetchNextPage(options) {\n return this.fetch({\n ...options,\n meta: {\n fetchMore: { direction: \"forward\" }\n }\n });\n }\n fetchPreviousPage(options) {\n return this.fetch({\n ...options,\n meta: {\n fetchMore: { direction: \"backward\" }\n }\n });\n }\n createResult(query, options) {\n const { state } = query;\n const parentResult = super.createResult(query, options);\n const { isFetching, isRefetching, isError, isRefetchError } = parentResult;\n const fetchDirection = state.fetchMeta?.fetchMore?.direction;\n const isFetchNextPageError = isError && fetchDirection === \"forward\";\n const isFetchingNextPage = isFetching && fetchDirection === \"forward\";\n const isFetchPreviousPageError = isError && fetchDirection === \"backward\";\n const isFetchingPreviousPage = isFetching && fetchDirection === \"backward\";\n const result = {\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: isRefetchError && !isFetchNextPageError && !isFetchPreviousPageError,\n isRefetching: isRefetching && !isFetchingNextPage && !isFetchingPreviousPage\n };\n return result;\n }\n};\nexport {\n InfiniteQueryObserver\n};\n//# sourceMappingURL=infiniteQueryObserver.js.map","// src/useInfiniteQuery.ts\nimport { InfiniteQueryObserver } from \"@tanstack/query-core\";\nimport { useBaseQuery } from \"./useBaseQuery.js\";\nfunction useInfiniteQuery(options, queryClient) {\n return useBaseQuery(\n InfiniteQueryObserver,\n options,\n queryClient\n );\n}\nexport {\n useInfiniteQuery\n};\n//# sourceMappingURL=useInfiniteQuery.js.map"],"names":["InfiniteQueryObserver","QueryObserver","client","options","notifyOptions","infiniteQueryBehavior","query","state","parentResult","isFetching","isRefetching","isError","isRefetchError","fetchDirection","isFetchNextPageError","isFetchingNextPage","isFetchPreviousPageError","isFetchingPreviousPage","hasNextPage","hasPreviousPage","useInfiniteQuery","queryClient","useBaseQuery"],"mappings":"sGAOA,IAAIA,EAAwB,cAAcC,CAAc,CACtD,YAAYC,EAAQC,EAAS,CAC3B,MAAMD,EAAQC,CAAO,CACzB,CACE,aAAc,CACZ,MAAM,YAAa,EACnB,KAAK,cAAgB,KAAK,cAAc,KAAK,IAAI,EACjD,KAAK,kBAAoB,KAAK,kBAAkB,KAAK,IAAI,CAC7D,CACE,WAAWA,EAASC,EAAe,CACjC,MAAM,WACJ,CACE,GAAGD,EACH,SAAUE,EAAqB,CAChC,EACDD,CACD,CACL,CACE,oBAAoBD,EAAS,CAC3B,OAAAA,EAAQ,SAAWE,EAAuB,EACnC,MAAM,oBAAoBF,CAAO,CAC5C,CACE,cAAcA,EAAS,CACrB,OAAO,KAAK,MAAM,CAChB,GAAGA,EACH,KAAM,CACJ,UAAW,CAAE,UAAW,SAAS,CACzC,CACA,CAAK,CACL,CACE,kBAAkBA,EAAS,CACzB,OAAO,KAAK,MAAM,CAChB,GAAGA,EACH,KAAM,CACJ,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