{"version":3,"file":"static/chunks/459-db41c680ddd7ecb7.js","mappings":"wOICA,WAAkB,OAAS,8DAAkE,+DCqC7F,cACA,kJClCA,gBAA+B,GAAY,CAC3C,gBAAyB,EACzB,QACA,cACA,eACA,CACA,GACA,aACA,iBACA,eAA2C,QAAqB,MAChE,cAYA,OAXA,IACA,MAAkB,GAAK,EACvB,WACA,WACA,YACA,iCACA,QACA,oCACA,CAAO,EACP,aAEA,CACA,CACA,OACA,2BACA,2BACA,aACA,aACA,OACA,CAAO,EAEP,CACA,UACA,+BACA,IACA,YACA,OACA,4BAEA,aAAoB,uBAAwB,EAE5C,CACA,QACI,GAAa,YACjB,0BACA,cACA,CAAO,CACP,CAAK,CACL,CACA,OACA,qBACA,CACA,SACA,4BAEA,QACA,OAA+B,eAC/B,0BACA,GAAiB,QAAU,MAE3B,CACA,YAAsB,EACtB,oBACA,2CAAuE,QAAU,QACjF,CACA,UACI,GAAa,YACjB,2BACA,IACA,CAAO,CACP,CAAK,CACL,CACA,UACI,GAAa,YACjB,0BACA,WACA,CAAO,CACP,CAAK,CACL,CACA,WACI,GAAa,YACjB,0BACA,YACA,CAAO,CACP,CAAK,CACL,CACA,YCvFA,gBAAkC,GAAY,CAC9C,gBAAyB,EACzB,QACA,cACA,gBACA,kBACA,CACA,IACA,EACA,aACA,UAAyB,GAAQ,EACjC,mBACA,qBACA,oCACA,OACA,CAAK,EAEL,OADA,YACA,CACA,CACA,OACA,WACA,qBACA,UACA,iBACA,aAAkB,wBAAyB,CAC3C,CACA,UACA,WACA,mBACA,uCACA,IACA,aACA,kBAEA,iBAGA,CACA,aAAkB,0BAA2B,CAC7C,CACA,UACA,6DACA,eACA,CACA,WACA,0DACA,uCACA,CACA,QACI,GAAa,YACjB,0BACA,cACA,CAAO,CACP,CAAK,CACL,CACA,SACA,kCACA,CACA,QACA,OAA+B,eAC/B,0BACA,GAAoB,QAAa,MAEjC,CACA,YAAsB,EACtB,+BAA8C,QAAa,MAC3D,CACA,UACI,GAAa,YACjB,2BACA,IACA,CAAO,CACP,CAAK,CACL,CACA,wBACA,gDACA,OAAW,GAAa,OACxB,gBACA,4BAAoE,IAAI,IAGxE,CACA,EACA,cACA,gDACA,2BCxFA,cACA,OACA,gBACA,gBACA,6CACA,0BACA,+BACA,GAAqB,wBACrB,IACA,YACA,SACA,MACA,kCACA,cACA,SACA,iBACA,KAEA,uCACA,IACA,CAAiB,EAEjB,SAEA,CAAW,CACX,EACA,EAAwB,QAAa,2BACrC,iBACA,KACA,wBAEA,2BACA,0BAEA,OACA,oBACA,YACA,iCACA,qBAEA,KACA,cACA,GAEA,UAAkB,GAAW,UAC7B,IAAmC,IAAU,CAAG,IAAQ,CACxD,OACA,qBACA,8BACA,CACA,EACA,gBACA,qBAEA,GACA,QACA,YACA,EACA,GALA,EA+CA,YAAyC,qBAAmB,EAC5D,gEACA,EAjDA,GAKA,KACA,gBACA,EAAU,IACV,kBACA,GACA,4CACA,gBACA,MAEA,eACA,GACA,EAAY,UAEZ,QACA,CACA,qBACA,cACA,sBACA,EACA,CACA,oBACA,oBACA,gBACa,CACb,GAIA,WAEA,CACA,CACA,CACA,oBAAqC,eAAmB,EACxD,iBACA,qCACA,KACA,EACA,KACA,GACA,MACA,CCrFA,YACA,IACA,GACA,GACA,GACA,GACA,GACA,GACA,cACA,IAAyB,EACzB,0BAAgD,EAChD,6BAAsD,EACtD,WADmE,aACnE,KACA,gBACA,gBACA,SACA,CACA,QACA,UACA,cAEA,QAA6B,GAAY,qBACzC,IACA,mCACA,kBAEA,CAAK,EACL,QAA8B,GAAa,qBAC3C,IACA,mCACA,mBAEA,CAAK,EACL,CACA,UACA,UACA,cAEA,YACA,eACA,YACA,eACA,CACA,cACA,wBAAsC,4BAAqC,SAE3E,cACA,wBAAyC,sBAA+B,SAExE,gBACA,gCAA+C,WAAU,EACzD,2CACA,CACA,mBACA,oCACA,cACA,yBACA,EACA,kCACA,wBAIA,OAHA,qCAA2D,QAAgB,kBAC3E,sBAEA,kBACA,CACA,CACA,kBACA,yCAAoD,UAAiB,GAErE,GADA,OACA,CAEA,CACA,oBACA,yCAAwD,EAAU,EAClE,cACA,aAEA,gBACA,EAAiB,QAAgB,MACjC,cAGA,wCAA0E,eAA0B,CACpG,CACA,sBACA,OAAW,GAAa,OACxB,6BAAqD,WAAU,IAC/D,EACA,yBACA,EAEA,CACA,iBACA,yCAA+C,EAAU,EACzD,sCACA,CACA,iBACA,cACI,GAAa,YACjB,yBACA,WACA,CAAO,CACP,CAAK,CACL,CACA,kBACA,cACA,GACA,cACA,MAEA,OAAW,GAAa,YACxB,yBACA,SACA,CAAO,EACP,0BAEA,CACA,kBAA4B,KAAoB,EAChD,OAAqC,gBAIrC,mBAHqB,GAAa,OAClC,6CAEA,KAAsC,IAAI,QAAQ,IAAI,CACtD,CACA,sBAAgC,KAAc,EAC9C,OAAW,GAAa,YAIxB,GAHA,+BACA,cACA,CAAO,EACP,uBACA,yBAEA,OACA,KACA,oCACA,EACA,+BACA,CAAK,CACL,CACA,mBAA6B,IAC7B,OACA,KACA,kCACA,EAUA,mBATqB,GAAa,OAClC,0DACA,wBAIA,OAHA,gBACA,WAAkC,KAAI,EAEtC,kDACA,CAAO,IAEP,KAAsC,IAAI,CAC1C,CACA,cACA,iCACA,mBACA,aAEA,4BACA,uBACM,QAAgB,iBACtB,wCACA,CACA,iBACA,+BAAyC,IAAI,QAAQ,IAAI,CACzD,CACA,sBAEA,OADA,WAAuB,EAAqB,SAC5C,UAD4C,KAC5C,GACA,CACA,yBACA,uCAAiD,IAAI,QAAQ,IAAI,CACjE,CACA,2BAEA,OADA,WAAuB,EAAqB,SAC5C,UAD4C,UAC5C,GACA,CACA,+BACA,EAAQ,CAAa,YACrB,gCAEA,iBACA,CACA,gBACA,eAEA,mBACA,eAEA,oBACA,eAEA,qBACA,SACA,CACA,sBACA,YAA4B,QAAO,KACnC,WACA,gBACA,CAAK,CACL,CACA,oBACA,4BACA,KAMA,OALA,cACU,QAAe,gBACzB,IAAmB,0BAEnB,CAAK,EACL,CACA,CACA,yBACA,YAA+B,QAAO,KACtC,cACA,gBACA,CAAK,CACL,CACA,uBACA,4BACA,KAMA,OALA,cACU,QAAe,mBACzB,IAAmB,0BAEnB,CAAK,EACL,CACA,CACA,uBACA,gBACA,SAEA,OACA,mBACA,qCACA,KACA,aACA,EAmBA,OAlBA,aACA,aAAmC,QAAqB,CACxD,WACA,EACA,EAEA,+BACA,gDAEA,yBACA,8BAEA,6BACA,+BAEA,4BAA0E,IAAS,EACnF,eAEA,CACA,CACA,iCACA,cACA,EAEA,CACA,qBACA,2DACA,KACA,aACA,CACA,CACA,QACA,gBACA,eACA,CACA","sources":["webpack://_N_E/./node_modules/next/dist/api/navigation.js","webpack://_N_E/./node_modules/aos/dist/aos.css","webpack://_N_E/./node_modules/swiper/swiper.css","webpack://_N_E/./node_modules/yet-another-react-lightbox/dist/styles.css","webpack://_N_E/./node_modules/next/font/google/target.css","webpack://_N_E/./node_modules/@tanstack/query-core/build/modern/hydration.js","webpack://_N_E/./node_modules/@tanstack/query-core/build/modern/queryCache.js","webpack://_N_E/./node_modules/@tanstack/query-core/build/modern/mutationCache.js","webpack://_N_E/./node_modules/@tanstack/query-core/build/modern/infiniteQueryBehavior.js","webpack://_N_E/./node_modules/@tanstack/query-core/build/modern/queryClient.js"],"sourcesContent":["export * from '../client/components/navigation';\n\n//# sourceMappingURL=navigation.js.map","// extracted by mini-css-extract-plugin","// extracted by mini-css-extract-plugin","// extracted by mini-css-extract-plugin","// extracted by mini-css-extract-plugin\nmodule.exports = {\"style\":{\"fontFamily\":\"'Poppins', 'Poppins Fallback'\",\"fontStyle\":\"normal\"},\"className\":\"__className_9e6e11\"};","// src/hydration.ts\nfunction defaultTransformerFn(data) {\n return data;\n}\nfunction dehydrateMutation(mutation) {\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}\nfunction dehydrateQuery(query, serializeData) {\n return {\n state: {\n ...query.state,\n ...query.state.data !== void 0 && {\n data: serializeData(query.state.data)\n }\n },\n queryKey: query.queryKey,\n queryHash: query.queryHash,\n ...query.state.status === \"pending\" && {\n promise: query.promise?.then(serializeData).catch((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 ...query.meta && { meta: query.meta }\n };\n}\nfunction defaultShouldDehydrateMutation(mutation) {\n return mutation.state.isPaused;\n}\nfunction defaultShouldDehydrateQuery(query) {\n return query.state.status === \"success\";\n}\nfunction dehydrate(client, options = {}) {\n const filterMutation = options.shouldDehydrateMutation ?? client.getDefaultOptions().dehydrate?.shouldDehydrateMutation ?? defaultShouldDehydrateMutation;\n const mutations = client.getMutationCache().getAll().flatMap(\n (mutation) => filterMutation(mutation) ? [dehydrateMutation(mutation)] : []\n );\n const filterQuery = options.shouldDehydrateQuery ?? client.getDefaultOptions().dehydrate?.shouldDehydrateQuery ?? defaultShouldDehydrateQuery;\n const serializeData = options.serializeData ?? client.getDefaultOptions().dehydrate?.serializeData ?? defaultTransformerFn;\n const queries = client.getQueryCache().getAll().flatMap(\n (query) => filterQuery(query) ? [dehydrateQuery(query, serializeData)] : []\n );\n return { mutations, queries };\n}\nfunction hydrate(client, dehydratedState, options) {\n if (typeof dehydratedState !== \"object\" || dehydratedState === null) {\n return;\n }\n const mutationCache = client.getMutationCache();\n const queryCache = client.getQueryCache();\n const deserializeData = options?.defaultOptions?.deserializeData ?? client.getDefaultOptions().hydrate?.deserializeData ?? defaultTransformerFn;\n const mutations = dehydratedState.mutations || [];\n const queries = dehydratedState.queries || [];\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 queries.forEach(({ queryKey, state, queryHash, meta, promise }) => {\n let query = queryCache.get(queryHash);\n const data = state.data === void 0 ? state.data : deserializeData(state.data);\n if (query) {\n if (query.state.dataUpdatedAt < state.dataUpdatedAt) {\n const { fetchStatus: _ignored, ...serializedState } = state;\n query.setState({\n ...serializedState,\n data\n });\n }\n } else {\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 }\n );\n }\n if (promise) {\n const initialPromise = Promise.resolve(promise).then(deserializeData);\n void query.fetch(void 0, { initialPromise });\n }\n });\n}\nexport {\n defaultShouldDehydrateMutation,\n defaultShouldDehydrateQuery,\n dehydrate,\n hydrate\n};\n//# sourceMappingURL=hydration.js.map","// src/queryCache.ts\nimport { hashQueryKeyByOptions, matchQuery } from \"./utils.js\";\nimport { Query } from \"./query.js\";\nimport { notifyManager } from \"./notifyManager.js\";\nimport { Subscribable } from \"./subscribable.js\";\nvar QueryCache = class extends Subscribable {\n constructor(config = {}) {\n super();\n this.config = config;\n this.#queries = /* @__PURE__ */ new Map();\n }\n #queries;\n build(client, options, state) {\n const queryKey = options.queryKey;\n const queryHash = options.queryHash ?? hashQueryKeyByOptions(queryKey, options);\n let query = this.get(queryHash);\n if (!query) {\n query = new Query({\n cache: this,\n queryKey,\n queryHash,\n options: client.defaultQueryOptions(options),\n state,\n defaultOptions: client.getQueryDefaults(queryKey)\n });\n this.add(query);\n }\n return query;\n }\n add(query) {\n if (!this.#queries.has(query.queryHash)) {\n this.#queries.set(query.queryHash, query);\n this.notify({\n type: \"added\",\n query\n });\n }\n }\n remove(query) {\n const queryInMap = this.#queries.get(query.queryHash);\n if (queryInMap) {\n query.destroy();\n if (queryInMap === query) {\n this.#queries.delete(query.queryHash);\n }\n this.notify({ type: \"removed\", query });\n }\n }\n clear() {\n notifyManager.batch(() => {\n this.getAll().forEach((query) => {\n this.remove(query);\n });\n });\n }\n get(queryHash) {\n return this.#queries.get(queryHash);\n }\n getAll() {\n return [...this.#queries.values()];\n }\n find(filters) {\n const defaultedFilters = { exact: true, ...filters };\n return this.getAll().find(\n (query) => matchQuery(defaultedFilters, query)\n );\n }\n findAll(filters = {}) {\n const queries = this.getAll();\n return Object.keys(filters).length > 0 ? queries.filter((query) => matchQuery(filters, query)) : queries;\n }\n notify(event) {\n notifyManager.batch(() => {\n this.listeners.forEach((listener) => {\n listener(event);\n });\n });\n }\n onFocus() {\n notifyManager.batch(() => {\n this.getAll().forEach((query) => {\n query.onFocus();\n });\n });\n }\n onOnline() {\n notifyManager.batch(() => {\n this.getAll().forEach((query) => {\n query.onOnline();\n });\n });\n }\n};\nexport {\n QueryCache\n};\n//# sourceMappingURL=queryCache.js.map","// src/mutationCache.ts\nimport { notifyManager } from \"./notifyManager.js\";\nimport { Mutation } from \"./mutation.js\";\nimport { matchMutation, noop } from \"./utils.js\";\nimport { Subscribable } from \"./subscribable.js\";\nvar MutationCache = class extends Subscribable {\n constructor(config = {}) {\n super();\n this.config = config;\n this.#mutations = /* @__PURE__ */ new Map();\n this.#mutationId = Date.now();\n }\n #mutations;\n #mutationId;\n build(client, options, state) {\n const mutation = new Mutation({\n mutationCache: this,\n mutationId: ++this.#mutationId,\n options: client.defaultMutationOptions(options),\n state\n });\n this.add(mutation);\n return mutation;\n }\n add(mutation) {\n const scope = scopeFor(mutation);\n const mutations = this.#mutations.get(scope) ?? [];\n mutations.push(mutation);\n this.#mutations.set(scope, mutations);\n this.notify({ type: \"added\", mutation });\n }\n remove(mutation) {\n const scope = scopeFor(mutation);\n if (this.#mutations.has(scope)) {\n const mutations = this.#mutations.get(scope)?.filter((x) => x !== mutation);\n if (mutations) {\n if (mutations.length === 0) {\n this.#mutations.delete(scope);\n } else {\n this.#mutations.set(scope, mutations);\n }\n }\n }\n this.notify({ type: \"removed\", mutation });\n }\n canRun(mutation) {\n const firstPendingMutation = this.#mutations.get(scopeFor(mutation))?.find((m) => m.state.status === \"pending\");\n return !firstPendingMutation || firstPendingMutation === mutation;\n }\n runNext(mutation) {\n const foundMutation = this.#mutations.get(scopeFor(mutation))?.find((m) => m !== mutation && m.state.isPaused);\n return foundMutation?.continue() ?? Promise.resolve();\n }\n clear() {\n notifyManager.batch(() => {\n this.getAll().forEach((mutation) => {\n this.remove(mutation);\n });\n });\n }\n getAll() {\n return [...this.#mutations.values()].flat();\n }\n find(filters) {\n const defaultedFilters = { exact: true, ...filters };\n return this.getAll().find(\n (mutation) => matchMutation(defaultedFilters, mutation)\n );\n }\n findAll(filters = {}) {\n return this.getAll().filter((mutation) => matchMutation(filters, mutation));\n }\n notify(event) {\n notifyManager.batch(() => {\n this.listeners.forEach((listener) => {\n listener(event);\n });\n });\n }\n resumePausedMutations() {\n const pausedMutations = this.getAll().filter((x) => x.state.isPaused);\n return notifyManager.batch(\n () => Promise.all(\n pausedMutations.map((mutation) => mutation.continue().catch(noop))\n )\n );\n }\n};\nfunction scopeFor(mutation) {\n return mutation.options.scope?.id ?? String(mutation.mutationId);\n}\nexport {\n MutationCache\n};\n//# sourceMappingURL=mutationCache.js.map","// src/infiniteQueryBehavior.ts\nimport { addToEnd, addToStart, ensureQueryFn } from \"./utils.js\";\nfunction infiniteQueryBehavior(pages) {\n return {\n onFetch: (context, query) => {\n const options = context.options;\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 = { pages: [], pageParams: [] };\n let currentPage = 0;\n const fetchFn = async () => {\n let cancelled = false;\n const addSignalProperty = (object) => {\n Object.defineProperty(object, \"signal\", {\n enumerable: true,\n get: () => {\n if (context.signal.aborted) {\n cancelled = true;\n } else {\n context.signal.addEventListener(\"abort\", () => {\n cancelled = true;\n });\n }\n return context.signal;\n }\n });\n };\n const queryFn = ensureQueryFn(context.options, context.fetchOptions);\n const fetchPage = async (data, param, previous) => {\n if (cancelled) {\n return Promise.reject();\n }\n if (param == null && data.pages.length) {\n return Promise.resolve(data);\n }\n const queryFnContext = {\n queryKey: context.queryKey,\n pageParam: param,\n direction: previous ? \"backward\" : \"forward\",\n meta: context.options.meta\n };\n addSignalProperty(queryFnContext);\n const page = await queryFn(\n queryFnContext\n );\n const { maxPages } = context.options;\n const addTo = previous ? addToStart : addToEnd;\n return {\n pages: addTo(data.pages, page, maxPages),\n pageParams: addTo(data.pageParams, param, maxPages)\n };\n };\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 result = await fetchPage(oldData, param, previous);\n } else {\n const remainingPages = pages ?? oldPages.length;\n do {\n const param = currentPage === 0 ? oldPageParams[0] ?? options.initialPageParam : 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 return result;\n };\n if (context.options.persister) {\n context.fetchFn = () => {\n return context.options.persister?.(\n fetchFn,\n {\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}\nfunction getNextPageParam(options, { pages, pageParams }) {\n const lastIndex = pages.length - 1;\n return pages.length > 0 ? options.getNextPageParam(\n pages[lastIndex],\n pages,\n pageParams[lastIndex],\n pageParams\n ) : void 0;\n}\nfunction getPreviousPageParam(options, { pages, pageParams }) {\n return pages.length > 0 ? options.getPreviousPageParam?.(pages[0], pages, pageParams[0], pageParams) : void 0;\n}\nfunction hasNextPage(options, data) {\n if (!data)\n return false;\n return getNextPageParam(options, data) != null;\n}\nfunction hasPreviousPage(options, data) {\n if (!data || !options.getPreviousPageParam)\n return false;\n return getPreviousPageParam(options, data) != null;\n}\nexport {\n hasNextPage,\n hasPreviousPage,\n infiniteQueryBehavior\n};\n//# sourceMappingURL=infiniteQueryBehavior.js.map","// src/queryClient.ts\nimport {\n functionalUpdate,\n hashKey,\n hashQueryKeyByOptions,\n noop,\n partialMatchKey,\n resolveStaleTime,\n skipToken\n} from \"./utils.js\";\nimport { QueryCache } from \"./queryCache.js\";\nimport { MutationCache } from \"./mutationCache.js\";\nimport { focusManager } from \"./focusManager.js\";\nimport { onlineManager } from \"./onlineManager.js\";\nimport { notifyManager } from \"./notifyManager.js\";\nimport { infiniteQueryBehavior } from \"./infiniteQueryBehavior.js\";\nvar QueryClient = class {\n #queryCache;\n #mutationCache;\n #defaultOptions;\n #queryDefaults;\n #mutationDefaults;\n #mountCount;\n #unsubscribeFocus;\n #unsubscribeOnline;\n constructor(config = {}) {\n this.#queryCache = config.queryCache || new QueryCache();\n this.#mutationCache = config.mutationCache || new MutationCache();\n this.#defaultOptions = config.defaultOptions || {};\n this.#queryDefaults = /* @__PURE__ */ new Map();\n this.#mutationDefaults = /* @__PURE__ */ new Map();\n this.#mountCount = 0;\n }\n mount() {\n this.#mountCount++;\n if (this.#mountCount !== 1)\n return;\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 unmount() {\n this.#mountCount--;\n if (this.#mountCount !== 0)\n return;\n this.#unsubscribeFocus?.();\n this.#unsubscribeFocus = void 0;\n this.#unsubscribeOnline?.();\n this.#unsubscribeOnline = void 0;\n }\n isFetching(filters) {\n return this.#queryCache.findAll({ ...filters, fetchStatus: \"fetching\" }).length;\n }\n isMutating(filters) {\n return this.#mutationCache.findAll({ ...filters, status: \"pending\" }).length;\n }\n getQueryData(queryKey) {\n const options = this.defaultQueryOptions({ queryKey });\n return this.#queryCache.get(options.queryHash)?.state.data;\n }\n ensureQueryData(options) {\n const cachedData = this.getQueryData(options.queryKey);\n if (cachedData === void 0)\n return this.fetchQuery(options);\n else {\n const defaultedOptions = this.defaultQueryOptions(options);\n const query = this.#queryCache.build(this, defaultedOptions);\n if (options.revalidateIfStale && query.isStaleByTime(resolveStaleTime(defaultedOptions.staleTime, query))) {\n void this.prefetchQuery(defaultedOptions);\n }\n return Promise.resolve(cachedData);\n }\n }\n getQueriesData(filters) {\n return this.#queryCache.findAll(filters).map(({ queryKey, state }) => {\n const data = state.data;\n return [queryKey, data];\n });\n }\n setQueryData(queryKey, updater, options) {\n const defaultedOptions = this.defaultQueryOptions({ queryKey });\n const query = this.#queryCache.get(\n defaultedOptions.queryHash\n );\n const prevData = query?.state.data;\n const data = functionalUpdate(updater, prevData);\n if (data === void 0) {\n return void 0;\n }\n return this.#queryCache.build(this, defaultedOptions).setData(data, { ...options, manual: true });\n }\n setQueriesData(filters, updater, options) {\n return notifyManager.batch(\n () => this.#queryCache.findAll(filters).map(({ queryKey }) => [\n queryKey,\n this.setQueryData(queryKey, updater, options)\n ])\n );\n }\n getQueryState(queryKey) {\n const options = this.defaultQueryOptions({ queryKey });\n return this.#queryCache.get(options.queryHash)?.state;\n }\n removeQueries(filters) {\n const queryCache = this.#queryCache;\n notifyManager.batch(() => {\n queryCache.findAll(filters).forEach((query) => {\n queryCache.remove(query);\n });\n });\n }\n resetQueries(filters, options) {\n const queryCache = this.#queryCache;\n const refetchFilters = {\n type: \"active\",\n ...filters\n };\n return notifyManager.batch(() => {\n queryCache.findAll(filters).forEach((query) => {\n query.reset();\n });\n return this.refetchQueries(refetchFilters, options);\n });\n }\n cancelQueries(filters = {}, cancelOptions = {}) {\n const defaultedCancelOptions = { revert: true, ...cancelOptions };\n const promises = notifyManager.batch(\n () => this.#queryCache.findAll(filters).map((query) => query.cancel(defaultedCancelOptions))\n );\n return Promise.all(promises).then(noop).catch(noop);\n }\n invalidateQueries(filters = {}, options = {}) {\n return notifyManager.batch(() => {\n this.#queryCache.findAll(filters).forEach((query) => {\n query.invalidate();\n });\n if (filters.refetchType === \"none\") {\n return Promise.resolve();\n }\n const refetchFilters = {\n ...filters,\n type: filters.refetchType ?? filters.type ?? \"active\"\n };\n return this.refetchQueries(refetchFilters, options);\n });\n }\n refetchQueries(filters = {}, options) {\n const fetchOptions = {\n ...options,\n cancelRefetch: options?.cancelRefetch ?? true\n };\n const promises = notifyManager.batch(\n () => this.#queryCache.findAll(filters).filter((query) => !query.isDisabled()).map((query) => {\n let promise = query.fetch(void 0, fetchOptions);\n if (!fetchOptions.throwOnError) {\n promise = promise.catch(noop);\n }\n return query.state.fetchStatus === \"paused\" ? Promise.resolve() : promise;\n })\n );\n return Promise.all(promises).then(noop);\n }\n fetchQuery(options) {\n const defaultedOptions = this.defaultQueryOptions(options);\n if (defaultedOptions.retry === void 0) {\n defaultedOptions.retry = false;\n }\n const query = this.#queryCache.build(this, defaultedOptions);\n return query.isStaleByTime(\n resolveStaleTime(defaultedOptions.staleTime, query)\n ) ? query.fetch(defaultedOptions) : Promise.resolve(query.state.data);\n }\n prefetchQuery(options) {\n return this.fetchQuery(options).then(noop).catch(noop);\n }\n fetchInfiniteQuery(options) {\n options.behavior = infiniteQueryBehavior(options.pages);\n return this.fetchQuery(options);\n }\n prefetchInfiniteQuery(options) {\n return this.fetchInfiniteQuery(options).then(noop).catch(noop);\n }\n ensureInfiniteQueryData(options) {\n options.behavior = infiniteQueryBehavior(options.pages);\n return this.ensureQueryData(options);\n }\n resumePausedMutations() {\n if (onlineManager.isOnline()) {\n return this.#mutationCache.resumePausedMutations();\n }\n return Promise.resolve();\n }\n getQueryCache() {\n return this.#queryCache;\n }\n getMutationCache() {\n return this.#mutationCache;\n }\n getDefaultOptions() {\n return this.#defaultOptions;\n }\n setDefaultOptions(options) {\n this.#defaultOptions = options;\n }\n setQueryDefaults(queryKey, options) {\n this.#queryDefaults.set(hashKey(queryKey), {\n queryKey,\n defaultOptions: options\n });\n }\n getQueryDefaults(queryKey) {\n const defaults = [...this.#queryDefaults.values()];\n let result = {};\n defaults.forEach((queryDefault) => {\n if (partialMatchKey(queryKey, queryDefault.queryKey)) {\n result = { ...result, ...queryDefault.defaultOptions };\n }\n });\n return result;\n }\n setMutationDefaults(mutationKey, options) {\n this.#mutationDefaults.set(hashKey(mutationKey), {\n mutationKey,\n defaultOptions: options\n });\n }\n getMutationDefaults(mutationKey) {\n const defaults = [...this.#mutationDefaults.values()];\n let result = {};\n defaults.forEach((queryDefault) => {\n if (partialMatchKey(mutationKey, queryDefault.mutationKey)) {\n result = { ...result, ...queryDefault.defaultOptions };\n }\n });\n return result;\n }\n defaultQueryOptions(options) {\n if (options._defaulted) {\n return options;\n }\n const defaultedOptions = {\n ...this.#defaultOptions.queries,\n ...this.getQueryDefaults(options.queryKey),\n ...options,\n _defaulted: true\n };\n if (!defaultedOptions.queryHash) {\n defaultedOptions.queryHash = hashQueryKeyByOptions(\n defaultedOptions.queryKey,\n defaultedOptions\n );\n }\n if (defaultedOptions.refetchOnReconnect === void 0) {\n defaultedOptions.refetchOnReconnect = defaultedOptions.networkMode !== \"always\";\n }\n if (defaultedOptions.throwOnError === void 0) {\n defaultedOptions.throwOnError = !!defaultedOptions.suspense;\n }\n if (!defaultedOptions.networkMode && defaultedOptions.persister) {\n defaultedOptions.networkMode = \"offlineFirst\";\n }\n if (defaultedOptions.enabled !== true && defaultedOptions.queryFn === skipToken) {\n defaultedOptions.enabled = false;\n }\n return defaultedOptions;\n }\n defaultMutationOptions(options) {\n if (options?._defaulted) {\n return options;\n }\n return {\n ...this.#defaultOptions.mutations,\n ...options?.mutationKey && this.getMutationDefaults(options.mutationKey),\n ...options,\n _defaulted: true\n };\n }\n clear() {\n this.#queryCache.clear();\n this.#mutationCache.clear();\n }\n};\nexport {\n QueryClient\n};\n//# sourceMappingURL=queryClient.js.map"],"names":[],"sourceRoot":"","ignoreList":[0,1,2,3,4,5,6,7,8,9]}