@yakocloud/state-vocab 1.0.4 → 2.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 CHANGED
@@ -275,6 +275,7 @@ function Dashboard() {
275
275
  const [counter, setCounter, resetCounter] = storage.stats.counter.useState(0)
276
276
  const [note, setNote] = storage.personal.note.useState('', {
277
277
  delayedSet: 500,
278
+ bidirectional: true,
278
279
  onSet: (v) => console.log('Saving note:', v),
279
280
  })
280
281
 
@@ -323,6 +324,7 @@ createRoot(document.getElementById('root')!).render(
323
324
  |---|---|---|
324
325
  | `storage` | `Storage \| undefined` | `undefined` (in-memory) |
325
326
  | `defaultValue` | `T \| undefined` | `undefined` |
327
+ | `bidirectional` | `true \| undefined` | `undefined` |
326
328
  | `serialize` | `(v: T) => string` | `JSON.stringify` |
327
329
  | `deserialize` | `(v: string) => T` | `JSON.parse` |
328
330
 
@@ -341,5 +343,6 @@ React context provider. Must be an ancestor of any component using `.useState()`
341
343
  | `defaultValue` | `D \| (() => D) \| undefined` | Local default, overrides `defineState` default |
342
344
  | `options.delayedSet` | `number \| undefined` | Debounce delay for `onSet` in ms |
343
345
  | `options.onSet` | `(next: D, prev: D) => void \| undefined` | Callback after state change |
346
+ | `options.bidirectional` | `true \| undefined` | bidirectional state update to sync tabs |
344
347
 
345
348
  Returns `[value, setValue, resetValue]`.
@@ -1,14 +1,16 @@
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`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const j=require("react"),Ve=Symbol("state-def"),K=Symbol("state-path");function Er(o,a,u){if(!a)return o;const s=a.split(".");let c=o;for(const y of s)if(c!==null&&typeof c=="object"&&y in c)c=c[y];else return u;return c===void 0?u:c}function mr(o,a,u){const s=a.replace(/\[(\d+)\]/g,".$1").split(".");let c=o;for(let y=0;y<s.length-1;y++){const h=s[y],p=s[y+1];(c[h]===void 0||c[h]===null)&&(c[h]=/^\d+$/.test(p)?[]:{}),c=c[h]}return c[s[s.length-1]]=u,o}function Rr(o,a=0){let u;return function(...s){u!==void 0&&clearTimeout(u),u=setTimeout(()=>{u=void 0,o.apply(this,s)},a)}}function _r(o,a,u=[]){return j.useMemo(()=>Rr(o,a),u)}function Sr(o){const a=JSON.stringify(o,null,2).split(`
2
+ `),u=[],s=[];for(const c of a){const y=c.match(/^(\s*)"([^"]+)"(\s*:\s*)(.+)$/);if(y){const[,h,p,g,b]=y;u.push(`${h}%c"${p}"%c${g}%c${b}`),s.push("color: #9cdcfe; font-weight: bold","color: #cccccc","color: #ce9178")}else u.push(`%c${c}`),s.push("color: #cccccc")}console.log(u.join(`
3
+ `),...s,o)}var z={exports:{}},Y={};var xe;function Tr(){if(xe)return Y;xe=1;var o=j,a=Symbol.for("react.element"),u=Symbol.for("react.fragment"),s=Object.prototype.hasOwnProperty,c=o.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,y={key:!0,ref:!0,__self:!0,__source:!0};function h(p,g,b){var f,_={},C=null,w=null;b!==void 0&&(C=""+b),g.key!==void 0&&(C=""+g.key),g.ref!==void 0&&(w=g.ref);for(f in g)s.call(g,f)&&!y.hasOwnProperty(f)&&(_[f]=g[f]);if(p&&p.defaultProps)for(f in g=p.defaultProps,g)_[f]===void 0&&(_[f]=g[f]);return{$$typeof:a,type:p,key:C,ref:w,props:_,_owner:c.current}}return Y.Fragment=u,Y.jsx=h,Y.jsxs=h,Y}var L={};var je;function wr(){return je||(je=1,process.env.NODE_ENV!=="production"&&(function(){var o=j,a=Symbol.for("react.element"),u=Symbol.for("react.portal"),s=Symbol.for("react.fragment"),c=Symbol.for("react.strict_mode"),y=Symbol.for("react.profiler"),h=Symbol.for("react.provider"),p=Symbol.for("react.context"),g=Symbol.for("react.forward_ref"),b=Symbol.for("react.suspense"),f=Symbol.for("react.suspense_list"),_=Symbol.for("react.memo"),C=Symbol.for("react.lazy"),w=Symbol.for("react.offscreen"),O=Symbol.iterator,R="@@iterator";function k(e){if(e===null||typeof e!="object")return null;var r=O&&e[O]||e[R];return typeof r=="function"?r:null}var D=o.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function S(e){{for(var r=arguments.length,t=new Array(r>1?r-1:0),n=1;n<r;n++)t[n-1]=arguments[n];We("error",e,t)}}function We(e,r,t){{var n=D.ReactDebugCurrentFrame,d=n.getStackAddendum();d!==""&&(r+="%s",t=t.concat([d]));var v=t.map(function(l){return String(l)});v.unshift("Warning: "+r),Function.prototype.apply.call(console[e],console,v)}}var Me=!1,Ye=!1,Le=!1,Ne=!1,Ue=!1,ae;ae=Symbol.for("react.module.reference");function Je(e){return!!(typeof e=="string"||typeof e=="function"||e===s||e===y||Ue||e===c||e===b||e===f||Ne||e===w||Me||Ye||Le||typeof e=="object"&&e!==null&&(e.$$typeof===C||e.$$typeof===_||e.$$typeof===h||e.$$typeof===p||e.$$typeof===g||e.$$typeof===ae||e.getModuleId!==void 0))}function qe(e,r,t){var n=e.displayName;if(n)return n;var d=r.displayName||r.name||"";return d!==""?t+"("+d+")":t}function oe(e){return e.displayName||"Context"}function A(e){if(e==null)return null;if(typeof e.tag=="number"&&S("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 s:return"Fragment";case u:return"Portal";case y:return"Profiler";case c:return"StrictMode";case b:return"Suspense";case f:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case p:var r=e;return oe(r)+".Consumer";case h:var t=e;return oe(t._context)+".Provider";case g:return qe(e,e.render,"ForwardRef");case _:var n=e.displayName||null;return n!==null?n:A(e.type)||"Memo";case C:{var d=e,v=d._payload,l=d._init;try{return A(l(v))}catch{return null}}}return null}var F=Object.assign,W=0,ie,ue,se,ce,le,fe,de;function ve(){}ve.__reactDisabledLog=!0;function ze(){{if(W===0){ie=console.log,ue=console.info,se=console.warn,ce=console.error,le=console.group,fe=console.groupCollapsed,de=console.groupEnd;var e={configurable:!0,enumerable:!0,value:ve,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}W++}}function Be(){{if(W--,W===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:F({},e,{value:ie}),info:F({},e,{value:ue}),warn:F({},e,{value:se}),error:F({},e,{value:ce}),group:F({},e,{value:le}),groupCollapsed:F({},e,{value:fe}),groupEnd:F({},e,{value:de})})}W<0&&S("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var G=D.ReactCurrentDispatcher,X;function N(e,r,t){{if(X===void 0)try{throw Error()}catch(d){var n=d.stack.trim().match(/\n( *(at )?)/);X=n&&n[1]||""}return`
4
+ `+X+e}}var H=!1,U;{var Ke=typeof WeakMap=="function"?WeakMap:Map;U=new Ke}function pe(e,r){if(!e||H)return"";{var t=U.get(e);if(t!==void 0)return t}var n;H=!0;var d=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var v;v=G.current,G.current=null,ze();try{if(r){var l=function(){throw Error()};if(Object.defineProperty(l.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(l,[])}catch(P){n=P}Reflect.construct(e,[],l)}else{try{l.call()}catch(P){n=P}e.call(l.prototype)}}else{try{throw Error()}catch(P){n=P}e()}}catch(P){if(P&&n&&typeof P.stack=="string"){for(var i=P.stack.split(`
5
+ `),T=n.stack.split(`
6
+ `),E=i.length-1,m=T.length-1;E>=1&&m>=0&&i[E]!==T[m];)m--;for(;E>=1&&m>=0;E--,m--)if(i[E]!==T[m]){if(E!==1||m!==1)do if(E--,m--,m<0||i[E]!==T[m]){var x=`
7
+ `+i[E].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(E>=1&&m>=0);break}}}finally{H=!1,G.current=v,Be(),Error.prepareStackTrace=d}var $=e?e.displayName||e.name:"",V=$?N($):"";return typeof e=="function"&&U.set(e,V),V}function Ge(e,r,t){return pe(e,!1)}function Xe(e){var r=e.prototype;return!!(r&&r.isReactComponent)}function J(e,r,t){if(e==null)return"";if(typeof e=="function")return pe(e,Xe(e));if(typeof e=="string")return N(e);switch(e){case b:return N("Suspense");case f:return N("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case g:return Ge(e.render);case _:return J(e.type,r,t);case C:{var n=e,d=n._payload,v=n._init;try{return J(v(d),r,t)}catch{}}}return""}var M=Object.prototype.hasOwnProperty,ge={},ye=D.ReactDebugCurrentFrame;function q(e){if(e){var r=e._owner,t=J(e.type,e._source,r?r.type:null);ye.setExtraStackFrame(t)}else ye.setExtraStackFrame(null)}function He(e,r,t,n,d){{var v=Function.call.bind(M);for(var l in e)if(v(e,l)){var i=void 0;try{if(typeof e[l]!="function"){var T=Error((n||"React class")+": "+t+" type `"+l+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[l]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw T.name="Invariant Violation",T}i=e[l](r,l,n,t,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(E){i=E}i&&!(i instanceof Error)&&(q(d),S("%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,l,typeof i),q(null)),i instanceof Error&&!(i.message in ge)&&(ge[i.message]=!0,q(d),S("Failed %s type: %s",t,i.message),q(null))}}}var Ze=Array.isArray;function Z(e){return Ze(e)}function Qe(e){{var r=typeof Symbol=="function"&&Symbol.toStringTag,t=r&&e[Symbol.toStringTag]||e.constructor.name||"Object";return t}}function er(e){try{return be(e),!1}catch{return!0}}function be(e){return""+e}function he(e){if(er(e))return S("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",Qe(e)),be(e)}var Ee=D.ReactCurrentOwner,rr={key:!0,ref:!0,__self:!0,__source:!0},me,Re;function tr(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 nr(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 ar(e,r){typeof e.ref=="string"&&Ee.current}function or(e,r){{var t=function(){me||(me=!0,S("%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 ir(e,r){{var t=function(){Re||(Re=!0,S("%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 ur=function(e,r,t,n,d,v,l){var i={$$typeof:a,type:e,key:r,ref:t,props:l,_owner:v};return i._store={},Object.defineProperty(i._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(i,"_self",{configurable:!1,enumerable:!1,writable:!1,value:n}),Object.defineProperty(i,"_source",{configurable:!1,enumerable:!1,writable:!1,value:d}),Object.freeze&&(Object.freeze(i.props),Object.freeze(i)),i};function sr(e,r,t,n,d){{var v,l={},i=null,T=null;t!==void 0&&(he(t),i=""+t),nr(r)&&(he(r.key),i=""+r.key),tr(r)&&(T=r.ref,ar(r,d));for(v in r)M.call(r,v)&&!rr.hasOwnProperty(v)&&(l[v]=r[v]);if(e&&e.defaultProps){var E=e.defaultProps;for(v in E)l[v]===void 0&&(l[v]=E[v])}if(i||T){var m=typeof e=="function"?e.displayName||e.name||"Unknown":e;i&&or(l,m),T&&ir(l,m)}return ur(e,i,T,d,n,Ee.current,l)}}var Q=D.ReactCurrentOwner,_e=D.ReactDebugCurrentFrame;function I(e){if(e){var r=e._owner,t=J(e.type,e._source,r?r.type:null);_e.setExtraStackFrame(t)}else _e.setExtraStackFrame(null)}var ee;ee=!1;function re(e){return typeof e=="object"&&e!==null&&e.$$typeof===a}function Se(){{if(Q.current){var e=A(Q.current.type);if(e)return`
6
8
 
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=`
9
+ Check the render method of \``+e+"`."}return""}}function cr(e){return""}var Te={};function lr(e){{var r=Se();if(!r){var t=typeof e=="string"?e:e.displayName||e.name;t&&(r=`
8
10
 
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:
11
+ Check the top-level render call using <`+t+">.")}return r}}function we(e,r){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var t=lr(r);if(Te[t])return;Te[t]=!0;var n="";e&&e._owner&&e._owner!==Q.current&&(n=" It was passed a child from "+A(e._owner.type)+"."),I(e),S('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)}}function Pe(e,r){{if(typeof e!="object")return;if(Z(e))for(var t=0;t<e.length;t++){var n=e[t];re(n)&&we(n,r)}else if(re(e))e._store&&(e._store.validated=!0);else if(e){var d=k(e);if(typeof d=="function"&&d!==e.entries)for(var v=d.call(e),l;!(l=v.next()).done;)re(l.value)&&we(l.value,r)}}}function fr(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===g||r.$$typeof===_))t=r.propTypes;else return;if(t){var n=A(r);He(t,e.props,"prop",n,e)}else if(r.PropTypes!==void 0&&!ee){ee=!0;var d=A(r);S("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",d||"Unknown")}typeof r.getDefaultProps=="function"&&!r.getDefaultProps.isReactClassApproved&&S("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function dr(e){{for(var r=Object.keys(e.props),t=0;t<r.length;t++){var n=r[t];if(n!=="children"&&n!=="key"){I(e),S("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",n),I(null);break}}e.ref!==null&&(I(e),S("Invalid attribute `ref` supplied to `React.Fragment`."),I(null))}}var Ce={};function Oe(e,r,t,n,d,v){{var l=Je(e);if(!l){var i="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(i+=" 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 T=cr();T?i+=T:i+=Se();var E;e===null?E="null":Z(e)?E="array":e!==void 0&&e.$$typeof===a?(E="<"+(A(e.type)||"Unknown")+" />",i=" Did you accidentally export a JSX literal instead of a component?"):E=typeof e,S("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",E,i)}var m=sr(e,r,t,d,v);if(m==null)return m;if(l){var x=r.children;if(x!==void 0)if(n)if(Z(x)){for(var $=0;$<x.length;$++)Pe(x[$],e);Object.freeze&&Object.freeze(x)}else S("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 Pe(x,e)}if(M.call(r,"key")){var V=A(e),P=Object.keys(r).filter(function(hr){return hr!=="key"}),te=P.length>0?"{key: someKey, "+P.join(": ..., ")+": ...}":"{key: someKey}";if(!Ce[V+te]){var br=P.length>0?"{"+P.join(": ..., ")+": ...}":"{}";S(`A props object containing a "key" prop is being spread into JSX:
10
12
  let props = %s;
11
13
  <%s {...props} />
12
14
  React keys must be passed directly to JSX without using spread:
13
15
  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;
16
+ <%s key={someKey} {...props} />`,te,V,br,V),Ce[V+te]=!0}}return e===s?dr(m):fr(m),m}}function vr(e,r,t){return Oe(e,r,t,!0)}function pr(e,r,t){return Oe(e,r,t,!1)}var gr=pr,yr=vr;L.Fragment=s,L.jsx=gr,L.jsxs=yr})()),L}var ke;function Pr(){return ke||(ke=1,process.env.NODE_ENV==="production"?z.exports=Tr():z.exports=wr()),z.exports}var Cr=Pr();const Ie=j.createContext({stateVocab:{},setStateVocab:()=>{}});function Or(){return j.useContext(Ie)}const xr=o=>{const{children:a,verbose:u}=o,[s,c]=j.useState({});return u&&Sr(s),Cr.jsx(Ie.Provider,{value:{stateVocab:s,setStateVocab:c},children:a})},B=(o,a)=>u=>{const s={...u};return mr(s,o,a),s},ne=(o,a)=>typeof o=="function"?o():o??a,De=o=>{const{serialized:a,defaultValue:u,superDefaultValue:s,deserialize:c}=o;if(a===null){const y=ne(u,s);return typeof y>"u"?void 0:y}return c(a)};function jr(o={}){const{storage:a,serialize:u=JSON.stringify,deserialize:s=JSON.parse}=o,c=o.defaultValue,y=o.bidirectional;return{[Ve]:!0,[K]:"",useState(h,p){p??={};const g=_r(p.onSet??(()=>{}),p.delayedSet,[]),b=Or(),f=this[K],_=j.useMemo(()=>{if(!a)return;const O=a.getItem(f);return De({serialized:O,defaultValue:h,superDefaultValue:c,deserialize:s})},[f]),C=j.useMemo(()=>Er(b.stateVocab,f,_??ne(h,c)),[b.stateVocab,_,f]);j.useEffect(()=>{!a||typeof _>"u"||b.setStateVocab(B(f,_))},[_]),j.useEffect(()=>{if(!p.bidirectional&&!y)return;const O=R=>{if(R.key!==f)return;const k=R.newValue,D=De({serialized:k,defaultValue:h,superDefaultValue:c,deserialize:s});b.setStateVocab(B(f,D)),g(D,w.current),w.current=D};return window.addEventListener("storage",O),()=>window.removeEventListener("storage",O)},[f,p.bidirectional,y]);const w=j.useRef(C);return[C,function(R){const k=typeof R=="function"?R(w.current):R;b.setStateVocab(B(f,k)),g(k,w.current),a&&a.setItem(f,u(k)),w.current=k},function(){const R=ne(h,c);if(typeof R>"u"){a?.removeItem(f);return}b.setStateVocab(B(f,R)),g(R,w.current),w.current=R,a&&a.setItem(f,u(R))}]},toString(){return this[K]}}}const Ae=new WeakMap,Fe=new WeakMap;function $e(o,a=""){let u=Ae.get(o);u||(u=new Map,Ae.set(o,u));const s=u.get(a);if(s)return s;const c=new Proxy(o,{get(y,h){const p=y[h],g=a?`${a}.${String(h)}`:String(h);if(p&&typeof p=="object"&&Ve in p){const b=p;let f=Fe.get(b);f||(f=new Map,Fe.set(b,f));const _=f.get(g);if(_)return _;const C=Reflect.ownKeys(b).filter(R=>typeof b[R]=="function"),w=Object.fromEntries(C.map(R=>[R,(...k)=>b[R].call({...b,[K]:g},...k)])),O={...b,...w};return f.set(g,O),O}return p&&typeof p=="object"?$e(p,g):p}});return u.set(a,c),c}function kr(o){return $e(o)}exports.StorageProvider=xr;exports.defineState=jr;exports.setupStorage=kr;