{"version":3,"file":"vue-query-C2sjm3l8.js","sources":["../../../node_modules/.pnpm/@tanstack+query-core@5.69.0/node_modules/@tanstack/query-core/build/modern/subscribable.js","../../../node_modules/.pnpm/@tanstack+query-core@5.69.0/node_modules/@tanstack/query-core/build/modern/utils.js","../../../node_modules/.pnpm/@tanstack+query-core@5.69.0/node_modules/@tanstack/query-core/build/modern/focusManager.js","../../../node_modules/.pnpm/@tanstack+query-core@5.69.0/node_modules/@tanstack/query-core/build/modern/onlineManager.js","../../../node_modules/.pnpm/@tanstack+query-core@5.69.0/node_modules/@tanstack/query-core/build/modern/thenable.js","../../../node_modules/.pnpm/@tanstack+query-core@5.69.0/node_modules/@tanstack/query-core/build/modern/retryer.js","../../../node_modules/.pnpm/@tanstack+query-core@5.69.0/node_modules/@tanstack/query-core/build/modern/notifyManager.js","../../../node_modules/.pnpm/@tanstack+query-core@5.69.0/node_modules/@tanstack/query-core/build/modern/removable.js","../../../node_modules/.pnpm/@tanstack+query-core@5.69.0/node_modules/@tanstack/query-core/build/modern/query.js","../../../node_modules/.pnpm/@tanstack+query-core@5.69.0/node_modules/@tanstack/query-core/build/modern/queryCache.js","../../../node_modules/.pnpm/@tanstack+query-core@5.69.0/node_modules/@tanstack/query-core/build/modern/mutation.js","../../../node_modules/.pnpm/@tanstack+query-core@5.69.0/node_modules/@tanstack/query-core/build/modern/mutationCache.js","../../../node_modules/.pnpm/@tanstack+query-core@5.69.0/node_modules/@tanstack/query-core/build/modern/infiniteQueryBehavior.js","../../../node_modules/.pnpm/@tanstack+query-core@5.69.0/node_modules/@tanstack/query-core/build/modern/queryClient.js","../../../node_modules/.pnpm/@tanstack+query-core@5.69.0/node_modules/@tanstack/query-core/build/modern/queryObserver.js","../../../node_modules/.pnpm/@tanstack+query-core@5.69.0/node_modules/@tanstack/query-core/build/modern/queriesObserver.js","../../../node_modules/.pnpm/@tanstack+query-core@5.69.0/node_modules/@tanstack/query-core/build/modern/infiniteQueryObserver.js","../../../node_modules/.pnpm/@tanstack+query-core@5.69.0/node_modules/@tanstack/query-core/build/modern/mutationObserver.js","../../../node_modules/.pnpm/@tanstack+query-core@5.69.0/node_modules/@tanstack/query-core/build/modern/hydration.js","../../../node_modules/.pnpm/@tanstack+query-core@5.69.0/node_modules/@tanstack/query-core/build/modern/streamedQuery.js","../../../node_modules/.pnpm/@tanstack+query-core@5.69.0/node_modules/@tanstack/query-core/build/modern/types.js","../../../node_modules/.pnpm/@tanstack+vue-query@5.69.0_vue@3.5.13/node_modules/@tanstack/vue-query/build/modern/utils.js","../../../node_modules/.pnpm/@tanstack+vue-query@5.69.0_vue@3.5.13/node_modules/@tanstack/vue-query/build/modern/useQueryClient.js","../../../node_modules/.pnpm/@tanstack+vue-query@5.69.0_vue@3.5.13/node_modules/@tanstack/vue-query/build/modern/queryCache.js","../../../node_modules/.pnpm/@tanstack+vue-query@5.69.0_vue@3.5.13/node_modules/@tanstack/vue-query/build/modern/mutationCache.js","../../../node_modules/.pnpm/@tanstack+vue-query@5.69.0_vue@3.5.13/node_modules/@tanstack/vue-query/build/modern/queryClient.js","../../../node_modules/.pnpm/@tanstack+vue-query@5.69.0_vue@3.5.13/node_modules/@tanstack/vue-query/build/modern/vueQueryPlugin.js","../../../node_modules/.pnpm/@tanstack+vue-query@5.69.0_vue@3.5.13/node_modules/@tanstack/vue-query/build/modern/queryOptions.js","../../../node_modules/.pnpm/@tanstack+vue-query@5.69.0_vue@3.5.13/node_modules/@tanstack/vue-query/build/modern/infiniteQueryOptions.js","../../../node_modules/.pnpm/@tanstack+vue-query@5.69.0_vue@3.5.13/node_modules/@tanstack/vue-query/build/modern/useBaseQuery.js","../../../node_modules/.pnpm/@tanstack+vue-query@5.69.0_vue@3.5.13/node_modules/@tanstack/vue-query/build/modern/useQuery.js","../../../node_modules/.pnpm/@tanstack+vue-query@5.69.0_vue@3.5.13/node_modules/@tanstack/vue-query/build/modern/useQueries.js","../../../node_modules/.pnpm/@tanstack+vue-query@5.69.0_vue@3.5.13/node_modules/@tanstack/vue-query/build/modern/useInfiniteQuery.js","../../../node_modules/.pnpm/@tanstack+vue-query@5.69.0_vue@3.5.13/node_modules/@tanstack/vue-query/build/modern/useMutation.js","../../../node_modules/.pnpm/@tanstack+vue-query@5.69.0_vue@3.5.13/node_modules/@tanstack/vue-query/build/modern/useIsFetching.js","../../../node_modules/.pnpm/@tanstack+vue-query@5.69.0_vue@3.5.13/node_modules/@tanstack/vue-query/build/modern/useMutationState.js"],"sourcesContent":["// src/subscribable.ts\nvar Subscribable = class {\n constructor() {\n this.listeners = /* @__PURE__ */ new Set();\n this.subscribe = this.subscribe.bind(this);\n }\n subscribe(listener) {\n this.listeners.add(listener);\n this.onSubscribe();\n return () => {\n this.listeners.delete(listener);\n this.onUnsubscribe();\n };\n }\n hasListeners() {\n return this.listeners.size > 0;\n }\n onSubscribe() {\n }\n onUnsubscribe() {\n }\n};\nexport {\n Subscribable\n};\n//# sourceMappingURL=subscribable.js.map","// src/utils.ts\nvar isServer = typeof window === \"undefined\" || \"Deno\" in globalThis;\nfunction noop() {\n}\nfunction functionalUpdate(updater, input) {\n return typeof updater === \"function\" ? updater(input) : updater;\n}\nfunction isValidTimeout(value) {\n return typeof value === \"number\" && value >= 0 && value !== Infinity;\n}\nfunction timeUntilStale(updatedAt, staleTime) {\n return Math.max(updatedAt + (staleTime || 0) - Date.now(), 0);\n}\nfunction resolveStaleTime(staleTime, query) {\n return typeof staleTime === \"function\" ? staleTime(query) : staleTime;\n}\nfunction resolveEnabled(enabled, query) {\n return typeof enabled === \"function\" ? enabled(query) : enabled;\n}\nfunction matchQuery(filters, query) {\n const {\n type = \"all\",\n exact,\n fetchStatus,\n predicate,\n queryKey,\n stale\n } = filters;\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 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 if (typeof stale === \"boolean\" && query.isStale() !== stale) {\n return false;\n }\n if (fetchStatus && fetchStatus !== query.state.fetchStatus) {\n return false;\n }\n if (predicate && !predicate(query)) {\n return false;\n }\n return true;\n}\nfunction matchMutation(filters, mutation) {\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 if (status && mutation.state.status !== status) {\n return false;\n }\n if (predicate && !predicate(mutation)) {\n return false;\n }\n return true;\n}\nfunction hashQueryKeyByOptions(queryKey, options) {\n const hashFn = options?.queryKeyHashFn || hashKey;\n return hashFn(queryKey);\n}\nfunction hashKey(queryKey) {\n return JSON.stringify(\n queryKey,\n (_, val) => isPlainObject(val) ? Object.keys(val).sort().reduce((result, key) => {\n result[key] = val[key];\n return result;\n }, {}) : val\n );\n}\nfunction partialMatchKey(a, b) {\n if (a === b) {\n return true;\n }\n if (typeof a !== typeof b) {\n return false;\n }\n if (a && b && typeof a === \"object\" && typeof b === \"object\") {\n return !Object.keys(b).some((key) => !partialMatchKey(a[key], b[key]));\n }\n return false;\n}\nfunction replaceEqualDeep(a, b) {\n if (a === b) {\n return a;\n }\n const array = isPlainArray(a) && isPlainArray(b);\n if (array || isPlainObject(a) && isPlainObject(b)) {\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 = array ? [] : {};\n let equalItems = 0;\n for (let i = 0; i < bSize; i++) {\n const key = array ? i : bItems[i];\n if ((!array && aItems.includes(key) || array) && a[key] === void 0 && b[key] === void 0) {\n copy[key] = void 0;\n equalItems++;\n } else {\n copy[key] = replaceEqualDeep(a[key], b[key]);\n if (copy[key] === a[key] && a[key] !== void 0) {\n equalItems++;\n }\n }\n }\n return aSize === bSize && equalItems === aSize ? a : copy;\n }\n return b;\n}\nfunction shallowEqualObjects(a, b) {\n if (!b || Object.keys(a).length !== Object.keys(b).length) {\n return false;\n }\n for (const key in a) {\n if (a[key] !== b[key]) {\n return false;\n }\n }\n return true;\n}\nfunction isPlainArray(value) {\n return Array.isArray(value) && value.length === Object.keys(value).length;\n}\nfunction isPlainObject(o) {\n if (!hasObjectPrototype(o)) {\n return false;\n }\n const ctor = o.constructor;\n if (ctor === void 0) {\n return true;\n }\n const prot = ctor.prototype;\n if (!hasObjectPrototype(prot)) {\n return false;\n }\n if (!prot.hasOwnProperty(\"isPrototypeOf\")) {\n return false;\n }\n if (Object.getPrototypeOf(o) !== Object.prototype) {\n return false;\n }\n return true;\n}\nfunction hasObjectPrototype(o) {\n return Object.prototype.toString.call(o) === \"[object Object]\";\n}\nfunction sleep(timeout) {\n return new Promise((resolve) => {\n setTimeout(resolve, timeout);\n });\n}\nfunction replaceData(prevData, data, options) {\n if (typeof options.structuralSharing === \"function\") {\n return options.structuralSharing(prevData, data);\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 }\n return replaceEqualDeep(prevData, data);\n }\n return data;\n}\nfunction keepPreviousData(previousData) {\n return previousData;\n}\nfunction addToEnd(items, item, max = 0) {\n const newItems = [...items, item];\n return max && newItems.length > max ? newItems.slice(1) : newItems;\n}\nfunction addToStart(items, item, max = 0) {\n const newItems = [item, ...items];\n return max && newItems.length > max ? newItems.slice(0, -1) : newItems;\n}\nvar skipToken = Symbol();\nfunction ensureQueryFn(options, fetchOptions) {\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 if (!options.queryFn && fetchOptions?.initialPromise) {\n return () => fetchOptions.initialPromise;\n }\n if (!options.queryFn || options.queryFn === skipToken) {\n return () => Promise.reject(new Error(`Missing queryFn: '${options.queryHash}'`));\n }\n return options.queryFn;\n}\nexport {\n addToEnd,\n addToStart,\n ensureQueryFn,\n functionalUpdate,\n hashKey,\n hashQueryKeyByOptions,\n isPlainArray,\n isPlainObject,\n isServer,\n isValidTimeout,\n keepPreviousData,\n matchMutation,\n matchQuery,\n noop,\n partialMatchKey,\n replaceData,\n replaceEqualDeep,\n resolveEnabled,\n resolveStaleTime,\n shallowEqualObjects,\n skipToken,\n sleep,\n timeUntilStale\n};\n//# sourceMappingURL=utils.js.map","// src/focusManager.ts\nimport { Subscribable } from \"./subscribable.js\";\nimport { isServer } from \"./utils.js\";\nvar FocusManager = class extends Subscribable {\n #focused;\n #cleanup;\n #setup;\n constructor() {\n super();\n this.#setup = (onFocus) => {\n if (!isServer && window.addEventListener) {\n const listener = () => onFocus();\n window.addEventListener(\"visibilitychange\", listener, false);\n return () => {\n window.removeEventListener(\"visibilitychange\", listener);\n };\n }\n return;\n };\n }\n onSubscribe() {\n if (!this.#cleanup) {\n this.setEventListener(this.#setup);\n }\n }\n onUnsubscribe() {\n if (!this.hasListeners()) {\n this.#cleanup?.();\n this.#cleanup = void 0;\n }\n }\n setEventListener(setup) {\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 setFocused(focused) {\n const changed = this.#focused !== focused;\n if (changed) {\n this.#focused = focused;\n this.onFocus();\n }\n }\n onFocus() {\n const isFocused = this.isFocused();\n this.listeners.forEach((listener) => {\n listener(isFocused);\n });\n }\n isFocused() {\n if (typeof this.#focused === \"boolean\") {\n return this.#focused;\n }\n return globalThis.document?.visibilityState !== \"hidden\";\n }\n};\nvar focusManager = new FocusManager();\nexport {\n FocusManager,\n focusManager\n};\n//# sourceMappingURL=focusManager.js.map","// src/onlineManager.ts\nimport { Subscribable } from \"./subscribable.js\";\nimport { isServer } from \"./utils.js\";\nvar OnlineManager = class extends Subscribable {\n #online = true;\n #cleanup;\n #setup;\n constructor() {\n super();\n this.#setup = (onOnline) => {\n if (!isServer && window.addEventListener) {\n const onlineListener = () => onOnline(true);\n const offlineListener = () => onOnline(false);\n window.addEventListener(\"online\", onlineListener, false);\n window.addEventListener(\"offline\", offlineListener, false);\n return () => {\n window.removeEventListener(\"online\", onlineListener);\n window.removeEventListener(\"offline\", offlineListener);\n };\n }\n return;\n };\n }\n onSubscribe() {\n if (!this.#cleanup) {\n this.setEventListener(this.#setup);\n }\n }\n onUnsubscribe() {\n if (!this.hasListeners()) {\n this.#cleanup?.();\n this.#cleanup = void 0;\n }\n }\n setEventListener(setup) {\n this.#setup = setup;\n this.#cleanup?.();\n this.#cleanup = setup(this.setOnline.bind(this));\n }\n setOnline(online) {\n const changed = this.#online !== online;\n if (changed) {\n this.#online = online;\n this.listeners.forEach((listener) => {\n listener(online);\n });\n }\n }\n isOnline() {\n return this.#online;\n }\n};\nvar onlineManager = new OnlineManager();\nexport {\n OnlineManager,\n onlineManager\n};\n//# sourceMappingURL=onlineManager.js.map","// src/thenable.ts\nfunction pendingThenable() {\n let resolve;\n let reject;\n const thenable = new Promise((_resolve, _reject) => {\n resolve = _resolve;\n reject = _reject;\n });\n thenable.status = \"pending\";\n thenable.catch(() => {\n });\n function finalize(data) {\n Object.assign(thenable, data);\n delete thenable.resolve;\n delete thenable.reject;\n }\n thenable.resolve = (value) => {\n finalize({\n status: \"fulfilled\",\n value\n });\n resolve(value);\n };\n thenable.reject = (reason) => {\n finalize({\n status: \"rejected\",\n reason\n });\n reject(reason);\n };\n return thenable;\n}\nexport {\n pendingThenable\n};\n//# sourceMappingURL=thenable.js.map","// src/retryer.ts\nimport { focusManager } from \"./focusManager.js\";\nimport { onlineManager } from \"./onlineManager.js\";\nimport { pendingThenable } from \"./thenable.js\";\nimport { isServer, sleep } from \"./utils.js\";\nfunction defaultRetryDelay(failureCount) {\n return Math.min(1e3 * 2 ** failureCount, 3e4);\n}\nfunction canFetch(networkMode) {\n return (networkMode ?? \"online\") === \"online\" ? onlineManager.isOnline() : true;\n}\nvar CancelledError = class extends Error {\n constructor(options) {\n super(\"CancelledError\");\n this.revert = options?.revert;\n this.silent = options?.silent;\n }\n};\nfunction isCancelledError(value) {\n return value instanceof CancelledError;\n}\nfunction createRetryer(config) {\n let isRetryCancelled = false;\n let failureCount = 0;\n let isResolved = false;\n let continueFn;\n const thenable = pendingThenable();\n const cancel = (cancelOptions) => {\n if (!isResolved) {\n reject(new CancelledError(cancelOptions));\n config.abort?.();\n }\n };\n const cancelRetry = () => {\n isRetryCancelled = true;\n };\n const continueRetry = () => {\n isRetryCancelled = false;\n };\n const canContinue = () => focusManager.isFocused() && (config.networkMode === \"always\" || onlineManager.isOnline()) && config.canRun();\n const canStart = () => canFetch(config.networkMode) && config.canRun();\n const resolve = (value) => {\n if (!isResolved) {\n isResolved = true;\n config.onSuccess?.(value);\n continueFn?.();\n thenable.resolve(value);\n }\n };\n const reject = (value) => {\n if (!isResolved) {\n isResolved = true;\n config.onError?.(value);\n continueFn?.();\n thenable.reject(value);\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 = void 0;\n if (!isResolved) {\n config.onContinue?.();\n }\n });\n };\n const run = () => {\n if (isResolved) {\n return;\n }\n let promiseOrValue;\n const initialPromise = failureCount === 0 ? config.initialPromise : void 0;\n try {\n promiseOrValue = initialPromise ?? config.fn();\n } catch (error) {\n promiseOrValue = Promise.reject(error);\n }\n Promise.resolve(promiseOrValue).then(resolve).catch((error) => {\n if (isResolved) {\n return;\n }\n const retry = config.retry ?? (isServer ? 0 : 3);\n const retryDelay = config.retryDelay ?? defaultRetryDelay;\n const delay = typeof retryDelay === \"function\" ? retryDelay(failureCount, error) : retryDelay;\n const shouldRetry = retry === true || typeof retry === \"number\" && failureCount < retry || typeof retry === \"function\" && retry(failureCount, error);\n if (isRetryCancelled || !shouldRetry) {\n reject(error);\n return;\n }\n failureCount++;\n config.onFail?.(failureCount, error);\n sleep(delay).then(() => {\n return canContinue() ? void 0 : pause();\n }).then(() => {\n if (isRetryCancelled) {\n reject(error);\n } else {\n run();\n }\n });\n });\n };\n return {\n promise: thenable,\n cancel,\n continue: () => {\n continueFn?.();\n return thenable;\n },\n cancelRetry,\n continueRetry,\n canStart,\n start: () => {\n if (canStart()) {\n run();\n } else {\n pause().then(run);\n }\n return thenable;\n }\n };\n}\nexport {\n CancelledError,\n canFetch,\n createRetryer,\n isCancelledError\n};\n//# sourceMappingURL=retryer.js.map","// src/notifyManager.ts\nfunction createNotifyManager() {\n let queue = [];\n let transactions = 0;\n let notifyFn = (callback) => {\n callback();\n };\n let batchNotifyFn = (callback) => {\n callback();\n };\n let scheduleFn = (cb) => setTimeout(cb, 0);\n const schedule = (callback) => {\n if (transactions) {\n queue.push(callback);\n } else {\n scheduleFn(() => {\n notifyFn(callback);\n });\n }\n };\n const flush = () => {\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 return {\n batch: (callback) => {\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: (callback) => {\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) => {\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) => {\n batchNotifyFn = fn;\n },\n setScheduler: (fn) => {\n scheduleFn = fn;\n }\n };\n}\nvar notifyManager = createNotifyManager();\nexport {\n createNotifyManager,\n notifyManager\n};\n//# sourceMappingURL=notifyManager.js.map","// src/removable.ts\nimport { isServer, isValidTimeout } from \"./utils.js\";\nvar Removable = class {\n #gcTimeout;\n destroy() {\n this.clearGcTimeout();\n }\n scheduleGc() {\n this.clearGcTimeout();\n if (isValidTimeout(this.gcTime)) {\n this.#gcTimeout = setTimeout(() => {\n this.optionalRemove();\n }, this.gcTime);\n }\n }\n updateGcTime(newGcTime) {\n this.gcTime = Math.max(\n this.gcTime || 0,\n newGcTime ?? (isServer ? Infinity : 5 * 60 * 1e3)\n );\n }\n clearGcTimeout() {\n if (this.#gcTimeout) {\n clearTimeout(this.#gcTimeout);\n this.#gcTimeout = void 0;\n }\n }\n};\nexport {\n Removable\n};\n//# sourceMappingURL=removable.js.map","// src/query.ts\nimport {\n ensureQueryFn,\n noop,\n replaceData,\n resolveEnabled,\n skipToken,\n timeUntilStale\n} from \"./utils.js\";\nimport { notifyManager } from \"./notifyManager.js\";\nimport { canFetch, createRetryer, isCancelledError } from \"./retryer.js\";\nimport { Removable } from \"./removable.js\";\nvar Query = class extends Removable {\n #initialState;\n #revertState;\n #cache;\n #client;\n #retryer;\n #defaultOptions;\n #abortSignalConsumed;\n constructor(config) {\n super();\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() {\n return this.options.meta;\n }\n get promise() {\n return this.#retryer?.promise;\n }\n setOptions(options) {\n this.options = { ...this.#defaultOptions, ...options };\n this.updateGcTime(this.options.gcTime);\n }\n optionalRemove() {\n if (!this.observers.length && this.state.fetchStatus === \"idle\") {\n this.#cache.remove(this);\n }\n }\n setData(newData, options) {\n const data = replaceData(this.state.data, newData, this.options);\n this.#dispatch({\n data,\n type: \"success\",\n dataUpdatedAt: options?.updatedAt,\n manual: options?.manual\n });\n return data;\n }\n setState(state, setStateOptions) {\n this.#dispatch({ type: \"setState\", state, setStateOptions });\n }\n cancel(options) {\n const promise = this.#retryer?.promise;\n this.#retryer?.cancel(options);\n return promise ? promise.then(noop).catch(noop) : Promise.resolve();\n }\n destroy() {\n super.destroy();\n this.cancel({ silent: true });\n }\n reset() {\n this.destroy();\n this.setState(this.#initialState);\n }\n isActive() {\n return this.observers.some(\n (observer) => resolveEnabled(observer.options.enabled, this) !== false\n );\n }\n isDisabled() {\n if (this.getObserversCount() > 0) {\n return !this.isActive();\n }\n return this.options.queryFn === skipToken || this.state.dataUpdateCount + this.state.errorUpdateCount === 0;\n }\n isStale() {\n if (this.state.isInvalidated) {\n return true;\n }\n if (this.getObserversCount() > 0) {\n return this.observers.some(\n (observer) => observer.getCurrentResult().isStale\n );\n }\n return this.state.data === void 0;\n }\n isStaleByTime(staleTime = 0) {\n return this.state.isInvalidated || this.state.data === void 0 || !timeUntilStale(this.state.dataUpdatedAt, staleTime);\n }\n onFocus() {\n const observer = this.observers.find((x) => x.shouldFetchOnWindowFocus());\n observer?.refetch({ cancelRefetch: false });\n this.#retryer?.continue();\n }\n onOnline() {\n const observer = this.observers.find((x) => x.shouldFetchOnReconnect());\n observer?.refetch({ cancelRefetch: false });\n this.#retryer?.continue();\n }\n addObserver(observer) {\n if (!this.observers.includes(observer)) {\n this.observers.push(observer);\n this.clearGcTimeout();\n this.#cache.notify({ type: \"observerAdded\", query: this, observer });\n }\n }\n removeObserver(observer) {\n if (this.observers.includes(observer)) {\n this.observers = this.observers.filter((x) => x !== observer);\n if (!this.observers.length) {\n if (this.#retryer) {\n if (this.#abortSignalConsumed) {\n this.#retryer.cancel({ revert: true });\n } else {\n this.#retryer.cancelRetry();\n }\n }\n this.scheduleGc();\n }\n this.#cache.notify({ type: \"observerRemoved\", query: this, observer });\n }\n }\n getObserversCount() {\n return this.observers.length;\n }\n invalidate() {\n if (!this.state.isInvalidated) {\n this.#dispatch({ type: \"invalidate\" });\n }\n }\n fetch(options, fetchOptions) {\n if (this.state.fetchStatus !== \"idle\") {\n if (this.state.data !== void 0 && fetchOptions?.cancelRefetch) {\n this.cancel({ silent: true });\n } else if (this.#retryer) {\n this.#retryer.continueRetry();\n return this.#retryer.promise;\n }\n }\n if (options) {\n this.setOptions(options);\n }\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 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 const abortController = new AbortController();\n const addSignalProperty = (object) => {\n Object.defineProperty(object, \"signal\", {\n enumerable: true,\n get: () => {\n this.#abortSignalConsumed = true;\n return abortController.signal;\n }\n });\n };\n const fetchFn = () => {\n const queryFn = ensureQueryFn(this.options, fetchOptions);\n const queryFnContext = {\n client: this.#client,\n queryKey: this.queryKey,\n meta: this.meta\n };\n addSignalProperty(queryFnContext);\n this.#abortSignalConsumed = false;\n if (this.options.persister) {\n return this.options.persister(\n queryFn,\n queryFnContext,\n this\n );\n }\n return queryFn(queryFnContext);\n };\n const context = {\n fetchOptions,\n options: this.options,\n queryKey: this.queryKey,\n client: this.#client,\n state: this.state,\n fetchFn\n };\n addSignalProperty(context);\n this.options.behavior?.onFetch(\n context,\n this\n );\n this.#revertState = this.state;\n if (this.state.fetchStatus === \"idle\" || this.state.fetchMeta !== context.fetchOptions?.meta) {\n this.#dispatch({ type: \"fetch\", meta: context.fetchOptions?.meta });\n }\n const onError = (error) => {\n if (!(isCancelledError(error) && error.silent)) {\n this.#dispatch({\n type: \"error\",\n error\n });\n }\n if (!isCancelledError(error)) {\n this.#cache.config.onError?.(\n error,\n this\n );\n this.#cache.config.onSettled?.(\n this.state.data,\n error,\n this\n );\n }\n this.scheduleGc();\n };\n this.#retryer = createRetryer({\n initialPromise: fetchOptions?.initialPromise,\n fn: context.fetchFn,\n abort: abortController.abort.bind(abortController),\n onSuccess: (data) => {\n if (data === void 0) {\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 onError(new Error(`${this.queryHash} data is undefined`));\n return;\n }\n try {\n this.setData(data);\n } catch (error) {\n onError(error);\n return;\n }\n this.#cache.config.onSuccess?.(data, this);\n this.#cache.config.onSettled?.(\n data,\n this.state.error,\n this\n );\n this.scheduleGc();\n },\n onError,\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 return this.#retryer.start();\n }\n #dispatch(action) {\n const reducer = (state) => {\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 return {\n ...state,\n data: action.data,\n dataUpdateCount: state.dataUpdateCount + 1,\n dataUpdatedAt: action.dataUpdatedAt ?? Date.now(),\n error: null,\n isInvalidated: false,\n status: \"success\",\n ...!action.manual && {\n fetchStatus: \"idle\",\n fetchFailureCount: 0,\n fetchFailureReason: null\n }\n };\n case \"error\":\n const error = action.error;\n if (isCancelledError(error) && error.revert && this.#revertState) {\n return { ...this.#revertState, fetchStatus: \"idle\" };\n }\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 };\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 this.state = reducer(this.state);\n notifyManager.batch(() => {\n this.observers.forEach((observer) => {\n observer.onQueryUpdate();\n });\n this.#cache.notify({ query: this, type: \"updated\", action });\n });\n }\n};\nfunction fetchState(data, options) {\n return {\n fetchFailureCount: 0,\n fetchFailureReason: null,\n fetchStatus: canFetch(options.networkMode) ? \"fetching\" : \"paused\",\n ...data === void 0 && {\n error: null,\n status: \"pending\"\n }\n };\n}\nfunction getDefaultState(options) {\n const data = typeof options.initialData === \"function\" ? options.initialData() : options.initialData;\n const hasData = data !== void 0;\n const initialDataUpdatedAt = hasData ? typeof options.initialDataUpdatedAt === \"function\" ? options.initialDataUpdatedAt() : options.initialDataUpdatedAt : 0;\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}\nexport {\n Query,\n fetchState\n};\n//# sourceMappingURL=query.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 client,\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/mutation.ts\nimport { notifyManager } from \"./notifyManager.js\";\nimport { Removable } from \"./removable.js\";\nimport { createRetryer } from \"./retryer.js\";\nvar Mutation = class extends Removable {\n #observers;\n #mutationCache;\n #retryer;\n constructor(config) {\n super();\n this.mutationId = config.mutationId;\n this.#mutationCache = config.mutationCache;\n this.#observers = [];\n this.state = config.state || getDefaultState();\n this.setOptions(config.options);\n this.scheduleGc();\n }\n setOptions(options) {\n this.options = options;\n this.updateGcTime(this.options.gcTime);\n }\n get meta() {\n return this.options.meta;\n }\n addObserver(observer) {\n if (!this.#observers.includes(observer)) {\n this.#observers.push(observer);\n this.clearGcTimeout();\n this.#mutationCache.notify({\n type: \"observerAdded\",\n mutation: this,\n observer\n });\n }\n }\n removeObserver(observer) {\n this.#observers = this.#observers.filter((x) => x !== observer);\n this.scheduleGc();\n this.#mutationCache.notify({\n type: \"observerRemoved\",\n mutation: this,\n observer\n });\n }\n 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 continue() {\n return this.#retryer?.continue() ?? // continuing a mutation assumes that variables are set, mutation must have been dehydrated before\n this.execute(this.state.variables);\n }\n async execute(variables) {\n this.#retryer = createRetryer({\n fn: () => {\n if (!this.options.mutationFn) {\n return Promise.reject(new Error(\"No mutationFn found\"));\n }\n return this.options.mutationFn(variables);\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: this.options.retry ?? 0,\n retryDelay: this.options.retryDelay,\n networkMode: this.options.networkMode,\n canRun: () => this.#mutationCache.canRun(this)\n });\n const restored = this.state.status === \"pending\";\n const isPaused = !this.#retryer.canStart();\n try {\n if (!restored) {\n this.#dispatch({ type: \"pending\", variables, isPaused });\n await this.#mutationCache.config.onMutate?.(\n variables,\n this\n );\n const context = await this.options.onMutate?.(variables);\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 await this.#mutationCache.config.onSuccess?.(\n data,\n variables,\n this.state.context,\n this\n );\n await this.options.onSuccess?.(data, variables, this.state.context);\n await this.#mutationCache.config.onSettled?.(\n data,\n null,\n this.state.variables,\n this.state.context,\n this\n );\n await this.options.onSettled?.(data, null, variables, this.state.context);\n this.#dispatch({ type: \"success\", data });\n return data;\n } catch (error) {\n try {\n await this.#mutationCache.config.onError?.(\n error,\n variables,\n this.state.context,\n this\n );\n await this.options.onError?.(\n error,\n variables,\n this.state.context\n );\n await this.#mutationCache.config.onSettled?.(\n void 0,\n error,\n this.state.variables,\n this.state.context,\n this\n );\n await this.options.onSettled?.(\n void 0,\n error,\n variables,\n this.state.context\n );\n throw error;\n } finally {\n this.#dispatch({ type: \"error\", error });\n }\n } finally {\n this.#mutationCache.runNext(this);\n }\n }\n #dispatch(action) {\n const reducer = (state) => {\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: void 0,\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: void 0,\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 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};\nfunction getDefaultState() {\n return {\n context: void 0,\n data: void 0,\n error: null,\n failureCount: 0,\n failureReason: null,\n isPaused: false,\n status: \"idle\",\n variables: void 0,\n submittedAt: 0\n };\n}\nexport {\n Mutation,\n getDefaultState\n};\n//# sourceMappingURL=mutation.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 Set();\n this.#scopes = /* @__PURE__ */ new Map();\n this.#mutationId = 0;\n }\n #mutations;\n #scopes;\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 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 remove(mutation) {\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 this.notify({ type: \"removed\", mutation });\n }\n canRun(mutation) {\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 return !firstPendingMutation || firstPendingMutation === mutation;\n } else {\n return true;\n }\n }\n runNext(mutation) {\n const scope = scopeFor(mutation);\n if (typeof scope === \"string\") {\n const foundMutation = this.#scopes.get(scope)?.find((m) => m !== mutation && m.state.isPaused);\n return foundMutation?.continue() ?? Promise.resolve();\n } else {\n return Promise.resolve();\n }\n }\n clear() {\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 getAll() {\n return Array.from(this.#mutations);\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;\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 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 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 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}\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 defaultedOptions = this.defaultQueryOptions(options);\n const query = this.#queryCache.build(this, defaultedOptions);\n const cachedData = query.state.data;\n if (cachedData === void 0) {\n return this.fetchQuery(options);\n }\n if (options.revalidateIfStale && query.isStaleByTime(resolveStaleTime(defaultedOptions.staleTime, query))) {\n void this.prefetchQuery(defaultedOptions);\n }\n return Promise.resolve(cachedData);\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(\n options.queryHash\n )?.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 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 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 return this.refetchQueries(\n {\n ...filters,\n type: filters?.refetchType ?? filters?.type ?? \"active\"\n },\n options\n );\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 const result = {};\n defaults.forEach((queryDefault) => {\n if (partialMatchKey(queryKey, queryDefault.queryKey)) {\n Object.assign(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 const result = {};\n defaults.forEach((queryDefault) => {\n if (partialMatchKey(mutationKey, queryDefault.mutationKey)) {\n Object.assign(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.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","// src/queryObserver.ts\nimport { focusManager } from \"./focusManager.js\";\nimport { notifyManager } from \"./notifyManager.js\";\nimport { fetchState } from \"./query.js\";\nimport { Subscribable } from \"./subscribable.js\";\nimport { pendingThenable } from \"./thenable.js\";\nimport {\n isServer,\n isValidTimeout,\n noop,\n replaceData,\n resolveEnabled,\n resolveStaleTime,\n shallowEqualObjects,\n timeUntilStale\n} from \"./utils.js\";\nvar QueryObserver = class extends Subscribable {\n constructor(client, options) {\n super();\n this.options = options;\n this.#client = client;\n this.#selectError = null;\n this.#currentThenable = pendingThenable();\n if (!this.options.experimental_prefetchInRender) {\n this.#currentThenable.reject(\n new Error(\"experimental_prefetchInRender feature flag is not enabled\")\n );\n }\n this.bindMethods();\n this.setOptions(options);\n }\n #client;\n #currentQuery = void 0;\n #currentQueryInitialState = void 0;\n #currentResult = void 0;\n #currentResultState;\n #currentResultOptions;\n #currentThenable;\n #selectError;\n #selectFn;\n #selectResult;\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;\n #staleTimeoutId;\n #refetchIntervalId;\n #currentRefetchInterval;\n #trackedProps = /* @__PURE__ */ new Set();\n bindMethods() {\n this.refetch = this.refetch.bind(this);\n }\n onSubscribe() {\n if (this.listeners.size === 1) {\n this.#currentQuery.addObserver(this);\n if (shouldFetchOnMount(this.#currentQuery, this.options)) {\n this.#executeFetch();\n } else {\n this.updateResult();\n }\n this.#updateTimers();\n }\n }\n onUnsubscribe() {\n if (!this.hasListeners()) {\n this.destroy();\n }\n }\n shouldFetchOnReconnect() {\n return shouldFetchOn(\n this.#currentQuery,\n this.options,\n this.options.refetchOnReconnect\n );\n }\n shouldFetchOnWindowFocus() {\n return shouldFetchOn(\n this.#currentQuery,\n this.options,\n this.options.refetchOnWindowFocus\n );\n }\n destroy() {\n this.listeners = /* @__PURE__ */ new Set();\n this.#clearStaleTimeout();\n this.#clearRefetchInterval();\n this.#currentQuery.removeObserver(this);\n }\n setOptions(options, notifyOptions) {\n const prevOptions = this.options;\n const prevQuery = this.#currentQuery;\n this.options = this.#client.defaultQueryOptions(options);\n if (this.options.enabled !== void 0 && typeof this.options.enabled !== \"boolean\" && typeof this.options.enabled !== \"function\" && typeof resolveEnabled(this.options.enabled, this.#currentQuery) !== \"boolean\") {\n throw new Error(\n \"Expected enabled to be a boolean or a callback that returns a boolean\"\n );\n }\n this.#updateQuery();\n this.#currentQuery.setOptions(this.options);\n if (prevOptions._defaulted && !shallowEqualObjects(this.options, prevOptions)) {\n this.#client.getQueryCache().notify({\n type: \"observerOptionsUpdated\",\n query: this.#currentQuery,\n observer: this\n });\n }\n const mounted = this.hasListeners();\n if (mounted && shouldFetchOptionally(\n this.#currentQuery,\n prevQuery,\n this.options,\n prevOptions\n )) {\n this.#executeFetch();\n }\n this.updateResult(notifyOptions);\n 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))) {\n this.#updateStaleTimeout();\n }\n const nextRefetchInterval = this.#computeRefetchInterval();\n if (mounted && (this.#currentQuery !== prevQuery || resolveEnabled(this.options.enabled, this.#currentQuery) !== resolveEnabled(prevOptions.enabled, this.#currentQuery) || nextRefetchInterval !== this.#currentRefetchInterval)) {\n this.#updateRefetchInterval(nextRefetchInterval);\n }\n }\n getOptimisticResult(options) {\n const query = this.#client.getQueryCache().build(this.#client, options);\n const result = this.createResult(query, options);\n if (shouldAssignObserverCurrentProperties(this, result)) {\n this.#currentResult = result;\n this.#currentResultOptions = this.options;\n this.#currentResultState = this.#currentQuery.state;\n }\n return result;\n }\n getCurrentResult() {\n return this.#currentResult;\n }\n trackResult(result, onPropTracked) {\n const trackedResult = {};\n Object.keys(result).forEach((key) => {\n Object.defineProperty(trackedResult, key, {\n configurable: false,\n enumerable: true,\n get: () => {\n this.trackProp(key);\n onPropTracked?.(key);\n return result[key];\n }\n });\n });\n return trackedResult;\n }\n trackProp(key) {\n this.#trackedProps.add(key);\n }\n getCurrentQuery() {\n return this.#currentQuery;\n }\n refetch({ ...options } = {}) {\n return this.fetch({\n ...options\n });\n }\n fetchOptimistic(options) {\n const defaultedOptions = this.#client.defaultQueryOptions(options);\n const query = this.#client.getQueryCache().build(this.#client, defaultedOptions);\n return query.fetch().then(() => this.createResult(query, defaultedOptions));\n }\n fetch(fetchOptions) {\n return this.#executeFetch({\n ...fetchOptions,\n cancelRefetch: fetchOptions.cancelRefetch ?? true\n }).then(() => {\n this.updateResult();\n return this.#currentResult;\n });\n }\n #executeFetch(fetchOptions) {\n this.#updateQuery();\n let promise = this.#currentQuery.fetch(\n this.options,\n fetchOptions\n );\n if (!fetchOptions?.throwOnError) {\n promise = promise.catch(noop);\n }\n return promise;\n }\n #updateStaleTimeout() {\n this.#clearStaleTimeout();\n const staleTime = resolveStaleTime(\n this.options.staleTime,\n this.#currentQuery\n );\n if (isServer || this.#currentResult.isStale || !isValidTimeout(staleTime)) {\n return;\n }\n const time = timeUntilStale(this.#currentResult.dataUpdatedAt, staleTime);\n const timeout = time + 1;\n this.#staleTimeoutId = setTimeout(() => {\n if (!this.#currentResult.isStale) {\n this.updateResult();\n }\n }, timeout);\n }\n #computeRefetchInterval() {\n return (typeof this.options.refetchInterval === \"function\" ? this.options.refetchInterval(this.#currentQuery) : this.options.refetchInterval) ?? false;\n }\n #updateRefetchInterval(nextInterval) {\n this.#clearRefetchInterval();\n this.#currentRefetchInterval = nextInterval;\n if (isServer || resolveEnabled(this.options.enabled, this.#currentQuery) === false || !isValidTimeout(this.#currentRefetchInterval) || this.#currentRefetchInterval === 0) {\n return;\n }\n this.#refetchIntervalId = setInterval(() => {\n if (this.options.refetchIntervalInBackground || focusManager.isFocused()) {\n this.#executeFetch();\n }\n }, this.#currentRefetchInterval);\n }\n #updateTimers() {\n this.#updateStaleTimeout();\n this.#updateRefetchInterval(this.#computeRefetchInterval());\n }\n #clearStaleTimeout() {\n if (this.#staleTimeoutId) {\n clearTimeout(this.#staleTimeoutId);\n this.#staleTimeoutId = void 0;\n }\n }\n #clearRefetchInterval() {\n if (this.#refetchIntervalId) {\n clearInterval(this.#refetchIntervalId);\n this.#refetchIntervalId = void 0;\n }\n }\n createResult(query, options) {\n const prevQuery = this.#currentQuery;\n const prevOptions = this.options;\n const prevResult = this.#currentResult;\n const prevResultState = this.#currentResultState;\n const prevResultOptions = this.#currentResultOptions;\n const queryChange = query !== prevQuery;\n const queryInitialState = queryChange ? query.state : this.#currentQueryInitialState;\n const { state } = query;\n let newState = { ...state };\n let isPlaceholderData = false;\n let data;\n if (options._optimisticResults) {\n const mounted = this.hasListeners();\n const fetchOnMount = !mounted && shouldFetchOnMount(query, options);\n const fetchOptionally = mounted && shouldFetchOptionally(query, prevQuery, options, prevOptions);\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 let { error, errorUpdatedAt, status } = newState;\n if (options.select && newState.data !== void 0) {\n if (prevResult && newState.data === prevResultState?.data && options.select === this.#selectFn) {\n data = this.#selectResult;\n } else {\n try {\n this.#selectFn = options.select;\n data = options.select(newState.data);\n data = replaceData(prevResult?.data, data, options);\n this.#selectResult = data;\n this.#selectError = null;\n } catch (selectError) {\n this.#selectError = selectError;\n }\n }\n } else {\n data = newState.data;\n }\n if (options.placeholderData !== void 0 && data === void 0 && status === \"pending\") {\n let placeholderData;\n if (prevResult?.isPlaceholderData && options.placeholderData === prevResultOptions?.placeholderData) {\n placeholderData = prevResult.data;\n } else {\n placeholderData = typeof options.placeholderData === \"function\" ? options.placeholderData(\n this.#lastQueryWithDefinedData?.state.data,\n this.#lastQueryWithDefinedData\n ) : options.placeholderData;\n if (options.select && placeholderData !== void 0) {\n try {\n placeholderData = options.select(placeholderData);\n this.#selectError = null;\n } catch (selectError) {\n this.#selectError = selectError;\n }\n }\n }\n if (placeholderData !== void 0) {\n status = \"success\";\n data = replaceData(\n prevResult?.data,\n placeholderData,\n options\n );\n isPlaceholderData = true;\n }\n }\n if (this.#selectError) {\n error = this.#selectError;\n data = this.#selectResult;\n errorUpdatedAt = Date.now();\n status = \"error\";\n }\n const isFetching = newState.fetchStatus === \"fetching\";\n const isPending = status === \"pending\";\n const isError = status === \"error\";\n const isLoading = isPending && isFetching;\n const hasData = data !== void 0;\n const result = {\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: newState.dataUpdateCount > queryInitialState.dataUpdateCount || 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 };\n const nextResult = result;\n if (this.options.experimental_prefetchInRender) {\n const finalizeThenableIfPossible = (thenable) => {\n if (nextResult.status === \"error\") {\n thenable.reject(nextResult.error);\n } else if (nextResult.data !== void 0) {\n thenable.resolve(nextResult.data);\n }\n };\n const recreateThenable = () => {\n const pending = this.#currentThenable = nextResult.promise = pendingThenable();\n finalizeThenableIfPossible(pending);\n };\n const prevThenable = this.#currentThenable;\n switch (prevThenable.status) {\n case \"pending\":\n if (query.queryHash === prevQuery.queryHash) {\n finalizeThenableIfPossible(prevThenable);\n }\n break;\n case \"fulfilled\":\n if (nextResult.status === \"error\" || nextResult.data !== prevThenable.value) {\n recreateThenable();\n }\n break;\n case \"rejected\":\n if (nextResult.status !== \"error\" || nextResult.error !== prevThenable.reason) {\n recreateThenable();\n }\n break;\n }\n }\n return nextResult;\n }\n updateResult(notifyOptions) {\n const prevResult = this.#currentResult;\n const nextResult = this.createResult(this.#currentQuery, this.options);\n this.#currentResultState = this.#currentQuery.state;\n this.#currentResultOptions = this.options;\n if (this.#currentResultState.data !== void 0) {\n this.#lastQueryWithDefinedData = this.#currentQuery;\n }\n if (shallowEqualObjects(nextResult, prevResult)) {\n return;\n }\n this.#currentResult = nextResult;\n const defaultNotifyOptions = {};\n const shouldNotifyListeners = () => {\n if (!prevResult) {\n return true;\n }\n const { notifyOnChangeProps } = this.options;\n const notifyOnChangePropsValue = typeof notifyOnChangeProps === \"function\" ? notifyOnChangeProps() : notifyOnChangeProps;\n if (notifyOnChangePropsValue === \"all\" || !notifyOnChangePropsValue && !this.#trackedProps.size) {\n return true;\n }\n const includedProps = new Set(\n notifyOnChangePropsValue ?? this.#trackedProps\n );\n if (this.options.throwOnError) {\n includedProps.add(\"error\");\n }\n return Object.keys(this.#currentResult).some((key) => {\n const typedKey = key;\n const changed = this.#currentResult[typedKey] !== prevResult[typedKey];\n return changed && includedProps.has(typedKey);\n });\n };\n if (notifyOptions?.listeners !== false && shouldNotifyListeners()) {\n defaultNotifyOptions.listeners = true;\n }\n this.#notify({ ...defaultNotifyOptions, ...notifyOptions });\n }\n #updateQuery() {\n const query = this.#client.getQueryCache().build(this.#client, this.options);\n if (query === this.#currentQuery) {\n return;\n }\n const prevQuery = this.#currentQuery;\n this.#currentQuery = query;\n this.#currentQueryInitialState = query.state;\n if (this.hasListeners()) {\n prevQuery?.removeObserver(this);\n query.addObserver(this);\n }\n }\n onQueryUpdate() {\n this.updateResult();\n if (this.hasListeners()) {\n this.#updateTimers();\n }\n }\n #notify(notifyOptions) {\n notifyManager.batch(() => {\n if (notifyOptions.listeners) {\n this.listeners.forEach((listener) => {\n listener(this.#currentResult);\n });\n }\n this.#client.getQueryCache().notify({\n query: this.#currentQuery,\n type: \"observerResultsUpdated\"\n });\n });\n }\n};\nfunction shouldLoadOnMount(query, options) {\n return resolveEnabled(options.enabled, query) !== false && query.state.data === void 0 && !(query.state.status === \"error\" && options.retryOnMount === false);\n}\nfunction shouldFetchOnMount(query, options) {\n return shouldLoadOnMount(query, options) || query.state.data !== void 0 && shouldFetchOn(query, options, options.refetchOnMount);\n}\nfunction shouldFetchOn(query, options, field) {\n if (resolveEnabled(options.enabled, query) !== false) {\n const value = typeof field === \"function\" ? field(query) : field;\n return value === \"always\" || value !== false && isStale(query, options);\n }\n return false;\n}\nfunction shouldFetchOptionally(query, prevQuery, options, prevOptions) {\n return (query !== prevQuery || resolveEnabled(prevOptions.enabled, query) === false) && (!options.suspense || query.state.status !== \"error\") && isStale(query, options);\n}\nfunction isStale(query, options) {\n return resolveEnabled(options.enabled, query) !== false && query.isStaleByTime(resolveStaleTime(options.staleTime, query));\n}\nfunction shouldAssignObserverCurrentProperties(observer, optimisticResult) {\n if (!shallowEqualObjects(observer.getCurrentResult(), optimisticResult)) {\n return true;\n }\n return false;\n}\nexport {\n QueryObserver\n};\n//# sourceMappingURL=queryObserver.js.map","// src/queriesObserver.ts\nimport { notifyManager } from \"./notifyManager.js\";\nimport { QueryObserver } from \"./queryObserver.js\";\nimport { Subscribable } from \"./subscribable.js\";\nimport { replaceEqualDeep } from \"./utils.js\";\nfunction difference(array1, array2) {\n return array1.filter((x) => !array2.includes(x));\n}\nfunction replaceAt(array, index, value) {\n const copy = array.slice(0);\n copy[index] = value;\n return copy;\n}\nvar QueriesObserver = class extends Subscribable {\n #client;\n #result;\n #queries;\n #options;\n #observers;\n #combinedResult;\n #lastCombine;\n #lastResult;\n #observerMatches = [];\n constructor(client, queries, options) {\n super();\n this.#client = client;\n this.#options = options;\n this.#queries = [];\n this.#observers = [];\n this.#result = [];\n this.setQueries(queries);\n }\n onSubscribe() {\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 onUnsubscribe() {\n if (!this.listeners.size) {\n this.destroy();\n }\n }\n destroy() {\n this.listeners = /* @__PURE__ */ new Set();\n this.#observers.forEach((observer) => {\n observer.destroy();\n });\n }\n setQueries(queries, options, notifyOptions) {\n this.#queries = queries;\n this.#options = options;\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 notifyManager.batch(() => {\n const prevObservers = this.#observers;\n const newObserverMatches = this.#findMatchingObservers(this.#queries);\n this.#observerMatches = newObserverMatches;\n newObserverMatches.forEach(\n (match) => match.observer.setOptions(match.defaultedQueryOptions, notifyOptions)\n );\n const newObservers = newObserverMatches.map((match) => match.observer);\n const newResult = newObservers.map(\n (observer) => observer.getCurrentResult()\n );\n const hasIndexChange = newObservers.some(\n (observer, index) => observer !== prevObservers[index]\n );\n if (prevObservers.length === newObservers.length && !hasIndexChange) {\n return;\n }\n this.#observers = newObservers;\n this.#result = newResult;\n if (!this.hasListeners()) {\n return;\n }\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 this.#notify();\n });\n }\n getCurrentResult() {\n return this.#result;\n }\n getQueries() {\n return this.#observers.map((observer) => observer.getCurrentQuery());\n }\n getObservers() {\n return this.#observers;\n }\n getOptimisticResult(queries, combine) {\n const matches = this.#findMatchingObservers(queries);\n const result = matches.map(\n (match) => match.observer.getOptimisticResult(match.defaultedQueryOptions)\n );\n return [\n result,\n (r) => {\n return this.#combineResult(r ?? result, combine);\n },\n () => {\n return this.#trackResult(result, matches);\n }\n ];\n }\n #trackResult(result, matches) {\n return matches.map((match, index) => {\n const observerResult = result[index];\n return !match.defaultedQueryOptions.notifyOnChangeProps ? match.observer.trackResult(observerResult, (accessedProp) => {\n matches.forEach((m) => {\n m.observer.trackProp(accessedProp);\n });\n }) : observerResult;\n });\n }\n #combineResult(input, combine) {\n if (combine) {\n if (!this.#combinedResult || this.#result !== this.#lastResult || combine !== this.#lastCombine) {\n this.#lastCombine = combine;\n this.#lastResult = this.#result;\n this.#combinedResult = replaceEqualDeep(\n this.#combinedResult,\n combine(input)\n );\n }\n return this.#combinedResult;\n }\n return input;\n }\n #findMatchingObservers(queries) {\n const prevObserversMap = new Map(\n this.#observers.map((observer) => [observer.options.queryHash, observer])\n );\n const observers = [];\n queries.forEach((options) => {\n const defaultedOptions = this.#client.defaultQueryOptions(options);\n const match = prevObserversMap.get(defaultedOptions.queryHash);\n if (match) {\n observers.push({\n defaultedQueryOptions: defaultedOptions,\n observer: match\n });\n } else {\n observers.push({\n defaultedQueryOptions: defaultedOptions,\n observer: new QueryObserver(this.#client, defaultedOptions)\n });\n }\n });\n return observers;\n }\n #onUpdate(observer, result) {\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 #notify() {\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 if (previousResult !== newResult) {\n notifyManager.batch(() => {\n this.listeners.forEach((listener) => {\n listener(this.#result);\n });\n });\n }\n }\n }\n};\nexport {\n QueriesObserver\n};\n//# sourceMappingURL=queriesObserver.js.map","// 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/mutationObserver.ts\nimport { getDefaultState } from \"./mutation.js\";\nimport { notifyManager } from \"./notifyManager.js\";\nimport { Subscribable } from \"./subscribable.js\";\nimport { hashKey, shallowEqualObjects } from \"./utils.js\";\nvar MutationObserver = class extends Subscribable {\n #client;\n #currentResult = void 0;\n #currentMutation;\n #mutateOptions;\n constructor(client, options) {\n super();\n this.#client = client;\n this.setOptions(options);\n this.bindMethods();\n this.#updateResult();\n }\n bindMethods() {\n this.mutate = this.mutate.bind(this);\n this.reset = this.reset.bind(this);\n }\n setOptions(options) {\n const prevOptions = this.options;\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 if (prevOptions?.mutationKey && this.options.mutationKey && hashKey(prevOptions.mutationKey) !== hashKey(this.options.mutationKey)) {\n this.reset();\n } else if (this.#currentMutation?.state.status === \"pending\") {\n this.#currentMutation.setOptions(this.options);\n }\n }\n onUnsubscribe() {\n if (!this.hasListeners()) {\n this.#currentMutation?.removeObserver(this);\n }\n }\n onMutationUpdate(action) {\n this.#updateResult();\n this.#notify(action);\n }\n getCurrentResult() {\n return this.#currentResult;\n }\n reset() {\n this.#currentMutation?.removeObserver(this);\n this.#currentMutation = void 0;\n this.#updateResult();\n this.#notify();\n }\n mutate(variables, options) {\n this.#mutateOptions = options;\n this.#currentMutation?.removeObserver(this);\n this.#currentMutation = this.#client.getMutationCache().build(this.#client, this.options);\n this.#currentMutation.addObserver(this);\n return this.#currentMutation.execute(variables);\n }\n #updateResult() {\n const state = this.#currentMutation?.state ?? getDefaultState();\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 };\n }\n #notify(action) {\n notifyManager.batch(() => {\n if (this.#mutateOptions && this.hasListeners()) {\n const variables = this.#currentResult.variables;\n const context = this.#currentResult.context;\n if (action?.type === \"success\") {\n this.#mutateOptions.onSuccess?.(action.data, variables, context);\n this.#mutateOptions.onSettled?.(action.data, null, variables, context);\n } else if (action?.type === \"error\") {\n this.#mutateOptions.onError?.(action.error, variables, context);\n this.#mutateOptions.onSettled?.(\n void 0,\n action.error,\n variables,\n context\n );\n }\n }\n this.listeners.forEach((listener) => {\n listener(this.#currentResult);\n });\n });\n }\n};\nexport {\n MutationObserver\n};\n//# sourceMappingURL=mutationObserver.js.map","// 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, shouldRedactErrors) {\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 (!shouldRedactErrors(error)) {\n return Promise.reject(error);\n }\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 defaultshouldRedactErrors(_) {\n return true;\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 shouldRedactErrors = options.shouldRedactErrors ?? client.getDefaultOptions().dehydrate?.shouldRedactErrors ?? defaultshouldRedactErrors;\n const serializeData = options.serializeData ?? client.getDefaultOptions().dehydrate?.serializeData ?? defaultTransformerFn;\n const queries = client.getQueryCache().getAll().flatMap(\n (query) => filterQuery(query) ? [dehydrateQuery(query, serializeData, shouldRedactErrors)] : []\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 defaultshouldRedactErrors,\n dehydrate,\n hydrate\n};\n//# sourceMappingURL=hydration.js.map","// src/streamedQuery.ts\nfunction streamedQuery({\n queryFn,\n refetchMode\n}) {\n return async (context) => {\n if (refetchMode !== \"append\") {\n const query = context.client.getQueryCache().find({ queryKey: context.queryKey, exact: true });\n if (query && query.state.data !== void 0) {\n query.setState({\n status: \"pending\",\n data: void 0,\n error: null,\n fetchStatus: \"fetching\"\n });\n }\n }\n const stream = await queryFn(context);\n for await (const chunk of stream) {\n if (context.signal.aborted) {\n break;\n }\n context.client.setQueryData(\n context.queryKey,\n (prev = []) => {\n return prev.concat(chunk);\n }\n );\n }\n return context.client.getQueryData(context.queryKey);\n };\n}\nexport {\n streamedQuery\n};\n//# sourceMappingURL=streamedQuery.js.map","// src/types.ts\nvar dataTagSymbol = Symbol(\"dataTagSymbol\");\nvar dataTagErrorSymbol = Symbol(\"dataTagErrorSymbol\");\nvar unsetMarker = Symbol(\"unsetMarker\");\nexport {\n dataTagErrorSymbol,\n dataTagSymbol,\n unsetMarker\n};\n//# sourceMappingURL=types.js.map","// src/utils.ts\nimport { isRef, unref } from \"vue-demi\";\nvar VUE_QUERY_CLIENT = \"VUE_QUERY_CLIENT\";\nfunction getClientKey(key) {\n const suffix = key ? `:${key}` : \"\";\n return `${VUE_QUERY_CLIENT}${suffix}`;\n}\nfunction updateState(state, update) {\n Object.keys(state).forEach((key) => {\n state[key] = update[key];\n });\n}\nfunction _cloneDeep(value, customize, currentKey = \"\", currentLevel = 0) {\n if (customize) {\n const result = customize(value, currentKey, currentLevel);\n if (result === void 0 && isRef(value)) {\n return result;\n }\n if (result !== void 0) {\n return result;\n }\n }\n if (Array.isArray(value)) {\n return value.map(\n (val, index) => _cloneDeep(val, customize, String(index), currentLevel + 1)\n );\n }\n if (typeof value === \"object\" && isPlainObject(value)) {\n const entries = Object.entries(value).map(([key, val]) => [\n key,\n _cloneDeep(val, customize, key, currentLevel + 1)\n ]);\n return Object.fromEntries(entries);\n }\n return value;\n}\nfunction cloneDeep(value, customize) {\n return _cloneDeep(value, customize);\n}\nfunction cloneDeepUnref(obj, unrefGetters = false) {\n return cloneDeep(obj, (val, key, level) => {\n if (level === 1 && key === \"queryKey\") {\n return cloneDeepUnref(val, true);\n }\n if (unrefGetters && isFunction(val)) {\n return cloneDeepUnref(val(), unrefGetters);\n }\n if (isRef(val)) {\n return cloneDeepUnref(unref(val), unrefGetters);\n }\n return void 0;\n });\n}\nfunction isPlainObject(value) {\n if (Object.prototype.toString.call(value) !== \"[object Object]\") {\n return false;\n }\n const prototype = Object.getPrototypeOf(value);\n return prototype === null || prototype === Object.prototype;\n}\nfunction isFunction(value) {\n return typeof value === \"function\";\n}\nfunction shouldThrowError(throwOnError, params) {\n if (typeof throwOnError === \"function\") {\n return throwOnError(...params);\n }\n return !!throwOnError;\n}\nexport {\n VUE_QUERY_CLIENT,\n cloneDeep,\n cloneDeepUnref,\n getClientKey,\n shouldThrowError,\n updateState\n};\n//# sourceMappingURL=utils.js.map","// src/useQueryClient.ts\nimport { hasInjectionContext, inject } from \"vue-demi\";\nimport { getClientKey } from \"./utils.js\";\nfunction useQueryClient(id = \"\") {\n if (!hasInjectionContext()) {\n throw new Error(\n \"vue-query hooks can only be used inside setup() function or functions that support injection context.\"\n );\n }\n const key = getClientKey(id);\n const queryClient = inject(key);\n if (!queryClient) {\n throw new Error(\n \"No 'queryClient' found in Vue context, use 'VueQueryPlugin' to properly initialize the library.\"\n );\n }\n return queryClient;\n}\nexport {\n useQueryClient\n};\n//# sourceMappingURL=useQueryClient.js.map","// src/queryCache.ts\nimport { QueryCache as QC } from \"@tanstack/query-core\";\nimport { cloneDeepUnref } from \"./utils.js\";\nvar QueryCache = class extends QC {\n find(filters) {\n return super.find(cloneDeepUnref(filters));\n }\n findAll(filters = {}) {\n return super.findAll(cloneDeepUnref(filters));\n }\n};\nexport {\n QueryCache\n};\n//# sourceMappingURL=queryCache.js.map","// src/mutationCache.ts\nimport { MutationCache as MC } from \"@tanstack/query-core\";\nimport { cloneDeepUnref } from \"./utils.js\";\nvar MutationCache = class extends MC {\n find(filters) {\n return super.find(cloneDeepUnref(filters));\n }\n findAll(filters = {}) {\n return super.findAll(cloneDeepUnref(filters));\n }\n};\nexport {\n MutationCache\n};\n//# sourceMappingURL=mutationCache.js.map","// src/queryClient.ts\nimport { nextTick, ref } from \"vue-demi\";\nimport { QueryClient as QC } from \"@tanstack/query-core\";\nimport { cloneDeepUnref } from \"./utils.js\";\nimport { QueryCache } from \"./queryCache.js\";\nimport { MutationCache } from \"./mutationCache.js\";\nvar QueryClient = class extends QC {\n constructor(config = {}) {\n const vueQueryConfig = {\n defaultOptions: config.defaultOptions,\n queryCache: config.queryCache || new QueryCache(),\n mutationCache: config.mutationCache || new MutationCache()\n };\n super(vueQueryConfig);\n this.isRestoring = ref(false);\n }\n isFetching(filters = {}) {\n return super.isFetching(cloneDeepUnref(filters));\n }\n isMutating(filters = {}) {\n return super.isMutating(cloneDeepUnref(filters));\n }\n getQueryData(queryKey) {\n return super.getQueryData(cloneDeepUnref(queryKey));\n }\n ensureQueryData(options) {\n return super.ensureQueryData(cloneDeepUnref(options));\n }\n getQueriesData(filters) {\n return super.getQueriesData(cloneDeepUnref(filters));\n }\n setQueryData(queryKey, updater, options = {}) {\n return super.setQueryData(\n cloneDeepUnref(queryKey),\n updater,\n cloneDeepUnref(options)\n );\n }\n setQueriesData(filters, updater, options = {}) {\n return super.setQueriesData(\n cloneDeepUnref(filters),\n updater,\n cloneDeepUnref(options)\n );\n }\n getQueryState(queryKey) {\n return super.getQueryState(cloneDeepUnref(queryKey));\n }\n removeQueries(filters = {}) {\n return super.removeQueries(cloneDeepUnref(filters));\n }\n resetQueries(filters = {}, options = {}) {\n return super.resetQueries(cloneDeepUnref(filters), cloneDeepUnref(options));\n }\n cancelQueries(filters = {}, options = {}) {\n return super.cancelQueries(cloneDeepUnref(filters), cloneDeepUnref(options));\n }\n invalidateQueries(filters = {}, options = {}) {\n const filtersCloned = cloneDeepUnref(filters);\n const optionsCloned = cloneDeepUnref(options);\n super.invalidateQueries(\n { ...filtersCloned, refetchType: \"none\" },\n optionsCloned\n );\n if (filtersCloned.refetchType === \"none\") {\n return Promise.resolve();\n }\n const refetchFilters = {\n ...filtersCloned,\n type: filtersCloned.refetchType ?? filtersCloned.type ?? \"active\"\n };\n return nextTick().then(() => {\n return super.refetchQueries(refetchFilters, optionsCloned);\n });\n }\n refetchQueries(filters = {}, options = {}) {\n return super.refetchQueries(\n cloneDeepUnref(filters),\n cloneDeepUnref(options)\n );\n }\n fetchQuery(options) {\n return super.fetchQuery(cloneDeepUnref(options));\n }\n prefetchQuery(options) {\n return super.prefetchQuery(cloneDeepUnref(options));\n }\n fetchInfiniteQuery(options) {\n return super.fetchInfiniteQuery(cloneDeepUnref(options));\n }\n prefetchInfiniteQuery(options) {\n return super.prefetchInfiniteQuery(cloneDeepUnref(options));\n }\n setDefaultOptions(options) {\n super.setDefaultOptions(cloneDeepUnref(options));\n }\n setQueryDefaults(queryKey, options) {\n super.setQueryDefaults(cloneDeepUnref(queryKey), cloneDeepUnref(options));\n }\n getQueryDefaults(queryKey) {\n return super.getQueryDefaults(cloneDeepUnref(queryKey));\n }\n setMutationDefaults(mutationKey, options) {\n super.setMutationDefaults(\n cloneDeepUnref(mutationKey),\n cloneDeepUnref(options)\n );\n }\n getMutationDefaults(mutationKey) {\n return super.getMutationDefaults(cloneDeepUnref(mutationKey));\n }\n};\nexport {\n QueryClient\n};\n//# sourceMappingURL=queryClient.js.map","// src/vueQueryPlugin.ts\nimport { isVue2 } from \"vue-demi\";\nimport { isServer } from \"@tanstack/query-core\";\nimport { QueryClient } from \"./queryClient.js\";\nimport { getClientKey } from \"./utils.js\";\nimport { setupDevtools } from \"./devtools/devtools.js\";\nvar VueQueryPlugin = {\n install: (app, options = {}) => {\n const clientKey = getClientKey(options.queryClientKey);\n let client;\n if (\"queryClient\" in options && options.queryClient) {\n client = options.queryClient;\n } else {\n const clientConfig = \"queryClientConfig\" in options ? options.queryClientConfig : void 0;\n client = new QueryClient(clientConfig);\n }\n if (!isServer) {\n client.mount();\n }\n let persisterUnmount = () => {\n };\n if (options.clientPersister) {\n client.isRestoring.value = true;\n const [unmount, promise] = options.clientPersister(client);\n persisterUnmount = unmount;\n promise.then(() => {\n client.isRestoring.value = false;\n options.clientPersisterOnSuccess?.(client);\n });\n }\n const cleanup = () => {\n client.unmount();\n persisterUnmount();\n };\n if (app.onUnmount) {\n app.onUnmount(cleanup);\n } else {\n const originalUnmount = app.unmount;\n app.unmount = function vueQueryUnmount() {\n cleanup();\n originalUnmount();\n };\n }\n if (isVue2) {\n app.mixin({\n beforeCreate() {\n if (!this._provided) {\n const provideCache = {};\n Object.defineProperty(this, \"_provided\", {\n get: () => provideCache,\n set: (v) => Object.assign(provideCache, v)\n });\n }\n this._provided[clientKey] = client;\n if (process.env.NODE_ENV === \"development\") {\n if (this === this.$root && options.enableDevtoolsV6Plugin) {\n setupDevtools(this, client);\n }\n }\n }\n });\n } else {\n app.provide(clientKey, client);\n if (process.env.NODE_ENV === \"development\") {\n if (options.enableDevtoolsV6Plugin) {\n setupDevtools(app, client);\n }\n }\n }\n }\n};\nexport {\n VueQueryPlugin\n};\n//# sourceMappingURL=vueQueryPlugin.js.map","// src/queryOptions.ts\nfunction queryOptions(options) {\n return options;\n}\nexport {\n queryOptions\n};\n//# sourceMappingURL=queryOptions.js.map","// src/infiniteQueryOptions.ts\nfunction infiniteQueryOptions(options) {\n return options;\n}\nexport {\n infiniteQueryOptions\n};\n//# sourceMappingURL=infiniteQueryOptions.js.map","// src/useBaseQuery.ts\nimport {\n computed,\n getCurrentScope,\n onScopeDispose,\n readonly,\n shallowReactive,\n shallowReadonly,\n toRefs,\n watch\n} from \"vue-demi\";\nimport { useQueryClient } from \"./useQueryClient.js\";\nimport { cloneDeepUnref, shouldThrowError, updateState } from \"./utils.js\";\nfunction useBaseQuery(Observer, options, queryClient) {\n if (process.env.NODE_ENV === \"development\") {\n if (!getCurrentScope()) {\n console.warn(\n 'vue-query composable like \"useQuery()\" should only be used inside a \"setup()\" function or a running effect scope. They might otherwise lead to memory leaks.'\n );\n }\n }\n const client = queryClient || useQueryClient();\n const defaultedOptions = computed(() => {\n const clonedOptions = cloneDeepUnref(options);\n if (typeof clonedOptions.enabled === \"function\") {\n clonedOptions.enabled = clonedOptions.enabled();\n }\n const defaulted = client.defaultQueryOptions(clonedOptions);\n defaulted._optimisticResults = client.isRestoring.value ? \"isRestoring\" : \"optimistic\";\n return defaulted;\n });\n const observer = new Observer(client, defaultedOptions.value);\n const state = shallowReactive(observer.getCurrentResult());\n let unsubscribe = () => {\n };\n watch(\n client.isRestoring,\n (isRestoring) => {\n if (!isRestoring) {\n unsubscribe();\n unsubscribe = observer.subscribe((result) => {\n updateState(state, result);\n });\n }\n },\n { immediate: true }\n );\n const updater = () => {\n observer.setOptions(defaultedOptions.value);\n updateState(state, observer.getCurrentResult());\n };\n watch(defaultedOptions, updater);\n onScopeDispose(() => {\n unsubscribe();\n });\n const refetch = (...args) => {\n updater();\n return state.refetch(...args);\n };\n const suspense = () => {\n return new Promise(\n (resolve, reject) => {\n let stopWatch = () => {\n };\n const run = () => {\n if (defaultedOptions.value.enabled !== false) {\n observer.setOptions(defaultedOptions.value);\n const optimisticResult = observer.getOptimisticResult(\n defaultedOptions.value\n );\n if (optimisticResult.isStale) {\n stopWatch();\n observer.fetchOptimistic(defaultedOptions.value).then(resolve, (error) => {\n if (shouldThrowError(defaultedOptions.value.throwOnError, [\n error,\n observer.getCurrentQuery()\n ])) {\n reject(error);\n } else {\n resolve(observer.getCurrentResult());\n }\n });\n } else {\n stopWatch();\n resolve(optimisticResult);\n }\n }\n };\n run();\n stopWatch = watch(defaultedOptions, run);\n }\n );\n };\n watch(\n () => state.error,\n (error) => {\n if (state.isError && !state.isFetching && shouldThrowError(defaultedOptions.value.throwOnError, [\n error,\n observer.getCurrentQuery()\n ])) {\n throw error;\n }\n }\n );\n const readonlyState = process.env.NODE_ENV === \"production\" ? state : (\n // @ts-expect-error\n defaultedOptions.value.shallow ? shallowReadonly(state) : readonly(state)\n );\n const object = toRefs(readonlyState);\n for (const key in state) {\n if (typeof state[key] === \"function\") {\n object[key] = state[key];\n }\n }\n object.suspense = suspense;\n object.refetch = refetch;\n return object;\n}\nexport {\n useBaseQuery\n};\n//# sourceMappingURL=useBaseQuery.js.map","// src/useQuery.ts\nimport { QueryObserver } from \"@tanstack/query-core\";\nimport { useBaseQuery } from \"./useBaseQuery.js\";\nfunction useQuery(options, queryClient) {\n return useBaseQuery(QueryObserver, options, queryClient);\n}\nexport {\n useQuery\n};\n//# sourceMappingURL=useQuery.js.map","// src/useQueries.ts\nimport { QueriesObserver } from \"@tanstack/query-core\";\nimport {\n computed,\n getCurrentScope,\n onScopeDispose,\n readonly,\n shallowReadonly,\n shallowRef,\n unref,\n watch\n} from \"vue-demi\";\nimport { useQueryClient } from \"./useQueryClient.js\";\nimport { cloneDeepUnref } from \"./utils.js\";\nfunction useQueries({\n queries,\n ...options\n}, queryClient) {\n if (process.env.NODE_ENV === \"development\") {\n if (!getCurrentScope()) {\n console.warn(\n 'vue-query composable like \"useQuery()\" should only be used inside a \"setup()\" function or a running effect scope. They might otherwise lead to memory leaks.'\n );\n }\n }\n const client = queryClient || useQueryClient();\n const defaultedQueries = computed(() => {\n const queriesRaw = unref(queries);\n return queriesRaw.map((queryOptions) => {\n const clonedOptions = cloneDeepUnref(queryOptions);\n if (typeof clonedOptions.enabled === \"function\") {\n clonedOptions.enabled = queryOptions.enabled();\n }\n const defaulted = client.defaultQueryOptions(clonedOptions);\n defaulted._optimisticResults = client.isRestoring.value ? \"isRestoring\" : \"optimistic\";\n return defaulted;\n });\n });\n const observer = new QueriesObserver(\n client,\n defaultedQueries.value,\n options\n );\n const getOptimisticResult = () => {\n const [results, getCombinedResult] = observer.getOptimisticResult(\n defaultedQueries.value,\n options.combine\n );\n return getCombinedResult(\n results.map((result, index) => {\n return {\n ...result,\n refetch: async (...args) => {\n const [{ [index]: query }] = observer.getOptimisticResult(\n defaultedQueries.value,\n options.combine\n );\n return query.refetch(...args);\n }\n };\n })\n );\n };\n const state = shallowRef(getOptimisticResult());\n let unsubscribe = () => {\n };\n watch(\n client.isRestoring,\n (isRestoring) => {\n if (!isRestoring) {\n unsubscribe();\n unsubscribe = observer.subscribe(() => {\n state.value = getOptimisticResult();\n });\n state.value = getOptimisticResult();\n }\n },\n { immediate: true }\n );\n watch(defaultedQueries, (queriesValue) => {\n observer.setQueries(\n queriesValue,\n options\n );\n state.value = getOptimisticResult();\n });\n onScopeDispose(() => {\n unsubscribe();\n });\n return process.env.NODE_ENV === \"production\" ? state : options.shallow ? shallowReadonly(state) : readonly(state);\n}\nexport {\n useQueries\n};\n//# sourceMappingURL=useQueries.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","// src/useMutation.ts\nimport {\n computed,\n getCurrentScope,\n onScopeDispose,\n readonly,\n shallowReactive,\n shallowReadonly,\n toRefs,\n watch\n} from \"vue-demi\";\nimport { MutationObserver } from \"@tanstack/query-core\";\nimport { cloneDeepUnref, shouldThrowError, updateState } from \"./utils.js\";\nimport { useQueryClient } from \"./useQueryClient.js\";\nfunction useMutation(mutationOptions, queryClient) {\n if (process.env.NODE_ENV === \"development\") {\n if (!getCurrentScope()) {\n console.warn(\n 'vue-query composable like \"useQuery()\" should only be used inside a \"setup()\" function or a running effect scope. They might otherwise lead to memory leaks.'\n );\n }\n }\n const client = queryClient || useQueryClient();\n const options = computed(() => {\n return client.defaultMutationOptions(cloneDeepUnref(mutationOptions));\n });\n const observer = new MutationObserver(client, options.value);\n const state = shallowReactive(observer.getCurrentResult());\n const unsubscribe = observer.subscribe((result) => {\n updateState(state, result);\n });\n const mutate = (variables, mutateOptions) => {\n observer.mutate(variables, mutateOptions).catch(() => {\n });\n };\n watch(options, () => {\n observer.setOptions(options.value);\n });\n onScopeDispose(() => {\n unsubscribe();\n });\n const readonlyState = process.env.NODE_ENV === \"production\" ? state : options.value.shallow ? shallowReadonly(state) : readonly(state);\n const resultRefs = toRefs(readonlyState);\n watch(\n () => state.error,\n (error) => {\n if (error && shouldThrowError(options.value.throwOnError, [error])) {\n throw error;\n }\n }\n );\n return {\n ...resultRefs,\n mutate,\n mutateAsync: state.mutate,\n reset: state.reset\n };\n}\nexport {\n useMutation\n};\n//# sourceMappingURL=useMutation.js.map","// src/useIsFetching.ts\nimport { getCurrentScope, onScopeDispose, ref, watchEffect } from \"vue-demi\";\nimport { useQueryClient } from \"./useQueryClient.js\";\nfunction useIsFetching(fetchingFilters = {}, queryClient) {\n if (process.env.NODE_ENV === \"development\") {\n if (!getCurrentScope()) {\n console.warn(\n 'vue-query composable like \"useQuery()\" should only be used inside a \"setup()\" function or a running effect scope. They might otherwise lead to memory leaks.'\n );\n }\n }\n const client = queryClient || useQueryClient();\n const isFetching = ref();\n const listener = () => {\n isFetching.value = client.isFetching(fetchingFilters);\n };\n const unsubscribe = client.getQueryCache().subscribe(listener);\n watchEffect(listener);\n onScopeDispose(() => {\n unsubscribe();\n });\n return isFetching;\n}\nexport {\n useIsFetching\n};\n//# sourceMappingURL=useIsFetching.js.map","// src/useMutationState.ts\nimport {\n computed,\n getCurrentScope,\n onScopeDispose,\n shallowReadonly,\n shallowRef,\n watch\n} from \"vue-demi\";\nimport { useQueryClient } from \"./useQueryClient.js\";\nimport { cloneDeepUnref } from \"./utils.js\";\nfunction useIsMutating(filters = {}, queryClient) {\n if (process.env.NODE_ENV === \"development\") {\n if (!getCurrentScope()) {\n console.warn(\n 'vue-query composable like \"useQuery()\" should only be used inside a \"setup()\" function or a running effect scope. They might otherwise lead to memory leaks.'\n );\n }\n }\n const client = queryClient || useQueryClient();\n const mutationState = useMutationState(\n {\n filters: computed(() => ({\n ...cloneDeepUnref(filters),\n status: \"pending\"\n }))\n },\n client\n );\n const length = computed(() => mutationState.value.length);\n return length;\n}\nfunction getResult(mutationCache, options) {\n return mutationCache.findAll(options.filters).map(\n (mutation) => options.select ? options.select(mutation) : mutation.state\n );\n}\nfunction useMutationState(options = {}, queryClient) {\n const filters = computed(() => cloneDeepUnref(options.filters));\n const mutationCache = (queryClient || useQueryClient()).getMutationCache();\n const state = shallowRef(getResult(mutationCache, options));\n const unsubscribe = mutationCache.subscribe(() => {\n state.value = getResult(mutationCache, options);\n });\n watch(filters, () => {\n state.value = getResult(mutationCache, options);\n });\n onScopeDispose(() => {\n unsubscribe();\n });\n return shallowReadonly(state);\n}\nexport {\n useIsMutating,\n useMutationState\n};\n//# sourceMappingURL=useMutationState.js.map"],"names":["Subscribable","listener","isServer","noop","functionalUpdate","updater","input","isValidTimeout","value","timeUntilStale","updatedAt","staleTime","resolveStaleTime","query","resolveEnabled","enabled","matchQuery","filters","type","exact","fetchStatus","predicate","queryKey","stale","hashQueryKeyByOptions","partialMatchKey","isActive","matchMutation","mutation","status","mutationKey","hashKey","options","_","val","isPlainObject","result","key","a","b","replaceEqualDeep","array","isPlainArray","aItems","aSize","bItems","bSize","copy","equalItems","i","shallowEqualObjects","o","hasObjectPrototype","ctor","prot","sleep","timeout","resolve","replaceData","prevData","data","keepPreviousData","previousData","addToEnd","items","item","max","newItems","addToStart","skipToken","ensureQueryFn","fetchOptions","FocusManager","#focused","#cleanup","#setup","onFocus","setup","focused","isFocused","focusManager","OnlineManager","#online","onOnline","onlineListener","offlineListener","online","onlineManager","pendingThenable","reject","thenable","_resolve","_reject","finalize","reason","defaultRetryDelay","failureCount","canFetch","networkMode","CancelledError","isCancelledError","createRetryer","config","isRetryCancelled","isResolved","continueFn","cancel","cancelOptions","cancelRetry","continueRetry","canContinue","canStart","pause","continueResolve","run","promiseOrValue","initialPromise","error","retry","retryDelay","delay","shouldRetry","createNotifyManager","queue","transactions","notifyFn","callback","batchNotifyFn","scheduleFn","cb","schedule","flush","originalQueue","args","fn","notifyManager","Removable","#gcTimeout","newGcTime","Query","#initialState","#revertState","#cache","#client","#retryer","#defaultOptions","#abortSignalConsumed","getDefaultState","newData","#dispatch","state","setStateOptions","promise","observer","x","abortController","addSignalProperty","object","fetchFn","queryFn","queryFnContext","context","onError","action","reducer","fetchState","hasData","initialDataUpdatedAt","QueryCache","#queries","client","queryHash","queryInMap","defaultedFilters","queries","event","Mutation","#observers","#mutationCache","variables","restored","isPaused","MutationCache","#mutations","#scopes","#mutationId","scope","scopeFor","scopedMutations","index","firstPendingMutation","m","pausedMutations","infiniteQueryBehavior","pages","direction","oldPages","oldPageParams","currentPage","cancelled","fetchPage","param","previous","page","maxPages","addTo","pageParamFn","getPreviousPageParam","getNextPageParam","oldData","remainingPages","pageParams","lastIndex","hasNextPage","hasPreviousPage","QueryClient","#queryCache","#queryDefaults","#mutationDefaults","#mountCount","#unsubscribeFocus","#unsubscribeOnline","defaultedOptions","cachedData","queryCache","defaultedCancelOptions","promises","defaults","queryDefault","QueryObserver","#selectError","#currentThenable","#currentQuery","#currentQueryInitialState","#currentResult","#currentResultState","#currentResultOptions","#selectFn","#selectResult","#lastQueryWithDefinedData","#staleTimeoutId","#refetchIntervalId","#currentRefetchInterval","#trackedProps","shouldFetchOnMount","#executeFetch","#updateTimers","shouldFetchOn","#clearStaleTimeout","#clearRefetchInterval","notifyOptions","prevOptions","prevQuery","#updateQuery","mounted","shouldFetchOptionally","#updateStaleTimeout","nextRefetchInterval","#computeRefetchInterval","#updateRefetchInterval","shouldAssignObserverCurrentProperties","onPropTracked","trackedResult","nextInterval","prevResult","prevResultState","prevResultOptions","queryInitialState","newState","isPlaceholderData","fetchOnMount","fetchOptionally","errorUpdatedAt","selectError","placeholderData","isFetching","isPending","isError","isLoading","nextResult","isStale","finalizeThenableIfPossible","recreateThenable","pending","prevThenable","defaultNotifyOptions","shouldNotifyListeners","notifyOnChangeProps","notifyOnChangePropsValue","includedProps","typedKey","#notify","shouldLoadOnMount","field","optimisticResult","difference","array1","array2","replaceAt","QueriesObserver","#result","#options","#combinedResult","#lastCombine","#lastResult","#observerMatches","#onUpdate","prevObservers","newObserverMatches","#findMatchingObservers","match","newObservers","newResult","hasIndexChange","combine","matches","#combineResult","#trackResult","observerResult","accessedProp","prevObserversMap","observers","previousResult","newTracked","InfiniteQueryObserver","parentResult","isRefetching","isRefetchError","fetchDirection","isFetchNextPageError","isFetchingNextPage","isFetchPreviousPageError","isFetchingPreviousPage","MutationObserver","#currentMutation","#mutateOptions","#updateResult","defaultTransformerFn","dehydrateMutation","dehydrateQuery","serializeData","shouldRedactErrors","defaultShouldDehydrateMutation","defaultShouldDehydrateQuery","defaultshouldRedactErrors","dehydrate","filterMutation","mutations","filterQuery","hydrate","dehydratedState","mutationCache","deserializeData","mutationOptions","meta","_ignored","serializedState","streamedQuery","refetchMode","stream","chunk","prev","dataTagSymbol","dataTagErrorSymbol","unsetMarker","VUE_QUERY_CLIENT","getClientKey","suffix","updateState","update","_cloneDeep","customize","currentKey","currentLevel","isRef","entries","cloneDeep","cloneDeepUnref","obj","unrefGetters","level","isFunction","unref","prototype","shouldThrowError","throwOnError","params","useQueryClient","id","hasInjectionContext","queryClient","inject","QC","MC","vueQueryConfig","ref","filtersCloned","optionsCloned","refetchFilters","nextTick","VueQueryPlugin","app","clientKey","clientConfig","persisterUnmount","unmount","cleanup","originalUnmount","queryOptions","infiniteQueryOptions","useBaseQuery","Observer","computed","clonedOptions","defaulted","shallowReactive","unsubscribe","watch","isRestoring","onScopeDispose","refetch","suspense","stopWatch","toRefs","useQuery","useQueries","defaultedQueries","getOptimisticResult","results","getCombinedResult","shallowRef","queriesValue","useInfiniteQuery","useMutation","mutate","mutateOptions","resultRefs","useIsFetching","fetchingFilters","watchEffect","useIsMutating","mutationState","useMutationState","getResult","shallowReadonly"],"mappings":"oyBACA,IAAIA,EAAe,KAAM,CACvB,aAAc,CACZ,KAAK,UAA4B,IAAI,IACrC,KAAK,UAAY,KAAK,UAAU,KAAK,IAAI,CAC7C,CACE,UAAUC,EAAU,CAClB,YAAK,UAAU,IAAIA,CAAQ,EAC3B,KAAK,YAAa,EACX,IAAM,CACX,KAAK,UAAU,OAAOA,CAAQ,EAC9B,KAAK,cAAe,CACrB,CACL,CACE,cAAe,CACb,OAAO,KAAK,UAAU,KAAO,CACjC,CACE,aAAc,CAChB,CACE,eAAgB,CAClB,CACA,ECpBIC,EAAW,OAAO,OAAW,KAAe,SAAU,WAC1D,SAASC,GAAO,CAChB,CACA,SAASC,GAAiBC,EAASC,EAAO,CACxC,OAAO,OAAOD,GAAY,WAAaA,EAAQC,CAAK,EAAID,CAC1D,CACA,SAASE,EAAeC,EAAO,CAC7B,OAAO,OAAOA,GAAU,UAAYA,GAAS,GAAKA,IAAU,GAC9D,CACA,SAASC,GAAeC,EAAWC,EAAW,CACrC,OAAA,KAAK,IAAID,GAAaC,GAAa,GAAK,KAAK,MAAO,CAAC,CAC9D,CACA,SAASC,EAAiBD,EAAWE,EAAO,CAC1C,OAAO,OAAOF,GAAc,WAAaA,EAAUE,CAAK,EAAIF,CAC9D,CACA,SAASG,EAAeC,EAASF,EAAO,CACtC,OAAO,OAAOE,GAAY,WAAaA,EAAQF,CAAK,EAAIE,C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