Socket
Socket
Sign inDemoInstall

@reduxjs/toolkit

Package Overview
Dependencies
Maintainers
4
Versions
96
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@reduxjs/toolkit - npm Package Compare versions

Comparing version 1.8.0-rc.0 to 1.8.0

4

dist/index.d.ts

@@ -31,3 +31,3 @@ export * from 'redux';

export { default as isPlainObject } from './isPlainObject';
export type { ListenerEffect, ListenerMiddleware, ListenerEffectAPI, ListenerMiddlewareInstance, CreateListenerMiddlewareOptions, ListenerErrorHandler, TypedStartListening, TypedAddListener, TypedStopListening, TypedRemoveListener, Unsubscribe, ForkedTaskExecutor, ForkedTask, ForkedTaskAPI, AsyncTaskExecutor, SyncTaskExecutor, TaskCancelled, TaskRejected, TaskResolved, TaskResult, } from './listenerMiddleware/index';
export { createListenerMiddleware, addListener, removeListener, removeAllListeners, TaskAbortError, } from './listenerMiddleware/index';
export type { ListenerEffect, ListenerMiddleware, ListenerEffectAPI, ListenerMiddlewareInstance, CreateListenerMiddlewareOptions, ListenerErrorHandler, TypedStartListening, TypedAddListener, TypedStopListening, TypedRemoveListener, UnsubscribeListener, UnsubscribeListenerOptions, ForkedTaskExecutor, ForkedTask, ForkedTaskAPI, AsyncTaskExecutor, SyncTaskExecutor, TaskCancelled, TaskRejected, TaskResolved, TaskResult, } from './listenerMiddleware/index';
export { createListenerMiddleware, addListener, removeListener, clearAllListeners, TaskAbortError, } from './listenerMiddleware/index';

@@ -5,20 +5,20 @@ import type { Dispatch, AnyAction } from 'redux';

export { TaskAbortError } from './exceptions';
export type { ListenerEffect, ListenerMiddleware, ListenerEffectAPI, ListenerMiddlewareInstance, CreateListenerMiddlewareOptions, ListenerErrorHandler, TypedStartListening, TypedAddListener, TypedStopListening, TypedRemoveListener, Unsubscribe, ForkedTaskExecutor, ForkedTask, ForkedTaskAPI, AsyncTaskExecutor, SyncTaskExecutor, TaskCancelled, TaskRejected, TaskResolved, TaskResult, } from './types';
export type { ListenerEffect, ListenerMiddleware, ListenerEffectAPI, ListenerMiddlewareInstance, CreateListenerMiddlewareOptions, ListenerErrorHandler, TypedStartListening, TypedAddListener, TypedStopListening, TypedRemoveListener, UnsubscribeListener, UnsubscribeListenerOptions, ForkedTaskExecutor, ForkedTask, ForkedTaskAPI, AsyncTaskExecutor, SyncTaskExecutor, TaskCancelled, TaskRejected, TaskResolved, TaskResult, } from './types';
/** Accepts the possible options for creating a listener, and returns a formatted listener entry */
export declare const createListenerEntry: TypedCreateListenerEntry<unknown>;
/**
* @alpha
* @public
*/
export declare const addListener: TypedAddListener<unknown, ThunkDispatch<unknown, unknown, AnyAction>, unknown, ListenerEntry<unknown, ThunkDispatch<unknown, unknown, AnyAction>>, "listenerMiddleware/add">;
/**
* @alpha
* @public
*/
export declare const removeAllListeners: import("../createAction").ActionCreatorWithoutPayload<string>;
export declare const clearAllListeners: import("../createAction").ActionCreatorWithoutPayload<string>;
/**
* @alpha
* @public
*/
export declare const removeListener: TypedRemoveListener<unknown, ThunkDispatch<unknown, unknown, AnyAction>, ListenerEntry<unknown, ThunkDispatch<unknown, unknown, AnyAction>>, "listenerMiddleware/remove">;
/**
* @alpha
* @public
*/
export declare function createListenerMiddleware<S = unknown, D extends Dispatch<AnyAction> = ThunkDispatch<S, unknown, AnyAction>, ExtraArgument = unknown>(middlewareOptions?: CreateListenerMiddlewareOptions<ExtraArgument>): ListenerMiddlewareInstance<S, D, ExtraArgument>;

@@ -189,3 +189,3 @@ import type { PayloadAction, BaseActionCreator } from '../createAction';

export declare type ListenerMiddleware<State = unknown, Dispatch extends ThunkDispatch<State, unknown, AnyAction> = ThunkDispatch<State, unknown, AnyAction>, ExtraArgument = unknown> = Middleware<{
(action: ReduxAction<'listenerMiddleware/add'>): Unsubscribe;
(action: ReduxAction<'listenerMiddleware/add'>): UnsubscribeListener;
}, State, Dispatch>;

@@ -195,3 +195,3 @@ /** @public */

middleware: ListenerMiddleware<State, Dispatch, ExtraArgument>;
startListening: AddListenerOverloads<Unsubscribe, State, Dispatch, ExtraArgument>;
startListening: AddListenerOverloads<UnsubscribeListener, State, Dispatch, ExtraArgument>;
stopListening: RemoveListenerOverloads<State, Dispatch>;

@@ -216,2 +216,8 @@ /**

}
/** @public */
export interface UnsubscribeListenerOptions {
cancelActive?: true;
}
/** @public */
export declare type UnsubscribeListener = (unsuscribeOptions?: UnsubscribeListenerOptions) => void;
/**

@@ -221,3 +227,3 @@ * @public

*/
export interface AddListenerOverloads<Return, State = unknown, Dispatch extends ReduxDispatch = ThunkDispatch<State, unknown, AnyAction>, ExtraArgument = unknown> {
export interface AddListenerOverloads<Return, State = unknown, Dispatch extends ReduxDispatch = ThunkDispatch<State, unknown, AnyAction>, ExtraArgument = unknown, AdditionalOptions = unknown> {
/** Accepts a "listener predicate" that is also a TS type predicate for the action*/

@@ -230,3 +236,3 @@ <MA extends AnyAction, LP extends ListenerPredicate<MA, State>>(options: {

effect: ListenerEffect<ListenerPredicateGuardedActionType<LP>, State, Dispatch, ExtraArgument>;
}): Return;
} & AdditionalOptions): Return;
/** Accepts an RTK action creator, like `incrementByAmount` */

@@ -239,3 +245,3 @@ <C extends TypedActionCreator<any>>(options: {

effect: ListenerEffect<ReturnType<C>, State, Dispatch, ExtraArgument>;
}): Return;
} & AdditionalOptions): Return;
/** Accepts a specific action type string */

@@ -248,3 +254,3 @@ <T extends string>(options: {

effect: ListenerEffect<ReduxAction<T>, State, Dispatch, ExtraArgument>;
}): Return;
} & AdditionalOptions): Return;
/** Accepts an RTK matcher function, such as `incrementByAmount.match` */

@@ -257,3 +263,3 @@ <MA extends AnyAction, M extends MatchFunction<MA>>(options: {

effect: ListenerEffect<GuardedType<M>, State, Dispatch, ExtraArgument>;
}): Return;
} & AdditionalOptions): Return;
/** Accepts a "listener predicate" that just returns a boolean, no type assertion */

@@ -266,6 +272,6 @@ <LP extends AnyListenerPredicate<State>>(options: {

effect: ListenerEffect<AnyAction, State, Dispatch, ExtraArgument>;
}): Return;
} & AdditionalOptions): Return;
}
/** @public */
export declare type RemoveListenerOverloads<State = unknown, Dispatch extends ReduxDispatch = ThunkDispatch<State, unknown, AnyAction>> = AddListenerOverloads<boolean, State, Dispatch>;
export declare type RemoveListenerOverloads<State = unknown, Dispatch extends ReduxDispatch = ThunkDispatch<State, unknown, AnyAction>> = AddListenerOverloads<boolean, State, Dispatch, any, UnsubscribeListenerOptions>;
/** @public */

