state-decorator 7.6.1 → 8.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +109 -17
- package/es/index.d.ts +5 -0
- package/es/index.js +1 -1
- package/es/index.js.map +1 -1
- package/es/v5.js +1 -1
- package/index.d.ts +5 -0
- package/index.js +1 -1
- package/index.js.map +1 -1
- package/package.json +1 -1
- package/v5.js +1 -1
package/README.md
CHANGED
|
@@ -6,6 +6,42 @@
|
|
|
6
6
|
|
|
7
7
|
The StateDecorator is a set of React hooks that manage a complex component state in an easy, testable and deterministic way.
|
|
8
8
|
|
|
9
|
+
## Table of contents
|
|
10
|
+
|
|
11
|
+
- [Features](#features)
|
|
12
|
+
- [V7: Partial state and new hooks](#v7-partial-state-and-new-hooks)
|
|
13
|
+
- [V8: Better React 19 compatibility](#v8-better-react-19-compatibility)
|
|
14
|
+
- [Getting started](#getting-started)
|
|
15
|
+
- [React hooks](#react-hooks)
|
|
16
|
+
- [StoreApi](#storeapi)
|
|
17
|
+
- [Initial state](#initial-state)
|
|
18
|
+
- [Action context](#action-context)
|
|
19
|
+
- [Actions](#actions)
|
|
20
|
+
- [Synchronous actions](#synchronous-actions)
|
|
21
|
+
- [Asynchronous actions](#asynchronous-actions)
|
|
22
|
+
- [Error management](#ErrorManagement)
|
|
23
|
+
- [Conflicting actions](#ConflictingActions)
|
|
24
|
+
- [Global / local Stores and State sharing](#GlobalLocalStores)
|
|
25
|
+
- [Derived state](#derived-state)
|
|
26
|
+
- [Global configuration](#global-configuration)
|
|
27
|
+
- [Trace actions](#trace-actions)
|
|
28
|
+
- [Concise logger](#concise-logger)
|
|
29
|
+
- [Detailed Logger](#detailed-logger)
|
|
30
|
+
- [Redux devtools](#redux-devtools)
|
|
31
|
+
- [Unit testing](#unit-testing)
|
|
32
|
+
- [Example](#example)
|
|
33
|
+
- [Error testing](#error-testing)
|
|
34
|
+
- [API](#api)
|
|
35
|
+
- [Immutability](#immutability)
|
|
36
|
+
- [Build](#build)
|
|
37
|
+
- [Limitations](#limitations)
|
|
38
|
+
- [Migration](#migration)
|
|
39
|
+
- [V7 to V8](#v7-to-v8)
|
|
40
|
+
- [V6 to V7](#v6-to-v7)
|
|
41
|
+
- [V5 to V6](#v5-to-v6)
|
|
42
|
+
- [Examples](#examples)
|
|
43
|
+
- [Visual Studio Code user snippet](#visual-studio-code-user-snippet)
|
|
44
|
+
|
|
9
45
|
# Features
|
|
10
46
|
|
|
11
47
|
- Deterministic state changes (clear separation of effects and side effects)
|
|
@@ -28,6 +64,11 @@ The StateDecorator is a set of React hooks that manage a complex component state
|
|
|
28
64
|
- New effect helpers
|
|
29
65
|
- See migration details in [migration section](#migration).
|
|
30
66
|
|
|
67
|
+
# V8: Better React 19 compatibility
|
|
68
|
+
|
|
69
|
+
- Fixed a React 18+/19 concurrent rendering issue: **onMount** (and **onPropsChange** entries flagged **onMount: true**) used to run during **init()**, which can itself run during render. Under concurrent rendering, a discarded and retried render attempt could trigger these side effects (e.g. data fetches) more than once per real mount. They are now deferred to a new **runMountEffects()** store method, called once from a layout effect after the render that actually commits — see [Call actions on mount](#call-actions-on-mount).
|
|
70
|
+
- See migration details in [migration section](#migration).
|
|
71
|
+
|
|
31
72
|
# Getting started
|
|
32
73
|
|
|
33
74
|
## Installation
|
|
@@ -141,13 +182,40 @@ export function App(props: Props) => {
|
|
|
141
182
|
|
|
142
183
|
# React hooks
|
|
143
184
|
|
|
144
|
-
| Hook | Purpose
|
|
145
|
-
| -------------------- |
|
|
146
|
-
| useLocalStore | Create a store and binds it to the react component.
|
|
147
|
-
| useStore |
|
|
148
|
-
| useBindStore | Binds a store instance to the react component (inject props).
|
|
149
|
-
| useStoreSlice | Get a slice of a store.
|
|
150
|
-
| useStoreContextSlice | Get a slice of a store stored in a context
|
|
185
|
+
| Hook | Purpose | Returns | Is component refreshed on store change? | Is store destroyed on unmount? |
|
|
186
|
+
| -------------------- | ------------------------------------------------------------------------------------------------------------------- | ------- | --------------------------------------- | ------------------------------ |
|
|
187
|
+
| useLocalStore | Create a store and binds it to the react component. | Store | if **refreshOnUpdate** is set | Y |
|
|
188
|
+
| useStore | Subscribes the component to a store instance already owned/initialized elsewhere (does not call `init`/`setProps`). | Store | yes | N |
|
|
189
|
+
| useBindStore | Binds a store instance to the react component (inject props). | Store | yes | N |
|
|
190
|
+
| useStoreSlice | Get a slice of a store. | Slice | yes | N |
|
|
191
|
+
| useStoreContextSlice | Get a slice of a store stored in a context | Slice | If slice has changed only | N |
|
|
192
|
+
|
|
193
|
+
# StoreApi
|
|
194
|
+
|
|
195
|
+
Whatever hook is used (or a plain `createStore`), the resulting store exposes the same **StoreApi**:
|
|
196
|
+
|
|
197
|
+
| Member | Signature | Description |
|
|
198
|
+
| ------------------------------------ | ------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
199
|
+
| state | `S & DS` | Current state, merged with derived state if any. |
|
|
200
|
+
| actions | `A` | Decorated actions, ready to call. |
|
|
201
|
+
| loading | `boolean` | `true` if at least one asynchronous action is currently loading. |
|
|
202
|
+
| loadingMap | `LoadingMap<A>` | Per-action loading flags (computed on access). |
|
|
203
|
+
| errorMap | `ErrorMap<A>` | Per-action error map (computed on access). |
|
|
204
|
+
| loadingParallelMap | `LoadingParallelMap<A>` | Per-action, per-`promiseId` loading flags for parallel actions. |
|
|
205
|
+
| errorParallelMap | `ErrorParallelMap<A>` | Per-action, per-`promiseId` error map for parallel actions. |
|
|
206
|
+
| `init(p)` | `(p: P) => void` | Initializes the store with the given props: computes initial state, runs `onPropsChange` effects. Called automatically by **useLocalStore** / **useBindStore**. |
|
|
207
|
+
| `runMountEffects()` | `() => void` | Runs **onMount** (and `onPropsChange` entries flagged `onMount: true`) exactly once. Must be called after `init()`, from an effect (never a render body). Called automatically by **useLocalStore** / **useBindStore** — see [Call actions on mount](#call-actions-on-mount). |
|
|
208
|
+
| `setProps(p)` | `(p: P) => void` | Updates the store with new props, triggering matching `onPropsChange` entries. |
|
|
209
|
+
| `destroy()` | `() => void` | Destroys the store: runs **onUnmount**, clears listeners/timers. Called automatically when a **useLocalStore**-owned component unmounts. |
|
|
210
|
+
| `abortAction(name, promiseId?)` | `(actionName: keyof A, promiseId?: string) => boolean` | Aborts a running asynchronous action marked `abortable`. See [Abort asynchronous action](#abort-asynchronous-action). |
|
|
211
|
+
| `addStateListener(listener)` | `(listener: () => void) => unregister` | Subscribes to state changes; returns an unregister function. |
|
|
212
|
+
| `isLoading(...)` | `IsLoadingFunc<A>` | Returns `true` if any of the given action names (or `[name, promiseId]` tuples) are loading. |
|
|
213
|
+
| `clearError(...)` | `ClearErrorFunc<A>` | Clears the error of an action marked `isErrorManaged: true`. |
|
|
214
|
+
| `getConfig()` | `() => StoreConfig<S, A, P, DS>` | Returns the store's configuration. |
|
|
215
|
+
| `getSnapshot()` | `() => StateListenerContext<S, DS, A, P>` | Returns a snapshot of the current state/props/actions. Used internally (e.g. by `useSyncExternalStore`). |
|
|
216
|
+
| `listenToStoreProps(depStore, keys)` | `(depStore: StoreApi, keys: K[]) => unregister` | Subscribes to another store's state changes and mirrors the listed properties into this store's props (via `setProps`) whenever they change. Returns an unregister function. |
|
|
217
|
+
|
|
218
|
+
**Note**: most of these methods (`init`, `runMountEffects`, `destroy`, `setProps`) are lifecycle methods already called for you by **useLocalStore** and **useBindStore**. You only need to call them yourself when driving a store outside these two hooks — e.g. a plain **createStore** used without React, or read through **useStore** / **useStoreSlice** (which only subscribe, they don't own the lifecycle).
|
|
151
219
|
|
|
152
220
|
# Initial state
|
|
153
221
|
|
|
@@ -648,7 +716,7 @@ const actions: StoreActions<State, Actions> = {
|
|
|
648
716
|
|
|
649
717
|
## Call actions on mount
|
|
650
718
|
|
|
651
|
-
When store is
|
|
719
|
+
When the store is mounted, the **onMount** option is called.
|
|
652
720
|
|
|
653
721
|
```typescript
|
|
654
722
|
import { StoreConfig } from 'state-decorator';
|
|
@@ -662,9 +730,19 @@ const config: StoreConfig<State, Actions, Props> = {
|
|
|
662
730
|
};
|
|
663
731
|
```
|
|
664
732
|
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
React
|
|
733
|
+
**onMount** (and any **onPropsChange** entry flagged **onMount: true**, see below) is _not_ called by **init()**. It is called by **runMountEffects()**, a separate store method that must be called once, after **init()**, from a React layout/passive effect (never from a render body) — **useLocalStore** and **useBindStore** already call it for you automatically, since these are the hooks that own the store's lifecycle (they call `init`/`runMountEffects`/`destroy`). **useStore** does not: it only subscribes to a store that is already initialized and mounted elsewhere (e.g. by `useBindStore`, `useLocalStore`, or manual code), so it never calls `init` or `runMountEffects` itself.
|
|
734
|
+
|
|
735
|
+
If you use **createStore** without any of these hooks (a store driven entirely outside React, e.g. `store.init(props)` called directly), you are responsible for calling `store.runMountEffects()` yourself once after `init()` — otherwise **onMount** (and any props change effects flagged `onMount: true`) will never run.
|
|
736
|
+
|
|
737
|
+
```typescript
|
|
738
|
+
const store = createStore(config);
|
|
739
|
+
store.init(props);
|
|
740
|
+
store.runMountEffects(); // required if the store isn't bound via useLocalStore / useBindStore
|
|
741
|
+
```
|
|
742
|
+
|
|
743
|
+
**onMount** is called from a layout effect (_useLayoutEffect_), synchronously right after mount and before paint. **onMountDeferred** is called from a passive effect (_useEffect_), after paint.
|
|
744
|
+
|
|
745
|
+
Use **onMount** for state changes that should be visible on first paint (e.g. avoiding a flash of missing data). Use **onMountDeferred** for work that doesn't need to block paint (e.g. expensive initialization, or work that depends on child components' own effects/refs having already run).
|
|
668
746
|
|
|
669
747
|
```typescript
|
|
670
748
|
import { StoreConfig } from 'state-decorator';
|
|
@@ -735,7 +813,7 @@ const config: StoreConfig<State, Actions, Props> = {
|
|
|
735
813
|
|
|
736
814
|
## OnMount
|
|
737
815
|
|
|
738
|
-
If the onMount flag is set on the props change configuration, the effects and side effects will be executed
|
|
816
|
+
If the onMount flag is set on the props change configuration, the effects and side effects will be executed when **runMountEffects()** is called (see [Call actions on mount](#call-actions-on-mount) above) — automatically after mount when using **useLocalStore** / **useStore** / **useBindStore**, or manually via `store.runMountEffects()` if the store isn't bound to any of these hooks.
|
|
739
817
|
|
|
740
818
|
It allows to trigger same actions at creation time and when the dependencies props are changed.
|
|
741
819
|
|
|
@@ -786,7 +864,7 @@ const config: StoreConfig<State, Actions, Props> = {
|
|
|
786
864
|
- Use several prop change configurations to separate dependencies between props and have simple definition.
|
|
787
865
|
- Use onMount flag to have a more systematic and simpler code.
|
|
788
866
|
|
|
789
|
-
# Global / local Stores and State sharing
|
|
867
|
+
# <a name="GlobalLocalStores"></a>Global / local Stores and State sharing
|
|
790
868
|
|
|
791
869
|
There are two ways to share state and actions:
|
|
792
870
|
|
|
@@ -825,13 +903,13 @@ export const store = createStore(getInitialState, userAppActions);
|
|
|
825
903
|
|
|
826
904
|
// In another file
|
|
827
905
|
import { memo } from 'react';
|
|
828
|
-
import {
|
|
906
|
+
import { useBindStore } from 'state-decorator';
|
|
829
907
|
import store from './GlobalStore';
|
|
830
908
|
|
|
831
|
-
// Bind to react component
|
|
909
|
+
// Bind to react component and inject props
|
|
832
910
|
// Each time the store state changes, a re-render is done.
|
|
833
911
|
export function Container(props: Props) {
|
|
834
|
-
const { state, actions } =
|
|
912
|
+
const { state, actions } = useBindStore(store, props);
|
|
835
913
|
return (
|
|
836
914
|
<div>
|
|
837
915
|
<Title text={state.title} />
|
|
@@ -1046,7 +1124,7 @@ const store = createStore<State, Actions, Props, DerivedState>({
|
|
|
1046
1124
|
});
|
|
1047
1125
|
|
|
1048
1126
|
export function App(props: Props) {
|
|
1049
|
-
const { state } =
|
|
1127
|
+
const { state } = useBindStore(store, props);
|
|
1050
1128
|
// state contains the store state and derived state
|
|
1051
1129
|
return (
|
|
1052
1130
|
<div>
|
|
@@ -1701,6 +1779,20 @@ resolve: {
|
|
|
1701
1779
|
|
|
1702
1780
|
# Migration
|
|
1703
1781
|
|
|
1782
|
+
## V7 to V8
|
|
1783
|
+
|
|
1784
|
+
No breaking changes for **useLocalStore** / **useStore** / **useBindStore** users — they behave the same, no code change needed.
|
|
1785
|
+
|
|
1786
|
+
The only breaking change concerns code using **createStore** directly without any of these hooks: **onMount** (and **onPropsChange** entries flagged **onMount: true**) is no longer called by **init()**. It is now called by a new **runMountEffects()** store method, which you must call once yourself, right after **init()**:
|
|
1787
|
+
|
|
1788
|
+
```diff
|
|
1789
|
+
const store = createStore(config);
|
|
1790
|
+
store.init(props);
|
|
1791
|
+
+store.runMountEffects();
|
|
1792
|
+
```
|
|
1793
|
+
|
|
1794
|
+
If you skip this, **onMount** (and `onMount`-flagged **onPropsChange** entries) will simply never run. See [Call actions on mount](#call-actions-on-mount) for details.
|
|
1795
|
+
|
|
1704
1796
|
## V6 to V7
|
|
1705
1797
|
|
|
1706
1798
|
### Step 1: V6 compatibility layer
|
package/es/index.d.ts
CHANGED
|
@@ -39,6 +39,11 @@ export type StoreApi<S, A extends DecoratedActions, P, DS = {}> = {
|
|
|
39
39
|
* Initializes the store with the specified props
|
|
40
40
|
*/
|
|
41
41
|
readonly init: (p: P) => void;
|
|
42
|
+
/**
|
|
43
|
+
* Runs onMount (and onPropsChange entries flagged onMount) exactly once for this store instance.
|
|
44
|
+
* Must be called from an effect (useLayoutEffect/useEffect), never from a render body.
|
|
45
|
+
*/
|
|
46
|
+
readonly runMountEffects: () => void;
|
|
42
47
|
/**
|
|
43
48
|
* Update the store with the specified props
|
|
44
49
|
*/
|
package/es/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import r,{useMemo as e,useContext as n,useRef as t,useEffect as u,useLayoutEffect as o,useReducer as i}from"react";import{createRef as c,isFuncConfig as a,isSimpleSyncAction as l,decorateSimpleSyncAction as f,isAsyncAction as s,decorateAsyncAction as d,computeAsyncActionInput as v,isSyncAction as p,decorateSyncAction as O,globalConfig as _,onPropChange as E,DEFAULT_PROMISE_ID as S,fixDerivedDeps as y,computeDerivedValues as g,buildOnMountInvocationContext as L,buildOnUnMountInvocationContext as h,isLoadingImpl as b,runMiddlewares as A,buildLoadingMap as m,buildErrorMap as R}from"./impl";export{EffectError,ParallelActionError,setGlobalConfig}from"./impl";import{logDetailedEffects as T}from"./development";var M=function(){return M=Object.assign||function(r){for(var e,n=1,t=arguments.length;n<t;n++)for(var u in e=arguments[n])Object.prototype.hasOwnProperty.call(e,u)&&(r[u]=e[u]);return r},M.apply(this,arguments)};function j(r,e,n){if(n||2===arguments.length)for(var t,u=0,o=e.length;u<o;u++)!t&&u in e||(t||(t=Array.prototype.slice.call(e,0,u)),t[u]=e[u]);return r.concat(t||Array.prototype.slice.call(e))}function w(r){var e={exports:{}};return r(e,e.exports),e.exports}"function"==typeof SuppressedError&&SuppressedError;var V="function"==typeof Object.is?Object.is:function(r,e){return r===e&&(0!==r||1/r==1/e)||r!=r&&e!=e},x=r.useState,D=r.useEffect,k=r.useLayoutEffect,P=r.useDebugValue;function C(r){var e=r.getSnapshot;r=r.value;try{var n=e();return!V(r,n)}catch(r){return!0}}var G="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(r,e){return e()}:function(r,e){var n=e(),t=x({inst:{value:n,getSnapshot:e}}),u=t[0].inst,o=t[1];return k((function(){u.value=n,u.getSnapshot=e,C(u)&&o({inst:u})}),[r,n,e]),D((function(){return C(u)&&o({inst:u}),r((function(){C(u)&&o({inst:u})}))}),[r]),P(n),n},K={useSyncExternalStore:void 0!==r.useSyncExternalStore?r.useSyncExternalStore:G},B=w((function(e,n){"production"!==process.env.NODE_ENV&&function(){function e(r){var e=r.getSnapshot;r=r.value;try{var n=e();return!u(r,n)}catch(r){return!0}}"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var t=r,u="function"==typeof Object.is?Object.is:function(r,e){return r===e&&(0!==r||1/r==1/e)||r!=r&&e!=e},o=t.useState,i=t.useEffect,c=t.useLayoutEffect,a=t.useDebugValue,l=!1,f=!1,s="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(r,e){return e()}:function(r,n){l||void 0===t.startTransition||(l=!0,console.error("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var s=n();if(!f){var d=n();u(s,d)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),f=!0)}var v=(d=o({inst:{value:s,getSnapshot:n}}))[0].inst,p=d[1];return c((function(){v.value=s,v.getSnapshot=n,e(v)&&p({inst:v})}),[r,s,n]),i((function(){return e(v)&&p({inst:v}),r((function(){e(v)&&p({inst:v})}))}),[r]),a(s),s};n.useSyncExternalStore=void 0!==t.useSyncExternalStore?t.useSyncExternalStore:s,"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()})),I=K,H=B,N=w((function(r){"production"===process.env.NODE_ENV?r.exports=I:r.exports=H})),U=N;var W,z="function"==typeof Object.is?Object.is:function(r,e){return r===e&&(0!==r||1/r==1/e)||r!=r&&e!=e},F=N.useSyncExternalStore,J=r.useRef,Y=r.useEffect,q=r.useMemo,Q=r.useDebugValue,X={useSyncExternalStoreWithSelector:function(r,e,n,t,u){var o=J(null);if(null===o.current){var i={hasValue:!1,value:null};o.current=i}else i=o.current;o=q((function(){function r(r){if(!a){if(a=!0,o=r,r=t(r),void 0!==u&&i.hasValue){var e=i.value;if(u(e,r))return c=e}return c=r}if(e=c,z(o,r))return e;var n=t(r);return void 0!==u&&u(e,n)?(o=r,e):(o=r,c=n)}var o,c,a=!1,l=void 0===n?null:n;return[function(){return r(e())},null===l?void 0:function(){return r(l())}]}),[e,n,t,u]);var c=F(r,o[0],o[1]);return Y((function(){i.hasValue=!0,i.value=c}),[c]),Q(c),c}},Z=w((function(e,n){"production"!==process.env.NODE_ENV&&function(){"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var e=r,t=N,u="function"==typeof Object.is?Object.is:function(r,e){return r===e&&(0!==r||1/r==1/e)||r!=r&&e!=e},o=t.useSyncExternalStore,i=e.useRef,c=e.useEffect,a=e.useMemo,l=e.useDebugValue;n.useSyncExternalStoreWithSelector=function(r,e,n,t,f){var s=i(null);if(null===s.current){var d={hasValue:!1,value:null};s.current=d}else d=s.current;s=a((function(){function r(r){if(!c){if(c=!0,o=r,r=t(r),void 0!==f&&d.hasValue){var e=d.value;if(f(e,r))return i=e}return i=r}if(e=i,u(o,r))return e;var n=t(r);return void 0!==f&&f(e,n)?(o=r,e):(o=r,i=n)}var o,i,c=!1,a=void 0===n?null:n;return[function(){return r(e())},null===a?void 0:function(){return r(a())}]}),[e,n,t,f]);var v=o(r,s[0],s[1]);return c((function(){d.hasValue=!0,d.value=v}),[v]),l(v),v},"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()})),$=X,rr=Z,er=w((function(r){"production"===process.env.NODE_ENV?r.exports=$:r.exports=rr}));!function(r){r.REJECT="reject",r.IGNORE="ignore",r.KEEP_LAST="keepLast",r.KEEP_ALL="keepAll",r.PARALLEL="parallel",r.REUSE="reuse",r.ABORT="abort"}(W||(W={}));var nr=er.useSyncExternalStoreWithSelector,tr=U.useSyncExternalStore;function ur(r){var e=c(),n=c(),t=c(),u=c(),o=c(),i=c(),w=c(),V=c(),x=c(),D=c(),k=c(),P=c(!1),C=c(!1),G=c(),K=c([]),B=r.actions,I=r.middlewares,H=void 0===I?[]:I,N=function(r,e){var n={};for(var t in r)Object.prototype.hasOwnProperty.call(r,t)&&e.indexOf(t)<0&&(n[t]=r[t]);if(null!=r&&"function"==typeof Object.getOwnPropertySymbols){var u=0;for(t=Object.getOwnPropertySymbols(r);u<t.length;u++)e.indexOf(t[u])<0&&Object.prototype.propertyIsEnumerable.call(r,t[u])&&(n[t[u]]=r[t[u]])}return n}(r,["actions","middlewares"]),U=a(r)?r.getInitialState:function(){return r.initialState},W={},z=0;function F(){G.current=M(M(M(M(M({},t.current),u.current),e.current),n.current.state),{isLoading:rr,abortAction:er,loading:V.current,loadingMap:w.current,loadingParallelMap:i.current,errorMap:nr(),errorParallelMap:x.current}),C.current=!1,Object.keys(W).forEach((function(r){var e;null===(e=W[r])||void 0===e||e.call(W)}))}function J(r){var o=t.current;t.current=r,P.current?E(e,n,t,o,u,N,U,Z,!1,!1):Q(r)}function Y(r){e.current=r,g(e,t,n,N),F()}function q(r){i.current=r,w.current=function(){if(P.current){var r=i.current;return Object.keys(r).reduce((function(e,n){var t=r[n];return e[n]=null!=Object.keys(t).find((function(r){return!!t[r]})),e}),{})}return null}(),V.current=function(){if(P.current){var r=i.current;return null!=Object.keys(r).find((function(e){var n=r[e];return Object.keys(n).find((function(r){return!!n[r]}))}))}return null}()}function Q(i){var c;if(!P.current){t.current=i,P.current=!0,e.current=U(i);var a=new Set(null==N?void 0:N.initialActionsMarkedLoading),l=Object.keys(B).reduce((function(r,e){var n;return r[e]=a.has(e)?((n={})[S]=!0,n):{},r}),{});q(l),x.current=Object.keys(B).reduce((function(r,e){return r[e]={},r}),{}),o.current={},D.current={},k.current={},n.current={state:null,deps:{}},(null==N?void 0:N.derivedState)&&y(N),K.current=[];var f={options:N,get state(){return e.current},actions:B,setState:Y};r.logEnabled&&T&&H.push(T());var s=function(r){var e,n=r();K.current.push(n),null===(e=n.init)||void 0===e||e.call(n,f)};null===(c=_.defaultMiddlewares)||void 0===c||c.forEach(s),null==H||H.forEach(s),g(e,t,n,N),E(e,n,t,null,u,N,U,Z,!0,!1),(null==N?void 0:N.onMount)&&N.onMount(L(e,n,t,u)),F()}}function X(r,e){void 0===e&&(e=S);var n=x.current[r];(null==n?void 0:n[e])&&delete n[e],F()}function Z(r,u,o,c,a,l,f,s,d){void 0===f&&(f=!1),void 0===s&&(s=!1),void 0===d&&(d=!1);var v=!1;if(!P.current)return F;var p=u,O=!!a&&b(p||i.current,[o,null==l?void 0:l.promiseId]),_=A(K.current,e.current,r,O,o,c,a,l),E=_.newState,y=_.newLoading;if(null!=E&&(v=!0,e.current=E),O!==y&&(p=m(p,o,(null==l?void 0:l.promiseId)||S,y),0===Object.keys(p).length&&(p=void 0)),null!=p&&(v=!0,q(p)),v)g(e,t,n,N),s||(e.current=E||e.current,d||F());else if(f){!g(e,t,n,N)||s||d||F()}return F}var $=Object.keys(B);function rr(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];return b.apply(void 0,j([i.current],r,!1))}function er(r,e){var n,t;void 0===e&&(e=S);var u=null===(t=null===(n=D.current[r])||void 0===n?void 0:n[e])||void 0===t?void 0:t.abortController,o=!1;return u&&(u.abort(),o=!0),o}function nr(){return P.current?R(x.current):null}return u.current=$.reduce((function(r,c){var a=B[c];return l(a)?r[c]=f(c,a,e,n,t,P,N,Z):s(a)?r[c]=d({actionName:c,stateRef:e,derivedStateRef:n,propsRef:t,loadingParallelMapRef:i,errorMapRef:x,actionsRef:u,promisesRef:D,conflictActionsRef:k,initializedRef:P,timeoutRef:o,needNotifyListenersRef:C,options:N,setState:Z,clearError:X,action:v(a)}):p(a)&&(r[c]=O(c,a,e,n,t,u,P,o,C,N,Z,X)),r}),{}),{getConfig:function(){return M({},r)},setProps:J,addStateListener:function(r){var e="".concat(z++);return W[e]=r,function(){delete W[e]}},init:Q,destroy:function(){var r;if(P.current){var u=Object.keys(B).reduce((function(r,e){var n=B[e];if(s(n)&&n.abortable){var t=i.current[e],u=Object.keys(t).reduce((function(r,n){return t[n]&&(er(e,n),r.push(n)),r}),[]);u.length>0&&(r[e]=u)}return r}),{});null===(r=null==N?void 0:N.onUnmount)||void 0===r||r.call(N,h(e,n,t,u)),Object.keys(o.current).forEach((function(r){clearTimeout(o.current[r])})),t.current=null,e.current=null,i.current=null,w.current=null,V.current=null,x.current=null,D.current=null,k.current=null,n.current=null,G.current=null,o.current=null,W={},P.current=!1,K.current.forEach((function(r){var e;null===(e=r.destroy)||void 0===e||e.call(r)})),K.current=[]}},isLoading:rr,abortAction:er,clearError:X,getSnapshot:function(){return G.current},invokeOnMountDeferred:function(){E(e,n,t,null,u,N,U,Z,!0,!0),(null==N?void 0:N.onMountDeferred)&&N.onMountDeferred(L(e,n,t,u))},listenToStoreProps:function(r,e){var n=r.state?fr(r.state,e):{};return r.addStateListener((function(){var u=r.state;if(u){var o=fr(u,e);e.some((function(r){return!Object.is(n[r],o[r])}))&&(n=o,J(M(M({},t.current),o)))}}))},get actions(){return u.current},get state(){return P.current?M(M({},e.current),n.current.state):null},get loading(){return V.current},get loadingMap(){return w.current},get errorMap(){return nr()},get loadingParallelMap(){return P.current?i.current:null},get errorParallelMap(){return P.current?x.current:null}}}function or(r,n,t){void 0===t&&(t=[]);var u=e((function(){return n instanceof Function?n:function(r){return fr(r,n)}}),j([n],t,!0));return nr(r.addStateListener,r.getSnapshot,void 0,u,_.comparator)}function ir(r){return tr(r.addStateListener,r.getSnapshot),r}function cr(r,e){return or(n(r),e)}function ar(r,e,n){void 0===n&&(n=!0);var c=t();return null==c.current&&(c.current=ur(r)),u((function(){return c.current.invokeOnMountDeferred(),function(){var r;null===(r=c.current)||void 0===r||r.destroy()}}),[]),function(r,e,n){void 0===e&&(e=null),void 0===n&&(n=!0);var u=i((function(r){return r>100?0:r+1}),0)[1],c=t(r);return r.setProps(e),o((function(){r.init(e)}),[]),o((function(){if(n)return c.current.addStateListener((function(){u()}))}),[n]),r}(c.current,e,n)}function lr(r,e){return r.setProps(e),tr(r.addStateListener,r.getSnapshot),o((function(){r.init(e)}),[]),u((function(){r.invokeOnMountDeferred()}),[r]),r}function fr(r,e){return e.reduce((function(e,n){return r.hasOwnProperty(n)&&(e[n]=r[n]),e}),{})}function sr(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];return function(e){return fr(e,r)}}export{W as ConflictPolicy,ur as createStore,ar as default,fr as pick,sr as slice,lr as useBindStore,ar as useLocalStore,ir as useStore,cr as useStoreContextSlice,or as useStoreSlice};
|
|
1
|
+
import r,{useMemo as n,useContext as e,useRef as t,useEffect as u,useLayoutEffect as o,useReducer as c}from"react";import{createRef as i,isFuncConfig as a,isSimpleSyncAction as l,decorateSimpleSyncAction as f,isAsyncAction as s,decorateAsyncAction as d,computeAsyncActionInput as v,isSyncAction as p,decorateSyncAction as O,globalConfig as _,onPropChange as E,DEFAULT_PROMISE_ID as S,fixDerivedDeps as y,computeDerivedValues as g,buildOnMountInvocationContext as L,buildOnUnMountInvocationContext as h,isLoadingImpl as b,runMiddlewares as A,buildLoadingMap as m,buildErrorMap as M}from"./impl";export{EffectError,ParallelActionError,setGlobalConfig}from"./impl";import{logDetailedEffects as R}from"./development";var T=function(){return T=Object.assign||function(r){for(var n,e=1,t=arguments.length;e<t;e++)for(var u in n=arguments[e])Object.prototype.hasOwnProperty.call(n,u)&&(r[u]=n[u]);return r},T.apply(this,arguments)};function j(r,n,e){if(e||2===arguments.length)for(var t,u=0,o=n.length;u<o;u++)!t&&u in n||(t||(t=Array.prototype.slice.call(n,0,u)),t[u]=n[u]);return r.concat(t||Array.prototype.slice.call(n))}function w(r){var n={exports:{}};return r(n,n.exports),n.exports}"function"==typeof SuppressedError&&SuppressedError;var V="function"==typeof Object.is?Object.is:function(r,n){return r===n&&(0!==r||1/r==1/n)||r!=r&&n!=n},x=r.useState,D=r.useEffect,k=r.useLayoutEffect,P=r.useDebugValue;function C(r){var n=r.getSnapshot;r=r.value;try{var e=n();return!V(r,e)}catch(r){return!0}}var G="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(r,n){return n()}:function(r,n){var e=n(),t=x({inst:{value:e,getSnapshot:n}}),u=t[0].inst,o=t[1];return k((function(){u.value=e,u.getSnapshot=n,C(u)&&o({inst:u})}),[r,e,n]),D((function(){return C(u)&&o({inst:u}),r((function(){C(u)&&o({inst:u})}))}),[r]),P(e),e},K={useSyncExternalStore:void 0!==r.useSyncExternalStore?r.useSyncExternalStore:G},B=w((function(n,e){"production"!==process.env.NODE_ENV&&function(){function n(r){var n=r.getSnapshot;r=r.value;try{var e=n();return!u(r,e)}catch(r){return!0}}"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var t=r,u="function"==typeof Object.is?Object.is:function(r,n){return r===n&&(0!==r||1/r==1/n)||r!=r&&n!=n},o=t.useState,c=t.useEffect,i=t.useLayoutEffect,a=t.useDebugValue,l=!1,f=!1,s="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(r,n){return n()}:function(r,e){l||void 0===t.startTransition||(l=!0,console.error("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var s=e();if(!f){var d=e();u(s,d)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),f=!0)}var v=(d=o({inst:{value:s,getSnapshot:e}}))[0].inst,p=d[1];return i((function(){v.value=s,v.getSnapshot=e,n(v)&&p({inst:v})}),[r,s,e]),c((function(){return n(v)&&p({inst:v}),r((function(){n(v)&&p({inst:v})}))}),[r]),a(s),s};e.useSyncExternalStore=void 0!==t.useSyncExternalStore?t.useSyncExternalStore:s,"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()})),I=K,H=B,N=w((function(r){"production"===process.env.NODE_ENV?r.exports=I:r.exports=H})),U=N;var W,z="function"==typeof Object.is?Object.is:function(r,n){return r===n&&(0!==r||1/r==1/n)||r!=r&&n!=n},F=N.useSyncExternalStore,J=r.useRef,Y=r.useEffect,q=r.useMemo,Q=r.useDebugValue,X={useSyncExternalStoreWithSelector:function(r,n,e,t,u){var o=J(null);if(null===o.current){var c={hasValue:!1,value:null};o.current=c}else c=o.current;o=q((function(){function r(r){if(!a){if(a=!0,o=r,r=t(r),void 0!==u&&c.hasValue){var n=c.value;if(u(n,r))return i=n}return i=r}if(n=i,z(o,r))return n;var e=t(r);return void 0!==u&&u(n,e)?(o=r,n):(o=r,i=e)}var o,i,a=!1,l=void 0===e?null:e;return[function(){return r(n())},null===l?void 0:function(){return r(l())}]}),[n,e,t,u]);var i=F(r,o[0],o[1]);return Y((function(){c.hasValue=!0,c.value=i}),[i]),Q(i),i}},Z=w((function(n,e){"production"!==process.env.NODE_ENV&&function(){"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var n=r,t=N,u="function"==typeof Object.is?Object.is:function(r,n){return r===n&&(0!==r||1/r==1/n)||r!=r&&n!=n},o=t.useSyncExternalStore,c=n.useRef,i=n.useEffect,a=n.useMemo,l=n.useDebugValue;e.useSyncExternalStoreWithSelector=function(r,n,e,t,f){var s=c(null);if(null===s.current){var d={hasValue:!1,value:null};s.current=d}else d=s.current;s=a((function(){function r(r){if(!i){if(i=!0,o=r,r=t(r),void 0!==f&&d.hasValue){var n=d.value;if(f(n,r))return c=n}return c=r}if(n=c,u(o,r))return n;var e=t(r);return void 0!==f&&f(n,e)?(o=r,n):(o=r,c=e)}var o,c,i=!1,a=void 0===e?null:e;return[function(){return r(n())},null===a?void 0:function(){return r(a())}]}),[n,e,t,f]);var v=o(r,s[0],s[1]);return i((function(){d.hasValue=!0,d.value=v}),[v]),l(v),v},"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()})),$=X,rr=Z,nr=w((function(r){"production"===process.env.NODE_ENV?r.exports=$:r.exports=rr}));!function(r){r.REJECT="reject",r.IGNORE="ignore",r.KEEP_LAST="keepLast",r.KEEP_ALL="keepAll",r.PARALLEL="parallel",r.REUSE="reuse",r.ABORT="abort"}(W||(W={}));var er=nr.useSyncExternalStoreWithSelector,tr=U.useSyncExternalStore;function ur(r){var n=i(),e=i(),t=i(),u=i(),o=i(),c=i(),w=i(),V=i(),x=i(),D=i(),k=i(),P=i(!1),C=i(!1),G=i(!1),K=i(),B=i([]),I=r.actions,H=r.middlewares,N=void 0===H?[]:H,U=function(r,n){var e={};for(var t in r)Object.prototype.hasOwnProperty.call(r,t)&&n.indexOf(t)<0&&(e[t]=r[t]);if(null!=r&&"function"==typeof Object.getOwnPropertySymbols){var u=0;for(t=Object.getOwnPropertySymbols(r);u<t.length;u++)n.indexOf(t[u])<0&&Object.prototype.propertyIsEnumerable.call(r,t[u])&&(e[t[u]]=r[t[u]])}return e}(r,["actions","middlewares"]),W=a(r)?r.getInitialState:function(){return r.initialState},z={},F=0;function J(){K.current=T(T(T(T(T({},t.current),u.current),n.current),e.current.state),{isLoading:nr,abortAction:er,loading:V.current,loadingMap:w.current,loadingParallelMap:c.current,errorMap:tr(),errorParallelMap:x.current}),G.current=!1,Object.keys(z).forEach((function(r){var n;null===(n=z[r])||void 0===n||n.call(z)}))}function Y(r){var o=t.current;t.current=r,P.current?E(n,e,t,o,u,U,W,$,!1,!1):X(r)}function q(r){n.current=r,g(n,t,e,U),J()}function Q(r){c.current=r,w.current=function(){if(P.current){var r=c.current;return Object.keys(r).reduce((function(n,e){var t=r[e];return n[e]=null!=Object.keys(t).find((function(r){return!!t[r]})),n}),{})}return null}(),V.current=function(){if(P.current){var r=c.current;return null!=Object.keys(r).find((function(n){var e=r[n];return Object.keys(e).find((function(r){return!!e[r]}))}))}return null}()}function X(u){var c;if(!P.current){t.current=u,P.current=!0,n.current=W(u);var i=new Set(null==U?void 0:U.initialActionsMarkedLoading),a=Object.keys(I).reduce((function(r,n){var e;return r[n]=i.has(n)?((e={})[S]=!0,e):{},r}),{});Q(a),x.current=Object.keys(I).reduce((function(r,n){return r[n]={},r}),{}),o.current={},D.current={},k.current={},e.current={state:null,deps:{}},(null==U?void 0:U.derivedState)&&y(U),B.current=[];var l={options:U,get state(){return n.current},actions:I,setState:q};r.logEnabled&&R&&N.push(R());var f=function(r){var n,e=r();B.current.push(e),null===(n=e.init)||void 0===n||n.call(e,l)};null===(c=_.defaultMiddlewares)||void 0===c||c.forEach(f),null==N||N.forEach(f),g(n,t,e,U),J()}}function Z(r,n){void 0===n&&(n=S);var e=x.current[r];(null==e?void 0:e[n])&&delete e[n],J()}function $(r,u,o,i,a,l,f,s,d){void 0===f&&(f=!1),void 0===s&&(s=!1),void 0===d&&(d=!1);var v=!1;if(!P.current)return J;var p=u,O=!!a&&b(p||c.current,[o,null==l?void 0:l.promiseId]),_=A(B.current,n.current,r,O,o,i,a,l),E=_.newState,y=_.newLoading;if(null!=E&&(v=!0,n.current=E),O!==y&&(p=m(p,o,(null==l?void 0:l.promiseId)||S,y),0===Object.keys(p).length&&(p=void 0)),null!=p&&(v=!0,Q(p)),v)g(n,t,e,U),s||(n.current=E||n.current,d||J());else if(f){!g(n,t,e,U)||s||d||J()}return J}var rr=Object.keys(I);function nr(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return b.apply(void 0,j([c.current],r,!1))}function er(r,n){var e,t;void 0===n&&(n=S);var u=null===(t=null===(e=D.current[r])||void 0===e?void 0:e[n])||void 0===t?void 0:t.abortController,o=!1;return u&&(u.abort(),o=!0),o}function tr(){return P.current?M(x.current):null}return u.current=rr.reduce((function(r,i){var a=I[i];return l(a)?r[i]=f(i,a,n,e,t,P,U,$):s(a)?r[i]=d({actionName:i,stateRef:n,derivedStateRef:e,propsRef:t,loadingParallelMapRef:c,errorMapRef:x,actionsRef:u,promisesRef:D,conflictActionsRef:k,initializedRef:P,timeoutRef:o,needNotifyListenersRef:G,options:U,setState:$,clearError:Z,action:v(a)}):p(a)&&(r[i]=O(i,a,n,e,t,u,P,o,G,U,$,Z)),r}),{}),{getConfig:function(){return T({},r)},setProps:Y,addStateListener:function(r){var n="".concat(F++);return z[n]=r,function(){delete z[n]}},init:X,runMountEffects:function(){P.current&&!C.current&&(C.current=!0,E(n,e,t,null,u,U,W,$,!0,!1),(null==U?void 0:U.onMount)&&U.onMount(L(n,e,t,u)),J())},destroy:function(){var r;if(P.current){var u=Object.keys(I).reduce((function(r,n){var e=I[n];if(s(e)&&e.abortable){var t=c.current[n],u=Object.keys(t).reduce((function(r,e){return t[e]&&(er(n,e),r.push(e)),r}),[]);u.length>0&&(r[n]=u)}return r}),{});null===(r=null==U?void 0:U.onUnmount)||void 0===r||r.call(U,h(n,e,t,u)),Object.keys(o.current).forEach((function(r){clearTimeout(o.current[r])})),t.current=null,n.current=null,c.current=null,w.current=null,V.current=null,x.current=null,D.current=null,k.current=null,e.current=null,K.current=null,o.current=null,z={},P.current=!1,C.current=!1,B.current.forEach((function(r){var n;null===(n=r.destroy)||void 0===n||n.call(r)})),B.current=[]}},isLoading:nr,abortAction:er,clearError:Z,getSnapshot:function(){return K.current},invokeOnMountDeferred:function(){E(n,e,t,null,u,U,W,$,!0,!0),(null==U?void 0:U.onMountDeferred)&&U.onMountDeferred(L(n,e,t,u))},listenToStoreProps:function(r,n){var e=r.state?fr(r.state,n):{};return r.addStateListener((function(){var u=r.state;if(u){var o=fr(u,n);n.some((function(r){return!Object.is(e[r],o[r])}))&&(e=o,Y(T(T({},t.current),o)))}}))},get actions(){return u.current},get state(){return P.current?T(T({},n.current),e.current.state):null},get loading(){return V.current},get loadingMap(){return w.current},get errorMap(){return tr()},get loadingParallelMap(){return P.current?c.current:null},get errorParallelMap(){return P.current?x.current:null}}}function or(r,e,t){void 0===t&&(t=[]);var u=n((function(){return e instanceof Function?e:function(r){return fr(r,e)}}),j([e],t,!0));return er(r.addStateListener,r.getSnapshot,void 0,u,_.comparator)}function cr(r){return tr(r.addStateListener,r.getSnapshot),r}function ir(r,n){return or(e(r),n)}function ar(r,n,e){void 0===e&&(e=!0);var i=t();return null==i.current&&(i.current=ur(r)),u((function(){return i.current.invokeOnMountDeferred(),function(){var r;null===(r=i.current)||void 0===r||r.destroy()}}),[]),function(r,n,e){void 0===n&&(n=null),void 0===e&&(e=!0);var u=c((function(r){return r>100?0:r+1}),0)[1],i=t(r);return r.setProps(n),o((function(){if(e)return i.current.addStateListener((function(){u()}))}),[e]),o((function(){r.init(n),r.runMountEffects()}),[]),r}(i.current,n,e)}function lr(r,n){return r.setProps(n),tr(r.addStateListener,r.getSnapshot),o((function(){r.init(n),r.runMountEffects()}),[]),u((function(){r.invokeOnMountDeferred()}),[r]),r}function fr(r,n){return n.reduce((function(n,e){return r.hasOwnProperty(e)&&(n[e]=r[e]),n}),{})}function sr(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return function(n){return fr(n,r)}}export{W as ConflictPolicy,ur as createStore,ar as default,fr as pick,sr as slice,lr as useBindStore,ar as useLocalStore,cr as useStore,ir as useStoreContextSlice,or as useStoreSlice};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/es/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../node_modules/tslib/tslib.es6.mjs","../../node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.js","../../node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js","../../node_modules/use-sync-external-store/shim/index.js","../../node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.js","../../node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.development.js","../../node_modules/use-sync-external-store/shim/with-selector.js"],"sourcesContent":["/******************************************************************************\nCopyright (c) Microsoft Corporation.\n\nPermission to use, copy, modify, and/or distribute this software for any\npurpose with or without fee is hereby granted.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\nPERFORMANCE OF THIS SOFTWARE.\n***************************************************************************** */\n/* global Reflect, Promise, SuppressedError, Symbol, Iterator */\n\nvar extendStatics = function(d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n};\n\nexport function __extends(d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n}\n\nexport var __assign = function() {\n __assign = Object.assign || function __assign(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\n }\n return t;\n }\n return __assign.apply(this, arguments);\n}\n\nexport function __rest(s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n}\n\nexport function __decorate(decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n}\n\nexport function __param(paramIndex, decorator) {\n return function (target, key) { decorator(target, key, paramIndex); }\n}\n\nexport function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {\n function accept(f) { if (f !== void 0 && typeof f !== \"function\") throw new TypeError(\"Function expected\"); return f; }\n var kind = contextIn.kind, key = kind === \"getter\" ? \"get\" : kind === \"setter\" ? \"set\" : \"value\";\n var target = !descriptorIn && ctor ? contextIn[\"static\"] ? ctor : ctor.prototype : null;\n var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});\n var _, done = false;\n for (var i = decorators.length - 1; i >= 0; i--) {\n var context = {};\n for (var p in contextIn) context[p] = p === \"access\" ? {} : contextIn[p];\n for (var p in contextIn.access) context.access[p] = contextIn.access[p];\n context.addInitializer = function (f) { if (done) throw new TypeError(\"Cannot add initializers after decoration has completed\"); extraInitializers.push(accept(f || null)); };\n var result = (0, decorators[i])(kind === \"accessor\" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);\n if (kind === \"accessor\") {\n if (result === void 0) continue;\n if (result === null || typeof result !== \"object\") throw new TypeError(\"Object expected\");\n if (_ = accept(result.get)) descriptor.get = _;\n if (_ = accept(result.set)) descriptor.set = _;\n if (_ = accept(result.init)) initializers.unshift(_);\n }\n else if (_ = accept(result)) {\n if (kind === \"field\") initializers.unshift(_);\n else descriptor[key] = _;\n }\n }\n if (target) Object.defineProperty(target, contextIn.name, descriptor);\n done = true;\n};\n\nexport function __runInitializers(thisArg, initializers, value) {\n var useValue = arguments.length > 2;\n for (var i = 0; i < initializers.length; i++) {\n value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);\n }\n return useValue ? value : void 0;\n};\n\nexport function __propKey(x) {\n return typeof x === \"symbol\" ? x : \"\".concat(x);\n};\n\nexport function __setFunctionName(f, name, prefix) {\n if (typeof name === \"symbol\") name = name.description ? \"[\".concat(name.description, \"]\") : \"\";\n return Object.defineProperty(f, \"name\", { configurable: true, value: prefix ? \"\".concat(prefix, \" \", name) : name });\n};\n\nexport function __metadata(metadataKey, metadataValue) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\n}\n\nexport function __awaiter(thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n}\n\nexport function __generator(thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === \"function\" ? Iterator : Object).prototype);\n return g.next = verb(0), g[\"throw\"] = verb(1), g[\"return\"] = verb(2), typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n}\n\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n});\n\nexport function __exportStar(m, o) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\n}\n\nexport function __values(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n}\n\nexport function __read(o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n}\n\n/** @deprecated */\nexport function __spread() {\n for (var ar = [], i = 0; i < arguments.length; i++)\n ar = ar.concat(__read(arguments[i]));\n return ar;\n}\n\n/** @deprecated */\nexport function __spreadArrays() {\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\n r[k] = a[j];\n return r;\n}\n\nexport function __spreadArray(to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n}\n\nexport function __await(v) {\n return this instanceof __await ? (this.v = v, this) : new __await(v);\n}\n\nexport function __asyncGenerator(thisArg, _arguments, generator) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\n return i = Object.create((typeof AsyncIterator === \"function\" ? AsyncIterator : Object).prototype), verb(\"next\"), verb(\"throw\"), verb(\"return\", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;\n function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }\n function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\n function fulfill(value) { resume(\"next\", value); }\n function reject(value) { resume(\"throw\", value); }\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\n}\n\nexport function __asyncDelegator(o) {\n var i, p;\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }\n}\n\nexport function __asyncValues(o) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var m = o[Symbol.asyncIterator], i;\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\n}\n\nexport function __makeTemplateObject(cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n};\n\nvar __setModuleDefault = Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n};\n\nvar ownKeys = function(o) {\n ownKeys = Object.getOwnPropertyNames || function (o) {\n var ar = [];\n for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;\n return ar;\n };\n return ownKeys(o);\n};\n\nexport function __importStar(mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== \"default\") __createBinding(result, mod, k[i]);\n __setModuleDefault(result, mod);\n return result;\n}\n\nexport function __importDefault(mod) {\n return (mod && mod.__esModule) ? mod : { default: mod };\n}\n\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\n}\n\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\n}\n\nexport function __classPrivateFieldIn(state, receiver) {\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\n}\n\nexport function __addDisposableResource(env, value, async) {\n if (value !== null && value !== void 0) {\n if (typeof value !== \"object\" && typeof value !== \"function\") throw new TypeError(\"Object expected.\");\n var dispose, inner;\n if (async) {\n if (!Symbol.asyncDispose) throw new TypeError(\"Symbol.asyncDispose is not defined.\");\n dispose = value[Symbol.asyncDispose];\n }\n if (dispose === void 0) {\n if (!Symbol.dispose) throw new TypeError(\"Symbol.dispose is not defined.\");\n dispose = value[Symbol.dispose];\n if (async) inner = dispose;\n }\n if (typeof dispose !== \"function\") throw new TypeError(\"Object not disposable.\");\n if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };\n env.stack.push({ value: value, dispose: dispose, async: async });\n }\n else if (async) {\n env.stack.push({ async: true });\n }\n return value;\n}\n\nvar _SuppressedError = typeof SuppressedError === \"function\" ? SuppressedError : function (error, suppressed, message) {\n var e = new Error(message);\n return e.name = \"SuppressedError\", e.error = error, e.suppressed = suppressed, e;\n};\n\nexport function __disposeResources(env) {\n function fail(e) {\n env.error = env.hasError ? new _SuppressedError(e, env.error, \"An error was suppressed during disposal.\") : e;\n env.hasError = true;\n }\n var r, s = 0;\n function next() {\n while (r = env.stack.pop()) {\n try {\n if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);\n if (r.dispose) {\n var result = r.dispose.call(r.value);\n if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });\n }\n else s |= 1;\n }\n catch (e) {\n fail(e);\n }\n }\n if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();\n if (env.hasError) throw env.error;\n }\n return next();\n}\n\nexport function __rewriteRelativeImportExtension(path, preserveJsx) {\n if (typeof path === \"string\" && /^\\.\\.?\\//.test(path)) {\n return path.replace(/\\.(tsx)$|((?:\\.d)?)((?:\\.[^./]+?)?)\\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) {\n return tsx ? preserveJsx ? \".jsx\" : \".js\" : d && (!ext || !cm) ? m : (d + ext + \".\" + cm.toLowerCase() + \"js\");\n });\n }\n return path;\n}\n\nexport default {\n __extends,\n __assign,\n __rest,\n __decorate,\n __param,\n __esDecorate,\n __runInitializers,\n __propKey,\n __setFunctionName,\n __metadata,\n __awaiter,\n __generator,\n __createBinding,\n __exportStar,\n __values,\n __read,\n __spread,\n __spreadArrays,\n __spreadArray,\n __await,\n __asyncGenerator,\n __asyncDelegator,\n __asyncValues,\n __makeTemplateObject,\n __importStar,\n __importDefault,\n __classPrivateFieldGet,\n __classPrivateFieldSet,\n __classPrivateFieldIn,\n __addDisposableResource,\n __disposeResources,\n __rewriteRelativeImportExtension,\n};\n","/**\n * @license React\n * use-sync-external-store-shim.production.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\"use strict\";\nvar React = require(\"react\");\nfunction is(x, y) {\n return (x === y && (0 !== x || 1 / x === 1 / y)) || (x !== x && y !== y);\n}\nvar objectIs = \"function\" === typeof Object.is ? Object.is : is,\n useState = React.useState,\n useEffect = React.useEffect,\n useLayoutEffect = React.useLayoutEffect,\n useDebugValue = React.useDebugValue;\nfunction useSyncExternalStore$2(subscribe, getSnapshot) {\n var value = getSnapshot(),\n _useState = useState({ inst: { value: value, getSnapshot: getSnapshot } }),\n inst = _useState[0].inst,\n forceUpdate = _useState[1];\n useLayoutEffect(\n function () {\n inst.value = value;\n inst.getSnapshot = getSnapshot;\n checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst });\n },\n [subscribe, value, getSnapshot]\n );\n useEffect(\n function () {\n checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst });\n return subscribe(function () {\n checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst });\n });\n },\n [subscribe]\n );\n useDebugValue(value);\n return value;\n}\nfunction checkIfSnapshotChanged(inst) {\n var latestGetSnapshot = inst.getSnapshot;\n inst = inst.value;\n try {\n var nextValue = latestGetSnapshot();\n return !objectIs(inst, nextValue);\n } catch (error) {\n return !0;\n }\n}\nfunction useSyncExternalStore$1(subscribe, getSnapshot) {\n return getSnapshot();\n}\nvar shim =\n \"undefined\" === typeof window ||\n \"undefined\" === typeof window.document ||\n \"undefined\" === typeof window.document.createElement\n ? useSyncExternalStore$1\n : useSyncExternalStore$2;\nexports.useSyncExternalStore =\n void 0 !== React.useSyncExternalStore ? React.useSyncExternalStore : shim;\n","/**\n * @license React\n * use-sync-external-store-shim.development.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\"use strict\";\n\"production\" !== process.env.NODE_ENV &&\n (function () {\n function is(x, y) {\n return (x === y && (0 !== x || 1 / x === 1 / y)) || (x !== x && y !== y);\n }\n function useSyncExternalStore$2(subscribe, getSnapshot) {\n didWarnOld18Alpha ||\n void 0 === React.startTransition ||\n ((didWarnOld18Alpha = !0),\n console.error(\n \"You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release.\"\n ));\n var value = getSnapshot();\n if (!didWarnUncachedGetSnapshot) {\n var cachedValue = getSnapshot();\n objectIs(value, cachedValue) ||\n (console.error(\n \"The result of getSnapshot should be cached to avoid an infinite loop\"\n ),\n (didWarnUncachedGetSnapshot = !0));\n }\n cachedValue = useState({\n inst: { value: value, getSnapshot: getSnapshot }\n });\n var inst = cachedValue[0].inst,\n forceUpdate = cachedValue[1];\n useLayoutEffect(\n function () {\n inst.value = value;\n inst.getSnapshot = getSnapshot;\n checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst });\n },\n [subscribe, value, getSnapshot]\n );\n useEffect(\n function () {\n checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst });\n return subscribe(function () {\n checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst });\n });\n },\n [subscribe]\n );\n useDebugValue(value);\n return value;\n }\n function checkIfSnapshotChanged(inst) {\n var latestGetSnapshot = inst.getSnapshot;\n inst = inst.value;\n try {\n var nextValue = latestGetSnapshot();\n return !objectIs(inst, nextValue);\n } catch (error) {\n return !0;\n }\n }\n function useSyncExternalStore$1(subscribe, getSnapshot) {\n return getSnapshot();\n }\n \"undefined\" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&\n \"function\" ===\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart &&\n __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());\n var React = require(\"react\"),\n objectIs = \"function\" === typeof Object.is ? Object.is : is,\n useState = React.useState,\n useEffect = React.useEffect,\n useLayoutEffect = React.useLayoutEffect,\n useDebugValue = React.useDebugValue,\n didWarnOld18Alpha = !1,\n didWarnUncachedGetSnapshot = !1,\n shim =\n \"undefined\" === typeof window ||\n \"undefined\" === typeof window.document ||\n \"undefined\" === typeof window.document.createElement\n ? useSyncExternalStore$1\n : useSyncExternalStore$2;\n exports.useSyncExternalStore =\n void 0 !== React.useSyncExternalStore ? React.useSyncExternalStore : shim;\n \"undefined\" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&\n \"function\" ===\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&\n __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());\n })();\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('../cjs/use-sync-external-store-shim.production.js');\n} else {\n module.exports = require('../cjs/use-sync-external-store-shim.development.js');\n}\n","/**\n * @license React\n * use-sync-external-store-shim/with-selector.production.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\"use strict\";\nvar React = require(\"react\"),\n shim = require(\"use-sync-external-store/shim\");\nfunction is(x, y) {\n return (x === y && (0 !== x || 1 / x === 1 / y)) || (x !== x && y !== y);\n}\nvar objectIs = \"function\" === typeof Object.is ? Object.is : is,\n useSyncExternalStore = shim.useSyncExternalStore,\n useRef = React.useRef,\n useEffect = React.useEffect,\n useMemo = React.useMemo,\n useDebugValue = React.useDebugValue;\nexports.useSyncExternalStoreWithSelector = function (\n subscribe,\n getSnapshot,\n getServerSnapshot,\n selector,\n isEqual\n) {\n var instRef = useRef(null);\n if (null === instRef.current) {\n var inst = { hasValue: !1, value: null };\n instRef.current = inst;\n } else inst = instRef.current;\n instRef = useMemo(\n function () {\n function memoizedSelector(nextSnapshot) {\n if (!hasMemo) {\n hasMemo = !0;\n memoizedSnapshot = nextSnapshot;\n nextSnapshot = selector(nextSnapshot);\n if (void 0 !== isEqual && inst.hasValue) {\n var currentSelection = inst.value;\n if (isEqual(currentSelection, nextSnapshot))\n return (memoizedSelection = currentSelection);\n }\n return (memoizedSelection = nextSnapshot);\n }\n currentSelection = memoizedSelection;\n if (objectIs(memoizedSnapshot, nextSnapshot)) return currentSelection;\n var nextSelection = selector(nextSnapshot);\n if (void 0 !== isEqual && isEqual(currentSelection, nextSelection))\n return (memoizedSnapshot = nextSnapshot), currentSelection;\n memoizedSnapshot = nextSnapshot;\n return (memoizedSelection = nextSelection);\n }\n var hasMemo = !1,\n memoizedSnapshot,\n memoizedSelection,\n maybeGetServerSnapshot =\n void 0 === getServerSnapshot ? null : getServerSnapshot;\n return [\n function () {\n return memoizedSelector(getSnapshot());\n },\n null === maybeGetServerSnapshot\n ? void 0\n : function () {\n return memoizedSelector(maybeGetServerSnapshot());\n }\n ];\n },\n [getSnapshot, getServerSnapshot, selector, isEqual]\n );\n var value = useSyncExternalStore(subscribe, instRef[0], instRef[1]);\n useEffect(\n function () {\n inst.hasValue = !0;\n inst.value = value;\n },\n [value]\n );\n useDebugValue(value);\n return value;\n};\n","/**\n * @license React\n * use-sync-external-store-shim/with-selector.development.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\"use strict\";\n\"production\" !== process.env.NODE_ENV &&\n (function () {\n function is(x, y) {\n return (x === y && (0 !== x || 1 / x === 1 / y)) || (x !== x && y !== y);\n }\n \"undefined\" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&\n \"function\" ===\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart &&\n __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());\n var React = require(\"react\"),\n shim = require(\"use-sync-external-store/shim\"),\n objectIs = \"function\" === typeof Object.is ? Object.is : is,\n useSyncExternalStore = shim.useSyncExternalStore,\n useRef = React.useRef,\n useEffect = React.useEffect,\n useMemo = React.useMemo,\n useDebugValue = React.useDebugValue;\n exports.useSyncExternalStoreWithSelector = function (\n subscribe,\n getSnapshot,\n getServerSnapshot,\n selector,\n isEqual\n ) {\n var instRef = useRef(null);\n if (null === instRef.current) {\n var inst = { hasValue: !1, value: null };\n instRef.current = inst;\n } else inst = instRef.current;\n instRef = useMemo(\n function () {\n function memoizedSelector(nextSnapshot) {\n if (!hasMemo) {\n hasMemo = !0;\n memoizedSnapshot = nextSnapshot;\n nextSnapshot = selector(nextSnapshot);\n if (void 0 !== isEqual && inst.hasValue) {\n var currentSelection = inst.value;\n if (isEqual(currentSelection, nextSnapshot))\n return (memoizedSelection = currentSelection);\n }\n return (memoizedSelection = nextSnapshot);\n }\n currentSelection = memoizedSelection;\n if (objectIs(memoizedSnapshot, nextSnapshot))\n return currentSelection;\n var nextSelection = selector(nextSnapshot);\n if (void 0 !== isEqual && isEqual(currentSelection, nextSelection))\n return (memoizedSnapshot = nextSnapshot), currentSelection;\n memoizedSnapshot = nextSnapshot;\n return (memoizedSelection = nextSelection);\n }\n var hasMemo = !1,\n memoizedSnapshot,\n memoizedSelection,\n maybeGetServerSnapshot =\n void 0 === getServerSnapshot ? null : getServerSnapshot;\n return [\n function () {\n return memoizedSelector(getSnapshot());\n },\n null === maybeGetServerSnapshot\n ? void 0\n : function () {\n return memoizedSelector(maybeGetServerSnapshot());\n }\n ];\n },\n [getSnapshot, getServerSnapshot, selector, isEqual]\n );\n var value = useSyncExternalStore(subscribe, instRef[0], instRef[1]);\n useEffect(\n function () {\n inst.hasValue = !0;\n inst.value = value;\n },\n [value]\n );\n useDebugValue(value);\n return value;\n };\n \"undefined\" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&\n \"function\" ===\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&\n __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());\n })();\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('../cjs/use-sync-external-store-shim/with-selector.production.js');\n} else {\n module.exports = require('../cjs/use-sync-external-store-shim/with-selector.development.js');\n}\n"],"names":["__assign","Object","assign","t","s","i","n","arguments","length","p","prototype","hasOwnProperty","call","apply","this","__spreadArray","to","from","pack","ar","l","Array","slice","concat","SuppressedError","objectIs","is","x","y","useState","React","useEffect","useLayoutEffect","useDebugValue","checkIfSnapshotChanged","inst","latestGetSnapshot","getSnapshot","value","nextValue","error","shim","window","document","createElement","subscribe","_useState","forceUpdate","useSyncExternalStore","process","env","NODE_ENV","__REACT_DEVTOOLS_GLOBAL_HOOK__","registerInternalModuleStart","Error","require$$0","didWarnOld18Alpha","didWarnUncachedGetSnapshot","startTransition","console","cachedValue","exports","registerInternalModuleStop","module","require$$1","useRef","useMemo","getServerSnapshot","selector","isEqual","instRef","current","hasValue","memoizedSelector","nextSnapshot","hasMemo","memoizedSnapshot","currentSelection","memoizedSelection","nextSelection","maybeGetServerSnapshot","useSyncExternalStoreWithSelector","e","indexOf","getOwnPropertySymbols","propertyIsEnumerable"],"mappings":"ysBA+BO,IAAIA,EAAW,WAQpB,OAPAA,EAAWC,OAAOC,QAAU,SAAkBC,GAC1C,IAAK,IAAIC,EAAGC,EAAI,EAAGC,EAAIC,UAAUC,OAAQH,EAAIC,EAAGD,IAE5C,IAAK,IAAII,KADTL,EAAIG,UAAUF,GACOJ,OAAOS,UAAUC,eAAeC,KAAKR,EAAGK,KAAIN,EAAEM,GAAKL,EAAEK,IAE9E,OAAON,CACV,EACMH,EAASa,MAAMC,KAAMP,UAC9B,EA6KO,SAASQ,EAAcC,EAAIC,EAAMC,GACtC,GAAIA,GAA6B,IAArBX,UAAUC,OAAc,IAAK,IAA4BW,EAAxBd,EAAI,EAAGe,EAAIH,EAAKT,OAAYH,EAAIe,EAAGf,KACxEc,GAAQd,KAAKY,IACRE,IAAIA,EAAKE,MAAMX,UAAUY,MAAMV,KAAKK,EAAM,EAAGZ,IAClDc,EAAGd,GAAKY,EAAKZ,IAGrB,OAAOW,EAAGO,OAAOJ,GAAME,MAAMX,UAAUY,MAAMV,KAAKK,GACpD,kEA0GkD,mBAApBO,iBAAiCA,gBCxT/D,IAAIC,EA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GAC7B,YAAI,IAAWL,GAAWA,EAAQQ,EAAkBE,IAC1CH,EAAmBF,EAAeG,IAC5CD,EAAmBF,EACXI,EAAoBC,EAC7B,CACD,IACEH,EACAE,EAFEH,GAAU,EAGZK,OACE,IAAWb,EAAoB,KAAOA,EAC1C,MAAO,CACL,WACE,OAAOM,EAAiBpC,IACzB,EACD,OAAS2C,OACL,EACA,WACE,OAAOP,EAAiBO,IACzB,EAER,GACD,CAAC3C,EAAa8B,EAAmBC,EAAUC,IAE7C,IAAI/B,EAAQU,EAAqBH,EAAWyB,EAAQ,GAAIA,EAAQ,IAShE,OARAvC,GACE,WACEI,EAAKqC,UAAW,EAChBrC,EAAKG,MAAQA,CACd,GACD,CAACA,IAEHL,EAAcK,GACPA,CACb,EACI,oBAAuBc,gCACrB,mBACSA,+BAA+BU,4BACxCV,+BAA+BU,2BAA2BR,QAC7D,CApFD,iCCV2B,eAAzBL,QAAQC,IAAIC,SACdY,EAAAF,QAAiBN,EAEjBQ,EAAAF,QAAiBG,6YNqCZ,SAAgB5D,EAAG8E,GACxB,IAAI/E,EAAI,CAAA,EACR,IAAK,IAAIM,KAAKL,EAAOH,OAAOS,UAAUC,eAAeC,KAAKR,EAAGK,IAAMyE,EAAEC,QAAQ1E,GAAK,IAC9EN,EAAEM,GAAKL,EAAEK,IACb,GAAS,MAALL,GAAqD,mBAAjCH,OAAOmF,sBACtB,KAAI/E,EAAI,EAAb,IAAgBI,EAAIR,OAAOmF,sBAAsBhF,GAAIC,EAAII,EAAED,OAAQH,IAC3D6E,EAAEC,QAAQ1E,EAAEJ,IAAM,GAAKJ,OAAOS,UAAU2E,qBAAqBzE,KAAKR,EAAGK,EAAEJ,MACvEF,EAAEM,EAAEJ,IAAMD,EAAEK,EAAEJ,IAF4B,CAItD,OAAOF,CACT"}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../node_modules/tslib/tslib.es6.mjs","../../node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.js","../../node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js","../../node_modules/use-sync-external-store/shim/index.js","../../node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.js","../../node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.development.js","../../node_modules/use-sync-external-store/shim/with-selector.js"],"sourcesContent":["/******************************************************************************\nCopyright (c) Microsoft Corporation.\n\nPermission to use, copy, modify, and/or distribute this software for any\npurpose with or without fee is hereby granted.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\nPERFORMANCE OF THIS SOFTWARE.\n***************************************************************************** */\n/* global Reflect, Promise, SuppressedError, Symbol, Iterator */\n\nvar extendStatics = function(d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n};\n\nexport function __extends(d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n}\n\nexport var __assign = function() {\n __assign = Object.assign || function __assign(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\n }\n return t;\n }\n return __assign.apply(this, arguments);\n}\n\nexport function __rest(s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n}\n\nexport function __decorate(decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n}\n\nexport function __param(paramIndex, decorator) {\n return function (target, key) { decorator(target, key, paramIndex); }\n}\n\nexport function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {\n function accept(f) { if (f !== void 0 && typeof f !== \"function\") throw new TypeError(\"Function expected\"); return f; }\n var kind = contextIn.kind, key = kind === \"getter\" ? \"get\" : kind === \"setter\" ? \"set\" : \"value\";\n var target = !descriptorIn && ctor ? contextIn[\"static\"] ? ctor : ctor.prototype : null;\n var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});\n var _, done = false;\n for (var i = decorators.length - 1; i >= 0; i--) {\n var context = {};\n for (var p in contextIn) context[p] = p === \"access\" ? {} : contextIn[p];\n for (var p in contextIn.access) context.access[p] = contextIn.access[p];\n context.addInitializer = function (f) { if (done) throw new TypeError(\"Cannot add initializers after decoration has completed\"); extraInitializers.push(accept(f || null)); };\n var result = (0, decorators[i])(kind === \"accessor\" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);\n if (kind === \"accessor\") {\n if (result === void 0) continue;\n if (result === null || typeof result !== \"object\") throw new TypeError(\"Object expected\");\n if (_ = accept(result.get)) descriptor.get = _;\n if (_ = accept(result.set)) descriptor.set = _;\n if (_ = accept(result.init)) initializers.unshift(_);\n }\n else if (_ = accept(result)) {\n if (kind === \"field\") initializers.unshift(_);\n else descriptor[key] = _;\n }\n }\n if (target) Object.defineProperty(target, contextIn.name, descriptor);\n done = true;\n};\n\nexport function __runInitializers(thisArg, initializers, value) {\n var useValue = arguments.length > 2;\n for (var i = 0; i < initializers.length; i++) {\n value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);\n }\n return useValue ? value : void 0;\n};\n\nexport function __propKey(x) {\n return typeof x === \"symbol\" ? x : \"\".concat(x);\n};\n\nexport function __setFunctionName(f, name, prefix) {\n if (typeof name === \"symbol\") name = name.description ? \"[\".concat(name.description, \"]\") : \"\";\n return Object.defineProperty(f, \"name\", { configurable: true, value: prefix ? \"\".concat(prefix, \" \", name) : name });\n};\n\nexport function __metadata(metadataKey, metadataValue) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\n}\n\nexport function __awaiter(thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n}\n\nexport function __generator(thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === \"function\" ? Iterator : Object).prototype);\n return g.next = verb(0), g[\"throw\"] = verb(1), g[\"return\"] = verb(2), typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n}\n\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n});\n\nexport function __exportStar(m, o) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\n}\n\nexport function __values(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n}\n\nexport function __read(o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n}\n\n/** @deprecated */\nexport function __spread() {\n for (var ar = [], i = 0; i < arguments.length; i++)\n ar = ar.concat(__read(arguments[i]));\n return ar;\n}\n\n/** @deprecated */\nexport function __spreadArrays() {\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\n r[k] = a[j];\n return r;\n}\n\nexport function __spreadArray(to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n}\n\nexport function __await(v) {\n return this instanceof __await ? (this.v = v, this) : new __await(v);\n}\n\nexport function __asyncGenerator(thisArg, _arguments, generator) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\n return i = Object.create((typeof AsyncIterator === \"function\" ? AsyncIterator : Object).prototype), verb(\"next\"), verb(\"throw\"), verb(\"return\", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;\n function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }\n function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\n function fulfill(value) { resume(\"next\", value); }\n function reject(value) { resume(\"throw\", value); }\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\n}\n\nexport function __asyncDelegator(o) {\n var i, p;\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }\n}\n\nexport function __asyncValues(o) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var m = o[Symbol.asyncIterator], i;\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\n}\n\nexport function __makeTemplateObject(cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n};\n\nvar __setModuleDefault = Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n};\n\nvar ownKeys = function(o) {\n ownKeys = Object.getOwnPropertyNames || function (o) {\n var ar = [];\n for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;\n return ar;\n };\n return ownKeys(o);\n};\n\nexport function __importStar(mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== \"default\") __createBinding(result, mod, k[i]);\n __setModuleDefault(result, mod);\n return result;\n}\n\nexport function __importDefault(mod) {\n return (mod && mod.__esModule) ? mod : { default: mod };\n}\n\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\n}\n\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\n}\n\nexport function __classPrivateFieldIn(state, receiver) {\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\n}\n\nexport function __addDisposableResource(env, value, async) {\n if (value !== null && value !== void 0) {\n if (typeof value !== \"object\" && typeof value !== \"function\") throw new TypeError(\"Object expected.\");\n var dispose, inner;\n if (async) {\n if (!Symbol.asyncDispose) throw new TypeError(\"Symbol.asyncDispose is not defined.\");\n dispose = value[Symbol.asyncDispose];\n }\n if (dispose === void 0) {\n if (!Symbol.dispose) throw new TypeError(\"Symbol.dispose is not defined.\");\n dispose = value[Symbol.dispose];\n if (async) inner = dispose;\n }\n if (typeof dispose !== \"function\") throw new TypeError(\"Object not disposable.\");\n if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };\n env.stack.push({ value: value, dispose: dispose, async: async });\n }\n else if (async) {\n env.stack.push({ async: true });\n }\n return value;\n}\n\nvar _SuppressedError = typeof SuppressedError === \"function\" ? SuppressedError : function (error, suppressed, message) {\n var e = new Error(message);\n return e.name = \"SuppressedError\", e.error = error, e.suppressed = suppressed, e;\n};\n\nexport function __disposeResources(env) {\n function fail(e) {\n env.error = env.hasError ? new _SuppressedError(e, env.error, \"An error was suppressed during disposal.\") : e;\n env.hasError = true;\n }\n var r, s = 0;\n function next() {\n while (r = env.stack.pop()) {\n try {\n if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);\n if (r.dispose) {\n var result = r.dispose.call(r.value);\n if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });\n }\n else s |= 1;\n }\n catch (e) {\n fail(e);\n }\n }\n if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();\n if (env.hasError) throw env.error;\n }\n return next();\n}\n\nexport function __rewriteRelativeImportExtension(path, preserveJsx) {\n if (typeof path === \"string\" && /^\\.\\.?\\//.test(path)) {\n return path.replace(/\\.(tsx)$|((?:\\.d)?)((?:\\.[^./]+?)?)\\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) {\n return tsx ? preserveJsx ? \".jsx\" : \".js\" : d && (!ext || !cm) ? m : (d + ext + \".\" + cm.toLowerCase() + \"js\");\n });\n }\n return path;\n}\n\nexport default {\n __extends,\n __assign,\n __rest,\n __decorate,\n __param,\n __esDecorate,\n __runInitializers,\n __propKey,\n __setFunctionName,\n __metadata,\n __awaiter,\n __generator,\n __createBinding,\n __exportStar,\n __values,\n __read,\n __spread,\n __spreadArrays,\n __spreadArray,\n __await,\n __asyncGenerator,\n __asyncDelegator,\n __asyncValues,\n __makeTemplateObject,\n __importStar,\n __importDefault,\n __classPrivateFieldGet,\n __classPrivateFieldSet,\n __classPrivateFieldIn,\n __addDisposableResource,\n __disposeResources,\n __rewriteRelativeImportExtension,\n};\n","/**\n * @license React\n * use-sync-external-store-shim.production.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\"use strict\";\nvar React = require(\"react\");\nfunction is(x, y) {\n return (x === y && (0 !== x || 1 / x === 1 / y)) || (x !== x && y !== y);\n}\nvar objectIs = \"function\" === typeof Object.is ? Object.is : is,\n useState = React.useState,\n useEffect = React.useEffect,\n useLayoutEffect = React.useLayoutEffect,\n useDebugValue = React.useDebugValue;\nfunction useSyncExternalStore$2(subscribe, getSnapshot) {\n var value = getSnapshot(),\n _useState = useState({ inst: { value: value, getSnapshot: getSnapshot } }),\n inst = _useState[0].inst,\n forceUpdate = _useState[1];\n useLayoutEffect(\n function () {\n inst.value = value;\n inst.getSnapshot = getSnapshot;\n checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst });\n },\n [subscribe, value, getSnapshot]\n );\n useEffect(\n function () {\n checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst });\n return subscribe(function () {\n checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst });\n });\n },\n [subscribe]\n );\n useDebugValue(value);\n return value;\n}\nfunction checkIfSnapshotChanged(inst) {\n var latestGetSnapshot = inst.getSnapshot;\n inst = inst.value;\n try {\n var nextValue = latestGetSnapshot();\n return !objectIs(inst, nextValue);\n } catch (error) {\n return !0;\n }\n}\nfunction useSyncExternalStore$1(subscribe, getSnapshot) {\n return getSnapshot();\n}\nvar shim =\n \"undefined\" === typeof window ||\n \"undefined\" === typeof window.document ||\n \"undefined\" === typeof window.document.createElement\n ? useSyncExternalStore$1\n : useSyncExternalStore$2;\nexports.useSyncExternalStore =\n void 0 !== React.useSyncExternalStore ? React.useSyncExternalStore : shim;\n","/**\n * @license React\n * use-sync-external-store-shim.development.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\"use strict\";\n\"production\" !== process.env.NODE_ENV &&\n (function () {\n function is(x, y) {\n return (x === y && (0 !== x || 1 / x === 1 / y)) || (x !== x && y !== y);\n }\n function useSyncExternalStore$2(subscribe, getSnapshot) {\n didWarnOld18Alpha ||\n void 0 === React.startTransition ||\n ((didWarnOld18Alpha = !0),\n console.error(\n \"You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release.\"\n ));\n var value = getSnapshot();\n if (!didWarnUncachedGetSnapshot) {\n var cachedValue = getSnapshot();\n objectIs(value, cachedValue) ||\n (console.error(\n \"The result of getSnapshot should be cached to avoid an infinite loop\"\n ),\n (didWarnUncachedGetSnapshot = !0));\n }\n cachedValue = useState({\n inst: { value: value, getSnapshot: getSnapshot }\n });\n var inst = cachedValue[0].inst,\n forceUpdate = cachedValue[1];\n useLayoutEffect(\n function () {\n inst.value = value;\n inst.getSnapshot = getSnapshot;\n checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst });\n },\n [subscribe, value, getSnapshot]\n );\n useEffect(\n function () {\n checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst });\n return subscribe(function () {\n checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst });\n });\n },\n [subscribe]\n );\n useDebugValue(value);\n return value;\n }\n function checkIfSnapshotChanged(inst) {\n var latestGetSnapshot = inst.getSnapshot;\n inst = inst.value;\n try {\n var nextValue = latestGetSnapshot();\n return !objectIs(inst, nextValue);\n } catch (error) {\n return !0;\n }\n }\n function useSyncExternalStore$1(subscribe, getSnapshot) {\n return getSnapshot();\n }\n \"undefined\" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&\n \"function\" ===\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart &&\n __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());\n var React = require(\"react\"),\n objectIs = \"function\" === typeof Object.is ? Object.is : is,\n useState = React.useState,\n useEffect = React.useEffect,\n useLayoutEffect = React.useLayoutEffect,\n useDebugValue = React.useDebugValue,\n didWarnOld18Alpha = !1,\n didWarnUncachedGetSnapshot = !1,\n shim =\n \"undefined\" === typeof window ||\n \"undefined\" === typeof window.document ||\n \"undefined\" === typeof window.document.createElement\n ? useSyncExternalStore$1\n : useSyncExternalStore$2;\n exports.useSyncExternalStore =\n void 0 !== React.useSyncExternalStore ? React.useSyncExternalStore : shim;\n \"undefined\" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&\n \"function\" ===\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&\n __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());\n })();\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('../cjs/use-sync-external-store-shim.production.js');\n} else {\n module.exports = require('../cjs/use-sync-external-store-shim.development.js');\n}\n","/**\n * @license React\n * use-sync-external-store-shim/with-selector.production.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\"use strict\";\nvar React = require(\"react\"),\n shim = require(\"use-sync-external-store/shim\");\nfunction is(x, y) {\n return (x === y && (0 !== x || 1 / x === 1 / y)) || (x !== x && y !== y);\n}\nvar objectIs = \"function\" === typeof Object.is ? Object.is : is,\n useSyncExternalStore = shim.useSyncExternalStore,\n useRef = React.useRef,\n useEffect = React.useEffect,\n useMemo = React.useMemo,\n useDebugValue = React.useDebugValue;\nexports.useSyncExternalStoreWithSelector = function (\n subscribe,\n getSnapshot,\n getServerSnapshot,\n selector,\n isEqual\n) {\n var instRef = useRef(null);\n if (null === instRef.current) {\n var inst = { hasValue: !1, value: null };\n instRef.current = inst;\n } else inst = instRef.current;\n instRef = useMemo(\n function () {\n function memoizedSelector(nextSnapshot) {\n if (!hasMemo) {\n hasMemo = !0;\n memoizedSnapshot = nextSnapshot;\n nextSnapshot = selector(nextSnapshot);\n if (void 0 !== isEqual && inst.hasValue) {\n var currentSelection = inst.value;\n if (isEqual(currentSelection, nextSnapshot))\n return (memoizedSelection = currentSelection);\n }\n return (memoizedSelection = nextSnapshot);\n }\n currentSelection = memoizedSelection;\n if (objectIs(memoizedSnapshot, nextSnapshot)) return currentSelection;\n var nextSelection = selector(nextSnapshot);\n if (void 0 !== isEqual && isEqual(currentSelection, nextSelection))\n return (memoizedSnapshot = nextSnapshot), currentSelection;\n memoizedSnapshot = nextSnapshot;\n return (memoizedSelection = nextSelection);\n }\n var hasMemo = !1,\n memoizedSnapshot,\n memoizedSelection,\n maybeGetServerSnapshot =\n void 0 === getServerSnapshot ? null : getServerSnapshot;\n return [\n function () {\n return memoizedSelector(getSnapshot());\n },\n null === maybeGetServerSnapshot\n ? void 0\n : function () {\n return memoizedSelector(maybeGetServerSnapshot());\n }\n ];\n },\n [getSnapshot, getServerSnapshot, selector, isEqual]\n );\n var value = useSyncExternalStore(subscribe, instRef[0], instRef[1]);\n useEffect(\n function () {\n inst.hasValue = !0;\n inst.value = value;\n },\n [value]\n );\n useDebugValue(value);\n return value;\n};\n","/**\n * @license React\n * use-sync-external-store-shim/with-selector.development.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\"use strict\";\n\"production\" !== process.env.NODE_ENV &&\n (function () {\n function is(x, y) {\n return (x === y && (0 !== x || 1 / x === 1 / y)) || (x !== x && y !== y);\n }\n \"undefined\" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&\n \"function\" ===\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart &&\n __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());\n var React = require(\"react\"),\n shim = require(\"use-sync-external-store/shim\"),\n objectIs = \"function\" === typeof Object.is ? Object.is : is,\n useSyncExternalStore = shim.useSyncExternalStore,\n useRef = React.useRef,\n useEffect = React.useEffect,\n useMemo = React.useMemo,\n useDebugValue = React.useDebugValue;\n exports.useSyncExternalStoreWithSelector = function (\n subscribe,\n getSnapshot,\n getServerSnapshot,\n selector,\n isEqual\n ) {\n var instRef = useRef(null);\n if (null === instRef.current) {\n var inst = { hasValue: !1, value: null };\n instRef.current = inst;\n } else inst = instRef.current;\n instRef = useMemo(\n function () {\n function memoizedSelector(nextSnapshot) {\n if (!hasMemo) {\n hasMemo = !0;\n memoizedSnapshot = nextSnapshot;\n nextSnapshot = selector(nextSnapshot);\n if (void 0 !== isEqual && inst.hasValue) {\n var currentSelection = inst.value;\n if (isEqual(currentSelection, nextSnapshot))\n return (memoizedSelection = currentSelection);\n }\n return (memoizedSelection = nextSnapshot);\n }\n currentSelection = memoizedSelection;\n if (objectIs(memoizedSnapshot, nextSnapshot))\n return currentSelection;\n var nextSelection = selector(nextSnapshot);\n if (void 0 !== isEqual && isEqual(currentSelection, nextSelection))\n return (memoizedSnapshot = nextSnapshot), currentSelection;\n memoizedSnapshot = nextSnapshot;\n return (memoizedSelection = nextSelection);\n }\n var hasMemo = !1,\n memoizedSnapshot,\n memoizedSelection,\n maybeGetServerSnapshot =\n void 0 === getServerSnapshot ? null : getServerSnapshot;\n return [\n function () {\n return memoizedSelector(getSnapshot());\n },\n null === maybeGetServerSnapshot\n ? void 0\n : function () {\n return memoizedSelector(maybeGetServerSnapshot());\n }\n ];\n },\n [getSnapshot, getServerSnapshot, selector, isEqual]\n );\n var value = useSyncExternalStore(subscribe, instRef[0], instRef[1]);\n useEffect(\n function () {\n inst.hasValue = !0;\n inst.value = value;\n },\n [value]\n );\n useDebugValue(value);\n return value;\n };\n \"undefined\" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&\n \"function\" ===\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&\n __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());\n })();\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('../cjs/use-sync-external-store-shim/with-selector.production.js');\n} else {\n module.exports = require('../cjs/use-sync-external-store-shim/with-selector.development.js');\n}\n"],"names":["__assign","Object","assign","t","s","i","n","arguments","length","p","prototype","hasOwnProperty","call","apply","this","__spreadArray","to","from","pack","ar","l","Array","slice","concat","SuppressedError","objectIs","is","x","y","useState","React","useEffect","useLayoutEffect","useDebugValue","checkIfSnapshotChanged","inst","latestGetSnapshot","getSnapshot","value","nextValue","error","shim","window","document","createElement","subscribe","_useState","forceUpdate","useSyncExternalStore","process","env","NODE_ENV","__REACT_DEVTOOLS_GLOBAL_HOOK__","registerInternalModuleStart","Error","require$$0","didWarnOld18Alpha","didWarnUncachedGetSnapshot","startTransition","console","cachedValue","exports","registerInternalModuleStop","module","require$$1","useRef","useMemo","getServerSnapshot","selector","isEqual","instRef","current","hasValue","memoizedSelector","nextSnapshot","hasMemo","memoizedSnapshot","currentSelection","memoizedSelection","nextSelection","maybeGetServerSnapshot","useSyncExternalStoreWithSelector","e","indexOf","getOwnPropertySymbols","propertyIsEnumerable"],"mappings":"ysBA+BO,IAAIA,EAAW,WAQpB,OAPAA,EAAWC,OAAOC,QAAU,SAAkBC,GAC1C,IAAK,IAAIC,EAAGC,EAAI,EAAGC,EAAIC,UAAUC,OAAQH,EAAIC,EAAGD,IAE5C,IAAK,IAAII,KADTL,EAAIG,UAAUF,GACOJ,OAAOS,UAAUC,eAAeC,KAAKR,EAAGK,KAAIN,EAAEM,GAAKL,EAAEK,IAE9E,OAAON,CACV,EACMH,EAASa,MAAMC,KAAMP,UAC9B,EA6KO,SAASQ,EAAcC,EAAIC,EAAMC,GACtC,GAAIA,GAA6B,IAArBX,UAAUC,OAAc,IAAK,IAA4BW,EAAxBd,EAAI,EAAGe,EAAIH,EAAKT,OAAYH,EAAIe,EAAGf,KACxEc,GAAQd,KAAKY,IACRE,IAAIA,EAAKE,MAAMX,UAAUY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EM,EAAEJ,IAAMD,EAAEK,EAAEJ,IAF4B,CAItD,OAAOF,CACT"}
|
package/es/v5.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{createStore as e}from"./index";import{useReducer as n,useRef as r,useLayoutEffect as t,useEffect as o}from"react";var i,s=function(){return s=Object.assign||function(e){for(var n,r=1,t=arguments.length;r<t;r++)for(var o in n=arguments[r])Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e},s.apply(this,arguments)};"function"==typeof SuppressedError&&SuppressedError,function(e){e.REJECT="reject",e.IGNORE="ignore",e.KEEP_LAST="keepLast",e.KEEP_ALL="keepAll",e.PARALLEL="parallel",e.REUSE="reuse",e.ABORT="abort"}(i||(i={}));var u=function e(n,r){if(n===r)return!0;if(n&&r&&"object"==typeof n&&"object"==typeof r){if(n.constructor!==r.constructor)return!1;var t,o,i;if(Array.isArray(n)){if((t=n.length)!=r.length)return!1;for(o=t;0!=o--;)if(!e(n[o],r[o]))return!1;return!0}if(n.constructor===RegExp)return n.source===r.source&&n.flags===r.flags;if(n.valueOf!==Object.prototype.valueOf)return n.valueOf()===r.valueOf();if(n.toString!==Object.prototype.toString)return n.toString()===r.toString();if((t=(i=Object.keys(n)).length)!==Object.keys(r).length)return!1;for(o=t;0!=o--;)if(!Object.prototype.hasOwnProperty.call(r,i[o]))return!1;for(o=t;0!=o--;){var s=i[o];if(!e(n[s],r[s]))return!1}return!0}return n!=n&&r!=r},c=null;function a(e){return!(e instanceof Function)&&e.hasOwnProperty("promiseGet")}function f(e){return!(e instanceof Function)&&(e.hasOwnProperty("promise")||e.hasOwnProperty("promiseGet"))}function l(e){return!(e instanceof Function||e.hasOwnProperty("promise")&&e.hasOwnProperty("promiseGet"))}function p(e){return e instanceof Function}function g(e){return!(e instanceof Function||e.hasOwnProperty("promise")||e.hasOwnProperty("promiseGet"))}function d(e){return Object.keys(e).reduce((function(n,r){var t=e[r];if(p(t))n[r]=function(e){return t(e.s,e.args,e.p)};else if(g(t)){var o={effects:function(e){return t.action(e.s,e.args,e.p)}};t.onActionDone&&(o.sideEffects=function(e){var n=e.s,r=e.p,o=e.args,i=e.a,s=e.notifyWarning;t.onActionDone(n,o,r,i,s)}),n[r]=o}else if(function(e){return!(e instanceof Function)&&e.hasOwnProperty("promise")}(t)||a(t)){var s;s=a(t)?{getPromise:function(e){var n=e.s,r=e.p,o=e.a,i=e.args,s=e.abortSignal;return t.promiseGet(i,n,r,o,s)},retryCount:3,conflictPolicy:i.REUSE}:{getPromise:function(e){var n=e.s,r=e.p,o=e.a,i=e.args,s=e.abortSignal;return t.promise(i,n,r,o,s)}},["abortable","conflictPolicy","getPromiseId","isTriggerRetryError","rejectPromiseOnError","retryCount","debounceTimeout","debounceSideEffectsTimeout","retryDelaySeed"].forEach((function(e){null!=t[e]&&(s[e]=t[e])})),t.successMessage&&(s.getSuccessMessage=function(){return t.successMessage}),t.errorMessage&&(s.getSuccessMessage=function(){return t.errorMessage}),t.getSuccessMessage&&(s.getSuccessMessage=function(e){var n=e.res,r=e.args,o=e.p;return t.getSuccessMessage(n,r,o)}),t.getErrorMessage&&(s.getErrorMessage=function(e){var n=e.err,r=e.args,o=e.p;return t.getErrorMessage(n,r,o)}),t.preReducer&&(s.preEffects=function(e){var n=e.s,r=e.p,o=e.args;return t.preReducer(n,o,r)}),t.optimisticReducer&&(s.optimisticEffects=function(e){var n=e.s,r=e.p,o=e.args;return t.optimisticReducer(n,o,r)}),t.reducer&&(s.effects=function(e){var n=e.s,r=e.res,o=e.p,i=e.args;return t.reducer(n,r,i,o)}),t.errorReducer&&(s.errorEffects=function(e){var n=e.s,r=e.err,o=e.p,i=e.args;return t.errorReducer(n,r,i,o)}),t.onDone&&(s.sideEffects=function(e){var n=e.s,r=e.res,o=e.p,i=e.args,s=e.a,u=e.notifyWarning;return t.onDone(n,r,i,o,s,u)}),t.onFail&&(s.errorSideEffects=function(e){var n=e.s,r=e.err,o=e.p,i=e.args,s=e.a,u=e.notifyWarning;return t.onFail(n,r,i,o,s,u)}),n[r]=s}return n}),{})}function v(o,i,u,a,f){void 0===a&&(a={});var l,p,g,v,y=n((function(e){return e>100?0:e+1}),0)[1],E=r(),h=r();null==E.current&&(E.current=d(i)),null==h.current&&(h.current=(l=a,p={},g=Object.keys(l),v=["onPropsChange","onPropsChangeReducer","getPropsRefValues","onMount","initialActionsMarkedLoading"],g.forEach((function(e){v.includes(e)||(p[e]=l[e])})),l.onMount&&(p.onMount=function(e){var n=e.s,r=e.p,t=e.a;return l.onMount(t,r,n)}),l.getPropsRefValues&&(p.onPropsChange={getDeps:l.getPropsRefValues,effects:function(e){var n=e.s,r=e.p,t=e.indices;return l.onPropsChangeReducer?l.onPropsChangeReducer(n,r,t):null},sideEffects:function(e){var n=e.s,r=e.p,t=e.a,o=e.indices;return null==l.onPropsChange?null:l.onPropsChange(n,r,t,o)}}),l.initialActionsMarkedLoading&&(p.initialActionsMarkedLoading=l.initialActionsMarkedLoading),p));var m=r();if(null==m.current){var O=f;a.logEnabled&&O.push(c()),m.current=e(s(s({getInitialState:o,actions:E.current},h.current),{middlewares:O}))}m.current.setProps(u),t((function(){return m.current.addStateListener((function(){y()}))}),[]);var P=m.current;return{state:P.state,actions:P.actions,loading:P.loading,loadingMap:P.loadingMap,loadingParallelMap:P.loadingParallelMap,abortAction:P.abortAction}}function y(e){o((function(){var n=e();return"function"==typeof n?n:void 0}),[e])}function E(e,n){void 0===n&&(n=[]),o((function(){return e}),[n,e])}function h(e){o((function(){return document.addEventListener("beforeunload",e),function(){document.removeEventListener("beforeunload",e)}}),[e])}"development"!==process.env.NODE_ENV&&"test"!==process.env.NODE_ENV||(c=function(e){return void 0===e&&(e=console),function(){var n="",r=e,t=function(e,n){var r;if(n!==e){var t=null!=e?typeof e:typeof n;if("number"===t||"string"===t||"boolean"===t)r="".concat(e," => ").concat(""===n?'""':n);else if(e&&e.length||n&&n.length)if(null==e)r="was ".concat(e,", now contains ").concat(n.length," element(s)");else if(null==n)r="contained ".concat(e.length," element(s), now is ").concat(n);else if(0===e.length)r="was empty, now contains ".concat(n.length," elements");else if(0===n.length)r="contained ".concat(e.length," elements, now is empty");else{var o=n.filter((function(n){return!e.find((function(e){return u(n,e)}))})),i=e.filter((function(e){return!n.find((function(n){return u(e,n)}))}));o.length>10&&(o="".concat(o.length," element(s) added")),i.length>10&&(i="".concat(i.length," element(s) removed")),r={added:o,removed:i}}else r=n}return r},o=function(e){return"string"==typeof e?'"'.concat(e,'"'):e};return{init:function(t){var i,s;n=(null===(i=t.options)||void 0===i?void 0:i.name)?"[".concat(null===(s=t.options)||void 0===s?void 0:s.name,"]"):"";var u=t.state;e.group(n,"initialState"),Object.keys(u).forEach((function(e){r.log(e,":",o(u[e]))})),e.groupEnd()},destroy:null,effects:function(e,i,s,u){var c,a=null===(c=e.context)||void 0===c?void 0:c.args,f=[n,e.name.toString()];if(e.isAsync&&("preEffects"===e.type?f.push(u?"START":"CANCELLED"):"effects"===e.type?f.push("DONE"):f.push("FAILED")),null!=s||a&&0!==Object.keys(a).length?r.group.apply(r,f):r.log.apply(r,f),a&&Object.keys(a).length>0&&(r.group("Arguments"),a.forEach((function(e){r.log(e,":",o(e))})),r.groupEnd()),null!=s){if(r.groupCollapsed("Before"),null==i)r.log("was null");else Object.keys(i).forEach((function(e){r.log(e,":",o(i[e]))}));if(r.groupEnd(),r.groupCollapsed("After"),null==s)r.log("was null");else Object.keys(s).forEach((function(e){r.log(e,":",o(s[e]))}));if(r.groupEnd(),null!=s){r.group("Diff");var l=function(e,n){var r={};return e&&Object.keys(e).forEach((function(o){if(n.hasOwnProperty(o)){var i=e[o],s=n[o],u=t(i,s);u&&(r[o]=u)}else r[o]="was deleted"})),Object.keys(n).forEach((function(o){if(null==e||!e.hasOwnProperty(o)){var i=n[o];r[o]=t(void 0,i)}})),r}(i,s);Object.keys(l).forEach((function(e){return r.log(e,":",l[e])})),r.groupEnd()}}return r.groupEnd(),null}}}});export{v as default,g as isAdvancedSyncAction,f as isAsyncAction,l as isAsyncPromiseGetAction,p as isSyncAction,y as useOnMount,h as useOnUnload,E as useOnUnmount};
|
|
1
|
+
import{createStore as e}from"./index";import{useReducer as n,useRef as r,useLayoutEffect as t,useEffect as o}from"react";var i,s=function(){return s=Object.assign||function(e){for(var n,r=1,t=arguments.length;r<t;r++)for(var o in n=arguments[r])Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e},s.apply(this,arguments)};"function"==typeof SuppressedError&&SuppressedError,function(e){e.REJECT="reject",e.IGNORE="ignore",e.KEEP_LAST="keepLast",e.KEEP_ALL="keepAll",e.PARALLEL="parallel",e.REUSE="reuse",e.ABORT="abort"}(i||(i={}));var u=function e(n,r){if(n===r)return!0;if(n&&r&&"object"==typeof n&&"object"==typeof r){if(n.constructor!==r.constructor)return!1;var t,o,i;if(Array.isArray(n)){if((t=n.length)!=r.length)return!1;for(o=t;0!=o--;)if(!e(n[o],r[o]))return!1;return!0}if(n.constructor===RegExp)return n.source===r.source&&n.flags===r.flags;if(n.valueOf!==Object.prototype.valueOf)return n.valueOf()===r.valueOf();if(n.toString!==Object.prototype.toString)return n.toString()===r.toString();if((t=(i=Object.keys(n)).length)!==Object.keys(r).length)return!1;for(o=t;0!=o--;)if(!Object.prototype.hasOwnProperty.call(r,i[o]))return!1;for(o=t;0!=o--;){var s=i[o];if(!e(n[s],r[s]))return!1}return!0}return n!=n&&r!=r},c=null;function a(e){return!(e instanceof Function)&&e.hasOwnProperty("promiseGet")}function f(e){return!(e instanceof Function)&&(e.hasOwnProperty("promise")||e.hasOwnProperty("promiseGet"))}function l(e){return!(e instanceof Function||e.hasOwnProperty("promise")&&e.hasOwnProperty("promiseGet"))}function p(e){return e instanceof Function}function g(e){return!(e instanceof Function||e.hasOwnProperty("promise")||e.hasOwnProperty("promiseGet"))}function d(e){return Object.keys(e).reduce((function(n,r){var t=e[r];if(p(t))n[r]=function(e){return t(e.s,e.args,e.p)};else if(g(t)){var o={effects:function(e){return t.action(e.s,e.args,e.p)}};t.onActionDone&&(o.sideEffects=function(e){var n=e.s,r=e.p,o=e.args,i=e.a,s=e.notifyWarning;t.onActionDone(n,o,r,i,s)}),n[r]=o}else if(function(e){return!(e instanceof Function)&&e.hasOwnProperty("promise")}(t)||a(t)){var s;s=a(t)?{getPromise:function(e){var n=e.s,r=e.p,o=e.a,i=e.args,s=e.abortSignal;return t.promiseGet(i,n,r,o,s)},retryCount:3,conflictPolicy:i.REUSE}:{getPromise:function(e){var n=e.s,r=e.p,o=e.a,i=e.args,s=e.abortSignal;return t.promise(i,n,r,o,s)}},["abortable","conflictPolicy","getPromiseId","isTriggerRetryError","rejectPromiseOnError","retryCount","debounceTimeout","debounceSideEffectsTimeout","retryDelaySeed"].forEach((function(e){null!=t[e]&&(s[e]=t[e])})),t.successMessage&&(s.getSuccessMessage=function(){return t.successMessage}),t.errorMessage&&(s.getSuccessMessage=function(){return t.errorMessage}),t.getSuccessMessage&&(s.getSuccessMessage=function(e){var n=e.res,r=e.args,o=e.p;return t.getSuccessMessage(n,r,o)}),t.getErrorMessage&&(s.getErrorMessage=function(e){var n=e.err,r=e.args,o=e.p;return t.getErrorMessage(n,r,o)}),t.preReducer&&(s.preEffects=function(e){var n=e.s,r=e.p,o=e.args;return t.preReducer(n,o,r)}),t.optimisticReducer&&(s.optimisticEffects=function(e){var n=e.s,r=e.p,o=e.args;return t.optimisticReducer(n,o,r)}),t.reducer&&(s.effects=function(e){var n=e.s,r=e.res,o=e.p,i=e.args;return t.reducer(n,r,i,o)}),t.errorReducer&&(s.errorEffects=function(e){var n=e.s,r=e.err,o=e.p,i=e.args;return t.errorReducer(n,r,i,o)}),t.onDone&&(s.sideEffects=function(e){var n=e.s,r=e.res,o=e.p,i=e.args,s=e.a,u=e.notifyWarning;return t.onDone(n,r,i,o,s,u)}),t.onFail&&(s.errorSideEffects=function(e){var n=e.s,r=e.err,o=e.p,i=e.args,s=e.a,u=e.notifyWarning;return t.onFail(n,r,i,o,s,u)}),n[r]=s}return n}),{})}function v(o,i,u,a,f){void 0===a&&(a={});var l,p,g,v,y=n((function(e){return e>100?0:e+1}),0)[1],E=r(),h=r();null==E.current&&(E.current=d(i)),null==h.current&&(h.current=(l=a,p={},g=Object.keys(l),v=["onPropsChange","onPropsChangeReducer","getPropsRefValues","onMount","initialActionsMarkedLoading"],g.forEach((function(e){v.includes(e)||(p[e]=l[e])})),l.onMount&&(p.onMount=function(e){var n=e.s,r=e.p,t=e.a;return l.onMount(t,r,n)}),l.getPropsRefValues&&(p.onPropsChange={getDeps:l.getPropsRefValues,effects:function(e){var n=e.s,r=e.p,t=e.indices;return l.onPropsChangeReducer?l.onPropsChangeReducer(n,r,t):null},sideEffects:function(e){var n=e.s,r=e.p,t=e.a,o=e.indices;return null==l.onPropsChange?null:l.onPropsChange(n,r,t,o)}}),l.initialActionsMarkedLoading&&(p.initialActionsMarkedLoading=l.initialActionsMarkedLoading),p));var m=r();if(null==m.current){var O=f;a.logEnabled&&O.push(c()),m.current=e(s(s({getInitialState:o,actions:E.current},h.current),{middlewares:O}))}m.current.setProps(u),t((function(){return m.current.addStateListener((function(){y()}))}),[]),t((function(){m.current.init(u),m.current.runMountEffects()}),[]);var P=m.current;return{state:P.state,actions:P.actions,loading:P.loading,loadingMap:P.loadingMap,loadingParallelMap:P.loadingParallelMap,abortAction:P.abortAction}}function y(e){o((function(){var n=e();return"function"==typeof n?n:void 0}),[e])}function E(e,n){void 0===n&&(n=[]),o((function(){return e}),[n,e])}function h(e){o((function(){return document.addEventListener("beforeunload",e),function(){document.removeEventListener("beforeunload",e)}}),[e])}"development"!==process.env.NODE_ENV&&"test"!==process.env.NODE_ENV||(c=function(e){return void 0===e&&(e=console),function(){var n="",r=e,t=function(e,n){var r;if(n!==e){var t=null!=e?typeof e:typeof n;if("number"===t||"string"===t||"boolean"===t)r="".concat(e," => ").concat(""===n?'""':n);else if(e&&e.length||n&&n.length)if(null==e)r="was ".concat(e,", now contains ").concat(n.length," element(s)");else if(null==n)r="contained ".concat(e.length," element(s), now is ").concat(n);else if(0===e.length)r="was empty, now contains ".concat(n.length," elements");else if(0===n.length)r="contained ".concat(e.length," elements, now is empty");else{var o=n.filter((function(n){return!e.find((function(e){return u(n,e)}))})),i=e.filter((function(e){return!n.find((function(n){return u(e,n)}))}));o.length>10&&(o="".concat(o.length," element(s) added")),i.length>10&&(i="".concat(i.length," element(s) removed")),r={added:o,removed:i}}else r=n}return r},o=function(e){return"string"==typeof e?'"'.concat(e,'"'):e};return{init:function(t){var i,s;n=(null===(i=t.options)||void 0===i?void 0:i.name)?"[".concat(null===(s=t.options)||void 0===s?void 0:s.name,"]"):"";var u=t.state;e.group(n,"initialState"),Object.keys(u).forEach((function(e){r.log(e,":",o(u[e]))})),e.groupEnd()},destroy:null,effects:function(e,i,s,u){var c,a=null===(c=e.context)||void 0===c?void 0:c.args,f=[n,e.name.toString()];if(e.isAsync&&("preEffects"===e.type?f.push(u?"START":"CANCELLED"):"effects"===e.type?f.push("DONE"):f.push("FAILED")),null!=s||a&&0!==Object.keys(a).length?r.group.apply(r,f):r.log.apply(r,f),a&&Object.keys(a).length>0&&(r.group("Arguments"),a.forEach((function(e){r.log(e,":",o(e))})),r.groupEnd()),null!=s){if(r.groupCollapsed("Before"),null==i)r.log("was null");else Object.keys(i).forEach((function(e){r.log(e,":",o(i[e]))}));if(r.groupEnd(),r.groupCollapsed("After"),null==s)r.log("was null");else Object.keys(s).forEach((function(e){r.log(e,":",o(s[e]))}));if(r.groupEnd(),null!=s){r.group("Diff");var l=function(e,n){var r={};return e&&Object.keys(e).forEach((function(o){if(n.hasOwnProperty(o)){var i=e[o],s=n[o],u=t(i,s);u&&(r[o]=u)}else r[o]="was deleted"})),Object.keys(n).forEach((function(o){if(null==e||!e.hasOwnProperty(o)){var i=n[o];r[o]=t(void 0,i)}})),r}(i,s);Object.keys(l).forEach((function(e){return r.log(e,":",l[e])})),r.groupEnd()}}return r.groupEnd(),null}}}});export{v as default,g as isAdvancedSyncAction,f as isAsyncAction,l as isAsyncPromiseGetAction,p as isSyncAction,y as useOnMount,h as useOnUnload,E as useOnUnmount};
|
|
2
2
|
//# sourceMappingURL=v5.js.map
|
package/index.d.ts
CHANGED
|
@@ -39,6 +39,11 @@ export type StoreApi<S, A extends DecoratedActions, P, DS = {}> = {
|
|
|
39
39
|
* Initializes the store with the specified props
|
|
40
40
|
*/
|
|
41
41
|
readonly init: (p: P) => void;
|
|
42
|
+
/**
|
|
43
|
+
* Runs onMount (and onPropsChange entries flagged onMount) exactly once for this store instance.
|
|
44
|
+
* Must be called from an effect (useLayoutEffect/useEffect), never from a render body.
|
|
45
|
+
*/
|
|
46
|
+
readonly runMountEffects: () => void;
|
|
42
47
|
/**
|
|
43
48
|
* Update the store with the specified props
|
|
44
49
|
*/
|
package/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("./impl"),r=require("./development");function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var u=n(e),o=function(){return o=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var u in t=arguments[r])Object.prototype.hasOwnProperty.call(t,u)&&(e[u]=t[u]);return e},o.apply(this,arguments)};function c(e,t,r){if(r||2===arguments.length)for(var n,u=0,o=t.length;u<o;u++)!n&&u in t||(n||(n=Array.prototype.slice.call(t,0,u)),n[u]=t[u]);return e.concat(n||Array.prototype.slice.call(t))}function i(e){var t={exports:{}};return e(t,t.exports),t.exports}"function"==typeof SuppressedError&&SuppressedError;var a="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},l=u.default.useState,f=u.default.useEffect,s=u.default.useLayoutEffect,d=u.default.useDebugValue;function v(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!a(e,r)}catch(e){return!0}}var p="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(e,t){var r=t(),n=l({inst:{value:r,getSnapshot:t}}),u=n[0].inst,o=n[1];return s((function(){u.value=r,u.getSnapshot=t,v(u)&&o({inst:u})}),[e,r,t]),f((function(){return v(u)&&o({inst:u}),e((function(){v(u)&&o({inst:u})}))}),[e]),d(r),r},O={useSyncExternalStore:void 0!==u.default.useSyncExternalStore?u.default.useSyncExternalStore:p},S=i((function(e,t){"production"!==process.env.NODE_ENV&&function(){function e(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!n(e,r)}catch(e){return!0}}"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var r=u.default,n="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},o=r.useState,c=r.useEffect,i=r.useLayoutEffect,a=r.useDebugValue,l=!1,f=!1,s="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(t,u){l||void 0===r.startTransition||(l=!0,console.error("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var s=u();if(!f){var d=u();n(s,d)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),f=!0)}var v=(d=o({inst:{value:s,getSnapshot:u}}))[0].inst,p=d[1];return i((function(){v.value=s,v.getSnapshot=u,e(v)&&p({inst:v})}),[t,s,u]),c((function(){return e(v)&&p({inst:v}),t((function(){e(v)&&p({inst:v})}))}),[t]),a(s),s};t.useSyncExternalStore=void 0!==r.useSyncExternalStore?r.useSyncExternalStore:s,"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()})),E=O,_=S,y=i((function(e){"production"===process.env.NODE_ENV?e.exports=E:e.exports=_})),g=y;var L,b="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},A=y.useSyncExternalStore,h=u.default.useRef,R=u.default.useEffect,x=u.default.useMemo,D=u.default.useDebugValue,M={useSyncExternalStoreWithSelector:function(e,t,r,n,u){var o=h(null);if(null===o.current){var c={hasValue:!1,value:null};o.current=c}else c=o.current;o=x((function(){function e(e){if(!a){if(a=!0,o=e,e=n(e),void 0!==u&&c.hasValue){var t=c.value;if(u(t,e))return i=t}return i=e}if(t=i,b(o,e))return t;var r=n(e);return void 0!==u&&u(t,r)?(o=e,t):(o=e,i=r)}var o,i,a=!1,l=void 0===r?null:r;return[function(){return e(t())},null===l?void 0:function(){return e(l())}]}),[t,r,n,u]);var i=A(e,o[0],o[1]);return R((function(){c.hasValue=!0,c.value=i}),[i]),D(i),i}},m=i((function(e,t){"production"!==process.env.NODE_ENV&&function(){"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var e=u.default,r=y,n="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},o=r.useSyncExternalStore,c=e.useRef,i=e.useEffect,a=e.useMemo,l=e.useDebugValue;t.useSyncExternalStoreWithSelector=function(e,t,r,u,f){var s=c(null);if(null===s.current){var d={hasValue:!1,value:null};s.current=d}else d=s.current;s=a((function(){function e(e){if(!i){if(i=!0,o=e,e=u(e),void 0!==f&&d.hasValue){var t=d.value;if(f(t,e))return c=t}return c=e}if(t=c,n(o,e))return t;var r=u(e);return void 0!==f&&f(t,r)?(o=e,t):(o=e,c=r)}var o,c,i=!1,a=void 0===r?null:r;return[function(){return e(t())},null===a?void 0:function(){return e(a())}]}),[t,r,u,f]);var v=o(e,s[0],s[1]);return i((function(){d.hasValue=!0,d.value=v}),[v]),l(v),v},"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()})),T=M,j=m,P=i((function(e){"production"===process.env.NODE_ENV?e.exports=T:e.exports=j}));exports.ConflictPolicy=void 0,(L=exports.ConflictPolicy||(exports.ConflictPolicy={})).REJECT="reject",L.IGNORE="ignore",L.KEEP_LAST="keepLast",L.KEEP_ALL="keepAll",L.PARALLEL="parallel",L.REUSE="reuse",L.ABORT="abort";var C=P.useSyncExternalStoreWithSelector,V=g.useSyncExternalStore;function w(e){var n=t.createRef(),u=t.createRef(),i=t.createRef(),a=t.createRef(),l=t.createRef(),f=t.createRef(),s=t.createRef(),d=t.createRef(),v=t.createRef(),p=t.createRef(),O=t.createRef(),S=t.createRef(!1),E=t.createRef(!1),_=t.createRef(),y=t.createRef([]),g=e.actions,L=e.middlewares,b=void 0===L?[]:L,A=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var u=0;for(n=Object.getOwnPropertySymbols(e);u<n.length;u++)t.indexOf(n[u])<0&&Object.prototype.propertyIsEnumerable.call(e,n[u])&&(r[n[u]]=e[n[u]])}return r}(e,["actions","middlewares"]),h=t.isFuncConfig(e)?e.getInitialState:function(){return e.initialState},R={},x=0;function D(){_.current=o(o(o(o(o({},i.current),a.current),n.current),u.current.state),{isLoading:w,abortAction:I,loading:d.current,loadingMap:s.current,loadingParallelMap:f.current,errorMap:k(),errorParallelMap:v.current}),E.current=!1,Object.keys(R).forEach((function(e){var t;null===(t=R[e])||void 0===t||t.call(R)}))}function M(e){var r=i.current;i.current=e,S.current?t.onPropChange(n,u,i,r,a,A,h,C,!1,!1):j(e)}function m(e){n.current=e,t.computeDerivedValues(n,i,u,A),D()}function T(e){f.current=e,s.current=function(){if(S.current){var e=f.current;return Object.keys(e).reduce((function(t,r){var n=e[r];return t[r]=null!=Object.keys(n).find((function(e){return!!n[e]})),t}),{})}return null}(),d.current=function(){if(S.current){var e=f.current;return null!=Object.keys(e).find((function(t){var r=e[t];return Object.keys(r).find((function(e){return!!r[e]}))}))}return null}()}function j(o){var c;if(!S.current){i.current=o,S.current=!0,n.current=h(o);var f=new Set(null==A?void 0:A.initialActionsMarkedLoading),s=Object.keys(g).reduce((function(e,r){var n;return e[r]=f.has(r)?((n={})[t.DEFAULT_PROMISE_ID]=!0,n):{},e}),{});T(s),v.current=Object.keys(g).reduce((function(e,t){return e[t]={},e}),{}),l.current={},p.current={},O.current={},u.current={state:null,deps:{}},(null==A?void 0:A.derivedState)&&t.fixDerivedDeps(A),y.current=[];var d={options:A,get state(){return n.current},actions:g,setState:m};e.logEnabled&&r.logDetailedEffects&&b.push(r.logDetailedEffects());var E=function(e){var t,r=e();y.current.push(r),null===(t=r.init)||void 0===t||t.call(r,d)};null===(c=t.globalConfig.defaultMiddlewares)||void 0===c||c.forEach(E),null==b||b.forEach(E),t.computeDerivedValues(n,i,u,A),t.onPropChange(n,u,i,null,a,A,h,C,!0,!1),(null==A?void 0:A.onMount)&&A.onMount(t.buildOnMountInvocationContext(n,u,i,a)),D()}}function P(e,r){void 0===r&&(r=t.DEFAULT_PROMISE_ID);var n=v.current[e];(null==n?void 0:n[r])&&delete n[r],D()}function C(e,r,o,c,a,l,s,d,v){void 0===s&&(s=!1),void 0===d&&(d=!1),void 0===v&&(v=!1);var p=!1;if(!S.current)return D;var O=r,E=!!a&&t.isLoadingImpl(O||f.current,[o,null==l?void 0:l.promiseId]),_=t.runMiddlewares(y.current,n.current,e,E,o,c,a,l),g=_.newState,L=_.newLoading;if(null!=g&&(p=!0,n.current=g),E!==L&&(O=t.buildLoadingMap(O,o,(null==l?void 0:l.promiseId)||t.DEFAULT_PROMISE_ID,L),0===Object.keys(O).length&&(O=void 0)),null!=O&&(p=!0,T(O)),p)t.computeDerivedValues(n,i,u,A),d||(n.current=g||n.current,v||D());else if(s){!t.computeDerivedValues(n,i,u,A)||d||v||D()}return D}var V=Object.keys(g);function w(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return t.isLoadingImpl.apply(void 0,c([f.current],e,!1))}function I(e,r){var n,u;void 0===r&&(r=t.DEFAULT_PROMISE_ID);var o=null===(u=null===(n=p.current[e])||void 0===n?void 0:n[r])||void 0===u?void 0:u.abortController,c=!1;return o&&(o.abort(),c=!0),c}function k(){return S.current?t.buildErrorMap(v.current):null}return a.current=V.reduce((function(e,r){var o=g[r];return t.isSimpleSyncAction(o)?e[r]=t.decorateSimpleSyncAction(r,o,n,u,i,S,A,C):t.isAsyncAction(o)?e[r]=t.decorateAsyncAction({actionName:r,stateRef:n,derivedStateRef:u,propsRef:i,loadingParallelMapRef:f,errorMapRef:v,actionsRef:a,promisesRef:p,conflictActionsRef:O,initializedRef:S,timeoutRef:l,needNotifyListenersRef:E,options:A,setState:C,clearError:P,action:t.computeAsyncActionInput(o)}):t.isSyncAction(o)&&(e[r]=t.decorateSyncAction(r,o,n,u,i,a,S,l,E,A,C,P)),e}),{}),{getConfig:function(){return o({},e)},setProps:M,addStateListener:function(e){var t="".concat(x++);return R[t]=e,function(){delete R[t]}},init:j,destroy:function(){var e;if(S.current){var r=Object.keys(g).reduce((function(e,r){var n=g[r];if(t.isAsyncAction(n)&&n.abortable){var u=f.current[r],o=Object.keys(u).reduce((function(e,t){return u[t]&&(I(r,t),e.push(t)),e}),[]);o.length>0&&(e[r]=o)}return e}),{});null===(e=null==A?void 0:A.onUnmount)||void 0===e||e.call(A,t.buildOnUnMountInvocationContext(n,u,i,r)),Object.keys(l.current).forEach((function(e){clearTimeout(l.current[e])})),i.current=null,n.current=null,f.current=null,s.current=null,d.current=null,v.current=null,p.current=null,O.current=null,u.current=null,_.current=null,l.current=null,R={},S.current=!1,y.current.forEach((function(e){var t;null===(t=e.destroy)||void 0===t||t.call(e)})),y.current=[]}},isLoading:w,abortAction:I,clearError:P,getSnapshot:function(){return _.current},invokeOnMountDeferred:function(){t.onPropChange(n,u,i,null,a,A,h,C,!0,!0),(null==A?void 0:A.onMountDeferred)&&A.onMountDeferred(t.buildOnMountInvocationContext(n,u,i,a))},listenToStoreProps:function(e,t){var r=e.state?G(e.state,t):{};return e.addStateListener((function(){var n=e.state;if(n){var u=G(n,t);t.some((function(e){return!Object.is(r[e],u[e])}))&&(r=u,M(o(o({},i.current),u)))}}))},get actions(){return a.current},get state(){return S.current?o(o({},n.current),u.current.state):null},get loading(){return d.current},get loadingMap(){return s.current},get errorMap(){return k()},get loadingParallelMap(){return S.current?f.current:null},get errorParallelMap(){return S.current?v.current:null}}}function I(r,n,u){void 0===u&&(u=[]);var o=e.useMemo((function(){return n instanceof Function?n:function(e){return G(e,n)}}),c([n],u,!0));return C(r.addStateListener,r.getSnapshot,void 0,o,t.globalConfig.comparator)}function k(t,r,n){void 0===n&&(n=!0);var u=e.useRef();return null==u.current&&(u.current=w(t)),e.useEffect((function(){return u.current.invokeOnMountDeferred(),function(){var e;null===(e=u.current)||void 0===e||e.destroy()}}),[]),function(t,r,n){void 0===r&&(r=null),void 0===n&&(n=!0);var u=e.useReducer((function(e){return e>100?0:e+1}),0)[1],o=e.useRef(t);return t.setProps(r),e.useLayoutEffect((function(){t.init(r)}),[]),e.useLayoutEffect((function(){if(n)return o.current.addStateListener((function(){u()}))}),[n]),t}(u.current,r,n)}function G(e,t){return t.reduce((function(t,r){return e.hasOwnProperty(r)&&(t[r]=e[r]),t}),{})}Object.defineProperty(exports,"EffectError",{enumerable:!0,get:function(){return t.EffectError}}),Object.defineProperty(exports,"ParallelActionError",{enumerable:!0,get:function(){return t.ParallelActionError}}),Object.defineProperty(exports,"setGlobalConfig",{enumerable:!0,get:function(){return t.setGlobalConfig}}),exports.createStore=w,exports.default=k,exports.pick=G,exports.slice=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(t){return G(t,e)}},exports.useBindStore=function(t,r){return t.setProps(r),V(t.addStateListener,t.getSnapshot),e.useLayoutEffect((function(){t.init(r)}),[]),e.useEffect((function(){t.invokeOnMountDeferred()}),[t]),t},exports.useLocalStore=k,exports.useStore=function(e){return V(e.addStateListener,e.getSnapshot),e},exports.useStoreContextSlice=function(t,r){return I(e.useContext(t),r)},exports.useStoreSlice=I;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("./impl"),r=require("./development");function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var u=n(e),o=function(){return o=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var u in t=arguments[r])Object.prototype.hasOwnProperty.call(t,u)&&(e[u]=t[u]);return e},o.apply(this,arguments)};function c(e,t,r){if(r||2===arguments.length)for(var n,u=0,o=t.length;u<o;u++)!n&&u in t||(n||(n=Array.prototype.slice.call(t,0,u)),n[u]=t[u]);return e.concat(n||Array.prototype.slice.call(t))}function i(e){var t={exports:{}};return e(t,t.exports),t.exports}"function"==typeof SuppressedError&&SuppressedError;var a="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},l=u.default.useState,f=u.default.useEffect,s=u.default.useLayoutEffect,d=u.default.useDebugValue;function v(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!a(e,r)}catch(e){return!0}}var p="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(e,t){var r=t(),n=l({inst:{value:r,getSnapshot:t}}),u=n[0].inst,o=n[1];return s((function(){u.value=r,u.getSnapshot=t,v(u)&&o({inst:u})}),[e,r,t]),f((function(){return v(u)&&o({inst:u}),e((function(){v(u)&&o({inst:u})}))}),[e]),d(r),r},O={useSyncExternalStore:void 0!==u.default.useSyncExternalStore?u.default.useSyncExternalStore:p},E=i((function(e,t){"production"!==process.env.NODE_ENV&&function(){function e(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!n(e,r)}catch(e){return!0}}"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var r=u.default,n="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},o=r.useState,c=r.useEffect,i=r.useLayoutEffect,a=r.useDebugValue,l=!1,f=!1,s="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(t,u){l||void 0===r.startTransition||(l=!0,console.error("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var s=u();if(!f){var d=u();n(s,d)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),f=!0)}var v=(d=o({inst:{value:s,getSnapshot:u}}))[0].inst,p=d[1];return i((function(){v.value=s,v.getSnapshot=u,e(v)&&p({inst:v})}),[t,s,u]),c((function(){return e(v)&&p({inst:v}),t((function(){e(v)&&p({inst:v})}))}),[t]),a(s),s};t.useSyncExternalStore=void 0!==r.useSyncExternalStore?r.useSyncExternalStore:s,"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()})),S=O,_=E,y=i((function(e){"production"===process.env.NODE_ENV?e.exports=S:e.exports=_})),g=y;var L,b="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},A=y.useSyncExternalStore,R=u.default.useRef,h=u.default.useEffect,x=u.default.useMemo,M=u.default.useDebugValue,D={useSyncExternalStoreWithSelector:function(e,t,r,n,u){var o=R(null);if(null===o.current){var c={hasValue:!1,value:null};o.current=c}else c=o.current;o=x((function(){function e(e){if(!a){if(a=!0,o=e,e=n(e),void 0!==u&&c.hasValue){var t=c.value;if(u(t,e))return i=t}return i=e}if(t=i,b(o,e))return t;var r=n(e);return void 0!==u&&u(t,r)?(o=e,t):(o=e,i=r)}var o,i,a=!1,l=void 0===r?null:r;return[function(){return e(t())},null===l?void 0:function(){return e(l())}]}),[t,r,n,u]);var i=A(e,o[0],o[1]);return h((function(){c.hasValue=!0,c.value=i}),[i]),M(i),i}},m=i((function(e,t){"production"!==process.env.NODE_ENV&&function(){"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var e=u.default,r=y,n="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},o=r.useSyncExternalStore,c=e.useRef,i=e.useEffect,a=e.useMemo,l=e.useDebugValue;t.useSyncExternalStoreWithSelector=function(e,t,r,u,f){var s=c(null);if(null===s.current){var d={hasValue:!1,value:null};s.current=d}else d=s.current;s=a((function(){function e(e){if(!i){if(i=!0,o=e,e=u(e),void 0!==f&&d.hasValue){var t=d.value;if(f(t,e))return c=t}return c=e}if(t=c,n(o,e))return t;var r=u(e);return void 0!==f&&f(t,r)?(o=e,t):(o=e,c=r)}var o,c,i=!1,a=void 0===r?null:r;return[function(){return e(t())},null===a?void 0:function(){return e(a())}]}),[t,r,u,f]);var v=o(e,s[0],s[1]);return i((function(){d.hasValue=!0,d.value=v}),[v]),l(v),v},"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()})),T=D,j=m,P=i((function(e){"production"===process.env.NODE_ENV?e.exports=T:e.exports=j}));exports.ConflictPolicy=void 0,(L=exports.ConflictPolicy||(exports.ConflictPolicy={})).REJECT="reject",L.IGNORE="ignore",L.KEEP_LAST="keepLast",L.KEEP_ALL="keepAll",L.PARALLEL="parallel",L.REUSE="reuse",L.ABORT="abort";var C=P.useSyncExternalStoreWithSelector,V=g.useSyncExternalStore;function w(e){var n=t.createRef(),u=t.createRef(),i=t.createRef(),a=t.createRef(),l=t.createRef(),f=t.createRef(),s=t.createRef(),d=t.createRef(),v=t.createRef(),p=t.createRef(),O=t.createRef(),E=t.createRef(!1),S=t.createRef(!1),_=t.createRef(!1),y=t.createRef(),g=t.createRef([]),L=e.actions,b=e.middlewares,A=void 0===b?[]:b,R=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var u=0;for(n=Object.getOwnPropertySymbols(e);u<n.length;u++)t.indexOf(n[u])<0&&Object.prototype.propertyIsEnumerable.call(e,n[u])&&(r[n[u]]=e[n[u]])}return r}(e,["actions","middlewares"]),h=t.isFuncConfig(e)?e.getInitialState:function(){return e.initialState},x={},M=0;function D(){y.current=o(o(o(o(o({},i.current),a.current),n.current),u.current.state),{isLoading:I,abortAction:k,loading:d.current,loadingMap:s.current,loadingParallelMap:f.current,errorMap:B(),errorParallelMap:v.current}),_.current=!1,Object.keys(x).forEach((function(e){var t;null===(t=x[e])||void 0===t||t.call(x)}))}function m(e){var r=i.current;i.current=e,E.current?t.onPropChange(n,u,i,r,a,R,h,V,!1,!1):P(e)}function T(e){n.current=e,t.computeDerivedValues(n,i,u,R),D()}function j(e){f.current=e,s.current=function(){if(E.current){var e=f.current;return Object.keys(e).reduce((function(t,r){var n=e[r];return t[r]=null!=Object.keys(n).find((function(e){return!!n[e]})),t}),{})}return null}(),d.current=function(){if(E.current){var e=f.current;return null!=Object.keys(e).find((function(t){var r=e[t];return Object.keys(r).find((function(e){return!!r[e]}))}))}return null}()}function P(o){var c;if(!E.current){i.current=o,E.current=!0,n.current=h(o);var a=new Set(null==R?void 0:R.initialActionsMarkedLoading),f=Object.keys(L).reduce((function(e,r){var n;return e[r]=a.has(r)?((n={})[t.DEFAULT_PROMISE_ID]=!0,n):{},e}),{});j(f),v.current=Object.keys(L).reduce((function(e,t){return e[t]={},e}),{}),l.current={},p.current={},O.current={},u.current={state:null,deps:{}},(null==R?void 0:R.derivedState)&&t.fixDerivedDeps(R),g.current=[];var s={options:R,get state(){return n.current},actions:L,setState:T};e.logEnabled&&r.logDetailedEffects&&A.push(r.logDetailedEffects());var d=function(e){var t,r=e();g.current.push(r),null===(t=r.init)||void 0===t||t.call(r,s)};null===(c=t.globalConfig.defaultMiddlewares)||void 0===c||c.forEach(d),null==A||A.forEach(d),t.computeDerivedValues(n,i,u,R),D()}}function C(e,r){void 0===r&&(r=t.DEFAULT_PROMISE_ID);var n=v.current[e];(null==n?void 0:n[r])&&delete n[r],D()}function V(e,r,o,c,a,l,s,d,v){void 0===s&&(s=!1),void 0===d&&(d=!1),void 0===v&&(v=!1);var p=!1;if(!E.current)return D;var O=r,S=!!a&&t.isLoadingImpl(O||f.current,[o,null==l?void 0:l.promiseId]),_=t.runMiddlewares(g.current,n.current,e,S,o,c,a,l),y=_.newState,L=_.newLoading;if(null!=y&&(p=!0,n.current=y),S!==L&&(O=t.buildLoadingMap(O,o,(null==l?void 0:l.promiseId)||t.DEFAULT_PROMISE_ID,L),0===Object.keys(O).length&&(O=void 0)),null!=O&&(p=!0,j(O)),p)t.computeDerivedValues(n,i,u,R),d||(n.current=y||n.current,v||D());else if(s){!t.computeDerivedValues(n,i,u,R)||d||v||D()}return D}var w=Object.keys(L);function I(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return t.isLoadingImpl.apply(void 0,c([f.current],e,!1))}function k(e,r){var n,u;void 0===r&&(r=t.DEFAULT_PROMISE_ID);var o=null===(u=null===(n=p.current[e])||void 0===n?void 0:n[r])||void 0===u?void 0:u.abortController,c=!1;return o&&(o.abort(),c=!0),c}function B(){return E.current?t.buildErrorMap(v.current):null}return a.current=w.reduce((function(e,r){var o=L[r];return t.isSimpleSyncAction(o)?e[r]=t.decorateSimpleSyncAction(r,o,n,u,i,E,R,V):t.isAsyncAction(o)?e[r]=t.decorateAsyncAction({actionName:r,stateRef:n,derivedStateRef:u,propsRef:i,loadingParallelMapRef:f,errorMapRef:v,actionsRef:a,promisesRef:p,conflictActionsRef:O,initializedRef:E,timeoutRef:l,needNotifyListenersRef:_,options:R,setState:V,clearError:C,action:t.computeAsyncActionInput(o)}):t.isSyncAction(o)&&(e[r]=t.decorateSyncAction(r,o,n,u,i,a,E,l,_,R,V,C)),e}),{}),{getConfig:function(){return o({},e)},setProps:m,addStateListener:function(e){var t="".concat(M++);return x[t]=e,function(){delete x[t]}},init:P,runMountEffects:function(){E.current&&!S.current&&(S.current=!0,t.onPropChange(n,u,i,null,a,R,h,V,!0,!1),(null==R?void 0:R.onMount)&&R.onMount(t.buildOnMountInvocationContext(n,u,i,a)),D())},destroy:function(){var e;if(E.current){var r=Object.keys(L).reduce((function(e,r){var n=L[r];if(t.isAsyncAction(n)&&n.abortable){var u=f.current[r],o=Object.keys(u).reduce((function(e,t){return u[t]&&(k(r,t),e.push(t)),e}),[]);o.length>0&&(e[r]=o)}return e}),{});null===(e=null==R?void 0:R.onUnmount)||void 0===e||e.call(R,t.buildOnUnMountInvocationContext(n,u,i,r)),Object.keys(l.current).forEach((function(e){clearTimeout(l.current[e])})),i.current=null,n.current=null,f.current=null,s.current=null,d.current=null,v.current=null,p.current=null,O.current=null,u.current=null,y.current=null,l.current=null,x={},E.current=!1,S.current=!1,g.current.forEach((function(e){var t;null===(t=e.destroy)||void 0===t||t.call(e)})),g.current=[]}},isLoading:I,abortAction:k,clearError:C,getSnapshot:function(){return y.current},invokeOnMountDeferred:function(){t.onPropChange(n,u,i,null,a,R,h,V,!0,!0),(null==R?void 0:R.onMountDeferred)&&R.onMountDeferred(t.buildOnMountInvocationContext(n,u,i,a))},listenToStoreProps:function(e,t){var r=e.state?G(e.state,t):{};return e.addStateListener((function(){var n=e.state;if(n){var u=G(n,t);t.some((function(e){return!Object.is(r[e],u[e])}))&&(r=u,m(o(o({},i.current),u)))}}))},get actions(){return a.current},get state(){return E.current?o(o({},n.current),u.current.state):null},get loading(){return d.current},get loadingMap(){return s.current},get errorMap(){return B()},get loadingParallelMap(){return E.current?f.current:null},get errorParallelMap(){return E.current?v.current:null}}}function I(r,n,u){void 0===u&&(u=[]);var o=e.useMemo((function(){return n instanceof Function?n:function(e){return G(e,n)}}),c([n],u,!0));return C(r.addStateListener,r.getSnapshot,void 0,o,t.globalConfig.comparator)}function k(t,r,n){void 0===n&&(n=!0);var u=e.useRef();return null==u.current&&(u.current=w(t)),e.useEffect((function(){return u.current.invokeOnMountDeferred(),function(){var e;null===(e=u.current)||void 0===e||e.destroy()}}),[]),function(t,r,n){void 0===r&&(r=null),void 0===n&&(n=!0);var u=e.useReducer((function(e){return e>100?0:e+1}),0)[1],o=e.useRef(t);return t.setProps(r),e.useLayoutEffect((function(){if(n)return o.current.addStateListener((function(){u()}))}),[n]),e.useLayoutEffect((function(){t.init(r),t.runMountEffects()}),[]),t}(u.current,r,n)}function G(e,t){return t.reduce((function(t,r){return e.hasOwnProperty(r)&&(t[r]=e[r]),t}),{})}Object.defineProperty(exports,"EffectError",{enumerable:!0,get:function(){return t.EffectError}}),Object.defineProperty(exports,"ParallelActionError",{enumerable:!0,get:function(){return t.ParallelActionError}}),Object.defineProperty(exports,"setGlobalConfig",{enumerable:!0,get:function(){return t.setGlobalConfig}}),exports.createStore=w,exports.default=k,exports.pick=G,exports.slice=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(t){return G(t,e)}},exports.useBindStore=function(t,r){return t.setProps(r),V(t.addStateListener,t.getSnapshot),e.useLayoutEffect((function(){t.init(r),t.runMountEffects()}),[]),e.useEffect((function(){t.invokeOnMountDeferred()}),[t]),t},exports.useLocalStore=k,exports.useStore=function(e){return V(e.addStateListener,e.getSnapshot),e},exports.useStoreContextSlice=function(t,r){return I(e.useContext(t),r)},exports.useStoreSlice=I;
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../node_modules/tslib/tslib.es6.mjs","../node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.js","../node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js","../node_modules/use-sync-external-store/shim/index.js","../node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.js","../node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.development.js","../node_modules/use-sync-external-store/shim/with-selector.js"],"sourcesContent":["/******************************************************************************\nCopyright (c) Microsoft Corporation.\n\nPermission to use, copy, modify, and/or distribute this software for any\npurpose with or without fee is hereby granted.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\nPERFORMANCE OF THIS SOFTWARE.\n***************************************************************************** */\n/* global Reflect, Promise, SuppressedError, Symbol, Iterator */\n\nvar extendStatics = function(d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n};\n\nexport function __extends(d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n}\n\nexport var __assign = function() {\n __assign = Object.assign || function __assign(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\n }\n return t;\n }\n return __assign.apply(this, arguments);\n}\n\nexport function __rest(s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n}\n\nexport function __decorate(decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n}\n\nexport function __param(paramIndex, decorator) {\n return function (target, key) { decorator(target, key, paramIndex); }\n}\n\nexport function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {\n function accept(f) { if (f !== void 0 && typeof f !== \"function\") throw new TypeError(\"Function expected\"); return f; }\n var kind = contextIn.kind, key = kind === \"getter\" ? \"get\" : kind === \"setter\" ? \"set\" : \"value\";\n var target = !descriptorIn && ctor ? contextIn[\"static\"] ? ctor : ctor.prototype : null;\n var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});\n var _, done = false;\n for (var i = decorators.length - 1; i >= 0; i--) {\n var context = {};\n for (var p in contextIn) context[p] = p === \"access\" ? {} : contextIn[p];\n for (var p in contextIn.access) context.access[p] = contextIn.access[p];\n context.addInitializer = function (f) { if (done) throw new TypeError(\"Cannot add initializers after decoration has completed\"); extraInitializers.push(accept(f || null)); };\n var result = (0, decorators[i])(kind === \"accessor\" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);\n if (kind === \"accessor\") {\n if (result === void 0) continue;\n if (result === null || typeof result !== \"object\") throw new TypeError(\"Object expected\");\n if (_ = accept(result.get)) descriptor.get = _;\n if (_ = accept(result.set)) descriptor.set = _;\n if (_ = accept(result.init)) initializers.unshift(_);\n }\n else if (_ = accept(result)) {\n if (kind === \"field\") initializers.unshift(_);\n else descriptor[key] = _;\n }\n }\n if (target) Object.defineProperty(target, contextIn.name, descriptor);\n done = true;\n};\n\nexport function __runInitializers(thisArg, initializers, value) {\n var useValue = arguments.length > 2;\n for (var i = 0; i < initializers.length; i++) {\n value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);\n }\n return useValue ? value : void 0;\n};\n\nexport function __propKey(x) {\n return typeof x === \"symbol\" ? x : \"\".concat(x);\n};\n\nexport function __setFunctionName(f, name, prefix) {\n if (typeof name === \"symbol\") name = name.description ? \"[\".concat(name.description, \"]\") : \"\";\n return Object.defineProperty(f, \"name\", { configurable: true, value: prefix ? \"\".concat(prefix, \" \", name) : name });\n};\n\nexport function __metadata(metadataKey, metadataValue) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\n}\n\nexport function __awaiter(thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n}\n\nexport function __generator(thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === \"function\" ? Iterator : Object).prototype);\n return g.next = verb(0), g[\"throw\"] = verb(1), g[\"return\"] = verb(2), typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n}\n\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n});\n\nexport function __exportStar(m, o) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\n}\n\nexport function __values(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n}\n\nexport function __read(o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n}\n\n/** @deprecated */\nexport function __spread() {\n for (var ar = [], i = 0; i < arguments.length; i++)\n ar = ar.concat(__read(arguments[i]));\n return ar;\n}\n\n/** @deprecated */\nexport function __spreadArrays() {\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\n r[k] = a[j];\n return r;\n}\n\nexport function __spreadArray(to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n}\n\nexport function __await(v) {\n return this instanceof __await ? (this.v = v, this) : new __await(v);\n}\n\nexport function __asyncGenerator(thisArg, _arguments, generator) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\n return i = Object.create((typeof AsyncIterator === \"function\" ? AsyncIterator : Object).prototype), verb(\"next\"), verb(\"throw\"), verb(\"return\", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;\n function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }\n function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\n function fulfill(value) { resume(\"next\", value); }\n function reject(value) { resume(\"throw\", value); }\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\n}\n\nexport function __asyncDelegator(o) {\n var i, p;\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }\n}\n\nexport function __asyncValues(o) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var m = o[Symbol.asyncIterator], i;\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\n}\n\nexport function __makeTemplateObject(cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n};\n\nvar __setModuleDefault = Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n};\n\nvar ownKeys = function(o) {\n ownKeys = Object.getOwnPropertyNames || function (o) {\n var ar = [];\n for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;\n return ar;\n };\n return ownKeys(o);\n};\n\nexport function __importStar(mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== \"default\") __createBinding(result, mod, k[i]);\n __setModuleDefault(result, mod);\n return result;\n}\n\nexport function __importDefault(mod) {\n return (mod && mod.__esModule) ? mod : { default: mod };\n}\n\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\n}\n\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\n}\n\nexport function __classPrivateFieldIn(state, receiver) {\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\n}\n\nexport function __addDisposableResource(env, value, async) {\n if (value !== null && value !== void 0) {\n if (typeof value !== \"object\" && typeof value !== \"function\") throw new TypeError(\"Object expected.\");\n var dispose, inner;\n if (async) {\n if (!Symbol.asyncDispose) throw new TypeError(\"Symbol.asyncDispose is not defined.\");\n dispose = value[Symbol.asyncDispose];\n }\n if (dispose === void 0) {\n if (!Symbol.dispose) throw new TypeError(\"Symbol.dispose is not defined.\");\n dispose = value[Symbol.dispose];\n if (async) inner = dispose;\n }\n if (typeof dispose !== \"function\") throw new TypeError(\"Object not disposable.\");\n if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };\n env.stack.push({ value: value, dispose: dispose, async: async });\n }\n else if (async) {\n env.stack.push({ async: true });\n }\n return value;\n}\n\nvar _SuppressedError = typeof SuppressedError === \"function\" ? SuppressedError : function (error, suppressed, message) {\n var e = new Error(message);\n return e.name = \"SuppressedError\", e.error = error, e.suppressed = suppressed, e;\n};\n\nexport function __disposeResources(env) {\n function fail(e) {\n env.error = env.hasError ? new _SuppressedError(e, env.error, \"An error was suppressed during disposal.\") : e;\n env.hasError = true;\n }\n var r, s = 0;\n function next() {\n while (r = env.stack.pop()) {\n try {\n if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);\n if (r.dispose) {\n var result = r.dispose.call(r.value);\n if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });\n }\n else s |= 1;\n }\n catch (e) {\n fail(e);\n }\n }\n if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();\n if (env.hasError) throw env.error;\n }\n return next();\n}\n\nexport function __rewriteRelativeImportExtension(path, preserveJsx) {\n if (typeof path === \"string\" && /^\\.\\.?\\//.test(path)) {\n return path.replace(/\\.(tsx)$|((?:\\.d)?)((?:\\.[^./]+?)?)\\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) {\n return tsx ? preserveJsx ? \".jsx\" : \".js\" : d && (!ext || !cm) ? m : (d + ext + \".\" + cm.toLowerCase() + \"js\");\n });\n }\n return path;\n}\n\nexport default {\n __extends,\n __assign,\n __rest,\n __decorate,\n __param,\n __esDecorate,\n __runInitializers,\n __propKey,\n __setFunctionName,\n __metadata,\n __awaiter,\n __generator,\n __createBinding,\n __exportStar,\n __values,\n __read,\n __spread,\n __spreadArrays,\n __spreadArray,\n __await,\n __asyncGenerator,\n __asyncDelegator,\n __asyncValues,\n __makeTemplateObject,\n __importStar,\n __importDefault,\n __classPrivateFieldGet,\n __classPrivateFieldSet,\n __classPrivateFieldIn,\n __addDisposableResource,\n __disposeResources,\n __rewriteRelativeImportExtension,\n};\n","/**\n * @license React\n * use-sync-external-store-shim.production.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\"use strict\";\nvar React = require(\"react\");\nfunction is(x, y) {\n return (x === y && (0 !== x || 1 / x === 1 / y)) || (x !== x && y !== y);\n}\nvar objectIs = \"function\" === typeof Object.is ? Object.is : is,\n useState = React.useState,\n useEffect = React.useEffect,\n useLayoutEffect = React.useLayoutEffect,\n useDebugValue = React.useDebugValue;\nfunction useSyncExternalStore$2(subscribe, getSnapshot) {\n var value = getSnapshot(),\n _useState = useState({ inst: { value: value, getSnapshot: getSnapshot } }),\n inst = _useState[0].inst,\n forceUpdate = _useState[1];\n useLayoutEffect(\n function () {\n inst.value = value;\n inst.getSnapshot = getSnapshot;\n checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst });\n },\n [subscribe, value, getSnapshot]\n );\n useEffect(\n function () {\n checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst });\n return subscribe(function () {\n checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst });\n });\n },\n [subscribe]\n );\n useDebugValue(value);\n return value;\n}\nfunction checkIfSnapshotChanged(inst) {\n var latestGetSnapshot = inst.getSnapshot;\n inst = inst.value;\n try {\n var nextValue = latestGetSnapshot();\n return !objectIs(inst, nextValue);\n } catch (error) {\n return !0;\n }\n}\nfunction useSyncExternalStore$1(subscribe, getSnapshot) {\n return getSnapshot();\n}\nvar shim =\n \"undefined\" === typeof window ||\n \"undefined\" === typeof window.document ||\n \"undefined\" === typeof window.document.createElement\n ? useSyncExternalStore$1\n : useSyncExternalStore$2;\nexports.useSyncExternalStore =\n void 0 !== React.useSyncExternalStore ? React.useSyncExternalStore : shim;\n","/**\n * @license React\n * use-sync-external-store-shim.development.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\"use strict\";\n\"production\" !== process.env.NODE_ENV &&\n (function () {\n function is(x, y) {\n return (x === y && (0 !== x || 1 / x === 1 / y)) || (x !== x && y !== y);\n }\n function useSyncExternalStore$2(subscribe, getSnapshot) {\n didWarnOld18Alpha ||\n void 0 === React.startTransition ||\n ((didWarnOld18Alpha = !0),\n console.error(\n \"You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release.\"\n ));\n var value = getSnapshot();\n if (!didWarnUncachedGetSnapshot) {\n var cachedValue = getSnapshot();\n objectIs(value, cachedValue) ||\n (console.error(\n \"The result of getSnapshot should be cached to avoid an infinite loop\"\n ),\n (didWarnUncachedGetSnapshot = !0));\n }\n cachedValue = useState({\n inst: { value: value, getSnapshot: getSnapshot }\n });\n var inst = cachedValue[0].inst,\n forceUpdate = cachedValue[1];\n useLayoutEffect(\n function () {\n inst.value = value;\n inst.getSnapshot = getSnapshot;\n checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst });\n },\n [subscribe, value, getSnapshot]\n );\n useEffect(\n function () {\n checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst });\n return subscribe(function () {\n checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst });\n });\n },\n [subscribe]\n );\n useDebugValue(value);\n return value;\n }\n function checkIfSnapshotChanged(inst) {\n var latestGetSnapshot = inst.getSnapshot;\n inst = inst.value;\n try {\n var nextValue = latestGetSnapshot();\n return !objectIs(inst, nextValue);\n } catch (error) {\n return !0;\n }\n }\n function useSyncExternalStore$1(subscribe, getSnapshot) {\n return getSnapshot();\n }\n \"undefined\" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&\n \"function\" ===\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart &&\n __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());\n var React = require(\"react\"),\n objectIs = \"function\" === typeof Object.is ? Object.is : is,\n useState = React.useState,\n useEffect = React.useEffect,\n useLayoutEffect = React.useLayoutEffect,\n useDebugValue = React.useDebugValue,\n didWarnOld18Alpha = !1,\n didWarnUncachedGetSnapshot = !1,\n shim =\n \"undefined\" === typeof window ||\n \"undefined\" === typeof window.document ||\n \"undefined\" === typeof window.document.createElement\n ? useSyncExternalStore$1\n : useSyncExternalStore$2;\n exports.useSyncExternalStore =\n void 0 !== React.useSyncExternalStore ? React.useSyncExternalStore : shim;\n \"undefined\" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&\n \"function\" ===\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&\n __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());\n })();\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('../cjs/use-sync-external-store-shim.production.js');\n} else {\n module.exports = require('../cjs/use-sync-external-store-shim.development.js');\n}\n","/**\n * @license React\n * use-sync-external-store-shim/with-selector.production.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\"use strict\";\nvar React = require(\"react\"),\n shim = require(\"use-sync-external-store/shim\");\nfunction is(x, y) {\n return (x === y && (0 !== x || 1 / x === 1 / y)) || (x !== x && y !== y);\n}\nvar objectIs = \"function\" === typeof Object.is ? Object.is : is,\n useSyncExternalStore = shim.useSyncExternalStore,\n useRef = React.useRef,\n useEffect = React.useEffect,\n useMemo = React.useMemo,\n useDebugValue = React.useDebugValue;\nexports.useSyncExternalStoreWithSelector = function (\n subscribe,\n getSnapshot,\n getServerSnapshot,\n selector,\n isEqual\n) {\n var instRef = useRef(null);\n if (null === instRef.current) {\n var inst = { hasValue: !1, value: null };\n instRef.current = inst;\n } else inst = instRef.current;\n instRef = useMemo(\n function () {\n function memoizedSelector(nextSnapshot) {\n if (!hasMemo) {\n hasMemo = !0;\n memoizedSnapshot = nextSnapshot;\n nextSnapshot = selector(nextSnapshot);\n if (void 0 !== isEqual && inst.hasValue) {\n var currentSelection = inst.value;\n if (isEqual(currentSelection, nextSnapshot))\n return (memoizedSelection = currentSelection);\n }\n return (memoizedSelection = nextSnapshot);\n }\n currentSelection = memoizedSelection;\n if (objectIs(memoizedSnapshot, nextSnapshot)) return currentSelection;\n var nextSelection = selector(nextSnapshot);\n if (void 0 !== isEqual && isEqual(currentSelection, nextSelection))\n return (memoizedSnapshot = nextSnapshot), currentSelection;\n memoizedSnapshot = nextSnapshot;\n return (memoizedSelection = nextSelection);\n }\n var hasMemo = !1,\n memoizedSnapshot,\n memoizedSelection,\n maybeGetServerSnapshot =\n void 0 === getServerSnapshot ? null : getServerSnapshot;\n return [\n function () {\n return memoizedSelector(getSnapshot());\n },\n null === maybeGetServerSnapshot\n ? void 0\n : function () {\n return memoizedSelector(maybeGetServerSnapshot());\n }\n ];\n },\n [getSnapshot, getServerSnapshot, selector, isEqual]\n );\n var value = useSyncExternalStore(subscribe, instRef[0], instRef[1]);\n useEffect(\n function () {\n inst.hasValue = !0;\n inst.value = value;\n },\n [value]\n );\n useDebugValue(value);\n return value;\n};\n","/**\n * @license React\n * use-sync-external-store-shim/with-selector.development.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\"use strict\";\n\"production\" !== process.env.NODE_ENV &&\n (function () {\n function is(x, y) {\n return (x === y && (0 !== x || 1 / x === 1 / y)) || (x !== x && y !== y);\n }\n \"undefined\" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&\n \"function\" ===\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart &&\n __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());\n var React = require(\"react\"),\n shim = require(\"use-sync-external-store/shim\"),\n objectIs = \"function\" === typeof Object.is ? Object.is : is,\n useSyncExternalStore = shim.useSyncExternalStore,\n useRef = React.useRef,\n useEffect = React.useEffect,\n useMemo = React.useMemo,\n useDebugValue = React.useDebugValue;\n exports.useSyncExternalStoreWithSelector = function (\n subscribe,\n getSnapshot,\n getServerSnapshot,\n selector,\n isEqual\n ) {\n var instRef = useRef(null);\n if (null === instRef.current) {\n var inst = { hasValue: !1, value: null };\n instRef.current = inst;\n } else inst = instRef.current;\n instRef = useMemo(\n function () {\n function memoizedSelector(nextSnapshot) {\n if (!hasMemo) {\n hasMemo = !0;\n memoizedSnapshot = nextSnapshot;\n nextSnapshot = selector(nextSnapshot);\n if (void 0 !== isEqual && inst.hasValue) {\n var currentSelection = inst.value;\n if (isEqual(currentSelection, nextSnapshot))\n return (memoizedSelection = currentSelection);\n }\n return (memoizedSelection = nextSnapshot);\n }\n currentSelection = memoizedSelection;\n if (objectIs(memoizedSnapshot, nextSnapshot))\n return currentSelection;\n var nextSelection = selector(nextSnapshot);\n if (void 0 !== isEqual && isEqual(currentSelection, nextSelection))\n return (memoizedSnapshot = nextSnapshot), currentSelection;\n memoizedSnapshot = nextSnapshot;\n return (memoizedSelection = nextSelection);\n }\n var hasMemo = !1,\n memoizedSnapshot,\n memoizedSelection,\n maybeGetServerSnapshot =\n void 0 === getServerSnapshot ? null : getServerSnapshot;\n return [\n function () {\n return memoizedSelector(getSnapshot());\n },\n null === maybeGetServerSnapshot\n ? void 0\n : function () {\n return memoizedSelector(maybeGetServerSnapshot());\n }\n ];\n },\n [getSnapshot, getServerSnapshot, selector, isEqual]\n );\n var value = useSyncExternalStore(subscribe, instRef[0], instRef[1]);\n useEffect(\n function () {\n inst.hasValue = !0;\n inst.value = value;\n },\n [value]\n );\n useDebugValue(value);\n return value;\n };\n \"undefined\" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&\n \"function\" ===\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&\n __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());\n })();\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('../cjs/use-sync-external-store-shim/with-selector.production.js');\n} else {\n module.exports = require('../cjs/use-sync-external-store-shim/with-selector.development.js');\n}\n"],"names":["__assign","Object","assign","t","s","i","n","arguments","length","p","prototype","hasOwnProperty","call","apply","this","__spreadArray","to","from","pack","ar","l","Array","slice","concat","SuppressedError","objectIs","is","x","y","useState","React","useEffect","useLayoutEffect","useDebugValue","checkIfSnapshotChanged","inst","latestGetSnapshot","getSnapshot","value","nextValue","error","shim","window","document","createElement","subscribe","_useState","forceUpdate","useSyncExternalStore","process","env","NODE_ENV","__REACT_DEVTOOLS_GLOBAL_HOOK__","registerInternalModuleStart","Error","require$$0","didWarnOld18Alpha","didWarnUncachedGetSnapshot","startTransition","console","cachedValue","exports","registerInternalModuleStop","module","require$$1","useRef","useMemo","getServerSnapshot","selector","isEqual","instRef","current","hasValue","memoizedSelector","nextSnapshot","hasMemo","memoizedSnapshot","currentSelection","memoizedSelection","nextSelection","maybeGetServerSnapshot","useSyncExternalStoreWithSelector","e","indexOf","getOwnPropertySymbols","propertyIsEnumerable"],"mappings":"6NA+BWA,EAAW,WAQpB,OAPAA,EAAWC,OAAOC,QAAU,SAAkBC,GAC1C,IAAK,IAAIC,EAAGC,EAAI,EAAGC,EAAIC,UAAUC,OAAQH,EAAIC,EAAGD,IAE5C,IAAK,IAAII,KADTL,EAAIG,UAAUF,GACOJ,OAAOS,UAAUC,eAAeC,KAAKR,EAAGK,KAAIN,EAAEM,GAAKL,EAAEK,IAE9E,OAAON,CACV,EACMH,EAASa,MAAMC,KAA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AEC,QAAQ1E,GAAK,IAC9EN,EAAEM,GAAKL,EAAEK,IACb,GAAS,MAALL,GAAqD,mBAAjCH,OAAOmF,sBACtB,KAAI/E,EAAI,EAAb,IAAgBI,EAAIR,OAAOmF,sBAAsBhF,GAAIC,EAAII,EAAED,OAAQH,IAC3D6E,EAAEC,QAAQ1E,EAAEJ,IAAM,GAAKJ,OAAOS,UAAU2E,qBAAqBzE,KAAKR,EAAGK,EAAEJ,MACvEF,EAAEM,EAAEJ,IAAMD,EAAEK,EAAEJ,IAF4B,CAItD,OAAOF,CACT"}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../node_modules/tslib/tslib.es6.mjs","../node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.js","../node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js","../node_modules/use-sync-external-store/shim/index.js","../node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.js","../node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.development.js","../node_modules/use-sync-external-store/shim/with-selector.js"],"sourcesContent":["/******************************************************************************\nCopyright (c) Microsoft Corporation.\n\nPermission to use, copy, modify, and/or distribute this software for any\npurpose with or without fee is hereby granted.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\nPERFORMANCE OF THIS SOFTWARE.\n***************************************************************************** */\n/* global Reflect, Promise, SuppressedError, Symbol, Iterator */\n\nvar extendStatics = function(d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n};\n\nexport function __extends(d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n}\n\nexport var __assign = function() {\n __assign = Object.assign || function __assign(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\n }\n return t;\n }\n return __assign.apply(this, arguments);\n}\n\nexport function __rest(s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n}\n\nexport function __decorate(decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n}\n\nexport function __param(paramIndex, decorator) {\n return function (target, key) { decorator(target, key, paramIndex); }\n}\n\nexport function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {\n function accept(f) { if (f !== void 0 && typeof f !== \"function\") throw new TypeError(\"Function expected\"); return f; }\n var kind = contextIn.kind, key = kind === \"getter\" ? \"get\" : kind === \"setter\" ? \"set\" : \"value\";\n var target = !descriptorIn && ctor ? contextIn[\"static\"] ? ctor : ctor.prototype : null;\n var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});\n var _, done = false;\n for (var i = decorators.length - 1; i >= 0; i--) {\n var context = {};\n for (var p in contextIn) context[p] = p === \"access\" ? {} : contextIn[p];\n for (var p in contextIn.access) context.access[p] = contextIn.access[p];\n context.addInitializer = function (f) { if (done) throw new TypeError(\"Cannot add initializers after decoration has completed\"); extraInitializers.push(accept(f || null)); };\n var result = (0, decorators[i])(kind === \"accessor\" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);\n if (kind === \"accessor\") {\n if (result === void 0) continue;\n if (result === null || typeof result !== \"object\") throw new TypeError(\"Object expected\");\n if (_ = accept(result.get)) descriptor.get = _;\n if (_ = accept(result.set)) descriptor.set = _;\n if (_ = accept(result.init)) initializers.unshift(_);\n }\n else if (_ = accept(result)) {\n if (kind === \"field\") initializers.unshift(_);\n else descriptor[key] = _;\n }\n }\n if (target) Object.defineProperty(target, contextIn.name, descriptor);\n done = true;\n};\n\nexport function __runInitializers(thisArg, initializers, value) {\n var useValue = arguments.length > 2;\n for (var i = 0; i < initializers.length; i++) {\n value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);\n }\n return useValue ? value : void 0;\n};\n\nexport function __propKey(x) {\n return typeof x === \"symbol\" ? x : \"\".concat(x);\n};\n\nexport function __setFunctionName(f, name, prefix) {\n if (typeof name === \"symbol\") name = name.description ? \"[\".concat(name.description, \"]\") : \"\";\n return Object.defineProperty(f, \"name\", { configurable: true, value: prefix ? \"\".concat(prefix, \" \", name) : name });\n};\n\nexport function __metadata(metadataKey, metadataValue) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\n}\n\nexport function __awaiter(thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n}\n\nexport function __generator(thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === \"function\" ? Iterator : Object).prototype);\n return g.next = verb(0), g[\"throw\"] = verb(1), g[\"return\"] = verb(2), typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n}\n\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n});\n\nexport function __exportStar(m, o) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\n}\n\nexport function __values(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n}\n\nexport function __read(o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n}\n\n/** @deprecated */\nexport function __spread() {\n for (var ar = [], i = 0; i < arguments.length; i++)\n ar = ar.concat(__read(arguments[i]));\n return ar;\n}\n\n/** @deprecated */\nexport function __spreadArrays() {\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\n r[k] = a[j];\n return r;\n}\n\nexport function __spreadArray(to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n}\n\nexport function __await(v) {\n return this instanceof __await ? (this.v = v, this) : new __await(v);\n}\n\nexport function __asyncGenerator(thisArg, _arguments, generator) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\n return i = Object.create((typeof AsyncIterator === \"function\" ? AsyncIterator : Object).prototype), verb(\"next\"), verb(\"throw\"), verb(\"return\", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;\n function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }\n function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\n function fulfill(value) { resume(\"next\", value); }\n function reject(value) { resume(\"throw\", value); }\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\n}\n\nexport function __asyncDelegator(o) {\n var i, p;\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }\n}\n\nexport function __asyncValues(o) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var m = o[Symbol.asyncIterator], i;\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\n}\n\nexport function __makeTemplateObject(cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n};\n\nvar __setModuleDefault = Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n};\n\nvar ownKeys = function(o) {\n ownKeys = Object.getOwnPropertyNames || function (o) {\n var ar = [];\n for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;\n return ar;\n };\n return ownKeys(o);\n};\n\nexport function __importStar(mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== \"default\") __createBinding(result, mod, k[i]);\n __setModuleDefault(result, mod);\n return result;\n}\n\nexport function __importDefault(mod) {\n return (mod && mod.__esModule) ? mod : { default: mod };\n}\n\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\n}\n\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\n}\n\nexport function __classPrivateFieldIn(state, receiver) {\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\n}\n\nexport function __addDisposableResource(env, value, async) {\n if (value !== null && value !== void 0) {\n if (typeof value !== \"object\" && typeof value !== \"function\") throw new TypeError(\"Object expected.\");\n var dispose, inner;\n if (async) {\n if (!Symbol.asyncDispose) throw new TypeError(\"Symbol.asyncDispose is not defined.\");\n dispose = value[Symbol.asyncDispose];\n }\n if (dispose === void 0) {\n if (!Symbol.dispose) throw new TypeError(\"Symbol.dispose is not defined.\");\n dispose = value[Symbol.dispose];\n if (async) inner = dispose;\n }\n if (typeof dispose !== \"function\") throw new TypeError(\"Object not disposable.\");\n if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };\n env.stack.push({ value: value, dispose: dispose, async: async });\n }\n else if (async) {\n env.stack.push({ async: true });\n }\n return value;\n}\n\nvar _SuppressedError = typeof SuppressedError === \"function\" ? SuppressedError : function (error, suppressed, message) {\n var e = new Error(message);\n return e.name = \"SuppressedError\", e.error = error, e.suppressed = suppressed, e;\n};\n\nexport function __disposeResources(env) {\n function fail(e) {\n env.error = env.hasError ? new _SuppressedError(e, env.error, \"An error was suppressed during disposal.\") : e;\n env.hasError = true;\n }\n var r, s = 0;\n function next() {\n while (r = env.stack.pop()) {\n try {\n if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);\n if (r.dispose) {\n var result = r.dispose.call(r.value);\n if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });\n }\n else s |= 1;\n }\n catch (e) {\n fail(e);\n }\n }\n if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();\n if (env.hasError) throw env.error;\n }\n return next();\n}\n\nexport function __rewriteRelativeImportExtension(path, preserveJsx) {\n if (typeof path === \"string\" && /^\\.\\.?\\//.test(path)) {\n return path.replace(/\\.(tsx)$|((?:\\.d)?)((?:\\.[^./]+?)?)\\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) {\n return tsx ? preserveJsx ? \".jsx\" : \".js\" : d && (!ext || !cm) ? m : (d + ext + \".\" + cm.toLowerCase() + \"js\");\n });\n }\n return path;\n}\n\nexport default {\n __extends,\n __assign,\n __rest,\n __decorate,\n __param,\n __esDecorate,\n __runInitializers,\n __propKey,\n __setFunctionName,\n __metadata,\n __awaiter,\n __generator,\n __createBinding,\n __exportStar,\n __values,\n __read,\n __spread,\n __spreadArrays,\n __spreadArray,\n __await,\n __asyncGenerator,\n __asyncDelegator,\n __asyncValues,\n __makeTemplateObject,\n __importStar,\n __importDefault,\n __classPrivateFieldGet,\n __classPrivateFieldSet,\n __classPrivateFieldIn,\n __addDisposableResource,\n __disposeResources,\n __rewriteRelativeImportExtension,\n};\n","/**\n * @license React\n * use-sync-external-store-shim.production.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\"use strict\";\nvar React = require(\"react\");\nfunction is(x, y) {\n return (x === y && (0 !== x || 1 / x === 1 / y)) || (x !== x && y !== y);\n}\nvar objectIs = \"function\" === typeof Object.is ? Object.is : is,\n useState = React.useState,\n useEffect = React.useEffect,\n useLayoutEffect = React.useLayoutEffect,\n useDebugValue = React.useDebugValue;\nfunction useSyncExternalStore$2(subscribe, getSnapshot) {\n var value = getSnapshot(),\n _useState = useState({ inst: { value: value, getSnapshot: getSnapshot } }),\n inst = _useState[0].inst,\n forceUpdate = _useState[1];\n useLayoutEffect(\n function () {\n inst.value = value;\n inst.getSnapshot = getSnapshot;\n checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst });\n },\n [subscribe, value, getSnapshot]\n );\n useEffect(\n function () {\n checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst });\n return subscribe(function () {\n checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst });\n });\n },\n [subscribe]\n );\n useDebugValue(value);\n return value;\n}\nfunction checkIfSnapshotChanged(inst) {\n var latestGetSnapshot = inst.getSnapshot;\n inst = inst.value;\n try {\n var nextValue = latestGetSnapshot();\n return !objectIs(inst, nextValue);\n } catch (error) {\n return !0;\n }\n}\nfunction useSyncExternalStore$1(subscribe, getSnapshot) {\n return getSnapshot();\n}\nvar shim =\n \"undefined\" === typeof window ||\n \"undefined\" === typeof window.document ||\n \"undefined\" === typeof window.document.createElement\n ? useSyncExternalStore$1\n : useSyncExternalStore$2;\nexports.useSyncExternalStore =\n void 0 !== React.useSyncExternalStore ? React.useSyncExternalStore : shim;\n","/**\n * @license React\n * use-sync-external-store-shim.development.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\"use strict\";\n\"production\" !== process.env.NODE_ENV &&\n (function () {\n function is(x, y) {\n return (x === y && (0 !== x || 1 / x === 1 / y)) || (x !== x && y !== y);\n }\n function useSyncExternalStore$2(subscribe, getSnapshot) {\n didWarnOld18Alpha ||\n void 0 === React.startTransition ||\n ((didWarnOld18Alpha = !0),\n console.error(\n \"You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release.\"\n ));\n var value = getSnapshot();\n if (!didWarnUncachedGetSnapshot) {\n var cachedValue = getSnapshot();\n objectIs(value, cachedValue) ||\n (console.error(\n \"The result of getSnapshot should be cached to avoid an infinite loop\"\n ),\n (didWarnUncachedGetSnapshot = !0));\n }\n cachedValue = useState({\n inst: { value: value, getSnapshot: getSnapshot }\n });\n var inst = cachedValue[0].inst,\n forceUpdate = cachedValue[1];\n useLayoutEffect(\n function () {\n inst.value = value;\n inst.getSnapshot = getSnapshot;\n checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst });\n },\n [subscribe, value, getSnapshot]\n );\n useEffect(\n function () {\n checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst });\n return subscribe(function () {\n checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst });\n });\n },\n [subscribe]\n );\n useDebugValue(value);\n return value;\n }\n function checkIfSnapshotChanged(inst) {\n var latestGetSnapshot = inst.getSnapshot;\n inst = inst.value;\n try {\n var nextValue = latestGetSnapshot();\n return !objectIs(inst, nextValue);\n } catch (error) {\n return !0;\n }\n }\n function useSyncExternalStore$1(subscribe, getSnapshot) {\n return getSnapshot();\n }\n \"undefined\" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&\n \"function\" ===\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart &&\n __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());\n var React = require(\"react\"),\n objectIs = \"function\" === typeof Object.is ? Object.is : is,\n useState = React.useState,\n useEffect = React.useEffect,\n useLayoutEffect = React.useLayoutEffect,\n useDebugValue = React.useDebugValue,\n didWarnOld18Alpha = !1,\n didWarnUncachedGetSnapshot = !1,\n shim =\n \"undefined\" === typeof window ||\n \"undefined\" === typeof window.document ||\n \"undefined\" === typeof window.document.createElement\n ? useSyncExternalStore$1\n : useSyncExternalStore$2;\n exports.useSyncExternalStore =\n void 0 !== React.useSyncExternalStore ? React.useSyncExternalStore : shim;\n \"undefined\" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&\n \"function\" ===\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&\n __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());\n })();\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('../cjs/use-sync-external-store-shim.production.js');\n} else {\n module.exports = require('../cjs/use-sync-external-store-shim.development.js');\n}\n","/**\n * @license React\n * use-sync-external-store-shim/with-selector.production.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\"use strict\";\nvar React = require(\"react\"),\n shim = require(\"use-sync-external-store/shim\");\nfunction is(x, y) {\n return (x === y && (0 !== x || 1 / x === 1 / y)) || (x !== x && y !== y);\n}\nvar objectIs = \"function\" === typeof Object.is ? Object.is : is,\n useSyncExternalStore = shim.useSyncExternalStore,\n useRef = React.useRef,\n useEffect = React.useEffect,\n useMemo = React.useMemo,\n useDebugValue = React.useDebugValue;\nexports.useSyncExternalStoreWithSelector = function (\n subscribe,\n getSnapshot,\n getServerSnapshot,\n selector,\n isEqual\n) {\n var instRef = useRef(null);\n if (null === instRef.current) {\n var inst = { hasValue: !1, value: null };\n instRef.current = inst;\n } else inst = instRef.current;\n instRef = useMemo(\n function () {\n function memoizedSelector(nextSnapshot) {\n if (!hasMemo) {\n hasMemo = !0;\n memoizedSnapshot = nextSnapshot;\n nextSnapshot = selector(nextSnapshot);\n if (void 0 !== isEqual && inst.hasValue) {\n var currentSelection = inst.value;\n if (isEqual(currentSelection, nextSnapshot))\n return (memoizedSelection = currentSelection);\n }\n return (memoizedSelection = nextSnapshot);\n }\n currentSelection = memoizedSelection;\n if (objectIs(memoizedSnapshot, nextSnapshot)) return currentSelection;\n var nextSelection = selector(nextSnapshot);\n if (void 0 !== isEqual && isEqual(currentSelection, nextSelection))\n return (memoizedSnapshot = nextSnapshot), currentSelection;\n memoizedSnapshot = nextSnapshot;\n return (memoizedSelection = nextSelection);\n }\n var hasMemo = !1,\n memoizedSnapshot,\n memoizedSelection,\n maybeGetServerSnapshot =\n void 0 === getServerSnapshot ? null : getServerSnapshot;\n return [\n function () {\n return memoizedSelector(getSnapshot());\n },\n null === maybeGetServerSnapshot\n ? void 0\n : function () {\n return memoizedSelector(maybeGetServerSnapshot());\n }\n ];\n },\n [getSnapshot, getServerSnapshot, selector, isEqual]\n );\n var value = useSyncExternalStore(subscribe, instRef[0], instRef[1]);\n useEffect(\n function () {\n inst.hasValue = !0;\n inst.value = value;\n },\n [value]\n );\n useDebugValue(value);\n return value;\n};\n","/**\n * @license React\n * use-sync-external-store-shim/with-selector.development.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\"use strict\";\n\"production\" !== process.env.NODE_ENV &&\n (function () {\n function is(x, y) {\n return (x === y && (0 !== x || 1 / x === 1 / y)) || (x !== x && y !== y);\n }\n \"undefined\" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&\n \"function\" ===\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart &&\n __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());\n var React = require(\"react\"),\n shim = require(\"use-sync-external-store/shim\"),\n objectIs = \"function\" === typeof Object.is ? Object.is : is,\n useSyncExternalStore = shim.useSyncExternalStore,\n useRef = React.useRef,\n useEffect = React.useEffect,\n useMemo = React.useMemo,\n useDebugValue = React.useDebugValue;\n exports.useSyncExternalStoreWithSelector = function (\n subscribe,\n getSnapshot,\n getServerSnapshot,\n selector,\n isEqual\n ) {\n var instRef = useRef(null);\n if (null === instRef.current) {\n var inst = { hasValue: !1, value: null };\n instRef.current = inst;\n } else inst = instRef.current;\n instRef = useMemo(\n function () {\n function memoizedSelector(nextSnapshot) {\n if (!hasMemo) {\n hasMemo = !0;\n memoizedSnapshot = nextSnapshot;\n nextSnapshot = selector(nextSnapshot);\n if (void 0 !== isEqual && inst.hasValue) {\n var currentSelection = inst.value;\n if (isEqual(currentSelection, nextSnapshot))\n return (memoizedSelection = currentSelection);\n }\n return (memoizedSelection = nextSnapshot);\n }\n currentSelection = memoizedSelection;\n if (objectIs(memoizedSnapshot, nextSnapshot))\n return currentSelection;\n var nextSelection = selector(nextSnapshot);\n if (void 0 !== isEqual && isEqual(currentSelection, nextSelection))\n return (memoizedSnapshot = nextSnapshot), currentSelection;\n memoizedSnapshot = nextSnapshot;\n return (memoizedSelection = nextSelection);\n }\n var hasMemo = !1,\n memoizedSnapshot,\n memoizedSelection,\n maybeGetServerSnapshot =\n void 0 === getServerSnapshot ? null : getServerSnapshot;\n return [\n function () {\n return memoizedSelector(getSnapshot());\n },\n null === maybeGetServerSnapshot\n ? void 0\n : function () {\n return memoizedSelector(maybeGetServerSnapshot());\n }\n ];\n },\n [getSnapshot, getServerSnapshot, selector, isEqual]\n );\n var value = useSyncExternalStore(subscribe, instRef[0], instRef[1]);\n useEffect(\n function () {\n inst.hasValue = !0;\n inst.value = value;\n },\n [value]\n );\n useDebugValue(value);\n return value;\n };\n \"undefined\" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&\n \"function\" ===\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&\n __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());\n })();\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('../cjs/use-sync-external-store-shim/with-selector.production.js');\n} else {\n module.exports = require('../cjs/use-sync-external-store-shim/with-selector.development.js');\n}\n"],"names":["__assign","Object","assign","t","s","i","n","arguments","length","p","prototype","hasOwnProperty","call","apply","this","__spreadArray","to","from","pack","ar","l","Array","slice","concat","SuppressedError","objectIs","is","x","y","useState","React","useEffect","useLayoutEffect","useDebugValue","checkIfSnapshotChanged","inst","latestGetSnapshot","getSnapshot","value","nextValue","error","shim","window","document","createElement","subscribe","_useState","forceUpdate","useSyncExternalStore","process","env","NODE_ENV","__REACT_DEVTOOLS_GLOBAL_HOOK__","registerInternalModuleStart","Error","require$$0","didWarnOld18Alpha","didWarnUncachedGetSnapshot","startTransition","console","cachedValue","exports","registerInternalModuleStop","module","require$$1","useRef","useMemo","getServerSnapshot","selector","isEqual","instRef","current","hasValue","memoizedSelector","nextSnapshot","hasMemo","memoizedSnapshot","currentSelection","memoizedSelection","nextSelection","maybeGetServerSnapshot","useSyncExternalStoreWithSelector","e","indexOf","getOwnPropertySymbols","propertyIsEnumerable"],"mappings":"6NA+BWA,EAAW,WAQpB,OAPAA,EAAWC,OAAOC,QAAU,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U,2BAA2BR,QAC7D,CApFD,+BCV2B,eAAzBL,QAAQC,IAAIC,SACdY,EAAAF,QAAiBN,EAEjBQ,EAAAF,QAAiBG,2mBNqCZ,SAAgB5D,EAAG8E,GACxB,IAAI/E,EAAI,CAAA,EACR,IAAK,IAAIM,KAAKL,EAAOH,OAAOS,UAAUC,eAAeC,KAAKR,EAAGK,IAAMyE,EAAEC,QAAQ1E,GAAK,IAC9EN,EAAEM,GAAKL,EAAEK,IACb,GAAS,MAALL,GAAqD,mBAAjCH,OAAOmF,sBACtB,KAAI/E,EAAI,EAAb,IAAgBI,EAAIR,OAAOmF,sBAAsBhF,GAAIC,EAAII,EAAED,OAAQH,IAC3D6E,EAAEC,QAAQ1E,EAAEJ,IAAM,GAAKJ,OAAOS,UAAU2E,qBAAqBzE,KAAKR,EAAGK,EAAEJ,MACvEF,EAAEM,EAAEJ,IAAMD,EAAEK,EAAEJ,IAF4B,CAItD,OAAOF,CACT"}
|
package/package.json
CHANGED
package/v5.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,n=require("./index"),r=require("react"),t=function(){return t=Object.assign||function(e){for(var n,r=1,t=arguments.length;r<t;r++)for(var o in n=arguments[r])Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e},t.apply(this,arguments)};"function"==typeof SuppressedError&&SuppressedError,function(e){e.REJECT="reject",e.IGNORE="ignore",e.KEEP_LAST="keepLast",e.KEEP_ALL="keepAll",e.PARALLEL="parallel",e.REUSE="reuse",e.ABORT="abort"}(e||(e={}));var o=function e(n,r){if(n===r)return!0;if(n&&r&&"object"==typeof n&&"object"==typeof r){if(n.constructor!==r.constructor)return!1;var t,o,s;if(Array.isArray(n)){if((t=n.length)!=r.length)return!1;for(o=t;0!=o--;)if(!e(n[o],r[o]))return!1;return!0}if(n.constructor===RegExp)return n.source===r.source&&n.flags===r.flags;if(n.valueOf!==Object.prototype.valueOf)return n.valueOf()===r.valueOf();if(n.toString!==Object.prototype.toString)return n.toString()===r.toString();if((t=(s=Object.keys(n)).length)!==Object.keys(r).length)return!1;for(o=t;0!=o--;)if(!Object.prototype.hasOwnProperty.call(r,s[o]))return!1;for(o=t;0!=o--;){var
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,n=require("./index"),r=require("react"),t=function(){return t=Object.assign||function(e){for(var n,r=1,t=arguments.length;r<t;r++)for(var o in n=arguments[r])Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e},t.apply(this,arguments)};"function"==typeof SuppressedError&&SuppressedError,function(e){e.REJECT="reject",e.IGNORE="ignore",e.KEEP_LAST="keepLast",e.KEEP_ALL="keepAll",e.PARALLEL="parallel",e.REUSE="reuse",e.ABORT="abort"}(e||(e={}));var o=function e(n,r){if(n===r)return!0;if(n&&r&&"object"==typeof n&&"object"==typeof r){if(n.constructor!==r.constructor)return!1;var t,o,s;if(Array.isArray(n)){if((t=n.length)!=r.length)return!1;for(o=t;0!=o--;)if(!e(n[o],r[o]))return!1;return!0}if(n.constructor===RegExp)return n.source===r.source&&n.flags===r.flags;if(n.valueOf!==Object.prototype.valueOf)return n.valueOf()===r.valueOf();if(n.toString!==Object.prototype.toString)return n.toString()===r.toString();if((t=(s=Object.keys(n)).length)!==Object.keys(r).length)return!1;for(o=t;0!=o--;)if(!Object.prototype.hasOwnProperty.call(r,s[o]))return!1;for(o=t;0!=o--;){var u=s[o];if(!e(n[u],r[u]))return!1}return!0}return n!=n&&r!=r},s=null;function u(e){return!(e instanceof Function)&&e.hasOwnProperty("promiseGet")}function i(e){return e instanceof Function}function c(e){return!(e instanceof Function||e.hasOwnProperty("promise")||e.hasOwnProperty("promiseGet"))}function a(n){return Object.keys(n).reduce((function(r,t){var o=n[t];if(i(o))r[t]=function(e){return o(e.s,e.args,e.p)};else if(c(o)){var s={effects:function(e){return o.action(e.s,e.args,e.p)}};o.onActionDone&&(s.sideEffects=function(e){var n=e.s,r=e.p,t=e.args,s=e.a,u=e.notifyWarning;o.onActionDone(n,t,r,s,u)}),r[t]=s}else if(function(e){return!(e instanceof Function)&&e.hasOwnProperty("promise")}(o)||u(o)){var a;a=u(o)?{getPromise:function(e){var n=e.s,r=e.p,t=e.a,s=e.args,u=e.abortSignal;return o.promiseGet(s,n,r,t,u)},retryCount:3,conflictPolicy:e.REUSE}:{getPromise:function(e){var n=e.s,r=e.p,t=e.a,s=e.args,u=e.abortSignal;return o.promise(s,n,r,t,u)}},["abortable","conflictPolicy","getPromiseId","isTriggerRetryError","rejectPromiseOnError","retryCount","debounceTimeout","debounceSideEffectsTimeout","retryDelaySeed"].forEach((function(e){null!=o[e]&&(a[e]=o[e])})),o.successMessage&&(a.getSuccessMessage=function(){return o.successMessage}),o.errorMessage&&(a.getSuccessMessage=function(){return o.errorMessage}),o.getSuccessMessage&&(a.getSuccessMessage=function(e){var n=e.res,r=e.args,t=e.p;return o.getSuccessMessage(n,r,t)}),o.getErrorMessage&&(a.getErrorMessage=function(e){var n=e.err,r=e.args,t=e.p;return o.getErrorMessage(n,r,t)}),o.preReducer&&(a.preEffects=function(e){var n=e.s,r=e.p,t=e.args;return o.preReducer(n,t,r)}),o.optimisticReducer&&(a.optimisticEffects=function(e){var n=e.s,r=e.p,t=e.args;return o.optimisticReducer(n,t,r)}),o.reducer&&(a.effects=function(e){var n=e.s,r=e.res,t=e.p,s=e.args;return o.reducer(n,r,s,t)}),o.errorReducer&&(a.errorEffects=function(e){var n=e.s,r=e.err,t=e.p,s=e.args;return o.errorReducer(n,r,s,t)}),o.onDone&&(a.sideEffects=function(e){var n=e.s,r=e.res,t=e.p,s=e.args,u=e.a,i=e.notifyWarning;return o.onDone(n,r,s,t,u,i)}),o.onFail&&(a.errorSideEffects=function(e){var n=e.s,r=e.err,t=e.p,s=e.args,u=e.a,i=e.notifyWarning;return o.onFail(n,r,s,t,u,i)}),r[t]=a}return r}),{})}"development"!==process.env.NODE_ENV&&"test"!==process.env.NODE_ENV||(s=function(e){return void 0===e&&(e=console),function(){var n="",r=e,t=function(e,n){var r;if(n!==e){var t=null!=e?typeof e:typeof n;if("number"===t||"string"===t||"boolean"===t)r="".concat(e," => ").concat(""===n?'""':n);else if(e&&e.length||n&&n.length)if(null==e)r="was ".concat(e,", now contains ").concat(n.length," element(s)");else if(null==n)r="contained ".concat(e.length," element(s), now is ").concat(n);else if(0===e.length)r="was empty, now contains ".concat(n.length," elements");else if(0===n.length)r="contained ".concat(e.length," elements, now is empty");else{var s=n.filter((function(n){return!e.find((function(e){return o(n,e)}))})),u=e.filter((function(e){return!n.find((function(n){return o(e,n)}))}));s.length>10&&(s="".concat(s.length," element(s) added")),u.length>10&&(u="".concat(u.length," element(s) removed")),r={added:s,removed:u}}else r=n}return r},s=function(e){return"string"==typeof e?'"'.concat(e,'"'):e};return{init:function(t){var o,u;n=(null===(o=t.options)||void 0===o?void 0:o.name)?"[".concat(null===(u=t.options)||void 0===u?void 0:u.name,"]"):"";var i=t.state;e.group(n,"initialState"),Object.keys(i).forEach((function(e){r.log(e,":",s(i[e]))})),e.groupEnd()},destroy:null,effects:function(e,o,u,i){var c,a=null===(c=e.context)||void 0===c?void 0:c.args,f=[n,e.name.toString()];if(e.isAsync&&("preEffects"===e.type?f.push(i?"START":"CANCELLED"):"effects"===e.type?f.push("DONE"):f.push("FAILED")),null!=u||a&&0!==Object.keys(a).length?r.group.apply(r,f):r.log.apply(r,f),a&&Object.keys(a).length>0&&(r.group("Arguments"),a.forEach((function(e){r.log(e,":",s(e))})),r.groupEnd()),null!=u){if(r.groupCollapsed("Before"),null==o)r.log("was null");else Object.keys(o).forEach((function(e){r.log(e,":",s(o[e]))}));if(r.groupEnd(),r.groupCollapsed("After"),null==u)r.log("was null");else Object.keys(u).forEach((function(e){r.log(e,":",s(u[e]))}));if(r.groupEnd(),null!=u){r.group("Diff");var l=function(e,n){var r={};return e&&Object.keys(e).forEach((function(o){if(n.hasOwnProperty(o)){var s=e[o],u=n[o],i=t(s,u);i&&(r[o]=i)}else r[o]="was deleted"})),Object.keys(n).forEach((function(o){if(null==e||!e.hasOwnProperty(o)){var s=n[o];r[o]=t(void 0,s)}})),r}(o,u);Object.keys(l).forEach((function(e){return r.log(e,":",l[e])})),r.groupEnd()}}return r.groupEnd(),null}}}}),exports.default=function(e,o,u,i,c){void 0===i&&(i={});var f,l,p,g,d=r.useReducer((function(e){return e>100?0:e+1}),0)[1],v=r.useRef(),y=r.useRef();null==v.current&&(v.current=a(o)),null==y.current&&(y.current=(f=i,l={},p=Object.keys(f),g=["onPropsChange","onPropsChangeReducer","getPropsRefValues","onMount","initialActionsMarkedLoading"],p.forEach((function(e){g.includes(e)||(l[e]=f[e])})),f.onMount&&(l.onMount=function(e){var n=e.s,r=e.p,t=e.a;return f.onMount(t,r,n)}),f.getPropsRefValues&&(l.onPropsChange={getDeps:f.getPropsRefValues,effects:function(e){var n=e.s,r=e.p,t=e.indices;return f.onPropsChangeReducer?f.onPropsChangeReducer(n,r,t):null},sideEffects:function(e){var n=e.s,r=e.p,t=e.a,o=e.indices;return null==f.onPropsChange?null:f.onPropsChange(n,r,t,o)}}),f.initialActionsMarkedLoading&&(l.initialActionsMarkedLoading=f.initialActionsMarkedLoading),l));var E=r.useRef();if(null==E.current){var h=c;i.logEnabled&&h.push(s()),E.current=n.createStore(t(t({getInitialState:e,actions:v.current},y.current),{middlewares:h}))}E.current.setProps(u),r.useLayoutEffect((function(){return E.current.addStateListener((function(){d()}))}),[]),r.useLayoutEffect((function(){E.current.init(u),E.current.runMountEffects()}),[]);var O=E.current;return{state:O.state,actions:O.actions,loading:O.loading,loadingMap:O.loadingMap,loadingParallelMap:O.loadingParallelMap,abortAction:O.abortAction}},exports.isAdvancedSyncAction=c,exports.isAsyncAction=function(e){return!(e instanceof Function)&&(e.hasOwnProperty("promise")||e.hasOwnProperty("promiseGet"))},exports.isAsyncPromiseGetAction=function(e){return!(e instanceof Function||e.hasOwnProperty("promise")&&e.hasOwnProperty("promiseGet"))},exports.isSyncAction=i,exports.useOnMount=function(e){r.useEffect((function(){var n=e();return"function"==typeof n?n:void 0}),[e])},exports.useOnUnload=function(e){r.useEffect((function(){return document.addEventListener("beforeunload",e),function(){document.removeEventListener("beforeunload",e)}}),[e])},exports.useOnUnmount=function(e,n){void 0===n&&(n=[]),r.useEffect((function(){return e}),[n,e])};
|
|
2
2
|
//# sourceMappingURL=v5.js.map
|