atomirx 0.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.
Files changed (121) hide show
  1. package/README.md +1666 -0
  2. package/coverage/base.css +224 -0
  3. package/coverage/block-navigation.js +87 -0
  4. package/coverage/clover.xml +1440 -0
  5. package/coverage/coverage-final.json +14 -0
  6. package/coverage/favicon.png +0 -0
  7. package/coverage/index.html +131 -0
  8. package/coverage/prettify.css +1 -0
  9. package/coverage/prettify.js +2 -0
  10. package/coverage/sort-arrow-sprite.png +0 -0
  11. package/coverage/sorter.js +210 -0
  12. package/coverage/src/core/atom.ts.html +889 -0
  13. package/coverage/src/core/batch.ts.html +223 -0
  14. package/coverage/src/core/define.ts.html +805 -0
  15. package/coverage/src/core/emitter.ts.html +919 -0
  16. package/coverage/src/core/equality.ts.html +631 -0
  17. package/coverage/src/core/hook.ts.html +460 -0
  18. package/coverage/src/core/index.html +281 -0
  19. package/coverage/src/core/isAtom.ts.html +100 -0
  20. package/coverage/src/core/isPromiseLike.ts.html +133 -0
  21. package/coverage/src/core/onCreateHook.ts.html +136 -0
  22. package/coverage/src/core/scheduleNotifyHook.ts.html +94 -0
  23. package/coverage/src/core/types.ts.html +523 -0
  24. package/coverage/src/core/withUse.ts.html +253 -0
  25. package/coverage/src/index.html +116 -0
  26. package/coverage/src/index.ts.html +106 -0
  27. package/dist/core/atom.d.ts +63 -0
  28. package/dist/core/atom.test.d.ts +1 -0
  29. package/dist/core/atomState.d.ts +104 -0
  30. package/dist/core/atomState.test.d.ts +1 -0
  31. package/dist/core/batch.d.ts +126 -0
  32. package/dist/core/batch.test.d.ts +1 -0
  33. package/dist/core/define.d.ts +173 -0
  34. package/dist/core/define.test.d.ts +1 -0
  35. package/dist/core/derived.d.ts +102 -0
  36. package/dist/core/derived.test.d.ts +1 -0
  37. package/dist/core/effect.d.ts +120 -0
  38. package/dist/core/effect.test.d.ts +1 -0
  39. package/dist/core/emitter.d.ts +237 -0
  40. package/dist/core/emitter.test.d.ts +1 -0
  41. package/dist/core/equality.d.ts +62 -0
  42. package/dist/core/equality.test.d.ts +1 -0
  43. package/dist/core/hook.d.ts +134 -0
  44. package/dist/core/hook.test.d.ts +1 -0
  45. package/dist/core/isAtom.d.ts +9 -0
  46. package/dist/core/isPromiseLike.d.ts +9 -0
  47. package/dist/core/isPromiseLike.test.d.ts +1 -0
  48. package/dist/core/onCreateHook.d.ts +79 -0
  49. package/dist/core/promiseCache.d.ts +134 -0
  50. package/dist/core/promiseCache.test.d.ts +1 -0
  51. package/dist/core/scheduleNotifyHook.d.ts +51 -0
  52. package/dist/core/select.d.ts +151 -0
  53. package/dist/core/selector.test.d.ts +1 -0
  54. package/dist/core/types.d.ts +279 -0
  55. package/dist/core/withUse.d.ts +38 -0
  56. package/dist/core/withUse.test.d.ts +1 -0
  57. package/dist/index-2ok7ilik.js +1217 -0
  58. package/dist/index-B_5SFzfl.cjs +1 -0
  59. package/dist/index.cjs +1 -0
  60. package/dist/index.d.ts +14 -0
  61. package/dist/index.js +20 -0
  62. package/dist/index.test.d.ts +1 -0
  63. package/dist/react/index.cjs +30 -0
  64. package/dist/react/index.d.ts +7 -0
  65. package/dist/react/index.js +823 -0
  66. package/dist/react/rx.d.ts +250 -0
  67. package/dist/react/rx.test.d.ts +1 -0
  68. package/dist/react/strictModeTest.d.ts +10 -0
  69. package/dist/react/useAction.d.ts +381 -0
  70. package/dist/react/useAction.test.d.ts +1 -0
  71. package/dist/react/useStable.d.ts +183 -0
  72. package/dist/react/useStable.test.d.ts +1 -0
  73. package/dist/react/useValue.d.ts +134 -0
  74. package/dist/react/useValue.test.d.ts +1 -0
  75. package/package.json +57 -0
  76. package/scripts/publish.js +198 -0
  77. package/src/core/atom.test.ts +369 -0
  78. package/src/core/atom.ts +189 -0
  79. package/src/core/atomState.test.ts +342 -0
  80. package/src/core/atomState.ts +256 -0
  81. package/src/core/batch.test.ts +257 -0
  82. package/src/core/batch.ts +172 -0
  83. package/src/core/define.test.ts +342 -0
  84. package/src/core/define.ts +243 -0
  85. package/src/core/derived.test.ts +381 -0
  86. package/src/core/derived.ts +339 -0
  87. package/src/core/effect.test.ts +196 -0
  88. package/src/core/effect.ts +184 -0
  89. package/src/core/emitter.test.ts +364 -0
  90. package/src/core/emitter.ts +392 -0
  91. package/src/core/equality.test.ts +392 -0
  92. package/src/core/equality.ts +182 -0
  93. package/src/core/hook.test.ts +227 -0
  94. package/src/core/hook.ts +177 -0
  95. package/src/core/isAtom.ts +27 -0
  96. package/src/core/isPromiseLike.test.ts +72 -0
  97. package/src/core/isPromiseLike.ts +16 -0
  98. package/src/core/onCreateHook.ts +92 -0
  99. package/src/core/promiseCache.test.ts +239 -0
  100. package/src/core/promiseCache.ts +279 -0
  101. package/src/core/scheduleNotifyHook.ts +53 -0
  102. package/src/core/select.ts +454 -0
  103. package/src/core/selector.test.ts +257 -0
  104. package/src/core/types.ts +311 -0
  105. package/src/core/withUse.test.ts +249 -0
  106. package/src/core/withUse.ts +56 -0
  107. package/src/index.test.ts +80 -0
  108. package/src/index.ts +51 -0
  109. package/src/react/index.ts +20 -0
  110. package/src/react/rx.test.tsx +416 -0
  111. package/src/react/rx.tsx +300 -0
  112. package/src/react/strictModeTest.tsx +71 -0
  113. package/src/react/useAction.test.ts +989 -0
  114. package/src/react/useAction.ts +605 -0
  115. package/src/react/useStable.test.ts +553 -0
  116. package/src/react/useStable.ts +288 -0
  117. package/src/react/useValue.test.ts +182 -0
  118. package/src/react/useValue.ts +261 -0
  119. package/tsconfig.json +9 -0
  120. package/v2.md +725 -0
  121. package/vite.config.ts +39 -0
