@yakocloud/state-vocab 1.0.1
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 +273 -0
- package/dist/state-vocab.cjs.js +14 -0
- package/dist/state-vocab.es.js +786 -0
- package/package.json +34 -0
package/README.md
ADDED
|
@@ -0,0 +1,273 @@
|
|
|
1
|
+
# state-vocab
|
|
2
|
+
|
|
3
|
+
A lightweight React state management library that synchronizes component state with any `Storage`-compatible (localStorage, sessionStorage, custom).
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install state-vocab
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Quick Start
|
|
12
|
+
|
|
13
|
+
```tsx
|
|
14
|
+
import { setupStorage, defineState, StorageProvider } from 'state-vocab'
|
|
15
|
+
|
|
16
|
+
const storage = setupStorage({
|
|
17
|
+
path: {
|
|
18
|
+
to: {
|
|
19
|
+
theme: defineState<'Dark' | 'White' | 'System'>({
|
|
20
|
+
storage: localStorage,
|
|
21
|
+
defaultValue: 'Dark',
|
|
22
|
+
})
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
})
|
|
26
|
+
|
|
27
|
+
function App() {
|
|
28
|
+
return (
|
|
29
|
+
<StorageProvider>
|
|
30
|
+
<Settings />
|
|
31
|
+
</StorageProvider>
|
|
32
|
+
)
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
function Settings() {
|
|
36
|
+
const [theme, setTheme] = storage.path.to.theme.useState()
|
|
37
|
+
|
|
38
|
+
return (
|
|
39
|
+
<select value={theme} onChange={(e) => setTheme(e.target.value)}>
|
|
40
|
+
<option value="Dark">Dark</option>
|
|
41
|
+
<option value="White">White</option>
|
|
42
|
+
<option value="System">System</option>
|
|
43
|
+
</select>
|
|
44
|
+
)
|
|
45
|
+
}
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## Core Concepts
|
|
49
|
+
|
|
50
|
+
### `defineState(options?)`
|
|
51
|
+
|
|
52
|
+
Defines a state node. Options:
|
|
53
|
+
|
|
54
|
+
| Option | Type | Description |
|
|
55
|
+
|---|---|---|
|
|
56
|
+
| `storage` | `Storage` | Where to persist the value. Omit for in-memory only. |
|
|
57
|
+
| `defaultValue` | `T` | Value used when storage has no entry. |
|
|
58
|
+
| `serialize` | `(v: T) => string` | Custom serializer. Default: `JSON.stringify`. |
|
|
59
|
+
| `deserialize` | `(v: string) => T` | Custom deserializer. Default: `JSON.parse`. |
|
|
60
|
+
|
|
61
|
+
```ts
|
|
62
|
+
// In-memory (no persistence)
|
|
63
|
+
const counter = defineState({ defaultValue: 0 })
|
|
64
|
+
|
|
65
|
+
// localStorage with custom type
|
|
66
|
+
const theme = defineState<'Dark' | 'White'>({
|
|
67
|
+
storage: localStorage,
|
|
68
|
+
defaultValue: 'Dark',
|
|
69
|
+
})
|
|
70
|
+
|
|
71
|
+
// localStorage with custom serialization
|
|
72
|
+
const birthday = defineState({
|
|
73
|
+
storage: localStorage,
|
|
74
|
+
deserialize: (raw) => new Date(JSON.parse(raw)),
|
|
75
|
+
})
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
### `setupStorage(tree)`
|
|
79
|
+
|
|
80
|
+
Wraps a nested object of `defineState()` nodes and injects dot-separated paths into each leaf. The returned object mirrors your tree structure.
|
|
81
|
+
|
|
82
|
+
```ts
|
|
83
|
+
const storage = setupStorage({
|
|
84
|
+
user: {
|
|
85
|
+
name: defineState({ storage: localStorage }),
|
|
86
|
+
age: defineState({ defaultValue: 0 }),
|
|
87
|
+
},
|
|
88
|
+
})
|
|
89
|
+
|
|
90
|
+
// Access paths:
|
|
91
|
+
storage.user.name // → path: "user.name"
|
|
92
|
+
storage.user.age // → path: "user.age"
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
### `StorageProvider`
|
|
96
|
+
|
|
97
|
+
A React context provider that must wrap all components using `useState()` from any state node. Place it once near the top of your tree.
|
|
98
|
+
|
|
99
|
+
```tsx
|
|
100
|
+
createRoot(document.getElementById('root')!).render(
|
|
101
|
+
<StorageProvider>
|
|
102
|
+
<App />
|
|
103
|
+
</StorageProvider>
|
|
104
|
+
)
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
## `useState` Hook
|
|
108
|
+
|
|
109
|
+
Each state node exposes a `.useState()` method that works like React's built-in `useState` but adds persistence and callbacks.
|
|
110
|
+
|
|
111
|
+
```ts
|
|
112
|
+
const [value, setValue, resetValue] = storage.path.to.node.useState(
|
|
113
|
+
defaultValue?,
|
|
114
|
+
options?
|
|
115
|
+
)
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
### Arguments
|
|
119
|
+
|
|
120
|
+
**`defaultValue`** — overrides the `defineState`-level default for this usage. Accepts a value or initializer function:
|
|
121
|
+
|
|
122
|
+
```ts
|
|
123
|
+
const [alarm] = storage.alarm.useState(() => new Date())
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
**`options.delayedSet`** — debounce the `onSet` callback by N milliseconds:
|
|
127
|
+
|
|
128
|
+
```ts
|
|
129
|
+
const [note, setNote] = storage.note.useState('', {
|
|
130
|
+
delayedSet: 1000,
|
|
131
|
+
onSet: (value) => saveToServer(value),
|
|
132
|
+
})
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
**`options.onSet`** — called after every state change with `(nextValue, prevValue)`:
|
|
136
|
+
|
|
137
|
+
```ts
|
|
138
|
+
const [counter, setCounter] = storage.counter.useState(0, {
|
|
139
|
+
onSet(next, prev) {
|
|
140
|
+
console.log(`Changed from ${prev} to ${next}`)
|
|
141
|
+
},
|
|
142
|
+
})
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
### Return value
|
|
146
|
+
|
|
147
|
+
```ts
|
|
148
|
+
const [value, setValue, resetValue] = storage.node.useState()
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
- **`value`** — current state
|
|
152
|
+
- **`setValue(nextValue | updater)`** — set state; accepts a value or `(prev) => next` function
|
|
153
|
+
- **`resetValue()`** — restores the default value
|
|
154
|
+
|
|
155
|
+
## Custom Storage
|
|
156
|
+
|
|
157
|
+
Any object implementing the [Web Storage API](https://developer.mozilla.org/en-US/docs/Web/API/Storage) works as a backend:
|
|
158
|
+
|
|
159
|
+
```ts
|
|
160
|
+
const storage = setupStorage({
|
|
161
|
+
server: defineState({
|
|
162
|
+
storage: {
|
|
163
|
+
length: 0,
|
|
164
|
+
getItem: (key) => cache[key] ?? null,
|
|
165
|
+
setItem: (key, value) => api.save(key, value),
|
|
166
|
+
removeItem: (key) => { delete cache[key] },
|
|
167
|
+
clear: () => {},
|
|
168
|
+
key: () => null,
|
|
169
|
+
},
|
|
170
|
+
}),
|
|
171
|
+
})
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
## Full Example
|
|
175
|
+
|
|
176
|
+
```tsx
|
|
177
|
+
import { setupStorage, defineState, StorageProvider } from 'state-vocab'
|
|
178
|
+
|
|
179
|
+
type Theme = 'Dark' | 'White' | 'System'
|
|
180
|
+
|
|
181
|
+
const storage = setupStorage({
|
|
182
|
+
preference: {
|
|
183
|
+
theme: defineState<Theme>({ storage: localStorage, defaultValue: 'Dark' }),
|
|
184
|
+
nightMode: defineState({ storage: sessionStorage }),
|
|
185
|
+
},
|
|
186
|
+
stats: {
|
|
187
|
+
counter: defineState({ defaultValue: 0 }),
|
|
188
|
+
},
|
|
189
|
+
personal: {
|
|
190
|
+
note: defineState({ storage: localStorage }),
|
|
191
|
+
birthday: defineState({
|
|
192
|
+
storage: localStorage,
|
|
193
|
+
deserialize: (raw) => {
|
|
194
|
+
try { return new Date(JSON.parse(raw)) } catch { return null }
|
|
195
|
+
},
|
|
196
|
+
}),
|
|
197
|
+
},
|
|
198
|
+
})
|
|
199
|
+
|
|
200
|
+
function Dashboard() {
|
|
201
|
+
const [theme, setTheme] = storage.preference.theme.useState()
|
|
202
|
+
const [nightMode, setNightMode] = storage.preference.nightMode.useState(false)
|
|
203
|
+
const [counter, setCounter, resetCounter] = storage.stats.counter.useState(0)
|
|
204
|
+
const [note, setNote] = storage.personal.note.useState('', {
|
|
205
|
+
delayedSet: 500,
|
|
206
|
+
onSet: (v) => console.log('Saving note:', v),
|
|
207
|
+
})
|
|
208
|
+
|
|
209
|
+
return (
|
|
210
|
+
<div>
|
|
211
|
+
<select value={theme ?? ''} onChange={(e) => setTheme(e.target.value as Theme)}>
|
|
212
|
+
<option value="Dark">Dark</option>
|
|
213
|
+
<option value="White">White</option>
|
|
214
|
+
<option value="System">System</option>
|
|
215
|
+
</select>
|
|
216
|
+
|
|
217
|
+
<input
|
|
218
|
+
type="checkbox"
|
|
219
|
+
checked={!!nightMode}
|
|
220
|
+
onChange={(e) => setNightMode(e.target.checked)}
|
|
221
|
+
/>
|
|
222
|
+
|
|
223
|
+
<input
|
|
224
|
+
type="number"
|
|
225
|
+
value={counter}
|
|
226
|
+
onChange={(e) => setCounter(+e.target.value)}
|
|
227
|
+
/>
|
|
228
|
+
<button onClick={resetCounter}>Reset</button>
|
|
229
|
+
|
|
230
|
+
<input
|
|
231
|
+
type="text"
|
|
232
|
+
value={note}
|
|
233
|
+
onChange={(e) => setNote(e.target.value)}
|
|
234
|
+
/>
|
|
235
|
+
</div>
|
|
236
|
+
)
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
createRoot(document.getElementById('root')!).render(
|
|
240
|
+
<StorageProvider>
|
|
241
|
+
<Dashboard />
|
|
242
|
+
</StorageProvider>
|
|
243
|
+
)
|
|
244
|
+
```
|
|
245
|
+
|
|
246
|
+
## API Reference
|
|
247
|
+
|
|
248
|
+
### `defineState<T>(options?)`
|
|
249
|
+
|
|
250
|
+
| Option | Type | Default |
|
|
251
|
+
|---|---|---|
|
|
252
|
+
| `storage` | `Storage \| undefined` | `undefined` (in-memory) |
|
|
253
|
+
| `defaultValue` | `T \| undefined` | `undefined` |
|
|
254
|
+
| `serialize` | `(v: T) => string` | `JSON.stringify` |
|
|
255
|
+
| `deserialize` | `(v: string) => T` | `JSON.parse` |
|
|
256
|
+
|
|
257
|
+
### `setupStorage<T>(tree: T): T`
|
|
258
|
+
|
|
259
|
+
Returns a proxied copy of `tree` with paths injected into all leaf nodes.
|
|
260
|
+
|
|
261
|
+
### `StorageProvider`
|
|
262
|
+
|
|
263
|
+
React context provider. Must be an ancestor of any component using `.useState()`.
|
|
264
|
+
|
|
265
|
+
### `node.useState<D>(defaultValue?, options?)`
|
|
266
|
+
|
|
267
|
+
| Parameter | Type | Description |
|
|
268
|
+
|---|---|---|
|
|
269
|
+
| `defaultValue` | `D \| (() => D) \| undefined` | Local default, overrides `defineState` default |
|
|
270
|
+
| `options.delayedSet` | `number \| undefined` | Debounce delay for `onSet` in ms |
|
|
271
|
+
| `options.onSet` | `(next: D, prev: D) => void \| undefined` | Callback after state change |
|
|
272
|
+
|
|
273
|
+
Returns `[value, setValue, resetValue]`.
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const D=require("react"),De=Symbol("state-def"),B=Symbol("state-path");function yr(d,i,c){if(!i)return d;const g=i.split(".");let l=d;for(const m of g)if(l!==null&&typeof l=="object"&&m in l)l=l[m];else return c;return l===void 0?c:l}function br(d,i,c){const g=i.replace(/\[(\d+)\]/g,".$1").split(".");let l=d;for(let m=0;m<g.length-1;m++){const R=g[m],y=g[m+1];(l[R]===void 0||l[R]===null)&&(l[R]=/^\d+$/.test(y)?[]:{}),l=l[R]}return l[g[g.length-1]]=c,d}function hr(d,i=0){let c;return function(...g){c!==void 0&&clearTimeout(c),c=setTimeout(()=>{c=void 0,d.apply(this,g)},i)}}function Er(d,i,c=[]){return D.useMemo(()=>hr(d,i),c)}var K={exports:{}},Y={};var Ce;function mr(){if(Ce)return Y;Ce=1;var d=D,i=Symbol.for("react.element"),c=Symbol.for("react.fragment"),g=Object.prototype.hasOwnProperty,l=d.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,m={key:!0,ref:!0,__self:!0,__source:!0};function R(y,f,v){var p,_={},w=null,k=null;v!==void 0&&(w=""+v),f.key!==void 0&&(w=""+f.key),f.ref!==void 0&&(k=f.ref);for(p in f)g.call(f,p)&&!m.hasOwnProperty(p)&&(_[p]=f[p]);if(y&&y.defaultProps)for(p in f=y.defaultProps,f)_[p]===void 0&&(_[p]=f[p]);return{$$typeof:i,type:y,key:w,ref:k,props:_,_owner:l.current}}return Y.Fragment=c,Y.jsx=R,Y.jsxs=R,Y}var L={};var we;function Rr(){return we||(we=1,process.env.NODE_ENV!=="production"&&(function(){var d=D,i=Symbol.for("react.element"),c=Symbol.for("react.portal"),g=Symbol.for("react.fragment"),l=Symbol.for("react.strict_mode"),m=Symbol.for("react.profiler"),R=Symbol.for("react.provider"),y=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),v=Symbol.for("react.suspense"),p=Symbol.for("react.suspense_list"),_=Symbol.for("react.memo"),w=Symbol.for("react.lazy"),k=Symbol.for("react.offscreen"),j=Symbol.iterator,P="@@iterator";function E(e){if(e===null||typeof e!="object")return null;var r=j&&e[j]||e[P];return typeof r=="function"?r:null}var S=d.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function T(e){{for(var r=arguments.length,t=new Array(r>1?r-1:0),n=1;n<r;n++)t[n-1]=arguments[n];Ie("error",e,t)}}function Ie(e,r,t){{var n=S.ReactDebugCurrentFrame,u=n.getStackAddendum();u!==""&&(r+="%s",t=t.concat([u]));var s=t.map(function(o){return String(o)});s.unshift("Warning: "+r),Function.prototype.apply.call(console[e],console,s)}}var Ve=!1,$e=!1,We=!1,Me=!1,Ye=!1,te;te=Symbol.for("react.module.reference");function Le(e){return!!(typeof e=="string"||typeof e=="function"||e===g||e===m||Ye||e===l||e===v||e===p||Me||e===k||Ve||$e||We||typeof e=="object"&&e!==null&&(e.$$typeof===w||e.$$typeof===_||e.$$typeof===R||e.$$typeof===y||e.$$typeof===f||e.$$typeof===te||e.getModuleId!==void 0))}function Ne(e,r,t){var n=e.displayName;if(n)return n;var u=r.displayName||r.name||"";return u!==""?t+"("+u+")":t}function ne(e){return e.displayName||"Context"}function A(e){if(e==null)return null;if(typeof e.tag=="number"&&T("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 g:return"Fragment";case c:return"Portal";case m:return"Profiler";case l:return"StrictMode";case v:return"Suspense";case p:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case y:var r=e;return ne(r)+".Consumer";case R:var t=e;return ne(t._context)+".Provider";case f:return Ne(e,e.render,"ForwardRef");case _:var n=e.displayName||null;return n!==null?n:A(e.type)||"Memo";case w:{var u=e,s=u._payload,o=u._init;try{return A(o(s))}catch{return null}}}return null}var F=Object.assign,W=0,ae,oe,ie,ue,se,ce,fe;function le(){}le.__reactDisabledLog=!0;function Ue(){{if(W===0){ae=console.log,oe=console.info,ie=console.warn,ue=console.error,se=console.group,ce=console.groupCollapsed,fe=console.groupEnd;var e={configurable:!0,enumerable:!0,value:le,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}W++}}function Je(){{if(W--,W===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:F({},e,{value:ae}),info:F({},e,{value:oe}),warn:F({},e,{value:ie}),error:F({},e,{value:ue}),group:F({},e,{value:se}),groupCollapsed:F({},e,{value:ce}),groupEnd:F({},e,{value:fe})})}W<0&&T("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var z=S.ReactCurrentDispatcher,G;function N(e,r,t){{if(G===void 0)try{throw Error()}catch(u){var n=u.stack.trim().match(/\n( *(at )?)/);G=n&&n[1]||""}return`
|
|
2
|
+
`+G+e}}var X=!1,U;{var qe=typeof WeakMap=="function"?WeakMap:Map;U=new qe}function de(e,r){if(!e||X)return"";{var t=U.get(e);if(t!==void 0)return t}var n;X=!0;var u=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var s;s=z.current,z.current=null,Ue();try{if(r){var o=function(){throw Error()};if(Object.defineProperty(o.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(o,[])}catch(C){n=C}Reflect.construct(e,[],o)}else{try{o.call()}catch(C){n=C}e.call(o.prototype)}}else{try{throw Error()}catch(C){n=C}e()}}catch(C){if(C&&n&&typeof C.stack=="string"){for(var a=C.stack.split(`
|
|
3
|
+
`),O=n.stack.split(`
|
|
4
|
+
`),b=a.length-1,h=O.length-1;b>=1&&h>=0&&a[b]!==O[h];)h--;for(;b>=1&&h>=0;b--,h--)if(a[b]!==O[h]){if(b!==1||h!==1)do if(b--,h--,h<0||a[b]!==O[h]){var x=`
|
|
5
|
+
`+a[b].replace(" at new "," at ");return e.displayName&&x.includes("<anonymous>")&&(x=x.replace("<anonymous>",e.displayName)),typeof e=="function"&&U.set(e,x),x}while(b>=1&&h>=0);break}}}finally{X=!1,z.current=s,Je(),Error.prepareStackTrace=u}var $=e?e.displayName||e.name:"",I=$?N($):"";return typeof e=="function"&&U.set(e,I),I}function Ke(e,r,t){return de(e,!1)}function Be(e){var r=e.prototype;return!!(r&&r.isReactComponent)}function J(e,r,t){if(e==null)return"";if(typeof e=="function")return de(e,Be(e));if(typeof e=="string")return N(e);switch(e){case v:return N("Suspense");case p:return N("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case f:return Ke(e.render);case _:return J(e.type,r,t);case w:{var n=e,u=n._payload,s=n._init;try{return J(s(u),r,t)}catch{}}}return""}var M=Object.prototype.hasOwnProperty,ve={},pe=S.ReactDebugCurrentFrame;function q(e){if(e){var r=e._owner,t=J(e.type,e._source,r?r.type:null);pe.setExtraStackFrame(t)}else pe.setExtraStackFrame(null)}function ze(e,r,t,n,u){{var s=Function.call.bind(M);for(var o in e)if(s(e,o)){var a=void 0;try{if(typeof e[o]!="function"){var O=Error((n||"React class")+": "+t+" type `"+o+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[o]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw O.name="Invariant Violation",O}a=e[o](r,o,n,t,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(b){a=b}a&&!(a instanceof Error)&&(q(u),T("%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).",n||"React class",t,o,typeof a),q(null)),a instanceof Error&&!(a.message in ve)&&(ve[a.message]=!0,q(u),T("Failed %s type: %s",t,a.message),q(null))}}}var Ge=Array.isArray;function H(e){return Ge(e)}function Xe(e){{var r=typeof Symbol=="function"&&Symbol.toStringTag,t=r&&e[Symbol.toStringTag]||e.constructor.name||"Object";return t}}function He(e){try{return ge(e),!1}catch{return!0}}function ge(e){return""+e}function ye(e){if(He(e))return T("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",Xe(e)),ge(e)}var be=S.ReactCurrentOwner,Ze={key:!0,ref:!0,__self:!0,__source:!0},he,Ee;function Qe(e){if(M.call(e,"ref")){var r=Object.getOwnPropertyDescriptor(e,"ref").get;if(r&&r.isReactWarning)return!1}return e.ref!==void 0}function er(e){if(M.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function rr(e,r){typeof e.ref=="string"&&be.current}function tr(e,r){{var t=function(){he||(he=!0,T("%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)",r))};t.isReactWarning=!0,Object.defineProperty(e,"key",{get:t,configurable:!0})}}function nr(e,r){{var t=function(){Ee||(Ee=!0,T("%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)",r))};t.isReactWarning=!0,Object.defineProperty(e,"ref",{get:t,configurable:!0})}}var ar=function(e,r,t,n,u,s,o){var a={$$typeof:i,type:e,key:r,ref:t,props:o,_owner:s};return a._store={},Object.defineProperty(a._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(a,"_self",{configurable:!1,enumerable:!1,writable:!1,value:n}),Object.defineProperty(a,"_source",{configurable:!1,enumerable:!1,writable:!1,value:u}),Object.freeze&&(Object.freeze(a.props),Object.freeze(a)),a};function or(e,r,t,n,u){{var s,o={},a=null,O=null;t!==void 0&&(ye(t),a=""+t),er(r)&&(ye(r.key),a=""+r.key),Qe(r)&&(O=r.ref,rr(r,u));for(s in r)M.call(r,s)&&!Ze.hasOwnProperty(s)&&(o[s]=r[s]);if(e&&e.defaultProps){var b=e.defaultProps;for(s in b)o[s]===void 0&&(o[s]=b[s])}if(a||O){var h=typeof e=="function"?e.displayName||e.name||"Unknown":e;a&&tr(o,h),O&&nr(o,h)}return ar(e,a,O,u,n,be.current,o)}}var Z=S.ReactCurrentOwner,me=S.ReactDebugCurrentFrame;function V(e){if(e){var r=e._owner,t=J(e.type,e._source,r?r.type:null);me.setExtraStackFrame(t)}else me.setExtraStackFrame(null)}var Q;Q=!1;function ee(e){return typeof e=="object"&&e!==null&&e.$$typeof===i}function Re(){{if(Z.current){var e=A(Z.current.type);if(e)return`
|
|
6
|
+
|
|
7
|
+
Check the render method of \``+e+"`."}return""}}function ir(e){return""}var _e={};function ur(e){{var r=Re();if(!r){var t=typeof e=="string"?e:e.displayName||e.name;t&&(r=`
|
|
8
|
+
|
|
9
|
+
Check the top-level render call using <`+t+">.")}return r}}function Se(e,r){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var t=ur(r);if(_e[t])return;_e[t]=!0;var n="";e&&e._owner&&e._owner!==Z.current&&(n=" It was passed a child from "+A(e._owner.type)+"."),V(e),T('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',t,n),V(null)}}function Te(e,r){{if(typeof e!="object")return;if(H(e))for(var t=0;t<e.length;t++){var n=e[t];ee(n)&&Se(n,r)}else if(ee(e))e._store&&(e._store.validated=!0);else if(e){var u=E(e);if(typeof u=="function"&&u!==e.entries)for(var s=u.call(e),o;!(o=s.next()).done;)ee(o.value)&&Se(o.value,r)}}}function sr(e){{var r=e.type;if(r==null||typeof r=="string")return;var t;if(typeof r=="function")t=r.propTypes;else if(typeof r=="object"&&(r.$$typeof===f||r.$$typeof===_))t=r.propTypes;else return;if(t){var n=A(r);ze(t,e.props,"prop",n,e)}else if(r.PropTypes!==void 0&&!Q){Q=!0;var u=A(r);T("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",u||"Unknown")}typeof r.getDefaultProps=="function"&&!r.getDefaultProps.isReactClassApproved&&T("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function cr(e){{for(var r=Object.keys(e.props),t=0;t<r.length;t++){var n=r[t];if(n!=="children"&&n!=="key"){V(e),T("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",n),V(null);break}}e.ref!==null&&(V(e),T("Invalid attribute `ref` supplied to `React.Fragment`."),V(null))}}var Oe={};function Pe(e,r,t,n,u,s){{var o=Le(e);if(!o){var a="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(a+=" 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 O=ir();O?a+=O:a+=Re();var b;e===null?b="null":H(e)?b="array":e!==void 0&&e.$$typeof===i?(b="<"+(A(e.type)||"Unknown")+" />",a=" Did you accidentally export a JSX literal instead of a component?"):b=typeof e,T("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",b,a)}var h=or(e,r,t,u,s);if(h==null)return h;if(o){var x=r.children;if(x!==void 0)if(n)if(H(x)){for(var $=0;$<x.length;$++)Te(x[$],e);Object.freeze&&Object.freeze(x)}else T("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else Te(x,e)}if(M.call(r,"key")){var I=A(e),C=Object.keys(r).filter(function(gr){return gr!=="key"}),re=C.length>0?"{key: someKey, "+C.join(": ..., ")+": ...}":"{key: someKey}";if(!Oe[I+re]){var pr=C.length>0?"{"+C.join(": ..., ")+": ...}":"{}";T(`A props object containing a "key" prop is being spread into JSX:
|
|
10
|
+
let props = %s;
|
|
11
|
+
<%s {...props} />
|
|
12
|
+
React keys must be passed directly to JSX without using spread:
|
|
13
|
+
let props = %s;
|
|
14
|
+
<%s key={someKey} {...props} />`,re,I,pr,I),Oe[I+re]=!0}}return e===g?cr(h):sr(h),h}}function fr(e,r,t){return Pe(e,r,t,!0)}function lr(e,r,t){return Pe(e,r,t,!1)}var dr=lr,vr=fr;L.Fragment=g,L.jsx=dr,L.jsxs=vr})()),L}var xe;function _r(){return xe||(xe=1,process.env.NODE_ENV==="production"?K.exports=mr():K.exports=Rr()),K.exports}var Sr=_r();const Ae=D.createContext({stateVocab:{},setStateVocab:()=>{}});function Tr(){return D.useContext(Ae)}const Or=({children:d})=>{const[i,c]=D.useState({});return console.log(i),Sr.jsx(Ae.Provider,{value:{stateVocab:i,setStateVocab:c},children:d})};function Pr(d={}){const{storage:i,serialize:c=JSON.stringify,deserialize:g=JSON.parse,defaultValue:l}=d;return{[De]:!0,[B]:"",useState(m,R){R??={};const y=Er(R.onSet??(()=>{}),R.delayedSet,[]),f=Tr(),v=this[B],p=()=>typeof m=="function"?m():m??l,_=D.useMemo(()=>{if(!i)return;const P=i.getItem(v);let E;if(P===null){const S=p();if(typeof S>"u")return;E=S}else E=g(P);return E},[v]),w=D.useMemo(()=>yr(f.stateVocab,v,_??p()),[f.stateVocab,_,v]),k=P=>E=>{const S={...E};return br(S,v,P),S};D.useEffect(()=>{!i||!_||f.setStateVocab(k(_))},[_]);const j=D.useRef(w);return[w,function(E){const S=typeof E=="function"?E(j.current):E;f.setStateVocab(k(S)),y(S,j.current),i&&i.setItem(v,c(S)),j.current=S},function(){const E=p();if(typeof E>"u"){i?.removeItem(v);return}f.setStateVocab(k(E)),y(E,j.current),j.current=E,i&&i.setItem(v,c(E))}]},toString(){return this[B]}}}const je=new WeakMap,ke=new WeakMap;function Fe(d,i=""){let c=je.get(d);c||(c=new Map,je.set(d,c));const g=c.get(i);if(g)return g;const l=new Proxy(d,{get(m,R){const y=m[R],f=i?`${i}.${String(R)}`:String(R);if(y&&typeof y=="object"&&De in y){const v=y;let p=ke.get(v);p||(p=new Map,ke.set(v,p));const _=p.get(f);if(_)return _;const w=Reflect.ownKeys(v).filter(P=>typeof v[P]=="function"),k=Object.fromEntries(w.map(P=>[P,(...E)=>v[P].call({...v,[B]:f},...E)])),j={...v,...k};return p.set(f,j),j}return y&&typeof y=="object"?Fe(y,f):y}});return c.set(i,l),l}function Cr(d){return Fe(d)}exports.StorageProvider=Or;exports.defineState=Pr;exports.setupStorage=Cr;
|
|
@@ -0,0 +1,786 @@
|
|
|
1
|
+
import De, { useMemo as re, createContext as br, useState as hr, useContext as Er, useEffect as mr, useRef as Rr } from "react";
|
|
2
|
+
const Ae = Symbol("state-def"), K = Symbol("state-path");
|
|
3
|
+
function _r(d, i, c) {
|
|
4
|
+
if (!i)
|
|
5
|
+
return d;
|
|
6
|
+
const g = i.split(".");
|
|
7
|
+
let l = d;
|
|
8
|
+
for (const m of g)
|
|
9
|
+
if (l !== null && typeof l == "object" && m in l)
|
|
10
|
+
l = l[m];
|
|
11
|
+
else
|
|
12
|
+
return c;
|
|
13
|
+
return l === void 0 ? c : l;
|
|
14
|
+
}
|
|
15
|
+
function Sr(d, i, c) {
|
|
16
|
+
const g = i.replace(/\[(\d+)\]/g, ".$1").split(".");
|
|
17
|
+
let l = d;
|
|
18
|
+
for (let m = 0; m < g.length - 1; m++) {
|
|
19
|
+
const R = g[m], y = g[m + 1];
|
|
20
|
+
(l[R] === void 0 || l[R] === null) && (l[R] = /^\d+$/.test(y) ? [] : {}), l = l[R];
|
|
21
|
+
}
|
|
22
|
+
return l[g[g.length - 1]] = c, d;
|
|
23
|
+
}
|
|
24
|
+
function Tr(d, i = 0) {
|
|
25
|
+
let c;
|
|
26
|
+
return function(...g) {
|
|
27
|
+
c !== void 0 && clearTimeout(c), c = setTimeout(() => {
|
|
28
|
+
c = void 0, d.apply(this, g);
|
|
29
|
+
}, i);
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
function Or(d, i, c = []) {
|
|
33
|
+
return re(
|
|
34
|
+
() => Tr(d, i),
|
|
35
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
36
|
+
c
|
|
37
|
+
);
|
|
38
|
+
}
|
|
39
|
+
var q = { exports: {} }, Y = {};
|
|
40
|
+
var Ce;
|
|
41
|
+
function Pr() {
|
|
42
|
+
if (Ce) return Y;
|
|
43
|
+
Ce = 1;
|
|
44
|
+
var d = De, i = Symbol.for("react.element"), c = Symbol.for("react.fragment"), g = Object.prototype.hasOwnProperty, l = d.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, m = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
45
|
+
function R(y, f, v) {
|
|
46
|
+
var p, _ = {}, w = null, k = null;
|
|
47
|
+
v !== void 0 && (w = "" + v), f.key !== void 0 && (w = "" + f.key), f.ref !== void 0 && (k = f.ref);
|
|
48
|
+
for (p in f) g.call(f, p) && !m.hasOwnProperty(p) && (_[p] = f[p]);
|
|
49
|
+
if (y && y.defaultProps) for (p in f = y.defaultProps, f) _[p] === void 0 && (_[p] = f[p]);
|
|
50
|
+
return { $$typeof: i, type: y, key: w, ref: k, props: _, _owner: l.current };
|
|
51
|
+
}
|
|
52
|
+
return Y.Fragment = c, Y.jsx = R, Y.jsxs = R, Y;
|
|
53
|
+
}
|
|
54
|
+
var M = {};
|
|
55
|
+
var we;
|
|
56
|
+
function Cr() {
|
|
57
|
+
return we || (we = 1, process.env.NODE_ENV !== "production" && (function() {
|
|
58
|
+
var d = De, i = Symbol.for("react.element"), c = Symbol.for("react.portal"), g = Symbol.for("react.fragment"), l = Symbol.for("react.strict_mode"), m = Symbol.for("react.profiler"), R = Symbol.for("react.provider"), y = Symbol.for("react.context"), f = Symbol.for("react.forward_ref"), v = Symbol.for("react.suspense"), p = Symbol.for("react.suspense_list"), _ = Symbol.for("react.memo"), w = Symbol.for("react.lazy"), k = Symbol.for("react.offscreen"), j = Symbol.iterator, P = "@@iterator";
|
|
59
|
+
function E(e) {
|
|
60
|
+
if (e === null || typeof e != "object")
|
|
61
|
+
return null;
|
|
62
|
+
var r = j && e[j] || e[P];
|
|
63
|
+
return typeof r == "function" ? r : null;
|
|
64
|
+
}
|
|
65
|
+
var S = d.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
66
|
+
function T(e) {
|
|
67
|
+
{
|
|
68
|
+
for (var r = arguments.length, t = new Array(r > 1 ? r - 1 : 0), n = 1; n < r; n++)
|
|
69
|
+
t[n - 1] = arguments[n];
|
|
70
|
+
Ve("error", e, t);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
function Ve(e, r, t) {
|
|
74
|
+
{
|
|
75
|
+
var n = S.ReactDebugCurrentFrame, u = n.getStackAddendum();
|
|
76
|
+
u !== "" && (r += "%s", t = t.concat([u]));
|
|
77
|
+
var s = t.map(function(o) {
|
|
78
|
+
return String(o);
|
|
79
|
+
});
|
|
80
|
+
s.unshift("Warning: " + r), Function.prototype.apply.call(console[e], console, s);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
var $e = !1, We = !1, Ye = !1, Me = !1, Le = !1, te;
|
|
84
|
+
te = Symbol.for("react.module.reference");
|
|
85
|
+
function Ne(e) {
|
|
86
|
+
return !!(typeof e == "string" || typeof e == "function" || e === g || e === m || Le || e === l || e === v || e === p || Me || e === k || $e || We || Ye || typeof e == "object" && e !== null && (e.$$typeof === w || e.$$typeof === _ || e.$$typeof === R || e.$$typeof === y || e.$$typeof === f || // This needs to include all possible module reference object
|
|
87
|
+
// types supported by any Flight configuration anywhere since
|
|
88
|
+
// we don't know which Flight build this will end up being used
|
|
89
|
+
// with.
|
|
90
|
+
e.$$typeof === te || e.getModuleId !== void 0));
|
|
91
|
+
}
|
|
92
|
+
function Ue(e, r, t) {
|
|
93
|
+
var n = e.displayName;
|
|
94
|
+
if (n)
|
|
95
|
+
return n;
|
|
96
|
+
var u = r.displayName || r.name || "";
|
|
97
|
+
return u !== "" ? t + "(" + u + ")" : t;
|
|
98
|
+
}
|
|
99
|
+
function ne(e) {
|
|
100
|
+
return e.displayName || "Context";
|
|
101
|
+
}
|
|
102
|
+
function D(e) {
|
|
103
|
+
if (e == null)
|
|
104
|
+
return null;
|
|
105
|
+
if (typeof e.tag == "number" && T("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function")
|
|
106
|
+
return e.displayName || e.name || null;
|
|
107
|
+
if (typeof e == "string")
|
|
108
|
+
return e;
|
|
109
|
+
switch (e) {
|
|
110
|
+
case g:
|
|
111
|
+
return "Fragment";
|
|
112
|
+
case c:
|
|
113
|
+
return "Portal";
|
|
114
|
+
case m:
|
|
115
|
+
return "Profiler";
|
|
116
|
+
case l:
|
|
117
|
+
return "StrictMode";
|
|
118
|
+
case v:
|
|
119
|
+
return "Suspense";
|
|
120
|
+
case p:
|
|
121
|
+
return "SuspenseList";
|
|
122
|
+
}
|
|
123
|
+
if (typeof e == "object")
|
|
124
|
+
switch (e.$$typeof) {
|
|
125
|
+
case y:
|
|
126
|
+
var r = e;
|
|
127
|
+
return ne(r) + ".Consumer";
|
|
128
|
+
case R:
|
|
129
|
+
var t = e;
|
|
130
|
+
return ne(t._context) + ".Provider";
|
|
131
|
+
case f:
|
|
132
|
+
return Ue(e, e.render, "ForwardRef");
|
|
133
|
+
case _:
|
|
134
|
+
var n = e.displayName || null;
|
|
135
|
+
return n !== null ? n : D(e.type) || "Memo";
|
|
136
|
+
case w: {
|
|
137
|
+
var u = e, s = u._payload, o = u._init;
|
|
138
|
+
try {
|
|
139
|
+
return D(o(s));
|
|
140
|
+
} catch {
|
|
141
|
+
return null;
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
return null;
|
|
146
|
+
}
|
|
147
|
+
var A = Object.assign, $ = 0, ae, oe, ie, ue, se, ce, fe;
|
|
148
|
+
function le() {
|
|
149
|
+
}
|
|
150
|
+
le.__reactDisabledLog = !0;
|
|
151
|
+
function Je() {
|
|
152
|
+
{
|
|
153
|
+
if ($ === 0) {
|
|
154
|
+
ae = console.log, oe = console.info, ie = console.warn, ue = console.error, se = console.group, ce = console.groupCollapsed, fe = console.groupEnd;
|
|
155
|
+
var e = {
|
|
156
|
+
configurable: !0,
|
|
157
|
+
enumerable: !0,
|
|
158
|
+
value: le,
|
|
159
|
+
writable: !0
|
|
160
|
+
};
|
|
161
|
+
Object.defineProperties(console, {
|
|
162
|
+
info: e,
|
|
163
|
+
log: e,
|
|
164
|
+
warn: e,
|
|
165
|
+
error: e,
|
|
166
|
+
group: e,
|
|
167
|
+
groupCollapsed: e,
|
|
168
|
+
groupEnd: e
|
|
169
|
+
});
|
|
170
|
+
}
|
|
171
|
+
$++;
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
function qe() {
|
|
175
|
+
{
|
|
176
|
+
if ($--, $ === 0) {
|
|
177
|
+
var e = {
|
|
178
|
+
configurable: !0,
|
|
179
|
+
enumerable: !0,
|
|
180
|
+
writable: !0
|
|
181
|
+
};
|
|
182
|
+
Object.defineProperties(console, {
|
|
183
|
+
log: A({}, e, {
|
|
184
|
+
value: ae
|
|
185
|
+
}),
|
|
186
|
+
info: A({}, e, {
|
|
187
|
+
value: oe
|
|
188
|
+
}),
|
|
189
|
+
warn: A({}, e, {
|
|
190
|
+
value: ie
|
|
191
|
+
}),
|
|
192
|
+
error: A({}, e, {
|
|
193
|
+
value: ue
|
|
194
|
+
}),
|
|
195
|
+
group: A({}, e, {
|
|
196
|
+
value: se
|
|
197
|
+
}),
|
|
198
|
+
groupCollapsed: A({}, e, {
|
|
199
|
+
value: ce
|
|
200
|
+
}),
|
|
201
|
+
groupEnd: A({}, e, {
|
|
202
|
+
value: fe
|
|
203
|
+
})
|
|
204
|
+
});
|
|
205
|
+
}
|
|
206
|
+
$ < 0 && T("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
var B = S.ReactCurrentDispatcher, z;
|
|
210
|
+
function L(e, r, t) {
|
|
211
|
+
{
|
|
212
|
+
if (z === void 0)
|
|
213
|
+
try {
|
|
214
|
+
throw Error();
|
|
215
|
+
} catch (u) {
|
|
216
|
+
var n = u.stack.trim().match(/\n( *(at )?)/);
|
|
217
|
+
z = n && n[1] || "";
|
|
218
|
+
}
|
|
219
|
+
return `
|
|
220
|
+
` + z + e;
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
var G = !1, N;
|
|
224
|
+
{
|
|
225
|
+
var Ke = typeof WeakMap == "function" ? WeakMap : Map;
|
|
226
|
+
N = new Ke();
|
|
227
|
+
}
|
|
228
|
+
function de(e, r) {
|
|
229
|
+
if (!e || G)
|
|
230
|
+
return "";
|
|
231
|
+
{
|
|
232
|
+
var t = N.get(e);
|
|
233
|
+
if (t !== void 0)
|
|
234
|
+
return t;
|
|
235
|
+
}
|
|
236
|
+
var n;
|
|
237
|
+
G = !0;
|
|
238
|
+
var u = Error.prepareStackTrace;
|
|
239
|
+
Error.prepareStackTrace = void 0;
|
|
240
|
+
var s;
|
|
241
|
+
s = B.current, B.current = null, Je();
|
|
242
|
+
try {
|
|
243
|
+
if (r) {
|
|
244
|
+
var o = function() {
|
|
245
|
+
throw Error();
|
|
246
|
+
};
|
|
247
|
+
if (Object.defineProperty(o.prototype, "props", {
|
|
248
|
+
set: function() {
|
|
249
|
+
throw Error();
|
|
250
|
+
}
|
|
251
|
+
}), typeof Reflect == "object" && Reflect.construct) {
|
|
252
|
+
try {
|
|
253
|
+
Reflect.construct(o, []);
|
|
254
|
+
} catch (C) {
|
|
255
|
+
n = C;
|
|
256
|
+
}
|
|
257
|
+
Reflect.construct(e, [], o);
|
|
258
|
+
} else {
|
|
259
|
+
try {
|
|
260
|
+
o.call();
|
|
261
|
+
} catch (C) {
|
|
262
|
+
n = C;
|
|
263
|
+
}
|
|
264
|
+
e.call(o.prototype);
|
|
265
|
+
}
|
|
266
|
+
} else {
|
|
267
|
+
try {
|
|
268
|
+
throw Error();
|
|
269
|
+
} catch (C) {
|
|
270
|
+
n = C;
|
|
271
|
+
}
|
|
272
|
+
e();
|
|
273
|
+
}
|
|
274
|
+
} catch (C) {
|
|
275
|
+
if (C && n && typeof C.stack == "string") {
|
|
276
|
+
for (var a = C.stack.split(`
|
|
277
|
+
`), O = n.stack.split(`
|
|
278
|
+
`), b = a.length - 1, h = O.length - 1; b >= 1 && h >= 0 && a[b] !== O[h]; )
|
|
279
|
+
h--;
|
|
280
|
+
for (; b >= 1 && h >= 0; b--, h--)
|
|
281
|
+
if (a[b] !== O[h]) {
|
|
282
|
+
if (b !== 1 || h !== 1)
|
|
283
|
+
do
|
|
284
|
+
if (b--, h--, h < 0 || a[b] !== O[h]) {
|
|
285
|
+
var x = `
|
|
286
|
+
` + a[b].replace(" at new ", " at ");
|
|
287
|
+
return e.displayName && x.includes("<anonymous>") && (x = x.replace("<anonymous>", e.displayName)), typeof e == "function" && N.set(e, x), x;
|
|
288
|
+
}
|
|
289
|
+
while (b >= 1 && h >= 0);
|
|
290
|
+
break;
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
} finally {
|
|
294
|
+
G = !1, B.current = s, qe(), Error.prepareStackTrace = u;
|
|
295
|
+
}
|
|
296
|
+
var V = e ? e.displayName || e.name : "", F = V ? L(V) : "";
|
|
297
|
+
return typeof e == "function" && N.set(e, F), F;
|
|
298
|
+
}
|
|
299
|
+
function Be(e, r, t) {
|
|
300
|
+
return de(e, !1);
|
|
301
|
+
}
|
|
302
|
+
function ze(e) {
|
|
303
|
+
var r = e.prototype;
|
|
304
|
+
return !!(r && r.isReactComponent);
|
|
305
|
+
}
|
|
306
|
+
function U(e, r, t) {
|
|
307
|
+
if (e == null)
|
|
308
|
+
return "";
|
|
309
|
+
if (typeof e == "function")
|
|
310
|
+
return de(e, ze(e));
|
|
311
|
+
if (typeof e == "string")
|
|
312
|
+
return L(e);
|
|
313
|
+
switch (e) {
|
|
314
|
+
case v:
|
|
315
|
+
return L("Suspense");
|
|
316
|
+
case p:
|
|
317
|
+
return L("SuspenseList");
|
|
318
|
+
}
|
|
319
|
+
if (typeof e == "object")
|
|
320
|
+
switch (e.$$typeof) {
|
|
321
|
+
case f:
|
|
322
|
+
return Be(e.render);
|
|
323
|
+
case _:
|
|
324
|
+
return U(e.type, r, t);
|
|
325
|
+
case w: {
|
|
326
|
+
var n = e, u = n._payload, s = n._init;
|
|
327
|
+
try {
|
|
328
|
+
return U(s(u), r, t);
|
|
329
|
+
} catch {
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
return "";
|
|
334
|
+
}
|
|
335
|
+
var W = Object.prototype.hasOwnProperty, ve = {}, pe = S.ReactDebugCurrentFrame;
|
|
336
|
+
function J(e) {
|
|
337
|
+
if (e) {
|
|
338
|
+
var r = e._owner, t = U(e.type, e._source, r ? r.type : null);
|
|
339
|
+
pe.setExtraStackFrame(t);
|
|
340
|
+
} else
|
|
341
|
+
pe.setExtraStackFrame(null);
|
|
342
|
+
}
|
|
343
|
+
function Ge(e, r, t, n, u) {
|
|
344
|
+
{
|
|
345
|
+
var s = Function.call.bind(W);
|
|
346
|
+
for (var o in e)
|
|
347
|
+
if (s(e, o)) {
|
|
348
|
+
var a = void 0;
|
|
349
|
+
try {
|
|
350
|
+
if (typeof e[o] != "function") {
|
|
351
|
+
var O = Error((n || "React class") + ": " + t + " type `" + o + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[o] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
|
352
|
+
throw O.name = "Invariant Violation", O;
|
|
353
|
+
}
|
|
354
|
+
a = e[o](r, o, n, t, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
355
|
+
} catch (b) {
|
|
356
|
+
a = b;
|
|
357
|
+
}
|
|
358
|
+
a && !(a instanceof Error) && (J(u), T("%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).", n || "React class", t, o, typeof a), J(null)), a instanceof Error && !(a.message in ve) && (ve[a.message] = !0, J(u), T("Failed %s type: %s", t, a.message), J(null));
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
var Xe = Array.isArray;
|
|
363
|
+
function X(e) {
|
|
364
|
+
return Xe(e);
|
|
365
|
+
}
|
|
366
|
+
function He(e) {
|
|
367
|
+
{
|
|
368
|
+
var r = typeof Symbol == "function" && Symbol.toStringTag, t = r && e[Symbol.toStringTag] || e.constructor.name || "Object";
|
|
369
|
+
return t;
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
function Ze(e) {
|
|
373
|
+
try {
|
|
374
|
+
return ge(e), !1;
|
|
375
|
+
} catch {
|
|
376
|
+
return !0;
|
|
377
|
+
}
|
|
378
|
+
}
|
|
379
|
+
function ge(e) {
|
|
380
|
+
return "" + e;
|
|
381
|
+
}
|
|
382
|
+
function ye(e) {
|
|
383
|
+
if (Ze(e))
|
|
384
|
+
return T("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", He(e)), ge(e);
|
|
385
|
+
}
|
|
386
|
+
var be = S.ReactCurrentOwner, Qe = {
|
|
387
|
+
key: !0,
|
|
388
|
+
ref: !0,
|
|
389
|
+
__self: !0,
|
|
390
|
+
__source: !0
|
|
391
|
+
}, he, Ee;
|
|
392
|
+
function er(e) {
|
|
393
|
+
if (W.call(e, "ref")) {
|
|
394
|
+
var r = Object.getOwnPropertyDescriptor(e, "ref").get;
|
|
395
|
+
if (r && r.isReactWarning)
|
|
396
|
+
return !1;
|
|
397
|
+
}
|
|
398
|
+
return e.ref !== void 0;
|
|
399
|
+
}
|
|
400
|
+
function rr(e) {
|
|
401
|
+
if (W.call(e, "key")) {
|
|
402
|
+
var r = Object.getOwnPropertyDescriptor(e, "key").get;
|
|
403
|
+
if (r && r.isReactWarning)
|
|
404
|
+
return !1;
|
|
405
|
+
}
|
|
406
|
+
return e.key !== void 0;
|
|
407
|
+
}
|
|
408
|
+
function tr(e, r) {
|
|
409
|
+
typeof e.ref == "string" && be.current;
|
|
410
|
+
}
|
|
411
|
+
function nr(e, r) {
|
|
412
|
+
{
|
|
413
|
+
var t = function() {
|
|
414
|
+
he || (he = !0, T("%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)", r));
|
|
415
|
+
};
|
|
416
|
+
t.isReactWarning = !0, Object.defineProperty(e, "key", {
|
|
417
|
+
get: t,
|
|
418
|
+
configurable: !0
|
|
419
|
+
});
|
|
420
|
+
}
|
|
421
|
+
}
|
|
422
|
+
function ar(e, r) {
|
|
423
|
+
{
|
|
424
|
+
var t = function() {
|
|
425
|
+
Ee || (Ee = !0, T("%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)", r));
|
|
426
|
+
};
|
|
427
|
+
t.isReactWarning = !0, Object.defineProperty(e, "ref", {
|
|
428
|
+
get: t,
|
|
429
|
+
configurable: !0
|
|
430
|
+
});
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
var or = function(e, r, t, n, u, s, o) {
|
|
434
|
+
var a = {
|
|
435
|
+
// This tag allows us to uniquely identify this as a React Element
|
|
436
|
+
$$typeof: i,
|
|
437
|
+
// Built-in properties that belong on the element
|
|
438
|
+
type: e,
|
|
439
|
+
key: r,
|
|
440
|
+
ref: t,
|
|
441
|
+
props: o,
|
|
442
|
+
// Record the component responsible for creating this element.
|
|
443
|
+
_owner: s
|
|
444
|
+
};
|
|
445
|
+
return a._store = {}, Object.defineProperty(a._store, "validated", {
|
|
446
|
+
configurable: !1,
|
|
447
|
+
enumerable: !1,
|
|
448
|
+
writable: !0,
|
|
449
|
+
value: !1
|
|
450
|
+
}), Object.defineProperty(a, "_self", {
|
|
451
|
+
configurable: !1,
|
|
452
|
+
enumerable: !1,
|
|
453
|
+
writable: !1,
|
|
454
|
+
value: n
|
|
455
|
+
}), Object.defineProperty(a, "_source", {
|
|
456
|
+
configurable: !1,
|
|
457
|
+
enumerable: !1,
|
|
458
|
+
writable: !1,
|
|
459
|
+
value: u
|
|
460
|
+
}), Object.freeze && (Object.freeze(a.props), Object.freeze(a)), a;
|
|
461
|
+
};
|
|
462
|
+
function ir(e, r, t, n, u) {
|
|
463
|
+
{
|
|
464
|
+
var s, o = {}, a = null, O = null;
|
|
465
|
+
t !== void 0 && (ye(t), a = "" + t), rr(r) && (ye(r.key), a = "" + r.key), er(r) && (O = r.ref, tr(r, u));
|
|
466
|
+
for (s in r)
|
|
467
|
+
W.call(r, s) && !Qe.hasOwnProperty(s) && (o[s] = r[s]);
|
|
468
|
+
if (e && e.defaultProps) {
|
|
469
|
+
var b = e.defaultProps;
|
|
470
|
+
for (s in b)
|
|
471
|
+
o[s] === void 0 && (o[s] = b[s]);
|
|
472
|
+
}
|
|
473
|
+
if (a || O) {
|
|
474
|
+
var h = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
|
|
475
|
+
a && nr(o, h), O && ar(o, h);
|
|
476
|
+
}
|
|
477
|
+
return or(e, a, O, u, n, be.current, o);
|
|
478
|
+
}
|
|
479
|
+
}
|
|
480
|
+
var H = S.ReactCurrentOwner, me = S.ReactDebugCurrentFrame;
|
|
481
|
+
function I(e) {
|
|
482
|
+
if (e) {
|
|
483
|
+
var r = e._owner, t = U(e.type, e._source, r ? r.type : null);
|
|
484
|
+
me.setExtraStackFrame(t);
|
|
485
|
+
} else
|
|
486
|
+
me.setExtraStackFrame(null);
|
|
487
|
+
}
|
|
488
|
+
var Z;
|
|
489
|
+
Z = !1;
|
|
490
|
+
function Q(e) {
|
|
491
|
+
return typeof e == "object" && e !== null && e.$$typeof === i;
|
|
492
|
+
}
|
|
493
|
+
function Re() {
|
|
494
|
+
{
|
|
495
|
+
if (H.current) {
|
|
496
|
+
var e = D(H.current.type);
|
|
497
|
+
if (e)
|
|
498
|
+
return `
|
|
499
|
+
|
|
500
|
+
Check the render method of \`` + e + "`.";
|
|
501
|
+
}
|
|
502
|
+
return "";
|
|
503
|
+
}
|
|
504
|
+
}
|
|
505
|
+
function ur(e) {
|
|
506
|
+
return "";
|
|
507
|
+
}
|
|
508
|
+
var _e = {};
|
|
509
|
+
function sr(e) {
|
|
510
|
+
{
|
|
511
|
+
var r = Re();
|
|
512
|
+
if (!r) {
|
|
513
|
+
var t = typeof e == "string" ? e : e.displayName || e.name;
|
|
514
|
+
t && (r = `
|
|
515
|
+
|
|
516
|
+
Check the top-level render call using <` + t + ">.");
|
|
517
|
+
}
|
|
518
|
+
return r;
|
|
519
|
+
}
|
|
520
|
+
}
|
|
521
|
+
function Se(e, r) {
|
|
522
|
+
{
|
|
523
|
+
if (!e._store || e._store.validated || e.key != null)
|
|
524
|
+
return;
|
|
525
|
+
e._store.validated = !0;
|
|
526
|
+
var t = sr(r);
|
|
527
|
+
if (_e[t])
|
|
528
|
+
return;
|
|
529
|
+
_e[t] = !0;
|
|
530
|
+
var n = "";
|
|
531
|
+
e && e._owner && e._owner !== H.current && (n = " It was passed a child from " + D(e._owner.type) + "."), I(e), T('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', t, n), I(null);
|
|
532
|
+
}
|
|
533
|
+
}
|
|
534
|
+
function Te(e, r) {
|
|
535
|
+
{
|
|
536
|
+
if (typeof e != "object")
|
|
537
|
+
return;
|
|
538
|
+
if (X(e))
|
|
539
|
+
for (var t = 0; t < e.length; t++) {
|
|
540
|
+
var n = e[t];
|
|
541
|
+
Q(n) && Se(n, r);
|
|
542
|
+
}
|
|
543
|
+
else if (Q(e))
|
|
544
|
+
e._store && (e._store.validated = !0);
|
|
545
|
+
else if (e) {
|
|
546
|
+
var u = E(e);
|
|
547
|
+
if (typeof u == "function" && u !== e.entries)
|
|
548
|
+
for (var s = u.call(e), o; !(o = s.next()).done; )
|
|
549
|
+
Q(o.value) && Se(o.value, r);
|
|
550
|
+
}
|
|
551
|
+
}
|
|
552
|
+
}
|
|
553
|
+
function cr(e) {
|
|
554
|
+
{
|
|
555
|
+
var r = e.type;
|
|
556
|
+
if (r == null || typeof r == "string")
|
|
557
|
+
return;
|
|
558
|
+
var t;
|
|
559
|
+
if (typeof r == "function")
|
|
560
|
+
t = r.propTypes;
|
|
561
|
+
else if (typeof r == "object" && (r.$$typeof === f || // Note: Memo only checks outer props here.
|
|
562
|
+
// Inner props are checked in the reconciler.
|
|
563
|
+
r.$$typeof === _))
|
|
564
|
+
t = r.propTypes;
|
|
565
|
+
else
|
|
566
|
+
return;
|
|
567
|
+
if (t) {
|
|
568
|
+
var n = D(r);
|
|
569
|
+
Ge(t, e.props, "prop", n, e);
|
|
570
|
+
} else if (r.PropTypes !== void 0 && !Z) {
|
|
571
|
+
Z = !0;
|
|
572
|
+
var u = D(r);
|
|
573
|
+
T("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", u || "Unknown");
|
|
574
|
+
}
|
|
575
|
+
typeof r.getDefaultProps == "function" && !r.getDefaultProps.isReactClassApproved && T("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
|
576
|
+
}
|
|
577
|
+
}
|
|
578
|
+
function fr(e) {
|
|
579
|
+
{
|
|
580
|
+
for (var r = Object.keys(e.props), t = 0; t < r.length; t++) {
|
|
581
|
+
var n = r[t];
|
|
582
|
+
if (n !== "children" && n !== "key") {
|
|
583
|
+
I(e), T("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", n), I(null);
|
|
584
|
+
break;
|
|
585
|
+
}
|
|
586
|
+
}
|
|
587
|
+
e.ref !== null && (I(e), T("Invalid attribute `ref` supplied to `React.Fragment`."), I(null));
|
|
588
|
+
}
|
|
589
|
+
}
|
|
590
|
+
var Oe = {};
|
|
591
|
+
function Pe(e, r, t, n, u, s) {
|
|
592
|
+
{
|
|
593
|
+
var o = Ne(e);
|
|
594
|
+
if (!o) {
|
|
595
|
+
var a = "";
|
|
596
|
+
(e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (a += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
|
|
597
|
+
var O = ur();
|
|
598
|
+
O ? a += O : a += Re();
|
|
599
|
+
var b;
|
|
600
|
+
e === null ? b = "null" : X(e) ? b = "array" : e !== void 0 && e.$$typeof === i ? (b = "<" + (D(e.type) || "Unknown") + " />", a = " Did you accidentally export a JSX literal instead of a component?") : b = typeof e, T("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", b, a);
|
|
601
|
+
}
|
|
602
|
+
var h = ir(e, r, t, u, s);
|
|
603
|
+
if (h == null)
|
|
604
|
+
return h;
|
|
605
|
+
if (o) {
|
|
606
|
+
var x = r.children;
|
|
607
|
+
if (x !== void 0)
|
|
608
|
+
if (n)
|
|
609
|
+
if (X(x)) {
|
|
610
|
+
for (var V = 0; V < x.length; V++)
|
|
611
|
+
Te(x[V], e);
|
|
612
|
+
Object.freeze && Object.freeze(x);
|
|
613
|
+
} else
|
|
614
|
+
T("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
|
|
615
|
+
else
|
|
616
|
+
Te(x, e);
|
|
617
|
+
}
|
|
618
|
+
if (W.call(r, "key")) {
|
|
619
|
+
var F = D(e), C = Object.keys(r).filter(function(yr) {
|
|
620
|
+
return yr !== "key";
|
|
621
|
+
}), ee = C.length > 0 ? "{key: someKey, " + C.join(": ..., ") + ": ...}" : "{key: someKey}";
|
|
622
|
+
if (!Oe[F + ee]) {
|
|
623
|
+
var gr = C.length > 0 ? "{" + C.join(": ..., ") + ": ...}" : "{}";
|
|
624
|
+
T(`A props object containing a "key" prop is being spread into JSX:
|
|
625
|
+
let props = %s;
|
|
626
|
+
<%s {...props} />
|
|
627
|
+
React keys must be passed directly to JSX without using spread:
|
|
628
|
+
let props = %s;
|
|
629
|
+
<%s key={someKey} {...props} />`, ee, F, gr, F), Oe[F + ee] = !0;
|
|
630
|
+
}
|
|
631
|
+
}
|
|
632
|
+
return e === g ? fr(h) : cr(h), h;
|
|
633
|
+
}
|
|
634
|
+
}
|
|
635
|
+
function lr(e, r, t) {
|
|
636
|
+
return Pe(e, r, t, !0);
|
|
637
|
+
}
|
|
638
|
+
function dr(e, r, t) {
|
|
639
|
+
return Pe(e, r, t, !1);
|
|
640
|
+
}
|
|
641
|
+
var vr = dr, pr = lr;
|
|
642
|
+
M.Fragment = g, M.jsx = vr, M.jsxs = pr;
|
|
643
|
+
})()), M;
|
|
644
|
+
}
|
|
645
|
+
var xe;
|
|
646
|
+
function wr() {
|
|
647
|
+
return xe || (xe = 1, process.env.NODE_ENV === "production" ? q.exports = Pr() : q.exports = Cr()), q.exports;
|
|
648
|
+
}
|
|
649
|
+
var xr = wr();
|
|
650
|
+
const Fe = br({
|
|
651
|
+
stateVocab: {},
|
|
652
|
+
setStateVocab: () => {
|
|
653
|
+
}
|
|
654
|
+
});
|
|
655
|
+
function jr() {
|
|
656
|
+
return Er(Fe);
|
|
657
|
+
}
|
|
658
|
+
const Dr = ({ children: d }) => {
|
|
659
|
+
const [i, c] = hr({});
|
|
660
|
+
return console.log(i), /* @__PURE__ */ xr.jsx(Fe.Provider, { value: { stateVocab: i, setStateVocab: c }, children: d });
|
|
661
|
+
};
|
|
662
|
+
function Ar(d = {}) {
|
|
663
|
+
const {
|
|
664
|
+
storage: i,
|
|
665
|
+
serialize: c = JSON.stringify,
|
|
666
|
+
deserialize: g = JSON.parse,
|
|
667
|
+
defaultValue: l
|
|
668
|
+
} = d;
|
|
669
|
+
return {
|
|
670
|
+
[Ae]: !0,
|
|
671
|
+
// marks this object as a leaf in the router tree
|
|
672
|
+
[K]: "",
|
|
673
|
+
// placeholder; injected at runtime by injectPaths()
|
|
674
|
+
useState(m, R) {
|
|
675
|
+
R ??= {};
|
|
676
|
+
const y = Or(
|
|
677
|
+
R.onSet ?? (() => {
|
|
678
|
+
}),
|
|
679
|
+
R.delayedSet,
|
|
680
|
+
[]
|
|
681
|
+
), f = jr(), v = this[K], p = () => typeof m == "function" ? m() : m ?? l, _ = re(
|
|
682
|
+
() => {
|
|
683
|
+
if (!i)
|
|
684
|
+
return;
|
|
685
|
+
const P = i.getItem(v);
|
|
686
|
+
let E;
|
|
687
|
+
if (P === null) {
|
|
688
|
+
const S = p();
|
|
689
|
+
if (typeof S > "u")
|
|
690
|
+
return;
|
|
691
|
+
E = S;
|
|
692
|
+
} else
|
|
693
|
+
E = g(P);
|
|
694
|
+
return E;
|
|
695
|
+
},
|
|
696
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
697
|
+
[v]
|
|
698
|
+
), w = re(
|
|
699
|
+
() => _r(
|
|
700
|
+
f.stateVocab,
|
|
701
|
+
v,
|
|
702
|
+
_ ?? p()
|
|
703
|
+
),
|
|
704
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
705
|
+
[
|
|
706
|
+
f.stateVocab,
|
|
707
|
+
_,
|
|
708
|
+
v
|
|
709
|
+
]
|
|
710
|
+
), k = (P) => (E) => {
|
|
711
|
+
const S = { ...E };
|
|
712
|
+
return Sr(S, v, P), S;
|
|
713
|
+
};
|
|
714
|
+
mr(
|
|
715
|
+
() => {
|
|
716
|
+
!i || !_ || f.setStateVocab(k(_));
|
|
717
|
+
},
|
|
718
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
719
|
+
[_]
|
|
720
|
+
);
|
|
721
|
+
const j = Rr(w);
|
|
722
|
+
return [
|
|
723
|
+
w,
|
|
724
|
+
function(E) {
|
|
725
|
+
const S = typeof E == "function" ? E(j.current) : E;
|
|
726
|
+
f.setStateVocab(k(S)), y(S, j.current), i && i.setItem(v, c(S)), j.current = S;
|
|
727
|
+
},
|
|
728
|
+
function() {
|
|
729
|
+
const E = p();
|
|
730
|
+
if (typeof E > "u") {
|
|
731
|
+
i?.removeItem(v);
|
|
732
|
+
return;
|
|
733
|
+
}
|
|
734
|
+
f.setStateVocab(k(E)), y(E, j.current), j.current = E, i && i.setItem(v, c(E));
|
|
735
|
+
}
|
|
736
|
+
];
|
|
737
|
+
},
|
|
738
|
+
/** Returns the fully qualified job name (dot-separated path). */
|
|
739
|
+
toString() {
|
|
740
|
+
return this[K];
|
|
741
|
+
}
|
|
742
|
+
};
|
|
743
|
+
}
|
|
744
|
+
const je = /* @__PURE__ */ new WeakMap(), ke = /* @__PURE__ */ new WeakMap();
|
|
745
|
+
function Ie(d, i = "") {
|
|
746
|
+
let c = je.get(d);
|
|
747
|
+
c || (c = /* @__PURE__ */ new Map(), je.set(d, c));
|
|
748
|
+
const g = c.get(i);
|
|
749
|
+
if (g)
|
|
750
|
+
return g;
|
|
751
|
+
const l = new Proxy(d, {
|
|
752
|
+
get(m, R) {
|
|
753
|
+
const y = m[R], f = i ? `${i}.${String(R)}` : String(R);
|
|
754
|
+
if (y && typeof y == "object" && Ae in y) {
|
|
755
|
+
const v = y;
|
|
756
|
+
let p = ke.get(v);
|
|
757
|
+
p || (p = /* @__PURE__ */ new Map(), ke.set(v, p));
|
|
758
|
+
const _ = p.get(f);
|
|
759
|
+
if (_)
|
|
760
|
+
return _;
|
|
761
|
+
const w = Reflect.ownKeys(v).filter(
|
|
762
|
+
(P) => typeof v[P] == "function"
|
|
763
|
+
), k = Object.fromEntries(
|
|
764
|
+
w.map((P) => [
|
|
765
|
+
P,
|
|
766
|
+
(...E) => v[P].call(
|
|
767
|
+
{ ...v, [K]: f },
|
|
768
|
+
...E
|
|
769
|
+
)
|
|
770
|
+
])
|
|
771
|
+
), j = { ...v, ...k };
|
|
772
|
+
return p.set(f, j), j;
|
|
773
|
+
}
|
|
774
|
+
return y && typeof y == "object" ? Ie(y, f) : y;
|
|
775
|
+
}
|
|
776
|
+
});
|
|
777
|
+
return c.set(i, l), l;
|
|
778
|
+
}
|
|
779
|
+
function Fr(d) {
|
|
780
|
+
return Ie(d);
|
|
781
|
+
}
|
|
782
|
+
export {
|
|
783
|
+
Dr as StorageProvider,
|
|
784
|
+
Ar as defineState,
|
|
785
|
+
Fr as setupStorage
|
|
786
|
+
};
|
package/package.json
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@yakocloud/state-vocab",
|
|
3
|
+
"version": "1.0.1",
|
|
4
|
+
"main": "dist/state-vocab.cjs.js",
|
|
5
|
+
"module": "dist/state-vocab.es.js",
|
|
6
|
+
"types": "dist/types/index.d.ts",
|
|
7
|
+
"files": [
|
|
8
|
+
"dist"
|
|
9
|
+
],
|
|
10
|
+
"scripts": {
|
|
11
|
+
"dev": "vite",
|
|
12
|
+
"build": "tsc -b && vite build",
|
|
13
|
+
"lint": "eslint .",
|
|
14
|
+
"build:types": "tsc --project tsconfig.types.json"
|
|
15
|
+
},
|
|
16
|
+
"peerDependencies": {
|
|
17
|
+
"react": "^18.0.0",
|
|
18
|
+
"react-dom": "^18.0.0"
|
|
19
|
+
},
|
|
20
|
+
"devDependencies": {
|
|
21
|
+
"@eslint/js": "^9.39.1",
|
|
22
|
+
"@types/node": "^24.10.1",
|
|
23
|
+
"@types/react": "^19.2.5",
|
|
24
|
+
"@types/react-dom": "^19.2.3",
|
|
25
|
+
"@vitejs/plugin-react": "^5.1.1",
|
|
26
|
+
"eslint": "^9.39.1",
|
|
27
|
+
"eslint-plugin-react-hooks": "^7.0.1",
|
|
28
|
+
"eslint-plugin-react-refresh": "^0.4.24",
|
|
29
|
+
"globals": "^16.5.0",
|
|
30
|
+
"typescript": "~5.9.3",
|
|
31
|
+
"typescript-eslint": "^8.46.4",
|
|
32
|
+
"vite": "^7.2.4"
|
|
33
|
+
}
|
|
34
|
+
}
|