@oxog/state 1.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Ersin Koç
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,295 @@
1
+ # @oxog/state
2
+
3
+ [![npm version](https://img.shields.io/npm/v/@oxog/state.svg)](https://www.npmjs.com/package/@oxog/state)
4
+ [![Bundle Size](https://img.shields.io/bundlephobia/minzip/@oxog/state)](https://bundlephobia.com/package/@oxog/state)
5
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
6
+
7
+ Zero-dependency reactive state management for any framework.
8
+
9
+ ## Features
10
+
11
+ - **Zero Dependencies** - No runtime dependencies, smaller bundle size
12
+ - **Framework Agnostic** - Works with React, Vue, Svelte, or vanilla JS
13
+ - **TypeScript Native** - Built with strict mode, full type inference
14
+ - **Plugin System** - Extend with persist, devtools, history, sync, immer
15
+ - **Tiny Bundle** - Less than 2KB gzipped for core
16
+
17
+ ## Installation
18
+
19
+ ```bash
20
+ npm install @oxog/state
21
+ ```
22
+
23
+ ```bash
24
+ yarn add @oxog/state
25
+ ```
26
+
27
+ ```bash
28
+ pnpm add @oxog/state
29
+ ```
30
+
31
+ ## Quick Start
32
+
33
+ ```typescript
34
+ import { createStore, useStore } from '@oxog/state';
35
+
36
+ // Create a store with state and actions
37
+ const store = createStore({
38
+ count: 0,
39
+ increment: (state) => ({ count: state.count + 1 }),
40
+ decrement: (state) => ({ count: state.count - 1 }),
41
+ });
42
+
43
+ // Use in React
44
+ function Counter() {
45
+ const count = useStore(store, (s) => s.count);
46
+ const increment = useStore(store, (s) => s.increment);
47
+
48
+ return <button onClick={increment}>{count}</button>;
49
+ }
50
+
51
+ // Use in vanilla JS
52
+ store.subscribe((state) => console.log(state.count));
53
+ store.increment();
54
+ ```
55
+
56
+ ## API Reference
57
+
58
+ ### Core
59
+
60
+ #### `createStore(initialState, actions?)`
61
+
62
+ Creates a reactive store.
63
+
64
+ ```typescript
65
+ // Inline actions
66
+ const store = createStore({
67
+ count: 0,
68
+ increment: (state) => ({ count: state.count + 1 }),
69
+ });
70
+
71
+ // Separate actions
72
+ const store = createStore(
73
+ { count: 0 },
74
+ { increment: (state) => ({ count: state.count + 1 }) }
75
+ );
76
+ ```
77
+
78
+ #### `batch(fn)`
79
+
80
+ Batch multiple updates into a single notification.
81
+
82
+ ```typescript
83
+ import { batch } from '@oxog/state';
84
+
85
+ batch(() => {
86
+ store.setState({ count: 1 });
87
+ store.setState({ name: 'John' });
88
+ }); // Single notification
89
+ ```
90
+
91
+ ### Store Methods
92
+
93
+ | Method | Description |
94
+ |--------|-------------|
95
+ | `getState()` | Get current state |
96
+ | `setState(partial)` | Update state with partial object |
97
+ | `merge(partial)` | Deep merge state |
98
+ | `reset()` | Reset to initial state |
99
+ | `subscribe(listener, selector?)` | Subscribe to changes |
100
+ | `use(plugin, options?)` | Add plugin |
101
+ | `destroy()` | Cleanup store |
102
+
103
+ ### React Hooks
104
+
105
+ #### `useStore(store, selector?, equalityFn?)`
106
+
107
+ Subscribe to store state in React components.
108
+
109
+ ```typescript
110
+ // Full state
111
+ const state = useStore(store);
112
+
113
+ // With selector
114
+ const count = useStore(store, (s) => s.count);
115
+
116
+ // With custom equality
117
+ const user = useStore(store, (s) => s.user, deepEqual);
118
+ ```
119
+
120
+ #### `useCreateStore(initialState)`
121
+
122
+ Create a store scoped to component lifecycle.
123
+
124
+ ```typescript
125
+ function MyComponent() {
126
+ const store = useCreateStore({ count: 0 });
127
+ // Store is destroyed when component unmounts
128
+ }
129
+ ```
130
+
131
+ #### `useAction(store, actionName)`
132
+
133
+ Get a stable action reference.
134
+
135
+ ```typescript
136
+ const increment = useAction(store, 'increment');
137
+ ```
138
+
139
+ ## Plugins
140
+
141
+ ### Persist
142
+
143
+ Persist state to localStorage or custom storage.
144
+
145
+ ```typescript
146
+ import { persist } from '@oxog/state';
147
+
148
+ const store = createStore({ count: 0 })
149
+ .use(persist({ key: 'my-app' }));
150
+
151
+ // With options
152
+ const store = createStore({ count: 0, temp: '' })
153
+ .use(persist({
154
+ key: 'my-app',
155
+ storage: sessionStorage,
156
+ whitelist: ['count'], // Only persist count
157
+ }));
158
+ ```
159
+
160
+ ### DevTools
161
+
162
+ Connect to Redux DevTools Extension.
163
+
164
+ ```typescript
165
+ import { devtools } from '@oxog/state';
166
+
167
+ const store = createStore({ count: 0 })
168
+ .use(devtools({ name: 'My Store' }));
169
+ ```
170
+
171
+ ### History
172
+
173
+ Add undo/redo functionality.
174
+
175
+ ```typescript
176
+ import { history } from '@oxog/state';
177
+
178
+ const store = createStore({ count: 0 })
179
+ .use(history({ limit: 50 }));
180
+
181
+ store.setState({ count: 1 });
182
+ store.setState({ count: 2 });
183
+ store.undo(); // { count: 1 }
184
+ store.redo(); // { count: 2 }
185
+ ```
186
+
187
+ ### Sync
188
+
189
+ Synchronize state across browser tabs.
190
+
191
+ ```typescript
192
+ import { sync } from '@oxog/state';
193
+
194
+ const store = createStore({ count: 0 })
195
+ .use(sync({ channel: 'my-app' }));
196
+ ```
197
+
198
+ ### Immer
199
+
200
+ Use mutable syntax for immutable updates.
201
+
202
+ ```typescript
203
+ import { immer } from '@oxog/state';
204
+
205
+ const store = createStore({
206
+ users: [{ id: 1, name: 'John' }],
207
+ }).use(immer());
208
+
209
+ store.setState((draft) => {
210
+ draft.users[0].name = 'Jane';
211
+ draft.users.push({ id: 2, name: 'Bob' });
212
+ });
213
+ ```
214
+
215
+ ### Selector
216
+
217
+ Add computed/derived values.
218
+
219
+ ```typescript
220
+ import { selector } from '@oxog/state';
221
+
222
+ const store = createStore({
223
+ items: [],
224
+ filter: 'all',
225
+ }).use(selector({
226
+ filteredItems: (state) => {
227
+ if (state.filter === 'all') return state.items;
228
+ return state.items.filter((i) => i.status === state.filter);
229
+ },
230
+ itemCount: (state) => state.items.length,
231
+ }));
232
+ ```
233
+
234
+ ## Async Actions
235
+
236
+ Handle async operations with async actions.
237
+
238
+ ```typescript
239
+ const store = createStore({
240
+ data: null,
241
+ loading: false,
242
+ error: null,
243
+ fetch: async (state, url: string) => {
244
+ store.setState({ loading: true, error: null });
245
+ try {
246
+ const res = await fetch(url);
247
+ const data = await res.json();
248
+ return { data, loading: false };
249
+ } catch (error) {
250
+ return { error, loading: false };
251
+ }
252
+ },
253
+ });
254
+
255
+ await store.fetch('/api/users');
256
+ ```
257
+
258
+ ## TypeScript
259
+
260
+ Full TypeScript support with type inference.
261
+
262
+ ```typescript
263
+ interface State {
264
+ count: number;
265
+ user: User | null;
266
+ }
267
+
268
+ interface Actions {
269
+ increment: (state: State) => Partial<State>;
270
+ setUser: (state: State, user: User) => Partial<State>;
271
+ }
272
+
273
+ const store = createStore<State, Actions>(
274
+ { count: 0, user: null },
275
+ {
276
+ increment: (s) => ({ count: s.count + 1 }),
277
+ setUser: (s, user) => ({ user }),
278
+ }
279
+ );
280
+ ```
281
+
282
+ ## Browser Support
283
+
284
+ - Chrome 60+
285
+ - Firefox 55+
286
+ - Safari 12+
287
+ - Edge 79+
288
+
289
+ ## Documentation
290
+
291
+ Full documentation available at [state.oxog.dev](https://state.oxog.dev)
292
+
293
+ ## License
294
+
295
+ MIT
@@ -0,0 +1,47 @@
1
+ "use strict";var OxogState=(()=>{var Gn=Object.create;var be=Object.defineProperty;var Xn=Object.getOwnPropertyDescriptor;var Jn=Object.getOwnPropertyNames;var Qn=Object.getPrototypeOf,Zn=Object.prototype.hasOwnProperty;var Ye=(t,r)=>()=>(r||t((r={exports:{}}).exports,r),r.exports),eo=(t,r)=>{for(var o in r)be(t,o,{get:r[o],enumerable:!0})},lr=(t,r,o,a)=>{if(r&&typeof r=="object"||typeof r=="function")for(let s of Jn(r))!Zn.call(t,s)&&s!==o&&be(t,s,{get:()=>r[s],enumerable:!(a=Xn(r,s))||a.enumerable});return t};var to=(t,r,o)=>(o=t!=null?Gn(Qn(t)):{},lr(r||!t||!t.__esModule?be(o,"default",{value:t,enumerable:!0}):o,t)),ro=t=>lr(be({},"__esModule",{value:!0}),t);var Cr=Ye(g=>{"use strict";var ue=Symbol.for("react.element"),uo=Symbol.for("react.portal"),co=Symbol.for("react.fragment"),lo=Symbol.for("react.strict_mode"),fo=Symbol.for("react.profiler"),po=Symbol.for("react.provider"),yo=Symbol.for("react.context"),ho=Symbol.for("react.forward_ref"),So=Symbol.for("react.suspense"),vo=Symbol.for("react.memo"),go=Symbol.for("react.lazy"),vr=Symbol.iterator;function mo(t){return t===null||typeof t!="object"?null:(t=vr&&t[vr]||t["@@iterator"],typeof t=="function"?t:null)}var Tr={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},br=Object.assign,Er={};function G(t,r,o){this.props=t,this.context=r,this.refs=Er,this.updater=o||Tr}G.prototype.isReactComponent={};G.prototype.setState=function(t,r){if(typeof t!="object"&&typeof t!="function"&&t!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,t,r,"setState")};G.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")};function _r(){}_r.prototype=G.prototype;function rt(t,r,o){this.props=t,this.context=r,this.refs=Er,this.updater=o||Tr}var nt=rt.prototype=new _r;nt.constructor=rt;br(nt,G.prototype);nt.isPureReactComponent=!0;var gr=Array.isArray,wr=Object.prototype.hasOwnProperty,ot={current:null},kr={key:!0,ref:!0,__self:!0,__source:!0};function Or(t,r,o){var a,s={},c=null,d=null;if(r!=null)for(a in r.ref!==void 0&&(d=r.ref),r.key!==void 0&&(c=""+r.key),r)wr.call(r,a)&&!kr.hasOwnProperty(a)&&(s[a]=r[a]);var y=arguments.length-2;if(y===1)s.children=o;else if(1<y){for(var f=Array(y),h=0;h<y;h++)f[h]=arguments[h+2];s.children=f}if(t&&t.defaultProps)for(a in y=t.defaultProps,y)s[a]===void 0&&(s[a]=y[a]);return{$$typeof:ue,type:t,key:c,ref:d,props:s,_owner:ot.current}}function To(t,r){return{$$typeof:ue,type:t.type,key:r,ref:t.ref,props:t.props,_owner:t._owner}}function at(t){return typeof t=="object"&&t!==null&&t.$$typeof===ue}function bo(t){var r={"=":"=0",":":"=2"};return"$"+t.replace(/[=:]/g,function(o){return r[o]})}var mr=/\/+/g;function tt(t,r){return typeof t=="object"&&t!==null&&t.key!=null?bo(""+t.key):r.toString(36)}function ke(t,r,o,a,s){var c=typeof t;(c==="undefined"||c==="boolean")&&(t=null);var d=!1;if(t===null)d=!0;else switch(c){case"string":case"number":d=!0;break;case"object":switch(t.$$typeof){case ue:case uo:d=!0}}if(d)return d=t,s=s(d),t=a===""?"."+tt(d,0):a,gr(s)?(o="",t!=null&&(o=t.replace(mr,"$&/")+"/"),ke(s,r,o,"",function(h){return h})):s!=null&&(at(s)&&(s=To(s,o+(!s.key||d&&d.key===s.key?"":(""+s.key).replace(mr,"$&/")+"/")+t)),r.push(s)),1;if(d=0,a=a===""?".":a+":",gr(t))for(var y=0;y<t.length;y++){c=t[y];var f=a+tt(c,y);d+=ke(c,r,o,f,s)}else if(f=mo(t),typeof f=="function")for(t=f.call(t),y=0;!(c=t.next()).done;)c=c.value,f=a+tt(c,y++),d+=ke(c,r,o,f,s);else if(c==="object")throw r=String(t),Error("Objects are not valid as a React child (found: "+(r==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":r)+"). If you meant to render a collection of children, use an array instead.");return d}function we(t,r,o){if(t==null)return t;var a=[],s=0;return ke(t,a,"","",function(c){return r.call(o,c,s++)}),a}function Eo(t){if(t._status===-1){var r=t._result;r=r(),r.then(function(o){(t._status===0||t._status===-1)&&(t._status=1,t._result=o)},function(o){(t._status===0||t._status===-1)&&(t._status=2,t._result=o)}),t._status===-1&&(t._status=0,t._result=r)}if(t._status===1)return t._result.default;throw t._result}var j={current:null},Oe={transition:null},_o={ReactCurrentDispatcher:j,ReactCurrentBatchConfig:Oe,ReactCurrentOwner:ot};function Pr(){throw Error("act(...) is not supported in production builds of React.")}g.Children={map:we,forEach:function(t,r,o){we(t,function(){r.apply(this,arguments)},o)},count:function(t){var r=0;return we(t,function(){r++}),r},toArray:function(t){return we(t,function(r){return r})||[]},only:function(t){if(!at(t))throw Error("React.Children.only expected to receive a single React element child.");return t}};g.Component=G;g.Fragment=co;g.Profiler=fo;g.PureComponent=rt;g.StrictMode=lo;g.Suspense=So;g.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=_o;g.act=Pr;g.cloneElement=function(t,r,o){if(t==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+t+".");var a=br({},t.props),s=t.key,c=t.ref,d=t._owner;if(r!=null){if(r.ref!==void 0&&(c=r.ref,d=ot.current),r.key!==void 0&&(s=""+r.key),t.type&&t.type.defaultProps)var y=t.type.defaultProps;for(f in r)wr.call(r,f)&&!kr.hasOwnProperty(f)&&(a[f]=r[f]===void 0&&y!==void 0?y[f]:r[f])}var f=arguments.length-2;if(f===1)a.children=o;else if(1<f){y=Array(f);for(var h=0;h<f;h++)y[h]=arguments[h+2];a.children=y}return{$$typeof:ue,type:t.type,key:s,ref:c,props:a,_owner:d}};g.createContext=function(t){return t={$$typeof:yo,_currentValue:t,_currentValue2:t,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},t.Provider={$$typeof:po,_context:t},t.Consumer=t};g.createElement=Or;g.createFactory=function(t){var r=Or.bind(null,t);return r.type=t,r};g.createRef=function(){return{current:null}};g.forwardRef=function(t){return{$$typeof:ho,render:t}};g.isValidElement=at;g.lazy=function(t){return{$$typeof:go,_payload:{_status:-1,_result:t},_init:Eo}};g.memo=function(t,r){return{$$typeof:vo,type:t,compare:r===void 0?null:r}};g.startTransition=function(t){var r=Oe.transition;Oe.transition={};try{t()}finally{Oe.transition=r}};g.unstable_act=Pr;g.useCallback=function(t,r){return j.current.useCallback(t,r)};g.useContext=function(t){return j.current.useContext(t)};g.useDebugValue=function(){};g.useDeferredValue=function(t){return j.current.useDeferredValue(t)};g.useEffect=function(t,r){return j.current.useEffect(t,r)};g.useId=function(){return j.current.useId()};g.useImperativeHandle=function(t,r,o){return j.current.useImperativeHandle(t,r,o)};g.useInsertionEffect=function(t,r){return j.current.useInsertionEffect(t,r)};g.useLayoutEffect=function(t,r){return j.current.useLayoutEffect(t,r)};g.useMemo=function(t,r){return j.current.useMemo(t,r)};g.useReducer=function(t,r,o){return j.current.useReducer(t,r,o)};g.useRef=function(t){return j.current.useRef(t)};g.useState=function(t){return j.current.useState(t)};g.useSyncExternalStore=function(t,r,o){return j.current.useSyncExternalStore(t,r,o)};g.useTransition=function(){return j.current.useTransition()};g.version="18.3.1"});var xr=Ye((m,Pe)=>{"use strict";process.env.NODE_ENV!=="production"&&(function(){"use strict";typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var t="18.3.1",r=Symbol.for("react.element"),o=Symbol.for("react.portal"),a=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),c=Symbol.for("react.profiler"),d=Symbol.for("react.provider"),y=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),b=Symbol.for("react.suspense_list"),C=Symbol.for("react.memo"),R=Symbol.for("react.lazy"),U=Symbol.for("react.offscreen"),mt=Symbol.iterator,Nr="@@iterator";function Tt(e){if(e===null||typeof e!="object")return null;var n=mt&&e[mt]||e[Nr];return typeof n=="function"?n:null}var bt={current:null},V={transition:null},A={current:null,isBatchingLegacy:!1,didScheduleLegacyUpdate:!1},L={current:null},X={},ce=null;function Et(e){ce=e}X.setExtraStackFrame=function(e){ce=e},X.getCurrentStack=null,X.getStackAddendum=function(){var e="";ce&&(e+=ce);var n=X.getCurrentStack;return n&&(e+=n()||""),e};var Lr=!1,Mr=!1,Br=!1,Fr=!1,$r=!1,q={ReactCurrentDispatcher:bt,ReactCurrentBatchConfig:V,ReactCurrentOwner:L};q.ReactDebugCurrentFrame=X,q.ReactCurrentActQueue=A;function K(e){{for(var n=arguments.length,i=new Array(n>1?n-1:0),u=1;u<n;u++)i[u-1]=arguments[u];_t("warn",e,i)}}function E(e){{for(var n=arguments.length,i=new Array(n>1?n-1:0),u=1;u<n;u++)i[u-1]=arguments[u];_t("error",e,i)}}function _t(e,n,i){{var u=q.ReactDebugCurrentFrame,l=u.getStackAddendum();l!==""&&(n+="%s",i=i.concat([l]));var S=i.map(function(p){return String(p)});S.unshift("Warning: "+n),Function.prototype.apply.call(console[e],console,S)}}var wt={};function xe(e,n){{var i=e.constructor,u=i&&(i.displayName||i.name)||"ReactClass",l=u+"."+n;if(wt[l])return;E("Can't call %s on a component that is not yet mounted. This is a no-op, but it might indicate a bug in your application. Instead, assign to `this.state` directly or define a `state = {};` class property with the desired state in the %s component.",n,u),wt[l]=!0}}var kt={isMounted:function(e){return!1},enqueueForceUpdate:function(e,n,i){xe(e,"forceUpdate")},enqueueReplaceState:function(e,n,i,u){xe(e,"replaceState")},enqueueSetState:function(e,n,i,u){xe(e,"setState")}},M=Object.assign,Re={};Object.freeze(Re);function F(e,n,i){this.props=e,this.context=n,this.refs=Re,this.updater=i||kt}F.prototype.isReactComponent={},F.prototype.setState=function(e,n){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw new Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,n,"setState")},F.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};{var Ae={isMounted:["isMounted","Instead, make sure to clean up subscriptions and pending requests in componentWillUnmount to prevent memory leaks."],replaceState:["replaceState","Refactor your code to use setState instead (see https://github.com/facebook/react/issues/3236)."]},Ur=function(e,n){Object.defineProperty(F.prototype,e,{get:function(){K("%s(...) is deprecated in plain JavaScript React classes. %s",n[0],n[1])}})};for(var De in Ae)Ae.hasOwnProperty(De)&&Ur(De,Ae[De])}function Ot(){}Ot.prototype=F.prototype;function je(e,n,i){this.props=e,this.context=n,this.refs=Re,this.updater=i||kt}var Ie=je.prototype=new Ot;Ie.constructor=je,M(Ie,F.prototype),Ie.isPureReactComponent=!0;function Vr(){var e={current:null};return Object.seal(e),e}var qr=Array.isArray;function le(e){return qr(e)}function Kr(e){{var n=typeof Symbol=="function"&&Symbol.toStringTag,i=n&&e[Symbol.toStringTag]||e.constructor.name||"Object";return i}}function Hr(e){try{return Pt(e),!1}catch{return!0}}function Pt(e){return""+e}function fe(e){if(Hr(e))return E("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",Kr(e)),Pt(e)}function Wr(e,n,i){var u=e.displayName;if(u)return u;var l=n.displayName||n.name||"";return l!==""?i+"("+l+")":i}function Ct(e){return e.displayName||"Context"}function B(e){if(e==null)return null;if(typeof e.tag=="number"&&E("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case a:return"Fragment";case o:return"Portal";case c:return"Profiler";case s:return"StrictMode";case h:return"Suspense";case b:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case y:var n=e;return Ct(n)+".Consumer";case d:var i=e;return Ct(i._context)+".Provider";case f:return Wr(e,e.render,"ForwardRef");case C:var u=e.displayName||null;return u!==null?u:B(e.type)||"Memo";case R:{var l=e,S=l._payload,p=l._init;try{return B(p(S))}catch{return null}}}return null}var J=Object.prototype.hasOwnProperty,xt={key:!0,ref:!0,__self:!0,__source:!0},Rt,At,Ne;Ne={};function Dt(e){if(J.call(e,"ref")){var n=Object.getOwnPropertyDescriptor(e,"ref").get;if(n&&n.isReactWarning)return!1}return e.ref!==void 0}function jt(e){if(J.call(e,"key")){var n=Object.getOwnPropertyDescriptor(e,"key").get;if(n&&n.isReactWarning)return!1}return e.key!==void 0}function Yr(e,n){var i=function(){Rt||(Rt=!0,E("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",n))};i.isReactWarning=!0,Object.defineProperty(e,"key",{get:i,configurable:!0})}function zr(e,n){var i=function(){At||(At=!0,E("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",n))};i.isReactWarning=!0,Object.defineProperty(e,"ref",{get:i,configurable:!0})}function Gr(e){if(typeof e.ref=="string"&&L.current&&e.__self&&L.current.stateNode!==e.__self){var n=B(L.current.type);Ne[n]||(E('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',n,e.ref),Ne[n]=!0)}}var Le=function(e,n,i,u,l,S,p){var v={$$typeof:r,type:e,key:n,ref:i,props:p,_owner:S};return v._store={},Object.defineProperty(v._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(v,"_self",{configurable:!1,enumerable:!1,writable:!1,value:u}),Object.defineProperty(v,"_source",{configurable:!1,enumerable:!1,writable:!1,value:l}),Object.freeze&&(Object.freeze(v.props),Object.freeze(v)),v};function Xr(e,n,i){var u,l={},S=null,p=null,v=null,T=null;if(n!=null){Dt(n)&&(p=n.ref,Gr(n)),jt(n)&&(fe(n.key),S=""+n.key),v=n.__self===void 0?null:n.__self,T=n.__source===void 0?null:n.__source;for(u in n)J.call(n,u)&&!xt.hasOwnProperty(u)&&(l[u]=n[u])}var _=arguments.length-2;if(_===1)l.children=i;else if(_>1){for(var w=Array(_),k=0;k<_;k++)w[k]=arguments[k+2];Object.freeze&&Object.freeze(w),l.children=w}if(e&&e.defaultProps){var O=e.defaultProps;for(u in O)l[u]===void 0&&(l[u]=O[u])}if(S||p){var P=typeof e=="function"?e.displayName||e.name||"Unknown":e;S&&Yr(l,P),p&&zr(l,P)}return Le(e,S,p,v,T,L.current,l)}function Jr(e,n){var i=Le(e.type,n,e.ref,e._self,e._source,e._owner,e.props);return i}function Qr(e,n,i){if(e==null)throw new Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var u,l=M({},e.props),S=e.key,p=e.ref,v=e._self,T=e._source,_=e._owner;if(n!=null){Dt(n)&&(p=n.ref,_=L.current),jt(n)&&(fe(n.key),S=""+n.key);var w;e.type&&e.type.defaultProps&&(w=e.type.defaultProps);for(u in n)J.call(n,u)&&!xt.hasOwnProperty(u)&&(n[u]===void 0&&w!==void 0?l[u]=w[u]:l[u]=n[u])}var k=arguments.length-2;if(k===1)l.children=i;else if(k>1){for(var O=Array(k),P=0;P<k;P++)O[P]=arguments[P+2];l.children=O}return Le(e.type,S,p,v,T,_,l)}function H(e){return typeof e=="object"&&e!==null&&e.$$typeof===r}var It=".",Zr=":";function en(e){var n=/[=:]/g,i={"=":"=0",":":"=2"},u=e.replace(n,function(l){return i[l]});return"$"+u}var Nt=!1,tn=/\/+/g;function Lt(e){return e.replace(tn,"$&/")}function Me(e,n){return typeof e=="object"&&e!==null&&e.key!=null?(fe(e.key),en(""+e.key)):n.toString(36)}function de(e,n,i,u,l){var S=typeof e;(S==="undefined"||S==="boolean")&&(e=null);var p=!1;if(e===null)p=!0;else switch(S){case"string":case"number":p=!0;break;case"object":switch(e.$$typeof){case r:case o:p=!0}}if(p){var v=e,T=l(v),_=u===""?It+Me(v,0):u;if(le(T)){var w="";_!=null&&(w=Lt(_)+"/"),de(T,n,w,"",function(zn){return zn})}else T!=null&&(H(T)&&(T.key&&(!v||v.key!==T.key)&&fe(T.key),T=Jr(T,i+(T.key&&(!v||v.key!==T.key)?Lt(""+T.key)+"/":"")+_)),n.push(T));return 1}var k,O,P=0,x=u===""?It:u+Zr;if(le(e))for(var Te=0;Te<e.length;Te++)k=e[Te],O=x+Me(k,Te),P+=de(k,n,i,O,l);else{var We=Tt(e);if(typeof We=="function"){var sr=e;We===sr.entries&&(Nt||K("Using Maps as children is not supported. Use an array of keyed ReactElements instead."),Nt=!0);for(var Wn=We.call(sr),ur,Yn=0;!(ur=Wn.next()).done;)k=ur.value,O=x+Me(k,Yn++),P+=de(k,n,i,O,l)}else if(S==="object"){var cr=String(e);throw new Error("Objects are not valid as a React child (found: "+(cr==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":cr)+"). If you meant to render a collection of children, use an array instead.")}}return P}function pe(e,n,i){if(e==null)return e;var u=[],l=0;return de(e,u,"","",function(S){return n.call(i,S,l++)}),u}function rn(e){var n=0;return pe(e,function(){n++}),n}function nn(e,n,i){pe(e,function(){n.apply(this,arguments)},i)}function on(e){return pe(e,function(n){return n})||[]}function an(e){if(!H(e))throw new Error("React.Children.only expected to receive a single React element child.");return e}function sn(e){var n={$$typeof:y,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null};n.Provider={$$typeof:d,_context:n};var i=!1,u=!1,l=!1;{var S={$$typeof:y,_context:n};Object.defineProperties(S,{Provider:{get:function(){return u||(u=!0,E("Rendering <Context.Consumer.Provider> is not supported and will be removed in a future major release. Did you mean to render <Context.Provider> instead?")),n.Provider},set:function(p){n.Provider=p}},_currentValue:{get:function(){return n._currentValue},set:function(p){n._currentValue=p}},_currentValue2:{get:function(){return n._currentValue2},set:function(p){n._currentValue2=p}},_threadCount:{get:function(){return n._threadCount},set:function(p){n._threadCount=p}},Consumer:{get:function(){return i||(i=!0,E("Rendering <Context.Consumer.Consumer> is not supported and will be removed in a future major release. Did you mean to render <Context.Consumer> instead?")),n.Consumer}},displayName:{get:function(){return n.displayName},set:function(p){l||(K("Setting `displayName` on Context.Consumer has no effect. You should set it directly on the context with Context.displayName = '%s'.",p),l=!0)}}}),n.Consumer=S}return n._currentRenderer=null,n._currentRenderer2=null,n}var Q=-1,Be=0,Mt=1,un=2;function cn(e){if(e._status===Q){var n=e._result,i=n();if(i.then(function(S){if(e._status===Be||e._status===Q){var p=e;p._status=Mt,p._result=S}},function(S){if(e._status===Be||e._status===Q){var p=e;p._status=un,p._result=S}}),e._status===Q){var u=e;u._status=Be,u._result=i}}if(e._status===Mt){var l=e._result;return l===void 0&&E(`lazy: Expected the result of a dynamic import() call. Instead received: %s
2
+
3
+ Your code should look like:
4
+ const MyComponent = lazy(() => import('./MyComponent'))
5
+
6
+ Did you accidentally put curly braces around the import?`,l),"default"in l||E(`lazy: Expected the result of a dynamic import() call. Instead received: %s
7
+
8
+ Your code should look like:
9
+ const MyComponent = lazy(() => import('./MyComponent'))`,l),l.default}else throw e._result}function ln(e){var n={_status:Q,_result:e},i={$$typeof:R,_payload:n,_init:cn};{var u,l;Object.defineProperties(i,{defaultProps:{configurable:!0,get:function(){return u},set:function(S){E("React.lazy(...): It is not supported to assign `defaultProps` to a lazy component import. Either specify them where the component is defined, or create a wrapping component around it."),u=S,Object.defineProperty(i,"defaultProps",{enumerable:!0})}},propTypes:{configurable:!0,get:function(){return l},set:function(S){E("React.lazy(...): It is not supported to assign `propTypes` to a lazy component import. Either specify them where the component is defined, or create a wrapping component around it."),l=S,Object.defineProperty(i,"propTypes",{enumerable:!0})}}})}return i}function fn(e){e!=null&&e.$$typeof===C?E("forwardRef requires a render function but received a `memo` component. Instead of forwardRef(memo(...)), use memo(forwardRef(...))."):typeof e!="function"?E("forwardRef requires a render function but was given %s.",e===null?"null":typeof e):e.length!==0&&e.length!==2&&E("forwardRef render functions accept exactly two parameters: props and ref. %s",e.length===1?"Did you forget to use the ref parameter?":"Any additional parameter will be undefined."),e!=null&&(e.defaultProps!=null||e.propTypes!=null)&&E("forwardRef render functions do not support propTypes or defaultProps. Did you accidentally pass a React component?");var n={$$typeof:f,render:e};{var i;Object.defineProperty(n,"displayName",{enumerable:!1,configurable:!0,get:function(){return i},set:function(u){i=u,!e.name&&!e.displayName&&(e.displayName=u)}})}return n}var Bt;Bt=Symbol.for("react.module.reference");function Ft(e){return!!(typeof e=="string"||typeof e=="function"||e===a||e===c||$r||e===s||e===h||e===b||Fr||e===U||Lr||Mr||Br||typeof e=="object"&&e!==null&&(e.$$typeof===R||e.$$typeof===C||e.$$typeof===d||e.$$typeof===y||e.$$typeof===f||e.$$typeof===Bt||e.getModuleId!==void 0))}function dn(e,n){Ft(e)||E("memo: The first argument must be a component. Instead received: %s",e===null?"null":typeof e);var i={$$typeof:C,type:e,compare:n===void 0?null:n};{var u;Object.defineProperty(i,"displayName",{enumerable:!1,configurable:!0,get:function(){return u},set:function(l){u=l,!e.name&&!e.displayName&&(e.displayName=l)}})}return i}function D(){var e=bt.current;return e===null&&E(`Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
10
+ 1. You might have mismatching versions of React and the renderer (such as React DOM)
11
+ 2. You might be breaking the Rules of Hooks
12
+ 3. You might have more than one copy of React in the same app
13
+ See https://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem.`),e}function pn(e){var n=D();if(e._context!==void 0){var i=e._context;i.Consumer===e?E("Calling useContext(Context.Consumer) is not supported, may cause bugs, and will be removed in a future major release. Did you mean to call useContext(Context) instead?"):i.Provider===e&&E("Calling useContext(Context.Provider) is not supported. Did you mean to call useContext(Context) instead?")}return n.useContext(e)}function yn(e){var n=D();return n.useState(e)}function hn(e,n,i){var u=D();return u.useReducer(e,n,i)}function Sn(e){var n=D();return n.useRef(e)}function vn(e,n){var i=D();return i.useEffect(e,n)}function gn(e,n){var i=D();return i.useInsertionEffect(e,n)}function mn(e,n){var i=D();return i.useLayoutEffect(e,n)}function Tn(e,n){var i=D();return i.useCallback(e,n)}function bn(e,n){var i=D();return i.useMemo(e,n)}function En(e,n,i){var u=D();return u.useImperativeHandle(e,n,i)}function _n(e,n){{var i=D();return i.useDebugValue(e,n)}}function wn(){var e=D();return e.useTransition()}function kn(e){var n=D();return n.useDeferredValue(e)}function On(){var e=D();return e.useId()}function Pn(e,n,i){var u=D();return u.useSyncExternalStore(e,n,i)}var Z=0,$t,Ut,Vt,qt,Kt,Ht,Wt;function Yt(){}Yt.__reactDisabledLog=!0;function Cn(){{if(Z===0){$t=console.log,Ut=console.info,Vt=console.warn,qt=console.error,Kt=console.group,Ht=console.groupCollapsed,Wt=console.groupEnd;var e={configurable:!0,enumerable:!0,value:Yt,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}Z++}}function xn(){{if(Z--,Z===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:M({},e,{value:$t}),info:M({},e,{value:Ut}),warn:M({},e,{value:Vt}),error:M({},e,{value:qt}),group:M({},e,{value:Kt}),groupCollapsed:M({},e,{value:Ht}),groupEnd:M({},e,{value:Wt})})}Z<0&&E("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var Fe=q.ReactCurrentDispatcher,$e;function ye(e,n,i){{if($e===void 0)try{throw Error()}catch(l){var u=l.stack.trim().match(/\n( *(at )?)/);$e=u&&u[1]||""}return`
14
+ `+$e+e}}var Ue=!1,he;{var Rn=typeof WeakMap=="function"?WeakMap:Map;he=new Rn}function zt(e,n){if(!e||Ue)return"";{var i=he.get(e);if(i!==void 0)return i}var u;Ue=!0;var l=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var S;S=Fe.current,Fe.current=null,Cn();try{if(n){var p=function(){throw Error()};if(Object.defineProperty(p.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(p,[])}catch(x){u=x}Reflect.construct(e,[],p)}else{try{p.call()}catch(x){u=x}e.call(p.prototype)}}else{try{throw Error()}catch(x){u=x}e()}}catch(x){if(x&&u&&typeof x.stack=="string"){for(var v=x.stack.split(`
15
+ `),T=u.stack.split(`
16
+ `),_=v.length-1,w=T.length-1;_>=1&&w>=0&&v[_]!==T[w];)w--;for(;_>=1&&w>=0;_--,w--)if(v[_]!==T[w]){if(_!==1||w!==1)do if(_--,w--,w<0||v[_]!==T[w]){var k=`
17
+ `+v[_].replace(" at new "," at ");return e.displayName&&k.includes("<anonymous>")&&(k=k.replace("<anonymous>",e.displayName)),typeof e=="function"&&he.set(e,k),k}while(_>=1&&w>=0);break}}}finally{Ue=!1,Fe.current=S,xn(),Error.prepareStackTrace=l}var O=e?e.displayName||e.name:"",P=O?ye(O):"";return typeof e=="function"&&he.set(e,P),P}function An(e,n,i){return zt(e,!1)}function Dn(e){var n=e.prototype;return!!(n&&n.isReactComponent)}function Se(e,n,i){if(e==null)return"";if(typeof e=="function")return zt(e,Dn(e));if(typeof e=="string")return ye(e);switch(e){case h:return ye("Suspense");case b:return ye("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case f:return An(e.render);case C:return Se(e.type,n,i);case R:{var u=e,l=u._payload,S=u._init;try{return Se(S(l),n,i)}catch{}}}return""}var Gt={},Xt=q.ReactDebugCurrentFrame;function ve(e){if(e){var n=e._owner,i=Se(e.type,e._source,n?n.type:null);Xt.setExtraStackFrame(i)}else Xt.setExtraStackFrame(null)}function jn(e,n,i,u,l){{var S=Function.call.bind(J);for(var p in e)if(S(e,p)){var v=void 0;try{if(typeof e[p]!="function"){var T=Error((u||"React class")+": "+i+" type `"+p+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[p]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw T.name="Invariant Violation",T}v=e[p](n,p,u,i,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(_){v=_}v&&!(v instanceof Error)&&(ve(l),E("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",u||"React class",i,p,typeof v),ve(null)),v instanceof Error&&!(v.message in Gt)&&(Gt[v.message]=!0,ve(l),E("Failed %s type: %s",i,v.message),ve(null))}}}function W(e){if(e){var n=e._owner,i=Se(e.type,e._source,n?n.type:null);Et(i)}else Et(null)}var Ve;Ve=!1;function Jt(){if(L.current){var e=B(L.current.type);if(e)return`
18
+
19
+ Check the render method of \``+e+"`."}return""}function In(e){if(e!==void 0){var n=e.fileName.replace(/^.*[\\\/]/,""),i=e.lineNumber;return`
20
+
21
+ Check your code at `+n+":"+i+"."}return""}function Nn(e){return e!=null?In(e.__source):""}var Qt={};function Ln(e){var n=Jt();if(!n){var i=typeof e=="string"?e:e.displayName||e.name;i&&(n=`
22
+
23
+ Check the top-level render call using <`+i+">.")}return n}function Zt(e,n){if(!(!e._store||e._store.validated||e.key!=null)){e._store.validated=!0;var i=Ln(n);if(!Qt[i]){Qt[i]=!0;var u="";e&&e._owner&&e._owner!==L.current&&(u=" It was passed a child from "+B(e._owner.type)+"."),W(e),E('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',i,u),W(null)}}}function er(e,n){if(typeof e=="object"){if(le(e))for(var i=0;i<e.length;i++){var u=e[i];H(u)&&Zt(u,n)}else if(H(e))e._store&&(e._store.validated=!0);else if(e){var l=Tt(e);if(typeof l=="function"&&l!==e.entries)for(var S=l.call(e),p;!(p=S.next()).done;)H(p.value)&&Zt(p.value,n)}}}function tr(e){{var n=e.type;if(n==null||typeof n=="string")return;var i;if(typeof n=="function")i=n.propTypes;else if(typeof n=="object"&&(n.$$typeof===f||n.$$typeof===C))i=n.propTypes;else return;if(i){var u=B(n);jn(i,e.props,"prop",u,e)}else if(n.PropTypes!==void 0&&!Ve){Ve=!0;var l=B(n);E("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",l||"Unknown")}typeof n.getDefaultProps=="function"&&!n.getDefaultProps.isReactClassApproved&&E("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Mn(e){{for(var n=Object.keys(e.props),i=0;i<n.length;i++){var u=n[i];if(u!=="children"&&u!=="key"){W(e),E("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",u),W(null);break}}e.ref!==null&&(W(e),E("Invalid attribute `ref` supplied to `React.Fragment`."),W(null))}}function rr(e,n,i){var u=Ft(e);if(!u){var l="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(l+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var S=Nn(n);S?l+=S:l+=Jt();var p;e===null?p="null":le(e)?p="array":e!==void 0&&e.$$typeof===r?(p="<"+(B(e.type)||"Unknown")+" />",l=" Did you accidentally export a JSX literal instead of a component?"):p=typeof e,E("React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",p,l)}var v=Xr.apply(this,arguments);if(v==null)return v;if(u)for(var T=2;T<arguments.length;T++)er(arguments[T],e);return e===a?Mn(v):tr(v),v}var nr=!1;function Bn(e){var n=rr.bind(null,e);return n.type=e,nr||(nr=!0,K("React.createFactory() is deprecated and will be removed in a future major release. Consider using JSX or use React.createElement() directly instead.")),Object.defineProperty(n,"type",{enumerable:!1,get:function(){return K("Factory.type is deprecated. Access the class directly before passing it to createFactory."),Object.defineProperty(this,"type",{value:e}),e}}),n}function Fn(e,n,i){for(var u=Qr.apply(this,arguments),l=2;l<arguments.length;l++)er(arguments[l],u.type);return tr(u),u}function $n(e,n){var i=V.transition;V.transition={};var u=V.transition;V.transition._updatedFibers=new Set;try{e()}finally{if(V.transition=i,i===null&&u._updatedFibers){var l=u._updatedFibers.size;l>10&&K("Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table."),u._updatedFibers.clear()}}}var or=!1,ge=null;function Un(e){if(ge===null)try{var n=("require"+Math.random()).slice(0,7),i=Pe&&Pe[n];ge=i.call(Pe,"timers").setImmediate}catch{ge=function(l){or===!1&&(or=!0,typeof MessageChannel>"u"&&E("This browser does not have a MessageChannel implementation, so enqueuing tasks via await act(async () => ...) will fail. Please file an issue at https://github.com/facebook/react/issues if you encounter this warning."));var S=new MessageChannel;S.port1.onmessage=l,S.port2.postMessage(void 0)}}return ge(e)}var Y=0,ar=!1;function ir(e){{var n=Y;Y++,A.current===null&&(A.current=[]);var i=A.isBatchingLegacy,u;try{if(A.isBatchingLegacy=!0,u=e(),!i&&A.didScheduleLegacyUpdate){var l=A.current;l!==null&&(A.didScheduleLegacyUpdate=!1,He(l))}}catch(O){throw me(n),O}finally{A.isBatchingLegacy=i}if(u!==null&&typeof u=="object"&&typeof u.then=="function"){var S=u,p=!1,v={then:function(O,P){p=!0,S.then(function(x){me(n),Y===0?qe(x,O,P):O(x)},function(x){me(n),P(x)})}};return!ar&&typeof Promise<"u"&&Promise.resolve().then(function(){}).then(function(){p||(ar=!0,E("You called act(async () => ...) without await. This could lead to unexpected testing behaviour, interleaving multiple act calls and mixing their scopes. You should - await act(async () => ...);"))}),v}else{var T=u;if(me(n),Y===0){var _=A.current;_!==null&&(He(_),A.current=null);var w={then:function(O,P){A.current===null?(A.current=[],qe(T,O,P)):O(T)}};return w}else{var k={then:function(O,P){O(T)}};return k}}}}function me(e){e!==Y-1&&E("You seem to have overlapping act() calls, this is not supported. Be sure to await previous act() calls before making a new one. "),Y=e}function qe(e,n,i){{var u=A.current;if(u!==null)try{He(u),Un(function(){u.length===0?(A.current=null,n(e)):qe(e,n,i)})}catch(l){i(l)}else n(e)}}var Ke=!1;function He(e){if(!Ke){Ke=!0;var n=0;try{for(;n<e.length;n++){var i=e[n];do i=i(!0);while(i!==null)}e.length=0}catch(u){throw e=e.slice(n+1),u}finally{Ke=!1}}}var Vn=rr,qn=Fn,Kn=Bn,Hn={map:pe,forEach:nn,count:rn,toArray:on,only:an};m.Children=Hn,m.Component=F,m.Fragment=a,m.Profiler=c,m.PureComponent=je,m.StrictMode=s,m.Suspense=h,m.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=q,m.act=ir,m.cloneElement=qn,m.createContext=sn,m.createElement=Vn,m.createFactory=Kn,m.createRef=Vr,m.forwardRef=fn,m.isValidElement=H,m.lazy=ln,m.memo=dn,m.startTransition=$n,m.unstable_act=ir,m.useCallback=Tn,m.useContext=pn,m.useDebugValue=_n,m.useDeferredValue=kn,m.useEffect=vn,m.useId=On,m.useImperativeHandle=En,m.useInsertionEffect=gn,m.useLayoutEffect=mn,m.useMemo=bn,m.useReducer=hn,m.useRef=Sn,m.useState=yn,m.useSyncExternalStore=Pn,m.useTransition=wn,m.version=t,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)})()});var Rr=Ye((oa,it)=>{"use strict";process.env.NODE_ENV==="production"?it.exports=Cr():it.exports=xr()});var Po={};eo(Po,{StoreError:()=>se,StoreErrorCode:()=>Ee,batch:()=>Sr,createStorage:()=>ct,createStore:()=>_e,deepClone:()=>N,deepEqual:()=>ee,deepMerge:()=>z,devtools:()=>lt,hasHistory:()=>dt,history:()=>ft,identity:()=>oe,immer:()=>vt,isFunction:()=>te,omit:()=>ne,persist:()=>ut,pick:()=>re,produce:()=>Ce,selector:()=>gt,sessionStorage:()=>st,shallowEqual:()=>$,sync:()=>pt,triggerSync:()=>yt,useAction:()=>jr,useCreateStore:()=>Dr,useStore:()=>Ar});function N(t,r){if(t===null||typeof t!="object")return t;if(t instanceof Date)return new Date(t.getTime());if(r||(r=new WeakMap),r.has(t))return r.get(t);if(r.set(t,t),Array.isArray(t)){let o=[];return r.set(t,o),t.forEach((a,s)=>{o[s]=N(a,r)}),o}if(t.constructor===Object){let o={};r.set(t,o);for(let a in t)Object.prototype.hasOwnProperty.call(t,a)&&(o[a]=N(t[a],r));return o}return t}function ee(t,r){if(Object.is(t,r))return!0;if(t===null||r===null||typeof t!="object"||typeof r!="object"||Array.isArray(t)!==Array.isArray(r))return!1;if(Array.isArray(t)){let s=r;if(t.length!==s.length)return!1;for(let c=0;c<t.length;c++)if(!ee(t[c],s[c]))return!1;return!0}let o=Object.keys(t),a=Object.keys(r);if(o.length!==a.length)return!1;for(let s of o)if(!Object.prototype.hasOwnProperty.call(r,s)||!ee(t[s],r[s]))return!1;return!0}function $(t,r){if(Object.is(t,r))return!0;if(typeof t!="object"||t===null||typeof r!="object"||r===null)return!1;let o=Object.keys(t),a=Object.keys(r);if(o.length!==a.length)return!1;for(let s of o)if(!a.includes(s)||!Object.is(t[s],r[s]))return!1;return!0}function z(t,r){if(r===null)return t;if(typeof r!="object")return r;let o=N(t);for(let a in r)if(Object.prototype.hasOwnProperty.call(r,a)){let s=r[a],c=o[a];if(s instanceof Date){o[a]=new Date(s.getTime());continue}s!==null&&typeof s=="object"&&!Array.isArray(s)&&!(s instanceof Date)&&c!==null&&typeof c=="object"&&!Array.isArray(c)&&!(c instanceof Date)?o[a]=z(c,s):o[a]=ze(s)}return o}function ze(t){if(t===null||typeof t!="object")return t;if(t instanceof Date)return new Date(t.getTime());if(Array.isArray(t))return t.map(r=>ze(r));if(t.constructor===Object){let r={};for(let o in t)Object.prototype.hasOwnProperty.call(t,o)&&(r[o]=ze(t[o]));return r}return t}function te(t){return typeof t=="function"}function re(t,r){let o={};for(let a of r)Object.prototype.hasOwnProperty.call(t,a)&&(o[a]=t[a]);return o}function ne(t,r){let o={...t};for(let a of r)delete o[a];return o}function oe(t){return t}var Ge=class{listeners=new Map;on(r,o){return this.listeners.has(r)||this.listeners.set(r,new Set),this.listeners.get(r).add(o),()=>{this.listeners.get(r)?.delete(o)}}emit(r,o){let a=this.listeners.get(r);if(a)for(let s of a)try{s(o)}catch(c){console.error(`Error in ${r} handler:`,c)}}destroy(){this.listeners.clear()}},Xe=class{plugins=new Map;eventBus=new Ge;config;errorHandlers=new Set;initializing=!1;constructor(r){this.config=r||{}}register(r,o,a){if(!r.name||!r.version||typeof r.install!="function")throw new Error("Invalid plugin: must have name, version, and install function");if(this.plugins.has(r.name))throw new Error(`Plugin '${r.name}' is already registered`);if(r.dependencies){for(let c of r.dependencies)if(!this.plugins.has(c))throw new Error(`Plugin '${r.name}' requires '${c}' to be registered first`)}let s={plugin:r,options:o};try{r.install(a,o)}catch(c){throw new Error(`Failed to install plugin '${r.name}': ${c}`)}this.plugins.set(r.name,s),!this.initializing&&r.onInit&&this.runOnInit(r,a)}async initializeAll(r){this.initializing=!0;let o=Array.from(this.plugins.values());for(let{plugin:a}of o)a.onInit&&await this.runOnInit(a,r);this.initializing=!1}async runOnInit(r,o){try{await r.onInit(o)}catch(a){console.error(`Error in ${r.name} onInit:`,a)}}async unregister(r){let o=this.plugins.get(r);if(o){if(o.plugin.onDestroy)try{await o.plugin.onDestroy()}catch(a){console.error(`Error in ${r} onDestroy:`,a)}this.plugins.delete(r)}}emitStateChange(r,o){this.eventBus.emit("stateChange",{state:r,prevState:o});for(let{plugin:a}of this.plugins.values())if(a.onStateChange)try{a.onStateChange(r,o)}catch(s){console.error(`Error in ${a.name} onStateChange:`,s)}}emitError(r){this.eventBus.emit("error",r);for(let{plugin:o}of this.plugins.values())if(o.onError)try{o.onError(r)}catch(a){console.error(`Error in ${o.name} onError:`,a)}for(let o of this.errorHandlers)try{o(r)}catch(a){console.error("Error in error handler:",a)}}onError(r){return this.errorHandlers.add(r),()=>{this.errorHandlers.delete(r)}}on(r,o){return this.eventBus.on(r,o)}async destroy(){let r=Array.from(this.plugins.keys());for(let o of r)await this.unregister(o);this.eventBus.destroy(),this.errorHandlers.clear()}};function fr(t){return new Xe(t)}var ae=0,Je=new Set,ie=new Set;function no(){return ae>0}function dr(){return ae}function oo(){return++ae}function pr(){return--ae}function yr(){return ie}function hr(){Je.clear(),ie.clear()}function ao(t){Je.add(t)}function io(t){ie.add(t)}function so(t){return ie.has(t)}var Qe={get depth(){return ae},get stores(){return Je},get managedStores(){return ie},isBatching:no,batch(t,r){let o=so(t);oo(),ao(t),!o&&"beginBatch"in t&&(t.beginBatch(),io(t));try{let a=r();if(pr(),dr()===0){for(let s of yr())"flushNotifications"in s&&s.flushNotifications(),"endBatch"in s&&s.endBatch();hr()}return a}catch(a){if(pr(),dr()===0){for(let s of yr())"endBatch"in s&&s.endBatch();hr()}throw a}}};var Ee=(c=>(c.STORE_DESTROYED="STORE_DESTROYED",c.PLUGIN_EXISTS="PLUGIN_EXISTS",c.PLUGIN_DEPENDENCY_MISSING="PLUGIN_DEPENDENCY_MISSING",c.INVALID_STATE_UPDATE="INVALID_STATE_UPDATE",c.ACTION_ERROR="ACTION_ERROR",c))(Ee||{}),se=class extends Error{constructor(o,a){super(a);this.code=o;this.name="StoreError"}};var Ze=class{state;initialState;listeners=new Set;selectorSubscriptions=new Map;kernel;destroyed=!1;batchDepth=0;pendingNotify=!1;queuedState=null;queuedPrevState=null;actions={};constructor(r,o){this.state=N(r),this.initialState=N(r),this.kernel=o,this.kernel.onError(a=>{console.error("Store error:",a)})}getState(){return this.checkNotDestroyed(),this.state}setState(r){this.checkNotDestroyed();let o=this.state,a=typeof r=="function"?r(this.state):r;this.state={...this.state,...a},this.notifyOrQueue(this.state,o)}merge(r){this.checkNotDestroyed();let o=this.state;this.state=z(this.state,r),this.notifyOrQueue(this.state,o)}reset(){this.checkNotDestroyed();let r=this.state;this.state=N(this.initialState),this.notifyOrQueue(this.state,r)}subscribe(r,o,a){if(this.checkNotDestroyed(),o===void 0&&typeof r=="function"){let f=r;return this.listeners.add(f),()=>{this.listeners.delete(f)}}let s=r,c=o,d=a||$,y=this.selectorSubscriptions.get(s);return y||(y={value:s(this.state),listeners:new Set,selector:s,equalityFn:d},this.selectorSubscriptions.set(s,y)),y.listeners.add(c),()=>{let f=this.selectorSubscriptions.get(s);f&&(f.listeners.delete(c),f.listeners.size===0&&this.selectorSubscriptions.delete(s))}}use(r,o){return this.checkNotDestroyed(),this.kernel.register(r,o,this),this}destroy(){this.destroyed||(this.destroyed=!0,this.kernel.destroy(),this.listeners.clear(),this.selectorSubscriptions.clear(),this.actions={})}addAction(r,o){return this.actions[r]=o,this}getActions(){return this.actions}checkNotDestroyed(){if(this.destroyed)throw new Error("Cannot use destroyed store")}notifyOrQueue(r,o){let a=Qe.isBatching();if(a){let s=Qe.managedStores;s.has(this)||s.add(this)}this.batchDepth>0||a?(this.queuedState=r,this.pendingNotify||(this.queuedPrevState=o),this.pendingNotify=!0):this.notify(r,o)}notify(r,o){this.kernel.emitStateChange(r,o);for(let a of this.listeners)try{a(r,o)}catch(s){this.kernel.emitError(s)}for(let a of this.selectorSubscriptions.values()){let s=a.selector(r);if(!a.equalityFn(s,a.value)){let c=a.value;a.value=s;for(let d of a.listeners)try{d(s,c)}catch(y){this.kernel.emitError(y)}}}}flushNotifications(){this.pendingNotify&&(this.notify(this.queuedState,this.queuedPrevState),this.pendingNotify=!1,this.queuedState=null,this.queuedPrevState=null)}beginBatch(){this.batchDepth++}endBatch(){this.batchDepth--,this.batchDepth===0&&this.flushNotifications()}},et=class{store;constructor(r,o){this.store=new Ze(r,o)}getState(){return this.store.getState()}setState(r){this.store.setState(r)}merge(r){this.store.merge(r)}reset(){this.store.reset()}subscribe(r,o,a){return o===void 0?this.store.subscribe(r):this.store.subscribe(r,o,a)}use(r,o){return this.store.use(r,o),this}destroy(){this.store.destroy()}action(r,o){return this.store.addAction(r,o),this[r]=(...a)=>{let s=this.getState(),c=o(s,...a);return c instanceof Promise?c.then(d=>(this.setState(d),d)):(this.setState(c),c)},this}addAction(r,o){return this.store.addAction(r,o),this}getActions(){return this.store.getActions()}beginBatch(){this.store.beginBatch()}endBatch(){this.store.endBatch()}flushNotifications(){this.store.flushNotifications()}};function _e(t,r){let o=fr({name:"store"}),a={...t},s={};for(let f in a)te(a[f])&&f.startsWith("$")&&(s[f.substring(1)]=a[f],delete a[f]);let c={...s,...r},d=new et(a,o);if(c)for(let[f,h]of Object.entries(c))d.addAction(f,h);let y=d.getActions();for(let[f,h]of Object.entries(y))d[f]=(...b)=>{let C=d.getState(),R=h(C,...b);return R instanceof Promise?R.then(U=>(d.setState(U),U)):(d.setState(R),R)};return o.initializeAll(d).catch(f=>{console.error("Error initializing plugins:",f)}),new Proxy(d,{get(f,h){if(h in f)return f[h];let b=f.store;if(b&&typeof b[h]=="function")return b[h].bind(b);if(b&&h in b)return b[h]},set(f,h,b){if(h in f||typeof b=="function")return f[h]=b,!0;let C=f.store;return C?(C[h]=b,!0):!1}})}function Sr(t){return t()}var I=to(Rr(),1);function Ar(t,r=oe,o=$){let a=(0,I.useRef)(r),s=(0,I.useRef)(o),c=(0,I.useRef)(t);a.current!==r&&(a.current=r),s.current!==o&&(s.current=o),c.current!==t&&(c.current=t);let d=()=>{let b=c.current.getState();return a.current(b)},h=(0,I.useSyncExternalStore)(b=>c.current.subscribe(R=>a.current(R),(R,U)=>{s.current(R,U)||b()},s.current),d,d);return(0,I.useDebugValue)(h),h}function Dr(t){let r=(0,I.useRef)();return r.current===void 0&&(r.current=_e(t)),(0,I.useEffect)(()=>()=>{r.current&&(r.current.destroy(),r.current=void 0)},[]),r.current}function jr(t,r){let o=(0,I.useRef)(t);o.current!==t&&(o.current=t);let a=o.current[r],s=(0,I.useRef)(a);return s.current!==a&&(s.current=a),s.current}var wo={getItem:t=>{if(typeof window>"u")return null;try{return window.localStorage.getItem(t)}catch{return null}},setItem:(t,r)=>{if(!(typeof window>"u"))try{window.localStorage.setItem(t,r)}catch{}},removeItem:()=>{}},st={getItem:t=>{if(typeof window>"u")return null;try{return window.sessionStorage.getItem(t)}catch{return null}},setItem:(t,r)=>{if(!(typeof window>"u"))try{window.sessionStorage.setItem(t,r)}catch{}},removeItem:t=>{if(!(typeof window>"u"))try{window.sessionStorage.removeItem(t)}catch{}}};function ut(t){let{key:r,storage:o=wo,whitelist:a,blacklist:s}=t;return{name:"persist",version:"1.0.0",install(c){try{let d=o.getItem(r);if(d){let y=JSON.parse(d);c.merge(y)}}catch(d){console.error(`Failed to hydrate state from '${r}':`,d)}c.subscribe(d=>{try{let y=d;a?y=re(d,a):s&&(y=ne(d,s)),o.setItem(r,JSON.stringify(y))}catch(y){console.error(`Failed to persist state to '${r}':`,y)}})},onDestroy(){}}}function ct(t){return t}function ko(){return typeof window<"u"&&!!window.__REDUX_DEVTOOLS_EXTENSION__}function Oo(){return typeof window>"u"?null:window.__REDUX_DEVTOOLS_EXTENSION__||null}function lt(t={}){let{name:r="OxogState Store",enabled:o=!0,maxAge:a=50}=t,s=null,c=[];return{name:"devtools",version:"1.0.0",install(d){if(!o||!ko())return;let y=Oo();y&&(s=y.connect({name:r}),s.init(d.getState()),d.subscribe((f,h)=>{s&&(c.push({state:f,action:"UPDATE"}),c.length>a&&c.shift(),s.send({type:"UPDATE",prev:h},f))}),s.subscribe(f=>{if(f.type==="DISPATCH"&&f.payload)switch(f.payload.type){case"JUMP_TO_STATE":case"JUMP_TO_ACTION":{let h=f.payload.type==="JUMP_TO_ACTION"?c.findIndex(b=>b.action===f.payload.action):f.payload.index;if(h>=0&&h<c.length){let b=c[h];b&&d.setState(b.state)}break}case"COMMIT":{s.init(d.getState()),c=[];break}case"ROLLBACK":{if(c.length>1){let h=c[c.length-2];h&&d.setState(h.state)}break}case"RESET":{d.reset();break}}}))},onDestroy(){s=null,c=[]}}}function ft(t={}){let{limit:r=50,keys:o}=t,a=null,s=null,c=!1;return{name:"history",version:"1.0.0",install(d){s=d,a={past:[],present:d.getState(),future:[]},d.subscribe(y=>{if(!a||c)return;let f=a.present,h=y,b=!0;o&&o.length>0?b=o.some(C=>f[C]!==h[C]):b=f!==h,b&&(a.past.push(f),a.past.length>r&&a.past.shift(),a.present=h,a.future=[])}),d.undo=()=>{if(!a||a.past.length===0)return;let y=a.past.pop();a.future.push(a.present),a.present=y,c=!0,d.setState(y),c=!1},d.redo=()=>{if(!a||a.future.length===0)return;let y=a.future.pop();a.past.push(a.present),a.present=y,c=!0,d.setState(y),c=!1},d.clearHistory=()=>{a&&(a.past=[],a.future=[])},d.canUndo=()=>a!==null&&a.past.length>0,d.canRedo=()=>a!==null&&a.future.length>0},onDestroy(){a=null,s=null}}}function dt(t){return typeof t.undo=="function"&&typeof t.redo=="function"}function pt(t={}){let{channel:r="oxog-state"}=t,o=null,a=null,s=!1;return{name:"sync",version:"1.0.0",install(c){if(a=c,typeof BroadcastChannel>"u"){console.warn("BroadcastChannel is not supported in this environment");return}o=new BroadcastChannel(r),o.onmessage=d=>{if(!s)try{c.setState(d.data)}catch(y){console.error("Error applying sync state:",y)}}},onInit(){if(o&&a){s=!0;try{o.postMessage(a.getState())}catch(c){console.error("Error broadcasting initial state:",c)}s=!1}},onDestroy(){o&&(o.close(),o=null),a=null}}}function yt(t,r="oxog-state"){if(typeof BroadcastChannel>"u"){console.warn("BroadcastChannel is not supported in this environment");return}let o=new BroadcastChannel(r);o.postMessage(t.getState()),o.close()}function ht(t,r){return new Proxy(t||{},{get(o,a){let s=o[a];return s!==null&&typeof s=="object"&&!Array.isArray(s)?r.has(s)?ht(r.get(s),r):ht(s,r):s},set(o,a,s){r.has(o)||r.set(o,{...o});let c=r.get(o);return c[a]=s,!0},deleteProperty(o,a){r.has(o)||r.set(o,{...o});let s=r.get(o);return delete s[a],!0}})}function Ir(t,r){if(!r.has(t))return St(t);let o=r.get(t);for(let a in o)if(Object.prototype.hasOwnProperty.call(o,a)){let s=o[a];s!==null&&typeof s=="object"&&!Array.isArray(s)&&(o[a]=Ir(s,r))}return o}function St(t){if(t===null||typeof t!="object")return t;if(Array.isArray(t))return t.map(o=>St(o));let r={};for(let o in t)Object.prototype.hasOwnProperty.call(t,o)&&(r[o]=St(t[o]));return r}function Ce(t,r){let o=new Map,a=ht(t,o);return r(a),Ir(t,o)}function vt(){return{name:"immer",version:"1.0.0",install(t){let r=t.setState.bind(t);t.setState=o=>{if(typeof o=="function"){let a=Ce(t.getState(),o);r(a)}else r(o)}}}}function gt(t){let{selectors:r}=t;return{name:"selector",version:"1.0.0",install(o){let a=o.getState.bind(o),s=new Map,c=new Proxy({},{get(d,y){let f=r[y];if(f){let h=a(),b=y,C=s.get(b);if(C&&C.state===h)return C.value;let R=f(h);return s.set(b,{value:R,state:h}),R}return a()[y]}});o.getState=()=>c,o.subscribe(()=>{s.clear()})}}}return ro(Po);})();
24
+ /*! Bundled license information:
25
+
26
+ react/cjs/react.production.min.js:
27
+ (**
28
+ * @license React
29
+ * react.production.min.js
30
+ *
31
+ * Copyright (c) Facebook, Inc. and its affiliates.
32
+ *
33
+ * This source code is licensed under the MIT license found in the
34
+ * LICENSE file in the root directory of this source tree.
35
+ *)
36
+
37
+ react/cjs/react.development.js:
38
+ (**
39
+ * @license React
40
+ * react.development.js
41
+ *
42
+ * Copyright (c) Facebook, Inc. and its affiliates.
43
+ *
44
+ * This source code is licensed under the MIT license found in the
45
+ * LICENSE file in the root directory of this source tree.
46
+ *)
47
+ */