@reevit/svelte 0.4.7 → 0.4.8

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,31 +1,31 @@
1
- import { createEventDispatcher as $t, onMount as oi, onDestroy as ai } from "svelte";
2
- import { createInitialState as si, ReevitAPIClient as li, generateReference as ci, detectCountryFromCurrency as ui, reevitReducer as fi, cn as de, validatePhone as Pn, detectNetwork as di, createThemeVariables as vi, createReevitClient as pi } from "@reevit/core";
1
+ import { createEventDispatcher as nn, onMount as oi, onDestroy as ai } from "svelte";
2
+ import { createInitialState as si, ReevitAPIClient as li, generateReference as ci, detectCountryFromCurrency as ui, reevitReducer as fi, cn as de, validatePhone as kn, detectNetwork as di, createThemeVariables as vi, createReevitClient as pi } from "@reevit/core";
3
3
  import { ReevitAPIClient as Za, cn as Qa, createInitialState as Xa, createReevitClient as $a, detectCountryFromCurrency as es, detectNetwork as ts, formatAmount as ns, formatPhone as rs, reevitReducer as is, validatePhone as os } from "@reevit/core";
4
4
  const hi = "5";
5
5
  typeof window < "u" && ((window.__svelte ??= {}).v ??= /* @__PURE__ */ new Set()).add(hi);
6
- let Lt = !1, mi = !1;
6
+ let Ot = !1, mi = !1;
7
7
  function _i() {
8
- Lt = !0;
8
+ Ot = !0;
9
9
  }
10
10
  _i();
