@powerhousedao/connect 1.0.0-dev.211 → 1.0.0-dev.213
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/dist/.env +1 -0
- package/dist/assets/{app-ec_tqKyy.js → app-DiHFmipv.js} +772 -577
- package/dist/assets/{app-loader-D_w1htsM.js → app-loader-CR-NiUOZ.js} +9 -7
- package/dist/assets/{browser-Ccv5jMQ2.js → browser-C10aMa50.js} +2937 -909
- package/dist/assets/{ccip-BINxWLhB.js → ccip-DMxcOGc8.js} +5 -5
- package/dist/assets/{content-xyBITmn7.js → content-BFPuAVvX.js} +186 -162
- package/dist/assets/{getEnsName-DtQ0D82H.js → getEnsName-08yGhvFP.js} +75 -55
- package/dist/assets/{index-B76kqOWF.js → index-BSiq93_2.js} +3 -3
- package/dist/assets/{index-F6sLtgJX.js → index-C6RulKld.js} +3 -3
- package/dist/assets/{index-DMwoEUPC.js → index-J6o4darV.js} +88 -2732
- package/dist/assets/{isAddressEqual-CVC2WsAk.js → isAddressEqual-BZ4M2bfj.js} +1 -1
- package/dist/assets/{main.CyEpz8Xq.js → main.GY5oyZm-.js} +1 -1
- package/dist/assets/{react-error-boundary.esm-CSTN2MP_.js → react-error-boundary.esm-C6q5J1bx.js} +10 -10
- package/dist/assets/{root-wxc1EfqI.js → root-BWz1808T.js} +7 -7
- package/dist/assets/{router-BJrY_t-B.js → router-DYMMZqez.js} +7 -7
- package/dist/icon.ico +0 -0
- package/dist/index.html +5 -4
- package/dist/modules/@powerhousedao/reactor-browser/{chunk-QP65GEDP.js → chunk-C5JXP4NO.js} +2 -2
- package/dist/modules/@powerhousedao/reactor-browser/{chunk-YAO66KBZ.js → chunk-FD4TUZZS.js} +353 -302
- package/dist/modules/@powerhousedao/reactor-browser/chunk-FD4TUZZS.js.map +7 -0
- package/dist/modules/@powerhousedao/reactor-browser/{chunk-VNJW3K7R.js → chunk-GJOMXDVW.js} +3 -3
- package/dist/modules/@powerhousedao/reactor-browser/chunk-GJOMXDVW.js.map +7 -0
- package/dist/modules/@powerhousedao/reactor-browser/{chunk-VHDG2FTR.js → chunk-GXLBC3KA.js} +2 -2
- package/dist/modules/@powerhousedao/reactor-browser/{chunk-NCCSZUHV.js → chunk-IDBZA52T.js} +2 -2
- package/dist/modules/@powerhousedao/reactor-browser/{chunk-5Q3OAWSW.js → chunk-LCQV2CEG.js} +9 -5
- package/dist/modules/@powerhousedao/reactor-browser/chunk-LCQV2CEG.js.map +7 -0
- package/dist/modules/@powerhousedao/reactor-browser/{chunk-PRKHJCY6.js → chunk-OJYBFBSZ.js} +2 -2
- package/dist/modules/@powerhousedao/reactor-browser/{chunk-XDWKADEF.js → chunk-UTLXXWAE.js} +5 -5
- package/dist/modules/@powerhousedao/reactor-browser/{chunk-XDWKADEF.js.map → chunk-UTLXXWAE.js.map} +3 -3
- package/dist/modules/@powerhousedao/reactor-browser/{chunk-GYHJG3BX.js → chunk-WSWYH5W2.js} +2 -2
- package/dist/modules/@powerhousedao/reactor-browser/{chunk-NG3UCFCH.js → chunk-XNBBEHKQ.js} +16 -7
- package/dist/modules/@powerhousedao/reactor-browser/chunk-XNBBEHKQ.js.map +7 -0
- package/dist/modules/@powerhousedao/reactor-browser/context/index.js +2 -2
- package/dist/modules/@powerhousedao/reactor-browser/context/read-mode.js +2 -2
- package/dist/modules/@powerhousedao/reactor-browser/hooks/document-state.js +87 -0
- package/dist/modules/@powerhousedao/reactor-browser/hooks/document-state.js.map +7 -0
- package/dist/modules/@powerhousedao/reactor-browser/hooks/index.js +11 -9
- package/dist/modules/@powerhousedao/reactor-browser/hooks/useAddDebouncedOperations.js +3 -3
- package/dist/modules/@powerhousedao/reactor-browser/hooks/useConnectCrypto.js +2 -2
- package/dist/modules/@powerhousedao/reactor-browser/hooks/useDocumentDrives.js +2 -2
- package/dist/modules/@powerhousedao/reactor-browser/hooks/useDocumentEditor.js +9 -7
- package/dist/modules/@powerhousedao/reactor-browser/hooks/useDriveActions.js +2 -2
- package/dist/modules/@powerhousedao/reactor-browser/hooks/useDriveActionsWithUiNodes.js +3 -3
- package/dist/modules/@powerhousedao/reactor-browser/index.js +13 -11
- package/dist/modules/@powerhousedao/reactor-browser/reactor.js +2 -2
- package/dist/swEnv.js +1 -0
- package/dist/vite-envs.sh +10 -1
- package/package.json +10 -10
- package/dist/modules/@powerhousedao/reactor-browser/chunk-5Q3OAWSW.js.map +0 -7
- package/dist/modules/@powerhousedao/reactor-browser/chunk-NG3UCFCH.js.map +0 -7
- package/dist/modules/@powerhousedao/reactor-browser/chunk-VNJW3K7R.js.map +0 -7
- package/dist/modules/@powerhousedao/reactor-browser/chunk-YAO66KBZ.js.map +0 -7
- package/dist/modules/@powerhousedao/reactor-browser/hooks/useDocumentsState.js +0 -44
- package/dist/modules/@powerhousedao/reactor-browser/hooks/useDocumentsState.js.map +0 -7
- /package/dist/modules/@powerhousedao/reactor-browser/{chunk-QP65GEDP.js.map → chunk-C5JXP4NO.js.map} +0 -0
- /package/dist/modules/@powerhousedao/reactor-browser/{chunk-VHDG2FTR.js.map → chunk-GXLBC3KA.js.map} +0 -0
- /package/dist/modules/@powerhousedao/reactor-browser/{chunk-NCCSZUHV.js.map → chunk-IDBZA52T.js.map} +0 -0
- /package/dist/modules/@powerhousedao/reactor-browser/{chunk-PRKHJCY6.js.map → chunk-OJYBFBSZ.js.map} +0 -0
- /package/dist/modules/@powerhousedao/reactor-browser/{chunk-GYHJG3BX.js.map → chunk-WSWYH5W2.js.map} +0 -0
|
@@ -1,43 +1,25 @@
|
|
|
1
|
-
// ../../node_modules/.pnpm/jotai@2.
|
|
2
|
-
var keyCount = 0;
|
|
3
|
-
function atom(read, write) {
|
|
4
|
-
const key = `atom${++keyCount}`;
|
|
5
|
-
const config = {
|
|
6
|
-
toString() {
|
|
7
|
-
return (import.meta.env ? import.meta.env.MODE : void 0) !== "production" && this.debugLabel ? key + ":" + this.debugLabel : key;
|
|
8
|
-
}
|
|
9
|
-
};
|
|
10
|
-
if (typeof read === "function") {
|
|
11
|
-
config.read = read;
|
|
12
|
-
} else {
|
|
13
|
-
config.init = read;
|
|
14
|
-
config.read = defaultRead;
|
|
15
|
-
config.write = defaultWrite;
|
|
16
|
-
}
|
|
17
|
-
if (write) {
|
|
18
|
-
config.write = write;
|
|
19
|
-
}
|
|
20
|
-
return config;
|
|
21
|
-
}
|
|
22
|
-
function defaultRead(get) {
|
|
23
|
-
return get(this);
|
|
24
|
-
}
|
|
25
|
-
function defaultWrite(get, set, arg) {
|
|
26
|
-
return set(
|
|
27
|
-
this,
|
|
28
|
-
typeof arg === "function" ? arg(get(this)) : arg
|
|
29
|
-
);
|
|
30
|
-
}
|
|
1
|
+
// ../../node_modules/.pnpm/jotai@2.12.1_@types+react@18.3.18_react@18.3.1/node_modules/jotai/esm/vanilla/internals.mjs
|
|
31
2
|
var isSelfAtom = (atom2, a) => atom2.unstable_is ? atom2.unstable_is(a) : a === atom2;
|
|
32
3
|
var hasInitialValue = (atom2) => "init" in atom2;
|
|
33
4
|
var isActuallyWritableAtom = (atom2) => !!atom2.write;
|
|
34
|
-
var
|
|
5
|
+
var isAtomStateInitialized = (atomState) => "v" in atomState || "e" in atomState;
|
|
6
|
+
var returnAtomValue = (atomState) => {
|
|
7
|
+
if ("e" in atomState) {
|
|
8
|
+
throw atomState.e;
|
|
9
|
+
}
|
|
10
|
+
if ((import.meta.env ? import.meta.env.MODE : void 0) !== "production" && !("v" in atomState)) {
|
|
11
|
+
throw new Error("[Bug] atom state is not initialized");
|
|
12
|
+
}
|
|
13
|
+
return atomState.v;
|
|
14
|
+
};
|
|
15
|
+
var PROMISE_STATE = Symbol();
|
|
16
|
+
var getPromiseState = (promise) => promise[PROMISE_STATE];
|
|
35
17
|
var isPendingPromise = (value) => {
|
|
36
18
|
var _a;
|
|
37
|
-
return isPromiseLike(value) && !((_a =
|
|
19
|
+
return isPromiseLike(value) && !((_a = getPromiseState(value)) == null ? void 0 : _a[1]);
|
|
38
20
|
};
|
|
39
21
|
var cancelPromise = (promise, nextValue) => {
|
|
40
|
-
const promiseState =
|
|
22
|
+
const promiseState = getPromiseState(promise);
|
|
41
23
|
if (promiseState) {
|
|
42
24
|
promiseState[1] = true;
|
|
43
25
|
promiseState[0].forEach((fn) => fn(nextValue));
|
|
@@ -46,11 +28,11 @@ var cancelPromise = (promise, nextValue) => {
|
|
|
46
28
|
}
|
|
47
29
|
};
|
|
48
30
|
var patchPromiseForCancelability = (promise) => {
|
|
49
|
-
if (
|
|
31
|
+
if (getPromiseState(promise)) {
|
|
50
32
|
return;
|
|
51
33
|
}
|
|
52
34
|
const promiseState = [/* @__PURE__ */ new Set(), false];
|
|
53
|
-
|
|
35
|
+
promise[PROMISE_STATE] = promiseState;
|
|
54
36
|
const settle = () => {
|
|
55
37
|
promiseState[1] = true;
|
|
56
38
|
};
|
|
@@ -60,16 +42,6 @@ var patchPromiseForCancelability = (promise) => {
|
|
|
60
42
|
};
|
|
61
43
|
};
|
|
62
44
|
var isPromiseLike = (p) => typeof (p == null ? void 0 : p.then) === "function";
|
|
63
|
-
var isAtomStateInitialized = (atomState) => "v" in atomState || "e" in atomState;
|
|
64
|
-
var returnAtomValue = (atomState) => {
|
|
65
|
-
if ("e" in atomState) {
|
|
66
|
-
throw atomState.e;
|
|
67
|
-
}
|
|
68
|
-
if ((import.meta.env ? import.meta.env.MODE : void 0) !== "production" && !("v" in atomState)) {
|
|
69
|
-
throw new Error("[Bug] atom state is not initialized");
|
|
70
|
-
}
|
|
71
|
-
return atomState.v;
|
|
72
|
-
};
|
|
73
45
|
var addPendingPromiseToDependency = (atom2, promise, dependencyAtomState) => {
|
|
74
46
|
if (!dependencyAtomState.p.has(atom2)) {
|
|
75
47
|
dependencyAtomState.p.add(atom2);
|
|
@@ -83,60 +55,122 @@ var addPendingPromiseToDependency = (atom2, promise, dependencyAtomState) => {
|
|
|
83
55
|
);
|
|
84
56
|
}
|
|
85
57
|
};
|
|
86
|
-
var
|
|
58
|
+
var setAtomStateValueOrPromise = (atom2, valueOrPromise, ensureAtomState) => {
|
|
59
|
+
const atomState = ensureAtomState(atom2);
|
|
60
|
+
const hasPrevValue = "v" in atomState;
|
|
61
|
+
const prevValue = atomState.v;
|
|
62
|
+
const pendingPromise = isPendingPromise(atomState.v) ? atomState.v : null;
|
|
63
|
+
if (isPromiseLike(valueOrPromise)) {
|
|
64
|
+
patchPromiseForCancelability(valueOrPromise);
|
|
65
|
+
for (const a of atomState.d.keys()) {
|
|
66
|
+
addPendingPromiseToDependency(atom2, valueOrPromise, ensureAtomState(a));
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
atomState.v = valueOrPromise;
|
|
70
|
+
delete atomState.e;
|
|
71
|
+
if (!hasPrevValue || !Object.is(prevValue, atomState.v)) {
|
|
72
|
+
++atomState.n;
|
|
73
|
+
if (pendingPromise) {
|
|
74
|
+
cancelPromise(pendingPromise, valueOrPromise);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
var getMountedOrPendingDependents = (atom2, atomState, mountedMap) => {
|
|
87
79
|
var _a;
|
|
88
|
-
|
|
89
|
-
|
|
80
|
+
const dependents = /* @__PURE__ */ new Set();
|
|
81
|
+
for (const a of ((_a = mountedMap.get(atom2)) == null ? void 0 : _a.t) || []) {
|
|
82
|
+
if (mountedMap.has(a)) {
|
|
83
|
+
dependents.add(a);
|
|
84
|
+
}
|
|
90
85
|
}
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
addPendingPromiseToDependency(atom2, atomState.v, aState);
|
|
86
|
+
for (const atomWithPendingPromise of atomState.p) {
|
|
87
|
+
dependents.add(atomWithPendingPromise);
|
|
94
88
|
}
|
|
95
|
-
|
|
89
|
+
return dependents;
|
|
96
90
|
};
|
|
97
|
-
var
|
|
98
|
-
|
|
99
|
-
const
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
91
|
+
var createStoreHook = () => {
|
|
92
|
+
const callbacks = /* @__PURE__ */ new Set();
|
|
93
|
+
const notify = () => {
|
|
94
|
+
callbacks.forEach((fn) => fn());
|
|
95
|
+
};
|
|
96
|
+
notify.add = (fn) => {
|
|
97
|
+
callbacks.add(fn);
|
|
98
|
+
return () => {
|
|
99
|
+
callbacks.delete(fn);
|
|
100
|
+
};
|
|
101
|
+
};
|
|
102
|
+
return notify;
|
|
103
|
+
};
|
|
104
|
+
var createStoreHookForAtoms = () => {
|
|
105
|
+
const all = {};
|
|
106
|
+
const callbacks = /* @__PURE__ */ new WeakMap();
|
|
107
|
+
const notify = (atom2) => {
|
|
108
|
+
var _a, _b;
|
|
109
|
+
(_a = callbacks.get(all)) == null ? void 0 : _a.forEach((fn) => fn(atom2));
|
|
110
|
+
(_b = callbacks.get(atom2)) == null ? void 0 : _b.forEach((fn) => fn());
|
|
111
|
+
};
|
|
112
|
+
notify.add = (atom2, fn) => {
|
|
113
|
+
const key = atom2 || all;
|
|
114
|
+
const fns = (callbacks.has(key) ? callbacks : callbacks.set(key, /* @__PURE__ */ new Set())).get(key);
|
|
115
|
+
fns.add(fn);
|
|
116
|
+
return () => {
|
|
117
|
+
fns == null ? void 0 : fns.delete(fn);
|
|
118
|
+
if (!fns.size) {
|
|
119
|
+
callbacks.delete(key);
|
|
120
|
+
}
|
|
121
|
+
};
|
|
122
|
+
};
|
|
123
|
+
return notify;
|
|
124
|
+
};
|
|
125
|
+
var initializeStoreHooks = (storeHooks) => {
|
|
126
|
+
storeHooks.c || (storeHooks.c = createStoreHookForAtoms());
|
|
127
|
+
storeHooks.m || (storeHooks.m = createStoreHookForAtoms());
|
|
128
|
+
storeHooks.u || (storeHooks.u = createStoreHookForAtoms());
|
|
129
|
+
storeHooks.f || (storeHooks.f = createStoreHook());
|
|
130
|
+
return storeHooks;
|
|
131
|
+
};
|
|
132
|
+
var BUILDING_BLOCKS = Symbol();
|
|
133
|
+
var buildStore = (atomStateMap = /* @__PURE__ */ new WeakMap(), mountedMap = /* @__PURE__ */ new WeakMap(), invalidatedAtoms = /* @__PURE__ */ new WeakMap(), changedAtoms = /* @__PURE__ */ new Set(), mountCallbacks = /* @__PURE__ */ new Set(), unmountCallbacks = /* @__PURE__ */ new Set(), storeHooks = {}, atomRead = (atom2, ...params) => atom2.read(...params), atomWrite = (atom2, ...params) => atom2.write(...params), atomOnInit = (atom2, store) => {
|
|
134
|
+
var _a;
|
|
135
|
+
return (_a = atom2.unstable_onInit) == null ? void 0 : _a.call(atom2, store);
|
|
136
|
+
}, atomOnMount = (atom2, setAtom) => {
|
|
137
|
+
var _a;
|
|
138
|
+
return (_a = atom2.onMount) == null ? void 0 : _a.call(atom2, setAtom);
|
|
139
|
+
}, ...buildingBlockFunctions) => {
|
|
140
|
+
const ensureAtomState = buildingBlockFunctions[0] || ((atom2) => {
|
|
108
141
|
if ((import.meta.env ? import.meta.env.MODE : void 0) !== "production" && !atom2) {
|
|
109
142
|
throw new Error("Atom is undefined or null");
|
|
110
143
|
}
|
|
111
|
-
let atomState =
|
|
144
|
+
let atomState = atomStateMap.get(atom2);
|
|
112
145
|
if (!atomState) {
|
|
113
146
|
atomState = { d: /* @__PURE__ */ new Map(), p: /* @__PURE__ */ new Set(), n: 0 };
|
|
114
|
-
|
|
147
|
+
atomStateMap.set(atom2, atomState);
|
|
115
148
|
atomOnInit == null ? void 0 : atomOnInit(atom2, store);
|
|
116
149
|
}
|
|
117
150
|
return atomState;
|
|
118
|
-
};
|
|
119
|
-
const
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
const mountCallbacks = /* @__PURE__ */ new Set();
|
|
123
|
-
const flushCallbacks = () => {
|
|
124
|
-
var _a;
|
|
125
|
-
const errors = [];
|
|
151
|
+
});
|
|
152
|
+
const flushCallbacks = buildingBlockFunctions[1] || (() => {
|
|
153
|
+
let hasError;
|
|
154
|
+
let error;
|
|
126
155
|
const call = (fn) => {
|
|
127
156
|
try {
|
|
128
157
|
fn();
|
|
129
158
|
} catch (e) {
|
|
130
|
-
|
|
159
|
+
if (!hasError) {
|
|
160
|
+
hasError = true;
|
|
161
|
+
error = e;
|
|
162
|
+
}
|
|
131
163
|
}
|
|
132
164
|
};
|
|
133
165
|
do {
|
|
134
|
-
(
|
|
166
|
+
if (storeHooks.f) {
|
|
167
|
+
call(storeHooks.f);
|
|
168
|
+
}
|
|
135
169
|
const callbacks = /* @__PURE__ */ new Set();
|
|
136
170
|
const add = callbacks.add.bind(callbacks);
|
|
137
|
-
changedAtoms.forEach((
|
|
138
|
-
var
|
|
139
|
-
return (
|
|
171
|
+
changedAtoms.forEach((atom2) => {
|
|
172
|
+
var _a;
|
|
173
|
+
return (_a = mountedMap.get(atom2)) == null ? void 0 : _a.l.forEach(add);
|
|
140
174
|
});
|
|
141
175
|
changedAtoms.clear();
|
|
142
176
|
unmountCallbacks.forEach(add);
|
|
@@ -148,36 +182,60 @@ var buildStore = (...storeArgs) => {
|
|
|
148
182
|
recomputeInvalidatedAtoms();
|
|
149
183
|
}
|
|
150
184
|
} while (changedAtoms.size || unmountCallbacks.size || mountCallbacks.size);
|
|
151
|
-
if (
|
|
152
|
-
throw
|
|
185
|
+
if (hasError) {
|
|
186
|
+
throw error;
|
|
153
187
|
}
|
|
154
|
-
};
|
|
155
|
-
const
|
|
156
|
-
const
|
|
157
|
-
const
|
|
158
|
-
const
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
188
|
+
});
|
|
189
|
+
const recomputeInvalidatedAtoms = buildingBlockFunctions[2] || (() => {
|
|
190
|
+
const topSortedReversed = [];
|
|
191
|
+
const visiting = /* @__PURE__ */ new WeakSet();
|
|
192
|
+
const visited = /* @__PURE__ */ new WeakSet();
|
|
193
|
+
const stack = Array.from(changedAtoms);
|
|
194
|
+
while (stack.length) {
|
|
195
|
+
const a = stack[stack.length - 1];
|
|
196
|
+
const aState = ensureAtomState(a);
|
|
197
|
+
if (visited.has(a)) {
|
|
198
|
+
stack.pop();
|
|
199
|
+
continue;
|
|
200
|
+
}
|
|
201
|
+
if (visiting.has(a)) {
|
|
202
|
+
if (invalidatedAtoms.get(a) === aState.n) {
|
|
203
|
+
topSortedReversed.push([a, aState]);
|
|
204
|
+
} else if ((import.meta.env ? import.meta.env.MODE : void 0) !== "production" && invalidatedAtoms.has(a)) {
|
|
205
|
+
throw new Error("[Bug] invalidated atom exists");
|
|
206
|
+
}
|
|
207
|
+
visited.add(a);
|
|
208
|
+
stack.pop();
|
|
209
|
+
continue;
|
|
210
|
+
}
|
|
211
|
+
visiting.add(a);
|
|
212
|
+
for (const d of getMountedOrPendingDependents(a, aState, mountedMap)) {
|
|
213
|
+
if (!visiting.has(d)) {
|
|
214
|
+
stack.push(d);
|
|
215
|
+
}
|
|
163
216
|
}
|
|
164
|
-
atomState.v = valueOrPromise;
|
|
165
|
-
} else {
|
|
166
|
-
atomState.v = valueOrPromise;
|
|
167
217
|
}
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
218
|
+
for (let i = topSortedReversed.length - 1; i >= 0; --i) {
|
|
219
|
+
const [a, aState] = topSortedReversed[i];
|
|
220
|
+
let hasChangedDeps = false;
|
|
221
|
+
for (const dep of aState.d.keys()) {
|
|
222
|
+
if (dep !== a && changedAtoms.has(dep)) {
|
|
223
|
+
hasChangedDeps = true;
|
|
224
|
+
break;
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
if (hasChangedDeps) {
|
|
228
|
+
readAtomState(a);
|
|
229
|
+
mountDependencies(a);
|
|
173
230
|
}
|
|
231
|
+
invalidatedAtoms.delete(a);
|
|
174
232
|
}
|
|
175
|
-
};
|
|
176
|
-
const readAtomState = (atom2) => {
|
|
177
|
-
var _a;
|
|
233
|
+
});
|
|
234
|
+
const readAtomState = buildingBlockFunctions[3] || ((atom2) => {
|
|
235
|
+
var _a, _b;
|
|
178
236
|
const atomState = ensureAtomState(atom2);
|
|
179
237
|
if (isAtomStateInitialized(atomState)) {
|
|
180
|
-
if (
|
|
238
|
+
if (mountedMap.has(atom2) && invalidatedAtoms.get(atom2) !== atomState.n) {
|
|
181
239
|
return atomState;
|
|
182
240
|
}
|
|
183
241
|
if (Array.from(atomState.d).every(
|
|
@@ -193,18 +251,19 @@ var buildStore = (...storeArgs) => {
|
|
|
193
251
|
atomState.d.clear();
|
|
194
252
|
let isSync = true;
|
|
195
253
|
const mountDependenciesIfAsync = () => {
|
|
196
|
-
if (
|
|
197
|
-
mountDependencies(atom2
|
|
254
|
+
if (mountedMap.has(atom2)) {
|
|
255
|
+
mountDependencies(atom2);
|
|
198
256
|
recomputeInvalidatedAtoms();
|
|
199
257
|
flushCallbacks();
|
|
200
258
|
}
|
|
201
259
|
};
|
|
202
260
|
const getter = (a) => {
|
|
261
|
+
var _a2;
|
|
203
262
|
if (isSelfAtom(atom2, a)) {
|
|
204
263
|
const aState2 = ensureAtomState(a);
|
|
205
264
|
if (!isAtomStateInitialized(aState2)) {
|
|
206
265
|
if (hasInitialValue(a)) {
|
|
207
|
-
setAtomStateValueOrPromise(a,
|
|
266
|
+
setAtomStateValueOrPromise(a, a.init, ensureAtomState);
|
|
208
267
|
} else {
|
|
209
268
|
throw new Error("no atom init");
|
|
210
269
|
}
|
|
@@ -215,7 +274,11 @@ var buildStore = (...storeArgs) => {
|
|
|
215
274
|
try {
|
|
216
275
|
return returnAtomValue(aState);
|
|
217
276
|
} finally {
|
|
218
|
-
|
|
277
|
+
atomState.d.set(a, aState.n);
|
|
278
|
+
if (isPendingPromise(atomState.v)) {
|
|
279
|
+
addPendingPromiseToDependency(atom2, atomState.v, aState);
|
|
280
|
+
}
|
|
281
|
+
(_a2 = mountedMap.get(a)) == null ? void 0 : _a2.t.add(atom2);
|
|
219
282
|
if (!isSync) {
|
|
220
283
|
mountDependenciesIfAsync();
|
|
221
284
|
}
|
|
@@ -240,19 +303,28 @@ var buildStore = (...storeArgs) => {
|
|
|
240
303
|
console.warn("setSelf function cannot be called in sync");
|
|
241
304
|
}
|
|
242
305
|
if (!isSync) {
|
|
243
|
-
|
|
306
|
+
try {
|
|
307
|
+
return writeAtomState(atom2, ...args);
|
|
308
|
+
} finally {
|
|
309
|
+
recomputeInvalidatedAtoms();
|
|
310
|
+
flushCallbacks();
|
|
311
|
+
}
|
|
244
312
|
}
|
|
245
313
|
};
|
|
246
314
|
}
|
|
247
315
|
return setSelf;
|
|
248
316
|
}
|
|
249
317
|
};
|
|
318
|
+
const prevEpochNumber = atomState.n;
|
|
250
319
|
try {
|
|
251
320
|
const valueOrPromise = atomRead(atom2, getter, options);
|
|
252
|
-
setAtomStateValueOrPromise(atom2,
|
|
321
|
+
setAtomStateValueOrPromise(atom2, valueOrPromise, ensureAtomState);
|
|
253
322
|
if (isPromiseLike(valueOrPromise)) {
|
|
254
323
|
(_a = valueOrPromise.onCancel) == null ? void 0 : _a.call(valueOrPromise, () => controller == null ? void 0 : controller.abort());
|
|
255
|
-
valueOrPromise.then(
|
|
324
|
+
valueOrPromise.then(
|
|
325
|
+
mountDependenciesIfAsync,
|
|
326
|
+
mountDependenciesIfAsync
|
|
327
|
+
);
|
|
256
328
|
}
|
|
257
329
|
return atomState;
|
|
258
330
|
} catch (error) {
|
|
@@ -262,89 +334,26 @@ var buildStore = (...storeArgs) => {
|
|
|
262
334
|
return atomState;
|
|
263
335
|
} finally {
|
|
264
336
|
isSync = false;
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
var _a;
|
|
270
|
-
const dependents = /* @__PURE__ */ new Map();
|
|
271
|
-
for (const a of ((_a = atomState.m) == null ? void 0 : _a.t) || []) {
|
|
272
|
-
const aState = ensureAtomState(a);
|
|
273
|
-
if (aState.m) {
|
|
274
|
-
dependents.set(a, aState);
|
|
275
|
-
}
|
|
276
|
-
}
|
|
277
|
-
for (const atomWithPendingPromise of atomState.p) {
|
|
278
|
-
dependents.set(
|
|
279
|
-
atomWithPendingPromise,
|
|
280
|
-
ensureAtomState(atomWithPendingPromise)
|
|
281
|
-
);
|
|
282
|
-
}
|
|
283
|
-
return dependents;
|
|
284
|
-
};
|
|
285
|
-
const invalidateDependents = (atomState) => {
|
|
286
|
-
const stack = [atomState];
|
|
287
|
-
while (stack.length) {
|
|
288
|
-
const aState = stack.pop();
|
|
289
|
-
for (const [d, s] of getMountedOrPendingDependents(aState)) {
|
|
290
|
-
if (!invalidatedAtoms.has(d)) {
|
|
291
|
-
invalidatedAtoms.set(d, s.n);
|
|
292
|
-
stack.push(s);
|
|
293
|
-
}
|
|
337
|
+
if (prevEpochNumber !== atomState.n && invalidatedAtoms.get(atom2) === prevEpochNumber) {
|
|
338
|
+
invalidatedAtoms.set(atom2, atomState.n);
|
|
339
|
+
changedAtoms.add(atom2);
|
|
340
|
+
(_b = storeHooks.c) == null ? void 0 : _b.call(storeHooks, atom2);
|
|
294
341
|
}
|
|
295
342
|
}
|
|
296
|
-
};
|
|
297
|
-
const
|
|
298
|
-
|
|
299
|
-
const topSortedReversed = [];
|
|
300
|
-
const visiting = /* @__PURE__ */ new WeakSet();
|
|
301
|
-
const visited = /* @__PURE__ */ new WeakSet();
|
|
302
|
-
const stack = Array.from(changedAtoms);
|
|
343
|
+
});
|
|
344
|
+
const invalidateDependents = buildingBlockFunctions[4] || ((atom2) => {
|
|
345
|
+
const stack = [atom2];
|
|
303
346
|
while (stack.length) {
|
|
304
|
-
const
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
if (invalidatedAtoms.get(a) === aState.n) {
|
|
311
|
-
topSortedReversed.push([a, aState, aState.n]);
|
|
312
|
-
} else {
|
|
313
|
-
invalidatedAtoms.delete(a);
|
|
314
|
-
changedAtoms.set(a, aState);
|
|
315
|
-
}
|
|
316
|
-
visited.add(a);
|
|
317
|
-
stack.pop();
|
|
318
|
-
continue;
|
|
319
|
-
}
|
|
320
|
-
visiting.add(a);
|
|
321
|
-
for (const [d, s] of getMountedOrPendingDependents(aState)) {
|
|
322
|
-
if (!visiting.has(d)) {
|
|
323
|
-
stack.push([d, s]);
|
|
324
|
-
}
|
|
325
|
-
}
|
|
326
|
-
}
|
|
327
|
-
for (let i = topSortedReversed.length - 1; i >= 0; --i) {
|
|
328
|
-
const [a, aState, prevEpochNumber] = topSortedReversed[i];
|
|
329
|
-
let hasChangedDeps = false;
|
|
330
|
-
for (const dep of aState.d.keys()) {
|
|
331
|
-
if (dep !== a && changedAtoms.has(dep)) {
|
|
332
|
-
hasChangedDeps = true;
|
|
333
|
-
break;
|
|
334
|
-
}
|
|
335
|
-
}
|
|
336
|
-
if (hasChangedDeps) {
|
|
337
|
-
readAtomState(a);
|
|
338
|
-
mountDependencies(a, aState);
|
|
339
|
-
if (prevEpochNumber !== aState.n) {
|
|
340
|
-
changedAtoms.set(a, aState);
|
|
341
|
-
(_a = aState.u) == null ? void 0 : _a.call(aState);
|
|
342
|
-
}
|
|
347
|
+
const a = stack.pop();
|
|
348
|
+
const aState = ensureAtomState(a);
|
|
349
|
+
for (const d of getMountedOrPendingDependents(a, aState, mountedMap)) {
|
|
350
|
+
const dState = ensureAtomState(d);
|
|
351
|
+
invalidatedAtoms.set(d, dState.n);
|
|
352
|
+
stack.push(d);
|
|
343
353
|
}
|
|
344
|
-
invalidatedAtoms.delete(a);
|
|
345
354
|
}
|
|
346
|
-
};
|
|
347
|
-
const writeAtomState = (atom2, ...args) => {
|
|
355
|
+
});
|
|
356
|
+
const writeAtomState = buildingBlockFunctions[5] || ((atom2, ...args) => {
|
|
348
357
|
let isSync = true;
|
|
349
358
|
const getter = (a) => returnAtomValue(readAtomState(a));
|
|
350
359
|
const setter = (a, ...args2) => {
|
|
@@ -357,12 +366,12 @@ var buildStore = (...storeArgs) => {
|
|
|
357
366
|
}
|
|
358
367
|
const prevEpochNumber = aState.n;
|
|
359
368
|
const v = args2[0];
|
|
360
|
-
setAtomStateValueOrPromise(a,
|
|
361
|
-
mountDependencies(a
|
|
369
|
+
setAtomStateValueOrPromise(a, v, ensureAtomState);
|
|
370
|
+
mountDependencies(a);
|
|
362
371
|
if (prevEpochNumber !== aState.n) {
|
|
363
|
-
changedAtoms.
|
|
364
|
-
(_a =
|
|
365
|
-
invalidateDependents(
|
|
372
|
+
changedAtoms.add(a);
|
|
373
|
+
(_a = storeHooks.c) == null ? void 0 : _a.call(storeHooks, a);
|
|
374
|
+
invalidateDependents(a);
|
|
366
375
|
}
|
|
367
376
|
return void 0;
|
|
368
377
|
} else {
|
|
@@ -380,56 +389,52 @@ var buildStore = (...storeArgs) => {
|
|
|
380
389
|
} finally {
|
|
381
390
|
isSync = false;
|
|
382
391
|
}
|
|
383
|
-
};
|
|
384
|
-
const
|
|
385
|
-
try {
|
|
386
|
-
return writeAtomState(atom2, ...args);
|
|
387
|
-
} finally {
|
|
388
|
-
recomputeInvalidatedAtoms();
|
|
389
|
-
flushCallbacks();
|
|
390
|
-
}
|
|
391
|
-
};
|
|
392
|
-
const mountDependencies = (atom2, atomState) => {
|
|
392
|
+
});
|
|
393
|
+
const mountDependencies = buildingBlockFunctions[6] || ((atom2) => {
|
|
393
394
|
var _a;
|
|
394
|
-
|
|
395
|
+
const atomState = ensureAtomState(atom2);
|
|
396
|
+
const mounted = mountedMap.get(atom2);
|
|
397
|
+
if (mounted && !isPendingPromise(atomState.v)) {
|
|
395
398
|
for (const [a, n] of atomState.d) {
|
|
396
|
-
if (!
|
|
399
|
+
if (!mounted.d.has(a)) {
|
|
397
400
|
const aState = ensureAtomState(a);
|
|
398
|
-
const aMounted = mountAtom(a
|
|
401
|
+
const aMounted = mountAtom(a);
|
|
399
402
|
aMounted.t.add(atom2);
|
|
400
|
-
|
|
403
|
+
mounted.d.add(a);
|
|
401
404
|
if (n !== aState.n) {
|
|
402
|
-
changedAtoms.
|
|
403
|
-
(_a =
|
|
404
|
-
invalidateDependents(
|
|
405
|
+
changedAtoms.add(a);
|
|
406
|
+
(_a = storeHooks.c) == null ? void 0 : _a.call(storeHooks, a);
|
|
407
|
+
invalidateDependents(a);
|
|
405
408
|
}
|
|
406
409
|
}
|
|
407
410
|
}
|
|
408
|
-
for (const a of
|
|
411
|
+
for (const a of mounted.d || []) {
|
|
409
412
|
if (!atomState.d.has(a)) {
|
|
410
|
-
|
|
411
|
-
const aMounted = unmountAtom(a
|
|
413
|
+
mounted.d.delete(a);
|
|
414
|
+
const aMounted = unmountAtom(a);
|
|
412
415
|
aMounted == null ? void 0 : aMounted.t.delete(atom2);
|
|
413
416
|
}
|
|
414
417
|
}
|
|
415
418
|
}
|
|
416
|
-
};
|
|
417
|
-
const mountAtom = (atom2
|
|
419
|
+
});
|
|
420
|
+
const mountAtom = buildingBlockFunctions[7] || ((atom2) => {
|
|
418
421
|
var _a;
|
|
419
|
-
|
|
422
|
+
const atomState = ensureAtomState(atom2);
|
|
423
|
+
let mounted = mountedMap.get(atom2);
|
|
424
|
+
if (!mounted) {
|
|
420
425
|
readAtomState(atom2);
|
|
421
426
|
for (const a of atomState.d.keys()) {
|
|
422
|
-
const aMounted = mountAtom(a
|
|
427
|
+
const aMounted = mountAtom(a);
|
|
423
428
|
aMounted.t.add(atom2);
|
|
424
429
|
}
|
|
425
|
-
|
|
430
|
+
mounted = {
|
|
426
431
|
l: /* @__PURE__ */ new Set(),
|
|
427
432
|
d: new Set(atomState.d.keys()),
|
|
428
433
|
t: /* @__PURE__ */ new Set()
|
|
429
434
|
};
|
|
430
|
-
(
|
|
435
|
+
mountedMap.set(atom2, mounted);
|
|
436
|
+
(_a = storeHooks.m) == null ? void 0 : _a.call(storeHooks, atom2);
|
|
431
437
|
if (isActuallyWritableAtom(atom2)) {
|
|
432
|
-
const mounted = atomState.m;
|
|
433
438
|
const processOnMount = () => {
|
|
434
439
|
let isSync = true;
|
|
435
440
|
const setAtom = (...args) => {
|
|
@@ -461,88 +466,148 @@ var buildStore = (...storeArgs) => {
|
|
|
461
466
|
mountCallbacks.add(processOnMount);
|
|
462
467
|
}
|
|
463
468
|
}
|
|
464
|
-
return
|
|
465
|
-
};
|
|
466
|
-
const unmountAtom = (atom2
|
|
469
|
+
return mounted;
|
|
470
|
+
});
|
|
471
|
+
const unmountAtom = buildingBlockFunctions[8] || ((atom2) => {
|
|
467
472
|
var _a;
|
|
468
|
-
|
|
473
|
+
const atomState = ensureAtomState(atom2);
|
|
474
|
+
let mounted = mountedMap.get(atom2);
|
|
475
|
+
if (mounted && !mounted.l.size && !Array.from(mounted.t).some((a) => {
|
|
469
476
|
var _a2;
|
|
470
|
-
return (_a2 =
|
|
477
|
+
return (_a2 = mountedMap.get(a)) == null ? void 0 : _a2.d.has(atom2);
|
|
471
478
|
})) {
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
unmountCallbacks.add(onUnmount);
|
|
479
|
+
if (mounted.u) {
|
|
480
|
+
unmountCallbacks.add(mounted.u);
|
|
475
481
|
}
|
|
476
|
-
|
|
477
|
-
|
|
482
|
+
mounted = void 0;
|
|
483
|
+
mountedMap.delete(atom2);
|
|
484
|
+
(_a = storeHooks.u) == null ? void 0 : _a.call(storeHooks, atom2);
|
|
478
485
|
for (const a of atomState.d.keys()) {
|
|
479
|
-
const aMounted = unmountAtom(a
|
|
486
|
+
const aMounted = unmountAtom(a);
|
|
480
487
|
aMounted == null ? void 0 : aMounted.t.delete(atom2);
|
|
481
488
|
}
|
|
482
489
|
return void 0;
|
|
483
490
|
}
|
|
484
|
-
return
|
|
485
|
-
};
|
|
486
|
-
const
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
491
|
+
return mounted;
|
|
492
|
+
});
|
|
493
|
+
const buildingBlocks = [
|
|
494
|
+
// store state
|
|
495
|
+
atomStateMap,
|
|
496
|
+
mountedMap,
|
|
497
|
+
invalidatedAtoms,
|
|
498
|
+
changedAtoms,
|
|
499
|
+
mountCallbacks,
|
|
500
|
+
unmountCallbacks,
|
|
501
|
+
storeHooks,
|
|
502
|
+
// atom intercepters
|
|
503
|
+
atomRead,
|
|
504
|
+
atomWrite,
|
|
505
|
+
atomOnInit,
|
|
506
|
+
atomOnMount,
|
|
507
|
+
// building-block functions
|
|
508
|
+
ensureAtomState,
|
|
509
|
+
flushCallbacks,
|
|
510
|
+
recomputeInvalidatedAtoms,
|
|
511
|
+
readAtomState,
|
|
512
|
+
invalidateDependents,
|
|
513
|
+
writeAtomState,
|
|
514
|
+
mountDependencies,
|
|
515
|
+
mountAtom,
|
|
516
|
+
unmountAtom
|
|
517
|
+
];
|
|
499
518
|
const store = {
|
|
500
|
-
get:
|
|
501
|
-
set:
|
|
502
|
-
|
|
503
|
-
|
|
519
|
+
get: (atom2) => returnAtomValue(readAtomState(atom2)),
|
|
520
|
+
set: (atom2, ...args) => {
|
|
521
|
+
try {
|
|
522
|
+
return writeAtomState(atom2, ...args);
|
|
523
|
+
} finally {
|
|
524
|
+
recomputeInvalidatedAtoms();
|
|
525
|
+
flushCallbacks();
|
|
526
|
+
}
|
|
527
|
+
},
|
|
528
|
+
sub: (atom2, listener) => {
|
|
529
|
+
const mounted = mountAtom(atom2);
|
|
530
|
+
const listeners = mounted.l;
|
|
531
|
+
listeners.add(listener);
|
|
532
|
+
flushCallbacks();
|
|
533
|
+
return () => {
|
|
534
|
+
listeners.delete(listener);
|
|
535
|
+
unmountAtom(atom2);
|
|
536
|
+
flushCallbacks();
|
|
537
|
+
};
|
|
538
|
+
}
|
|
504
539
|
};
|
|
540
|
+
Object.defineProperty(store, BUILDING_BLOCKS, { value: buildingBlocks });
|
|
505
541
|
return store;
|
|
506
542
|
};
|
|
507
|
-
var
|
|
508
|
-
|
|
509
|
-
|
|
543
|
+
var INTERNAL_buildStoreRev1 = buildStore;
|
|
544
|
+
var INTERNAL_initializeStoreHooks = initializeStoreHooks;
|
|
545
|
+
|
|
546
|
+
// ../../node_modules/.pnpm/jotai@2.12.1_@types+react@18.3.18_react@18.3.1/node_modules/jotai/esm/vanilla.mjs
|
|
547
|
+
var keyCount = 0;
|
|
548
|
+
function atom(read, write) {
|
|
549
|
+
const key = `atom${++keyCount}`;
|
|
550
|
+
const config = {
|
|
551
|
+
toString() {
|
|
552
|
+
return (import.meta.env ? import.meta.env.MODE : void 0) !== "production" && this.debugLabel ? key + ":" + this.debugLabel : key;
|
|
553
|
+
}
|
|
554
|
+
};
|
|
555
|
+
if (typeof read === "function") {
|
|
556
|
+
config.read = read;
|
|
557
|
+
} else {
|
|
558
|
+
config.init = read;
|
|
559
|
+
config.read = defaultRead;
|
|
560
|
+
config.write = defaultWrite;
|
|
561
|
+
}
|
|
562
|
+
if (write) {
|
|
563
|
+
config.write = write;
|
|
564
|
+
}
|
|
565
|
+
return config;
|
|
566
|
+
}
|
|
567
|
+
function defaultRead(get) {
|
|
568
|
+
return get(this);
|
|
569
|
+
}
|
|
570
|
+
function defaultWrite(get, set, arg) {
|
|
571
|
+
return set(
|
|
572
|
+
this,
|
|
573
|
+
typeof arg === "function" ? arg(get(this)) : arg
|
|
574
|
+
);
|
|
575
|
+
}
|
|
576
|
+
var createDevStoreRev4 = () => {
|
|
510
577
|
let inRestoreAtom = 0;
|
|
511
|
-
const
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
};
|
|
525
|
-
};
|
|
526
|
-
storeArgs[3] = function devAtomWrite(atom2, getter, setter, ...args) {
|
|
578
|
+
const storeHooks = INTERNAL_initializeStoreHooks({});
|
|
579
|
+
const atomStateMap = /* @__PURE__ */ new WeakMap();
|
|
580
|
+
const mountedAtoms = /* @__PURE__ */ new WeakMap();
|
|
581
|
+
const store = INTERNAL_buildStoreRev1(
|
|
582
|
+
atomStateMap,
|
|
583
|
+
mountedAtoms,
|
|
584
|
+
void 0,
|
|
585
|
+
void 0,
|
|
586
|
+
void 0,
|
|
587
|
+
void 0,
|
|
588
|
+
storeHooks,
|
|
589
|
+
void 0,
|
|
590
|
+
(atom2, get, set, ...args) => {
|
|
527
591
|
if (inRestoreAtom) {
|
|
528
|
-
return
|
|
592
|
+
return set(atom2, ...args);
|
|
529
593
|
}
|
|
530
|
-
return
|
|
531
|
-
}
|
|
532
|
-
|
|
594
|
+
return atom2.write(get, set, ...args);
|
|
595
|
+
}
|
|
596
|
+
);
|
|
597
|
+
const debugMountedAtoms = /* @__PURE__ */ new Set();
|
|
598
|
+
storeHooks.m.add(void 0, (atom2) => {
|
|
599
|
+
debugMountedAtoms.add(atom2);
|
|
600
|
+
const atomState = atomStateMap.get(atom2);
|
|
601
|
+
atomState.m = mountedAtoms.get(atom2);
|
|
602
|
+
});
|
|
603
|
+
storeHooks.u.add(void 0, (atom2) => {
|
|
604
|
+
debugMountedAtoms.delete(atom2);
|
|
605
|
+
const atomState = atomStateMap.get(atom2);
|
|
606
|
+
delete atomState.m;
|
|
533
607
|
});
|
|
534
|
-
const savedStoreSet = derivedStore.set;
|
|
535
608
|
const devStore = {
|
|
536
609
|
// store dev methods (these are tentative and subject to change without notice)
|
|
537
|
-
dev4_get_internal_weak_map: () =>
|
|
538
|
-
get: (atom2) => {
|
|
539
|
-
const atomState = savedGetAtomState(atom2);
|
|
540
|
-
if (!atomState || atomState.n === 0) {
|
|
541
|
-
return void 0;
|
|
542
|
-
}
|
|
543
|
-
return atomState;
|
|
544
|
-
}
|
|
545
|
-
}),
|
|
610
|
+
dev4_get_internal_weak_map: () => atomStateMap,
|
|
546
611
|
dev4_get_mounted_atoms: () => debugMountedAtoms,
|
|
547
612
|
dev4_restore_atoms: (values) => {
|
|
548
613
|
const restoreAtom = {
|
|
@@ -551,7 +616,7 @@ var deriveDevStoreRev4 = (store) => {
|
|
|
551
616
|
++inRestoreAtom;
|
|
552
617
|
try {
|
|
553
618
|
for (const [atom2, value] of values) {
|
|
554
|
-
if (
|
|
619
|
+
if ("init" in atom2) {
|
|
555
620
|
set(atom2, value);
|
|
556
621
|
}
|
|
557
622
|
}
|
|
@@ -560,30 +625,16 @@ var deriveDevStoreRev4 = (store) => {
|
|
|
560
625
|
}
|
|
561
626
|
}
|
|
562
627
|
};
|
|
563
|
-
|
|
628
|
+
store.set(restoreAtom);
|
|
564
629
|
}
|
|
565
630
|
};
|
|
566
|
-
return Object.assign(
|
|
631
|
+
return Object.assign(store, devStore);
|
|
567
632
|
};
|
|
568
633
|
var createStore = () => {
|
|
569
|
-
const atomStateMap = /* @__PURE__ */ new WeakMap();
|
|
570
|
-
const store = buildStore(
|
|
571
|
-
(atom2) => atomStateMap.get(atom2),
|
|
572
|
-
(atom2, atomState) => atomStateMap.set(atom2, atomState).get(atom2),
|
|
573
|
-
(atom2, ...params) => atom2.read(...params),
|
|
574
|
-
(atom2, ...params) => atom2.write(...params),
|
|
575
|
-
(atom2, ...params) => {
|
|
576
|
-
var _a;
|
|
577
|
-
return (_a = atom2.unstable_onInit) == null ? void 0 : _a.call(atom2, ...params);
|
|
578
|
-
},
|
|
579
|
-
(atom2, ...params) => {
|
|
580
|
-
var _a;
|
|
581
|
-
return (_a = atom2.onMount) == null ? void 0 : _a.call(atom2, ...params);
|
|
582
|
-
}
|
|
583
|
-
);
|
|
584
634
|
if ((import.meta.env ? import.meta.env.MODE : void 0) !== "production") {
|
|
585
|
-
return
|
|
635
|
+
return createDevStoreRev4();
|
|
586
636
|
}
|
|
637
|
+
const store = INTERNAL_buildStoreRev1();
|
|
587
638
|
return store;
|
|
588
639
|
};
|
|
589
640
|
var defaultStore;
|
|
@@ -602,7 +653,7 @@ var getDefaultStore = () => {
|
|
|
602
653
|
return defaultStore;
|
|
603
654
|
};
|
|
604
655
|
|
|
605
|
-
// ../../node_modules/.pnpm/jotai@2.
|
|
656
|
+
// ../../node_modules/.pnpm/jotai@2.12.1_@types+react@18.3.18_react@18.3.1/node_modules/jotai/esm/react.mjs
|
|
606
657
|
import ReactExports, { createContext, useContext, useRef, createElement, useReducer, useEffect, useDebugValue, useCallback } from "react";
|
|
607
658
|
var StoreContext = createContext(
|
|
608
659
|
void 0
|
|
@@ -743,4 +794,4 @@ export {
|
|
|
743
794
|
atom,
|
|
744
795
|
useAtom
|
|
745
796
|
};
|
|
746
|
-
//# sourceMappingURL=chunk-
|
|
797
|
+
//# sourceMappingURL=chunk-FD4TUZZS.js.map
|