@@ -286,7 +292,7 @@ export interface RemoveListenerAction<Action extends AnyAction, State, Dispatch extends ReduxDispatch<AnyAction>> {

* A "pre-typed" version of `removeListenerAction`, so the listener args are well-typed */
export declare type TypedRemoveListener<State, Dispatch extends ReduxDispatch<AnyAction> = ThunkDispatch<State, unknown, AnyAction>, Payload = ListenerEntry<State, Dispatch>, T extends string = 'listenerMiddleware/remove'> = BaseActionCreator<Payload, T> & AddListenerOverloads<PayloadAction<Payload, T>, State, Dispatch>;
export declare type TypedRemoveListener<State, Dispatch extends ReduxDispatch<AnyAction> = ThunkDispatch<State, unknown, AnyAction>, Payload = ListenerEntry<State, Dispatch>, T extends string = 'listenerMiddleware/remove'> = BaseActionCreator<Payload, T> & AddListenerOverloads<PayloadAction<Payload, T>, State, Dispatch, any, UnsubscribeListenerOptions>;
/**
* @public
* A "pre-typed" version of `middleware.startListening`, so the listener args are well-typed */
export declare type TypedStartListening<State, Dispatch extends ReduxDispatch<AnyAction> = ThunkDispatch<State, unknown, AnyAction>, ExtraArgument = unknown> = AddListenerOverloads<Unsubscribe, State, Dispatch, ExtraArgument>;
export declare type TypedStartListening<State, Dispatch extends ReduxDispatch<AnyAction> = ThunkDispatch<State, unknown, AnyAction>, ExtraArgument = unknown> = AddListenerOverloads<UnsubscribeListener, State, Dispatch, ExtraArgument>;
/** @public

@@ -326,6 +332,4 @@ * A "pre-typed" version of `middleware.stopListening`, so the listener args are well-typed */

/** @public */
export declare type Unsubscribe = () => void;
/** @public */
export declare type GuardedType<T> = T extends (x: any, ...args: unknown[]) => x is infer T ? T : never;
/** @public */
export declare type ListenerPredicateGuardedActionType<T> = T extends ListenerPredicate<infer Action, any> ? Action : never;

@@ -1,2 +0,2 @@

var e,n=this&&this.__extends||(e=function(n,t){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var t in n)Object.prototype.hasOwnProperty.call(n,t)&&(e[t]=n[t])},e(n,t)},function(n,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=n}e(n,t),n.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),t=this&&this.__generator||function(e,n){var t,r,i,u,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return u={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(u[Symbol.iterator]=function(){return this}),u;function a(u){return function(a){return function(u){if(t)throw new TypeError("Generator is already executing.");for(;o;)try{if(t=1,r&&(i=2&u[0]?r.return:u[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,u[1])).done)return i;switch(r=0,i&&(u=[2&u[0],i.value]),u[0]){case 0:case 1:i=u;break;case 4:return o.label++,{value:u[1],done:!1};case 5:o.label++,r=u[1],u=[0];continue;case 7:u=o.ops.pop(),o.trys.pop();continue;default:if(!((i=(i=o.trys).length>0&&i[i.length-1])||6!==u[0]&&2!==u[0])){o=0;continue}if(3===u[0]&&(!i||u[1]>i[0]&&u[1]<i[3])){o.label=u[1];break}if(6===u[0]&&o.label<i[1]){o.label=i[1],i=u;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(u);break}i[2]&&o.ops.pop(),o.trys.pop();continue}u=n.call(e,o)}catch(e){u=[6,e],r=0}finally{t=i=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([u,a])}}},r=this&&this.__spreadArray||function(e,n){for(var t=0,r=n.length,i=e.length;t<r;t++,i++)e[i]=n[t];return e},i=Object.create,u=Object.defineProperty,o=Object.defineProperties,a=Object.getOwnPropertyDescriptor,c=Object.getOwnPropertyDescriptors,f=Object.getOwnPropertyNames,l=Object.getOwnPropertySymbols,s=Object.getPrototypeOf,d=Object.prototype.hasOwnProperty,p=Object.prototype.propertyIsEnumerable,v=function(e,n,t){return n in e?u(e,n,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[n]=t},h=function(e,n){for(var t in n||(n={}))d.call(n,t)&&v(e,t,n[t]);if(l)for(var r=0,i=l(n);r<i.length;r++)p.call(n,t=i[r])&&v(e,t,n[t]);return e},y=function(e,n){return o(e,c(n))},g=function(e){return u(e,"__esModule",{value:!0})},b=function(e,n,t){if(n&&"object"==typeof n||"function"==typeof n)for(var r=function(r){d.call(e,r)||"default"===r||u(e,r,{get:function(){return n[r]},enumerable:!(t=a(n,r))||t.enumerable})},i=0,o=f(n);i<o.length;i++)r(o[i]);return e},m=function(e){return b(g(u(null!=e?i(s(e)):{},"default",e&&e.__esModule&&"default"in e?{get:function(){return e.default},enumerable:!0}:{value:e,enumerable:!0})),e)},w=function(e,n,t){return new Promise((function(r,i){var u=function(e){try{a(t.next(e))}catch(e){i(e)}},o=function(e){try{a(t.throw(e))}catch(e){i(e)}},a=function(e){return e.done?r(e.value):Promise.resolve(e.value).then(u,o)};a((t=t.apply(e,n)).next())}))};g(exports),function(e,n){for(var t in n)u(e,t,{get:n[t],enumerable:!0})}(exports,{MiddlewareArray:function(){return k},TaskAbortError:function(){return je},addListener:function(){return ke},configureStore:function(){return z},createAction:function(){return N},createAsyncThunk:function(){return ue},createDraftSafeSelector:function(){return P},createEntityAdapter:function(){return $},createImmutableStateInvariantMiddleware:function(){return C},createListenerMiddleware:function(){return Le},createNextState:function(){return j.default},createReducer:function(){return G},createSelector:function(){return E.createSelector},createSerializableStateInvariantMiddleware:function(){return R},createSlice:function(){return F},current:function(){return j.current},findNonSerializableValue:function(){return L},freeze:function(){return j.freeze},getDefaultMiddleware:function(){return V},getType:function(){return X},isAllOf:function(){return fe},isAnyOf:function(){return ce},isAsyncThunkAction:function(){return ye},isDraft:function(){return j.isDraft},isFulfilled:function(){return he},isImmutableDefault:function(){return T},isPending:function(){return de},isPlain:function(){return D},isPlainObject:function(){return M},isRejected:function(){return pe},isRejectedWithValue:function(){return ve},miniSerializeError:function(){return ie},nanoid:function(){return ee},original:function(){return j.original},removeAllListeners:function(){return Te},removeListener:function(){return Ce},unwrapResult:function(){return oe}});var O=m(require("immer"));b(exports,m(require("redux")));var j=m(require("immer")),E=m(require("reselect")),S=m(require("immer")),A=m(require("reselect")),P=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var t=A.createSelector.apply(void 0,e),i=function(e){for(var n=[],i=1;i<arguments.length;i++)n[i-1]=arguments[i];return t.apply(void 0,r([(0,S.isDraft)(e)?(0,S.current)(e):e],n))};return i},_=m(require("redux")),x=m(require("redux")),I="undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(0!==arguments.length)return"object"==typeof arguments[0]?x.compose:x.compose.apply(null,arguments)};function M(e){if("object"!=typeof e||null===e)return!1;var n=Object.getPrototypeOf(e);if(null===n)return!0;for(var t=n;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return n===t}"undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION__&&window;var q=m(require("redux-thunk")),k=function(e){function t(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var i=e.apply(this,n)||this;return Object.setPrototypeOf(i,t.prototype),i}return n(t,e),Object.defineProperty(t,Symbol.species,{get:function(){return t},enumerable:!1,configurable:!0}),t.prototype.concat=function(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];return e.prototype.concat.apply(this,n)},t.prototype.prepend=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return 1===e.length&&Array.isArray(e[0])?new(t.bind.apply(t,r([void 0],e[0].concat(this)))):new(t.bind.apply(t,r([void 0],e.concat(this))))},t}(Array);function T(e){return"object"!=typeof e||null==e||Object.isFrozen(e)}function C(e){return void 0===e&&(e={}),function(){return function(e){return function(n){return e(n)}}}}function D(e){var n=typeof e;return"undefined"===n||null===e||"string"===n||"boolean"===n||"number"===n||Array.isArray(e)||M(e)}function L(e,n,t,r,i){var u;if(void 0===n&&(n=""),void 0===t&&(t=D),void 0===i&&(i=[]),!t(e))return{keyPath:n||"<root>",value:e};if("object"!=typeof e||null===e)return!1;for(var o=null!=r?r(e):Object.entries(e),a=i.length>0,c=0,f=o;c<f.length;c++){var l=f[c],s=l[0],d=l[1],p=n?n+"."+s:s;if(!(a&&i.indexOf(p)>=0)){if(!t(d))return{keyPath:p,value:d};if("object"==typeof d&&(u=L(d,p,t,r,i)))return u}}return!1}function R(e){return void 0===e&&(e={}),function(){return function(e){return function(n){return e(n)}}}}function V(e){void 0===e&&(e={});var n=e.thunk,t=void 0===n||n,r=new k;return t&&r.push("boolean"==typeof t?q.default:q.default.withExtraArgument(t.extraArgument)),r}function z(e){var n,t=function(e){return V(e)},i=e||{},u=i.reducer,o=void 0===u?void 0:u,a=i.middleware,c=void 0===a?t():a,f=i.devTools,l=void 0===f||f,s=i.preloadedState,d=void 0===s?void 0:s,p=i.enhancers,v=void 0===p?void 0:p;if("function"==typeof o)n=o;else{if(!M(o))throw new Error('"reducer" is a required argument, and must be a function or an object of functions that can be passed to combineReducers');n=(0,_.combineReducers)(o)}var y=c;"function"==typeof y&&(y=y(t));var g=_.applyMiddleware.apply(void 0,y),b=_.compose;l&&(b=I(h({trace:!1},"object"==typeof l&&l)));var m=[g];Array.isArray(v)?m=r([g],v):"function"==typeof v&&(m=v(m));var w=b.apply(void 0,m);return(0,_.createStore)(n,d,w)}function N(e,n){function t(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];if(n){var i=n.apply(void 0,t);if(!i)throw new Error("prepareAction did not return an object");return h(h({type:e,payload:i.payload},"meta"in i&&{meta:i.meta}),"error"in i&&{error:i.error})}return{type:e,payload:t[0]}}return t.toString=function(){return""+e},t.type=e,t.match=function(n){return n.type===e},t}function W(e){return["type","payload","error","meta"].indexOf(e)>-1}function X(e){return""+e}var B=m(require("immer"));function U(e){var n,t={},r=[],i={addCase:function(e,n){var r="string"==typeof e?e:e.type;if(r in t)throw new Error("addCase cannot be called with two reducers for the same action type");return t[r]=n,i},addMatcher:function(e,n){return r.push({matcher:e,reducer:n}),i},addDefaultCase:function(e){return n=e,i}};return e(i),[t,r,n]}function G(e,n,t,i){void 0===t&&(t=[]);var u,o="function"==typeof n?U(n):[n,t,i],a=o[0],c=o[1],f=o[2];if("function"==typeof e)u=function(){return(0,B.default)(e(),(function(){}))};else{var l=(0,B.default)(e,(function(){}));u=function(){return l}}function s(e,n){void 0===e&&(e=u());var t=r([a[n.type]],c.filter((function(e){return(0,e.matcher)(n)})).map((function(e){return e.reducer})));return 0===t.filter((function(e){return!!e})).length&&(t=[f]),t.reduce((function(e,t){if(t){var r;if((0,B.isDraft)(e))return void 0===(r=t(e,n))?e:r;if((0,B.isDraftable)(e))return(0,B.default)(e,(function(e){return t(e,n)}));if(void 0===(r=t(e,n))){if(null===e)return e;throw Error("A case reducer on a non-draftable value must not return undefined")}return r}return e}),e)}return s.getInitialState=u,s}function F(e){var n=e.name;if(!n)throw new Error("`name` is a required option for createSlice");var t,r="function"==typeof e.initialState?e.initialState:(0,j.default)(e.initialState,(function(){})),i=e.reducers||{},u=Object.keys(i),o={},a={},c={};function f(){var n="function"==typeof e.extraReducers?U(e.extraReducers):[e.extraReducers],t=n[0],i=n[1],u=void 0===i?[]:i,o=n[2],c=void 0===o?void 0:o,f=h(h({},void 0===t?{}:t),a);return G(r,f,u,c)}return u.forEach((function(e){var t,r,u=i[e],f=n+"/"+e;"reducer"in u?(t=u.reducer,r=u.prepare):t=u,o[e]=t,a[f]=t,c[e]=r?N(f,r):N(f)})),{name:n,reducer:function(e,n){return t||(t=f()),t(e,n)},actions:c,caseReducers:o,getInitialState:function(){return t||(t=f()),t.getInitialState()}}}var H=m(require("immer"));function J(e){return function(n,t){var r=function(n){var r;M(r=t)&&"string"==typeof r.type&&Object.keys(r).every(W)?e(t.payload,n):e(t,n)};return(0,H.isDraft)(n)?(r(n),n):(0,H.default)(n,r)}}function K(e,n){return n(e)}function Q(e){return Array.isArray(e)||(e=Object.values(e)),e}function Y(e,n,t){for(var r=[],i=[],u=0,o=e=Q(e);u<o.length;u++){var a=o[u],c=K(a,n);c in t.entities?i.push({id:c,changes:a}):r.push(a)}return[r,i]}function Z(e){function n(n,t){var r=K(n,e);r in t.entities||(t.ids.push(r),t.entities[r]=n)}function t(e,t){for(var r=0,i=e=Q(e);r<i.length;r++)n(i[r],t)}function r(n,t){var r=K(n,e);r in t.entities||t.ids.push(r),t.entities[r]=n}function i(e,n){var t=!1;e.forEach((function(e){e in n.entities&&(delete n.entities[e],t=!0)})),t&&(n.ids=n.ids.filter((function(e){return e in n.entities})))}function u(n,t){var r={},i={};if(n.forEach((function(e){e.id in t.entities&&(i[e.id]={id:e.id,changes:h(h({},i[e.id]?i[e.id].changes:null),e.changes)})})),(n=Object.values(i)).length>0){var u=n.filter((function(n){return function(n,t,r){var i=Object.assign({},r.entities[t.id],t.changes),u=K(i,e),o=u!==t.id;return o&&(n[t.id]=u,delete r.entities[t.id]),r.entities[u]=i,o}(r,n,t)})).length>0;u&&(t.ids=t.ids.map((function(e){return r[e]||e})))}}function o(n,r){var i=Y(n,e,r),o=i[0];u(i[1],r),t(o,r)}return{removeAll:(a=function(e){Object.assign(e,{ids:[],entities:{}})},c=J((function(e,n){return a(n)})),function(e){return c(e,void 0)}),addOne:J(n),addMany:J(t),setOne:J(r),setMany:J((function(e,n){for(var t=0,i=e=Q(e);t<i.length;t++)r(i[t],n)})),setAll:J((function(e,n){e=Q(e),n.ids=[],n.entities={},t(e,n)})),updateOne:J((function(e,n){return u([e],n)})),updateMany:J(u),upsertOne:J((function(e,n){return o([e],n)})),upsertMany:J(o),removeOne:J((function(e,n){return i([e],n)})),removeMany:J(i)};var a,c}function $(e){void 0===e&&(e={});var n=h({sortComparer:!1,selectId:function(e){return e.id}},e),t=n.selectId,r=n.sortComparer,i={getInitialState:function(e){return void 0===e&&(e={}),Object.assign({ids:[],entities:{}},e)}},u={getSelectors:function(e){var n=function(e){return e.ids},t=function(e){return e.entities},r=P(n,t,(function(e,n){return e.map((function(e){return n[e]}))})),i=function(e,n){return n},u=function(e,n){return e[n]},o=P(n,(function(e){return e.length}));if(!e)return{selectIds:n,selectEntities:t,selectAll:r,selectTotal:o,selectById:P(t,i,u)};var a=P(e,t);return{selectIds:P(e,n),selectEntities:a,selectAll:P(e,r),selectTotal:P(e,o),selectById:P(a,i,u)}}},o=r?function(e,n){var t=Z(e);function r(n,t){var r=(n=Q(n)).filter((function(n){return!(K(n,e)in t.entities)}));0!==r.length&&a(r,t)}function i(e,n){0!==(e=Q(e)).length&&a(e,n)}function u(n,t){var r=[];n.forEach((function(n){return function(n,t,r){if(!(t.id in r.entities))return!1;var i=Object.assign({},r.entities[t.id],t.changes),u=K(i,e);return delete r.entities[t.id],n.push(i),u!==t.id}(r,n,t)})),0!==r.length&&a(r,t)}function o(n,t){var i=Y(n,e,t),o=i[0];u(i[1],t),r(o,t)}function a(t,r){t.forEach((function(n){r.entities[e(n)]=n}));var i=Object.values(r.entities);i.sort(n);var u=i.map(e);(function(e,n){if(e.length!==n.length)return!1;for(var t=0;t<e.length&&t<n.length;t++)if(e[t]!==n[t])return!1;return!0})(r.ids,u)||(r.ids=u)}return{removeOne:t.removeOne,removeMany:t.removeMany,removeAll:t.removeAll,addOne:J((function(e,n){return r([e],n)})),updateOne:J((function(e,n){return u([e],n)})),upsertOne:J((function(e,n){return o([e],n)})),setOne:J((function(e,n){return i([e],n)})),setMany:J(i),setAll:J((function(e,n){e=Q(e),n.entities={},n.ids=[],r(e,n)})),addMany:J(r),updateMany:J(u),upsertMany:J(o)}}(t,r):Z(t);return h(h(h({selectId:t,sortComparer:r},i),u),o)}var ee=function(e){void 0===e&&(e=21);for(var n="",t=e;t--;)n+="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW"[64*Math.random()|0];return n},ne=["name","message","stack","code"],te=function(e,n){this.payload=e,this.meta=n},re=function(e,n){this.payload=e,this.meta=n},ie=function(e){if("object"==typeof e&&null!==e){for(var n={},t=0,r=ne;t<r.length;t++){var i=r[t];"string"==typeof e[i]&&(n[i]=e[i])}return n}return{message:String(e)}};function ue(e,n,r){var i=N(e+"/fulfilled",(function(e,n,t,r){return{payload:e,meta:y(h({},r||{}),{arg:t,requestId:n,requestStatus:"fulfilled"})}})),u=N(e+"/pending",(function(e,n,t){return{payload:void 0,meta:y(h({},t||{}),{arg:n,requestId:e,requestStatus:"pending"})}})),o=N(e+"/rejected",(function(e,n,t,i,u){return{payload:i,error:(r&&r.serializeError||ie)(e||"Rejected"),meta:y(h({},u||{}),{arg:t,requestId:n,rejectedWithValue:!!i,requestStatus:"rejected",aborted:"AbortError"===(null==e?void 0:e.name),condition:"ConditionError"===(null==e?void 0:e.name)})}})),a="undefined"!=typeof AbortController?AbortController:function(){function e(){this.signal={aborted:!1,addEventListener:function(){},dispatchEvent:function(){return!1},onabort:function(){},removeEventListener:function(){}}}return e.prototype.abort=function(){},e}();return Object.assign((function(e){return function(c,f,l){var s,d=(null==r?void 0:r.idGenerator)?r.idGenerator(e):ee(),p=new a,v=new Promise((function(e,n){return p.signal.addEventListener("abort",(function(){return n({name:"AbortError",message:s||"Aborted"})}))})),h=!1,y=function(){return w(this,null,(function(){var a,s,y,g,b;return t(this,(function(t){switch(t.label){case 0:return t.trys.push([0,4,,5]),null===(m=g=null==(a=null==r?void 0:r.condition)?void 0:a.call(r,e,{getState:f,extra:l}))||"object"!=typeof m||"function"!=typeof m.then?[3,2]:[4,g];case 1:g=t.sent(),t.label=2;case 2:if(!1===g)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};return h=!0,c(u(d,e,null==(s=null==r?void 0:r.getPendingMeta)?void 0:s.call(r,{requestId:d,arg:e},{getState:f,extra:l}))),[4,Promise.race([v,Promise.resolve(n(e,{dispatch:c,getState:f,extra:l,requestId:d,signal:p.signal,rejectWithValue:function(e,n){return new te(e,n)},fulfillWithValue:function(e,n){return new re(e,n)}})).then((function(n){if(n instanceof te)throw n;return n instanceof re?i(n.payload,d,e,n.meta):i(n,d,e)}))])];case 3:return y=t.sent(),[3,5];case 4:return b=t.sent(),y=b instanceof te?o(null,d,e,b.payload,b.meta):o(b,d,e),[3,5];case 5:return r&&!r.dispatchConditionRejection&&o.match(y)&&y.meta.condition||c(y),[2,y]}var m}))}))}();return Object.assign(y,{abort:function(e){h&&(s=e,p.abort())},requestId:d,arg:e,unwrap:function(){return y.then(oe)}})}}),{pending:u,rejected:o,fulfilled:i,typePrefix:e})}function oe(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}var ae=function(e,n){return(t=e)&&"function"==typeof t.match?e.match(n):e(n);var t};function ce(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return function(n){return e.some((function(e){return ae(e,n)}))}}function fe(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return function(n){return e.every((function(e){return ae(e,n)}))}}function le(e,n){if(!e||!e.meta)return!1;var t="string"==typeof e.meta.requestId,r=n.indexOf(e.meta.requestStatus)>-1;return t&&r}function se(e){return"function"==typeof e[0]&&"pending"in e[0]&&"fulfilled"in e[0]&&"rejected"in e[0]}function de(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return 0===e.length?function(e){return le(e,["pending"])}:se(e)?function(n){var t=e.map((function(e){return e.pending}));return ce.apply(void 0,t)(n)}:de()(e[0])}function pe(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return 0===e.length?function(e){return le(e,["rejected"])}:se(e)?function(n){var t=e.map((function(e){return e.rejected}));return ce.apply(void 0,t)(n)}:pe()(e[0])}function ve(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var t=function(e){return e&&e.meta&&e.meta.rejectedWithValue};return 0===e.length||se(e)?function(n){return fe(pe.apply(void 0,e),t)(n)}:ve()(e[0])}function he(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return 0===e.length?function(e){return le(e,["fulfilled"])}:se(e)?function(n){var t=e.map((function(e){return e.fulfilled}));return ce.apply(void 0,t)(n)}:he()(e[0])}function ye(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return 0===e.length?function(e){return le(e,["pending","fulfilled","rejected"])}:se(e)?function(n){for(var t=[],r=0,i=e;r<i.length;r++){var u=i[r];t.push(u.pending,u.rejected,u.fulfilled)}return ce.apply(void 0,t)(n)}:ye()(e[0])}var ge=function(e,n){if("function"!=typeof e)throw new TypeError(n+" is not a function")},be=function(){},me=function(e,n){return void 0===n&&(n=be),e.catch(n),e},we=function(e,n){e.addEventListener("abort",n,{once:!0})},Oe=function(e,n){var t=e.signal;t.aborted||("reason"in t||Object.defineProperty(t,"reason",{enumerable:!0,value:n,configurable:!0,writable:!0}),e.abort(n))},je=function(e){this.code=e,this.name="TaskAbortError",this.message="task cancelled (reason: "+e+")"},Ee=function(e){if(e.aborted)throw new je(e.reason)},Se=function(e){return me(new Promise((function(n,t){var r=function(){return t(new je(e.reason))};e.aborted?r():we(e,r)})))},Ae=function(e){return function(n){return me(Promise.race([Se(e),n]).then((function(n){return Ee(e),n})))}},Pe=function(e){var n=Ae(e);return function(e){return n(new Promise((function(n){return setTimeout(n,e)})))}},_e=Object.assign,xe={},Ie="listenerMiddleware",Me=function(e){var n=e.type,t=e.actionCreator,r=e.matcher,i=e.predicate,u=e.effect;if(n)i=N(n).match;else if(t)n=t.type,i=t.match;else if(r)i=r;else if(!i)throw new Error("Creating or removing a listener requires one of the known fields for matching an action");return ge(u,"options.listener"),{predicate:i,type:n,effect:u}},qe=function(e,n,t){try{e(n,t)}catch(e){setTimeout((function(){throw e}),0)}},ke=N(Ie+"/add"),Te=N(Ie+"/removeAll"),Ce=N(Ie+"/remove"),De=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];console.error.apply(console,r([Ie+"/error"],e))};function Le(e){var n=this;void 0===e&&(e={});var r=new Map,i=e.extra,u=e.onError,o=void 0===u?De:u;ge(o,"onError");var a=function(e){for(var n=0,t=r.values();n<t.length;n++){var i=t[n];if(e(i))return i}},c=function(e){var n=a((function(n){return n.effect===e.effect}));return n||(n=function(e){var n=Me(e),t=n.type,r=n.predicate,i=n.effect;return{id:ee(),effect:i,type:t,predicate:r,pending:new Set,unsubscribe:function(){throw new Error("Unsubscribe not initialized")}}}(e)),function(e){return e.unsubscribe=function(){return r.delete(e.id)},r.set(e.id,e),e.unsubscribe}(n)},f=function(e){var n=Me(e),t=n.type,r=n.effect,i=n.predicate,u=a((function(e){return("string"==typeof t?e.type===t:e.predicate===i)&&e.effect===r}));return null==u||u.unsubscribe(),!!u},l=function(e,u,a,f){return w(n,null,(function(){var n,l,s;return t(this,(function(d){switch(d.label){case 0:n=new AbortController,l=function(e,n){return function(r,i){return me(function(r,i){return w(void 0,null,(function(){var u,o,a,c;return t(this,(function(t){switch(t.label){case 0:Ee(n),u=function(){},o=new Promise((function(n){u=e({predicate:r,effect:function(e,t){t.unsubscribe(),n([e,t.getState(),t.getOriginalState()])}})})),a=[Se(n),o],null!=i&&a.push(new Promise((function(e){return setTimeout(e,i,null)}))),t.label=1;case 1:return t.trys.push([1,,3,4]),[4,Promise.race(a)];case 2:return c=t.sent(),Ee(n),[2,c];case 3:return u(),[7];case 4:return[2]}}))}))}(r,i))}}(c,n.signal),d.label=1;case 1:return d.trys.push([1,3,4,5]),e.pending.add(n),[4,Promise.resolve(e.effect(u,_e({},a,{getOriginalState:f,condition:function(e,n){return l(e,n).then(Boolean)},take:l,delay:Pe(n.signal),pause:Ae(n.signal),extra:i,signal:n.signal,fork:(p=n.signal,function(e){ge(e,"taskExecutor");var n,r=new AbortController;n=r,we(p,(function(){return Oe(n,p.reason)}));var i,u,o=(i=function(){return w(void 0,null,(function(){var n;return t(this,(function(t){switch(t.label){case 0:return Ee(p),Ee(r.signal),[4,e({pause:Ae(r.signal),delay:Pe(r.signal),signal:r.signal})];case 1:return n=t.sent(),Ee(r.signal),[2,n]}}))}))},u=function(){return Oe(r,"task-completed")},w(void 0,null,(function(){var e;return t(this,(function(n){switch(n.label){case 0:return n.trys.push([0,3,4,5]),[4,Promise.resolve()];case 1:return n.sent(),[4,i()];case 2:return[2,{status:"ok",value:n.sent()}];case 3:return[2,{status:(e=n.sent())instanceof je?"cancelled":"rejected",error:e}];case 4:return null==u||u(),[7];case 5:return[2]}}))})));return{result:Ae(p)(o),cancel:function(){Oe(r,"task-cancelled")}}}),unsubscribe:e.unsubscribe,subscribe:function(){r.set(e.id,e)},cancelActiveListeners:function(){e.pending.forEach((function(e,t,r){e!==n&&(Oe(e,"listener-cancelled"),r.delete(e))}))}})))];case 2:return d.sent(),[3,5];case 3:return(s=d.sent())instanceof je||qe(o,s,{raisedBy:"effect"}),[3,5];case 4:return Oe(n,"listener-completed"),e.pending.delete(n),[7];case 5:return[2]}var p}))}))},s=function(e){return function(){e.forEach((function(e){e.pending.forEach((function(e){Oe(e,"listener-cancelled")}))})),e.clear()}}(r);return{middleware:function(e){return function(n){return function(t){if(ke.match(t))return c(t.payload);if(!Te.match(t)){if(Ce.match(t))return f(t.payload);var i,u=e.getState(),a=function(){if(u===xe)throw new Error(Ie+": getOriginalState can only be called synchronously");return u};try{if(i=n(t),r.size>0)for(var d=e.getState(),p=Array.from(r.values()),v=0,h=p;v<h.length;v++){var y=h[v],g=!1;try{g=y.predicate(t,d,u)}catch(e){g=!1,qe(o,e,{raisedBy:"predicate"})}g&&l(y,t,e,a)}}finally{u=xe}return i}s()}}},startListening:c,stopListening:f,clearListeners:s}}(0,O.enableES5)();
var e,n=this&&this.__extends||(e=function(n,t){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var t in n)Object.prototype.hasOwnProperty.call(n,t)&&(e[t]=n[t])},e(n,t)},function(n,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=n}e(n,t),n.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),t=this&&this.__generator||function(e,n){var t,r,i,u,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return u={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(u[Symbol.iterator]=function(){return this}),u;function a(u){return function(a){return function(u){if(t)throw new TypeError("Generator is already executing.");for(;o;)try{if(t=1,r&&(i=2&u[0]?r.return:u[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,u[1])).done)return i;switch(r=0,i&&(u=[2&u[0],i.value]),u[0]){case 0:case 1:i=u;break;case 4:return o.label++,{value:u[1],done:!1};case 5:o.label++,r=u[1],u=[0];continue;case 7:u=o.ops.pop(),o.trys.pop();continue;default:if(!((i=(i=o.trys).length>0&&i[i.length-1])||6!==u[0]&&2!==u[0])){o=0;continue}if(3===u[0]&&(!i||u[1]>i[0]&&u[1]<i[3])){o.label=u[1];break}if(6===u[0]&&o.label<i[1]){o.label=i[1],i=u;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(u);break}i[2]&&o.ops.pop(),o.trys.pop();continue}u=n.call(e,o)}catch(e){u=[6,e],r=0}finally{t=i=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([u,a])}}},r=this&&this.__spreadArray||function(e,n){for(var t=0,r=n.length,i=e.length;t<r;t++,i++)e[i]=n[t];return e},i=Object.create,u=Object.defineProperty,o=Object.defineProperties,a=Object.getOwnPropertyDescriptor,c=Object.getOwnPropertyDescriptors,f=Object.getOwnPropertyNames,l=Object.getOwnPropertySymbols,s=Object.getPrototypeOf,d=Object.prototype.hasOwnProperty,p=Object.prototype.propertyIsEnumerable,v=function(e,n,t){return n in e?u(e,n,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[n]=t},h=function(e,n){for(var t in n||(n={}))d.call(n,t)&&v(e,t,n[t]);if(l)for(var r=0,i=l(n);r<i.length;r++)p.call(n,t=i[r])&&v(e,t,n[t]);return e},y=function(e,n){return o(e,c(n))},g=function(e){return u(e,"__esModule",{value:!0})},b=function(e,n,t){if(n&&"object"==typeof n||"function"==typeof n)for(var r=function(r){d.call(e,r)||"default"===r||u(e,r,{get:function(){return n[r]},enumerable:!(t=a(n,r))||t.enumerable})},i=0,o=f(n);i<o.length;i++)r(o[i]);return e},m=function(e){return b(g(u(null!=e?i(s(e)):{},"default",e&&e.__esModule&&"default"in e?{get:function(){return e.default},enumerable:!0}:{value:e,enumerable:!0})),e)},w=function(e,n,t){return new Promise((function(r,i){var u=function(e){try{a(t.next(e))}catch(e){i(e)}},o=function(e){try{a(t.throw(e))}catch(e){i(e)}},a=function(e){return e.done?r(e.value):Promise.resolve(e.value).then(u,o)};a((t=t.apply(e,n)).next())}))};g(exports),function(e,n){for(var t in n)u(e,t,{get:n[t],enumerable:!0})}(exports,{MiddlewareArray:function(){return k},TaskAbortError:function(){return je},addListener:function(){return ke},clearAllListeners:function(){return Te},configureStore:function(){return z},createAction:function(){return N},createAsyncThunk:function(){return ue},createDraftSafeSelector:function(){return P},createEntityAdapter:function(){return $},createImmutableStateInvariantMiddleware:function(){return C},createListenerMiddleware:function(){return Re},createNextState:function(){return j.default},createReducer:function(){return G},createSelector:function(){return E.createSelector},createSerializableStateInvariantMiddleware:function(){return R},createSlice:function(){return F},current:function(){return j.current},findNonSerializableValue:function(){return L},freeze:function(){return j.freeze},getDefaultMiddleware:function(){return V},getType:function(){return X},isAllOf:function(){return fe},isAnyOf:function(){return ce},isAsyncThunkAction:function(){return ye},isDraft:function(){return j.isDraft},isFulfilled:function(){return he},isImmutableDefault:function(){return T},isPending:function(){return de},isPlain:function(){return D},isPlainObject:function(){return M},isRejected:function(){return pe},isRejectedWithValue:function(){return ve},miniSerializeError:function(){return ie},nanoid:function(){return ee},original:function(){return j.original},removeListener:function(){return Ce},unwrapResult:function(){return oe}});var O=m(require("immer"));b(exports,m(require("redux")));var j=m(require("immer")),E=m(require("reselect")),S=m(require("immer")),A=m(require("reselect")),P=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var t=A.createSelector.apply(void 0,e),i=function(e){for(var n=[],i=1;i<arguments.length;i++)n[i-1]=arguments[i];return t.apply(void 0,r([(0,S.isDraft)(e)?(0,S.current)(e):e],n))};return i},_=m(require("redux")),x=m(require("redux")),I="undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(0!==arguments.length)return"object"==typeof arguments[0]?x.compose:x.compose.apply(null,arguments)};function M(e){if("object"!=typeof e||null===e)return!1;var n=Object.getPrototypeOf(e);if(null===n)return!0;for(var t=n;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return n===t}"undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION__&&window;var q=m(require("redux-thunk")),k=function(e){function t(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var i=e.apply(this,n)||this;return Object.setPrototypeOf(i,t.prototype),i}return n(t,e),Object.defineProperty(t,Symbol.species,{get:function(){return t},enumerable:!1,configurable:!0}),t.prototype.concat=function(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];return e.prototype.concat.apply(this,n)},t.prototype.prepend=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return 1===e.length&&Array.isArray(e[0])?new(t.bind.apply(t,r([void 0],e[0].concat(this)))):new(t.bind.apply(t,r([void 0],e.concat(this))))},t}(Array);function T(e){return"object"!=typeof e||null==e||Object.isFrozen(e)}function C(e){return void 0===e&&(e={}),function(){return function(e){return function(n){return e(n)}}}}function D(e){var n=typeof e;return"undefined"===n||null===e||"string"===n||"boolean"===n||"number"===n||Array.isArray(e)||M(e)}function L(e,n,t,r,i){var u;if(void 0===n&&(n=""),void 0===t&&(t=D),void 0===i&&(i=[]),!t(e))return{keyPath:n||"<root>",value:e};if("object"!=typeof e||null===e)return!1;for(var o=null!=r?r(e):Object.entries(e),a=i.length>0,c=0,f=o;c<f.length;c++){var l=f[c],s=l[0],d=l[1],p=n?n+"."+s:s;if(!(a&&i.indexOf(p)>=0)){if(!t(d))return{keyPath:p,value:d};if("object"==typeof d&&(u=L(d,p,t,r,i)))return u}}return!1}function R(e){return void 0===e&&(e={}),function(){return function(e){return function(n){return e(n)}}}}function V(e){void 0===e&&(e={});var n=e.thunk,t=void 0===n||n,r=new k;return t&&r.push("boolean"==typeof t?q.default:q.default.withExtraArgument(t.extraArgument)),r}function z(e){var n,t=function(e){return V(e)},i=e||{},u=i.reducer,o=void 0===u?void 0:u,a=i.middleware,c=void 0===a?t():a,f=i.devTools,l=void 0===f||f,s=i.preloadedState,d=void 0===s?void 0:s,p=i.enhancers,v=void 0===p?void 0:p;if("function"==typeof o)n=o;else{if(!M(o))throw new Error('"reducer" is a required argument, and must be a function or an object of functions that can be passed to combineReducers');n=(0,_.combineReducers)(o)}var y=c;"function"==typeof y&&(y=y(t));var g=_.applyMiddleware.apply(void 0,y),b=_.compose;l&&(b=I(h({trace:!1},"object"==typeof l&&l)));var m=[g];Array.isArray(v)?m=r([g],v):"function"==typeof v&&(m=v(m));var w=b.apply(void 0,m);return(0,_.createStore)(n,d,w)}function N(e,n){function t(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];if(n){var i=n.apply(void 0,t);if(!i)throw new Error("prepareAction did not return an object");return h(h({type:e,payload:i.payload},"meta"in i&&{meta:i.meta}),"error"in i&&{error:i.error})}return{type:e,payload:t[0]}}return t.toString=function(){return""+e},t.type=e,t.match=function(n){return n.type===e},t}function W(e){return["type","payload","error","meta"].indexOf(e)>-1}function X(e){return""+e}var B=m(require("immer"));function U(e){var n,t={},r=[],i={addCase:function(e,n){var r="string"==typeof e?e:e.type;if(r in t)throw new Error("addCase cannot be called with two reducers for the same action type");return t[r]=n,i},addMatcher:function(e,n){return r.push({matcher:e,reducer:n}),i},addDefaultCase:function(e){return n=e,i}};return e(i),[t,r,n]}function G(e,n,t,i){void 0===t&&(t=[]);var u,o="function"==typeof n?U(n):[n,t,i],a=o[0],c=o[1],f=o[2];if("function"==typeof e)u=function(){return(0,B.default)(e(),(function(){}))};else{var l=(0,B.default)(e,(function(){}));u=function(){return l}}function s(e,n){void 0===e&&(e=u());var t=r([a[n.type]],c.filter((function(e){return(0,e.matcher)(n)})).map((function(e){return e.reducer})));return 0===t.filter((function(e){return!!e})).length&&(t=[f]),t.reduce((function(e,t){if(t){var r;if((0,B.isDraft)(e))return void 0===(r=t(e,n))?e:r;if((0,B.isDraftable)(e))return(0,B.default)(e,(function(e){return t(e,n)}));if(void 0===(r=t(e,n))){if(null===e)return e;throw Error("A case reducer on a non-draftable value must not return undefined")}return r}return e}),e)}return s.getInitialState=u,s}function F(e){var n=e.name;if(!n)throw new Error("`name` is a required option for createSlice");var t,r="function"==typeof e.initialState?e.initialState:(0,j.default)(e.initialState,(function(){})),i=e.reducers||{},u=Object.keys(i),o={},a={},c={};function f(){var n="function"==typeof e.extraReducers?U(e.extraReducers):[e.extraReducers],t=n[0],i=n[1],u=void 0===i?[]:i,o=n[2],c=void 0===o?void 0:o,f=h(h({},void 0===t?{}:t),a);return G(r,f,u,c)}return u.forEach((function(e){var t,r,u=i[e],f=n+"/"+e;"reducer"in u?(t=u.reducer,r=u.prepare):t=u,o[e]=t,a[f]=t,c[e]=r?N(f,r):N(f)})),{name:n,reducer:function(e,n){return t||(t=f()),t(e,n)},actions:c,caseReducers:o,getInitialState:function(){return t||(t=f()),t.getInitialState()}}}var H=m(require("immer"));function J(e){return function(n,t){var r=function(n){var r;M(r=t)&&"string"==typeof r.type&&Object.keys(r).every(W)?e(t.payload,n):e(t,n)};return(0,H.isDraft)(n)?(r(n),n):(0,H.default)(n,r)}}function K(e,n){return n(e)}function Q(e){return Array.isArray(e)||(e=Object.values(e)),e}function Y(e,n,t){for(var r=[],i=[],u=0,o=e=Q(e);u<o.length;u++){var a=o[u],c=K(a,n);c in t.entities?i.push({id:c,changes:a}):r.push(a)}return[r,i]}function Z(e){function n(n,t){var r=K(n,e);r in t.entities||(t.ids.push(r),t.entities[r]=n)}function t(e,t){for(var r=0,i=e=Q(e);r<i.length;r++)n(i[r],t)}function r(n,t){var r=K(n,e);r in t.entities||t.ids.push(r),t.entities[r]=n}function i(e,n){var t=!1;e.forEach((function(e){e in n.entities&&(delete n.entities[e],t=!0)})),t&&(n.ids=n.ids.filter((function(e){return e in n.entities})))}function u(n,t){var r={},i={};if(n.forEach((function(e){e.id in t.entities&&(i[e.id]={id:e.id,changes:h(h({},i[e.id]?i[e.id].changes:null),e.changes)})})),(n=Object.values(i)).length>0){var u=n.filter((function(n){return function(n,t,r){var i=Object.assign({},r.entities[t.id],t.changes),u=K(i,e),o=u!==t.id;return o&&(n[t.id]=u,delete r.entities[t.id]),r.entities[u]=i,o}(r,n,t)})).length>0;u&&(t.ids=t.ids.map((function(e){return r[e]||e})))}}function o(n,r){var i=Y(n,e,r),o=i[0];u(i[1],r),t(o,r)}return{removeAll:(a=function(e){Object.assign(e,{ids:[],entities:{}})},c=J((function(e,n){return a(n)})),function(e){return c(e,void 0)}),addOne:J(n),addMany:J(t),setOne:J(r),setMany:J((function(e,n){for(var t=0,i=e=Q(e);t<i.length;t++)r(i[t],n)})),setAll:J((function(e,n){e=Q(e),n.ids=[],n.entities={},t(e,n)})),updateOne:J((function(e,n){return u([e],n)})),updateMany:J(u),upsertOne:J((function(e,n){return o([e],n)})),upsertMany:J(o),removeOne:J((function(e,n){return i([e],n)})),removeMany:J(i)};var a,c}function $(e){void 0===e&&(e={});var n=h({sortComparer:!1,selectId:function(e){return e.id}},e),t=n.selectId,r=n.sortComparer,i={getInitialState:function(e){return void 0===e&&(e={}),Object.assign({ids:[],entities:{}},e)}},u={getSelectors:function(e){var n=function(e){return e.ids},t=function(e){return e.entities},r=P(n,t,(function(e,n){return e.map((function(e){return n[e]}))})),i=function(e,n){return n},u=function(e,n){return e[n]},o=P(n,(function(e){return e.length}));if(!e)return{selectIds:n,selectEntities:t,selectAll:r,selectTotal:o,selectById:P(t,i,u)};var a=P(e,t);return{selectIds:P(e,n),selectEntities:a,selectAll:P(e,r),selectTotal:P(e,o),selectById:P(a,i,u)}}},o=r?function(e,n){var t=Z(e);function r(n,t){var r=(n=Q(n)).filter((function(n){return!(K(n,e)in t.entities)}));0!==r.length&&a(r,t)}function i(e,n){0!==(e=Q(e)).length&&a(e,n)}function u(n,t){var r=[];n.forEach((function(n){return function(n,t,r){if(!(t.id in r.entities))return!1;var i=Object.assign({},r.entities[t.id],t.changes),u=K(i,e);return delete r.entities[t.id],n.push(i),u!==t.id}(r,n,t)})),0!==r.length&&a(r,t)}function o(n,t){var i=Y(n,e,t),o=i[0];u(i[1],t),r(o,t)}function a(t,r){t.forEach((function(n){r.entities[e(n)]=n}));var i=Object.values(r.entities);i.sort(n);var u=i.map(e);(function(e,n){if(e.length!==n.length)return!1;for(var t=0;t<e.length&&t<n.length;t++)if(e[t]!==n[t])return!1;return!0})(r.ids,u)||(r.ids=u)}return{removeOne:t.removeOne,removeMany:t.removeMany,removeAll:t.removeAll,addOne:J((function(e,n){return r([e],n)})),updateOne:J((function(e,n){return u([e],n)})),upsertOne:J((function(e,n){return o([e],n)})),setOne:J((function(e,n){return i([e],n)})),setMany:J(i),setAll:J((function(e,n){e=Q(e),n.entities={},n.ids=[],r(e,n)})),addMany:J(r),updateMany:J(u),upsertMany:J(o)}}(t,r):Z(t);return h(h(h({selectId:t,sortComparer:r},i),u),o)}var ee=function(e){void 0===e&&(e=21);for(var n="",t=e;t--;)n+="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW"[64*Math.random()|0];return n},ne=["name","message","stack","code"],te=function(e,n){this.payload=e,this.meta=n},re=function(e,n){this.payload=e,this.meta=n},ie=function(e){if("object"==typeof e&&null!==e){for(var n={},t=0,r=ne;t<r.length;t++){var i=r[t];"string"==typeof e[i]&&(n[i]=e[i])}return n}return{message:String(e)}};function ue(e,n,r){var i=N(e+"/fulfilled",(function(e,n,t,r){return{payload:e,meta:y(h({},r||{}),{arg:t,requestId:n,requestStatus:"fulfilled"})}})),u=N(e+"/pending",(function(e,n,t){return{payload:void 0,meta:y(h({},t||{}),{arg:n,requestId:e,requestStatus:"pending"})}})),o=N(e+"/rejected",(function(e,n,t,i,u){return{payload:i,error:(r&&r.serializeError||ie)(e||"Rejected"),meta:y(h({},u||{}),{arg:t,requestId:n,rejectedWithValue:!!i,requestStatus:"rejected",aborted:"AbortError"===(null==e?void 0:e.name),condition:"ConditionError"===(null==e?void 0:e.name)})}})),a="undefined"!=typeof AbortController?AbortController:function(){function e(){this.signal={aborted:!1,addEventListener:function(){},dispatchEvent:function(){return!1},onabort:function(){},removeEventListener:function(){}}}return e.prototype.abort=function(){},e}();return Object.assign((function(e){return function(c,f,l){var s,d=(null==r?void 0:r.idGenerator)?r.idGenerator(e):ee(),p=new a,v=new Promise((function(e,n){return p.signal.addEventListener("abort",(function(){return n({name:"AbortError",message:s||"Aborted"})}))})),h=!1,y=function(){return w(this,null,(function(){var a,s,y,g,b;return t(this,(function(t){switch(t.label){case 0:return t.trys.push([0,4,,5]),null===(m=g=null==(a=null==r?void 0:r.condition)?void 0:a.call(r,e,{getState:f,extra:l}))||"object"!=typeof m||"function"!=typeof m.then?[3,2]:[4,g];case 1:g=t.sent(),t.label=2;case 2:if(!1===g)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};return h=!0,c(u(d,e,null==(s=null==r?void 0:r.getPendingMeta)?void 0:s.call(r,{requestId:d,arg:e},{getState:f,extra:l}))),[4,Promise.race([v,Promise.resolve(n(e,{dispatch:c,getState:f,extra:l,requestId:d,signal:p.signal,rejectWithValue:function(e,n){return new te(e,n)},fulfillWithValue:function(e,n){return new re(e,n)}})).then((function(n){if(n instanceof te)throw n;return n instanceof re?i(n.payload,d,e,n.meta):i(n,d,e)}))])];case 3:return y=t.sent(),[3,5];case 4:return b=t.sent(),y=b instanceof te?o(null,d,e,b.payload,b.meta):o(b,d,e),[3,5];case 5:return r&&!r.dispatchConditionRejection&&o.match(y)&&y.meta.condition||c(y),[2,y]}var m}))}))}();return Object.assign(y,{abort:function(e){h&&(s=e,p.abort())},requestId:d,arg:e,unwrap:function(){return y.then(oe)}})}}),{pending:u,rejected:o,fulfilled:i,typePrefix:e})}function oe(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}var ae=function(e,n){return(t=e)&&"function"==typeof t.match?e.match(n):e(n);var t};function ce(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return function(n){return e.some((function(e){return ae(e,n)}))}}function fe(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return function(n){return e.every((function(e){return ae(e,n)}))}}function le(e,n){if(!e||!e.meta)return!1;var t="string"==typeof e.meta.requestId,r=n.indexOf(e.meta.requestStatus)>-1;return t&&r}function se(e){return"function"==typeof e[0]&&"pending"in e[0]&&"fulfilled"in e[0]&&"rejected"in e[0]}function de(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return 0===e.length?function(e){return le(e,["pending"])}:se(e)?function(n){var t=e.map((function(e){return e.pending}));return ce.apply(void 0,t)(n)}:de()(e[0])}function pe(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return 0===e.length?function(e){return le(e,["rejected"])}:se(e)?function(n){var t=e.map((function(e){return e.rejected}));return ce.apply(void 0,t)(n)}:pe()(e[0])}function ve(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var t=function(e){return e&&e.meta&&e.meta.rejectedWithValue};return 0===e.length||se(e)?function(n){return fe(pe.apply(void 0,e),t)(n)}:ve()(e[0])}function he(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return 0===e.length?function(e){return le(e,["fulfilled"])}:se(e)?function(n){var t=e.map((function(e){return e.fulfilled}));return ce.apply(void 0,t)(n)}:he()(e[0])}function ye(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return 0===e.length?function(e){return le(e,["pending","fulfilled","rejected"])}:se(e)?function(n){for(var t=[],r=0,i=e;r<i.length;r++){var u=i[r];t.push(u.pending,u.rejected,u.fulfilled)}return ce.apply(void 0,t)(n)}:ye()(e[0])}var ge=function(e,n){if("function"!=typeof e)throw new TypeError(n+" is not a function")},be=function(){},me=function(e,n){return void 0===n&&(n=be),e.catch(n),e},we=function(e,n){e.addEventListener("abort",n,{once:!0})},Oe=function(e,n){var t=e.signal;t.aborted||("reason"in t||Object.defineProperty(t,"reason",{enumerable:!0,value:n,configurable:!0,writable:!0}),e.abort(n))},je=function(e){this.code=e,this.name="TaskAbortError",this.message="task cancelled (reason: "+e+")"},Ee=function(e){if(e.aborted)throw new je(e.reason)},Se=function(e){return me(new Promise((function(n,t){var r=function(){return t(new je(e.reason))};e.aborted?r():we(e,r)})))},Ae=function(e){return function(n){return me(Promise.race([Se(e),n]).then((function(n){return Ee(e),n})))}},Pe=function(e){var n=Ae(e);return function(e){return n(new Promise((function(n){return setTimeout(n,e)})))}},_e=Object.assign,xe={},Ie="listenerMiddleware",Me=function(e){var n=e.type,t=e.actionCreator,r=e.matcher,i=e.predicate,u=e.effect;if(n)i=N(n).match;else if(t)n=t.type,i=t.match;else if(r)i=r;else if(!i)throw new Error("Creating or removing a listener requires one of the known fields for matching an action");return ge(u,"options.listener"),{predicate:i,type:n,effect:u}},qe=function(e,n,t){try{e(n,t)}catch(e){setTimeout((function(){throw e}),0)}},ke=N(Ie+"/add"),Te=N(Ie+"/removeAll"),Ce=N(Ie+"/remove"),De=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];console.error.apply(console,r([Ie+"/error"],e))},Le=function(e){e.pending.forEach((function(e){Oe(e,"listener-cancelled")}))};function Re(e){var n=this;void 0===e&&(e={});var r=new Map,i=e.extra,u=e.onError,o=void 0===u?De:u;ge(o,"onError");var a=function(e){for(var n=0,t=r.values();n<t.length;n++){var i=t[n];if(e(i))return i}},c=function(e){var n=a((function(n){return n.effect===e.effect}));return n||(n=function(e){var n=Me(e),t=n.type,r=n.predicate,i=n.effect;return{id:ee(),effect:i,type:t,predicate:r,pending:new Set,unsubscribe:function(){throw new Error("Unsubscribe not initialized")}}}(e)),function(e){return e.unsubscribe=function(){return r.delete(e.id)},r.set(e.id,e),function(n){e.unsubscribe(),(null==n?void 0:n.cancelActive)&&Le(e)}}(n)},f=function(e){var n=Me(e),t=n.type,r=n.effect,i=n.predicate,u=a((function(e){return("string"==typeof t?e.type===t:e.predicate===i)&&e.effect===r}));return u&&(u.unsubscribe(),e.cancelActive&&Le(u)),!!u},l=function(e,u,a,f){return w(n,null,(function(){var n,l,s;return t(this,(function(d){switch(d.label){case 0:n=new AbortController,l=function(e,n){return function(r,i){return me(function(r,i){return w(void 0,null,(function(){var u,o,a,c;return t(this,(function(t){switch(t.label){case 0:Ee(n),u=function(){},o=new Promise((function(n){u=e({predicate:r,effect:function(e,t){t.unsubscribe(),n([e,t.getState(),t.getOriginalState()])}})})),a=[Se(n),o],null!=i&&a.push(new Promise((function(e){return setTimeout(e,i,null)}))),t.label=1;case 1:return t.trys.push([1,,3,4]),[4,Promise.race(a)];case 2:return c=t.sent(),Ee(n),[2,c];case 3:return u(),[7];case 4:return[2]}}))}))}(r,i))}}(c,n.signal),d.label=1;case 1:return d.trys.push([1,3,4,5]),e.pending.add(n),[4,Promise.resolve(e.effect(u,_e({},a,{getOriginalState:f,condition:function(e,n){return l(e,n).then(Boolean)},take:l,delay:Pe(n.signal),pause:Ae(n.signal),extra:i,signal:n.signal,fork:(p=n.signal,function(e){ge(e,"taskExecutor");var n,r=new AbortController;n=r,we(p,(function(){return Oe(n,p.reason)}));var i,u,o=(i=function(){return w(void 0,null,(function(){var n;return t(this,(function(t){switch(t.label){case 0:return Ee(p),Ee(r.signal),[4,e({pause:Ae(r.signal),delay:Pe(r.signal),signal:r.signal})];case 1:return n=t.sent(),Ee(r.signal),[2,n]}}))}))},u=function(){return Oe(r,"task-completed")},w(void 0,null,(function(){var e;return t(this,(function(n){switch(n.label){case 0:return n.trys.push([0,3,4,5]),[4,Promise.resolve()];case 1:return n.sent(),[4,i()];case 2:return[2,{status:"ok",value:n.sent()}];case 3:return[2,{status:(e=n.sent())instanceof je?"cancelled":"rejected",error:e}];case 4:return null==u||u(),[7];case 5:return[2]}}))})));return{result:Ae(p)(o),cancel:function(){Oe(r,"task-cancelled")}}}),unsubscribe:e.unsubscribe,subscribe:function(){r.set(e.id,e)},cancelActiveListeners:function(){e.pending.forEach((function(e,t,r){e!==n&&(Oe(e,"listener-cancelled"),r.delete(e))}))}})))];case 2:return d.sent(),[3,5];case 3:return(s=d.sent())instanceof je||qe(o,s,{raisedBy:"effect"}),[3,5];case 4:return Oe(n,"listener-completed"),e.pending.delete(n),[7];case 5:return[2]}var p}))}))},s=function(e){return function(){e.forEach(Le),e.clear()}}(r);return{middleware:function(e){return function(n){return function(t){if(ke.match(t))return c(t.payload);if(!Te.match(t)){if(Ce.match(t))return f(t.payload);var i,u=e.getState(),a=function(){if(u===xe)throw new Error(Ie+": getOriginalState can only be called synchronously");return u};try{if(i=n(t),r.size>0)for(var d=e.getState(),p=Array.from(r.values()),v=0,h=p;v<h.length;v++){var y=h[v],g=!1;try{g=y.predicate(t,d,u)}catch(e){g=!1,qe(o,e,{raisedBy:"predicate"})}g&&l(y,t,e,a)}}finally{u=xe}return i}s()}}},startListening:c,stopListening:f,clearListeners:s}}(0,O.enableES5)();
//# sourceMappingURL=redux-toolkit.cjs.production.min.js.map

