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,GAAM,qBAuKCC,GAA6Bx/B,GAAsByT,EAAA,GAAAjS,OAAgB+9B,GAAG,SAAS,CAC1FxE,UAAWA,IAAMyE,KAWNC,IALmC,GAAAj+B,OAAgB+9B,GAAG,cAKtBv/B,GAAsByT,EAAA,GAAAjS,OAAgB+9B,GAAG,YAAY,CAChGxE,UAAWA,IAAM0E,MCgCI/9B,OAAO0a,IAAI,4BClO3B,SAASgU,GAAuBC,GACrC,MAAO,iCAAP7uB,OAAwC6uB,EAAI,qDAAA7uB,OAAoD6uB,EAAI,kFACtG,C","sources":["../node_modules/@reduxjs/toolkit/src/query/utils/capitalize.ts","../node_modules/@reduxjs/toolkit/src/query/tsHelpers.ts","../node_modules/@reduxjs/toolkit/src/query/defaultSerializeQueryArgs.ts","../node_modules/@reduxjs/toolkit/src/query/react/constants.ts","../node_modules/@reduxjs/toolkit/src/query/react/useSerializedStableValue.ts","../node_modules/@reduxjs/toolkit/src/query/react/useShallowStableValue.ts","../node_modules/@reduxjs/toolkit/src/query/react/buildHooks.ts","../node_modules/@reduxjs/toolkit/src/query/react/module.ts","../node_modules/@reduxjs/toolkit/src/query/react/index.ts","../node_modules/@reduxjs/toolkit/src/query/endpointDefinitions.ts","../node_modules/@reduxjs/toolkit/src/query/core/apiState.ts","../node_modules/@reduxjs/toolkit/src/query/utils/copyWithStructuralSharing.ts","../node_modules/@reduxjs/toolkit/src/query/utils/countObjectKeys.ts","../node_modules/@reduxjs/toolkit/src/query/utils/flatten.ts","../node_modules/@reduxjs/toolkit/src/query/utils/isNotNullish.ts","../node_modules/@reduxjs/toolkit/src/query/utils/joinUrls.ts","../node_modules/@reduxjs/toolkit/src/query/utils/isAbsoluteUrl.ts","../node_modules/@reduxjs/toolkit/src/query/fetchBaseQuery.ts","../node_modules/@reduxjs/toolkit/src/query/HandledError.ts","../node_modules/@reduxjs/toolkit/src/query/retry.ts","../node_modules/@reduxjs/toolkit/src/query/core/setupListeners.ts","../node_modules/@reduxjs/toolkit/src/query/core/buildInitiate.ts","../node_modules/@reduxjs/toolkit/src/query/core/buildThunks.ts","../node_modules/@reduxjs/toolkit/src/query/core/buildSlice.ts","../node_modules/@reduxjs/toolkit/src/query/utils/isOnline.ts","../node_modules/@reduxjs/toolkit/src/query/utils/isDocumentVisible.ts","../node_modules/@reduxjs/toolkit/src/query/core/buildSelectors.ts","../node_modules/@reduxjs/toolkit/src/query/createApi.ts","../node_modules/@reduxjs/toolkit/src/query/core/buildMiddleware/batchActions.ts","../node_modules/@reduxjs/toolkit/src/query/core/buildMiddleware/cacheCollection.ts","../node_modules/@reduxjs/toolkit/src/query/core/buildMiddleware/cacheLifecycle.ts","../node_modules/@reduxjs/toolkit/src/query/core/buildMiddleware/devMiddleware.ts","../node_modules/@reduxjs/toolkit/src/query/core/buildMiddleware/invalidationByTags.ts","../node_modules/@reduxjs/toolkit/src/query/core/buildMiddleware/polling.ts","../node_modules/@reduxjs/toolkit/src/query/core/buildMiddleware/queryLifecycle.ts","../node_modules/@reduxjs/toolkit/src/query/core/buildMiddleware/index.ts","../node_modules/@reduxjs/toolkit/src/query/core/buildMiddleware/windowEventHandling.ts","../node_modules/@reduxjs/toolkit/src/query/core/module.ts","../node_modules/@reduxjs/toolkit/src/query/utils/getOrInsert.ts","../node_modules/@reduxjs/toolkit/src/tsHelpers.ts","../node_modules/@reduxjs/toolkit/src/query/core/index.ts","../node_modules/@reduxjs/toolkit/node_modules/redux/src/utils/formatProdErrorMessage.ts","../node_modules/@reduxjs/toolkit/node_modules/redux/src/utils/symbol-observable.ts","../node_modules/@reduxjs/toolkit/node_modules/redux/src/utils/actionTypes.ts","../node_modules/@reduxjs/toolkit/node_modules/redux/src/utils/isPlainObject.ts","../node_modules/@reduxjs/toolkit/node_modules/redux/src/createStore.ts","../node_modules/@reduxjs/toolkit/node_modules/redux/src/combineReducers.ts","../node_modules/@reduxjs/toolkit/node_modules/redux/src/compose.ts","../node_modules/@reduxjs/toolkit/node_modules/redux/src/utils/isAction.ts","../node_modules/@reduxjs/toolkit/node_modules/redux-thunk/dist/redux-thunk.mjs","../node_modules/@reduxjs/toolkit/src/createDraftSafeSelector.ts","../node_modules/@reduxjs/toolkit/src/devtoolsExtension.ts","../node_modules/@reduxjs/toolkit/src/createAction.ts","../node_modules/@reduxjs/toolkit/src/utils.ts","../node_modules/@reduxjs/toolkit/src/getDefaultMiddleware.ts","../node_modules/@reduxjs/toolkit/src/autoBatchEnhancer.ts","../node_modules/@reduxjs/toolkit/src/getDefaultEnhancers.ts","../node_modules/@reduxjs/toolkit/src/configureStore.ts","../node_modules/@reduxjs/toolkit/node_modules/redux/src/applyMiddleware.ts","../node_modules/@reduxjs/toolkit/src/mapBuilders.ts","../node_modules/@reduxjs/toolkit/src/matchers.ts","../node_modules/@reduxjs/toolkit/src/nanoid.ts","../node_modules/@reduxjs/toolkit/src/createAsyncThunk.ts","../node_modules/@reduxjs/toolkit/src/createSlice.ts","../node_modules/@reduxjs/toolkit/src/createReducer.ts","../node_modules/@reduxjs/toolkit/src/listenerMiddleware/exceptions.ts","../node_modules/@reduxjs/toolkit/src/listenerMiddleware/task.ts","../node_modules/@reduxjs/toolkit/src/listenerMiddleware/index.ts","../node_modules/@reduxjs/toolkit/src/combineSlices.ts","../node_modules/@reduxjs/toolkit/src/formatProdErrorMessage.ts"],"sourcesContent":["export function capitalize(str: string) {\n return str.replace(str[0], str[0].toUpperCase());\n}","export type Id = { [K in keyof T]: T[K] } & {};\nexport type WithRequiredProp = Omit & Required>;\nexport type Override = T2 extends any ? Omit & T2 : never;\nexport function assertCast(v: any): asserts v is T {}\nexport function safeAssign(target: T, ...args: Array>>): T {\n return Object.assign(target, ...args);\n}\n\n/**\n * Convert a Union type `(A|B)` to an intersection type `(A&B)`\n */\nexport type UnionToIntersection = (U extends any ? (k: U) => void : never) extends (k: infer I) => void ? I : never;\nexport type NonOptionalKeys = { [K in keyof T]-?: undefined extends T[K] ? never : K }[keyof T];\nexport type HasRequiredProps = NonOptionalKeys extends never ? False : True;\nexport type OptionalIfAllPropsOptional = HasRequiredProps;\nexport type NoInfer = [T][T extends any ? 0 : never];\nexport type NonUndefined = T extends undefined ? never : T;\nexport type UnwrapPromise = T extends PromiseLike ? V : T;\nexport type MaybePromise = T | PromiseLike;\nexport type OmitFromUnion = T extends any ? Omit : never;\nexport type IsAny = true | false extends (T extends never ? true : false) ? True : False;\nexport type CastAny = IsAny;","import type { QueryCacheKey } from './core/apiState';\nimport type { EndpointDefinition } from './endpointDefinitions';\nimport { isPlainObject } from './core/rtkImports';\nconst cache: WeakMap | undefined = WeakMap ? new WeakMap() : undefined;\nexport const defaultSerializeQueryArgs: SerializeQueryArgs = ({\n endpointName,\n queryArgs\n}) => {\n let serialized = '';\n const cached = cache?.get(queryArgs);\n if (typeof cached === 'string') {\n serialized = cached;\n } else {\n const stringified = JSON.stringify(queryArgs, (key, value) => {\n // Handle bigints\n value = typeof value === 'bigint' ? {\n $bigint: value.toString()\n } : value;\n // Sort the object keys before stringifying, to prevent useQuery({ a: 1, b: 2 }) having a different cache key than useQuery({ b: 2, a: 1 })\n value = isPlainObject(value) ? Object.keys(value).sort().reduce((acc, key) => {\n acc[key] = (value as any)[key];\n return acc;\n }, {}) : value;\n return value;\n });\n if (isPlainObject(queryArgs)) {\n cache?.set(queryArgs, stringified);\n }\n serialized = stringified;\n }\n return `${endpointName}(${serialized})`;\n};\nexport type SerializeQueryArgs = (_: {\n queryArgs: QueryArgs;\n endpointDefinition: EndpointDefinition;\n endpointName: string;\n}) => ReturnType;\nexport type InternalSerializeQueryArgs = (_: {\n queryArgs: any;\n endpointDefinition: EndpointDefinition;\n endpointName: string;\n}) => QueryCacheKey;","export const UNINITIALIZED_VALUE = Symbol();\nexport type UninitializedValue = typeof UNINITIALIZED_VALUE;","import { useEffect, useRef, useMemo } from 'react';\nimport type { SerializeQueryArgs } from '@reduxjs/toolkit/query';\nimport type { EndpointDefinition } from '@reduxjs/toolkit/query';\nexport function useStableQueryArgs(queryArgs: T, serialize: SerializeQueryArgs, endpointDefinition: EndpointDefinition, endpointName: string) {\n const incoming = useMemo(() => ({\n queryArgs,\n serialized: typeof queryArgs == 'object' ? serialize({\n queryArgs,\n endpointDefinition,\n endpointName\n }) : queryArgs\n }), [queryArgs, serialize, endpointDefinition, endpointName]);\n const cache = useRef(incoming);\n useEffect(() => {\n if (cache.current.serialized !== incoming.serialized) {\n cache.current = incoming;\n }\n }, [incoming]);\n return cache.current.serialized === incoming.serialized ? cache.current.queryArgs : queryArgs;\n}","import { useEffect, useRef } from 'react';\nimport { shallowEqual } from 'react-redux';\nexport function useShallowStableValue(value: T) {\n const cache = useRef(value);\n useEffect(() => {\n if (!shallowEqual(cache.current, value)) {\n cache.current = value;\n }\n }, [value]);\n return shallowEqual(cache.current, value) ? cache.current : value;\n}","import { formatProdErrorMessage as _formatProdErrorMessage, formatProdErrorMessage as _formatProdErrorMessage2 } from \"@reduxjs/toolkit\";\nimport type { Selector, ThunkAction, ThunkDispatch, UnknownAction } from '@reduxjs/toolkit';\nimport type { Api, ApiContext, ApiEndpointMutation, ApiEndpointQuery, BaseQueryFn, CoreModule, EndpointDefinitions, MutationActionCreatorResult, MutationDefinition, MutationResultSelectorResult, PrefetchOptions, QueryActionCreatorResult, QueryArgFrom, QueryCacheKey, QueryDefinition, QueryKeys, QueryResultSelectorResult, QuerySubState, ResultTypeFrom, RootState, SerializeQueryArgs, SkipToken, SubscriptionOptions, TSHelpersId, TSHelpersNoInfer, TSHelpersOverride } from '@reduxjs/toolkit/query';\nimport { QueryStatus, skipToken } from '@reduxjs/toolkit/query';\nimport type { DependencyList } from 'react';\nimport { useCallback, useDebugValue, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';\nimport { shallowEqual } from 'react-redux';\nimport type { SubscriptionSelectors } from '../core';\nimport { defaultSerializeQueryArgs } from '../defaultSerializeQueryArgs';\nimport type { UninitializedValue } from './constants';\nimport { UNINITIALIZED_VALUE } from './constants';\nimport type { ReactHooksModuleOptions } from './module';\nimport { useStableQueryArgs } from './useSerializedStableValue';\nimport { useShallowStableValue } from './useShallowStableValue';\n\n// Copy-pasted from React-Redux\nconst canUseDOM = () => !!(typeof window !== 'undefined' && typeof window.document !== 'undefined' && typeof window.document.createElement !== 'undefined');\nconst isDOM = /* @__PURE__ */canUseDOM();\n\n// Under React Native, we know that we always want to use useLayoutEffect\n\nconst isRunningInReactNative = () => typeof navigator !== 'undefined' && navigator.product === 'ReactNative';\nconst isReactNative = /* @__PURE__ */isRunningInReactNative();\nconst getUseIsomorphicLayoutEffect = () => isDOM || isReactNative ? useLayoutEffect : useEffect;\nexport const useIsomorphicLayoutEffect = /* @__PURE__ */getUseIsomorphicLayoutEffect();\nexport type QueryHooks> = {\n useQuery: UseQuery;\n useLazyQuery: UseLazyQuery;\n useQuerySubscription: UseQuerySubscription;\n useLazyQuerySubscription: UseLazyQuerySubscription;\n useQueryState: UseQueryState;\n};\nexport type MutationHooks> = {\n useMutation: UseMutation;\n};\n\n/**\n * A React hook that automatically triggers fetches of data from an endpoint, 'subscribes' the component to the cached data, and reads the request status and cached data from the Redux store. The component will re-render as the loading status changes and the data becomes available.\n *\n * The query arg is used as a cache key. Changing the query arg will tell the hook to re-fetch the data if it does not exist in the cache already, and the hook will return the data for that query arg once it's available.\n *\n * This hook combines the functionality of both [`useQueryState`](#usequerystate) and [`useQuerySubscription`](#usequerysubscription) together, and is intended to be used in the majority of situations.\n *\n * #### Features\n *\n * - Automatically triggers requests to retrieve data based on the hook argument and whether cached data exists by default\n * - 'Subscribes' the component to keep cached data in the store, and 'unsubscribes' when the component unmounts\n * - Accepts polling/re-fetching options to trigger automatic re-fetches when the corresponding criteria is met\n * - Returns the latest request status and cached data from the Redux store\n * - Re-renders as the request status changes and data becomes available\n */\nexport type UseQuery> = = UseQueryStateDefaultResult>(arg: QueryArgFrom | SkipToken, options?: UseQuerySubscriptionOptions & UseQueryStateOptions) => UseQueryHookResult;\nexport type TypedUseQuery = UseQuery>;\nexport type UseQueryHookResult, R = UseQueryStateDefaultResult> = UseQueryStateResult & UseQuerySubscriptionResult;\n\n/**\n * Helper type to manually type the result\n * of the `useQuery` hook in userland code.\n */\nexport type TypedUseQueryHookResult>> = TypedUseQueryStateResult & TypedUseQuerySubscriptionResult;\ntype UseQuerySubscriptionOptions = SubscriptionOptions & {\n /**\n * Prevents a query from automatically running.\n *\n * @remarks\n * When `skip` is true (or `skipToken` is passed in as `arg`):\n *\n * - **If the query has cached data:**\n * * The cached data **will not be used** on the initial load, and will ignore updates from any identical query until the `skip` condition is removed\n * * The query will have a status of `uninitialized`\n * * If `skip: false` is set after the initial load, the cached result will be used\n * - **If the query does not have cached data:**\n * * The query will have a status of `uninitialized`\n * * The query will not exist in the state when viewed with the dev tools\n * * The query will not automatically fetch on mount\n * * The query will not automatically run when additional components with the same query are added that do run\n *\n * @example\n * ```tsx\n * // codeblock-meta no-transpile title=\"Skip example\"\n * const Pokemon = ({ name, skip }: { name: string; skip: boolean }) => {\n * const { data, error, status } = useGetPokemonByNameQuery(name, {\n * skip,\n * });\n *\n * return (\n *
\n * {name} - {status}\n *
\n * );\n * };\n * ```\n */\n skip?: boolean;\n /**\n * Defaults to `false`. This setting allows you to control whether if a cached result is already available, RTK Query will only serve a cached result, or if it should `refetch` when set to `true` or if an adequate amount of time has passed since the last successful query result.\n * - `false` - Will not cause a query to be performed _unless_ it does not exist yet.\n * - `true` - Will always refetch when a new subscriber to a query is added. Behaves the same as calling the `refetch` callback or passing `forceRefetch: true` in the action creator.\n * - `number` - **Value is in seconds**. If a number is provided and there is an existing query in the cache, it will compare the current time vs the last fulfilled timestamp, and only refetch if enough time has elapsed.\n *\n * If you specify this option alongside `skip: true`, this **will not be evaluated** until `skip` is false.\n */\n refetchOnMountOrArgChange?: boolean | number;\n};\n\n/**\n * A React hook that automatically triggers fetches of data from an endpoint, and 'subscribes' the component to the cached data.\n *\n * The query arg is used as a cache key. Changing the query arg will tell the hook to re-fetch the data if it does not exist in the cache already.\n *\n * Note that this hook does not return a request status or cached data. For that use-case, see [`useQuery`](#usequery) or [`useQueryState`](#usequerystate).\n *\n * #### Features\n *\n * - Automatically triggers requests to retrieve data based on the hook argument and whether cached data exists by default\n * - 'Subscribes' the component to keep cached data in the store, and 'unsubscribes' when the component unmounts\n * - Accepts polling/re-fetching options to trigger automatic re-fetches when the corresponding criteria is met\n */\nexport type UseQuerySubscription> = (arg: QueryArgFrom | SkipToken, options?: UseQuerySubscriptionOptions) => UseQuerySubscriptionResult;\nexport type TypedUseQuerySubscription = UseQuerySubscription>;\nexport type UseQuerySubscriptionResult> = Pick, 'refetch'>;\n\n/**\n * Helper type to manually type the result\n * of the `useQuerySubscription` hook in userland code.\n */\nexport type TypedUseQuerySubscriptionResult = UseQuerySubscriptionResult>;\nexport type UseLazyQueryLastPromiseInfo> = {\n lastArg: QueryArgFrom;\n};\n\n/**\n * A React hook similar to [`useQuery`](#usequery), but with manual control over when the data fetching occurs.\n *\n * This hook includes the functionality of [`useLazyQuerySubscription`](#uselazyquerysubscription).\n *\n * #### Features\n *\n * - Manual control over firing a request to retrieve data\n * - 'Subscribes' the component to keep cached data in the store, and 'unsubscribes' when the component unmounts\n * - Returns the latest request status and cached data from the Redux store\n * - Re-renders as the request status changes and data becomes available\n * - Accepts polling/re-fetching options to trigger automatic re-fetches when the corresponding criteria is met and the fetch has been manually called at least once\n *\n * #### Note\n *\n * When the trigger function returned from a LazyQuery is called, it always initiates a new request to the server even if there is cached data. Set `preferCacheValue`(the second argument to the function) as `true` if you want it to immediately return a cached value if one exists.\n */\nexport type UseLazyQuery> = = UseQueryStateDefaultResult>(options?: SubscriptionOptions & Omit, 'skip'>) => [LazyQueryTrigger, UseLazyQueryStateResult, UseLazyQueryLastPromiseInfo];\nexport type TypedUseLazyQuery = UseLazyQuery>;\nexport type UseLazyQueryStateResult, R = UseQueryStateDefaultResult> = UseQueryStateResult & {\n /**\n * Resets the hook state to its initial `uninitialized` state.\n * This will also remove the last result from the cache.\n */\n reset: () => void;\n};\n\n/**\n * Helper type to manually type the result\n * of the `useLazyQuery` hook in userland code.\n */\nexport type TypedUseLazyQueryStateResult>> = UseLazyQueryStateResult, R>;\nexport type LazyQueryTrigger> = {\n /**\n * Triggers a lazy query.\n *\n * By default, this will start a new request even if there is already a value in the cache.\n * If you want to use the cache value and only start a request if there is no cache value, set the second argument to `true`.\n *\n * @remarks\n * If you need to access the error or success payload immediately after a lazy query, you can chain .unwrap().\n *\n * @example\n * ```ts\n * // codeblock-meta title=\"Using .unwrap with async await\"\n * try {\n * const payload = await getUserById(1).unwrap();\n * console.log('fulfilled', payload)\n * } catch (error) {\n * console.error('rejected', error);\n * }\n * ```\n */\n (arg: QueryArgFrom, preferCacheValue?: boolean): QueryActionCreatorResult;\n};\nexport type TypedLazyQueryTrigger = LazyQueryTrigger>;\n\n/**\n * A React hook similar to [`useQuerySubscription`](#usequerysubscription), but with manual control over when the data fetching occurs.\n *\n * Note that this hook does not return a request status or cached data. For that use-case, see [`useLazyQuery`](#uselazyquery).\n *\n * #### Features\n *\n * - Manual control over firing a request to retrieve data\n * - 'Subscribes' the component to keep cached data in the store, and 'unsubscribes' when the component unmounts\n * - Accepts polling/re-fetching options to trigger automatic re-fetches when the corresponding criteria is met and the fetch has been manually called at least once\n */\nexport type UseLazyQuerySubscription> = (options?: SubscriptionOptions) => readonly [LazyQueryTrigger, QueryArgFrom | UninitializedValue, {\n reset: () => void;\n}];\nexport type TypedUseLazyQuerySubscription = UseLazyQuerySubscription>;\n\n/**\n * @internal\n */\nexport type QueryStateSelector, D extends QueryDefinition> = (state: UseQueryStateDefaultResult) => R;\n\n/**\n * Provides a way to define a strongly-typed version of\n * {@linkcode QueryStateSelector} for use with a specific query.\n * This is useful for scenarios where you want to create a \"pre-typed\"\n * {@linkcode UseQueryStateOptions.selectFromResult | selectFromResult}\n * function.\n *\n * @example\n * #### __Create a strongly-typed `selectFromResult` selector function__\n *\n * ```tsx\n * import type { TypedQueryStateSelector } from '@reduxjs/toolkit/query/react'\n * import { createApi, fetchBaseQuery } from '@reduxjs/toolkit/query/react'\n *\n * type Post = {\n * id: number\n * title: string\n * }\n *\n * type PostsApiResponse = {\n * posts: Post[]\n * total: number\n * skip: number\n * limit: number\n * }\n *\n * type QueryArgument = number | undefined\n *\n * type BaseQueryFunction = ReturnType\n *\n * type SelectedResult = Pick\n *\n * const postsApiSlice = createApi({\n * baseQuery: fetchBaseQuery({ baseUrl: 'https://dummyjson.com/posts' }),\n * reducerPath: 'postsApi',\n * tagTypes: ['Posts'],\n * endpoints: (build) => ({\n * getPosts: build.query({\n * query: (limit = 5) => `?limit=${limit}&select=title`,\n * }),\n * }),\n * })\n *\n * const { useGetPostsQuery } = postsApiSlice\n *\n * function PostById({ id }: { id: number }) {\n * const { post } = useGetPostsQuery(undefined, {\n * selectFromResult: (state) => ({\n * post: state.data?.posts.find((post) => post.id === id),\n * }),\n * })\n *\n * return
  • {post?.title}
  • \n * }\n *\n * const EMPTY_ARRAY: Post[] = []\n *\n * const typedSelectFromResult: TypedQueryStateSelector<\n * PostsApiResponse,\n * QueryArgument,\n * BaseQueryFunction,\n * SelectedResult\n * > = (state) => ({ posts: state.data?.posts ?? EMPTY_ARRAY })\n *\n * function PostsList() {\n * const { posts } = useGetPostsQuery(undefined, {\n * selectFromResult: typedSelectFromResult,\n * })\n *\n * return (\n *
    \n *
      \n * {posts.map((post) => (\n * \n * ))}\n *
    \n *
    \n * )\n * }\n * ```\n *\n * @template ResultType - The type of the result `data` returned by the query.\n * @template QueryArgumentType - The type of the argument passed into the query.\n * @template BaseQueryFunctionType - The type of the base query function being used.\n * @template SelectedResultType - The type of the selected result returned by the __`selectFromResult`__ function.\n *\n * @since 2.3.0\n * @public\n */\nexport type TypedQueryStateSelector = UseQueryStateDefaultResult>> = QueryStateSelector>;\n\n/**\n * A React hook that reads the request status and cached data from the Redux store. The component will re-render as the loading status changes and the data becomes available.\n *\n * Note that this hook does not trigger fetching new data. For that use-case, see [`useQuery`](#usequery) or [`useQuerySubscription`](#usequerysubscription).\n *\n * #### Features\n *\n * - Returns the latest request status and cached data from the Redux store\n * - Re-renders as the request status changes and data becomes available\n */\nexport type UseQueryState> = = UseQueryStateDefaultResult>(arg: QueryArgFrom | SkipToken, options?: UseQueryStateOptions) => UseQueryStateResult;\nexport type TypedUseQueryState = UseQueryState>;\n\n/**\n * @internal\n */\nexport type UseQueryStateOptions, R extends Record> = {\n /**\n * Prevents a query from automatically running.\n *\n * @remarks\n * When skip is true:\n *\n * - **If the query has cached data:**\n * * The cached data **will not be used** on the initial load, and will ignore updates from any identical query until the `skip` condition is removed\n * * The query will have a status of `uninitialized`\n * * If `skip: false` is set after skipping the initial load, the cached result will be used\n * - **If the query does not have cached data:**\n * * The query will have a status of `uninitialized`\n * * The query will not exist in the state when viewed with the dev tools\n * * The query will not automatically fetch on mount\n * * The query will not automatically run when additional components with the same query are added that do run\n *\n * @example\n * ```ts\n * // codeblock-meta title=\"Skip example\"\n * const Pokemon = ({ name, skip }: { name: string; skip: boolean }) => {\n * const { data, error, status } = useGetPokemonByNameQuery(name, {\n * skip,\n * });\n *\n * return (\n *
    \n * {name} - {status}\n *
    \n * );\n * };\n * ```\n */\n skip?: boolean;\n /**\n * `selectFromResult` allows you to get a specific segment from a query result in a performant manner.\n * When using this feature, the component will not rerender unless the underlying data of the selected item has changed.\n * If the selected item is one element in a larger collection, it will disregard changes to elements in the same collection.\n *\n * @example\n * ```ts\n * // codeblock-meta title=\"Using selectFromResult to extract a single result\"\n * function PostsList() {\n * const { data: posts } = api.useGetPostsQuery();\n *\n * return (\n *
      \n * {posts?.data?.map((post) => (\n * \n * ))}\n *
    \n * );\n * }\n *\n * function PostById({ id }: { id: number }) {\n * // Will select the post with the given id, and will only rerender if the given posts data changes\n * const { post } = api.useGetPostsQuery(undefined, {\n * selectFromResult: ({ data }) => ({ post: data?.find((post) => post.id === id) }),\n * });\n *\n * return
  • {post?.name}
  • ;\n * }\n * ```\n */\n selectFromResult?: QueryStateSelector;\n};\n\n/**\n * Provides a way to define a \"pre-typed\" version of\n * {@linkcode UseQueryStateOptions} with specific options for a given query.\n * This is particularly useful for setting default query behaviors such as\n * refetching strategies, which can be overridden as needed.\n *\n * @example\n * #### __Create a `useQuery` hook with default options__\n *\n * ```ts\n * import type {\n * SubscriptionOptions,\n * TypedUseQueryStateOptions,\n * } from '@reduxjs/toolkit/query/react'\n * import { createApi, fetchBaseQuery } from '@reduxjs/toolkit/query/react'\n *\n * type Post = {\n * id: number\n * name: string\n * }\n *\n * const api = createApi({\n * baseQuery: fetchBaseQuery({ baseUrl: '/' }),\n * tagTypes: ['Post'],\n * endpoints: (build) => ({\n * getPosts: build.query({\n * query: () => 'posts',\n * }),\n * }),\n * })\n *\n * const { useGetPostsQuery } = api\n *\n * export const useGetPostsQueryWithDefaults = <\n * SelectedResult extends Record,\n * >(\n * overrideOptions: TypedUseQueryStateOptions<\n * Post[],\n * void,\n * ReturnType,\n * SelectedResult\n * > &\n * SubscriptionOptions,\n * ) =>\n * useGetPostsQuery(undefined, {\n * // Insert default options here\n *\n * refetchOnMountOrArgChange: true,\n * refetchOnFocus: true,\n * ...overrideOptions,\n * })\n * ```\n *\n * @template ResultType - The type of the result `data` returned by the query.\n * @template QueryArg - The type of the argument passed into the query.\n * @template BaseQuery - The type of the base query function being used.\n * @template SelectedResult - The type of the selected result returned by the __`selectFromResult`__ function.\n *\n * @since 2.2.8\n * @public\n */\nexport type TypedUseQueryStateOptions = UseQueryStateDefaultResult>> = UseQueryStateOptions, SelectedResult>;\nexport type UseQueryStateResult<_ extends QueryDefinition, R> = TSHelpersNoInfer;\n\n/**\n * Helper type to manually type the result\n * of the `useQueryState` hook in userland code.\n */\nexport type TypedUseQueryStateResult>> = TSHelpersNoInfer;\ntype UseQueryStateBaseResult> = QuerySubState & {\n /**\n * Where `data` tries to hold data as much as possible, also re-using\n * data from the last arguments passed into the hook, this property\n * will always contain the received data from the query, for the current query arguments.\n */\n currentData?: ResultTypeFrom;\n /**\n * Query has not started yet.\n */\n isUninitialized: false;\n /**\n * Query is currently loading for the first time. No data yet.\n */\n isLoading: false;\n /**\n * Query is currently fetching, but might have data from an earlier request.\n */\n isFetching: false;\n /**\n * Query has data from a successful load.\n */\n isSuccess: false;\n /**\n * Query is currently in \"error\" state.\n */\n isError: false;\n};\ntype UseQueryStateDefaultResult> = TSHelpersId, {\n status: QueryStatus.uninitialized;\n}>, {\n isUninitialized: true;\n}> | TSHelpersOverride, {\n isLoading: true;\n isFetching: boolean;\n data: undefined;\n} | ({\n isSuccess: true;\n isFetching: true;\n error: undefined;\n} & Required, 'data' | 'fulfilledTimeStamp'>>) | ({\n isSuccess: true;\n isFetching: false;\n error: undefined;\n} & Required, 'data' | 'fulfilledTimeStamp' | 'currentData'>>) | ({\n isError: true;\n} & Required, 'error'>>)>> & {\n /**\n * @deprecated Included for completeness, but discouraged.\n * Please use the `isLoading`, `isFetching`, `isSuccess`, `isError`\n * and `isUninitialized` flags instead\n */\n status: QueryStatus;\n};\nexport type MutationStateSelector, D extends MutationDefinition> = (state: MutationResultSelectorResult) => R;\nexport type UseMutationStateOptions, R extends Record> = {\n selectFromResult?: MutationStateSelector;\n fixedCacheKey?: string;\n};\nexport type UseMutationStateResult, R> = TSHelpersNoInfer & {\n originalArgs?: QueryArgFrom;\n /**\n * Resets the hook state to its initial `uninitialized` state.\n * This will also remove the last result from the cache.\n */\n reset: () => void;\n};\n\n/**\n * Helper type to manually type the result\n * of the `useMutation` hook in userland code.\n */\nexport type TypedUseMutationResult>> = UseMutationStateResult, R>;\n\n/**\n * A React hook that lets you trigger an update request for a given endpoint, and subscribes the component to read the request status from the Redux store. The component will re-render as the loading status changes.\n *\n * #### Features\n *\n * - Manual control over firing a request to alter data on the server or possibly invalidate the cache\n * - 'Subscribes' the component to keep cached data in the store, and 'unsubscribes' when the component unmounts\n * - Returns the latest request status and cached data from the Redux store\n * - Re-renders as the request status changes and data becomes available\n */\nexport type UseMutation> = = MutationResultSelectorResult>(options?: UseMutationStateOptions) => readonly [MutationTrigger, UseMutationStateResult];\nexport type TypedUseMutation = UseMutation>;\nexport type MutationTrigger> = {\n /**\n * Triggers the mutation and returns a Promise.\n * @remarks\n * If you need to access the error or success payload immediately after a mutation, you can chain .unwrap().\n *\n * @example\n * ```ts\n * // codeblock-meta title=\"Using .unwrap with async await\"\n * try {\n * const payload = await addPost({ id: 1, name: 'Example' }).unwrap();\n * console.log('fulfilled', payload)\n * } catch (error) {\n * console.error('rejected', error);\n * }\n * ```\n */\n (arg: QueryArgFrom): MutationActionCreatorResult;\n};\nexport type TypedMutationTrigger = MutationTrigger>;\n\n/**\n * Wrapper around `defaultQueryStateSelector` to be used in `useQuery`.\n * We want the initial render to already come back with\n * `{ isUninitialized: false, isFetching: true, isLoading: true }`\n * to prevent that the library user has to do an additional check for `isUninitialized`/\n */\nconst noPendingQueryStateSelector: QueryStateSelector = selected => {\n if (selected.isUninitialized) {\n return {\n ...selected,\n isUninitialized: false,\n isFetching: true,\n isLoading: selected.data !== undefined ? false : true,\n status: QueryStatus.pending\n } as any;\n }\n return selected;\n};\ntype GenericPrefetchThunk = (endpointName: any, arg: any, options: PrefetchOptions) => ThunkAction;\n\n/**\n *\n * @param opts.api - An API with defined endpoints to create hooks for\n * @param opts.moduleOptions.batch - The version of the `batchedUpdates` function to be used\n * @param opts.moduleOptions.useDispatch - The version of the `useDispatch` hook to be used\n * @param opts.moduleOptions.useSelector - The version of the `useSelector` hook to be used\n * @returns An object containing functions to generate hooks based on an endpoint\n */\nexport function buildHooks({\n api,\n moduleOptions: {\n batch,\n hooks: {\n useDispatch,\n useSelector,\n useStore\n },\n unstable__sideEffectsInRender,\n createSelector\n },\n serializeQueryArgs,\n context\n}: {\n api: Api;\n moduleOptions: Required;\n serializeQueryArgs: SerializeQueryArgs;\n context: ApiContext;\n}) {\n const usePossiblyImmediateEffect: (effect: () => void | undefined, deps?: DependencyList) => void = unstable__sideEffectsInRender ? cb => cb() : useEffect;\n return {\n buildQueryHooks,\n buildMutationHook,\n usePrefetch\n };\n function queryStatePreSelector(currentState: QueryResultSelectorResult, lastResult: UseQueryStateDefaultResult | undefined, queryArgs: any): UseQueryStateDefaultResult {\n // if we had a last result and the current result is uninitialized,\n // we might have called `api.util.resetApiState`\n // in this case, reset the hook\n if (lastResult?.endpointName && currentState.isUninitialized) {\n const {\n endpointName\n } = lastResult;\n const endpointDefinition = context.endpointDefinitions[endpointName];\n if (queryArgs !== skipToken && serializeQueryArgs({\n queryArgs: lastResult.originalArgs,\n endpointDefinition,\n endpointName\n }) === serializeQueryArgs({\n queryArgs,\n endpointDefinition,\n endpointName\n })) lastResult = undefined;\n }\n\n // data is the last known good request result we have tracked - or if none has been tracked yet the last good result for the current args\n let data = currentState.isSuccess ? currentState.data : lastResult?.data;\n if (data === undefined) data = currentState.data;\n const hasData = data !== undefined;\n\n // isFetching = true any time a request is in flight\n const isFetching = currentState.isLoading;\n\n // isLoading = true only when loading while no data is present yet (initial load with no data in the cache)\n const isLoading = (!lastResult || lastResult.isLoading || lastResult.isUninitialized) && !hasData && isFetching;\n\n // isSuccess = true when data is present and we're not refetching after an error.\n // That includes cases where the _current_ item is either actively\n // fetching or about to fetch due to an uninitialized entry.\n const isSuccess = currentState.isSuccess || hasData && (isFetching && !lastResult?.isError || currentState.isUninitialized);\n return {\n ...currentState,\n data,\n currentData: currentState.data,\n isFetching,\n isLoading,\n isSuccess\n } as UseQueryStateDefaultResult;\n }\n function usePrefetch>(endpointName: EndpointName, defaultOptions?: PrefetchOptions) {\n const dispatch = useDispatch>();\n const stableDefaultOptions = useShallowStableValue(defaultOptions);\n return useCallback((arg: any, options?: PrefetchOptions) => dispatch((api.util.prefetch as GenericPrefetchThunk)(endpointName, arg, {\n ...stableDefaultOptions,\n ...options\n })), [endpointName, dispatch, stableDefaultOptions]);\n }\n function buildQueryHooks(name: string): QueryHooks {\n const useQuerySubscription: UseQuerySubscription = (arg: any, {\n refetchOnReconnect,\n refetchOnFocus,\n refetchOnMountOrArgChange,\n skip = false,\n pollingInterval = 0,\n skipPollingIfUnfocused = false\n } = {}) => {\n const {\n initiate\n } = api.endpoints[name] as ApiEndpointQuery, Definitions>;\n const dispatch = useDispatch>();\n\n // TODO: Change this to `useRef(undefined)` after upgrading to React 19.\n /**\n * @todo Change this to `useRef(undefined)` after upgrading to React 19.\n */\n const subscriptionSelectorsRef = useRef(undefined);\n if (!subscriptionSelectorsRef.current) {\n const returnedValue = dispatch(api.internalActions.internal_getRTKQSubscriptions());\n if (process.env.NODE_ENV !== 'production') {\n if (typeof returnedValue !== 'object' || typeof returnedValue?.type === 'string') {\n throw new Error(process.env.NODE_ENV === \"production\" ? _formatProdErrorMessage(37) : `Warning: Middleware for RTK-Query API at reducerPath \"${api.reducerPath}\" has not been added to the store.\n You must add the middleware for RTK-Query to function correctly!`);\n }\n }\n subscriptionSelectorsRef.current = returnedValue as unknown as SubscriptionSelectors;\n }\n const stableArg = useStableQueryArgs(skip ? skipToken : arg,\n // Even if the user provided a per-endpoint `serializeQueryArgs` with\n // a consistent return value, _here_ we want to use the default behavior\n // so we can tell if _anything_ actually changed. Otherwise, we can end up\n // with a case where the query args did change but the serialization doesn't,\n // and then we never try to initiate a refetch.\n defaultSerializeQueryArgs, context.endpointDefinitions[name], name);\n const stableSubscriptionOptions = useShallowStableValue({\n refetchOnReconnect,\n refetchOnFocus,\n pollingInterval,\n skipPollingIfUnfocused\n });\n const lastRenderHadSubscription = useRef(false);\n\n // TODO: Change this to `useRef>(undefined)` after upgrading to React 19.\n /**\n * @todo Change this to `useRef>(undefined)` after upgrading to React 19.\n */\n const promiseRef = useRef | undefined>(undefined);\n let {\n queryCacheKey,\n requestId\n } = promiseRef.current || {};\n\n // HACK We've saved the middleware subscription lookup callbacks into a ref,\n // so we can directly check here if the subscription exists for this query.\n let currentRenderHasSubscription = false;\n if (queryCacheKey && requestId) {\n currentRenderHasSubscription = subscriptionSelectorsRef.current.isRequestSubscribed(queryCacheKey, requestId);\n }\n const subscriptionRemoved = !currentRenderHasSubscription && lastRenderHadSubscription.current;\n usePossiblyImmediateEffect(() => {\n lastRenderHadSubscription.current = currentRenderHasSubscription;\n });\n usePossiblyImmediateEffect((): void | undefined => {\n if (subscriptionRemoved) {\n promiseRef.current = undefined;\n }\n }, [subscriptionRemoved]);\n usePossiblyImmediateEffect((): void | undefined => {\n const lastPromise = promiseRef.current;\n if (typeof process !== 'undefined' && process.env.NODE_ENV === 'removeMeOnCompilation') {\n // this is only present to enforce the rule of hooks to keep `isSubscribed` in the dependency array\n console.log(subscriptionRemoved);\n }\n if (stableArg === skipToken) {\n lastPromise?.unsubscribe();\n promiseRef.current = undefined;\n return;\n }\n const lastSubscriptionOptions = promiseRef.current?.subscriptionOptions;\n if (!lastPromise || lastPromise.arg !== stableArg) {\n lastPromise?.unsubscribe();\n const promise = dispatch(initiate(stableArg, {\n subscriptionOptions: stableSubscriptionOptions,\n forceRefetch: refetchOnMountOrArgChange\n }));\n promiseRef.current = promise;\n } else if (stableSubscriptionOptions !== lastSubscriptionOptions) {\n lastPromise.updateSubscriptionOptions(stableSubscriptionOptions);\n }\n }, [dispatch, initiate, refetchOnMountOrArgChange, stableArg, stableSubscriptionOptions, subscriptionRemoved]);\n useEffect(() => {\n return () => {\n promiseRef.current?.unsubscribe();\n promiseRef.current = undefined;\n };\n }, []);\n return useMemo(() => ({\n /**\n * A method to manually refetch data for the query\n */\n refetch: () => {\n if (!promiseRef.current) throw new Error(process.env.NODE_ENV === \"production\" ? _formatProdErrorMessage2(38) : 'Cannot refetch a query that has not been started yet.');\n return promiseRef.current?.refetch();\n }\n }), []);\n };\n const useLazyQuerySubscription: UseLazyQuerySubscription = ({\n refetchOnReconnect,\n refetchOnFocus,\n pollingInterval = 0,\n skipPollingIfUnfocused = false\n } = {}) => {\n const {\n initiate\n } = api.endpoints[name] as ApiEndpointQuery, Definitions>;\n const dispatch = useDispatch>();\n const [arg, setArg] = useState(UNINITIALIZED_VALUE);\n\n // TODO: Change this to `useRef>(undefined)` after upgrading to React 19.\n /**\n * @todo Change this to `useRef>(undefined)` after upgrading to React 19.\n */\n const promiseRef = useRef | undefined>(undefined);\n const stableSubscriptionOptions = useShallowStableValue({\n refetchOnReconnect,\n refetchOnFocus,\n pollingInterval,\n skipPollingIfUnfocused\n });\n usePossiblyImmediateEffect(() => {\n const lastSubscriptionOptions = promiseRef.current?.subscriptionOptions;\n if (stableSubscriptionOptions !== lastSubscriptionOptions) {\n promiseRef.current?.updateSubscriptionOptions(stableSubscriptionOptions);\n }\n }, [stableSubscriptionOptions]);\n const subscriptionOptionsRef = useRef(stableSubscriptionOptions);\n usePossiblyImmediateEffect(() => {\n subscriptionOptionsRef.current = stableSubscriptionOptions;\n }, [stableSubscriptionOptions]);\n const trigger = useCallback(function (arg: any, preferCacheValue = false) {\n let promise: QueryActionCreatorResult;\n batch(() => {\n promiseRef.current?.unsubscribe();\n promiseRef.current = promise = dispatch(initiate(arg, {\n subscriptionOptions: subscriptionOptionsRef.current,\n forceRefetch: !preferCacheValue\n }));\n setArg(arg);\n });\n return promise!;\n }, [dispatch, initiate]);\n const reset = useCallback(() => {\n if (promiseRef.current?.queryCacheKey) {\n dispatch(api.internalActions.removeQueryResult({\n queryCacheKey: promiseRef.current?.queryCacheKey as QueryCacheKey\n }));\n }\n }, [dispatch]);\n\n /* cleanup on unmount */\n useEffect(() => {\n return () => {\n promiseRef?.current?.unsubscribe();\n };\n }, []);\n\n /* if \"cleanup on unmount\" was triggered from a fast refresh, we want to reinstate the query */\n useEffect(() => {\n if (arg !== UNINITIALIZED_VALUE && !promiseRef.current) {\n trigger(arg, true);\n }\n }, [arg, trigger]);\n return useMemo(() => [trigger, arg, {\n reset\n }] as const, [trigger, arg, reset]);\n };\n const useQueryState: UseQueryState = (arg: any, {\n skip = false,\n selectFromResult\n } = {}) => {\n const {\n select\n } = api.endpoints[name] as ApiEndpointQuery, Definitions>;\n const stableArg = useStableQueryArgs(skip ? skipToken : arg, serializeQueryArgs, context.endpointDefinitions[name], name);\n type ApiRootState = Parameters>[0];\n const lastValue = useRef(undefined);\n const selectDefaultResult: Selector = useMemo(() => createSelector([select(stableArg), (_: ApiRootState, lastResult: any) => lastResult, (_: ApiRootState) => stableArg], queryStatePreSelector, {\n memoizeOptions: {\n resultEqualityCheck: shallowEqual\n }\n }), [select, stableArg]);\n const querySelector: Selector = useMemo(() => selectFromResult ? createSelector([selectDefaultResult], selectFromResult, {\n devModeChecks: {\n identityFunctionCheck: 'never'\n }\n }) : selectDefaultResult, [selectDefaultResult, selectFromResult]);\n const currentState = useSelector((state: RootState) => querySelector(state, lastValue.current), shallowEqual);\n const store = useStore>();\n const newLastValue = selectDefaultResult(store.getState(), lastValue.current);\n useIsomorphicLayoutEffect(() => {\n lastValue.current = newLastValue;\n }, [newLastValue]);\n return currentState;\n };\n return {\n useQueryState,\n useQuerySubscription,\n useLazyQuerySubscription,\n useLazyQuery(options) {\n const [trigger, arg, {\n reset\n }] = useLazyQuerySubscription(options);\n const queryStateResults = useQueryState(arg, {\n ...options,\n skip: arg === UNINITIALIZED_VALUE\n });\n const info = useMemo(() => ({\n lastArg: arg\n }), [arg]);\n return useMemo(() => [trigger, {\n ...queryStateResults,\n reset\n }, info], [trigger, queryStateResults, reset, info]);\n },\n useQuery(arg, options) {\n const querySubscriptionResults = useQuerySubscription(arg, options);\n const queryStateResults = useQueryState(arg, {\n selectFromResult: arg === skipToken || options?.skip ? undefined : noPendingQueryStateSelector,\n ...options\n });\n const {\n data,\n status,\n isLoading,\n isSuccess,\n isError,\n error\n } = queryStateResults;\n useDebugValue({\n data,\n status,\n isLoading,\n isSuccess,\n isError,\n error\n });\n return useMemo(() => ({\n ...queryStateResults,\n ...querySubscriptionResults\n }), [queryStateResults, querySubscriptionResults]);\n }\n };\n }\n function buildMutationHook(name: string): UseMutation {\n return ({\n selectFromResult,\n fixedCacheKey\n } = {}) => {\n const {\n select,\n initiate\n } = api.endpoints[name] as ApiEndpointMutation, Definitions>;\n const dispatch = useDispatch>();\n const [promise, setPromise] = useState>();\n useEffect(() => () => {\n if (!promise?.arg.fixedCacheKey) {\n promise?.reset();\n }\n }, [promise]);\n const triggerMutation = useCallback(function (arg: Parameters['0']) {\n const promise = dispatch(initiate(arg, {\n fixedCacheKey\n }));\n setPromise(promise);\n return promise;\n }, [dispatch, initiate, fixedCacheKey]);\n const {\n requestId\n } = promise || {};\n const selectDefaultResult = useMemo(() => select({\n fixedCacheKey,\n requestId: promise?.requestId\n }), [fixedCacheKey, promise, select]);\n const mutationSelector = useMemo((): Selector, any> => selectFromResult ? createSelector([selectDefaultResult], selectFromResult) : selectDefaultResult, [selectFromResult, selectDefaultResult]);\n const currentState = useSelector(mutationSelector, shallowEqual);\n const originalArgs = fixedCacheKey == null ? promise?.arg.originalArgs : undefined;\n const reset = useCallback(() => {\n batch(() => {\n if (promise) {\n setPromise(undefined);\n }\n if (fixedCacheKey) {\n dispatch(api.internalActions.removeMutationResult({\n requestId,\n fixedCacheKey\n }));\n }\n });\n }, [dispatch, fixedCacheKey, promise, requestId]);\n const {\n endpointName,\n data,\n status,\n isLoading,\n isSuccess,\n isError,\n error\n } = currentState;\n useDebugValue({\n endpointName,\n data,\n status,\n isLoading,\n isSuccess,\n isError,\n error\n });\n const finalState = useMemo(() => ({\n ...currentState,\n originalArgs,\n reset\n }), [currentState, originalArgs, reset]);\n return useMemo(() => [triggerMutation, finalState] as const, [triggerMutation, finalState]);\n };\n }\n}","import { formatProdErrorMessage as _formatProdErrorMessage } from \"@reduxjs/toolkit\";\nimport type { Api, BaseQueryFn, EndpointDefinitions, Module, MutationDefinition, PrefetchOptions, QueryArgFrom, QueryDefinition, QueryKeys } from '@reduxjs/toolkit/query';\nimport { batch as rrBatch, useDispatch as rrUseDispatch, useSelector as rrUseSelector, useStore as rrUseStore } from 'react-redux';\nimport { createSelector as _createSelector } from 'reselect';\nimport { isMutationDefinition, isQueryDefinition } from '../endpointDefinitions';\nimport { safeAssign } from '../tsHelpers';\nimport { capitalize, countObjectKeys } from '../utils';\nimport type { MutationHooks, QueryHooks } from './buildHooks';\nimport { buildHooks } from './buildHooks';\nimport type { HooksWithUniqueNames } from './namedHooks';\nexport const reactHooksModuleName = /* @__PURE__ */Symbol();\nexport type ReactHooksModule = typeof reactHooksModuleName;\ndeclare module '@reduxjs/toolkit/query' {\n export interface ApiModules<\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n BaseQuery extends BaseQueryFn, Definitions extends EndpointDefinitions,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n ReducerPath extends string,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n TagTypes extends string> {\n [reactHooksModuleName]: {\n /**\n * Endpoints based on the input endpoints provided to `createApi`, containing `select`, `hooks` and `action matchers`.\n */\n endpoints: { [K in keyof Definitions]: Definitions[K] extends QueryDefinition ? QueryHooks : Definitions[K] extends MutationDefinition ? MutationHooks : never };\n /**\n * A hook that accepts a string endpoint name, and provides a callback that when called, pre-fetches the data for that endpoint.\n */\n usePrefetch>(endpointName: EndpointName, options?: PrefetchOptions): (arg: QueryArgFrom, options?: PrefetchOptions) => void;\n } & HooksWithUniqueNames;\n }\n}\ntype RR = typeof import('react-redux');\nexport interface ReactHooksModuleOptions {\n /**\n * The hooks from React Redux to be used\n */\n hooks?: {\n /**\n * The version of the `useDispatch` hook to be used\n */\n useDispatch: RR['useDispatch'];\n /**\n * The version of the `useSelector` hook to be used\n */\n useSelector: RR['useSelector'];\n /**\n * The version of the `useStore` hook to be used\n */\n useStore: RR['useStore'];\n };\n /**\n * The version of the `batchedUpdates` function to be used\n */\n batch?: RR['batch'];\n /**\n * Enables performing asynchronous tasks immediately within a render.\n *\n * @example\n *\n * ```ts\n * import {\n * buildCreateApi,\n * coreModule,\n * reactHooksModule\n * } from '@reduxjs/toolkit/query/react'\n *\n * const createApi = buildCreateApi(\n * coreModule(),\n * reactHooksModule({ unstable__sideEffectsInRender: true })\n * )\n * ```\n */\n unstable__sideEffectsInRender?: boolean;\n /**\n * A selector creator (usually from `reselect`, or matching the same signature)\n */\n createSelector?: typeof _createSelector;\n}\n\n/**\n * Creates a module that generates react hooks from endpoints, for use with `buildCreateApi`.\n *\n * @example\n * ```ts\n * const MyContext = React.createContext(null);\n * const customCreateApi = buildCreateApi(\n * coreModule(),\n * reactHooksModule({\n * hooks: {\n * useDispatch: createDispatchHook(MyContext),\n * useSelector: createSelectorHook(MyContext),\n * useStore: createStoreHook(MyContext)\n * }\n * })\n * );\n * ```\n *\n * @returns A module for use with `buildCreateApi`\n */\nexport const reactHooksModule = ({\n batch = rrBatch,\n hooks = {\n useDispatch: rrUseDispatch,\n useSelector: rrUseSelector,\n useStore: rrUseStore\n },\n createSelector = _createSelector,\n unstable__sideEffectsInRender = false,\n ...rest\n}: ReactHooksModuleOptions = {}): Module => {\n if (process.env.NODE_ENV !== 'production') {\n const hookNames = ['useDispatch', 'useSelector', 'useStore'] as const;\n let warned = false;\n for (const hookName of hookNames) {\n // warn for old hook options\n if (countObjectKeys(rest) > 0) {\n if ((rest as Partial)[hookName]) {\n if (!warned) {\n console.warn('As of RTK 2.0, the hooks now need to be specified as one object, provided under a `hooks` key:' + '\\n`reactHooksModule({ hooks: { useDispatch, useSelector, useStore } })`');\n warned = true;\n }\n }\n // migrate\n // @ts-ignore\n hooks[hookName] = rest[hookName];\n }\n // then make sure we have them all\n if (typeof hooks[hookName] !== 'function') {\n throw new Error(process.env.NODE_ENV === \"production\" ? _formatProdErrorMessage(36) : `When using custom hooks for context, all ${hookNames.length} hooks need to be provided: ${hookNames.join(', ')}.\\nHook ${hookName} was either not provided or not a function.`);\n }\n }\n }\n return {\n name: reactHooksModuleName,\n init(api, {\n serializeQueryArgs\n }, context) {\n const anyApi = api as any as Api, any, any, ReactHooksModule>;\n const {\n buildQueryHooks,\n buildMutationHook,\n usePrefetch\n } = buildHooks({\n api,\n moduleOptions: {\n batch,\n hooks,\n unstable__sideEffectsInRender,\n createSelector\n },\n serializeQueryArgs,\n context\n });\n safeAssign(anyApi, {\n usePrefetch\n });\n safeAssign(context, {\n batch\n });\n return {\n injectEndpoint(endpointName, definition) {\n if (isQueryDefinition(definition)) {\n const {\n useQuery,\n useLazyQuery,\n useLazyQuerySubscription,\n useQueryState,\n useQuerySubscription\n } = buildQueryHooks(endpointName);\n safeAssign(anyApi.endpoints[endpointName], {\n useQuery,\n useLazyQuery,\n useLazyQuerySubscription,\n useQueryState,\n useQuerySubscription\n });\n (api as any)[`use${capitalize(endpointName)}Query`] = useQuery;\n (api as any)[`useLazy${capitalize(endpointName)}Query`] = useLazyQuery;\n } else if (isMutationDefinition(definition)) {\n const useMutation = buildMutationHook(endpointName);\n safeAssign(anyApi.endpoints[endpointName], {\n useMutation\n });\n (api as any)[`use${capitalize(endpointName)}Mutation`] = useMutation;\n }\n }\n };\n }\n };\n};","// This must remain here so that the `mangleErrors.cjs` build script\n// does not have to import this into each source file it rewrites.\nimport { formatProdErrorMessage } from '@reduxjs/toolkit';\nimport { buildCreateApi, coreModule } from '@reduxjs/toolkit/query';\nimport { reactHooksModule, reactHooksModuleName } from './module';\nexport * from '@reduxjs/toolkit/query';\nexport { ApiProvider } from './ApiProvider';\nconst createApi = /* @__PURE__ */buildCreateApi(coreModule(), reactHooksModule());\nexport type { TypedUseMutationResult, TypedUseQueryHookResult, TypedUseQueryStateResult, TypedUseQuerySubscriptionResult, TypedLazyQueryTrigger, TypedUseLazyQuery, TypedUseMutation, TypedMutationTrigger, TypedQueryStateSelector, TypedUseQueryState, TypedUseQuery, TypedUseQuerySubscription, TypedUseLazyQuerySubscription, TypedUseQueryStateOptions, TypedUseLazyQueryStateResult } from './buildHooks';\nexport { UNINITIALIZED_VALUE } from './constants';\nexport { createApi, reactHooksModule, reactHooksModuleName };","import type { Api } from '@reduxjs/toolkit/query';\nimport type { BaseQueryApi, BaseQueryArg, BaseQueryError, BaseQueryExtraOptions, BaseQueryFn, BaseQueryMeta, BaseQueryResult, QueryReturnValue } from './baseQueryTypes';\nimport type { QuerySubState, RootState } from './core';\nimport type { CacheCollectionQueryExtraOptions } from './core/buildMiddleware/cacheCollection';\nimport type { CacheLifecycleMutationExtraOptions, CacheLifecycleQueryExtraOptions } from './core/buildMiddleware/cacheLifecycle';\nimport type { QueryLifecycleMutationExtraOptions, QueryLifecycleQueryExtraOptions } from './core/buildMiddleware/queryLifecycle';\nimport type { SerializeQueryArgs } from './defaultSerializeQueryArgs';\nimport type { NEVER } from './fakeBaseQuery';\nimport type { CastAny, HasRequiredProps, MaybePromise, NonUndefined, OmitFromUnion, UnwrapPromise } from './tsHelpers';\nimport { isNotNullish } from './utils';\nconst resultType = /* @__PURE__ */Symbol();\nconst baseQuery = /* @__PURE__ */Symbol();\ntype EndpointDefinitionWithQuery = {\n /**\n * `query` can be a function that returns either a `string` or an `object` which is passed to your `baseQuery`. If you are using [fetchBaseQuery](./fetchBaseQuery), this can return either a `string` or an `object` of properties in `FetchArgs`. If you use your own custom [`baseQuery`](../../rtk-query/usage/customizing-queries), you can customize this behavior to your liking.\n *\n * @example\n *\n * ```ts\n * // codeblock-meta title=\"query example\"\n *\n * import { createApi, fetchBaseQuery } from '@reduxjs/toolkit/query/react'\n * interface Post {\n * id: number\n * name: string\n * }\n * type PostsResponse = Post[]\n *\n * const api = createApi({\n * baseQuery: fetchBaseQuery({ baseUrl: '/' }),\n * tagTypes: ['Post'],\n * endpoints: (build) => ({\n * getPosts: build.query({\n * // highlight-start\n * query: () => 'posts',\n * // highlight-end\n * }),\n * addPost: build.mutation>({\n * // highlight-start\n * query: (body) => ({\n * url: `posts`,\n * method: 'POST',\n * body,\n * }),\n * // highlight-end\n * invalidatesTags: [{ type: 'Post', id: 'LIST' }],\n * }),\n * })\n * })\n * ```\n */\n query(arg: QueryArg): BaseQueryArg;\n queryFn?: never;\n /**\n * A function to manipulate the data returned by a query or mutation.\n */\n transformResponse?(baseQueryReturnValue: BaseQueryResult, meta: BaseQueryMeta, arg: QueryArg): ResultType | Promise;\n /**\n * A function to manipulate the data returned by a failed query or mutation.\n */\n transformErrorResponse?(baseQueryReturnValue: BaseQueryError, meta: BaseQueryMeta, arg: QueryArg): unknown;\n /**\n * Defaults to `true`.\n *\n * Most apps should leave this setting on. The only time it can be a performance issue\n * is if an API returns extremely large amounts of data (e.g. 10,000 rows per request) and\n * you're unable to paginate it.\n *\n * For details of how this works, please see the below. When it is set to `false`,\n * every request will cause subscribed components to rerender, even when the data has not changed.\n *\n * @see https://redux-toolkit.js.org/api/other-exports#copywithstructuralsharing\n */\n structuralSharing?: boolean;\n};\ntype EndpointDefinitionWithQueryFn = {\n /**\n * Can be used in place of `query` as an inline function that bypasses `baseQuery` completely for the endpoint.\n *\n * @example\n * ```ts\n * // codeblock-meta title=\"Basic queryFn example\"\n *\n * import { createApi, fetchBaseQuery } from '@reduxjs/toolkit/query/react'\n * interface Post {\n * id: number\n * name: string\n * }\n * type PostsResponse = Post[]\n *\n * const api = createApi({\n * baseQuery: fetchBaseQuery({ baseUrl: '/' }),\n * endpoints: (build) => ({\n * getPosts: build.query({\n * query: () => 'posts',\n * }),\n * flipCoin: build.query<'heads' | 'tails', void>({\n * // highlight-start\n * queryFn(arg, queryApi, extraOptions, baseQuery) {\n * const randomVal = Math.random()\n * if (randomVal < 0.45) {\n * return { data: 'heads' }\n * }\n * if (randomVal < 0.9) {\n * return { data: 'tails' }\n * }\n * return { error: { status: 500, statusText: 'Internal Server Error', data: \"Coin landed on its edge!\" } }\n * }\n * // highlight-end\n * })\n * })\n * })\n * ```\n */\n queryFn(arg: QueryArg, api: BaseQueryApi, extraOptions: BaseQueryExtraOptions, baseQuery: (arg: Parameters[0]) => ReturnType): MaybePromise, BaseQueryMeta>>;\n query?: never;\n transformResponse?: never;\n transformErrorResponse?: never;\n /**\n * Defaults to `true`.\n *\n * Most apps should leave this setting on. The only time it can be a performance issue\n * is if an API returns extremely large amounts of data (e.g. 10,000 rows per request) and\n * you're unable to paginate it.\n *\n * For details of how this works, please see the below. When it is set to `false`,\n * every request will cause subscribed components to rerender, even when the data has not changed.\n *\n * @see https://redux-toolkit.js.org/api/other-exports#copywithstructuralsharing\n */\n structuralSharing?: boolean;\n};\ntype BaseEndpointTypes = {\n QueryArg: QueryArg;\n BaseQuery: BaseQuery;\n ResultType: ResultType;\n};\nexport type BaseEndpointDefinition = (([CastAny, {}>] extends [NEVER] ? never : EndpointDefinitionWithQuery) | EndpointDefinitionWithQueryFn) & {\n /* phantom type */\n [resultType]?: ResultType;\n /* phantom type */\n [baseQuery]?: BaseQuery;\n} & HasRequiredProps, {\n extraOptions: BaseQueryExtraOptions;\n}, {\n extraOptions?: BaseQueryExtraOptions;\n}>;\nexport enum DefinitionType {\n query = 'query',\n mutation = 'mutation',\n}\nexport type GetResultDescriptionFn = (result: ResultType | undefined, error: ErrorType | undefined, arg: QueryArg, meta: MetaType) => ReadonlyArray | undefined | null>;\nexport type FullTagDescription = {\n type: TagType;\n id?: number | string;\n};\nexport type TagDescription = TagType | FullTagDescription;\n\n/**\n * @public\n */\nexport type ResultDescription = ReadonlyArray | undefined | null> | GetResultDescriptionFn;\ntype QueryTypes = BaseEndpointTypes & {\n /**\n * The endpoint definition type. To be used with some internal generic types.\n * @example\n * ```ts\n * const useMyWrappedHook: UseQuery = ...\n * ```\n */\n QueryDefinition: QueryDefinition;\n TagTypes: TagTypes;\n ReducerPath: ReducerPath;\n};\n\n/**\n * @public\n */\nexport interface QueryExtraOptions extends CacheLifecycleQueryExtraOptions, QueryLifecycleQueryExtraOptions, CacheCollectionQueryExtraOptions {\n type: DefinitionType.query;\n\n /**\n * Used by `query` endpoints. Determines which 'tag' is attached to the cached data returned by the query.\n * Expects an array of tag type strings, an array of objects of tag types with ids, or a function that returns such an array.\n * 1. `['Post']` - equivalent to `2`\n * 2. `[{ type: 'Post' }]` - equivalent to `1`\n * 3. `[{ type: 'Post', id: 1 }]`\n * 4. `(result, error, arg) => ['Post']` - equivalent to `5`\n * 5. `(result, error, arg) => [{ type: 'Post' }]` - equivalent to `4`\n * 6. `(result, error, arg) => [{ type: 'Post', id: 1 }]`\n *\n * @example\n *\n * ```ts\n * // codeblock-meta title=\"providesTags example\"\n *\n * import { createApi, fetchBaseQuery } from '@reduxjs/toolkit/query/react'\n * interface Post {\n * id: number\n * name: string\n * }\n * type PostsResponse = Post[]\n *\n * const api = createApi({\n * baseQuery: fetchBaseQuery({ baseUrl: '/' }),\n * tagTypes: ['Posts'],\n * endpoints: (build) => ({\n * getPosts: build.query({\n * query: () => 'posts',\n * // highlight-start\n * providesTags: (result) =>\n * result\n * ? [\n * ...result.map(({ id }) => ({ type: 'Posts' as const, id })),\n * { type: 'Posts', id: 'LIST' },\n * ]\n * : [{ type: 'Posts', id: 'LIST' }],\n * // highlight-end\n * })\n * })\n * })\n * ```\n */\n providesTags?: ResultDescription, BaseQueryMeta>;\n /**\n * Not to be used. A query should not invalidate tags in the cache.\n */\n invalidatesTags?: never;\n\n /**\n * Can be provided to return a custom cache key value based on the query arguments.\n *\n * This is primarily intended for cases where a non-serializable value is passed as part of the query arg object and should be excluded from the cache key. It may also be used for cases where an endpoint should only have a single cache entry, such as an infinite loading / pagination implementation.\n *\n * Unlike the `createApi` version which can _only_ return a string, this per-endpoint option can also return an an object, number, or boolean. If it returns a string, that value will be used as the cache key directly. If it returns an object / number / boolean, that value will be passed to the built-in `defaultSerializeQueryArgs`. This simplifies the use case of stripping out args you don't want included in the cache key.\n *\n *\n * @example\n *\n * ```ts\n * // codeblock-meta title=\"serializeQueryArgs : exclude value\"\n *\n * import { createApi, fetchBaseQuery, defaultSerializeQueryArgs } from '@reduxjs/toolkit/query/react'\n * interface Post {\n * id: number\n * name: string\n * }\n *\n * interface MyApiClient {\n * fetchPost: (id: string) => Promise\n * }\n *\n * createApi({\n * baseQuery: fetchBaseQuery({ baseUrl: '/' }),\n * endpoints: (build) => ({\n * // Example: an endpoint with an API client passed in as an argument,\n * // but only the item ID should be used as the cache key\n * getPost: build.query({\n * queryFn: async ({ id, client }) => {\n * const post = await client.fetchPost(id)\n * return { data: post }\n * },\n * // highlight-start\n * serializeQueryArgs: ({ queryArgs, endpointDefinition, endpointName }) => {\n * const { id } = queryArgs\n * // This can return a string, an object, a number, or a boolean.\n * // If it returns an object, number or boolean, that value\n * // will be serialized automatically via `defaultSerializeQueryArgs`\n * return { id } // omit `client` from the cache key\n *\n * // Alternately, you can use `defaultSerializeQueryArgs` yourself:\n * // return defaultSerializeQueryArgs({\n * // endpointName,\n * // queryArgs: { id },\n * // endpointDefinition\n * // })\n * // Or create and return a string yourself:\n * // return `getPost(${id})`\n * },\n * // highlight-end\n * }),\n * }),\n *})\n * ```\n */\n serializeQueryArgs?: SerializeQueryArgs>;\n\n /**\n * Can be provided to merge an incoming response value into the current cache data.\n * If supplied, no automatic structural sharing will be applied - it's up to\n * you to update the cache appropriately.\n *\n * Since RTKQ normally replaces cache entries with the new response, you will usually\n * need to use this with the `serializeQueryArgs` or `forceRefetch` options to keep\n * an existing cache entry so that it can be updated.\n *\n * Since this is wrapped with Immer, you may either mutate the `currentCacheValue` directly,\n * or return a new value, but _not_ both at once.\n *\n * Will only be called if the existing `currentCacheData` is _not_ `undefined` - on first response,\n * the cache entry will just save the response data directly.\n *\n * Useful if you don't want a new request to completely override the current cache value,\n * maybe because you have manually updated it from another source and don't want those\n * updates to get lost.\n *\n *\n * @example\n *\n * ```ts\n * // codeblock-meta title=\"merge: pagination\"\n *\n * import { createApi, fetchBaseQuery, defaultSerializeQueryArgs } from '@reduxjs/toolkit/query/react'\n * interface Post {\n * id: number\n * name: string\n * }\n *\n * createApi({\n * baseQuery: fetchBaseQuery({ baseUrl: '/' }),\n * endpoints: (build) => ({\n * listItems: build.query({\n * query: (pageNumber) => `/listItems?page=${pageNumber}`,\n * // Only have one cache entry because the arg always maps to one string\n * serializeQueryArgs: ({ endpointName }) => {\n * return endpointName\n * },\n * // Always merge incoming data to the cache entry\n * merge: (currentCache, newItems) => {\n * currentCache.push(...newItems)\n * },\n * // Refetch when the page arg changes\n * forceRefetch({ currentArg, previousArg }) {\n * return currentArg !== previousArg\n * },\n * }),\n * }),\n *})\n * ```\n */\n merge?(currentCacheData: ResultType, responseData: ResultType, otherArgs: {\n arg: QueryArg;\n baseQueryMeta: BaseQueryMeta;\n requestId: string;\n fulfilledTimeStamp: number;\n }): ResultType | void;\n\n /**\n * Check to see if the endpoint should force a refetch in cases where it normally wouldn't.\n * This is primarily useful for \"infinite scroll\" / pagination use cases where\n * RTKQ is keeping a single cache entry that is added to over time, in combination\n * with `serializeQueryArgs` returning a fixed cache key and a `merge` callback\n * set to add incoming data to the cache entry each time.\n *\n * @example\n *\n * ```ts\n * // codeblock-meta title=\"forceRefresh: pagination\"\n *\n * import { createApi, fetchBaseQuery, defaultSerializeQueryArgs } from '@reduxjs/toolkit/query/react'\n * interface Post {\n * id: number\n * name: string\n * }\n *\n * createApi({\n * baseQuery: fetchBaseQuery({ baseUrl: '/' }),\n * endpoints: (build) => ({\n * listItems: build.query({\n * query: (pageNumber) => `/listItems?page=${pageNumber}`,\n * // Only have one cache entry because the arg always maps to one string\n * serializeQueryArgs: ({ endpointName }) => {\n * return endpointName\n * },\n * // Always merge incoming data to the cache entry\n * merge: (currentCache, newItems) => {\n * currentCache.push(...newItems)\n * },\n * // Refetch when the page arg changes\n * forceRefetch({ currentArg, previousArg }) {\n * return currentArg !== previousArg\n * },\n * }),\n * }),\n *})\n * ```\n */\n forceRefetch?(params: {\n currentArg: QueryArg | undefined;\n previousArg: QueryArg | undefined;\n state: RootState;\n endpointState?: QuerySubState;\n }): boolean;\n\n /**\n * All of these are `undefined` at runtime, purely to be used in TypeScript declarations!\n */\n Types?: QueryTypes;\n}\nexport type QueryDefinition = BaseEndpointDefinition & QueryExtraOptions;\ntype MutationTypes = BaseEndpointTypes & {\n /**\n * The endpoint definition type. To be used with some internal generic types.\n * @example\n * ```ts\n * const useMyWrappedHook: UseMutation = ...\n * ```\n */\n MutationDefinition: MutationDefinition;\n TagTypes: TagTypes;\n ReducerPath: ReducerPath;\n};\n\n/**\n * @public\n */\nexport interface MutationExtraOptions extends CacheLifecycleMutationExtraOptions, QueryLifecycleMutationExtraOptions {\n type: DefinitionType.mutation;\n\n /**\n * Used by `mutation` endpoints. Determines which cached data should be either re-fetched or removed from the cache.\n * Expects the same shapes as `providesTags`.\n *\n * @example\n *\n * ```ts\n * // codeblock-meta title=\"invalidatesTags example\"\n * import { createApi, fetchBaseQuery } from '@reduxjs/toolkit/query/react'\n * interface Post {\n * id: number\n * name: string\n * }\n * type PostsResponse = Post[]\n *\n * const api = createApi({\n * baseQuery: fetchBaseQuery({ baseUrl: '/' }),\n * tagTypes: ['Posts'],\n * endpoints: (build) => ({\n * getPosts: build.query({\n * query: () => 'posts',\n * providesTags: (result) =>\n * result\n * ? [\n * ...result.map(({ id }) => ({ type: 'Posts' as const, id })),\n * { type: 'Posts', id: 'LIST' },\n * ]\n * : [{ type: 'Posts', id: 'LIST' }],\n * }),\n * addPost: build.mutation>({\n * query(body) {\n * return {\n * url: `posts`,\n * method: 'POST',\n * body,\n * }\n * },\n * // highlight-start\n * invalidatesTags: [{ type: 'Posts', id: 'LIST' }],\n * // highlight-end\n * }),\n * })\n * })\n * ```\n */\n invalidatesTags?: ResultDescription, BaseQueryMeta>;\n /**\n * Not to be used. A mutation should not provide tags to the cache.\n */\n providesTags?: never;\n\n /**\n * All of these are `undefined` at runtime, purely to be used in TypeScript declarations!\n */\n Types?: MutationTypes;\n}\nexport type MutationDefinition = BaseEndpointDefinition & MutationExtraOptions;\nexport type EndpointDefinition = QueryDefinition | MutationDefinition;\nexport type EndpointDefinitions = Record>;\nexport function isQueryDefinition(e: EndpointDefinition): e is QueryDefinition {\n return e.type === DefinitionType.query;\n}\nexport function isMutationDefinition(e: EndpointDefinition): e is MutationDefinition {\n return e.type === DefinitionType.mutation;\n}\nexport type EndpointBuilder = {\n /**\n * An endpoint definition that retrieves data, and may provide tags to the cache.\n *\n * @example\n * ```js\n * // codeblock-meta title=\"Example of all query endpoint options\"\n * const api = createApi({\n * baseQuery,\n * endpoints: (build) => ({\n * getPost: build.query({\n * query: (id) => ({ url: `post/${id}` }),\n * // Pick out data and prevent nested properties in a hook or selector\n * transformResponse: (response) => response.data,\n * // Pick out error and prevent nested properties in a hook or selector\n * transformErrorResponse: (response) => response.error,\n * // `result` is the server response\n * providesTags: (result, error, id) => [{ type: 'Post', id }],\n * // trigger side effects or optimistic updates\n * onQueryStarted(id, { dispatch, getState, extra, requestId, queryFulfilled, getCacheEntry, updateCachedData }) {},\n * // handle subscriptions etc\n * onCacheEntryAdded(id, { dispatch, getState, extra, requestId, cacheEntryRemoved, cacheDataLoaded, getCacheEntry, updateCachedData }) {},\n * }),\n * }),\n *});\n *```\n */\n query(definition: OmitFromUnion, 'type'>): QueryDefinition;\n /**\n * An endpoint definition that alters data on the server or will possibly invalidate the cache.\n *\n * @example\n * ```js\n * // codeblock-meta title=\"Example of all mutation endpoint options\"\n * const api = createApi({\n * baseQuery,\n * endpoints: (build) => ({\n * updatePost: build.mutation({\n * query: ({ id, ...patch }) => ({ url: `post/${id}`, method: 'PATCH', body: patch }),\n * // Pick out data and prevent nested properties in a hook or selector\n * transformResponse: (response) => response.data,\n * // Pick out error and prevent nested properties in a hook or selector\n * transformErrorResponse: (response) => response.error,\n * // `result` is the server response\n * invalidatesTags: (result, error, id) => [{ type: 'Post', id }],\n * // trigger side effects or optimistic updates\n * onQueryStarted(id, { dispatch, getState, extra, requestId, queryFulfilled, getCacheEntry }) {},\n * // handle subscriptions etc\n * onCacheEntryAdded(id, { dispatch, getState, extra, requestId, cacheEntryRemoved, cacheDataLoaded, getCacheEntry }) {},\n * }),\n * }),\n * });\n * ```\n */\n mutation(definition: OmitFromUnion, 'type'>): MutationDefinition;\n};\nexport type AssertTagTypes = >(t: T) => T;\nexport function calculateProvidedBy(description: ResultDescription | undefined, result: ResultType | undefined, error: ErrorType | undefined, queryArg: QueryArg, meta: MetaType | undefined, assertTagTypes: AssertTagTypes): readonly FullTagDescription[] {\n if (isFunction(description)) {\n return description(result as ResultType, error as undefined, queryArg, meta as MetaType).filter(isNotNullish).map(expandTagDescription).map(assertTagTypes);\n }\n if (Array.isArray(description)) {\n return description.map(expandTagDescription).map(assertTagTypes);\n }\n return [];\n}\nfunction isFunction(t: T): t is Extract {\n return typeof t === 'function';\n}\nexport function expandTagDescription(description: TagDescription): FullTagDescription {\n return typeof description === 'string' ? {\n type: description\n } : description;\n}\nexport type QueryArgFrom> = D extends BaseEndpointDefinition ? QA : unknown;\nexport type ResultTypeFrom> = D extends BaseEndpointDefinition ? RT : unknown;\nexport type ReducerPathFrom> = D extends EndpointDefinition ? RP : unknown;\nexport type TagTypesFrom> = D extends EndpointDefinition ? RP : unknown;\nexport type TagTypesFromApi = T extends Api ? TagTypes : never;\nexport type DefinitionsFromApi = T extends Api ? Definitions : never;\nexport type TransformedResponse = K extends keyof NewDefinitions ? NewDefinitions[K]['transformResponse'] extends undefined ? ResultType : UnwrapPromise>> : ResultType;\nexport type OverrideResultType = Definition extends QueryDefinition ? QueryDefinition : Definition extends MutationDefinition ? MutationDefinition : never;\nexport type UpdateDefinitions = { [K in keyof Definitions]: Definitions[K] extends QueryDefinition ? QueryDefinition, ReducerPath> : Definitions[K] extends MutationDefinition ? MutationDefinition, ReducerPath> : never };","import type { SerializedError } from '@reduxjs/toolkit';\nimport type { BaseQueryError } from '../baseQueryTypes';\nimport type { QueryDefinition, MutationDefinition, EndpointDefinitions, BaseEndpointDefinition, ResultTypeFrom, QueryArgFrom } from '../endpointDefinitions';\nimport type { Id, WithRequiredProp } from '../tsHelpers';\nexport type QueryCacheKey = string & {\n _type: 'queryCacheKey';\n};\nexport type QuerySubstateIdentifier = {\n queryCacheKey: QueryCacheKey;\n};\nexport type MutationSubstateIdentifier = {\n requestId: string;\n fixedCacheKey?: string;\n} | {\n requestId?: string;\n fixedCacheKey: string;\n};\nexport type RefetchConfigOptions = {\n refetchOnMountOrArgChange: boolean | number;\n refetchOnReconnect: boolean;\n refetchOnFocus: boolean;\n};\n\n/**\n * Strings describing the query state at any given time.\n */\nexport enum QueryStatus {\n uninitialized = 'uninitialized',\n pending = 'pending',\n fulfilled = 'fulfilled',\n rejected = 'rejected',\n}\nexport type RequestStatusFlags = {\n status: QueryStatus.uninitialized;\n isUninitialized: true;\n isLoading: false;\n isSuccess: false;\n isError: false;\n} | {\n status: QueryStatus.pending;\n isUninitialized: false;\n isLoading: true;\n isSuccess: false;\n isError: false;\n} | {\n status: QueryStatus.fulfilled;\n isUninitialized: false;\n isLoading: false;\n isSuccess: true;\n isError: false;\n} | {\n status: QueryStatus.rejected;\n isUninitialized: false;\n isLoading: false;\n isSuccess: false;\n isError: true;\n};\nexport function getRequestStatusFlags(status: QueryStatus): RequestStatusFlags {\n return {\n status,\n isUninitialized: status === QueryStatus.uninitialized,\n isLoading: status === QueryStatus.pending,\n isSuccess: status === QueryStatus.fulfilled,\n isError: status === QueryStatus.rejected\n } as any;\n}\n\n/**\n * @public\n */\nexport type SubscriptionOptions = {\n /**\n * How frequently to automatically re-fetch data (in milliseconds). Defaults to `0` (off).\n */\n pollingInterval?: number;\n /**\n * Defaults to 'false'. This setting allows you to control whether RTK Query will continue polling if the window is not focused.\n *\n * If pollingInterval is not set or set to 0, this **will not be evaluated** until pollingInterval is greater than 0.\n *\n * Note: requires [`setupListeners`](./setupListeners) to have been called.\n */\n skipPollingIfUnfocused?: boolean;\n /**\n * Defaults to `false`. This setting allows you to control whether RTK Query will try to refetch all subscribed queries after regaining a network connection.\n *\n * If you specify this option alongside `skip: true`, this **will not be evaluated** until `skip` is false.\n *\n * Note: requires [`setupListeners`](./setupListeners) to have been called.\n */\n refetchOnReconnect?: boolean;\n /**\n * Defaults to `false`. This setting allows you to control whether RTK Query will try to refetch all subscribed queries after the application window regains focus.\n *\n * If you specify this option alongside `skip: true`, this **will not be evaluated** until `skip` is false.\n *\n * Note: requires [`setupListeners`](./setupListeners) to have been called.\n */\n refetchOnFocus?: boolean;\n};\nexport type Subscribers = {\n [requestId: string]: SubscriptionOptions;\n};\nexport type QueryKeys = { [K in keyof Definitions]: Definitions[K] extends QueryDefinition ? K : never }[keyof Definitions];\nexport type MutationKeys = { [K in keyof Definitions]: Definitions[K] extends MutationDefinition ? K : never }[keyof Definitions];\ntype BaseQuerySubState> = {\n /**\n * The argument originally passed into the hook or `initiate` action call\n */\n originalArgs: QueryArgFrom;\n /**\n * A unique ID associated with the request\n */\n requestId: string;\n /**\n * The received data from the query\n */\n data?: ResultTypeFrom;\n /**\n * The received error if applicable\n */\n error?: SerializedError | (D extends QueryDefinition ? BaseQueryError : never);\n /**\n * The name of the endpoint associated with the query\n */\n endpointName: string;\n /**\n * Time that the latest query started\n */\n startedTimeStamp: number;\n /**\n * Time that the latest query was fulfilled\n */\n fulfilledTimeStamp?: number;\n};\nexport type QuerySubState> = Id<({\n status: QueryStatus.fulfilled;\n} & WithRequiredProp, 'data' | 'fulfilledTimeStamp'> & {\n error: undefined;\n}) | ({\n status: QueryStatus.pending;\n} & BaseQuerySubState) | ({\n status: QueryStatus.rejected;\n} & WithRequiredProp, 'error'>) | {\n status: QueryStatus.uninitialized;\n originalArgs?: undefined;\n data?: undefined;\n error?: undefined;\n requestId?: undefined;\n endpointName?: string;\n startedTimeStamp?: undefined;\n fulfilledTimeStamp?: undefined;\n}>;\ntype BaseMutationSubState> = {\n requestId: string;\n data?: ResultTypeFrom;\n error?: SerializedError | (D extends MutationDefinition ? BaseQueryError : never);\n endpointName: string;\n startedTimeStamp: number;\n fulfilledTimeStamp?: number;\n};\nexport type MutationSubState> = (({\n status: QueryStatus.fulfilled;\n} & WithRequiredProp, 'data' | 'fulfilledTimeStamp'>) & {\n error: undefined;\n}) | (({\n status: QueryStatus.pending;\n} & BaseMutationSubState) & {\n data?: undefined;\n}) | ({\n status: QueryStatus.rejected;\n} & WithRequiredProp, 'error'>) | {\n requestId?: undefined;\n status: QueryStatus.uninitialized;\n data?: undefined;\n error?: undefined;\n endpointName?: string;\n startedTimeStamp?: undefined;\n fulfilledTimeStamp?: undefined;\n};\nexport type CombinedState = {\n queries: QueryState;\n mutations: MutationState;\n provided: InvalidationState;\n subscriptions: SubscriptionState;\n config: ConfigState;\n};\nexport type InvalidationState = { [_ in TagTypes]: {\n [id: string]: Array;\n [id: number]: Array;\n} };\nexport type QueryState = {\n [queryCacheKey: string]: QuerySubState | undefined;\n};\nexport type SubscriptionState = {\n [queryCacheKey: string]: Subscribers | undefined;\n};\nexport type ConfigState = RefetchConfigOptions & {\n reducerPath: ReducerPath;\n online: boolean;\n focused: boolean;\n middlewareRegistered: boolean | 'conflict';\n} & ModifiableConfigState;\nexport type ModifiableConfigState = {\n keepUnusedDataFor: number;\n invalidationBehavior: 'delayed' | 'immediately';\n} & RefetchConfigOptions;\nexport type MutationState = {\n [requestId: string]: MutationSubState | undefined;\n};\nexport type RootState = { [P in ReducerPath]: CombinedState };","import { isPlainObject as _iPO } from '../core/rtkImports';\n\n// remove type guard\nconst isPlainObject: (_: any) => boolean = _iPO;\nexport function copyWithStructuralSharing(oldObj: any, newObj: T): T;\nexport function copyWithStructuralSharing(oldObj: any, newObj: any): any {\n if (oldObj === newObj || !(isPlainObject(oldObj) && isPlainObject(newObj) || Array.isArray(oldObj) && Array.isArray(newObj))) {\n return newObj;\n }\n const newKeys = Object.keys(newObj);\n const oldKeys = Object.keys(oldObj);\n let isSameObject = newKeys.length === oldKeys.length;\n const mergeObj: any = Array.isArray(newObj) ? [] : {};\n for (const key of newKeys) {\n mergeObj[key] = copyWithStructuralSharing(oldObj[key], newObj[key]);\n if (isSameObject) isSameObject = oldObj[key] === mergeObj[key];\n }\n return isSameObject ? oldObj : mergeObj;\n}","// Fast method for counting an object's keys\n// without resorting to `Object.keys(obj).length\n// Will this make a big difference in perf? Probably not\n// But we can save a few allocations.\n\nexport function countObjectKeys(obj: Record) {\n let count = 0;\n for (const _key in obj) {\n count++;\n }\n return count;\n}","/**\r\n * Alternative to `Array.flat(1)`\r\n * @param arr An array like [1,2,3,[1,2]]\r\n * @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/flat\r\n */\nexport const flatten = (arr: readonly any[]) => [].concat(...arr);","export function isNotNullish(v: T | null | undefined): v is T {\n return v != null;\n}","import { isAbsoluteUrl } from './isAbsoluteUrl';\nconst withoutTrailingSlash = (url: string) => url.replace(/\\/$/, '');\nconst withoutLeadingSlash = (url: string) => url.replace(/^\\//, '');\nexport function joinUrls(base: string | undefined, url: string | undefined): string {\n if (!base) {\n return url!;\n }\n if (!url) {\n return base;\n }\n if (isAbsoluteUrl(url)) {\n return url;\n }\n const delimiter = base.endsWith('/') || !url.startsWith('?') ? '/' : '';\n base = withoutTrailingSlash(base);\n url = withoutLeadingSlash(url);\n return `${base}${delimiter}${url}`;\n}","/**\r\n * If either :// or // is present consider it to be an absolute url\r\n *\r\n * @param url string\r\n */\n\nexport function isAbsoluteUrl(url: string) {\n return new RegExp(`(^|:)//`).test(url);\n}","import { joinUrls } from './utils';\nimport { isPlainObject } from './core/rtkImports';\nimport type { BaseQueryApi, BaseQueryFn } from './baseQueryTypes';\nimport type { MaybePromise, Override } from './tsHelpers';\nexport type ResponseHandler = 'content-type' | 'json' | 'text' | ((response: Response) => Promise);\ntype CustomRequestInit = Override | undefined;\n}>;\nexport interface FetchArgs extends CustomRequestInit {\n url: string;\n params?: Record;\n body?: any;\n responseHandler?: ResponseHandler;\n validateStatus?: (response: Response, body: any) => boolean;\n /**\n * A number in milliseconds that represents that maximum time a request can take before timing out.\n */\n timeout?: number;\n}\n\n/**\n * A mini-wrapper that passes arguments straight through to\n * {@link [fetch](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API)}.\n * Avoids storing `fetch` in a closure, in order to permit mocking/monkey-patching.\n */\nconst defaultFetchFn: typeof fetch = (...args) => fetch(...args);\nconst defaultValidateStatus = (response: Response) => response.status >= 200 && response.status <= 299;\nconst defaultIsJsonContentType = (headers: Headers) => /*applicat*//ion\\/(vnd\\.api\\+)?json/.test(headers.get('content-type') || '');\nexport type FetchBaseQueryError = {\n /**\n * * `number`:\n * HTTP status code\n */\n status: number;\n data: unknown;\n} | {\n /**\n * * `\"FETCH_ERROR\"`:\n * An error that occurred during execution of `fetch` or the `fetchFn` callback option\n **/\n status: 'FETCH_ERROR';\n data?: undefined;\n error: string;\n} | {\n /**\n * * `\"PARSING_ERROR\"`:\n * An error happened during parsing.\n * Most likely a non-JSON-response was returned with the default `responseHandler` \"JSON\",\n * or an error occurred while executing a custom `responseHandler`.\n **/\n status: 'PARSING_ERROR';\n originalStatus: number;\n data: string;\n error: string;\n} | {\n /**\n * * `\"TIMEOUT_ERROR\"`:\n * Request timed out\n **/\n status: 'TIMEOUT_ERROR';\n data?: undefined;\n error: string;\n} | {\n /**\n * * `\"CUSTOM_ERROR\"`:\n * A custom error type that you can return from your `queryFn` where another error might not make sense.\n **/\n status: 'CUSTOM_ERROR';\n data?: unknown;\n error: string;\n};\nfunction stripUndefined(obj: any) {\n if (!isPlainObject(obj)) {\n return obj;\n }\n const copy: Record = {\n ...obj\n };\n for (const [k, v] of Object.entries(copy)) {\n if (v === undefined) delete copy[k];\n }\n return copy;\n}\nexport type FetchBaseQueryArgs = {\n baseUrl?: string;\n prepareHeaders?: (headers: Headers, api: Pick & {\n arg: string | FetchArgs;\n extraOptions: unknown;\n }) => MaybePromise;\n fetchFn?: (input: RequestInfo, init?: RequestInit | undefined) => Promise;\n paramsSerializer?: (params: Record) => string;\n /**\n * By default, we only check for 'application/json' and 'application/vnd.api+json' as the content-types for json. If you need to support another format, you can pass\n * in a predicate function for your given api to get the same automatic stringifying behavior\n * @example\n * ```ts\n * const isJsonContentType = (headers: Headers) => [\"application/vnd.api+json\", \"application/json\", \"application/vnd.hal+json\"].includes(headers.get(\"content-type\")?.trim());\n * ```\n */\n isJsonContentType?: (headers: Headers) => boolean;\n /**\n * Defaults to `application/json`;\n */\n jsonContentType?: string;\n\n /**\n * Custom replacer function used when calling `JSON.stringify()`;\n */\n jsonReplacer?: (this: any, key: string, value: any) => any;\n} & RequestInit & Pick;\nexport type FetchBaseQueryMeta = {\n request: Request;\n response?: Response;\n};\n\n/**\n * This is a very small wrapper around fetch that aims to simplify requests.\n *\n * @example\n * ```ts\n * const baseQuery = fetchBaseQuery({\n * baseUrl: 'https://api.your-really-great-app.com/v1/',\n * prepareHeaders: (headers, { getState }) => {\n * const token = (getState() as RootState).auth.token;\n * // If we have a token set in state, let's assume that we should be passing it.\n * if (token) {\n * headers.set('authorization', `Bearer ${token}`);\n * }\n * return headers;\n * },\n * })\n * ```\n *\n * @param {string} baseUrl\n * The base URL for an API service.\n * Typically in the format of https://example.com/\n *\n * @param {(headers: Headers, api: { getState: () => unknown; arg: string | FetchArgs; extra: unknown; endpoint: string; type: 'query' | 'mutation'; forced: boolean; }) => Headers} prepareHeaders\n * An optional function that can be used to inject headers on requests.\n * Provides a Headers object, most of the `BaseQueryApi` (`dispatch` is not available), and the arg passed into the query function.\n * Useful for setting authentication or headers that need to be set conditionally.\n *\n * @link https://developer.mozilla.org/en-US/docs/Web/API/Headers\n *\n * @param {(input: RequestInfo, init?: RequestInit | undefined) => Promise} fetchFn\n * Accepts a custom `fetch` function if you do not want to use the default on the window.\n * Useful in SSR environments if you need to use a library such as `isomorphic-fetch` or `cross-fetch`\n *\n * @param {(params: Record) => string} paramsSerializer\n * An optional function that can be used to stringify querystring parameters.\n *\n * @param {(headers: Headers) => boolean} isJsonContentType\n * An optional predicate function to determine if `JSON.stringify()` should be called on the `body` arg of `FetchArgs`\n *\n * @param {string} jsonContentType Used when automatically setting the content-type header for a request with a jsonifiable body that does not have an explicit content-type header. Defaults to `application/json`.\n *\n * @param {(this: any, key: string, value: any) => any} jsonReplacer Custom replacer function used when calling `JSON.stringify()`.\n *\n * @param {number} timeout\n * A number in milliseconds that represents the maximum time a request can take before timing out.\n */\n\nexport function fetchBaseQuery({\n baseUrl,\n prepareHeaders = x => x,\n fetchFn = defaultFetchFn,\n paramsSerializer,\n isJsonContentType = defaultIsJsonContentType,\n jsonContentType = 'application/json',\n jsonReplacer,\n timeout: defaultTimeout,\n responseHandler: globalResponseHandler,\n validateStatus: globalValidateStatus,\n ...baseFetchOptions\n}: FetchBaseQueryArgs = {}): BaseQueryFn {\n if (typeof fetch === 'undefined' && fetchFn === defaultFetchFn) {\n console.warn('Warning: `fetch` is not available. Please supply a custom `fetchFn` property to use `fetchBaseQuery` on SSR environments.');\n }\n return async (arg, api, extraOptions) => {\n const {\n getState,\n extra,\n endpoint,\n forced,\n type\n } = api;\n let meta: FetchBaseQueryMeta | undefined;\n let {\n url,\n headers = new Headers(baseFetchOptions.headers),\n params = undefined,\n responseHandler = globalResponseHandler ?? 'json' as const,\n validateStatus = globalValidateStatus ?? defaultValidateStatus,\n timeout = defaultTimeout,\n ...rest\n } = typeof arg == 'string' ? {\n url: arg\n } : arg;\n let abortController: AbortController | undefined,\n signal = api.signal;\n if (timeout) {\n abortController = new AbortController();\n api.signal.addEventListener('abort', abortController.abort);\n signal = abortController.signal;\n }\n let config: RequestInit = {\n ...baseFetchOptions,\n signal,\n ...rest\n };\n headers = new Headers(stripUndefined(headers));\n config.headers = (await prepareHeaders(headers, {\n getState,\n arg,\n extra,\n endpoint,\n forced,\n type,\n extraOptions\n })) || headers;\n\n // Only set the content-type to json if appropriate. Will not be true for FormData, ArrayBuffer, Blob, etc.\n const isJsonifiable = (body: any) => typeof body === 'object' && (isPlainObject(body) || Array.isArray(body) || typeof body.toJSON === 'function');\n if (!config.headers.has('content-type') && isJsonifiable(config.body)) {\n config.headers.set('content-type', jsonContentType);\n }\n if (isJsonifiable(config.body) && isJsonContentType(config.headers)) {\n config.body = JSON.stringify(config.body, jsonReplacer);\n }\n if (params) {\n const divider = ~url.indexOf('?') ? '&' : '?';\n const query = paramsSerializer ? paramsSerializer(params) : new URLSearchParams(stripUndefined(params));\n url += divider + query;\n }\n url = joinUrls(baseUrl, url);\n const request = new Request(url, config);\n const requestClone = new Request(url, config);\n meta = {\n request: requestClone\n };\n let response,\n timedOut = false,\n timeoutId = abortController && setTimeout(() => {\n timedOut = true;\n abortController!.abort();\n }, timeout);\n try {\n response = await fetchFn(request);\n } catch (e) {\n return {\n error: {\n status: timedOut ? 'TIMEOUT_ERROR' : 'FETCH_ERROR',\n error: String(e)\n },\n meta\n };\n } finally {\n if (timeoutId) clearTimeout(timeoutId);\n abortController?.signal.removeEventListener('abort', abortController.abort);\n }\n const responseClone = response.clone();\n meta.response = responseClone;\n let resultData: any;\n let responseText: string = '';\n try {\n let handleResponseError;\n await Promise.all([handleResponse(response, responseHandler).then(r => resultData = r, e => handleResponseError = e),\n // see https://github.com/node-fetch/node-fetch/issues/665#issuecomment-538995182\n // we *have* to \"use up\" both streams at the same time or they will stop running in node-fetch scenarios\n responseClone.text().then(r => responseText = r, () => {})]);\n if (handleResponseError) throw handleResponseError;\n } catch (e) {\n return {\n error: {\n status: 'PARSING_ERROR',\n originalStatus: response.status,\n data: responseText,\n error: String(e)\n },\n meta\n };\n }\n return validateStatus(response, resultData) ? {\n data: resultData,\n meta\n } : {\n error: {\n status: response.status,\n data: resultData\n },\n meta\n };\n };\n async function handleResponse(response: Response, responseHandler: ResponseHandler) {\n if (typeof responseHandler === 'function') {\n return responseHandler(response);\n }\n if (responseHandler === 'content-type') {\n responseHandler = isJsonContentType(response.headers) ? 'json' : 'text';\n }\n if (responseHandler === 'json') {\n const text = await response.text();\n return text.length ? JSON.parse(text) : null;\n }\n return response.text();\n }\n}","export class HandledError {\n constructor(public readonly value: any, public readonly meta: any = undefined) {}\n}","import type { BaseQueryApi, BaseQueryArg, BaseQueryEnhancer, BaseQueryError, BaseQueryExtraOptions, BaseQueryFn, BaseQueryMeta } from './baseQueryTypes';\nimport type { FetchBaseQueryError } from './fetchBaseQuery';\nimport { HandledError } from './HandledError';\n\n/**\n * Exponential backoff based on the attempt number.\n *\n * @remarks\n * 1. 600ms * random(0.4, 1.4)\n * 2. 1200ms * random(0.4, 1.4)\n * 3. 2400ms * random(0.4, 1.4)\n * 4. 4800ms * random(0.4, 1.4)\n * 5. 9600ms * random(0.4, 1.4)\n *\n * @param attempt - Current attempt\n * @param maxRetries - Maximum number of retries\n */\nasync function defaultBackoff(attempt: number = 0, maxRetries: number = 5) {\n const attempts = Math.min(attempt, maxRetries);\n const timeout = ~~((Math.random() + 0.4) * (300 << attempts)); // Force a positive int in the case we make this an option\n await new Promise(resolve => setTimeout((res: any) => resolve(res), timeout));\n}\ntype RetryConditionFunction = (error: BaseQueryError, args: BaseQueryArg, extraArgs: {\n attempt: number;\n baseQueryApi: BaseQueryApi;\n extraOptions: BaseQueryExtraOptions & RetryOptions;\n}) => boolean;\nexport type RetryOptions = {\n /**\n * Function used to determine delay between retries\n */\n backoff?: (attempt: number, maxRetries: number) => Promise;\n} & ({\n /**\n * How many times the query will be retried (default: 5)\n */\n maxRetries?: number;\n retryCondition?: undefined;\n} | {\n /**\n * Callback to determine if a retry should be attempted.\n * Return `true` for another retry and `false` to quit trying prematurely.\n */\n retryCondition?: RetryConditionFunction;\n maxRetries?: undefined;\n});\nfunction fail(error: BaseQueryError, meta?: BaseQueryMeta): never {\n throw Object.assign(new HandledError({\n error,\n meta\n }), {\n throwImmediately: true\n });\n}\nconst EMPTY_OPTIONS = {};\nconst retryWithBackoff: BaseQueryEnhancer = (baseQuery, defaultOptions) => async (args, api, extraOptions) => {\n // We need to figure out `maxRetries` before we define `defaultRetryCondition.\n // This is probably goofy, but ought to work.\n // Put our defaults in one array, filter out undefineds, grab the last value.\n const possibleMaxRetries: number[] = [5, (defaultOptions as any || EMPTY_OPTIONS).maxRetries, (extraOptions as any || EMPTY_OPTIONS).maxRetries].filter(x => x !== undefined);\n const [maxRetries] = possibleMaxRetries.slice(-1);\n const defaultRetryCondition: RetryConditionFunction = (_, __, {\n attempt\n }) => attempt <= maxRetries;\n const options: {\n maxRetries: number;\n backoff: typeof defaultBackoff;\n retryCondition: typeof defaultRetryCondition;\n } = {\n maxRetries,\n backoff: defaultBackoff,\n retryCondition: defaultRetryCondition,\n ...defaultOptions,\n ...extraOptions\n };\n let retry = 0;\n while (true) {\n try {\n const result = await baseQuery(args, api, extraOptions);\n // baseQueries _should_ return an error property, so we should check for that and throw it to continue retrying\n if (result.error) {\n throw new HandledError(result);\n }\n return result;\n } catch (e: any) {\n retry++;\n if (e.throwImmediately) {\n if (e instanceof HandledError) {\n return e.value;\n }\n\n // We don't know what this is, so we have to rethrow it\n throw e;\n }\n if (e instanceof HandledError && !options.retryCondition(e.value.error as FetchBaseQueryError, args, {\n attempt: retry,\n baseQueryApi: api,\n extraOptions\n })) {\n return e.value;\n }\n await options.backoff(retry, options.maxRetries);\n }\n }\n};\n\n/**\n * A utility that can wrap `baseQuery` in the API definition to provide retries with a basic exponential backoff.\n *\n * @example\n *\n * ```ts\n * // codeblock-meta title=\"Retry every request 5 times by default\"\n * import { createApi, fetchBaseQuery, retry } from '@reduxjs/toolkit/query/react'\n * interface Post {\n * id: number\n * name: string\n * }\n * type PostsResponse = Post[]\n *\n * // maxRetries: 5 is the default, and can be omitted. Shown for documentation purposes.\n * const staggeredBaseQuery = retry(fetchBaseQuery({ baseUrl: '/' }), { maxRetries: 5 });\n * export const api = createApi({\n * baseQuery: staggeredBaseQuery,\n * endpoints: (build) => ({\n * getPosts: build.query({\n * query: () => ({ url: 'posts' }),\n * }),\n * getPost: build.query({\n * query: (id) => ({ url: `post/${id}` }),\n * extraOptions: { maxRetries: 8 }, // You can override the retry behavior on each endpoint\n * }),\n * }),\n * });\n *\n * export const { useGetPostsQuery, useGetPostQuery } = api;\n * ```\n */\nexport const retry = /* @__PURE__ */Object.assign(retryWithBackoff, {\n fail\n});","import type { ThunkDispatch, ActionCreatorWithoutPayload // Workaround for API-Extractor\n} from '@reduxjs/toolkit';\nimport { createAction } from './rtkImports';\nexport const onFocus = /* @__PURE__ */createAction('__rtkq/focused');\nexport const onFocusLost = /* @__PURE__ */createAction('__rtkq/unfocused');\nexport const onOnline = /* @__PURE__ */createAction('__rtkq/online');\nexport const onOffline = /* @__PURE__ */createAction('__rtkq/offline');\nlet initialized = false;\n\n/**\n * A utility used to enable `refetchOnMount` and `refetchOnReconnect` behaviors.\n * It requires the dispatch method from your store.\n * Calling `setupListeners(store.dispatch)` will configure listeners with the recommended defaults,\n * but you have the option of providing a callback for more granular control.\n *\n * @example\n * ```ts\n * setupListeners(store.dispatch)\n * ```\n *\n * @param dispatch - The dispatch method from your store\n * @param customHandler - An optional callback for more granular control over listener behavior\n * @returns Return value of the handler.\n * The default handler returns an `unsubscribe` method that can be called to remove the listeners.\n */\nexport function setupListeners(dispatch: ThunkDispatch, customHandler?: (dispatch: ThunkDispatch, actions: {\n onFocus: typeof onFocus;\n onFocusLost: typeof onFocusLost;\n onOnline: typeof onOnline;\n onOffline: typeof onOffline;\n}) => () => void) {\n function defaultHandler() {\n const handleFocus = () => dispatch(onFocus());\n const handleFocusLost = () => dispatch(onFocusLost());\n const handleOnline = () => dispatch(onOnline());\n const handleOffline = () => dispatch(onOffline());\n const handleVisibilityChange = () => {\n if (window.document.visibilityState === 'visible') {\n handleFocus();\n } else {\n handleFocusLost();\n }\n };\n if (!initialized) {\n if (typeof window !== 'undefined' && window.addEventListener) {\n // Handle focus events\n window.addEventListener('visibilitychange', handleVisibilityChange, false);\n window.addEventListener('focus', handleFocus, false);\n\n // Handle connection events\n window.addEventListener('online', handleOnline, false);\n window.addEventListener('offline', handleOffline, false);\n initialized = true;\n }\n }\n const unsubscribe = () => {\n window.removeEventListener('focus', handleFocus);\n window.removeEventListener('visibilitychange', handleVisibilityChange);\n window.removeEventListener('online', handleOnline);\n window.removeEventListener('offline', handleOffline);\n initialized = false;\n };\n return unsubscribe;\n }\n return customHandler ? customHandler(dispatch, {\n onFocus,\n onFocusLost,\n onOffline,\n onOnline\n }) : defaultHandler();\n}","import { formatProdErrorMessage as _formatProdErrorMessage } from \"@reduxjs/toolkit\";\nimport type { SerializedError, ThunkAction, UnknownAction } from '@reduxjs/toolkit';\nimport type { Dispatch } from 'redux';\nimport type { SafePromise } from '../../tsHelpers';\nimport { asSafePromise } from '../../tsHelpers';\nimport type { Api, ApiContext } from '../apiTypes';\nimport type { BaseQueryError, QueryReturnValue } from '../baseQueryTypes';\nimport type { InternalSerializeQueryArgs } from '../defaultSerializeQueryArgs';\nimport type { EndpointDefinitions, MutationDefinition, QueryArgFrom, QueryDefinition, ResultTypeFrom } from '../endpointDefinitions';\nimport { countObjectKeys, getOrInsert, isNotNullish } from '../utils';\nimport type { SubscriptionOptions } from './apiState';\nimport type { QueryResultSelectorResult } from './buildSelectors';\nimport type { MutationThunk, QueryThunk, QueryThunkArg } from './buildThunks';\nimport type { ApiEndpointQuery } from './module';\nexport type BuildInitiateApiEndpointQuery> = {\n initiate: StartQueryActionCreator;\n};\nexport type BuildInitiateApiEndpointMutation> = {\n initiate: StartMutationActionCreator;\n};\nexport const forceQueryFnSymbol = Symbol('forceQueryFn');\nexport const isUpsertQuery = (arg: QueryThunkArg) => typeof arg[forceQueryFnSymbol] === 'function';\nexport type StartQueryActionCreatorOptions = {\n subscribe?: boolean;\n forceRefetch?: boolean | number;\n subscriptionOptions?: SubscriptionOptions;\n [forceQueryFnSymbol]?: () => QueryReturnValue;\n};\ntype StartQueryActionCreator> = (arg: QueryArgFrom, options?: StartQueryActionCreatorOptions) => ThunkAction, any, any, UnknownAction>;\nexport type QueryActionCreatorResult> = SafePromise> & {\n arg: QueryArgFrom;\n requestId: string;\n subscriptionOptions: SubscriptionOptions | undefined;\n abort(): void;\n unwrap(): Promise>;\n unsubscribe(): void;\n refetch(): QueryActionCreatorResult;\n updateSubscriptionOptions(options: SubscriptionOptions): void;\n queryCacheKey: string;\n};\ntype StartMutationActionCreator> = (arg: QueryArgFrom, options?: {\n /**\n * If this mutation should be tracked in the store.\n * If you just want to manually trigger this mutation using `dispatch` and don't care about the\n * result, state & potential errors being held in store, you can set this to false.\n * (defaults to `true`)\n */\n track?: boolean;\n fixedCacheKey?: string;\n}) => ThunkAction, any, any, UnknownAction>;\nexport type MutationActionCreatorResult> = SafePromise<{\n data: ResultTypeFrom;\n error?: undefined;\n} | {\n data?: undefined;\n error: Exclude ? BaseQuery : never>, undefined> | SerializedError;\n}> & {\n /** @internal */\n arg: {\n /**\n * The name of the given endpoint for the mutation\n */\n endpointName: string;\n /**\n * The original arguments supplied to the mutation call\n */\n originalArgs: QueryArgFrom;\n /**\n * Whether the mutation is being tracked in the store.\n */\n track?: boolean;\n fixedCacheKey?: string;\n };\n /**\n * A unique string generated for the request sequence\n */\n requestId: string;\n\n /**\n * A method to cancel the mutation promise. Note that this is not intended to prevent the mutation\n * that was fired off from reaching the server, but only to assist in handling the response.\n *\n * Calling `abort()` prior to the promise resolving will force it to reach the error state with\n * the serialized error:\n * `{ name: 'AbortError', message: 'Aborted' }`\n *\n * @example\n * ```ts\n * const [updateUser] = useUpdateUserMutation();\n *\n * useEffect(() => {\n * const promise = updateUser(id);\n * promise\n * .unwrap()\n * .catch((err) => {\n * if (err.name === 'AbortError') return;\n * // else handle the unexpected error\n * })\n *\n * return () => {\n * promise.abort();\n * }\n * }, [id, updateUser])\n * ```\n */\n abort(): void;\n /**\n * Unwraps a mutation call to provide the raw response/error.\n *\n * @remarks\n * If you need to access the error or success payload immediately after a mutation, you can chain .unwrap().\n *\n * @example\n * ```ts\n * // codeblock-meta title=\"Using .unwrap\"\n * addPost({ id: 1, name: 'Example' })\n * .unwrap()\n * .then((payload) => console.log('fulfilled', payload))\n * .catch((error) => console.error('rejected', error));\n * ```\n *\n * @example\n * ```ts\n * // codeblock-meta title=\"Using .unwrap with async await\"\n * try {\n * const payload = await addPost({ id: 1, name: 'Example' }).unwrap();\n * console.log('fulfilled', payload)\n * } catch (error) {\n * console.error('rejected', error);\n * }\n * ```\n */\n unwrap(): Promise>;\n /**\n * A method to manually unsubscribe from the mutation call, meaning it will be removed from cache after the usual caching grace period.\n The value returned by the hook will reset to `isUninitialized` afterwards.\n */\n reset(): void;\n};\nexport function buildInitiate({\n serializeQueryArgs,\n queryThunk,\n mutationThunk,\n api,\n context\n}: {\n serializeQueryArgs: InternalSerializeQueryArgs;\n queryThunk: QueryThunk;\n mutationThunk: MutationThunk;\n api: Api;\n context: ApiContext;\n}) {\n const runningQueries: Map | undefined>> = new Map();\n const runningMutations: Map | undefined>> = new Map();\n const {\n unsubscribeQueryResult,\n removeMutationResult,\n updateSubscriptionOptions\n } = api.internalActions;\n return {\n buildInitiateQuery,\n buildInitiateMutation,\n getRunningQueryThunk,\n getRunningMutationThunk,\n getRunningQueriesThunk,\n getRunningMutationsThunk\n };\n function getRunningQueryThunk(endpointName: string, queryArgs: any) {\n return (dispatch: Dispatch) => {\n const endpointDefinition = context.endpointDefinitions[endpointName];\n const queryCacheKey = serializeQueryArgs({\n queryArgs,\n endpointDefinition,\n endpointName\n });\n return runningQueries.get(dispatch)?.[queryCacheKey] as QueryActionCreatorResult | undefined;\n };\n }\n function getRunningMutationThunk(\n /**\n * this is only here to allow TS to infer the result type by input value\n * we could use it to validate the result, but it's probably not necessary\n */\n _endpointName: string, fixedCacheKeyOrRequestId: string) {\n return (dispatch: Dispatch) => {\n return runningMutations.get(dispatch)?.[fixedCacheKeyOrRequestId] as MutationActionCreatorResult | undefined;\n };\n }\n function getRunningQueriesThunk() {\n return (dispatch: Dispatch) => Object.values(runningQueries.get(dispatch) || {}).filter(isNotNullish);\n }\n function getRunningMutationsThunk() {\n return (dispatch: Dispatch) => Object.values(runningMutations.get(dispatch) || {}).filter(isNotNullish);\n }\n function middlewareWarning(dispatch: Dispatch) {\n if (process.env.NODE_ENV !== 'production') {\n if ((middlewareWarning as any).triggered) return;\n const returnedValue = dispatch(api.internalActions.internal_getRTKQSubscriptions());\n (middlewareWarning as any).triggered = true;\n\n // The RTKQ middleware should return the internal state object,\n // but it should _not_ be the action object.\n if (typeof returnedValue !== 'object' || typeof returnedValue?.type === 'string') {\n // Otherwise, must not have been added\n throw new Error(process.env.NODE_ENV === \"production\" ? _formatProdErrorMessage(34) : `Warning: Middleware for RTK-Query API at reducerPath \"${api.reducerPath}\" has not been added to the store.\nYou must add the middleware for RTK-Query to function correctly!`);\n }\n }\n }\n function buildInitiateQuery(endpointName: string, endpointDefinition: QueryDefinition) {\n const queryAction: StartQueryActionCreator = (arg, {\n subscribe = true,\n forceRefetch,\n subscriptionOptions,\n [forceQueryFnSymbol]: forceQueryFn,\n ...rest\n } = {}) => (dispatch, getState) => {\n const queryCacheKey = serializeQueryArgs({\n queryArgs: arg,\n endpointDefinition,\n endpointName\n });\n const thunk = queryThunk({\n ...rest,\n type: 'query',\n subscribe,\n forceRefetch: forceRefetch,\n subscriptionOptions,\n endpointName,\n originalArgs: arg,\n queryCacheKey,\n [forceQueryFnSymbol]: forceQueryFn\n });\n const selector = (api.endpoints[endpointName] as ApiEndpointQuery).select(arg);\n const thunkResult = dispatch(thunk);\n const stateAfter = selector(getState());\n middlewareWarning(dispatch);\n const {\n requestId,\n abort\n } = thunkResult;\n const skippedSynchronously = stateAfter.requestId !== requestId;\n const runningQuery = runningQueries.get(dispatch)?.[queryCacheKey];\n const selectFromState = () => selector(getState());\n const statePromise: QueryActionCreatorResult = Object.assign((forceQueryFn ?\n // a query has been forced (upsertQueryData)\n // -> we want to resolve it once data has been written with the data that will be written\n thunkResult.then(selectFromState) : skippedSynchronously && !runningQuery ?\n // a query has been skipped due to a condition and we do not have any currently running query\n // -> we want to resolve it immediately with the current data\n Promise.resolve(stateAfter) :\n // query just started or one is already in flight\n // -> wait for the running query, then resolve with data from after that\n Promise.all([runningQuery, thunkResult]).then(selectFromState)) as SafePromise, {\n arg,\n requestId,\n subscriptionOptions,\n queryCacheKey,\n abort,\n async unwrap() {\n const result = await statePromise;\n if (result.isError) {\n throw result.error;\n }\n return result.data;\n },\n refetch: () => dispatch(queryAction(arg, {\n subscribe: false,\n forceRefetch: true\n })),\n unsubscribe() {\n if (subscribe) dispatch(unsubscribeQueryResult({\n queryCacheKey,\n requestId\n }));\n },\n updateSubscriptionOptions(options: SubscriptionOptions) {\n statePromise.subscriptionOptions = options;\n dispatch(updateSubscriptionOptions({\n endpointName,\n requestId,\n queryCacheKey,\n options\n }));\n }\n });\n if (!runningQuery && !skippedSynchronously && !forceQueryFn) {\n const running = getOrInsert(runningQueries, dispatch, {});\n running[queryCacheKey] = statePromise;\n statePromise.then(() => {\n delete running[queryCacheKey];\n if (!countObjectKeys(running)) {\n runningQueries.delete(dispatch);\n }\n });\n }\n return statePromise;\n };\n return queryAction;\n }\n function buildInitiateMutation(endpointName: string): StartMutationActionCreator {\n return (arg, {\n track = true,\n fixedCacheKey\n } = {}) => (dispatch, getState) => {\n const thunk = mutationThunk({\n type: 'mutation',\n endpointName,\n originalArgs: arg,\n track,\n fixedCacheKey\n });\n const thunkResult = dispatch(thunk);\n middlewareWarning(dispatch);\n const {\n requestId,\n abort,\n unwrap\n } = thunkResult;\n const returnValuePromise = asSafePromise(thunkResult.unwrap().then(data => ({\n data\n })), error => ({\n error\n }));\n const reset = () => {\n dispatch(removeMutationResult({\n requestId,\n fixedCacheKey\n }));\n };\n const ret = Object.assign(returnValuePromise, {\n arg: thunkResult.arg,\n requestId,\n abort,\n unwrap,\n reset\n });\n const running = runningMutations.get(dispatch) || {};\n runningMutations.set(dispatch, running);\n running[requestId] = ret;\n ret.then(() => {\n delete running[requestId];\n if (!countObjectKeys(running)) {\n runningMutations.delete(dispatch);\n }\n });\n if (fixedCacheKey) {\n running[fixedCacheKey] = ret;\n ret.then(() => {\n if (running[fixedCacheKey] === ret) {\n delete running[fixedCacheKey];\n if (!countObjectKeys(running)) {\n runningMutations.delete(dispatch);\n }\n }\n });\n }\n return ret;\n };\n }\n}","import type { AsyncThunk, AsyncThunkPayloadCreator, Draft, ThunkAction, ThunkDispatch, UnknownAction } from '@reduxjs/toolkit';\nimport type { Patch } from 'immer';\nimport { isDraftable, produceWithPatches } from 'immer';\nimport type { Api, ApiContext } from '../apiTypes';\nimport type { BaseQueryError, BaseQueryFn, QueryReturnValue } from '../baseQueryTypes';\nimport type { InternalSerializeQueryArgs } from '../defaultSerializeQueryArgs';\nimport type { AssertTagTypes, EndpointDefinition, EndpointDefinitions, MutationDefinition, QueryArgFrom, QueryDefinition, ResultTypeFrom } from '../endpointDefinitions';\nimport { calculateProvidedBy, isQueryDefinition } from '../endpointDefinitions';\nimport { HandledError } from '../HandledError';\nimport type { UnwrapPromise } from '../tsHelpers';\nimport type { QueryKeys, QuerySubstateIdentifier, RootState } from './apiState';\nimport { QueryStatus } from './apiState';\nimport type { QueryActionCreatorResult, StartQueryActionCreatorOptions } from './buildInitiate';\nimport { forceQueryFnSymbol, isUpsertQuery } from './buildInitiate';\nimport type { ApiEndpointQuery, PrefetchOptions } from './module';\nimport { createAsyncThunk, isAllOf, isFulfilled, isPending, isRejected, isRejectedWithValue, SHOULD_AUTOBATCH } from './rtkImports';\nexport type BuildThunksApiEndpointQuery> = Matchers;\nexport type BuildThunksApiEndpointMutation> = Matchers;\ntype EndpointThunk> = Definition extends EndpointDefinition ? Thunk extends AsyncThunk ? AsyncThunk;\n}> : never : never;\nexport type PendingAction> = ReturnType['pending']>;\nexport type FulfilledAction> = ReturnType['fulfilled']>;\nexport type RejectedAction> = ReturnType['rejected']>;\nexport type Matcher = (value: any) => value is M;\nexport interface Matchers> {\n matchPending: Matcher>;\n matchFulfilled: Matcher>;\n matchRejected: Matcher>;\n}\nexport type QueryThunkArg = QuerySubstateIdentifier & StartQueryActionCreatorOptions & {\n type: 'query';\n originalArgs: unknown;\n endpointName: string;\n};\ntype MutationThunkArg = {\n type: 'mutation';\n originalArgs: unknown;\n endpointName: string;\n track?: boolean;\n fixedCacheKey?: string;\n};\nexport type ThunkResult = unknown;\nexport type ThunkApiMetaConfig = {\n pendingMeta: {\n startedTimeStamp: number;\n [SHOULD_AUTOBATCH]: true;\n };\n fulfilledMeta: {\n fulfilledTimeStamp: number;\n baseQueryMeta: unknown;\n [SHOULD_AUTOBATCH]: true;\n };\n rejectedMeta: {\n baseQueryMeta: unknown;\n [SHOULD_AUTOBATCH]: true;\n };\n};\nexport type QueryThunk = AsyncThunk;\nexport type MutationThunk = AsyncThunk;\nfunction defaultTransformResponse(baseQueryReturnValue: unknown) {\n return baseQueryReturnValue;\n}\nexport type MaybeDrafted = T | Draft;\nexport type Recipe = (data: MaybeDrafted) => void | MaybeDrafted;\nexport type UpsertRecipe = (data: MaybeDrafted | undefined) => void | MaybeDrafted;\nexport type PatchQueryDataThunk = >(endpointName: EndpointName, arg: QueryArgFrom, patches: readonly Patch[], updateProvided?: boolean) => ThunkAction;\nexport type UpdateQueryDataThunk = >(endpointName: EndpointName, arg: QueryArgFrom, updateRecipe: Recipe>, updateProvided?: boolean) => ThunkAction;\nexport type UpsertQueryDataThunk = >(endpointName: EndpointName, arg: QueryArgFrom, value: ResultTypeFrom) => ThunkAction ? Definitions[EndpointName] : never>, PartialState, any, UnknownAction>;\n\n/**\n * An object returned from dispatching a `api.util.updateQueryData` call.\n */\nexport type PatchCollection = {\n /**\n * An `immer` Patch describing the cache update.\n */\n patches: Patch[];\n /**\n * An `immer` Patch to revert the cache update.\n */\n inversePatches: Patch[];\n /**\n * A function that will undo the cache update.\n */\n undo: () => void;\n};\nexport function buildThunks({\n reducerPath,\n baseQuery,\n context: {\n endpointDefinitions\n },\n serializeQueryArgs,\n api,\n assertTagType\n}: {\n baseQuery: BaseQuery;\n reducerPath: ReducerPath;\n context: ApiContext;\n serializeQueryArgs: InternalSerializeQueryArgs;\n api: Api;\n assertTagType: AssertTagTypes;\n}) {\n type State = RootState;\n const patchQueryData: PatchQueryDataThunk = (endpointName, arg, patches, updateProvided) => (dispatch, getState) => {\n const endpointDefinition = endpointDefinitions[endpointName];\n const queryCacheKey = serializeQueryArgs({\n queryArgs: arg,\n endpointDefinition,\n endpointName\n });\n dispatch(api.internalActions.queryResultPatched({\n queryCacheKey,\n patches\n }));\n if (!updateProvided) {\n return;\n }\n const newValue = api.endpoints[endpointName].select(arg)(\n // Work around TS 4.1 mismatch\n getState() as RootState);\n const providedTags = calculateProvidedBy(endpointDefinition.providesTags, newValue.data, undefined, arg, {}, assertTagType);\n dispatch(api.internalActions.updateProvidedBy({\n queryCacheKey,\n providedTags\n }));\n };\n const updateQueryData: UpdateQueryDataThunk = (endpointName, arg, updateRecipe, updateProvided = true) => (dispatch, getState) => {\n const endpointDefinition = api.endpoints[endpointName];\n const currentState = endpointDefinition.select(arg)(\n // Work around TS 4.1 mismatch\n getState() as RootState);\n const ret: PatchCollection = {\n patches: [],\n inversePatches: [],\n undo: () => dispatch(api.util.patchQueryData(endpointName, arg, ret.inversePatches, updateProvided))\n };\n if (currentState.status === QueryStatus.uninitialized) {\n return ret;\n }\n let newValue;\n if ('data' in currentState) {\n if (isDraftable(currentState.data)) {\n const [value, patches, inversePatches] = produceWithPatches(currentState.data, updateRecipe);\n ret.patches.push(...patches);\n ret.inversePatches.push(...inversePatches);\n newValue = value;\n } else {\n newValue = updateRecipe(currentState.data);\n ret.patches.push({\n op: 'replace',\n path: [],\n value: newValue\n });\n ret.inversePatches.push({\n op: 'replace',\n path: [],\n value: currentState.data\n });\n }\n }\n if (ret.patches.length === 0) {\n return ret;\n }\n dispatch(api.util.patchQueryData(endpointName, arg, ret.patches, updateProvided));\n return ret;\n };\n const upsertQueryData: UpsertQueryDataThunk = (endpointName, arg, value) => dispatch => {\n return dispatch((api.endpoints[endpointName] as ApiEndpointQuery, Definitions>).initiate(arg, {\n subscribe: false,\n forceRefetch: true,\n [forceQueryFnSymbol]: () => ({\n data: value\n })\n }));\n };\n const executeEndpoint: AsyncThunkPayloadCreator;\n }> = async (arg, {\n signal,\n abort,\n rejectWithValue,\n fulfillWithValue,\n dispatch,\n getState,\n extra\n }) => {\n const endpointDefinition = endpointDefinitions[arg.endpointName];\n try {\n let transformResponse: (baseQueryReturnValue: any, meta: any, arg: any) => any = defaultTransformResponse;\n let result: QueryReturnValue;\n const baseQueryApi = {\n signal,\n abort,\n dispatch,\n getState,\n extra,\n endpoint: arg.endpointName,\n type: arg.type,\n forced: arg.type === 'query' ? isForcedQuery(arg, getState()) : undefined,\n queryCacheKey: arg.type === 'query' ? arg.queryCacheKey : undefined\n };\n const forceQueryFn = arg.type === 'query' ? arg[forceQueryFnSymbol] : undefined;\n if (forceQueryFn) {\n result = forceQueryFn();\n } else if (endpointDefinition.query) {\n result = await baseQuery(endpointDefinition.query(arg.originalArgs), baseQueryApi, endpointDefinition.extraOptions as any);\n if (endpointDefinition.transformResponse) {\n transformResponse = endpointDefinition.transformResponse;\n }\n } else {\n result = await endpointDefinition.queryFn(arg.originalArgs, baseQueryApi, endpointDefinition.extraOptions as any, arg => baseQuery(arg, baseQueryApi, endpointDefinition.extraOptions as any));\n }\n if (typeof process !== 'undefined' && process.env.NODE_ENV === 'development') {\n const what = endpointDefinition.query ? '`baseQuery`' : '`queryFn`';\n let err: undefined | string;\n if (!result) {\n err = `${what} did not return anything.`;\n } else if (typeof result !== 'object') {\n err = `${what} did not return an object.`;\n } else if (result.error && result.data) {\n err = `${what} returned an object containing both \\`error\\` and \\`result\\`.`;\n } else if (result.error === undefined && result.data === undefined) {\n err = `${what} returned an object containing neither a valid \\`error\\` and \\`result\\`. At least one of them should not be \\`undefined\\``;\n } else {\n for (const key of Object.keys(result)) {\n if (key !== 'error' && key !== 'data' && key !== 'meta') {\n err = `The object returned by ${what} has the unknown property ${key}.`;\n break;\n }\n }\n }\n if (err) {\n console.error(`Error encountered handling the endpoint ${arg.endpointName}.\n ${err}\n It needs to return an object with either the shape \\`{ data: }\\` or \\`{ error: }\\` that may contain an optional \\`meta\\` property.\n Object returned was:`, result);\n }\n }\n if (result.error) throw new HandledError(result.error, result.meta);\n return fulfillWithValue(await transformResponse(result.data, result.meta, arg.originalArgs), {\n fulfilledTimeStamp: Date.now(),\n baseQueryMeta: result.meta,\n [SHOULD_AUTOBATCH]: true\n });\n } catch (error) {\n let catchedError = error;\n if (catchedError instanceof HandledError) {\n let transformErrorResponse: (baseQueryReturnValue: any, meta: any, arg: any) => any = defaultTransformResponse;\n if (endpointDefinition.query && endpointDefinition.transformErrorResponse) {\n transformErrorResponse = endpointDefinition.transformErrorResponse;\n }\n try {\n return rejectWithValue(await transformErrorResponse(catchedError.value, catchedError.meta, arg.originalArgs), {\n baseQueryMeta: catchedError.meta,\n [SHOULD_AUTOBATCH]: true\n });\n } catch (e) {\n catchedError = e;\n }\n }\n if (typeof process !== 'undefined' && process.env.NODE_ENV !== 'production') {\n console.error(`An unhandled error occurred processing a request for the endpoint \"${arg.endpointName}\".\nIn the case of an unhandled error, no tags will be \"provided\" or \"invalidated\".`, catchedError);\n } else {\n console.error(catchedError);\n }\n throw catchedError;\n }\n };\n function isForcedQuery(arg: QueryThunkArg, state: RootState) {\n const requestState = state[reducerPath]?.queries?.[arg.queryCacheKey];\n const baseFetchOnMountOrArgChange = state[reducerPath]?.config.refetchOnMountOrArgChange;\n const fulfilledVal = requestState?.fulfilledTimeStamp;\n const refetchVal = arg.forceRefetch ?? (arg.subscribe && baseFetchOnMountOrArgChange);\n if (refetchVal) {\n // Return if it's true or compare the dates because it must be a number\n return refetchVal === true || (Number(new Date()) - Number(fulfilledVal)) / 1000 >= refetchVal;\n }\n return false;\n }\n const queryThunk = createAsyncThunk;\n }>(`${reducerPath}/executeQuery`, executeEndpoint, {\n getPendingMeta() {\n return {\n startedTimeStamp: Date.now(),\n [SHOULD_AUTOBATCH]: true\n };\n },\n condition(queryThunkArgs, {\n getState\n }) {\n const state = getState();\n const requestState = state[reducerPath]?.queries?.[queryThunkArgs.queryCacheKey];\n const fulfilledVal = requestState?.fulfilledTimeStamp;\n const currentArg = queryThunkArgs.originalArgs;\n const previousArg = requestState?.originalArgs;\n const endpointDefinition = endpointDefinitions[queryThunkArgs.endpointName];\n\n // Order of these checks matters.\n // In order for `upsertQueryData` to successfully run while an existing request is in flight,\n /// we have to check for that first, otherwise `queryThunk` will bail out and not run at all.\n if (isUpsertQuery(queryThunkArgs)) {\n return true;\n }\n\n // Don't retry a request that's currently in-flight\n if (requestState?.status === 'pending') {\n return false;\n }\n\n // if this is forced, continue\n if (isForcedQuery(queryThunkArgs, state)) {\n return true;\n }\n if (isQueryDefinition(endpointDefinition) && endpointDefinition?.forceRefetch?.({\n currentArg,\n previousArg,\n endpointState: requestState,\n state\n })) {\n return true;\n }\n\n // Pull from the cache unless we explicitly force refetch or qualify based on time\n if (fulfilledVal) {\n // Value is cached and we didn't specify to refresh, skip it.\n return false;\n }\n return true;\n },\n dispatchConditionRejection: true\n });\n const mutationThunk = createAsyncThunk;\n }>(`${reducerPath}/executeMutation`, executeEndpoint, {\n getPendingMeta() {\n return {\n startedTimeStamp: Date.now(),\n [SHOULD_AUTOBATCH]: true\n };\n }\n });\n const hasTheForce = (options: any): options is {\n force: boolean;\n } => 'force' in options;\n const hasMaxAge = (options: any): options is {\n ifOlderThan: false | number;\n } => 'ifOlderThan' in options;\n const prefetch = ,>(endpointName: EndpointName, arg: any, options: PrefetchOptions): ThunkAction => (dispatch: ThunkDispatch, getState: () => any) => {\n const force = hasTheForce(options) && options.force;\n const maxAge = hasMaxAge(options) && options.ifOlderThan;\n const queryAction = (force: boolean = true) => {\n const options = {\n forceRefetch: force,\n isPrefetch: true\n };\n return (api.endpoints[endpointName] as ApiEndpointQuery).initiate(arg, options);\n };\n const latestStateValue = (api.endpoints[endpointName] as ApiEndpointQuery).select(arg)(getState());\n if (force) {\n dispatch(queryAction());\n } else if (maxAge) {\n const lastFulfilledTs = latestStateValue?.fulfilledTimeStamp;\n if (!lastFulfilledTs) {\n dispatch(queryAction());\n return;\n }\n const shouldRetrigger = (Number(new Date()) - Number(new Date(lastFulfilledTs))) / 1000 >= maxAge;\n if (shouldRetrigger) {\n dispatch(queryAction());\n }\n } else {\n // If prefetching with no options, just let it try\n dispatch(queryAction(false));\n }\n };\n function matchesEndpoint(endpointName: string) {\n return (action: any): action is UnknownAction => action?.meta?.arg?.endpointName === endpointName;\n }\n function buildMatchThunkActions | AsyncThunk>(thunk: Thunk, endpointName: string) {\n return {\n matchPending: isAllOf(isPending(thunk), matchesEndpoint(endpointName)),\n matchFulfilled: isAllOf(isFulfilled(thunk), matchesEndpoint(endpointName)),\n matchRejected: isAllOf(isRejected(thunk), matchesEndpoint(endpointName))\n } as Matchers;\n }\n return {\n queryThunk,\n mutationThunk,\n prefetch,\n updateQueryData,\n upsertQueryData,\n patchQueryData,\n buildMatchThunkActions\n };\n}\nexport function calculateProvidedByThunk(action: UnwrapPromise> | ReturnType>>, type: 'providesTags' | 'invalidatesTags', endpointDefinitions: EndpointDefinitions, assertTagType: AssertTagTypes) {\n return calculateProvidedBy(endpointDefinitions[action.meta.arg.endpointName][type], isFulfilled(action) ? action.payload : undefined, isRejectedWithValue(action) ? action.payload : undefined, action.meta.arg.originalArgs, 'baseQueryMeta' in action.meta ? action.meta.baseQueryMeta : undefined, assertTagType);\n}","import type { Action, PayloadAction, UnknownAction } from '@reduxjs/toolkit';\nimport { combineReducers, createAction, createSlice, isAnyOf, isFulfilled, isRejectedWithValue, createNextState, prepareAutoBatched, SHOULD_AUTOBATCH, nanoid } from './rtkImports';\nimport type { QuerySubstateIdentifier, QuerySubState, MutationSubstateIdentifier, MutationSubState, MutationState, QueryState, InvalidationState, Subscribers, QueryCacheKey, SubscriptionState, ConfigState, QueryKeys } from './apiState';\nimport { QueryStatus } from './apiState';\nimport type { MutationThunk, QueryThunk, QueryThunkArg, RejectedAction } from './buildThunks';\nimport { calculateProvidedByThunk } from './buildThunks';\nimport type { AssertTagTypes, DefinitionType, EndpointDefinitions, FullTagDescription, QueryArgFrom, QueryDefinition, ResultTypeFrom } from '../endpointDefinitions';\nimport type { Patch } from 'immer';\nimport { isDraft } from 'immer';\nimport { applyPatches, original } from 'immer';\nimport { onFocus, onFocusLost, onOffline, onOnline } from './setupListeners';\nimport { isDocumentVisible, isOnline, copyWithStructuralSharing } from '../utils';\nimport type { ApiContext } from '../apiTypes';\nimport { isUpsertQuery } from './buildInitiate';\nimport type { InternalSerializeQueryArgs } from '../defaultSerializeQueryArgs';\n\n/**\n * A typesafe single entry to be upserted into the cache\n */\nexport type NormalizedQueryUpsertEntry> = {\n endpointName: EndpointName;\n arg: QueryArgFrom;\n value: ResultTypeFrom;\n};\n\n/**\n * The internal version that is not typesafe since we can't carry the generics through `createSlice`\n */\ntype NormalizedQueryUpsertEntryPayload = {\n endpointName: string;\n arg: unknown;\n value: unknown;\n};\nexport type ProcessedQueryUpsertEntry = {\n queryDescription: QueryThunkArg;\n value: unknown;\n};\n\n/**\n * A typesafe representation of a util action creator that accepts cache entry descriptions to upsert\n */\nexport type UpsertEntries = (>>(entries: [...{ [I in keyof EndpointNames]: NormalizedQueryUpsertEntry }]) => PayloadAction) & {\n match: (action: unknown) => action is PayloadAction;\n};\nfunction updateQuerySubstateIfExists(state: QueryState, queryCacheKey: QueryCacheKey, update: (substate: QuerySubState) => void) {\n const substate = state[queryCacheKey];\n if (substate) {\n update(substate);\n }\n}\nexport function getMutationCacheKey(id: MutationSubstateIdentifier | {\n requestId: string;\n arg: {\n fixedCacheKey?: string | undefined;\n };\n}): string;\nexport function getMutationCacheKey(id: {\n fixedCacheKey?: string;\n requestId?: string;\n}): string | undefined;\nexport function getMutationCacheKey(id: {\n fixedCacheKey?: string;\n requestId?: string;\n} | MutationSubstateIdentifier | {\n requestId: string;\n arg: {\n fixedCacheKey?: string | undefined;\n };\n}): string | undefined {\n return ('arg' in id ? id.arg.fixedCacheKey : id.fixedCacheKey) ?? id.requestId;\n}\nfunction updateMutationSubstateIfExists(state: MutationState, id: MutationSubstateIdentifier | {\n requestId: string;\n arg: {\n fixedCacheKey?: string | undefined;\n };\n}, update: (substate: MutationSubState) => void) {\n const substate = state[getMutationCacheKey(id)];\n if (substate) {\n update(substate);\n }\n}\nconst initialState = {} as any;\nexport function buildSlice({\n reducerPath,\n queryThunk,\n mutationThunk,\n serializeQueryArgs,\n context: {\n endpointDefinitions: definitions,\n apiUid,\n extractRehydrationInfo,\n hasRehydrationInfo\n },\n assertTagType,\n config\n}: {\n reducerPath: string;\n queryThunk: QueryThunk;\n mutationThunk: MutationThunk;\n serializeQueryArgs: InternalSerializeQueryArgs;\n context: ApiContext;\n assertTagType: AssertTagTypes;\n config: Omit, 'online' | 'focused' | 'middlewareRegistered'>;\n}) {\n const resetApiState = createAction(`${reducerPath}/resetApiState`);\n function writePendingCacheEntry(draft: QueryState, arg: QueryThunkArg, upserting: boolean, meta: {\n arg: QueryThunkArg;\n requestId: string;\n // requestStatus: 'pending'\n } & {\n startedTimeStamp: number;\n }) {\n draft[arg.queryCacheKey] ??= {\n status: QueryStatus.uninitialized,\n endpointName: arg.endpointName\n };\n updateQuerySubstateIfExists(draft, arg.queryCacheKey, substate => {\n substate.status = QueryStatus.pending;\n substate.requestId = upserting && substate.requestId ?\n // for `upsertQuery` **updates**, keep the current `requestId`\n substate.requestId :\n // for normal queries or `upsertQuery` **inserts** always update the `requestId`\n meta.requestId;\n if (arg.originalArgs !== undefined) {\n substate.originalArgs = arg.originalArgs;\n }\n substate.startedTimeStamp = meta.startedTimeStamp;\n });\n }\n function writeFulfilledCacheEntry(draft: QueryState, meta: {\n arg: QueryThunkArg;\n requestId: string;\n // requestStatus: 'fulfilled'\n } & {\n fulfilledTimeStamp: number;\n baseQueryMeta: unknown;\n // RTK_autoBatch: true\n }, payload: unknown, upserting: boolean) {\n updateQuerySubstateIfExists(draft, meta.arg.queryCacheKey, substate => {\n if (substate.requestId !== meta.requestId && !upserting) return;\n const {\n merge\n } = definitions[meta.arg.endpointName] as QueryDefinition;\n substate.status = QueryStatus.fulfilled;\n if (merge) {\n if (substate.data !== undefined) {\n const {\n fulfilledTimeStamp,\n arg,\n baseQueryMeta,\n requestId\n } = meta;\n // There's existing cache data. Let the user merge it in themselves.\n // We're already inside an Immer-powered reducer, and the user could just mutate `substate.data`\n // themselves inside of `merge()`. But, they might also want to return a new value.\n // Try to let Immer figure that part out, save the result, and assign it to `substate.data`.\n let newData = createNextState(substate.data, draftSubstateData => {\n // As usual with Immer, you can mutate _or_ return inside here, but not both\n return merge(draftSubstateData, payload, {\n arg: arg.originalArgs,\n baseQueryMeta,\n fulfilledTimeStamp,\n requestId\n });\n });\n substate.data = newData;\n } else {\n // Presumably a fresh request. Just cache the response data.\n substate.data = payload;\n }\n } else {\n // Assign or safely update the cache data.\n substate.data = definitions[meta.arg.endpointName].structuralSharing ?? true ? copyWithStructuralSharing(isDraft(substate.data) ? original(substate.data) : substate.data, payload) : payload;\n }\n delete substate.error;\n substate.fulfilledTimeStamp = meta.fulfilledTimeStamp;\n });\n }\n const querySlice = createSlice({\n name: `${reducerPath}/queries`,\n initialState: initialState as QueryState,\n reducers: {\n removeQueryResult: {\n reducer(draft, {\n payload: {\n queryCacheKey\n }\n }: PayloadAction) {\n delete draft[queryCacheKey];\n },\n prepare: prepareAutoBatched()\n },\n cacheEntriesUpserted: {\n reducer(draft, action: PayloadAction) {\n for (const entry of action.payload) {\n const {\n queryDescription: arg,\n value\n } = entry;\n writePendingCacheEntry(draft, arg, true, {\n arg,\n requestId: action.meta.requestId,\n startedTimeStamp: action.meta.timestamp\n });\n writeFulfilledCacheEntry(draft, {\n arg,\n requestId: action.meta.requestId,\n fulfilledTimeStamp: action.meta.timestamp,\n baseQueryMeta: {}\n }, value,\n // We know we're upserting here\n true);\n }\n },\n prepare: (payload: NormalizedQueryUpsertEntryPayload[]) => {\n const queryDescriptions: ProcessedQueryUpsertEntry[] = payload.map(entry => {\n const {\n endpointName,\n arg,\n value\n } = entry;\n const endpointDefinition = definitions[endpointName];\n const queryDescription: QueryThunkArg = {\n type: 'query',\n endpointName: endpointName,\n originalArgs: entry.arg,\n queryCacheKey: serializeQueryArgs({\n queryArgs: arg,\n endpointDefinition,\n endpointName\n })\n };\n return {\n queryDescription,\n value\n };\n });\n const result = {\n payload: queryDescriptions,\n meta: {\n [SHOULD_AUTOBATCH]: true,\n requestId: nanoid(),\n timestamp: Date.now()\n }\n };\n return result;\n }\n },\n queryResultPatched: {\n reducer(draft, {\n payload: {\n queryCacheKey,\n patches\n }\n }: PayloadAction) {\n updateQuerySubstateIfExists(draft, queryCacheKey, substate => {\n substate.data = applyPatches(substate.data as any, patches.concat());\n });\n },\n prepare: prepareAutoBatched()\n }\n },\n extraReducers(builder) {\n builder.addCase(queryThunk.pending, (draft, {\n meta,\n meta: {\n arg\n }\n }) => {\n const upserting = isUpsertQuery(arg);\n writePendingCacheEntry(draft, arg, upserting, meta);\n }).addCase(queryThunk.fulfilled, (draft, {\n meta,\n payload\n }) => {\n const upserting = isUpsertQuery(meta.arg);\n writeFulfilledCacheEntry(draft, meta, payload, upserting);\n }).addCase(queryThunk.rejected, (draft, {\n meta: {\n condition,\n arg,\n requestId\n },\n error,\n payload\n }) => {\n updateQuerySubstateIfExists(draft, arg.queryCacheKey, substate => {\n if (condition) {\n // request was aborted due to condition (another query already running)\n } else {\n // request failed\n if (substate.requestId !== requestId) return;\n substate.status = QueryStatus.rejected;\n substate.error = (payload ?? error) as any;\n }\n });\n }).addMatcher(hasRehydrationInfo, (draft, action) => {\n const {\n queries\n } = extractRehydrationInfo(action)!;\n for (const [key, entry] of Object.entries(queries)) {\n if (\n // do not rehydrate entries that were currently in flight.\n entry?.status === QueryStatus.fulfilled || entry?.status === QueryStatus.rejected) {\n draft[key] = entry;\n }\n }\n });\n }\n });\n const mutationSlice = createSlice({\n name: `${reducerPath}/mutations`,\n initialState: initialState as MutationState,\n reducers: {\n removeMutationResult: {\n reducer(draft, {\n payload\n }: PayloadAction) {\n const cacheKey = getMutationCacheKey(payload);\n if (cacheKey in draft) {\n delete draft[cacheKey];\n }\n },\n prepare: prepareAutoBatched()\n }\n },\n extraReducers(builder) {\n builder.addCase(mutationThunk.pending, (draft, {\n meta,\n meta: {\n requestId,\n arg,\n startedTimeStamp\n }\n }) => {\n if (!arg.track) return;\n draft[getMutationCacheKey(meta)] = {\n requestId,\n status: QueryStatus.pending,\n endpointName: arg.endpointName,\n startedTimeStamp\n };\n }).addCase(mutationThunk.fulfilled, (draft, {\n payload,\n meta\n }) => {\n if (!meta.arg.track) return;\n updateMutationSubstateIfExists(draft, meta, substate => {\n if (substate.requestId !== meta.requestId) return;\n substate.status = QueryStatus.fulfilled;\n substate.data = payload;\n substate.fulfilledTimeStamp = meta.fulfilledTimeStamp;\n });\n }).addCase(mutationThunk.rejected, (draft, {\n payload,\n error,\n meta\n }) => {\n if (!meta.arg.track) return;\n updateMutationSubstateIfExists(draft, meta, substate => {\n if (substate.requestId !== meta.requestId) return;\n substate.status = QueryStatus.rejected;\n substate.error = (payload ?? error) as any;\n });\n }).addMatcher(hasRehydrationInfo, (draft, action) => {\n const {\n mutations\n } = extractRehydrationInfo(action)!;\n for (const [key, entry] of Object.entries(mutations)) {\n if (\n // do not rehydrate entries that were currently in flight.\n (entry?.status === QueryStatus.fulfilled || entry?.status === QueryStatus.rejected) &&\n // only rehydrate endpoints that were persisted using a `fixedCacheKey`\n key !== entry?.requestId) {\n draft[key] = entry;\n }\n }\n });\n }\n });\n const invalidationSlice = createSlice({\n name: `${reducerPath}/invalidation`,\n initialState: initialState as InvalidationState,\n reducers: {\n updateProvidedBy: {\n reducer(draft, action: PayloadAction<{\n queryCacheKey: QueryCacheKey;\n providedTags: readonly FullTagDescription[];\n }>) {\n const {\n queryCacheKey,\n providedTags\n } = action.payload;\n for (const tagTypeSubscriptions of Object.values(draft)) {\n for (const idSubscriptions of Object.values(tagTypeSubscriptions)) {\n const foundAt = idSubscriptions.indexOf(queryCacheKey);\n if (foundAt !== -1) {\n idSubscriptions.splice(foundAt, 1);\n }\n }\n }\n for (const {\n type,\n id\n } of providedTags) {\n const subscribedQueries = (draft[type] ??= {})[id || '__internal_without_id'] ??= [];\n const alreadySubscribed = subscribedQueries.includes(queryCacheKey);\n if (!alreadySubscribed) {\n subscribedQueries.push(queryCacheKey);\n }\n }\n },\n prepare: prepareAutoBatched<{\n queryCacheKey: QueryCacheKey;\n providedTags: readonly FullTagDescription[];\n }>()\n }\n },\n extraReducers(builder) {\n builder.addCase(querySlice.actions.removeQueryResult, (draft, {\n payload: {\n queryCacheKey\n }\n }) => {\n for (const tagTypeSubscriptions of Object.values(draft)) {\n for (const idSubscriptions of Object.values(tagTypeSubscriptions)) {\n const foundAt = idSubscriptions.indexOf(queryCacheKey);\n if (foundAt !== -1) {\n idSubscriptions.splice(foundAt, 1);\n }\n }\n }\n }).addMatcher(hasRehydrationInfo, (draft, action) => {\n const {\n provided\n } = extractRehydrationInfo(action)!;\n for (const [type, incomingTags] of Object.entries(provided)) {\n for (const [id, cacheKeys] of Object.entries(incomingTags)) {\n const subscribedQueries = (draft[type] ??= {})[id || '__internal_without_id'] ??= [];\n for (const queryCacheKey of cacheKeys) {\n const alreadySubscribed = subscribedQueries.includes(queryCacheKey);\n if (!alreadySubscribed) {\n subscribedQueries.push(queryCacheKey);\n }\n }\n }\n }\n }).addMatcher(isAnyOf(isFulfilled(queryThunk), isRejectedWithValue(queryThunk)), (draft, action) => {\n const providedTags = calculateProvidedByThunk(action, 'providesTags', definitions, assertTagType);\n const {\n queryCacheKey\n } = action.meta.arg;\n invalidationSlice.caseReducers.updateProvidedBy(draft, invalidationSlice.actions.updateProvidedBy({\n queryCacheKey,\n providedTags\n }));\n });\n }\n });\n\n // Dummy slice to generate actions\n const subscriptionSlice = createSlice({\n name: `${reducerPath}/subscriptions`,\n initialState: initialState as SubscriptionState,\n reducers: {\n updateSubscriptionOptions(d, a: PayloadAction<{\n endpointName: string;\n requestId: string;\n options: Subscribers[number];\n } & QuerySubstateIdentifier>) {\n // Dummy\n },\n unsubscribeQueryResult(d, a: PayloadAction<{\n requestId: string;\n } & QuerySubstateIdentifier>) {\n // Dummy\n },\n internal_getRTKQSubscriptions() {}\n }\n });\n const internalSubscriptionsSlice = createSlice({\n name: `${reducerPath}/internalSubscriptions`,\n initialState: initialState as SubscriptionState,\n reducers: {\n subscriptionsUpdated: {\n reducer(state, action: PayloadAction) {\n return applyPatches(state, action.payload);\n },\n prepare: prepareAutoBatched()\n }\n }\n });\n const configSlice = createSlice({\n name: `${reducerPath}/config`,\n initialState: {\n online: isOnline(),\n focused: isDocumentVisible(),\n middlewareRegistered: false,\n ...config\n } as ConfigState,\n reducers: {\n middlewareRegistered(state, {\n payload\n }: PayloadAction) {\n state.middlewareRegistered = state.middlewareRegistered === 'conflict' || apiUid !== payload ? 'conflict' : true;\n }\n },\n extraReducers: builder => {\n builder.addCase(onOnline, state => {\n state.online = true;\n }).addCase(onOffline, state => {\n state.online = false;\n }).addCase(onFocus, state => {\n state.focused = true;\n }).addCase(onFocusLost, state => {\n state.focused = false;\n })\n // update the state to be a new object to be picked up as a \"state change\"\n // by redux-persist's `autoMergeLevel2`\n .addMatcher(hasRehydrationInfo, draft => ({\n ...draft\n }));\n }\n });\n const combinedReducer = combineReducers({\n queries: querySlice.reducer,\n mutations: mutationSlice.reducer,\n provided: invalidationSlice.reducer,\n subscriptions: internalSubscriptionsSlice.reducer,\n config: configSlice.reducer\n });\n const reducer: typeof combinedReducer = (state, action) => combinedReducer(resetApiState.match(action) ? undefined : state, action);\n const actions = {\n ...configSlice.actions,\n ...querySlice.actions,\n ...subscriptionSlice.actions,\n ...internalSubscriptionsSlice.actions,\n ...mutationSlice.actions,\n ...invalidationSlice.actions,\n resetApiState\n };\n return {\n reducer,\n actions\n };\n}\nexport type SliceActions = ReturnType['actions'];","/**\n * Assumes a browser is online if `undefined`, otherwise makes a best effort\n * @link https://developer.mozilla.org/en-US/docs/Web/API/NavigatorOnLine/onLine\n */\nexport function isOnline() {\n // We set the default config value in the store, so we'd need to check for this in a SSR env\n return typeof navigator === 'undefined' ? true : navigator.onLine === undefined ? true : navigator.onLine;\n}","/**\r\n * Assumes true for a non-browser env, otherwise makes a best effort\r\n * @link https://developer.mozilla.org/en-US/docs/Web/API/Document/visibilityState\r\n */\nexport function isDocumentVisible(): boolean {\n // `document` may not exist in non-browser envs (like RN)\n if (typeof document === 'undefined') {\n return true;\n }\n // Match true for visible, prerender, undefined\n return document.visibilityState !== 'hidden';\n}","import type { InternalSerializeQueryArgs } from '../defaultSerializeQueryArgs';\nimport type { EndpointDefinitions, MutationDefinition, QueryArgFrom, QueryDefinition, ReducerPathFrom, TagDescription, TagTypesFrom } from '../endpointDefinitions';\nimport { expandTagDescription } from '../endpointDefinitions';\nimport { flatten, isNotNullish } from '../utils';\nimport type { MutationSubState, QueryCacheKey, QueryKeys, QueryState, QuerySubState, RequestStatusFlags, RootState as _RootState } from './apiState';\nimport { QueryStatus, getRequestStatusFlags } from './apiState';\nimport { getMutationCacheKey } from './buildSlice';\nimport type { createSelector as _createSelector } from './rtkImports';\nimport { createNextState } from './rtkImports';\nexport type SkipToken = typeof skipToken;\n/**\n * Can be passed into `useQuery`, `useQueryState` or `useQuerySubscription`\n * instead of the query argument to get the same effect as if setting\n * `skip: true` in the query options.\n *\n * Useful for scenarios where a query should be skipped when `arg` is `undefined`\n * and TypeScript complains about it because `arg` is not allowed to be passed\n * in as `undefined`, such as\n *\n * ```ts\n * // codeblock-meta title=\"will error if the query argument is not allowed to be undefined\" no-transpile\n * useSomeQuery(arg, { skip: !!arg })\n * ```\n *\n * ```ts\n * // codeblock-meta title=\"using skipToken instead\" no-transpile\n * useSomeQuery(arg ?? skipToken)\n * ```\n *\n * If passed directly into a query or mutation selector, that selector will always\n * return an uninitialized state.\n */\nexport const skipToken = /* @__PURE__ */Symbol.for('RTKQ/skipToken');\nexport type BuildSelectorsApiEndpointQuery, Definitions extends EndpointDefinitions> = {\n select: QueryResultSelectorFactory, ReducerPathFrom>>;\n};\nexport type BuildSelectorsApiEndpointMutation, Definitions extends EndpointDefinitions> = {\n select: MutationResultSelectorFactory, ReducerPathFrom>>;\n};\ntype QueryResultSelectorFactory, RootState> = (queryArg: QueryArgFrom | SkipToken) => (state: RootState) => QueryResultSelectorResult;\nexport type QueryResultSelectorResult> = QuerySubState & RequestStatusFlags;\ntype MutationResultSelectorFactory, RootState> = (requestId: string | {\n requestId: string | undefined;\n fixedCacheKey: string | undefined;\n} | SkipToken) => (state: RootState) => MutationResultSelectorResult;\nexport type MutationResultSelectorResult> = MutationSubState & RequestStatusFlags;\nconst initialSubState: QuerySubState = {\n status: QueryStatus.uninitialized as const\n};\n\n// abuse immer to freeze default states\nconst defaultQuerySubState = /* @__PURE__ */createNextState(initialSubState, () => {});\nconst defaultMutationSubState = /* @__PURE__ */createNextState(initialSubState as MutationSubState, () => {});\nexport function buildSelectors({\n serializeQueryArgs,\n reducerPath,\n createSelector\n}: {\n serializeQueryArgs: InternalSerializeQueryArgs;\n reducerPath: ReducerPath;\n createSelector: typeof _createSelector;\n}) {\n type RootState = _RootState;\n const selectSkippedQuery = (state: RootState) => defaultQuerySubState;\n const selectSkippedMutation = (state: RootState) => defaultMutationSubState;\n return {\n buildQuerySelector,\n buildMutationSelector,\n selectInvalidatedBy,\n selectCachedArgsForQuery\n };\n function withRequestFlags(substate: T): T & RequestStatusFlags {\n return {\n ...substate,\n ...getRequestStatusFlags(substate.status)\n };\n }\n function selectInternalState(rootState: RootState) {\n const state = rootState[reducerPath];\n if (process.env.NODE_ENV !== 'production') {\n if (!state) {\n if ((selectInternalState as any).triggered) return state;\n (selectInternalState as any).triggered = true;\n console.error(`Error: No data found at \\`state.${reducerPath}\\`. Did you forget to add the reducer to the store?`);\n }\n }\n return state;\n }\n function buildQuerySelector(endpointName: string, endpointDefinition: QueryDefinition) {\n return ((queryArgs: any) => {\n if (queryArgs === skipToken) {\n return createSelector(selectSkippedQuery, withRequestFlags);\n }\n const serializedArgs = serializeQueryArgs({\n queryArgs,\n endpointDefinition,\n endpointName\n });\n const selectQuerySubstate = (state: RootState) => selectInternalState(state)?.queries?.[serializedArgs] ?? defaultQuerySubState;\n return createSelector(selectQuerySubstate, withRequestFlags);\n }) as QueryResultSelectorFactory;\n }\n function buildMutationSelector() {\n return (id => {\n let mutationId: string | typeof skipToken;\n if (typeof id === 'object') {\n mutationId = getMutationCacheKey(id) ?? skipToken;\n } else {\n mutationId = id;\n }\n const selectMutationSubstate = (state: RootState) => selectInternalState(state)?.mutations?.[mutationId as string] ?? defaultMutationSubState;\n const finalSelectMutationSubstate = mutationId === skipToken ? selectSkippedMutation : selectMutationSubstate;\n return createSelector(finalSelectMutationSubstate, withRequestFlags);\n }) as MutationResultSelectorFactory;\n }\n function selectInvalidatedBy(state: RootState, tags: ReadonlyArray | null | undefined>): Array<{\n endpointName: string;\n originalArgs: any;\n queryCacheKey: QueryCacheKey;\n }> {\n const apiState = state[reducerPath];\n const toInvalidate = new Set();\n for (const tag of tags.filter(isNotNullish).map(expandTagDescription)) {\n const provided = apiState.provided[tag.type];\n if (!provided) {\n continue;\n }\n let invalidateSubscriptions = (tag.id !== undefined ?\n // id given: invalidate all queries that provide this type & id\n provided[tag.id] :\n // no id: invalidate all queries that provide this type\n flatten(Object.values(provided))) ?? [];\n for (const invalidate of invalidateSubscriptions) {\n toInvalidate.add(invalidate);\n }\n }\n return flatten(Array.from(toInvalidate.values()).map(queryCacheKey => {\n const querySubState = apiState.queries[queryCacheKey];\n return querySubState ? [{\n queryCacheKey,\n endpointName: querySubState.endpointName!,\n originalArgs: querySubState.originalArgs\n }] : [];\n }));\n }\n function selectCachedArgsForQuery>(state: RootState, queryName: QueryName): Array> {\n return Object.values(state[reducerPath].queries as QueryState).filter((entry): entry is Exclude, {\n status: QueryStatus.uninitialized;\n }> => entry?.endpointName === queryName && entry.status !== QueryStatus.uninitialized).map(entry => entry.originalArgs);\n }\n}","import { formatProdErrorMessage as _formatProdErrorMessage } from \"@reduxjs/toolkit\";\nimport type { Api, ApiContext, Module, ModuleName } from './apiTypes';\nimport type { CombinedState } from './core/apiState';\nimport type { BaseQueryArg, BaseQueryFn } from './baseQueryTypes';\nimport type { SerializeQueryArgs } from './defaultSerializeQueryArgs';\nimport { defaultSerializeQueryArgs } from './defaultSerializeQueryArgs';\nimport type { EndpointBuilder, EndpointDefinitions } from './endpointDefinitions';\nimport { DefinitionType, isQueryDefinition } from './endpointDefinitions';\nimport { nanoid } from './core/rtkImports';\nimport type { UnknownAction } from '@reduxjs/toolkit';\nimport type { NoInfer } from './tsHelpers';\nimport { weakMapMemoize } from 'reselect';\nexport interface CreateApiOptions {\n /**\n * The base query used by each endpoint if no `queryFn` option is specified. RTK Query exports a utility called [fetchBaseQuery](./fetchBaseQuery) as a lightweight wrapper around `fetch` for common use-cases. See [Customizing Queries](../../rtk-query/usage/customizing-queries) if `fetchBaseQuery` does not handle your requirements.\n *\n * @example\n *\n * ```ts\n * import { createApi, fetchBaseQuery } from '@reduxjs/toolkit/query'\n *\n * const api = createApi({\n * // highlight-start\n * baseQuery: fetchBaseQuery({ baseUrl: '/' }),\n * // highlight-end\n * endpoints: (build) => ({\n * // ...endpoints\n * }),\n * })\n * ```\n */\n baseQuery: BaseQuery;\n /**\n * An array of string tag type names. Specifying tag types is optional, but you should define them so that they can be used for caching and invalidation. When defining a tag type, you will be able to [provide](../../rtk-query/usage/automated-refetching#providing-tags) them with `providesTags` and [invalidate](../../rtk-query/usage/automated-refetching#invalidating-tags) them with `invalidatesTags` when configuring [endpoints](#endpoints).\n *\n * @example\n *\n * ```ts\n * import { createApi, fetchBaseQuery } from '@reduxjs/toolkit/query'\n *\n * const api = createApi({\n * baseQuery: fetchBaseQuery({ baseUrl: '/' }),\n * // highlight-start\n * tagTypes: ['Post', 'User'],\n * // highlight-end\n * endpoints: (build) => ({\n * // ...endpoints\n * }),\n * })\n * ```\n */\n tagTypes?: readonly TagTypes[];\n /**\n * The `reducerPath` is a _unique_ key that your service will be mounted to in your store. If you call `createApi` more than once in your application, you will need to provide a unique value each time. Defaults to `'api'`.\n *\n * @example\n *\n * ```ts\n * // codeblock-meta title=\"apis.js\"\n * import { createApi, fetchBaseQuery } from '@reduxjs/toolkit/query';\n *\n * const apiOne = createApi({\n * // highlight-start\n * reducerPath: 'apiOne',\n * // highlight-end\n * baseQuery: fetchBaseQuery({ baseUrl: '/' }),\n * endpoints: (builder) => ({\n * // ...endpoints\n * }),\n * });\n *\n * const apiTwo = createApi({\n * // highlight-start\n * reducerPath: 'apiTwo',\n * // highlight-end\n * baseQuery: fetchBaseQuery({ baseUrl: '/' }),\n * endpoints: (builder) => ({\n * // ...endpoints\n * }),\n * });\n * ```\n */\n reducerPath?: ReducerPath;\n /**\n * Accepts a custom function if you have a need to change the creation of cache keys for any reason.\n */\n serializeQueryArgs?: SerializeQueryArgs;\n /**\n * Endpoints are just a set of operations that you want to perform against your server. You define them as an object using the builder syntax. There are two basic endpoint types: [`query`](../../rtk-query/usage/queries) and [`mutation`](../../rtk-query/usage/mutations).\n */\n endpoints(build: EndpointBuilder): Definitions;\n /**\n * Defaults to `60` _(this value is in seconds)_. This is how long RTK Query will keep your data cached for **after** the last component unsubscribes. For example, if you query an endpoint, then unmount the component, then mount another component that makes the same request within the given time frame, the most recent value will be served from the cache.\n *\n * ```ts\n * // codeblock-meta title=\"keepUnusedDataFor example\"\n *\n * import { createApi, fetchBaseQuery } from '@reduxjs/toolkit/query/react'\n * interface Post {\n * id: number\n * name: string\n * }\n * type PostsResponse = Post[]\n *\n * const api = createApi({\n * baseQuery: fetchBaseQuery({ baseUrl: '/' }),\n * endpoints: (build) => ({\n * getPosts: build.query({\n * query: () => 'posts',\n * // highlight-start\n * keepUnusedDataFor: 5\n * // highlight-end\n * })\n * })\n * })\n * ```\n */\n keepUnusedDataFor?: number;\n /**\n * Defaults to `false`. This setting allows you to control whether if a cached result is already available RTK Query will only serve a cached result, or if it should `refetch` when set to `true` or if an adequate amount of time has passed since the last successful query result.\n * - `false` - Will not cause a query to be performed _unless_ it does not exist yet.\n * - `true` - Will always refetch when a new subscriber to a query is added. Behaves the same as calling the `refetch` callback or passing `forceRefetch: true` in the action creator.\n * - `number` - **Value is in seconds**. If a number is provided and there is an existing query in the cache, it will compare the current time vs the last fulfilled timestamp, and only refetch if enough time has elapsed.\n *\n * If you specify this option alongside `skip: true`, this **will not be evaluated** until `skip` is false.\n */\n refetchOnMountOrArgChange?: boolean | number;\n /**\n * Defaults to `false`. This setting allows you to control whether RTK Query will try to refetch all subscribed queries after the application window regains focus.\n *\n * If you specify this option alongside `skip: true`, this **will not be evaluated** until `skip` is false.\n *\n * Note: requires [`setupListeners`](./setupListeners) to have been called.\n */\n refetchOnFocus?: boolean;\n /**\n * Defaults to `false`. This setting allows you to control whether RTK Query will try to refetch all subscribed queries after regaining a network connection.\n *\n * If you specify this option alongside `skip: true`, this **will not be evaluated** until `skip` is false.\n *\n * Note: requires [`setupListeners`](./setupListeners) to have been called.\n */\n refetchOnReconnect?: boolean;\n /**\n * Defaults to `'delayed'`. This setting allows you to control when tags are invalidated after a mutation.\n *\n * - `'immediately'`: Queries are invalidated instantly after the mutation finished, even if they are running.\n * If the query provides tags that were invalidated while it ran, it won't be re-fetched.\n * - `'delayed'`: Invalidation only happens after all queries and mutations are settled.\n * This ensures that queries are always invalidated correctly and automatically \"batches\" invalidations of concurrent mutations.\n * Note that if you constantly have some queries (or mutations) running, this can delay tag invalidations indefinitely.\n */\n invalidationBehavior?: 'delayed' | 'immediately';\n /**\n * A function that is passed every dispatched action. If this returns something other than `undefined`,\n * that return value will be used to rehydrate fulfilled & errored queries.\n *\n * @example\n *\n * ```ts\n * // codeblock-meta title=\"next-redux-wrapper rehydration example\"\n * import type { Action, PayloadAction } from '@reduxjs/toolkit'\n * import { createApi, fetchBaseQuery } from '@reduxjs/toolkit/query/react'\n * import { HYDRATE } from 'next-redux-wrapper'\n *\n * type RootState = any; // normally inferred from state\n *\n * function isHydrateAction(action: Action): action is PayloadAction {\n * return action.type === HYDRATE\n * }\n *\n * export const api = createApi({\n * baseQuery: fetchBaseQuery({ baseUrl: '/' }),\n * // highlight-start\n * extractRehydrationInfo(action, { reducerPath }): any {\n * if (isHydrateAction(action)) {\n * return action.payload[reducerPath]\n * }\n * },\n * // highlight-end\n * endpoints: (build) => ({\n * // omitted\n * }),\n * })\n * ```\n */\n extractRehydrationInfo?: (action: UnknownAction, {\n reducerPath\n }: {\n reducerPath: ReducerPath;\n }) => undefined | CombinedState, NoInfer, NoInfer>;\n}\nexport type CreateApi = {\n /**\n * Creates a service to use in your application. Contains only the basic redux logic (the core module).\n *\n * @link https://rtk-query-docs.netlify.app/api/createApi\n */\n (options: CreateApiOptions): Api;\n};\n\n/**\n * Builds a `createApi` method based on the provided `modules`.\n *\n * @link https://rtk-query-docs.netlify.app/concepts/customizing-create-api\n *\n * @example\n * ```ts\n * const MyContext = React.createContext(null);\n * const customCreateApi = buildCreateApi(\n * coreModule(),\n * reactHooksModule({\n * hooks: {\n * useDispatch: createDispatchHook(MyContext),\n * useSelector: createSelectorHook(MyContext),\n * useStore: createStoreHook(MyContext)\n * }\n * })\n * );\n * ```\n *\n * @param modules - A variable number of modules that customize how the `createApi` method handles endpoints\n * @returns A `createApi` method using the provided `modules`.\n */\nexport function buildCreateApi, ...Module[]]>(...modules: Modules): CreateApi {\n return function baseCreateApi(options) {\n const extractRehydrationInfo = weakMapMemoize((action: UnknownAction) => options.extractRehydrationInfo?.(action, {\n reducerPath: (options.reducerPath ?? 'api') as any\n }));\n const optionsWithDefaults: CreateApiOptions = {\n reducerPath: 'api',\n keepUnusedDataFor: 60,\n refetchOnMountOrArgChange: false,\n refetchOnFocus: false,\n refetchOnReconnect: false,\n invalidationBehavior: 'delayed',\n ...options,\n extractRehydrationInfo,\n serializeQueryArgs(queryArgsApi) {\n let finalSerializeQueryArgs = defaultSerializeQueryArgs;\n if ('serializeQueryArgs' in queryArgsApi.endpointDefinition) {\n const endpointSQA = queryArgsApi.endpointDefinition.serializeQueryArgs!;\n finalSerializeQueryArgs = queryArgsApi => {\n const initialResult = endpointSQA(queryArgsApi);\n if (typeof initialResult === 'string') {\n // If the user function returned a string, use it as-is\n return initialResult;\n } else {\n // Assume they returned an object (such as a subset of the original\n // query args) or a primitive, and serialize it ourselves\n return defaultSerializeQueryArgs({\n ...queryArgsApi,\n queryArgs: initialResult\n });\n }\n };\n } else if (options.serializeQueryArgs) {\n finalSerializeQueryArgs = options.serializeQueryArgs;\n }\n return finalSerializeQueryArgs(queryArgsApi);\n },\n tagTypes: [...(options.tagTypes || [])]\n };\n const context: ApiContext = {\n endpointDefinitions: {},\n batch(fn) {\n // placeholder \"batch\" method to be overridden by plugins, for example with React.unstable_batchedUpdate\n fn();\n },\n apiUid: nanoid(),\n extractRehydrationInfo,\n hasRehydrationInfo: weakMapMemoize(action => extractRehydrationInfo(action) != null)\n };\n const api = {\n injectEndpoints,\n enhanceEndpoints({\n addTagTypes,\n endpoints\n }) {\n if (addTagTypes) {\n for (const eT of addTagTypes) {\n if (!optionsWithDefaults.tagTypes!.includes(eT as any)) {\n ;\n (optionsWithDefaults.tagTypes as any[]).push(eT);\n }\n }\n }\n if (endpoints) {\n for (const [endpointName, partialDefinition] of Object.entries(endpoints)) {\n if (typeof partialDefinition === 'function') {\n partialDefinition(context.endpointDefinitions[endpointName]);\n } else {\n Object.assign(context.endpointDefinitions[endpointName] || {}, partialDefinition);\n }\n }\n }\n return api;\n }\n } as Api;\n const initializedModules = modules.map(m => m.init(api as any, optionsWithDefaults as any, context));\n function injectEndpoints(inject: Parameters[0]) {\n const evaluatedEndpoints = inject.endpoints({\n query: x => ({\n ...x,\n type: DefinitionType.query\n }) as any,\n mutation: x => ({\n ...x,\n type: DefinitionType.mutation\n }) as any\n });\n for (const [endpointName, definition] of Object.entries(evaluatedEndpoints)) {\n if (inject.overrideExisting !== true && endpointName in context.endpointDefinitions) {\n if (inject.overrideExisting === 'throw') {\n throw new Error(process.env.NODE_ENV === \"production\" ? _formatProdErrorMessage(39) : `called \\`injectEndpoints\\` to override already-existing endpointName ${endpointName} without specifying \\`overrideExisting: true\\``);\n } else if (typeof process !== 'undefined' && process.env.NODE_ENV === 'development') {\n console.error(`called \\`injectEndpoints\\` to override already-existing endpointName ${endpointName} without specifying \\`overrideExisting: true\\``);\n }\n continue;\n }\n context.endpointDefinitions[endpointName] = definition;\n for (const m of initializedModules) {\n m.injectEndpoint(endpointName, definition);\n }\n }\n return api as any;\n }\n return api.injectEndpoints({\n endpoints: options.endpoints as any\n });\n };\n}","import type { InternalHandlerBuilder, SubscriptionSelectors } from './types';\nimport type { SubscriptionState } from '../apiState';\nimport { produceWithPatches } from 'immer';\nimport type { Action } from '@reduxjs/toolkit';\nimport { countObjectKeys } from '../../utils/countObjectKeys';\nexport const buildBatchedActionsHandler: InternalHandlerBuilder<[actionShouldContinue: boolean, returnValue: SubscriptionSelectors | boolean]> = ({\n api,\n queryThunk,\n internalState\n}) => {\n const subscriptionsPrefix = `${api.reducerPath}/subscriptions`;\n let previousSubscriptions: SubscriptionState = null as unknown as SubscriptionState;\n let updateSyncTimer: ReturnType | null = null;\n const {\n updateSubscriptionOptions,\n unsubscribeQueryResult\n } = api.internalActions;\n\n // Actually intentionally mutate the subscriptions state used in the middleware\n // This is done to speed up perf when loading many components\n const actuallyMutateSubscriptions = (mutableState: SubscriptionState, action: Action) => {\n if (updateSubscriptionOptions.match(action)) {\n const {\n queryCacheKey,\n requestId,\n options\n } = action.payload;\n if (mutableState?.[queryCacheKey]?.[requestId]) {\n mutableState[queryCacheKey]![requestId] = options;\n }\n return true;\n }\n if (unsubscribeQueryResult.match(action)) {\n const {\n queryCacheKey,\n requestId\n } = action.payload;\n if (mutableState[queryCacheKey]) {\n delete mutableState[queryCacheKey]![requestId];\n }\n return true;\n }\n if (api.internalActions.removeQueryResult.match(action)) {\n delete mutableState[action.payload.queryCacheKey];\n return true;\n }\n if (queryThunk.pending.match(action)) {\n const {\n meta: {\n arg,\n requestId\n }\n } = action;\n const substate = mutableState[arg.queryCacheKey] ??= {};\n substate[`${requestId}_running`] = {};\n if (arg.subscribe) {\n substate[requestId] = arg.subscriptionOptions ?? substate[requestId] ?? {};\n }\n return true;\n }\n let mutated = false;\n if (queryThunk.fulfilled.match(action) || queryThunk.rejected.match(action)) {\n const state = mutableState[action.meta.arg.queryCacheKey] || {};\n const key = `${action.meta.requestId}_running`;\n mutated ||= !!state[key];\n delete state[key];\n }\n if (queryThunk.rejected.match(action)) {\n const {\n meta: {\n condition,\n arg,\n requestId\n }\n } = action;\n if (condition && arg.subscribe) {\n const substate = mutableState[arg.queryCacheKey] ??= {};\n substate[requestId] = arg.subscriptionOptions ?? substate[requestId] ?? {};\n mutated = true;\n }\n }\n return mutated;\n };\n const getSubscriptions = () => internalState.currentSubscriptions;\n const getSubscriptionCount = (queryCacheKey: string) => {\n const subscriptions = getSubscriptions();\n const subscriptionsForQueryArg = subscriptions[queryCacheKey] ?? {};\n return countObjectKeys(subscriptionsForQueryArg);\n };\n const isRequestSubscribed = (queryCacheKey: string, requestId: string) => {\n const subscriptions = getSubscriptions();\n return !!subscriptions?.[queryCacheKey]?.[requestId];\n };\n const subscriptionSelectors: SubscriptionSelectors = {\n getSubscriptions,\n getSubscriptionCount,\n isRequestSubscribed\n };\n return (action, mwApi): [actionShouldContinue: boolean, result: SubscriptionSelectors | boolean] => {\n if (!previousSubscriptions) {\n // Initialize it the first time this handler runs\n previousSubscriptions = JSON.parse(JSON.stringify(internalState.currentSubscriptions));\n }\n if (api.util.resetApiState.match(action)) {\n previousSubscriptions = internalState.currentSubscriptions = {};\n updateSyncTimer = null;\n return [true, false];\n }\n\n // Intercept requests by hooks to see if they're subscribed\n // We return the internal state reference so that hooks\n // can do their own checks to see if they're still active.\n // It's stupid and hacky, but it does cut down on some dispatch calls.\n if (api.internalActions.internal_getRTKQSubscriptions.match(action)) {\n return [false, subscriptionSelectors];\n }\n\n // Update subscription data based on this action\n const didMutate = actuallyMutateSubscriptions(internalState.currentSubscriptions, action);\n let actionShouldContinue = true;\n if (didMutate) {\n if (!updateSyncTimer) {\n // We only use the subscription state for the Redux DevTools at this point,\n // as the real data is kept here in the middleware.\n // Given that, we can throttle synchronizing this state significantly to\n // save on overall perf.\n // In 1.9, it was updated in a microtask, but now we do it at most every 500ms.\n updateSyncTimer = setTimeout(() => {\n // Deep clone the current subscription data\n const newSubscriptions: SubscriptionState = JSON.parse(JSON.stringify(internalState.currentSubscriptions));\n // Figure out a smaller diff between original and current\n const [, patches] = produceWithPatches(previousSubscriptions, () => newSubscriptions);\n\n // Sync the store state for visibility\n mwApi.next(api.internalActions.subscriptionsUpdated(patches));\n // Save the cloned state for later reference\n previousSubscriptions = newSubscriptions;\n updateSyncTimer = null;\n }, 500);\n }\n const isSubscriptionSliceAction = typeof action.type == 'string' && !!action.type.startsWith(subscriptionsPrefix);\n const isAdditionalSubscriptionAction = queryThunk.rejected.match(action) && action.meta.condition && !!action.meta.arg.subscribe;\n actionShouldContinue = !isSubscriptionSliceAction && !isAdditionalSubscriptionAction;\n }\n return [actionShouldContinue, false];\n };\n};","import type { QueryDefinition } from '../../endpointDefinitions';\nimport type { ConfigState, QueryCacheKey } from '../apiState';\nimport { isAnyOf } from '../rtkImports';\nimport type { ApiMiddlewareInternalHandler, InternalHandlerBuilder, QueryStateMeta, SubMiddlewareApi, TimeoutId } from './types';\nexport type ReferenceCacheCollection = never;\nfunction isObjectEmpty(obj: Record) {\n // Apparently a for..in loop is faster than `Object.keys()` here:\n // https://stackoverflow.com/a/59787784/62937\n for (const k in obj) {\n // If there is at least one key, it's not empty\n return false;\n }\n return true;\n}\nexport type CacheCollectionQueryExtraOptions = {\n /**\n * Overrides the api-wide definition of `keepUnusedDataFor` for this endpoint only. _(This value is in seconds.)_\n *\n * This is how long RTK Query will keep your data cached for **after** the last component unsubscribes. For example, if you query an endpoint, then unmount the component, then mount another component that makes the same request within the given time frame, the most recent value will be served from the cache.\n */\n keepUnusedDataFor?: number;\n};\n\n// Per https://developer.mozilla.org/en-US/docs/Web/API/setTimeout#maximum_delay_value , browsers store\n// `setTimeout()` timer values in a 32-bit int. If we pass a value in that's larger than that,\n// it wraps and ends up executing immediately.\n// Our `keepUnusedDataFor` values are in seconds, so adjust the numbers here accordingly.\nexport const THIRTY_TWO_BIT_MAX_INT = 2_147_483_647;\nexport const THIRTY_TWO_BIT_MAX_TIMER_SECONDS = 2_147_483_647 / 1_000 - 1;\nexport const buildCacheCollectionHandler: InternalHandlerBuilder = ({\n reducerPath,\n api,\n queryThunk,\n context,\n internalState\n}) => {\n const {\n removeQueryResult,\n unsubscribeQueryResult,\n cacheEntriesUpserted\n } = api.internalActions;\n const canTriggerUnsubscribe = isAnyOf(unsubscribeQueryResult.match, queryThunk.fulfilled, queryThunk.rejected, cacheEntriesUpserted.match);\n function anySubscriptionsRemainingForKey(queryCacheKey: string) {\n const subscriptions = internalState.currentSubscriptions[queryCacheKey];\n return !!subscriptions && !isObjectEmpty(subscriptions);\n }\n const currentRemovalTimeouts: QueryStateMeta = {};\n const handler: ApiMiddlewareInternalHandler = (action, mwApi, internalState) => {\n if (canTriggerUnsubscribe(action)) {\n const state = mwApi.getState()[reducerPath];\n let queryCacheKeys: QueryCacheKey[];\n if (cacheEntriesUpserted.match(action)) {\n queryCacheKeys = action.payload.map(entry => entry.queryDescription.queryCacheKey);\n } else {\n const {\n queryCacheKey\n } = unsubscribeQueryResult.match(action) ? action.payload : action.meta.arg;\n queryCacheKeys = [queryCacheKey];\n }\n for (const queryCacheKey of queryCacheKeys) {\n handleUnsubscribe(queryCacheKey, state.queries[queryCacheKey]?.endpointName, mwApi, state.config);\n }\n }\n if (api.util.resetApiState.match(action)) {\n for (const [key, timeout] of Object.entries(currentRemovalTimeouts)) {\n if (timeout) clearTimeout(timeout);\n delete currentRemovalTimeouts[key];\n }\n }\n if (context.hasRehydrationInfo(action)) {\n const state = mwApi.getState()[reducerPath];\n const {\n queries\n } = context.extractRehydrationInfo(action)!;\n for (const [queryCacheKey, queryState] of Object.entries(queries)) {\n // Gotcha:\n // If rehydrating before the endpoint has been injected,the global `keepUnusedDataFor`\n // will be used instead of the endpoint-specific one.\n handleUnsubscribe(queryCacheKey as QueryCacheKey, queryState?.endpointName, mwApi, state.config);\n }\n }\n };\n function handleUnsubscribe(queryCacheKey: QueryCacheKey, endpointName: string | undefined, api: SubMiddlewareApi, config: ConfigState) {\n const endpointDefinition = context.endpointDefinitions[endpointName!] as QueryDefinition;\n const keepUnusedDataFor = endpointDefinition?.keepUnusedDataFor ?? config.keepUnusedDataFor;\n if (keepUnusedDataFor === Infinity) {\n // Hey, user said keep this forever!\n return;\n }\n // Prevent `setTimeout` timers from overflowing a 32-bit internal int, by\n // clamping the max value to be at most 1000ms less than the 32-bit max.\n // Look, a 24.8-day keepalive ought to be enough for anybody, right? :)\n // Also avoid negative values too.\n const finalKeepUnusedDataFor = Math.max(0, Math.min(keepUnusedDataFor, THIRTY_TWO_BIT_MAX_TIMER_SECONDS));\n if (!anySubscriptionsRemainingForKey(queryCacheKey)) {\n const currentTimeout = currentRemovalTimeouts[queryCacheKey];\n if (currentTimeout) {\n clearTimeout(currentTimeout);\n }\n currentRemovalTimeouts[queryCacheKey] = setTimeout(() => {\n if (!anySubscriptionsRemainingForKey(queryCacheKey)) {\n api.dispatch(removeQueryResult({\n queryCacheKey\n }));\n }\n delete currentRemovalTimeouts![queryCacheKey];\n }, finalKeepUnusedDataFor * 1000);\n }\n }\n return handler;\n};","import type { ThunkDispatch, UnknownAction } from '@reduxjs/toolkit';\nimport type { BaseQueryFn, BaseQueryMeta } from '../../baseQueryTypes';\nimport type { BaseEndpointDefinition } from '../../endpointDefinitions';\nimport { DefinitionType } from '../../endpointDefinitions';\nimport type { RootState } from '../apiState';\nimport type { MutationResultSelectorResult, QueryResultSelectorResult } from '../buildSelectors';\nimport { getMutationCacheKey } from '../buildSlice';\nimport type { PatchCollection, Recipe } from '../buildThunks';\nimport { isAsyncThunkAction, isFulfilled } from '../rtkImports';\nimport type { ApiMiddlewareInternalHandler, InternalHandlerBuilder, PromiseWithKnownReason, SubMiddlewareApi } from './types';\nexport type ReferenceCacheLifecycle = never;\nexport interface QueryBaseLifecycleApi extends LifecycleApi {\n /**\n * Gets the current value of this cache entry.\n */\n getCacheEntry(): QueryResultSelectorResult<{\n type: DefinitionType.query;\n } & BaseEndpointDefinition>;\n /**\n * Updates the current cache entry value.\n * For documentation see `api.util.updateQueryData`.\n */\n updateCachedData(updateRecipe: Recipe): PatchCollection;\n}\nexport type MutationBaseLifecycleApi = LifecycleApi & {\n /**\n * Gets the current value of this cache entry.\n */\n getCacheEntry(): MutationResultSelectorResult<{\n type: DefinitionType.mutation;\n } & BaseEndpointDefinition>;\n};\ntype LifecycleApi = {\n /**\n * The dispatch method for the store\n */\n dispatch: ThunkDispatch;\n /**\n * A method to get the current state\n */\n getState(): RootState;\n /**\n * `extra` as provided as `thunk.extraArgument` to the `configureStore` `getDefaultMiddleware` option.\n */\n extra: unknown;\n /**\n * A unique ID generated for the mutation\n */\n requestId: string;\n};\ntype CacheLifecyclePromises = {\n /**\n * Promise that will resolve with the first value for this cache key.\n * This allows you to `await` until an actual value is in cache.\n *\n * If the cache entry is removed from the cache before any value has ever\n * been resolved, this Promise will reject with\n * `new Error('Promise never resolved before cacheEntryRemoved.')`\n * to prevent memory leaks.\n * You can just re-throw that error (or not handle it at all) -\n * it will be caught outside of `cacheEntryAdded`.\n *\n * If you don't interact with this promise, it will not throw.\n */\n cacheDataLoaded: PromiseWithKnownReason<{\n /**\n * The (transformed) query result.\n */\n data: ResultType;\n /**\n * The `meta` returned by the `baseQuery`\n */\n meta: MetaType;\n }, typeof neverResolvedError>;\n /**\n * Promise that allows you to wait for the point in time when the cache entry\n * has been removed from the cache, by not being used/subscribed to any more\n * in the application for too long or by dispatching `api.util.resetApiState`.\n */\n cacheEntryRemoved: Promise;\n};\nexport interface QueryCacheLifecycleApi extends QueryBaseLifecycleApi, CacheLifecyclePromises> {}\nexport type MutationCacheLifecycleApi = MutationBaseLifecycleApi & CacheLifecyclePromises>;\nexport type CacheLifecycleQueryExtraOptions = {\n onCacheEntryAdded?(arg: QueryArg, api: QueryCacheLifecycleApi): Promise | void;\n};\nexport type CacheLifecycleMutationExtraOptions = {\n onCacheEntryAdded?(arg: QueryArg, api: MutationCacheLifecycleApi): Promise | void;\n};\nconst neverResolvedError = new Error('Promise never resolved before cacheEntryRemoved.') as Error & {\n message: 'Promise never resolved before cacheEntryRemoved.';\n};\nexport const buildCacheLifecycleHandler: InternalHandlerBuilder = ({\n api,\n reducerPath,\n context,\n queryThunk,\n mutationThunk,\n internalState\n}) => {\n const isQueryThunk = isAsyncThunkAction(queryThunk);\n const isMutationThunk = isAsyncThunkAction(mutationThunk);\n const isFulfilledThunk = isFulfilled(queryThunk, mutationThunk);\n type CacheLifecycle = {\n valueResolved?(value: {\n data: unknown;\n meta: unknown;\n }): unknown;\n cacheEntryRemoved(): void;\n };\n const lifecycleMap: Record = {};\n function resolveLifecycleEntry(cacheKey: string, data: unknown, meta: unknown) {\n const lifecycle = lifecycleMap[cacheKey];\n if (lifecycle?.valueResolved) {\n lifecycle.valueResolved({\n data,\n meta\n });\n delete lifecycle.valueResolved;\n }\n }\n function removeLifecycleEntry(cacheKey: string) {\n const lifecycle = lifecycleMap[cacheKey];\n if (lifecycle) {\n delete lifecycleMap[cacheKey];\n lifecycle.cacheEntryRemoved();\n }\n }\n const handler: ApiMiddlewareInternalHandler = (action, mwApi, stateBefore) => {\n const cacheKey = getCacheKey(action);\n function checkForNewCacheKey(endpointName: string, cacheKey: string, requestId: string, originalArgs: unknown) {\n const oldState = stateBefore[reducerPath].queries[cacheKey];\n const state = mwApi.getState()[reducerPath].queries[cacheKey];\n if (!oldState && state) {\n handleNewKey(endpointName, originalArgs, cacheKey, mwApi, requestId);\n }\n }\n if (queryThunk.pending.match(action)) {\n checkForNewCacheKey(action.meta.arg.endpointName, cacheKey, action.meta.requestId, action.meta.arg.originalArgs);\n } else if (api.internalActions.cacheEntriesUpserted.match(action)) {\n for (const {\n queryDescription,\n value\n } of action.payload) {\n const {\n endpointName,\n originalArgs,\n queryCacheKey\n } = queryDescription;\n checkForNewCacheKey(endpointName, queryCacheKey, action.meta.requestId, originalArgs);\n resolveLifecycleEntry(queryCacheKey, value, {});\n }\n } else if (mutationThunk.pending.match(action)) {\n const state = mwApi.getState()[reducerPath].mutations[cacheKey];\n if (state) {\n handleNewKey(action.meta.arg.endpointName, action.meta.arg.originalArgs, cacheKey, mwApi, action.meta.requestId);\n }\n } else if (isFulfilledThunk(action)) {\n resolveLifecycleEntry(cacheKey, action.payload, action.meta.baseQueryMeta);\n } else if (api.internalActions.removeQueryResult.match(action) || api.internalActions.removeMutationResult.match(action)) {\n removeLifecycleEntry(cacheKey);\n } else if (api.util.resetApiState.match(action)) {\n for (const cacheKey of Object.keys(lifecycleMap)) {\n removeLifecycleEntry(cacheKey);\n }\n }\n };\n function getCacheKey(action: any) {\n if (isQueryThunk(action)) return action.meta.arg.queryCacheKey;\n if (isMutationThunk(action)) {\n return action.meta.arg.fixedCacheKey ?? action.meta.requestId;\n }\n if (api.internalActions.removeQueryResult.match(action)) return action.payload.queryCacheKey;\n if (api.internalActions.removeMutationResult.match(action)) return getMutationCacheKey(action.payload);\n return '';\n }\n function handleNewKey(endpointName: string, originalArgs: any, queryCacheKey: string, mwApi: SubMiddlewareApi, requestId: string) {\n const endpointDefinition = context.endpointDefinitions[endpointName];\n const onCacheEntryAdded = endpointDefinition?.onCacheEntryAdded;\n if (!onCacheEntryAdded) return;\n const lifecycle = {} as CacheLifecycle;\n const cacheEntryRemoved = new Promise(resolve => {\n lifecycle.cacheEntryRemoved = resolve;\n });\n const cacheDataLoaded: PromiseWithKnownReason<{\n data: unknown;\n meta: unknown;\n }, typeof neverResolvedError> = Promise.race([new Promise<{\n data: unknown;\n meta: unknown;\n }>(resolve => {\n lifecycle.valueResolved = resolve;\n }), cacheEntryRemoved.then(() => {\n throw neverResolvedError;\n })]);\n // prevent uncaught promise rejections from happening.\n // if the original promise is used in any way, that will create a new promise that will throw again\n cacheDataLoaded.catch(() => {});\n lifecycleMap[queryCacheKey] = lifecycle;\n const selector = (api.endpoints[endpointName] as any).select(endpointDefinition.type === DefinitionType.query ? originalArgs : queryCacheKey);\n const extra = mwApi.dispatch((_, __, extra) => extra);\n const lifecycleApi = {\n ...mwApi,\n getCacheEntry: () => selector(mwApi.getState()),\n requestId,\n extra,\n updateCachedData: (endpointDefinition.type === DefinitionType.query ? (updateRecipe: Recipe) => mwApi.dispatch(api.util.updateQueryData(endpointName as never, originalArgs, updateRecipe)) : undefined) as any,\n cacheDataLoaded,\n cacheEntryRemoved\n };\n const runningHandler = onCacheEntryAdded(originalArgs, lifecycleApi);\n // if a `neverResolvedError` was thrown, but not handled in the running handler, do not let it leak out further\n Promise.resolve(runningHandler).catch(e => {\n if (e === neverResolvedError) return;\n throw e;\n });\n }\n return handler;\n};","import type { InternalHandlerBuilder } from './types';\nexport const buildDevCheckHandler: InternalHandlerBuilder = ({\n api,\n context: {\n apiUid\n },\n reducerPath\n}) => {\n return (action, mwApi) => {\n if (api.util.resetApiState.match(action)) {\n // dispatch after api reset\n mwApi.dispatch(api.internalActions.middlewareRegistered(apiUid));\n }\n if (typeof process !== 'undefined' && process.env.NODE_ENV === 'development') {\n if (api.internalActions.middlewareRegistered.match(action) && action.payload === apiUid && mwApi.getState()[reducerPath]?.config?.middlewareRegistered === 'conflict') {\n console.warn(`There is a mismatch between slice and middleware for the reducerPath \"${reducerPath}\".\nYou can only have one api per reducer path, this will lead to crashes in various situations!${reducerPath === 'api' ? `\nIf you have multiple apis, you *have* to specify the reducerPath option when using createApi!` : ''}`);\n }\n }\n };\n};","import { isAnyOf, isFulfilled, isRejected, isRejectedWithValue } from '../rtkImports';\nimport type { EndpointDefinitions, FullTagDescription } from '../../endpointDefinitions';\nimport { calculateProvidedBy } from '../../endpointDefinitions';\nimport type { CombinedState, QueryCacheKey } from '../apiState';\nimport { QueryStatus } from '../apiState';\nimport { calculateProvidedByThunk } from '../buildThunks';\nimport type { SubMiddlewareApi, InternalHandlerBuilder, ApiMiddlewareInternalHandler, InternalMiddlewareState } from './types';\nimport { countObjectKeys } from '../../utils/countObjectKeys';\nexport const buildInvalidationByTagsHandler: InternalHandlerBuilder = ({\n reducerPath,\n context,\n context: {\n endpointDefinitions\n },\n mutationThunk,\n queryThunk,\n api,\n assertTagType,\n refetchQuery,\n internalState\n}) => {\n const {\n removeQueryResult\n } = api.internalActions;\n const isThunkActionWithTags = isAnyOf(isFulfilled(mutationThunk), isRejectedWithValue(mutationThunk));\n const isQueryEnd = isAnyOf(isFulfilled(mutationThunk, queryThunk), isRejected(mutationThunk, queryThunk));\n let pendingTagInvalidations: FullTagDescription[] = [];\n const handler: ApiMiddlewareInternalHandler = (action, mwApi) => {\n if (isThunkActionWithTags(action)) {\n invalidateTags(calculateProvidedByThunk(action, 'invalidatesTags', endpointDefinitions, assertTagType), mwApi);\n } else if (isQueryEnd(action)) {\n invalidateTags([], mwApi);\n } else if (api.util.invalidateTags.match(action)) {\n invalidateTags(calculateProvidedBy(action.payload, undefined, undefined, undefined, undefined, assertTagType), mwApi);\n }\n };\n function hasPendingRequests(state: CombinedState) {\n for (const key in state.queries) {\n if (state.queries[key]?.status === QueryStatus.pending) return true;\n }\n for (const key in state.mutations) {\n if (state.mutations[key]?.status === QueryStatus.pending) return true;\n }\n return false;\n }\n function invalidateTags(newTags: readonly FullTagDescription[], mwApi: SubMiddlewareApi) {\n const rootState = mwApi.getState();\n const state = rootState[reducerPath];\n pendingTagInvalidations.push(...newTags);\n if (state.config.invalidationBehavior === 'delayed' && hasPendingRequests(state)) {\n return;\n }\n const tags = pendingTagInvalidations;\n pendingTagInvalidations = [];\n if (tags.length === 0) return;\n const toInvalidate = api.util.selectInvalidatedBy(rootState, tags);\n context.batch(() => {\n const valuesArray = Array.from(toInvalidate.values());\n for (const {\n queryCacheKey\n } of valuesArray) {\n const querySubState = state.queries[queryCacheKey];\n const subscriptionSubState = internalState.currentSubscriptions[queryCacheKey] ?? {};\n if (querySubState) {\n if (countObjectKeys(subscriptionSubState) === 0) {\n mwApi.dispatch(removeQueryResult({\n queryCacheKey: queryCacheKey as QueryCacheKey\n }));\n } else if (querySubState.status !== QueryStatus.uninitialized) {\n mwApi.dispatch(refetchQuery(querySubState));\n }\n }\n }\n });\n }\n return handler;\n};","import type { QuerySubstateIdentifier, Subscribers } from '../apiState';\nimport { QueryStatus } from '../apiState';\nimport type { QueryStateMeta, SubMiddlewareApi, TimeoutId, InternalHandlerBuilder, ApiMiddlewareInternalHandler, InternalMiddlewareState } from './types';\nexport const buildPollingHandler: InternalHandlerBuilder = ({\n reducerPath,\n queryThunk,\n api,\n refetchQuery,\n internalState\n}) => {\n const currentPolls: QueryStateMeta<{\n nextPollTimestamp: number;\n timeout?: TimeoutId;\n pollingInterval: number;\n }> = {};\n const handler: ApiMiddlewareInternalHandler = (action, mwApi) => {\n if (api.internalActions.updateSubscriptionOptions.match(action) || api.internalActions.unsubscribeQueryResult.match(action)) {\n updatePollingInterval(action.payload, mwApi);\n }\n if (queryThunk.pending.match(action) || queryThunk.rejected.match(action) && action.meta.condition) {\n updatePollingInterval(action.meta.arg, mwApi);\n }\n if (queryThunk.fulfilled.match(action) || queryThunk.rejected.match(action) && !action.meta.condition) {\n startNextPoll(action.meta.arg, mwApi);\n }\n if (api.util.resetApiState.match(action)) {\n clearPolls();\n }\n };\n function startNextPoll({\n queryCacheKey\n }: QuerySubstateIdentifier, api: SubMiddlewareApi) {\n const state = api.getState()[reducerPath];\n const querySubState = state.queries[queryCacheKey];\n const subscriptions = internalState.currentSubscriptions[queryCacheKey];\n if (!querySubState || querySubState.status === QueryStatus.uninitialized) return;\n const {\n lowestPollingInterval,\n skipPollingIfUnfocused\n } = findLowestPollingInterval(subscriptions);\n if (!Number.isFinite(lowestPollingInterval)) return;\n const currentPoll = currentPolls[queryCacheKey];\n if (currentPoll?.timeout) {\n clearTimeout(currentPoll.timeout);\n currentPoll.timeout = undefined;\n }\n const nextPollTimestamp = Date.now() + lowestPollingInterval;\n currentPolls[queryCacheKey] = {\n nextPollTimestamp,\n pollingInterval: lowestPollingInterval,\n timeout: setTimeout(() => {\n if (state.config.focused || !skipPollingIfUnfocused) {\n api.dispatch(refetchQuery(querySubState));\n }\n startNextPoll({\n queryCacheKey\n }, api);\n }, lowestPollingInterval)\n };\n }\n function updatePollingInterval({\n queryCacheKey\n }: QuerySubstateIdentifier, api: SubMiddlewareApi) {\n const state = api.getState()[reducerPath];\n const querySubState = state.queries[queryCacheKey];\n const subscriptions = internalState.currentSubscriptions[queryCacheKey];\n if (!querySubState || querySubState.status === QueryStatus.uninitialized) {\n return;\n }\n const {\n lowestPollingInterval\n } = findLowestPollingInterval(subscriptions);\n if (!Number.isFinite(lowestPollingInterval)) {\n cleanupPollForKey(queryCacheKey);\n return;\n }\n const currentPoll = currentPolls[queryCacheKey];\n const nextPollTimestamp = Date.now() + lowestPollingInterval;\n if (!currentPoll || nextPollTimestamp < currentPoll.nextPollTimestamp) {\n startNextPoll({\n queryCacheKey\n }, api);\n }\n }\n function cleanupPollForKey(key: string) {\n const existingPoll = currentPolls[key];\n if (existingPoll?.timeout) {\n clearTimeout(existingPoll.timeout);\n }\n delete currentPolls[key];\n }\n function clearPolls() {\n for (const key of Object.keys(currentPolls)) {\n cleanupPollForKey(key);\n }\n }\n function findLowestPollingInterval(subscribers: Subscribers = {}) {\n let skipPollingIfUnfocused: boolean | undefined = false;\n let lowestPollingInterval = Number.POSITIVE_INFINITY;\n for (let key in subscribers) {\n if (!!subscribers[key].pollingInterval) {\n lowestPollingInterval = Math.min(subscribers[key].pollingInterval!, lowestPollingInterval);\n skipPollingIfUnfocused = subscribers[key].skipPollingIfUnfocused || skipPollingIfUnfocused;\n }\n }\n return {\n lowestPollingInterval,\n skipPollingIfUnfocused\n };\n }\n return handler;\n};","import type { BaseQueryError, BaseQueryFn, BaseQueryMeta } from '../../baseQueryTypes';\nimport { DefinitionType } from '../../endpointDefinitions';\nimport type { Recipe } from '../buildThunks';\nimport { isFulfilled, isPending, isRejected } from '../rtkImports';\nimport type { MutationBaseLifecycleApi, QueryBaseLifecycleApi } from './cacheLifecycle';\nimport type { ApiMiddlewareInternalHandler, InternalHandlerBuilder, PromiseConstructorWithKnownReason, PromiseWithKnownReason } from './types';\nexport type ReferenceQueryLifecycle = never;\ntype QueryLifecyclePromises = {\n /**\n * Promise that will resolve with the (transformed) query result.\n *\n * If the query fails, this promise will reject with the error.\n *\n * This allows you to `await` for the query to finish.\n *\n * If you don't interact with this promise, it will not throw.\n */\n queryFulfilled: PromiseWithKnownReason<{\n /**\n * The (transformed) query result.\n */\n data: ResultType;\n /**\n * The `meta` returned by the `baseQuery`\n */\n meta: BaseQueryMeta;\n }, QueryFulfilledRejectionReason>;\n};\ntype QueryFulfilledRejectionReason = {\n error: BaseQueryError;\n /**\n * If this is `false`, that means this error was returned from the `baseQuery` or `queryFn` in a controlled manner.\n */\n isUnhandledError: false;\n /**\n * The `meta` returned by the `baseQuery`\n */\n meta: BaseQueryMeta;\n} | {\n error: unknown;\n meta?: undefined;\n /**\n * If this is `true`, that means that this error is the result of `baseQueryFn`, `queryFn`, `transformResponse` or `transformErrorResponse` throwing an error instead of handling it properly.\n * There can not be made any assumption about the shape of `error`.\n */\n isUnhandledError: true;\n};\nexport type QueryLifecycleQueryExtraOptions = {\n /**\n * A function that is called when the individual query is started. The function is called with a lifecycle api object containing properties such as `queryFulfilled`, allowing code to be run when a query is started, when it succeeds, and when it fails (i.e. throughout the lifecycle of an individual query/mutation call).\n *\n * Can be used to perform side-effects throughout the lifecycle of the query.\n *\n * @example\n * ```ts\n * import { createApi, fetchBaseQuery } from '@reduxjs/toolkit/query'\n * import { messageCreated } from './notificationsSlice\n * export interface Post {\n * id: number\n * name: string\n * }\n *\n * const api = createApi({\n * baseQuery: fetchBaseQuery({\n * baseUrl: '/',\n * }),\n * endpoints: (build) => ({\n * getPost: build.query({\n * query: (id) => `post/${id}`,\n * async onQueryStarted(id, { dispatch, queryFulfilled }) {\n * // `onStart` side-effect\n * dispatch(messageCreated('Fetching posts...'))\n * try {\n * const { data } = await queryFulfilled\n * // `onSuccess` side-effect\n * dispatch(messageCreated('Posts received!'))\n * } catch (err) {\n * // `onError` side-effect\n * dispatch(messageCreated('Error fetching posts!'))\n * }\n * }\n * }),\n * }),\n * })\n * ```\n */\n onQueryStarted?(queryArgument: QueryArg, queryLifeCycleApi: QueryLifecycleApi): Promise | void;\n};\nexport type QueryLifecycleMutationExtraOptions = {\n /**\n * A function that is called when the individual mutation is started. The function is called with a lifecycle api object containing properties such as `queryFulfilled`, allowing code to be run when a query is started, when it succeeds, and when it fails (i.e. throughout the lifecycle of an individual query/mutation call).\n *\n * Can be used for `optimistic updates`.\n *\n * @example\n *\n * ```ts\n * import { createApi, fetchBaseQuery } from '@reduxjs/toolkit/query'\n * export interface Post {\n * id: number\n * name: string\n * }\n *\n * const api = createApi({\n * baseQuery: fetchBaseQuery({\n * baseUrl: '/',\n * }),\n * tagTypes: ['Post'],\n * endpoints: (build) => ({\n * getPost: build.query({\n * query: (id) => `post/${id}`,\n * providesTags: ['Post'],\n * }),\n * updatePost: build.mutation & Partial>({\n * query: ({ id, ...patch }) => ({\n * url: `post/${id}`,\n * method: 'PATCH',\n * body: patch,\n * }),\n * invalidatesTags: ['Post'],\n * async onQueryStarted({ id, ...patch }, { dispatch, queryFulfilled }) {\n * const patchResult = dispatch(\n * api.util.updateQueryData('getPost', id, (draft) => {\n * Object.assign(draft, patch)\n * })\n * )\n * try {\n * await queryFulfilled\n * } catch {\n * patchResult.undo()\n * }\n * },\n * }),\n * }),\n * })\n * ```\n */\n onQueryStarted?(queryArgument: QueryArg, mutationLifeCycleApi: MutationLifecycleApi): Promise | void;\n};\nexport interface QueryLifecycleApi extends QueryBaseLifecycleApi, QueryLifecyclePromises {}\nexport type MutationLifecycleApi = MutationBaseLifecycleApi & QueryLifecyclePromises;\n\n/**\n * Provides a way to define a strongly-typed version of\n * {@linkcode QueryLifecycleQueryExtraOptions.onQueryStarted | onQueryStarted}\n * for a specific query.\n *\n * @example\n * #### __Create and reuse a strongly-typed `onQueryStarted` function__\n *\n * ```ts\n * import type { TypedQueryOnQueryStarted } from '@reduxjs/toolkit/query'\n * import { createApi, fetchBaseQuery } from '@reduxjs/toolkit/query'\n *\n * type Post = {\n * id: number\n * title: string\n * userId: number\n * }\n *\n * type PostsApiResponse = {\n * posts: Post[]\n * total: number\n * skip: number\n * limit: number\n * }\n *\n * type QueryArgument = number | undefined\n *\n * type BaseQueryFunction = ReturnType\n *\n * const baseApiSlice = createApi({\n * baseQuery: fetchBaseQuery({ baseUrl: 'https://dummyjson.com' }),\n * reducerPath: 'postsApi',\n * tagTypes: ['Posts'],\n * endpoints: (builder) => ({\n * getPosts: builder.query({\n * query: () => `/posts`,\n * }),\n *\n * getPostById: builder.query({\n * query: (postId) => `/posts/${postId}`,\n * }),\n * }),\n * })\n *\n * const updatePostOnFulfilled: TypedQueryOnQueryStarted<\n * PostsApiResponse,\n * QueryArgument,\n * BaseQueryFunction,\n * 'postsApi'\n * > = async (queryArgument, { dispatch, queryFulfilled }) => {\n * const result = await queryFulfilled\n *\n * const { posts } = result.data\n *\n * // Pre-fill the individual post entries with the results\n * // from the list endpoint query\n * dispatch(\n * baseApiSlice.util.upsertQueryEntries(\n * posts.map((post) => ({\n * endpointName: 'getPostById',\n * arg: post.id,\n * value: post,\n * })),\n * ),\n * )\n * }\n *\n * export const extendedApiSlice = baseApiSlice.injectEndpoints({\n * endpoints: (builder) => ({\n * getPostsByUserId: builder.query({\n * query: (userId) => `/posts/user/${userId}`,\n *\n * onQueryStarted: updatePostOnFulfilled,\n * }),\n * }),\n * })\n * ```\n *\n * @template ResultType - The type of the result `data` returned by the query.\n * @template QueryArgumentType - The type of the argument passed into the query.\n * @template BaseQueryFunctionType - The type of the base query function being used.\n * @template ReducerPath - The type representing the `reducerPath` for the API slice.\n *\n * @since 2.4.0\n * @public\n */\nexport type TypedQueryOnQueryStarted = QueryLifecycleQueryExtraOptions['onQueryStarted'];\n\n/**\n * Provides a way to define a strongly-typed version of\n * {@linkcode QueryLifecycleMutationExtraOptions.onQueryStarted | onQueryStarted}\n * for a specific mutation.\n *\n * @example\n * #### __Create and reuse a strongly-typed `onQueryStarted` function__\n *\n * ```ts\n * import type { TypedMutationOnQueryStarted } from '@reduxjs/toolkit/query'\n * import { createApi, fetchBaseQuery } from '@reduxjs/toolkit/query'\n *\n * type Post = {\n * id: number\n * title: string\n * userId: number\n * }\n *\n * type PostsApiResponse = {\n * posts: Post[]\n * total: number\n * skip: number\n * limit: number\n * }\n *\n * type QueryArgument = Pick & Partial\n *\n * type BaseQueryFunction = ReturnType\n *\n * const baseApiSlice = createApi({\n * baseQuery: fetchBaseQuery({ baseUrl: 'https://dummyjson.com' }),\n * reducerPath: 'postsApi',\n * tagTypes: ['Posts'],\n * endpoints: (builder) => ({\n * getPosts: builder.query({\n * query: () => `/posts`,\n * }),\n *\n * getPostById: builder.query({\n * query: (postId) => `/posts/${postId}`,\n * }),\n * }),\n * })\n *\n * const updatePostOnFulfilled: TypedMutationOnQueryStarted<\n * Post,\n * QueryArgument,\n * BaseQueryFunction,\n * 'postsApi'\n * > = async ({ id, ...patch }, { dispatch, queryFulfilled }) => {\n * const patchCollection = dispatch(\n * baseApiSlice.util.updateQueryData('getPostById', id, (draftPost) => {\n * Object.assign(draftPost, patch)\n * }),\n * )\n *\n * try {\n * await queryFulfilled\n * } catch {\n * patchCollection.undo()\n * }\n * }\n *\n * export const extendedApiSlice = baseApiSlice.injectEndpoints({\n * endpoints: (builder) => ({\n * addPost: builder.mutation>({\n * query: (body) => ({\n * url: `posts/add`,\n * method: 'POST',\n * body,\n * }),\n *\n * onQueryStarted: updatePostOnFulfilled,\n * }),\n *\n * updatePost: builder.mutation({\n * query: ({ id, ...patch }) => ({\n * url: `post/${id}`,\n * method: 'PATCH',\n * body: patch,\n * }),\n *\n * onQueryStarted: updatePostOnFulfilled,\n * }),\n * }),\n * })\n * ```\n *\n * @template ResultType - The type of the result `data` returned by the query.\n * @template QueryArgumentType - The type of the argument passed into the query.\n * @template BaseQueryFunctionType - The type of the base query function being used.\n * @template ReducerPath - The type representing the `reducerPath` for the API slice.\n *\n * @since 2.4.0\n * @public\n */\nexport type TypedMutationOnQueryStarted = QueryLifecycleMutationExtraOptions['onQueryStarted'];\nexport const buildQueryLifecycleHandler: InternalHandlerBuilder = ({\n api,\n context,\n queryThunk,\n mutationThunk\n}) => {\n const isPendingThunk = isPending(queryThunk, mutationThunk);\n const isRejectedThunk = isRejected(queryThunk, mutationThunk);\n const isFullfilledThunk = isFulfilled(queryThunk, mutationThunk);\n type CacheLifecycle = {\n resolve(value: {\n data: unknown;\n meta: unknown;\n }): unknown;\n reject(value: QueryFulfilledRejectionReason): unknown;\n };\n const lifecycleMap: Record = {};\n const handler: ApiMiddlewareInternalHandler = (action, mwApi) => {\n if (isPendingThunk(action)) {\n const {\n requestId,\n arg: {\n endpointName,\n originalArgs\n }\n } = action.meta;\n const endpointDefinition = context.endpointDefinitions[endpointName];\n const onQueryStarted = endpointDefinition?.onQueryStarted;\n if (onQueryStarted) {\n const lifecycle = {} as CacheLifecycle;\n const queryFulfilled = new (Promise as PromiseConstructorWithKnownReason)<{\n data: unknown;\n meta: unknown;\n }, QueryFulfilledRejectionReason>((resolve, reject) => {\n lifecycle.resolve = resolve;\n lifecycle.reject = reject;\n });\n // prevent uncaught promise rejections from happening.\n // if the original promise is used in any way, that will create a new promise that will throw again\n queryFulfilled.catch(() => {});\n lifecycleMap[requestId] = lifecycle;\n const selector = (api.endpoints[endpointName] as any).select(endpointDefinition.type === DefinitionType.query ? originalArgs : requestId);\n const extra = mwApi.dispatch((_, __, extra) => extra);\n const lifecycleApi = {\n ...mwApi,\n getCacheEntry: () => selector(mwApi.getState()),\n requestId,\n extra,\n updateCachedData: (endpointDefinition.type === DefinitionType.query ? (updateRecipe: Recipe) => mwApi.dispatch(api.util.updateQueryData(endpointName as never, originalArgs, updateRecipe)) : undefined) as any,\n queryFulfilled\n };\n onQueryStarted(originalArgs, lifecycleApi);\n }\n } else if (isFullfilledThunk(action)) {\n const {\n requestId,\n baseQueryMeta\n } = action.meta;\n lifecycleMap[requestId]?.resolve({\n data: action.payload,\n meta: baseQueryMeta\n });\n delete lifecycleMap[requestId];\n } else if (isRejectedThunk(action)) {\n const {\n requestId,\n rejectedWithValue,\n baseQueryMeta\n } = action.meta;\n lifecycleMap[requestId]?.reject({\n error: action.payload ?? action.error,\n isUnhandledError: !rejectedWithValue,\n meta: baseQueryMeta as any\n });\n delete lifecycleMap[requestId];\n }\n };\n return handler;\n};","import type { Action, Middleware, ThunkDispatch, UnknownAction } from '@reduxjs/toolkit';\nimport type { EndpointDefinitions, FullTagDescription } from '../../endpointDefinitions';\nimport type { QueryStatus, QuerySubState, RootState } from '../apiState';\nimport type { QueryThunkArg } from '../buildThunks';\nimport { createAction, isAction } from '../rtkImports';\nimport { buildBatchedActionsHandler } from './batchActions';\nimport { buildCacheCollectionHandler } from './cacheCollection';\nimport { buildCacheLifecycleHandler } from './cacheLifecycle';\nimport { buildDevCheckHandler } from './devMiddleware';\nimport { buildInvalidationByTagsHandler } from './invalidationByTags';\nimport { buildPollingHandler } from './polling';\nimport { buildQueryLifecycleHandler } from './queryLifecycle';\nimport type { BuildMiddlewareInput, InternalHandlerBuilder, InternalMiddlewareState } from './types';\nimport { buildWindowEventHandler } from './windowEventHandling';\nimport type { ApiEndpointQuery } from '../module';\nexport type { ReferenceCacheCollection } from './cacheCollection';\nexport type { MutationCacheLifecycleApi, QueryCacheLifecycleApi, ReferenceCacheLifecycle } from './cacheLifecycle';\nexport type { MutationLifecycleApi, QueryLifecycleApi, ReferenceQueryLifecycle, TypedMutationOnQueryStarted, TypedQueryOnQueryStarted } from './queryLifecycle';\nexport type { SubscriptionSelectors } from './types';\nexport function buildMiddleware(input: BuildMiddlewareInput) {\n const {\n reducerPath,\n queryThunk,\n api,\n context\n } = input;\n const {\n apiUid\n } = context;\n const actions = {\n invalidateTags: createAction | null | undefined>>(`${reducerPath}/invalidateTags`)\n };\n const isThisApiSliceAction = (action: Action) => action.type.startsWith(`${reducerPath}/`);\n const handlerBuilders: InternalHandlerBuilder[] = [buildDevCheckHandler, buildCacheCollectionHandler, buildInvalidationByTagsHandler, buildPollingHandler, buildCacheLifecycleHandler, buildQueryLifecycleHandler];\n const middleware: Middleware<{}, RootState, ThunkDispatch> = mwApi => {\n let initialized = false;\n const internalState: InternalMiddlewareState = {\n currentSubscriptions: {}\n };\n const builderArgs = {\n ...(input as any as BuildMiddlewareInput),\n internalState,\n refetchQuery,\n isThisApiSliceAction\n };\n const handlers = handlerBuilders.map(build => build(builderArgs));\n const batchedActionsHandler = buildBatchedActionsHandler(builderArgs);\n const windowEventsHandler = buildWindowEventHandler(builderArgs);\n return next => {\n return action => {\n if (!isAction(action)) {\n return next(action);\n }\n if (!initialized) {\n initialized = true;\n // dispatch before any other action\n mwApi.dispatch(api.internalActions.middlewareRegistered(apiUid));\n }\n const mwApiWithNext = {\n ...mwApi,\n next\n };\n const stateBefore = mwApi.getState();\n const [actionShouldContinue, internalProbeResult] = batchedActionsHandler(action, mwApiWithNext, stateBefore);\n let res: any;\n if (actionShouldContinue) {\n res = next(action);\n } else {\n res = internalProbeResult;\n }\n if (!!mwApi.getState()[reducerPath]) {\n // Only run these checks if the middleware is registered okay\n\n // This looks for actions that aren't specific to the API slice\n windowEventsHandler(action, mwApiWithNext, stateBefore);\n if (isThisApiSliceAction(action) || context.hasRehydrationInfo(action)) {\n // Only run these additional checks if the actions are part of the API slice,\n // or the action has hydration-related data\n for (const handler of handlers) {\n handler(action, mwApiWithNext, stateBefore);\n }\n }\n }\n return res;\n };\n };\n };\n return {\n middleware,\n actions\n };\n function refetchQuery(querySubState: Exclude, {\n status: QueryStatus.uninitialized;\n }>) {\n return (input.api.endpoints[querySubState.endpointName] as ApiEndpointQuery).initiate(querySubState.originalArgs as any, {\n subscribe: false,\n forceRefetch: true\n });\n }\n}","import { QueryStatus } from '../apiState';\nimport type { QueryCacheKey } from '../apiState';\nimport { onFocus, onOnline } from '../setupListeners';\nimport type { ApiMiddlewareInternalHandler, InternalHandlerBuilder, SubMiddlewareApi } from './types';\nimport { countObjectKeys } from '../../utils/countObjectKeys';\nexport const buildWindowEventHandler: InternalHandlerBuilder = ({\n reducerPath,\n context,\n api,\n refetchQuery,\n internalState\n}) => {\n const {\n removeQueryResult\n } = api.internalActions;\n const handler: ApiMiddlewareInternalHandler = (action, mwApi) => {\n if (onFocus.match(action)) {\n refetchValidQueries(mwApi, 'refetchOnFocus');\n }\n if (onOnline.match(action)) {\n refetchValidQueries(mwApi, 'refetchOnReconnect');\n }\n };\n function refetchValidQueries(api: SubMiddlewareApi, type: 'refetchOnFocus' | 'refetchOnReconnect') {\n const state = api.getState()[reducerPath];\n const queries = state.queries;\n const subscriptions = internalState.currentSubscriptions;\n context.batch(() => {\n for (const queryCacheKey of Object.keys(subscriptions)) {\n const querySubState = queries[queryCacheKey];\n const subscriptionSubState = subscriptions[queryCacheKey];\n if (!subscriptionSubState || !querySubState) continue;\n const shouldRefetch = Object.values(subscriptionSubState).some(sub => sub[type] === true) || Object.values(subscriptionSubState).every(sub => sub[type] === undefined) && state.config[type];\n if (shouldRefetch) {\n if (countObjectKeys(subscriptionSubState) === 0) {\n api.dispatch(removeQueryResult({\n queryCacheKey: queryCacheKey as QueryCacheKey\n }));\n } else if (querySubState.status !== QueryStatus.uninitialized) {\n api.dispatch(refetchQuery(querySubState));\n }\n }\n }\n });\n }\n return handler;\n};","/**\n * Note: this file should import all other files for type discovery and declaration merging\n */\nimport type { ActionCreatorWithPayload, Middleware, Reducer, ThunkAction, ThunkDispatch, UnknownAction } from '@reduxjs/toolkit';\nimport { enablePatches } from 'immer';\nimport type { Api, Module } from '../apiTypes';\nimport type { BaseQueryFn } from '../baseQueryTypes';\nimport type { InternalSerializeQueryArgs } from '../defaultSerializeQueryArgs';\nimport type { AssertTagTypes, EndpointDefinitions, MutationDefinition, QueryArgFrom, QueryDefinition, TagDescription } from '../endpointDefinitions';\nimport { isMutationDefinition, isQueryDefinition } from '../endpointDefinitions';\nimport { assertCast, safeAssign } from '../tsHelpers';\nimport type { CombinedState, MutationKeys, QueryKeys, RootState } from './apiState';\nimport type { BuildInitiateApiEndpointMutation, BuildInitiateApiEndpointQuery, MutationActionCreatorResult, QueryActionCreatorResult } from './buildInitiate';\nimport { buildInitiate } from './buildInitiate';\nimport type { ReferenceCacheCollection, ReferenceCacheLifecycle, ReferenceQueryLifecycle } from './buildMiddleware';\nimport { buildMiddleware } from './buildMiddleware';\nimport type { BuildSelectorsApiEndpointMutation, BuildSelectorsApiEndpointQuery } from './buildSelectors';\nimport { buildSelectors } from './buildSelectors';\nimport type { SliceActions, UpsertEntries } from './buildSlice';\nimport { buildSlice } from './buildSlice';\nimport type { BuildThunksApiEndpointMutation, BuildThunksApiEndpointQuery, PatchQueryDataThunk, UpdateQueryDataThunk, UpsertQueryDataThunk } from './buildThunks';\nimport { buildThunks } from './buildThunks';\nimport { createSelector as _createSelector } from './rtkImports';\nimport { onFocus, onFocusLost, onOffline, onOnline } from './setupListeners';\n\n/**\n * `ifOlderThan` - (default: `false` | `number`) - _number is value in seconds_\n * - If specified, it will only run the query if the difference between `new Date()` and the last `fulfilledTimeStamp` is greater than the given value\n *\n * @overloadSummary\n * `force`\n * - If `force: true`, it will ignore the `ifOlderThan` value if it is set and the query will be run even if it exists in the cache.\n */\nexport type PrefetchOptions = {\n ifOlderThan?: false | number;\n} | {\n force?: boolean;\n};\nexport const coreModuleName = /* @__PURE__ */Symbol();\nexport type CoreModule = typeof coreModuleName | ReferenceCacheLifecycle | ReferenceQueryLifecycle | ReferenceCacheCollection;\nexport type ThunkWithReturnValue = ThunkAction;\nexport interface ApiModules<\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nBaseQuery extends BaseQueryFn, Definitions extends EndpointDefinitions, ReducerPath extends string, TagTypes extends string> {\n [coreModuleName]: {\n /**\n * This api's reducer should be mounted at `store[api.reducerPath]`.\n *\n * @example\n * ```ts\n * configureStore({\n * reducer: {\n * [api.reducerPath]: api.reducer,\n * },\n * middleware: (getDefaultMiddleware) => getDefaultMiddleware().concat(api.middleware),\n * })\n * ```\n */\n reducerPath: ReducerPath;\n /**\n * Internal actions not part of the public API. Note: These are subject to change at any given time.\n */\n internalActions: InternalActions;\n /**\n * A standard redux reducer that enables core functionality. Make sure it's included in your store.\n *\n * @example\n * ```ts\n * configureStore({\n * reducer: {\n * [api.reducerPath]: api.reducer,\n * },\n * middleware: (getDefaultMiddleware) => getDefaultMiddleware().concat(api.middleware),\n * })\n * ```\n */\n reducer: Reducer, UnknownAction>;\n /**\n * This is a standard redux middleware and is responsible for things like polling, garbage collection and a handful of other things. Make sure it's included in your store.\n *\n * @example\n * ```ts\n * configureStore({\n * reducer: {\n * [api.reducerPath]: api.reducer,\n * },\n * middleware: (getDefaultMiddleware) => getDefaultMiddleware().concat(api.middleware),\n * })\n * ```\n */\n middleware: Middleware<{}, RootState, ThunkDispatch>;\n /**\n * A collection of utility thunks for various situations.\n */\n util: {\n /**\n * A thunk that (if dispatched) will return a specific running query, identified\n * by `endpointName` and `arg`.\n * If that query is not running, dispatching the thunk will result in `undefined`.\n *\n * Can be used to await a specific query triggered in any way,\n * including via hook calls or manually dispatching `initiate` actions.\n *\n * See https://redux-toolkit.js.org/rtk-query/usage/server-side-rendering for details.\n */\n getRunningQueryThunk>(endpointName: EndpointName, arg: QueryArgFrom): ThunkWithReturnValue | undefined>;\n\n /**\n * A thunk that (if dispatched) will return a specific running mutation, identified\n * by `endpointName` and `fixedCacheKey` or `requestId`.\n * If that mutation is not running, dispatching the thunk will result in `undefined`.\n *\n * Can be used to await a specific mutation triggered in any way,\n * including via hook trigger functions or manually dispatching `initiate` actions.\n *\n * See https://redux-toolkit.js.org/rtk-query/usage/server-side-rendering for details.\n */\n getRunningMutationThunk>(endpointName: EndpointName, fixedCacheKeyOrRequestId: string): ThunkWithReturnValue | undefined>;\n\n /**\n * A thunk that (if dispatched) will return all running queries.\n *\n * Useful for SSR scenarios to await all running queries triggered in any way,\n * including via hook calls or manually dispatching `initiate` actions.\n *\n * See https://redux-toolkit.js.org/rtk-query/usage/server-side-rendering for details.\n */\n getRunningQueriesThunk(): ThunkWithReturnValue>>;\n\n /**\n * A thunk that (if dispatched) will return all running mutations.\n *\n * Useful for SSR scenarios to await all running mutations triggered in any way,\n * including via hook calls or manually dispatching `initiate` actions.\n *\n * See https://redux-toolkit.js.org/rtk-query/usage/server-side-rendering for details.\n */\n getRunningMutationsThunk(): ThunkWithReturnValue>>;\n\n /**\n * A Redux thunk that can be used to manually trigger pre-fetching of data.\n *\n * The thunk accepts three arguments: the name of the endpoint we are updating (such as `'getPost'`), the appropriate query arg values to construct the desired cache key, and a set of options used to determine if the data actually should be re-fetched based on cache staleness.\n *\n * React Hooks users will most likely never need to use this directly, as the `usePrefetch` hook will dispatch this thunk internally as needed when you call the prefetching function supplied by the hook.\n *\n * @example\n *\n * ```ts no-transpile\n * dispatch(api.util.prefetch('getPosts', undefined, { force: true }))\n * ```\n */\n prefetch>(endpointName: EndpointName, arg: QueryArgFrom, options: PrefetchOptions): ThunkAction;\n /**\n * A Redux thunk action creator that, when dispatched, creates and applies a set of JSON diff/patch objects to the current state. This immediately updates the Redux state with those changes.\n *\n * The thunk action creator accepts three arguments: the name of the endpoint we are updating (such as `'getPost'`), the appropriate query arg values to construct the desired cache key, and an `updateRecipe` callback function. The callback receives an Immer-wrapped `draft` of the current state, and may modify the draft to match the expected results after the mutation completes successfully.\n *\n * The thunk executes _synchronously_, and returns an object containing `{patches: Patch[], inversePatches: Patch[], undo: () => void}`. The `patches` and `inversePatches` are generated using Immer's [`produceWithPatches` method](https://immerjs.github.io/immer/patches).\n *\n * This is typically used as the first step in implementing optimistic updates. The generated `inversePatches` can be used to revert the updates by calling `dispatch(patchQueryData(endpointName, arg, inversePatches))`. Alternatively, the `undo` method can be called directly to achieve the same effect.\n *\n * Note that the first two arguments (`endpointName` and `arg`) are used to determine which existing cache entry to update. If no existing cache entry is found, the `updateRecipe` callback will not run.\n *\n * @example\n *\n * ```ts\n * const patchCollection = dispatch(\n * api.util.updateQueryData('getPosts', undefined, (draftPosts) => {\n * draftPosts.push({ id: 1, name: 'Teddy' })\n * })\n * )\n * ```\n */\n updateQueryData: UpdateQueryDataThunk>;\n\n /**\n * A Redux thunk action creator that, when dispatched, acts as an artificial API request to upsert a value into the cache.\n *\n * The thunk action creator accepts three arguments: the name of the endpoint we are updating (such as `'getPost'`), the appropriate query arg values to construct the desired cache key, and the data to upsert.\n *\n * If no cache entry for that cache key exists, a cache entry will be created and the data added. If a cache entry already exists, this will _overwrite_ the existing cache entry data.\n *\n * The thunk executes _asynchronously_, and returns a promise that resolves when the store has been updated.\n *\n * If dispatched while an actual request is in progress, both the upsert and request will be handled as soon as they resolve, resulting in a \"last result wins\" update behavior.\n *\n * @example\n *\n * ```ts\n * await dispatch(\n * api.util.upsertQueryData('getPost', {id: 1}, {id: 1, text: \"Hello!\"})\n * )\n * ```\n */\n upsertQueryData: UpsertQueryDataThunk>;\n /**\n * A Redux thunk that applies a JSON diff/patch array to the cached data for a given query result. This immediately updates the Redux state with those changes.\n *\n * The thunk accepts three arguments: the name of the endpoint we are updating (such as `'getPost'`), the appropriate query arg values to construct the desired cache key, and a JSON diff/patch array as produced by Immer's `produceWithPatches`.\n *\n * This is typically used as the second step in implementing optimistic updates. If a request fails, the optimistically-applied changes can be reverted by dispatching `patchQueryData` with the `inversePatches` that were generated by `updateQueryData` earlier.\n *\n * In cases where it is desired to simply revert the previous changes, it may be preferable to call the `undo` method returned from dispatching `updateQueryData` instead.\n *\n * @example\n * ```ts\n * const patchCollection = dispatch(\n * api.util.updateQueryData('getPosts', undefined, (draftPosts) => {\n * draftPosts.push({ id: 1, name: 'Teddy' })\n * })\n * )\n *\n * // later\n * dispatch(\n * api.util.patchQueryData('getPosts', undefined, patchCollection.inversePatches)\n * )\n *\n * // or\n * patchCollection.undo()\n * ```\n */\n patchQueryData: PatchQueryDataThunk>;\n\n /**\n * A Redux action creator that can be dispatched to manually reset the api state completely. This will immediately remove all existing cache entries, and all queries will be considered 'uninitialized'.\n *\n * @example\n *\n * ```ts\n * dispatch(api.util.resetApiState())\n * ```\n */\n resetApiState: SliceActions['resetApiState'];\n upsertQueryEntries: UpsertEntries;\n\n /**\n * A Redux action creator that can be used to manually invalidate cache tags for [automated re-fetching](../../usage/automated-refetching.mdx).\n *\n * The action creator accepts one argument: the cache tags to be invalidated. It returns an action with those tags as a payload, and the corresponding `invalidateTags` action type for the api.\n *\n * Dispatching the result of this action creator will [invalidate](../../usage/automated-refetching.mdx#invalidating-cache-data) the given tags, causing queries to automatically re-fetch if they are subscribed to cache data that [provides](../../usage/automated-refetching.mdx#providing-cache-data) the corresponding tags.\n *\n * The array of tags provided to the action creator should be in one of the following formats, where `TagType` is equal to a string provided to the [`tagTypes`](../createApi.mdx#tagtypes) property of the api:\n *\n * - `[TagType]`\n * - `[{ type: TagType }]`\n * - `[{ type: TagType, id: number | string }]`\n *\n * @example\n *\n * ```ts\n * dispatch(api.util.invalidateTags(['Post']))\n * dispatch(api.util.invalidateTags([{ type: 'Post', id: 1 }]))\n * dispatch(\n * api.util.invalidateTags([\n * { type: 'Post', id: 1 },\n * { type: 'Post', id: 'LIST' },\n * ])\n * )\n * ```\n */\n invalidateTags: ActionCreatorWithPayload | null | undefined>, string>;\n\n /**\n * A function to select all `{ endpointName, originalArgs, queryCacheKey }` combinations that would be invalidated by a specific set of tags.\n *\n * Can be used for mutations that want to do optimistic updates instead of invalidating a set of tags, but don't know exactly what they need to update.\n */\n selectInvalidatedBy: (state: RootState, tags: ReadonlyArray | null | undefined>) => Array<{\n endpointName: string;\n originalArgs: any;\n queryCacheKey: string;\n }>;\n\n /**\n * A function to select all arguments currently cached for a given endpoint.\n *\n * Can be used for mutations that want to do optimistic updates instead of invalidating a set of tags, but don't know exactly what they need to update.\n */\n selectCachedArgsForQuery: >(state: RootState, queryName: QueryName) => Array>;\n };\n /**\n * Endpoints based on the input endpoints provided to `createApi`, containing `select` and `action matchers`.\n */\n endpoints: { [K in keyof Definitions]: Definitions[K] extends QueryDefinition ? ApiEndpointQuery : Definitions[K] extends MutationDefinition ? ApiEndpointMutation : never };\n };\n}\nexport interface ApiEndpointQuery<\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nDefinition extends QueryDefinition,\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nDefinitions extends EndpointDefinitions> extends BuildThunksApiEndpointQuery, BuildInitiateApiEndpointQuery, BuildSelectorsApiEndpointQuery {\n name: string;\n /**\n * All of these are `undefined` at runtime, purely to be used in TypeScript declarations!\n */\n Types: NonNullable;\n}\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nexport interface ApiEndpointMutation<\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nDefinition extends MutationDefinition,\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nDefinitions extends EndpointDefinitions> extends BuildThunksApiEndpointMutation, BuildInitiateApiEndpointMutation, BuildSelectorsApiEndpointMutation {\n name: string;\n /**\n * All of these are `undefined` at runtime, purely to be used in TypeScript declarations!\n */\n Types: NonNullable;\n}\nexport type ListenerActions = {\n /**\n * Will cause the RTK Query middleware to trigger any refetchOnReconnect-related behavior\n * @link https://rtk-query-docs.netlify.app/api/setupListeners\n */\n onOnline: typeof onOnline;\n onOffline: typeof onOffline;\n /**\n * Will cause the RTK Query middleware to trigger any refetchOnFocus-related behavior\n * @link https://rtk-query-docs.netlify.app/api/setupListeners\n */\n onFocus: typeof onFocus;\n onFocusLost: typeof onFocusLost;\n};\nexport type InternalActions = SliceActions & ListenerActions;\nexport interface CoreModuleOptions {\n /**\n * A selector creator (usually from `reselect`, or matching the same signature)\n */\n createSelector?: typeof _createSelector;\n}\n\n/**\n * Creates a module containing the basic redux logic for use with `buildCreateApi`.\n *\n * @example\n * ```ts\n * const createBaseApi = buildCreateApi(coreModule());\n * ```\n */\nexport const coreModule = ({\n createSelector = _createSelector\n}: CoreModuleOptions = {}): Module => ({\n name: coreModuleName,\n init(api, {\n baseQuery,\n tagTypes,\n reducerPath,\n serializeQueryArgs,\n keepUnusedDataFor,\n refetchOnMountOrArgChange,\n refetchOnFocus,\n refetchOnReconnect,\n invalidationBehavior\n }, context) {\n enablePatches();\n assertCast(serializeQueryArgs);\n const assertTagType: AssertTagTypes = tag => {\n if (typeof process !== 'undefined' && process.env.NODE_ENV === 'development') {\n if (!tagTypes.includes(tag.type as any)) {\n console.error(`Tag type '${tag.type}' was used, but not specified in \\`tagTypes\\`!`);\n }\n }\n return tag;\n };\n Object.assign(api, {\n reducerPath,\n endpoints: {},\n internalActions: {\n onOnline,\n onOffline,\n onFocus,\n onFocusLost\n },\n util: {}\n });\n const {\n queryThunk,\n mutationThunk,\n patchQueryData,\n updateQueryData,\n upsertQueryData,\n prefetch,\n buildMatchThunkActions\n } = buildThunks({\n baseQuery,\n reducerPath,\n context,\n api,\n serializeQueryArgs,\n assertTagType\n });\n const {\n reducer,\n actions: sliceActions\n } = buildSlice({\n context,\n queryThunk,\n mutationThunk,\n serializeQueryArgs,\n reducerPath,\n assertTagType,\n config: {\n refetchOnFocus,\n refetchOnReconnect,\n refetchOnMountOrArgChange,\n keepUnusedDataFor,\n reducerPath,\n invalidationBehavior\n }\n });\n safeAssign(api.util, {\n patchQueryData,\n updateQueryData,\n upsertQueryData,\n prefetch,\n resetApiState: sliceActions.resetApiState,\n upsertQueryEntries: sliceActions.cacheEntriesUpserted as any\n });\n safeAssign(api.internalActions, sliceActions);\n const {\n middleware,\n actions: middlewareActions\n } = buildMiddleware({\n reducerPath,\n context,\n queryThunk,\n mutationThunk,\n api,\n assertTagType\n });\n safeAssign(api.util, middlewareActions);\n safeAssign(api, {\n reducer: reducer as any,\n middleware\n });\n const {\n buildQuerySelector,\n buildMutationSelector,\n selectInvalidatedBy,\n selectCachedArgsForQuery\n } = buildSelectors({\n serializeQueryArgs: serializeQueryArgs as any,\n reducerPath,\n createSelector\n });\n safeAssign(api.util, {\n selectInvalidatedBy,\n selectCachedArgsForQuery\n });\n const {\n buildInitiateQuery,\n buildInitiateMutation,\n getRunningMutationThunk,\n getRunningMutationsThunk,\n getRunningQueriesThunk,\n getRunningQueryThunk\n } = buildInitiate({\n queryThunk,\n mutationThunk,\n api,\n serializeQueryArgs: serializeQueryArgs as any,\n context\n });\n safeAssign(api.util, {\n getRunningMutationThunk,\n getRunningMutationsThunk,\n getRunningQueryThunk,\n getRunningQueriesThunk\n });\n return {\n name: coreModuleName,\n injectEndpoint(endpointName, definition) {\n const anyApi = api as any as Api, string, string, CoreModule>;\n anyApi.endpoints[endpointName] ??= {} as any;\n if (isQueryDefinition(definition)) {\n safeAssign(anyApi.endpoints[endpointName], {\n name: endpointName,\n select: buildQuerySelector(endpointName, definition),\n initiate: buildInitiateQuery(endpointName, definition)\n }, buildMatchThunkActions(queryThunk, endpointName));\n } else if (isMutationDefinition(definition)) {\n safeAssign(anyApi.endpoints[endpointName], {\n name: endpointName,\n select: buildMutationSelector(),\n initiate: buildInitiateMutation(endpointName)\n }, buildMatchThunkActions(mutationThunk, endpointName));\n }\n }\n };\n }\n});","export function getOrInsert(map: WeakMap, key: K, value: V): V;\nexport function getOrInsert(map: Map, key: K, value: V): V;\nexport function getOrInsert(map: Map | WeakMap, key: K, value: V): V {\n if (map.has(key)) return map.get(key) as V;\n return map.set(key, value).get(key) as V;\n}","import type { Middleware, StoreEnhancer } from 'redux';\nimport type { Tuple } from './utils';\nexport function safeAssign(target: T, ...args: Array>>) {\n Object.assign(target, ...args);\n}\n\n/**\n * return True if T is `any`, otherwise return False\n * taken from https://github.com/joonhocho/tsdef\n *\n * @internal\n */\nexport type IsAny =\n// test if we are going the left AND right path in the condition\ntrue | false extends (T extends never ? true : false) ? True : False;\nexport type CastAny = IsAny;\n\n/**\n * return True if T is `unknown`, otherwise return False\n * taken from https://github.com/joonhocho/tsdef\n *\n * @internal\n */\nexport type IsUnknown = unknown extends T ? IsAny : False;\nexport type FallbackIfUnknown = IsUnknown;\n\n/**\n * @internal\n */\nexport type IfMaybeUndefined = [undefined] extends [P] ? True : False;\n\n/**\n * @internal\n */\nexport type IfVoid = [void] extends [P] ? True : False;\n\n/**\n * @internal\n */\nexport type IsEmptyObj = T extends any ? keyof T extends never ? IsUnknown>> : False : never;\n\n/**\n * returns True if TS version is above 3.5, False if below.\n * uses feature detection to detect TS version >= 3.5\n * * versions below 3.5 will return `{}` for unresolvable interference\n * * versions above will return `unknown`\n *\n * @internal\n */\nexport type AtLeastTS35 = [True, False][IsUnknown() => T>, 0, 1>];\n\n/**\n * @internal\n */\nexport type IsUnknownOrNonInferrable = AtLeastTS35, IsEmptyObj>>;\n\n/**\n * Convert a Union type `(A|B)` to an intersection type `(A&B)`\n */\nexport type UnionToIntersection = (U extends any ? (k: U) => void : never) extends (k: infer I) => void ? I : never;\n\n// Appears to have a convenient side effect of ignoring `never` even if that's not what you specified\nexport type ExcludeFromTuple = T extends [infer Head, ...infer Tail] ? ExcludeFromTuple : Acc;\ntype ExtractDispatchFromMiddlewareTuple = MiddlewareTuple extends [infer Head, ...infer Tail] ? ExtractDispatchFromMiddlewareTuple ? IsAny : {})> : Acc;\nexport type ExtractDispatchExtensions = M extends Tuple ? ExtractDispatchFromMiddlewareTuple : M extends ReadonlyArray ? ExtractDispatchFromMiddlewareTuple<[...M], {}> : never;\ntype ExtractStoreExtensionsFromEnhancerTuple = EnhancerTuple extends [infer Head, ...infer Tail] ? ExtractStoreExtensionsFromEnhancerTuple ? IsAny : {})> : Acc;\nexport type ExtractStoreExtensions = E extends Tuple ? ExtractStoreExtensionsFromEnhancerTuple : E extends ReadonlyArray ? UnionToIntersection ? Ext extends {} ? IsAny : {} : {}> : never;\ntype ExtractStateExtensionsFromEnhancerTuple = EnhancerTuple extends [infer Head, ...infer Tail] ? ExtractStateExtensionsFromEnhancerTuple ? IsAny : {})> : Acc;\nexport type ExtractStateExtensions = E extends Tuple ? ExtractStateExtensionsFromEnhancerTuple : E extends ReadonlyArray ? UnionToIntersection ? StateExt extends {} ? IsAny : {} : {}> : never;\n\n/**\n * Helper type. Passes T out again, but boxes it in a way that it cannot\n * \"widen\" the type by accident if it is a generic that should be inferred\n * from elsewhere.\n *\n * @internal\n */\nexport type NoInfer = [T][T extends any ? 0 : never];\nexport type NonUndefined = T extends undefined ? never : T;\nexport type WithRequiredProp = Omit & Required>;\nexport type WithOptionalProp = Omit & Partial>;\nexport interface TypeGuard {\n (value: any): value is T;\n}\nexport interface HasMatchFunction {\n match: TypeGuard;\n}\nexport const hasMatchFunction = (v: Matcher): v is HasMatchFunction => {\n return v && typeof (v as HasMatchFunction).match === 'function';\n};\n\n/** @public */\nexport type Matcher = HasMatchFunction | TypeGuard;\n\n/** @public */\nexport type ActionFromMatcher> = M extends Matcher ? T : never;\nexport type Id = { [K in keyof T]: T[K] } & {};\nexport type Tail = T extends [any, ...infer Tail] ? Tail : never;\nexport type UnknownIfNonSpecific = {} extends T ? unknown : T;\n\n/**\n * A Promise that will never reject.\n * @see https://github.com/reduxjs/redux-toolkit/issues/4101\n */\nexport type SafePromise = Promise & {\n __linterBrands: 'SafePromise';\n};\n\n/**\n * Properly wraps a Promise as a {@link SafePromise} with .catch(fallback).\n */\nexport function asSafePromise(promise: Promise, fallback: (error: unknown) => Rejected) {\n return promise.catch(fallback) as SafePromise;\n}","import { buildCreateApi } from '../createApi';\nimport { coreModule } from './module';\nexport const createApi = /* @__PURE__ */buildCreateApi(coreModule());\nexport { QueryStatus } from './apiState';\nexport type { CombinedState, MutationKeys, QueryCacheKey, QueryKeys, QuerySubState, RootState, SubscriptionOptions } from './apiState';\nexport type { MutationActionCreatorResult, QueryActionCreatorResult, StartQueryActionCreatorOptions } from './buildInitiate';\nexport type { MutationCacheLifecycleApi, MutationLifecycleApi, QueryCacheLifecycleApi, QueryLifecycleApi, SubscriptionSelectors, TypedMutationOnQueryStarted, TypedQueryOnQueryStarted } from './buildMiddleware/index';\nexport { skipToken } from './buildSelectors';\nexport type { MutationResultSelectorResult, QueryResultSelectorResult, SkipToken } from './buildSelectors';\nexport type { SliceActions } from './buildSlice';\nexport type { PatchQueryDataThunk, UpdateQueryDataThunk, UpsertQueryDataThunk } from './buildThunks';\nexport { coreModuleName } from './module';\nexport type { ApiEndpointMutation, ApiEndpointQuery, CoreModule, InternalActions, PrefetchOptions, ThunkWithReturnValue } from './module';\nexport { setupListeners } from './setupListeners';\nexport { buildCreateApi, coreModule };","/**\n * Adapted from React: https://github.com/facebook/react/blob/master/packages/shared/formatProdErrorMessage.js\n *\n * Do not require this module directly! Use normal throw error calls. These messages will be replaced with error codes\n * during build.\n * @param {number} code\n */\nexport function formatProdErrorMessage(code: number) {\n return `Minified Redux error #${code}; visit https://redux.js.org/Errors?code=${code} for the full message or ` + 'use the non-minified dev environment for full errors. ';\n}","declare global {\n interface SymbolConstructor {\n readonly observable: symbol;\n }\n}\nconst $$observable = /* #__PURE__ */(() => typeof Symbol === 'function' && Symbol.observable || '@@observable')();\nexport default $$observable;","/**\n * These are private action types reserved by Redux.\n * For any unknown actions, you must return the current state.\n * If the current state is undefined, you must return the initial state.\n * Do not reference these action types directly in your code.\n */\n\nconst randomString = () => Math.random().toString(36).substring(7).split('').join('.');\nconst ActionTypes = {\n INIT: `@@redux/INIT${/* #__PURE__ */randomString()}`,\n REPLACE: `@@redux/REPLACE${/* #__PURE__ */randomString()}`,\n PROBE_UNKNOWN_ACTION: () => `@@redux/PROBE_UNKNOWN_ACTION${randomString()}`\n};\nexport default ActionTypes;","/**\n * @param obj The object to inspect.\n * @returns True if the argument appears to be a plain object.\n */\nexport default function isPlainObject(obj: any): obj is object {\n if (typeof obj !== 'object' || obj === null) return false;\n let proto = obj;\n while (Object.getPrototypeOf(proto) !== null) {\n proto = Object.getPrototypeOf(proto);\n }\n return Object.getPrototypeOf(obj) === proto || Object.getPrototypeOf(obj) === null;\n}","import { formatProdErrorMessage as _formatProdErrorMessage13 } from \"src/utils/formatProdErrorMessage\";\nimport { formatProdErrorMessage as _formatProdErrorMessage12 } from \"src/utils/formatProdErrorMessage\";\nimport { formatProdErrorMessage as _formatProdErrorMessage11 } from \"src/utils/formatProdErrorMessage\";\nimport { formatProdErrorMessage as _formatProdErrorMessage10 } from \"src/utils/formatProdErrorMessage\";\nimport { formatProdErrorMessage as _formatProdErrorMessage9 } from \"src/utils/formatProdErrorMessage\";\nimport { formatProdErrorMessage as _formatProdErrorMessage8 } from \"src/utils/formatProdErrorMessage\";\nimport { formatProdErrorMessage as _formatProdErrorMessage7 } from \"src/utils/formatProdErrorMessage\";\nimport { formatProdErrorMessage as _formatProdErrorMessage6 } from \"src/utils/formatProdErrorMessage\";\nimport { formatProdErrorMessage as _formatProdErrorMessage5 } from \"src/utils/formatProdErrorMessage\";\nimport { formatProdErrorMessage as _formatProdErrorMessage4 } from \"src/utils/formatProdErrorMessage\";\nimport { formatProdErrorMessage as _formatProdErrorMessage3 } from \"src/utils/formatProdErrorMessage\";\nimport { formatProdErrorMessage as _formatProdErrorMessage2 } from \"src/utils/formatProdErrorMessage\";\nimport { formatProdErrorMessage as _formatProdErrorMessage } from \"src/utils/formatProdErrorMessage\";\nimport $$observable from './utils/symbol-observable';\nimport { Store, StoreEnhancer, Dispatch, Observer, ListenerCallback, UnknownIfNonSpecific } from './types/store';\nimport { Action } from './types/actions';\nimport { Reducer } from './types/reducers';\nimport ActionTypes from './utils/actionTypes';\nimport isPlainObject from './utils/isPlainObject';\nimport { kindOf } from './utils/kindOf';\n\n/**\n * @deprecated\n *\n * **We recommend using the `configureStore` method\n * of the `@reduxjs/toolkit` package**, which replaces `createStore`.\n *\n * Redux Toolkit is our recommended approach for writing Redux logic today,\n * including store setup, reducers, data fetching, and more.\n *\n * **For more details, please read this Redux docs page:**\n * **https://redux.js.org/introduction/why-rtk-is-redux-today**\n *\n * `configureStore` from Redux Toolkit is an improved version of `createStore` that\n * simplifies setup and helps avoid common bugs.\n *\n * You should not be using the `redux` core package by itself today, except for learning purposes.\n * The `createStore` method from the core `redux` package will not be removed, but we encourage\n * all users to migrate to using Redux Toolkit for all Redux code.\n *\n * If you want to use `createStore` without this visual deprecation warning, use\n * the `legacy_createStore` import instead:\n *\n * `import { legacy_createStore as createStore} from 'redux'`\n *\n */\nexport function createStore(reducer: Reducer, enhancer?: StoreEnhancer): Store> & Ext;\n/**\n * @deprecated\n *\n * **We recommend using the `configureStore` method\n * of the `@reduxjs/toolkit` package**, which replaces `createStore`.\n *\n * Redux Toolkit is our recommended approach for writing Redux logic today,\n * including store setup, reducers, data fetching, and more.\n *\n * **For more details, please read this Redux docs page:**\n * **https://redux.js.org/introduction/why-rtk-is-redux-today**\n *\n * `configureStore` from Redux Toolkit is an improved version of `createStore` that\n * simplifies setup and helps avoid common bugs.\n *\n * You should not be using the `redux` core package by itself today, except for learning purposes.\n * The `createStore` method from the core `redux` package will not be removed, but we encourage\n * all users to migrate to using Redux Toolkit for all Redux code.\n *\n * If you want to use `createStore` without this visual deprecation warning, use\n * the `legacy_createStore` import instead:\n *\n * `import { legacy_createStore as createStore} from 'redux'`\n *\n */\nexport function createStore(reducer: Reducer, preloadedState?: PreloadedState | undefined, enhancer?: StoreEnhancer): Store> & Ext;\nexport function createStore(reducer: Reducer, preloadedState?: PreloadedState | StoreEnhancer | undefined, enhancer?: StoreEnhancer): Store> & Ext {\n if (typeof reducer !== 'function') {\n throw new Error(process.env.NODE_ENV === \"production\" ? _formatProdErrorMessage(2) : `Expected the root reducer to be a function. Instead, received: '${kindOf(reducer)}'`);\n }\n if (typeof preloadedState === 'function' && typeof enhancer === 'function' || typeof enhancer === 'function' && typeof arguments[3] === 'function') {\n throw new Error(process.env.NODE_ENV === \"production\" ? _formatProdErrorMessage2(0) : 'It looks like you are passing several store enhancers to ' + 'createStore(). This is not supported. Instead, compose them ' + 'together to a single function. See https://redux.js.org/tutorials/fundamentals/part-4-store#creating-a-store-with-enhancers for an example.');\n }\n if (typeof preloadedState === 'function' && typeof enhancer === 'undefined') {\n enhancer = (preloadedState as StoreEnhancer);\n preloadedState = undefined;\n }\n if (typeof enhancer !== 'undefined') {\n if (typeof enhancer !== 'function') {\n throw new Error(process.env.NODE_ENV === \"production\" ? _formatProdErrorMessage3(1) : `Expected the enhancer to be a function. Instead, received: '${kindOf(enhancer)}'`);\n }\n return enhancer(createStore)(reducer, (preloadedState as PreloadedState | undefined));\n }\n let currentReducer = reducer;\n let currentState: S | PreloadedState | undefined = (preloadedState as PreloadedState | undefined);\n let currentListeners: Map | null = new Map();\n let nextListeners = currentListeners;\n let listenerIdCounter = 0;\n let isDispatching = false;\n\n /**\n * This makes a shallow copy of currentListeners so we can use\n * nextListeners as a temporary list while dispatching.\n *\n * This prevents any bugs around consumers calling\n * subscribe/unsubscribe in the middle of a dispatch.\n */\n function ensureCanMutateNextListeners() {\n if (nextListeners === currentListeners) {\n nextListeners = new Map();\n currentListeners.forEach((listener, key) => {\n nextListeners.set(key, listener);\n });\n }\n }\n\n /**\n * Reads the state tree managed by the store.\n *\n * @returns The current state tree of your application.\n */\n function getState(): S {\n if (isDispatching) {\n throw new Error(process.env.NODE_ENV === \"production\" ? _formatProdErrorMessage4(3) : 'You may not call store.getState() while the reducer is executing. ' + 'The reducer has already received the state as an argument. ' + 'Pass it down from the top reducer instead of reading it from the store.');\n }\n return (currentState as S);\n }\n\n /**\n * Adds a change listener. It will be called any time an action is dispatched,\n * and some part of the state tree may potentially have changed. You may then\n * call `getState()` to read the current state tree inside the callback.\n *\n * You may call `dispatch()` from a change listener, with the following\n * caveats:\n *\n * 1. The subscriptions are snapshotted just before every `dispatch()` call.\n * If you subscribe or unsubscribe while the listeners are being invoked, this\n * will not have any effect on the `dispatch()` that is currently in progress.\n * However, the next `dispatch()` call, whether nested or not, will use a more\n * recent snapshot of the subscription list.\n *\n * 2. The listener should not expect to see all state changes, as the state\n * might have been updated multiple times during a nested `dispatch()` before\n * the listener is called. It is, however, guaranteed that all subscribers\n * registered before the `dispatch()` started will be called with the latest\n * state by the time it exits.\n *\n * @param listener A callback to be invoked on every dispatch.\n * @returns A function to remove this change listener.\n */\n function subscribe(listener: () => void) {\n if (typeof listener !== 'function') {\n throw new Error(process.env.NODE_ENV === \"production\" ? _formatProdErrorMessage5(4) : `Expected the listener to be a function. Instead, received: '${kindOf(listener)}'`);\n }\n if (isDispatching) {\n throw new Error(process.env.NODE_ENV === \"production\" ? _formatProdErrorMessage6(5) : 'You may not call store.subscribe() while the reducer is executing. ' + 'If you would like to be notified after the store has been updated, subscribe from a ' + 'component and invoke store.getState() in the callback to access the latest state. ' + 'See https://redux.js.org/api/store#subscribelistener for more details.');\n }\n let isSubscribed = true;\n ensureCanMutateNextListeners();\n const listenerId = listenerIdCounter++;\n nextListeners.set(listenerId, listener);\n return function unsubscribe() {\n if (!isSubscribed) {\n return;\n }\n if (isDispatching) {\n throw new Error(process.env.NODE_ENV === \"production\" ? _formatProdErrorMessage7(6) : 'You may not unsubscribe from a store listener while the reducer is executing. ' + 'See https://redux.js.org/api/store#subscribelistener for more details.');\n }\n isSubscribed = false;\n ensureCanMutateNextListeners();\n nextListeners.delete(listenerId);\n currentListeners = null;\n };\n }\n\n /**\n * Dispatches an action. It is the only way to trigger a state change.\n *\n * The `reducer` function, used to create the store, will be called with the\n * current state tree and the given `action`. Its return value will\n * be considered the **next** state of the tree, and the change listeners\n * will be notified.\n *\n * The base implementation only supports plain object actions. If you want to\n * dispatch a Promise, an Observable, a thunk, or something else, you need to\n * wrap your store creating function into the corresponding middleware. For\n * example, see the documentation for the `redux-thunk` package. Even the\n * middleware will eventually dispatch plain object actions using this method.\n *\n * @param action A plain object representing “what changed”. It is\n * a good idea to keep actions serializable so you can record and replay user\n * sessions, or use the time travelling `redux-devtools`. An action must have\n * a `type` property which may not be `undefined`. It is a good idea to use\n * string constants for action types.\n *\n * @returns For convenience, the same action object you dispatched.\n *\n * Note that, if you use a custom middleware, it may wrap `dispatch()` to\n * return something else (for example, a Promise you can await).\n */\n function dispatch(action: A) {\n if (!isPlainObject(action)) {\n throw new Error(process.env.NODE_ENV === \"production\" ? _formatProdErrorMessage8(7) : `Actions must be plain objects. Instead, the actual type was: '${kindOf(action)}'. You may need to add middleware to your store setup to handle dispatching other values, such as 'redux-thunk' to handle dispatching functions. See https://redux.js.org/tutorials/fundamentals/part-4-store#middleware and https://redux.js.org/tutorials/fundamentals/part-6-async-logic#using-the-redux-thunk-middleware for examples.`);\n }\n if (typeof action.type === 'undefined') {\n throw new Error(process.env.NODE_ENV === \"production\" ? _formatProdErrorMessage9(8) : 'Actions may not have an undefined \"type\" property. You may have misspelled an action type string constant.');\n }\n if (typeof action.type !== 'string') {\n throw new Error(process.env.NODE_ENV === \"production\" ? _formatProdErrorMessage10(17) : `Action \"type\" property must be a string. Instead, the actual type was: '${kindOf(action.type)}'. Value was: '${action.type}' (stringified)`);\n }\n if (isDispatching) {\n throw new Error(process.env.NODE_ENV === \"production\" ? _formatProdErrorMessage11(9) : 'Reducers may not dispatch actions.');\n }\n try {\n isDispatching = true;\n currentState = currentReducer(currentState, action);\n } finally {\n isDispatching = false;\n }\n const listeners = currentListeners = nextListeners;\n listeners.forEach(listener => {\n listener();\n });\n return action;\n }\n\n /**\n * Replaces the reducer currently used by the store to calculate the state.\n *\n * You might need this if your app implements code splitting and you want to\n * load some of the reducers dynamically. You might also need this if you\n * implement a hot reloading mechanism for Redux.\n *\n * @param nextReducer The reducer for the store to use instead.\n */\n function replaceReducer(nextReducer: Reducer): void {\n if (typeof nextReducer !== 'function') {\n throw new Error(process.env.NODE_ENV === \"production\" ? _formatProdErrorMessage12(10) : `Expected the nextReducer to be a function. Instead, received: '${kindOf(nextReducer)}`);\n }\n currentReducer = ((nextReducer as unknown) as Reducer);\n\n // This action has a similar effect to ActionTypes.INIT.\n // Any reducers that existed in both the new and old rootReducer\n // will receive the previous state. This effectively populates\n // the new state tree with any relevant data from the old one.\n dispatch(({\n type: ActionTypes.REPLACE\n } as A));\n }\n\n /**\n * Interoperability point for observable/reactive libraries.\n * @returns A minimal observable of state changes.\n * For more information, see the observable proposal:\n * https://github.com/tc39/proposal-observable\n */\n function observable() {\n const outerSubscribe = subscribe;\n return {\n /**\n * The minimal observable subscription method.\n * @param observer Any object that can be used as an observer.\n * The observer object should have a `next` method.\n * @returns An object with an `unsubscribe` method that can\n * be used to unsubscribe the observable from the store, and prevent further\n * emission of values from the observable.\n */\n subscribe(observer: unknown) {\n if (typeof observer !== 'object' || observer === null) {\n throw new Error(process.env.NODE_ENV === \"production\" ? _formatProdErrorMessage13(11) : `Expected the observer to be an object. Instead, received: '${kindOf(observer)}'`);\n }\n function observeState() {\n const observerAsObserver = (observer as Observer);\n if (observerAsObserver.next) {\n observerAsObserver.next(getState());\n }\n }\n observeState();\n const unsubscribe = outerSubscribe(observeState);\n return {\n unsubscribe\n };\n },\n [$$observable]() {\n return this;\n }\n };\n }\n\n // When a store is created, an \"INIT\" action is dispatched so that every\n // reducer returns their initial state. This effectively populates\n // the initial state tree.\n dispatch(({\n type: ActionTypes.INIT\n } as A));\n const store = (({\n dispatch: (dispatch as Dispatch),\n subscribe,\n getState,\n replaceReducer,\n [$$observable]: observable\n } as unknown) as Store & Ext);\n return store;\n}\n\n/**\n * Creates a Redux store that holds the state tree.\n *\n * **We recommend using `configureStore` from the\n * `@reduxjs/toolkit` package**, which replaces `createStore`:\n * **https://redux.js.org/introduction/why-rtk-is-redux-today**\n *\n * The only way to change the data in the store is to call `dispatch()` on it.\n *\n * There should only be a single store in your app. To specify how different\n * parts of the state tree respond to actions, you may combine several reducers\n * into a single reducer function by using `combineReducers`.\n *\n * @param {Function} reducer A function that returns the next state tree, given\n * the current state tree and the action to handle.\n *\n * @param {any} [preloadedState] The initial state. You may optionally specify it\n * to hydrate the state from the server in universal apps, or to restore a\n * previously serialized user session.\n * If you use `combineReducers` to produce the root reducer function, this must be\n * an object with the same shape as `combineReducers` keys.\n *\n * @param {Function} [enhancer] The store enhancer. You may optionally specify it\n * to enhance the store with third-party capabilities such as middleware,\n * time travel, persistence, etc. The only store enhancer that ships with Redux\n * is `applyMiddleware()`.\n *\n * @returns {Store} A Redux store that lets you read the state, dispatch actions\n * and subscribe to changes.\n */\nexport function legacy_createStore(reducer: Reducer, enhancer?: StoreEnhancer): Store> & Ext;\n/**\n * Creates a Redux store that holds the state tree.\n *\n * **We recommend using `configureStore` from the\n * `@reduxjs/toolkit` package**, which replaces `createStore`:\n * **https://redux.js.org/introduction/why-rtk-is-redux-today**\n *\n * The only way to change the data in the store is to call `dispatch()` on it.\n *\n * There should only be a single store in your app. To specify how different\n * parts of the state tree respond to actions, you may combine several reducers\n * into a single reducer function by using `combineReducers`.\n *\n * @param {Function} reducer A function that returns the next state tree, given\n * the current state tree and the action to handle.\n *\n * @param {any} [preloadedState] The initial state. You may optionally specify it\n * to hydrate the state from the server in universal apps, or to restore a\n * previously serialized user session.\n * If you use `combineReducers` to produce the root reducer function, this must be\n * an object with the same shape as `combineReducers` keys.\n *\n * @param {Function} [enhancer] The store enhancer. You may optionally specify it\n * to enhance the store with third-party capabilities such as middleware,\n * time travel, persistence, etc. The only store enhancer that ships with Redux\n * is `applyMiddleware()`.\n *\n * @returns {Store} A Redux store that lets you read the state, dispatch actions\n * and subscribe to changes.\n */\nexport function legacy_createStore(reducer: Reducer, preloadedState?: PreloadedState | undefined, enhancer?: StoreEnhancer): Store> & Ext;\nexport function legacy_createStore(reducer: Reducer, preloadedState?: PreloadedState | StoreEnhancer | undefined, enhancer?: StoreEnhancer): Store> & Ext {\n return createStore(reducer, (preloadedState as any), enhancer);\n}","import { formatProdErrorMessage as _formatProdErrorMessage3 } from \"src/utils/formatProdErrorMessage\";\nimport { formatProdErrorMessage as _formatProdErrorMessage2 } from \"src/utils/formatProdErrorMessage\";\nimport { formatProdErrorMessage as _formatProdErrorMessage } from \"src/utils/formatProdErrorMessage\";\nimport { Action } from './types/actions';\nimport { ActionFromReducersMapObject, PreloadedStateShapeFromReducersMapObject, Reducer, StateFromReducersMapObject } from './types/reducers';\nimport ActionTypes from './utils/actionTypes';\nimport isPlainObject from './utils/isPlainObject';\nimport warning from './utils/warning';\nimport { kindOf } from './utils/kindOf';\nfunction getUnexpectedStateShapeWarningMessage(inputState: object, reducers: {\n [key: string]: Reducer;\n}, action: Action, unexpectedKeyCache: {\n [key: string]: true;\n}) {\n const reducerKeys = Object.keys(reducers);\n const argumentName = action && action.type === ActionTypes.INIT ? 'preloadedState argument passed to createStore' : 'previous state received by the reducer';\n if (reducerKeys.length === 0) {\n return 'Store does not have a valid reducer. Make sure the argument passed ' + 'to combineReducers is an object whose values are reducers.';\n }\n if (!isPlainObject(inputState)) {\n return `The ${argumentName} has unexpected type of \"${kindOf(inputState)}\". Expected argument to be an object with the following ` + `keys: \"${reducerKeys.join('\", \"')}\"`;\n }\n const unexpectedKeys = Object.keys(inputState).filter(key => !reducers.hasOwnProperty(key) && !unexpectedKeyCache[key]);\n unexpectedKeys.forEach(key => {\n unexpectedKeyCache[key] = true;\n });\n if (action && action.type === ActionTypes.REPLACE) return;\n if (unexpectedKeys.length > 0) {\n return `Unexpected ${unexpectedKeys.length > 1 ? 'keys' : 'key'} ` + `\"${unexpectedKeys.join('\", \"')}\" found in ${argumentName}. ` + `Expected to find one of the known reducer keys instead: ` + `\"${reducerKeys.join('\", \"')}\". Unexpected keys will be ignored.`;\n }\n}\nfunction assertReducerShape(reducers: {\n [key: string]: Reducer;\n}) {\n Object.keys(reducers).forEach(key => {\n const reducer = reducers[key];\n const initialState = reducer(undefined, {\n type: ActionTypes.INIT\n });\n if (typeof initialState === 'undefined') {\n throw new Error(process.env.NODE_ENV === \"production\" ? _formatProdErrorMessage(12) : `The slice reducer for key \"${key}\" returned undefined during initialization. ` + `If the state passed to the reducer is undefined, you must ` + `explicitly return the initial state. The initial state may ` + `not be undefined. If you don't want to set a value for this reducer, ` + `you can use null instead of undefined.`);\n }\n if (typeof reducer(undefined, {\n type: ActionTypes.PROBE_UNKNOWN_ACTION()\n }) === 'undefined') {\n throw new Error(process.env.NODE_ENV === \"production\" ? _formatProdErrorMessage2(13) : `The slice reducer for key \"${key}\" returned undefined when probed with a random type. ` + `Don't try to handle '${ActionTypes.INIT}' or other actions in \"redux/*\" ` + `namespace. They are considered private. Instead, you must return the ` + `current state for any unknown actions, unless it is undefined, ` + `in which case you must return the initial state, regardless of the ` + `action type. The initial state may not be undefined, but can be null.`);\n }\n });\n}\n\n/**\n * Turns an object whose values are different reducer functions, into a single\n * reducer function. It will call every child reducer, and gather their results\n * into a single state object, whose keys correspond to the keys of the passed\n * reducer functions.\n *\n * @template S Combined state object type.\n *\n * @param reducers An object whose values correspond to different reducer\n * functions that need to be combined into one. One handy way to obtain it\n * is to use `import * as reducers` syntax. The reducers may never\n * return undefined for any action. Instead, they should return their\n * initial state if the state passed to them was undefined, and the current\n * state for any unrecognized action.\n *\n * @returns A reducer function that invokes every reducer inside the passed\n * object, and builds a state object with the same shape.\n */\nexport default function combineReducers(reducers: M): M[keyof M] extends Reducer | undefined ? Reducer, ActionFromReducersMapObject, Partial>> : never;\nexport default function combineReducers(reducers: {\n [key: string]: Reducer;\n}) {\n const reducerKeys = Object.keys(reducers);\n const finalReducers: {\n [key: string]: Reducer;\n } = {};\n for (let i = 0; i < reducerKeys.length; i++) {\n const key = reducerKeys[i];\n if (process.env.NODE_ENV !== 'production') {\n if (typeof reducers[key] === 'undefined') {\n warning(`No reducer provided for key \"${key}\"`);\n }\n }\n if (typeof reducers[key] === 'function') {\n finalReducers[key] = reducers[key];\n }\n }\n const finalReducerKeys = Object.keys(finalReducers);\n\n // This is used to make sure we don't warn about the same\n // keys multiple times.\n let unexpectedKeyCache: {\n [key: string]: true;\n };\n if (process.env.NODE_ENV !== 'production') {\n unexpectedKeyCache = {};\n }\n let shapeAssertionError: unknown;\n try {\n assertReducerShape(finalReducers);\n } catch (e) {\n shapeAssertionError = e;\n }\n return function combination(state: StateFromReducersMapObject = {}, action: Action) {\n if (shapeAssertionError) {\n throw shapeAssertionError;\n }\n if (process.env.NODE_ENV !== 'production') {\n const warningMessage = getUnexpectedStateShapeWarningMessage(state, finalReducers, action, unexpectedKeyCache);\n if (warningMessage) {\n warning(warningMessage);\n }\n }\n let hasChanged = false;\n const nextState: StateFromReducersMapObject = {};\n for (let i = 0; i < finalReducerKeys.length; i++) {\n const key = finalReducerKeys[i];\n const reducer = finalReducers[key];\n const previousStateForKey = state[key];\n const nextStateForKey = reducer(previousStateForKey, action);\n if (typeof nextStateForKey === 'undefined') {\n const actionType = action && action.type;\n throw new Error(process.env.NODE_ENV === \"production\" ? _formatProdErrorMessage3(14) : `When called with an action of type ${actionType ? `\"${String(actionType)}\"` : '(unknown type)'}, the slice reducer for key \"${key}\" returned undefined. ` + `To ignore an action, you must explicitly return the previous state. ` + `If you want this reducer to hold no value, you can return null instead of undefined.`);\n }\n nextState[key] = nextStateForKey;\n hasChanged = hasChanged || nextStateForKey !== previousStateForKey;\n }\n hasChanged = hasChanged || finalReducerKeys.length !== Object.keys(state).length;\n return hasChanged ? nextState : state;\n };\n}","type Func = (...a: T) => R;\n\n/**\n * Composes single-argument functions from right to left. The rightmost\n * function can take multiple arguments as it provides the signature for the\n * resulting composite function.\n *\n * @param funcs The functions to compose.\n * @returns A function obtained by composing the argument functions from right\n * to left. For example, `compose(f, g, h)` is identical to doing\n * `(...args) => f(g(h(...args)))`.\n */\nexport default function compose(): (a: R) => R;\nexport default function compose(f: F): F;\n\n/* two functions */\nexport default function compose(f1: (a: A) => R, f2: Func): Func;\n\n/* three functions */\nexport default function compose(f1: (b: B) => R, f2: (a: A) => B, f3: Func): Func;\n\n/* four functions */\nexport default function compose(f1: (c: C) => R, f2: (b: B) => C, f3: (a: A) => B, f4: Func): Func;\n\n/* rest */\nexport default function compose(f1: (a: any) => R, ...funcs: Function[]): (...args: any[]) => R;\nexport default function compose(...funcs: Function[]): (...args: any[]) => R;\nexport default function compose(...funcs: Function[]) {\n if (funcs.length === 0) {\n // infer the argument type so it is usable in inference down the line\n return (arg: T) => arg;\n }\n if (funcs.length === 1) {\n return funcs[0];\n }\n return funcs.reduce((a, b) => (...args: any) => a(b(...args)));\n}","import { Action } from '../types/actions';\nimport isPlainObject from './isPlainObject';\nexport default function isAction(action: unknown): action is Action {\n return isPlainObject(action) && 'type' in action && typeof (action as Record<'type', unknown>).type === 'string';\n}","// src/index.ts\nfunction createThunkMiddleware(extraArgument) {\n const middleware = ({ dispatch, getState }) => (next) => (action) => {\n if (typeof action === \"function\") {\n return action(dispatch, getState, extraArgument);\n }\n return next(action);\n };\n return middleware;\n}\nvar thunk = createThunkMiddleware();\nvar withExtraArgument = createThunkMiddleware;\nexport {\n thunk,\n withExtraArgument\n};\n","import { current, isDraft } from 'immer';\nimport { createSelectorCreator, weakMapMemoize } from 'reselect';\nexport const createDraftSafeSelectorCreator: typeof createSelectorCreator = (...args: unknown[]) => {\n const createSelector = (createSelectorCreator as any)(...args);\n const createDraftSafeSelector = Object.assign((...args: unknown[]) => {\n const selector = createSelector(...args);\n const wrappedSelector = (value: unknown, ...rest: unknown[]) => selector(isDraft(value) ? current(value) : value, ...rest);\n Object.assign(wrappedSelector, selector);\n return wrappedSelector as any;\n }, {\n withTypes: () => createDraftSafeSelector\n });\n return createDraftSafeSelector;\n};\n\n/**\n * \"Draft-Safe\" version of `reselect`'s `createSelector`:\n * If an `immer`-drafted object is passed into the resulting selector's first argument,\n * the selector will act on the current draft value, instead of returning a cached value\n * that might be possibly outdated if the draft has been modified since.\n * @public\n */\nexport const createDraftSafeSelector = /* @__PURE__ */\ncreateDraftSafeSelectorCreator(weakMapMemoize);","import type { Action, ActionCreator, StoreEnhancer } from 'redux';\nimport { compose } from 'redux';\n\n/**\n * @public\n */\nexport interface DevToolsEnhancerOptions {\n /**\n * the instance name to be showed on the monitor page. Default value is `document.title`.\n * If not specified and there's no document title, it will consist of `tabId` and `instanceId`.\n */\n name?: string;\n /**\n * action creators functions to be available in the Dispatcher.\n */\n actionCreators?: ActionCreator[] | {\n [key: string]: ActionCreator;\n };\n /**\n * if more than one action is dispatched in the indicated interval, all new actions will be collected and sent at once.\n * It is the joint between performance and speed. When set to `0`, all actions will be sent instantly.\n * Set it to a higher value when experiencing perf issues (also `maxAge` to a lower value).\n *\n * @default 500 ms.\n */\n latency?: number;\n /**\n * (> 1) - maximum allowed actions to be stored in the history tree. The oldest actions are removed once maxAge is reached. It's critical for performance.\n *\n * @default 50\n */\n maxAge?: number;\n /**\n * Customizes how actions and state are serialized and deserialized. Can be a boolean or object. If given a boolean, the behavior is the same as if you\n * were to pass an object and specify `options` as a boolean. Giving an object allows fine-grained customization using the `replacer` and `reviver`\n * functions.\n */\n serialize?: boolean | {\n /**\n * - `undefined` - will use regular `JSON.stringify` to send data (it's the fast mode).\n * - `false` - will handle also circular references.\n * - `true` - will handle also date, regex, undefined, error objects, symbols, maps, sets and functions.\n * - object, which contains `date`, `regex`, `undefined`, `error`, `symbol`, `map`, `set` and `function` keys.\n * For each of them you can indicate if to include (by setting as `true`).\n * For `function` key you can also specify a custom function which handles serialization.\n * See [`jsan`](https://github.com/kolodny/jsan) for more details.\n */\n options?: undefined | boolean | {\n date?: true;\n regex?: true;\n undefined?: true;\n error?: true;\n symbol?: true;\n map?: true;\n set?: true;\n function?: true | ((fn: (...args: any[]) => any) => string);\n };\n /**\n * [JSON replacer function](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify#The_replacer_parameter) used for both actions and states stringify.\n * In addition, you can specify a data type by adding a [`__serializedType__`](https://github.com/zalmoxisus/remotedev-serialize/blob/master/helpers/index.js#L4)\n * key. So you can deserialize it back while importing or persisting data.\n * Moreover, it will also [show a nice preview showing the provided custom type](https://cloud.githubusercontent.com/assets/7957859/21814330/a17d556a-d761-11e6-85ef-159dd12f36c5.png):\n */\n replacer?: (key: string, value: unknown) => any;\n /**\n * [JSON `reviver` function](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse#Using_the_reviver_parameter)\n * used for parsing the imported actions and states. See [`remotedev-serialize`](https://github.com/zalmoxisus/remotedev-serialize/blob/master/immutable/serialize.js#L8-L41)\n * as an example on how to serialize special data types and get them back.\n */\n reviver?: (key: string, value: unknown) => any;\n /**\n * Automatically serialize/deserialize immutablejs via [remotedev-serialize](https://github.com/zalmoxisus/remotedev-serialize).\n * Just pass the Immutable library. It will support all ImmutableJS structures. You can even export them into a file and get them back.\n * The only exception is `Record` class, for which you should pass this in addition the references to your classes in `refs`.\n */\n immutable?: any;\n /**\n * ImmutableJS `Record` classes used to make possible restore its instances back when importing, persisting...\n */\n refs?: any;\n };\n /**\n * function which takes `action` object and id number as arguments, and should return `action` object back.\n */\n actionSanitizer?: (action: A, id: number) => A;\n /**\n * function which takes `state` object and index as arguments, and should return `state` object back.\n */\n stateSanitizer?: (state: S, index: number) => S;\n /**\n * *string or array of strings as regex* - actions types to be hidden / shown in the monitors (while passed to the reducers).\n * If `actionsAllowlist` specified, `actionsDenylist` is ignored.\n */\n actionsDenylist?: string | string[];\n /**\n * *string or array of strings as regex* - actions types to be hidden / shown in the monitors (while passed to the reducers).\n * If `actionsAllowlist` specified, `actionsDenylist` is ignored.\n */\n actionsAllowlist?: string | string[];\n /**\n * called for every action before sending, takes `state` and `action` object, and returns `true` in case it allows sending the current data to the monitor.\n * Use it as a more advanced version of `actionsDenylist`/`actionsAllowlist` parameters.\n */\n predicate?: (state: S, action: A) => boolean;\n /**\n * if specified as `false`, it will not record the changes till clicking on `Start recording` button.\n * Available only for Redux enhancer, for others use `autoPause`.\n *\n * @default true\n */\n shouldRecordChanges?: boolean;\n /**\n * if specified, whenever clicking on `Pause recording` button and there are actions in the history log, will add this action type.\n * If not specified, will commit when paused. Available only for Redux enhancer.\n *\n * @default \"@@PAUSED\"\"\n */\n pauseActionType?: string;\n /**\n * auto pauses when the extension’s window is not opened, and so has zero impact on your app when not in use.\n * Not available for Redux enhancer (as it already does it but storing the data to be sent).\n *\n * @default false\n */\n autoPause?: boolean;\n /**\n * if specified as `true`, it will not allow any non-monitor actions to be dispatched till clicking on `Unlock changes` button.\n * Available only for Redux enhancer.\n *\n * @default false\n */\n shouldStartLocked?: boolean;\n /**\n * if set to `false`, will not recompute the states on hot reloading (or on replacing the reducers). Available only for Redux enhancer.\n *\n * @default true\n */\n shouldHotReload?: boolean;\n /**\n * if specified as `true`, whenever there's an exception in reducers, the monitors will show the error message, and next actions will not be dispatched.\n *\n * @default false\n */\n shouldCatchErrors?: boolean;\n /**\n * If you want to restrict the extension, specify the features you allow.\n * If not specified, all of the features are enabled. When set as an object, only those included as `true` will be allowed.\n * Note that except `true`/`false`, `import` and `export` can be set as `custom` (which is by default for Redux enhancer), meaning that the importing/exporting occurs on the client side.\n * Otherwise, you'll get/set the data right from the monitor part.\n */\n features?: {\n /**\n * start/pause recording of dispatched actions\n */\n pause?: boolean;\n /**\n * lock/unlock dispatching actions and side effects\n */\n lock?: boolean;\n /**\n * persist states on page reloading\n */\n persist?: boolean;\n /**\n * export history of actions in a file\n */\n export?: boolean | 'custom';\n /**\n * import history of actions from a file\n */\n import?: boolean | 'custom';\n /**\n * jump back and forth (time travelling)\n */\n jump?: boolean;\n /**\n * skip (cancel) actions\n */\n skip?: boolean;\n /**\n * drag and drop actions in the history list\n */\n reorder?: boolean;\n /**\n * dispatch custom actions or action creators\n */\n dispatch?: boolean;\n /**\n * generate tests for the selected actions\n */\n test?: boolean;\n };\n /**\n * Set to true or a stacktrace-returning function to record call stack traces for dispatched actions.\n * Defaults to false.\n */\n trace?: boolean | ((action: A) => string);\n /**\n * The maximum number of stack trace entries to record per action. Defaults to 10.\n */\n traceLimit?: number;\n}\ntype Compose = typeof compose;\ninterface ComposeWithDevTools {\n (options: DevToolsEnhancerOptions): Compose;\n (...funcs: StoreEnhancer[]): StoreEnhancer;\n}\n\n/**\n * @public\n */\nexport const composeWithDevTools: ComposeWithDevTools = typeof window !== 'undefined' && (window as any).__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ ? (window as any).__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ : function () {\n if (arguments.length === 0) return undefined;\n if (typeof arguments[0] === 'object') return compose;\n return compose.apply(null, arguments as any as Function[]);\n};\n\n/**\n * @public\n */\nexport const devToolsEnhancer: {\n (options: DevToolsEnhancerOptions): StoreEnhancer;\n} = typeof window !== 'undefined' && (window as any).__REDUX_DEVTOOLS_EXTENSION__ ? (window as any).__REDUX_DEVTOOLS_EXTENSION__ : function () {\n return function (noop) {\n return noop;\n };\n};","import { formatProdErrorMessage as _formatProdErrorMessage } from \"@reduxjs/toolkit\";\nimport { isAction } from 'redux';\nimport type { IsUnknownOrNonInferrable, IfMaybeUndefined, IfVoid, IsAny } from './tsHelpers';\nimport { hasMatchFunction } from './tsHelpers';\n\n/**\n * An action with a string type and an associated payload. This is the\n * type of action returned by `createAction()` action creators.\n *\n * @template P The type of the action's payload.\n * @template T the type used for the action type.\n * @template M The type of the action's meta (optional)\n * @template E The type of the action's error (optional)\n *\n * @public\n */\nexport type PayloadAction

    = {\n payload: P;\n type: T;\n} & ([M] extends [never] ? {} : {\n meta: M;\n}) & ([E] extends [never] ? {} : {\n error: E;\n});\n\n/**\n * A \"prepare\" method to be used as the second parameter of `createAction`.\n * Takes any number of arguments and returns a Flux Standard Action without\n * type (will be added later) that *must* contain a payload (might be undefined).\n *\n * @public\n */\nexport type PrepareAction

    = ((...args: any[]) => {\n payload: P;\n}) | ((...args: any[]) => {\n payload: P;\n meta: any;\n}) | ((...args: any[]) => {\n payload: P;\n error: any;\n}) | ((...args: any[]) => {\n payload: P;\n meta: any;\n error: any;\n});\n\n/**\n * Internal version of `ActionCreatorWithPreparedPayload`. Not to be used externally.\n *\n * @internal\n */\nexport type _ActionCreatorWithPreparedPayload | void, T extends string = string> = PA extends PrepareAction ? ActionCreatorWithPreparedPayload, P, T, ReturnType extends {\n error: infer E;\n} ? E : never, ReturnType extends {\n meta: infer M;\n} ? M : never> : void;\n\n/**\n * Basic type for all action creators.\n *\n * @inheritdoc {redux#ActionCreator}\n */\nexport type BaseActionCreator = {\n type: T;\n match: (action: unknown) => action is PayloadAction;\n};\n\n/**\n * An action creator that takes multiple arguments that are passed\n * to a `PrepareAction` method to create the final Action.\n * @typeParam Args arguments for the action creator function\n * @typeParam P `payload` type\n * @typeParam T `type` name\n * @typeParam E optional `error` type\n * @typeParam M optional `meta` type\n *\n * @inheritdoc {redux#ActionCreator}\n *\n * @public\n */\nexport interface ActionCreatorWithPreparedPayload extends BaseActionCreator {\n /**\n * Calling this {@link redux#ActionCreator} with `Args` will return\n * an Action with a payload of type `P` and (depending on the `PrepareAction`\n * method used) a `meta`- and `error` property of types `M` and `E` respectively.\n */\n (...args: Args): PayloadAction;\n}\n\n/**\n * An action creator of type `T` that takes an optional payload of type `P`.\n *\n * @inheritdoc {redux#ActionCreator}\n *\n * @public\n */\nexport interface ActionCreatorWithOptionalPayload extends BaseActionCreator {\n /**\n * Calling this {@link redux#ActionCreator} with an argument will\n * return a {@link PayloadAction} of type `T` with a payload of `P`.\n * Calling it without an argument will return a PayloadAction with a payload of `undefined`.\n */\n (payload?: P): PayloadAction;\n}\n\n/**\n * An action creator of type `T` that takes no payload.\n *\n * @inheritdoc {redux#ActionCreator}\n *\n * @public\n */\nexport interface ActionCreatorWithoutPayload extends BaseActionCreator {\n /**\n * Calling this {@link redux#ActionCreator} will\n * return a {@link PayloadAction} of type `T` with a payload of `undefined`\n */\n (noArgument: void): PayloadAction;\n}\n\n/**\n * An action creator of type `T` that requires a payload of type P.\n *\n * @inheritdoc {redux#ActionCreator}\n *\n * @public\n */\nexport interface ActionCreatorWithPayload extends BaseActionCreator {\n /**\n * Calling this {@link redux#ActionCreator} with an argument will\n * return a {@link PayloadAction} of type `T` with a payload of `P`\n */\n (payload: P): PayloadAction;\n}\n\n/**\n * An action creator of type `T` whose `payload` type could not be inferred. Accepts everything as `payload`.\n *\n * @inheritdoc {redux#ActionCreator}\n *\n * @public\n */\nexport interface ActionCreatorWithNonInferrablePayload extends BaseActionCreator {\n /**\n * Calling this {@link redux#ActionCreator} with an argument will\n * return a {@link PayloadAction} of type `T` with a payload\n * of exactly the type of the argument.\n */\n (payload: PT): PayloadAction;\n}\n\n/**\n * An action creator that produces actions with a `payload` attribute.\n *\n * @typeParam P the `payload` type\n * @typeParam T the `type` of the resulting action\n * @typeParam PA if the resulting action is preprocessed by a `prepare` method, the signature of said method.\n *\n * @public\n */\nexport type PayloadActionCreator

    | void = void> = IfPrepareActionMethodProvided,\n// else\nIsAny, IsUnknownOrNonInferrable,\n// else\nIfVoid,\n// else\nIfMaybeUndefined,\n// else\nActionCreatorWithPayload>>>>>;\n\n/**\n * A utility function to create an action creator for the given action type\n * string. The action creator accepts a single argument, which will be included\n * in the action object as a field called payload. The action creator function\n * will also have its toString() overridden so that it returns the action type.\n *\n * @param type The action type to use for created actions.\n * @param prepare (optional) a method that takes any number of arguments and returns { payload } or { payload, meta }.\n * If this is given, the resulting action creator will pass its arguments to this method to calculate payload & meta.\n *\n * @public\n */\nexport function createAction

    (type: T): PayloadActionCreator;\n\n/**\n * A utility function to create an action creator for the given action type\n * string. The action creator accepts a single argument, which will be included\n * in the action object as a field called payload. The action creator function\n * will also have its toString() overridden so that it returns the action type.\n *\n * @param type The action type to use for created actions.\n * @param prepare (optional) a method that takes any number of arguments and returns { payload } or { payload, meta }.\n * If this is given, the resulting action creator will pass its arguments to this method to calculate payload & meta.\n *\n * @public\n */\nexport function createAction, T extends string = string>(type: T, prepareAction: PA): PayloadActionCreator['payload'], T, PA>;\nexport function createAction(type: string, prepareAction?: Function): any {\n function actionCreator(...args: any[]) {\n if (prepareAction) {\n let prepared = prepareAction(...args);\n if (!prepared) {\n throw new Error(process.env.NODE_ENV === \"production\" ? _formatProdErrorMessage(0) : 'prepareAction did not return an object');\n }\n return {\n type,\n payload: prepared.payload,\n ...('meta' in prepared && {\n meta: prepared.meta\n }),\n ...('error' in prepared && {\n error: prepared.error\n })\n };\n }\n return {\n type,\n payload: args[0]\n };\n }\n actionCreator.toString = () => `${type}`;\n actionCreator.type = type;\n actionCreator.match = (action: unknown): action is PayloadAction => isAction(action) && action.type === type;\n return actionCreator;\n}\n\n/**\n * Returns true if value is an RTK-like action creator, with a static type property and match method.\n */\nexport function isActionCreator(action: unknown): action is BaseActionCreator & Function {\n return typeof action === 'function' && 'type' in action &&\n // hasMatchFunction only wants Matchers but I don't see the point in rewriting it\n hasMatchFunction(action as any);\n}\n\n/**\n * Returns true if value is an action with a string type and valid Flux Standard Action keys.\n */\nexport function isFSA(action: unknown): action is {\n type: string;\n payload?: unknown;\n error?: unknown;\n meta?: unknown;\n} {\n return isAction(action) && Object.keys(action).every(isValidKey);\n}\nfunction isValidKey(key: string) {\n return ['type', 'payload', 'error', 'meta'].indexOf(key) > -1;\n}\n\n// helper types for more readable typings\n\ntype IfPrepareActionMethodProvided | void, True, False> = PA extends (...args: any[]) => any ? True : False;","import { produce as createNextState, isDraftable } from 'immer';\nexport function getTimeMeasureUtils(maxDelay: number, fnName: string) {\n let elapsed = 0;\n return {\n measureTime(fn: () => T): T {\n const started = Date.now();\n try {\n return fn();\n } finally {\n const finished = Date.now();\n elapsed += finished - started;\n }\n },\n warnIfExceeded() {\n if (elapsed > maxDelay) {\n console.warn(`${fnName} took ${elapsed}ms, which is more than the warning threshold of ${maxDelay}ms. \nIf your state or actions are very large, you may want to disable the middleware as it might cause too much of a slowdown in development mode. See https://redux-toolkit.js.org/api/getDefaultMiddleware for instructions.\nIt is disabled in production builds, so you don't need to worry about that.`);\n }\n }\n };\n}\nexport function delay(ms: number) {\n return new Promise(resolve => setTimeout(resolve, ms));\n}\nexport class Tuple = []> extends Array {\n constructor(length: number);\n constructor(...items: Items);\n constructor(...items: any[]) {\n super(...items);\n Object.setPrototypeOf(this, Tuple.prototype);\n }\n static override get [Symbol.species]() {\n return Tuple as any;\n }\n override concat>(items: Tuple): Tuple<[...Items, ...AdditionalItems]>;\n override concat>(items: AdditionalItems): Tuple<[...Items, ...AdditionalItems]>;\n override concat>(...items: AdditionalItems): Tuple<[...Items, ...AdditionalItems]>;\n override concat(...arr: any[]) {\n return super.concat.apply(this, arr);\n }\n prepend>(items: Tuple): Tuple<[...AdditionalItems, ...Items]>;\n prepend>(items: AdditionalItems): Tuple<[...AdditionalItems, ...Items]>;\n prepend>(...items: AdditionalItems): Tuple<[...AdditionalItems, ...Items]>;\n prepend(...arr: any[]) {\n if (arr.length === 1 && Array.isArray(arr[0])) {\n return new Tuple(...arr[0].concat(this));\n }\n return new Tuple(...arr.concat(this));\n }\n}\nexport function freezeDraftable(val: T) {\n return isDraftable(val) ? createNextState(val, () => {}) : val;\n}\nexport function getOrInsert(map: WeakMap, key: K, value: V): V;\nexport function getOrInsert(map: Map, key: K, value: V): V;\nexport function getOrInsert(map: Map | WeakMap, key: K, value: V): V {\n if (map.has(key)) return map.get(key) as V;\n return map.set(key, value).get(key) as V;\n}\nexport function getOrInsertComputed(map: WeakMap, key: K, compute: (key: K) => V): V;\nexport function getOrInsertComputed(map: Map, key: K, compute: (key: K) => V): V;\nexport function getOrInsertComputed(map: Map | WeakMap, key: K, compute: (key: K) => V): V {\n if (map.has(key)) return map.get(key) as V;\n return map.set(key, compute(key)).get(key) as V;\n}","import type { Middleware, UnknownAction } from 'redux';\nimport type { ThunkMiddleware } from 'redux-thunk';\nimport { thunk as thunkMiddleware, withExtraArgument } from 'redux-thunk';\nimport type { ActionCreatorInvariantMiddlewareOptions } from './actionCreatorInvariantMiddleware';\nimport { createActionCreatorInvariantMiddleware } from './actionCreatorInvariantMiddleware';\nimport type { ImmutableStateInvariantMiddlewareOptions } from './immutableStateInvariantMiddleware';\n/* PROD_START_REMOVE_UMD */\nimport { createImmutableStateInvariantMiddleware } from './immutableStateInvariantMiddleware';\n/* PROD_STOP_REMOVE_UMD */\n\nimport type { SerializableStateInvariantMiddlewareOptions } from './serializableStateInvariantMiddleware';\nimport { createSerializableStateInvariantMiddleware } from './serializableStateInvariantMiddleware';\nimport type { ExcludeFromTuple } from './tsHelpers';\nimport { Tuple } from './utils';\nfunction isBoolean(x: any): x is boolean {\n return typeof x === 'boolean';\n}\ninterface ThunkOptions {\n extraArgument: E;\n}\ninterface GetDefaultMiddlewareOptions {\n thunk?: boolean | ThunkOptions;\n immutableCheck?: boolean | ImmutableStateInvariantMiddlewareOptions;\n serializableCheck?: boolean | SerializableStateInvariantMiddlewareOptions;\n actionCreatorCheck?: boolean | ActionCreatorInvariantMiddlewareOptions;\n}\nexport type ThunkMiddlewareFor = O extends {\n thunk: false;\n} ? never : O extends {\n thunk: {\n extraArgument: infer E;\n };\n} ? ThunkMiddleware : ThunkMiddleware;\nexport type GetDefaultMiddleware = (options?: O) => Tuple], never>>;\nexport const buildGetDefaultMiddleware = (): GetDefaultMiddleware => function getDefaultMiddleware(options) {\n const {\n thunk = true,\n immutableCheck = true,\n serializableCheck = true,\n actionCreatorCheck = true\n } = options ?? {};\n let middlewareArray = new Tuple();\n if (thunk) {\n if (isBoolean(thunk)) {\n middlewareArray.push(thunkMiddleware);\n } else {\n middlewareArray.push(withExtraArgument(thunk.extraArgument));\n }\n }\n if (process.env.NODE_ENV !== 'production') {\n if (immutableCheck) {\n /* PROD_START_REMOVE_UMD */\n let immutableOptions: ImmutableStateInvariantMiddlewareOptions = {};\n if (!isBoolean(immutableCheck)) {\n immutableOptions = immutableCheck;\n }\n middlewareArray.unshift(createImmutableStateInvariantMiddleware(immutableOptions));\n /* PROD_STOP_REMOVE_UMD */\n }\n if (serializableCheck) {\n let serializableOptions: SerializableStateInvariantMiddlewareOptions = {};\n if (!isBoolean(serializableCheck)) {\n serializableOptions = serializableCheck;\n }\n middlewareArray.push(createSerializableStateInvariantMiddleware(serializableOptions));\n }\n if (actionCreatorCheck) {\n let actionCreatorOptions: ActionCreatorInvariantMiddlewareOptions = {};\n if (!isBoolean(actionCreatorCheck)) {\n actionCreatorOptions = actionCreatorCheck;\n }\n middlewareArray.unshift(createActionCreatorInvariantMiddleware(actionCreatorOptions));\n }\n }\n return middlewareArray as any;\n};","import type { StoreEnhancer } from 'redux';\nexport const SHOULD_AUTOBATCH = 'RTK_autoBatch';\nexport const prepareAutoBatched = () => (payload: T): {\n payload: T;\n meta: unknown;\n} => ({\n payload,\n meta: {\n [SHOULD_AUTOBATCH]: true\n }\n});\nconst createQueueWithTimer = (timeout: number) => {\n return (notify: () => void) => {\n setTimeout(notify, timeout);\n };\n};\nexport type AutoBatchOptions = {\n type: 'tick';\n} | {\n type: 'timer';\n timeout: number;\n} | {\n type: 'raf';\n} | {\n type: 'callback';\n queueNotification: (notify: () => void) => void;\n};\n\n/**\n * A Redux store enhancer that watches for \"low-priority\" actions, and delays\n * notifying subscribers until either the queued callback executes or the\n * next \"standard-priority\" action is dispatched.\n *\n * This allows dispatching multiple \"low-priority\" actions in a row with only\n * a single subscriber notification to the UI after the sequence of actions\n * is finished, thus improving UI re-render performance.\n *\n * Watches for actions with the `action.meta[SHOULD_AUTOBATCH]` attribute.\n * This can be added to `action.meta` manually, or by using the\n * `prepareAutoBatched` helper.\n *\n * By default, it will queue a notification for the end of the event loop tick.\n * However, you can pass several other options to configure the behavior:\n * - `{type: 'tick'}`: queues using `queueMicrotask`\n * - `{type: 'timer', timeout: number}`: queues using `setTimeout`\n * - `{type: 'raf'}`: queues using `requestAnimationFrame` (default)\n * - `{type: 'callback', queueNotification: (notify: () => void) => void}`: lets you provide your own callback\n *\n *\n */\nexport const autoBatchEnhancer = (options: AutoBatchOptions = {\n type: 'raf'\n}): StoreEnhancer => next => (...args) => {\n const store = next(...args);\n let notifying = true;\n let shouldNotifyAtEndOfTick = false;\n let notificationQueued = false;\n const listeners = new Set<() => void>();\n const queueCallback = options.type === 'tick' ? queueMicrotask : options.type === 'raf' ?\n // requestAnimationFrame won't exist in SSR environments. Fall back to a vague approximation just to keep from erroring.\n typeof window !== 'undefined' && window.requestAnimationFrame ? window.requestAnimationFrame : createQueueWithTimer(10) : options.type === 'callback' ? options.queueNotification : createQueueWithTimer(options.timeout);\n const notifyListeners = () => {\n // We're running at the end of the event loop tick.\n // Run the real listener callbacks to actually update the UI.\n notificationQueued = false;\n if (shouldNotifyAtEndOfTick) {\n shouldNotifyAtEndOfTick = false;\n listeners.forEach(l => l());\n }\n };\n return Object.assign({}, store, {\n // Override the base `store.subscribe` method to keep original listeners\n // from running if we're delaying notifications\n subscribe(listener: () => void) {\n // Each wrapped listener will only call the real listener if\n // the `notifying` flag is currently active when it's called.\n // This lets the base store work as normal, while the actual UI\n // update becomes controlled by this enhancer.\n const wrappedListener: typeof listener = () => notifying && listener();\n const unsubscribe = store.subscribe(wrappedListener);\n listeners.add(listener);\n return () => {\n unsubscribe();\n listeners.delete(listener);\n };\n },\n // Override the base `store.dispatch` method so that we can check actions\n // for the `shouldAutoBatch` flag and determine if batching is active\n dispatch(action: any) {\n try {\n // If the action does _not_ have the `shouldAutoBatch` flag,\n // we resume/continue normal notify-after-each-dispatch behavior\n notifying = !action?.meta?.[SHOULD_AUTOBATCH];\n // If a `notifyListeners` microtask was queued, you can't cancel it.\n // Instead, we set a flag so that it's a no-op when it does run\n shouldNotifyAtEndOfTick = !notifying;\n if (shouldNotifyAtEndOfTick) {\n // We've seen at least 1 action with `SHOULD_AUTOBATCH`. Try to queue\n // a microtask to notify listeners at the end of the event loop tick.\n // Make sure we only enqueue this _once_ per tick.\n if (!notificationQueued) {\n notificationQueued = true;\n queueCallback(notifyListeners);\n }\n }\n // Go ahead and process the action as usual, including reducers.\n // If normal notification behavior is enabled, the store will notify\n // all of its own listeners, and the wrapper callbacks above will\n // see `notifying` is true and pass on to the real listener callbacks.\n // If we're \"batching\" behavior, then the wrapped callbacks will\n // bail out, causing the base store notification behavior to be no-ops.\n return store.dispatch(action);\n } finally {\n // Assume we're back to normal behavior after each action\n notifying = true;\n }\n }\n });\n};","import type { StoreEnhancer } from 'redux';\nimport type { AutoBatchOptions } from './autoBatchEnhancer';\nimport { autoBatchEnhancer } from './autoBatchEnhancer';\nimport { Tuple } from './utils';\nimport type { Middlewares } from './configureStore';\nimport type { ExtractDispatchExtensions } from './tsHelpers';\ntype GetDefaultEnhancersOptions = {\n autoBatch?: boolean | AutoBatchOptions;\n};\nexport type GetDefaultEnhancers> = (options?: GetDefaultEnhancersOptions) => Tuple<[StoreEnhancer<{\n dispatch: ExtractDispatchExtensions;\n}>]>;\nexport const buildGetDefaultEnhancers = ,>(middlewareEnhancer: StoreEnhancer<{\n dispatch: ExtractDispatchExtensions;\n}>): GetDefaultEnhancers => function getDefaultEnhancers(options) {\n const {\n autoBatch = true\n } = options ?? {};\n let enhancerArray = new Tuple(middlewareEnhancer);\n if (autoBatch) {\n enhancerArray.push(autoBatchEnhancer(typeof autoBatch === 'object' ? autoBatch : undefined));\n }\n return enhancerArray as any;\n};","import { formatProdErrorMessage as _formatProdErrorMessage, formatProdErrorMessage as _formatProdErrorMessage2, formatProdErrorMessage as _formatProdErrorMessage3, formatProdErrorMessage as _formatProdErrorMessage4, formatProdErrorMessage as _formatProdErrorMessage5, formatProdErrorMessage as _formatProdErrorMessage6, formatProdErrorMessage as _formatProdErrorMessage7 } from \"@reduxjs/toolkit\";\nimport type { Reducer, ReducersMapObject, Middleware, Action, StoreEnhancer, Store, UnknownAction } from 'redux';\nimport { applyMiddleware, createStore, compose, combineReducers, isPlainObject } from 'redux';\nimport type { DevToolsEnhancerOptions as DevToolsOptions } from './devtoolsExtension';\nimport { composeWithDevTools } from './devtoolsExtension';\nimport type { ThunkMiddlewareFor, GetDefaultMiddleware } from './getDefaultMiddleware';\nimport { buildGetDefaultMiddleware } from './getDefaultMiddleware';\nimport type { ExtractDispatchExtensions, ExtractStoreExtensions, ExtractStateExtensions, UnknownIfNonSpecific } from './tsHelpers';\nimport type { Tuple } from './utils';\nimport type { GetDefaultEnhancers } from './getDefaultEnhancers';\nimport { buildGetDefaultEnhancers } from './getDefaultEnhancers';\n\n/**\n * Options for `configureStore()`.\n *\n * @public\n */\nexport interface ConfigureStoreOptions> = Tuple>, E extends Tuple = Tuple, P = S> {\n /**\n * A single reducer function that will be used as the root reducer, or an\n * object of slice reducers that will be passed to `combineReducers()`.\n */\n reducer: Reducer | ReducersMapObject;\n\n /**\n * An array of Redux middleware to install, or a callback receiving `getDefaultMiddleware` and returning a Tuple of middleware.\n * If not supplied, defaults to the set of middleware returned by `getDefaultMiddleware()`.\n *\n * @example `middleware: (gDM) => gDM().concat(logger, apiMiddleware, yourCustomMiddleware)`\n * @see https://redux-toolkit.js.org/api/getDefaultMiddleware#intended-usage\n */\n middleware?: (getDefaultMiddleware: GetDefaultMiddleware) => M;\n\n /**\n * Whether to enable Redux DevTools integration. Defaults to `true`.\n *\n * Additional configuration can be done by passing Redux DevTools options\n */\n devTools?: boolean | DevToolsOptions;\n\n /**\n * The initial state, same as Redux's createStore.\n * You may optionally specify it to hydrate the state\n * from the server in universal apps, or to restore a previously serialized\n * user session. If you use `combineReducers()` to produce the root reducer\n * function (either directly or indirectly by passing an object as `reducer`),\n * this must be an object with the same shape as the reducer map keys.\n */\n // we infer here, and instead complain if the reducer doesn't match\n preloadedState?: P;\n\n /**\n * The store enhancers to apply. See Redux's `createStore()`.\n * All enhancers will be included before the DevTools Extension enhancer.\n * If you need to customize the order of enhancers, supply a callback\n * function that will receive a `getDefaultEnhancers` function that returns a Tuple,\n * and should return a Tuple of enhancers (such as `getDefaultEnhancers().concat(offline)`).\n * If you only need to add middleware, you can use the `middleware` parameter instead.\n */\n enhancers?: (getDefaultEnhancers: GetDefaultEnhancers) => E;\n}\nexport type Middlewares = ReadonlyArray>;\ntype Enhancers = ReadonlyArray;\n\n/**\n * A Redux store returned by `configureStore()`. Supports dispatching\n * side-effectful _thunks_ in addition to plain actions.\n *\n * @public\n */\nexport type EnhancedStore = ExtractStoreExtensions & Store>>;\n\n/**\n * A friendly abstraction over the standard Redux `createStore()` function.\n *\n * @param options The store configuration.\n * @returns A configured Redux store.\n *\n * @public\n */\nexport function configureStore> = Tuple<[ThunkMiddlewareFor]>, E extends Tuple = Tuple<[StoreEnhancer<{\n dispatch: ExtractDispatchExtensions;\n}>, StoreEnhancer]>, P = S>(options: ConfigureStoreOptions): EnhancedStore {\n const getDefaultMiddleware = buildGetDefaultMiddleware();\n const {\n reducer = undefined,\n middleware,\n devTools = true,\n preloadedState = undefined,\n enhancers = undefined\n } = options || {};\n let rootReducer: Reducer;\n if (typeof reducer === 'function') {\n rootReducer = reducer;\n } else if (isPlainObject(reducer)) {\n rootReducer = combineReducers(reducer) as unknown as Reducer;\n } else {\n throw new Error(process.env.NODE_ENV === \"production\" ? _formatProdErrorMessage(1) : '`reducer` is a required argument, and must be a function or an object of functions that can be passed to combineReducers');\n }\n if (process.env.NODE_ENV !== 'production' && middleware && typeof middleware !== 'function') {\n throw new Error(process.env.NODE_ENV === \"production\" ? _formatProdErrorMessage2(2) : '`middleware` field must be a callback');\n }\n let finalMiddleware: Tuple>;\n if (typeof middleware === 'function') {\n finalMiddleware = middleware(getDefaultMiddleware);\n if (process.env.NODE_ENV !== 'production' && !Array.isArray(finalMiddleware)) {\n throw new Error(process.env.NODE_ENV === \"production\" ? _formatProdErrorMessage3(3) : 'when using a middleware builder function, an array of middleware must be returned');\n }\n } else {\n finalMiddleware = getDefaultMiddleware();\n }\n if (process.env.NODE_ENV !== 'production' && finalMiddleware.some((item: any) => typeof item !== 'function')) {\n throw new Error(process.env.NODE_ENV === \"production\" ? _formatProdErrorMessage4(4) : 'each middleware provided to configureStore must be a function');\n }\n let finalCompose = compose;\n if (devTools) {\n finalCompose = composeWithDevTools({\n // Enable capture of stack traces for dispatched Redux actions\n trace: process.env.NODE_ENV !== 'production',\n ...(typeof devTools === 'object' && devTools)\n });\n }\n const middlewareEnhancer = applyMiddleware(...finalMiddleware);\n const getDefaultEnhancers = buildGetDefaultEnhancers(middlewareEnhancer);\n if (process.env.NODE_ENV !== 'production' && enhancers && typeof enhancers !== 'function') {\n throw new Error(process.env.NODE_ENV === \"production\" ? _formatProdErrorMessage5(5) : '`enhancers` field must be a callback');\n }\n let storeEnhancers = typeof enhancers === 'function' ? enhancers(getDefaultEnhancers) : getDefaultEnhancers();\n if (process.env.NODE_ENV !== 'production' && !Array.isArray(storeEnhancers)) {\n throw new Error(process.env.NODE_ENV === \"production\" ? _formatProdErrorMessage6(6) : '`enhancers` callback must return an array');\n }\n if (process.env.NODE_ENV !== 'production' && storeEnhancers.some((item: any) => typeof item !== 'function')) {\n throw new Error(process.env.NODE_ENV === \"production\" ? _formatProdErrorMessage7(7) : 'each enhancer provided to configureStore must be a function');\n }\n if (process.env.NODE_ENV !== 'production' && finalMiddleware.length && !storeEnhancers.includes(middlewareEnhancer)) {\n console.error('middlewares were provided, but middleware enhancer was not included in final enhancers - make sure to call `getDefaultEnhancers`');\n }\n const composedEnhancer: StoreEnhancer = finalCompose(...storeEnhancers);\n return createStore(rootReducer, preloadedState as P, composedEnhancer);\n}","import { formatProdErrorMessage as _formatProdErrorMessage } from \"src/utils/formatProdErrorMessage\";\nimport compose from './compose';\nimport { Middleware, MiddlewareAPI } from './types/middleware';\nimport { StoreEnhancer, Dispatch } from './types/store';\n\n/**\n * Creates a store enhancer that applies middleware to the dispatch method\n * of the Redux store. This is handy for a variety of tasks, such as expressing\n * asynchronous actions in a concise manner, or logging every action payload.\n *\n * See `redux-thunk` package as an example of the Redux middleware.\n *\n * Because middleware is potentially asynchronous, this should be the first\n * store enhancer in the composition chain.\n *\n * Note that each middleware will be given the `dispatch` and `getState` functions\n * as named arguments.\n *\n * @param middlewares The middleware chain to be applied.\n * @returns A store enhancer applying the middleware.\n *\n * @template Ext Dispatch signature added by a middleware.\n * @template S The type of the state supported by a middleware.\n */\nexport default function applyMiddleware(): StoreEnhancer;\nexport default function applyMiddleware(middleware1: Middleware): StoreEnhancer<{\n dispatch: Ext1;\n}>;\nexport default function applyMiddleware(middleware1: Middleware, middleware2: Middleware): StoreEnhancer<{\n dispatch: Ext1 & Ext2;\n}>;\nexport default function applyMiddleware(middleware1: Middleware, middleware2: Middleware, middleware3: Middleware): StoreEnhancer<{\n dispatch: Ext1 & Ext2 & Ext3;\n}>;\nexport default function applyMiddleware(middleware1: Middleware, middleware2: Middleware, middleware3: Middleware, middleware4: Middleware): StoreEnhancer<{\n dispatch: Ext1 & Ext2 & Ext3 & Ext4;\n}>;\nexport default function applyMiddleware(middleware1: Middleware, middleware2: Middleware, middleware3: Middleware, middleware4: Middleware, middleware5: Middleware): StoreEnhancer<{\n dispatch: Ext1 & Ext2 & Ext3 & Ext4 & Ext5;\n}>;\nexport default function applyMiddleware(...middlewares: Middleware[]): StoreEnhancer<{\n dispatch: Ext;\n}>;\nexport default function applyMiddleware(...middlewares: Middleware[]): StoreEnhancer {\n return createStore => (reducer, preloadedState) => {\n const store = createStore(reducer, preloadedState);\n let dispatch: Dispatch = () => {\n throw new Error(process.env.NODE_ENV === \"production\" ? _formatProdErrorMessage(15) : 'Dispatching while constructing your middleware is not allowed. ' + 'Other middleware would not be applied to this dispatch.');\n };\n const middlewareAPI: MiddlewareAPI = {\n getState: store.getState,\n dispatch: (action, ...args) => dispatch(action, ...args)\n };\n const chain = middlewares.map(middleware => middleware(middlewareAPI));\n dispatch = compose(...chain)(store.dispatch);\n return {\n ...store,\n dispatch\n };\n };\n}","import { formatProdErrorMessage as _formatProdErrorMessage, formatProdErrorMessage as _formatProdErrorMessage2, formatProdErrorMessage as _formatProdErrorMessage3, formatProdErrorMessage as _formatProdErrorMessage4, formatProdErrorMessage as _formatProdErrorMessage5, formatProdErrorMessage as _formatProdErrorMessage6 } from \"@reduxjs/toolkit\";\nimport type { Action } from 'redux';\nimport type { CaseReducer, CaseReducers, ActionMatcherDescriptionCollection } from './createReducer';\nimport type { TypeGuard } from './tsHelpers';\nexport type TypedActionCreator = {\n (...args: any[]): Action;\n type: Type;\n};\n\n/**\n * A builder for an action <-> reducer map.\n *\n * @public\n */\nexport interface ActionReducerMapBuilder {\n /**\n * Adds a case reducer to handle a single exact action type.\n * @remarks\n * All calls to `builder.addCase` must come before any calls to `builder.addMatcher` or `builder.addDefaultCase`.\n * @param actionCreator - Either a plain action type string, or an action creator generated by [`createAction`](./createAction) that can be used to determine the action type.\n * @param reducer - The actual case reducer function.\n */\n addCase>(actionCreator: ActionCreator, reducer: CaseReducer>): ActionReducerMapBuilder;\n /**\n * Adds a case reducer to handle a single exact action type.\n * @remarks\n * All calls to `builder.addCase` must come before any calls to `builder.addMatcher` or `builder.addDefaultCase`.\n * @param actionCreator - Either a plain action type string, or an action creator generated by [`createAction`](./createAction) that can be used to determine the action type.\n * @param reducer - The actual case reducer function.\n */\n addCase>(type: Type, reducer: CaseReducer): ActionReducerMapBuilder;\n\n /**\n * Allows you to match your incoming actions against your own filter function instead of only the `action.type` property.\n * @remarks\n * If multiple matcher reducers match, all of them will be executed in the order\n * they were defined in - even if a case reducer already matched.\n * All calls to `builder.addMatcher` must come after any calls to `builder.addCase` and before any calls to `builder.addDefaultCase`.\n * @param matcher - A matcher function. In TypeScript, this should be a [type predicate](https://www.typescriptlang.org/docs/handbook/2/narrowing.html#using-type-predicates)\n * function\n * @param reducer - The actual case reducer function.\n *\n * @example\n ```ts\n import {\n createAction,\n createReducer,\n AsyncThunk,\n UnknownAction,\n } from \"@reduxjs/toolkit\";\n type GenericAsyncThunk = AsyncThunk;\n type PendingAction = ReturnType;\n type RejectedAction = ReturnType;\n type FulfilledAction = ReturnType;\n const initialState: Record = {};\n const resetAction = createAction(\"reset-tracked-loading-state\");\n function isPendingAction(action: UnknownAction): action is PendingAction {\n return typeof action.type === \"string\" && action.type.endsWith(\"/pending\");\n }\n const reducer = createReducer(initialState, (builder) => {\n builder\n .addCase(resetAction, () => initialState)\n // matcher can be defined outside as a type predicate function\n .addMatcher(isPendingAction, (state, action) => {\n state[action.meta.requestId] = \"pending\";\n })\n .addMatcher(\n // matcher can be defined inline as a type predicate function\n (action): action is RejectedAction => action.type.endsWith(\"/rejected\"),\n (state, action) => {\n state[action.meta.requestId] = \"rejected\";\n }\n )\n // matcher can just return boolean and the matcher can receive a generic argument\n .addMatcher(\n (action) => action.type.endsWith(\"/fulfilled\"),\n (state, action) => {\n state[action.meta.requestId] = \"fulfilled\";\n }\n );\n });\n ```\n */\n addMatcher(matcher: TypeGuard | ((action: any) => boolean), reducer: CaseReducer): Omit, 'addCase'>;\n\n /**\n * Adds a \"default case\" reducer that is executed if no case reducer and no matcher\n * reducer was executed for this action.\n * @param reducer - The fallback \"default case\" reducer function.\n *\n * @example\n ```ts\n import { createReducer } from '@reduxjs/toolkit'\n const initialState = { otherActions: 0 }\n const reducer = createReducer(initialState, builder => {\n builder\n // .addCase(...)\n // .addMatcher(...)\n .addDefaultCase((state, action) => {\n state.otherActions++\n })\n })\n ```\n */\n addDefaultCase(reducer: CaseReducer): {};\n}\nexport function executeReducerBuilderCallback(builderCallback: (builder: ActionReducerMapBuilder) => void): [CaseReducers, ActionMatcherDescriptionCollection, CaseReducer | undefined] {\n const actionsMap: CaseReducers = {};\n const actionMatchers: ActionMatcherDescriptionCollection = [];\n let defaultCaseReducer: CaseReducer | undefined;\n const builder = {\n addCase(typeOrActionCreator: string | TypedActionCreator, reducer: CaseReducer) {\n if (process.env.NODE_ENV !== 'production') {\n /*\n to keep the definition by the user in line with actual behavior,\n we enforce `addCase` to always be called before calling `addMatcher`\n as matching cases take precedence over matchers\n */\n if (actionMatchers.length > 0) {\n throw new Error(process.env.NODE_ENV === \"production\" ? _formatProdErrorMessage(26) : '`builder.addCase` should only be called before calling `builder.addMatcher`');\n }\n if (defaultCaseReducer) {\n throw new Error(process.env.NODE_ENV === \"production\" ? _formatProdErrorMessage2(27) : '`builder.addCase` should only be called before calling `builder.addDefaultCase`');\n }\n }\n const type = typeof typeOrActionCreator === 'string' ? typeOrActionCreator : typeOrActionCreator.type;\n if (!type) {\n throw new Error(process.env.NODE_ENV === \"production\" ? _formatProdErrorMessage3(28) : '`builder.addCase` cannot be called with an empty action type');\n }\n if (type in actionsMap) {\n throw new Error(process.env.NODE_ENV === \"production\" ? _formatProdErrorMessage4(29) : '`builder.addCase` cannot be called with two reducers for the same action type ' + `'${type}'`);\n }\n actionsMap[type] = reducer;\n return builder;\n },\n addMatcher(matcher: TypeGuard, reducer: CaseReducer) {\n if (process.env.NODE_ENV !== 'production') {\n if (defaultCaseReducer) {\n throw new Error(process.env.NODE_ENV === \"production\" ? _formatProdErrorMessage5(30) : '`builder.addMatcher` should only be called before calling `builder.addDefaultCase`');\n }\n }\n actionMatchers.push({\n matcher,\n reducer\n });\n return builder;\n },\n addDefaultCase(reducer: CaseReducer) {\n if (process.env.NODE_ENV !== 'production') {\n if (defaultCaseReducer) {\n throw new Error(process.env.NODE_ENV === \"production\" ? _formatProdErrorMessage6(31) : '`builder.addDefaultCase` can only be called once');\n }\n }\n defaultCaseReducer = reducer;\n return builder;\n }\n };\n builderCallback(builder);\n return [actionsMap, actionMatchers, defaultCaseReducer];\n}","import type { ActionFromMatcher, Matcher, UnionToIntersection } from './tsHelpers';\nimport { hasMatchFunction } from './tsHelpers';\nimport type { AsyncThunk, AsyncThunkFulfilledActionCreator, AsyncThunkPendingActionCreator, AsyncThunkRejectedActionCreator } from './createAsyncThunk';\n\n/** @public */\nexport type ActionMatchingAnyOf[]> = ActionFromMatcher;\n\n/** @public */\nexport type ActionMatchingAllOf[]> = UnionToIntersection>;\nconst matches = (matcher: Matcher, action: any) => {\n if (hasMatchFunction(matcher)) {\n return matcher.match(action);\n } else {\n return matcher(action);\n }\n};\n\n/**\n * A higher-order function that returns a function that may be used to check\n * whether an action matches any one of the supplied type guards or action\n * creators.\n *\n * @param matchers The type guards or action creators to match against.\n *\n * @public\n */\nexport function isAnyOf[]>(...matchers: Matchers) {\n return (action: any): action is ActionMatchingAnyOf => {\n return matchers.some(matcher => matches(matcher, action));\n };\n}\n\n/**\n * A higher-order function that returns a function that may be used to check\n * whether an action matches all of the supplied type guards or action\n * creators.\n *\n * @param matchers The type guards or action creators to match against.\n *\n * @public\n */\nexport function isAllOf[]>(...matchers: Matchers) {\n return (action: any): action is ActionMatchingAllOf => {\n return matchers.every(matcher => matches(matcher, action));\n };\n}\n\n/**\n * @param action A redux action\n * @param validStatus An array of valid meta.requestStatus values\n *\n * @internal\n */\nexport function hasExpectedRequestMetadata(action: any, validStatus: readonly string[]) {\n if (!action || !action.meta) return false;\n const hasValidRequestId = typeof action.meta.requestId === 'string';\n const hasValidRequestStatus = validStatus.indexOf(action.meta.requestStatus) > -1;\n return hasValidRequestId && hasValidRequestStatus;\n}\nfunction isAsyncThunkArray(a: [any] | AnyAsyncThunk[]): a is AnyAsyncThunk[] {\n return typeof a[0] === 'function' && 'pending' in a[0] && 'fulfilled' in a[0] && 'rejected' in a[0];\n}\nexport type UnknownAsyncThunkPendingAction = ReturnType>;\nexport type PendingActionFromAsyncThunk = ActionFromMatcher;\n\n/**\n * A higher-order function that returns a function that may be used to check\n * whether an action was created by an async thunk action creator, and that\n * the action is pending.\n *\n * @public\n */\nexport function isPending(): (action: any) => action is UnknownAsyncThunkPendingAction;\n/**\n * A higher-order function that returns a function that may be used to check\n * whether an action belongs to one of the provided async thunk action creators,\n * and that the action is pending.\n *\n * @param asyncThunks (optional) The async thunk action creators to match against.\n *\n * @public\n */\nexport function isPending(...asyncThunks: AsyncThunks): (action: any) => action is PendingActionFromAsyncThunk;\n/**\n * Tests if `action` is a pending thunk action\n * @public\n */\nexport function isPending(action: any): action is UnknownAsyncThunkPendingAction;\nexport function isPending(...asyncThunks: AsyncThunks | [any]) {\n if (asyncThunks.length === 0) {\n return (action: any) => hasExpectedRequestMetadata(action, ['pending']);\n }\n if (!isAsyncThunkArray(asyncThunks)) {\n return isPending()(asyncThunks[0]);\n }\n return isAnyOf(...asyncThunks.map(asyncThunk => asyncThunk.pending));\n}\nexport type UnknownAsyncThunkRejectedAction = ReturnType>;\nexport type RejectedActionFromAsyncThunk = ActionFromMatcher;\n\n/**\n * A higher-order function that returns a function that may be used to check\n * whether an action was created by an async thunk action creator, and that\n * the action is rejected.\n *\n * @public\n */\nexport function isRejected(): (action: any) => action is UnknownAsyncThunkRejectedAction;\n/**\n * A higher-order function that returns a function that may be used to check\n * whether an action belongs to one of the provided async thunk action creators,\n * and that the action is rejected.\n *\n * @param asyncThunks (optional) The async thunk action creators to match against.\n *\n * @public\n */\nexport function isRejected(...asyncThunks: AsyncThunks): (action: any) => action is RejectedActionFromAsyncThunk;\n/**\n * Tests if `action` is a rejected thunk action\n * @public\n */\nexport function isRejected(action: any): action is UnknownAsyncThunkRejectedAction;\nexport function isRejected(...asyncThunks: AsyncThunks | [any]) {\n if (asyncThunks.length === 0) {\n return (action: any) => hasExpectedRequestMetadata(action, ['rejected']);\n }\n if (!isAsyncThunkArray(asyncThunks)) {\n return isRejected()(asyncThunks[0]);\n }\n return isAnyOf(...asyncThunks.map(asyncThunk => asyncThunk.rejected));\n}\nexport type UnknownAsyncThunkRejectedWithValueAction = ReturnType>;\nexport type RejectedWithValueActionFromAsyncThunk = ActionFromMatcher & (T extends AsyncThunk ? {\n payload: RejectedValue;\n} : unknown);\n\n/**\n * A higher-order function that returns a function that may be used to check\n * whether an action was created by an async thunk action creator, and that\n * the action is rejected with value.\n *\n * @public\n */\nexport function isRejectedWithValue(): (action: any) => action is UnknownAsyncThunkRejectedAction;\n/**\n * A higher-order function that returns a function that may be used to check\n * whether an action belongs to one of the provided async thunk action creators,\n * and that the action is rejected with value.\n *\n * @param asyncThunks (optional) The async thunk action creators to match against.\n *\n * @public\n */\nexport function isRejectedWithValue(...asyncThunks: AsyncThunks): (action: any) => action is RejectedWithValueActionFromAsyncThunk;\n/**\n * Tests if `action` is a rejected thunk action with value\n * @public\n */\nexport function isRejectedWithValue(action: any): action is UnknownAsyncThunkRejectedAction;\nexport function isRejectedWithValue(...asyncThunks: AsyncThunks | [any]) {\n const hasFlag = (action: any): action is any => {\n return action && action.meta && action.meta.rejectedWithValue;\n };\n if (asyncThunks.length === 0) {\n return isAllOf(isRejected(...asyncThunks), hasFlag);\n }\n if (!isAsyncThunkArray(asyncThunks)) {\n return isRejectedWithValue()(asyncThunks[0]);\n }\n return isAllOf(isRejected(...asyncThunks), hasFlag);\n}\nexport type UnknownAsyncThunkFulfilledAction = ReturnType>;\nexport type FulfilledActionFromAsyncThunk = ActionFromMatcher;\n\n/**\n * A higher-order function that returns a function that may be used to check\n * whether an action was created by an async thunk action creator, and that\n * the action is fulfilled.\n *\n * @public\n */\nexport function isFulfilled(): (action: any) => action is UnknownAsyncThunkFulfilledAction;\n/**\n * A higher-order function that returns a function that may be used to check\n * whether an action belongs to one of the provided async thunk action creators,\n * and that the action is fulfilled.\n *\n * @param asyncThunks (optional) The async thunk action creators to match against.\n *\n * @public\n */\nexport function isFulfilled(...asyncThunks: AsyncThunks): (action: any) => action is FulfilledActionFromAsyncThunk;\n/**\n * Tests if `action` is a fulfilled thunk action\n * @public\n */\nexport function isFulfilled(action: any): action is UnknownAsyncThunkFulfilledAction;\nexport function isFulfilled(...asyncThunks: AsyncThunks | [any]) {\n if (asyncThunks.length === 0) {\n return (action: any) => hasExpectedRequestMetadata(action, ['fulfilled']);\n }\n if (!isAsyncThunkArray(asyncThunks)) {\n return isFulfilled()(asyncThunks[0]);\n }\n return isAnyOf(...asyncThunks.map(asyncThunk => asyncThunk.fulfilled));\n}\nexport type UnknownAsyncThunkAction = UnknownAsyncThunkPendingAction | UnknownAsyncThunkRejectedAction | UnknownAsyncThunkFulfilledAction;\nexport type AnyAsyncThunk = {\n pending: {\n match: (action: any) => action is any;\n };\n fulfilled: {\n match: (action: any) => action is any;\n };\n rejected: {\n match: (action: any) => action is any;\n };\n};\nexport type ActionsFromAsyncThunk = ActionFromMatcher | ActionFromMatcher | ActionFromMatcher;\n\n/**\n * A higher-order function that returns a function that may be used to check\n * whether an action was created by an async thunk action creator.\n *\n * @public\n */\nexport function isAsyncThunkAction(): (action: any) => action is UnknownAsyncThunkAction;\n/**\n * A higher-order function that returns a function that may be used to check\n * whether an action belongs to one of the provided async thunk action creators.\n *\n * @param asyncThunks (optional) The async thunk action creators to match against.\n *\n * @public\n */\nexport function isAsyncThunkAction(...asyncThunks: AsyncThunks): (action: any) => action is ActionsFromAsyncThunk;\n/**\n * Tests if `action` is a thunk action\n * @public\n */\nexport function isAsyncThunkAction(action: any): action is UnknownAsyncThunkAction;\nexport function isAsyncThunkAction(...asyncThunks: AsyncThunks | [any]) {\n if (asyncThunks.length === 0) {\n return (action: any) => hasExpectedRequestMetadata(action, ['pending', 'fulfilled', 'rejected']);\n }\n if (!isAsyncThunkArray(asyncThunks)) {\n return isAsyncThunkAction()(asyncThunks[0]);\n }\n return isAnyOf(...asyncThunks.flatMap(asyncThunk => [asyncThunk.pending, asyncThunk.rejected, asyncThunk.fulfilled]));\n}","// Borrowed from https://github.com/ai/nanoid/blob/3.0.2/non-secure/index.js\n// This alphabet uses `A-Za-z0-9_-` symbols. A genetic algorithm helped\n// optimize the gzip compression for this alphabet.\nlet urlAlphabet = 'ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW';\n\n/**\r\n *\r\n * @public\r\n */\nexport let nanoid = (size = 21) => {\n let id = '';\n // A compact alternative for `for (var i = 0; i < step; i++)`.\n let i = size;\n while (i--) {\n // `| 0` is more compact and faster than `Math.floor()`.\n id += urlAlphabet[Math.random() * 64 | 0];\n }\n return id;\n};","import type { Dispatch, UnknownAction } from 'redux';\nimport type { ThunkDispatch } from 'redux-thunk';\nimport type { ActionCreatorWithPreparedPayload } from './createAction';\nimport { createAction } from './createAction';\nimport { isAnyOf } from './matchers';\nimport { nanoid } from './nanoid';\nimport type { FallbackIfUnknown, Id, IsAny, IsUnknown, SafePromise } from './tsHelpers';\nexport type BaseThunkAPI = {\n dispatch: D;\n getState: () => S;\n extra: E;\n requestId: string;\n signal: AbortSignal;\n abort: (reason?: string) => void;\n rejectWithValue: IsUnknown RejectWithValue, (value: RejectedValue, meta: RejectedMeta) => RejectWithValue>;\n fulfillWithValue: IsUnknown(value: FulfilledValue) => FulfilledValue, (value: FulfilledValue, meta: FulfilledMeta) => FulfillWithMeta>;\n};\n\n/**\n * @public\n */\nexport interface SerializedError {\n name?: string;\n message?: string;\n stack?: string;\n code?: string;\n}\nconst commonProperties: Array = ['name', 'message', 'stack', 'code'];\nclass RejectWithValue {\n /*\n type-only property to distinguish between RejectWithValue and FulfillWithMeta\n does not exist at runtime\n */\n private readonly _type!: 'RejectWithValue';\n constructor(public readonly payload: Payload, public readonly meta: RejectedMeta) {}\n}\nclass FulfillWithMeta {\n /*\n type-only property to distinguish between RejectWithValue and FulfillWithMeta\n does not exist at runtime\n */\n private readonly _type!: 'FulfillWithMeta';\n constructor(public readonly payload: Payload, public readonly meta: FulfilledMeta) {}\n}\n\n/**\n * Serializes an error into a plain object.\n * Reworked from https://github.com/sindresorhus/serialize-error\n *\n * @public\n */\nexport const miniSerializeError = (value: any): SerializedError => {\n if (typeof value === 'object' && value !== null) {\n const simpleError: SerializedError = {};\n for (const property of commonProperties) {\n if (typeof value[property] === 'string') {\n simpleError[property] = value[property];\n }\n }\n return simpleError;\n }\n return {\n message: String(value)\n };\n};\nexport type AsyncThunkConfig = {\n state?: unknown;\n dispatch?: ThunkDispatch;\n extra?: unknown;\n rejectValue?: unknown;\n serializedErrorType?: unknown;\n pendingMeta?: unknown;\n fulfilledMeta?: unknown;\n rejectedMeta?: unknown;\n};\nexport type GetState = ThunkApiConfig extends {\n state: infer State;\n} ? State : unknown;\ntype GetExtra = ThunkApiConfig extends {\n extra: infer Extra;\n} ? Extra : unknown;\ntype GetDispatch = ThunkApiConfig extends {\n dispatch: infer Dispatch;\n} ? FallbackIfUnknown, GetExtra, UnknownAction>> : ThunkDispatch, GetExtra, UnknownAction>;\nexport type GetThunkAPI = BaseThunkAPI, GetExtra, GetDispatch, GetRejectValue, GetRejectedMeta, GetFulfilledMeta>;\ntype GetRejectValue = ThunkApiConfig extends {\n rejectValue: infer RejectValue;\n} ? RejectValue : unknown;\ntype GetPendingMeta = ThunkApiConfig extends {\n pendingMeta: infer PendingMeta;\n} ? PendingMeta : unknown;\ntype GetFulfilledMeta = ThunkApiConfig extends {\n fulfilledMeta: infer FulfilledMeta;\n} ? FulfilledMeta : unknown;\ntype GetRejectedMeta = ThunkApiConfig extends {\n rejectedMeta: infer RejectedMeta;\n} ? RejectedMeta : unknown;\ntype GetSerializedErrorType = ThunkApiConfig extends {\n serializedErrorType: infer GetSerializedErrorType;\n} ? GetSerializedErrorType : SerializedError;\ntype MaybePromise = T | Promise | (T extends any ? Promise : never);\n\n/**\n * A type describing the return value of the `payloadCreator` argument to `createAsyncThunk`.\n * Might be useful for wrapping `createAsyncThunk` in custom abstractions.\n *\n * @public\n */\nexport type AsyncThunkPayloadCreatorReturnValue = MaybePromise, Returned, FulfillWithMeta>> | RejectWithValue, GetRejectedMeta>>;\n/**\n * A type describing the `payloadCreator` argument to `createAsyncThunk`.\n * Might be useful for wrapping `createAsyncThunk` in custom abstractions.\n *\n * @public\n */\nexport type AsyncThunkPayloadCreator = (arg: ThunkArg, thunkAPI: GetThunkAPI) => AsyncThunkPayloadCreatorReturnValue;\n\n/**\n * A ThunkAction created by `createAsyncThunk`.\n * Dispatching it returns a Promise for either a\n * fulfilled or rejected action.\n * Also, the returned value contains an `abort()` method\n * that allows the asyncAction to be cancelled from the outside.\n *\n * @public\n */\nexport type AsyncThunkAction = (dispatch: NonNullable>, getState: () => GetState, extra: GetExtra) => SafePromise> | ReturnType>> & {\n abort: (reason?: string) => void;\n requestId: string;\n arg: ThunkArg;\n unwrap: () => Promise;\n};\ntype AsyncThunkActionCreator = IsAny AsyncThunkAction,\n// unknown handling\nunknown extends ThunkArg ? (arg: ThunkArg) => AsyncThunkAction // argument not specified or specified as void or undefined\n: [ThunkArg] extends [void] | [undefined] ? () => AsyncThunkAction // argument contains void\n: [void] extends [ThunkArg] // make optional\n? (arg?: ThunkArg) => AsyncThunkAction // argument contains undefined\n: [undefined] extends [ThunkArg] ? WithStrictNullChecks<\n// with strict nullChecks: make optional\n(arg?: ThunkArg) => AsyncThunkAction,\n// without strict null checks this will match everything, so don't make it optional\n(arg: ThunkArg) => AsyncThunkAction> // default case: normal argument\n: (arg: ThunkArg) => AsyncThunkAction>;\n\n/**\n * Options object for `createAsyncThunk`.\n *\n * @public\n */\nexport type AsyncThunkOptions = {\n /**\n * A method to control whether the asyncThunk should be executed. Has access to the\n * `arg`, `api.getState()` and `api.extra` arguments.\n *\n * @returns `false` if it should be skipped\n */\n condition?(arg: ThunkArg, api: Pick, 'getState' | 'extra'>): MaybePromise;\n /**\n * If `condition` returns `false`, the asyncThunk will be skipped.\n * This option allows you to control whether a `rejected` action with `meta.condition == false`\n * will be dispatched or not.\n *\n * @default `false`\n */\n dispatchConditionRejection?: boolean;\n serializeError?: (x: unknown) => GetSerializedErrorType;\n\n /**\n * A function to use when generating the `requestId` for the request sequence.\n *\n * @default `nanoid`\n */\n idGenerator?: (arg: ThunkArg) => string;\n} & IsUnknown, {\n /**\n * A method to generate additional properties to be added to `meta` of the pending action.\n *\n * Using this optional overload will not modify the types correctly, this overload is only in place to support JavaScript users.\n * Please use the `ThunkApiConfig` parameter `pendingMeta` to get access to a correctly typed overload\n */\n getPendingMeta?(base: {\n arg: ThunkArg;\n requestId: string;\n }, api: Pick, 'getState' | 'extra'>): GetPendingMeta;\n}, {\n /**\n * A method to generate additional properties to be added to `meta` of the pending action.\n */\n getPendingMeta(base: {\n arg: ThunkArg;\n requestId: string;\n }, api: Pick, 'getState' | 'extra'>): GetPendingMeta;\n}>;\nexport type AsyncThunkPendingActionCreator = ActionCreatorWithPreparedPayload<[string, ThunkArg, GetPendingMeta?], undefined, string, never, {\n arg: ThunkArg;\n requestId: string;\n requestStatus: 'pending';\n} & GetPendingMeta>;\nexport type AsyncThunkRejectedActionCreator = ActionCreatorWithPreparedPayload<[Error | null, string, ThunkArg, GetRejectValue?, GetRejectedMeta?], GetRejectValue | undefined, string, GetSerializedErrorType, {\n arg: ThunkArg;\n requestId: string;\n requestStatus: 'rejected';\n aborted: boolean;\n condition: boolean;\n} & (({\n rejectedWithValue: false;\n} & { [K in keyof GetRejectedMeta]?: undefined }) | ({\n rejectedWithValue: true;\n} & GetRejectedMeta))>;\nexport type AsyncThunkFulfilledActionCreator = ActionCreatorWithPreparedPayload<[Returned, string, ThunkArg, GetFulfilledMeta?], Returned, string, never, {\n arg: ThunkArg;\n requestId: string;\n requestStatus: 'fulfilled';\n} & GetFulfilledMeta>;\n\n/**\n * A type describing the return value of `createAsyncThunk`.\n * Might be useful for wrapping `createAsyncThunk` in custom abstractions.\n *\n * @public\n */\nexport type AsyncThunk = AsyncThunkActionCreator & {\n pending: AsyncThunkPendingActionCreator;\n rejected: AsyncThunkRejectedActionCreator;\n fulfilled: AsyncThunkFulfilledActionCreator;\n // matchSettled?\n settled: (action: any) => action is ReturnType | AsyncThunkFulfilledActionCreator>;\n typePrefix: string;\n};\nexport type OverrideThunkApiConfigs = Id>;\nexport type CreateAsyncThunkFunction = {\n /**\n *\n * @param typePrefix\n * @param payloadCreator\n * @param options\n *\n * @public\n */\n // separate signature without `AsyncThunkConfig` for better inference\n (typePrefix: string, payloadCreator: AsyncThunkPayloadCreator, options?: AsyncThunkOptions): AsyncThunk;\n\n /**\n *\n * @param typePrefix\n * @param payloadCreator\n * @param options\n *\n * @public\n */\n (typePrefix: string, payloadCreator: AsyncThunkPayloadCreator>, options?: AsyncThunkOptions>): AsyncThunk>;\n};\ntype CreateAsyncThunk = CreateAsyncThunkFunction & {\n withTypes(): CreateAsyncThunk>;\n};\nexport const createAsyncThunk = /* @__PURE__ */(() => {\n function createAsyncThunk(typePrefix: string, payloadCreator: AsyncThunkPayloadCreator, options?: AsyncThunkOptions): AsyncThunk {\n type RejectedValue = GetRejectValue;\n type PendingMeta = GetPendingMeta;\n type FulfilledMeta = GetFulfilledMeta;\n type RejectedMeta = GetRejectedMeta;\n const fulfilled: AsyncThunkFulfilledActionCreator = createAction(typePrefix + '/fulfilled', (payload: Returned, requestId: string, arg: ThunkArg, meta?: FulfilledMeta) => ({\n payload,\n meta: {\n ...(meta as any || {}),\n arg,\n requestId,\n requestStatus: 'fulfilled' as const\n }\n }));\n const pending: AsyncThunkPendingActionCreator = createAction(typePrefix + '/pending', (requestId: string, arg: ThunkArg, meta?: PendingMeta) => ({\n payload: undefined,\n meta: {\n ...(meta as any || {}),\n arg,\n requestId,\n requestStatus: 'pending' as const\n }\n }));\n const rejected: AsyncThunkRejectedActionCreator = createAction(typePrefix + '/rejected', (error: Error | null, requestId: string, arg: ThunkArg, payload?: RejectedValue, meta?: RejectedMeta) => ({\n payload,\n error: (options && options.serializeError || miniSerializeError)(error || 'Rejected') as GetSerializedErrorType,\n meta: {\n ...(meta as any || {}),\n arg,\n requestId,\n rejectedWithValue: !!payload,\n requestStatus: 'rejected' as const,\n aborted: error?.name === 'AbortError',\n condition: error?.name === 'ConditionError'\n }\n }));\n function actionCreator(arg: ThunkArg): AsyncThunkAction> {\n return (dispatch, getState, extra) => {\n const requestId = options?.idGenerator ? options.idGenerator(arg) : nanoid();\n const abortController = new AbortController();\n let abortHandler: (() => void) | undefined;\n let abortReason: string | undefined;\n function abort(reason?: string) {\n abortReason = reason;\n abortController.abort();\n }\n const promise = async function () {\n let finalAction: ReturnType;\n try {\n let conditionResult = options?.condition?.(arg, {\n getState,\n extra\n });\n if (isThenable(conditionResult)) {\n conditionResult = await conditionResult;\n }\n if (conditionResult === false || abortController.signal.aborted) {\n // eslint-disable-next-line no-throw-literal\n throw {\n name: 'ConditionError',\n message: 'Aborted due to condition callback returning false.'\n };\n }\n const abortedPromise = new Promise((_, reject) => {\n abortHandler = () => {\n reject({\n name: 'AbortError',\n message: abortReason || 'Aborted'\n });\n };\n abortController.signal.addEventListener('abort', abortHandler);\n });\n dispatch(pending(requestId, arg, options?.getPendingMeta?.({\n requestId,\n arg\n }, {\n getState,\n extra\n })) as any);\n finalAction = await Promise.race([abortedPromise, Promise.resolve(payloadCreator(arg, {\n dispatch,\n getState,\n extra,\n requestId,\n signal: abortController.signal,\n abort,\n rejectWithValue: ((value: RejectedValue, meta?: RejectedMeta) => {\n return new RejectWithValue(value, meta);\n }) as any,\n fulfillWithValue: ((value: unknown, meta?: FulfilledMeta) => {\n return new FulfillWithMeta(value, meta);\n }) as any\n })).then(result => {\n if (result instanceof RejectWithValue) {\n throw result;\n }\n if (result instanceof FulfillWithMeta) {\n return fulfilled(result.payload, requestId, arg, result.meta);\n }\n return fulfilled(result as any, requestId, arg);\n })]);\n } catch (err) {\n finalAction = err instanceof RejectWithValue ? rejected(null, requestId, arg, err.payload, err.meta) : rejected(err as any, requestId, arg);\n } finally {\n if (abortHandler) {\n abortController.signal.removeEventListener('abort', abortHandler);\n }\n }\n // We dispatch the result action _after_ the catch, to avoid having any errors\n // here get swallowed by the try/catch block,\n // per https://twitter.com/dan_abramov/status/770914221638942720\n // and https://github.com/reduxjs/redux-toolkit/blob/e85eb17b39a2118d859f7b7746e0f3fee523e089/docs/tutorials/advanced-tutorial.md#async-error-handling-logic-in-thunks\n\n const skipDispatch = options && !options.dispatchConditionRejection && rejected.match(finalAction) && (finalAction as any).meta.condition;\n if (!skipDispatch) {\n dispatch(finalAction as any);\n }\n return finalAction;\n }();\n return Object.assign(promise as SafePromise, {\n abort,\n requestId,\n arg,\n unwrap() {\n return promise.then(unwrapResult);\n }\n });\n };\n }\n return Object.assign(actionCreator as AsyncThunkActionCreator, {\n pending,\n rejected,\n fulfilled,\n settled: isAnyOf(rejected, fulfilled),\n typePrefix\n });\n }\n createAsyncThunk.withTypes = () => createAsyncThunk;\n return createAsyncThunk as CreateAsyncThunk;\n})();\ninterface UnwrappableAction {\n payload: any;\n meta?: any;\n error?: any;\n}\ntype UnwrappedActionPayload = Exclude['payload'];\n\n/**\n * @public\n */\nexport function unwrapResult(action: R): UnwrappedActionPayload {\n if (action.meta && action.meta.rejectedWithValue) {\n throw action.payload;\n }\n if (action.error) {\n throw action.error;\n }\n return action.payload;\n}\ntype WithStrictNullChecks = undefined extends boolean ? False : True;\nfunction isThenable(value: any): value is PromiseLike {\n return value !== null && typeof value === 'object' && typeof value.then === 'function';\n}","import { formatProdErrorMessage as _formatProdErrorMessage, formatProdErrorMessage as _formatProdErrorMessage2, formatProdErrorMessage as _formatProdErrorMessage3, formatProdErrorMessage as _formatProdErrorMessage4, formatProdErrorMessage as _formatProdErrorMessage5, formatProdErrorMessage as _formatProdErrorMessage6, formatProdErrorMessage as _formatProdErrorMessage7, formatProdErrorMessage as _formatProdErrorMessage8 } from \"@reduxjs/toolkit\";\nimport type { Action, Reducer, UnknownAction } from 'redux';\nimport type { Selector } from 'reselect';\nimport type { InjectConfig } from './combineSlices';\nimport type { ActionCreatorWithoutPayload, PayloadAction, PayloadActionCreator, PrepareAction, _ActionCreatorWithPreparedPayload } from './createAction';\nimport { createAction } from './createAction';\nimport type { AsyncThunk, AsyncThunkConfig, AsyncThunkOptions, AsyncThunkPayloadCreator, OverrideThunkApiConfigs } from './createAsyncThunk';\nimport { createAsyncThunk as _createAsyncThunk } from './createAsyncThunk';\nimport type { ActionMatcherDescriptionCollection, CaseReducer, ReducerWithInitialState } from './createReducer';\nimport { createReducer } from './createReducer';\nimport type { ActionReducerMapBuilder, TypedActionCreator } from './mapBuilders';\nimport { executeReducerBuilderCallback } from './mapBuilders';\nimport type { Id, TypeGuard } from './tsHelpers';\nimport { getOrInsertComputed } from './utils';\nconst asyncThunkSymbol = /* @__PURE__ */Symbol.for('rtk-slice-createasyncthunk');\n// type is annotated because it's too long to infer\nexport const asyncThunkCreator: {\n [asyncThunkSymbol]: typeof _createAsyncThunk;\n} = {\n [asyncThunkSymbol]: _createAsyncThunk\n};\ntype InjectIntoConfig = InjectConfig & {\n reducerPath?: NewReducerPath;\n};\n\n/**\n * The return value of `createSlice`\n *\n * @public\n */\nexport interface Slice = SliceCaseReducers, Name extends string = string, ReducerPath extends string = Name, Selectors extends SliceSelectors = SliceSelectors> {\n /**\n * The slice name.\n */\n name: Name;\n\n /**\n * The slice reducer path.\n */\n reducerPath: ReducerPath;\n\n /**\n * The slice's reducer.\n */\n reducer: Reducer;\n\n /**\n * Action creators for the types of actions that are handled by the slice\n * reducer.\n */\n actions: CaseReducerActions;\n\n /**\n * The individual case reducer functions that were passed in the `reducers` parameter.\n * This enables reuse and testing if they were defined inline when calling `createSlice`.\n */\n caseReducers: SliceDefinedCaseReducers;\n\n /**\n * Provides access to the initial state value given to the slice.\n * If a lazy state initializer was provided, it will be called and a fresh value returned.\n */\n getInitialState: () => State;\n\n /**\n * Get localised slice selectors (expects to be called with *just* the slice's state as the first parameter)\n */\n getSelectors(): Id>;\n\n /**\n * Get globalised slice selectors (`selectState` callback is expected to receive first parameter and return slice state)\n */\n getSelectors(selectState: (rootState: RootState) => State): Id>;\n\n /**\n * Selectors that assume the slice's state is `rootState[slice.reducerPath]` (which is usually the case)\n *\n * Equivalent to `slice.getSelectors((state: RootState) => state[slice.reducerPath])`.\n */\n get selectors(): Id>;\n\n /**\n * Inject slice into provided reducer (return value from `combineSlices`), and return injected slice.\n */\n injectInto(this: this, injectable: {\n inject: (slice: {\n reducerPath: string;\n reducer: Reducer;\n }, config?: InjectConfig) => void;\n }, config?: InjectIntoConfig): InjectedSlice;\n\n /**\n * Select the slice state, using the slice's current reducerPath.\n *\n * Will throw an error if slice is not found.\n */\n selectSlice(state: { [K in ReducerPath]: State }): State;\n}\n\n/**\n * A slice after being called with `injectInto(reducer)`.\n *\n * Selectors can now be called with an `undefined` value, in which case they use the slice's initial state.\n */\ntype InjectedSlice = SliceCaseReducers, Name extends string = string, ReducerPath extends string = Name, Selectors extends SliceSelectors = SliceSelectors> = Omit, 'getSelectors' | 'selectors'> & {\n /**\n * Get localised slice selectors (expects to be called with *just* the slice's state as the first parameter)\n */\n getSelectors(): Id>;\n\n /**\n * Get globalised slice selectors (`selectState` callback is expected to receive first parameter and return slice state)\n */\n getSelectors(selectState: (rootState: RootState) => State | undefined): Id>;\n\n /**\n * Selectors that assume the slice's state is `rootState[slice.name]` (which is usually the case)\n *\n * Equivalent to `slice.getSelectors((state: RootState) => state[slice.name])`.\n */\n get selectors(): Id>;\n\n /**\n * Select the slice state, using the slice's current reducerPath.\n *\n * Returns initial state if slice is not found.\n */\n selectSlice(state: { [K in ReducerPath]?: State | undefined }): State;\n};\n\n/**\n * Options for `createSlice()`.\n *\n * @public\n */\nexport interface CreateSliceOptions = SliceCaseReducers, Name extends string = string, ReducerPath extends string = Name, Selectors extends SliceSelectors = SliceSelectors> {\n /**\n * The slice's name. Used to namespace the generated action types.\n */\n name: Name;\n\n /**\n * The slice's reducer path. Used when injecting into a combined slice reducer.\n */\n reducerPath?: ReducerPath;\n\n /**\n * The initial state that should be used when the reducer is called the first time. This may also be a \"lazy initializer\" function, which should return an initial state value when called. This will be used whenever the reducer is called with `undefined` as its state value, and is primarily useful for cases like reading initial state from `localStorage`.\n */\n initialState: State | (() => State);\n\n /**\n * A mapping from action types to action-type-specific *case reducer*\n * functions. For every action type, a matching action creator will be\n * generated using `createAction()`.\n */\n reducers: ValidateSliceCaseReducers | ((creators: ReducerCreators) => CR);\n\n /**\n * A callback that receives a *builder* object to define\n * case reducers via calls to `builder.addCase(actionCreatorOrType, reducer)`.\n *\n *\n * @example\n ```ts\n import { createAction, createSlice, Action } from '@reduxjs/toolkit'\n const incrementBy = createAction('incrementBy')\n const decrement = createAction('decrement')\n interface RejectedAction extends Action {\n error: Error\n }\n function isRejectedAction(action: Action): action is RejectedAction {\n return action.type.endsWith('rejected')\n }\n createSlice({\n name: 'counter',\n initialState: 0,\n reducers: {},\n extraReducers: builder => {\n builder\n .addCase(incrementBy, (state, action) => {\n // action is inferred correctly here if using TS\n })\n // You can chain calls, or have separate `builder.addCase()` lines each time\n .addCase(decrement, (state, action) => {})\n // You can match a range of action types\n .addMatcher(\n isRejectedAction,\n // `action` will be inferred as a RejectedAction due to isRejectedAction being defined as a type guard\n (state, action) => {}\n )\n // and provide a default case if no other handlers matched\n .addDefaultCase((state, action) => {})\n }\n })\n ```\n */\n extraReducers?: (builder: ActionReducerMapBuilder) => void;\n\n /**\n * A map of selectors that receive the slice's state and any additional arguments, and return a result.\n */\n selectors?: Selectors;\n}\nexport enum ReducerType {\n reducer = 'reducer',\n reducerWithPrepare = 'reducerWithPrepare',\n asyncThunk = 'asyncThunk',\n}\ntype ReducerDefinition = {\n _reducerDefinitionType: T;\n};\nexport type CaseReducerDefinition = CaseReducer & ReducerDefinition;\n\n/**\n * A CaseReducer with a `prepare` method.\n *\n * @public\n */\nexport type CaseReducerWithPrepare = {\n reducer: CaseReducer;\n prepare: PrepareAction;\n};\nexport interface CaseReducerWithPrepareDefinition extends CaseReducerWithPrepare, ReducerDefinition {}\ntype AsyncThunkSliceReducerConfig = {\n pending?: CaseReducer['pending']>>;\n rejected?: CaseReducer['rejected']>>;\n fulfilled?: CaseReducer['fulfilled']>>;\n settled?: CaseReducer['rejected' | 'fulfilled']>>;\n options?: AsyncThunkOptions;\n};\ntype AsyncThunkSliceReducerDefinition = AsyncThunkSliceReducerConfig & ReducerDefinition & {\n payloadCreator: AsyncThunkPayloadCreator;\n};\n\n/**\n * Providing these as part of the config would cause circular types, so we disallow passing them\n */\ntype PreventCircular = { [K in keyof ThunkApiConfig]: K extends 'state' | 'dispatch' ? never : ThunkApiConfig[K] };\ninterface AsyncThunkCreator = PreventCircular> {\n (payloadCreator: AsyncThunkPayloadCreator, config?: AsyncThunkSliceReducerConfig): AsyncThunkSliceReducerDefinition;\n = {}>(payloadCreator: AsyncThunkPayloadCreator, config?: AsyncThunkSliceReducerConfig): AsyncThunkSliceReducerDefinition;\n withTypes>(): AsyncThunkCreator>;\n}\nexport interface ReducerCreators {\n reducer(caseReducer: CaseReducer): CaseReducerDefinition;\n reducer(caseReducer: CaseReducer>): CaseReducerDefinition>;\n asyncThunk: AsyncThunkCreator;\n preparedReducer>(prepare: Prepare, reducer: CaseReducer>>): {\n _reducerDefinitionType: ReducerType.reducerWithPrepare;\n prepare: Prepare;\n reducer: CaseReducer>>;\n };\n}\n\n/**\n * The type describing a slice's `reducers` option.\n *\n * @public\n */\nexport type SliceCaseReducers = Record | Record> | CaseReducerWithPrepare>>;\n\n/**\n * The type describing a slice's `selectors` option.\n */\nexport type SliceSelectors = {\n [K: string]: (sliceState: State, ...args: any[]) => any;\n};\ntype SliceActionType = ActionName extends string | number ? `${SliceName}/${ActionName}` : string;\n\n/**\n * Derives the slice's `actions` property from the `reducers` options\n *\n * @public\n */\nexport type CaseReducerActions, SliceName extends string> = { [Type in keyof CaseReducers]: CaseReducers[Type] extends infer Definition ? Definition extends {\n prepare: any;\n} ? ActionCreatorForCaseReducerWithPrepare> : Definition extends AsyncThunkSliceReducerDefinition ? AsyncThunk : Definition extends {\n reducer: any;\n} ? ActionCreatorForCaseReducer> : ActionCreatorForCaseReducer> : never };\n\n/**\n * Get a `PayloadActionCreator` type for a passed `CaseReducerWithPrepare`\n *\n * @internal\n */\ntype ActionCreatorForCaseReducerWithPrepare = _ActionCreatorWithPreparedPayload;\n\n/**\n * Get a `PayloadActionCreator` type for a passed `CaseReducer`\n *\n * @internal\n */\ntype ActionCreatorForCaseReducer = CR extends (state: any, action: infer Action) => any ? Action extends {\n payload: infer P;\n} ? PayloadActionCreator : ActionCreatorWithoutPayload : ActionCreatorWithoutPayload;\n\n/**\n * Extracts the CaseReducers out of a `reducers` object, even if they are\n * tested into a `CaseReducerWithPrepare`.\n *\n * @internal\n */\ntype SliceDefinedCaseReducers> = { [Type in keyof CaseReducers]: CaseReducers[Type] extends infer Definition ? Definition extends AsyncThunkSliceReducerDefinition ? Id, 'fulfilled' | 'rejected' | 'pending' | 'settled'>> : Definition extends {\n reducer: infer Reducer;\n} ? Reducer : Definition : never };\ntype RemappedSelector = S extends Selector ? Selector & {\n unwrapped: S;\n} : never;\n\n/**\n * Extracts the final selector type from the `selectors` object.\n *\n * Removes the `string` index signature from the default value.\n */\ntype SliceDefinedSelectors, RootState> = { [K in keyof Selectors as string extends K ? never : K]: RemappedSelector };\n\n/**\n * Used on a SliceCaseReducers object.\n * Ensures that if a CaseReducer is a `CaseReducerWithPrepare`, that\n * the `reducer` and the `prepare` function use the same type of `payload`.\n *\n * Might do additional such checks in the future.\n *\n * This type is only ever useful if you want to write your own wrapper around\n * `createSlice`. Please don't use it otherwise!\n *\n * @public\n */\nexport type ValidateSliceCaseReducers> = ACR & { [T in keyof ACR]: ACR[T] extends {\n reducer(s: S, action?: infer A): any;\n} ? {\n prepare(...a: never[]): Omit;\n} : {} };\nfunction getType(slice: string, actionKey: string): string {\n return `${slice}/${actionKey}`;\n}\ninterface BuildCreateSliceConfig {\n creators?: {\n asyncThunk?: typeof asyncThunkCreator;\n };\n}\nexport function buildCreateSlice({\n creators\n}: BuildCreateSliceConfig = {}) {\n const cAT = creators?.asyncThunk?.[asyncThunkSymbol];\n return function createSlice, Name extends string, Selectors extends SliceSelectors, ReducerPath extends string = Name>(options: CreateSliceOptions): Slice {\n const {\n name,\n reducerPath = name as unknown as ReducerPath\n } = options;\n if (!name) {\n throw new Error(process.env.NODE_ENV === \"production\" ? _formatProdErrorMessage(11) : '`name` is a required option for createSlice');\n }\n if (typeof process !== 'undefined' && process.env.NODE_ENV === 'development') {\n if (options.initialState === undefined) {\n console.error('You must provide an `initialState` value that is not `undefined`. You may have misspelled `initialState`');\n }\n }\n const reducers = (typeof options.reducers === 'function' ? options.reducers(buildReducerCreators()) : options.reducers) || {};\n const reducerNames = Object.keys(reducers);\n const context: ReducerHandlingContext = {\n sliceCaseReducersByName: {},\n sliceCaseReducersByType: {},\n actionCreators: {},\n sliceMatchers: []\n };\n const contextMethods: ReducerHandlingContextMethods = {\n addCase(typeOrActionCreator: string | TypedActionCreator, reducer: CaseReducer) {\n const type = typeof typeOrActionCreator === 'string' ? typeOrActionCreator : typeOrActionCreator.type;\n if (!type) {\n throw new Error(process.env.NODE_ENV === \"production\" ? _formatProdErrorMessage2(12) : '`context.addCase` cannot be called with an empty action type');\n }\n if (type in context.sliceCaseReducersByType) {\n throw new Error(process.env.NODE_ENV === \"production\" ? _formatProdErrorMessage3(13) : '`context.addCase` cannot be called with two reducers for the same action type: ' + type);\n }\n context.sliceCaseReducersByType[type] = reducer;\n return contextMethods;\n },\n addMatcher(matcher, reducer) {\n context.sliceMatchers.push({\n matcher,\n reducer\n });\n return contextMethods;\n },\n exposeAction(name, actionCreator) {\n context.actionCreators[name] = actionCreator;\n return contextMethods;\n },\n exposeCaseReducer(name, reducer) {\n context.sliceCaseReducersByName[name] = reducer;\n return contextMethods;\n }\n };\n reducerNames.forEach(reducerName => {\n const reducerDefinition = reducers[reducerName];\n const reducerDetails: ReducerDetails = {\n reducerName,\n type: getType(name, reducerName),\n createNotation: typeof options.reducers === 'function'\n };\n if (isAsyncThunkSliceReducerDefinition(reducerDefinition)) {\n handleThunkCaseReducerDefinition(reducerDetails, reducerDefinition, contextMethods, cAT);\n } else {\n handleNormalReducerDefinition(reducerDetails, reducerDefinition as any, contextMethods);\n }\n });\n function buildReducer() {\n if (process.env.NODE_ENV !== 'production') {\n if (typeof options.extraReducers === 'object') {\n throw new Error(process.env.NODE_ENV === \"production\" ? _formatProdErrorMessage4(14) : \"The object notation for `createSlice.extraReducers` has been removed. Please use the 'builder callback' notation instead: https://redux-toolkit.js.org/api/createSlice\");\n }\n }\n const [extraReducers = {}, actionMatchers = [], defaultCaseReducer = undefined] = typeof options.extraReducers === 'function' ? executeReducerBuilderCallback(options.extraReducers) : [options.extraReducers];\n const finalCaseReducers = {\n ...extraReducers,\n ...context.sliceCaseReducersByType\n };\n return createReducer(options.initialState, builder => {\n for (let key in finalCaseReducers) {\n builder.addCase(key, finalCaseReducers[key] as CaseReducer);\n }\n for (let sM of context.sliceMatchers) {\n builder.addMatcher(sM.matcher, sM.reducer);\n }\n for (let m of actionMatchers) {\n builder.addMatcher(m.matcher, m.reducer);\n }\n if (defaultCaseReducer) {\n builder.addDefaultCase(defaultCaseReducer);\n }\n });\n }\n const selectSelf = (state: State) => state;\n const injectedSelectorCache = new Map State | undefined, Record any>>>();\n let _reducer: ReducerWithInitialState;\n function reducer(state: State | undefined, action: UnknownAction) {\n if (!_reducer) _reducer = buildReducer();\n return _reducer(state, action);\n }\n function getInitialState() {\n if (!_reducer) _reducer = buildReducer();\n return _reducer.getInitialState();\n }\n function makeSelectorProps(reducerPath: CurrentReducerPath, injected = false): Pick, 'getSelectors' | 'selectors' | 'selectSlice' | 'reducerPath'> {\n function selectSlice(state: { [K in CurrentReducerPath]: State }) {\n let sliceState = state[reducerPath];\n if (typeof sliceState === 'undefined') {\n if (injected) {\n sliceState = getInitialState();\n } else if (process.env.NODE_ENV !== 'production') {\n throw new Error(process.env.NODE_ENV === \"production\" ? _formatProdErrorMessage5(15) : 'selectSlice returned undefined for an uninjected slice reducer');\n }\n }\n return sliceState;\n }\n function getSelectors(selectState: (rootState: any) => State = selectSelf) {\n const selectorCache = getOrInsertComputed(injectedSelectorCache, injected, () => new WeakMap());\n return getOrInsertComputed(selectorCache, selectState, () => {\n const map: Record> = {};\n for (const [name, selector] of Object.entries(options.selectors ?? {})) {\n map[name] = wrapSelector(selector, selectState, getInitialState, injected);\n }\n return map;\n }) as any;\n }\n return {\n reducerPath,\n getSelectors,\n get selectors() {\n return getSelectors(selectSlice);\n },\n selectSlice\n };\n }\n const slice: Slice = {\n name,\n reducer,\n actions: context.actionCreators as any,\n caseReducers: context.sliceCaseReducersByName as any,\n getInitialState,\n ...makeSelectorProps(reducerPath),\n injectInto(injectable, {\n reducerPath: pathOpt,\n ...config\n } = {}) {\n const newReducerPath = pathOpt ?? reducerPath;\n injectable.inject({\n reducerPath: newReducerPath,\n reducer\n }, config);\n return {\n ...slice,\n ...makeSelectorProps(newReducerPath, true)\n } as any;\n }\n };\n return slice;\n };\n}\nfunction wrapSelector>(selector: S, selectState: Selector, getInitialState: () => State, injected?: boolean) {\n function wrapper(rootState: NewState, ...args: any[]) {\n let sliceState = selectState(rootState);\n if (typeof sliceState === 'undefined') {\n if (injected) {\n sliceState = getInitialState();\n } else if (process.env.NODE_ENV !== 'production') {\n throw new Error(process.env.NODE_ENV === \"production\" ? _formatProdErrorMessage6(16) : 'selectState returned undefined for an uninjected slice reducer');\n }\n }\n return selector(sliceState, ...args);\n }\n wrapper.unwrapped = selector;\n return wrapper as RemappedSelector;\n}\n\n/**\n * A function that accepts an initial state, an object full of reducer\n * functions, and a \"slice name\", and automatically generates\n * action creators and action types that correspond to the\n * reducers and state.\n *\n * @public\n */\nexport const createSlice = /* @__PURE__ */buildCreateSlice();\ninterface ReducerHandlingContext {\n sliceCaseReducersByName: Record | Pick, 'fulfilled' | 'rejected' | 'pending' | 'settled'>>;\n sliceCaseReducersByType: Record>;\n sliceMatchers: ActionMatcherDescriptionCollection;\n actionCreators: Record;\n}\ninterface ReducerHandlingContextMethods {\n /**\n * Adds a case reducer to handle a single action type.\n * @param actionCreator - Either a plain action type string, or an action creator generated by [`createAction`](./createAction) that can be used to determine the action type.\n * @param reducer - The actual case reducer function.\n */\n addCase>(actionCreator: ActionCreator, reducer: CaseReducer>): ReducerHandlingContextMethods;\n /**\n * Adds a case reducer to handle a single action type.\n * @param actionCreator - Either a plain action type string, or an action creator generated by [`createAction`](./createAction) that can be used to determine the action type.\n * @param reducer - The actual case reducer function.\n */\n addCase>(type: Type, reducer: CaseReducer): ReducerHandlingContextMethods;\n\n /**\n * Allows you to match incoming actions against your own filter function instead of only the `action.type` property.\n * @remarks\n * If multiple matcher reducers match, all of them will be executed in the order\n * they were defined in - even if a case reducer already matched.\n * All calls to `builder.addMatcher` must come after any calls to `builder.addCase` and before any calls to `builder.addDefaultCase`.\n * @param matcher - A matcher function. In TypeScript, this should be a [type predicate](https://www.typescriptlang.org/docs/handbook/2/narrowing.html#using-type-predicates)\n * function\n * @param reducer - The actual case reducer function.\n *\n */\n addMatcher(matcher: TypeGuard, reducer: CaseReducer): ReducerHandlingContextMethods;\n /**\n * Add an action to be exposed under the final `slice.actions` key.\n * @param name The key to be exposed as.\n * @param actionCreator The action to expose.\n * @example\n * context.exposeAction(\"addPost\", createAction(\"addPost\"));\n *\n * export const { addPost } = slice.actions\n *\n * dispatch(addPost(post))\n */\n exposeAction(name: string, actionCreator: Function): ReducerHandlingContextMethods;\n /**\n * Add a case reducer to be exposed under the final `slice.caseReducers` key.\n * @param name The key to be exposed as.\n * @param reducer The reducer to expose.\n * @example\n * context.exposeCaseReducer(\"addPost\", (state, action: PayloadAction) => {\n * state.push(action.payload)\n * })\n *\n * slice.caseReducers.addPost([], addPost(post))\n */\n exposeCaseReducer(name: string, reducer: CaseReducer | Pick, 'fulfilled' | 'rejected' | 'pending' | 'settled'>): ReducerHandlingContextMethods;\n}\ninterface ReducerDetails {\n /** The key the reducer was defined under */\n reducerName: string;\n /** The predefined action type, i.e. `${slice.name}/${reducerName}` */\n type: string;\n /** Whether create. notation was used when defining reducers */\n createNotation: boolean;\n}\nfunction buildReducerCreators(): ReducerCreators {\n function asyncThunk(payloadCreator: AsyncThunkPayloadCreator, config: AsyncThunkSliceReducerConfig): AsyncThunkSliceReducerDefinition {\n return {\n _reducerDefinitionType: ReducerType.asyncThunk,\n payloadCreator,\n ...config\n };\n }\n asyncThunk.withTypes = () => asyncThunk;\n return {\n reducer(caseReducer: CaseReducer) {\n return Object.assign({\n // hack so the wrapping function has the same name as the original\n // we need to create a wrapper so the `reducerDefinitionType` is not assigned to the original\n [caseReducer.name](...args: Parameters) {\n return caseReducer(...args);\n }\n }[caseReducer.name], {\n _reducerDefinitionType: ReducerType.reducer\n } as const);\n },\n preparedReducer(prepare, reducer) {\n return {\n _reducerDefinitionType: ReducerType.reducerWithPrepare,\n prepare,\n reducer\n };\n },\n asyncThunk: asyncThunk as any\n };\n}\nfunction handleNormalReducerDefinition({\n type,\n reducerName,\n createNotation\n}: ReducerDetails, maybeReducerWithPrepare: CaseReducer | CaseReducerWithPrepare>, context: ReducerHandlingContextMethods) {\n let caseReducer: CaseReducer;\n let prepareCallback: PrepareAction | undefined;\n if ('reducer' in maybeReducerWithPrepare) {\n if (createNotation && !isCaseReducerWithPrepareDefinition(maybeReducerWithPrepare)) {\n throw new Error(process.env.NODE_ENV === \"production\" ? _formatProdErrorMessage7(17) : 'Please use the `create.preparedReducer` notation for prepared action creators with the `create` notation.');\n }\n caseReducer = maybeReducerWithPrepare.reducer;\n prepareCallback = maybeReducerWithPrepare.prepare;\n } else {\n caseReducer = maybeReducerWithPrepare;\n }\n context.addCase(type, caseReducer).exposeCaseReducer(reducerName, caseReducer).exposeAction(reducerName, prepareCallback ? createAction(type, prepareCallback) : createAction(type));\n}\nfunction isAsyncThunkSliceReducerDefinition(reducerDefinition: any): reducerDefinition is AsyncThunkSliceReducerDefinition {\n return reducerDefinition._reducerDefinitionType === ReducerType.asyncThunk;\n}\nfunction isCaseReducerWithPrepareDefinition(reducerDefinition: any): reducerDefinition is CaseReducerWithPrepareDefinition {\n return reducerDefinition._reducerDefinitionType === ReducerType.reducerWithPrepare;\n}\nfunction handleThunkCaseReducerDefinition({\n type,\n reducerName\n}: ReducerDetails, reducerDefinition: AsyncThunkSliceReducerDefinition, context: ReducerHandlingContextMethods, cAT: typeof _createAsyncThunk | undefined) {\n if (!cAT) {\n throw new Error(process.env.NODE_ENV === \"production\" ? _formatProdErrorMessage8(18) : 'Cannot use `create.asyncThunk` in the built-in `createSlice`. ' + 'Use `buildCreateSlice({ creators: { asyncThunk: asyncThunkCreator } })` to create a customised version of `createSlice`.');\n }\n const {\n payloadCreator,\n fulfilled,\n pending,\n rejected,\n settled,\n options\n } = reducerDefinition;\n const thunk = cAT(type, payloadCreator, options as any);\n context.exposeAction(reducerName, thunk);\n if (fulfilled) {\n context.addCase(thunk.fulfilled, fulfilled);\n }\n if (pending) {\n context.addCase(thunk.pending, pending);\n }\n if (rejected) {\n context.addCase(thunk.rejected, rejected);\n }\n if (settled) {\n context.addMatcher(thunk.settled, settled);\n }\n context.exposeCaseReducer(reducerName, {\n fulfilled: fulfilled || noop,\n pending: pending || noop,\n rejected: rejected || noop,\n settled: settled || noop\n });\n}\nfunction noop() {}","import { formatProdErrorMessage as _formatProdErrorMessage } from \"@reduxjs/toolkit\";\nimport type { Draft } from 'immer';\nimport { produce as createNextState, isDraft, isDraftable } from 'immer';\nimport type { Action, Reducer, UnknownAction } from 'redux';\nimport type { ActionReducerMapBuilder } from './mapBuilders';\nimport { executeReducerBuilderCallback } from './mapBuilders';\nimport type { NoInfer, TypeGuard } from './tsHelpers';\nimport { freezeDraftable } from './utils';\n\n/**\n * Defines a mapping from action types to corresponding action object shapes.\n *\n * @deprecated This should not be used manually - it is only used for internal\n * inference purposes and should not have any further value.\n * It might be removed in the future.\n * @public\n */\nexport type Actions = Record;\nexport type ActionMatcherDescription = {\n matcher: TypeGuard;\n reducer: CaseReducer>;\n};\nexport type ReadonlyActionMatcherDescriptionCollection = ReadonlyArray>;\nexport type ActionMatcherDescriptionCollection = Array>;\n\n/**\n * A *case reducer* is a reducer function for a specific action type. Case\n * reducers can be composed to full reducers using `createReducer()`.\n *\n * Unlike a normal Redux reducer, a case reducer is never called with an\n * `undefined` state to determine the initial state. Instead, the initial\n * state is explicitly specified as an argument to `createReducer()`.\n *\n * In addition, a case reducer can choose to mutate the passed-in `state`\n * value directly instead of returning a new state. This does not actually\n * cause the store state to be mutated directly; instead, thanks to\n * [immer](https://github.com/mweststrate/immer), the mutations are\n * translated to copy operations that result in a new state.\n *\n * @public\n */\nexport type CaseReducer = (state: Draft, action: A) => NoInfer | void | Draft>;\n\n/**\n * A mapping from action types to case reducers for `createReducer()`.\n *\n * @deprecated This should not be used manually - it is only used\n * for internal inference purposes and using it manually\n * would lead to type erasure.\n * It might be removed in the future.\n * @public\n */\nexport type CaseReducers = { [T in keyof AS]: AS[T] extends Action ? CaseReducer : void };\nexport type NotFunction = T extends Function ? never : T;\nfunction isStateFunction(x: unknown): x is () => S {\n return typeof x === 'function';\n}\nexport type ReducerWithInitialState> = Reducer & {\n getInitialState: () => S;\n};\n\n/**\n * A utility function that allows defining a reducer as a mapping from action\n * type to *case reducer* functions that handle these action types. The\n * reducer's initial state is passed as the first argument.\n *\n * @remarks\n * The body of every case reducer is implicitly wrapped with a call to\n * `produce()` from the [immer](https://github.com/mweststrate/immer) library.\n * This means that rather than returning a new state object, you can also\n * mutate the passed-in state object directly; these mutations will then be\n * automatically and efficiently translated into copies, giving you both\n * convenience and immutability.\n *\n * @overloadSummary\n * This function accepts a callback that receives a `builder` object as its argument.\n * That builder provides `addCase`, `addMatcher` and `addDefaultCase` functions that may be\n * called to define what actions this reducer will handle.\n *\n * @param initialState - `State | (() => State)`: The initial state that should be used when the reducer is called the first time. This may also be a \"lazy initializer\" function, which should return an initial state value when called. This will be used whenever the reducer is called with `undefined` as its state value, and is primarily useful for cases like reading initial state from `localStorage`.\n * @param builderCallback - `(builder: Builder) => void` A callback that receives a *builder* object to define\n * case reducers via calls to `builder.addCase(actionCreatorOrType, reducer)`.\n * @example\n```ts\nimport {\n createAction,\n createReducer,\n UnknownAction,\n PayloadAction,\n} from \"@reduxjs/toolkit\";\n\nconst increment = createAction(\"increment\");\nconst decrement = createAction(\"decrement\");\n\nfunction isActionWithNumberPayload(\n action: UnknownAction\n): action is PayloadAction {\n return typeof action.payload === \"number\";\n}\n\nconst reducer = createReducer(\n {\n counter: 0,\n sumOfNumberPayloads: 0,\n unhandledActions: 0,\n },\n (builder) => {\n builder\n .addCase(increment, (state, action) => {\n // action is inferred correctly here\n state.counter += action.payload;\n })\n // You can chain calls, or have separate `builder.addCase()` lines each time\n .addCase(decrement, (state, action) => {\n state.counter -= action.payload;\n })\n // You can apply a \"matcher function\" to incoming actions\n .addMatcher(isActionWithNumberPayload, (state, action) => {})\n // and provide a default case if no other handlers matched\n .addDefaultCase((state, action) => {});\n }\n);\n```\n * @public\n */\nexport function createReducer>(initialState: S | (() => S), mapOrBuilderCallback: (builder: ActionReducerMapBuilder) => void): ReducerWithInitialState {\n if (process.env.NODE_ENV !== 'production') {\n if (typeof mapOrBuilderCallback === 'object') {\n throw new Error(process.env.NODE_ENV === \"production\" ? _formatProdErrorMessage(8) : \"The object notation for `createReducer` has been removed. Please use the 'builder callback' notation instead: https://redux-toolkit.js.org/api/createReducer\");\n }\n }\n let [actionsMap, finalActionMatchers, finalDefaultCaseReducer] = executeReducerBuilderCallback(mapOrBuilderCallback);\n\n // Ensure the initial state gets frozen either way (if draftable)\n let getInitialState: () => S;\n if (isStateFunction(initialState)) {\n getInitialState = () => freezeDraftable(initialState());\n } else {\n const frozenInitialState = freezeDraftable(initialState);\n getInitialState = () => frozenInitialState;\n }\n function reducer(state = getInitialState(), action: any): S {\n let caseReducers = [actionsMap[action.type], ...finalActionMatchers.filter(({\n matcher\n }) => matcher(action)).map(({\n reducer\n }) => reducer)];\n if (caseReducers.filter(cr => !!cr).length === 0) {\n caseReducers = [finalDefaultCaseReducer];\n }\n return caseReducers.reduce((previousState, caseReducer): S => {\n if (caseReducer) {\n if (isDraft(previousState)) {\n // If it's already a draft, we must already be inside a `createNextState` call,\n // likely because this is being wrapped in `createReducer`, `createSlice`, or nested\n // inside an existing draft. It's safe to just pass the draft to the mutator.\n const draft = previousState as Draft; // We can assume this is already a draft\n const result = caseReducer(draft, action);\n if (result === undefined) {\n return previousState;\n }\n return result as S;\n } else if (!isDraftable(previousState)) {\n // If state is not draftable (ex: a primitive, such as 0), we want to directly\n // return the caseReducer func and not wrap it with produce.\n const result = caseReducer(previousState as any, action);\n if (result === undefined) {\n if (previousState === null) {\n return previousState;\n }\n throw Error('A case reducer on a non-draftable value must not return undefined');\n }\n return result as S;\n } else {\n // @ts-ignore createNextState() produces an Immutable> rather\n // than an Immutable, and TypeScript cannot find out how to reconcile\n // these two types.\n return createNextState(previousState, (draft: Draft) => {\n return caseReducer(draft, action);\n });\n }\n }\n return previousState;\n }, state);\n }\n reducer.getInitialState = getInitialState;\n return reducer as ReducerWithInitialState;\n}","import type { SerializedError } from '@reduxjs/toolkit';\nconst task = 'task';\nconst listener = 'listener';\nconst completed = 'completed';\nconst cancelled = 'cancelled';\n\n/* TaskAbortError error codes */\nexport const taskCancelled = `task-${cancelled}` as const;\nexport const taskCompleted = `task-${completed}` as const;\nexport const listenerCancelled = `${listener}-${cancelled}` as const;\nexport const listenerCompleted = `${listener}-${completed}` as const;\nexport class TaskAbortError implements SerializedError {\n name = 'TaskAbortError';\n message: string;\n constructor(public code: string | undefined) {\n this.message = `${task} ${cancelled} (reason: ${code})`;\n }\n}","import { TaskAbortError } from './exceptions';\nimport type { AbortSignalWithReason, TaskResult } from './types';\nimport { addAbortSignalListener, catchRejection, noop } from './utils';\n\n/**\n * Synchronously raises {@link TaskAbortError} if the task tied to the input `signal` has been cancelled.\n * @param signal\n * @param reason\n * @see {TaskAbortError}\n */\nexport const validateActive = (signal: AbortSignal): void => {\n if (signal.aborted) {\n const {\n reason\n } = signal as AbortSignalWithReason;\n throw new TaskAbortError(reason);\n }\n};\n\n/**\n * Generates a race between the promise(s) and the AbortSignal\n * This avoids `Promise.race()`-related memory leaks:\n * https://github.com/nodejs/node/issues/17469#issuecomment-349794909\n */\nexport function raceWithSignal(signal: AbortSignalWithReason, promise: Promise): Promise {\n let cleanup = noop;\n return new Promise((resolve, reject) => {\n const notifyRejection = () => reject(new TaskAbortError(signal.reason));\n if (signal.aborted) {\n notifyRejection();\n return;\n }\n cleanup = addAbortSignalListener(signal, notifyRejection);\n promise.finally(() => cleanup()).then(resolve, reject);\n }).finally(() => {\n // after this point, replace `cleanup` with a noop, so there is no reference to `signal` any more\n cleanup = noop;\n });\n}\n\n/**\n * Runs a task and returns promise that resolves to {@link TaskResult}.\n * Second argument is an optional `cleanUp` function that always runs after task.\n *\n * **Note:** `runTask` runs the executor in the next microtask.\n * @returns\n */\nexport const runTask = async (task: () => Promise, cleanUp?: () => void): Promise> => {\n try {\n await Promise.resolve();\n const value = await task();\n return {\n status: 'ok',\n value\n };\n } catch (error: any) {\n return {\n status: error instanceof TaskAbortError ? 'cancelled' : 'rejected',\n error\n };\n } finally {\n cleanUp?.();\n }\n};\n\n/**\n * Given an input `AbortSignal` and a promise returns another promise that resolves\n * as soon the input promise is provided or rejects as soon as\n * `AbortSignal.abort` is `true`.\n * @param signal\n * @returns\n */\nexport const createPause = (signal: AbortSignal) => {\n return (promise: Promise): Promise => {\n return catchRejection(raceWithSignal(signal, promise).then(output => {\n validateActive(signal);\n return output;\n }));\n };\n};\n\n/**\n * Given an input `AbortSignal` and `timeoutMs` returns a promise that resolves\n * after `timeoutMs` or rejects as soon as `AbortSignal.abort` is `true`.\n * @param signal\n * @returns\n */\nexport const createDelay = (signal: AbortSignal) => {\n const pause = createPause(signal);\n return (timeoutMs: number): Promise => {\n return pause(new Promise(resolve => setTimeout(resolve, timeoutMs)));\n };\n};","import { formatProdErrorMessage as _formatProdErrorMessage, formatProdErrorMessage as _formatProdErrorMessage2, formatProdErrorMessage as _formatProdErrorMessage3 } from \"@reduxjs/toolkit\";\nimport type { Action, Dispatch, MiddlewareAPI, UnknownAction } from 'redux';\nimport { isAction } from 'redux';\nimport type { ThunkDispatch } from 'redux-thunk';\nimport { createAction } from '../createAction';\nimport { nanoid } from '../nanoid';\nimport { TaskAbortError, listenerCancelled, listenerCompleted, taskCancelled, taskCompleted } from './exceptions';\nimport { createDelay, createPause, raceWithSignal, runTask, validateActive } from './task';\nimport type { AbortSignalWithReason, AddListenerOverloads, AnyListenerPredicate, CreateListenerMiddlewareOptions, FallbackAddListenerOptions, ForkOptions, ForkedTask, ForkedTaskExecutor, ListenerEntry, ListenerErrorHandler, ListenerErrorInfo, ListenerMiddleware, ListenerMiddlewareInstance, TakePattern, TaskResult, TypedAddListener, TypedCreateListenerEntry, TypedRemoveListener, UnsubscribeListener, UnsubscribeListenerOptions } from './types';\nimport { abortControllerWithReason, addAbortSignalListener, assertFunction, catchRejection, noop } from './utils';\nexport { TaskAbortError } from './exceptions';\nexport type { AsyncTaskExecutor, CreateListenerMiddlewareOptions, ForkedTask, ForkedTaskAPI, ForkedTaskExecutor, ListenerEffect, ListenerEffectAPI, ListenerErrorHandler, ListenerMiddleware, ListenerMiddlewareInstance, SyncTaskExecutor, TaskCancelled, TaskRejected, TaskResolved, TaskResult, TypedAddListener, TypedRemoveListener, TypedStartListening, TypedStopListening, UnsubscribeListener, UnsubscribeListenerOptions } from './types';\n\n//Overly-aggressive byte-shaving\nconst {\n assign\n} = Object;\n/**\n * @internal\n */\nconst INTERNAL_NIL_TOKEN = {} as const;\nconst alm = 'listenerMiddleware' as const;\nconst createFork = (parentAbortSignal: AbortSignalWithReason, parentBlockingPromises: Promise[]) => {\n const linkControllers = (controller: AbortController) => addAbortSignalListener(parentAbortSignal, () => abortControllerWithReason(controller, parentAbortSignal.reason));\n return (taskExecutor: ForkedTaskExecutor, opts?: ForkOptions): ForkedTask => {\n assertFunction(taskExecutor, 'taskExecutor');\n const childAbortController = new AbortController();\n linkControllers(childAbortController);\n const result = runTask(async (): Promise => {\n validateActive(parentAbortSignal);\n validateActive(childAbortController.signal);\n const result = (await taskExecutor({\n pause: createPause(childAbortController.signal),\n delay: createDelay(childAbortController.signal),\n signal: childAbortController.signal\n })) as T;\n validateActive(childAbortController.signal);\n return result;\n }, () => abortControllerWithReason(childAbortController, taskCompleted));\n if (opts?.autoJoin) {\n parentBlockingPromises.push(result.catch(noop));\n }\n return {\n result: createPause>(parentAbortSignal)(result),\n cancel() {\n abortControllerWithReason(childAbortController, taskCancelled);\n }\n };\n };\n};\nconst createTakePattern = (startListening: AddListenerOverloads, signal: AbortSignal): TakePattern => {\n /**\n * A function that takes a ListenerPredicate and an optional timeout,\n * and resolves when either the predicate returns `true` based on an action\n * state combination or when the timeout expires.\n * If the parent listener is canceled while waiting, this will throw a\n * TaskAbortError.\n */\n const take = async

    ,>(predicate: P, timeout: number | undefined) => {\n validateActive(signal);\n\n // Placeholder unsubscribe function until the listener is added\n let unsubscribe: UnsubscribeListener = () => {};\n const tuplePromise = new Promise<[Action, S, S]>((resolve, reject) => {\n // Inside the Promise, we synchronously add the listener.\n let stopListening = startListening({\n predicate: predicate as any,\n effect: (action, listenerApi): void => {\n // One-shot listener that cleans up as soon as the predicate passes\n listenerApi.unsubscribe();\n // Resolve the promise with the same arguments the predicate saw\n resolve([action, listenerApi.getState(), listenerApi.getOriginalState()]);\n }\n });\n unsubscribe = () => {\n stopListening();\n reject();\n };\n });\n const promises: (Promise | Promise<[Action, S, S]>)[] = [tuplePromise];\n if (timeout != null) {\n promises.push(new Promise(resolve => setTimeout(resolve, timeout, null)));\n }\n try {\n const output = await raceWithSignal(signal, Promise.race(promises));\n validateActive(signal);\n return output;\n } finally {\n // Always clean up the listener\n unsubscribe();\n }\n };\n return ((predicate: AnyListenerPredicate, timeout: number | undefined) => catchRejection(take(predicate, timeout))) as TakePattern;\n};\nconst getListenerEntryPropsFrom = (options: FallbackAddListenerOptions) => {\n let {\n type,\n actionCreator,\n matcher,\n predicate,\n effect\n } = options;\n if (type) {\n predicate = createAction(type).match;\n } else if (actionCreator) {\n type = actionCreator!.type;\n predicate = actionCreator.match;\n } else if (matcher) {\n predicate = matcher;\n } else if (predicate) {\n // pass\n } else {\n throw new Error(process.env.NODE_ENV === \"production\" ? _formatProdErrorMessage(21) : 'Creating or removing a listener requires one of the known fields for matching an action');\n }\n assertFunction(effect, 'options.listener');\n return {\n predicate,\n type,\n effect\n };\n};\n\n/** Accepts the possible options for creating a listener, and returns a formatted listener entry */\nexport const createListenerEntry: TypedCreateListenerEntry = /* @__PURE__ */assign((options: FallbackAddListenerOptions) => {\n const {\n type,\n predicate,\n effect\n } = getListenerEntryPropsFrom(options);\n const entry: ListenerEntry = {\n id: nanoid(),\n effect,\n type,\n predicate,\n pending: new Set(),\n unsubscribe: () => {\n throw new Error(process.env.NODE_ENV === \"production\" ? _formatProdErrorMessage2(22) : 'Unsubscribe not initialized');\n }\n };\n return entry;\n}, {\n withTypes: () => createListenerEntry\n}) as unknown as TypedCreateListenerEntry;\nconst findListenerEntry = (listenerMap: Map, options: FallbackAddListenerOptions) => {\n const {\n type,\n effect,\n predicate\n } = getListenerEntryPropsFrom(options);\n return Array.from(listenerMap.values()).find(entry => {\n const matchPredicateOrType = typeof type === 'string' ? entry.type === type : entry.predicate === predicate;\n return matchPredicateOrType && entry.effect === effect;\n });\n};\nconst cancelActiveListeners = (entry: ListenerEntry>) => {\n entry.pending.forEach(controller => {\n abortControllerWithReason(controller, listenerCancelled);\n });\n};\nconst createClearListenerMiddleware = (listenerMap: Map) => {\n return () => {\n listenerMap.forEach(cancelActiveListeners);\n listenerMap.clear();\n };\n};\n\n/**\n * Safely reports errors to the `errorHandler` provided.\n * Errors that occur inside `errorHandler` are notified in a new task.\n * Inspired by [rxjs reportUnhandledError](https://github.com/ReactiveX/rxjs/blob/6fafcf53dc9e557439b25debaeadfd224b245a66/src/internal/util/reportUnhandledError.ts)\n * @param errorHandler\n * @param errorToNotify\n */\nconst safelyNotifyError = (errorHandler: ListenerErrorHandler, errorToNotify: unknown, errorInfo: ListenerErrorInfo): void => {\n try {\n errorHandler(errorToNotify, errorInfo);\n } catch (errorHandlerError) {\n // We cannot let an error raised here block the listener queue.\n // The error raised here will be picked up by `window.onerror`, `process.on('error')` etc...\n setTimeout(() => {\n throw errorHandlerError;\n }, 0);\n }\n};\n\n/**\n * @public\n */\nexport const addListener = /* @__PURE__ */assign(/* @__PURE__ */createAction(`${alm}/add`), {\n withTypes: () => addListener\n}) as unknown as TypedAddListener;\n\n/**\n * @public\n */\nexport const clearAllListeners = /* @__PURE__ */createAction(`${alm}/removeAll`);\n\n/**\n * @public\n */\nexport const removeListener = /* @__PURE__ */assign(/* @__PURE__ */createAction(`${alm}/remove`), {\n withTypes: () => removeListener\n}) as unknown as TypedRemoveListener;\nconst defaultErrorHandler: ListenerErrorHandler = (...args: unknown[]) => {\n console.error(`${alm}/error`, ...args);\n};\n\n/**\n * @public\n */\nexport const createListenerMiddleware = = ThunkDispatch, ExtraArgument = unknown>(middlewareOptions: CreateListenerMiddlewareOptions = {}) => {\n const listenerMap = new Map();\n const {\n extra,\n onError = defaultErrorHandler\n } = middlewareOptions;\n assertFunction(onError, 'onError');\n const insertEntry = (entry: ListenerEntry) => {\n entry.unsubscribe = () => listenerMap.delete(entry.id);\n listenerMap.set(entry.id, entry);\n return (cancelOptions?: UnsubscribeListenerOptions) => {\n entry.unsubscribe();\n if (cancelOptions?.cancelActive) {\n cancelActiveListeners(entry);\n }\n };\n };\n const startListening = ((options: FallbackAddListenerOptions) => {\n const entry = findListenerEntry(listenerMap, options) ?? createListenerEntry(options as any);\n return insertEntry(entry);\n }) as AddListenerOverloads;\n assign(startListening, {\n withTypes: () => startListening\n });\n const stopListening = (options: FallbackAddListenerOptions & UnsubscribeListenerOptions): boolean => {\n const entry = findListenerEntry(listenerMap, options);\n if (entry) {\n entry.unsubscribe();\n if (options.cancelActive) {\n cancelActiveListeners(entry);\n }\n }\n return !!entry;\n };\n assign(stopListening, {\n withTypes: () => stopListening\n });\n const notifyListener = async (entry: ListenerEntry>, action: unknown, api: MiddlewareAPI, getOriginalState: () => StateType) => {\n const internalTaskController = new AbortController();\n const take = createTakePattern(startListening as AddListenerOverloads, internalTaskController.signal);\n const autoJoinPromises: Promise[] = [];\n try {\n entry.pending.add(internalTaskController);\n await Promise.resolve(entry.effect(action,\n // Use assign() rather than ... to avoid extra helper functions added to bundle\n assign({}, api, {\n getOriginalState,\n condition: (predicate: AnyListenerPredicate, timeout?: number) => take(predicate, timeout).then(Boolean),\n take,\n delay: createDelay(internalTaskController.signal),\n pause: createPause(internalTaskController.signal),\n extra,\n signal: internalTaskController.signal,\n fork: createFork(internalTaskController.signal, autoJoinPromises),\n unsubscribe: entry.unsubscribe,\n subscribe: () => {\n listenerMap.set(entry.id, entry);\n },\n cancelActiveListeners: () => {\n entry.pending.forEach((controller, _, set) => {\n if (controller !== internalTaskController) {\n abortControllerWithReason(controller, listenerCancelled);\n set.delete(controller);\n }\n });\n },\n cancel: () => {\n abortControllerWithReason(internalTaskController, listenerCancelled);\n entry.pending.delete(internalTaskController);\n },\n throwIfCancelled: () => {\n validateActive(internalTaskController.signal);\n }\n })));\n } catch (listenerError) {\n if (!(listenerError instanceof TaskAbortError)) {\n safelyNotifyError(onError, listenerError, {\n raisedBy: 'effect'\n });\n }\n } finally {\n await Promise.all(autoJoinPromises);\n abortControllerWithReason(internalTaskController, listenerCompleted); // Notify that the task has completed\n entry.pending.delete(internalTaskController);\n }\n };\n const clearListenerMiddleware = createClearListenerMiddleware(listenerMap);\n const middleware: ListenerMiddleware = api => next => action => {\n if (!isAction(action)) {\n // we only want to notify listeners for action objects\n return next(action);\n }\n if (addListener.match(action)) {\n return startListening(action.payload as any);\n }\n if (clearAllListeners.match(action)) {\n clearListenerMiddleware();\n return;\n }\n if (removeListener.match(action)) {\n return stopListening(action.payload);\n }\n\n // Need to get this state _before_ the reducer processes the action\n let originalState: StateType | typeof INTERNAL_NIL_TOKEN = api.getState();\n\n // `getOriginalState` can only be called synchronously.\n // @see https://github.com/reduxjs/redux-toolkit/discussions/1648#discussioncomment-1932820\n const getOriginalState = (): StateType => {\n if (originalState === INTERNAL_NIL_TOKEN) {\n throw new Error(process.env.NODE_ENV === \"production\" ? _formatProdErrorMessage3(23) : `${alm}: getOriginalState can only be called synchronously`);\n }\n return originalState as StateType;\n };\n let result: unknown;\n try {\n // Actually forward the action to the reducer before we handle listeners\n result = next(action);\n if (listenerMap.size > 0) {\n const currentState = api.getState();\n // Work around ESBuild+TS transpilation issue\n const listenerEntries = Array.from(listenerMap.values());\n for (const entry of listenerEntries) {\n let runListener = false;\n try {\n runListener = entry.predicate(action, currentState, originalState);\n } catch (predicateError) {\n runListener = false;\n safelyNotifyError(onError, predicateError, {\n raisedBy: 'predicate'\n });\n }\n if (!runListener) {\n continue;\n }\n notifyListener(entry, action, api, getOriginalState);\n }\n }\n } finally {\n // Remove `originalState` store from this scope.\n originalState = INTERNAL_NIL_TOKEN;\n }\n return result;\n };\n return {\n middleware,\n startListening,\n stopListening,\n clearListeners: clearListenerMiddleware\n } as ListenerMiddlewareInstance;\n};","import { formatProdErrorMessage as _formatProdErrorMessage, formatProdErrorMessage as _formatProdErrorMessage2 } from \"@reduxjs/toolkit\";\nimport type { Reducer, StateFromReducersMapObject, UnknownAction } from 'redux';\nimport { combineReducers } from 'redux';\nimport { nanoid } from './nanoid';\nimport type { Id, NonUndefined, Tail, UnionToIntersection, WithOptionalProp } from './tsHelpers';\nimport { getOrInsertComputed } from './utils';\ntype SliceLike = {\n reducerPath: ReducerPath;\n reducer: Reducer;\n};\ntype AnySliceLike = SliceLike;\ntype SliceLikeReducerPath = A extends SliceLike ? ReducerPath : never;\ntype SliceLikeState = A extends SliceLike ? State : never;\nexport type WithSlice = { [Path in SliceLikeReducerPath]: SliceLikeState };\ntype ReducerMap = Record;\ntype ExistingSliceLike = { [ReducerPath in keyof DeclaredState]: SliceLike> }[keyof DeclaredState];\nexport type InjectConfig = {\n /**\n * Allow replacing reducer with a different reference. Normally, an error will be thrown if a different reducer instance to the one already injected is used.\n */\n overrideExisting?: boolean;\n};\n\n/**\n * A reducer that allows for slices/reducers to be injected after initialisation.\n */\nexport interface CombinedSliceReducer extends Reducer> {\n /**\n * Provide a type for slices that will be injected lazily.\n *\n * One way to do this would be with interface merging:\n * ```ts\n *\n * export interface LazyLoadedSlices {}\n *\n * export const rootReducer = combineSlices(stringSlice).withLazyLoadedSlices();\n *\n * // elsewhere\n *\n * declare module './reducer' {\n * export interface LazyLoadedSlices extends WithSlice {}\n * }\n *\n * const withBoolean = rootReducer.inject(booleanSlice);\n *\n * // elsewhere again\n *\n * declare module './reducer' {\n * export interface LazyLoadedSlices {\n * customName: CustomState\n * }\n * }\n *\n * const withCustom = rootReducer.inject({ reducerPath: \"customName\", reducer: customSlice.reducer })\n * ```\n */\n withLazyLoadedSlices(): CombinedSliceReducer>>;\n\n /**\n * Inject a slice.\n *\n * Accepts an individual slice, RTKQ API instance, or a \"slice-like\" { reducerPath, reducer } object.\n *\n * ```ts\n * rootReducer.inject(booleanSlice)\n * rootReducer.inject(baseApi)\n * rootReducer.inject({ reducerPath: 'boolean' as const, reducer: newReducer }, { overrideExisting: true })\n * ```\n *\n */\n inject>>(slice: Sl, config?: InjectConfig): CombinedSliceReducer>>;\n\n /**\n * Inject a slice.\n *\n * Accepts an individual slice, RTKQ API instance, or a \"slice-like\" { reducerPath, reducer } object.\n *\n * ```ts\n * rootReducer.inject(booleanSlice)\n * rootReducer.inject(baseApi)\n * rootReducer.inject({ reducerPath: 'boolean' as const, reducer: newReducer }, { overrideExisting: true })\n * ```\n *\n */\n inject(slice: SliceLike, config?: InjectConfig): CombinedSliceReducer>>>;\n\n /**\n * Create a selector that guarantees that the slices injected will have a defined value when selector is run.\n *\n * ```ts\n * const selectBooleanWithoutInjection = (state: RootState) => state.boolean;\n * // ^? boolean | undefined\n *\n * const selectBoolean = rootReducer.inject(booleanSlice).selector((state) => {\n * // if action hasn't been dispatched since slice was injected, this would usually be undefined\n * // however selector() uses a Proxy around the first parameter to ensure that it evaluates to the initial state instead, if undefined\n * return state.boolean;\n * // ^? boolean\n * })\n * ```\n *\n * If the reducer is nested inside the root state, a selectState callback can be passed to retrieve the reducer's state.\n *\n * ```ts\n *\n * export interface LazyLoadedSlices {};\n *\n * export const innerReducer = combineSlices(stringSlice).withLazyLoadedSlices();\n *\n * export const rootReducer = combineSlices({ inner: innerReducer });\n *\n * export type RootState = ReturnType;\n *\n * // elsewhere\n *\n * declare module \"./reducer.ts\" {\n * export interface LazyLoadedSlices extends WithSlice {}\n * }\n *\n * const withBool = innerReducer.inject(booleanSlice);\n *\n * const selectBoolean = withBool.selector(\n * (state) => state.boolean,\n * (rootState: RootState) => state.inner\n * );\n * // now expects to be passed RootState instead of innerReducer state\n *\n * ```\n *\n * Value passed to selectorFn will be a Proxy - use selector.original(proxy) to get original state value (useful for debugging)\n *\n * ```ts\n * const injectedReducer = rootReducer.inject(booleanSlice);\n * const selectBoolean = injectedReducer.selector((state) => {\n * console.log(injectedReducer.selector.original(state).boolean) // possibly undefined\n * return state.boolean\n * })\n * ```\n */\n selector: {\n /**\n * Create a selector that guarantees that the slices injected will have a defined value when selector is run.\n *\n * ```ts\n * const selectBooleanWithoutInjection = (state: RootState) => state.boolean;\n * // ^? boolean | undefined\n *\n * const selectBoolean = rootReducer.inject(booleanSlice).selector((state) => {\n * // if action hasn't been dispatched since slice was injected, this would usually be undefined\n * // however selector() uses a Proxy around the first parameter to ensure that it evaluates to the initial state instead, if undefined\n * return state.boolean;\n * // ^? boolean\n * })\n * ```\n *\n * Value passed to selectorFn will be a Proxy - use selector.original(proxy) to get original state value (useful for debugging)\n *\n * ```ts\n * const injectedReducer = rootReducer.inject(booleanSlice);\n * const selectBoolean = injectedReducer.selector((state) => {\n * console.log(injectedReducer.selector.original(state).boolean) // undefined\n * return state.boolean\n * })\n * ```\n */\n unknown>(selectorFn: Selector): (state: WithOptionalProp[0], Exclude>, ...args: Tail>) => ReturnType;\n\n /**\n * Create a selector that guarantees that the slices injected will have a defined value when selector is run.\n *\n * ```ts\n * const selectBooleanWithoutInjection = (state: RootState) => state.boolean;\n * // ^? boolean | undefined\n *\n * const selectBoolean = rootReducer.inject(booleanSlice).selector((state) => {\n * // if action hasn't been dispatched since slice was injected, this would usually be undefined\n * // however selector() uses a Proxy around the first parameter to ensure that it evaluates to the initial state instead, if undefined\n * return state.boolean;\n * // ^? boolean\n * })\n * ```\n *\n * If the reducer is nested inside the root state, a selectState callback can be passed to retrieve the reducer's state.\n *\n * ```ts\n *\n * interface LazyLoadedSlices {};\n *\n * const innerReducer = combineSlices(stringSlice).withLazyLoadedSlices();\n *\n * const rootReducer = combineSlices({ inner: innerReducer });\n *\n * type RootState = ReturnType;\n *\n * // elsewhere\n *\n * declare module \"./reducer.ts\" {\n * interface LazyLoadedSlices extends WithSlice {}\n * }\n *\n * const withBool = innerReducer.inject(booleanSlice);\n *\n * const selectBoolean = withBool.selector(\n * (state) => state.boolean,\n * (rootState: RootState) => state.inner\n * );\n * // now expects to be passed RootState instead of innerReducer state\n *\n * ```\n *\n * Value passed to selectorFn will be a Proxy - use selector.original(proxy) to get original state value (useful for debugging)\n *\n * ```ts\n * const injectedReducer = rootReducer.inject(booleanSlice);\n * const selectBoolean = injectedReducer.selector((state) => {\n * console.log(injectedReducer.selector.original(state).boolean) // possibly undefined\n * return state.boolean\n * })\n * ```\n */\n unknown, RootState>(selectorFn: Selector, selectState: (rootState: RootState, ...args: Tail>) => WithOptionalProp[0], Exclude>): (state: RootState, ...args: Tail>) => ReturnType;\n /**\n * Returns the unproxied state. Useful for debugging.\n * @param state state Proxy, that ensures injected reducers have value\n * @returns original, unproxied state\n * @throws if value passed is not a state Proxy\n */\n original: (state: DeclaredState) => InitialState & Partial;\n };\n}\ntype InitialState> = UnionToIntersection : StateFromReducersMapObject : never>;\nconst isSliceLike = (maybeSliceLike: AnySliceLike | ReducerMap): maybeSliceLike is AnySliceLike => 'reducerPath' in maybeSliceLike && typeof maybeSliceLike.reducerPath === 'string';\nconst getReducers = (slices: Array) => slices.flatMap(sliceOrMap => isSliceLike(sliceOrMap) ? [[sliceOrMap.reducerPath, sliceOrMap.reducer] as const] : Object.entries(sliceOrMap));\nconst ORIGINAL_STATE = Symbol.for('rtk-state-proxy-original');\nconst isStateProxy = (value: any) => !!value && !!value[ORIGINAL_STATE];\nconst stateProxyMap = new WeakMap();\nconst createStateProxy = (state: State, reducerMap: Partial>) => getOrInsertComputed(stateProxyMap, state, () => new Proxy(state, {\n get: (target, prop, receiver) => {\n if (prop === ORIGINAL_STATE) return target;\n const result = Reflect.get(target, prop, receiver);\n if (typeof result === 'undefined') {\n const reducer = reducerMap[prop.toString()];\n if (reducer) {\n // ensure action type is random, to prevent reducer treating it differently\n const reducerResult = reducer(undefined, {\n type: nanoid()\n });\n if (typeof reducerResult === 'undefined') {\n throw new Error(process.env.NODE_ENV === \"production\" ? _formatProdErrorMessage(24) : `The slice reducer for key \"${prop.toString()}\" returned undefined when called for selector(). ` + `If the state passed to the reducer is undefined, you must ` + `explicitly return the initial state. The initial state may ` + `not be undefined. If you don't want to set a value for this reducer, ` + `you can use null instead of undefined.`);\n }\n return reducerResult;\n }\n }\n return result;\n }\n})) as State;\nconst original = (state: any) => {\n if (!isStateProxy(state)) {\n throw new Error(process.env.NODE_ENV === \"production\" ? _formatProdErrorMessage2(25) : 'original must be used on state Proxy');\n }\n return state[ORIGINAL_STATE];\n};\nconst noopReducer: Reducer> = (state = {}) => state;\nexport function combineSlices>(...slices: Slices): CombinedSliceReducer>> {\n const reducerMap = Object.fromEntries(getReducers(slices));\n const getReducer = () => Object.keys(reducerMap).length ? combineReducers(reducerMap) : noopReducer;\n let reducer = getReducer();\n function combinedReducer(state: Record, action: UnknownAction) {\n return reducer(state, action);\n }\n combinedReducer.withLazyLoadedSlices = () => combinedReducer;\n const inject = (slice: AnySliceLike, config: InjectConfig = {}): typeof combinedReducer => {\n const {\n reducerPath,\n reducer: reducerToInject\n } = slice;\n const currentReducer = reducerMap[reducerPath];\n if (!config.overrideExisting && currentReducer && currentReducer !== reducerToInject) {\n if (typeof process !== 'undefined' && process.env.NODE_ENV === 'development') {\n console.error(`called \\`inject\\` to override already-existing reducer ${reducerPath} without specifying \\`overrideExisting: true\\``);\n }\n return combinedReducer;\n }\n reducerMap[reducerPath] = reducerToInject;\n reducer = getReducer();\n return combinedReducer;\n };\n const selector = Object.assign(function makeSelector(selectorFn: (state: State, ...args: Args) => any, selectState?: (rootState: RootState, ...args: Args) => State) {\n return function selector(state: State, ...args: Args) {\n return selectorFn(createStateProxy(selectState ? selectState(state as any, ...args) : state, reducerMap), ...args);\n };\n }, {\n original\n });\n return Object.assign(combinedReducer, {\n inject,\n selector\n }) as any;\n}","/**\n * Adapted from React: https://github.com/facebook/react/blob/master/packages/shared/formatProdErrorMessage.js\n *\n * Do not require this module directly! Use normal throw error calls. These messages will be replaced with error codes\n * during build.\n * @param {number} code\n */\nexport function formatProdErrorMessage(code: number) {\n return `Minified Redux Toolkit error #${code}; visit https://redux-toolkit.js.org/Errors?code=${code} for the full message or ` + 'use the non-minified dev environment for full errors. ';\n}"],"names":["capitalize","str","replace","toUpperCase","safeAssign","target","_len","arguments","length","args","Array","_key2","Object","assign","cache","WeakMap","defaultSerializeQueryArgs","_ref","endpointName","queryArgs","serialized","cached","get","stringified","JSON","stringify","key","value","$bigint","toString","isPlainObject","keys","sort","reduce","acc","key2","set","concat","UNINITIALIZED_VALUE","Symbol","useStableQueryArgs","serialize","endpointDefinition","incoming","useMemo","cache2","useRef","useEffect","current","useShallowStableValue","useRef2","useEffect2","shallowEqual","isDOM","canUseDOM","window","document","createElement","isReactNative","isRunningInReactNative","navigator","product","useIsomorphicLayoutEffect","getUseIsomorphicLayoutEffect","useLayoutEffect","useEffect3","noPendingQueryStateSelector","selected","isUninitialized","_objectSpread","isFetching","isLoading","data","status","QueryStatus","pending","reactHooksModuleName","createApi","buildCreateApi","coreModule","_ref3","undefined","batch","rrBatch","hooks","useDispatch","rrUseDispatch","useSelector","rrUseSelector","useStore","rrUseStore","createSelector","createSelector2","_createSelector","unstable__sideEffectsInRender","_objectWithoutProperties","_excluded","name","init","api","_ref4","context","serializeQueryArgs","anyApi","buildQueryHooks","buildMutationHook","usePrefetch","_ref2","moduleOptions","usePossiblyImmediateEffect","cb","useQuerySubscription","arg","refetchOnReconnect","refetchOnFocus","refetchOnMountOrArgChange","skip","pollingInterval","skipPollingIfUnfocused","initiate","endpoints","dispatch","subscriptionSelectorsRef","useRef3","returnedValue","internalActions","internal_getRTKQSubscriptions","stableArg","skipToken","endpointDefinitions","stableSubscriptionOptions","lastRenderHadSubscription","promiseRef","queryCacheKey","requestId","currentRenderHasSubscription","isRequestSubscribed","subscriptionRemoved","_promiseRef$current","lastPromise","unsubscribe","lastSubscriptionOptions","subscriptionOptions","updateSubscriptionOptions","promise","forceRefetch","_promiseRef$current2","useMemo2","refetch","_promiseRef$current3","Error","_formatProdErrorMessage2","useLazyQuerySubscription","setArg","useState","_promiseRef$current4","_promiseRef$current5","subscriptionOptionsRef","trigger","useCallback","arg2","preferCacheValue","_promiseRef$current6","reset","_promiseRef$current7","_promiseRef$current8","removeQueryResult","_promiseRef$current9","useQueryState","selectFromResult","select","lastValue","selectDefaultResult","_","lastResult","queryStatePreSelector","memoizeOptions","resultEqualityCheck","shallowEqual2","querySelector","devModeChecks","identityFunctionCheck","currentState","state","store","newLastValue","getState","useLazyQuery","options","queryStateResults","info","lastArg","useQuery","querySubscriptionResults","isSuccess","isError","error","useDebugValue","fixedCacheKey","setPromise","triggerMutation","promise2","mutationSelector","originalArgs","removeMutationResult","finalState","defaultOptions","stableDefaultOptions","util","prefetch","_lastResult","_lastResult2","_lastResult3","hasData","currentData","buildHooks","injectEndpoint","definition","type","e","isMutationDefinition","useMutation","reactHooksModule","QueryStatus2","isPlainObject2","copyWithStructuralSharing","oldObj","newObj","isArray","newKeys","oldKeys","isSameObject","mergeObj","countObjectKeys","obj","count","_key","flatten","arr","isNotNullish","v","withoutTrailingSlash","url","withoutLeadingSlash","joinUrls","base","RegExp","test","isAbsoluteUrl","delimiter","endsWith","startsWith","defaultFetchFn","fetch","defaultValidateStatus","response","defaultIsJsonContentType","headers","stripUndefined","copy","k","entries","fetchBaseQuery","baseUrl","prepareHeaders","x","fetchFn","paramsSerializer","isJsonContentType","jsonContentType","jsonReplacer","timeout","defaultTimeout","responseHandler","globalResponseHandler","validateStatus","globalValidateStatus","baseFetchOptions","async","extraOptions","extra","endpoint","forced","meta","abortController","Headers","params","rest","_excluded2","signal","AbortController","addEventListener","abort","config","isJsonifiable","body","toJSON","has","divider","indexOf","URLSearchParams","request","Request","timedOut","timeoutId","setTimeout","String","_abortController","clearTimeout","removeEventListener","responseClone","clone","resultData","responseText","handleResponseError","Promise","all","handleResponse","then","r","text","originalStatus","parse","HandledError","constructor","onFocus","createAction","onFocusLost","onOnline","onOffline","isQueryDefinition","calculateProvidedBy","description","result","queryArg","assertTagTypes","filter","map","expandTagDescription","forceQueryFnSymbol","isUpsertQuery","defaultTransformResponse","baseQueryReturnValue","calculateProvidedByThunk","action","assertTagType","isFulfilled","payload","isRejectedWithValue","baseQueryMeta","updateQuerySubstateIfExists","update","substate","getMutationCacheKey","id","_ref9","updateMutationSubstateIfExists","initialState","buildSlice","_ref10","reducerPath","queryThunk","mutationThunk","definitions","apiUid","extractRehydrationInfo","hasRehydrationInfo","resetApiState","writePendingCacheEntry","draft","upserting","_arg$queryCacheKey","_draft$_arg$queryCach","startedTimeStamp","writeFulfilledCacheEntry","merge","_definitions$meta$arg","fulfilledTimeStamp","newData","createNextState","draftSubstateData","structuralSharing","isDraft","original","querySlice","createSlice","reducers","reducer","_ref11","prepare","prepareAutoBatched","cacheEntriesUpserted","entry","queryDescription","timestamp","SHOULD_AUTOBATCH","nanoid","Date","now","queryResultPatched","_ref12","patches","applyPatches","extraReducers","builder","addCase","_ref13","fulfilled","_ref14","rejected","_ref15","condition","addMatcher","queries","mutationSlice","_ref16","cacheKey","_ref17","track","_ref18","_ref19","mutations","invalidationSlice","updateProvidedBy","providedTags","tagTypeSubscriptions","values","idSubscriptions","foundAt","splice","_draft$type","_ref20","_draft$type$_ref","_draft$type2","subscribedQueries","includes","push","actions","_ref21","provided","incomingTags","cacheKeys","_draft$type3","_ref22","_draft$type3$_ref","_draft$type4","isAnyOf","caseReducers","subscriptionSlice","d","a","unsubscribeQueryResult","internalSubscriptionsSlice","subscriptionsUpdated","configSlice","online","onLine","focused","visibilityState","middlewareRegistered","_ref23","combinedReducer","combineReducers","subscriptions","match","for","initialSubState","defaultQuerySubState","defaultMutationSubState","_ref26","modules","weakMapMemoize","_options$extractRehyd","_options$reducerPath","call","optionsWithDefaults","keepUnusedDataFor","invalidationBehavior","queryArgsApi","finalSerializeQueryArgs","endpointSQA","queryArgsApi2","initialResult","tagTypes","fn","injectEndpoints","inject","evaluatedEndpoints","query","mutation","overrideExisting","m","initializedModules","enhanceEndpoints","_ref27","addTagTypes","eT","partialDefinition","_len2","_key3","buildBatchedActionsHandler","_ref28","internalState","subscriptionsPrefix","previousSubscriptions","updateSyncTimer","getSubscriptions","currentSubscriptions","subscriptionSelectors","getSubscriptionCount","_subscriptions$queryC","_subscriptions$queryC2","mwApi","didMutate","actuallyMutateSubscriptions","mutableState","_mutableState$queryCa","_arg$queryCacheKey2","_mutableState$_arg$qu","_ref29","_arg$subscriptionOpti","subscribe","mutated","_arg$queryCacheKey3","_mutableState$_arg$qu2","_ref30","_arg$subscriptionOpti2","actionShouldContinue","newSubscriptions","produceWithPatches2","next","isSubscriptionSliceAction","isAdditionalSubscriptionAction","buildCacheCollectionHandler","_ref31","canTriggerUnsubscribe","anySubscriptionsRemainingForKey","isObjectEmpty","currentRemovalTimeouts","handleUnsubscribe","api2","_endpointDefinition$k","Infinity","finalKeepUnusedDataFor","Math","max","min","currentTimeout","handler","internalState2","queryCacheKeys","_state$queries$queryC","queryState","neverResolvedError","buildCacheLifecycleHandler","_ref32","isQueryThunk","isAsyncThunkAction","isMutationThunk","isFulfilledThunk","lifecycleMap","resolveLifecycleEntry","lifecycle","valueResolved","removeLifecycleEntry","cacheEntryRemoved","handleNewKey","onCacheEntryAdded","resolve","cacheDataLoaded","race","catch","selector","__","extra2","lifecycleApi","getCacheEntry","updateCachedData","updateRecipe","updateQueryData","runningHandler","stateBefore","_action$meta$arg$fixe","getCacheKey","checkForNewCacheKey","cacheKey2","oldState","buildDevCheckHandler","_ref33","buildInvalidationByTagsHandler","_ref34","refetchQuery","isThunkActionWithTags","isQueryEnd","isRejected","pendingTagInvalidations","invalidateTags","newTags","rootState","_state$queries$key","_state$mutations$key","hasPendingRequests","tags","toInvalidate","selectInvalidatedBy","valuesArray","from","_internalState$curren","querySubState","subscriptionSubState","buildPollingHandler","_ref35","currentPolls","startNextPoll","_ref36","lowestPollingInterval","findLowestPollingInterval","Number","isFinite","currentPoll","nextPollTimestamp","updatePollingInterval","_ref37","cleanupPollForKey","existingPoll","subscribers","POSITIVE_INFINITY","clearPolls","buildQueryLifecycleHandler","_ref38","isPendingThunk","isPending","isRejectedThunk","isFullfilledThunk","onQueryStarted","queryFulfilled","reject","_lifecycleMap$request","_lifecycleMap$request2","_action$payload","rejectedWithValue","isUnhandledError","buildMiddleware","input","isThisApiSliceAction","handlerBuilders","middleware","initialized2","builderArgs","handlers","build","batchedActionsHandler","windowEventsHandler","_ref39","refetchValidQueries","some","sub","every","buildWindowEventHandler","isAction","mwApiWithNext","internalProbeResult","res","coreModuleName","_ref40","baseQuery","enablePatches","tag","patchQueryData","upsertQueryData","buildMatchThunkActions","_ref6","executeEndpoint","_ref7","rejectWithValue","fulfillWithValue","transformResponse","baseQueryApi","isForcedQuery","forceQueryFn","queryFn","catchedError","transformErrorResponse","_state$reducerPath","_state$reducerPath2","_arg$forceRefetch","requestState","baseFetchOnMountOrArgChange","fulfilledVal","refetchVal","createAsyncThunk","getPendingMeta","queryThunkArgs","_ref8","_state$reducerPath3","_endpointDefinition$f","currentArg","previousArg","endpointState","dispatchConditionRejection","matchesEndpoint","_action$meta","force","hasTheForce","maxAge","hasMaxAge","ifOlderThan","queryAction","options2","isPrefetch","latestStateValue","lastFulfilledTs","updateProvided","ret","inversePatches","undo","newValue","isDraftable","produceWithPatches","op","path","providesTags","thunk","matchPending","isAllOf","matchFulfilled","matchRejected","buildThunks","sliceActions","upsertQueryEntries","middlewareActions","buildQuerySelector","buildMutationSelector","selectCachedArgsForQuery","_ref24","selectSkippedQuery","selectSkippedMutation","withRequestFlags","serializedArgs","_selectInternalState$","_selectInternalState","selectInternalState","mutationId","_getMutationCacheKey","_selectInternalState$2","_selectInternalState2","apiState","Set","_ref25","invalidateSubscriptions","invalidate","add","queryName","buildSelectors","buildInitiateQuery","buildInitiateMutation","getRunningMutationThunk","getRunningMutationsThunk","getRunningQueriesThunk","getRunningQueryThunk","runningQueries","Map","runningMutations","_ref5","_toPropertyKey","_runningQueries$get2","thunkResult","stateAfter","middlewareWarning","skippedSynchronously","runningQuery","selectFromState","statePromise","unwrap","running","delete","returnValuePromise","fallback","_runningQueries$get","_endpointName","fixedCacheKeyOrRequestId","_runningMutations$get","buildInitiate","_anyApi$endpoints","_anyApi$endpoints$end","formatProdErrorMessage","code","symbol_observable_default","observable","randomString","random","substring","split","join","actionTypes_default","INIT","REPLACE","PROBE_UNKNOWN_ACTION","proto","getPrototypeOf","createStore","preloadedState","enhancer","currentReducer","currentListeners","nextListeners","listenerIdCounter","isDispatching","ensureCanMutateNextListeners","forEach","listener","isSubscribed","listenerId","replaceReducer","nextReducer","outerSubscribe","observer","observeState","observerAsObserver","this","reducerKeys","finalReducers","i","process","finalReducerKeys","shapeAssertionError","assertReducerShape","hasChanged","nextState","previousStateForKey","nextStateForKey","compose","funcs","b","createThunkMiddleware","extraArgument","withExtraArgument","composeWithDevTools","__REDUX_DEVTOOLS_EXTENSION_COMPOSE__","apply","hasMatchFunction","__REDUX_DEVTOOLS_EXTENSION__","prepareAction","actionCreator","prepared","Tuple","_Tuple","super","setPrototypeOf","prototype","species","prepend","_len3","freezeDraftable","val","getOrInsertComputed","compute","buildGetDefaultMiddleware","immutableCheck","serializableCheck","actionCreatorCheck","middlewareArray","thunkMiddleware","createQueueWithTimer","notify","buildGetDefaultEnhancers","middlewareEnhancer","autoBatch","enhancerArray","notifying","shouldNotifyAtEndOfTick","notificationQueued","listeners","queueCallback","queueMicrotask","requestAnimationFrame","queueNotification","notifyListeners","l","listener2","wrappedListener","autoBatchEnhancer","configureStore","getDefaultMiddleware","devTools","enhancers","rootReducer","finalMiddleware","finalCompose","compose2","trace","middlewares","createStore2","middlewareAPI","_len4","_key4","chain","applyMiddleware","getDefaultEnhancers","executeReducerBuilderCallback","builderCallback","actionsMap","actionMatchers","defaultCaseReducer","typeOrActionCreator","matcher","addDefaultCase","matches","matchers","_len5","_key5","hasExpectedRequestMetadata","validStatus","hasValidRequestId","hasValidRequestStatus","requestStatus","isAsyncThunkArray","_len6","asyncThunks","_key6","asyncThunk","_len7","_key7","hasFlag","_len8","_key8","_len9","_key9","_len10","_key10","flatMap","commonProperties","RejectWithValue","_defineProperty","FulfillWithMeta","miniSerializeError","simpleError","property","message","createAsyncThunk2","typePrefix","payloadCreator","serializeError","aborted","idGenerator","abortHandler","abortReason","reason","finalAction","_options$condition","_options$getPendingMe","conditionResult","abortedPromise","err","unwrapResult","settled","withTypes","asyncThunkSymbol","getType","slice","actionKey","buildCreateSlice","_creators$asyncThunk","creators","cAT","_reducerDefinitionType","caseReducer","preparedReducer","buildReducerCreators","reducerNames","sliceCaseReducersByName","sliceCaseReducersByType","actionCreators","sliceMatchers","contextMethods","reducer2","exposeAction","name2","exposeCaseReducer","buildReducer","finalCaseReducers","mapOrBuilderCallback","getInitialState","finalActionMatchers","finalDefaultCaseReducer","frozenInitialState","cr","previousState","isDraft2","isDraftable2","createNextState2","createReducer","sM","reducerName","reducerDefinition","reducerDetails","createNotation","isAsyncThunkSliceReducerDefinition","maybeReducerWithPrepare","prepareCallback","isCaseReducerWithPrepareDefinition","handleNormalReducerDefinition","noop","handleThunkCaseReducerDefinition","selectSelf","injectedSelectorCache","_reducer","makeSelectorProps","reducerPath2","injected","selectSlice","sliceState","getSelectors","selectState","selectorCache","_options$selectors","selectors","wrapSelector","injectInto","injectable","pathOpt","newReducerPath","wrapper","_len11","_key11","unwrapped","completed","cancelled","alm","addListener","removeListener"],"sourceRoot":""}