11
- const yi = 1, bi = 2, ur = 4, gi = 8, wi = 16, Ei = 1, Pi = 2, Si = 4, ki = 8, Ci = 16, Ii = 1, Mi = 2, oe = /* @__PURE__ */ Symbol(), xi = "http://www.w3.org/1999/xhtml", In = !1;
12
- var fr = Array.isArray, Ri = Array.prototype.indexOf, Dn = Array.from, dr = Object.defineProperty, Bt = Object.getOwnPropertyDescriptor, vr = Object.getOwnPropertyDescriptors, Ti = Object.prototype, Ai = Array.prototype, Un = Object.getPrototypeOf;
13
- const Mn = () => {
11
+ const yi = 1, bi = 2, dr = 4, gi = 8, wi = 16, Ei = 1, Pi = 2, Si = 4, ki = 8, Ci = 16, Ii = 1, Mi = 2, ae = /* @__PURE__ */ Symbol(), xi = "http://www.w3.org/1999/xhtml", xn = !1;
12
+ var vr = Array.isArray, Ri = Array.prototype.indexOf, jn = Array.from, pr = Object.defineProperty, Vt = Object.getOwnPropertyDescriptor, hr = Object.getOwnPropertyDescriptors, Ti = Object.prototype, Ai = Array.prototype, zn = Object.getPrototypeOf;
13
+ const Rn = () => {
14
14
  };
15
15
  function Ni(e) {
16
16
  return e();
17
17
  }
18
- function xn(e) {
18
+ function Tn(e) {
19
19
  for (var t = 0; t < e.length; t++)
20
20
  e[t]();
21
21
  }
22
- function pr() {
22
+ function mr() {
23
23
  var e, t, n = new Promise((r, o) => {
24
24
  e = r, t = o;
25
25
  });
26
26
  return { promise: n, resolve: e, reject: t };
27
27
  }
28
- const re = 2, hr = 4, en = 8, Li = 1 << 24, Ne = 16, Le = 32, mt = 64, jn = 128, Se = 512, te = 1024, pe = 2048, ke = 4096, ye = 8192, Re = 16384, zn = 32768, It = 65536, Xn = 1 << 17, mr = 1 << 18, tn = 1 << 19, _r = 1 << 20, xe = 1 << 25, nt = 32768, Rn = 1 << 21, Hn = 1 << 22, Ke = 1 << 23, pt = /* @__PURE__ */ Symbol("$state"), Oi = /* @__PURE__ */ Symbol("legacy props"), Fi = /* @__PURE__ */ Symbol(""), dt = new class extends Error {
28
+ const ie = 2, _r = 4, rn = 8, Li = 1 << 24, Ne = 16, Le = 32, yt = 64, Hn = 128, Pe = 512, ne = 1024, pe = 2048, Se = 4096, me = 8192, Re = 16384, Bn = 32768, Mt = 65536, er = 1 << 17, yr = 1 << 18, on = 1 << 19, br = 1 << 20, xe = 1 << 25, rt = 32768, An = 1 << 21, Kn = 1 << 22, qe = 1 << 23, mt = /* @__PURE__ */ Symbol("$state"), Oi = /* @__PURE__ */ Symbol("legacy props"), Fi = /* @__PURE__ */ Symbol(""), pt = new class extends Error {
29
29
  name = "StaleReactionError";
30
30
  message = "The reaction that called `getAbortSignal()` was re-run or destroyed";
31
31
  }();
@@ -56,78 +56,78 @@ function qi() {
56
56
  function Vi() {
57
57
  throw new Error("https://svelte.dev/e/state_unsafe_mutation");
58
58
  }
59
- function yr(e) {
59
+ function gr(e) {
60
60
  return e === this.v;
61
61
  }
62
62
  function Yi(e, t) {
63
63
  return e != e ? t == t : e !== t || e !== null && typeof e == "object" || typeof e == "function";
64
64
  }
65
- function br(e) {
65
+ function wr(e) {
66
66
  return !Yi(e, this.v);
67
67
  }
68
- let $ = null;
69
- function qt(e) {
70
- $ = e;
68
+ let ee = null;
69
+ function Gt(e) {
70
+ ee = e;
71
71
  }
72
- function nn(e, t = !1, n) {
73
- $ = {
74
- p: $,
72
+ function an(e, t = !1, n) {
73
+ ee = {
74
+ p: ee,
75
75
  i: !1,
76
76
  c: null,
77
77
  e: null,
78
78
  s: e,
79
79
  x: null,
80
- l: Lt && !t ? { s: null, u: null, $: [] } : null
80
+ l: Ot && !t ? { s: null, u: null, $: [] } : null
81
81
  };
82
82
  }
83
- function rn(e) {
83
+ function sn(e) {
84
84
  var t = (
85
85
  /** @type {ComponentContext} */
86
- $
86
+ ee
87
87
  ), n = t.e;
88
88
  if (n !== null) {
89
89
  t.e = null;
90
90
  for (var r of n)
91
- Rr(r);
91
+ Ar(r);
92
92
  }
93
- return t.i = !0, $ = t.p, /** @type {T} */
93
+ return t.i = !0, ee = t.p, /** @type {T} */
94
94
  {};
95
95
  }
96
- function Ot() {
97
- return !Lt || $ !== null && $.l === null;
96
+ function Ft() {
97
+ return !Ot || ee !== null && ee.l === null;
98
98
  }
99
- let Ze = [];
100
- function gr() {
101
- var e = Ze;
102
- Ze = [], xn(e);
99
+ let Qe = [];
100
+ function Er() {
101
+ var e = Qe;
102
+ Qe = [], Tn(e);
103
103
  }
104
- function Bn(e) {
105
- if (Ze.length === 0 && !Ct) {
106
- var t = Ze;
104
+ function qn(e) {
105
+ if (Qe.length === 0 && !It) {
106
+ var t = Qe;
107
107
  queueMicrotask(() => {
108
- t === Ze && gr();
108
+ t === Qe && Er();
109
109
  });
110
110
  }
111
- Ze.push(e);
111
+ Qe.push(e);
112
112
  }
113
113
  function Gi() {
114
- for (; Ze.length > 0; )
115
- gr();
114
+ for (; Qe.length > 0; )
115
+ Er();
116
116
  }
117
117
  function Wi(e) {
118
- var t = z;
118
+ var t = j;
119
119
  if (t === null)
120
- return N.f |= Ke, e;
121
- if ((t.f & zn) === 0) {
122
- if ((t.f & jn) === 0)
120
+ return A.f |= qe, e;
121
+ if ((t.f & Bn) === 0) {
122
+ if ((t.f & Hn) === 0)
123
123
  throw e;
124
124
  t.b.error(e);
125
125
  } else
126
- Vt(e, t);
126
+ Wt(e, t);
127
127
  }
128
- function Vt(e, t) {
128
+ function Wt(e, t) {
129
129
  for (; t !== null; ) {
130
- if ((t.f & jn) !== 0)
130
+ if ((t.f & Hn) !== 0)
131
131
  try {
132
132
  t.b.error(e);
133
133
  return;
@@ -138,9 +138,9 @@ function Vt(e, t) {
138
138
  }
139
139
  throw e;
140
140
  }
141
- const zt = /* @__PURE__ */ new Set();
142
- let L = null, Kt = null, we = null, ge = [], on = null, Tn = !1, Ct = !1;
143
- class Mt {
141
+ const Kt = /* @__PURE__ */ new Set();
142
+ let N = null, Yt = null, ge = null, be = [], ln = null, Nn = !1, It = !1;
143
+ class xt {
144
144
  committed = !1;
145
145
  /**
146
146
  * The current values of any sources that are updated in this batch
@@ -204,7 +204,7 @@ class Mt {
204
204
  * @param {Effect[]} root_effects
205
205
  */
206
206
  process(t) {
207
- ge = [], Kt = null, this.apply();
207
+ be = [], Yt = null, this.apply();
208
208
  var n = {
209
209
  parent: null,
210
210
  effect: null,
@@ -213,7 +213,7 @@ class Mt {
213
213
  };
214
214
  for (const r of t)
215
215
  this.#l(r, n);
216
- this.is_fork || this.#u(), this.is_deferred() ? (this.#s(n.effects), this.#s(n.render_effects)) : (Kt = this, L = null, $n(n.render_effects), $n(n.effects), Kt = null, this.#o?.resolve()), we = null;
216
+ this.is_fork || this.#u(), this.is_deferred() ? (this.#s(n.effects), this.#s(n.render_effects)) : (Yt = this, N = null, tr(n.render_effects), tr(n.effects), Yt = null, this.#o?.resolve()), ge = null;
217
217
  }
218
218
  /**
219
219
  * Traverse the effect tree, executing effects or stashing
@@ -222,16 +222,16 @@ class Mt {
222
222
  * @param {EffectTarget} target
223
223
  */
224
224
  #l(t, n) {
225
- t.f ^= te;
225
+ t.f ^= ne;
226
226
  for (var r = t.first; r !== null; ) {
227
- var o = r.f, i = (o & (Le | mt)) !== 0, l = i && (o & te) !== 0, s = l || (o & ye) !== 0 || this.skipped_effects.has(r);
228
- if ((r.f & jn) !== 0 && r.b?.is_pending() && (n = {
227
+ var o = r.f, i = (o & (Le | yt)) !== 0, l = i && (o & ne) !== 0, s = l || (o & me) !== 0 || this.skipped_effects.has(r);
228
+ if ((r.f & Hn) !== 0 && r.b?.is_pending() && (n = {
229
229
  parent: n,
230
230
  effect: r,
231
231
  effects: [],
232
232
  render_effects: []
233
233
  }), !s && r.fn !== null) {
234
- i ? r.f ^= te : (o & hr) !== 0 ? n.effects.push(r) : _t(r) && ((r.f & Ne) !== 0 && this.#i.add(r), ht(r));
234
+ i ? r.f ^= ne : (o & _r) !== 0 ? n.effects.push(r) : bt(r) && ((r.f & Ne) !== 0 && this.#i.add(r), _t(r));
235
235
  var c = r.first;
236
236
  if (c !== null) {
237
237
  r = c;
@@ -249,7 +249,7 @@ class Mt {
249
249
  */
250
250
  #s(t) {
251
251
  for (const n of t)
252
- (n.f & pe) !== 0 ? this.#i.add(n) : (n.f & ke) !== 0 && this.#a.add(n), this.#c(n.deps), ne(n, te);
252
+ (n.f & pe) !== 0 ? this.#i.add(n) : (n.f & Se) !== 0 && this.#a.add(n), this.#c(n.deps), re(n, ne);
253
253
  }
254
254
  /**
255
255
  * @param {Value[] | null} deps
@@ -257,7 +257,7 @@ class Mt {
257
257
  #c(t) {
258
258
  if (t !== null)
259
259
  for (const n of t)
260
- (n.f & re) === 0 || (n.f & nt) === 0 || (n.f ^= nt, this.#c(
260
+ (n.f & ie) === 0 || (n.f & rt) === 0 || (n.f ^= rt, this.#c(
261
261
  /** @type {Derived} */
262
262
  n.deps
263
263
  ));
@@ -269,17 +269,17 @@ class Mt {
269
269
  * @param {any} value
270
270
  */
271
271
  capture(t, n) {
272
- this.previous.has(t) || this.previous.set(t, n), (t.f & Ke) === 0 && (this.current.set(t, t.v), we?.set(t, t.v));
272
+ this.previous.has(t) || this.previous.set(t, n), (t.f & qe) === 0 && (this.current.set(t, t.v), ge?.set(t, t.v));
273
273
  }
274
274
  activate() {
275
- L = this, this.apply();
275
+ N = this, this.apply();
276
276
  }
277
277
  deactivate() {
278
- L === this && (L = null, we = null);
278
+ N === this && (N = null, ge = null);
279
279
  }
280
280
  flush() {
281
- if (this.activate(), ge.length > 0) {
282
- if (wr(), L !== null && L !== this)
281
+ if (this.activate(), be.length > 0) {
282
+ if (Pr(), N !== null && N !== this)
283
283
  return;
284
284
  } else this.#e === 0 && this.process([]);
285
285
  this.deactivate();
@@ -296,15 +296,15 @@ class Mt {
296
296
  this.#e === 0 && this.#f();
297
297
  }
298
298
  #f() {
299
- if (zt.size > 1) {
299
+ if (Kt.size > 1) {
300
300
  this.previous.clear();
301
- var t = we, n = !0, r = {
301
+ var t = ge, n = !0, r = {
302
302
  parent: null,
303
303
  effect: null,
304
304
  effects: [],
305
305
  render_effects: []
306
306
  };
307
- for (const i of zt) {
307
+ for (const i of Kt) {
308
308
  if (i === this) {
309
309
  n = !1;
310
310
  continue;
@@ -322,23 +322,23 @@ class Mt {
322
322
  continue;
323
323
  const s = [...i.current.keys()].filter((c) => !this.current.has(c));
324
324
  if (s.length > 0) {
325
- var o = ge;
326
- ge = [];
325
+ var o = be;
326
+ be = [];
327
327
  const c = /* @__PURE__ */ new Set(), u = /* @__PURE__ */ new Map();
328
328
  for (const f of l)
329
- Er(f, s, c, u);
330
- if (ge.length > 0) {
331
- L = i, i.apply();
332
- for (const f of ge)
329
+ Sr(f, s, c, u);
330
+ if (be.length > 0) {
331
+ N = i, i.apply();
332
+ for (const f of be)
333
333
  i.#l(f, r);
334
334
  i.deactivate();
335
335
  }
336
- ge = o;
336
+ be = o;
337
337
  }
338
338
  }
339
- L = null, we = t;
339
+ N = null, ge = t;
340
340
  }
341
- this.committed = !0, zt.delete(this);
341
+ this.committed = !0, Kt.delete(this);
342
342
  }
343
343
  /**
344
344
  *
@@ -356,9 +356,9 @@ class Mt {
356
356
  }
357
357
  revive() {
358
358
  for (const t of this.#i)
359
- this.#a.delete(t), ne(t, pe), rt(t);
359
+ this.#a.delete(t), re(t, pe), it(t);
360
360
  for (const t of this.#a)
361
- ne(t, ke), rt(t);
361
+ re(t, Se), it(t);
362
362
  this.flush();
363
363
  }
364
364
  /** @param {() => void} fn */
@@ -370,80 +370,80 @@ class Mt {
370
370
  this.#n.add(t);
371
371
  }
372
372
  settled() {
373
- return (this.#o ??= pr()).promise;
373
+ return (this.#o ??= mr()).promise;
374
374
  }
375
375
  static ensure() {
376
- if (L === null) {
377
- const t = L = new Mt();
378
- zt.add(L), Ct || Mt.enqueue(() => {
379
- L === t && t.flush();
376
+ if (N === null) {
377
+ const t = N = new xt();
378
+ Kt.add(N), It || xt.enqueue(() => {
379
+ N === t && t.flush();
380
380
  });
381
381
  }
382
- return L;
382
+ return N;
383
383
  }
384
384
  /** @param {() => void} task */
385
385
  static enqueue(t) {
386
- Bn(t);
386
+ qn(t);
387
387
  }
388
388
  apply() {
389
389
  }
390
390
  }
391
391
  function Ji(e) {
392
- var t = Ct;
393
- Ct = !0;
392
+ var t = It;
393
+ It = !0;
394
394
  try {
395
395
  for (var n; ; ) {
396
- if (Gi(), ge.length === 0 && (L?.flush(), ge.length === 0))
397
- return on = null, /** @type {T} */
396
+ if (Gi(), be.length === 0 && (N?.flush(), be.length === 0))
397
+ return ln = null, /** @type {T} */
398
398
  n;
399
- wr();
399
+ Pr();
400
400
  }
401
401
  } finally {
402
- Ct = t;
402
+ It = t;
403
403
  }
404
404
  }
405
- function wr() {
406
- var e = Xe;
407
- Tn = !0;
405
+ function Pr() {
406
+ var e = $e;
407
+ Nn = !0;
408
408
  var t = null;
409
409
  try {
410
410
  var n = 0;
411
- for (Jt(!0); ge.length > 0; ) {
412
- var r = Mt.ensure();
411
+ for (Xt(!0); be.length > 0; ) {
412
+ var r = xt.ensure();
413
413
  if (n++ > 1e3) {
414
414
  var o, i;
415
415
  Zi();
416
416
  }
417
- r.process(ge), qe.clear();
417
+ r.process(be), Ve.clear();
418
418
  }
419
419
  } finally {
420
- Tn = !1, Jt(e), on = null;
420
+ Nn = !1, Xt(e), ln = null;
421
421
  }
422
422
  }
423
423
  function Zi() {
424
424
  try {
425
425
  Hi();
426
426
  } catch (e) {
427
- Vt(e, on);
427
+ Wt(e, ln);
428
428
  }
429
429
  }
430
430
  let Me = null;
431
- function $n(e) {
431
+ function tr(e) {
432
432
  var t = e.length;
433
433
  if (t !== 0) {
434
434
  for (var n = 0; n < t; ) {
435
435
  var r = e[n++];
436
- if ((r.f & (Re | ye)) === 0 && _t(r) && (Me = /* @__PURE__ */ new Set(), ht(r), r.deps === null && r.first === null && r.nodes === null && (r.teardown === null && r.ac === null ? Lr(r) : r.fn = null), Me?.size > 0)) {
437
- qe.clear();
436
+ if ((r.f & (Re | me)) === 0 && bt(r) && (Me = /* @__PURE__ */ new Set(), _t(r), r.deps === null && r.first === null && r.nodes === null && (r.teardown === null && r.ac === null ? Fr(r) : r.fn = null), Me?.size > 0)) {
437
+ Ve.clear();
438
438
  for (const o of Me) {
439
- if ((o.f & (Re | ye)) !== 0) continue;
439
+ if ((o.f & (Re | me)) !== 0) continue;
440
440
  const i = [o];
441
441
  let l = o.parent;
442
442
  for (; l !== null; )
443
443
  Me.has(l) && (Me.delete(l), i.push(l)), l = l.parent;
444
444
  for (let s = i.length - 1; s >= 0; s--) {
445
445
  const c = i[s];
446
- (c.f & (Re | ye)) === 0 && ht(c);
446
+ (c.f & (Re | me)) === 0 && _t(c);
447
447
  }
448
448
  }
449
449
  Me.clear();
@@ -452,30 +452,30 @@ function $n(e) {
452
452
  Me = null;
453
453
  }
454
454
  }
455
- function Er(e, t, n, r) {
455
+ function Sr(e, t, n, r) {
456
456
  if (!n.has(e) && (n.add(e), e.reactions !== null))
457
457
  for (const o of e.reactions) {
458
458
  const i = o.f;
459
- (i & re) !== 0 ? Er(
459
+ (i & ie) !== 0 ? Sr(
460
460
  /** @type {Derived} */
461
461
  o,
462
462
  t,
463
463
  n,
464
464
  r
465
- ) : (i & (Hn | Ne)) !== 0 && (i & pe) === 0 && Pr(o, t, r) && (ne(o, pe), rt(
465
+ ) : (i & (Kn | Ne)) !== 0 && (i & pe) === 0 && kr(o, t, r) && (re(o, pe), it(
466
466
  /** @type {Effect} */
467
467
  o
468
468
  ));
469
469
  }
470
470
  }
471
- function Pr(e, t, n) {
471
+ function kr(e, t, n) {
472
472
  const r = n.get(e);
473
473
  if (r !== void 0) return r;
474
474
  if (e.deps !== null)
475
475
  for (const o of e.deps) {
476
476
  if (t.includes(o))
477
477
  return !0;
478
- if ((o.f & re) !== 0 && Pr(
478
+ if ((o.f & ie) !== 0 && kr(
479
479
  /** @type {Derived} */
480
480
  o,
481
481
  t,
@@ -489,28 +489,28 @@ function Pr(e, t, n) {
489
489
  }
490
490
  return n.set(e, !1), !1;
491
491
  }
492
- function rt(e) {
493
- for (var t = on = e; t.parent !== null; ) {
492
+ function it(e) {
493
+ for (var t = ln = e; t.parent !== null; ) {
494
494
  t = t.parent;
495
495
  var n = t.f;
496
- if (Tn && t === z && (n & Ne) !== 0 && (n & mr) === 0)
496
+ if (Nn && t === j && (n & Ne) !== 0 && (n & yr) === 0)
497
497
  return;
498
- if ((n & (mt | Le)) !== 0) {
499
- if ((n & te) === 0) return;
500
- t.f ^= te;
498
+ if ((n & (yt | Le)) !== 0) {
499
+ if ((n & ne) === 0) return;
500
+ t.f ^= ne;
501
501
  }
502
502
  }
503
- ge.push(t);
503
+ be.push(t);
504
504
  }
505
505
  function Qi(e, t, n, r) {
506
- const o = Ot() ? an : xt;
506
+ const o = Ft() ? cn : Rt;
507
507
  if (n.length === 0 && e.length === 0) {
508
508
  r(t.map(o));
509
509
  return;
510
510
  }
511
- var i = L, l = (
511
+ var i = N, l = (
512
512
  /** @type {Effect} */
513
- z
513
+ j
514
514
  ), s = Xi();
515
515
  function c() {
516
516
  Promise.all(n.map((u) => /* @__PURE__ */ $i(u))).then((u) => {
@@ -518,11 +518,11 @@ function Qi(e, t, n, r) {
518
518
  try {
519
519
  r([...t.map(o), ...u]);
520
520
  } catch (f) {
521
- (l.f & Re) === 0 && Vt(f, l);
521
+ (l.f & Re) === 0 && Wt(f, l);
522
522
  }
523
- i?.deactivate(), Yt();
523
+ i?.deactivate(), Jt();
524
524
  }).catch((u) => {
525
- Vt(u, l);
525
+ Wt(u, l);
526
526
  });
527
527
  }
528
528
  e.length > 0 ? Promise.all(e).then(() => {
@@ -530,40 +530,40 @@ function Qi(e, t, n, r) {
530
530
  try {
531
531
  return c();
532
532
  } finally {
533
- i?.deactivate(), Yt();
533
+ i?.deactivate(), Jt();
534
534
  }
535
535
  }) : c();
536
536
  }
537
537
  function Xi() {
538
- var e = z, t = N, n = $, r = L;
538
+ var e = j, t = A, n = ee, r = N;
539
539
  return function(i = !0) {
540
- Ve(e), Ie(t), qt(n), i && r?.activate();
540
+ Ye(e), Ce(t), Gt(n), i && r?.activate();
541
541
  };
542
542
  }
543
- function Yt() {
544
- Ve(null), Ie(null), qt(null);
543
+ function Jt() {
544
+ Ye(null), Ce(null), Gt(null);
545
545
  }
546
546
  // @__NO_SIDE_EFFECTS__
547
- function an(e) {
548
- var t = re | pe, n = N !== null && (N.f & re) !== 0 ? (
547
+ function cn(e) {
548
+ var t = ie | pe, n = A !== null && (A.f & ie) !== 0 ? (
549
549
  /** @type {Derived} */
550
- N
550
+ A
551
551
  ) : null;
552
- return z !== null && (z.f |= tn), {
553
- ctx: $,
552
+ return j !== null && (j.f |= on), {
553
+ ctx: ee,
554
554
  deps: null,
555
555
  effects: null,
556
- equals: yr,
556
+ equals: gr,
557
557
  f: t,
558
558
  fn: e,
559
559
  reactions: null,
560
560
  rv: 0,
561
561
  v: (
562
562
  /** @type {V} */
563
- oe
563
+ ae
564
564
  ),
565
565
  wv: 0,
566
- parent: n ?? z,
566
+ parent: n ?? j,
567
567
  ac: null
568
568
  };
569
569
  }
@@ -571,7 +571,7 @@ function an(e) {
571
571
  function $i(e, t) {
572
572
  let n = (
573
573
  /** @type {Effect | null} */
574
- z
574
+ j
575
575
  );
576
576
  n === null && Di();
577
577
  var r = (
@@ -581,60 +581,60 @@ function $i(e, t) {
581
581
  /** @type {Promise<V>} */
582
582
  /** @type {unknown} */
583
583
  void 0
584
- ), i = Rt(
584
+ ), i = Tt(
585
585
  /** @type {V} */
586
- oe
587
- ), l = !N, s = /* @__PURE__ */ new Map();
586
+ ae
587
+ ), l = !A, s = /* @__PURE__ */ new Map();
588
588
  return uo(() => {
589
- var c = pr();
589
+ var c = mr();
590
590
  o = c.promise;
591
591
  try {
592
592
  Promise.resolve(e()).then(c.resolve, c.reject).then(() => {
593
- u === L && u.committed && u.deactivate(), Yt();
593
+ u === N && u.committed && u.deactivate(), Jt();
594
594
  });
595
- } catch (v) {
596
- c.reject(v), Yt();
595
+ } catch (d) {
596
+ c.reject(d), Jt();
597
597
  }
598
598
  var u = (
599
599
  /** @type {Batch} */
600
- L
600
+ N
601
601
  );
602
602
  if (l) {
603
603
  var f = !r.is_pending();
604
- r.update_pending_count(1), u.increment(f), s.get(u)?.reject(dt), s.delete(u), s.set(u, c);
604
+ r.update_pending_count(1), u.increment(f), s.get(u)?.reject(pt), s.delete(u), s.set(u, c);
605
605
  }
606
- const d = (v, m = void 0) => {
606
+ const h = (d, m = void 0) => {
607
607
  if (u.activate(), m)
608
- m !== dt && (i.f |= Ke, Tt(i, m));
608
+ m !== pt && (i.f |= qe, At(i, m));
609
609
  else {
610
- (i.f & Ke) !== 0 && (i.f ^= Ke), Tt(i, v);
611
- for (const [_, h] of s) {
610
+ (i.f & qe) !== 0 && (i.f ^= qe), At(i, d);
611
+ for (const [_, p] of s) {
612
612
  if (s.delete(_), _ === u) break;
613
- h.reject(dt);
613
+ p.reject(pt);
614
614
  }
615
615
  }
616
616
  l && (r.update_pending_count(-1), u.decrement(f));
617
617
  };
618
- c.promise.then(d, (v) => d(null, v || "unknown"));
619
- }), qn(() => {
618
+ c.promise.then(h, (d) => h(null, d || "unknown"));
619
+ }), Yn(() => {
620
620
  for (const c of s.values())
621
- c.reject(dt);
621
+ c.reject(pt);
622
622
  }), new Promise((c) => {
623
623
  function u(f) {
624
- function d() {
624
+ function h() {
625
625
  f === o ? c(i) : u(o);
626
626
  }
627
- f.then(d, d);
627
+ f.then(h, h);
628
628
  }
629
629
  u(o);
630
630
  });
631
631
  }
632
632
  // @__NO_SIDE_EFFECTS__
633
- function xt(e) {
634
- const t = /* @__PURE__ */ an(e);
635
- return t.equals = br, t;
633
+ function Rt(e) {
634
+ const t = /* @__PURE__ */ cn(e);
635
+ return t.equals = wr, t;
636
636
  }
637
- function Sr(e) {
637
+ function Cr(e) {
638
638
  var t = e.effects;
639
639
  if (t !== null) {
640
640
  e.effects = null;
@@ -647,7 +647,7 @@ function Sr(e) {
647
647
  }
648
648
  function eo(e) {
649
649
  for (var t = e.parent; t !== null; ) {
650
- if ((t.f & re) === 0)
650
+ if ((t.f & ie) === 0)
651
651
  return (t.f & Re) === 0 ? (
652
652
  /** @type {Effect} */
653
653
  t
@@ -656,124 +656,124 @@ function eo(e) {
656
656
  }
657
657
  return null;
658
658
  }
659
- function Kn(e) {
660
- var t, n = z;
661
- Ve(eo(e));
659
+ function Vn(e) {
660
+ var t, n = j;
661
+ Ye(eo(e));
662
662
  try {
663
- e.f &= ~nt, Sr(e), t = zr(e);
663
+ e.f &= ~rt, Cr(e), t = Br(e);
664
664
  } finally {
665
- Ve(n);
665
+ Ye(n);
666
666
  }
667
667
  return t;
668
668
  }
669
- function kr(e) {
670
- var t = Kn(e);
671
- if (e.equals(t) || (L?.is_fork || (e.v = t), e.wv = Ur()), !it)
672
- if (we !== null)
673
- (Wt() || L?.is_fork) && we.set(e, t);
669
+ function Ir(e) {
670
+ var t = Vn(e);
671
+ if (e.equals(t) || (N?.is_fork || (e.v = t), e.wv = zr()), !ot)
672
+ if (ge !== null)
673
+ (Qt() || N?.is_fork) && ge.set(e, t);
674
674
  else {
675
- var n = (e.f & Se) === 0 ? ke : te;
676
- ne(e, n);
675
+ var n = (e.f & Pe) === 0 ? Se : ne;
676
+ re(e, n);
677
677
  }
678
678
  }
679
- let An = /* @__PURE__ */ new Set();
680
- const qe = /* @__PURE__ */ new Map();
681
- let Cr = !1;
682
- function Rt(e, t) {
679
+ let Ln = /* @__PURE__ */ new Set();
680
+ const Ve = /* @__PURE__ */ new Map();
681
+ let Mr = !1;
682
+ function Tt(e, t) {
683
683
  var n = {
684
684
  f: 0,
685
685
  // TODO ideally we could skip this altogether, but it causes type errors
686
686
  v: e,
687
687
  reactions: null,
688
- equals: yr,
688
+ equals: gr,
689
689
  rv: 0,
690
690
  wv: 0
691
691
  };
692
692
  return n;
693
693
  }
694
694
  // @__NO_SIDE_EFFECTS__
695
- function ze(e, t) {
696
- const n = Rt(e);
695
+ function He(e, t) {
696
+ const n = Tt(e);
697
697
  return ho(n), n;
698
698
  }
699
699
  // @__NO_SIDE_EFFECTS__
700
- function X(e, t = !1, n = !0) {
701
- const r = Rt(e);
702
- return t || (r.equals = br), Lt && n && $ !== null && $.l !== null && ($.l.s ??= []).push(r), r;
700
+ function $(e, t = !1, n = !0) {
701
+ const r = Tt(e);
702
+ return t || (r.equals = wr), Ot && n && ee !== null && ee.l !== null && (ee.l.s ??= []).push(r), r;
703
703
  }
704
- function A(e, t, n = !1) {
705
- N !== null && // since we are untracking the function inside `$inspect.with` we need to add this check
704
+ function T(e, t, n = !1) {
705
+ A !== null && // since we are untracking the function inside `$inspect.with` we need to add this check
706
706
  // to ensure we error if state is set inside an inspect effect
707
- (!Ce || (N.f & Xn) !== 0) && Ot() && (N.f & (re | Ne | Hn | Xn)) !== 0 && !Ae?.includes(e) && Vi();
708
- let r = n ? vt(t) : t;
709
- return Tt(e, r);
707
+ (!ke || (A.f & er) !== 0) && Ft() && (A.f & (ie | Ne | Kn | er)) !== 0 && !Ae?.includes(e) && Vi();
708
+ let r = n ? ht(t) : t;
709
+ return At(e, r);
710
710
  }
711
- function Tt(e, t) {
711
+ function At(e, t) {
712
712
  if (!e.equals(t)) {
713
713
  var n = e.v;
714
- it ? qe.set(e, t) : qe.set(e, n), e.v = t;
715
- var r = Mt.ensure();
716
- r.capture(e, n), (e.f & re) !== 0 && ((e.f & pe) !== 0 && Kn(
714
+ ot ? Ve.set(e, t) : Ve.set(e, n), e.v = t;
715
+ var r = xt.ensure();
716
+ r.capture(e, n), (e.f & ie) !== 0 && ((e.f & pe) !== 0 && Vn(
717
717
  /** @type {Derived} */
718
718
  e
719
- ), ne(e, (e.f & Se) !== 0 ? te : ke)), e.wv = Ur(), Ir(e, pe), Ot() && z !== null && (z.f & te) !== 0 && (z.f & (Le | mt)) === 0 && (be === null ? mo([e]) : be.push(e)), !r.is_fork && An.size > 0 && !Cr && to();
719
+ ), re(e, (e.f & Pe) !== 0 ? ne : Se)), e.wv = zr(), xr(e, pe), Ft() && j !== null && (j.f & ne) !== 0 && (j.f & (Le | yt)) === 0 && (ye === null ? mo([e]) : ye.push(e)), !r.is_fork && Ln.size > 0 && !Mr && to();
720
720
  }
721
721
  return t;
722
722
  }
723
723
  function to() {
724
- Cr = !1;
725
- var e = Xe;
726
- Jt(!0);
727
- const t = Array.from(An);
724
+ Mr = !1;
725
+ var e = $e;
726
+ Xt(!0);
727
+ const t = Array.from(Ln);
728
728
  try {
729
729
  for (const n of t)
730
- (n.f & te) !== 0 && ne(n, ke), _t(n) && ht(n);
730
+ (n.f & ne) !== 0 && re(n, Se), bt(n) && _t(n);
731
731
  } finally {
732
- Jt(e);
732
+ Xt(e);
733
733
  }
734
- An.clear();
734
+ Ln.clear();
735
735
  }
736
- function Sn(e) {
737
- A(e, e.v + 1);
736
+ function Cn(e) {
737
+ T(e, e.v + 1);
738
738
  }
739
- function Ir(e, t) {
739
+ function xr(e, t) {
740
740
  var n = e.reactions;
741
741
  if (n !== null)
742
- for (var r = Ot(), o = n.length, i = 0; i < o; i++) {
742
+ for (var r = Ft(), o = n.length, i = 0; i < o; i++) {
743
743
  var l = n[i], s = l.f;
744
- if (!(!r && l === z)) {
744
+ if (!(!r && l === j)) {
745
745
  var c = (s & pe) === 0;
746
- if (c && ne(l, t), (s & re) !== 0) {
746
+ if (c && re(l, t), (s & ie) !== 0) {
747
747
  var u = (
748
748
  /** @type {Derived} */
749
749
  l
750
750
  );
751
- we?.delete(u), (s & nt) === 0 && (s & Se && (l.f |= nt), Ir(u, ke));
751
+ ge?.delete(u), (s & rt) === 0 && (s & Pe && (l.f |= rt), xr(u, Se));
752
752
  } else c && ((s & Ne) !== 0 && Me !== null && Me.add(
753
753
  /** @type {Effect} */
754
754
  l
755
- ), rt(
755
+ ), it(
756
756
  /** @type {Effect} */
757
757
  l
758
758
  ));
759
759
  }
760
760
  }
761
761
  }
762
- function vt(e) {
763
- if (typeof e != "object" || e === null || pt in e)
762
+ function ht(e) {
763
+ if (typeof e != "object" || e === null || mt in e)
764
764
  return e;
765
- const t = Un(e);
765
+ const t = zn(e);
766
766
  if (t !== Ti && t !== Ai)
767
767
  return e;
768
- var n = /* @__PURE__ */ new Map(), r = fr(e), o = /* @__PURE__ */ ze(0), i = $e, l = (s) => {
769
- if ($e === i)
768
+ var n = /* @__PURE__ */ new Map(), r = vr(e), o = /* @__PURE__ */ He(0), i = et, l = (s) => {
769
+ if (et === i)
770
770
  return s();
771
- var c = N, u = $e;
772
- Ie(null), rr(i);
771
+ var c = A, u = et;
772
+ Ce(null), or(i);
773
773
  var f = s();
774
- return Ie(c), rr(u), f;
774
+ return Ce(c), or(u), f;
775
775
  };
776
- return r && n.set("length", /* @__PURE__ */ ze(
776
+ return r && n.set("length", /* @__PURE__ */ He(
777
777
  /** @type {any[]} */
778
778
  e.length
779
779
  )), new Proxy(
@@ -784,31 +784,31 @@ function vt(e) {
784
784
  (!("value" in u) || u.configurable === !1 || u.enumerable === !1 || u.writable === !1) && Ki();
785
785
  var f = n.get(c);
786
786
  return f === void 0 ? f = l(() => {
787
- var d = /* @__PURE__ */ ze(u.value);
788
- return n.set(c, d), d;
789
- }) : A(f, u.value, !0), !0;
787
+ var h = /* @__PURE__ */ He(u.value);
788
+ return n.set(c, h), h;
789
+ }) : T(f, u.value, !0), !0;
790
790
  },
791
791
  deleteProperty(s, c) {
792
792
  var u = n.get(c);
793
793
  if (u === void 0) {
794
794
  if (c in s) {
795
- const f = l(() => /* @__PURE__ */ ze(oe));
796
- n.set(c, f), Sn(o);
795
+ const f = l(() => /* @__PURE__ */ He(ae));
796
+ n.set(c, f), Cn(o);
797
797
  }
798
798
  } else
799
- A(u, oe), Sn(o);
799
+ T(u, ae), Cn(o);
800
800
  return !0;
801
801
  },
802
802
  get(s, c, u) {
803
- if (c === pt)
803
+ if (c === mt)
804
804
  return e;
805
- var f = n.get(c), d = c in s;
806
- if (f === void 0 && (!d || Bt(s, c)?.writable) && (f = l(() => {
807
- var m = vt(d ? s[c] : oe), _ = /* @__PURE__ */ ze(m);
805
+ var f = n.get(c), h = c in s;
806
+ if (f === void 0 && (!h || Vt(s, c)?.writable) && (f = l(() => {
807
+ var m = ht(h ? s[c] : ae), _ = /* @__PURE__ */ He(m);
808
808
  return _;
809
809
  }), n.set(c, f)), f !== void 0) {
810
- var v = a(f);
811
- return v === oe ? void 0 : v;
810
+ var d = a(f);
811
+ return d === ae ? void 0 : d;
812
812
  }
813
813
  return Reflect.get(s, c, u);
814
814
  },
@@ -818,68 +818,68 @@ function vt(e) {
818
818
  var f = n.get(c);
819
819
  f && (u.value = a(f));
820
820
  } else if (u === void 0) {
821
- var d = n.get(c), v = d?.v;
822
- if (d !== void 0 && v !== oe)
821
+ var h = n.get(c), d = h?.v;
822
+ if (h !== void 0 && d !== ae)
823
823
  return {
824
824
  enumerable: !0,
825
825
  configurable: !0,
826
- value: v,
826
+ value: d,
827
827
  writable: !0
828
828
  };
829
829
  }
830
830
  return u;
831
831
  },
832
832
  has(s, c) {
833
- if (c === pt)
833
+ if (c === mt)
834
834
  return !0;
835
- var u = n.get(c), f = u !== void 0 && u.v !== oe || Reflect.has(s, c);
836
- if (u !== void 0 || z !== null && (!f || Bt(s, c)?.writable)) {
835
+ var u = n.get(c), f = u !== void 0 && u.v !== ae || Reflect.has(s, c);
836
+ if (u !== void 0 || j !== null && (!f || Vt(s, c)?.writable)) {
837
837
  u === void 0 && (u = l(() => {
838
- var v = f ? vt(s[c]) : oe, m = /* @__PURE__ */ ze(v);
838
+ var d = f ? ht(s[c]) : ae, m = /* @__PURE__ */ He(d);
839
839
  return m;
840
840
  }), n.set(c, u));
841
- var d = a(u);
842
- if (d === oe)
841
+ var h = a(u);
842
+ if (h === ae)
843
843
  return !1;
844
844
  }
845
845
  return f;
846
846
  },
847
847
  set(s, c, u, f) {
848
- var d = n.get(c), v = c in s;
848
+ var h = n.get(c), d = c in s;
849
849
  if (r && c === "length")
850
850
  for (var m = u; m < /** @type {Source<number>} */
851
- d.v; m += 1) {
851
+ h.v; m += 1) {
852
852
  var _ = n.get(m + "");
853
- _ !== void 0 ? A(_, oe) : m in s && (_ = l(() => /* @__PURE__ */ ze(oe)), n.set(m + "", _));
853
+ _ !== void 0 ? T(_, ae) : m in s && (_ = l(() => /* @__PURE__ */ He(ae)), n.set(m + "", _));
854
854
  }
855
- if (d === void 0)
856
- (!v || Bt(s, c)?.writable) && (d = l(() => /* @__PURE__ */ ze(void 0)), A(d, vt(u)), n.set(c, d));
855
+ if (h === void 0)
856
+ (!d || Vt(s, c)?.writable) && (h = l(() => /* @__PURE__ */ He(void 0)), T(h, ht(u)), n.set(c, h));
857
857
  else {
858
- v = d.v !== oe;
859
- var h = l(() => vt(u));
860
- A(d, h);
858
+ d = h.v !== ae;
859
+ var p = l(() => ht(u));
860
+ T(h, p);
861
861
  }
862
- var p = Reflect.getOwnPropertyDescriptor(s, c);
863
- if (p?.set && p.set.call(f, u), !v) {
862
+ var v = Reflect.getOwnPropertyDescriptor(s, c);
863
+ if (v?.set && v.set.call(f, u), !d) {
864
864
  if (r && typeof c == "string") {
865
865
  var y = (
866
866
  /** @type {Source<number>} */
867
867
  n.get("length")
868
- ), q = Number(c);
869
- Number.isInteger(q) && q >= y.v && A(y, q + 1);
868
+ ), B = Number(c);
869
+ Number.isInteger(B) && B >= y.v && T(y, B + 1);
870
870
  }
871
- Sn(o);
871
+ Cn(o);
872
872
  }
873
873
  return !0;
874
874
  },
875
875
  ownKeys(s) {
876
876
  a(o);
877
- var c = Reflect.ownKeys(s).filter((d) => {
878
- var v = n.get(d);
879
- return v === void 0 || v.v !== oe;
877
+ var c = Reflect.ownKeys(s).filter((h) => {
878
+ var d = n.get(h);
879
+ return d === void 0 || d.v !== ae;
880
880
  });
881
881
  for (var [u, f] of n)
882
- f.v !== oe && !(u in s) && c.push(u);
882
+ f.v !== ae && !(u in s) && c.push(u);
883
883
  return c;
884
884
  },
885
885
  setPrototypeOf() {
@@ -889,48 +889,48 @@ function vt(e) {
889
889
  );
890
890
  }
891
891
  var no, ro, io;
892
- function Qe(e = "") {
892
+ function Xe(e = "") {
893
893
  return document.createTextNode(e);
894
894
  }
895
895
  // @__NO_SIDE_EFFECTS__
896
- function Gt(e) {
896
+ function Zt(e) {
897
897
  return (
898
898
  /** @type {TemplateNode | null} */
899
899
  ro.call(e)
900
900
  );
901
901
  }
902
902
  // @__NO_SIDE_EFFECTS__
903
- function Ft(e) {
903
+ function Dt(e) {
904
904
  return (
905
905
  /** @type {TemplateNode | null} */
906
906
  io.call(e)
907
907
  );
908
908
  }
909
909
  function E(e, t) {
910
- return /* @__PURE__ */ Gt(e);
910
+ return /* @__PURE__ */ Zt(e);
911
911
  }
912
- function Be(e, t = !1) {
912
+ function Ke(e, t = !1) {
913
913
  {
914
- var n = /* @__PURE__ */ Gt(e);
915
- return n instanceof Comment && n.data === "" ? /* @__PURE__ */ Ft(n) : n;
914
+ var n = /* @__PURE__ */ Zt(e);
915
+ return n instanceof Comment && n.data === "" ? /* @__PURE__ */ Dt(n) : n;
916
916
  }
917
917
  }
918
- function j(e, t = 1, n = !1) {
918
+ function U(e, t = 1, n = !1) {
919
919
  let r = e;
920
920
  for (; t--; )
921
921
  r = /** @type {TemplateNode} */
922
- /* @__PURE__ */ Ft(r);
922
+ /* @__PURE__ */ Dt(r);
923
923
  return r;
924
924
  }
925
925
  function oo(e) {
926
926
  e.textContent = "";
927
927
  }
928
- function Mr() {
928
+ function Rr() {
929
929
  return !1;
930
930
  }
931
- let er = !1;
931
+ let nr = !1;
932
932
  function ao() {
933
- er || (er = !0, document.addEventListener(
933
+ nr || (nr = !0, document.addEventListener(
934
934
  "reset",
935
935
  (e) => {
936
936
  Promise.resolve().then(() => {
@@ -947,37 +947,37 @@ function ao() {
947
947
  { capture: !0 }
948
948
  ));
949
949
  }
950
- function sn(e) {
951
- var t = N, n = z;
952
- Ie(null), Ve(null);
950
+ function un(e) {
951
+ var t = A, n = j;
952
+ Ce(null), Ye(null);
953
953
  try {
954
954
  return e();
955
955
  } finally {
956
- Ie(t), Ve(n);
956
+ Ce(t), Ye(n);
957
957
  }
958
958
  }
959
959
  function so(e, t, n, r = n) {
960
- e.addEventListener(t, () => sn(n));
960
+ e.addEventListener(t, () => un(n));
961
961
  const o = e.__on_r;
962
962
  o ? e.__on_r = () => {
963
963
  o(), r(!0);
964
964
  } : e.__on_r = () => r(!0), ao();
965
965
  }
966
- function xr(e) {
967
- z === null && (N === null && zi(), ji()), it && Ui();
966
+ function Tr(e) {
967
+ j === null && (A === null && zi(), ji()), ot && Ui();
968
968
  }
969
969
  function lo(e, t) {
970
970
  var n = t.last;
971
971
  n === null ? t.last = t.first = e : (n.next = e, e.prev = n, t.last = e);
972
972
  }
973
- function Ye(e, t, n) {
974
- var r = z;
975
- r !== null && (r.f & ye) !== 0 && (e |= ye);
973
+ function Ge(e, t, n) {
974
+ var r = j;
975
+ r !== null && (r.f & me) !== 0 && (e |= me);
976
976
  var o = {
977
- ctx: $,
977
+ ctx: ee,
978
978
  deps: null,
979
979
  nodes: null,
980
- f: e | pe | Se,
980
+ f: e | pe | Pe,
981
981
  first: null,
982
982
  fn: t,
983
983
  last: null,
@@ -991,111 +991,111 @@ function Ye(e, t, n) {
991
991
  };
992
992
  if (n)
993
993
  try {
994
- ht(o), o.f |= zn;
994
+ _t(o), o.f |= Bn;
995
995
  } catch (s) {
996
996
  throw Te(o), s;
997
997
  }
998
- else t !== null && rt(o);
998
+ else t !== null && it(o);
999
999
  var i = o;
1000
1000
  if (n && i.deps === null && i.teardown === null && i.nodes === null && i.first === i.last && // either `null`, or a singular child
1001
- (i.f & tn) === 0 && (i = i.first, (e & Ne) !== 0 && (e & It) !== 0 && i !== null && (i.f |= It)), i !== null && (i.parent = r, r !== null && lo(i, r), N !== null && (N.f & re) !== 0 && (e & mt) === 0)) {
1001
+ (i.f & on) === 0 && (i = i.first, (e & Ne) !== 0 && (e & Mt) !== 0 && i !== null && (i.f |= Mt)), i !== null && (i.parent = r, r !== null && lo(i, r), A !== null && (A.f & ie) !== 0 && (e & yt) === 0)) {
1002
1002
  var l = (
1003
1003
  /** @type {Derived} */
1004
- N
1004
+ A
1005
1005
  );
1006
1006
  (l.effects ??= []).push(i);
1007
1007
  }
1008
1008
  return o;
1009
1009
  }
1010
- function Wt() {
1011
- return N !== null && !Ce;
1010
+ function Qt() {
1011
+ return A !== null && !ke;
1012
1012
  }
1013
- function qn(e) {
1014
- const t = Ye(en, null, !1);
1015
- return ne(t, te), t.teardown = e, t;
1013
+ function Yn(e) {
1014
+ const t = Ge(rn, null, !1);
1015
+ return re(t, ne), t.teardown = e, t;
1016
1016
  }
1017
- function tr(e) {
1018
- xr();
1017
+ function rr(e) {
1018
+ Tr();
1019
1019
  var t = (
1020
1020
  /** @type {Effect} */
1021
- z.f
1022
- ), n = !N && (t & Le) !== 0 && (t & zn) === 0;
1021
+ j.f
1022
+ ), n = !A && (t & Le) !== 0 && (t & Bn) === 0;
1023
1023
  if (n) {
1024
1024
  var r = (
1025
1025
  /** @type {ComponentContext} */
1026
- $
1026
+ ee
1027
1027
  );
1028
1028
  (r.e ??= []).push(e);
1029
1029
  } else
1030
- return Rr(e);
1030
+ return Ar(e);
1031
1031
  }
1032
- function Rr(e) {
1033
- return Ye(hr | _r, e, !1);
1032
+ function Ar(e) {
1033
+ return Ge(_r | br, e, !1);
1034
1034
  }
1035
1035
  function co(e) {
1036
- return xr(), Ye(en | _r, e, !0);
1036
+ return Tr(), Ge(rn | br, e, !0);
1037
1037
  }
1038
- function ee(e, t) {
1038
+ function te(e, t) {
1039
1039
  var n = (
1040
1040
  /** @type {ComponentContextLegacy} */
1041
- $
1041
+ ee
1042
1042
  ), r = { effect: null, ran: !1, deps: e };
1043
- n.l.$.push(r), r.effect = Yn(() => {
1043
+ n.l.$.push(r), r.effect = Wn(() => {
1044
1044
  e(), !r.ran && (r.ran = !0, w(t));
1045
1045
  });
1046
1046
  }
1047
- function Vn() {
1047
+ function Gn() {
1048
1048
  var e = (
1049
1049
  /** @type {ComponentContextLegacy} */
1050
- $
1050
+ ee
1051
1051
  );
1052
- Yn(() => {
1052
+ Wn(() => {
1053
1053
  for (var t of e.l.$) {
1054
1054
  t.deps();
1055
1055
  var n = t.effect;
1056
- (n.f & te) !== 0 && ne(n, ke), _t(n) && ht(n), t.ran = !1;
1056
+ (n.f & ne) !== 0 && re(n, Se), bt(n) && _t(n), t.ran = !1;
1057
1057
  }
1058
1058
  });
1059
1059
  }
1060
1060
  function uo(e) {
1061
- return Ye(Hn | tn, e, !0);
1061
+ return Ge(Kn | on, e, !0);
1062
1062
  }
1063
- function Yn(e, t = 0) {
1064
- return Ye(en | t, e, !0);
1063
+ function Wn(e, t = 0) {
1064
+ return Ge(rn | t, e, !0);
1065
1065
  }
1066
- function Z(e, t = [], n = [], r = []) {
1066
+ function Q(e, t = [], n = [], r = []) {
1067
1067
  Qi(r, t, n, (o) => {
1068
- Ye(en, () => e(...o.map(a)), !0);
1068
+ Ge(rn, () => e(...o.map(a)), !0);
1069
1069
  });
1070
1070
  }
1071
- function Tr(e, t = 0) {
1072
- var n = Ye(Ne | t, e, !0);
1071
+ function Nr(e, t = 0) {
1072
+ var n = Ge(Ne | t, e, !0);
1073
1073
  return n;
1074
1074
  }
1075
- function At(e) {
1076
- return Ye(Le | tn, e, !0);
1075
+ function Nt(e) {
1076
+ return Ge(Le | on, e, !0);
1077
1077
  }
1078
- function Ar(e) {
1078
+ function Lr(e) {
1079
1079
  var t = e.teardown;
1080
1080
  if (t !== null) {
1081
- const n = it, r = N;
1082
- nr(!0), Ie(null);
1081
+ const n = ot, r = A;
1082
+ ir(!0), Ce(null);
1083
1083
  try {
1084
1084
  t.call(null);
1085
1085
  } finally {
1086
- nr(n), Ie(r);
1086
+ ir(n), Ce(r);
1087
1087
  }
1088
1088
  }
1089
1089
  }
1090
- function Nr(e, t = !1) {
1090
+ function Or(e, t = !1) {
1091
1091
  var n = e.first;
1092
1092
  for (e.first = e.last = null; n !== null; ) {
1093
1093
  const o = n.ac;
1094
- o !== null && sn(() => {
1095
- o.abort(dt);
1094
+ o !== null && un(() => {
1095
+ o.abort(pt);
1096
1096
  });
1097
1097
  var r = n.next;
1098
- (n.f & mt) !== 0 ? n.parent = null : Te(n, t), n = r;
1098
+ (n.f & yt) !== 0 ? n.parent = null : Te(n, t), n = r;
1099
1099
  }
1100
1100
  }
1101
1101
  function fo(e) {
@@ -1106,32 +1106,32 @@ function fo(e) {
1106
1106
  }
1107
1107
  function Te(e, t = !0) {
1108
1108
  var n = !1;
1109
- (t || (e.f & mr) !== 0) && e.nodes !== null && e.nodes.end !== null && (vo(
1109
+ (t || (e.f & yr) !== 0) && e.nodes !== null && e.nodes.end !== null && (vo(
1110
1110
  e.nodes.start,
1111
1111
  /** @type {TemplateNode} */
1112
1112
  e.nodes.end
1113
- ), n = !0), Nr(e, t && !n), Zt(e, 0), ne(e, Re);
1113
+ ), n = !0), Or(e, t && !n), $t(e, 0), re(e, Re);
1114
1114
  var r = e.nodes && e.nodes.t;
1115
1115
  if (r !== null)
1116
1116
  for (const i of r)
1117
1117
  i.stop();
1118
- Ar(e);
1118
+ Lr(e);
1119
1119
  var o = e.parent;
1120
- o !== null && o.first !== null && Lr(e), e.next = e.prev = e.teardown = e.ctx = e.deps = e.fn = e.nodes = e.ac = null;
1120
+ o !== null && o.first !== null && Fr(e), e.next = e.prev = e.teardown = e.ctx = e.deps = e.fn = e.nodes = e.ac = null;
1121
1121
  }
1122
1122
  function vo(e, t) {
1123
1123
  for (; e !== null; ) {
1124
- var n = e === t ? null : /* @__PURE__ */ Ft(e);
1124
+ var n = e === t ? null : /* @__PURE__ */ Dt(e);
1125
1125
  e.remove(), e = n;
1126
1126
  }
1127
1127
  }
1128
- function Lr(e) {
1128
+ function Fr(e) {
1129
1129
  var t = e.parent, n = e.prev, r = e.next;
1130
1130
  n !== null && (n.next = r), r !== null && (r.prev = n), t !== null && (t.first === e && (t.first = r), t.last === e && (t.last = n));
1131
1131
  }
1132
- function Gn(e, t, n = !0) {
1132
+ function Jn(e, t, n = !0) {
1133
1133
  var r = [];
1134
- Or(e, r, !0);
1134
+ Dr(e, r, !0);
1135
1135
  var o = () => {
1136
1136
  n && Te(e), t && t();
1137
1137
  }, i = r.length;
@@ -1142,31 +1142,31 @@ function Gn(e, t, n = !0) {
1142
1142
  } else
1143
1143
  o();
1144
1144
  }
1145
- function Or(e, t, n) {
1146
- if ((e.f & ye) === 0) {
1147
- e.f ^= ye;
1145
+ function Dr(e, t, n) {
1146
+ if ((e.f & me) === 0) {
1147
+ e.f ^= me;
1148
1148
  var r = e.nodes && e.nodes.t;
1149
1149
  if (r !== null)
1150
1150
  for (const s of r)
1151
1151
  (s.is_global || n) && t.push(s);
1152
1152
  for (var o = e.first; o !== null; ) {
1153
- var i = o.next, l = (o.f & It) !== 0 || // If this is a branch effect without a block effect parent,
1153
+ var i = o.next, l = (o.f & Mt) !== 0 || // If this is a branch effect without a block effect parent,
1154
1154
  // it means the parent block effect was pruned. In that case,
1155
1155
  // transparency information was transferred to the branch effect.
1156
1156
  (o.f & Le) !== 0 && (e.f & Ne) !== 0;
1157
- Or(o, t, l ? n : !1), o = i;
1157
+ Dr(o, t, l ? n : !1), o = i;
1158
1158
  }
1159
1159
  }
1160
1160
  }
1161
- function Wn(e) {
1162
- Fr(e, !0);
1161
+ function Zn(e) {
1162
+ Ur(e, !0);
1163
1163
  }
1164
- function Fr(e, t) {
1165
- if ((e.f & ye) !== 0) {
1166
- e.f ^= ye, (e.f & te) === 0 && (ne(e, pe), rt(e));
1164
+ function Ur(e, t) {
1165
+ if ((e.f & me) !== 0) {
1166
+ e.f ^= me, (e.f & ne) === 0 && (re(e, pe), it(e));
1167
1167
  for (var n = e.first; n !== null; ) {
1168
- var r = n.next, o = (n.f & It) !== 0 || (n.f & Le) !== 0;
1169
- Fr(n, o ? t : !1), n = r;
1168
+ var r = n.next, o = (n.f & Mt) !== 0 || (n.f & Le) !== 0;
1169
+ Ur(n, o ? t : !1), n = r;
1170
1170
  }
1171
1171
  var i = e.nodes && e.nodes.t;
1172
1172
  if (i !== null)
@@ -1177,118 +1177,118 @@ function Fr(e, t) {
1177
1177
  function po(e, t) {
1178
1178
  if (e.nodes)
1179
1179
  for (var n = e.nodes.start, r = e.nodes.end; n !== null; ) {
1180
- var o = n === r ? null : /* @__PURE__ */ Ft(n);
1180
+ var o = n === r ? null : /* @__PURE__ */ Dt(n);
1181
1181
  t.append(n), n = o;
1182
1182
  }
1183
1183
  }
1184
- let Xe = !1;
1185
- function Jt(e) {
1186
- Xe = e;
1184
+ let $e = !1;
1185
+ function Xt(e) {
1186
+ $e = e;
1187
1187
  }
1188
- let it = !1;
1189
- function nr(e) {
1190
- it = e;
1188
+ let ot = !1;
1189
+ function ir(e) {
1190
+ ot = e;
1191
1191
  }
1192
- let N = null, Ce = !1;
1193
- function Ie(e) {
1194
- N = e;
1192
+ let A = null, ke = !1;
1193
+ function Ce(e) {
1194
+ A = e;
1195
1195
  }
1196
- let z = null;
1197
- function Ve(e) {
1198
- z = e;
1196
+ let j = null;
1197
+ function Ye(e) {
1198
+ j = e;
1199
1199
  }
1200
1200
  let Ae = null;
1201
1201
  function ho(e) {
1202
- N !== null && (Ae === null ? Ae = [e] : Ae.push(e));
1202
+ A !== null && (Ae === null ? Ae = [e] : Ae.push(e));
1203
1203
  }
1204
- let ce = null, _e = 0, be = null;
1204
+ let ce = null, he = 0, ye = null;
1205
1205
  function mo(e) {
1206
- be = e;
1206
+ ye = e;
1207
1207
  }
1208
- let Dr = 1, Nt = 0, $e = Nt;
1209
- function rr(e) {
1210
- $e = e;
1208
+ let jr = 1, Lt = 0, et = Lt;
1209
+ function or(e) {
1210
+ et = e;
1211
1211
  }
1212
- function Ur() {
1213
- return ++Dr;
1212
+ function zr() {
1213
+ return ++jr;
1214
1214
  }
1215
- function _t(e) {
1215
+ function bt(e) {
1216
1216
  var t = e.f;
1217
1217
  if ((t & pe) !== 0)
1218
1218
  return !0;
1219
- if (t & re && (e.f &= ~nt), (t & ke) !== 0) {
1219
+ if (t & ie && (e.f &= ~rt), (t & Se) !== 0) {
1220
1220
  var n = e.deps;
1221
1221
  if (n !== null)
1222
1222
  for (var r = n.length, o = 0; o < r; o++) {
1223
1223
  var i = n[o];
1224
- if (_t(
1224
+ if (bt(
1225
1225
  /** @type {Derived} */
1226
1226
  i
1227
- ) && kr(
1227
+ ) && Ir(
1228
1228
  /** @type {Derived} */
1229
1229
  i
1230
1230
  ), i.wv > e.wv)
1231
1231
  return !0;
1232
1232
  }
1233
- (t & Se) !== 0 && // During time traveling we don't want to reset the status so that
1233
+ (t & Pe) !== 0 && // During time traveling we don't want to reset the status so that
1234
1234
  // traversal of the graph in the other batches still happens
1235
- we === null && ne(e, te);
1235
+ ge === null && re(e, ne);
1236
1236
  }
1237
1237
  return !1;
1238
1238
  }
1239
- function jr(e, t, n = !0) {
1239
+ function Hr(e, t, n = !0) {
1240
1240
  var r = e.reactions;
1241
1241
  if (r !== null && !Ae?.includes(e))
1242
1242
  for (var o = 0; o < r.length; o++) {
1243
1243
  var i = r[o];
1244
- (i.f & re) !== 0 ? jr(
1244
+ (i.f & ie) !== 0 ? Hr(
1245
1245
  /** @type {Derived} */
1246
1246
  i,
1247
1247
  t,
1248
1248
  !1
1249
- ) : t === i && (n ? ne(i, pe) : (i.f & te) !== 0 && ne(i, ke), rt(
1249
+ ) : t === i && (n ? re(i, pe) : (i.f & ne) !== 0 && re(i, Se), it(
1250
1250
  /** @type {Effect} */
1251
1251
  i
1252
1252
  ));
1253
1253
  }
1254
1254
  }
1255
- function zr(e) {
1256
- var t = ce, n = _e, r = be, o = N, i = Ae, l = $, s = Ce, c = $e, u = e.f;
1255
+ function Br(e) {
1256
+ var t = ce, n = he, r = ye, o = A, i = Ae, l = ee, s = ke, c = et, u = e.f;
1257
1257
  ce = /** @type {null | Value[]} */
1258
- null, _e = 0, be = null, N = (u & (Le | mt)) === 0 ? e : null, Ae = null, qt(e.ctx), Ce = !1, $e = ++Nt, e.ac !== null && (sn(() => {
1259
- e.ac.abort(dt);
1258
+ null, he = 0, ye = null, A = (u & (Le | yt)) === 0 ? e : null, Ae = null, Gt(e.ctx), ke = !1, et = ++Lt, e.ac !== null && (un(() => {
1259
+ e.ac.abort(pt);
1260
1260
  }), e.ac = null);
1261
1261
  try {
1262
- e.f |= Rn;
1262
+ e.f |= An;
1263
1263
  var f = (
1264
1264
  /** @type {Function} */
1265
1265
  e.fn
1266
- ), d = f(), v = e.deps;
1266
+ ), h = f(), d = e.deps;
1267
1267
  if (ce !== null) {
1268
1268
  var m;
1269
- if (Zt(e, _e), v !== null && _e > 0)
1270
- for (v.length = _e + ce.length, m = 0; m < ce.length; m++)
1271
- v[_e + m] = ce[m];
1269
+ if ($t(e, he), d !== null && he > 0)
1270
+ for (d.length = he + ce.length, m = 0; m < ce.length; m++)
1271
+ d[he + m] = ce[m];
1272
1272
  else
1273
- e.deps = v = ce;
1274
- if (Wt() && (e.f & Se) !== 0)
1275
- for (m = _e; m < v.length; m++)
1276
- (v[m].reactions ??= []).push(e);
1277
- } else v !== null && _e < v.length && (Zt(e, _e), v.length = _e);
1278
- if (Ot() && be !== null && !Ce && v !== null && (e.f & (re | ke | pe)) === 0)
1273
+ e.deps = d = ce;
1274
+ if (Qt() && (e.f & Pe) !== 0)
1275
+ for (m = he; m < d.length; m++)
1276
+ (d[m].reactions ??= []).push(e);
1277
+ } else d !== null && he < d.length && ($t(e, he), d.length = he);
1278
+ if (Ft() && ye !== null && !ke && d !== null && (e.f & (ie | Se | pe)) === 0)
1279
1279
  for (m = 0; m < /** @type {Source[]} */
1280
- be.length; m++)
1281
- jr(
1282
- be[m],
1280
+ ye.length; m++)
1281
+ Hr(
1282
+ ye[m],
1283
1283
  /** @type {Effect} */
1284
1284
  e
1285
1285
  );
1286
- return o !== null && o !== e && (Nt++, be !== null && (r === null ? r = be : r.push(.../** @type {Source[]} */
1287
- be))), (e.f & Ke) !== 0 && (e.f ^= Ke), d;
1286
+ return o !== null && o !== e && (Lt++, ye !== null && (r === null ? r = ye : r.push(.../** @type {Source[]} */
1287
+ ye))), (e.f & qe) !== 0 && (e.f ^= qe), h;
1288
1288
  } catch (_) {
1289
1289
  return Wi(_);
1290
1290
  } finally {
1291
- e.f ^= Rn, ce = t, _e = n, be = r, N = o, Ae = i, qt(l), Ce = s, $e = c;
1291
+ e.f ^= An, ce = t, he = n, ye = r, A = o, Ae = i, Gt(l), ke = s, et = c;
1292
1292
  }
1293
1293
  }
1294
1294
  function _o(e, t) {
@@ -1300,38 +1300,38 @@ function _o(e, t) {
1300
1300
  o === 0 ? n = t.reactions = null : (n[r] = n[o], n.pop());
1301
1301
  }
1302
1302
  }
1303
- n === null && (t.f & re) !== 0 && // Destroying a child effect while updating a parent effect can cause a dependency to appear
1303
+ n === null && (t.f & ie) !== 0 && // Destroying a child effect while updating a parent effect can cause a dependency to appear
1304
1304
  // to be unused, when in fact it is used by the currently-updating parent. Checking `new_deps`
1305
1305
  // allows us to skip the expensive work of disconnecting and immediately reconnecting it
1306
- (ce === null || !ce.includes(t)) && (ne(t, ke), (t.f & Se) !== 0 && (t.f ^= Se, t.f &= ~nt), Sr(
1306
+ (ce === null || !ce.includes(t)) && (re(t, Se), (t.f & Pe) !== 0 && (t.f ^= Pe, t.f &= ~rt), Cr(
1307
1307
  /** @type {Derived} **/
1308
1308
  t
1309
- ), Zt(
1309
+ ), $t(
1310
1310
  /** @type {Derived} **/
1311
1311
  t,
1312
1312
  0
1313
1313
  ));
1314
1314
  }
1315
- function Zt(e, t) {
1315
+ function $t(e, t) {
1316
1316
  var n = e.deps;
1317
1317
  if (n !== null)
1318
1318
  for (var r = t; r < n.length; r++)
1319
1319
  _o(e, n[r]);
1320
1320
  }
1321
- function ht(e) {
1321
+ function _t(e) {
1322
1322
  var t = e.f;
1323
1323
  if ((t & Re) === 0) {
1324
- ne(e, te);
1325
- var n = z, r = Xe;
1326
- z = e, Xe = !0;
1324
+ re(e, ne);
1325
+ var n = j, r = $e;
1326
+ j = e, $e = !0;
1327
1327
  try {
1328
- (t & (Ne | Li)) !== 0 ? fo(e) : Nr(e), Ar(e);
1329
- var o = zr(e);
1330
- e.teardown = typeof o == "function" ? o : null, e.wv = Dr;
1328
+ (t & (Ne | Li)) !== 0 ? fo(e) : Or(e), Lr(e);
1329
+ var o = Br(e);
1330
+ e.teardown = typeof o == "function" ? o : null, e.wv = jr;
1331
1331
  var i;
1332
- In && mi && (e.f & pe) !== 0 && e.deps;
1332
+ xn && mi && (e.f & pe) !== 0 && e.deps;
1333
1333
  } finally {
1334
- Xe = r, z = n;
1334
+ $e = r, j = n;
1335
1335
  }
1336
1336
  }
1337
1337
  }
@@ -1339,53 +1339,53 @@ async function yo() {
1339
1339
  await Promise.resolve(), Ji();
1340
1340
  }
1341
1341
  function a(e) {
1342
- var t = e.f, n = (t & re) !== 0;
1343
- if (N !== null && !Ce) {
1344
- var r = z !== null && (z.f & Re) !== 0;
1342
+ var t = e.f, n = (t & ie) !== 0;
1343
+ if (A !== null && !ke) {
1344
+ var r = j !== null && (j.f & Re) !== 0;
1345
1345
  if (!r && !Ae?.includes(e)) {
1346
- var o = N.deps;
1347
- if ((N.f & Rn) !== 0)
1348
- e.rv < Nt && (e.rv = Nt, ce === null && o !== null && o[_e] === e ? _e++ : ce === null ? ce = [e] : ce.includes(e) || ce.push(e));
1346
+ var o = A.deps;
1347
+ if ((A.f & An) !== 0)
1348
+ e.rv < Lt && (e.rv = Lt, ce === null && o !== null && o[he] === e ? he++ : ce === null ? ce = [e] : ce.includes(e) || ce.push(e));
1349
1349
  else {
1350
- (N.deps ??= []).push(e);
1350
+ (A.deps ??= []).push(e);
1351
1351
  var i = e.reactions;
1352
- i === null ? e.reactions = [N] : i.includes(N) || i.push(N);
1352
+ i === null ? e.reactions = [A] : i.includes(A) || i.push(A);
1353
1353
  }
1354
1354
  }
1355
1355
  }
1356
- if (it) {
1357
- if (qe.has(e))
1358
- return qe.get(e);
1356
+ if (ot) {
1357
+ if (Ve.has(e))
1358
+ return Ve.get(e);
1359
1359
  if (n) {
1360
1360
  var l = (
1361
1361
  /** @type {Derived} */
1362
1362
  e
1363
1363
  ), s = l.v;
1364
- return ((l.f & te) === 0 && l.reactions !== null || Br(l)) && (s = Kn(l)), qe.set(l, s), s;
1364
+ return ((l.f & ne) === 0 && l.reactions !== null || qr(l)) && (s = Vn(l)), Ve.set(l, s), s;
1365
1365
  }
1366
- } else n && (!we?.has(e) || L?.is_fork && !Wt()) && (l = /** @type {Derived} */
1367
- e, _t(l) && kr(l), Xe && Wt() && (l.f & Se) === 0 && Hr(l));
1368
- if (we?.has(e))
1369
- return we.get(e);
1370
- if ((e.f & Ke) !== 0)
1366
+ } else n && (!ge?.has(e) || N?.is_fork && !Qt()) && (l = /** @type {Derived} */
1367
+ e, bt(l) && Ir(l), $e && Qt() && (l.f & Pe) === 0 && Kr(l));
1368
+ if (ge?.has(e))
1369
+ return ge.get(e);
1370
+ if ((e.f & qe) !== 0)
1371
1371
  throw e.v;
1372
1372
  return e.v;
1373
1373
  }
1374
- function Hr(e) {
1374
+ function Kr(e) {
1375
1375
  if (e.deps !== null) {
1376
- e.f ^= Se;
1376
+ e.f ^= Pe;
1377
1377
  for (const t of e.deps)
1378
- (t.reactions ??= []).push(e), (t.f & re) !== 0 && (t.f & Se) === 0 && Hr(
1378
+ (t.reactions ??= []).push(e), (t.f & ie) !== 0 && (t.f & Pe) === 0 && Kr(
1379
1379
  /** @type {Derived} */
1380
1380
  t
1381
1381
  );
1382
1382
  }
1383
1383
  }
1384
- function Br(e) {
1385
- if (e.v === oe) return !0;
1384
+ function qr(e) {
1385
+ if (e.v === ae) return !0;
1386
1386
  if (e.deps === null) return !1;
1387
1387
  for (const t of e.deps)
1388
- if (qe.has(t) || (t.f & re) !== 0 && Br(
1388
+ if (Ve.has(t) || (t.f & ie) !== 0 && qr(
1389
1389
  /** @type {Derived} */
1390
1390
  t
1391
1391
  ))
@@ -1393,40 +1393,40 @@ function Br(e) {
1393
1393
  return !1;
1394
1394
  }
1395
1395
  function w(e) {
1396
- var t = Ce;
1396
+ var t = ke;
1397
1397
  try {
1398
- return Ce = !0, e();
1398
+ return ke = !0, e();
1399
1399
  } finally {
1400
- Ce = t;
1400
+ ke = t;
1401
1401
  }
1402
1402
  }
1403
1403
  const bo = -7169;
1404
- function ne(e, t) {
1404
+ function re(e, t) {
1405
1405
  e.f = e.f & bo | t;
1406
1406
  }
1407
1407
  function G(e) {
1408
1408
  if (!(typeof e != "object" || !e || e instanceof EventTarget)) {
1409
- if (pt in e)
1410
- Nn(e);
1409
+ if (mt in e)
1410
+ On(e);
1411
1411
  else if (!Array.isArray(e))
1412
1412
  for (let t in e) {
1413
1413
  const n = e[t];
1414
- typeof n == "object" && n && pt in n && Nn(n);
1414
+ typeof n == "object" && n && mt in n && On(n);
1415
1415
  }
1416
1416
  }
1417
1417
  }
1418
- function Nn(e, t = /* @__PURE__ */ new Set()) {
1418
+ function On(e, t = /* @__PURE__ */ new Set()) {
1419
1419
  if (typeof e == "object" && e !== null && // We don't want to traverse DOM elements
1420
1420
  !(e instanceof EventTarget) && !t.has(e)) {
1421
1421
  t.add(e), e instanceof Date && e.getTime();
1422
1422
  for (let r in e)
1423
1423
  try {
1424
- Nn(e[r], t);
1424
+ On(e[r], t);
1425
1425
  } catch {
1426
1426
  }
1427
- const n = Un(e);
1427
+ const n = zn(e);
1428
1428
  if (n !== Object.prototype && n !== Array.prototype && n !== Map.prototype && n !== Set.prototype && n !== Date.prototype) {
1429
- const r = vr(n);
1429
+ const r = hr(n);
1430
1430
  for (let o in r) {
1431
1431
  const i = r[o].get;
1432
1432
  if (i)
@@ -1441,9 +1441,9 @@ function Nn(e, t = /* @__PURE__ */ new Set()) {
1441
1441
  function go(e, t, n, r = {}) {
1442
1442
  function o(i) {
1443
1443
  if (r.capture || wo.call(t, i), !i.cancelBubble)
1444
- return sn(() => n?.call(this, i));
1444
+ return un(() => n?.call(this, i));
1445
1445
  }
1446
- return e.startsWith("pointer") || e.startsWith("touch") || e === "wheel" ? Bn(() => {
1446
+ return e.startsWith("pointer") || e.startsWith("touch") || e === "wheel" ? qn(() => {
1447
1447
  t.addEventListener(e, o, r);
1448
1448
  }) : t.addEventListener(e, o, r), o;
1449
1449
  }
@@ -1452,11 +1452,11 @@ function fe(e, t, n, r, o) {
1452
1452
  (t === document.body || // @ts-ignore
1453
1453
  t === window || // @ts-ignore
1454
1454
  t === document || // Firefox has quirky behavior, it can happen that we still get "canplay" events when the element is already removed
1455
- t instanceof HTMLMediaElement) && qn(() => {
1455
+ t instanceof HTMLMediaElement) && Yn(() => {
1456
1456
  t.removeEventListener(e, l, i);
1457
1457
  });
1458
1458
  }
1459
- let ir = null;
1459
+ let ar = null;
1460
1460
  function wo(e) {
1461
1461
  var t = this, n = (
1462
1462
  /** @type {Node} */
@@ -1465,8 +1465,8 @@ function wo(e) {
1465
1465
  /** @type {null | Element} */
1466
1466
  o[0] || e.target
1467
1467
  );
1468
- ir = e;
1469
- var l = 0, s = ir === e && e.__root;
1468
+ ar = e;
1469
+ var l = 0, s = ar === e && e.__root;
1470
1470
  if (s) {
1471
1471
  var c = o.indexOf(s);
1472
1472
  if (c !== -1 && (t === document || t === /** @type {any} */
@@ -1481,40 +1481,40 @@ function wo(e) {
1481
1481
  }
1482
1482
  if (i = /** @type {Element} */
1483
1483
  o[l] || e.target, i !== t) {
1484
- dr(e, "currentTarget", {
1484
+ pr(e, "currentTarget", {
1485
1485
  configurable: !0,
1486
1486
  get() {
1487
1487
  return i || n;
1488
1488
  }
1489
1489
  });
1490
- var f = N, d = z;
1491
- Ie(null), Ve(null);
1490
+ var f = A, h = j;
1491
+ Ce(null), Ye(null);
1492
1492
  try {
1493
- for (var v, m = []; i !== null; ) {
1493
+ for (var d, m = []; i !== null; ) {
1494
1494
  var _ = i.assignedSlot || i.parentNode || /** @type {any} */
1495
1495
  i.host || null;
1496
1496
  try {
1497
- var h = i["__" + r];
1498
- h != null && (!/** @type {any} */
1497
+ var p = i["__" + r];
1498
+ p != null && (!/** @type {any} */
1499
1499
  i.disabled || // DOM could've been updated already by the time this is reached, so we check this as well
1500
1500
  // -> the target could not have been disabled because it emits the event in the first place
1501
- e.target === i) && h.call(i, e);
1502
- } catch (p) {
1503
- v ? m.push(p) : v = p;
1501
+ e.target === i) && p.call(i, e);
1502
+ } catch (v) {
1503
+ d ? m.push(v) : d = v;
1504
1504
  }
1505
1505
  if (e.cancelBubble || _ === t || _ === null)
1506
1506
  break;
1507
1507
  i = _;
1508
1508
  }
1509
- if (v) {
1510
- for (let p of m)
1509
+ if (d) {
1510
+ for (let v of m)
1511
1511
  queueMicrotask(() => {
1512
- throw p;
1512
+ throw v;
1513
1513
  });
1514
- throw v;
1514
+ throw d;
1515
1515
  }
1516
1516
  } finally {
1517
- e.__root = t, delete e.currentTarget, Ie(f), Ve(d);
1517
+ e.__root = t, delete e.currentTarget, Ce(f), Ye(h);
1518
1518
  }
1519
1519
  }
1520
1520
  }
@@ -1522,10 +1522,10 @@ function Eo(e) {
1522
1522
  var t = document.createElement("template");
1523
1523
  return t.innerHTML = e.replaceAll("<!>", "<!---->"), t.content;
1524
1524
  }
1525
- function Qt(e, t) {
1525
+ function en(e, t) {
1526
1526
  var n = (
1527
1527
  /** @type {Effect} */
1528
- z
1528
+ j
1529
1529
  );
1530
1530
  n.nodes === null && (n.nodes = { start: e, end: t, a: null, t: null });
1531
1531
  }
@@ -1534,7 +1534,7 @@ function R(e, t) {
1534
1534
  var n = (t & Ii) !== 0, r = (t & Mi) !== 0, o, i = !e.startsWith("<!>");
1535
1535
  return () => {
1536
1536
  o === void 0 && (o = Eo(i ? e : "<!>" + e), n || (o = /** @type {TemplateNode} */
1537
- /* @__PURE__ */ Gt(o)));
1537
+ /* @__PURE__ */ Zt(o)));
1538
1538
  var l = (
1539
1539
  /** @type {TemplateNode} */
1540
1540
  r || no ? document.importNode(o, !0) : o.cloneNode(!0)
@@ -1542,26 +1542,26 @@ function R(e, t) {
1542
1542
  if (n) {
1543
1543
  var s = (
1544
1544
  /** @type {TemplateNode} */
1545
- /* @__PURE__ */ Gt(l)
1545
+ /* @__PURE__ */ Zt(l)
1546
1546
  ), c = (
1547
1547
  /** @type {TemplateNode} */
1548
1548
  l.lastChild
1549
1549
  );
1550
- Qt(s, c);
1550
+ en(s, c);
1551
1551
  } else
1552
- Qt(l, l);
1552
+ en(l, l);
1553
1553
  return l;
1554
1554
  };
1555
1555
  }
1556
1556
  function Po(e = "") {
1557
1557
  {
1558
- var t = Qe(e + "");
1559
- return Qt(t, t), t;
1558
+ var t = Xe(e + "");
1559
+ return en(t, t), t;
1560
1560
  }
1561
1561
  }
1562
- function ft() {
1563
- var e = document.createDocumentFragment(), t = document.createComment(""), n = Qe();
1564
- return e.append(t, n), Qt(t, n), e;
1562
+ function vt() {
1563
+ var e = document.createDocumentFragment(), t = document.createComment(""), n = Xe();
1564
+ return e.append(t, n), en(t, n), e;
1565
1565
  }
1566
1566
  function P(e, t) {
1567
1567
  e !== null && e.before(
@@ -1619,7 +1619,7 @@ class So {
1619
1619
  #i = () => {
1620
1620
  var t = (
1621
1621
  /** @type {Batch} */
1622
- L
1622
+ N
1623
1623
  );
1624
1624
  if (this.#t.has(t)) {
1625
1625
  var n = (
@@ -1627,7 +1627,7 @@ class So {
1627
1627
  this.#t.get(t)
1628
1628
  ), r = this.#n.get(n);
1629
1629
  if (r)
1630
- Wn(r), this.#r.delete(n);
1630
+ Zn(r), this.#r.delete(n);
1631
1631
  else {
1632
1632
  var o = this.#e.get(n);
1633
1633
  o && (this.#n.set(n, o.effect), this.#e.delete(n), o.fragment.lastChild.remove(), this.anchor.before(o.fragment), r = o.effect);
@@ -1643,12 +1643,12 @@ class So {
1643
1643
  const s = () => {
1644
1644
  if (Array.from(this.#t.values()).includes(i)) {
1645
1645
  var u = document.createDocumentFragment();
1646
- po(l, u), u.append(Qe()), this.#e.set(i, { effect: l, fragment: u });
1646
+ po(l, u), u.append(Xe()), this.#e.set(i, { effect: l, fragment: u });
1647
1647
  } else
1648
1648
  Te(l);
1649
1649
  this.#r.delete(i), this.#n.delete(i);
1650
1650
  };
1651
- this.#o || !r ? (this.#r.add(i), Gn(l, s, !1)) : s();
1651
+ this.#o || !r ? (this.#r.add(i), Jn(l, s, !1)) : s();
1652
1652
  }
1653
1653
  }
1654
1654
  };
@@ -1669,19 +1669,19 @@ class So {
1669
1669
  ensure(t, n) {
1670
1670
  var r = (
1671
1671
  /** @type {Batch} */
1672
- L
1673
- ), o = Mr();
1672
+ N
1673
+ ), o = Rr();
1674
1674
  if (n && !this.#n.has(t) && !this.#e.has(t))
1675
1675
  if (o) {
1676
- var i = document.createDocumentFragment(), l = Qe();
1676
+ var i = document.createDocumentFragment(), l = Xe();
1677
1677
  i.append(l), this.#e.set(t, {
1678
- effect: At(() => n(l)),
1678
+ effect: Nt(() => n(l)),
1679
1679
  fragment: i
1680
1680
  });
1681
1681
  } else
1682
1682
  this.#n.set(
1683
1683
  t,
1684
- At(() => n(this.anchor))
1684
+ Nt(() => n(this.anchor))
1685
1685
  );
1686
1686
  if (this.#t.set(r, t), o) {
1687
1687
  for (const [s, c] of this.#n)
@@ -1694,11 +1694,11 @@ class So {
1694
1694
  }
1695
1695
  }
1696
1696
  function J(e, t, n = !1) {
1697
- var r = new So(e), o = n ? It : 0;
1697
+ var r = new So(e), o = n ? Mt : 0;
1698
1698
  function i(l, s) {
1699
1699
  r.ensure(l, s);
1700
1700
  }
1701
- Tr(() => {
1701
+ Nr(() => {
1702
1702
  var l = !1;
1703
1703
  t((s, c = !0) => {
1704
1704
  l = !0, i(c, s);
@@ -1707,17 +1707,17 @@ function J(e, t, n = !1) {
1707
1707
  }
1708
1708
  function ko(e, t, n) {
1709
1709
  for (var r = [], o = t.length, i, l = t.length, s = 0; s < o; s++) {
1710
- let d = t[s];
1711
- Gn(
1712
- d,
1710
+ let h = t[s];
1711
+ Jn(
1712
+ h,
1713
1713
  () => {
1714
1714
  if (i) {
1715
- if (i.pending.delete(d), i.done.add(d), i.pending.size === 0) {
1716
- var v = (
1715
+ if (i.pending.delete(h), i.done.add(h), i.pending.size === 0) {
1716
+ var d = (
1717
1717
  /** @type {Set<EachOutroGroup>} */
1718
1718
  e.outrogroups
1719
1719
  );
1720
- Ln(Dn(i.done)), v.delete(i), v.size === 0 && (e.outrogroups = null);
1720
+ Fn(jn(i.done)), d.delete(i), d.size === 0 && (e.outrogroups = null);
1721
1721
  }
1722
1722
  } else
1723
1723
  l -= 1;
@@ -1737,149 +1737,149 @@ function ko(e, t, n) {
1737
1737
  );
1738
1738
  oo(f), f.append(u), e.items.clear();
1739
1739
  }
1740
- Ln(t, !c);
1740
+ Fn(t, !c);
1741
1741
  } else
1742
1742
  i = {
1743
1743
  pending: new Set(t),
1744
1744
  done: /* @__PURE__ */ new Set()
1745
1745
  }, (e.outrogroups ??= /* @__PURE__ */ new Set()).add(i);
1746
1746
  }
1747
- function Ln(e, t = !0) {
1747
+ function Fn(e, t = !0) {
1748
1748
  for (var n = 0; n < e.length; n++)
1749
1749
  Te(e[n], t);
1750
1750
  }
1751
- var or;
1752
- function Jn(e, t, n, r, o, i = null) {
1753
- var l = e, s = /* @__PURE__ */ new Map(), c = (t & ur) !== 0;
1751
+ var sr;
1752
+ function Qn(e, t, n, r, o, i = null) {
1753
+ var l = e, s = /* @__PURE__ */ new Map(), c = (t & dr) !== 0;
1754
1754
  if (c) {
1755
1755
  var u = (
1756
1756
  /** @type {Element} */
1757
1757
  e
1758
1758
  );
1759
- l = u.appendChild(Qe());
1759
+ l = u.appendChild(Xe());
1760
1760
  }
1761
- var f = null, d = /* @__PURE__ */ xt(() => {
1761
+ var f = null, h = /* @__PURE__ */ Rt(() => {
1762
1762
  var y = n();
1763
- return fr(y) ? y : y == null ? [] : Dn(y);
1764
- }), v, m = !0;
1763
+ return vr(y) ? y : y == null ? [] : jn(y);
1764
+ }), d, m = !0;
1765
1765
  function _() {
1766
- p.fallback = f, Co(p, v, l, t, r), f !== null && (v.length === 0 ? (f.f & xe) === 0 ? Wn(f) : (f.f ^= xe, kt(f, null, l)) : Gn(f, () => {
1766
+ v.fallback = f, Co(v, d, l, t, r), f !== null && (d.length === 0 ? (f.f & xe) === 0 ? Zn(f) : (f.f ^= xe, Ct(f, null, l)) : Jn(f, () => {
1767
1767
  f = null;
1768
1768
  }));
1769
1769
  }
1770
- var h = Tr(() => {
1771
- v = /** @type {V[]} */
1772
- a(d);
1773
- for (var y = v.length, q = /* @__PURE__ */ new Set(), S = (
1770
+ var p = Nr(() => {
1771
+ d = /** @type {V[]} */
1772
+ a(h);
1773
+ for (var y = d.length, B = /* @__PURE__ */ new Set(), k = (
1774
1774
  /** @type {Batch} */
1775
- L
1776
- ), H = Mr(), B = 0; B < y; B += 1) {
1777
- var Q = v[B], O = r(Q, B), V = m ? null : s.get(O);
1778
- V ? (V.v && Tt(V.v, Q), V.i && Tt(V.i, B), H && S.skipped_effects.delete(V.e)) : (V = Io(
1775
+ N
1776
+ ), z = Rr(), H = 0; H < y; H += 1) {
1777
+ var X = d[H], L = r(X, H), q = m ? null : s.get(L);
1778
+ q ? (q.v && At(q.v, X), q.i && At(q.i, H), z && k.skipped_effects.delete(q.e)) : (q = Io(
1779
1779
  s,
1780
- m ? l : or ??= Qe(),
1781
- Q,
1782
- O,
1783
- B,
1780
+ m ? l : sr ??= Xe(),
1781
+ X,
1782
+ L,
1783
+ H,
1784
1784
  o,
1785
1785
  t,
1786
1786
  n
1787
- ), m || (V.e.f |= xe), s.set(O, V)), q.add(O);
1787
+ ), m || (q.e.f |= xe), s.set(L, q)), B.add(L);
1788
1788
  }
1789
- if (y === 0 && i && !f && (m ? f = At(() => i(l)) : (f = At(() => i(or ??= Qe())), f.f |= xe)), !m)
1790
- if (H) {
1791
- for (const [C, b] of s)
1792
- q.has(C) || S.skipped_effects.add(b.e);
1793
- S.oncommit(_), S.ondiscard(() => {
1789
+ if (y === 0 && i && !f && (m ? f = Nt(() => i(l)) : (f = Nt(() => i(sr ??= Xe())), f.f |= xe)), !m)
1790
+ if (z) {
1791
+ for (const [C, g] of s)
1792
+ B.has(C) || k.skipped_effects.add(g.e);
1793
+ k.oncommit(_), k.ondiscard(() => {
1794
1794
  });
1795
1795
  } else
1796
1796
  _();
1797
- a(d);
1798
- }), p = { effect: h, items: s, outrogroups: null, fallback: f };
1797
+ a(h);
1798
+ }), v = { effect: p, items: s, outrogroups: null, fallback: f };
1799
1799
  m = !1;
1800
1800
  }
1801
1801
  function Co(e, t, n, r, o) {
1802
- var i = (r & gi) !== 0, l = t.length, s = e.items, c = e.effect.first, u, f = null, d, v = [], m = [], _, h, p, y;
1802
+ var i = (r & gi) !== 0, l = t.length, s = e.items, c = e.effect.first, u, f = null, h, d = [], m = [], _, p, v, y;
1803
1803
  if (i)
1804
1804
  for (y = 0; y < l; y += 1)
1805
- _ = t[y], h = o(_, y), p = /** @type {EachItem} */
1806
- s.get(h).e, (p.f & xe) === 0 && (p.nodes?.a?.measure(), (d ??= /* @__PURE__ */ new Set()).add(p));
1805
+ _ = t[y], p = o(_, y), v = /** @type {EachItem} */
1806
+ s.get(p).e, (v.f & xe) === 0 && (v.nodes?.a?.measure(), (h ??= /* @__PURE__ */ new Set()).add(v));
1807
1807
  for (y = 0; y < l; y += 1) {
1808
- if (_ = t[y], h = o(_, y), p = /** @type {EachItem} */
1809
- s.get(h).e, e.outrogroups !== null)
1810
- for (const b of e.outrogroups)
1811
- b.pending.delete(p), b.done.delete(p);
1812
- if ((p.f & xe) !== 0)
1813
- if (p.f ^= xe, p === c)
1814
- kt(p, null, n);
1808
+ if (_ = t[y], p = o(_, y), v = /** @type {EachItem} */
1809
+ s.get(p).e, e.outrogroups !== null)
1810
+ for (const g of e.outrogroups)
1811
+ g.pending.delete(v), g.done.delete(v);
1812
+ if ((v.f & xe) !== 0)
1813
+ if (v.f ^= xe, v === c)
1814
+ Ct(v, null, n);
1815
1815
  else {
1816
- var q = f ? f.next : c;
1817
- p === e.effect.last && (e.effect.last = p.prev), p.prev && (p.prev.next = p.next), p.next && (p.next.prev = p.prev), He(e, f, p), He(e, p, q), kt(p, q, n), f = p, v = [], m = [], c = f.next;
1816
+ var B = f ? f.next : c;
1817
+ v === e.effect.last && (e.effect.last = v.prev), v.prev && (v.prev.next = v.next), v.next && (v.next.prev = v.prev), Be(e, f, v), Be(e, v, B), Ct(v, B, n), f = v, d = [], m = [], c = f.next;
1818
1818
  continue;
1819
1819
  }
1820
- if ((p.f & ye) !== 0 && (Wn(p), i && (p.nodes?.a?.unfix(), (d ??= /* @__PURE__ */ new Set()).delete(p))), p !== c) {
1821
- if (u !== void 0 && u.has(p)) {
1822
- if (v.length < m.length) {
1823
- var S = m[0], H;
1824
- f = S.prev;
1825
- var B = v[0], Q = v[v.length - 1];
1826
- for (H = 0; H < v.length; H += 1)
1827
- kt(v[H], S, n);
1828
- for (H = 0; H < m.length; H += 1)
1829
- u.delete(m[H]);
1830
- He(e, B.prev, Q.next), He(e, f, B), He(e, Q, S), c = S, f = Q, y -= 1, v = [], m = [];
1820
+ if ((v.f & me) !== 0 && (Zn(v), i && (v.nodes?.a?.unfix(), (h ??= /* @__PURE__ */ new Set()).delete(v))), v !== c) {
1821
+ if (u !== void 0 && u.has(v)) {
1822
+ if (d.length < m.length) {
1823
+ var k = m[0], z;
1824
+ f = k.prev;
1825
+ var H = d[0], X = d[d.length - 1];
1826
+ for (z = 0; z < d.length; z += 1)
1827
+ Ct(d[z], k, n);
1828
+ for (z = 0; z < m.length; z += 1)
1829
+ u.delete(m[z]);
1830
+ Be(e, H.prev, X.next), Be(e, f, H), Be(e, X, k), c = k, f = X, y -= 1, d = [], m = [];
1831
1831
  } else
1832
- u.delete(p), kt(p, c, n), He(e, p.prev, p.next), He(e, p, f === null ? e.effect.first : f.next), He(e, f, p), f = p;
1832
+ u.delete(v), Ct(v, c, n), Be(e, v.prev, v.next), Be(e, v, f === null ? e.effect.first : f.next), Be(e, f, v), f = v;
1833
1833
  continue;
1834
1834
  }
1835
- for (v = [], m = []; c !== null && c !== p; )
1835
+ for (d = [], m = []; c !== null && c !== v; )
1836
1836
  (u ??= /* @__PURE__ */ new Set()).add(c), m.push(c), c = c.next;
1837
1837
  if (c === null)
1838
1838
  continue;
1839
1839
  }
1840
- (p.f & xe) === 0 && v.push(p), f = p, c = p.next;
1840
+ (v.f & xe) === 0 && d.push(v), f = v, c = v.next;
1841
1841
  }
1842
1842
  if (e.outrogroups !== null) {
1843
- for (const b of e.outrogroups)
1844
- b.pending.size === 0 && (Ln(Dn(b.done)), e.outrogroups?.delete(b));
1843
+ for (const g of e.outrogroups)
1844
+ g.pending.size === 0 && (Fn(jn(g.done)), e.outrogroups?.delete(g));
1845
1845
  e.outrogroups.size === 0 && (e.outrogroups = null);
1846
1846
  }
1847
1847
  if (c !== null || u !== void 0) {
1848
- var O = [];
1848
+ var L = [];
1849
1849
  if (u !== void 0)
1850
- for (p of u)
1851
- (p.f & ye) === 0 && O.push(p);
1850
+ for (v of u)
1851
+ (v.f & me) === 0 && L.push(v);
1852
1852
  for (; c !== null; )
1853
- (c.f & ye) === 0 && c !== e.fallback && O.push(c), c = c.next;
1854
- var V = O.length;
1855
- if (V > 0) {
1856
- var C = (r & ur) !== 0 && l === 0 ? n : null;
1853
+ (c.f & me) === 0 && c !== e.fallback && L.push(c), c = c.next;
1854
+ var q = L.length;
1855
+ if (q > 0) {
1856
+ var C = (r & dr) !== 0 && l === 0 ? n : null;
1857
1857
  if (i) {
1858
- for (y = 0; y < V; y += 1)
1859
- O[y].nodes?.a?.measure();
1860
- for (y = 0; y < V; y += 1)
1861
- O[y].nodes?.a?.fix();
1858
+ for (y = 0; y < q; y += 1)
1859
+ L[y].nodes?.a?.measure();
1860
+ for (y = 0; y < q; y += 1)
1861
+ L[y].nodes?.a?.fix();
1862
1862
  }
1863
- ko(e, O, C);
1863
+ ko(e, L, C);
1864
1864
  }
1865
1865
  }
1866
- i && Bn(() => {
1867
- if (d !== void 0)
1868
- for (p of d)
1869
- p.nodes?.a?.apply();
1866
+ i && qn(() => {
1867
+ if (h !== void 0)
1868
+ for (v of h)
1869
+ v.nodes?.a?.apply();
1870
1870
  });
1871
1871
  }
1872
1872
  function Io(e, t, n, r, o, i, l, s) {
1873
- var c = (l & yi) !== 0 ? (l & wi) === 0 ? /* @__PURE__ */ X(n, !1, !1) : Rt(n) : null, u = (l & bi) !== 0 ? Rt(o) : null;
1873
+ var c = (l & yi) !== 0 ? (l & wi) === 0 ? /* @__PURE__ */ $(n, !1, !1) : Tt(n) : null, u = (l & bi) !== 0 ? Tt(o) : null;
1874
1874
  return {
1875
1875
  v: c,
1876
1876
  i: u,
1877
- e: At(() => (i(t, c ?? n, u ?? o, s), () => {
1877
+ e: Nt(() => (i(t, c ?? n, u ?? o, s), () => {
1878
1878
  e.delete(r);
1879
1879
  }))
1880
1880
  };
1881
1881
  }
1882
- function kt(e, t, n) {
1882
+ function Ct(e, t, n) {
1883
1883
  if (e.nodes)
1884
1884
  for (var r = e.nodes.start, o = e.nodes.end, i = t && (t.f & xe) === 0 ? (
1885
1885
  /** @type {EffectNodes} */
@@ -1887,34 +1887,34 @@ function kt(e, t, n) {
1887
1887
  ) : n; r !== null; ) {
1888
1888
  var l = (
1889
1889
  /** @type {TemplateNode} */
1890
- /* @__PURE__ */ Ft(r)
1890
+ /* @__PURE__ */ Dt(r)
1891
1891
  );
1892
1892
  if (i.before(r), r === o)
1893
1893
  return;
1894
1894
  r = l;
1895
1895
  }
1896
1896
  }
1897
- function He(e, t, n) {
1897
+ function Be(e, t, n) {
1898
1898
  t === null ? e.effect.first = n : t.next = n, n === null ? e.effect.last = t : n.prev = t;
1899
1899
  }
1900
- function On(e, t, n, r, o) {
1900
+ function Dn(e, t, n, r, o) {
1901
1901
  var i = t.$$slots?.[n], l = !1;
1902
1902
  i === !0 && (i = t[n === "default" ? "children" : n], l = !0), i === void 0 ? o !== null && o(e) : i(e, l ? () => r : r);
1903
1903
  }
1904
- function Kr(e) {
1904
+ function Vr(e) {
1905
1905
  var t, n, r = "";
1906
1906
  if (typeof e == "string" || typeof e == "number") r += e;
1907
1907
  else if (typeof e == "object") if (Array.isArray(e)) {
1908
1908
  var o = e.length;
1909
- for (t = 0; t < o; t++) e[t] && (n = Kr(e[t])) && (r && (r += " "), r += n);
1909
+ for (t = 0; t < o; t++) e[t] && (n = Vr(e[t])) && (r && (r += " "), r += n);
1910
1910
  } else for (n in e) e[n] && (r && (r += " "), r += n);
1911
1911
  return r;
1912
1912
  }
1913
1913
  function Mo() {
1914
- for (var e, t, n = 0, r = "", o = arguments.length; n < o; n++) (e = arguments[n]) && (t = Kr(e)) && (r && (r += " "), r += t);
1914
+ for (var e, t, n = 0, r = "", o = arguments.length; n < o; n++) (e = arguments[n]) && (t = Vr(e)) && (r && (r += " "), r += t);
1915
1915
  return r;
1916
1916
  }
1917
- function et(e) {
1917
+ function tt(e) {
1918
1918
  return typeof e == "object" ? Mo(e) : e ?? "";
1919
1919
  }
1920
1920
  function xo(e, t, n) {
@@ -1924,7 +1924,7 @@ function xo(e, t, n) {
1924
1924
  function Ro(e, t) {
1925
1925
  return e == null ? null : String(e);
1926
1926
  }
1927
- function tt(e, t, n, r, o, i) {
1927
+ function nt(e, t, n, r, o, i) {
1928
1928
  var l = e.__className;
1929
1929
  if (l !== n || l === void 0) {
1930
1930
  var s = xo(n);
@@ -1932,7 +1932,7 @@ function tt(e, t, n, r, o, i) {
1932
1932
  }
1933
1933
  return i;
1934
1934
  }
1935
- function Zn(e, t, n, r) {
1935
+ function Xn(e, t, n, r) {
1936
1936
  var o = e.__style;
1937
1937
  if (o !== t) {
1938
1938
  var i = Ro(t);
@@ -1941,7 +1941,7 @@ function Zn(e, t, n, r) {
1941
1941
  return r;
1942
1942
  }
1943
1943
  const To = /* @__PURE__ */ Symbol("is custom element"), Ao = /* @__PURE__ */ Symbol("is html");
1944
- function Xt(e, t, n, r) {
1944
+ function tn(e, t, n, r) {
1945
1945
  var o = No(e);
1946
1946
  o[t] !== (o[t] = n) && (t === "loading" && (e[Fi] = n), n == null ? e.removeAttribute(t) : typeof n != "string" && Lo(e).includes(t) ? e[t] = n : e.setAttribute(t, n));
1947
1947
  }
@@ -1955,16 +1955,16 @@ function No(e) {
1955
1955
  }
1956
1956
  );
1957
1957
  }
1958
- var ar = /* @__PURE__ */ new Map();
1958
+ var lr = /* @__PURE__ */ new Map();
1959
1959
  function Lo(e) {
1960
- var t = e.getAttribute("is") || e.nodeName, n = ar.get(t);
1960
+ var t = e.getAttribute("is") || e.nodeName, n = lr.get(t);
1961
1961
  if (n) return n;
1962
- ar.set(t, n = []);
1962
+ lr.set(t, n = []);
1963
1963
  for (var r, o = e, i = Element.prototype; i !== o; ) {
1964
- r = vr(o);
1964
+ r = hr(o);
1965
1965
  for (var l in r)
1966
1966
  r[l].set && n.push(l);
1967
- o = Un(o);
1967
+ o = zn(o);
1968
1968
  }
1969
1969
  return n;
1970
1970
  }
@@ -1972,7 +1972,7 @@ function Oo(e, t, n = t) {
1972
1972
  var r = /* @__PURE__ */ new WeakSet();
1973
1973
  so(e, "input", async (o) => {
1974
1974
  var i = o ? e.defaultValue : e.value;
1975
- if (i = kn(e) ? Cn(i) : i, n(i), L !== null && r.add(L), await yo(), i !== (i = t())) {
1975
+ if (i = In(e) ? Mn(i) : i, n(i), N !== null && r.add(N), await yo(), i !== (i = t())) {
1976
1976
  var l = e.selectionStart, s = e.selectionEnd, c = e.value.length;
1977
1977
  if (e.value = i ?? "", s !== null) {
1978
1978
  var u = e.value.length;
@@ -1983,24 +1983,24 @@ function Oo(e, t, n = t) {
1983
1983
  // then use the updated value from the input instead.
1984
1984
  // If defaultValue is set, then value == defaultValue
1985
1985
  // TODO Svelte 6: remove input.value check and set to empty string?
1986
- w(t) == null && e.value && (n(kn(e) ? Cn(e.value) : e.value), L !== null && r.add(L)), Yn(() => {
1986
+ w(t) == null && e.value && (n(In(e) ? Mn(e.value) : e.value), N !== null && r.add(N)), Wn(() => {
1987
1987
  var o = t();
1988
1988
  if (e === document.activeElement) {
1989
1989
  var i = (
1990
1990
  /** @type {Batch} */
1991
- Kt ?? L
1991
+ Yt ?? N
1992
1992
  );
1993
1993
  if (r.has(i))
1994
1994
  return;
1995
1995
  }
1996
- kn(e) && o === Cn(e.value) || e.type === "date" && !o && !e.value || o !== e.value && (e.value = o ?? "");
1996
+ In(e) && o === Mn(e.value) || e.type === "date" && !o && !e.value || o !== e.value && (e.value = o ?? "");
1997
1997
  });
1998
1998
  }
1999
- function kn(e) {
1999
+ function In(e) {
2000
2000
  var t = e.type;
2001
2001
  return t === "number" || t === "range";
2002
2002
  }
2003
- function Cn(e) {
2003
+ function Mn(e) {
2004
2004
  return e === "" ? null : +e;
2005
2005
  }
2006
2006
  function Fo(e) {
@@ -2012,10 +2012,10 @@ function Fo(e) {
2012
2012
  return n.preventDefault(), e?.apply(this, t);
2013
2013
  };
2014
2014
  }
2015
- function ln(e = !1) {
2015
+ function fn(e = !1) {
2016
2016
  const t = (
2017
2017
  /** @type {ComponentContextLegacy} */
2018
- $
2018
+ ee
2019
2019
  ), n = t.l.u;
2020
2020
  if (!n) return;
2021
2021
  let r = () => G(t.s);
@@ -2024,7 +2024,7 @@ function ln(e = !1) {
2024
2024
  /** @type {Record<string, any>} */
2025
2025
  {}
2026
2026
  );
2027
- const l = /* @__PURE__ */ an(() => {
2027
+ const l = /* @__PURE__ */ cn(() => {
2028
2028
  let s = !1;
2029
2029
  const c = t.s;
2030
2030
  for (const u in c)
@@ -2034,25 +2034,25 @@ function ln(e = !1) {
2034
2034
  r = () => a(l);
2035
2035
  }
2036
2036
  n.b.length && co(() => {
2037
- sr(t, r), xn(n.b);
2038
- }), tr(() => {
2037
+ cr(t, r), Tn(n.b);
2038
+ }), rr(() => {
2039
2039
  const o = w(() => n.m.map(Ni));
2040
2040
  return () => {
2041
2041
  for (const i of o)
2042
2042
  typeof i == "function" && i();
2043
2043
  };
2044
- }), n.a.length && tr(() => {
2045
- sr(t, r), xn(n.a);
2044
+ }), n.a.length && rr(() => {
2045
+ cr(t, r), Tn(n.a);
2046
2046
  });
2047
2047
  }
2048
- function sr(e, t) {
2048
+ function cr(e, t) {
2049
2049
  if (e.l.s)
2050
2050
  for (const n of e.l.s) a(n);
2051
2051
  t();
2052
2052
  }
2053
- function qr(e, t, n) {
2053
+ function Yr(e, t, n) {
2054
2054
  if (e == null)
2055
- return t(void 0), Mn;
2055
+ return t(void 0), Rn;
2056
2056
  const r = w(
2057
2057
  () => e.subscribe(
2058
2058
  t,
@@ -2064,33 +2064,33 @@ function qr(e, t, n) {
2064
2064
  }
2065
2065
  function Do(e) {
2066
2066
  let t;
2067
- return qr(e, (n) => t = n)(), t;
2067
+ return Yr(e, (n) => t = n)(), t;
2068
2068
  }
2069
- let Ht = !1, Fn = /* @__PURE__ */ Symbol();
2069
+ let qt = !1, Un = /* @__PURE__ */ Symbol();
2070
2070
  function Uo(e, t, n) {
2071
2071
  const r = n[t] ??= {
2072
2072
  store: null,
2073
- source: /* @__PURE__ */ X(void 0),
2074
- unsubscribe: Mn
2073
+ source: /* @__PURE__ */ $(void 0),
2074
+ unsubscribe: Rn
2075
2075
  };
2076
- if (r.store !== e && !(Fn in n))
2076
+ if (r.store !== e && !(Un in n))
2077
2077
  if (r.unsubscribe(), r.store = e ?? null, e == null)
2078
- r.source.v = void 0, r.unsubscribe = Mn;
2078
+ r.source.v = void 0, r.unsubscribe = Rn;
2079
2079
  else {
2080
2080
  var o = !0;
2081
- r.unsubscribe = qr(e, (i) => {
2082
- o ? r.source.v = i : A(r.source, i);
2081
+ r.unsubscribe = Yr(e, (i) => {
2082
+ o ? r.source.v = i : T(r.source, i);
2083
2083
  }), o = !1;
2084
2084
  }
2085
- return e && Fn in n ? Do(e) : a(r.source);
2085
+ return e && Un in n ? Do(e) : a(r.source);
2086
2086
  }
2087
2087
  function jo() {
2088
2088
  const e = {};
2089
2089
  function t() {
2090
- qn(() => {
2090
+ Yn(() => {
2091
2091
  for (var n in e)
2092
2092
  e[n].unsubscribe();
2093
- dr(e, Fn, {
2093
+ pr(e, Un, {
2094
2094
  enumerable: !1,
2095
2095
  value: !0
2096
2096
  });
@@ -2099,15 +2099,15 @@ function jo() {
2099
2099
  return [e, t];
2100
2100
  }
2101
2101
  function zo(e) {
2102
- var t = Ht;
2102
+ var t = qt;
2103
2103
  try {
2104
- return Ht = !1, [e(), Ht];
2104
+ return qt = !1, [e(), qt];
2105
2105
  } finally {
2106
- Ht = t;
2106
+ qt = t;
2107
2107
  }
2108
2108
  }
2109
- function D(e, t, n, r) {
2110
- var o = !Lt || (n & Pi) !== 0, i = (n & ki) !== 0, l = (n & Ci) !== 0, s = (
2109
+ function F(e, t, n, r) {
2110
+ var o = !Ot || (n & Pi) !== 0, i = (n & ki) !== 0, l = (n & Ci) !== 0, s = (
2111
2111
  /** @type {V} */
2112
2112
  r
2113
2113
  ), c = !0, u = () => (c && (c = !1, s = l ? w(
@@ -2118,54 +2118,54 @@ function D(e, t, n, r) {
2118
2118
  r
2119
2119
  )), s), f;
2120
2120
  if (i) {
2121
- var d = pt in e || Oi in e;
2122
- f = Bt(e, t)?.set ?? (d && t in e ? (S) => e[t] = S : void 0);
2121
+ var h = mt in e || Oi in e;
2122
+ f = Vt(e, t)?.set ?? (h && t in e ? (k) => e[t] = k : void 0);
2123
2123
  }
2124
- var v, m = !1;
2125
- i ? [v, m] = zo(() => (
2124
+ var d, m = !1;
2125
+ i ? [d, m] = zo(() => (
2126
2126
  /** @type {V} */
2127
2127
  e[t]
2128
- )) : v = /** @type {V} */
2129
- e[t], v === void 0 && r !== void 0 && (v = u(), f && (o && Bi(), f(v)));
2128
+ )) : d = /** @type {V} */
2129
+ e[t], d === void 0 && r !== void 0 && (d = u(), f && (o && Bi(), f(d)));
2130
2130
  var _;
2131
2131
  if (o ? _ = () => {
2132
- var S = (
2132
+ var k = (
2133
2133
  /** @type {V} */
2134
2134
  e[t]
2135
2135
  );
2136
- return S === void 0 ? u() : (c = !0, S);
2136
+ return k === void 0 ? u() : (c = !0, k);
2137
2137
  } : _ = () => {
2138
- var S = (
2138
+ var k = (
2139
2139
  /** @type {V} */
2140
2140
  e[t]
2141
2141
  );
2142
- return S !== void 0 && (s = /** @type {V} */
2143
- void 0), S === void 0 ? s : S;
2142
+ return k !== void 0 && (s = /** @type {V} */
2143
+ void 0), k === void 0 ? s : k;
2144
2144
  }, o && (n & Si) === 0)
2145
2145
  return _;
2146
2146
  if (f) {
2147
- var h = e.$$legacy;
2147
+ var p = e.$$legacy;
2148
2148
  return (
2149
2149
  /** @type {() => V} */
2150
- (function(S, H) {
2151
- return arguments.length > 0 ? ((!o || !H || h || m) && f(H ? _() : S), S) : _();
2150
+ (function(k, z) {
2151
+ return arguments.length > 0 ? ((!o || !z || p || m) && f(z ? _() : k), k) : _();
2152
2152
  })
2153
2153
  );
2154
2154
  }
2155
- var p = !1, y = ((n & Ei) !== 0 ? an : xt)(() => (p = !1, _()));
2155
+ var v = !1, y = ((n & Ei) !== 0 ? cn : Rt)(() => (v = !1, _()));
2156
2156
  i && a(y);
2157
- var q = (
2157
+ var B = (
2158
2158
  /** @type {Effect} */
2159
- z
2159
+ j
2160
2160
  );
2161
2161
  return (
2162
2162
  /** @type {() => V} */
2163
- (function(S, H) {
2163
+ (function(k, z) {
2164
2164
  if (arguments.length > 0) {
2165
- const B = H ? a(y) : o && i ? vt(S) : S;
2166
- return A(y, B), p = !0, s !== void 0 && (s = B), S;
2165
+ const H = z ? a(y) : o && i ? ht(k) : k;
2166
+ return T(y, H), v = !0, s !== void 0 && (s = H), k;
2167
2167
  }
2168
- return it && p || (q.f & Re) !== 0 ? y.v : a(y);
2168
+ return ot && v || (B.f & Re) !== 0 ? y.v : a(y);
2169
2169
  })
2170
2170
  );
2171
2171
  }
@@ -2233,28 +2233,29 @@ function Go(e, t) {
2233
2233
  }
2234
2234
  function Wo(e) {
2235
2235
  const { config: t, onSuccess: n, onError: r, onClose: o, onStateChange: i, apiBaseUrl: l } = e;
2236
- let s = si();
2236
+ let s = si(), c = 0;
2237
2237
  t.initialPaymentIntent && (s = {
2238
2238
  ...s,
2239
2239
  status: "ready",
2240
2240
  paymentIntent: t.initialPaymentIntent,
2241
2241
  selectedMethod: t.initialPaymentIntent.availableMethods?.length === 1 ? t.initialPaymentIntent.availableMethods[0] : null
2242
2242
  });
2243
- const c = /* @__PURE__ */ new Set(), u = new li({
2243
+ const u = /* @__PURE__ */ new Set(), f = new li({
2244
2244
  publicKey: t.publicKey,
2245
2245
  baseUrl: l
2246
- }), f = () => {
2247
- c.forEach((k) => k(s));
2248
- }, d = (k) => {
2249
- const x = s.status;
2250
- s = fi(s, k), f(), s.status !== x && i?.(s.status);
2251
- }, v = (k) => (c.add(k), k(s), () => c.delete(k)), m = async (k, x) => {
2246
+ }), h = () => {
2247
+ u.forEach((S) => S(s));
2248
+ }, d = (S) => {
2249
+ const M = s.status;
2250
+ s = fi(s, S), h(), s.status !== M && i?.(s.status);
2251
+ }, m = (S) => (u.add(S), S(s), () => u.delete(S)), _ = async (S, M) => {
2252
+ const K = ++c;
2252
2253
  d({ type: "INIT_START" });
2253
2254
  try {
2254
- const T = t.reference || ci(), K = ui(t.currency), g = t.paymentMethods && t.paymentMethods.length === 1 ? t.paymentMethods[0] : void 0, he = k ?? g;
2255
- let Ee, ae;
2255
+ const b = t.reference || ci(), V = ui(t.currency), Oe = t.paymentMethods && t.paymentMethods.length === 1 ? t.paymentMethods[0] : void 0, _e = S ?? Oe;
2256
+ let at, Ie;
2256
2257
  if (t.paymentLinkCode) {
2257
- const me = await fetch(
2258
+ const we = await fetch(
2258
2259
  `${l || Ho}/v1/pay/${t.paymentLinkCode}/pay`,
2259
2260
  {
2260
2261
  method: "POST",
@@ -2267,118 +2268,122 @@ function Wo(e) {
2267
2268
  email: t.email || "",
2268
2269
  name: t.customerName || "",
2269
2270
  phone: t.phone || "",
2270
- method: he,
2271
- country: K,
2272
- provider: x?.preferredProvider || x?.allowedProviders?.[0],
2271
+ method: _e,
2272
+ country: V,
2273
+ provider: M?.preferredProvider || M?.allowedProviders?.[0],
2273
2274
  custom_fields: t.customFields
2274
2275
  })
2275
2276
  }
2276
- ), yt = await me.json().catch(() => ({}));
2277
- me.ok ? Ee = yt : ae = Bo(me, yt);
2277
+ ), jt = await we.json().catch(() => ({}));
2278
+ we.ok ? at = jt : Ie = Bo(we, jt);
2278
2279
  } else {
2279
- const me = await u.createPaymentIntent(
2280
- { ...t, reference: T },
2281
- he,
2282
- K,
2280
+ const we = await f.createPaymentIntent(
2281
+ { ...t, reference: b },
2282
+ _e,
2283
+ V,
2283
2284
  {
2284
- preferredProviders: x?.preferredProvider ? [x.preferredProvider] : void 0,
2285
- allowedProviders: x?.allowedProviders
2285
+ preferredProviders: M?.preferredProvider ? [M.preferredProvider] : void 0,
2286
+ allowedProviders: M?.allowedProviders
2286
2287
  }
2287
2288
  );
2288
- Ee = me.data, ae = me.error;
2289
+ at = we.data, Ie = we.error;
2289
2290
  }
2290
- if (ae) {
2291
- d({ type: "INIT_ERROR", payload: ae }), r?.(ae);
2291
+ if (K !== c)
2292
+ return;
2293
+ if (Ie) {
2294
+ d({ type: "INIT_ERROR", payload: Ie }), r?.(Ie);
2292
2295
  return;
2293
2296
  }
2294
- if (!Ee) {
2295
- const me = {
2297
+ if (!at) {
2298
+ const we = {
2296
2299
  code: "INIT_FAILED",
2297
2300
  message: "No data received from API",
2298
2301
  recoverable: !0
2299
2302
  };
2300
- d({ type: "INIT_ERROR", payload: me }), r?.(me);
2303
+ d({ type: "INIT_ERROR", payload: we }), r?.(we);
2301
2304
  return;
2302
2305
  }
2303
- const un = Go(Ee, { ...t, reference: T });
2304
- d({ type: "INIT_SUCCESS", payload: un });
2305
- } catch (T) {
2306
- const K = {
2306
+ const Ut = Go(at, { ...t, reference: b });
2307
+ d({ type: "INIT_SUCCESS", payload: Ut });
2308
+ } catch (b) {
2309
+ if (K !== c)
2310
+ return;
2311
+ const V = {
2307
2312
  code: "INIT_FAILED",
2308
- message: T instanceof Error ? T.message : "Failed to initialize checkout",
2313
+ message: b instanceof Error ? b.message : "Failed to initialize checkout",
2309
2314
  recoverable: !0,
2310
- originalError: T
2315
+ originalError: b
2311
2316
  };
2312
- d({ type: "INIT_ERROR", payload: K }), r?.(K);
2317
+ d({ type: "INIT_ERROR", payload: V }), r?.(V);
2313
2318
  }
2314
- }, _ = (k) => {
2315
- d({ type: "SELECT_METHOD", payload: k });
2316
- }, h = async (k) => {
2319
+ }, p = (S) => {
2320
+ d({ type: "SELECT_METHOD", payload: S });
2321
+ }, v = async (S) => {
2317
2322
  if (!(!s.paymentIntent || !s.selectedMethod)) {
2318
2323
  d({ type: "PROCESS_START" });
2319
2324
  try {
2320
- let x;
2325
+ let M;
2321
2326
  if (s.paymentIntent.clientSecret) {
2322
- const { data: K, error: g } = await u.confirmPaymentIntent(
2327
+ const { data: b, error: V } = await f.confirmPaymentIntent(
2323
2328
  s.paymentIntent.id,
2324
2329
  s.paymentIntent.clientSecret
2325
2330
  );
2326
- if (g) {
2327
- d({ type: "PROCESS_ERROR", payload: g }), r?.(g);
2331
+ if (V) {
2332
+ d({ type: "PROCESS_ERROR", payload: V }), r?.(V);
2328
2333
  return;
2329
2334
  }
2330
- x = K;
2335
+ M = b;
2331
2336
  } else {
2332
- const { data: K, error: g } = await u.confirmPayment(s.paymentIntent.id);
2333
- if (g) {
2334
- d({ type: "PROCESS_ERROR", payload: g }), r?.(g);
2337
+ const { data: b, error: V } = await f.confirmPayment(s.paymentIntent.id);
2338
+ if (V) {
2339
+ d({ type: "PROCESS_ERROR", payload: V }), r?.(V);
2335
2340
  return;
2336
2341
  }
2337
- x = K;
2342
+ M = b;
2338
2343
  }
2339
- const T = {
2344
+ const K = {
2340
2345
  paymentId: s.paymentIntent.id,
2341
- reference: k.reference || s.paymentIntent.reference || s.paymentIntent.metadata?.reference || "",
2346
+ reference: S.reference || s.paymentIntent.reference || s.paymentIntent.metadata?.reference || "",
2342
2347
  amount: s.paymentIntent.amount,
2343
2348
  currency: s.paymentIntent.currency,
2344
2349
  paymentMethod: s.selectedMethod,
2345
2350
  psp: s.paymentIntent.recommendedPsp,
2346
- pspReference: k.pspReference || x?.provider_ref_id || "",
2351
+ pspReference: S.pspReference || M?.provider_ref_id || "",
2347
2352
  status: "success",
2348
- metadata: k
2353
+ metadata: S
2349
2354
  };
2350
- d({ type: "PROCESS_SUCCESS", payload: T }), n?.(T);
2351
- } catch (x) {
2352
- const T = {
2355
+ d({ type: "PROCESS_SUCCESS", payload: K }), n?.(K);
2356
+ } catch (M) {
2357
+ const K = {
2353
2358
  code: "PAYMENT_FAILED",
2354
- message: x instanceof Error ? x.message : "Payment failed",
2359
+ message: M instanceof Error ? M.message : "Payment failed",
2355
2360
  recoverable: !0,
2356
- originalError: x
2361
+ originalError: M
2357
2362
  };
2358
- d({ type: "PROCESS_ERROR", payload: T }), r?.(T);
2363
+ d({ type: "PROCESS_ERROR", payload: K }), r?.(K);
2359
2364
  }
2360
2365
  }
2361
2366
  };
2362
2367
  return {
2363
2368
  // Svelte store contract
2364
- subscribe: v,
2369
+ subscribe: m,
2365
2370
  // Actions
2366
- initialize: m,
2367
- selectMethod: _,
2368
- processPayment: h,
2369
- handlePspSuccess: async (k) => {
2370
- await h(k);
2371
+ initialize: _,
2372
+ selectMethod: p,
2373
+ processPayment: v,
2374
+ handlePspSuccess: async (S) => {
2375
+ await v(S);
2371
2376
  },
2372
- handlePspError: (k) => {
2373
- d({ type: "PROCESS_ERROR", payload: k }), r?.(k);
2377
+ handlePspError: (S) => {
2378
+ d({ type: "PROCESS_ERROR", payload: S }), r?.(S);
2374
2379
  },
2375
2380
  reset: () => {
2376
- d({ type: "RESET" });
2381
+ c += 1, d({ type: "RESET" });
2377
2382
  },
2378
2383
  close: async () => {
2379
2384
  if (s.paymentIntent && s.status !== "success")
2380
2385
  try {
2381
- await u.cancelPaymentIntent(s.paymentIntent.id);
2386
+ await f.cancelPaymentIntent(s.paymentIntent.id);
2382
2387
  } catch {
2383
2388
  }
2384
2389
  d({ type: "CLOSE" }), o?.();
@@ -2396,20 +2401,20 @@ function Wo(e) {
2396
2401
  };
2397
2402
  }
2398
2403
  var Jo = /* @__PURE__ */ R('<div class="reevit-method-selector__label">Select payment method</div>'), Zo = /* @__PURE__ */ R('<span class="reevit-method-option__description"> </span>'), Qo = /* @__PURE__ */ R('<span class="reevit-method-option__check"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"><polyline points="20 6 9 17 4 12"></polyline></svg></span>'), Xo = /* @__PURE__ */ R('<span class="reevit-method-option__chevron"><svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><polyline points="9 18 15 12 9 6"></polyline></svg></span>'), $o = /* @__PURE__ */ R('<button type="button"><span class="reevit-method-option__icon-wrapper"><span class="reevit-method-option__icon"> </span></span> <div class="reevit-method-option__content"><span class="reevit-method-option__label"> </span> <!></div> <!></button>'), ea = /* @__PURE__ */ R("<div><!> <div></div></div>");
2399
- function Vr(e, t) {
2400
- nn(t, !1);
2401
- const n = /* @__PURE__ */ X(), r = /* @__PURE__ */ X();
2402
- let o = D(t, "methods", 8), i = D(t, "selected", 8);
2403
- D(t, "provider", 8, void 0);
2404
- let l = D(t, "layout", 8, "list"), s = D(t, "showLabel", 8, !0);
2405
- const c = $t();
2404
+ function Gr(e, t) {
2405
+ an(t, !1);
2406
+ const n = /* @__PURE__ */ $(), r = /* @__PURE__ */ $();
2407
+ let o = F(t, "methods", 8), i = F(t, "selected", 8);
2408
+ F(t, "provider", 8, void 0);
2409
+ let l = F(t, "layout", 8, "list"), s = F(t, "showLabel", 8, !0);
2410
+ const c = nn();
2406
2411
  function u(_) {
2407
2412
  c("select", _);
2408
2413
  }
2409
- ee(() => G(l()), () => {
2410
- A(n, l() === "grid");
2411
- }), ee(() => G(o()), () => {
2412
- A(r, [
2414
+ te(() => G(l()), () => {
2415
+ T(n, l() === "grid");
2416
+ }), te(() => G(o()), () => {
2417
+ T(r, [
2413
2418
  {
2414
2419
  id: "card",
2415
2420
  name: "Card",
@@ -2429,80 +2434,80 @@ function Vr(e, t) {
2429
2434
  description: "Pay directly from your bank account"
2430
2435
  }
2431
2436
  ].filter((_) => o().includes(_.id)));
2432
- }), Vn(), ln();
2433
- var f = ea(), d = E(f);
2437
+ }), Gn(), fn();
2438
+ var f = ea(), h = E(f);
2434
2439
  {
2435
- var v = (_) => {
2436
- var h = Jo();
2437
- P(_, h);
2440
+ var d = (_) => {
2441
+ var p = Jo();
2442
+ P(_, p);
2438
2443
  };
2439
- J(d, (_) => {
2440
- s() && _(v);
2444
+ J(h, (_) => {
2445
+ s() && _(d);
2441
2446
  });
2442
2447
  }
2443
- var m = j(d, 2);
2444
- Jn(m, 7, () => a(r), (_) => _.id, (_, h, p) => {
2445
- var y = $o(), q = E(y), S = E(q), H = E(S), B = j(q, 2), Q = E(B), O = E(Q), V = j(Q, 2);
2448
+ var m = U(h, 2);
2449
+ Qn(m, 7, () => a(r), (_) => _.id, (_, p, v) => {
2450
+ var y = $o(), B = E(y), k = E(B), z = E(k), H = U(B, 2), X = E(H), L = E(X), q = U(X, 2);
2446
2451
  {
2447
2452
  var C = (I) => {
2448
- var k = Zo(), x = E(k);
2449
- Z(() => ve(x, (a(h), w(() => a(h).description)))), P(I, k);
2453
+ var Z = Zo(), S = E(Z);
2454
+ Q(() => ve(S, (a(p), w(() => a(p).description)))), P(I, Z);
2450
2455
  };
2451
- J(V, (I) => {
2456
+ J(q, (I) => {
2452
2457
  a(n) || I(C);
2453
2458
  });
2454
2459
  }
2455
- var b = j(B, 2);
2460
+ var g = U(H, 2);
2456
2461
  {
2457
- var F = (I) => {
2458
- var k = ft(), x = Be(k);
2462
+ var O = (I) => {
2463
+ var Z = vt(), S = Ke(Z);
2459
2464
  {
2460
- var T = (g) => {
2461
- var he = Qo();
2462
- P(g, he);
2463
- }, K = (g) => {
2464
- var he = Xo();
2465
- P(g, he);
2465
+ var M = (b) => {
2466
+ var V = Qo();
2467
+ P(b, V);
2468
+ }, K = (b) => {
2469
+ var V = Xo();
2470
+ P(b, V);
2466
2471
  };
2467
- J(x, (g) => {
2468
- G(i()), a(h), w(() => i() === a(h).id) ? g(T) : g(K, !1);
2472
+ J(S, (b) => {
2473
+ G(i()), a(p), w(() => i() === a(p).id) ? b(M) : b(K, !1);
2469
2474
  });
2470
2475
  }
2471
- P(I, k);
2476
+ P(I, Z);
2472
2477
  };
2473
- J(b, (I) => {
2474
- a(n) || I(F);
2478
+ J(g, (I) => {
2479
+ a(n) || I(O);
2475
2480
  });
2476
2481
  }
2477
- Z(
2482
+ Q(
2478
2483
  (I) => {
2479
- tt(y, 1, I), Zn(y, `animation-delay: ${a(p) * 0.05}s`), ve(H, (a(h), w(() => a(h).icon))), ve(O, (a(h), w(() => a(h).name)));
2484
+ nt(y, 1, I), Xn(y, `animation-delay: ${a(v) * 0.05}s`), ve(z, (a(p), w(() => a(p).icon))), ve(L, (a(p), w(() => a(p).name)));
2480
2485
  },
2481
2486
  [
2482
- () => et((G(de), a(n), G(i()), a(h), w(() => de(
2487
+ () => tt((G(de), a(n), G(i()), a(p), w(() => de(
2483
2488
  "reevit-method-option",
2484
2489
  a(n) ? "reevit-method-option--grid" : "reevit-method-option--list",
2485
- i() === a(h).id && "reevit-method-option--selected"
2490
+ i() === a(p).id && "reevit-method-option--selected"
2486
2491
  ))))
2487
2492
  ]
2488
- ), fe("click", y, () => u(a(h).id)), P(_, y);
2489
- }), Z(
2490
- (_, h) => {
2491
- tt(f, 1, _), tt(m, 1, h);
2493
+ ), fe("click", y, () => u(a(p).id)), P(_, y);
2494
+ }), Q(
2495
+ (_, p) => {
2496
+ nt(f, 1, _), nt(m, 1, p);
2492
2497
  },
2493
2498
  [
2494
- () => et((G(de), a(n), w(() => de("reevit-method-selector", a(n) && "reevit-method-selector--grid")))),
2495
- () => et((G(de), a(n), w(() => de("reevit-method-selector__options", a(n) ? "reevit-method-selector__options--grid" : "reevit-method-selector__options--list"))))
2499
+ () => tt((G(de), a(n), w(() => de("reevit-method-selector", a(n) && "reevit-method-selector--grid")))),
2500
+ () => tt((G(de), a(n), w(() => de("reevit-method-selector__options", a(n) ? "reevit-method-selector__options--grid" : "reevit-method-selector__options--list"))))
2496
2501
  ]
2497
- ), P(e, f), rn();
2502
+ ), P(e, f), sn();
2498
2503
  }
2499
2504
  var ta = /* @__PURE__ */ R('<img alt="" class="reevit-psp-option__logo-img" loading="lazy"/>'), na = /* @__PURE__ */ R('<span class="reevit-psp-option__logo-fallback"> </span>'), ra = /* @__PURE__ */ R('<div class="reevit-psp-accordion__content reevit-animate-fade-in"><div class="reevit-psp-methods"><!></div> <!></div>'), ia = /* @__PURE__ */ R('<div class="reevit-psp-accordion"><button type="button"><span class="reevit-psp-option__logo" aria-hidden="true"><!></span> <div class="reevit-psp-option__content"><span class="reevit-psp-option__name"> </span> <span class="reevit-psp-option__methods"> </span></div></button> <!></div>'), oa = /* @__PURE__ */ R('<div class="reevit-psp-selector"><div class="reevit-psp-selector__label">Select payment provider</div> <div class="reevit-psp-selector__options"></div></div>');
2500
2505
  function aa(e, t) {
2501
- nn(t, !1);
2502
- let n = D(t, "providers", 24, () => []), r = D(t, "selectedProvider", 8, null), o = D(t, "disabled", 8, !1);
2503
- D(t, "theme", 8, void 0);
2504
- let i = D(t, "selectedMethod", 8, null);
2505
- const l = $t(), s = {
2506
+ an(t, !1);
2507
+ let n = F(t, "providers", 24, () => []), r = F(t, "selectedProvider", 8, null), o = F(t, "disabled", 8, !1);
2508
+ F(t, "theme", 8, void 0);
2509
+ let i = F(t, "selectedMethod", 8, null);
2510
+ const l = nn(), s = {
2506
2511
  paystack: "https://reevit.io/images/providers/paystack.png",
2507
2512
  stripe: "https://reevit.io/images/providers/stripe.png",
2508
2513
  flutterwave: "https://reevit.io/images/providers/flutterwave.png",
@@ -2513,34 +2518,34 @@ function aa(e, t) {
2513
2518
  card: "Card",
2514
2519
  mobile_money: "Mobile Money",
2515
2520
  bank_transfer: "Bank Transfer"
2516
- }, u = (_) => _.length ? _.map((h) => c[h]).join(", ") : "Payment methods", f = (_, h) => _.toLowerCase().includes("hubtel") ? h.filter((p) => p === "card" || p === "mobile_money") : h;
2517
- function d(_) {
2521
+ }, u = (_) => _.length ? _.map((p) => c[p]).join(", ") : "Payment methods", f = (_, p) => _.toLowerCase().includes("hubtel") ? p.filter((v) => v === "card" || v === "mobile_money") : p;
2522
+ function h(_) {
2518
2523
  l("select", _);
2519
2524
  }
2520
- ln();
2521
- var v = oa(), m = j(E(v), 2);
2522
- Jn(m, 5, n, (_) => _.provider, (_, h) => {
2523
- const p = /* @__PURE__ */ xt(() => (G(r()), a(h), w(() => r() === a(h).provider))), y = /* @__PURE__ */ xt(() => (a(h), w(() => f(a(h).provider, a(h).methods))));
2524
- var q = ia(), S = E(q), H = E(S), B = E(H);
2525
+ fn();
2526
+ var d = oa(), m = U(E(d), 2);
2527
+ Qn(m, 5, n, (_) => _.provider, (_, p) => {
2528
+ const v = /* @__PURE__ */ Rt(() => (G(r()), a(p), w(() => r() === a(p).provider))), y = /* @__PURE__ */ Rt(() => (a(p), w(() => f(a(p).provider, a(p).methods))));
2529
+ var B = ia(), k = E(B), z = E(k), H = E(z);
2525
2530
  {
2526
- var Q = (T) => {
2531
+ var X = (M) => {
2527
2532
  var K = ta();
2528
- Z(() => Xt(K, "src", (a(h), w(() => s[a(h).provider])))), P(T, K);
2529
- }, O = (T) => {
2530
- var K = na(), g = E(K);
2531
- Z((he) => ve(g, he), [
2532
- () => (a(h), w(() => a(h).name.slice(0, 1).toUpperCase()))
2533
- ]), P(T, K);
2533
+ Q(() => tn(K, "src", (a(p), w(() => s[a(p).provider])))), P(M, K);
2534
+ }, L = (M) => {
2535
+ var K = na(), b = E(K);
2536
+ Q((V) => ve(b, V), [
2537
+ () => (a(p), w(() => a(p).name.slice(0, 1).toUpperCase()))
2538
+ ]), P(M, K);
2534
2539
  };
2535
- J(B, (T) => {
2536
- a(h), w(() => s[a(h).provider]) ? T(Q) : T(O, !1);
2540
+ J(H, (M) => {
2541
+ a(p), w(() => s[a(p).provider]) ? M(X) : M(L, !1);
2537
2542
  });
2538
2543
  }
2539
- var V = j(H, 2), C = E(V), b = E(C), F = j(C, 2), I = E(F), k = j(S, 2);
2544
+ var q = U(z, 2), C = E(q), g = E(C), O = U(C, 2), I = E(O), Z = U(k, 2);
2540
2545
  {
2541
- var x = (T) => {
2542
- var K = ra(), g = E(K), he = E(g);
2543
- Vr(he, {
2546
+ var S = (M) => {
2547
+ var K = ra(), b = E(K), V = E(b);
2548
+ Gr(V, {
2544
2549
  get methods() {
2545
2550
  return a(y);
2546
2551
  },
@@ -2548,43 +2553,43 @@ function aa(e, t) {
2548
2553
  return i();
2549
2554
  },
2550
2555
  get provider() {
2551
- return a(h), w(() => a(h).provider);
2556
+ return a(p), w(() => a(p).provider);
2552
2557
  },
2553
2558
  layout: "list",
2554
2559
  showLabel: !1,
2555
- $$events: { select: (ae) => l("methodSelect", ae.detail) }
2560
+ $$events: { select: (_e) => l("methodSelect", _e.detail) }
2556
2561
  });
2557
- var Ee = j(g, 2);
2558
- On(Ee, t, "method-content", {}, null), P(T, K);
2562
+ var Oe = U(b, 2);
2563
+ Dn(Oe, t, "method-content", {}, null), P(M, K);
2559
2564
  };
2560
- J(k, (T) => {
2561
- a(p) && T(x);
2565
+ J(Z, (M) => {
2566
+ a(v) && M(S);
2562
2567
  });
2563
2568
  }
2564
- Z(
2565
- (T, K) => {
2566
- tt(S, 1, T), S.disabled = o(), Xt(S, "aria-expanded", a(p)), ve(b, (a(h), w(() => a(h).name))), ve(I, K);
2569
+ Q(
2570
+ (M, K) => {
2571
+ nt(k, 1, M), k.disabled = o(), tn(k, "aria-expanded", a(v)), ve(g, (a(p), w(() => a(p).name))), ve(I, K);
2567
2572
  },
2568
2573
  [
2569
- () => et((G(de), G(a(p)), G(o()), w(() => de("reevit-psp-option", a(p) && "reevit-psp-option--selected", o() && "reevit-psp-option--disabled")))),
2574
+ () => tt((G(de), G(a(v)), G(o()), w(() => de("reevit-psp-option", a(v) && "reevit-psp-option--selected", o() && "reevit-psp-option--disabled")))),
2570
2575
  () => (G(a(y)), w(() => u(a(y))))
2571
2576
  ]
2572
- ), fe("click", S, () => d(a(h).provider)), P(_, q);
2573
- }), P(e, v), rn();
2577
+ ), fe("click", k, () => h(a(p).provider)), P(_, B);
2578
+ }), P(e, d), sn();
2574
2579
  }
2575
2580
  var sa = /* @__PURE__ */ R('<button type="button"><div class="reevit-network-dot"></div> </button>'), la = /* @__PURE__ */ R('<p class="reevit-error-message"> </p>'), ca = /* @__PURE__ */ R('<button type="button" class="reevit-btn reevit-btn--secondary">Back</button>'), ua = /* @__PURE__ */ R('<span class="reevit-spinner"></span>'), fa = /* @__PURE__ */ R("<span>Continue</span>"), da = /* @__PURE__ */ R('<form class="reevit-momo-form"><div class="reevit-form-group"><label class="reevit-label" for="reevit-phone">Phone Number</label> <input id="reevit-phone" type="tel" placeholder="e.g. 024 123 4567" autocomplete="tel"/></div> <div class="reevit-network-selector"><label class="reevit-label" for="reevit-network-grid">Select Network</label> <div id="reevit-network-grid" class="reevit-networks-grid"></div></div> <!> <div class="reevit-momo-form__actions"><!> <button type="submit" class="reevit-btn reevit-btn--primary"><!></button></div> <p class="reevit-secure-text">🔒 Secure mobile money payment via Reevit</p></form>');
2576
- function lr(e, t) {
2577
- nn(t, !1);
2578
- let n = D(t, "initialPhone", 8, ""), r = D(t, "loading", 8, !1), o = D(t, "hideCancel", 8, !1);
2579
- const i = $t();
2580
- let l = /* @__PURE__ */ X(n()), s = /* @__PURE__ */ X(null), c = /* @__PURE__ */ X(null);
2581
+ function ur(e, t) {
2582
+ an(t, !1);
2583
+ let n = F(t, "initialPhone", 8, ""), r = F(t, "loading", 8, !1), o = F(t, "hideCancel", 8, !1);
2584
+ const i = nn();
2585
+ let l = /* @__PURE__ */ $(n()), s = /* @__PURE__ */ $(null), c = /* @__PURE__ */ $(null);
2581
2586
  function u() {
2582
- if (!Pn(a(l))) {
2583
- A(c, "Please enter a valid phone number");
2587
+ if (!kn(a(l))) {
2588
+ T(c, "Please enter a valid phone number");
2584
2589
  return;
2585
2590
  }
2586
2591
  if (!a(s)) {
2587
- A(c, "Please select your mobile network");
2592
+ T(c, "Please select your mobile network");
2588
2593
  return;
2589
2594
  }
2590
2595
  i("submit", { phone: a(l), network: a(s) });
@@ -2594,63 +2599,63 @@ function lr(e, t) {
2594
2599
  { id: "vodafone", name: "Vodafone", color: "#E60000" },
2595
2600
  { id: "airteltigo", name: "AirtelTigo", color: "#005596" }
2596
2601
  ];
2597
- ee(() => (a(l), a(c)), () => {
2602
+ te(() => (a(l), a(c)), () => {
2598
2603
  const C = di(a(l));
2599
- C && A(s, C), a(c) && A(c, null);
2600
- }), Vn(), ln();
2601
- var d = da(), v = E(d), m = j(E(v), 2), _ = j(v, 2), h = j(E(_), 2);
2602
- Jn(h, 5, () => f, (C) => C.id, (C, b) => {
2603
- var F = sa(), I = E(F), k = j(I);
2604
- Z(
2605
- (x) => {
2606
- tt(F, 1, x), F.disabled = r(), Zn(I, `background-color: ${a(b), w(() => a(b).color) ?? ""}`), ve(k, ` ${a(b), w(() => a(b).name) ?? ""}`);
2604
+ C && T(s, C), a(c) && T(c, null);
2605
+ }), Gn(), fn();
2606
+ var h = da(), d = E(h), m = U(E(d), 2), _ = U(d, 2), p = U(E(_), 2);
2607
+ Qn(p, 5, () => f, (C) => C.id, (C, g) => {
2608
+ var O = sa(), I = E(O), Z = U(I);
2609
+ Q(
2610
+ (S) => {
2611
+ nt(O, 1, S), O.disabled = r(), Xn(I, `background-color: ${a(g), w(() => a(g).color) ?? ""}`), ve(Z, ` ${a(g), w(() => a(g).name) ?? ""}`);
2607
2612
  },
2608
2613
  [
2609
- () => et((G(de), a(s), a(b), w(() => de("reevit-network-btn", a(s) === a(b).id && "reevit-network-btn--selected"))))
2614
+ () => tt((G(de), a(s), a(g), w(() => de("reevit-network-btn", a(s) === a(g).id && "reevit-network-btn--selected"))))
2610
2615
  ]
2611
- ), fe("click", F, () => A(s, a(b).id)), P(C, F);
2616
+ ), fe("click", O, () => T(s, a(g).id)), P(C, O);
2612
2617
  });
2613
- var p = j(_, 2);
2618
+ var v = U(_, 2);
2614
2619
  {
2615
2620
  var y = (C) => {
2616
- var b = la(), F = E(b);
2617
- Z(() => ve(F, a(c))), P(C, b);
2621
+ var g = la(), O = E(g);
2622
+ Q(() => ve(O, a(c))), P(C, g);
2618
2623
  };
2619
- J(p, (C) => {
2624
+ J(v, (C) => {
2620
2625
  a(c) && C(y);
2621
2626
  });
2622
2627
  }
2623
- var q = j(p, 2), S = E(q);
2628
+ var B = U(v, 2), k = E(B);
2624
2629
  {
2625
- var H = (C) => {
2626
- var b = ca();
2627
- Z(() => b.disabled = r()), fe("click", b, () => i("cancel")), P(C, b);
2630
+ var z = (C) => {
2631
+ var g = ca();
2632
+ Q(() => g.disabled = r()), fe("click", g, () => i("cancel")), P(C, g);
2628
2633
  };
2629
- J(S, (C) => {
2630
- o() || C(H);
2634
+ J(k, (C) => {
2635
+ o() || C(z);
2631
2636
  });
2632
2637
  }
2633
- var B = j(S, 2), Q = E(B);
2638
+ var H = U(k, 2), X = E(H);
2634
2639
  {
2635
- var O = (C) => {
2636
- var b = ua();
2637
- P(C, b);
2638
- }, V = (C) => {
2639
- var b = fa();
2640
- P(C, b);
2640
+ var L = (C) => {
2641
+ var g = ua();
2642
+ P(C, g);
2643
+ }, q = (C) => {
2644
+ var g = fa();
2645
+ P(C, g);
2641
2646
  };
2642
- J(Q, (C) => {
2643
- r() ? C(O) : C(V, !1);
2647
+ J(X, (C) => {
2648
+ r() ? C(L) : C(q, !1);
2644
2649
  });
2645
2650
  }
2646
- Z(
2651
+ Q(
2647
2652
  (C) => {
2648
- tt(m, 1, C), m.disabled = r(), B.disabled = r() || !a(l);
2653
+ nt(m, 1, C), m.disabled = r(), H.disabled = r() || !a(l);
2649
2654
  },
2650
2655
  [
2651
- () => et((G(de), a(c), G(Pn), a(l), w(() => de("reevit-input", a(c) && !Pn(a(l)) && "reevit-input--error"))))
2656
+ () => tt((G(de), a(c), G(kn), a(l), w(() => de("reevit-input", a(c) && !kn(a(l)) && "reevit-input--error"))))
2652
2657
  ]
2653
- ), Oo(m, () => a(l), (C) => A(l, C)), fe("submit", d, Fo(u)), P(e, d), rn();
2658
+ ), Oo(m, () => a(l), (C) => T(l, C)), fe("submit", h, Fo(u)), P(e, h), sn();
2654
2659
  }
2655
2660
  class va {
2656
2661
  constructor(t) {
@@ -2687,8 +2692,8 @@ class va {
2687
2692
  u.textContent = "Loading...", c.appendChild(u);
2688
2693
  const f = document.createElement("iframe");
2689
2694
  f.setAttribute("id", "hubtel-iframe-element"), f.src = this.createCheckoutUrl(t, r), f.style.display = "none", f.style.width = (i = o?.width) !== null && i !== void 0 ? i : "100%", f.style.height = (l = o?.height) !== null && l !== void 0 ? l : "100%", f.style.minHeight = o?.minHeight || "400px", f.style.border = (s = o?.border) !== null && s !== void 0 ? s : "none", f.onload = () => {
2690
- var d;
2691
- c.removeChild(u), f.style.display = "block", (d = n.onLoad) === null || d === void 0 || d.call(n);
2695
+ var h;
2696
+ c.removeChild(u), f.style.display = "block", (h = n.onLoad) === null || h === void 0 || h.call(n);
2692
2697
  }, c.appendChild(f);
2693
2698
  }
2694
2699
  openModal({ purchaseInfo: t, callBacks: n, config: r }) {
@@ -2728,8 +2733,8 @@ class va {
2728
2733
  else if (f.feesChanged)
2729
2734
  (c = t.onFeesChanged) === null || c === void 0 || c.call(t, f.fees);
2730
2735
  else if (f.resize) {
2731
- const d = document.getElementById("hubtel-iframe-element");
2732
- d && (d.style.height = f.height + "px"), (u = t?.onResize) === null || u === void 0 || u.call(t, f);
2736
+ const h = document.getElementById("hubtel-iframe-element");
2737
+ h && (h.style.height = f.height + "px"), (u = t?.onResize) === null || u === void 0 || u.call(t, f);
2733
2738
  }
2734
2739
  };
2735
2740
  this.messageHandler = n, window.addEventListener("message", n, !1);
@@ -2864,9 +2869,9 @@ class va {
2864
2869
  `, document.head.appendChild(t), this.stylesInjected = !0;
2865
2870
  }
2866
2871
  }
2867
- const cr = /* @__PURE__ */ new Map();
2868
- function cn(e, t) {
2869
- const n = cr.get(t);
2872
+ const fr = /* @__PURE__ */ new Map();
2873
+ function dn(e, t) {
2874
+ const n = fr.get(t);
2870
2875
  if (n) return n;
2871
2876
  const r = new Promise((o, i) => {
2872
2877
  if (document.getElementById(t)) {
@@ -2876,22 +2881,22 @@ function cn(e, t) {
2876
2881
  const l = document.createElement("script");
2877
2882
  l.id = t, l.src = e, l.async = !0, l.onload = () => o(), l.onerror = () => i(new Error(`Failed to load ${t} script`)), document.head.appendChild(l);
2878
2883
  });
2879
- return cr.set(t, r), r;
2884
+ return fr.set(t, r), r;
2880
2885
  }
2881
2886
  function pa() {
2882
- return cn("https://js.paystack.co/v1/inline.js", "paystack-script");
2887
+ return dn("https://js.paystack.co/v1/inline.js", "paystack-script");
2883
2888
  }
2884
2889
  function Va() {
2885
2890
  return Promise.resolve();
2886
2891
  }
2887
2892
  function ha() {
2888
- return cn("https://checkout.flutterwave.com/v3.js", "flutterwave-script");
2893
+ return dn("https://checkout.flutterwave.com/v3.js", "flutterwave-script");
2889
2894
  }
2890
2895
  function ma() {
2891
- return cn("https://js.stripe.com/v3/", "stripe-script");
2896
+ return dn("https://js.stripe.com/v3/", "stripe-script");
2892
2897
  }
2893
2898
  function _a() {
2894
- return cn("https://sdk.monnify.com/plugin/monnify.js", "monnify-script");
2899
+ return dn("https://sdk.monnify.com/plugin/monnify.js", "monnify-script");
2895
2900
  }
2896
2901
  async function ya(e) {
2897
2902
  if (await pa(), !window.PaystackPop)
@@ -3023,9 +3028,9 @@ async function Pa(e, t) {
3023
3028
  }
3024
3029
  var Sa = /* @__PURE__ */ R('<span class="reevit-spinner"></span>'), ka = /* @__PURE__ */ R('<button type="button" class="reevit-pay-button"><!></button>'), Ca = /* @__PURE__ */ R('<span class="reevit-modal__brand-name"> </span>'), Ia = /* @__PURE__ */ R('<div class="reevit-loading-state"><div class="reevit-spinner reevit-spinner--large"></div> <p>Initializing payment...</p></div>'), Ma = /* @__PURE__ */ R('<div class="reevit-error-state"><div class="reevit-error-icon">⚠️</div> <h3>Payment Failed</h3> <p> </p> <button class="reevit-retry-btn">Retry</button></div>'), xa = /* @__PURE__ */ R('<div class="reevit-success-state"><div class="reevit-success-icon">✅</div> <h3>Payment Successful</h3> <p>Thank you for your payment.</p> <button class="reevit-done-btn">Done</button></div>'), Ra = /* @__PURE__ */ R(`<div class="reevit-inline-action"><p class="reevit-inline-action__hint">You'll be redirected to complete your card payment securely.</p> <button class="reevit-btn reevit-btn--primary">Pay with Card</button></div>`), Ta = /* @__PURE__ */ R('<p class="reevit-inline-action__hint"> </p> <button class="reevit-btn reevit-btn--primary"> </button>', 1), Aa = /* @__PURE__ */ R('<div class="reevit-inline-action"><!></div>'), Na = /* @__PURE__ */ R('<div slot="method-content" class="reevit-animate-fade-in"><!></div>'), La = /* @__PURE__ */ R('<span class="reevit-spinner"></span>'), Oa = /* @__PURE__ */ R("<span> </span>"), Fa = /* @__PURE__ */ R('<div class="reevit-card-info reevit-animate-fade-in"><p class="reevit-info-text"> </p> <button class="reevit-submit-btn"><!></button></div>'), Da = /* @__PURE__ */ R('<div class="reevit-method-step__actions reevit-animate-slide-up"><!></div>'), Ua = /* @__PURE__ */ R("<!> <!>", 1), ja = /* @__PURE__ */ R('<div class="reevit-method-step reevit-animate-slide-up"><!></div>'), za = /* @__PURE__ */ R('<div class="reevit-modal-overlay" role="button" tabindex="0"><div><button class="reevit-modal-close" aria-label="Close">&times;</button> <div class="reevit-modal-header"><div class="reevit-modal__branding"><img class="reevit-modal__logo"/> <!></div></div> <div class="reevit-modal-body"><!></div> <div class="reevit-modal-footer"><div class="reevit-trust-badges"><span>PCI DSS Compliant</span> <span>•</span> <span>SSL Secure</span></div></div></div></div>'), Ha = /* @__PURE__ */ R('<div class="reevit-sdk-container"><!> <!></div>');
3025
3030
  function Ga(e, t) {
3026
- nn(t, !1);
3027
- const n = () => Uo(g, "$store", r), [r, o] = jo(), i = /* @__PURE__ */ X(), l = /* @__PURE__ */ X(), s = /* @__PURE__ */ X(), c = /* @__PURE__ */ X(), u = /* @__PURE__ */ X(), f = $t();
3028
- let d = D(t, "publicKey", 8, void 0), v = D(t, "amount", 8), m = D(t, "currency", 8), _ = D(t, "email", 8, void 0), h = D(t, "phone", 8, void 0), p = D(t, "customerName", 8, void 0), y = D(t, "reference", 8, void 0), q = D(t, "metadata", 8, void 0), S = D(t, "customFields", 8, void 0), H = D(t, "paymentLinkCode", 8, void 0), B = D(t, "paymentMethods", 24, () => ["card", "mobile_money"]), Q = D(t, "theme", 24, () => ({})), O = D(t, "isOpen", 12, !1), V = D(t, "apiBaseUrl", 8, void 0), C = D(t, "initialPaymentIntent", 8, void 0), b = /* @__PURE__ */ X({}), F = /* @__PURE__ */ X(null), I = /* @__PURE__ */ X("paystack"), k = /* @__PURE__ */ X(["card", "mobile_money"]), x = /* @__PURE__ */ X([]), T = /* @__PURE__ */ X(a(k));
3031
+ an(t, !1);
3032
+ const n = () => Uo(b, "$store", r), [r, o] = jo(), i = /* @__PURE__ */ $(), l = /* @__PURE__ */ $(), s = /* @__PURE__ */ $(), c = /* @__PURE__ */ $(), u = /* @__PURE__ */ $(), f = nn();
3033
+ let h = F(t, "publicKey", 8, void 0), d = F(t, "amount", 8), m = F(t, "currency", 8), _ = F(t, "email", 8, void 0), p = F(t, "phone", 8, void 0), v = F(t, "customerName", 8, void 0), y = F(t, "reference", 8, void 0), B = F(t, "metadata", 8, void 0), k = F(t, "customFields", 8, void 0), z = F(t, "paymentLinkCode", 8, void 0), H = F(t, "paymentMethods", 24, () => ["card", "mobile_money"]), X = F(t, "theme", 24, () => ({})), L = F(t, "isOpen", 12, !1), q = F(t, "apiBaseUrl", 8, void 0), C = F(t, "initialPaymentIntent", 8, void 0), g = /* @__PURE__ */ $({}), O = /* @__PURE__ */ $(null), I = /* @__PURE__ */ $("paystack"), Z = /* @__PURE__ */ $(["card", "mobile_money"]), S = /* @__PURE__ */ $([]), M = /* @__PURE__ */ $(a(Z));
3029
3034
  const K = {
3030
3035
  hubtel: "Hubtel",
3031
3036
  paystack: "Paystack",
@@ -3033,71 +3038,71 @@ function Ga(e, t) {
3033
3038
  monnify: "Monnify",
3034
3039
  mpesa: "M-Pesa",
3035
3040
  stripe: "Stripe"
3036
- }, g = Wo({
3041
+ }, b = Wo({
3037
3042
  config: {
3038
- publicKey: d(),
3039
- amount: v(),
3043
+ publicKey: h(),
3044
+ amount: d(),
3040
3045
  currency: m(),
3041
3046
  email: _(),
3042
- phone: h(),
3043
- customerName: p(),
3047
+ phone: p(),
3048
+ customerName: v(),
3044
3049
  reference: y(),
3045
- metadata: q(),
3046
- customFields: S(),
3047
- paymentLinkCode: H(),
3048
- paymentMethods: B(),
3050
+ metadata: B(),
3051
+ customFields: k(),
3052
+ paymentLinkCode: z(),
3053
+ paymentMethods: H(),
3049
3054
  initialPaymentIntent: C()
3050
3055
  },
3051
- apiBaseUrl: V(),
3052
- onSuccess: (M) => f("success", M),
3053
- onError: (M) => f("error", M),
3056
+ apiBaseUrl: q(),
3057
+ onSuccess: (x) => f("success", x),
3058
+ onError: (x) => f("error", x),
3054
3059
  onClose: () => {
3055
- O(!1), f("close");
3060
+ L(!1), f("close");
3056
3061
  }
3057
3062
  });
3058
- function he() {
3059
- O(!0), A(F, null);
3063
+ function V() {
3064
+ L(!0), T(O, null);
3060
3065
  }
3061
- function Ee() {
3062
- O(!1), A(F, null), g.close();
3066
+ function Oe() {
3067
+ L(!1), T(O, null), b.close();
3063
3068
  }
3064
- async function ae(M) {
3069
+ async function _e(x) {
3065
3070
  if (!a(i).paymentIntent) return;
3066
3071
  const W = a(I);
3067
3072
  try {
3068
3073
  switch (W) {
3069
3074
  case "paystack": {
3070
3075
  await ya({
3071
- key: a(i).paymentIntent.pspPublicKey ?? d() ?? "",
3076
+ key: a(i).paymentIntent.pspPublicKey ?? h() ?? "",
3072
3077
  email: _() ?? "",
3073
- amount: v(),
3078
+ amount: d(),
3074
3079
  currency: m(),
3075
3080
  ref: a(i).paymentIntent.id,
3076
- onSuccess: (Y) => g.handlePspSuccess(Y),
3081
+ onSuccess: (Y) => b.handlePspSuccess(Y),
3077
3082
  onClose: () => {
3078
3083
  }
3079
3084
  });
3080
3085
  break;
3081
3086
  }
3082
3087
  case "hubtel": {
3083
- const Y = a(i).paymentIntent.pspCredentials?.merchantAccount, se = pi({ publicKey: d(), baseUrl: V() }), { data: U, error: ie } = await se.createHubtelSession(a(i).paymentIntent.id, a(i).paymentIntent.clientSecret);
3084
- if (ie || !U?.basicAuth) {
3088
+ const Y = a(i).paymentIntent.pspCredentials?.merchantAccount, se = pi({ publicKey: h(), baseUrl: q() }), { data: D, error: oe } = await se.createHubtelSession(a(i).paymentIntent.id, a(i).paymentIntent.clientSecret);
3089
+ if (oe || !D?.basicAuth) {
3085
3090
  f("error", {
3086
- code: ie?.code || "hubtel_session_error",
3087
- message: ie?.message || "Failed to create Hubtel session"
3091
+ code: oe?.code || "hubtel_session_error",
3092
+ message: oe?.message || "Failed to create Hubtel session"
3088
3093
  });
3089
3094
  return;
3090
3095
  }
3091
3096
  const le = a(i).selectedMethod === "card" || a(i).selectedMethod === "mobile_money" ? a(i).selectedMethod : void 0;
3092
3097
  await ba({
3093
- clientId: U.merchantAccount || (typeof Y == "string" ? Y : d() ?? ""),
3094
- purchaseDescription: `Payment for ${v()} ${m()}`,
3095
- amount: v(),
3096
- customerPhone: M?.phone ?? h() ?? "",
3098
+ clientId: D.merchantAccount || (typeof Y == "string" ? Y : h() ?? ""),
3099
+ purchaseDescription: `Payment for ${d()} ${m()}`,
3100
+ amount: d(),
3101
+ customerPhone: x?.phone ?? p() ?? "",
3097
3102
  customerEmail: _() ?? "",
3098
- basicAuth: U.basicAuth,
3103
+ basicAuth: D.basicAuth,
3099
3104
  preferredMethod: le,
3100
- onSuccess: (bt) => g.handlePspSuccess(bt),
3105
+ onSuccess: (gt) => b.handlePspSuccess(gt),
3101
3106
  onClose: () => {
3102
3107
  }
3103
3108
  });
@@ -3105,24 +3110,24 @@ function Ga(e, t) {
3105
3110
  }
3106
3111
  case "flutterwave": {
3107
3112
  await ga({
3108
- public_key: a(i).paymentIntent.pspPublicKey ?? d() ?? "",
3113
+ public_key: a(i).paymentIntent.pspPublicKey ?? h() ?? "",
3109
3114
  tx_ref: a(i).paymentIntent.id,
3110
- amount: v(),
3115
+ amount: d(),
3111
3116
  currency: m(),
3112
3117
  customer: {
3113
3118
  email: _() ?? "",
3114
- phone_number: M?.phone ?? h() ?? ""
3119
+ phone_number: x?.phone ?? p() ?? ""
3115
3120
  },
3116
- callback: (Y) => g.handlePspSuccess(Y),
3121
+ callback: (Y) => b.handlePspSuccess(Y),
3117
3122
  onclose: () => {
3118
3123
  }
3119
3124
  });
3120
3125
  break;
3121
3126
  }
3122
3127
  case "monnify": {
3123
- const Y = q()?.contract_code, se = a(i).paymentIntent.pspPublicKey ?? d() ?? "", U = typeof Y == "string" ? Y : d() ?? "";
3124
- if (!se || !U) {
3125
- g.handlePspError({
3128
+ const Y = B()?.contract_code, se = a(i).paymentIntent.pspPublicKey ?? h() ?? "", D = typeof Y == "string" ? Y : h() ?? "";
3129
+ if (!se || !D) {
3130
+ b.handlePspError({
3126
3131
  code: "MONNIFY_CONFIG_MISSING",
3127
3132
  message: "Monnify configuration is missing. Please check your API key and contract code."
3128
3133
  });
@@ -3130,294 +3135,294 @@ function Ga(e, t) {
3130
3135
  }
3131
3136
  await Ea({
3132
3137
  apiKey: se,
3133
- contractCode: U,
3134
- amount: v(),
3138
+ contractCode: D,
3139
+ amount: d(),
3135
3140
  currency: m(),
3136
3141
  reference: a(i).paymentIntent.reference ?? a(i).paymentIntent.id,
3137
- customerName: q()?.customer_name ?? _() ?? "",
3142
+ customerName: B()?.customer_name ?? _() ?? "",
3138
3143
  customerEmail: _() ?? "",
3139
- customerPhone: M?.phone ?? h() ?? "",
3140
- metadata: q(),
3141
- onSuccess: (ie) => g.handlePspSuccess(ie),
3144
+ customerPhone: x?.phone ?? p() ?? "",
3145
+ metadata: B(),
3146
+ onSuccess: (oe) => b.handlePspSuccess(oe),
3142
3147
  onClose: () => {
3143
3148
  }
3144
3149
  });
3145
3150
  break;
3146
3151
  }
3147
3152
  case "mpesa": {
3148
- const se = `${V() ?? "https://api.reevit.io"}/v1/payments/${a(i).paymentIntent.id}/mpesa`;
3153
+ const se = `${q() ?? "https://api.reevit.io"}/v1/payments/${a(i).paymentIntent.id}/mpesa`;
3149
3154
  await Pa(
3150
3155
  {
3151
- phoneNumber: M?.phone ?? h() ?? "",
3152
- amount: v(),
3156
+ phoneNumber: x?.phone ?? p() ?? "",
3157
+ amount: d(),
3153
3158
  reference: a(i).paymentIntent.reference ?? a(i).paymentIntent.id,
3154
3159
  description: `Payment ${a(i).paymentIntent.reference ?? ""}`,
3155
3160
  onInitiated: () => {
3156
3161
  },
3157
- onSuccess: (U) => g.handlePspSuccess(U),
3158
- onError: (U) => g.handlePspError({ code: "MPESA_ERROR", message: U.message })
3162
+ onSuccess: (D) => b.handlePspSuccess(D),
3163
+ onError: (D) => b.handlePspError({ code: "MPESA_ERROR", message: D.message })
3159
3164
  },
3160
3165
  se
3161
3166
  );
3162
3167
  break;
3163
3168
  }
3164
3169
  case "stripe": {
3165
- g.handlePspError({
3170
+ b.handlePspError({
3166
3171
  code: "STRIPE_NOT_IMPLEMENTED",
3167
3172
  message: "Stripe integration requires custom Elements setup. Please use the React SDK or implement custom Stripe Elements."
3168
3173
  });
3169
3174
  break;
3170
3175
  }
3171
3176
  default:
3172
- g.handlePspError({
3177
+ b.handlePspError({
3173
3178
  code: "UNSUPPORTED_PSP",
3174
3179
  message: `Payment provider "${W}" is not supported in this checkout.`
3175
3180
  });
3176
3181
  }
3177
3182
  } catch (Y) {
3178
- g.handlePspError({
3183
+ b.handlePspError({
3179
3184
  code: "BRIDGE_ERROR",
3180
3185
  message: Y instanceof Error ? Y.message : "Failed to open payment gateway"
3181
3186
  });
3182
3187
  }
3183
3188
  }
3184
- function un(M) {
3185
- if (M === a(F)) {
3186
- A(F, null), g.reset();
3189
+ function at(x) {
3190
+ if (x === a(O)) {
3191
+ T(O, null), b.reset();
3187
3192
  return;
3188
3193
  }
3189
- const W = a(x).find((U) => U.provider === M), Y = W?.methods?.length ? W.methods : a(k), se = a(i).selectedMethod && Y.includes(a(i).selectedMethod) ? a(i).selectedMethod : Y[0];
3190
- A(F, M), g.reset(), g.initialize(se, { preferredProvider: M, allowedProviders: [M] });
3194
+ const W = a(S).find((D) => D.provider === x), Y = W?.methods?.length ? W.methods : a(Z), se = a(i).selectedMethod && Y.includes(a(i).selectedMethod) ? a(i).selectedMethod : Y[0];
3195
+ T(O, x), b.reset(), b.initialize(se, { preferredProvider: x, allowedProviders: [x] });
3191
3196
  }
3192
3197
  oi(() => {
3193
- O() && g.initialize();
3198
+ L() && b.initialize();
3194
3199
  }), ai(() => {
3195
3200
  typeof document < "u" && (document.body.style.overflow = "");
3196
- }), ee(() => n(), () => {
3197
- A(i, n());
3198
- }), ee(() => (a(i), G(Q())), () => {
3199
- A(b, {
3201
+ }), te(() => n(), () => {
3202
+ T(i, n());
3203
+ }), te(() => (a(i), G(X())), () => {
3204
+ T(g, {
3200
3205
  ...a(i).paymentIntent?.branding || {},
3201
- ...Q() || {}
3206
+ ...X() || {}
3202
3207
  });
3203
- }), ee(() => a(b), () => {
3204
- A(l, vi(a(b)));
3205
- }), ee(() => G(B()), () => {
3206
- A(k, B()?.length ? B() : ["card", "mobile_money"]);
3207
- }), ee(() => (a(i), a(k)), () => {
3208
- A(x, (() => {
3209
- const M = a(i).paymentIntent;
3210
- if (!M) return [];
3211
- const W = new Set(a(k)), Y = (M.availableProviders || []).map((U) => {
3212
- const ie = U.provider.toLowerCase().includes("hubtel") ? U.methods.filter((le) => le === "card" || le === "mobile_money") : U.methods;
3208
+ }), te(() => a(g), () => {
3209
+ T(l, vi(a(g)));
3210
+ }), te(() => G(H()), () => {
3211
+ T(Z, H()?.length ? H() : ["card", "mobile_money"]);
3212
+ }), te(() => (a(i), a(Z)), () => {
3213
+ T(S, (() => {
3214
+ const x = a(i).paymentIntent;
3215
+ if (!x) return [];
3216
+ const W = new Set(a(Z)), Y = (x.availableProviders || []).map((D) => {
3217
+ const oe = D.provider.toLowerCase().includes("hubtel") ? D.methods.filter((le) => le === "card" || le === "mobile_money") : D.methods;
3213
3218
  return {
3214
- ...U,
3215
- methods: ie.filter((le) => W.has(le))
3219
+ ...D,
3220
+ methods: oe.filter((le) => W.has(le))
3216
3221
  };
3217
- }).filter((U) => U.methods.length > 0);
3222
+ }).filter((D) => D.methods.length > 0);
3218
3223
  if (Y.length > 0) return Y;
3219
- const se = M.recommendedPsp.toLowerCase().includes("hubtel") ? a(k).filter((U) => U === "card" || U === "mobile_money") : a(k);
3224
+ const se = x.recommendedPsp.toLowerCase().includes("hubtel") ? a(Z).filter((D) => D === "card" || D === "mobile_money") : a(Z);
3220
3225
  return [
3221
3226
  {
3222
- provider: M.recommendedPsp,
3223
- name: K[M.recommendedPsp] || M.recommendedPsp,
3227
+ provider: x.recommendedPsp,
3228
+ name: K[x.recommendedPsp] || x.recommendedPsp,
3224
3229
  methods: se
3225
3230
  }
3226
3231
  ];
3227
3232
  })());
3228
- }), ee(() => (a(x), a(F)), () => {
3229
- a(x).length > 0 && (a(F) && a(x).some((M) => M.provider === a(F)) || (a(x).length === 1 ? A(F, a(x)[0].provider) : A(F, null)));
3230
- }), ee(() => (a(F), a(i)), () => {
3231
- A(I, a(F) || a(i).paymentIntent?.recommendedPsp || "paystack");
3232
- }), ee(
3233
- () => (a(x), a(I), a(k)),
3233
+ }), te(() => (a(S), a(O)), () => {
3234
+ a(S).length > 0 && (a(O) && a(S).some((x) => x.provider === a(O)) || (a(S).length === 1 ? T(O, a(S)[0].provider) : T(O, null)));
3235
+ }), te(() => (a(O), a(i)), () => {
3236
+ T(I, a(O) || a(i).paymentIntent?.recommendedPsp || "paystack");
3237
+ }), te(
3238
+ () => (a(S), a(I), a(Z)),
3234
3239
  () => {
3235
- A(T, (() => {
3236
- const M = a(x).find((W) => W.provider === a(I));
3237
- return M?.methods.length ? M.methods : a(k);
3240
+ T(M, (() => {
3241
+ const x = a(S).find((W) => W.provider === a(I));
3242
+ return x?.methods.length ? x.methods : a(Z);
3238
3243
  })());
3239
3244
  }
3240
- ), ee(() => (a(i), a(T)), () => {
3241
- a(i).selectedMethod && a(T).length > 0 && !a(T).includes(a(i).selectedMethod) && g.selectMethod(a(T)[0]);
3242
- }), ee(() => {
3245
+ ), te(() => (a(i), a(M)), () => {
3246
+ a(i).selectedMethod && a(M).length > 0 && !a(M).includes(a(i).selectedMethod) && b.selectMethod(a(M)[0]);
3247
+ }), te(() => {
3243
3248
  }, () => {
3244
- A(s, g.isLoading());
3245
- }), ee(() => {
3249
+ T(s, b.isLoading());
3250
+ }), te(() => {
3246
3251
  }, () => {
3247
- A(c, g.getStatus() === "processing");
3248
- }), ee(() => {
3252
+ T(c, b.getStatus() === "processing");
3253
+ }), te(() => {
3249
3254
  }, () => {
3250
- A(u, g.getStatus() === "method_selected");
3251
- }), ee(
3252
- () => (G(O()), a(i), a(F), G(h())),
3255
+ T(u, b.getStatus() === "method_selected");
3256
+ }), te(
3257
+ () => (G(L()), a(i), a(O), G(p())),
3253
3258
  () => {
3254
- if (O() && a(i).paymentIntent && a(i).selectedMethod) {
3255
- const W = (a(F) || a(i).paymentIntent.recommendedPsp || "paystack").toLowerCase().includes("mpesa");
3256
- (a(i).selectedMethod === "card" || a(i).selectedMethod === "mobile_money" && (!W || h())) && ae(null);
3259
+ if (L() && a(i).paymentIntent && a(i).selectedMethod) {
3260
+ const W = (a(O) || a(i).paymentIntent.recommendedPsp || "paystack").toLowerCase().includes("mpesa");
3261
+ (a(i).selectedMethod === "card" || a(i).selectedMethod === "mobile_money" && (!W || p())) && _e(null);
3257
3262
  }
3258
3263
  }
3259
- ), ee(() => (G(O()), a(i)), () => {
3260
- O() ? (document.body.style.overflow = "hidden", !a(i).paymentIntent && a(i).status === "idle" && g.initialize()) : typeof document < "u" && (document.body.style.overflow = "");
3261
- }), Vn(), ln();
3262
- var me = Ha(), yt = E(me);
3263
- On(
3264
- yt,
3264
+ ), te(() => (G(L()), a(i)), () => {
3265
+ L() ? (document.body.style.overflow = "hidden", !a(i).paymentIntent && a(i).status === "idle" && b.initialize()) : typeof document < "u" && (document.body.style.overflow = "");
3266
+ }), Gn(), fn();
3267
+ var Ie = Ha(), Ut = E(Ie);
3268
+ Dn(
3269
+ Ut,
3265
3270
  t,
3266
3271
  "default",
3267
3272
  {
3268
- handleOpen: he,
3273
+ handleOpen: V,
3269
3274
  get isLoading() {
3270
3275
  return a(s);
3271
3276
  }
3272
3277
  },
3273
- (M) => {
3278
+ (x) => {
3274
3279
  var W = ka(), Y = E(W);
3275
3280
  {
3276
- var se = (ie) => {
3281
+ var se = (oe) => {
3277
3282
  var le = Sa();
3278
- P(ie, le);
3279
- }, U = (ie) => {
3280
- var le = ft(), bt = Be(le);
3281
- On(bt, t, "button-text", {}, (fn) => {
3282
- var dn = Po("Pay Now");
3283
- P(fn, dn);
3284
- }), P(ie, le);
3283
+ P(oe, le);
3284
+ }, D = (oe) => {
3285
+ var le = vt(), gt = Ke(le);
3286
+ Dn(gt, t, "button-text", {}, (vn) => {
3287
+ var pn = Po("Pay Now");
3288
+ P(vn, pn);
3289
+ }), P(oe, le);
3285
3290
  };
3286
- J(Y, (ie) => {
3287
- a(s) ? ie(se) : ie(U, !1);
3291
+ J(Y, (oe) => {
3292
+ a(s) ? oe(se) : oe(D, !1);
3288
3293
  });
3289
3294
  }
3290
- Z(() => W.disabled = a(s)), fe("click", W, he), P(M, W);
3295
+ Q(() => W.disabled = a(s)), fe("click", W, V), P(x, W);
3291
3296
  }
3292
3297
  );
3293
- var Yr = j(yt, 2);
3298
+ var we = U(Ut, 2);
3294
3299
  {
3295
- var Gr = (M) => {
3296
- var W = za(), Y = E(W), se = E(Y), U = j(se, 2), ie = E(U), le = E(ie), bt = j(le, 2);
3300
+ var jt = (x) => {
3301
+ var W = za(), Y = E(W), se = E(Y), D = U(se, 2), oe = E(D), le = E(oe), gt = U(le, 2);
3297
3302
  {
3298
- var fn = (ue) => {
3299
- var Ge = Ca(), vn = E(Ge);
3300
- Z(() => ve(vn, (a(b), w(() => a(b).companyName)))), P(ue, Ge);
3303
+ var vn = (ue) => {
3304
+ var We = Ca(), hn = E(We);
3305
+ Q(() => ve(hn, (a(g), w(() => a(g).companyName)))), P(ue, We);
3301
3306
  };
3302
- J(bt, (ue) => {
3303
- a(b), w(() => a(b).companyName) && ue(fn);
3307
+ J(gt, (ue) => {
3308
+ a(g), w(() => a(g).companyName) && ue(vn);
3304
3309
  });
3305
3310
  }
3306
- var dn = j(U, 2), Wr = E(dn);
3311
+ var pn = U(D, 2), Wr = E(pn);
3307
3312
  {
3308
3313
  var Jr = (ue) => {
3309
- var Ge = Ia();
3310
- P(ue, Ge);
3314
+ var We = Ia();
3315
+ P(ue, We);
3311
3316
  }, Zr = (ue) => {
3312
- var Ge = ft(), vn = Be(Ge);
3317
+ var We = vt(), hn = Ke(We);
3313
3318
  {
3314
- var Qr = (ot) => {
3315
- var gt = Ma(), Dt = j(E(gt), 4), pn = E(Dt), hn = j(Dt, 2);
3316
- Z(() => ve(pn, (a(i), w(() => a(i).error.message)))), fe("click", hn, () => g.initialize()), P(ot, gt);
3317
- }, Xr = (ot) => {
3318
- var gt = ft(), Dt = Be(gt);
3319
+ var Qr = (st) => {
3320
+ var wt = Ma(), zt = U(E(wt), 4), mn = E(zt), _n = U(zt, 2);
3321
+ Q(() => ve(mn, (a(i), w(() => a(i).error.message)))), fe("click", _n, () => b.initialize()), P(st, wt);
3322
+ }, Xr = (st) => {
3323
+ var wt = vt(), zt = Ke(wt);
3319
3324
  {
3320
- var pn = (at) => {
3321
- var wt = xa(), mn = j(E(wt), 6);
3322
- fe("click", mn, Ee), P(at, wt);
3323
- }, hn = (at) => {
3324
- var wt = ft(), mn = Be(wt);
3325
+ var mn = (lt) => {
3326
+ var Et = xa(), yn = U(E(Et), 6);
3327
+ fe("click", yn, Oe), P(lt, Et);
3328
+ }, _n = (lt) => {
3329
+ var Et = vt(), yn = Ke(Et);
3325
3330
  {
3326
- var $r = (_n) => {
3327
- var Qn = ja(), ei = E(Qn);
3331
+ var $r = (bn) => {
3332
+ var $n = ja(), ei = E($n);
3328
3333
  {
3329
- var ti = (st) => {
3330
- aa(st, {
3334
+ var ti = (ct) => {
3335
+ aa(ct, {
3331
3336
  get providers() {
3332
- return a(x);
3337
+ return a(S);
3333
3338
  },
3334
3339
  get selectedProvider() {
3335
- return a(F);
3340
+ return a(O);
3336
3341
  },
3337
3342
  get disabled() {
3338
3343
  return a(s);
3339
3344
  },
3340
3345
  get theme() {
3341
- return a(b);
3346
+ return a(g);
3342
3347
  },
3343
3348
  get selectedMethod() {
3344
3349
  return a(i), w(() => a(i).selectedMethod);
3345
3350
  },
3346
3351
  $$events: {
3347
- select: (Oe) => un(Oe.detail),
3348
- methodSelect: (Oe) => g.selectMethod(Oe.detail)
3352
+ select: (Fe) => at(Fe.detail),
3353
+ methodSelect: (Fe) => b.selectMethod(Fe.detail)
3349
3354
  },
3350
3355
  $$slots: {
3351
- "method-content": (Oe, yn) => {
3352
- var Ut = Na(), bn = E(Ut);
3356
+ "method-content": (Fe, gn) => {
3357
+ var Ht = Na(), wn = E(Ht);
3353
3358
  {
3354
- var We = (Fe) => {
3355
- var Je = Ra(), lt = j(E(Je), 2);
3356
- Z(() => lt.disabled = a(c)), fe("click", lt, () => ae(null)), P(Fe, Je);
3357
- }, jt = (Fe) => {
3358
- var Je = ft(), lt = Be(Je);
3359
+ var Je = (De) => {
3360
+ var Ze = Ra(), ut = U(E(Ze), 2);
3361
+ Q(() => ut.disabled = a(c)), fe("click", ut, () => _e(null)), P(De, Ze);
3362
+ }, Bt = (De) => {
3363
+ var Ze = vt(), ut = Ke(Ze);
3359
3364
  {
3360
- var De = (Ue) => {
3361
- var Et = Aa(), gn = E(Et);
3365
+ var Ue = (je) => {
3366
+ var Pt = Aa(), En = E(Pt);
3362
3367
  {
3363
- var Pt = (je) => {
3364
- lr(je, {
3368
+ var St = (ze) => {
3369
+ ur(ze, {
3365
3370
  get initialPhone() {
3366
- return h();
3371
+ return p();
3367
3372
  },
3368
3373
  get loading() {
3369
3374
  return a(c);
3370
3375
  },
3371
3376
  hideCancel: !0,
3372
- $$events: { submit: (ct) => ae(ct.detail) }
3377
+ $$events: { submit: (ft) => _e(ft.detail) }
3373
3378
  });
3374
- }, wn = (je) => {
3375
- var ct = Ta(), Pe = Be(ct), ut = E(Pe), St = j(Pe, 2), En = E(St);
3376
- Z(
3379
+ }, Pn = (ze) => {
3380
+ var ft = Ta(), Ee = Ke(ft), dt = E(Ee), kt = U(Ee, 2), Sn = E(kt);
3381
+ Q(
3377
3382
  (ri, ii) => {
3378
- ve(ut, ri), St.disabled = a(c), ve(En, ii);
3383
+ ve(dt, ri), kt.disabled = a(c), ve(Sn, ii);
3379
3384
  },
3380
3385
  [
3381
3386
  () => (a(I), w(() => a(I).includes("hubtel") ? "Opens the Hubtel checkout with Mobile Money selected." : `Continue to pay securely with Mobile Money via ${K[a(I)] || a(I)}.`)),
3382
3387
  () => (a(I), w(() => a(I).includes("hubtel") ? "Continue with Hubtel" : "Pay with Mobile Money"))
3383
3388
  ]
3384
- ), fe("click", St, () => ae(null)), P(je, ct);
3389
+ ), fe("click", kt, () => _e(null)), P(ze, ft);
3385
3390
  };
3386
- J(gn, (je) => {
3387
- a(I), G(h()), w(() => a(I).includes("mpesa") && !h()) ? je(Pt) : je(wn, !1);
3391
+ J(En, (ze) => {
3392
+ a(I), G(p()), w(() => a(I).includes("mpesa") && !p()) ? ze(St) : ze(Pn, !1);
3388
3393
  });
3389
3394
  }
3390
- P(Ue, Et);
3395
+ P(je, Pt);
3391
3396
  };
3392
3397
  J(
3393
- lt,
3394
- (Ue) => {
3395
- a(i), w(() => a(i).selectedMethod === "mobile_money") && Ue(De);
3398
+ ut,
3399
+ (je) => {
3400
+ a(i), w(() => a(i).selectedMethod === "mobile_money") && je(Ue);
3396
3401
  },
3397
3402
  !0
3398
3403
  );
3399
3404
  }
3400
- P(Fe, Je);
3405
+ P(De, Ze);
3401
3406
  };
3402
- J(bn, (Fe) => {
3403
- a(i), w(() => a(i).selectedMethod === "card") ? Fe(We) : Fe(jt, !1);
3407
+ J(wn, (De) => {
3408
+ a(i), w(() => a(i).selectedMethod === "card") ? De(Je) : De(Bt, !1);
3404
3409
  });
3405
3410
  }
3406
- P(Oe, Ut);
3411
+ P(Fe, Ht);
3407
3412
  }
3408
3413
  }
3409
3414
  });
3410
- }, ni = (st) => {
3411
- var Oe = Ua(), yn = Be(Oe);
3412
- Vr(yn, {
3415
+ }, ni = (ct) => {
3416
+ var Fe = Ua(), gn = Ke(Fe);
3417
+ Gr(gn, {
3413
3418
  get methods() {
3414
- return a(T);
3419
+ return a(M);
3415
3420
  },
3416
3421
  get selected() {
3417
3422
  return a(i), w(() => a(i).selectedMethod);
3418
3423
  },
3419
3424
  get amount() {
3420
- return v();
3425
+ return d();
3421
3426
  },
3422
3427
  get currency() {
3423
3428
  return m();
@@ -3427,123 +3432,123 @@ function Ga(e, t) {
3427
3432
  },
3428
3433
  layout: "grid",
3429
3434
  showLabel: !1,
3430
- $$events: { select: (We) => g.selectMethod(We.detail) }
3435
+ $$events: { select: (Je) => b.selectMethod(Je.detail) }
3431
3436
  });
3432
- var Ut = j(yn, 2);
3437
+ var Ht = U(gn, 2);
3433
3438
  {
3434
- var bn = (We) => {
3435
- var jt = Da(), Fe = E(jt);
3439
+ var wn = (Je) => {
3440
+ var Bt = Da(), De = E(Bt);
3436
3441
  {
3437
- var Je = (De) => {
3438
- lr(De, {
3442
+ var Ze = (Ue) => {
3443
+ ur(Ue, {
3439
3444
  get initialPhone() {
3440
- return h();
3445
+ return p();
3441
3446
  },
3442
3447
  get loading() {
3443
3448
  return a(c);
3444
3449
  },
3445
3450
  $$events: {
3446
- submit: (Ue) => ae(Ue.detail),
3447
- cancel: () => g.selectMethod(null)
3451
+ submit: (je) => _e(je.detail),
3452
+ cancel: () => b.selectMethod(null)
3448
3453
  }
3449
3454
  });
3450
- }, lt = (De) => {
3451
- var Ue = Fa(), Et = E(Ue), gn = E(Et), Pt = j(Et, 2), wn = E(Pt);
3455
+ }, ut = (Ue) => {
3456
+ var je = Fa(), Pt = E(je), En = E(Pt), St = U(Pt, 2), Pn = E(St);
3452
3457
  {
3453
- var je = (Pe) => {
3454
- var ut = La();
3455
- P(Pe, ut);
3456
- }, ct = (Pe) => {
3457
- var ut = Oa(), St = E(ut);
3458
- Z((En) => ve(St, En), [
3458
+ var ze = (Ee) => {
3459
+ var dt = La();
3460
+ P(Ee, dt);
3461
+ }, ft = (Ee) => {
3462
+ var dt = Oa(), kt = E(dt);
3463
+ Q((Sn) => ve(kt, Sn), [
3459
3464
  () => (a(i), a(I), w(() => a(i).selectedMethod === "card" ? "Pay with Card" : a(I).includes("hubtel") ? "Continue with Hubtel" : "Pay with Mobile Money"))
3460
- ]), P(Pe, ut);
3465
+ ]), P(Ee, dt);
3461
3466
  };
3462
- J(wn, (Pe) => {
3463
- a(c) ? Pe(je) : Pe(ct, !1);
3467
+ J(Pn, (Ee) => {
3468
+ a(c) ? Ee(ze) : Ee(ft, !1);
3464
3469
  });
3465
3470
  }
3466
- Z(
3467
- (Pe) => {
3468
- ve(gn, Pe), Pt.disabled = a(c);
3471
+ Q(
3472
+ (Ee) => {
3473
+ ve(En, Ee), St.disabled = a(c);
3469
3474
  },
3470
3475
  [
3471
3476
  () => (a(i), a(I), w(() => a(i).selectedMethod === "card" ? "You will be redirected to complete your card payment securely." : a(I).includes("hubtel") ? "Opens the Hubtel checkout with Mobile Money selected." : `Continue to pay securely via ${K[a(I)] || a(I)}.`))
3472
3477
  ]
3473
- ), fe("click", Pt, () => ae(null)), P(De, Ue);
3478
+ ), fe("click", St, () => _e(null)), P(Ue, je);
3474
3479
  };
3475
- J(Fe, (De) => {
3476
- a(i), a(I), G(h()), w(() => a(i).selectedMethod === "mobile_money" && a(I).includes("mpesa") && !h()) ? De(Je) : De(lt, !1);
3480
+ J(De, (Ue) => {
3481
+ a(i), a(I), G(p()), w(() => a(i).selectedMethod === "mobile_money" && a(I).includes("mpesa") && !p()) ? Ue(Ze) : Ue(ut, !1);
3477
3482
  });
3478
3483
  }
3479
- P(We, jt);
3484
+ P(Je, Bt);
3480
3485
  };
3481
- J(Ut, (We) => {
3482
- a(u) && We(bn);
3486
+ J(Ht, (Je) => {
3487
+ a(u) && Je(wn);
3483
3488
  });
3484
3489
  }
3485
- P(st, Oe);
3490
+ P(ct, Fe);
3486
3491
  };
3487
- J(ei, (st) => {
3488
- a(x), w(() => a(x).length > 1) ? st(ti) : st(ni, !1);
3492
+ J(ei, (ct) => {
3493
+ a(S), w(() => a(S).length > 1) ? ct(ti) : ct(ni, !1);
3489
3494
  });
3490
3495
  }
3491
- P(_n, Qn);
3496
+ P(bn, $n);
3492
3497
  };
3493
3498
  J(
3494
- mn,
3495
- (_n) => {
3496
- a(i), a(u), w(() => a(i).status === "ready" || a(u)) && _n($r);
3499
+ yn,
3500
+ (bn) => {
3501
+ a(i), a(u), w(() => a(i).status === "ready" || a(u)) && bn($r);
3497
3502
  },
3498
3503
  !0
3499
3504
  );
3500
3505
  }
3501
- P(at, wt);
3506
+ P(lt, Et);
3502
3507
  };
3503
3508
  J(
3504
- Dt,
3505
- (at) => {
3506
- a(i), w(() => a(i).status === "success") ? at(pn) : at(hn, !1);
3509
+ zt,
3510
+ (lt) => {
3511
+ a(i), w(() => a(i).status === "success") ? lt(mn) : lt(_n, !1);
3507
3512
  },
3508
3513
  !0
3509
3514
  );
3510
3515
  }
3511
- P(ot, gt);
3516
+ P(st, wt);
3512
3517
  };
3513
3518
  J(
3514
- vn,
3515
- (ot) => {
3516
- a(i), w(() => a(i).status === "failed" && a(i).error) ? ot(Qr) : ot(Xr, !1);
3519
+ hn,
3520
+ (st) => {
3521
+ a(i), w(() => a(i).status === "failed" && a(i).error) ? st(Qr) : st(Xr, !1);
3517
3522
  },
3518
3523
  !0
3519
3524
  );
3520
3525
  }
3521
- P(ue, Ge);
3526
+ P(ue, We);
3522
3527
  };
3523
3528
  J(Wr, (ue) => {
3524
3529
  a(i), w(() => a(i).status === "loading") ? ue(Jr) : ue(Zr, !1);
3525
3530
  });
3526
3531
  }
3527
- Z(
3532
+ Q(
3528
3533
  (ue) => {
3529
- tt(Y, 1, ue), Xt(le, "src", (a(b), w(() => a(b).logoUrl || "https://i.imgur.com/bzUR5Lm.png"))), Xt(le, "alt", (a(b), w(() => a(b).companyName || "Reevit")));
3534
+ nt(Y, 1, ue), tn(le, "src", (a(g), w(() => a(g).logoUrl || "https://i.imgur.com/bzUR5Lm.png"))), tn(le, "alt", (a(g), w(() => a(g).companyName || "Reevit")));
3530
3535
  },
3531
3536
  [
3532
- () => et((G(de), a(b), w(() => de("reevit-modal-content", a(b).darkMode && "reevit-modal--dark"))))
3537
+ () => tt((G(de), a(g), w(() => de("reevit-modal-content", a(g).darkMode && "reevit-modal--dark"))))
3533
3538
  ]
3534
- ), fe("click", se, Ee), fe("click", W, Ee), fe("keydown", W, (ue) => ue.key === "Escape" && Ee()), P(M, W);
3539
+ ), fe("click", se, Oe), fe("click", W, Oe), fe("keydown", W, (ue) => ue.key === "Escape" && Oe()), P(x, W);
3535
3540
  };
3536
- J(Yr, (M) => {
3537
- O() && M(Gr);
3541
+ J(we, (x) => {
3542
+ L() && x(jt);
3538
3543
  });
3539
3544
  }
3540
- Z((M) => Zn(me, M), [
3541
- () => (a(l), w(() => Object.entries(a(l)).map(([M, W]) => `${M}:${W}`).join(";")))
3542
- ]), P(e, me), rn(), o();
3545
+ Q((x) => Xn(Ie, x), [
3546
+ () => (a(l), w(() => Object.entries(a(l)).map(([x, W]) => `${x}:${W}`).join(";")))
3547
+ ]), P(e, Ie), sn(), o();
3543
3548
  }
3544
3549
  export {
3545
- lr as MobileMoneyForm,
3546
- Vr as PaymentMethodSelector,
3550
+ ur as MobileMoneyForm,
3551
+ Gr as PaymentMethodSelector,
3547
3552
  aa as ProviderSelector,
3548
3553
  Za as ReevitAPIClient,
3549
3554
  Ga as ReevitCheckout,