@@ -269,14 +269,13 @@ var __defProp = Object.defineProperty;

return (storeAPI) => (next) => (action) => {
if (ignoreActions || ignoredActions.length && ignoredActions.indexOf(action.type) !== -1) {
return next(action);
const result = next(action);
const measureUtils = getTimeMeasureUtils(warnAfter, "SerializableStateInvariantMiddleware");
if (!ignoreActions && !(ignoredActions.length && ignoredActions.indexOf(action.type) !== -1)) {
measureUtils.measureTime(() => {
const foundActionNonSerializableValue = findNonSerializableValue(action, "", isSerializable, getEntries, ignoredActionPaths);
if (foundActionNonSerializableValue) {
const { keyPath, value } = foundActionNonSerializableValue;
console.error(`A non-serializable value was detected in an action, in the path: \`${keyPath}\`. Value:`, value, "\nTake a look at the logic that dispatched this action: ", action, "\n(See https://redux.js.org/faq/actions#why-should-type-be-a-string-or-at-least-serializable-why-should-my-action-types-be-constants)", "\n(To allow non-serializable values see: https://redux-toolkit.js.org/usage/usage-guide#working-with-non-serializable-data)");
}
});
}
const measureUtils = getTimeMeasureUtils(warnAfter, "SerializableStateInvariantMiddleware");
measureUtils.measureTime(() => {
const foundActionNonSerializableValue = findNonSerializableValue(action, "", isSerializable, getEntries, ignoredActionPaths);
if (foundActionNonSerializableValue) {
const { keyPath, value } = foundActionNonSerializableValue;
console.error(`A non-serializable value was detected in an action, in the path: \`${keyPath}\`. Value:`, value, "\nTake a look at the logic that dispatched this action: ", action, "\n(See https://redux.js.org/faq/actions#why-should-type-be-a-string-or-at-least-serializable-why-should-my-action-types-be-constants)", "\n(To allow non-serializable values see: https://redux-toolkit.js.org/usage/usage-guide#working-with-non-serializable-data)");
}
});
const result = next(action);
if (!ignoreState) {

@@ -1381,7 +1380,3 @@ measureUtils.measureTime(() => {

return () => {
listenerMap.forEach((entry) => {
entry.pending.forEach((controller) => {
abortControllerWithReason(controller, listenerCancelled);
});
});
listenerMap.forEach(cancelActiveListeners);
listenerMap.clear();

@@ -1401,3 +1396,3 @@ };

var addListener = createAction(`${alm}/add`);
var removeAllListeners = createAction(`${alm}/removeAll`);
var clearAllListeners = createAction(`${alm}/removeAll`);
var removeListener = createAction(`${alm}/remove`);

@@ -1407,2 +1402,7 @@ var defaultErrorHandler = (...args) => {

};
var cancelActiveListeners = (entry) => {
entry.pending.forEach((controller) => {
abortControllerWithReason(controller, listenerCancelled);
});
};
function createListenerMiddleware(middlewareOptions = {}) {

@@ -1415,3 +1415,8 @@ const listenerMap = new Map();

listenerMap.set(entry.id, entry);
return entry.unsubscribe;
return (cancelOptions) => {
entry.unsubscribe();
if (cancelOptions == null ? void 0 : cancelOptions.cancelActive) {
cancelActiveListeners(entry);
}
};
};

@@ -1439,3 +1444,8 @@ const findListenerEntry = (comparator) => {

});
entry == null ? void 0 : entry.unsubscribe();
if (entry) {
entry.unsubscribe();
if (options.cancelActive) {
cancelActiveListeners(entry);
}
}
return !!entry;

@@ -1488,3 +1498,3 @@ };

}
if (removeAllListeners.match(action)) {
if (clearAllListeners.match(action)) {
clearListenerMiddleware();

@@ -1541,3 +1551,3 @@ return;

enableES5();
export { MiddlewareArray, TaskAbortError, addListener, configureStore, createAction, createAsyncThunk, createDraftSafeSelector, createEntityAdapter, createImmutableStateInvariantMiddleware, createListenerMiddleware, default2 as createNextState, createReducer, createSelector2 as createSelector, createSerializableStateInvariantMiddleware, createSlice, current2 as current, findNonSerializableValue, freeze, getDefaultMiddleware, getType, isAllOf, isAnyOf, isAsyncThunkAction, isDraft4 as isDraft, isFulfilled, isImmutableDefault, isPending, isPlain, isPlainObject, isRejected, isRejectedWithValue, miniSerializeError, nanoid, original, removeAllListeners, removeListener, unwrapResult };
export { MiddlewareArray, TaskAbortError, addListener, clearAllListeners, configureStore, createAction, createAsyncThunk, createDraftSafeSelector, createEntityAdapter, createImmutableStateInvariantMiddleware, createListenerMiddleware, default2 as createNextState, createReducer, createSelector2 as createSelector, createSerializableStateInvariantMiddleware, createSlice, current2 as current, findNonSerializableValue, freeze, getDefaultMiddleware, getType, isAllOf, isAnyOf, isAsyncThunkAction, isDraft4 as isDraft, isFulfilled, isImmutableDefault, isPending, isPlain, isPlainObject, isRejected, isRejectedWithValue, miniSerializeError, nanoid, original, removeListener, unwrapResult };
//# sourceMappingURL=redux-toolkit.modern.development.js.map

@@ -269,14 +269,13 @@ var __defProp = Object.defineProperty;

return (storeAPI) => (next) => (action) => {
if (ignoreActions || ignoredActions.length && ignoredActions.indexOf(action.type) !== -1) {
return next(action);
const result = next(action);
const measureUtils = getTimeMeasureUtils(warnAfter, "SerializableStateInvariantMiddleware");
if (!ignoreActions && !(ignoredActions.length && ignoredActions.indexOf(action.type) !== -1)) {
measureUtils.measureTime(() => {
const foundActionNonSerializableValue = findNonSerializableValue(action, "", isSerializable, getEntries, ignoredActionPaths);
if (foundActionNonSerializableValue) {
const { keyPath, value } = foundActionNonSerializableValue;
console.error(`A non-serializable value was detected in an action, in the path: \`${keyPath}\`. Value:`, value, "\nTake a look at the logic that dispatched this action: ", action, "\n(See https://redux.js.org/faq/actions#why-should-type-be-a-string-or-at-least-serializable-why-should-my-action-types-be-constants)", "\n(To allow non-serializable values see: https://redux-toolkit.js.org/usage/usage-guide#working-with-non-serializable-data)");
}
});
}
const measureUtils = getTimeMeasureUtils(warnAfter, "SerializableStateInvariantMiddleware");
measureUtils.measureTime(() => {
const foundActionNonSerializableValue = findNonSerializableValue(action, "", isSerializable, getEntries, ignoredActionPaths);
if (foundActionNonSerializableValue) {
const { keyPath, value } = foundActionNonSerializableValue;
console.error(`A non-serializable value was detected in an action, in the path: \`${keyPath}\`. Value:`, value, "\nTake a look at the logic that dispatched this action: ", action, "\n(See https://redux.js.org/faq/actions#why-should-type-be-a-string-or-at-least-serializable-why-should-my-action-types-be-constants)", "\n(To allow non-serializable values see: https://redux-toolkit.js.org/usage/usage-guide#working-with-non-serializable-data)");
}
});
const result = next(action);
if (!ignoreState) {

@@ -1381,7 +1380,3 @@ measureUtils.measureTime(() => {

return () => {
listenerMap.forEach((entry) => {
entry.pending.forEach((controller) => {
abortControllerWithReason(controller, listenerCancelled);
});
});
listenerMap.forEach(cancelActiveListeners);
listenerMap.clear();

@@ -1401,3 +1396,3 @@ };

var addListener = createAction(`${alm}/add`);
var removeAllListeners = createAction(`${alm}/removeAll`);
var clearAllListeners = createAction(`${alm}/removeAll`);
var removeListener = createAction(`${alm}/remove`);

@@ -1407,2 +1402,7 @@ var defaultErrorHandler = (...args) => {

};
var cancelActiveListeners = (entry) => {
entry.pending.forEach((controller) => {
abortControllerWithReason(controller, listenerCancelled);
});
};
function createListenerMiddleware(middlewareOptions = {}) {

@@ -1415,3 +1415,8 @@ const listenerMap = new Map();

listenerMap.set(entry.id, entry);
return entry.unsubscribe;
return (cancelOptions) => {
entry.unsubscribe();
if (cancelOptions == null ? void 0 : cancelOptions.cancelActive) {
cancelActiveListeners(entry);
}
};
};

@@ -1439,3 +1444,8 @@ const findListenerEntry = (comparator) => {

});
entry == null ? void 0 : entry.unsubscribe();
if (entry) {
entry.unsubscribe();
if (options.cancelActive) {
cancelActiveListeners(entry);
}
}
return !!entry;

@@ -1488,3 +1498,3 @@ };

}
if (removeAllListeners.match(action)) {
if (clearAllListeners.match(action)) {
clearListenerMiddleware();

@@ -1541,3 +1551,3 @@ return;

enableES5();
export { MiddlewareArray, TaskAbortError, addListener, configureStore, createAction, createAsyncThunk, createDraftSafeSelector, createEntityAdapter, createImmutableStateInvariantMiddleware, createListenerMiddleware, default2 as createNextState, createReducer, createSelector2 as createSelector, createSerializableStateInvariantMiddleware, createSlice, current2 as current, findNonSerializableValue, freeze, getDefaultMiddleware, getType, isAllOf, isAnyOf, isAsyncThunkAction, isDraft4 as isDraft, isFulfilled, isImmutableDefault, isPending, isPlain, isPlainObject, isRejected, isRejectedWithValue, miniSerializeError, nanoid, original, removeAllListeners, removeListener, unwrapResult };
export { MiddlewareArray, TaskAbortError, addListener, clearAllListeners, configureStore, createAction, createAsyncThunk, createDraftSafeSelector, createEntityAdapter, createImmutableStateInvariantMiddleware, createListenerMiddleware, default2 as createNextState, createReducer, createSelector2 as createSelector, createSerializableStateInvariantMiddleware, createSlice, current2 as current, findNonSerializableValue, freeze, getDefaultMiddleware, getType, isAllOf, isAnyOf, isAsyncThunkAction, isDraft4 as isDraft, isFulfilled, isImmutableDefault, isPending, isPlain, isPlainObject, isRejected, isRejectedWithValue, miniSerializeError, nanoid, original, removeListener, unwrapResult };
//# sourceMappingURL=redux-toolkit.modern.js.map

@@ -1,2 +0,2 @@

var e=Object.defineProperty,t=Object.defineProperties,n=Object.getOwnPropertyDescriptors,r=Object.getOwnPropertySymbols,o=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable,a=(t,n,r)=>n in t?e(t,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[n]=r,s=(e,t)=>{for(var n in t||(t={}))o.call(t,n)&&a(e,n,t[n]);if(r)for(var n of r(t))i.call(t,n)&&a(e,n,t[n]);return e},c=(e,r)=>t(e,n(r));import{enableES5 as u}from"immer";export*from"redux";import{default as l,current as f,freeze as d,original as p,isDraft as m}from"immer";import{createSelector as y}from"reselect";import{current as h,isDraft as g}from"immer";import{createSelector as b}from"reselect";var w=(...e)=>{const t=b(...e);return(e,...n)=>t(g(e)?h(e):e,...n)};import{createStore as v,compose as O,applyMiddleware as j,combineReducers as E}from"redux";import{compose as S}from"redux";var A="undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(0!==arguments.length)return"object"==typeof arguments[0]?S:S.apply(null,arguments)};function P(e){if("object"!=typeof e||null===e)return!1;let t=Object.getPrototypeOf(e);if(null===t)return!0;let n=t;for(;null!==Object.getPrototypeOf(n);)n=Object.getPrototypeOf(n);return t===n}"undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION__&&window;import x from"redux-thunk";var I=class extends Array{constructor(...e){super(...e),Object.setPrototypeOf(this,I.prototype)}static get[Symbol.species](){return I}concat(...e){return super.concat.apply(this,e)}prepend(...e){return 1===e.length&&Array.isArray(e[0])?new I(...e[0].concat(this)):new I(...e.concat(this))}};function _(e){return"object"!=typeof e||null==e||Object.isFrozen(e)}function k(e={}){return()=>e=>t=>e(t)}function C(e){const t=typeof e;return"undefined"===t||null===e||"string"===t||"boolean"===t||"number"===t||Array.isArray(e)||P(e)}function M(e,t="",n=C,r,o=[]){let i;if(!n(e))return{keyPath:t||"<root>",value:e};if("object"!=typeof e||null===e)return!1;const a=null!=r?r(e):Object.entries(e),s=o.length>0;for(const[e,c]of a){const a=t?t+"."+e:e;if(!(s&&o.indexOf(a)>=0)){if(!n(c))return{keyPath:a,value:c};if("object"==typeof c&&(i=M(c,a,n,r,o),i))return i}}return!1}function q(e={}){return()=>e=>t=>e(t)}function T(e={}){const{thunk:t=!0,immutableCheck:n=!0,serializableCheck:r=!0}=e;let o=new I;return t&&o.push("boolean"==typeof t?x:x.withExtraArgument(t.extraArgument)),o}function D(e){const t=function(e){return T(e)},{reducer:n,middleware:r=t(),devTools:o=!0,preloadedState:i,enhancers:a}=e||{};let c;if("function"==typeof n)c=n;else{if(!P(n))throw new Error('"reducer" is a required argument, and must be a function or an object of functions that can be passed to combineReducers');c=E(n)}let u=r;"function"==typeof u&&(u=u(t));const l=j(...u);let f=O;o&&(f=A(s({trace:!1},"object"==typeof o&&o)));let d=[l];Array.isArray(a)?d=[l,...a]:"function"==typeof a&&(d=a(d));const p=f(...d);return v(c,i,p)}function L(e,t){function n(...n){if(t){let r=t(...n);if(!r)throw new Error("prepareAction did not return an object");return s(s({type:e,payload:r.payload},"meta"in r&&{meta:r.meta}),"error"in r&&{error:r.error})}return{type:e,payload:n[0]}}return n.toString=()=>`${e}`,n.type=e,n.match=t=>t.type===e,n}function R(e){return["type","payload","error","meta"].indexOf(e)>-1}function $(e){return`${e}`}import V,{isDraft as N,isDraftable as X}from"immer";function z(e){const t={},n=[];let r;const o={addCase(e,n){const r="string"==typeof e?e:e.type;if(r in t)throw new Error("addCase cannot be called with two reducers for the same action type");return t[r]=n,o},addMatcher:(e,t)=>(n.push({matcher:e,reducer:t}),o),addDefaultCase:e=>(r=e,o)};return e(o),[t,n,r]}function B(e,t,n=[],r){let o,[i,a,s]="function"==typeof t?z(t):[t,n,r];if("function"==typeof e)o=()=>V(e(),(()=>{}));else{const t=V(e,(()=>{}));o=()=>t}function c(e=o(),t){let n=[i[t.type],...a.filter((({matcher:e})=>e(t))).map((({reducer:e})=>e))];return 0===n.filter((e=>!!e)).length&&(n=[s]),n.reduce(((e,n)=>{if(n){if(N(e)){const r=n(e,t);return void 0===r?e:r}if(X(e))return V(e,(e=>n(e,t)));{const r=n(e,t);if(void 0===r){if(null===e)return e;throw Error("A case reducer on a non-draftable value must not return undefined")}return r}}return e}),e)}return c.getInitialState=o,c}function W(e){const{name:t}=e;if(!t)throw new Error("`name` is a required option for createSlice");const n="function"==typeof e.initialState?e.initialState:l(e.initialState,(()=>{})),r=e.reducers||{},o=Object.keys(r),i={},a={},c={};function u(){const[t={},r=[],o]="function"==typeof e.extraReducers?z(e.extraReducers):[e.extraReducers],i=s(s({},t),a);return B(n,i,r,o)}let f;return o.forEach((e=>{const n=r[e],o=`${t}/${e}`;let s,u;"reducer"in n?(s=n.reducer,u=n.prepare):s=n,i[e]=s,a[o]=s,c[e]=u?L(o,u):L(o)})),{name:t,reducer:(e,t)=>(f||(f=u()),f(e,t)),actions:c,caseReducers:i,getInitialState:()=>(f||(f=u()),f.getInitialState())}}import U,{isDraft as G}from"immer";function F(e){const t=H(((t,n)=>e(n)));return function(e){return t(e,void 0)}}function H(e){return function(t,n){const r=t=>{var r;P(r=n)&&"string"==typeof r.type&&Object.keys(r).every(R)?e(n.payload,t):e(n,t)};return G(t)?(r(t),t):U(t,r)}}function J(e,t){return t(e)}function K(e){return Array.isArray(e)||(e=Object.values(e)),e}function Q(e,t,n){e=K(e);const r=[],o=[];for(const i of e){const e=J(i,t);e in n.entities?o.push({id:e,changes:i}):r.push(i)}return[r,o]}function Y(e){function t(t,n){const r=J(t,e);r in n.entities||(n.ids.push(r),n.entities[r]=t)}function n(e,n){e=K(e);for(const r of e)t(r,n)}function r(t,n){const r=J(t,e);r in n.entities||n.ids.push(r),n.entities[r]=t}function o(e,t){let n=!1;e.forEach((e=>{e in t.entities&&(delete t.entities[e],n=!0)})),n&&(t.ids=t.ids.filter((e=>e in t.entities)))}function i(t,n){const r={},o={};if(t.forEach((e=>{e.id in n.entities&&(o[e.id]={id:e.id,changes:s(s({},o[e.id]?o[e.id].changes:null),e.changes)})})),(t=Object.values(o)).length>0){const o=t.filter((t=>function(t,n,r){const o=Object.assign({},r.entities[n.id],n.changes),i=J(o,e),a=i!==n.id;return a&&(t[n.id]=i,delete r.entities[n.id]),r.entities[i]=o,a}(r,t,n))).length>0;o&&(n.ids=n.ids.map((e=>r[e]||e)))}}function a(t,r){const[o,a]=Q(t,e,r);i(a,r),n(o,r)}return{removeAll:F((function(e){Object.assign(e,{ids:[],entities:{}})})),addOne:H(t),addMany:H(n),setOne:H(r),setMany:H((function(e,t){e=K(e);for(const n of e)r(n,t)})),setAll:H((function(e,t){e=K(e),t.ids=[],t.entities={},n(e,t)})),updateOne:H((function(e,t){return i([e],t)})),updateMany:H(i),upsertOne:H((function(e,t){return a([e],t)})),upsertMany:H(a),removeOne:H((function(e,t){return o([e],t)})),removeMany:H(o)}}function Z(e={}){const{selectId:t,sortComparer:n}=s({sortComparer:!1,selectId:e=>e.id},e),r={getInitialState:function(e={}){return Object.assign({ids:[],entities:{}},e)}},o={getSelectors:function(e){const t=e=>e.ids,n=e=>e.entities,r=w(t,n,((e,t)=>e.map((e=>t[e])))),o=(e,t)=>t,i=(e,t)=>e[t],a=w(t,(e=>e.length));if(!e)return{selectIds:t,selectEntities:n,selectAll:r,selectTotal:a,selectById:w(n,o,i)};const s=w(e,n);return{selectIds:w(e,t),selectEntities:s,selectAll:w(e,r),selectTotal:w(e,a),selectById:w(s,o,i)}}},i=n?function(e,t){const{removeOne:n,removeMany:r,removeAll:o}=Y(e);function i(t,n){const r=(t=K(t)).filter((t=>!(J(t,e)in n.entities)));0!==r.length&&u(r,n)}function a(e,t){0!==(e=K(e)).length&&u(e,t)}function s(t,n){const r=[];t.forEach((t=>function(t,n,r){if(!(n.id in r.entities))return!1;const o=Object.assign({},r.entities[n.id],n.changes),i=J(o,e);return delete r.entities[n.id],t.push(o),i!==n.id}(r,t,n))),0!==r.length&&u(r,n)}function c(t,n){const[r,o]=Q(t,e,n);s(o,n),i(r,n)}function u(n,r){n.forEach((t=>{r.entities[e(t)]=t}));const o=Object.values(r.entities);o.sort(t);const i=o.map(e),{ids:a}=r;(function(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length&&n<t.length;n++)if(e[n]!==t[n])return!1;return!0})(a,i)||(r.ids=i)}return{removeOne:n,removeMany:r,removeAll:o,addOne:H((function(e,t){return i([e],t)})),updateOne:H((function(e,t){return s([e],t)})),upsertOne:H((function(e,t){return c([e],t)})),setOne:H((function(e,t){return a([e],t)})),setMany:H(a),setAll:H((function(e,t){e=K(e),t.entities={},t.ids=[],i(e,t)})),addMany:H(i),updateMany:H(s),upsertMany:H(c)}}(t,n):Y(t);return s(s(s({selectId:t,sortComparer:n},r),o),i)}var ee=(e=21)=>{let t="",n=e;for(;n--;)t+="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW"[64*Math.random()|0];return t},te=["name","message","stack","code"],ne=class{constructor(e,t){this.payload=e,this.meta=t}},re=class{constructor(e,t){this.payload=e,this.meta=t}},oe=e=>{if("object"==typeof e&&null!==e){const t={};for(const n of te)"string"==typeof e[n]&&(t[n]=e[n]);return t}return{message:String(e)}};function ie(e,t,n){const r=L(e+"/fulfilled",((e,t,n,r)=>({payload:e,meta:c(s({},r||{}),{arg:n,requestId:t,requestStatus:"fulfilled"})}))),o=L(e+"/pending",((e,t,n)=>({payload:void 0,meta:c(s({},n||{}),{arg:t,requestId:e,requestStatus:"pending"})}))),i=L(e+"/rejected",((e,t,r,o,i)=>({payload:o,error:(n&&n.serializeError||oe)(e||"Rejected"),meta:c(s({},i||{}),{arg:r,requestId:t,rejectedWithValue:!!o,requestStatus:"rejected",aborted:"AbortError"===(null==e?void 0:e.name),condition:"ConditionError"===(null==e?void 0:e.name)})}))),a="undefined"!=typeof AbortController?AbortController:class{constructor(){this.signal={aborted:!1,addEventListener(){},dispatchEvent:()=>!1,onabort(){},removeEventListener(){}}}abort(){}};return Object.assign((function(e){return(s,c,u)=>{const l=(null==n?void 0:n.idGenerator)?n.idGenerator(e):ee(),f=new a;let d;const p=new Promise(((e,t)=>f.signal.addEventListener("abort",(()=>t({name:"AbortError",message:d||"Aborted"})))));let m=!1;const y=async function(){var a,d;let y;try{let i=null==(a=null==n?void 0:n.condition)?void 0:a.call(n,e,{getState:c,extra:u});if(null!==(h=i)&&"object"==typeof h&&"function"==typeof h.then&&(i=await i),!1===i)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};m=!0,s(o(l,e,null==(d=null==n?void 0:n.getPendingMeta)?void 0:d.call(n,{requestId:l,arg:e},{getState:c,extra:u}))),y=await Promise.race([p,Promise.resolve(t(e,{dispatch:s,getState:c,extra:u,requestId:l,signal:f.signal,rejectWithValue:(e,t)=>new ne(e,t),fulfillWithValue:(e,t)=>new re(e,t)})).then((t=>{if(t instanceof ne)throw t;return t instanceof re?r(t.payload,l,e,t.meta):r(t,l,e)}))])}catch(t){y=t instanceof ne?i(null,l,e,t.payload,t.meta):i(t,l,e)}var h;return n&&!n.dispatchConditionRejection&&i.match(y)&&y.meta.condition||s(y),y}();return Object.assign(y,{abort:function(e){m&&(d=e,f.abort())},requestId:l,arg:e,unwrap:()=>y.then(ae)})}}),{pending:o,rejected:i,fulfilled:r,typePrefix:e})}function ae(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}var se=(e,t)=>{return(n=e)&&"function"==typeof n.match?e.match(t):e(t);var n};function ce(...e){return t=>e.some((e=>se(e,t)))}function ue(...e){return t=>e.every((e=>se(e,t)))}function le(e,t){if(!e||!e.meta)return!1;const n="string"==typeof e.meta.requestId,r=t.indexOf(e.meta.requestStatus)>-1;return n&&r}function fe(e){return"function"==typeof e[0]&&"pending"in e[0]&&"fulfilled"in e[0]&&"rejected"in e[0]}function de(...e){return 0===e.length?e=>le(e,["pending"]):fe(e)?t=>ce(...e.map((e=>e.pending)))(t):de()(e[0])}function pe(...e){return 0===e.length?e=>le(e,["rejected"]):fe(e)?t=>ce(...e.map((e=>e.rejected)))(t):pe()(e[0])}function me(...e){const t=e=>e&&e.meta&&e.meta.rejectedWithValue;return 0===e.length||fe(e)?n=>ue(pe(...e),t)(n):me()(e[0])}function ye(...e){return 0===e.length?e=>le(e,["fulfilled"]):fe(e)?t=>ce(...e.map((e=>e.fulfilled)))(t):ye()(e[0])}function he(...e){return 0===e.length?e=>le(e,["pending","fulfilled","rejected"]):fe(e)?t=>{const n=[];for(const t of e)n.push(t.pending,t.rejected,t.fulfilled);return ce(...n)(t)}:he()(e[0])}var ge=(e,t)=>{if("function"!=typeof e)throw new TypeError(`${t} is not a function`)},be=()=>{},we=(e,t=be)=>(e.catch(t),e),ve=(e,t)=>{e.addEventListener("abort",t,{once:!0})},Oe=(e,t)=>{const n=e.signal;n.aborted||("reason"in n||Object.defineProperty(n,"reason",{enumerable:!0,value:t,configurable:!0,writable:!0}),e.abort(t))},je=class{constructor(e){this.code=e,this.name="TaskAbortError",this.message=`task cancelled (reason: ${e})`}},Ee=e=>{if(e.aborted)throw new je(e.reason)},Se=e=>we(new Promise(((t,n)=>{const r=()=>n(new je(e.reason));e.aborted?r():ve(e,r)}))),Ae=e=>t=>we(Promise.race([Se(e),t]).then((t=>(Ee(e),t)))),Pe=e=>{const t=Ae(e);return e=>t(new Promise((t=>setTimeout(t,e))))},{assign:xe}=Object,Ie={},_e="listenerMiddleware",ke=e=>{let{type:t,actionCreator:n,matcher:r,predicate:o,effect:i}=e;if(t)o=L(t).match;else if(n)t=n.type,o=n.match;else if(r)o=r;else if(!o)throw new Error("Creating or removing a listener requires one of the known fields for matching an action");return ge(i,"options.listener"),{predicate:o,type:t,effect:i}},Ce=(e,t,n)=>{try{e(t,n)}catch(e){setTimeout((()=>{throw e}),0)}},Me=L(`${_e}/add`),qe=L(`${_e}/removeAll`),Te=L(`${_e}/remove`),De=(...e)=>{console.error(`${_e}/error`,...e)};function Le(e={}){const t=new Map,{extra:n,onError:r=De}=e;ge(r,"onError");const o=e=>{for(const n of t.values())if(e(n))return n},i=e=>{let n=o((t=>t.effect===e.effect));return n||(n=(e=>{const{type:t,predicate:n,effect:r}=ke(e);return{id:ee(),effect:r,type:t,predicate:n,pending:new Set,unsubscribe:()=>{throw new Error("Unsubscribe not initialized")}}})(e)),(e=>(e.unsubscribe=()=>t.delete(e.id),t.set(e.id,e),e.unsubscribe))(n)},a=e=>{const{type:t,effect:n,predicate:r}=ke(e),i=o((e=>("string"==typeof t?e.type===t:e.predicate===r)&&e.effect===n));return null==i||i.unsubscribe(),!!i},s=async(e,o,a,s)=>{const c=new AbortController,u=((e,t)=>(n,r)=>we((async(n,r)=>{Ee(t);let o=()=>{};const i=new Promise((t=>{o=e({predicate:n,effect:(e,n)=>{n.unsubscribe(),t([e,n.getState(),n.getOriginalState()])}})})),a=[Se(t),i];null!=r&&a.push(new Promise((e=>setTimeout(e,r,null))));try{const e=await Promise.race(a);return Ee(t),e}finally{o()}})(n,r)))(i,c.signal);try{e.pending.add(c),await Promise.resolve(e.effect(o,xe({},a,{getOriginalState:s,condition:(e,t)=>u(e,t).then(Boolean),take:u,delay:Pe(c.signal),pause:Ae(c.signal),extra:n,signal:c.signal,fork:(l=c.signal,e=>{ge(e,"taskExecutor");const t=new AbortController;var n;n=t,ve(l,(()=>Oe(n,l.reason)));const r=(async(n,r)=>{try{return await Promise.resolve(),{status:"ok",value:await(async()=>{Ee(l),Ee(t.signal);const n=await e({pause:Ae(t.signal),delay:Pe(t.signal),signal:t.signal});return Ee(t.signal),n})()}}catch(e){return{status:e instanceof je?"cancelled":"rejected",error:e}}finally{null==r||r()}})(0,(()=>Oe(t,"task-completed")));return{result:Ae(l)(r),cancel(){Oe(t,"task-cancelled")}}}),unsubscribe:e.unsubscribe,subscribe:()=>{t.set(e.id,e)},cancelActiveListeners:()=>{e.pending.forEach(((e,t,n)=>{e!==c&&(Oe(e,"listener-cancelled"),n.delete(e))}))}})))}catch(e){e instanceof je||Ce(r,e,{raisedBy:"effect"})}finally{Oe(c,"listener-completed"),e.pending.delete(c)}var l},c=(e=>()=>{e.forEach((e=>{e.pending.forEach((e=>{Oe(e,"listener-cancelled")}))})),e.clear()})(t);return{middleware:e=>n=>o=>{if(Me.match(o))return i(o.payload);if(qe.match(o))return void c();if(Te.match(o))return a(o.payload);let u=e.getState();const l=()=>{if(u===Ie)throw new Error(`${_e}: getOriginalState can only be called synchronously`);return u};let f;try{if(f=n(o),t.size>0){let n=e.getState();const i=Array.from(t.values());for(let t of i){let i=!1;try{i=t.predicate(o,n,u)}catch(e){i=!1,Ce(r,e,{raisedBy:"predicate"})}i&&s(t,o,e,l)}}}finally{u=Ie}return f},startListening:i,stopListening:a,clearListeners:c}}u();export{I as MiddlewareArray,je as TaskAbortError,Me as addListener,D as configureStore,L as createAction,ie as createAsyncThunk,w as createDraftSafeSelector,Z as createEntityAdapter,k as createImmutableStateInvariantMiddleware,Le as createListenerMiddleware,l as createNextState,B as createReducer,y as createSelector,q as createSerializableStateInvariantMiddleware,W as createSlice,f as current,M as findNonSerializableValue,d as freeze,T as getDefaultMiddleware,$ as getType,ue as isAllOf,ce as isAnyOf,he as isAsyncThunkAction,m as isDraft,ye as isFulfilled,_ as isImmutableDefault,de as isPending,C as isPlain,P as isPlainObject,pe as isRejected,me as isRejectedWithValue,oe as miniSerializeError,ee as nanoid,p as original,qe as removeAllListeners,Te as removeListener,ae as unwrapResult};
var e=Object.defineProperty,t=Object.defineProperties,n=Object.getOwnPropertyDescriptors,r=Object.getOwnPropertySymbols,o=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable,a=(t,n,r)=>n in t?e(t,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[n]=r,c=(e,t)=>{for(var n in t||(t={}))o.call(t,n)&&a(e,n,t[n]);if(r)for(var n of r(t))i.call(t,n)&&a(e,n,t[n]);return e},s=(e,r)=>t(e,n(r));import{enableES5 as u}from"immer";export*from"redux";import{default as l,current as f,freeze as d,original as p,isDraft as m}from"immer";import{createSelector as y}from"reselect";import{current as h,isDraft as g}from"immer";import{createSelector as b}from"reselect";var w=(...e)=>{const t=b(...e);return(e,...n)=>t(g(e)?h(e):e,...n)};import{createStore as v,compose as O,applyMiddleware as j,combineReducers as E}from"redux";import{compose as S}from"redux";var A="undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(0!==arguments.length)return"object"==typeof arguments[0]?S:S.apply(null,arguments)};function P(e){if("object"!=typeof e||null===e)return!1;let t=Object.getPrototypeOf(e);if(null===t)return!0;let n=t;for(;null!==Object.getPrototypeOf(n);)n=Object.getPrototypeOf(n);return t===n}"undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION__&&window;import x from"redux-thunk";var I=class extends Array{constructor(...e){super(...e),Object.setPrototypeOf(this,I.prototype)}static get[Symbol.species](){return I}concat(...e){return super.concat.apply(this,e)}prepend(...e){return 1===e.length&&Array.isArray(e[0])?new I(...e[0].concat(this)):new I(...e.concat(this))}};function _(e){return"object"!=typeof e||null==e||Object.isFrozen(e)}function k(e={}){return()=>e=>t=>e(t)}function C(e){const t=typeof e;return"undefined"===t||null===e||"string"===t||"boolean"===t||"number"===t||Array.isArray(e)||P(e)}function M(e,t="",n=C,r,o=[]){let i;if(!n(e))return{keyPath:t||"<root>",value:e};if("object"!=typeof e||null===e)return!1;const a=null!=r?r(e):Object.entries(e),c=o.length>0;for(const[e,s]of a){const a=t?t+"."+e:e;if(!(c&&o.indexOf(a)>=0)){if(!n(s))return{keyPath:a,value:s};if("object"==typeof s&&(i=M(s,a,n,r,o),i))return i}}return!1}function q(e={}){return()=>e=>t=>e(t)}function T(e={}){const{thunk:t=!0,immutableCheck:n=!0,serializableCheck:r=!0}=e;let o=new I;return t&&o.push("boolean"==typeof t?x:x.withExtraArgument(t.extraArgument)),o}function D(e){const t=function(e){return T(e)},{reducer:n,middleware:r=t(),devTools:o=!0,preloadedState:i,enhancers:a}=e||{};let s;if("function"==typeof n)s=n;else{if(!P(n))throw new Error('"reducer" is a required argument, and must be a function or an object of functions that can be passed to combineReducers');s=E(n)}let u=r;"function"==typeof u&&(u=u(t));const l=j(...u);let f=O;o&&(f=A(c({trace:!1},"object"==typeof o&&o)));let d=[l];Array.isArray(a)?d=[l,...a]:"function"==typeof a&&(d=a(d));const p=f(...d);return v(s,i,p)}function L(e,t){function n(...n){if(t){let r=t(...n);if(!r)throw new Error("prepareAction did not return an object");return c(c({type:e,payload:r.payload},"meta"in r&&{meta:r.meta}),"error"in r&&{error:r.error})}return{type:e,payload:n[0]}}return n.toString=()=>`${e}`,n.type=e,n.match=t=>t.type===e,n}function R(e){return["type","payload","error","meta"].indexOf(e)>-1}function $(e){return`${e}`}import V,{isDraft as N,isDraftable as X}from"immer";function z(e){const t={},n=[];let r;const o={addCase(e,n){const r="string"==typeof e?e:e.type;if(r in t)throw new Error("addCase cannot be called with two reducers for the same action type");return t[r]=n,o},addMatcher:(e,t)=>(n.push({matcher:e,reducer:t}),o),addDefaultCase:e=>(r=e,o)};return e(o),[t,n,r]}function B(e,t,n=[],r){let o,[i,a,c]="function"==typeof t?z(t):[t,n,r];if("function"==typeof e)o=()=>V(e(),(()=>{}));else{const t=V(e,(()=>{}));o=()=>t}function s(e=o(),t){let n=[i[t.type],...a.filter((({matcher:e})=>e(t))).map((({reducer:e})=>e))];return 0===n.filter((e=>!!e)).length&&(n=[c]),n.reduce(((e,n)=>{if(n){if(N(e)){const r=n(e,t);return void 0===r?e:r}if(X(e))return V(e,(e=>n(e,t)));{const r=n(e,t);if(void 0===r){if(null===e)return e;throw Error("A case reducer on a non-draftable value must not return undefined")}return r}}return e}),e)}return s.getInitialState=o,s}function W(e){const{name:t}=e;if(!t)throw new Error("`name` is a required option for createSlice");const n="function"==typeof e.initialState?e.initialState:l(e.initialState,(()=>{})),r=e.reducers||{},o=Object.keys(r),i={},a={},s={};function u(){const[t={},r=[],o]="function"==typeof e.extraReducers?z(e.extraReducers):[e.extraReducers],i=c(c({},t),a);return B(n,i,r,o)}let f;return o.forEach((e=>{const n=r[e],o=`${t}/${e}`;let c,u;"reducer"in n?(c=n.reducer,u=n.prepare):c=n,i[e]=c,a[o]=c,s[e]=u?L(o,u):L(o)})),{name:t,reducer:(e,t)=>(f||(f=u()),f(e,t)),actions:s,caseReducers:i,getInitialState:()=>(f||(f=u()),f.getInitialState())}}import U,{isDraft as G}from"immer";function F(e){const t=H(((t,n)=>e(n)));return function(e){return t(e,void 0)}}function H(e){return function(t,n){const r=t=>{var r;P(r=n)&&"string"==typeof r.type&&Object.keys(r).every(R)?e(n.payload,t):e(n,t)};return G(t)?(r(t),t):U(t,r)}}function J(e,t){return t(e)}function K(e){return Array.isArray(e)||(e=Object.values(e)),e}function Q(e,t,n){e=K(e);const r=[],o=[];for(const i of e){const e=J(i,t);e in n.entities?o.push({id:e,changes:i}):r.push(i)}return[r,o]}function Y(e){function t(t,n){const r=J(t,e);r in n.entities||(n.ids.push(r),n.entities[r]=t)}function n(e,n){e=K(e);for(const r of e)t(r,n)}function r(t,n){const r=J(t,e);r in n.entities||n.ids.push(r),n.entities[r]=t}function o(e,t){let n=!1;e.forEach((e=>{e in t.entities&&(delete t.entities[e],n=!0)})),n&&(t.ids=t.ids.filter((e=>e in t.entities)))}function i(t,n){const r={},o={};if(t.forEach((e=>{e.id in n.entities&&(o[e.id]={id:e.id,changes:c(c({},o[e.id]?o[e.id].changes:null),e.changes)})})),(t=Object.values(o)).length>0){const o=t.filter((t=>function(t,n,r){const o=Object.assign({},r.entities[n.id],n.changes),i=J(o,e),a=i!==n.id;return a&&(t[n.id]=i,delete r.entities[n.id]),r.entities[i]=o,a}(r,t,n))).length>0;o&&(n.ids=n.ids.map((e=>r[e]||e)))}}function a(t,r){const[o,a]=Q(t,e,r);i(a,r),n(o,r)}return{removeAll:F((function(e){Object.assign(e,{ids:[],entities:{}})})),addOne:H(t),addMany:H(n),setOne:H(r),setMany:H((function(e,t){e=K(e);for(const n of e)r(n,t)})),setAll:H((function(e,t){e=K(e),t.ids=[],t.entities={},n(e,t)})),updateOne:H((function(e,t){return i([e],t)})),updateMany:H(i),upsertOne:H((function(e,t){return a([e],t)})),upsertMany:H(a),removeOne:H((function(e,t){return o([e],t)})),removeMany:H(o)}}function Z(e={}){const{selectId:t,sortComparer:n}=c({sortComparer:!1,selectId:e=>e.id},e),r={getInitialState:function(e={}){return Object.assign({ids:[],entities:{}},e)}},o={getSelectors:function(e){const t=e=>e.ids,n=e=>e.entities,r=w(t,n,((e,t)=>e.map((e=>t[e])))),o=(e,t)=>t,i=(e,t)=>e[t],a=w(t,(e=>e.length));if(!e)return{selectIds:t,selectEntities:n,selectAll:r,selectTotal:a,selectById:w(n,o,i)};const c=w(e,n);return{selectIds:w(e,t),selectEntities:c,selectAll:w(e,r),selectTotal:w(e,a),selectById:w(c,o,i)}}},i=n?function(e,t){const{removeOne:n,removeMany:r,removeAll:o}=Y(e);function i(t,n){const r=(t=K(t)).filter((t=>!(J(t,e)in n.entities)));0!==r.length&&u(r,n)}function a(e,t){0!==(e=K(e)).length&&u(e,t)}function c(t,n){const r=[];t.forEach((t=>function(t,n,r){if(!(n.id in r.entities))return!1;const o=Object.assign({},r.entities[n.id],n.changes),i=J(o,e);return delete r.entities[n.id],t.push(o),i!==n.id}(r,t,n))),0!==r.length&&u(r,n)}function s(t,n){const[r,o]=Q(t,e,n);c(o,n),i(r,n)}function u(n,r){n.forEach((t=>{r.entities[e(t)]=t}));const o=Object.values(r.entities);o.sort(t);const i=o.map(e),{ids:a}=r;(function(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length&&n<t.length;n++)if(e[n]!==t[n])return!1;return!0})(a,i)||(r.ids=i)}return{removeOne:n,removeMany:r,removeAll:o,addOne:H((function(e,t){return i([e],t)})),updateOne:H((function(e,t){return c([e],t)})),upsertOne:H((function(e,t){return s([e],t)})),setOne:H((function(e,t){return a([e],t)})),setMany:H(a),setAll:H((function(e,t){e=K(e),t.entities={},t.ids=[],i(e,t)})),addMany:H(i),updateMany:H(c),upsertMany:H(s)}}(t,n):Y(t);return c(c(c({selectId:t,sortComparer:n},r),o),i)}var ee=(e=21)=>{let t="",n=e;for(;n--;)t+="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW"[64*Math.random()|0];return t},te=["name","message","stack","code"],ne=class{constructor(e,t){this.payload=e,this.meta=t}},re=class{constructor(e,t){this.payload=e,this.meta=t}},oe=e=>{if("object"==typeof e&&null!==e){const t={};for(const n of te)"string"==typeof e[n]&&(t[n]=e[n]);return t}return{message:String(e)}};function ie(e,t,n){const r=L(e+"/fulfilled",((e,t,n,r)=>({payload:e,meta:s(c({},r||{}),{arg:n,requestId:t,requestStatus:"fulfilled"})}))),o=L(e+"/pending",((e,t,n)=>({payload:void 0,meta:s(c({},n||{}),{arg:t,requestId:e,requestStatus:"pending"})}))),i=L(e+"/rejected",((e,t,r,o,i)=>({payload:o,error:(n&&n.serializeError||oe)(e||"Rejected"),meta:s(c({},i||{}),{arg:r,requestId:t,rejectedWithValue:!!o,requestStatus:"rejected",aborted:"AbortError"===(null==e?void 0:e.name),condition:"ConditionError"===(null==e?void 0:e.name)})}))),a="undefined"!=typeof AbortController?AbortController:class{constructor(){this.signal={aborted:!1,addEventListener(){},dispatchEvent:()=>!1,onabort(){},removeEventListener(){}}}abort(){}};return Object.assign((function(e){return(c,s,u)=>{const l=(null==n?void 0:n.idGenerator)?n.idGenerator(e):ee(),f=new a;let d;const p=new Promise(((e,t)=>f.signal.addEventListener("abort",(()=>t({name:"AbortError",message:d||"Aborted"})))));let m=!1;const y=async function(){var a,d;let y;try{let i=null==(a=null==n?void 0:n.condition)?void 0:a.call(n,e,{getState:s,extra:u});if(null!==(h=i)&&"object"==typeof h&&"function"==typeof h.then&&(i=await i),!1===i)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};m=!0,c(o(l,e,null==(d=null==n?void 0:n.getPendingMeta)?void 0:d.call(n,{requestId:l,arg:e},{getState:s,extra:u}))),y=await Promise.race([p,Promise.resolve(t(e,{dispatch:c,getState:s,extra:u,requestId:l,signal:f.signal,rejectWithValue:(e,t)=>new ne(e,t),fulfillWithValue:(e,t)=>new re(e,t)})).then((t=>{if(t instanceof ne)throw t;return t instanceof re?r(t.payload,l,e,t.meta):r(t,l,e)}))])}catch(t){y=t instanceof ne?i(null,l,e,t.payload,t.meta):i(t,l,e)}var h;return n&&!n.dispatchConditionRejection&&i.match(y)&&y.meta.condition||c(y),y}();return Object.assign(y,{abort:function(e){m&&(d=e,f.abort())},requestId:l,arg:e,unwrap:()=>y.then(ae)})}}),{pending:o,rejected:i,fulfilled:r,typePrefix:e})}function ae(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}var ce=(e,t)=>{return(n=e)&&"function"==typeof n.match?e.match(t):e(t);var n};function se(...e){return t=>e.some((e=>ce(e,t)))}function ue(...e){return t=>e.every((e=>ce(e,t)))}function le(e,t){if(!e||!e.meta)return!1;const n="string"==typeof e.meta.requestId,r=t.indexOf(e.meta.requestStatus)>-1;return n&&r}function fe(e){return"function"==typeof e[0]&&"pending"in e[0]&&"fulfilled"in e[0]&&"rejected"in e[0]}function de(...e){return 0===e.length?e=>le(e,["pending"]):fe(e)?t=>se(...e.map((e=>e.pending)))(t):de()(e[0])}function pe(...e){return 0===e.length?e=>le(e,["rejected"]):fe(e)?t=>se(...e.map((e=>e.rejected)))(t):pe()(e[0])}function me(...e){const t=e=>e&&e.meta&&e.meta.rejectedWithValue;return 0===e.length||fe(e)?n=>ue(pe(...e),t)(n):me()(e[0])}function ye(...e){return 0===e.length?e=>le(e,["fulfilled"]):fe(e)?t=>se(...e.map((e=>e.fulfilled)))(t):ye()(e[0])}function he(...e){return 0===e.length?e=>le(e,["pending","fulfilled","rejected"]):fe(e)?t=>{const n=[];for(const t of e)n.push(t.pending,t.rejected,t.fulfilled);return se(...n)(t)}:he()(e[0])}var ge=(e,t)=>{if("function"!=typeof e)throw new TypeError(`${t} is not a function`)},be=()=>{},we=(e,t=be)=>(e.catch(t),e),ve=(e,t)=>{e.addEventListener("abort",t,{once:!0})},Oe=(e,t)=>{const n=e.signal;n.aborted||("reason"in n||Object.defineProperty(n,"reason",{enumerable:!0,value:t,configurable:!0,writable:!0}),e.abort(t))},je=class{constructor(e){this.code=e,this.name="TaskAbortError",this.message=`task cancelled (reason: ${e})`}},Ee=e=>{if(e.aborted)throw new je(e.reason)},Se=e=>we(new Promise(((t,n)=>{const r=()=>n(new je(e.reason));e.aborted?r():ve(e,r)}))),Ae=e=>t=>we(Promise.race([Se(e),t]).then((t=>(Ee(e),t)))),Pe=e=>{const t=Ae(e);return e=>t(new Promise((t=>setTimeout(t,e))))},{assign:xe}=Object,Ie={},_e="listenerMiddleware",ke=e=>{let{type:t,actionCreator:n,matcher:r,predicate:o,effect:i}=e;if(t)o=L(t).match;else if(n)t=n.type,o=n.match;else if(r)o=r;else if(!o)throw new Error("Creating or removing a listener requires one of the known fields for matching an action");return ge(i,"options.listener"),{predicate:o,type:t,effect:i}},Ce=(e,t,n)=>{try{e(t,n)}catch(e){setTimeout((()=>{throw e}),0)}},Me=L(`${_e}/add`),qe=L(`${_e}/removeAll`),Te=L(`${_e}/remove`),De=(...e)=>{console.error(`${_e}/error`,...e)},Le=e=>{e.pending.forEach((e=>{Oe(e,"listener-cancelled")}))};function Re(e={}){const t=new Map,{extra:n,onError:r=De}=e;ge(r,"onError");const o=e=>{for(const n of t.values())if(e(n))return n},i=e=>{let n=o((t=>t.effect===e.effect));return n||(n=(e=>{const{type:t,predicate:n,effect:r}=ke(e);return{id:ee(),effect:r,type:t,predicate:n,pending:new Set,unsubscribe:()=>{throw new Error("Unsubscribe not initialized")}}})(e)),(e=>(e.unsubscribe=()=>t.delete(e.id),t.set(e.id,e),t=>{e.unsubscribe(),(null==t?void 0:t.cancelActive)&&Le(e)}))(n)},a=e=>{const{type:t,effect:n,predicate:r}=ke(e),i=o((e=>("string"==typeof t?e.type===t:e.predicate===r)&&e.effect===n));return i&&(i.unsubscribe(),e.cancelActive&&Le(i)),!!i},c=async(e,o,a,c)=>{const s=new AbortController,u=((e,t)=>(n,r)=>we((async(n,r)=>{Ee(t);let o=()=>{};const i=new Promise((t=>{o=e({predicate:n,effect:(e,n)=>{n.unsubscribe(),t([e,n.getState(),n.getOriginalState()])}})})),a=[Se(t),i];null!=r&&a.push(new Promise((e=>setTimeout(e,r,null))));try{const e=await Promise.race(a);return Ee(t),e}finally{o()}})(n,r)))(i,s.signal);try{e.pending.add(s),await Promise.resolve(e.effect(o,xe({},a,{getOriginalState:c,condition:(e,t)=>u(e,t).then(Boolean),take:u,delay:Pe(s.signal),pause:Ae(s.signal),extra:n,signal:s.signal,fork:(l=s.signal,e=>{ge(e,"taskExecutor");const t=new AbortController;var n;n=t,ve(l,(()=>Oe(n,l.reason)));const r=(async(n,r)=>{try{return await Promise.resolve(),{status:"ok",value:await(async()=>{Ee(l),Ee(t.signal);const n=await e({pause:Ae(t.signal),delay:Pe(t.signal),signal:t.signal});return Ee(t.signal),n})()}}catch(e){return{status:e instanceof je?"cancelled":"rejected",error:e}}finally{null==r||r()}})(0,(()=>Oe(t,"task-completed")));return{result:Ae(l)(r),cancel(){Oe(t,"task-cancelled")}}}),unsubscribe:e.unsubscribe,subscribe:()=>{t.set(e.id,e)},cancelActiveListeners:()=>{e.pending.forEach(((e,t,n)=>{e!==s&&(Oe(e,"listener-cancelled"),n.delete(e))}))}})))}catch(e){e instanceof je||Ce(r,e,{raisedBy:"effect"})}finally{Oe(s,"listener-completed"),e.pending.delete(s)}var l},s=(e=>()=>{e.forEach(Le),e.clear()})(t);return{middleware:e=>n=>o=>{if(Me.match(o))return i(o.payload);if(qe.match(o))return void s();if(Te.match(o))return a(o.payload);let u=e.getState();const l=()=>{if(u===Ie)throw new Error(`${_e}: getOriginalState can only be called synchronously`);return u};let f;try{if(f=n(o),t.size>0){let n=e.getState();const i=Array.from(t.values());for(let t of i){let i=!1;try{i=t.predicate(o,n,u)}catch(e){i=!1,Ce(r,e,{raisedBy:"predicate"})}i&&c(t,o,e,l)}}}finally{u=Ie}return f},startListening:i,stopListening:a,clearListeners:s}}u();export{I as MiddlewareArray,je as TaskAbortError,Me as addListener,qe as clearAllListeners,D as configureStore,L as createAction,ie as createAsyncThunk,w as createDraftSafeSelector,Z as createEntityAdapter,k as createImmutableStateInvariantMiddleware,Re as createListenerMiddleware,l as createNextState,B as createReducer,y as createSelector,q as createSerializableStateInvariantMiddleware,W as createSlice,f as current,M as findNonSerializableValue,d as freeze,T as getDefaultMiddleware,$ as getType,ue as isAllOf,se as isAnyOf,he as isAsyncThunkAction,m as isDraft,ye as isFulfilled,_ as isImmutableDefault,de as isPending,C as isPlain,P as isPlainObject,pe as isRejected,me as isRejectedWithValue,oe as miniSerializeError,ee as nanoid,p as original,Te as removeListener,ae as unwrapResult};
//# sourceMappingURL=redux-toolkit.modern.production.min.js.map

@@ -7,3 +7,3 @@ (function (global, factory) {

var t,e,n,r=undefined&&undefined.__extends||(t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e;}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);},t(e,n)},function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e;}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r);}),o=undefined&&undefined.__generator||function(t,e){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function c(i){return function(c){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!((o=(o=u.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=e.call(t,u);}catch(t){i=[6,t],r=0;}finally{n=o=0;}if(5&i[0])throw i[1];return {value:i[0]?i[1]:void 0,done:!0}}([i,c])}}},i=undefined&&undefined.__spreadArray||function(t,e){for(var n=0,r=e.length,o=t.length;n<r;n++,o++)t[o]=e[n];return t},u=Object.defineProperty,c=Object.defineProperties,a=Object.getOwnPropertyDescriptors,f=Object.getOwnPropertySymbols,l=Object.prototype.hasOwnProperty,s=Object.prototype.propertyIsEnumerable,p=function(t,e,n){return e in t?u(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n},d=function(t,e){for(var n in e||(e={}))l.call(e,n)&&p(t,n,e[n]);if(f)for(var r=0,o=f(e);r<o.length;r++)s.call(e,n=o[r])&&p(t,n,e[n]);return t},v=function(t,e){return c(t,a(e))},y=function(t,e,n){return new Promise((function(r,o){var i=function(t){try{c(n.next(t));}catch(t){o(t);}},u=function(t){try{c(n.throw(t));}catch(t){o(t);}},c=function(t){return t.done?r(t.value):Promise.resolve(t.value).then(i,u)};c((n=n.apply(t,e)).next());}))};function h(t){for(var e=arguments.length,n=Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];throw Error("[Immer] minified error nr: "+t+(n.length?" "+n.map((function(t){return "'"+t+"'"})).join(","):"")+". Find the full error at: https://bit.ly/3cXEKWf")}function g(t){return !!t&&!!t[nt]}function b(t){return !!t&&(function(t){if(!t||"object"!=typeof t)return !1;var e=Object.getPrototypeOf(t);if(null===e)return !0;var n=Object.hasOwnProperty.call(e,"constructor")&&e.constructor;return n===Object||"function"==typeof n&&Function.toString.call(n)===rt}(t)||Array.isArray(t)||!!t[et]||!!t.constructor[et]||A(t)||S(t))}function m(t){return g(t)||h(23,t),t[nt].t}function O(t,e,n){void 0===n&&(n=!1),0===w(t)?(n?Object.keys:ot)(t).forEach((function(r){n&&"symbol"==typeof r||e(r,t[r],t);})):t.forEach((function(n,r){return e(r,n,t)}));}function w(t){var e=t[nt];return e?e.i>3?e.i-4:e.i:Array.isArray(t)?1:A(t)?2:S(t)?3:0}function j(t,e){return 2===w(t)?t.has(e):Object.prototype.hasOwnProperty.call(t,e)}function P(t,e,n){var r=w(t);2===r?t.set(e,n):3===r?(t.delete(e),t.add(n)):t[e]=n;}function E(t,e){return t===e?0!==t||1/t==1/e:t!=t&&e!=e}function A(t){return Q&&t instanceof Map}function S(t){return Y&&t instanceof Set}function _(t){return t.o||t.t}function x(t){if(Array.isArray(t))return Array.prototype.slice.call(t);var e=it(t);delete e[nt];for(var n=ot(e),r=0;r<n.length;r++){var o=n[r],i=e[o];!1===i.writable&&(i.writable=!0,i.configurable=!0),(i.get||i.set)&&(e[o]={configurable:!0,writable:!0,enumerable:i.enumerable,value:t[o]});}return Object.create(Object.getPrototypeOf(t),e)}function k(t,e){return void 0===e&&(e=!1),D(t)||g(t)||!b(t)||(w(t)>1&&(t.set=t.add=t.clear=t.delete=I),Object.freeze(t),e&&O(t,(function(t,e){return k(e,!0)}),!0)),t}function I(){h(2);}function D(t){return null==t||"object"!=typeof t||Object.isFrozen(t)}function N(t){var e=ut[t];return e||h(18,t),e}function C(){return n}function T(t,e){e&&(N("Patches"),t.u=[],t.s=[],t.v=e);}function R(t){M(t),t.p.forEach(q),t.p=null;}function M(t){t===n&&(n=t.l);}function F(t){return n={p:[],l:n,h:t,m:!0,_:0}}function q(t){var e=t[nt];0===e.i||1===e.i?e.j():e.O=!0;}function z(t,e){e._=e.p.length;var n=e.p[0],r=void 0!==t&&t!==n;return e.h.g||N("ES5").S(e,t,r),r?(n[nt].P&&(R(e),h(4)),b(t)&&(t=U(e,t),e.l||W(e,t)),e.u&&N("Patches").M(n[nt],t,e.u,e.s)):t=U(e,n,[]),R(e),e.u&&e.v(e.u,e.s),t!==tt?t:void 0}function U(t,e,n){if(D(e))return e;var r=e[nt];if(!r)return O(e,(function(o,i){return L(t,r,e,o,i,n)}),!0),e;if(r.A!==t)return e;if(!r.P)return W(t,r.t,!0),r.t;if(!r.I){r.I=!0,r.A._--;var o=4===r.i||5===r.i?r.o=x(r.k):r.o;O(3===r.i?new Set(o):o,(function(e,i){return L(t,r,o,e,i,n)})),W(t,o,!1),n&&t.u&&N("Patches").R(r,n,t.u,t.s);}return r.o}function L(t,e,n,r,o,i){if(g(o)){var u=U(t,o,i&&e&&3!==e.i&&!j(e.D,r)?i.concat(r):void 0);if(P(n,r,u),!g(u))return;t.m=!1;}if(b(o)&&!D(o)){if(!t.h.F&&t._<1)return;U(t,o),e&&e.A.l||W(t,o);}}function W(t,e,n){void 0===n&&(n=!1),t.h.F&&t.m&&k(e,n);}function K(t,e){var n=t[nt];return (n?_(n):t)[e]}function B(t,e){if(e in t)for(var n=Object.getPrototypeOf(t);n;){var r=Object.getOwnPropertyDescriptor(n,e);if(r)return r;n=Object.getPrototypeOf(n);}}function V(t){t.P||(t.P=!0,t.l&&V(t.l));}function X(t){t.o||(t.o=x(t.t));}function G(t,e,n){var r=A(e)?N("MapSet").N(e,n):S(e)?N("MapSet").T(e,n):t.g?function(t,e){var n=Array.isArray(t),r={i:n?1:0,A:e?e.A:C(),P:!1,I:!1,D:{},l:e,t:t,k:null,o:null,j:null,C:!1},o=r,i=ct;n&&(o=[r],i=at);var u=Proxy.revocable(o,i),c=u.revoke,a=u.proxy;return r.k=a,r.j=c,a}(e,n):N("ES5").J(e,n);return (n?n.A:C()).p.push(r),r}function J(t){return g(t)||h(22,t),function t(e){if(!b(e))return e;var n,r=e[nt],o=w(e);if(r){if(!r.P&&(r.i<4||!N("ES5").K(r)))return r.t;r.I=!0,n=$(e,o),r.I=!1;}else n=$(e,o);return O(n,(function(e,o){r&&function(t,e){return 2===w(t)?t.get(e):t[e]}(r.t,e)===o||P(n,e,t(o));})),3===o?new Set(n):n}(t)}function $(t,e){switch(e){case 2:return new Map(t);case 3:return Array.from(t)}return x(t)}var H="undefined"!=typeof Symbol&&"symbol"==typeof Symbol("x"),Q="undefined"!=typeof Map,Y="undefined"!=typeof Set,Z="undefined"!=typeof Proxy&&void 0!==Proxy.revocable&&"undefined"!=typeof Reflect,tt=H?Symbol.for("immer-nothing"):((e={})["immer-nothing"]=!0,e),et=H?Symbol.for("immer-draftable"):"__$immer_draftable",nt=H?Symbol.for("immer-state"):"__$immer_state",rt=(""+Object.prototype.constructor),ot="undefined"!=typeof Reflect&&Reflect.ownKeys?Reflect.ownKeys:void 0!==Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:Object.getOwnPropertyNames,it=Object.getOwnPropertyDescriptors||function(t){var e={};return ot(t).forEach((function(n){e[n]=Object.getOwnPropertyDescriptor(t,n);})),e},ut={},ct={get:function(t,e){if(e===nt)return t;var n,r,o,i=_(t);if(!j(i,e))return n=t,(o=B(i,e))?"value"in o?o.value:null===(r=o.get)||void 0===r?void 0:r.call(n.k):void 0;var u=i[e];return t.I||!b(u)?u:u===K(t.t,e)?(X(t),t.o[e]=G(t.A.h,u,t)):u},has:function(t,e){return e in _(t)},ownKeys:function(t){return Reflect.ownKeys(_(t))},set:function(t,e,n){var r=B(_(t),e);if(null==r?void 0:r.set)return r.set.call(t.k,n),!0;if(!t.P){var o=K(_(t),e),i=null==o?void 0:o[nt];if(i&&i.t===n)return t.o[e]=n,t.D[e]=!1,!0;if(E(n,o)&&(void 0!==n||j(t.t,e)))return !0;X(t),V(t);}return t.o[e]===n&&"number"!=typeof n&&(void 0!==n||e in t.o)||(t.o[e]=n,t.D[e]=!0,!0)},deleteProperty:function(t,e){return void 0!==K(t.t,e)||e in t.t?(t.D[e]=!1,X(t),V(t)):delete t.D[e],t.o&&delete t.o[e],!0},getOwnPropertyDescriptor:function(t,e){var n=_(t),r=Reflect.getOwnPropertyDescriptor(n,e);return r?{writable:!0,configurable:1!==t.i||"length"!==e,enumerable:r.enumerable,value:n[e]}:r},defineProperty:function(){h(11);},getPrototypeOf:function(t){return Object.getPrototypeOf(t.t)},setPrototypeOf:function(){h(12);}},at={};O(ct,(function(t,e){at[t]=function(){return arguments[0]=arguments[0][0],e.apply(this,arguments)};})),at.deleteProperty=function(t,e){return ct.deleteProperty.call(this,t[0],e)},at.set=function(t,e,n){return ct.set.call(this,t[0],e,n,t[0])};var ft=new(function(){function t(t){var e=this;this.g=Z,this.F=!0,this.produce=function(t,n,r){if("function"==typeof t&&"function"!=typeof n){var o=n;n=t;var i=e;return function(t){var e=this;void 0===t&&(t=o);for(var r=arguments.length,u=Array(r>1?r-1:0),c=1;c<r;c++)u[c-1]=arguments[c];return i.produce(t,(function(t){var r;return (r=n).call.apply(r,[e,t].concat(u))}))}}var u;if("function"!=typeof n&&h(6),void 0!==r&&"function"!=typeof r&&h(7),b(t)){var c=F(e),a=G(e,t,void 0),f=!0;try{u=n(a),f=!1;}finally{f?R(c):M(c);}return "undefined"!=typeof Promise&&u instanceof Promise?u.then((function(t){return T(c,r),z(t,c)}),(function(t){throw R(c),t})):(T(c,r),z(u,c))}if(!t||"object"!=typeof t){if((u=n(t))===tt)return;return void 0===u&&(u=t),e.F&&k(u,!0),u}h(21,t);},this.produceWithPatches=function(t,n){return "function"==typeof t?function(n){for(var r=arguments.length,o=Array(r>1?r-1:0),i=1;i<r;i++)o[i-1]=arguments[i];return e.produceWithPatches(n,(function(e){return t.apply(void 0,[e].concat(o))}))}:[e.produce(t,n,(function(t,e){r=t,o=e;})),r,o];var r,o;},"boolean"==typeof(null==t?void 0:t.useProxies)&&this.setUseProxies(t.useProxies),"boolean"==typeof(null==t?void 0:t.autoFreeze)&&this.setAutoFreeze(t.autoFreeze);}var e=t.prototype;return e.createDraft=function(t){b(t)||h(8),g(t)&&(t=J(t));var e=F(this),n=G(this,t,void 0);return n[nt].C=!0,M(e),n},e.finishDraft=function(t,e){var n=(t&&t[nt]).A;return T(n,e),z(void 0,n)},e.setAutoFreeze=function(t){this.F=t;},e.setUseProxies=function(t){t&&!Z&&h(20),this.g=t;},e.applyPatches=function(t,e){var n;for(n=e.length-1;n>=0;n--){var r=e[n];if(0===r.path.length&&"replace"===r.op){t=r.value;break}}n>-1&&(e=e.slice(n+1));var o=N("Patches").$;return g(t)?o(t,e):this.produce(t,(function(t){return o(t,e)}))},t}()),lt=ft.produce,st=(ft.produceWithPatches.bind(ft),ft.setAutoFreeze.bind(ft),ft.setUseProxies.bind(ft),ft.applyPatches.bind(ft),ft.createDraft.bind(ft),ft.finishDraft.bind(ft),lt);function pt(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function dt(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r);}return n}function vt(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?dt(Object(n),!0).forEach((function(e){pt(t,e,n[e]);})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):dt(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e));}));}return t}function yt(t){return "Minified Redux error #"+t+"; visit https://redux.js.org/Errors?code="+t+" for the full message or use the non-minified dev environment for full errors. "}var ht="function"==typeof Symbol&&Symbol.observable||"@@observable",gt=function(){return Math.random().toString(36).substring(7).split("").join(".")},bt={INIT:"@@redux/INIT"+gt(),REPLACE:"@@redux/REPLACE"+gt(),PROBE_UNKNOWN_ACTION:function(){return "@@redux/PROBE_UNKNOWN_ACTION"+gt()}};function mt(t){if("object"!=typeof t||null===t)return !1;for(var e=t;null!==Object.getPrototypeOf(e);)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e}function Ot(t,e,n){var r;if("function"==typeof e&&"function"==typeof n||"function"==typeof n&&"function"==typeof arguments[3])throw new Error(yt(0));if("function"==typeof e&&void 0===n&&(n=e,e=void 0),void 0!==n){if("function"!=typeof n)throw new Error(yt(1));return n(Ot)(t,e)}if("function"!=typeof t)throw new Error(yt(2));var o=t,i=e,u=[],c=u,a=!1;function f(){c===u&&(c=u.slice());}function l(){if(a)throw new Error(yt(3));return i}function s(t){if("function"!=typeof t)throw new Error(yt(4));if(a)throw new Error(yt(5));var e=!0;return f(),c.push(t),function(){if(e){if(a)throw new Error(yt(6));e=!1,f();var n=c.indexOf(t);c.splice(n,1),u=null;}}}function p(t){if(!mt(t))throw new Error(yt(7));if(void 0===t.type)throw new Error(yt(8));if(a)throw new Error(yt(9));try{a=!0,i=o(i,t);}finally{a=!1;}for(var e=u=c,n=0;n<e.length;n++)(0, e[n])();return t}function d(t){if("function"!=typeof t)throw new Error(yt(10));o=t,p({type:bt.REPLACE});}function v(){var t,e=s;return (t={subscribe:function(t){if("object"!=typeof t||null===t)throw new Error(yt(11));function n(){t.next&&t.next(l());}return n(),{unsubscribe:e(n)}}})[ht]=function(){return this},t}return p({type:bt.INIT}),(r={dispatch:p,subscribe:s,getState:l,replaceReducer:d})[ht]=v,r}function wt(t){for(var e=Object.keys(t),n={},r=0;r<e.length;r++){var o=e[r];"function"==typeof t[o]&&(n[o]=t[o]);}var i,u=Object.keys(n);try{!function(t){Object.keys(t).forEach((function(e){var n=t[e];if(void 0===n(void 0,{type:bt.INIT}))throw new Error(yt(12));if(void 0===n(void 0,{type:bt.PROBE_UNKNOWN_ACTION()}))throw new Error(yt(13))}));}(n);}catch(t){i=t;}return function(t,e){if(void 0===t&&(t={}),i)throw i;for(var r=!1,o={},c=0;c<u.length;c++){var a=u[c],f=t[a],l=(0, n[a])(f,e);if(void 0===l)throw new Error(yt(14));o[a]=l,r=r||l!==f;}return (r=r||u.length!==Object.keys(t).length)?o:t}}function jt(t,e){return function(){return e(t.apply(this,arguments))}}function Pt(t,e){if("function"==typeof t)return jt(t,e);if("object"!=typeof t||null===t)throw new Error(yt(16));var n={};for(var r in t){var o=t[r];"function"==typeof o&&(n[r]=jt(o,e));}return n}function Et(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return 0===e.length?function(t){return t}:1===e.length?e[0]:e.reduce((function(t,e){return function(){return t(e.apply(void 0,arguments))}}))}function At(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return function(t){return function(){var n=t.apply(void 0,arguments),r=function(){throw new Error(yt(15))},o={getState:n.getState,dispatch:function(){return r.apply(void 0,arguments)}},i=e.map((function(t){return t(o)}));return r=Et.apply(void 0,i)(n.dispatch),vt(vt({},n),{},{dispatch:r})}}}var St=function(t,e){return t===e};function _t(t,e){var n,r,o,i="object"==typeof e?e:{equalityCheck:e},u=i.equalityCheck,c=i.maxSize,a=void 0===c?1:c,f=i.resultEqualityCheck,l=(o=void 0===u?St:u,function(t,e){if(null===t||null===e||t.length!==e.length)return !1;for(var n=t.length,r=0;r<n;r++)if(!o(t[r],e[r]))return !1;return !0}),s=1===a?(n=l,{get:function(t){return r&&n(r.key,t)?r.value:"NOT_FOUND"},put:function(t,e){r={key:t,value:e};},getEntries:function(){return r?[r]:[]},clear:function(){r=void 0;}}):function(t,e){var n=[];function r(t){var r=n.findIndex((function(n){return e(t,n.key)}));if(r>-1){var o=n[r];return r>0&&(n.splice(r,1),n.unshift(o)),o.value}return "NOT_FOUND"}return {get:r,put:function(e,o){"NOT_FOUND"===r(e)&&(n.unshift({key:e,value:o}),n.length>t&&n.pop());},getEntries:function(){return n},clear:function(){n=[];}}}(a,l);function p(){var e=s.get(arguments);if("NOT_FOUND"===e){if(e=t.apply(null,arguments),f){var n=s.getEntries(),r=n.find((function(t){return f(t.value,e)}));r&&(e=r.value);}s.put(arguments,e);}return e}return p.clearCache=function(){return s.clear()},p}function xt(t){var e=Array.isArray(t[0])?t[0]:t;if(!e.every((function(t){return "function"==typeof t}))){var n=e.map((function(t){return "function"==typeof t?"function "+(t.name||"unnamed")+"()":typeof t})).join(", ");throw new Error("createSelector expects all input-selectors to be functions, but received the following types: ["+n+"]")}return e}function kt(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];var o=function(){for(var e=arguments.length,r=new Array(e),o=0;o<e;o++)r[o]=arguments[o];var i,u=0,c={memoizeOptions:void 0},a=r.pop();if("object"==typeof a&&(c=a,a=r.pop()),"function"!=typeof a)throw new Error("createSelector expects an output function after the inputs, but received: ["+typeof a+"]");var f=c,l=f.memoizeOptions,s=void 0===l?n:l,p=Array.isArray(s)?s:[s],d=xt(r),v=t.apply(void 0,[function(){return u++,a.apply(null,arguments)}].concat(p)),y=t((function(){for(var t=[],e=d.length,n=0;n<e;n++)t.push(d[n].apply(null,arguments));return i=v.apply(null,t)}));return Object.assign(y,{resultFunc:a,memoizedResultFunc:v,dependencies:d,lastResult:function(){return i},recomputations:function(){return u},resetRecomputations:function(){return u=0}}),y};return o}var It=kt(_t),Dt=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=It.apply(void 0,t),r=function(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];return n.apply(void 0,i([g(t)?J(t):t],e))};return r},Nt="undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(0!==arguments.length)return "object"==typeof arguments[0]?Et:Et.apply(null,arguments)};function Ct(t){if("object"!=typeof t||null===t)return !1;var e=Object.getPrototypeOf(t);if(null===e)return !0;for(var n=e;null!==Object.getPrototypeOf(n);)n=Object.getPrototypeOf(n);return e===n}function Tt(t){return function(e){var n=e.dispatch,r=e.getState;return function(e){return function(o){return "function"==typeof o?o(n,r,t):e(o)}}}}var Rt=Tt();Rt.withExtraArgument=Tt;var Mt=Rt,Ft=function(t){function e(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var o=t.apply(this,n)||this;return Object.setPrototypeOf(o,e.prototype),o}return r(e,t),Object.defineProperty(e,Symbol.species,{get:function(){return e},enumerable:!1,configurable:!0}),e.prototype.concat=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return t.prototype.concat.apply(this,e)},e.prototype.prepend=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return 1===t.length&&Array.isArray(t[0])?new(e.bind.apply(e,i([void 0],t[0].concat(this)))):new(e.bind.apply(e,i([void 0],t.concat(this))))},e}(Array);function qt(t){var e=typeof t;return "undefined"===e||null===t||"string"===e||"boolean"===e||"number"===e||Array.isArray(t)||Ct(t)}function zt(t,e,n,r,o){var i;if(void 0===e&&(e=""),void 0===n&&(n=qt),void 0===o&&(o=[]),!n(t))return {keyPath:e||"<root>",value:t};if("object"!=typeof t||null===t)return !1;for(var u=null!=r?r(t):Object.entries(t),c=o.length>0,a=0,f=u;a<f.length;a++){var l=f[a],s=l[0],p=l[1],d=e?e+"."+s:s;if(!(c&&o.indexOf(d)>=0)){if(!n(p))return {keyPath:d,value:p};if("object"==typeof p&&(i=zt(p,d,n,r,o)))return i}}return !1}function Ut(t){return function(){return function(t){return function(e){return t(e)}}}}function Lt(t){void 0===t&&(t={});var e=t.thunk,n=void 0===e||e,r=new Ft;return n&&r.push("boolean"==typeof n?Mt:Mt.withExtraArgument(n.extraArgument)),r}function Wt(t){var e,n=function(t){return Lt(t)},r=t||{},o=r.reducer,u=void 0===o?void 0:o,c=r.middleware,a=void 0===c?n():c,f=r.devTools,l=void 0===f||f,s=r.preloadedState,p=void 0===s?void 0:s,v=r.enhancers,y=void 0===v?void 0:v;if("function"==typeof u)e=u;else {if(!Ct(u))throw new Error('"reducer" is a required argument, and must be a function or an object of functions that can be passed to combineReducers');e=wt(u);}var h=a;"function"==typeof h&&(h=h(n));var g=At.apply(void 0,h),b=Et;l&&(b=Nt(d({trace:!1},"object"==typeof l&&l)));var m=[g];return Array.isArray(y)?m=i([g],y):"function"==typeof y&&(m=y(m)),Ot(e,p,b.apply(void 0,m))}function Kt(t,e){function n(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];if(e){var o=e.apply(void 0,n);if(!o)throw new Error("prepareAction did not return an object");return d(d({type:t,payload:o.payload},"meta"in o&&{meta:o.meta}),"error"in o&&{error:o.error})}return {type:t,payload:n[0]}}return n.toString=function(){return ""+t},n.type=t,n.match=function(e){return e.type===t},n}function Bt(t){return ["type","payload","error","meta"].indexOf(t)>-1}function Vt(t){return ""+t}function Xt(t){var e,n={},r=[],o={addCase:function(t,e){var r="string"==typeof t?t:t.type;if(r in n)throw new Error("addCase cannot be called with two reducers for the same action type");return n[r]=e,o},addMatcher:function(t,e){return r.push({matcher:t,reducer:e}),o},addDefaultCase:function(t){return e=t,o}};return t(o),[n,r,e]}function Gt(t,e,n,r){void 0===n&&(n=[]);var o,u="function"==typeof e?Xt(e):[e,n,r],c=u[0],a=u[1],f=u[2];if("function"==typeof t)o=function(){return st(t(),(function(){}))};else {var l=st(t,(function(){}));o=function(){return l};}function s(t,e){void 0===t&&(t=o());var n=i([c[e.type]],a.filter((function(t){return (0, t.matcher)(e)})).map((function(t){return t.reducer})));return 0===n.filter((function(t){return !!t})).length&&(n=[f]),n.reduce((function(t,n){if(n){var r;if(g(t))return void 0===(r=n(t,e))?t:r;if(b(t))return st(t,(function(t){return n(t,e)}));if(void 0===(r=n(t,e))){if(null===t)return t;throw Error("A case reducer on a non-draftable value must not return undefined")}return r}return t}),t)}return s.getInitialState=o,s}function Jt(t){var e=t.name;if(!e)throw new Error("`name` is a required option for createSlice");var n,r="function"==typeof t.initialState?t.initialState:st(t.initialState,(function(){})),o=t.reducers||{},i=Object.keys(o),u={},c={},a={};function f(){var e="function"==typeof t.extraReducers?Xt(t.extraReducers):[t.extraReducers],n=e[0],o=e[1],i=void 0===o?[]:o,u=e[2],a=void 0===u?void 0:u,f=d(d({},void 0===n?{}:n),c);return Gt(r,f,i,a)}return i.forEach((function(t){var n,r,i=o[t],f=e+"/"+t;"reducer"in i?(n=i.reducer,r=i.prepare):n=i,u[t]=n,c[f]=n,a[t]=r?Kt(f,r):Kt(f);})),{name:e,reducer:function(t,e){return n||(n=f()),n(t,e)},actions:a,caseReducers:u,getInitialState:function(){return n||(n=f()),n.getInitialState()}}}function $t(t){return "object"!=typeof t||null==t||Object.isFrozen(t)}function Ht(t){return function(){return function(t){return function(e){return t(e)}}}}function Qt(t){return function(e,n){var r=function(e){var r;Ct(r=n)&&"string"==typeof r.type&&Object.keys(r).every(Bt)?t(n.payload,e):t(n,e);};return g(e)?(r(e),e):st(e,r)}}function Yt(t,e){return e(t)}function Zt(t){return Array.isArray(t)||(t=Object.values(t)),t}function te(t,e,n){for(var r=[],o=[],i=0,u=t=Zt(t);i<u.length;i++){var c=u[i],a=Yt(c,e);a in n.entities?o.push({id:a,changes:c}):r.push(c);}return [r,o]}function ee(t){function e(e,n){var r=Yt(e,t);r in n.entities||(n.ids.push(r),n.entities[r]=e);}function n(t,n){for(var r=0,o=t=Zt(t);r<o.length;r++)e(o[r],n);}function r(e,n){var r=Yt(e,t);r in n.entities||n.ids.push(r),n.entities[r]=e;}function o(t,e){var n=!1;t.forEach((function(t){t in e.entities&&(delete e.entities[t],n=!0);})),n&&(e.ids=e.ids.filter((function(t){return t in e.entities})));}function i(e,n){var r={},o={};if(e.forEach((function(t){t.id in n.entities&&(o[t.id]={id:t.id,changes:d(d({},o[t.id]?o[t.id].changes:null),t.changes)});})),(e=Object.values(o)).length>0){var i=e.filter((function(e){return function(e,n,r){var o=Object.assign({},r.entities[n.id],n.changes),i=Yt(o,t),u=i!==n.id;return u&&(e[n.id]=i,delete r.entities[n.id]),r.entities[i]=o,u}(r,e,n)})).length>0;i&&(n.ids=n.ids.map((function(t){return r[t]||t})));}}function u(e,r){var o=te(e,t,r),u=o[0];i(o[1],r),n(u,r);}return {removeAll:(c=function(t){Object.assign(t,{ids:[],entities:{}});},a=Qt((function(t,e){return c(e)})),function(t){return a(t,void 0)}),addOne:Qt(e),addMany:Qt(n),setOne:Qt(r),setMany:Qt((function(t,e){for(var n=0,o=t=Zt(t);n<o.length;n++)r(o[n],e);})),setAll:Qt((function(t,e){t=Zt(t),e.ids=[],e.entities={},n(t,e);})),updateOne:Qt((function(t,e){return i([t],e)})),updateMany:Qt(i),upsertOne:Qt((function(t,e){return u([t],e)})),upsertMany:Qt(u),removeOne:Qt((function(t,e){return o([t],e)})),removeMany:Qt(o)};var c,a;}function ne(t){void 0===t&&(t={});var e=d({sortComparer:!1,selectId:function(t){return t.id}},t),n=e.selectId,r=e.sortComparer,o={getInitialState:function(t){return void 0===t&&(t={}),Object.assign({ids:[],entities:{}},t)}},i={getSelectors:function(t){var e=function(t){return t.ids},n=function(t){return t.entities},r=Dt(e,n,(function(t,e){return t.map((function(t){return e[t]}))})),o=function(t,e){return e},i=function(t,e){return t[e]},u=Dt(e,(function(t){return t.length}));if(!t)return {selectIds:e,selectEntities:n,selectAll:r,selectTotal:u,selectById:Dt(n,o,i)};var c=Dt(t,n);return {selectIds:Dt(t,e),selectEntities:c,selectAll:Dt(t,r),selectTotal:Dt(t,u),selectById:Dt(c,o,i)}}},u=r?function(t,e){var n=ee(t);function r(e,n){var r=(e=Zt(e)).filter((function(e){return !(Yt(e,t)in n.entities)}));0!==r.length&&c(r,n);}function o(t,e){0!==(t=Zt(t)).length&&c(t,e);}function i(e,n){var r=[];e.forEach((function(e){return function(e,n,r){if(!(n.id in r.entities))return !1;var o=Object.assign({},r.entities[n.id],n.changes),i=Yt(o,t);return delete r.entities[n.id],e.push(o),i!==n.id}(r,e,n)})),0!==r.length&&c(r,n);}function u(e,n){var o=te(e,t,n),u=o[0];i(o[1],n),r(u,n);}function c(n,r){n.forEach((function(e){r.entities[t(e)]=e;}));var o=Object.values(r.entities);o.sort(e);var i=o.map(t);(function(t,e){if(t.length!==e.length)return !1;for(var n=0;n<t.length&&n<e.length;n++)if(t[n]!==e[n])return !1;return !0})(r.ids,i)||(r.ids=i);}return {removeOne:n.removeOne,removeMany:n.removeMany,removeAll:n.removeAll,addOne:Qt((function(t,e){return r([t],e)})),updateOne:Qt((function(t,e){return i([t],e)})),upsertOne:Qt((function(t,e){return u([t],e)})),setOne:Qt((function(t,e){return o([t],e)})),setMany:Qt(o),setAll:Qt((function(t,e){t=Zt(t),e.entities={},e.ids=[],r(t,e);})),addMany:Qt(r),updateMany:Qt(i),upsertMany:Qt(u)}}(n,r):ee(n);return d(d(d({selectId:n,sortComparer:r},o),i),u)}var re=function(t){void 0===t&&(t=21);for(var e="",n=t;n--;)e+="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW"[64*Math.random()|0];return e},oe=["name","message","stack","code"],ie=function(t,e){this.payload=t,this.meta=e;},ue=function(t,e){this.payload=t,this.meta=e;},ce=function(t){if("object"==typeof t&&null!==t){for(var e={},n=0,r=oe;n<r.length;n++){var o=r[n];"string"==typeof t[o]&&(e[o]=t[o]);}return e}return {message:String(t)}};function ae(t,e,n){var r=Kt(t+"/fulfilled",(function(t,e,n,r){return {payload:t,meta:v(d({},r||{}),{arg:n,requestId:e,requestStatus:"fulfilled"})}})),i=Kt(t+"/pending",(function(t,e,n){return {payload:void 0,meta:v(d({},n||{}),{arg:e,requestId:t,requestStatus:"pending"})}})),u=Kt(t+"/rejected",(function(t,e,r,o,i){return {payload:o,error:(n&&n.serializeError||ce)(t||"Rejected"),meta:v(d({},i||{}),{arg:r,requestId:e,rejectedWithValue:!!o,requestStatus:"rejected",aborted:"AbortError"===(null==t?void 0:t.name),condition:"ConditionError"===(null==t?void 0:t.name)})}})),c="undefined"!=typeof AbortController?AbortController:function(){function t(){this.signal={aborted:!1,addEventListener:function(){},dispatchEvent:function(){return !1},onabort:function(){},removeEventListener:function(){}};}return t.prototype.abort=function(){},t}();return Object.assign((function(t){return function(a,f,l){var s,p=(null==n?void 0:n.idGenerator)?n.idGenerator(t):re(),d=new c,v=new Promise((function(t,e){return d.signal.addEventListener("abort",(function(){return e({name:"AbortError",message:s||"Aborted"})}))})),h=!1,g=function(){return y(this,null,(function(){var c,s,y,g,b;return o(this,(function(o){switch(o.label){case 0:return o.trys.push([0,4,,5]),null===(m=g=null==(c=null==n?void 0:n.condition)?void 0:c.call(n,t,{getState:f,extra:l}))||"object"!=typeof m||"function"!=typeof m.then?[3,2]:[4,g];case 1:g=o.sent(),o.label=2;case 2:if(!1===g)throw {name:"ConditionError",message:"Aborted due to condition callback returning false."};return h=!0,a(i(p,t,null==(s=null==n?void 0:n.getPendingMeta)?void 0:s.call(n,{requestId:p,arg:t},{getState:f,extra:l}))),[4,Promise.race([v,Promise.resolve(e(t,{dispatch:a,getState:f,extra:l,requestId:p,signal:d.signal,rejectWithValue:function(t,e){return new ie(t,e)},fulfillWithValue:function(t,e){return new ue(t,e)}})).then((function(e){if(e instanceof ie)throw e;return e instanceof ue?r(e.payload,p,t,e.meta):r(e,p,t)}))])];case 3:return y=o.sent(),[3,5];case 4:return b=o.sent(),y=b instanceof ie?u(null,p,t,b.payload,b.meta):u(b,p,t),[3,5];case 5:return n&&!n.dispatchConditionRejection&&u.match(y)&&y.meta.condition||a(y),[2,y]}var m;}))}))}();return Object.assign(g,{abort:function(t){h&&(s=t,d.abort());},requestId:p,arg:t,unwrap:function(){return g.then(fe)}})}}),{pending:i,rejected:u,fulfilled:r,typePrefix:t})}function fe(t){if(t.meta&&t.meta.rejectedWithValue)throw t.payload;if(t.error)throw t.error;return t.payload}var le=function(t,e){return (n=t)&&"function"==typeof n.match?t.match(e):t(e);var n;};function se(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(e){return t.some((function(t){return le(t,e)}))}}function pe(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(e){return t.every((function(t){return le(t,e)}))}}function de(t,e){if(!t||!t.meta)return !1;var n="string"==typeof t.meta.requestId,r=e.indexOf(t.meta.requestStatus)>-1;return n&&r}function ve(t){return "function"==typeof t[0]&&"pending"in t[0]&&"fulfilled"in t[0]&&"rejected"in t[0]}function ye(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return 0===t.length?function(t){return de(t,["pending"])}:ve(t)?function(e){var n=t.map((function(t){return t.pending}));return se.apply(void 0,n)(e)}:ye()(t[0])}function he(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return 0===t.length?function(t){return de(t,["rejected"])}:ve(t)?function(e){var n=t.map((function(t){return t.rejected}));return se.apply(void 0,n)(e)}:he()(t[0])}function ge(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=function(t){return t&&t.meta&&t.meta.rejectedWithValue};return 0===t.length||ve(t)?function(e){return pe(he.apply(void 0,t),n)(e)}:ge()(t[0])}function be(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return 0===t.length?function(t){return de(t,["fulfilled"])}:ve(t)?function(e){var n=t.map((function(t){return t.fulfilled}));return se.apply(void 0,n)(e)}:be()(t[0])}function me(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return 0===t.length?function(t){return de(t,["pending","fulfilled","rejected"])}:ve(t)?function(e){for(var n=[],r=0,o=t;r<o.length;r++){var i=o[r];n.push(i.pending,i.rejected,i.fulfilled);}return se.apply(void 0,n)(e)}:me()(t[0])}var Oe=function(t,e){if("function"!=typeof t)throw new TypeError(e+" is not a function")},we=function(){},je=function(t,e){return void 0===e&&(e=we),t.catch(e),t},Pe=function(t,e){t.addEventListener("abort",e,{once:!0});},Ee=function(t,e){var n=t.signal;n.aborted||("reason"in n||Object.defineProperty(n,"reason",{enumerable:!0,value:e,configurable:!0,writable:!0}),t.abort(e));},Ae=function(t){this.code=t,this.name="TaskAbortError",this.message="task cancelled (reason: "+t+")";},Se=function(t){if(t.aborted)throw new Ae(t.reason)},_e=function(t){return je(new Promise((function(e,n){var r=function(){return n(new Ae(t.reason))};t.aborted?r():Pe(t,r);})))},xe=function(t){return function(e){return je(Promise.race([_e(t),e]).then((function(e){return Se(t),e})))}},ke=function(t){var e=xe(t);return function(t){return e(new Promise((function(e){return setTimeout(e,t)})))}},Ie=Object.assign,De={},Ne="listenerMiddleware",Ce=function(t){var e=t.type,n=t.actionCreator,r=t.matcher,o=t.predicate,i=t.effect;if(e)o=Kt(e).match;else if(n)e=n.type,o=n.match;else if(r)o=r;else if(!o)throw new Error("Creating or removing a listener requires one of the known fields for matching an action");return Oe(i,"options.listener"),{predicate:o,type:e,effect:i}},Te=function(t,e,n){try{t(e,n);}catch(t){setTimeout((function(){throw t}),0);}},Re=Kt(Ne+"/add"),Me=Kt(Ne+"/removeAll"),Fe=Kt(Ne+"/remove"),qe=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];console.error.apply(console,i([Ne+"/error"],t));};function ze(t){var e=this;void 0===t&&(t={});var n=new Map,r=t.extra,i=t.onError,u=void 0===i?qe:i;Oe(u,"onError");var c=function(t){for(var e=0,r=n.values();e<r.length;e++){var o=r[e];if(t(o))return o}},a=function(t){var e=c((function(e){return e.effect===t.effect}));return e||(e=function(t){var e=Ce(t),n=e.type,r=e.predicate,o=e.effect;return {id:re(),effect:o,type:n,predicate:r,pending:new Set,unsubscribe:function(){throw new Error("Unsubscribe not initialized")}}}(t)),function(t){return t.unsubscribe=function(){return n.delete(t.id)},n.set(t.id,t),t.unsubscribe}(e)},f=function(t){var e=Ce(t),n=e.type,r=e.effect,o=e.predicate,i=c((function(t){return ("string"==typeof n?t.type===n:t.predicate===o)&&t.effect===r}));return null==i||i.unsubscribe(),!!i},l=function(t,i,c,f){return y(e,null,(function(){var e,l,s;return o(this,(function(p){switch(p.label){case 0:e=new AbortController,l=function(t,e){return function(n,r){return je(function(n,r){return y(void 0,null,(function(){var i,u,c,a;return o(this,(function(o){switch(o.label){case 0:Se(e),i=function(){},u=new Promise((function(e){i=t({predicate:n,effect:function(t,n){n.unsubscribe(),e([t,n.getState(),n.getOriginalState()]);}});})),c=[_e(e),u],null!=r&&c.push(new Promise((function(t){return setTimeout(t,r,null)}))),o.label=1;case 1:return o.trys.push([1,,3,4]),[4,Promise.race(c)];case 2:return a=o.sent(),Se(e),[2,a];case 3:return i(),[7];case 4:return [2]}}))}))}(n,r))}}(a,e.signal),p.label=1;case 1:return p.trys.push([1,3,4,5]),t.pending.add(e),[4,Promise.resolve(t.effect(i,Ie({},c,{getOriginalState:f,condition:function(t,e){return l(t,e).then(Boolean)},take:l,delay:ke(e.signal),pause:xe(e.signal),extra:r,signal:e.signal,fork:(d=e.signal,function(t){Oe(t,"taskExecutor");var e,n=new AbortController;e=n,Pe(d,(function(){return Ee(e,d.reason)}));var r,i,u=(r=function(){return y(void 0,null,(function(){var e;return o(this,(function(r){switch(r.label){case 0:return Se(d),Se(n.signal),[4,t({pause:xe(n.signal),delay:ke(n.signal),signal:n.signal})];case 1:return e=r.sent(),Se(n.signal),[2,e]}}))}))},i=function(){return Ee(n,"task-completed")},y(void 0,null,(function(){var t;return o(this,(function(e){switch(e.label){case 0:return e.trys.push([0,3,4,5]),[4,Promise.resolve()];case 1:return e.sent(),[4,r()];case 2:return [2,{status:"ok",value:e.sent()}];case 3:return [2,{status:(t=e.sent())instanceof Ae?"cancelled":"rejected",error:t}];case 4:return null==i||i(),[7];case 5:return [2]}}))})));return {result:xe(d)(u),cancel:function(){Ee(n,"task-cancelled");}}}),unsubscribe:t.unsubscribe,subscribe:function(){n.set(t.id,t);},cancelActiveListeners:function(){t.pending.forEach((function(t,n,r){t!==e&&(Ee(t,"listener-cancelled"),r.delete(t));}));}})))];case 2:return p.sent(),[3,5];case 3:return (s=p.sent())instanceof Ae||Te(u,s,{raisedBy:"effect"}),[3,5];case 4:return Ee(e,"listener-completed"),t.pending.delete(e),[7];case 5:return [2]}var d;}))}))},s=function(t){return function(){t.forEach((function(t){t.pending.forEach((function(t){Ee(t,"listener-cancelled");}));})),t.clear();}}(n);return {middleware:function(t){return function(e){return function(r){if(Re.match(r))return a(r.payload);if(!Me.match(r)){if(Fe.match(r))return f(r.payload);var o,i=t.getState(),c=function(){if(i===De)throw new Error(Ne+": getOriginalState can only be called synchronously");return i};try{if(o=e(r),n.size>0)for(var p=t.getState(),d=Array.from(n.values()),v=0,y=d;v<y.length;v++){var h=y[v],g=!1;try{g=h.predicate(r,p,i);}catch(t){g=!1,Te(u,t,{raisedBy:"predicate"});}g&&l(h,r,t,c);}}finally{i=De;}return o}s();}}},startListening:a,stopListening:f,clearListeners:s}}!function(){function t(t,e){var n=o[t];return n?n.enumerable=e:o[t]=n={configurable:!0,enumerable:e,get:function(){return ct.get(this[nt],t)},set:function(e){ct.set(this[nt],t,e);}},n}function e(t){for(var e=t.length-1;e>=0;e--){var o=t[e][nt];if(!o.P)switch(o.i){case 5:r(o)&&V(o);break;case 4:n(o)&&V(o);}}}function n(t){for(var e=t.t,n=t.k,r=ot(n),o=r.length-1;o>=0;o--){var i=r[o];if(i!==nt){var u=e[i];if(void 0===u&&!j(e,i))return !0;var c=n[i],a=c&&c[nt];if(a?a.t!==u:!E(c,u))return !0}}var f=!!e[nt];return r.length!==ot(e).length+(f?0:1)}function r(t){var e=t.k;if(e.length!==t.t.length)return !0;var n=Object.getOwnPropertyDescriptor(e,e.length-1);return !(!n||n.get)}var o={};ut.ES5||(ut.ES5={J:function(e,n){var r=Array.isArray(e),o=function(e,n){if(e){for(var r=Array(n.length),o=0;o<n.length;o++)Object.defineProperty(r,""+o,t(o,!0));return r}var i=it(n);delete i[nt];for(var u=ot(i),c=0;c<u.length;c++){var a=u[c];i[a]=t(a,e||!!i[a].enumerable);}return Object.create(Object.getPrototypeOf(n),i)}(r,e),i={i:r?5:4,A:n?n.A:C(),P:!1,I:!1,D:{},l:n,t:e,k:o,o:null,O:!1,C:!1};return Object.defineProperty(o,nt,{value:i,writable:!0}),o},S:function(t,n,o){o?g(n)&&n[nt].A===t&&e(t.p):(t.u&&function t(e){if(e&&"object"==typeof e){var n=e[nt];if(n){var o=n.t,i=n.k,u=n.D,c=n.i;if(4===c)O(i,(function(e){e!==nt&&(void 0!==o[e]||j(o,e)?u[e]||t(i[e]):(u[e]=!0,V(n)));})),O(o,(function(t){void 0!==i[t]||j(i,t)||(u[t]=!1,V(n));}));else if(5===c){if(r(n)&&(V(n),u.length=!0),i.length<o.length)for(var a=i.length;a<o.length;a++)u[a]=!1;else for(var f=o.length;f<i.length;f++)u[f]=!0;for(var l=Math.min(i.length,o.length),s=0;s<l;s++)void 0===u[s]&&t(i[s]);}}}}(t.p[0]),e(t.p));},K:function(t){return 4===t.i?n(t):r(t)}});}();
var t,e,n,r=undefined&&undefined.__extends||(t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e;}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);},t(e,n)},function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e;}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r);}),o=undefined&&undefined.__generator||function(t,e){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function c(i){return function(c){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!((o=(o=u.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=e.call(t,u);}catch(t){i=[6,t],r=0;}finally{n=o=0;}if(5&i[0])throw i[1];return {value:i[0]?i[1]:void 0,done:!0}}([i,c])}}},i=undefined&&undefined.__spreadArray||function(t,e){for(var n=0,r=e.length,o=t.length;n<r;n++,o++)t[o]=e[n];return t},u=Object.defineProperty,c=Object.defineProperties,a=Object.getOwnPropertyDescriptors,f=Object.getOwnPropertySymbols,l=Object.prototype.hasOwnProperty,s=Object.prototype.propertyIsEnumerable,p=function(t,e,n){return e in t?u(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n},d=function(t,e){for(var n in e||(e={}))l.call(e,n)&&p(t,n,e[n]);if(f)for(var r=0,o=f(e);r<o.length;r++)s.call(e,n=o[r])&&p(t,n,e[n]);return t},v=function(t,e){return c(t,a(e))},y=function(t,e,n){return new Promise((function(r,o){var i=function(t){try{c(n.next(t));}catch(t){o(t);}},u=function(t){try{c(n.throw(t));}catch(t){o(t);}},c=function(t){return t.done?r(t.value):Promise.resolve(t.value).then(i,u)};c((n=n.apply(t,e)).next());}))};function h(t){for(var e=arguments.length,n=Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];throw Error("[Immer] minified error nr: "+t+(n.length?" "+n.map((function(t){return "'"+t+"'"})).join(","):"")+". Find the full error at: https://bit.ly/3cXEKWf")}function g(t){return !!t&&!!t[nt]}function b(t){return !!t&&(function(t){if(!t||"object"!=typeof t)return !1;var e=Object.getPrototypeOf(t);if(null===e)return !0;var n=Object.hasOwnProperty.call(e,"constructor")&&e.constructor;return n===Object||"function"==typeof n&&Function.toString.call(n)===rt}(t)||Array.isArray(t)||!!t[et]||!!t.constructor[et]||A(t)||S(t))}function m(t){return g(t)||h(23,t),t[nt].t}function O(t,e,n){void 0===n&&(n=!1),0===w(t)?(n?Object.keys:ot)(t).forEach((function(r){n&&"symbol"==typeof r||e(r,t[r],t);})):t.forEach((function(n,r){return e(r,n,t)}));}function w(t){var e=t[nt];return e?e.i>3?e.i-4:e.i:Array.isArray(t)?1:A(t)?2:S(t)?3:0}function j(t,e){return 2===w(t)?t.has(e):Object.prototype.hasOwnProperty.call(t,e)}function P(t,e,n){var r=w(t);2===r?t.set(e,n):3===r?(t.delete(e),t.add(n)):t[e]=n;}function E(t,e){return t===e?0!==t||1/t==1/e:t!=t&&e!=e}function A(t){return Q&&t instanceof Map}function S(t){return Y&&t instanceof Set}function _(t){return t.o||t.t}function x(t){if(Array.isArray(t))return Array.prototype.slice.call(t);var e=it(t);delete e[nt];for(var n=ot(e),r=0;r<n.length;r++){var o=n[r],i=e[o];!1===i.writable&&(i.writable=!0,i.configurable=!0),(i.get||i.set)&&(e[o]={configurable:!0,writable:!0,enumerable:i.enumerable,value:t[o]});}return Object.create(Object.getPrototypeOf(t),e)}function k(t,e){return void 0===e&&(e=!1),D(t)||g(t)||!b(t)||(w(t)>1&&(t.set=t.add=t.clear=t.delete=I),Object.freeze(t),e&&O(t,(function(t,e){return k(e,!0)}),!0)),t}function I(){h(2);}function D(t){return null==t||"object"!=typeof t||Object.isFrozen(t)}function N(t){var e=ut[t];return e||h(18,t),e}function C(){return n}function T(t,e){e&&(N("Patches"),t.u=[],t.s=[],t.v=e);}function R(t){M(t),t.p.forEach(q),t.p=null;}function M(t){t===n&&(n=t.l);}function F(t){return n={p:[],l:n,h:t,m:!0,_:0}}function q(t){var e=t[nt];0===e.i||1===e.i?e.j():e.O=!0;}function z(t,e){e._=e.p.length;var n=e.p[0],r=void 0!==t&&t!==n;return e.h.g||N("ES5").S(e,t,r),r?(n[nt].P&&(R(e),h(4)),b(t)&&(t=U(e,t),e.l||W(e,t)),e.u&&N("Patches").M(n[nt],t,e.u,e.s)):t=U(e,n,[]),R(e),e.u&&e.v(e.u,e.s),t!==tt?t:void 0}function U(t,e,n){if(D(e))return e;var r=e[nt];if(!r)return O(e,(function(o,i){return L(t,r,e,o,i,n)}),!0),e;if(r.A!==t)return e;if(!r.P)return W(t,r.t,!0),r.t;if(!r.I){r.I=!0,r.A._--;var o=4===r.i||5===r.i?r.o=x(r.k):r.o;O(3===r.i?new Set(o):o,(function(e,i){return L(t,r,o,e,i,n)})),W(t,o,!1),n&&t.u&&N("Patches").R(r,n,t.u,t.s);}return r.o}function L(t,e,n,r,o,i){if(g(o)){var u=U(t,o,i&&e&&3!==e.i&&!j(e.D,r)?i.concat(r):void 0);if(P(n,r,u),!g(u))return;t.m=!1;}if(b(o)&&!D(o)){if(!t.h.F&&t._<1)return;U(t,o),e&&e.A.l||W(t,o);}}function W(t,e,n){void 0===n&&(n=!1),t.h.F&&t.m&&k(e,n);}function K(t,e){var n=t[nt];return (n?_(n):t)[e]}function B(t,e){if(e in t)for(var n=Object.getPrototypeOf(t);n;){var r=Object.getOwnPropertyDescriptor(n,e);if(r)return r;n=Object.getPrototypeOf(n);}}function V(t){t.P||(t.P=!0,t.l&&V(t.l));}function X(t){t.o||(t.o=x(t.t));}function G(t,e,n){var r=A(e)?N("MapSet").N(e,n):S(e)?N("MapSet").T(e,n):t.g?function(t,e){var n=Array.isArray(t),r={i:n?1:0,A:e?e.A:C(),P:!1,I:!1,D:{},l:e,t:t,k:null,o:null,j:null,C:!1},o=r,i=ct;n&&(o=[r],i=at);var u=Proxy.revocable(o,i),c=u.revoke,a=u.proxy;return r.k=a,r.j=c,a}(e,n):N("ES5").J(e,n);return (n?n.A:C()).p.push(r),r}function J(t){return g(t)||h(22,t),function t(e){if(!b(e))return e;var n,r=e[nt],o=w(e);if(r){if(!r.P&&(r.i<4||!N("ES5").K(r)))return r.t;r.I=!0,n=$(e,o),r.I=!1;}else n=$(e,o);return O(n,(function(e,o){r&&function(t,e){return 2===w(t)?t.get(e):t[e]}(r.t,e)===o||P(n,e,t(o));})),3===o?new Set(n):n}(t)}function $(t,e){switch(e){case 2:return new Map(t);case 3:return Array.from(t)}return x(t)}var H="undefined"!=typeof Symbol&&"symbol"==typeof Symbol("x"),Q="undefined"!=typeof Map,Y="undefined"!=typeof Set,Z="undefined"!=typeof Proxy&&void 0!==Proxy.revocable&&"undefined"!=typeof Reflect,tt=H?Symbol.for("immer-nothing"):((e={})["immer-nothing"]=!0,e),et=H?Symbol.for("immer-draftable"):"__$immer_draftable",nt=H?Symbol.for("immer-state"):"__$immer_state",rt=(""+Object.prototype.constructor),ot="undefined"!=typeof Reflect&&Reflect.ownKeys?Reflect.ownKeys:void 0!==Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:Object.getOwnPropertyNames,it=Object.getOwnPropertyDescriptors||function(t){var e={};return ot(t).forEach((function(n){e[n]=Object.getOwnPropertyDescriptor(t,n);})),e},ut={},ct={get:function(t,e){if(e===nt)return t;var n,r,o,i=_(t);if(!j(i,e))return n=t,(o=B(i,e))?"value"in o?o.value:null===(r=o.get)||void 0===r?void 0:r.call(n.k):void 0;var u=i[e];return t.I||!b(u)?u:u===K(t.t,e)?(X(t),t.o[e]=G(t.A.h,u,t)):u},has:function(t,e){return e in _(t)},ownKeys:function(t){return Reflect.ownKeys(_(t))},set:function(t,e,n){var r=B(_(t),e);if(null==r?void 0:r.set)return r.set.call(t.k,n),!0;if(!t.P){var o=K(_(t),e),i=null==o?void 0:o[nt];if(i&&i.t===n)return t.o[e]=n,t.D[e]=!1,!0;if(E(n,o)&&(void 0!==n||j(t.t,e)))return !0;X(t),V(t);}return t.o[e]===n&&"number"!=typeof n&&(void 0!==n||e in t.o)||(t.o[e]=n,t.D[e]=!0,!0)},deleteProperty:function(t,e){return void 0!==K(t.t,e)||e in t.t?(t.D[e]=!1,X(t),V(t)):delete t.D[e],t.o&&delete t.o[e],!0},getOwnPropertyDescriptor:function(t,e){var n=_(t),r=Reflect.getOwnPropertyDescriptor(n,e);return r?{writable:!0,configurable:1!==t.i||"length"!==e,enumerable:r.enumerable,value:n[e]}:r},defineProperty:function(){h(11);},getPrototypeOf:function(t){return Object.getPrototypeOf(t.t)},setPrototypeOf:function(){h(12);}},at={};O(ct,(function(t,e){at[t]=function(){return arguments[0]=arguments[0][0],e.apply(this,arguments)};})),at.deleteProperty=function(t,e){return ct.deleteProperty.call(this,t[0],e)},at.set=function(t,e,n){return ct.set.call(this,t[0],e,n,t[0])};var ft=new(function(){function t(t){var e=this;this.g=Z,this.F=!0,this.produce=function(t,n,r){if("function"==typeof t&&"function"!=typeof n){var o=n;n=t;var i=e;return function(t){var e=this;void 0===t&&(t=o);for(var r=arguments.length,u=Array(r>1?r-1:0),c=1;c<r;c++)u[c-1]=arguments[c];return i.produce(t,(function(t){var r;return (r=n).call.apply(r,[e,t].concat(u))}))}}var u;if("function"!=typeof n&&h(6),void 0!==r&&"function"!=typeof r&&h(7),b(t)){var c=F(e),a=G(e,t,void 0),f=!0;try{u=n(a),f=!1;}finally{f?R(c):M(c);}return "undefined"!=typeof Promise&&u instanceof Promise?u.then((function(t){return T(c,r),z(t,c)}),(function(t){throw R(c),t})):(T(c,r),z(u,c))}if(!t||"object"!=typeof t){if((u=n(t))===tt)return;return void 0===u&&(u=t),e.F&&k(u,!0),u}h(21,t);},this.produceWithPatches=function(t,n){return "function"==typeof t?function(n){for(var r=arguments.length,o=Array(r>1?r-1:0),i=1;i<r;i++)o[i-1]=arguments[i];return e.produceWithPatches(n,(function(e){return t.apply(void 0,[e].concat(o))}))}:[e.produce(t,n,(function(t,e){r=t,o=e;})),r,o];var r,o;},"boolean"==typeof(null==t?void 0:t.useProxies)&&this.setUseProxies(t.useProxies),"boolean"==typeof(null==t?void 0:t.autoFreeze)&&this.setAutoFreeze(t.autoFreeze);}var e=t.prototype;return e.createDraft=function(t){b(t)||h(8),g(t)&&(t=J(t));var e=F(this),n=G(this,t,void 0);return n[nt].C=!0,M(e),n},e.finishDraft=function(t,e){var n=(t&&t[nt]).A;return T(n,e),z(void 0,n)},e.setAutoFreeze=function(t){this.F=t;},e.setUseProxies=function(t){t&&!Z&&h(20),this.g=t;},e.applyPatches=function(t,e){var n;for(n=e.length-1;n>=0;n--){var r=e[n];if(0===r.path.length&&"replace"===r.op){t=r.value;break}}n>-1&&(e=e.slice(n+1));var o=N("Patches").$;return g(t)?o(t,e):this.produce(t,(function(t){return o(t,e)}))},t}()),lt=ft.produce,st=(ft.produceWithPatches.bind(ft),ft.setAutoFreeze.bind(ft),ft.setUseProxies.bind(ft),ft.applyPatches.bind(ft),ft.createDraft.bind(ft),ft.finishDraft.bind(ft),lt);function pt(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function dt(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r);}return n}function vt(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?dt(Object(n),!0).forEach((function(e){pt(t,e,n[e]);})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):dt(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e));}));}return t}function yt(t){return "Minified Redux error #"+t+"; visit https://redux.js.org/Errors?code="+t+" for the full message or use the non-minified dev environment for full errors. "}var ht="function"==typeof Symbol&&Symbol.observable||"@@observable",gt=function(){return Math.random().toString(36).substring(7).split("").join(".")},bt={INIT:"@@redux/INIT"+gt(),REPLACE:"@@redux/REPLACE"+gt(),PROBE_UNKNOWN_ACTION:function(){return "@@redux/PROBE_UNKNOWN_ACTION"+gt()}};function mt(t){if("object"!=typeof t||null===t)return !1;for(var e=t;null!==Object.getPrototypeOf(e);)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e}function Ot(t,e,n){var r;if("function"==typeof e&&"function"==typeof n||"function"==typeof n&&"function"==typeof arguments[3])throw new Error(yt(0));if("function"==typeof e&&void 0===n&&(n=e,e=void 0),void 0!==n){if("function"!=typeof n)throw new Error(yt(1));return n(Ot)(t,e)}if("function"!=typeof t)throw new Error(yt(2));var o=t,i=e,u=[],c=u,a=!1;function f(){c===u&&(c=u.slice());}function l(){if(a)throw new Error(yt(3));return i}function s(t){if("function"!=typeof t)throw new Error(yt(4));if(a)throw new Error(yt(5));var e=!0;return f(),c.push(t),function(){if(e){if(a)throw new Error(yt(6));e=!1,f();var n=c.indexOf(t);c.splice(n,1),u=null;}}}function p(t){if(!mt(t))throw new Error(yt(7));if(void 0===t.type)throw new Error(yt(8));if(a)throw new Error(yt(9));try{a=!0,i=o(i,t);}finally{a=!1;}for(var e=u=c,n=0;n<e.length;n++)(0, e[n])();return t}function d(t){if("function"!=typeof t)throw new Error(yt(10));o=t,p({type:bt.REPLACE});}function v(){var t,e=s;return (t={subscribe:function(t){if("object"!=typeof t||null===t)throw new Error(yt(11));function n(){t.next&&t.next(l());}return n(),{unsubscribe:e(n)}}})[ht]=function(){return this},t}return p({type:bt.INIT}),(r={dispatch:p,subscribe:s,getState:l,replaceReducer:d})[ht]=v,r}function wt(t){for(var e=Object.keys(t),n={},r=0;r<e.length;r++){var o=e[r];"function"==typeof t[o]&&(n[o]=t[o]);}var i,u=Object.keys(n);try{!function(t){Object.keys(t).forEach((function(e){var n=t[e];if(void 0===n(void 0,{type:bt.INIT}))throw new Error(yt(12));if(void 0===n(void 0,{type:bt.PROBE_UNKNOWN_ACTION()}))throw new Error(yt(13))}));}(n);}catch(t){i=t;}return function(t,e){if(void 0===t&&(t={}),i)throw i;for(var r=!1,o={},c=0;c<u.length;c++){var a=u[c],f=t[a],l=(0, n[a])(f,e);if(void 0===l)throw new Error(yt(14));o[a]=l,r=r||l!==f;}return (r=r||u.length!==Object.keys(t).length)?o:t}}function jt(t,e){return function(){return e(t.apply(this,arguments))}}function Pt(t,e){if("function"==typeof t)return jt(t,e);if("object"!=typeof t||null===t)throw new Error(yt(16));var n={};for(var r in t){var o=t[r];"function"==typeof o&&(n[r]=jt(o,e));}return n}function Et(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return 0===e.length?function(t){return t}:1===e.length?e[0]:e.reduce((function(t,e){return function(){return t(e.apply(void 0,arguments))}}))}function At(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return function(t){return function(){var n=t.apply(void 0,arguments),r=function(){throw new Error(yt(15))},o={getState:n.getState,dispatch:function(){return r.apply(void 0,arguments)}},i=e.map((function(t){return t(o)}));return r=Et.apply(void 0,i)(n.dispatch),vt(vt({},n),{},{dispatch:r})}}}var St=function(t,e){return t===e};function _t(t,e){var n,r,o,i="object"==typeof e?e:{equalityCheck:e},u=i.equalityCheck,c=i.maxSize,a=void 0===c?1:c,f=i.resultEqualityCheck,l=(o=void 0===u?St:u,function(t,e){if(null===t||null===e||t.length!==e.length)return !1;for(var n=t.length,r=0;r<n;r++)if(!o(t[r],e[r]))return !1;return !0}),s=1===a?(n=l,{get:function(t){return r&&n(r.key,t)?r.value:"NOT_FOUND"},put:function(t,e){r={key:t,value:e};},getEntries:function(){return r?[r]:[]},clear:function(){r=void 0;}}):function(t,e){var n=[];function r(t){var r=n.findIndex((function(n){return e(t,n.key)}));if(r>-1){var o=n[r];return r>0&&(n.splice(r,1),n.unshift(o)),o.value}return "NOT_FOUND"}return {get:r,put:function(e,o){"NOT_FOUND"===r(e)&&(n.unshift({key:e,value:o}),n.length>t&&n.pop());},getEntries:function(){return n},clear:function(){n=[];}}}(a,l);function p(){var e=s.get(arguments);if("NOT_FOUND"===e){if(e=t.apply(null,arguments),f){var n=s.getEntries(),r=n.find((function(t){return f(t.value,e)}));r&&(e=r.value);}s.put(arguments,e);}return e}return p.clearCache=function(){return s.clear()},p}function xt(t){var e=Array.isArray(t[0])?t[0]:t;if(!e.every((function(t){return "function"==typeof t}))){var n=e.map((function(t){return "function"==typeof t?"function "+(t.name||"unnamed")+"()":typeof t})).join(", ");throw new Error("createSelector expects all input-selectors to be functions, but received the following types: ["+n+"]")}return e}function kt(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];var o=function(){for(var e=arguments.length,r=new Array(e),o=0;o<e;o++)r[o]=arguments[o];var i,u=0,c={memoizeOptions:void 0},a=r.pop();if("object"==typeof a&&(c=a,a=r.pop()),"function"!=typeof a)throw new Error("createSelector expects an output function after the inputs, but received: ["+typeof a+"]");var f=c,l=f.memoizeOptions,s=void 0===l?n:l,p=Array.isArray(s)?s:[s],d=xt(r),v=t.apply(void 0,[function(){return u++,a.apply(null,arguments)}].concat(p)),y=t((function(){for(var t=[],e=d.length,n=0;n<e;n++)t.push(d[n].apply(null,arguments));return i=v.apply(null,t)}));return Object.assign(y,{resultFunc:a,memoizedResultFunc:v,dependencies:d,lastResult:function(){return i},recomputations:function(){return u},resetRecomputations:function(){return u=0}}),y};return o}var It=kt(_t),Dt=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=It.apply(void 0,t),r=function(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];return n.apply(void 0,i([g(t)?J(t):t],e))};return r},Nt="undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(0!==arguments.length)return "object"==typeof arguments[0]?Et:Et.apply(null,arguments)};function Ct(t){if("object"!=typeof t||null===t)return !1;var e=Object.getPrototypeOf(t);if(null===e)return !0;for(var n=e;null!==Object.getPrototypeOf(n);)n=Object.getPrototypeOf(n);return e===n}function Tt(t){return function(e){var n=e.dispatch,r=e.getState;return function(e){return function(o){return "function"==typeof o?o(n,r,t):e(o)}}}}var Rt=Tt();Rt.withExtraArgument=Tt;var Mt=Rt,Ft=function(t){function e(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var o=t.apply(this,n)||this;return Object.setPrototypeOf(o,e.prototype),o}return r(e,t),Object.defineProperty(e,Symbol.species,{get:function(){return e},enumerable:!1,configurable:!0}),e.prototype.concat=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return t.prototype.concat.apply(this,e)},e.prototype.prepend=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return 1===t.length&&Array.isArray(t[0])?new(e.bind.apply(e,i([void 0],t[0].concat(this)))):new(e.bind.apply(e,i([void 0],t.concat(this))))},e}(Array);function qt(t){var e=typeof t;return "undefined"===e||null===t||"string"===e||"boolean"===e||"number"===e||Array.isArray(t)||Ct(t)}function zt(t,e,n,r,o){var i;if(void 0===e&&(e=""),void 0===n&&(n=qt),void 0===o&&(o=[]),!n(t))return {keyPath:e||"<root>",value:t};if("object"!=typeof t||null===t)return !1;for(var u=null!=r?r(t):Object.entries(t),c=o.length>0,a=0,f=u;a<f.length;a++){var l=f[a],s=l[0],p=l[1],d=e?e+"."+s:s;if(!(c&&o.indexOf(d)>=0)){if(!n(p))return {keyPath:d,value:p};if("object"==typeof p&&(i=zt(p,d,n,r,o)))return i}}return !1}function Ut(t){return function(){return function(t){return function(e){return t(e)}}}}function Lt(t){void 0===t&&(t={});var e=t.thunk,n=void 0===e||e,r=new Ft;return n&&r.push("boolean"==typeof n?Mt:Mt.withExtraArgument(n.extraArgument)),r}function Wt(t){var e,n=function(t){return Lt(t)},r=t||{},o=r.reducer,u=void 0===o?void 0:o,c=r.middleware,a=void 0===c?n():c,f=r.devTools,l=void 0===f||f,s=r.preloadedState,p=void 0===s?void 0:s,v=r.enhancers,y=void 0===v?void 0:v;if("function"==typeof u)e=u;else {if(!Ct(u))throw new Error('"reducer" is a required argument, and must be a function or an object of functions that can be passed to combineReducers');e=wt(u);}var h=a;"function"==typeof h&&(h=h(n));var g=At.apply(void 0,h),b=Et;l&&(b=Nt(d({trace:!1},"object"==typeof l&&l)));var m=[g];return Array.isArray(y)?m=i([g],y):"function"==typeof y&&(m=y(m)),Ot(e,p,b.apply(void 0,m))}function Kt(t,e){function n(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];if(e){var o=e.apply(void 0,n);if(!o)throw new Error("prepareAction did not return an object");return d(d({type:t,payload:o.payload},"meta"in o&&{meta:o.meta}),"error"in o&&{error:o.error})}return {type:t,payload:n[0]}}return n.toString=function(){return ""+t},n.type=t,n.match=function(e){return e.type===t},n}function Bt(t){return ["type","payload","error","meta"].indexOf(t)>-1}function Vt(t){return ""+t}function Xt(t){var e,n={},r=[],o={addCase:function(t,e){var r="string"==typeof t?t:t.type;if(r in n)throw new Error("addCase cannot be called with two reducers for the same action type");return n[r]=e,o},addMatcher:function(t,e){return r.push({matcher:t,reducer:e}),o},addDefaultCase:function(t){return e=t,o}};return t(o),[n,r,e]}function Gt(t,e,n,r){void 0===n&&(n=[]);var o,u="function"==typeof e?Xt(e):[e,n,r],c=u[0],a=u[1],f=u[2];if("function"==typeof t)o=function(){return st(t(),(function(){}))};else {var l=st(t,(function(){}));o=function(){return l};}function s(t,e){void 0===t&&(t=o());var n=i([c[e.type]],a.filter((function(t){return (0, t.matcher)(e)})).map((function(t){return t.reducer})));return 0===n.filter((function(t){return !!t})).length&&(n=[f]),n.reduce((function(t,n){if(n){var r;if(g(t))return void 0===(r=n(t,e))?t:r;if(b(t))return st(t,(function(t){return n(t,e)}));if(void 0===(r=n(t,e))){if(null===t)return t;throw Error("A case reducer on a non-draftable value must not return undefined")}return r}return t}),t)}return s.getInitialState=o,s}function Jt(t){var e=t.name;if(!e)throw new Error("`name` is a required option for createSlice");var n,r="function"==typeof t.initialState?t.initialState:st(t.initialState,(function(){})),o=t.reducers||{},i=Object.keys(o),u={},c={},a={};function f(){var e="function"==typeof t.extraReducers?Xt(t.extraReducers):[t.extraReducers],n=e[0],o=e[1],i=void 0===o?[]:o,u=e[2],a=void 0===u?void 0:u,f=d(d({},void 0===n?{}:n),c);return Gt(r,f,i,a)}return i.forEach((function(t){var n,r,i=o[t],f=e+"/"+t;"reducer"in i?(n=i.reducer,r=i.prepare):n=i,u[t]=n,c[f]=n,a[t]=r?Kt(f,r):Kt(f);})),{name:e,reducer:function(t,e){return n||(n=f()),n(t,e)},actions:a,caseReducers:u,getInitialState:function(){return n||(n=f()),n.getInitialState()}}}function $t(t){return "object"!=typeof t||null==t||Object.isFrozen(t)}function Ht(t){return function(){return function(t){return function(e){return t(e)}}}}function Qt(t){return function(e,n){var r=function(e){var r;Ct(r=n)&&"string"==typeof r.type&&Object.keys(r).every(Bt)?t(n.payload,e):t(n,e);};return g(e)?(r(e),e):st(e,r)}}function Yt(t,e){return e(t)}function Zt(t){return Array.isArray(t)||(t=Object.values(t)),t}function te(t,e,n){for(var r=[],o=[],i=0,u=t=Zt(t);i<u.length;i++){var c=u[i],a=Yt(c,e);a in n.entities?o.push({id:a,changes:c}):r.push(c);}return [r,o]}function ee(t){function e(e,n){var r=Yt(e,t);r in n.entities||(n.ids.push(r),n.entities[r]=e);}function n(t,n){for(var r=0,o=t=Zt(t);r<o.length;r++)e(o[r],n);}function r(e,n){var r=Yt(e,t);r in n.entities||n.ids.push(r),n.entities[r]=e;}function o(t,e){var n=!1;t.forEach((function(t){t in e.entities&&(delete e.entities[t],n=!0);})),n&&(e.ids=e.ids.filter((function(t){return t in e.entities})));}function i(e,n){var r={},o={};if(e.forEach((function(t){t.id in n.entities&&(o[t.id]={id:t.id,changes:d(d({},o[t.id]?o[t.id].changes:null),t.changes)});})),(e=Object.values(o)).length>0){var i=e.filter((function(e){return function(e,n,r){var o=Object.assign({},r.entities[n.id],n.changes),i=Yt(o,t),u=i!==n.id;return u&&(e[n.id]=i,delete r.entities[n.id]),r.entities[i]=o,u}(r,e,n)})).length>0;i&&(n.ids=n.ids.map((function(t){return r[t]||t})));}}function u(e,r){var o=te(e,t,r),u=o[0];i(o[1],r),n(u,r);}return {removeAll:(c=function(t){Object.assign(t,{ids:[],entities:{}});},a=Qt((function(t,e){return c(e)})),function(t){return a(t,void 0)}),addOne:Qt(e),addMany:Qt(n),setOne:Qt(r),setMany:Qt((function(t,e){for(var n=0,o=t=Zt(t);n<o.length;n++)r(o[n],e);})),setAll:Qt((function(t,e){t=Zt(t),e.ids=[],e.entities={},n(t,e);})),updateOne:Qt((function(t,e){return i([t],e)})),updateMany:Qt(i),upsertOne:Qt((function(t,e){return u([t],e)})),upsertMany:Qt(u),removeOne:Qt((function(t,e){return o([t],e)})),removeMany:Qt(o)};var c,a;}function ne(t){void 0===t&&(t={});var e=d({sortComparer:!1,selectId:function(t){return t.id}},t),n=e.selectId,r=e.sortComparer,o={getInitialState:function(t){return void 0===t&&(t={}),Object.assign({ids:[],entities:{}},t)}},i={getSelectors:function(t){var e=function(t){return t.ids},n=function(t){return t.entities},r=Dt(e,n,(function(t,e){return t.map((function(t){return e[t]}))})),o=function(t,e){return e},i=function(t,e){return t[e]},u=Dt(e,(function(t){return t.length}));if(!t)return {selectIds:e,selectEntities:n,selectAll:r,selectTotal:u,selectById:Dt(n,o,i)};var c=Dt(t,n);return {selectIds:Dt(t,e),selectEntities:c,selectAll:Dt(t,r),selectTotal:Dt(t,u),selectById:Dt(c,o,i)}}},u=r?function(t,e){var n=ee(t);function r(e,n){var r=(e=Zt(e)).filter((function(e){return !(Yt(e,t)in n.entities)}));0!==r.length&&c(r,n);}function o(t,e){0!==(t=Zt(t)).length&&c(t,e);}function i(e,n){var r=[];e.forEach((function(e){return function(e,n,r){if(!(n.id in r.entities))return !1;var o=Object.assign({},r.entities[n.id],n.changes),i=Yt(o,t);return delete r.entities[n.id],e.push(o),i!==n.id}(r,e,n)})),0!==r.length&&c(r,n);}function u(e,n){var o=te(e,t,n),u=o[0];i(o[1],n),r(u,n);}function c(n,r){n.forEach((function(e){r.entities[t(e)]=e;}));var o=Object.values(r.entities);o.sort(e);var i=o.map(t);(function(t,e){if(t.length!==e.length)return !1;for(var n=0;n<t.length&&n<e.length;n++)if(t[n]!==e[n])return !1;return !0})(r.ids,i)||(r.ids=i);}return {removeOne:n.removeOne,removeMany:n.removeMany,removeAll:n.removeAll,addOne:Qt((function(t,e){return r([t],e)})),updateOne:Qt((function(t,e){return i([t],e)})),upsertOne:Qt((function(t,e){return u([t],e)})),setOne:Qt((function(t,e){return o([t],e)})),setMany:Qt(o),setAll:Qt((function(t,e){t=Zt(t),e.entities={},e.ids=[],r(t,e);})),addMany:Qt(r),updateMany:Qt(i),upsertMany:Qt(u)}}(n,r):ee(n);return d(d(d({selectId:n,sortComparer:r},o),i),u)}var re=function(t){void 0===t&&(t=21);for(var e="",n=t;n--;)e+="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW"[64*Math.random()|0];return e},oe=["name","message","stack","code"],ie=function(t,e){this.payload=t,this.meta=e;},ue=function(t,e){this.payload=t,this.meta=e;},ce=function(t){if("object"==typeof t&&null!==t){for(var e={},n=0,r=oe;n<r.length;n++){var o=r[n];"string"==typeof t[o]&&(e[o]=t[o]);}return e}return {message:String(t)}};function ae(t,e,n){var r=Kt(t+"/fulfilled",(function(t,e,n,r){return {payload:t,meta:v(d({},r||{}),{arg:n,requestId:e,requestStatus:"fulfilled"})}})),i=Kt(t+"/pending",(function(t,e,n){return {payload:void 0,meta:v(d({},n||{}),{arg:e,requestId:t,requestStatus:"pending"})}})),u=Kt(t+"/rejected",(function(t,e,r,o,i){return {payload:o,error:(n&&n.serializeError||ce)(t||"Rejected"),meta:v(d({},i||{}),{arg:r,requestId:e,rejectedWithValue:!!o,requestStatus:"rejected",aborted:"AbortError"===(null==t?void 0:t.name),condition:"ConditionError"===(null==t?void 0:t.name)})}})),c="undefined"!=typeof AbortController?AbortController:function(){function t(){this.signal={aborted:!1,addEventListener:function(){},dispatchEvent:function(){return !1},onabort:function(){},removeEventListener:function(){}};}return t.prototype.abort=function(){},t}();return Object.assign((function(t){return function(a,f,l){var s,p=(null==n?void 0:n.idGenerator)?n.idGenerator(t):re(),d=new c,v=new Promise((function(t,e){return d.signal.addEventListener("abort",(function(){return e({name:"AbortError",message:s||"Aborted"})}))})),h=!1,g=function(){return y(this,null,(function(){var c,s,y,g,b;return o(this,(function(o){switch(o.label){case 0:return o.trys.push([0,4,,5]),null===(m=g=null==(c=null==n?void 0:n.condition)?void 0:c.call(n,t,{getState:f,extra:l}))||"object"!=typeof m||"function"!=typeof m.then?[3,2]:[4,g];case 1:g=o.sent(),o.label=2;case 2:if(!1===g)throw {name:"ConditionError",message:"Aborted due to condition callback returning false."};return h=!0,a(i(p,t,null==(s=null==n?void 0:n.getPendingMeta)?void 0:s.call(n,{requestId:p,arg:t},{getState:f,extra:l}))),[4,Promise.race([v,Promise.resolve(e(t,{dispatch:a,getState:f,extra:l,requestId:p,signal:d.signal,rejectWithValue:function(t,e){return new ie(t,e)},fulfillWithValue:function(t,e){return new ue(t,e)}})).then((function(e){if(e instanceof ie)throw e;return e instanceof ue?r(e.payload,p,t,e.meta):r(e,p,t)}))])];case 3:return y=o.sent(),[3,5];case 4:return b=o.sent(),y=b instanceof ie?u(null,p,t,b.payload,b.meta):u(b,p,t),[3,5];case 5:return n&&!n.dispatchConditionRejection&&u.match(y)&&y.meta.condition||a(y),[2,y]}var m;}))}))}();return Object.assign(g,{abort:function(t){h&&(s=t,d.abort());},requestId:p,arg:t,unwrap:function(){return g.then(fe)}})}}),{pending:i,rejected:u,fulfilled:r,typePrefix:t})}function fe(t){if(t.meta&&t.meta.rejectedWithValue)throw t.payload;if(t.error)throw t.error;return t.payload}var le=function(t,e){return (n=t)&&"function"==typeof n.match?t.match(e):t(e);var n;};function se(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(e){return t.some((function(t){return le(t,e)}))}}function pe(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(e){return t.every((function(t){return le(t,e)}))}}function de(t,e){if(!t||!t.meta)return !1;var n="string"==typeof t.meta.requestId,r=e.indexOf(t.meta.requestStatus)>-1;return n&&r}function ve(t){return "function"==typeof t[0]&&"pending"in t[0]&&"fulfilled"in t[0]&&"rejected"in t[0]}function ye(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return 0===t.length?function(t){return de(t,["pending"])}:ve(t)?function(e){var n=t.map((function(t){return t.pending}));return se.apply(void 0,n)(e)}:ye()(t[0])}function he(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return 0===t.length?function(t){return de(t,["rejected"])}:ve(t)?function(e){var n=t.map((function(t){return t.rejected}));return se.apply(void 0,n)(e)}:he()(t[0])}function ge(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=function(t){return t&&t.meta&&t.meta.rejectedWithValue};return 0===t.length||ve(t)?function(e){return pe(he.apply(void 0,t),n)(e)}:ge()(t[0])}function be(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return 0===t.length?function(t){return de(t,["fulfilled"])}:ve(t)?function(e){var n=t.map((function(t){return t.fulfilled}));return se.apply(void 0,n)(e)}:be()(t[0])}function me(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return 0===t.length?function(t){return de(t,["pending","fulfilled","rejected"])}:ve(t)?function(e){for(var n=[],r=0,o=t;r<o.length;r++){var i=o[r];n.push(i.pending,i.rejected,i.fulfilled);}return se.apply(void 0,n)(e)}:me()(t[0])}var Oe=function(t,e){if("function"!=typeof t)throw new TypeError(e+" is not a function")},we=function(){},je=function(t,e){return void 0===e&&(e=we),t.catch(e),t},Pe=function(t,e){t.addEventListener("abort",e,{once:!0});},Ee=function(t,e){var n=t.signal;n.aborted||("reason"in n||Object.defineProperty(n,"reason",{enumerable:!0,value:e,configurable:!0,writable:!0}),t.abort(e));},Ae=function(t){this.code=t,this.name="TaskAbortError",this.message="task cancelled (reason: "+t+")";},Se=function(t){if(t.aborted)throw new Ae(t.reason)},_e=function(t){return je(new Promise((function(e,n){var r=function(){return n(new Ae(t.reason))};t.aborted?r():Pe(t,r);})))},xe=function(t){return function(e){return je(Promise.race([_e(t),e]).then((function(e){return Se(t),e})))}},ke=function(t){var e=xe(t);return function(t){return e(new Promise((function(e){return setTimeout(e,t)})))}},Ie=Object.assign,De={},Ne="listenerMiddleware",Ce=function(t){var e=t.type,n=t.actionCreator,r=t.matcher,o=t.predicate,i=t.effect;if(e)o=Kt(e).match;else if(n)e=n.type,o=n.match;else if(r)o=r;else if(!o)throw new Error("Creating or removing a listener requires one of the known fields for matching an action");return Oe(i,"options.listener"),{predicate:o,type:e,effect:i}},Te=function(t,e,n){try{t(e,n);}catch(t){setTimeout((function(){throw t}),0);}},Re=Kt(Ne+"/add"),Me=Kt(Ne+"/removeAll"),Fe=Kt(Ne+"/remove"),qe=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];console.error.apply(console,i([Ne+"/error"],t));},ze=function(t){t.pending.forEach((function(t){Ee(t,"listener-cancelled");}));};function Ue(t){var e=this;void 0===t&&(t={});var n=new Map,r=t.extra,i=t.onError,u=void 0===i?qe:i;Oe(u,"onError");var c=function(t){for(var e=0,r=n.values();e<r.length;e++){var o=r[e];if(t(o))return o}},a=function(t){var e=c((function(e){return e.effect===t.effect}));return e||(e=function(t){var e=Ce(t),n=e.type,r=e.predicate,o=e.effect;return {id:re(),effect:o,type:n,predicate:r,pending:new Set,unsubscribe:function(){throw new Error("Unsubscribe not initialized")}}}(t)),function(t){return t.unsubscribe=function(){return n.delete(t.id)},n.set(t.id,t),function(e){t.unsubscribe(),(null==e?void 0:e.cancelActive)&&ze(t);}}(e)},f=function(t){var e=Ce(t),n=e.type,r=e.effect,o=e.predicate,i=c((function(t){return ("string"==typeof n?t.type===n:t.predicate===o)&&t.effect===r}));return i&&(i.unsubscribe(),t.cancelActive&&ze(i)),!!i},l=function(t,i,c,f){return y(e,null,(function(){var e,l,s;return o(this,(function(p){switch(p.label){case 0:e=new AbortController,l=function(t,e){return function(n,r){return je(function(n,r){return y(void 0,null,(function(){var i,u,c,a;return o(this,(function(o){switch(o.label){case 0:Se(e),i=function(){},u=new Promise((function(e){i=t({predicate:n,effect:function(t,n){n.unsubscribe(),e([t,n.getState(),n.getOriginalState()]);}});})),c=[_e(e),u],null!=r&&c.push(new Promise((function(t){return setTimeout(t,r,null)}))),o.label=1;case 1:return o.trys.push([1,,3,4]),[4,Promise.race(c)];case 2:return a=o.sent(),Se(e),[2,a];case 3:return i(),[7];case 4:return [2]}}))}))}(n,r))}}(a,e.signal),p.label=1;case 1:return p.trys.push([1,3,4,5]),t.pending.add(e),[4,Promise.resolve(t.effect(i,Ie({},c,{getOriginalState:f,condition:function(t,e){return l(t,e).then(Boolean)},take:l,delay:ke(e.signal),pause:xe(e.signal),extra:r,signal:e.signal,fork:(d=e.signal,function(t){Oe(t,"taskExecutor");var e,n=new AbortController;e=n,Pe(d,(function(){return Ee(e,d.reason)}));var r,i,u=(r=function(){return y(void 0,null,(function(){var e;return o(this,(function(r){switch(r.label){case 0:return Se(d),Se(n.signal),[4,t({pause:xe(n.signal),delay:ke(n.signal),signal:n.signal})];case 1:return e=r.sent(),Se(n.signal),[2,e]}}))}))},i=function(){return Ee(n,"task-completed")},y(void 0,null,(function(){var t;return o(this,(function(e){switch(e.label){case 0:return e.trys.push([0,3,4,5]),[4,Promise.resolve()];case 1:return e.sent(),[4,r()];case 2:return [2,{status:"ok",value:e.sent()}];case 3:return [2,{status:(t=e.sent())instanceof Ae?"cancelled":"rejected",error:t}];case 4:return null==i||i(),[7];case 5:return [2]}}))})));return {result:xe(d)(u),cancel:function(){Ee(n,"task-cancelled");}}}),unsubscribe:t.unsubscribe,subscribe:function(){n.set(t.id,t);},cancelActiveListeners:function(){t.pending.forEach((function(t,n,r){t!==e&&(Ee(t,"listener-cancelled"),r.delete(t));}));}})))];case 2:return p.sent(),[3,5];case 3:return (s=p.sent())instanceof Ae||Te(u,s,{raisedBy:"effect"}),[3,5];case 4:return Ee(e,"listener-completed"),t.pending.delete(e),[7];case 5:return [2]}var d;}))}))},s=function(t){return function(){t.forEach(ze),t.clear();}}(n);return {middleware:function(t){return function(e){return function(r){if(Re.match(r))return a(r.payload);if(!Me.match(r)){if(Fe.match(r))return f(r.payload);var o,i=t.getState(),c=function(){if(i===De)throw new Error(Ne+": getOriginalState can only be called synchronously");return i};try{if(o=e(r),n.size>0)for(var p=t.getState(),d=Array.from(n.values()),v=0,y=d;v<y.length;v++){var h=y[v],g=!1;try{g=h.predicate(r,p,i);}catch(t){g=!1,Te(u,t,{raisedBy:"predicate"});}g&&l(h,r,t,c);}}finally{i=De;}return o}s();}}},startListening:a,stopListening:f,clearListeners:s}}!function(){function t(t,e){var n=o[t];return n?n.enumerable=e:o[t]=n={configurable:!0,enumerable:e,get:function(){return ct.get(this[nt],t)},set:function(e){ct.set(this[nt],t,e);}},n}function e(t){for(var e=t.length-1;e>=0;e--){var o=t[e][nt];if(!o.P)switch(o.i){case 5:r(o)&&V(o);break;case 4:n(o)&&V(o);}}}function n(t){for(var e=t.t,n=t.k,r=ot(n),o=r.length-1;o>=0;o--){var i=r[o];if(i!==nt){var u=e[i];if(void 0===u&&!j(e,i))return !0;var c=n[i],a=c&&c[nt];if(a?a.t!==u:!E(c,u))return !0}}var f=!!e[nt];return r.length!==ot(e).length+(f?0:1)}function r(t){var e=t.k;if(e.length!==t.t.length)return !0;var n=Object.getOwnPropertyDescriptor(e,e.length-1);return !(!n||n.get)}var o={};ut.ES5||(ut.ES5={J:function(e,n){var r=Array.isArray(e),o=function(e,n){if(e){for(var r=Array(n.length),o=0;o<n.length;o++)Object.defineProperty(r,""+o,t(o,!0));return r}var i=it(n);delete i[nt];for(var u=ot(i),c=0;c<u.length;c++){var a=u[c];i[a]=t(a,e||!!i[a].enumerable);}return Object.create(Object.getPrototypeOf(n),i)}(r,e),i={i:r?5:4,A:n?n.A:C(),P:!1,I:!1,D:{},l:n,t:e,k:o,o:null,O:!1,C:!1};return Object.defineProperty(o,nt,{value:i,writable:!0}),o},S:function(t,n,o){o?g(n)&&n[nt].A===t&&e(t.p):(t.u&&function t(e){if(e&&"object"==typeof e){var n=e[nt];if(n){var o=n.t,i=n.k,u=n.D,c=n.i;if(4===c)O(i,(function(e){e!==nt&&(void 0!==o[e]||j(o,e)?u[e]||t(i[e]):(u[e]=!0,V(n)));})),O(o,(function(t){void 0!==i[t]||j(i,t)||(u[t]=!1,V(n));}));else if(5===c){if(r(n)&&(V(n),u.length=!0),i.length<o.length)for(var a=i.length;a<o.length;a++)u[a]=!1;else for(var f=o.length;f<i.length;f++)u[f]=!0;for(var l=Math.min(i.length,o.length),s=0;s<l;s++)void 0===u[s]&&t(i[s]);}}}}(t.p[0]),e(t.p));},K:function(t){return 4===t.i?n(t):r(t)}});}();

