@but212/atom-effect-jquery 0.9.2 → 0.10.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/dist/index.mjs CHANGED
@@ -1,14 +1,14 @@
1
1
  import u from "jquery";
2
- import { default as xt } from "jquery";
3
- const Le = {
2
+ import { default as Ot } from "jquery";
3
+ const Ve = {
4
4
  /** One second in milliseconds */
5
5
  ONE_SECOND_MS: 1e3
6
- }, oe = {
6
+ }, ue = {
7
7
  IDLE: "idle",
8
8
  PENDING: "pending",
9
9
  RESOLVED: "resolved",
10
10
  REJECTED: "rejected"
11
- }, Z = {
11
+ }, te = {
12
12
  DISPOSED: 1,
13
13
  // 0001 - Effect has been disposed
14
14
  EXECUTING: 2
@@ -28,7 +28,10 @@ const Le = {
28
28
  // 100000 - Currently recomputing
29
29
  HAS_ERROR: 64
30
30
  // 1000000 - Has error state
31
- }, L = {
31
+ }, Y = {
32
+ SYNC: 1,
33
+ NOTIFICATION_SCHEDULED: 2
34
+ }, B = {
32
35
  /** Maximum effect executions per second to detect infinite loops (Legacy/Fallback) */
33
36
  MAX_EXECUTIONS_PER_SECOND: 1e3,
34
37
  /**
@@ -45,13 +48,13 @@ const Le = {
45
48
  MAX_FLUSH_ITERATIONS: 1e3,
46
49
  /** Minimum allowed value for max flush iterations */
47
50
  MIN_FLUSH_ITERATIONS: 10
48
- }, Ee = {
51
+ }, ye = {
49
52
  /** Maximum dependencies before warning about large dependency graphs */
50
53
  MAX_DEPENDENCIES: 1e3,
51
54
  /** Enable infinite loop detection warnings */
52
55
  WARN_INFINITE_LOOP: !0
53
- }, B = 1073741823, T = typeof process < "u" && process.env && process.env.NODE_ENV !== "production", je = Object.freeze([]);
54
- class k extends Error {
56
+ }, z = 1073741823, v = typeof process < "u" && process.env && process.env.NODE_ENV !== "production", Be = Object.freeze([]);
57
+ class w extends Error {
55
58
  /**
56
59
  * Creates a new AtomError
57
60
  * @param message - Error message describing what went wrong
@@ -62,7 +65,7 @@ class k extends Error {
62
65
  super(e), this.name = "AtomError", this.cause = s, this.recoverable = n, this.timestamp = /* @__PURE__ */ new Date();
63
66
  }
64
67
  }
65
- class X extends k {
68
+ class Q extends w {
66
69
  /**
67
70
  * Creates a new ComputedError
68
71
  * @param message - Error message
@@ -72,7 +75,7 @@ class X extends k {
72
75
  super(e, s, !0), this.name = "ComputedError";
73
76
  }
74
77
  }
75
- class V extends k {
78
+ class V extends w {
76
79
  /**
77
80
  * Creates a new EffectError
78
81
  * @param message - Error message
@@ -82,7 +85,7 @@ class V extends k {
82
85
  super(e, s, !1), this.name = "EffectError";
83
86
  }
84
87
  }
85
- class ee extends k {
88
+ class se extends w {
86
89
  /**
87
90
  * Creates a new SchedulerError
88
91
  * @param message - Error message
@@ -92,7 +95,7 @@ class ee extends k {
92
95
  super(e, s, !1), this.name = "SchedulerError";
93
96
  }
94
97
  }
95
- const y = {
98
+ const g = {
96
99
  // ─────────────────────────────────────────────────────────────────
97
100
  // Computed errors
98
101
  // ─────────────────────────────────────────────────────────────────
@@ -144,28 +147,28 @@ const y = {
144
147
  * @remarks This prevents cascading failures from masking the original error.
145
148
  */
146
149
  CALLBACK_ERROR_IN_ERROR_HANDLER: "Error occurred during onError callback execution"
147
- }, he = /* @__PURE__ */ Symbol("debugName"), Be = /* @__PURE__ */ Symbol("id"), ae = /* @__PURE__ */ Symbol("type"), ge = /* @__PURE__ */ Symbol("noDefaultValue");
148
- function qe(t) {
150
+ }, fe = /* @__PURE__ */ Symbol("debugName"), qe = /* @__PURE__ */ Symbol("id"), de = /* @__PURE__ */ Symbol("type"), De = /* @__PURE__ */ Symbol("noDefaultValue");
151
+ function ze(t) {
149
152
  return "dependencies" in t && Array.isArray(t.dependencies);
150
153
  }
151
- let me = 0;
152
- function Ce(t, e, s) {
154
+ let Ie = 0;
155
+ function xe(t, e, s) {
153
156
  if (t._visitedEpoch !== s) {
154
157
  if (t._visitedEpoch = s, t === e)
155
- throw new X("Indirect circular dependency detected");
156
- if (qe(t)) {
158
+ throw new Q("Indirect circular dependency detected");
159
+ if (ze(t)) {
157
160
  const n = t.dependencies;
158
161
  for (let i = 0; i < n.length; i++) {
159
162
  const r = n[i];
160
- r && Ce(r, e, s);
163
+ r && xe(r, e, s);
161
164
  }
162
165
  }
163
166
  }
164
167
  }
165
- const w = {
168
+ const R = {
166
169
  enabled: typeof process < "u" && process.env?.NODE_ENV === "development",
167
- maxDependencies: Ee.MAX_DEPENDENCIES,
168
- warnInfiniteLoop: Ee.WARN_INFINITE_LOOP,
170
+ maxDependencies: ye.MAX_DEPENDENCIES,
171
+ warnInfiniteLoop: ye.WARN_INFINITE_LOOP,
169
172
  warn(t, e) {
170
173
  this.enabled && t && console.warn(`[Atom Effect] ${e}`);
171
174
  },
@@ -176,32 +179,32 @@ const w = {
176
179
  */
177
180
  checkCircular(t, e) {
178
181
  if (t === e)
179
- throw new X("Direct circular dependency detected");
180
- this.enabled && (me++, Ce(t, e, me));
182
+ throw new Q("Direct circular dependency detected");
183
+ this.enabled && (Ie++, xe(t, e, Ie));
181
184
  },
182
185
  attachDebugInfo(t, e, s) {
183
186
  if (!this.enabled)
184
187
  return;
185
188
  const n = t;
186
- n[he] = `${e}_${s}`, n[Be] = s, n[ae] = e;
189
+ n[fe] = `${e}_${s}`, n[qe] = s, n[de] = e;
187
190
  },
188
191
  getDebugName(t) {
189
- if (t != null && he in t)
190
- return t[he];
192
+ if (t != null && fe in t)
193
+ return t[fe];
191
194
  },
192
195
  getDebugType(t) {
193
- if (t != null && ae in t)
194
- return t[ae];
196
+ if (t != null && de in t)
197
+ return t[de];
195
198
  }
196
199
  };
197
- let ze = 1;
198
- const Xe = () => ze++;
199
- class ve {
200
+ let Xe = 1;
201
+ const Ge = () => Xe++;
202
+ class Re {
200
203
  constructor() {
201
- this.id = Xe() & B, this.flags = 0;
204
+ this.id = Ge() & z, this.flags = 0;
202
205
  }
203
206
  }
204
- class Ne extends ve {
207
+ class Ae extends Re {
205
208
  constructor() {
206
209
  super(), this.version = 0, this._lastSeenEpoch = -1;
207
210
  }
@@ -216,7 +219,7 @@ class Ne extends ve {
216
219
  if (typeof e == "object" && e !== null && "execute" in e)
217
220
  return this._objectSubscribers.add(e);
218
221
  if (typeof e != "function")
219
- throw new k(y.ATOM_SUBSCRIBER_MUST_BE_FUNCTION);
222
+ throw new w(g.ATOM_SUBSCRIBER_MUST_BE_FUNCTION);
220
223
  return this._functionSubscribers.add(e);
221
224
  }
222
225
  /**
@@ -234,35 +237,35 @@ class Ne extends ve {
234
237
  _notifySubscribers(e, s) {
235
238
  this._functionSubscribers.forEachSafe(
236
239
  (n) => n(e, s),
237
- (n) => console.error(new k(y.ATOM_INDIVIDUAL_SUBSCRIBER_FAILED, n))
240
+ (n) => console.error(new w(g.ATOM_INDIVIDUAL_SUBSCRIBER_FAILED, n))
238
241
  ), this._objectSubscribers.forEachSafe(
239
242
  (n) => n.execute(),
240
- (n) => console.error(new k(y.ATOM_INDIVIDUAL_SUBSCRIBER_FAILED, n))
243
+ (n) => console.error(new w(g.ATOM_INDIVIDUAL_SUBSCRIBER_FAILED, n))
241
244
  );
242
245
  }
243
246
  }
244
- let te = 0;
245
- function xe() {
246
- return te = te + 1 & B || 1, te;
247
+ let ne = 0;
248
+ function Oe() {
249
+ return ne = ne + 1 & z || 1, ne;
247
250
  }
248
- function Ge() {
249
- return te;
251
+ function He() {
252
+ return ne;
250
253
  }
251
- let ne = 0, fe = 0, ie = !1;
252
- function ye() {
253
- return ie ? (T && console.warn(
254
+ let re = 0, pe = 0, oe = !1;
255
+ function Ce() {
256
+ return oe ? (v && console.warn(
254
257
  "Warning: startFlush() called during flush - ignored to prevent infinite loop detection bypass"
255
- ), !1) : (ie = !0, ne = ne + 1 & B, fe = 0, !0);
258
+ ), !1) : (oe = !0, re = re + 1 & z, pe = 0, !0);
256
259
  }
257
- function Se() {
258
- ie = !1;
260
+ function ve() {
261
+ oe = !1;
259
262
  }
260
263
  function Qe() {
261
- return ie ? ++fe : 0;
264
+ return oe ? ++pe : 0;
262
265
  }
263
- class He {
266
+ class Ye {
264
267
  constructor() {
265
- this.queueA = [], this.queueB = [], this.queue = this.queueA, this.queueSize = 0, this._epoch = 0, this.isProcessing = !1, this.isBatching = !1, this.batchDepth = 0, this.batchQueue = [], this.batchQueueSize = 0, this.isFlushingSync = !1, this.maxFlushIterations = L.MAX_FLUSH_ITERATIONS;
268
+ this.queueA = [], this.queueB = [], this.queue = this.queueA, this.queueSize = 0, this._epoch = 0, this.isProcessing = !1, this.isBatching = !1, this.batchDepth = 0, this.batchQueue = [], this.batchQueueSize = 0, this.isFlushingSync = !1, this.maxFlushIterations = B.MAX_FLUSH_ITERATIONS;
266
269
  }
267
270
  get phase() {
268
271
  return this.isProcessing || this.isFlushingSync ? 2 : this.isBatching ? 1 : 0;
@@ -275,15 +278,15 @@ class He {
275
278
  */
276
279
  schedule(e) {
277
280
  if (typeof e != "function")
278
- throw new ee("Scheduler callback must be a function");
281
+ throw new se("Scheduler callback must be a function");
279
282
  e._nextEpoch !== this._epoch && (e._nextEpoch = this._epoch, this.isBatching || this.isFlushingSync ? this.batchQueue[this.batchQueueSize++] = e : (this.queue[this.queueSize++] = e, this.isProcessing || this.flush()));
280
283
  }
281
284
  flush() {
282
285
  this.isProcessing || this.queueSize === 0 || (this.isProcessing = !0, queueMicrotask(() => {
283
286
  try {
284
287
  if (this.queueSize === 0) return;
285
- const e = ye();
286
- this._drainQueue(), e && Se();
288
+ const e = Ce();
289
+ this._drainQueue(), e && ve();
287
290
  } finally {
288
291
  this.isProcessing = !1, this.queueSize > 0 && !this.isBatching && this.flush();
289
292
  }
@@ -291,11 +294,11 @@ class He {
291
294
  }
292
295
  flushSync() {
293
296
  this.isFlushingSync = !0;
294
- const e = ye();
297
+ const e = Ce();
295
298
  try {
296
299
  this._mergeBatchQueue(), this._drainQueue();
297
300
  } finally {
298
- this.isFlushingSync = !1, e && Se();
301
+ this.isFlushingSync = !1, e && ve();
299
302
  }
300
303
  }
301
304
  _mergeBatchQueue() {
@@ -323,7 +326,7 @@ class He {
323
326
  }
324
327
  _handleFlushOverflow() {
325
328
  console.error(
326
- new ee(
329
+ new se(
327
330
  `Maximum flush iterations (${this.maxFlushIterations}) exceeded. Possible infinite loop.`
328
331
  )
329
332
  ), this.queueSize = 0, this.queue.length = 0, this.batchQueueSize = 0;
@@ -334,7 +337,7 @@ class He {
334
337
  e[n]?.();
335
338
  } catch (i) {
336
339
  console.error(
337
- new ee("Error occurred during scheduler execution", i)
340
+ new se("Error occurred during scheduler execution", i)
338
341
  );
339
342
  }
340
343
  e.length = 0;
@@ -355,51 +358,64 @@ class He {
355
358
  * @param max - Maximum iterations count.
356
359
  */
357
360
  setMaxFlushIterations(e) {
358
- if (e < L.MIN_FLUSH_ITERATIONS)
359
- throw new ee(
360
- `Max flush iterations must be at least ${L.MIN_FLUSH_ITERATIONS}`
361
+ if (e < B.MIN_FLUSH_ITERATIONS)
362
+ throw new se(
363
+ `Max flush iterations must be at least ${B.MIN_FLUSH_ITERATIONS}`
361
364
  );
362
365
  this.maxFlushIterations = e;
363
366
  }
364
367
  }
365
- const Y = new He();
366
- function z(t) {
368
+ const Z = new Ye();
369
+ function Je(t) {
367
370
  if (typeof t != "function")
368
- throw new k("Batch callback must be a function");
369
- Y.startBatch();
371
+ throw new w("Batch callback must be a function");
372
+ Z.startBatch();
370
373
  try {
371
374
  return t();
372
375
  } finally {
373
- Y.endBatch();
376
+ Z.endBatch();
374
377
  }
375
378
  }
376
- const q = {
377
- current: null,
378
- run(t, e) {
379
- const s = this.current;
380
- this.current = t;
379
+ class Ke {
380
+ constructor() {
381
+ this.current = null;
382
+ }
383
+ /**
384
+ * Runs the provided function within the context of the given listener.
385
+ * Restores the previous context after the function completes or throws.
386
+ *
387
+ * @param listener - The tracking listener to associate with the current execution.
388
+ * @param fn - The function to execute.
389
+ */
390
+ run(e, s) {
391
+ const n = this.current;
392
+ this.current = e;
381
393
  try {
382
- return e();
394
+ return s();
383
395
  } finally {
384
- this.current = s;
396
+ this.current = n;
385
397
  }
386
- },
398
+ }
399
+ /**
400
+ * Retrieves the listener currently associated with the tracking context.
401
+ */
387
402
  getCurrent() {
388
403
  return this.current;
389
404
  }
390
- };
391
- function Te(t) {
405
+ }
406
+ const X = new Ke();
407
+ function Ue(t) {
392
408
  if (typeof t != "function")
393
- throw new k("Untracked callback must be a function");
394
- const e = q.current;
395
- q.current = null;
409
+ throw new w("Untracked callback must be a function");
410
+ const e = X.current;
411
+ X.current = null;
396
412
  try {
397
413
  return t();
398
414
  } finally {
399
- q.current = e;
415
+ X.current = e;
400
416
  }
401
417
  }
402
- class re {
418
+ class ce {
403
419
  constructor() {
404
420
  this.subscribers = null;
405
421
  }
@@ -455,9 +471,9 @@ class re {
455
471
  return this.subscribers ? [...this.subscribers] : [];
456
472
  }
457
473
  }
458
- class de {
474
+ class be {
459
475
  constructor() {
460
- this.pool = [], this.maxPoolSize = 50, this.maxReusableCapacity = 256, this.stats = T ? {
476
+ this.pool = [], this.maxPoolSize = 50, this.maxReusableCapacity = 256, this.stats = v ? {
461
477
  acquired: 0,
462
478
  released: 0,
463
479
  rejected: { frozen: 0, tooLarge: 0, poolFull: 0 }
@@ -465,7 +481,7 @@ class de {
465
481
  }
466
482
  /** Acquires an array from the pool or creates a new one if the pool is empty. */
467
483
  acquire() {
468
- return T && this.stats && this.stats.acquired++, this.pool.pop() ?? [];
484
+ return v && this.stats && this.stats.acquired++, this.pool.pop() ?? [];
469
485
  }
470
486
  /**
471
487
  * Releases an array back to the pool.
@@ -476,23 +492,23 @@ class de {
476
492
  release(e, s) {
477
493
  if (!(s && e === s)) {
478
494
  if (Object.isFrozen(e)) {
479
- T && this.stats && this.stats.rejected.frozen++;
495
+ v && this.stats && this.stats.rejected.frozen++;
480
496
  return;
481
497
  }
482
498
  if (e.length > this.maxReusableCapacity) {
483
- T && this.stats && this.stats.rejected.tooLarge++;
499
+ v && this.stats && this.stats.rejected.tooLarge++;
484
500
  return;
485
501
  }
486
502
  if (this.pool.length >= this.maxPoolSize) {
487
- T && this.stats && this.stats.rejected.poolFull++;
503
+ v && this.stats && this.stats.rejected.poolFull++;
488
504
  return;
489
505
  }
490
- e.length = 0, this.pool.push(e), T && this.stats && this.stats.released++;
506
+ e.length = 0, this.pool.push(e), v && this.stats && this.stats.released++;
491
507
  }
492
508
  }
493
509
  /** Returns current stats for the pool (dev mode only). */
494
510
  getStats() {
495
- if (!T || !this.stats) return null;
511
+ if (!v || !this.stats) return null;
496
512
  const { acquired: e, released: s, rejected: n } = this.stats, i = n.frozen + n.tooLarge + n.poolFull;
497
513
  return {
498
514
  acquired: e,
@@ -504,142 +520,145 @@ class de {
504
520
  }
505
521
  /** Resets the pool and its stats. */
506
522
  reset() {
507
- this.pool.length = 0, T && this.stats && (this.stats.acquired = 0, this.stats.released = 0, this.stats.rejected = { frozen: 0, tooLarge: 0, poolFull: 0 });
523
+ this.pool.length = 0, v && this.stats && (this.stats.acquired = 0, this.stats.released = 0, this.stats.rejected = { frozen: 0, tooLarge: 0, poolFull: 0 });
508
524
  }
509
525
  }
510
- const S = Object.freeze([]), O = Object.freeze([]), D = Object.freeze([]), M = new de(), j = new de(), A = new de();
511
- function le(t) {
526
+ const S = Object.freeze([]), T = Object.freeze([]), y = Object.freeze([]), F = new be(), q = new be(), x = new be();
527
+ function _e(t) {
512
528
  return t !== null && typeof t == "object" && "value" in t && "subscribe" in t && typeof t.subscribe == "function";
513
529
  }
514
- function De(t) {
515
- if (w.enabled && (t == null || typeof t == "object")) {
516
- const e = w.getDebugType(t);
530
+ function Ne(t) {
531
+ if (R.enabled && (t == null || typeof t == "object")) {
532
+ const e = R.getDebugType(t);
517
533
  if (e)
518
534
  return e === "computed";
519
535
  }
520
- return le(t) && "invalidate" in t && typeof t.invalidate == "function";
536
+ return _e(t) && "invalidate" in t && typeof t.invalidate == "function";
521
537
  }
522
- function Re(t) {
538
+ function we(t) {
523
539
  return t != null && typeof t.then == "function";
524
540
  }
525
- function Je(t) {
541
+ function We(t) {
526
542
  return typeof t == "object" && t !== null;
527
543
  }
528
- function Ye(t) {
544
+ function Ze(t) {
529
545
  return (typeof t == "object" || typeof t == "function") && t !== null && typeof t.addDependency == "function";
530
546
  }
531
- function Ke(t) {
547
+ function et(t) {
532
548
  return typeof t == "function" && typeof t.addDependency != "function";
533
549
  }
534
- function We(t) {
535
- return Je(t) && typeof t.execute == "function";
550
+ function tt(t) {
551
+ return We(t) && typeof t.execute == "function";
536
552
  }
537
- function Ue(t, e, s, n) {
553
+ function ke(t, e, s, n) {
538
554
  if (e) {
539
- if (Ye(e)) {
555
+ if (Ze(e)) {
540
556
  e.addDependency(t);
541
557
  return;
542
558
  }
543
- if (Ke(e)) {
559
+ if (et(e)) {
544
560
  s.add(e);
545
561
  return;
546
562
  }
547
- We(e) && n.add(e);
563
+ tt(e) && n.add(e);
548
564
  }
549
565
  }
550
- function Ze(t, e, s, n) {
551
- if (e !== S && s !== O)
566
+ function st(t, e, s, n) {
567
+ if (e !== S && s !== T)
552
568
  for (let r = 0; r < e.length; r++) {
553
569
  const o = e[r];
554
570
  o && (o._tempUnsub = s[r]);
555
571
  }
556
- const i = j.acquire();
572
+ const i = q.acquire();
557
573
  i.length = t.length;
558
574
  for (let r = 0; r < t.length; r++) {
559
575
  const o = t[r];
560
- o && (o._tempUnsub ? (i[r] = o._tempUnsub, o._tempUnsub = void 0) : (w.checkCircular(o, n), i[r] = o.subscribe(n)));
576
+ o && (o._tempUnsub ? (i[r] = o._tempUnsub, o._tempUnsub = void 0) : (R.checkCircular(o, n), i[r] = o.subscribe(n)));
561
577
  }
562
578
  if (e !== S)
563
579
  for (let r = 0; r < e.length; r++) {
564
580
  const o = e[r];
565
581
  o?._tempUnsub && (o._tempUnsub(), o._tempUnsub = void 0);
566
582
  }
567
- return s !== O && j.release(s), i;
583
+ return s !== T && q.release(s), i;
568
584
  }
569
- class et extends Ne {
585
+ class nt extends Ae {
570
586
  constructor(e, s) {
571
- super(), this._isNotificationScheduled = !1, this._value = e, this._functionSubscribersStore = new re(), this._objectSubscribersStore = new re(), this._sync = s, this._notifyTask = this._flushNotifications.bind(this), w.attachDebugInfo(this, "atom", this.id);
587
+ super(), this._functionSubscribersStore = null, this._objectSubscribersStore = null, this._value = e, s && (this.flags |= Y.SYNC), R.attachDebugInfo(this, "atom", this.id);
572
588
  }
573
- /** Gets the manager for function-based subscribers. */
574
589
  get _functionSubscribers() {
575
- return this._functionSubscribersStore;
590
+ return this._functionSubscribersStore || (this._functionSubscribersStore = new ce()), this._functionSubscribersStore;
576
591
  }
577
- /** Gets the manager for object-based subscribers. */
578
592
  get _objectSubscribers() {
579
- return this._objectSubscribersStore;
593
+ return this._objectSubscribersStore || (this._objectSubscribersStore = new ce()), this._objectSubscribersStore;
580
594
  }
581
595
  /**
582
- * Returns the current value and registers the atom as a dependency in the current tracking context.
596
+ * Returns the current value and registers the atom as a dependency if in a tracking context.
583
597
  */
584
598
  get value() {
585
- const e = q.getCurrent();
586
- return e && this._track(e), this._value;
599
+ const e = X.current;
600
+ return e && ke(this, e, this._functionSubscribers, this._objectSubscribers), this._value;
587
601
  }
588
602
  /**
589
603
  * Sets a new value and schedules notifications if the value has changed.
590
- * Uses `Object.is` for comparison.
591
604
  */
592
605
  set value(e) {
593
606
  if (Object.is(this._value, e)) return;
594
607
  const s = this._value;
595
- this.version = this.version + 1 & B, this._value = e, !(!this._functionSubscribersStore.hasSubscribers && !this._objectSubscribersStore.hasSubscribers) && this._scheduleNotification(s);
596
- }
597
- _track(e) {
598
- Ue(this, e, this._functionSubscribersStore, this._objectSubscribersStore);
608
+ this._value = e, this.version = this.version + 1 & z;
609
+ const n = this._functionSubscribersStore?.hasSubscribers, i = this._objectSubscribersStore?.hasSubscribers;
610
+ (n || i) && this._scheduleNotification(s);
599
611
  }
612
+ /**
613
+ * Schedules or flushes notifications based on sync mode and batching state.
614
+ */
600
615
  _scheduleNotification(e) {
601
- this._isNotificationScheduled || (this._pendingOldValue = e, this._isNotificationScheduled = !0), this._sync && !Y.isBatching ? this._flushNotifications() : Y.schedule(this._notifyTask);
616
+ if (this.flags & Y.NOTIFICATION_SCHEDULED || (this._pendingOldValue = e, this.flags |= Y.NOTIFICATION_SCHEDULED), this.flags & Y.SYNC && !Z.isBatching) {
617
+ this._flushNotifications();
618
+ return;
619
+ }
620
+ this._notifyTask || (this._notifyTask = () => this._flushNotifications()), Z.schedule(this._notifyTask);
602
621
  }
603
622
  _flushNotifications() {
604
- if (!this._isNotificationScheduled) return;
623
+ if (!(this.flags & Y.NOTIFICATION_SCHEDULED)) return;
605
624
  const e = this._pendingOldValue, s = this._value;
606
- this._pendingOldValue = void 0, this._isNotificationScheduled = !1, this._notifySubscribers(s, e);
625
+ this._pendingOldValue = void 0, this.flags &= -3, this._notifySubscribers(s, e);
607
626
  }
608
627
  /**
609
- * Returns the current value without registering as a dependency in the tracking context.
628
+ * Overridden to avoid unnecessary manager creation during notification loop.
610
629
  */
630
+ _notifySubscribers(e, s) {
631
+ this._functionSubscribersStore && this._functionSubscribersStore.forEachSafe((n) => n(e, s)), this._objectSubscribersStore && this._objectSubscribersStore.forEachSafe((n) => n.execute());
632
+ }
611
633
  peek() {
612
634
  return this._value;
613
635
  }
614
- /**
615
- * Disposes of the atom, clearing all subscribers and resetting the value.
616
- */
617
636
  dispose() {
618
- this._functionSubscribersStore.clear(), this._objectSubscribersStore.clear(), this._value = void 0;
637
+ this._functionSubscribersStore?.clear(), this._objectSubscribersStore?.clear(), this._value = void 0, this._notifyTask = void 0;
619
638
  }
620
639
  }
621
- function tt(t, e = {}) {
622
- return new et(t, e.sync ?? !1);
640
+ function it(t, e = {}) {
641
+ return new nt(t, e.sync ?? !1);
623
642
  }
624
- function H(t, e, s) {
643
+ function K(t, e, s) {
625
644
  if (t instanceof TypeError)
626
645
  return new e(`Type error (${s}): ${t.message}`, t);
627
646
  if (t instanceof ReferenceError)
628
647
  return new e(`Reference error (${s}): ${t.message}`, t);
629
- if (t instanceof k)
648
+ if (t instanceof w)
630
649
  return t;
631
650
  const n = t instanceof Error ? t.message : String(t), i = t instanceof Error ? t : null;
632
651
  return new e(`Unexpected error (${s}): ${n}`, i);
633
652
  }
634
- const Oe = d.RESOLVED | d.PENDING | d.REJECTED, ce = Array(Oe + 1).fill(oe.IDLE);
635
- ce[d.RESOLVED] = oe.RESOLVED;
636
- ce[d.PENDING] = oe.PENDING;
637
- ce[d.REJECTED] = oe.REJECTED;
638
- class Ae extends Ne {
653
+ const Fe = d.RESOLVED | d.PENDING | d.REJECTED, he = Array(Fe + 1).fill(ue.IDLE);
654
+ he[d.RESOLVED] = ue.RESOLVED;
655
+ he[d.PENDING] = ue.PENDING;
656
+ he[d.REJECTED] = ue.REJECTED;
657
+ class Me extends Ae {
639
658
  constructor(e, s = {}) {
640
659
  if (typeof e != "function")
641
- throw new X(y.COMPUTED_MUST_BE_FUNCTION);
642
- if (super(), this._cachedErrors = null, this._errorCacheEpoch = -1, this._value = void 0, this.flags = d.DIRTY | d.IDLE, this._error = null, this._promiseId = 0, this._equal = s.equal ?? Object.is, this._fn = e, this._defaultValue = "defaultValue" in s ? s.defaultValue : ge, this._hasDefaultValue = this._defaultValue !== ge, this._onError = s.onError ?? null, this.MAX_PROMISE_ID = Number.MAX_SAFE_INTEGER - 1, this._functionSubscribersStore = new re(), this._objectSubscribersStore = new re(), this._dependencies = S, this._dependencyVersions = D, this._unsubscribes = O, this._notifyJob = () => {
660
+ throw new Q(g.COMPUTED_MUST_BE_FUNCTION);
661
+ if (super(), this._cachedErrors = null, this._errorCacheEpoch = -1, this._value = void 0, this.flags = d.DIRTY | d.IDLE, this._error = null, this._promiseId = 0, this._equal = s.equal ?? Object.is, this._fn = e, this._defaultValue = "defaultValue" in s ? s.defaultValue : De, this._hasDefaultValue = this._defaultValue !== De, this._onError = s.onError ?? null, this.MAX_PROMISE_ID = Number.MAX_SAFE_INTEGER - 1, this._functionSubscribersStore = new ce(), this._objectSubscribersStore = new ce(), this._dependencies = S, this._dependencyVersions = y, this._unsubscribes = T, this._notifyJob = () => {
643
662
  this._functionSubscribersStore.forEachSafe(
644
663
  (n) => n(),
645
664
  (n) => console.error(n)
@@ -650,7 +669,7 @@ class Ae extends Ne {
650
669
  }, this._trackable = Object.assign(() => this._markDirty(), {
651
670
  addDependency: (n) => {
652
671
  }
653
- }), w.attachDebugInfo(this, "computed", this.id), w.enabled) {
672
+ }), R.attachDebugInfo(this, "computed", this.id), R.enabled) {
654
673
  const n = this;
655
674
  n.subscriberCount = () => this._functionSubscribersStore.size + this._objectSubscribersStore.size, n.isDirty = () => this._isDirty(), n.dependencies = this._dependencies, n.stateFlags = this._getFlagsAsString();
656
675
  }
@@ -690,8 +709,8 @@ class Ae extends Ne {
690
709
  }
691
710
  get errors() {
692
711
  if (this._registerTracking(), !this.hasError)
693
- return je;
694
- const e = Ge();
712
+ return Be;
713
+ const e = He();
695
714
  if (this._errorCacheEpoch === e && this._cachedErrors !== null)
696
715
  return this._cachedErrors;
697
716
  const s = /* @__PURE__ */ new Set();
@@ -718,17 +737,17 @@ class Ae extends Ne {
718
737
  return this._registerTracking(), this._isResolved();
719
738
  }
720
739
  invalidate() {
721
- this._markDirty(), this._dependencyVersions !== D && (A.release(this._dependencyVersions), this._dependencyVersions = D), this._errorCacheEpoch = -1, this._cachedErrors = null;
740
+ this._markDirty(), this._dependencyVersions !== y && (x.release(this._dependencyVersions), this._dependencyVersions = y), this._errorCacheEpoch = -1, this._cachedErrors = null;
722
741
  }
723
742
  dispose() {
724
- if (this._unsubscribes !== O) {
743
+ if (this._unsubscribes !== T) {
725
744
  for (let e = 0; e < this._unsubscribes.length; e++) {
726
745
  const s = this._unsubscribes[e];
727
746
  s && s();
728
747
  }
729
- j.release(this._unsubscribes), this._unsubscribes = O;
748
+ q.release(this._unsubscribes), this._unsubscribes = T;
730
749
  }
731
- this._dependencies !== S && (M.release(this._dependencies), this._dependencies = S), this._dependencyVersions !== D && (A.release(this._dependencyVersions), this._dependencyVersions = D), this._functionSubscribersStore.clear(), this._objectSubscribersStore.clear(), this.flags = d.DIRTY | d.IDLE, this._error = null, this._value = void 0, this._promiseId = (this._promiseId + 1) % this.MAX_PROMISE_ID, this._cachedErrors = null, this._errorCacheEpoch = -1;
750
+ this._dependencies !== S && (F.release(this._dependencies), this._dependencies = S), this._dependencyVersions !== y && (x.release(this._dependencyVersions), this._dependencyVersions = y), this._functionSubscribersStore.clear(), this._objectSubscribersStore.clear(), this.flags = d.DIRTY | d.IDLE, this._error = null, this._value = void 0, this._promiseId = (this._promiseId + 1) % this.MAX_PROMISE_ID, this._cachedErrors = null, this._errorCacheEpoch = -1;
732
751
  }
733
752
  // State flag operations
734
753
  _isDirty() {
@@ -772,7 +791,7 @@ class Ae extends Ne {
772
791
  this.flags = this.flags & ~s | -Number(e) & s;
773
792
  }
774
793
  _getAsyncState() {
775
- return ce[this.flags & Oe];
794
+ return he[this.flags & Fe];
776
795
  }
777
796
  _getFlagsAsString() {
778
797
  const e = [];
@@ -787,8 +806,8 @@ class Ae extends Ne {
787
806
  const e = this._prepareComputationContext();
788
807
  let s = !1;
789
808
  try {
790
- const n = q.run(this._trackable, this._fn);
791
- this._commitDependencies(e), s = !0, Re(n) ? this._handleAsyncComputation(n) : this._handleSyncResult(n);
809
+ const n = X.run(this._trackable, this._fn);
810
+ this._commitDependencies(e), s = !0, we(n) ? this._handleAsyncComputation(n) : this._handleSyncResult(n);
792
811
  } catch (n) {
793
812
  if (!s)
794
813
  try {
@@ -802,21 +821,21 @@ class Ae extends Ne {
802
821
  }
803
822
  }
804
823
  _prepareComputationContext() {
805
- const e = this._dependencies, s = this._dependencyVersions, n = M.acquire(), i = A.acquire(), r = xe(), o = { depCount: 0 }, c = (_) => {
824
+ const e = this._dependencies, s = this._dependencyVersions, n = F.acquire(), i = x.acquire(), r = Oe(), o = { depCount: 0 }, c = (_) => {
806
825
  _._lastSeenEpoch !== r && (_._lastSeenEpoch = r, o.depCount < n.length ? (n[o.depCount] = _, i[o.depCount] = _.version) : (n.push(_), i.push(_.version)), o.depCount++);
807
- }, f = this._trackable.addDependency;
808
- return this._trackable.addDependency = c, { prevDeps: e, prevVersions: s, nextDeps: n, nextVersions: i, originalAdd: f, state: o };
826
+ }, h = this._trackable.addDependency;
827
+ return this._trackable.addDependency = c, { prevDeps: e, prevVersions: s, nextDeps: n, nextVersions: i, originalAdd: h, state: o };
809
828
  }
810
829
  _commitDependencies(e) {
811
830
  const { nextDeps: s, nextVersions: n, state: i, prevDeps: r } = e;
812
- s.length = i.depCount, n.length = i.depCount, this._unsubscribes = Ze(s, r, this._unsubscribes, this), this._dependencies = s, this._dependencyVersions = n;
831
+ s.length = i.depCount, n.length = i.depCount, this._unsubscribes = st(s, r, this._unsubscribes, this), this._dependencies = s, this._dependencyVersions = n;
813
832
  }
814
833
  _cleanupContext(e, s) {
815
- this._trackable.addDependency = e.originalAdd, s ? (e.prevDeps !== S && M.release(e.prevDeps), e.prevVersions !== D && A.release(e.prevVersions)) : (M.release(e.nextDeps), A.release(e.nextVersions));
834
+ this._trackable.addDependency = e.originalAdd, s ? (e.prevDeps !== S && F.release(e.prevDeps), e.prevVersions !== y && x.release(e.prevVersions)) : (F.release(e.nextDeps), x.release(e.nextVersions));
816
835
  }
817
836
  _handleSyncResult(e) {
818
837
  const s = !this._isResolved() || !this._equal(this._value, e);
819
- this.version = this.version + Number(s) & B, this._value = e, this._clearDirty(), this._setResolved(), this._error = null, this._setRecomputing(!1), this._cachedErrors = null, this._errorCacheEpoch = -1;
838
+ this.version = this.version + Number(s) & z, this._value = e, this._clearDirty(), this._setResolved(), this._error = null, this._setRecomputing(!1), this._cachedErrors = null, this._errorCacheEpoch = -1;
820
839
  }
821
840
  _handleAsyncComputation(e) {
822
841
  this._setPending(), this._clearDirty(), this._notifyJob(), this._promiseId = this._promiseId >= this.MAX_PROMISE_ID ? 1 : this._promiseId + 1;
@@ -829,32 +848,32 @@ class Ae extends Ne {
829
848
  }
830
849
  _handleAsyncResolution(e) {
831
850
  const s = !this._isResolved() || !this._equal(this._value, e);
832
- this.version = this.version + Number(s) & B, this._value = e, this._clearDirty(), this._setResolved(), this._error = null, this._setRecomputing(!1), this._cachedErrors = null, this._errorCacheEpoch = -1, this._notifyJob();
851
+ this.version = this.version + Number(s) & z, this._value = e, this._clearDirty(), this._setResolved(), this._error = null, this._setRecomputing(!1), this._cachedErrors = null, this._errorCacheEpoch = -1, this._notifyJob();
833
852
  }
834
853
  _handleAsyncRejection(e) {
835
- const s = H(e, X, y.COMPUTED_ASYNC_COMPUTATION_FAILED), n = !this._isRejected();
836
- if (this.version = this.version + Number(n) & B, this._error = s, this._setRejected(), this._clearDirty(), this._setRecomputing(!1), this._onError)
854
+ const s = K(e, Q, g.COMPUTED_ASYNC_COMPUTATION_FAILED), n = !this._isRejected();
855
+ if (this.version = this.version + Number(n) & z, this._error = s, this._setRejected(), this._clearDirty(), this._setRecomputing(!1), this._onError)
837
856
  try {
838
857
  this._onError(s);
839
858
  } catch (i) {
840
- console.error(y.CALLBACK_ERROR_IN_ERROR_HANDLER, i);
859
+ console.error(g.CALLBACK_ERROR_IN_ERROR_HANDLER, i);
841
860
  }
842
861
  this._notifyJob();
843
862
  }
844
863
  _handleComputationError(e) {
845
- const s = H(e, X, y.COMPUTED_COMPUTATION_FAILED);
864
+ const s = K(e, Q, g.COMPUTED_COMPUTATION_FAILED);
846
865
  if (this._error = s, this._setRejected(), this._clearDirty(), this._setRecomputing(!1), this._onError)
847
866
  try {
848
867
  this._onError(s);
849
868
  } catch (n) {
850
- console.error(y.CALLBACK_ERROR_IN_ERROR_HANDLER, n);
869
+ console.error(g.CALLBACK_ERROR_IN_ERROR_HANDLER, n);
851
870
  }
852
871
  throw s;
853
872
  }
854
873
  _handlePending() {
855
874
  if (this._hasDefaultValue)
856
875
  return this._defaultValue;
857
- throw new X(y.COMPUTED_ASYNC_PENDING_NO_DEFAULT);
876
+ throw new Q(g.COMPUTED_ASYNC_PENDING_NO_DEFAULT);
858
877
  }
859
878
  _handleRejected() {
860
879
  if (this._error?.recoverable && this._hasDefaultValue)
@@ -869,19 +888,19 @@ class Ae extends Ne {
869
888
  this._isRecomputing() || this._isDirty() || (this._setDirty(), this._notifyJob());
870
889
  }
871
890
  _registerTracking() {
872
- Ue(
891
+ ke(
873
892
  this,
874
- q.getCurrent(),
893
+ X.getCurrent(),
875
894
  this._functionSubscribersStore,
876
895
  this._objectSubscribersStore
877
896
  );
878
897
  }
879
898
  }
880
- Object.freeze(Ae.prototype);
881
- function st(t, e = {}) {
882
- return new Ae(t, e);
899
+ Object.freeze(Me.prototype);
900
+ function rt(t, e = {}) {
901
+ return new Me(t, e);
883
902
  }
884
- class nt extends ve {
903
+ class ot extends Re {
885
904
  /**
886
905
  * Creates a new EffectImpl instance.
887
906
  * @param fn - The effect function to run.
@@ -890,18 +909,18 @@ class nt extends ve {
890
909
  constructor(e, s = {}) {
891
910
  super(), this.run = () => {
892
911
  if (this.isDisposed)
893
- throw new V(y.EFFECT_MUST_BE_FUNCTION);
894
- this._dependencyVersions !== D && (A.release(this._dependencyVersions), this._dependencyVersions = D), this.execute();
912
+ throw new V(g.EFFECT_MUST_BE_FUNCTION);
913
+ this._dependencyVersions !== y && (x.release(this._dependencyVersions), this._dependencyVersions = y), this.execute();
895
914
  }, this.dispose = () => {
896
915
  if (!this.isDisposed) {
897
- if (this._setDisposed(), this._safeCleanup(), this._unsubscribes !== O) {
916
+ if (this._setDisposed(), this._safeCleanup(), this._unsubscribes !== T) {
898
917
  for (let i = 0; i < this._unsubscribes.length; i++) {
899
918
  const r = this._unsubscribes[i];
900
919
  r && r();
901
920
  }
902
- j.release(this._unsubscribes), this._unsubscribes = O;
921
+ q.release(this._unsubscribes), this._unsubscribes = T;
903
922
  }
904
- this._dependencies !== S && (M.release(this._dependencies), this._dependencies = S), this._dependencyVersions !== D && (A.release(this._dependencyVersions), this._dependencyVersions = D);
923
+ this._dependencies !== S && (F.release(this._dependencies), this._dependencies = S), this._dependencyVersions !== y && (x.release(this._dependencyVersions), this._dependencyVersions = y);
905
924
  }
906
925
  }, this.addDependency = (i) => {
907
926
  if (this.isExecuting && this._nextDeps && this._nextUnsubs && this._nextVersions) {
@@ -915,8 +934,8 @@ class nt extends ve {
915
934
  const i = this._prepareEffectContext();
916
935
  let r = !1;
917
936
  try {
918
- const o = q.run(this, this._fn);
919
- this._commitEffect(i), r = !0, this._checkLoopWarnings(), Re(o) ? o.then((c) => {
937
+ const o = X.run(this, this._fn);
938
+ this._commitEffect(i), r = !0, this._checkLoopWarnings(), we(o) ? o.then((c) => {
920
939
  !this.isDisposed && typeof c == "function" && (this._cleanup = c);
921
940
  }).catch((c) => {
922
941
  this._handleExecutionError(c);
@@ -926,20 +945,20 @@ class nt extends ve {
926
945
  } finally {
927
946
  this._cleanupEffect(i, r), this._setExecuting(!1);
928
947
  }
929
- }, this._currentEpoch = -1, this._lastFlushEpoch = -1, this._executionsInEpoch = 0, this._fn = e, this._sync = s.sync ?? !1, this._maxExecutions = s.maxExecutionsPerSecond ?? L.MAX_EXECUTIONS_PER_SECOND, this._maxExecutionsPerFlush = s.maxExecutionsPerFlush ?? L.MAX_EXECUTIONS_PER_EFFECT, this._trackModifications = s.trackModifications ?? !1, this._cleanup = null, this._dependencies = S, this._dependencyVersions = D, this._unsubscribes = O, this._nextDeps = null, this._nextVersions = null, this._nextUnsubs = null, this._onError = s.onError ?? null, this._historyPtr = 0;
948
+ }, this._currentEpoch = -1, this._lastFlushEpoch = -1, this._executionsInEpoch = 0, this._fn = e, this._sync = s.sync ?? !1, this._maxExecutions = s.maxExecutionsPerSecond ?? B.MAX_EXECUTIONS_PER_SECOND, this._maxExecutionsPerFlush = s.maxExecutionsPerFlush ?? B.MAX_EXECUTIONS_PER_EFFECT, this._trackModifications = s.trackModifications ?? !1, this._cleanup = null, this._dependencies = S, this._dependencyVersions = y, this._unsubscribes = T, this._nextDeps = null, this._nextVersions = null, this._nextUnsubs = null, this._onError = s.onError ?? null, this._historyPtr = 0;
930
949
  const n = Number.isFinite(this._maxExecutions);
931
- this._historyCapacity = n ? Math.min(this._maxExecutions + 1, L.MAX_EXECUTIONS_PER_SECOND + 1) : 0, this._history = T && n && this._historyCapacity > 0 ? new Array(this._historyCapacity).fill(0) : null, this._executionCount = 0, w.attachDebugInfo(this, "effect", this.id);
950
+ this._historyCapacity = n ? Math.min(this._maxExecutions + 1, B.MAX_EXECUTIONS_PER_SECOND + 1) : 0, this._history = v && n && this._historyCapacity > 0 ? new Array(this._historyCapacity).fill(0) : null, this._executionCount = 0, R.attachDebugInfo(this, "effect", this.id);
932
951
  }
933
952
  /**
934
953
  * Prepares the execution context by acquiring pools and setting up epoch.
935
954
  * @returns The prepared EffectContext.
936
955
  */
937
956
  _prepareEffectContext() {
938
- const e = this._dependencies, s = this._dependencyVersions, n = this._unsubscribes, i = M.acquire(), r = A.acquire(), o = j.acquire(), c = xe();
939
- if (e !== S && n !== O)
940
- for (let f = 0; f < e.length; f++) {
941
- const _ = e[f];
942
- _ && (_._tempUnsub = n[f]);
957
+ const e = this._dependencies, s = this._dependencyVersions, n = this._unsubscribes, i = F.acquire(), r = x.acquire(), o = q.acquire(), c = Oe();
958
+ if (e !== S && n !== T)
959
+ for (let h = 0; h < e.length; h++) {
960
+ const _ = e[h];
961
+ _ && (_._tempUnsub = n[h]);
943
962
  }
944
963
  return this._nextDeps = i, this._nextVersions = r, this._nextUnsubs = o, this._currentEpoch = c, { prevDeps: e, prevVersions: s, prevUnsubs: n, nextDeps: i, nextVersions: r, nextUnsubs: o };
945
964
  }
@@ -963,14 +982,14 @@ class nt extends ve {
963
982
  const i = e.prevDeps[n];
964
983
  i?._tempUnsub && (i._tempUnsub(), i._tempUnsub = void 0);
965
984
  }
966
- M.release(e.prevDeps);
985
+ F.release(e.prevDeps);
967
986
  }
968
- e.prevUnsubs !== O && j.release(e.prevUnsubs), e.prevVersions !== D && A.release(e.prevVersions);
987
+ e.prevUnsubs !== T && q.release(e.prevUnsubs), e.prevVersions !== y && x.release(e.prevVersions);
969
988
  } else {
970
- M.release(e.nextDeps), A.release(e.nextVersions);
989
+ F.release(e.nextDeps), x.release(e.nextVersions);
971
990
  for (let n = 0; n < e.nextUnsubs.length; n++)
972
991
  e.nextUnsubs[n]?.();
973
- if (j.release(e.nextUnsubs), e.prevDeps !== S)
992
+ if (q.release(e.nextUnsubs), e.prevDeps !== S)
974
993
  for (let n = 0; n < e.prevDeps.length; n++) {
975
994
  const i = e.prevDeps[n];
976
995
  i && (i._tempUnsub = void 0);
@@ -984,11 +1003,11 @@ class nt extends ve {
984
1003
  _subscribeTo(e) {
985
1004
  try {
986
1005
  const s = e.subscribe(() => {
987
- this._trackModifications && this.isExecuting && (e._modifiedAtEpoch = this._currentEpoch), this._sync ? this.execute() : Y.schedule(this.execute);
1006
+ this._trackModifications && this.isExecuting && (e._modifiedAtEpoch = this._currentEpoch), this._sync ? this.execute() : Z.schedule(this.execute);
988
1007
  });
989
1008
  this._nextUnsubs && this._nextUnsubs.push(s);
990
1009
  } catch (s) {
991
- console.error(H(s, V, y.EFFECT_EXECUTION_FAILED)), this._nextUnsubs && this._nextUnsubs.push(() => {
1010
+ console.error(K(s, V, g.EFFECT_EXECUTION_FAILED)), this._nextUnsubs && this._nextUnsubs.push(() => {
992
1011
  });
993
1012
  }
994
1013
  }
@@ -996,7 +1015,7 @@ class nt extends ve {
996
1015
  * Whether the effect has been disposed.
997
1016
  */
998
1017
  get isDisposed() {
999
- return (this.flags & Z.DISPOSED) !== 0;
1018
+ return (this.flags & te.DISPOSED) !== 0;
1000
1019
  }
1001
1020
  /**
1002
1021
  * Total number of times this effect has executed.
@@ -1008,13 +1027,13 @@ class nt extends ve {
1008
1027
  * Whether the effect is currently executing.
1009
1028
  */
1010
1029
  get isExecuting() {
1011
- return (this.flags & Z.EXECUTING) !== 0;
1030
+ return (this.flags & te.EXECUTING) !== 0;
1012
1031
  }
1013
1032
  _setDisposed() {
1014
- this.flags |= Z.DISPOSED;
1033
+ this.flags |= te.DISPOSED;
1015
1034
  }
1016
1035
  _setExecuting(e) {
1017
- const s = Z.EXECUTING;
1036
+ const s = te.EXECUTING;
1018
1037
  this.flags = this.flags & ~s | -Number(e) & s;
1019
1038
  }
1020
1039
  /**
@@ -1025,7 +1044,7 @@ class nt extends ve {
1025
1044
  try {
1026
1045
  this._cleanup();
1027
1046
  } catch (e) {
1028
- console.error(H(e, V, y.EFFECT_CLEANUP_FAILED));
1047
+ console.error(K(e, V, g.EFFECT_CLEANUP_FAILED));
1029
1048
  }
1030
1049
  this._cleanup = null;
1031
1050
  }
@@ -1035,22 +1054,22 @@ class nt extends ve {
1035
1054
  * @throws {EffectError} If an infinite loop is detected.
1036
1055
  */
1037
1056
  _checkInfiniteLoop() {
1038
- if (this._lastFlushEpoch !== ne && (this._lastFlushEpoch = ne, this._executionsInEpoch = 0), this._executionsInEpoch++, this._executionsInEpoch > this._maxExecutionsPerFlush && this._throwInfiniteLoopError("per-effect"), Qe() > L.MAX_EXECUTIONS_PER_FLUSH && this._throwInfiniteLoopError("global"), this._executionCount++, this._history && this._maxExecutions > 0) {
1057
+ if (this._lastFlushEpoch !== re && (this._lastFlushEpoch = re, this._executionsInEpoch = 0), this._executionsInEpoch++, this._executionsInEpoch > this._maxExecutionsPerFlush && this._throwInfiniteLoopError("per-effect"), Qe() > B.MAX_EXECUTIONS_PER_FLUSH && this._throwInfiniteLoopError("global"), this._executionCount++, this._history && this._maxExecutions > 0) {
1039
1058
  const e = Date.now(), s = this._historyPtr, n = this._historyCapacity;
1040
1059
  this._history[s] = e;
1041
1060
  const i = (s + 1) % n, r = this._history[i] ?? 0;
1042
- if (this._historyPtr = i, r > 0 && e - r < Le.ONE_SECOND_MS) {
1061
+ if (this._historyPtr = i, r > 0 && e - r < Ve.ONE_SECOND_MS) {
1043
1062
  const o = new V(
1044
1063
  `Effect executed ${n} times within 1 second. Infinite loop suspected`
1045
1064
  );
1046
- if (this.dispose(), console.error(o), this._onError && this._onError(o), T)
1065
+ if (this.dispose(), console.error(o), this._onError && this._onError(o), v)
1047
1066
  throw o;
1048
1067
  }
1049
1068
  }
1050
1069
  }
1051
1070
  _throwInfiniteLoopError(e) {
1052
1071
  const s = new V(
1053
- `Infinite loop detected (${e}): effect executed ${this._executionsInEpoch} times in current flush. Total executions in flush: ${fe}`
1072
+ `Infinite loop detected (${e}): effect executed ${this._executionsInEpoch} times in current flush. Total executions in flush: ${pe}`
1054
1073
  );
1055
1074
  throw this.dispose(), console.error(s), s;
1056
1075
  }
@@ -1059,14 +1078,14 @@ class nt extends ve {
1059
1078
  * @returns true if any dependency has changed or if it's the first run.
1060
1079
  */
1061
1080
  _shouldExecute() {
1062
- if (this._dependencies === S || this._dependencyVersions === D)
1081
+ if (this._dependencies === S || this._dependencyVersions === y)
1063
1082
  return !0;
1064
1083
  for (let e = 0; e < this._dependencies.length; e++) {
1065
1084
  const s = this._dependencies[e];
1066
1085
  if (s) {
1067
1086
  if ("value" in s)
1068
1087
  try {
1069
- Te(() => s.value);
1088
+ Ue(() => s.value);
1070
1089
  } catch {
1071
1090
  return !0;
1072
1091
  }
@@ -1081,7 +1100,7 @@ class nt extends ve {
1081
1100
  * Wraps the error, logs it to console, and calls onError callback if provided.
1082
1101
  */
1083
1102
  _handleExecutionError(e) {
1084
- const s = H(e, V, y.EFFECT_EXECUTION_FAILED);
1103
+ const s = K(e, V, g.EFFECT_EXECUTION_FAILED);
1085
1104
  console.error(s), this._onError && this._onError(s);
1086
1105
  }
1087
1106
  /**
@@ -1089,32 +1108,33 @@ class nt extends ve {
1089
1108
  * Only active if trackModifications is enabled and debug is on.
1090
1109
  */
1091
1110
  _checkLoopWarnings() {
1092
- if (this._trackModifications && w.enabled) {
1111
+ if (this._trackModifications && R.enabled) {
1093
1112
  const e = this._dependencies;
1094
1113
  for (let s = 0; s < e.length; s++) {
1095
1114
  const n = e[s];
1096
- n && n._modifiedAtEpoch === this._currentEpoch && w.warn(
1115
+ n && n._modifiedAtEpoch === this._currentEpoch && R.warn(
1097
1116
  !0,
1098
- `Effect is reading a dependency (${w.getDebugName(n) || "unknown"}) that it just modified. Infinite loop may occur`
1117
+ `Effect is reading a dependency (${R.getDebugName(n) || "unknown"}) that it just modified. Infinite loop may occur`
1099
1118
  );
1100
1119
  }
1101
1120
  }
1102
1121
  }
1103
1122
  }
1104
- function I(t, e = {}) {
1123
+ function D(t, e = {}) {
1105
1124
  if (typeof t != "function")
1106
- throw new V(y.EFFECT_MUST_BE_FUNCTION);
1107
- const s = new nt(t, e);
1125
+ throw new V(g.EFFECT_MUST_BE_FUNCTION);
1126
+ const s = new ot(t, e);
1108
1127
  return s.execute(), s;
1109
1128
  }
1110
- function b(t) {
1129
+ function p(t) {
1111
1130
  return t !== null && typeof t == "object" && "value" in t && "subscribe" in t;
1112
1131
  }
1113
- function E(t) {
1114
- return b(t) ? t.value : t;
1132
+ function k(t) {
1133
+ return p(t) ? t.value : t;
1115
1134
  }
1116
- function ue(t) {
1117
- const e = t.jquery ? t[0] : t;
1135
+ function ae(t) {
1136
+ if (!t) return "unknown";
1137
+ const e = "jquery" in t ? t[0] : t;
1118
1138
  if (!e) return "unknown";
1119
1139
  if (e.id) return `#${e.id}`;
1120
1140
  if (e.className) {
@@ -1123,7 +1143,7 @@ function ue(t) {
1123
1143
  }
1124
1144
  return e.tagName.toLowerCase();
1125
1145
  }
1126
- function it() {
1146
+ function ct() {
1127
1147
  if (typeof window < "u") {
1128
1148
  const t = window.__ATOM_DEBUG__;
1129
1149
  if (typeof t == "boolean")
@@ -1136,8 +1156,8 @@ function it() {
1136
1156
  }
1137
1157
  return !1;
1138
1158
  }
1139
- let P = it();
1140
- const h = {
1159
+ let P = ct();
1160
+ const l = {
1141
1161
  get enabled() {
1142
1162
  return P;
1143
1163
  },
@@ -1155,8 +1175,8 @@ const h = {
1155
1175
  */
1156
1176
  domUpdated(t, e, s) {
1157
1177
  if (!P) return;
1158
- const n = ue(t);
1159
- console.log(`[atom-effect-jquery] DOM updated: ${n}.${e} =`, s), rt(t);
1178
+ const n = ae(t);
1179
+ console.log(`[atom-effect-jquery] DOM updated: ${n}.${e} =`, s), ut(t);
1160
1180
  },
1161
1181
  cleanup(t) {
1162
1182
  P && console.log(`[atom-effect-jquery] Cleanup: ${t}`);
@@ -1165,7 +1185,7 @@ const h = {
1165
1185
  P && console.warn("[atom-effect-jquery]", ...t);
1166
1186
  }
1167
1187
  };
1168
- function rt(t) {
1188
+ function ut(t) {
1169
1189
  const e = t[0];
1170
1190
  if (!e || !document.contains(e)) return;
1171
1191
  const s = "atom_debug_timer", n = "atom_debug_cleanup_timer", i = "atom_debug_org_style";
@@ -1194,85 +1214,76 @@ function rt(t) {
1194
1214
  }, 100);
1195
1215
  t.data(s, r);
1196
1216
  }
1197
- const ot = /* @__PURE__ */ new WeakMap();
1198
- function we(t, e = {}) {
1199
- const s = tt(t, e);
1200
- return e.name && ot.set(s, { name: e.name }), s;
1217
+ const ht = /* @__PURE__ */ new WeakMap();
1218
+ function $e(t, e = {}) {
1219
+ const s = it(t, e);
1220
+ return e.name && ht.set(s, { name: e.name }), s;
1201
1221
  }
1202
- Object.defineProperty(we, "debug", {
1222
+ Object.defineProperty($e, "debug", {
1203
1223
  get() {
1204
- return h.enabled;
1224
+ return l.enabled;
1205
1225
  },
1206
1226
  set(t) {
1207
- h.enabled = t;
1227
+ l.enabled = t;
1208
1228
  }
1209
1229
  });
1210
- function ct() {
1230
+ function at() {
1211
1231
  return new Promise((t) => setTimeout(t, 0));
1212
1232
  }
1213
1233
  u.extend({
1214
- atom: we,
1215
- computed: st,
1216
- effect: I,
1217
- batch: z,
1218
- untracked: Te,
1219
- isAtom: le,
1220
- isComputed: De,
1221
- isReactive: (t) => le(t) || De(t),
1222
- nextTick: ct
1234
+ atom: $e,
1235
+ computed: rt,
1236
+ effect: D,
1237
+ batch: Je,
1238
+ untracked: Ue,
1239
+ isAtom: _e,
1240
+ isComputed: Ne,
1241
+ isReactive: (t) => _e(t) || Ne(t),
1242
+ nextTick: at
1223
1243
  });
1224
- function ke() {
1244
+ function Le() {
1225
1245
  return { timeoutId: null, phase: "idle", hasFocus: !1 };
1226
1246
  }
1227
- function Fe(t, e, s = {}) {
1247
+ function je(t, e, s = {}) {
1228
1248
  const {
1229
1249
  debounce: n,
1230
1250
  event: i = "input",
1231
- parse: r = (p) => p,
1232
- format: o = (p) => String(p ?? "")
1233
- } = s, c = ke(), f = () => {
1251
+ parse: r = (I) => I,
1252
+ format: o = (I) => String(I ?? "")
1253
+ } = s, c = Le(), h = () => {
1234
1254
  c.phase = "composing";
1235
1255
  }, _ = () => {
1236
- c.phase = "idle", F();
1256
+ c.phase = "idle", N();
1237
1257
  };
1238
- t.on("compositionstart", f), t.on("compositionend", _);
1239
- const C = () => {
1258
+ t.on("compositionstart", h), t.on("compositionend", _);
1259
+ const m = () => {
1240
1260
  c.hasFocus = !0;
1241
- }, m = () => {
1261
+ }, G = () => {
1242
1262
  c.hasFocus = !1;
1243
- const p = o(e.value);
1244
- t.val() !== p && t.val(p);
1263
+ const I = o(e.value);
1264
+ t.val() !== I && t.val(I);
1245
1265
  };
1246
- t.on("focus", C), t.on("blur", m);
1247
- const F = () => {
1248
- c.phase === "idle" && (c.phase = "syncing-to-atom", z(() => {
1249
- e.value = r(t.val());
1250
- }), c.phase = "idle");
1251
- }, v = () => {
1252
- c.phase === "idle" && (n ? (c.timeoutId && clearTimeout(c.timeoutId), c.timeoutId = window.setTimeout(F, n)) : F());
1266
+ t.on("focus", m), t.on("blur", G);
1267
+ const N = () => {
1268
+ c.phase === "idle" && (c.phase = "syncing-to-atom", e.value = r(t.val()), c.phase = "idle");
1269
+ }, A = () => {
1270
+ c.phase === "idle" && (n ? (c.timeoutId && clearTimeout(c.timeoutId), c.timeoutId = window.setTimeout(N, n)) : N());
1253
1271
  };
1254
- return t.on(i, v), t.on("change", v), { effect: () => {
1255
- const p = o(e.value), $ = t.val();
1256
- if ($ !== p) {
1257
- if (c.hasFocus && r($) === e.value)
1272
+ return t.on(i, A), t.on("change", A), { effect: () => {
1273
+ const I = o(e.value), H = t.val();
1274
+ if (H !== I) {
1275
+ if (c.hasFocus && r(H) === e.value)
1258
1276
  return;
1259
- c.phase = "syncing-to-dom", t.val(p), h.domUpdated(t, "val", p), c.phase = "idle";
1277
+ c.phase = "syncing-to-dom", t.val(I), l.domUpdated(t, "val", I), c.phase = "idle";
1260
1278
  }
1261
1279
  }, cleanup: () => {
1262
- t.off(i, v), t.off("change", v), t.off("compositionstart", f), t.off("compositionend", _), t.off("focus", C), t.off("blur", m), c.timeoutId && clearTimeout(c.timeoutId);
1280
+ t.off(i, A), t.off("change", A), t.off("compositionstart", h), t.off("compositionend", _), t.off("focus", m), t.off("blur", G), c.timeoutId && clearTimeout(c.timeoutId);
1263
1281
  } };
1264
1282
  }
1265
- class ut {
1266
- // DOM Element -> Effect Array (for disposal)
1283
+ class lt {
1267
1284
  effects = /* @__PURE__ */ new WeakMap();
1268
- // DOM Element -> Custom Cleanup Function Array
1269
1285
  cleanups = /* @__PURE__ */ new WeakMap();
1270
- // Track bound elements (Performance optimization)
1271
1286
  boundElements = /* @__PURE__ */ new WeakSet();
1272
- /**
1273
- * Tracks elements that are temporarily detached (e.g. via .detach())
1274
- * so they are NOT cleaned up by the MutationObserver.
1275
- */
1276
1287
  preservedNodes = /* @__PURE__ */ new WeakSet();
1277
1288
  keep(e) {
1278
1289
  this.preservedNodes.add(e);
@@ -1280,183 +1291,156 @@ class ut {
1280
1291
  isKept(e) {
1281
1292
  return this.preservedNodes.has(e);
1282
1293
  }
1283
- /**
1284
- * Registers an Effect to be disposed later.
1285
- */
1286
1294
  trackEffect(e, s) {
1287
- const n = this.effects.get(e) || [];
1288
- n.push(s), this.effects.set(e, n), this.boundElements.add(e);
1295
+ let n = this.effects.get(e);
1296
+ n || (n = [], this.effects.set(e, n), this.boundElements.add(e)), n.push(s);
1289
1297
  }
1290
- /**
1291
- * Registers a custom cleanup function (e.g., event listener removal).
1292
- */
1293
1298
  trackCleanup(e, s) {
1294
- const n = this.cleanups.get(e) || [];
1295
- n.push(s), this.cleanups.set(e, n), this.boundElements.add(e);
1299
+ let n = this.cleanups.get(e);
1300
+ n || (n = [], this.cleanups.set(e, n), this.boundElements.add(e)), n.push(s);
1296
1301
  }
1297
- /**
1298
- * Checks if an element has bindings (Fast check).
1299
- */
1300
1302
  hasBind(e) {
1301
1303
  return this.boundElements.has(e);
1302
1304
  }
1303
- /**
1304
- * Cleans up a single element.
1305
- * - Disposes all Effects (severs connection with Atom).
1306
- * - Executes all custom cleanups.
1307
- */
1308
1305
  cleanup(e) {
1309
- if (!this.boundElements.has(e)) return;
1310
- h.cleanup(ue(e));
1306
+ if (!this.boundElements.delete(e)) return;
1307
+ l.cleanup(ae(e));
1311
1308
  const s = this.effects.get(e);
1312
- s && (this.effects.delete(e), s.forEach((i) => {
1313
- try {
1314
- i.dispose();
1315
- } catch (r) {
1316
- h.warn("Effect dispose error:", r);
1309
+ if (s) {
1310
+ this.effects.delete(e);
1311
+ for (let i = 0, r = s.length; i < r; i++) {
1312
+ const o = s[i];
1313
+ if (o)
1314
+ try {
1315
+ o.dispose();
1316
+ } catch (c) {
1317
+ l.warn("Effect dispose error:", c);
1318
+ }
1317
1319
  }
1318
- }));
1320
+ }
1319
1321
  const n = this.cleanups.get(e);
1320
- n && (this.cleanups.delete(e), n.forEach((i) => {
1321
- try {
1322
- i();
1323
- } catch (r) {
1324
- h.warn("Cleanup error:", r);
1322
+ if (n) {
1323
+ this.cleanups.delete(e);
1324
+ for (let i = 0, r = n.length; i < r; i++) {
1325
+ const o = n[i];
1326
+ if (o)
1327
+ try {
1328
+ o();
1329
+ } catch (c) {
1330
+ l.warn("Cleanup error:", c);
1331
+ }
1325
1332
  }
1326
- })), this.boundElements.delete(e);
1333
+ }
1327
1334
  }
1328
- /**
1329
- * Cleans up the element and all its descendants (Recursive).
1330
- * - Essential for deep removal (empty(), remove(), etc.).
1331
- */
1332
1335
  cleanupTree(e) {
1333
- e.querySelectorAll("*").forEach((n) => {
1334
- this.boundElements.has(n) && this.cleanup(n);
1335
- }), this.cleanup(e);
1336
+ const s = e.querySelectorAll("*");
1337
+ for (let n = 0, i = s.length; n < i; n++) {
1338
+ const r = s[n];
1339
+ r && this.boundElements.has(r) && this.cleanup(r);
1340
+ }
1341
+ this.cleanup(e);
1336
1342
  }
1337
1343
  }
1338
- const l = new ut();
1339
- let J = null;
1340
- function ht(t = document.body) {
1341
- J || (J = new MutationObserver((e) => {
1342
- for (const s of e)
1343
- s.removedNodes.forEach((n) => {
1344
- l.isKept(n) || n.isConnected || n.nodeType === 1 && l.cleanupTree(n);
1345
- });
1346
- }), J.observe(t, { childList: !0, subtree: !0 }));
1344
+ const f = new lt();
1345
+ let W = null;
1346
+ function ft(t = document.body) {
1347
+ W || (W = new MutationObserver((e) => {
1348
+ for (let s = 0, n = e.length; s < n; s++) {
1349
+ const i = e[s];
1350
+ if (!i) continue;
1351
+ const r = i.removedNodes;
1352
+ for (let o = 0, c = r.length; o < c; o++) {
1353
+ const h = r[o];
1354
+ h && (f.isKept(h) || h.isConnected || h.nodeType === 1 && f.cleanupTree(h));
1355
+ }
1356
+ }
1357
+ }), W.observe(t, { childList: !0, subtree: !0 }));
1347
1358
  }
1348
- function It() {
1349
- J?.disconnect(), J = null;
1359
+ function Tt() {
1360
+ W?.disconnect(), W = null;
1350
1361
  }
1351
1362
  u.fn.atomText = function(t, e) {
1352
- return this.each(function() {
1353
- const s = u(this);
1354
- if (b(t)) {
1355
- const n = I(() => {
1356
- const i = E(t), r = e ? e(i) : String(i ?? "");
1357
- s.text(r), h.domUpdated(s, "text", r);
1363
+ if (p(t))
1364
+ return this.each(function() {
1365
+ const n = u(this), i = D(() => {
1366
+ const r = t.value, o = e ? e(r) : String(r ?? "");
1367
+ n.text(o), l.domUpdated(n, "text", o);
1358
1368
  });
1359
- l.trackEffect(this, n);
1360
- } else {
1361
- const n = e ? e(t) : String(t ?? "");
1362
- s.text(n);
1363
- }
1364
- });
1369
+ f.trackEffect(this, i);
1370
+ });
1371
+ const s = e ? e(t) : String(t ?? "");
1372
+ return this.text(s);
1365
1373
  };
1366
1374
  u.fn.atomHtml = function(t) {
1367
- return this.each(function() {
1368
- const e = u(this);
1369
- if (b(t)) {
1370
- const s = I(() => {
1371
- const n = String(E(t) ?? "");
1372
- e.html(n), h.domUpdated(e, "html", n);
1373
- });
1374
- l.trackEffect(this, s);
1375
- } else
1376
- e.html(String(t ?? ""));
1377
- });
1375
+ return p(t) ? this.each(function() {
1376
+ const e = u(this), s = D(() => {
1377
+ const n = String(t.value ?? "");
1378
+ e.html(n), l.domUpdated(e, "html", n);
1379
+ });
1380
+ f.trackEffect(this, s);
1381
+ }) : this.html(String(t ?? ""));
1378
1382
  };
1379
1383
  u.fn.atomClass = function(t, e) {
1380
- return this.each(function() {
1381
- const s = u(this);
1382
- if (b(e)) {
1383
- const n = I(() => {
1384
- const i = !!E(e);
1385
- s.toggleClass(t, i), h.domUpdated(s, `class.${t}`, i);
1386
- });
1387
- l.trackEffect(this, n);
1388
- } else
1389
- s.toggleClass(t, !!e);
1390
- });
1384
+ return p(e) ? this.each(function() {
1385
+ const s = u(this), n = D(() => {
1386
+ const i = !!e.value;
1387
+ s.toggleClass(t, i), l.domUpdated(s, `class.${t}`, i);
1388
+ });
1389
+ f.trackEffect(this, n);
1390
+ }) : this.toggleClass(t, !!e);
1391
1391
  };
1392
1392
  u.fn.atomCss = function(t, e, s) {
1393
- return this.each(function() {
1394
- const n = u(this);
1395
- if (b(e)) {
1396
- const i = I(() => {
1397
- const r = E(e), o = s ? `${r}${s}` : r;
1398
- n.css(t, o), h.domUpdated(n, `css.${t}`, o);
1393
+ if (p(e))
1394
+ return this.each(function() {
1395
+ const i = u(this), r = D(() => {
1396
+ const o = e.value, c = s ? `${o}${s}` : o;
1397
+ i.css(t, c), l.domUpdated(i, `css.${t}`, c);
1399
1398
  });
1400
- l.trackEffect(this, i);
1401
- } else
1402
- n.css(t, s ? `${e}${s}` : e);
1403
- });
1399
+ f.trackEffect(this, r);
1400
+ });
1401
+ const n = s ? `${e}${s}` : e;
1402
+ return this.css(t, n);
1404
1403
  };
1405
1404
  u.fn.atomAttr = function(t, e) {
1406
- return this.each(function() {
1407
- const s = u(this), n = (i) => {
1408
- i == null || i === !1 ? s.removeAttr(t) : i === !0 ? s.attr(t, t) : s.attr(t, String(i)), h.domUpdated(s, `attr.${t}`, i);
1409
- };
1410
- if (b(e)) {
1411
- const i = I(() => n(E(e)));
1412
- l.trackEffect(this, i);
1413
- } else
1414
- n(e);
1415
- });
1405
+ return p(e) ? this.each(function() {
1406
+ const s = u(this), n = D(() => {
1407
+ const i = e.value;
1408
+ i == null || i === !1 ? s.removeAttr(t) : i === !0 ? s.attr(t, t) : s.attr(t, String(i)), l.domUpdated(s, `attr.${t}`, i);
1409
+ });
1410
+ f.trackEffect(this, n);
1411
+ }) : e == null || e === !1 ? this.removeAttr(t) : e === !0 ? this.attr(t, t) : this.attr(t, String(e));
1416
1412
  };
1417
1413
  u.fn.atomProp = function(t, e) {
1418
- return this.each(function() {
1419
- const s = u(this);
1420
- if (b(e)) {
1421
- const n = I(() => {
1422
- const i = E(e);
1423
- s.prop(t, i), h.domUpdated(s, `prop.${t}`, i);
1424
- });
1425
- l.trackEffect(this, n);
1426
- } else
1427
- s.prop(t, e);
1428
- });
1414
+ return p(e) ? this.each(function() {
1415
+ const s = u(this), n = D(() => {
1416
+ const i = e.value;
1417
+ s.prop(t, i), l.domUpdated(s, `prop.${t}`, i);
1418
+ });
1419
+ f.trackEffect(this, n);
1420
+ }) : this.prop(t, e);
1429
1421
  };
1430
1422
  u.fn.atomShow = function(t) {
1431
- return this.each(function() {
1432
- const e = u(this);
1433
- if (b(t)) {
1434
- const s = I(() => {
1435
- const n = !!E(t);
1436
- e.toggle(n), h.domUpdated(e, "show", n);
1437
- });
1438
- l.trackEffect(this, s);
1439
- } else
1440
- e.toggle(!!t);
1441
- });
1423
+ return p(t) ? this.each(function() {
1424
+ const e = u(this), s = D(() => {
1425
+ const n = !!t.value;
1426
+ e.toggle(n), l.domUpdated(e, "show", n);
1427
+ });
1428
+ f.trackEffect(this, s);
1429
+ }) : this.toggle(!!t);
1442
1430
  };
1443
1431
  u.fn.atomHide = function(t) {
1444
- return this.each(function() {
1445
- const e = u(this);
1446
- if (b(t)) {
1447
- const s = I(() => {
1448
- const n = !E(t);
1449
- e.toggle(n), h.domUpdated(e, "hide", !n);
1450
- });
1451
- l.trackEffect(this, s);
1452
- } else
1453
- e.toggle(!t);
1454
- });
1432
+ return p(t) ? this.each(function() {
1433
+ const e = u(this), s = D(() => {
1434
+ const n = !t.value;
1435
+ e.toggle(n), l.domUpdated(e, "hide", !n);
1436
+ });
1437
+ f.trackEffect(this, s);
1438
+ }) : this.toggle(!t);
1455
1439
  };
1456
1440
  u.fn.atomVal = function(t, e = {}) {
1457
1441
  return this.each(function() {
1458
- const { effect: s, cleanup: n } = Fe(u(this), t, e), i = I(s);
1459
- l.trackEffect(this, i), l.trackCleanup(this, n);
1442
+ const s = u(this), { effect: n, cleanup: i } = je(s, t, e), r = D(n);
1443
+ f.trackEffect(this, r), f.trackCleanup(this, i);
1460
1444
  });
1461
1445
  };
1462
1446
  u.fn.atomChecked = function(t) {
@@ -1464,107 +1448,103 @@ u.fn.atomChecked = function(t) {
1464
1448
  const e = u(this);
1465
1449
  let s = !1;
1466
1450
  const n = () => {
1467
- s || z(() => {
1468
- t.value = e.prop("checked");
1469
- });
1451
+ s || (t.value = !!e.prop("checked"));
1470
1452
  };
1471
- e.on("change", n), l.trackCleanup(this, () => e.off("change", n));
1472
- const i = I(() => {
1473
- s = !0, e.prop("checked", t.value), h.domUpdated(e, "checked", t.value), s = !1;
1453
+ e.on("change", n), f.trackCleanup(this, () => e.off("change", n));
1454
+ const i = D(() => {
1455
+ s = !0;
1456
+ const r = !!t.value;
1457
+ e.prop("checked", r), l.domUpdated(e, "checked", r), s = !1;
1474
1458
  });
1475
- l.trackEffect(this, i);
1459
+ f.trackEffect(this, i);
1476
1460
  });
1477
1461
  };
1478
1462
  u.fn.atomOn = function(t, e) {
1479
1463
  return this.each(function() {
1480
- const s = u(this), n = function(i) {
1481
- z(() => e.call(this, i));
1482
- };
1483
- s.on(t, n), l.trackCleanup(this, () => s.off(t, n));
1464
+ const s = u(this);
1465
+ s.on(t, e), f.trackCleanup(this, () => s.off(t, e));
1484
1466
  });
1485
1467
  };
1486
1468
  u.fn.atomUnbind = function() {
1487
1469
  return this.each(function() {
1488
- l.cleanupTree(this);
1470
+ f.cleanupTree(this);
1489
1471
  });
1490
1472
  };
1491
- function at(t, e) {
1492
- b(e) ? t.effects.push(() => {
1493
- const s = String(E(e) ?? "");
1494
- t.$el.text(s), h.domUpdated(t.$el, "text", s);
1473
+ function dt(t, e) {
1474
+ p(e) ? t.effects.push(() => {
1475
+ const s = String(k(e) ?? "");
1476
+ t.$el.text(s), l.domUpdated(t.$el, "text", s);
1495
1477
  }) : t.$el.text(String(e ?? ""));
1496
1478
  }
1497
- function lt(t, e) {
1498
- b(e) ? t.effects.push(() => {
1499
- const s = String(E(e) ?? "");
1500
- t.$el.html(s), h.domUpdated(t.$el, "html", s);
1479
+ function _t(t, e) {
1480
+ p(e) ? t.effects.push(() => {
1481
+ const s = String(k(e) ?? "");
1482
+ t.$el.html(s), l.domUpdated(t.$el, "html", s);
1501
1483
  }) : t.$el.html(String(e ?? ""));
1502
1484
  }
1503
- function ft(t, e) {
1485
+ function pt(t, e) {
1504
1486
  for (const [s, n] of Object.entries(e))
1505
- b(n) ? t.effects.push(() => {
1506
- const i = !!E(n);
1507
- t.$el.toggleClass(s, i), h.domUpdated(t.$el, `class.${s}`, i);
1487
+ p(n) ? t.effects.push(() => {
1488
+ const i = !!k(n);
1489
+ t.$el.toggleClass(s, i), l.domUpdated(t.$el, `class.${s}`, i);
1508
1490
  }) : t.$el.toggleClass(s, !!n);
1509
1491
  }
1510
- function dt(t, e) {
1492
+ function bt(t, e) {
1511
1493
  for (const [s, n] of Object.entries(e))
1512
1494
  if (Array.isArray(n)) {
1513
1495
  const [i, r] = n;
1514
- b(i) ? t.effects.push(() => {
1515
- const o = `${E(i)}${r}`;
1516
- t.$el.css(s, o), h.domUpdated(t.$el, `css.${s}`, o);
1496
+ p(i) ? t.effects.push(() => {
1497
+ const o = `${k(i)}${r}`;
1498
+ t.$el.css(s, o), l.domUpdated(t.$el, `css.${s}`, o);
1517
1499
  }) : t.$el.css(s, `${i}${r}`);
1518
- } else b(n) ? t.effects.push(() => {
1519
- const i = E(n);
1520
- t.$el.css(s, i), h.domUpdated(t.$el, `css.${s}`, i);
1500
+ } else p(n) ? t.effects.push(() => {
1501
+ const i = k(n);
1502
+ t.$el.css(s, i), l.domUpdated(t.$el, `css.${s}`, i);
1521
1503
  }) : t.$el.css(s, n);
1522
1504
  }
1523
- function _t(t, e) {
1505
+ function Et(t, e) {
1524
1506
  for (const [s, n] of Object.entries(e)) {
1525
1507
  const i = (r) => {
1526
- r == null || r === !1 ? t.$el.removeAttr(s) : r === !0 ? t.$el.attr(s, s) : t.$el.attr(s, String(r)), h.domUpdated(t.$el, `attr.${s}`, r);
1508
+ r == null || r === !1 ? t.$el.removeAttr(s) : r === !0 ? t.$el.attr(s, s) : t.$el.attr(s, String(r)), l.domUpdated(t.$el, `attr.${s}`, r);
1527
1509
  };
1528
- b(n) ? t.effects.push(() => i(E(n))) : i(n);
1510
+ p(n) ? t.effects.push(() => i(k(n))) : i(n);
1529
1511
  }
1530
1512
  }
1531
- function pt(t, e) {
1513
+ function gt(t, e) {
1532
1514
  for (const [s, n] of Object.entries(e))
1533
- b(n) ? t.effects.push(() => {
1534
- const i = E(n);
1535
- t.$el.prop(s, i), h.domUpdated(t.$el, `prop.${s}`, i);
1515
+ p(n) ? t.effects.push(() => {
1516
+ const i = k(n);
1517
+ t.$el.prop(s, i), l.domUpdated(t.$el, `prop.${s}`, i);
1536
1518
  }) : t.$el.prop(s, n);
1537
1519
  }
1538
- function bt(t, e) {
1539
- b(e) ? t.effects.push(() => {
1540
- const s = !!E(e);
1541
- t.$el.toggle(s), h.domUpdated(t.$el, "show", s);
1520
+ function mt(t, e) {
1521
+ p(e) ? t.effects.push(() => {
1522
+ const s = !!k(e);
1523
+ t.$el.toggle(s), l.domUpdated(t.$el, "show", s);
1542
1524
  }) : t.$el.toggle(!!e);
1543
1525
  }
1544
- function Et(t, e) {
1545
- b(e) ? t.effects.push(() => {
1546
- const s = !E(e);
1547
- t.$el.toggle(s), h.domUpdated(t.$el, "hide", !s);
1526
+ function St(t, e) {
1527
+ p(e) ? t.effects.push(() => {
1528
+ const s = !k(e);
1529
+ t.$el.toggle(s), l.domUpdated(t.$el, "hide", !s);
1548
1530
  }) : t.$el.toggle(!e);
1549
1531
  }
1550
- function gt(t, e) {
1551
- const s = Array.isArray(e) ? e[0] : e, n = Array.isArray(e) ? e[1] : {}, { effect: i, cleanup: r } = Fe(t.$el, s, n);
1532
+ function yt(t, e) {
1533
+ const s = Array.isArray(e) ? e[0] : e, n = Array.isArray(e) ? e[1] : {}, { effect: i, cleanup: r } = je(t.$el, s, n);
1552
1534
  t.effects.push(i), t.trackCleanup(r);
1553
1535
  }
1554
- function mt(t, e) {
1555
- const s = ke(), n = () => {
1556
- s.phase === "idle" && z(() => {
1557
- e.value = t.$el.prop("checked");
1558
- });
1536
+ function Dt(t, e) {
1537
+ const s = Le(), n = () => {
1538
+ s.phase === "idle" && (e.value = t.$el.prop("checked"));
1559
1539
  };
1560
1540
  t.$el.on("change", n), t.trackCleanup(() => t.$el.off("change", n)), t.effects.push(() => {
1561
- s.phase = "syncing-to-dom", t.$el.prop("checked", e.value), h.domUpdated(t.$el, "checked", e.value), s.phase = "idle";
1541
+ s.phase = "syncing-to-dom", t.$el.prop("checked", e.value), l.domUpdated(t.$el, "checked", e.value), s.phase = "idle";
1562
1542
  });
1563
1543
  }
1564
- function yt(t, e) {
1544
+ function It(t, e) {
1565
1545
  for (const [s, n] of Object.entries(e)) {
1566
1546
  const i = function(r) {
1567
- z(() => n.call(this, r));
1547
+ n.call(this, r);
1568
1548
  };
1569
1549
  t.$el.on(s, i), t.trackCleanup(() => t.$el.off(s, i));
1570
1550
  }
@@ -1575,148 +1555,151 @@ u.fn.atomBind = function(t) {
1575
1555
  $el: e,
1576
1556
  el: this,
1577
1557
  effects: s,
1578
- trackCleanup: (i) => l.trackCleanup(this, i)
1558
+ trackCleanup: (i) => f.trackCleanup(this, i)
1579
1559
  };
1580
- t.text !== void 0 && at(n, t.text), t.html !== void 0 && lt(n, t.html), t.class && ft(n, t.class), t.css && dt(n, t.css), t.attr && _t(n, t.attr), t.prop && pt(n, t.prop), t.show !== void 0 && bt(n, t.show), t.hide !== void 0 && Et(n, t.hide), t.val !== void 0 && gt(n, t.val), t.checked !== void 0 && mt(n, t.checked), t.on && yt(n, t.on), s.forEach((i) => {
1581
- const r = I(i);
1582
- l.trackEffect(this, r);
1560
+ t.text !== void 0 && dt(n, t.text), t.html !== void 0 && _t(n, t.html), t.class && pt(n, t.class), t.css && bt(n, t.css), t.attr && Et(n, t.attr), t.prop && gt(n, t.prop), t.show !== void 0 && mt(n, t.show), t.hide !== void 0 && St(n, t.hide), t.val !== void 0 && yt(n, t.val), t.checked !== void 0 && Dt(n, t.checked), t.on && It(n, t.on), s.forEach((i) => {
1561
+ const r = D(i);
1562
+ f.trackEffect(this, r);
1583
1563
  });
1584
1564
  });
1585
1565
  };
1586
- function St(t) {
1587
- if (t.length === 0) return [];
1588
- const e = t.slice(), s = [0];
1589
- let n, i, r, o;
1590
- const c = t.length;
1591
- for (n = 0; n < c; n++) {
1592
- const C = t[n];
1593
- if (C !== -1) {
1594
- const m = s[s.length - 1];
1595
- if (t[m] < C) {
1596
- e[n] = m, s.push(n);
1597
- continue;
1598
- }
1599
- for (i = 0, r = s.length - 1; i < r; )
1600
- o = (i + r) / 2 | 0, t[s[o]] < C ? i = o + 1 : r = o;
1601
- C < t[s[i]] && (i > 0 && (e[n] = s[i - 1]), s[i] = n);
1566
+ function Ct(t) {
1567
+ const e = t.length;
1568
+ if (e === 0) return new Int32Array(0);
1569
+ const s = new Int32Array(e), n = new Int32Array(e);
1570
+ let i = 0;
1571
+ for (let o = 0; o < e; o++) {
1572
+ const c = t[o];
1573
+ if (c === -1) continue;
1574
+ if (i === 0 || t[n[i - 1]] < c) {
1575
+ s[o] = i > 0 ? n[i - 1] : -1, n[i++] = o;
1576
+ continue;
1577
+ }
1578
+ let h = 0, _ = i - 1;
1579
+ for (; h < _; ) {
1580
+ const m = h + _ >>> 1;
1581
+ t[n[m]] < c ? h = m + 1 : _ = m;
1602
1582
  }
1583
+ c < t[n[h]] && (h > 0 && (s[o] = n[h - 1]), n[h] = o);
1603
1584
  }
1604
- let f = s.length, _ = s[f - 1];
1605
- for (; f-- > 0; )
1606
- s[f] = _, _ = e[_];
1607
- return s;
1585
+ const r = new Int32Array(i);
1586
+ for (let o = i - 1, c = n[i - 1]; o >= 0; o--)
1587
+ r[o] = c, c = s[c];
1588
+ return r;
1608
1589
  }
1609
1590
  u.fn.atomList = function(t, e) {
1591
+ const { key: s, render: n, bind: i, update: r, onAdd: o, onRemove: c, empty: h } = e, _ = typeof s == "function" ? s : (m) => m[s];
1610
1592
  return this.each(function() {
1611
- const s = u(this), n = ue(this), { key: i, render: r, bind: o, onAdd: c, onRemove: f, empty: _ } = e, C = typeof i == "function" ? i : (p) => p[i], m = /* @__PURE__ */ new Map();
1612
- let F = [], v = null;
1613
- const K = /* @__PURE__ */ new Set(), _e = I(() => {
1614
- const p = t.value, $ = [], pe = /* @__PURE__ */ new Set();
1615
- for (let a = 0; a < p.length; a++) {
1616
- const g = p[a], x = C(g, a);
1617
- $.push(x), pe.add(x);
1593
+ const m = u(this), G = ae(this), N = /* @__PURE__ */ new Map(), A = /* @__PURE__ */ new Set();
1594
+ let M = [], $ = null;
1595
+ const I = D(() => {
1596
+ const H = t.value, O = H.length;
1597
+ if (O === 0 ? h && !$ && ($ = u(h).appendTo(m)) : $ && ($.remove(), $ = null), O === 0 && N.size === 0) {
1598
+ M = [];
1599
+ return;
1618
1600
  }
1619
- if (h.log("list", `${n} updating with ${p.length} items`), p.length === 0 && _) {
1620
- v || (v = u(_), s.append(v));
1621
- for (const [, a] of m) {
1622
- a.$el.remove();
1623
- const g = a.$el[0];
1624
- g && l.cleanup(g);
1625
- }
1626
- m.clear(), F = [];
1601
+ l.log("list", `${G} updating with ${O} items`);
1602
+ const ee = new Array(O), Ee = /* @__PURE__ */ new Set();
1603
+ for (let a = 0; a < O; a++) {
1604
+ const b = H[a], C = _(b, a);
1605
+ ee[a] = C, Ee.add(C);
1606
+ }
1607
+ for (const [a, b] of N) {
1608
+ if (Ee.has(a) || A.has(a)) continue;
1609
+ const C = () => {
1610
+ b.$el.remove();
1611
+ const E = b.$el[0];
1612
+ E && f.cleanup(E), A.delete(a), l.log("list", `${G} removed item:`, a);
1613
+ };
1614
+ if (N.delete(a), A.add(a), c) {
1615
+ const E = c(b.$el);
1616
+ E instanceof Promise ? E.then(C) : C();
1617
+ } else
1618
+ C();
1619
+ }
1620
+ if (O === 0) {
1621
+ M = [];
1627
1622
  return;
1628
- } else v && (v.remove(), v = null);
1629
- for (const [a, g] of m)
1630
- if (!pe.has(a)) {
1631
- if (K.has(a)) continue;
1632
- const x = () => {
1633
- g.$el.remove();
1634
- const W = g.$el[0];
1635
- W && l.cleanup(W), K.delete(a), h.log("list", `${n} removed item:`, a);
1636
- };
1637
- m.delete(a), K.add(a), f ? Promise.resolve(f(g.$el)).then(x) : x();
1638
- }
1639
- const be = /* @__PURE__ */ new Map();
1640
- F.forEach((a, g) => be.set(a, g));
1641
- const $e = $.map((a) => be.get(a) ?? -1), Pe = St($e), Ve = new Set(Pe);
1642
- let R = null;
1643
- for (let a = p.length - 1; a >= 0; a--) {
1644
- const g = $[a], x = p[a], W = Ve.has(a);
1645
- if (m.has(g)) {
1646
- const N = m.get(g);
1647
- if (!N) continue;
1648
- N.item = x;
1649
- const U = N.$el[0];
1650
- if (!U) continue;
1651
- if (e.update && e.update(N.$el, x, a), !W)
1652
- R ? N.$el.insertBefore(R) : N.$el.appendTo(s);
1653
- else {
1654
- const G = U.nextSibling;
1655
- R && G !== R ? N.$el.insertBefore(R) : !R && G && N.$el.appendTo(s);
1656
- }
1657
- R = U;
1623
+ }
1624
+ const ge = /* @__PURE__ */ new Map();
1625
+ for (let a = 0; a < M.length; a++) {
1626
+ const b = M[a];
1627
+ b !== void 0 && ge.set(b, a);
1628
+ }
1629
+ const me = new Int32Array(O);
1630
+ for (let a = 0; a < O; a++) {
1631
+ const b = ee[a];
1632
+ me[a] = b !== void 0 ? ge.get(b) ?? -1 : -1;
1633
+ }
1634
+ const Se = Ct(me);
1635
+ let le = Se.length - 1, U = null;
1636
+ for (let a = O - 1; a >= 0; a--) {
1637
+ const b = ee[a], C = H[a], E = N.get(b);
1638
+ if (E) {
1639
+ E.item = C;
1640
+ const L = E.$el[0];
1641
+ if (!L) continue;
1642
+ r && r(E.$el, C, a), le >= 0 && Se[le] === a ? (le--, L.nextSibling !== U && (U ? E.$el.insertBefore(U) : E.$el.appendTo(m))) : U ? E.$el.insertBefore(U) : E.$el.appendTo(m), U = L;
1658
1643
  } else {
1659
- const N = r(x, a), U = N instanceof Element ? u(N) : u(N);
1660
- m.set(g, { $el: U, item: x }), R ? U.insertBefore(R) : U.appendTo(s), o && o(U, x, a), c && c(U), h.log("list", `${n} added item:`, g);
1661
- const G = U[0];
1662
- G && (R = G);
1644
+ const L = n(C, a), j = L instanceof Element ? u(L) : u(L);
1645
+ N.set(b, { $el: j, item: C }), U ? j.insertBefore(U) : j.appendTo(m), i && i(j, C, a), o && o(j), l.log("list", `${G} added item:`, b), U = j[0] || null;
1663
1646
  }
1664
1647
  }
1665
- F = $;
1648
+ M = ee;
1666
1649
  });
1667
- l.trackEffect(this, _e), l.trackCleanup(this, () => {
1668
- m.clear(), F = [], v?.remove();
1650
+ f.trackEffect(this, I), f.trackCleanup(this, () => {
1651
+ N.clear(), A.clear(), M = [], $?.remove();
1669
1652
  });
1670
1653
  });
1671
1654
  };
1672
- const se = /* @__PURE__ */ new WeakMap();
1655
+ const ie = /* @__PURE__ */ new WeakMap();
1673
1656
  u.fn.atomMount = function(t, e = {}) {
1674
1657
  return this.each(function() {
1675
- const s = u(this), n = ue(this), i = se.get(this);
1676
- i && (h.log("mount", `${n} unmounting existing component`), i()), h.log("mount", `${n} mounting component`);
1658
+ const s = u(this), n = ae(this), i = ie.get(this);
1659
+ i && (l.log("mount", `${n} unmounting existing component`), i()), l.log("mount", `${n} mounting component`);
1677
1660
  let r;
1678
1661
  try {
1679
1662
  r = t(s, e);
1680
- } catch (f) {
1681
- console.error("[atom-effect-jquery] Mount error:", f);
1663
+ } catch (h) {
1664
+ console.error("[atom-effect-jquery] Mount error:", h);
1682
1665
  return;
1683
1666
  }
1684
1667
  let o = !1;
1685
1668
  const c = () => {
1686
1669
  if (!o) {
1687
- if (o = !0, h.log("mount", `${n} full cleanup`), typeof r == "function")
1670
+ if (o = !0, l.log("mount", `${n} full cleanup`), typeof r == "function")
1688
1671
  try {
1689
1672
  r();
1690
1673
  } catch {
1691
1674
  }
1692
- l.cleanupTree(this), se.delete(this);
1675
+ f.cleanupTree(this), ie.delete(this);
1693
1676
  }
1694
1677
  };
1695
- se.set(this, c), l.trackCleanup(this, c);
1678
+ ie.set(this, c), f.trackCleanup(this, c);
1696
1679
  });
1697
1680
  };
1698
1681
  u.fn.atomUnmount = function() {
1699
1682
  return this.each(function() {
1700
- se.get(this)?.();
1683
+ ie.get(this)?.();
1701
1684
  });
1702
1685
  };
1703
- const Q = /* @__PURE__ */ new WeakMap();
1704
- let Ie = !1;
1705
- function Me() {
1706
- if (Ie) return;
1707
- Ie = !0;
1686
+ const J = /* @__PURE__ */ new WeakMap();
1687
+ let Te = !1;
1688
+ function Pe() {
1689
+ if (Te) return;
1690
+ Te = !0;
1708
1691
  const t = u.fn.on, e = u.fn.off, s = u.fn.remove, n = u.fn.empty, i = u.fn.detach;
1709
1692
  u.fn.remove = function(r) {
1710
1693
  return (r ? this.filter(r) : this).each(function() {
1711
- l.cleanupTree(this);
1694
+ f.cleanupTree(this);
1712
1695
  }), s.call(this, r);
1713
1696
  }, u.fn.empty = function() {
1714
1697
  return this.each(function() {
1715
- this.querySelectorAll("*").forEach((o) => l.cleanup(o));
1698
+ this.querySelectorAll("*").forEach((o) => f.cleanup(o));
1716
1699
  }), n.call(this);
1717
1700
  }, u.fn.detach = function(r) {
1718
1701
  return (r ? this.filter(r) : this).each(function() {
1719
- l.keep(this);
1702
+ f.keep(this);
1720
1703
  }), i.call(this, r);
1721
1704
  }, u.fn.on = function(...r) {
1722
1705
  let o = -1;
@@ -1727,13 +1710,10 @@ function Me() {
1727
1710
  }
1728
1711
  if (o !== -1) {
1729
1712
  const c = r[o];
1730
- let f;
1731
- Q.has(c) ? f = Q.get(c) : (f = function(..._) {
1732
- let C;
1733
- return z(() => {
1734
- C = c.apply(this, _);
1735
- }), C;
1736
- }, Q.set(c, f)), r[o] = f;
1713
+ let h;
1714
+ J.has(c) ? h = J.get(c) : (h = function(..._) {
1715
+ return c.apply(this, _);
1716
+ }, J.set(c, h)), r[o] = h;
1737
1717
  }
1738
1718
  return t.apply(this, r);
1739
1719
  }, u.fn.off = function(...r) {
@@ -1745,27 +1725,27 @@ function Me() {
1745
1725
  }
1746
1726
  if (o !== -1) {
1747
1727
  const c = r[o];
1748
- Q.has(c) && (r[o] = Q.get(c));
1728
+ J.has(c) && (r[o] = J.get(c));
1749
1729
  }
1750
1730
  return e.apply(this, r);
1751
1731
  };
1752
1732
  }
1753
- const Ct = Me;
1754
- Me();
1733
+ const xt = Pe;
1734
+ Pe();
1755
1735
  u(() => {
1756
- ht(document.body);
1736
+ ft(document.body);
1757
1737
  });
1758
1738
  export {
1759
- tt as atom,
1760
- z as batch,
1761
- st as computed,
1762
- xt as default,
1763
- It as disableAutoCleanup,
1764
- I as effect,
1765
- ht as enableAutoCleanup,
1766
- Ct as enablejQueryBatching,
1767
- Me as enablejQueryOverrides,
1768
- l as registry,
1769
- Te as untracked
1739
+ it as atom,
1740
+ Je as batch,
1741
+ rt as computed,
1742
+ Ot as default,
1743
+ Tt as disableAutoCleanup,
1744
+ D as effect,
1745
+ ft as enableAutoCleanup,
1746
+ xt as enablejQueryBatching,
1747
+ Pe as enablejQueryOverrides,
1748
+ f as registry,
1749
+ Ue as untracked
1770
1750
  };
1771
1751
  //# sourceMappingURL=index.mjs.map