atomaric 0.0.60 → 0.0.62
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/build/atomaric.js +314 -198
- package/build/atomaric.umd.cjs +1 -1
- package/package.json +8 -10
- package/types/index.d.ts +6 -2
- package/src/class.ts +0 -295
- package/src/globals.d.ts +0 -52
- package/src/index.ts +0 -2
- package/src/lib.ts +0 -36
- package/src/makeDeepProxyObject.ts +0 -35
- package/src/makeDoFillerActions.ts +0 -225
- package/src/test.tsx +0 -207
package/build/atomaric.js
CHANGED
|
@@ -1,290 +1,406 @@
|
|
|
1
|
-
let
|
|
1
|
+
let O = () => {
|
|
2
2
|
throw "call configureAtomaric() before all!";
|
|
3
3
|
};
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
},
|
|
7
|
-
const
|
|
8
|
-
get: (
|
|
9
|
-
const
|
|
10
|
-
return typeof
|
|
11
|
-
Array.isArray(
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
) :
|
|
4
|
+
const T = {}, ye = (e) => {
|
|
5
|
+
T.useSyncExternalStore = O = e.useSyncExternalStore, T.keyPathSeparator = e.keyPathSeparator, T.securifyKeyLevel = e.securifyKeyLevel, T.securifyValueLevel = e.securifyValueLevel;
|
|
6
|
+
}, ne = (e) => O(e.subscribe, e.get), se = (e) => e.set, he = (e) => e.setDeferred, pe = (e) => e.get, we = (e) => e.do, Se = (e) => [ne(e), se(e)], Ae = (e, t) => new ue(e, t), ce = (e, t) => {
|
|
7
|
+
const c = (u, y, S) => new Proxy(u, {
|
|
8
|
+
get: (s, n, i) => {
|
|
9
|
+
const l = S === 0 && t.get != null ? t.get(s, n, i) : s[n];
|
|
10
|
+
return typeof l == "object" && l !== null ? c(
|
|
11
|
+
Array.isArray(l) ? l.slice(0) : { ...l },
|
|
12
|
+
y.concat(Array.isArray(s) ? +n : n),
|
|
13
|
+
S + 1
|
|
14
|
+
) : l;
|
|
15
15
|
},
|
|
16
|
-
set: (
|
|
16
|
+
set: (s, n, i) => (t.onSet(s, y, n, i, s[n]) && (s[n] = i), !0)
|
|
17
17
|
});
|
|
18
|
-
return
|
|
19
|
-
},
|
|
18
|
+
return c(e, [], 0);
|
|
19
|
+
}, ie = (e, t, c) => {
|
|
20
20
|
let u = null;
|
|
21
21
|
if (typeof e == "number")
|
|
22
|
-
u =
|
|
23
|
-
|
|
24
|
-
(
|
|
25
|
-
increment: (
|
|
26
|
-
|
|
22
|
+
u = L(
|
|
23
|
+
t,
|
|
24
|
+
(s) => ({
|
|
25
|
+
increment: (n) => {
|
|
26
|
+
s.set(+s.get() + (n ?? 0));
|
|
27
27
|
}
|
|
28
28
|
})
|
|
29
29
|
);
|
|
30
30
|
else if (typeof e == "boolean")
|
|
31
|
-
u =
|
|
32
|
-
|
|
33
|
-
(
|
|
31
|
+
u = L(
|
|
32
|
+
t,
|
|
33
|
+
(s) => ({
|
|
34
34
|
toggle: () => {
|
|
35
|
-
|
|
35
|
+
s.set(!s.get());
|
|
36
36
|
}
|
|
37
37
|
})
|
|
38
38
|
);
|
|
39
39
|
else if (Array.isArray(e))
|
|
40
|
-
u =
|
|
41
|
-
|
|
42
|
-
(
|
|
43
|
-
push: (...
|
|
44
|
-
|
|
40
|
+
u = L(
|
|
41
|
+
t,
|
|
42
|
+
(s) => ({
|
|
43
|
+
push: (...n) => {
|
|
44
|
+
s.set(s.get().concat(n));
|
|
45
45
|
},
|
|
46
|
-
unshift: (...
|
|
47
|
-
|
|
46
|
+
unshift: (...n) => {
|
|
47
|
+
s.set(n.concat(s.get()));
|
|
48
48
|
},
|
|
49
|
-
update: (
|
|
50
|
-
const
|
|
51
|
-
|
|
49
|
+
update: (n) => {
|
|
50
|
+
const i = s.get(), l = v(i, n);
|
|
51
|
+
l !== i && s.set(l);
|
|
52
52
|
},
|
|
53
|
-
filter: (
|
|
54
|
-
|
|
53
|
+
filter: (n) => {
|
|
54
|
+
s.set(s.get().filter(n ?? oe));
|
|
55
55
|
},
|
|
56
|
-
add: (
|
|
57
|
-
|
|
56
|
+
add: (n) => {
|
|
57
|
+
s.get().includes(n) || s.set(s.get().concat([n]));
|
|
58
58
|
},
|
|
59
|
-
remove: (
|
|
60
|
-
const
|
|
61
|
-
if (
|
|
62
|
-
const
|
|
63
|
-
|
|
59
|
+
remove: (n) => {
|
|
60
|
+
const i = s.get().indexOf(n);
|
|
61
|
+
if (i < 0) return;
|
|
62
|
+
const l = s.get().slice(0);
|
|
63
|
+
l.splice(i, 1), s.set(l);
|
|
64
64
|
},
|
|
65
|
-
toggle: (
|
|
66
|
-
const
|
|
67
|
-
|
|
65
|
+
toggle: (n, i) => {
|
|
66
|
+
const l = s.get().slice(), d = l.indexOf(n);
|
|
67
|
+
d < 0 ? i ? l.unshift(n) : l.push(n) : l.splice(d, 1), s.set(l);
|
|
68
68
|
}
|
|
69
69
|
})
|
|
70
70
|
);
|
|
71
71
|
else if (e instanceof Set)
|
|
72
|
-
u =
|
|
73
|
-
|
|
74
|
-
(
|
|
75
|
-
add: (
|
|
76
|
-
|
|
72
|
+
u = L(
|
|
73
|
+
t,
|
|
74
|
+
(s) => ({
|
|
75
|
+
add: (n) => {
|
|
76
|
+
s.set(new Set(s.get()).add(n));
|
|
77
77
|
},
|
|
78
|
-
delete: (
|
|
79
|
-
const
|
|
80
|
-
|
|
78
|
+
delete: (n) => {
|
|
79
|
+
const i = new Set(s.get());
|
|
80
|
+
i.delete(n), s.set(i);
|
|
81
81
|
},
|
|
82
|
-
toggle: (
|
|
83
|
-
const
|
|
84
|
-
|
|
82
|
+
toggle: (n) => {
|
|
83
|
+
const i = new Set(s.get());
|
|
84
|
+
i.has(n) ? i.delete(n) : i.add(n), s.set(i);
|
|
85
85
|
},
|
|
86
86
|
clear: () => {
|
|
87
|
-
|
|
87
|
+
s.set(/* @__PURE__ */ new Set());
|
|
88
88
|
}
|
|
89
89
|
})
|
|
90
90
|
);
|
|
91
91
|
else if (e instanceof Object) {
|
|
92
|
-
const
|
|
93
|
-
u =
|
|
94
|
-
|
|
95
|
-
(
|
|
96
|
-
setPartial: (
|
|
97
|
-
...
|
|
98
|
-
...typeof
|
|
92
|
+
const s = T.keyPathSeparator || ".";
|
|
93
|
+
u = L(
|
|
94
|
+
t,
|
|
95
|
+
(n) => ({
|
|
96
|
+
setPartial: (i) => n.set((l) => ({
|
|
97
|
+
...l,
|
|
98
|
+
...typeof i == "function" ? i(n.get()) : i
|
|
99
99
|
})),
|
|
100
|
-
update: (
|
|
101
|
-
const
|
|
102
|
-
|
|
100
|
+
update: (i) => {
|
|
101
|
+
const l = n.get(), d = v(l, i);
|
|
102
|
+
d !== l && n.set(d);
|
|
103
103
|
},
|
|
104
|
-
setDeepPartial: (
|
|
105
|
-
if (!
|
|
106
|
-
if (
|
|
107
|
-
let
|
|
108
|
-
const
|
|
109
|
-
|
|
110
|
-
const
|
|
111
|
-
let g =
|
|
112
|
-
for (const
|
|
113
|
-
|
|
114
|
-
const
|
|
115
|
-
if (
|
|
116
|
-
if (
|
|
117
|
-
const
|
|
118
|
-
|
|
104
|
+
setDeepPartial: (i, l, d, b = s) => {
|
|
105
|
+
if (!b) return;
|
|
106
|
+
if (i.includes(b)) {
|
|
107
|
+
let V = i.split(b);
|
|
108
|
+
const p = V[V.length - 1];
|
|
109
|
+
V = V.slice(0, -1);
|
|
110
|
+
const M = { ...n.get() };
|
|
111
|
+
let g = M, P = d;
|
|
112
|
+
for (const x of V) {
|
|
113
|
+
P = P == null ? void 0 : P[Array.isArray(P) ? "0" : x];
|
|
114
|
+
const $ = g[K(g, x)] ?? (Array.isArray(P) ? [] : {});
|
|
115
|
+
if ($ == null || typeof $ != "object") {
|
|
116
|
+
if (d == null) throw "Incorrect path for setDeepPartial";
|
|
117
|
+
const C = typeof l == "function" ? l(void 0) : l;
|
|
118
|
+
n.get()[i] !== C && n.do.setPartial({ [i]: C });
|
|
119
119
|
return;
|
|
120
120
|
}
|
|
121
|
-
g = g[
|
|
121
|
+
g = g[K(g, x)] = Array.isArray($) ? [...$] : { ...$ };
|
|
122
122
|
}
|
|
123
|
-
const
|
|
124
|
-
g[
|
|
123
|
+
const w = g[p];
|
|
124
|
+
g[p] = typeof l == "function" ? l(g[p]) : l, w !== g[p] && n.set(M);
|
|
125
125
|
return;
|
|
126
126
|
}
|
|
127
|
-
const h =
|
|
128
|
-
A !== h &&
|
|
127
|
+
const h = n.get()[i], A = typeof l == "function" ? l(h) : l;
|
|
128
|
+
A !== h && n.do.setPartial({ [i]: A });
|
|
129
129
|
}
|
|
130
130
|
})
|
|
131
131
|
);
|
|
132
132
|
}
|
|
133
|
-
const
|
|
134
|
-
(
|
|
135
|
-
() =>
|
|
136
|
-
|
|
137
|
-
(
|
|
138
|
-
) : null,
|
|
139
|
-
return
|
|
140
|
-
(
|
|
141
|
-
),
|
|
142
|
-
},
|
|
143
|
-
const
|
|
133
|
+
const y = typeof c == "object" && c != null && "do" in c ? c.do(
|
|
134
|
+
(s, n) => t.set(s, n),
|
|
135
|
+
() => t.get(),
|
|
136
|
+
t,
|
|
137
|
+
(s, n, i) => t.setDeferred(s, n, i)
|
|
138
|
+
) : null, S = {};
|
|
139
|
+
return y && Object.keys(y).forEach((s) => Object.defineProperty(S, s, { get: () => y[s] })), u && Object.keys(u).forEach(
|
|
140
|
+
(s) => Object.defineProperty(S, s, { get: () => u[s] })
|
|
141
|
+
), S;
|
|
142
|
+
}, oe = (e) => e, L = (e, t, c) => t(e), v = (e, t) => {
|
|
143
|
+
const c = Array.isArray(e) ? e.slice(0) : { ...e };
|
|
144
144
|
let u = !1;
|
|
145
|
-
const
|
|
146
|
-
onSet: (
|
|
147
|
-
if (
|
|
148
|
-
let
|
|
145
|
+
const y = ce(e, {
|
|
146
|
+
onSet: (S, s, n, i, l) => {
|
|
147
|
+
if (i === l) return !0;
|
|
148
|
+
let d = c;
|
|
149
149
|
u = !0;
|
|
150
|
-
for (const
|
|
151
|
-
const h =
|
|
152
|
-
|
|
150
|
+
for (const b of s) {
|
|
151
|
+
const h = d[b];
|
|
152
|
+
d = d[b] = Array.isArray(h) ? h.slice(0) : { ...h };
|
|
153
153
|
}
|
|
154
|
-
return
|
|
154
|
+
return d[n] = i, !0;
|
|
155
155
|
}
|
|
156
156
|
});
|
|
157
|
-
return
|
|
158
|
-
},
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
157
|
+
return t(y), u ? c : e;
|
|
158
|
+
}, K = (e, t) => Array.isArray(e) ? `${+t}` : t;
|
|
159
|
+
var le = /* @__PURE__ */ ((e) => (e[e.None = 0] = "None", e[e.Simple = 1] = "Simple", e[e.Middle = 2] = "Middle", e[e.Strong = 3] = "Strong", e))(le || {});
|
|
160
|
+
class ue {
|
|
161
|
+
constructor(t, c) {
|
|
162
|
+
const u = (r) => l = r, y = () => l, S = /* @__PURE__ */ new Set(), s = (r) => r(h());
|
|
163
|
+
let n = !0, i = !1, l = t, d, b = () => {
|
|
164
|
+
}, h = () => y(), A = null, V = () => {
|
|
165
|
+
const r = ie(t, p, c);
|
|
166
|
+
return V = () => r, r;
|
|
166
167
|
};
|
|
167
|
-
const
|
|
168
|
-
get: (
|
|
169
|
-
set:
|
|
170
|
-
}),
|
|
171
|
-
|
|
168
|
+
const p = new Proxy(this, {
|
|
169
|
+
get: (r, a) => a === "do" ? V() : r[a],
|
|
170
|
+
set: fe
|
|
171
|
+
}), M = () => {
|
|
172
|
+
n = !0, i !== !0 && b(h()), i = !1;
|
|
172
173
|
try {
|
|
173
|
-
|
|
174
|
+
H.postMessage({ key: f, value: y() });
|
|
174
175
|
} catch {
|
|
175
176
|
}
|
|
176
|
-
}, g = (
|
|
177
|
-
const
|
|
178
|
-
|
|
177
|
+
}, g = (r, a) => {
|
|
178
|
+
const D = typeof r == "function" ? r(h()) : r;
|
|
179
|
+
D !== h() && (u(D), i = a, n && (n = !1, S.forEach(s), queueMicrotask(M)));
|
|
179
180
|
};
|
|
180
|
-
this.set = (
|
|
181
|
-
|
|
181
|
+
this.set = (r, a) => g(r, a), this.get = () => h(), this.initialValue = t, this.isInitialValue = () => t === y(), this.subscribe = (r) => (S.add(r), () => {
|
|
182
|
+
S.delete(r);
|
|
182
183
|
}), this.reset = () => {
|
|
183
|
-
g(
|
|
184
|
+
g(t, !0);
|
|
184
185
|
};
|
|
185
|
-
const
|
|
186
|
-
g(
|
|
186
|
+
const P = (r, a) => {
|
|
187
|
+
g(r, a), d = void 0;
|
|
187
188
|
};
|
|
188
|
-
if (this.setDeferred = (
|
|
189
|
-
|
|
190
|
-
},
|
|
191
|
-
let
|
|
192
|
-
if (
|
|
193
|
-
throw console.error(
|
|
194
|
-
} : (
|
|
195
|
-
if (typeof
|
|
196
|
-
|
|
197
|
-
else if ("storeKey" in
|
|
198
|
-
|
|
199
|
-
else return
|
|
200
|
-
const
|
|
201
|
-
|
|
202
|
-
|
|
189
|
+
if (this.setDeferred = (r, a = 500, D, W = !0) => {
|
|
190
|
+
W && d === void 0 && g(r, D), clearTimeout(d), d = setTimeout(P, a, r, D);
|
|
191
|
+
}, c == null) return p;
|
|
192
|
+
let w = null, x = null, $ = !0, C = !0, U = !1, R = 0, I = 0, k = -1, E = t instanceof Set ? (r) => new Set(r) : (r) => r, _ = t instanceof Set ? (r) => {
|
|
193
|
+
if (r instanceof Set) return Array.from(r);
|
|
194
|
+
throw console.error(r), "The value is not Set instance";
|
|
195
|
+
} : (r) => r;
|
|
196
|
+
if (typeof c == "string")
|
|
197
|
+
w = c;
|
|
198
|
+
else if ("storeKey" in c)
|
|
199
|
+
$ = c.warnOnDuplicateStoreKey ?? $, C = c.listenStorageChanges ?? C, w = c.storeKey, E = c.unzipValue ?? E, _ = c.zipValue ?? _, U = c.unchangable ?? U, R = c.securifyKeyLevel ?? T.securifyKeyLevel ?? R, I = c.securifyValueLevel ?? T.securifyValueLevel ?? I, x = c.exp ?? x;
|
|
200
|
+
else return p;
|
|
201
|
+
const F = R ? m(
|
|
202
|
+
w,
|
|
203
|
+
3
|
|
204
|
+
/* Strong */
|
|
205
|
+
) : w, f = `${I ? J : z}${F}`;
|
|
206
|
+
if (R) {
|
|
207
|
+
const r = `${z}${w}`;
|
|
208
|
+
r in o && (o[f] = o[r], delete o[r]);
|
|
209
|
+
} else {
|
|
210
|
+
const r = `${z}${m(
|
|
211
|
+
w,
|
|
212
|
+
3
|
|
213
|
+
/* Strong */
|
|
214
|
+
)}`;
|
|
215
|
+
r in o && (o[f] = o[r], delete o[r]);
|
|
216
|
+
}
|
|
217
|
+
if (I) {
|
|
218
|
+
delete o[`${z}${F}`];
|
|
219
|
+
const r = _, a = E;
|
|
220
|
+
E = (D) => {
|
|
221
|
+
try {
|
|
222
|
+
return a(Q(D, I)[0]);
|
|
223
|
+
} catch {
|
|
224
|
+
return delete o[f], "";
|
|
225
|
+
}
|
|
226
|
+
}, _ = (D) => {
|
|
227
|
+
try {
|
|
228
|
+
return m([r(D)], I);
|
|
229
|
+
} catch {
|
|
230
|
+
return delete o[f], "";
|
|
231
|
+
}
|
|
232
|
+
};
|
|
233
|
+
} else delete o[`${J}${F}`];
|
|
234
|
+
const X = x === null || !(x(p, f in o) instanceof Date) ? (r) => m(
|
|
235
|
+
[_(r)],
|
|
236
|
+
0
|
|
237
|
+
/* None */
|
|
238
|
+
) : (r) => (A ?? (A = {}), A.exp = x(p, f in o).getTime(), A.exp - Date.now() < 24 * 60 * 60 * 1e3 && (clearTimeout(k), clearTimeout(ee[f]), k = setTimeout(() => this.reset(), A.exp - Date.now())), A.exp = Math.trunc(A.exp / 1e3), m(
|
|
239
|
+
[_(r), A],
|
|
240
|
+
0
|
|
241
|
+
/* None */
|
|
242
|
+
)), Y = (r) => {
|
|
243
|
+
const a = Q(
|
|
244
|
+
r,
|
|
245
|
+
0
|
|
246
|
+
/* None */
|
|
247
|
+
);
|
|
248
|
+
return A = a[1], E(a[0]);
|
|
203
249
|
};
|
|
204
|
-
let
|
|
205
|
-
if (
|
|
206
|
-
if (h =
|
|
207
|
-
|
|
250
|
+
let Z = !0;
|
|
251
|
+
if (B[f] = p, o[`atom/${w}`] && (o[f] || (o[f] = `[${o[`atom/${w}`]}]`), delete o[`atom/${w}`]), h = () => {
|
|
252
|
+
if (h = y, Z) {
|
|
253
|
+
Z = !1;
|
|
208
254
|
try {
|
|
209
|
-
u(
|
|
255
|
+
u(f in o ? Y(o[f]) : t);
|
|
210
256
|
} catch {
|
|
211
|
-
console.warn("Invalid json value",
|
|
257
|
+
console.warn("Invalid json value", o[f]);
|
|
212
258
|
}
|
|
213
259
|
}
|
|
214
|
-
return
|
|
215
|
-
},
|
|
216
|
-
if (
|
|
260
|
+
return y();
|
|
261
|
+
}, b = (r) => {
|
|
262
|
+
if (r === t) {
|
|
217
263
|
this.reset();
|
|
218
264
|
return;
|
|
219
265
|
}
|
|
220
|
-
|
|
266
|
+
o[f] = X(r);
|
|
221
267
|
}, this.reset = () => {
|
|
222
|
-
delete
|
|
223
|
-
},
|
|
224
|
-
if (
|
|
225
|
-
let
|
|
226
|
-
|
|
227
|
-
clearTimeout(
|
|
268
|
+
delete o[f], g(t, !0);
|
|
269
|
+
}, $ && j[f] !== void 0 && console.warn("Duplicate Atom key", w), C)
|
|
270
|
+
if (U) {
|
|
271
|
+
let r = !1, a;
|
|
272
|
+
N[f] = this, j[f] = () => {
|
|
273
|
+
clearTimeout(a), a = setTimeout(() => r = !1, 10), !r && (r = !0, o[f] = X(y()));
|
|
228
274
|
};
|
|
229
275
|
} else
|
|
230
|
-
|
|
231
|
-
if (
|
|
276
|
+
j[f] = (r) => {
|
|
277
|
+
if (r.newValue === null) {
|
|
232
278
|
this.reset();
|
|
233
279
|
return;
|
|
234
280
|
}
|
|
235
281
|
try {
|
|
236
|
-
g(
|
|
282
|
+
g(Y(r.newValue));
|
|
237
283
|
} catch {
|
|
238
|
-
console.warn("Invalid json value",
|
|
284
|
+
console.warn("Invalid json value", r.newValue);
|
|
239
285
|
}
|
|
240
286
|
};
|
|
241
|
-
return
|
|
287
|
+
return p;
|
|
242
288
|
}
|
|
243
289
|
}
|
|
244
|
-
let
|
|
290
|
+
let H;
|
|
245
291
|
try {
|
|
246
|
-
|
|
247
|
-
var
|
|
248
|
-
(
|
|
292
|
+
H = new BroadcastChannel("updateHere"), H.addEventListener("message", (e) => {
|
|
293
|
+
var t;
|
|
294
|
+
(t = N[e.data.key]) == null || t.set(e.data.value, !0);
|
|
249
295
|
});
|
|
250
296
|
} catch {
|
|
251
297
|
}
|
|
252
|
-
const
|
|
253
|
-
throw `${
|
|
298
|
+
const o = localStorage, j = {}, N = {}, fe = (e, t) => {
|
|
299
|
+
throw `${t} is readonly property`;
|
|
254
300
|
};
|
|
255
301
|
window.addEventListener("storage", (e) => {
|
|
256
|
-
var
|
|
257
|
-
e.key === null || e.newValue === e.oldValue || (
|
|
302
|
+
var t;
|
|
303
|
+
e.key === null || e.newValue === e.oldValue || (t = j[e.key]) == null || t.call(j, e);
|
|
258
304
|
});
|
|
259
|
-
const
|
|
260
|
-
|
|
261
|
-
|
|
305
|
+
const ae = o.setItem.bind(o), de = o.removeItem.bind(o);
|
|
306
|
+
o.setItem = (e, t) => {
|
|
307
|
+
N[e] === void 0 && ae.call(o, e, t);
|
|
262
308
|
};
|
|
263
|
-
|
|
264
|
-
|
|
309
|
+
o.removeItem = (e) => {
|
|
310
|
+
N[e] === void 0 && de.call(o, e);
|
|
265
311
|
};
|
|
266
|
-
const
|
|
312
|
+
const ge = /"exp":\s*(\d+)/, z = "atom\\", J = "atom`s\\", B = {}, ee = {}, te = /[a-z]/gi, q = 5, G = {};
|
|
313
|
+
for (let e = 54; e < 80; e++) {
|
|
314
|
+
if (e === 68 || e === 72 || e === 55) continue;
|
|
315
|
+
const t = String.fromCharCode(e + 43).toUpperCase(), c = String.fromCharCode(e + 43).toLowerCase();
|
|
316
|
+
G[t] = c, G[c] = t;
|
|
317
|
+
}
|
|
318
|
+
const re = (e) => G[e] ?? e, m = /* @__PURE__ */ (() => {
|
|
319
|
+
const e = {
|
|
320
|
+
0: (t) => JSON.stringify(t),
|
|
321
|
+
1: (t) => btoa(encodeURI(e[
|
|
322
|
+
0
|
|
323
|
+
/* None */
|
|
324
|
+
](t))),
|
|
325
|
+
2: (t) => {
|
|
326
|
+
const c = e[
|
|
327
|
+
1
|
|
328
|
+
/* Simple */
|
|
329
|
+
](t);
|
|
330
|
+
return `${c.slice(0, q)}${c.slice(q).replace(te, re)}`;
|
|
331
|
+
},
|
|
332
|
+
3: (t) => btoa(e[
|
|
333
|
+
2
|
|
334
|
+
/* Middle */
|
|
335
|
+
](t))
|
|
336
|
+
};
|
|
337
|
+
return (t, c) => {
|
|
338
|
+
try {
|
|
339
|
+
return e[c](t);
|
|
340
|
+
} catch (u) {
|
|
341
|
+
if (c === 0) throw u;
|
|
342
|
+
return e[
|
|
343
|
+
0
|
|
344
|
+
/* None */
|
|
345
|
+
](t);
|
|
346
|
+
}
|
|
347
|
+
};
|
|
348
|
+
})(), Q = /* @__PURE__ */ (() => {
|
|
349
|
+
const e = {
|
|
350
|
+
0: (t) => JSON.parse(t),
|
|
351
|
+
1: (t) => e[
|
|
352
|
+
0
|
|
353
|
+
/* None */
|
|
354
|
+
](decodeURI(atob(t))),
|
|
355
|
+
2: (t) => e[
|
|
356
|
+
1
|
|
357
|
+
/* Simple */
|
|
358
|
+
](
|
|
359
|
+
`${t.slice(0, q)}${t.slice(q).replace(te, re)}`
|
|
360
|
+
),
|
|
361
|
+
3: (t) => e[
|
|
362
|
+
2
|
|
363
|
+
/* Middle */
|
|
364
|
+
](atob(t))
|
|
365
|
+
};
|
|
366
|
+
return (t, c) => {
|
|
367
|
+
try {
|
|
368
|
+
return e[c](t);
|
|
369
|
+
} catch (u) {
|
|
370
|
+
if (c === 0) throw u;
|
|
371
|
+
return e[
|
|
372
|
+
0
|
|
373
|
+
/* None */
|
|
374
|
+
](t);
|
|
375
|
+
}
|
|
376
|
+
};
|
|
377
|
+
})();
|
|
267
378
|
setTimeout(() => {
|
|
268
|
-
Object.keys(
|
|
379
|
+
Object.keys(o).forEach((e) => {
|
|
269
380
|
var u;
|
|
270
|
-
if (
|
|
271
|
-
const
|
|
272
|
-
if (!
|
|
273
|
-
const
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
381
|
+
if (typeof o[e] != "string" || !e.startsWith(z) && !e.startsWith(J)) return;
|
|
382
|
+
const t = +((u = o[e].match(ge)) == null ? void 0 : u[1]);
|
|
383
|
+
if (!t || t * 1e3 - Date.now() > 24 * 60 * 60 * 1e3) return;
|
|
384
|
+
const c = Q(
|
|
385
|
+
o[e],
|
|
386
|
+
0
|
|
387
|
+
/* None */
|
|
388
|
+
);
|
|
389
|
+
!Array.isArray(c) || c[1] == null || !("exp" in c[1]) || c[1].exp !== t || (ee[e] = setTimeout(() => {
|
|
390
|
+
B[e] ? B[e].reset() : delete o[e];
|
|
391
|
+
}, t * 1e3 - Date.now()));
|
|
277
392
|
});
|
|
278
393
|
}, 1e3);
|
|
279
394
|
export {
|
|
280
|
-
|
|
281
|
-
le as
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
se as
|
|
289
|
-
|
|
395
|
+
ue as Atom,
|
|
396
|
+
le as AtomSecureLevel,
|
|
397
|
+
Ae as atom,
|
|
398
|
+
ye as configureAtomaric,
|
|
399
|
+
T as configuredOptions,
|
|
400
|
+
Se as useAtom,
|
|
401
|
+
we as useAtomDo,
|
|
402
|
+
pe as useAtomGet,
|
|
403
|
+
se as useAtomSet,
|
|
404
|
+
he as useAtomSetDeferred,
|
|
405
|
+
ne as useAtomValue
|
|
290
406
|
};
|