@@ -16,2 +16,3 @@ exports.MiddlewareArray = Ft;

exports.bindActionCreators = Pt;
exports.clearAllListeners = Me;
exports.combineReducers = wt;

@@ -25,3 +26,3 @@ exports.compose = Et;

exports.createImmutableStateInvariantMiddleware = Ht;
exports.createListenerMiddleware = ze;
exports.createListenerMiddleware = Ue;
exports.createNextState = st;

@@ -52,3 +53,2 @@ exports.createReducer = Gt;

exports.original = m;
exports.removeAllListeners = Me;
exports.removeListener = Fe;

@@ -55,0 +55,0 @@ exports.unwrapResult = fe;

{
"name": "@reduxjs/toolkit",
"version": "1.8.0-rc.0",
"version": "1.8.0",
"description": "The official, opinionated, batteries-included toolset for efficient Redux development",

@@ -5,0 +5,0 @@ "author": "Mark Erikson <mark@isquaredsoftware.com>",

@@ -165,3 +165,4 @@ import { enableES5 } from 'immer'

TypedRemoveListener,
Unsubscribe,
UnsubscribeListener,
UnsubscribeListenerOptions,
ForkedTaskExecutor,

@@ -182,4 +183,4 @@ ForkedTask,

removeListener,
removeAllListeners,
clearAllListeners,
TaskAbortError,
} from './listenerMiddleware/index'