@@ -0,0 +1,823 @@
1
+ import We, { useRef as k, useCallback as q, useSyncExternalStore as mr, useReducer as hr, useEffect as ke, memo as _r } from "react";
2
+ import { i as K, r as ne, s as De, t as Fe, a as Sr, b as Tr } from "../index-2ok7ilik.js";
3
+ import { A as Wr, c as Yr, d as Vr, e as Lr, f as Ur, g as Mr, h as qr, k as Nr, j as zr, m as Br, l as Jr, n as Kr, p as Gr, o as Xr, u as Hr } from "../index-2ok7ilik.js";
4
+ function Ye(u, c) {
5
+ const S = K(u) ? ({ get: d }) => d(u) : u, p = ne(c ?? "shallow"), h = k(S), C = k(p);
6
+ h.current = S, C.current = p;
7
+ const E = k(/* @__PURE__ */ new Map()), v = k(/* @__PURE__ */ new Set()), i = k({
8
+ value: void 0,
9
+ initialized: !1
10
+ }), T = q(() => {
11
+ const d = De(h.current);
12
+ if (v.current = d.dependencies, d.promise !== void 0)
13
+ throw d.promise;
14
+ if (d.error !== void 0)
15
+ throw d.error;
16
+ const b = d.value;
17
+ return (!i.current.initialized || !C.current(b, i.current.value)) && (i.current = { value: b, initialized: !0 }), i.current.value;
18
+ }, []), f = q((d) => {
19
+ const b = E.current, P = () => {
20
+ const A = v.current;
21
+ for (const [x, R] of b)
22
+ A.has(x) || (R(), b.delete(x));
23
+ for (const x of A)
24
+ if (!b.has(x)) {
25
+ const R = x.on(() => {
26
+ const _ = De(h.current);
27
+ v.current = _.dependencies, P(), d();
28
+ });
29
+ b.set(x, R);
30
+ }
31
+ };
32
+ return P(), () => {
33
+ for (const A of b.values())
34
+ A();
35
+ b.clear();
36
+ };
37
+ }, []);
38
+ return mr(f, T, T);
39
+ }
40
+ function Or(u) {
41
+ return u == null ? "strict" : Array.isArray(u) ? "shallow" : u instanceof Date ? "deep" : typeof u == "object" ? "shallow" : "strict";
42
+ }
43
+ function kr(u, c) {
44
+ const S = k({}), p = k(null);
45
+ p.current === null && (p.current = {});
46
+ const h = S.current, C = p.current;
47
+ for (const E of Object.keys(u)) {
48
+ const v = u[E], i = h[E];
49
+ if (typeof v == "function") {
50
+ const [b] = Fe(
51
+ i,
52
+ v,
53
+ () => !1
54
+ // Equality doesn't matter for functions
55
+ );
56
+ h[E] = { value: b }, C[E] = b;
57
+ continue;
58
+ }
59
+ const T = c == null ? void 0 : c[E], f = T ? ne(T) : ne(Or(v)), [d] = Fe(
60
+ i,
61
+ v,
62
+ f
63
+ );
64
+ h[E] = { value: d }, C[E] = d;
65
+ }
66
+ for (const E of Object.keys(h))
67
+ E in u || (delete h[E], delete C[E]);
68
+ return C;
69
+ }
70
+ const Ve = {
71
+ status: "idle",
72
+ result: void 0,
73
+ error: void 0
74
+ }, Le = {
75
+ status: "loading",
76
+ result: void 0,
77
+ error: void 0
78
+ };
79
+ function Cr(u, c) {
80
+ switch (c.type) {
81
+ case "START":
82
+ return Le;
83
+ case "SUCCESS":
84
+ return {
85
+ status: "success",
86
+ result: c.result,
87
+ error: void 0
88
+ };
89
+ case "ERROR":
90
+ return {
91
+ status: "error",
92
+ result: void 0,
93
+ error: c.error
94
+ };
95
+ case "RESET":
96
+ return Ve;
97
+ default:
98
+ return u;
99
+ }
100
+ }
101
+ function Dr(u, c = {}) {
102
+ const { lazy: S = !0, exclusive: p = !0, deps: h = [] } = c, C = S ? Ve : Le, [E, v] = hr(
103
+ Cr,
104
+ C
105
+ ), i = k(null), T = k(u);
106
+ T.current = u;
107
+ const f = q(() => {
108
+ const R = i.current;
109
+ return R ? (R.abort(), i.current = null, !0) : !1;
110
+ }, []), d = (S ? [] : h ?? []).filter(K), b = Ye(({ get: R }) => d.map((_) => R(_))), P = q(() => {
111
+ p && f();
112
+ const R = new AbortController();
113
+ i.current = R, v({ type: "START" });
114
+ let _;
115
+ try {
116
+ _ = T.current({ signal: R.signal });
117
+ } catch (y) {
118
+ return v({ type: "ERROR", error: y }), Object.assign(Promise.reject(y), {
119
+ abort: () => R.abort()
120
+ });
121
+ }
122
+ if (Sr(_)) {
123
+ const y = _;
124
+ return y.then(
125
+ (D) => {
126
+ i.current === R && v({ type: "SUCCESS", result: D });
127
+ },
128
+ (D) => {
129
+ if (D instanceof DOMException && D.name === "AbortError") {
130
+ (i.current === null || i.current === R) && v({ type: "ERROR", error: D });
131
+ return;
132
+ }
133
+ i.current === R && v({ type: "ERROR", error: D });
134
+ }
135
+ ), Object.assign(y, {
136
+ abort: () => {
137
+ R.abort(), i.current === R && (i.current = null);
138
+ }
139
+ });
140
+ }
141
+ return v({ type: "SUCCESS", result: _ }), Object.assign(Promise.resolve(_), {
142
+ abort: () => R.abort()
143
+ });
144
+ }, [p, f]), A = (h ?? []).filter((R) => !K(R));
145
+ ke(() => {
146
+ S || P();
147
+ }, [S, ...b, ...A]), ke(() => () => {
148
+ p && f();
149
+ }, [p, f]);
150
+ const x = q(() => {
151
+ p && f(), v({ type: "RESET" });
152
+ }, [p, f]);
153
+ return Object.assign(P, {
154
+ ...E,
155
+ abort: f,
156
+ reset: x
157
+ });
158
+ }
159
+ var ae = { exports: {} }, U = {};
160
+ /**
161
+ * @license React
162
+ * react-jsx-runtime.production.min.js
163
+ *
164
+ * Copyright (c) Facebook, Inc. and its affiliates.
165
+ *
166
+ * This source code is licensed under the MIT license found in the
167
+ * LICENSE file in the root directory of this source tree.
168
+ */
169
+ var Ie;
170
+ function wr() {
171
+ if (Ie) return U;
172
+ Ie = 1;
173
+ var u = We, c = Symbol.for("react.element"), S = Symbol.for("react.fragment"), p = Object.prototype.hasOwnProperty, h = u.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, C = { key: !0, ref: !0, __self: !0, __source: !0 };
174
+ function E(v, i, T) {
175
+ var f, d = {}, b = null, P = null;
176
+ T !== void 0 && (b = "" + T), i.key !== void 0 && (b = "" + i.key), i.ref !== void 0 && (P = i.ref);
177
+ for (f in i) p.call(i, f) && !C.hasOwnProperty(f) && (d[f] = i[f]);
178
+ if (v && v.defaultProps) for (f in i = v.defaultProps, i) d[f] === void 0 && (d[f] = i[f]);
179
+ return { $$typeof: c, type: v, key: b, ref: P, props: d, _owner: h.current };
180
+ }
181
+ return U.Fragment = S, U.jsx = E, U.jsxs = E, U;
182
+ }
183
+ var M = {};
184
+ /**
185
+ * @license React
186
+ * react-jsx-runtime.development.js
187
+ *
188
+ * Copyright (c) Facebook, Inc. and its affiliates.
189
+ *
190
+ * This source code is licensed under the MIT license found in the
191
+ * LICENSE file in the root directory of this source tree.
192
+ */
193
+ var $e;
194
+ function jr() {
195
+ return $e || ($e = 1, process.env.NODE_ENV !== "production" && function() {
196
+ var u = We, c = Symbol.for("react.element"), S = Symbol.for("react.portal"), p = Symbol.for("react.fragment"), h = Symbol.for("react.strict_mode"), C = Symbol.for("react.profiler"), E = Symbol.for("react.provider"), v = Symbol.for("react.context"), i = Symbol.for("react.forward_ref"), T = Symbol.for("react.suspense"), f = Symbol.for("react.suspense_list"), d = Symbol.for("react.memo"), b = Symbol.for("react.lazy"), P = Symbol.for("react.offscreen"), A = Symbol.iterator, x = "@@iterator";
197
+ function R(e) {
198
+ if (e === null || typeof e != "object")
199
+ return null;
200
+ var r = A && e[A] || e[x];
201
+ return typeof r == "function" ? r : null;
202
+ }
203
+ var _ = u.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
204
+ function y(e) {
205
+ {
206
+ for (var r = arguments.length, t = new Array(r > 1 ? r - 1 : 0), n = 1; n < r; n++)
207
+ t[n - 1] = arguments[n];
208
+ D("error", e, t);
209
+ }
210
+ }
211
+ function D(e, r, t) {
212
+ {
213
+ var n = _.ReactDebugCurrentFrame, s = n.getStackAddendum();
214
+ s !== "" && (r += "%s", t = t.concat([s]));
215
+ var l = t.map(function(o) {
216
+ return String(o);
217
+ });
218
+ l.unshift("Warning: " + r), Function.prototype.apply.call(console[e], console, l);
219
+ }
220
+ }
221
+ var ie = !1, Ue = !1, Me = !1, qe = !1, Ne = !1, se;
222
+ se = Symbol.for("react.module.reference");
223
+ function ze(e) {
224
+ return !!(typeof e == "string" || typeof e == "function" || e === p || e === C || Ne || e === h || e === T || e === f || qe || e === P || ie || Ue || Me || typeof e == "object" && e !== null && (e.$$typeof === b || e.$$typeof === d || e.$$typeof === E || e.$$typeof === v || e.$$typeof === i || // This needs to include all possible module reference object
225
+ // types supported by any Flight configuration anywhere since
226
+ // we don't know which Flight build this will end up being used
227
+ // with.
228
+ e.$$typeof === se || e.getModuleId !== void 0));
229
+ }
230
+ function Be(e, r, t) {
231
+ var n = e.displayName;
232
+ if (n)
233
+ return n;
234
+ var s = r.displayName || r.name || "";
235
+ return s !== "" ? t + "(" + s + ")" : t;
236
+ }
237
+ function ue(e) {
238
+ return e.displayName || "Context";
239
+ }
240
+ function F(e) {
241
+ if (e == null)
242
+ return null;
243
+ if (typeof e.tag == "number" && y("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function")
244
+ return e.displayName || e.name || null;
245
+ if (typeof e == "string")
246
+ return e;
247
+ switch (e) {
248
+ case p:
249
+ return "Fragment";
250
+ case S:
251
+ return "Portal";
252
+ case C:
253
+ return "Profiler";
254
+ case h:
255
+ return "StrictMode";
256
+ case T:
257
+ return "Suspense";
258
+ case f:
259
+ return "SuspenseList";
260
+ }
261
+ if (typeof e == "object")
262
+ switch (e.$$typeof) {
263
+ case v:
264
+ var r = e;
265
+ return ue(r) + ".Consumer";
266
+ case E:
267
+ var t = e;
268
+ return ue(t._context) + ".Provider";
269
+ case i:
270
+ return Be(e, e.render, "ForwardRef");
271
+ case d:
272
+ var n = e.displayName || null;
273
+ return n !== null ? n : F(e.type) || "Memo";
274
+ case b: {
275
+ var s = e, l = s._payload, o = s._init;
276
+ try {
277
+ return F(o(l));
278
+ } catch {
279
+ return null;
280
+ }
281
+ }
282
+ }
283
+ return null;
284
+ }
285
+ var I = Object.assign, V = 0, ce, le, fe, de, ve, pe, be;
286
+ function Re() {
287
+ }
288
+ Re.__reactDisabledLog = !0;
289
+ function Je() {
290
+ {
291
+ if (V === 0) {
292
+ ce = console.log, le = console.info, fe = console.warn, de = console.error, ve = console.group, pe = console.groupCollapsed, be = console.groupEnd;
293
+ var e = {
294
+ configurable: !0,
295
+ enumerable: !0,
296
+ value: Re,
297
+ writable: !0
298
+ };
299
+ Object.defineProperties(console, {
300
+ info: e,
301
+ log: e,
302
+ warn: e,
303
+ error: e,
304
+ group: e,
305
+ groupCollapsed: e,
306
+ groupEnd: e
307
+ });
308
+ }
309
+ V++;
310
+ }
311
+ }
312
+ function Ke() {
313
+ {
314
+ if (V--, V === 0) {
315
+ var e = {
316
+ configurable: !0,
317
+ enumerable: !0,
318
+ writable: !0
319
+ };
320
+ Object.defineProperties(console, {
321
+ log: I({}, e, {
322
+ value: ce
323
+ }),
324
+ info: I({}, e, {
325
+ value: le
326
+ }),
327
+ warn: I({}, e, {
328
+ value: fe
329
+ }),
330
+ error: I({}, e, {
331
+ value: de
332
+ }),
333
+ group: I({}, e, {
334
+ value: ve
335
+ }),
336
+ groupCollapsed: I({}, e, {
337
+ value: pe
338
+ }),
339
+ groupEnd: I({}, e, {
340
+ value: be
341
+ })
342
+ });
343
+ }
344
+ V < 0 && y("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
345
+ }
346
+ }
347
+ var G = _.ReactCurrentDispatcher, X;
348
+ function N(e, r, t) {
349
+ {
350
+ if (X === void 0)
351
+ try {
352
+ throw Error();
353
+ } catch (s) {
354
+ var n = s.stack.trim().match(/\n( *(at )?)/);
355
+ X = n && n[1] || "";
356
+ }
357
+ return `
358
+ ` + X + e;
359
+ }
360
+ }
361
+ var H = !1, z;
362
+ {
363
+ var Ge = typeof WeakMap == "function" ? WeakMap : Map;
364
+ z = new Ge();
365
+ }
366
+ function Ee(e, r) {
367
+ if (!e || H)
368
+ return "";
369
+ {
370
+ var t = z.get(e);
371
+ if (t !== void 0)
372
+ return t;
373
+ }
374
+ var n;
375
+ H = !0;
376
+ var s = Error.prepareStackTrace;
377
+ Error.prepareStackTrace = void 0;
378
+ var l;
379
+ l = G.current, G.current = null, Je();
380
+ try {
381
+ if (r) {
382
+ var o = function() {
383
+ throw Error();
384
+ };
385
+ if (Object.defineProperty(o.prototype, "props", {
386
+ set: function() {
387
+ throw Error();
388
+ }
389
+ }), typeof Reflect == "object" && Reflect.construct) {
390
+ try {
391
+ Reflect.construct(o, []);
392
+ } catch (w) {
393
+ n = w;
394
+ }
395
+ Reflect.construct(e, [], o);
396
+ } else {
397
+ try {
398
+ o.call();
399
+ } catch (w) {
400
+ n = w;
401
+ }
402
+ e.call(o.prototype);
403
+ }
404
+ } else {
405
+ try {
406
+ throw Error();
407
+ } catch (w) {
408
+ n = w;
409
+ }
410
+ e();
411
+ }
412
+ } catch (w) {
413
+ if (w && n && typeof w.stack == "string") {
414
+ for (var a = w.stack.split(`
415
+ `), O = n.stack.split(`
416
+ `), g = a.length - 1, m = O.length - 1; g >= 1 && m >= 0 && a[g] !== O[m]; )
417
+ m--;
418
+ for (; g >= 1 && m >= 0; g--, m--)
419
+ if (a[g] !== O[m]) {
420
+ if (g !== 1 || m !== 1)
421
+ do
422
+ if (g--, m--, m < 0 || a[g] !== O[m]) {
423
+ var j = `
424
+ ` + a[g].replace(" at new ", " at ");
425
+ return e.displayName && j.includes("<anonymous>") && (j = j.replace("<anonymous>", e.displayName)), typeof e == "function" && z.set(e, j), j;
426
+ }
427
+ while (g >= 1 && m >= 0);
428
+ break;
429
+ }
430
+ }
431
+ } finally {
432
+ H = !1, G.current = l, Ke(), Error.prepareStackTrace = s;
433
+ }
434
+ var Y = e ? e.displayName || e.name : "", $ = Y ? N(Y) : "";
435
+ return typeof e == "function" && z.set(e, $), $;
436
+ }
437
+ function Xe(e, r, t) {
438
+ return Ee(e, !1);
439
+ }
440
+ function He(e) {
441
+ var r = e.prototype;
442
+ return !!(r && r.isReactComponent);
443
+ }
444
+ function B(e, r, t) {
445
+ if (e == null)
446
+ return "";
447
+ if (typeof e == "function")
448
+ return Ee(e, He(e));
449
+ if (typeof e == "string")
450
+ return N(e);
451
+ switch (e) {
452
+ case T:
453
+ return N("Suspense");
454
+ case f:
455
+ return N("SuspenseList");
456
+ }
457
+ if (typeof e == "object")
458
+ switch (e.$$typeof) {
459
+ case i:
460
+ return Xe(e.render);
461
+ case d:
462
+ return B(e.type, r, t);
463
+ case b: {
464
+ var n = e, s = n._payload, l = n._init;
465
+ try {
466
+ return B(l(s), r, t);
467
+ } catch {
468
+ }
469
+ }
470
+ }
471
+ return "";
472
+ }
473
+ var L = Object.prototype.hasOwnProperty, ye = {}, ge = _.ReactDebugCurrentFrame;
474
+ function J(e) {
475
+ if (e) {
476
+ var r = e._owner, t = B(e.type, e._source, r ? r.type : null);
477
+ ge.setExtraStackFrame(t);
478
+ } else
479
+ ge.setExtraStackFrame(null);
480
+ }
481
+ function Ze(e, r, t, n, s) {
482
+ {
483
+ var l = Function.call.bind(L);
484
+ for (var o in e)
485
+ if (l(e, o)) {
486
+ var a = void 0;
487
+ try {
488
+ if (typeof e[o] != "function") {
489
+ 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`.");
490
+ throw O.name = "Invariant Violation", O;
491
+ }
492
+ a = e[o](r, o, n, t, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
493
+ } catch (g) {
494
+ a = g;
495
+ }
496
+ a && !(a instanceof Error) && (J(s), y("%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 ye) && (ye[a.message] = !0, J(s), y("Failed %s type: %s", t, a.message), J(null));
497
+ }
498
+ }
499
+ }
500
+ var Qe = Array.isArray;
501
+ function Z(e) {
502
+ return Qe(e);
503
+ }
504
+ function er(e) {
505
+ {
506
+ var r = typeof Symbol == "function" && Symbol.toStringTag, t = r && e[Symbol.toStringTag] || e.constructor.name || "Object";
507
+ return t;
508
+ }
509
+ }
510
+ function rr(e) {
511
+ try {
512
+ return me(e), !1;
513
+ } catch {
514
+ return !0;
515
+ }
516
+ }
517
+ function me(e) {
518
+ return "" + e;
519
+ }
520
+ function he(e) {
521
+ if (rr(e))
522
+ return y("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", er(e)), me(e);
523
+ }
524
+ var _e = _.ReactCurrentOwner, tr = {
525
+ key: !0,
526
+ ref: !0,
527
+ __self: !0,
528
+ __source: !0
529
+ }, Se, Te;
530
+ function nr(e) {
531
+ if (L.call(e, "ref")) {
532
+ var r = Object.getOwnPropertyDescriptor(e, "ref").get;
533
+ if (r && r.isReactWarning)
534
+ return !1;
535
+ }
536
+ return e.ref !== void 0;
537
+ }
538
+ function ar(e) {
539
+ if (L.call(e, "key")) {
540
+ var r = Object.getOwnPropertyDescriptor(e, "key").get;
541
+ if (r && r.isReactWarning)
542
+ return !1;
543
+ }
544
+ return e.key !== void 0;
545
+ }
546
+ function or(e, r) {
547
+ typeof e.ref == "string" && _e.current;
548
+ }
549
+ function ir(e, r) {
550
+ {
551
+ var t = function() {
552
+ Se || (Se = !0, y("%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));
553
+ };
554
+ t.isReactWarning = !0, Object.defineProperty(e, "key", {
555
+ get: t,
556
+ configurable: !0
557
+ });
558
+ }
559
+ }
560
+ function sr(e, r) {
561
+ {
562
+ var t = function() {
563
+ Te || (Te = !0, y("%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));
564
+ };
565
+ t.isReactWarning = !0, Object.defineProperty(e, "ref", {
566
+ get: t,
567
+ configurable: !0
568
+ });
569
+ }
570
+ }
571
+ var ur = function(e, r, t, n, s, l, o) {
572
+ var a = {
573
+ // This tag allows us to uniquely identify this as a React Element
574
+ $$typeof: c,
575
+ // Built-in properties that belong on the element
576
+ type: e,
577
+ key: r,
578
+ ref: t,
579
+ props: o,
580
+ // Record the component responsible for creating this element.
581
+ _owner: l
582
+ };
583
+ return a._store = {}, Object.defineProperty(a._store, "validated", {
584
+ configurable: !1,
585
+ enumerable: !1,
586
+ writable: !0,
587
+ value: !1
588
+ }), Object.defineProperty(a, "_self", {
589
+ configurable: !1,
590
+ enumerable: !1,
591
+ writable: !1,
592
+ value: n
593
+ }), Object.defineProperty(a, "_source", {
594
+ configurable: !1,
595
+ enumerable: !1,
596
+ writable: !1,
597
+ value: s
598
+ }), Object.freeze && (Object.freeze(a.props), Object.freeze(a)), a;
599
+ };
600
+ function cr(e, r, t, n, s) {
601
+ {
602
+ var l, o = {}, a = null, O = null;
603
+ t !== void 0 && (he(t), a = "" + t), ar(r) && (he(r.key), a = "" + r.key), nr(r) && (O = r.ref, or(r, s));
604
+ for (l in r)
605
+ L.call(r, l) && !tr.hasOwnProperty(l) && (o[l] = r[l]);
606
+ if (e && e.defaultProps) {
607
+ var g = e.defaultProps;
608
+ for (l in g)
609
+ o[l] === void 0 && (o[l] = g[l]);
610
+ }
611
+ if (a || O) {
612
+ var m = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
613
+ a && ir(o, m), O && sr(o, m);
614
+ }
615
+ return ur(e, a, O, s, n, _e.current, o);
616
+ }
617
+ }
618
+ var Q = _.ReactCurrentOwner, Oe = _.ReactDebugCurrentFrame;
619
+ function W(e) {
620
+ if (e) {
621
+ var r = e._owner, t = B(e.type, e._source, r ? r.type : null);
622
+ Oe.setExtraStackFrame(t);
623
+ } else
624
+ Oe.setExtraStackFrame(null);
625
+ }
626
+ var ee;
627
+ ee = !1;
628
+ function re(e) {
629
+ return typeof e == "object" && e !== null && e.$$typeof === c;
630
+ }
631
+ function Ce() {
632
+ {
633
+ if (Q.current) {
634
+ var e = F(Q.current.type);
635
+ if (e)
636
+ return `
637
+
638
+ Check the render method of \`` + e + "`.";
639
+ }
640
+ return "";
641
+ }
642
+ }
643
+ function lr(e) {
644
+ return "";
645
+ }
646
+ var we = {};
647
+ function fr(e) {
648
+ {
649
+ var r = Ce();
650
+ if (!r) {
651
+ var t = typeof e == "string" ? e : e.displayName || e.name;
652
+ t && (r = `
653
+
654
+ Check the top-level render call using <` + t + ">.");
655
+ }
656
+ return r;
657
+ }
658
+ }
659
+ function je(e, r) {
660
+ {
661
+ if (!e._store || e._store.validated || e.key != null)
662
+ return;
663
+ e._store.validated = !0;
664
+ var t = fr(r);
665
+ if (we[t])
666
+ return;
667
+ we[t] = !0;
668
+ var n = "";
669
+ e && e._owner && e._owner !== Q.current && (n = " It was passed a child from " + F(e._owner.type) + "."), W(e), y('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), W(null);
670
+ }
671
+ }
672
+ function Pe(e, r) {
673
+ {
674
+ if (typeof e != "object")
675
+ return;
676
+ if (Z(e))
677
+ for (var t = 0; t < e.length; t++) {
678
+ var n = e[t];
679
+ re(n) && je(n, r);
680
+ }
681
+ else if (re(e))
682
+ e._store && (e._store.validated = !0);
683
+ else if (e) {
684
+ var s = R(e);
685
+ if (typeof s == "function" && s !== e.entries)
686
+ for (var l = s.call(e), o; !(o = l.next()).done; )
687
+ re(o.value) && je(o.value, r);
688
+ }
689
+ }
690
+ }
691
+ function dr(e) {
692
+ {
693
+ var r = e.type;
694
+ if (r == null || typeof r == "string")
695
+ return;
696
+ var t;
697
+ if (typeof r == "function")
698
+ t = r.propTypes;
699
+ else if (typeof r == "object" && (r.$$typeof === i || // Note: Memo only checks outer props here.
700
+ // Inner props are checked in the reconciler.
701
+ r.$$typeof === d))
702
+ t = r.propTypes;
703
+ else
704
+ return;
705
+ if (t) {
706
+ var n = F(r);
707
+ Ze(t, e.props, "prop", n, e);
708
+ } else if (r.PropTypes !== void 0 && !ee) {
709
+ ee = !0;
710
+ var s = F(r);
711
+ y("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", s || "Unknown");
712
+ }
713
+ typeof r.getDefaultProps == "function" && !r.getDefaultProps.isReactClassApproved && y("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
714
+ }
715
+ }
716
+ function vr(e) {
717
+ {
718
+ for (var r = Object.keys(e.props), t = 0; t < r.length; t++) {
719
+ var n = r[t];
720
+ if (n !== "children" && n !== "key") {
721
+ W(e), y("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", n), W(null);
722
+ break;
723
+ }
724
+ }
725
+ e.ref !== null && (W(e), y("Invalid attribute `ref` supplied to `React.Fragment`."), W(null));
726
+ }
727
+ }
728
+ var xe = {};
729
+ function Ae(e, r, t, n, s, l) {
730
+ {
731
+ var o = ze(e);
732
+ if (!o) {
733
+ var a = "";
734
+ (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.");
735
+ var O = lr();
736
+ O ? a += O : a += Ce();
737
+ var g;
738
+ e === null ? g = "null" : Z(e) ? g = "array" : e !== void 0 && e.$$typeof === c ? (g = "<" + (F(e.type) || "Unknown") + " />", a = " Did you accidentally export a JSX literal instead of a component?") : g = typeof e, y("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", g, a);
739
+ }
740
+ var m = cr(e, r, t, s, l);
741
+ if (m == null)
742
+ return m;
743
+ if (o) {
744
+ var j = r.children;
745
+ if (j !== void 0)
746
+ if (n)
747
+ if (Z(j)) {
748
+ for (var Y = 0; Y < j.length; Y++)
749
+ Pe(j[Y], e);
750
+ Object.freeze && Object.freeze(j);
751
+ } else
752
+ y("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
753
+ else
754
+ Pe(j, e);
755
+ }
756
+ if (L.call(r, "key")) {
757
+ var $ = F(e), w = Object.keys(r).filter(function(gr) {
758
+ return gr !== "key";
759
+ }), te = w.length > 0 ? "{key: someKey, " + w.join(": ..., ") + ": ...}" : "{key: someKey}";
760
+ if (!xe[$ + te]) {
761
+ var yr = w.length > 0 ? "{" + w.join(": ..., ") + ": ...}" : "{}";
762
+ y(`A props object containing a "key" prop is being spread into JSX:
763
+ let props = %s;
764
+ <%s {...props} />
765
+ React keys must be passed directly to JSX without using spread:
766
+ let props = %s;
767
+ <%s key={someKey} {...props} />`, te, $, yr, $), xe[$ + te] = !0;
768
+ }
769
+ }
770
+ return e === p ? vr(m) : dr(m), m;
771
+ }
772
+ }
773
+ function pr(e, r, t) {
774
+ return Ae(e, r, t, !0);
775
+ }
776
+ function br(e, r, t) {
777
+ return Ae(e, r, t, !1);
778
+ }
779
+ var Rr = br, Er = pr;
780
+ M.Fragment = p, M.jsx = Rr, M.jsxs = Er;
781
+ }()), M;
782
+ }
783
+ process.env.NODE_ENV === "production" ? ae.exports = wr() : ae.exports = jr();
784
+ var oe = ae.exports;
785
+ function Fr(u, c) {
786
+ return /* @__PURE__ */ oe.jsx(
787
+ Pr,
788
+ {
789
+ selectorOrAtom: u,
790
+ equals: c
791
+ }
792
+ );
793
+ }
794
+ const Pr = _r(
795
+ function(c) {
796
+ const S = K(c.selectorOrAtom) ? ({ get: h }) => h(c.selectorOrAtom) : c.selectorOrAtom, p = Ye(S, c.equals);
797
+ return /* @__PURE__ */ oe.jsx(oe.Fragment, { children: p ?? null });
798
+ },
799
+ (u, c) => Tr(u.selectorOrAtom, c.selectorOrAtom) && u.equals === c.equals
800
+ );
801
+ export {
802
+ Wr as AllAtomsRejectedError,
803
+ Yr as atom,
804
+ Vr as batch,
805
+ Lr as define,
806
+ Ur as derived,
807
+ Mr as effect,
808
+ qr as emitter,
809
+ Nr as getAtomState,
810
+ K as isAtom,
811
+ zr as isDerived,
812
+ Br as isFulfilled,
813
+ Jr as isPending,
814
+ Kr as isRejected,
815
+ Gr as onCreateHook,
816
+ Fr as rx,
817
+ De as select,
818
+ Xr as trackPromise,
819
+ Hr as unwrap,
820
+ Dr as useAction,
821
+ kr as useStable,
822
+ Ye as useValue
823
+ };