@@ -17,3 +17,3 @@ import type { Dispatch, AnyAction, MiddlewareAPI } from 'redux'

ListenerErrorHandler,
Unsubscribe,
UnsubscribeListener,
TakePattern,

@@ -26,2 +26,3 @@ ListenerErrorInfo,

AbortSignalWithReason,
UnsubscribeListenerOptions,
} from './types'

@@ -60,3 +61,4 @@ import {

TypedRemoveListener,
Unsubscribe,
UnsubscribeListener,
UnsubscribeListenerOptions,
ForkedTaskExecutor,

@@ -119,3 +121,7 @@ ForkedTask,

const createTakePattern = <S>(
startListening: AddListenerOverloads<Unsubscribe, S, Dispatch<AnyAction>>,
startListening: AddListenerOverloads<
UnsubscribeListener,
S,
Dispatch<AnyAction>
>,
signal: AbortSignal

@@ -137,3 +143,3 @@ ): TakePattern<S> => {

// Placeholder unsubscribe function until the listener is added
let unsubscribe: Unsubscribe = () => {}
let unsubscribe: UnsubscribeListener = () => {}

@@ -231,7 +237,3 @@ const tuplePromise = new Promise<[AnyAction, S, S]>((resolve) => {

return () => {
listenerMap.forEach((entry) => {
entry.pending.forEach((controller) => {
abortControllerWithReason(controller, listenerCancelled)
})
})
listenerMap.forEach(cancelActiveListeners)

@@ -266,3 +268,3 @@ listenerMap.clear()

/**
* @alpha
* @public
*/

@@ -274,8 +276,8 @@ export const addListener = createAction(

/**
* @alpha
* @public
*/
export const removeAllListeners = createAction(`${alm}/removeAll`)
export const clearAllListeners = createAction(`${alm}/removeAll`)
/**
* @alpha
* @public
*/

@@ -290,4 +292,12 @@ export const removeListener = createAction(

const cancelActiveListeners = (
entry: ListenerEntry<unknown, Dispatch<AnyAction>>
) => {
entry.pending.forEach((controller) => {
abortControllerWithReason(controller, listenerCancelled)
})
}
/**
* @alpha
* @public
*/

@@ -308,3 +318,8 @@ export function createListenerMiddleware<

listenerMap.set(entry.id, entry)
return entry.unsubscribe
return (cancelOptions?: UnsubscribeListenerOptions) => {
entry.unsubscribe()
if (cancelOptions?.cancelActive) {
cancelActiveListeners(entry)
}
}
}

@@ -336,3 +351,5 @@

const stopListening = (options: FallbackAddListenerOptions): boolean => {
const stopListening = (
options: FallbackAddListenerOptions & UnsubscribeListenerOptions
): boolean => {
const { type, effect, predicate } = getListenerEntryPropsFrom(options)

@@ -349,3 +366,8 @@

entry?.unsubscribe()
if (entry) {
entry.unsubscribe()
if (options.cancelActive) {
cancelActiveListeners(entry)
}
}

@@ -420,3 +442,3 @@ return !!entry

if (removeAllListeners.match(action)) {
if (clearAllListeners.match(action)) {
clearListenerMiddleware()

@@ -423,0 +445,0 @@ return

@@ -17,3 +17,3 @@ import {

TaskAbortError,
removeAllListeners,
clearAllListeners,
} from '../index'

@@ -26,3 +26,3 @@

TypedStartListening,
Unsubscribe,
UnsubscribeListener,
ListenerMiddleware,

@@ -450,3 +450,3 @@ } from '../index'

expectType<Unsubscribe>(unsubscribe)
expectType<UnsubscribeListener>(unsubscribe)

@@ -484,2 +484,76 @@ store.dispatch(testAction1('a'))

test('can cancel an active listener when unsubscribing directly', async () => {
let wasCancelled = false
const unsubscribe = startListening({
actionCreator: testAction1,
effect: async (action, listenerApi) => {
try {
await listenerApi.condition(testAction2.match)
} catch (err) {
if (err instanceof TaskAbortError) {
wasCancelled = true
}
}
},
})
store.dispatch(testAction1('a'))
unsubscribe({ cancelActive: true })
expect(wasCancelled).toBe(false)
await delay(10)
expect(wasCancelled).toBe(true)
})
test('can cancel an active listener when unsubscribing via stopListening', async () => {
let wasCancelled = false
const effect = async (action: any, listenerApi: any) => {
try {
await listenerApi.condition(testAction2.match)
} catch (err) {
if (err instanceof TaskAbortError) {
wasCancelled = true
}
}
}
startListening({
actionCreator: testAction1,
effect,
})
store.dispatch(testAction1('a'))
stopListening({ actionCreator: testAction1, effect, cancelActive: true })
expect(wasCancelled).toBe(false)
await delay(10)
expect(wasCancelled).toBe(true)
})
test('can cancel an active listener when unsubscribing via removeListener', async () => {
let wasCancelled = false
const effect = async (action: any, listenerApi: any) => {
try {
await listenerApi.condition(testAction2.match)
} catch (err) {
if (err instanceof TaskAbortError) {
wasCancelled = true
}
}
}
startListening({
actionCreator: testAction1,
effect,
})
store.dispatch(testAction1('a'))
store.dispatch(
removeListener({
actionCreator: testAction1,
effect,
cancelActive: true,
})
)
expect(wasCancelled).toBe(false)
await delay(10)
expect(wasCancelled).toBe(true)
})
const addListenerOptions: [

@@ -656,3 +730,3 @@ string,

startListening({
actionCreator: removeAllListeners,
actionCreator: clearAllListeners,
effect() {

@@ -671,3 +745,3 @@ listener2Calls++

store.dispatch(testAction1('a'))
store.dispatch(removeAllListeners())
store.dispatch(clearAllListeners())
store.dispatch(testAction1('b'))

@@ -674,0 +748,0 @@ expect(await listener1Test).toBe(1)

@@ -248,3 +248,3 @@ import type { PayloadAction, BaseActionCreator } from '../createAction'

{
(action: ReduxAction<'listenerMiddleware/add'>): Unsubscribe
(action: ReduxAction<'listenerMiddleware/add'>): UnsubscribeListener
},

@@ -267,3 +267,3 @@ State,

startListening: AddListenerOverloads<
Unsubscribe,
UnsubscribeListener,
State,

@@ -315,2 +315,12 @@ Dispatch,

/** @public */
export interface UnsubscribeListenerOptions {
cancelActive?: true
}
/** @public */
export type UnsubscribeListener = (
unsuscribeOptions?: UnsubscribeListenerOptions
) => void
/**

@@ -324,53 +334,64 @@ * @public

Dispatch extends ReduxDispatch = ThunkDispatch<State, unknown, AnyAction>,
ExtraArgument = unknown
ExtraArgument = unknown,
AdditionalOptions = unknown
> {
/** Accepts a "listener predicate" that is also a TS type predicate for the action*/
<MA extends AnyAction, LP extends ListenerPredicate<MA, State>>(options: {
actionCreator?: never
type?: never
matcher?: never
predicate: LP
effect: ListenerEffect<
ListenerPredicateGuardedActionType<LP>,
State,
Dispatch,
ExtraArgument
>
}): Return
<MA extends AnyAction, LP extends ListenerPredicate<MA, State>>(
options: {
actionCreator?: never
type?: never
matcher?: never
predicate: LP
effect: ListenerEffect<
ListenerPredicateGuardedActionType<LP>,
State,
Dispatch,
ExtraArgument
>
} & AdditionalOptions
): Return
/** Accepts an RTK action creator, like `incrementByAmount` */
<C extends TypedActionCreator<any>>(options: {
actionCreator: C
type?: never
matcher?: never
predicate?: never
effect: ListenerEffect<ReturnType<C>, State, Dispatch, ExtraArgument>
}): Return
<C extends TypedActionCreator<any>>(
options: {
actionCreator: C
type?: never
matcher?: never
predicate?: never
effect: ListenerEffect<ReturnType<C>, State, Dispatch, ExtraArgument>
} & AdditionalOptions
): Return
/** Accepts a specific action type string */
<T extends string>(options: {
actionCreator?: never
type: T
matcher?: never
predicate?: never
effect: ListenerEffect<ReduxAction<T>, State, Dispatch, ExtraArgument>
}): Return
<T extends string>(
options: {
actionCreator?: never
type: T
matcher?: never
predicate?: never
effect: ListenerEffect<ReduxAction<T>, State, Dispatch, ExtraArgument>
} & AdditionalOptions
): Return
/** Accepts an RTK matcher function, such as `incrementByAmount.match` */
<MA extends AnyAction, M extends MatchFunction<MA>>(options: {
actionCreator?: never
type?: never
matcher: M
predicate?: never
effect: ListenerEffect<GuardedType<M>, State, Dispatch, ExtraArgument>
}): Return
<MA extends AnyAction, M extends MatchFunction<MA>>(
options: {
actionCreator?: never
type?: never
matcher: M
predicate?: never
effect: ListenerEffect<GuardedType<M>, State, Dispatch, ExtraArgument>
} & AdditionalOptions
): Return
/** Accepts a "listener predicate" that just returns a boolean, no type assertion */
<LP extends AnyListenerPredicate<State>>(options: {
actionCreator?: never
type?: never
matcher?: never
predicate: LP
effect: ListenerEffect<AnyAction, State, Dispatch, ExtraArgument>
}): Return
<LP extends AnyListenerPredicate<State>>(
options: {
actionCreator?: never
type?: never
matcher?: never
predicate: LP
effect: ListenerEffect<AnyAction, State, Dispatch, ExtraArgument>
} & AdditionalOptions
): Return
}

@@ -382,3 +403,9 @@

Dispatch extends ReduxDispatch = ThunkDispatch<State, unknown, AnyAction>
> = AddListenerOverloads<boolean, State, Dispatch>
> = AddListenerOverloads<
boolean,
State,
Dispatch,
any,
UnsubscribeListenerOptions
>

@@ -432,3 +459,9 @@ /** @public */

> = BaseActionCreator<Payload, T> &
AddListenerOverloads<PayloadAction<Payload, T>, State, Dispatch>
AddListenerOverloads<
PayloadAction<Payload, T>,
State,
Dispatch,
any,
UnsubscribeListenerOptions
>

@@ -446,3 +479,3 @@ /**

ExtraArgument = unknown
> = AddListenerOverloads<Unsubscribe, State, Dispatch, ExtraArgument>
> = AddListenerOverloads<UnsubscribeListener, State, Dispatch, ExtraArgument>

@@ -504,5 +537,2 @@ /** @public

/** @public */
export type Unsubscribe = () => void
/** @public */
export type GuardedType<T> = T extends (

@@ -509,0 +539,0 @@ x: any,

@@ -172,8 +172,3 @@ import isPlainObject from './isPlainObject'

return (storeAPI) => (next) => (action) => {
if (
ignoreActions ||
(ignoredActions.length && ignoredActions.indexOf(action.type) !== -1)
) {
return next(action)
}
const result = next(action)

@@ -184,27 +179,31 @@ const measureUtils = getTimeMeasureUtils(

)
measureUtils.measureTime(() => {
const foundActionNonSerializableValue = findNonSerializableValue(
action,
'',
isSerializable,
getEntries,
ignoredActionPaths
)
if (foundActionNonSerializableValue) {
const { keyPath, value } = foundActionNonSerializableValue
console.error(
`A non-serializable value was detected in an action, in the path: \`${keyPath}\`. Value:`,
value,
'\nTake a look at the logic that dispatched this action: ',
if (
!ignoreActions &&
!(ignoredActions.length && ignoredActions.indexOf(action.type) !== -1)
) {
measureUtils.measureTime(() => {
const foundActionNonSerializableValue = findNonSerializableValue(
action,
'\n(See https://redux.js.org/faq/actions#why-should-type-be-a-string-or-at-least-serializable-why-should-my-action-types-be-constants)',
'\n(To allow non-serializable values see: https://redux-toolkit.js.org/usage/usage-guide#working-with-non-serializable-data)'
'',
isSerializable,
getEntries,
ignoredActionPaths
)
}
})
const result = next(action)
if (foundActionNonSerializableValue) {
const { keyPath, value } = foundActionNonSerializableValue
console.error(
`A non-serializable value was detected in an action, in the path: \`${keyPath}\`. Value:`,
value,
'\nTake a look at the logic that dispatched this action: ',
action,
'\n(See https://redux.js.org/faq/actions#why-should-type-be-a-string-or-at-least-serializable-why-should-my-action-types-be-constants)',
'\n(To allow non-serializable values see: https://redux-toolkit.js.org/usage/usage-guide#working-with-non-serializable-data)'
)
}
})
}
if (!ignoreState) {

@@ -211,0 +210,0 @@ measureUtils.measureTime(() => {

@@ -329,7 +329,9 @@ import {

expect(numTimesCalled).toBe(0)
// The state check only calls `isSerializable` once
expect(numTimesCalled).toBe(1)
store.dispatch({ type: 'ANY_OTHER_ACTION' })
expect(numTimesCalled).toBeGreaterThan(0)
// Action checks call `isSerializable` 2+ times when enabled
expect(numTimesCalled).toBeGreaterThanOrEqual(3)
})

@@ -414,3 +416,8 @@

expect(numTimesCalled).toBe(0)
// `isSerializable` is called once for a state check
expect(numTimesCalled).toBe(1)
store.dispatch({ type: 'THIS_DOESNT_MATTER_AGAIN' })
expect(numTimesCalled).toBe(2)
})

@@ -475,15 +482,53 @@

const badValue = new Map()
let numTimesCalled = 0
const reducer = () => badValue
configureStore({
const store = configureStore({
reducer,
middleware: [
createSerializableStateInvariantMiddleware({
isSerializable: () => {
numTimesCalled++
return true
},
ignoreState: true,
}),
],
}).dispatch({ type: 'test' })
})
expect(numTimesCalled).toBe(0)
store.dispatch({ type: 'test' })
expect(getLog().log).toMatchInlineSnapshot(`""`)
// Should be called twice for the action - there is an initial check for early returns, then a second and potentially 3rd for nested properties
expect(numTimesCalled).toBe(2)
})
it('never calls isSerializable if both ignoreState and ignoreActions are true', () => {
const badValue = new Map()
let numTimesCalled = 0
const reducer = () => badValue
const store = configureStore({
reducer,
middleware: [
createSerializableStateInvariantMiddleware({
isSerializable: () => {
numTimesCalled++
return true
},
ignoreState: true,
ignoreActions: true,
}),
],
})
expect(numTimesCalled).toBe(0)
store.dispatch({ type: 'TEST', payload: new Date() })
store.dispatch({ type: 'OTHER_THING' })
expect(numTimesCalled).toBe(0)
})
it('Should print a warning if execution takes too long', () => {

@@ -490,0 +535,0 @@ const reducer: Reducer = (state = 42, action) => {

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc