@reevit/svelte 0.3.4 → 0.3.6
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/bridges/loaders.d.ts +3 -2
- package/dist/bridges/loaders.d.ts.map +1 -1
- package/dist/index.js +101 -1
- package/dist/index.mjs +1359 -1133
- package/package.json +3 -2
package/dist/index.mjs
CHANGED
|
@@ -1,77 +1,77 @@
|
|
|
1
|
-
import { createEventDispatcher as en, onMount as
|
|
2
|
-
import { createInitialState as
|
|
3
|
-
import { ReevitAPIClient as
|
|
1
|
+
import { createEventDispatcher as en, onMount as wr, onDestroy as Er } from "svelte";
|
|
2
|
+
import { createInitialState as Pr, ReevitAPIClient as Sr, generateReference as Ir, detectCountryFromCurrency as kr, reevitReducer as Cr, formatAmount as yn, cn as we, validatePhone as Ht, detectNetwork as Rr, createThemeVariables as xr } from "@reevit/core";
|
|
3
|
+
import { ReevitAPIClient as za, cn as Ha, createInitialState as qa, createReevitClient as Ka, detectCountryFromCurrency as Va, detectNetwork as Ya, formatAmount as Ba, formatPhone as Wa, reevitReducer as Ga, validatePhone as Za } from "@reevit/core";
|
|
4
4
|
const Mr = "5";
|
|
5
5
|
typeof window < "u" && ((window.__svelte ??= {}).v ??= /* @__PURE__ */ new Set()).add(Mr);
|
|
6
|
-
let ot = !1,
|
|
7
|
-
function
|
|
6
|
+
let ot = !1, Tr = !1;
|
|
7
|
+
function Ar() {
|
|
8
8
|
ot = !0;
|
|
9
9
|
}
|
|
10
|
-
|
|
11
|
-
const
|
|
12
|
-
var Mn = Array.isArray,
|
|
13
|
-
const
|
|
10
|
+
Ar();
|
|
11
|
+
const Or = 1, Nr = 2, Dr = 16, Fr = 1, Lr = 2, Ur = 4, jr = 8, zr = 16, Hr = 1, qr = 2, Y = /* @__PURE__ */ Symbol(), Yt = !1;
|
|
12
|
+
var Mn = Array.isArray, Kr = Array.prototype.indexOf, tn = Array.from, Tn = Object.defineProperty, ht = Object.getOwnPropertyDescriptor, Vr = Object.getOwnPropertyDescriptors, Yr = Object.prototype, Br = Array.prototype, An = Object.getPrototypeOf;
|
|
13
|
+
const Bt = () => {
|
|
14
14
|
};
|
|
15
|
-
function
|
|
15
|
+
function Wr(e) {
|
|
16
16
|
return e();
|
|
17
17
|
}
|
|
18
|
-
function
|
|
18
|
+
function Wt(e) {
|
|
19
19
|
for (var t = 0; t < e.length; t++)
|
|
20
20
|
e[t]();
|
|
21
21
|
}
|
|
22
|
-
function
|
|
23
|
-
var e, t, n = new Promise((r,
|
|
24
|
-
e = r, t =
|
|
22
|
+
function On() {
|
|
23
|
+
var e, t, n = new Promise((r, a) => {
|
|
24
|
+
e = r, t = a;
|
|
25
25
|
});
|
|
26
26
|
return { promise: n, resolve: e, reject: t };
|
|
27
27
|
}
|
|
28
|
-
const V = 2,
|
|
28
|
+
const V = 2, Nn = 4, Ct = 8, Gr = 1 << 24, me = 16, ye = 32, Ye = 64, nn = 128, ne = 512, q = 1024, Z = 2048, re = 4096, Q = 8192, pe = 16384, rn = 32768, tt = 65536, bn = 1 << 17, Dn = 1 << 18, Rt = 1 << 19, Fn = 1 << 20, Ee = 1 << 25, Oe = 32768, Gt = 1 << 21, an = 1 << 22, Pe = 1 << 23, Ke = /* @__PURE__ */ Symbol("$state"), Zr = /* @__PURE__ */ Symbol("legacy props"), ze = new class extends Error {
|
|
29
29
|
name = "StaleReactionError";
|
|
30
30
|
message = "The reaction that called `getAbortSignal()` was re-run or destroyed";
|
|
31
31
|
}();
|
|
32
32
|
function Jr() {
|
|
33
33
|
throw new Error("https://svelte.dev/e/async_derived_orphan");
|
|
34
34
|
}
|
|
35
|
-
function
|
|
35
|
+
function Qr(e) {
|
|
36
36
|
throw new Error("https://svelte.dev/e/effect_in_teardown");
|
|
37
37
|
}
|
|
38
|
-
function
|
|
38
|
+
function Xr() {
|
|
39
39
|
throw new Error("https://svelte.dev/e/effect_in_unowned_derived");
|
|
40
40
|
}
|
|
41
41
|
function $r(e) {
|
|
42
42
|
throw new Error("https://svelte.dev/e/effect_orphan");
|
|
43
43
|
}
|
|
44
|
-
function
|
|
44
|
+
function ei() {
|
|
45
45
|
throw new Error("https://svelte.dev/e/effect_update_depth_exceeded");
|
|
46
46
|
}
|
|
47
|
-
function
|
|
47
|
+
function ti(e) {
|
|
48
48
|
throw new Error("https://svelte.dev/e/props_invalid_value");
|
|
49
49
|
}
|
|
50
|
-
function
|
|
50
|
+
function ni() {
|
|
51
51
|
throw new Error("https://svelte.dev/e/state_descriptors_fixed");
|
|
52
52
|
}
|
|
53
|
-
function
|
|
53
|
+
function ri() {
|
|
54
54
|
throw new Error("https://svelte.dev/e/state_prototype_fixed");
|
|
55
55
|
}
|
|
56
|
-
function
|
|
56
|
+
function ii() {
|
|
57
57
|
throw new Error("https://svelte.dev/e/state_unsafe_mutation");
|
|
58
58
|
}
|
|
59
59
|
function Ln(e) {
|
|
60
60
|
return e === this.v;
|
|
61
61
|
}
|
|
62
|
-
function
|
|
62
|
+
function ai(e, t) {
|
|
63
63
|
return e != e ? t == t : e !== t || e !== null && typeof e == "object" || typeof e == "function";
|
|
64
64
|
}
|
|
65
|
-
function
|
|
66
|
-
return !
|
|
65
|
+
function Un(e) {
|
|
66
|
+
return !ai(e, this.v);
|
|
67
67
|
}
|
|
68
|
-
let
|
|
69
|
-
function
|
|
70
|
-
|
|
68
|
+
let H = null;
|
|
69
|
+
function mt(e) {
|
|
70
|
+
H = e;
|
|
71
71
|
}
|
|
72
72
|
function sn(e, t = !1, n) {
|
|
73
|
-
|
|
74
|
-
p:
|
|
73
|
+
H = {
|
|
74
|
+
p: H,
|
|
75
75
|
i: !1,
|
|
76
76
|
c: null,
|
|
77
77
|
e: null,
|
|
@@ -83,49 +83,49 @@ function sn(e, t = !1, n) {
|
|
|
83
83
|
function on(e) {
|
|
84
84
|
var t = (
|
|
85
85
|
/** @type {ComponentContext} */
|
|
86
|
-
|
|
86
|
+
H
|
|
87
87
|
), n = t.e;
|
|
88
88
|
if (n !== null) {
|
|
89
89
|
t.e = null;
|
|
90
90
|
for (var r of n)
|
|
91
91
|
Jn(r);
|
|
92
92
|
}
|
|
93
|
-
return t.i = !0,
|
|
93
|
+
return t.i = !0, H = t.p, /** @type {T} */
|
|
94
94
|
{};
|
|
95
95
|
}
|
|
96
96
|
function lt() {
|
|
97
|
-
return !ot ||
|
|
97
|
+
return !ot || H !== null && H.l === null;
|
|
98
98
|
}
|
|
99
|
-
let
|
|
100
|
-
function
|
|
101
|
-
var e =
|
|
102
|
-
|
|
99
|
+
let Re = [];
|
|
100
|
+
function jn() {
|
|
101
|
+
var e = Re;
|
|
102
|
+
Re = [], Wt(e);
|
|
103
103
|
}
|
|
104
|
-
function
|
|
105
|
-
if (
|
|
106
|
-
var t =
|
|
104
|
+
function zn(e) {
|
|
105
|
+
if (Re.length === 0 && !et) {
|
|
106
|
+
var t = Re;
|
|
107
107
|
queueMicrotask(() => {
|
|
108
|
-
t ===
|
|
108
|
+
t === Re && jn();
|
|
109
109
|
});
|
|
110
110
|
}
|
|
111
|
-
|
|
111
|
+
Re.push(e);
|
|
112
112
|
}
|
|
113
|
-
function
|
|
114
|
-
for (;
|
|
115
|
-
|
|
113
|
+
function si() {
|
|
114
|
+
for (; Re.length > 0; )
|
|
115
|
+
jn();
|
|
116
116
|
}
|
|
117
|
-
function
|
|
118
|
-
var t =
|
|
117
|
+
function oi(e) {
|
|
118
|
+
var t = x;
|
|
119
119
|
if (t === null)
|
|
120
|
-
return
|
|
120
|
+
return S.f |= Pe, e;
|
|
121
121
|
if ((t.f & rn) === 0) {
|
|
122
122
|
if ((t.f & nn) === 0)
|
|
123
123
|
throw e;
|
|
124
124
|
t.b.error(e);
|
|
125
125
|
} else
|
|
126
|
-
|
|
126
|
+
yt(e, t);
|
|
127
127
|
}
|
|
128
|
-
function
|
|
128
|
+
function yt(e, t) {
|
|
129
129
|
for (; t !== null; ) {
|
|
130
130
|
if ((t.f & nn) !== 0)
|
|
131
131
|
try {
|
|
@@ -138,8 +138,8 @@ function bt(e, t) {
|
|
|
138
138
|
}
|
|
139
139
|
throw e;
|
|
140
140
|
}
|
|
141
|
-
const
|
|
142
|
-
let
|
|
141
|
+
const dt = /* @__PURE__ */ new Set();
|
|
142
|
+
let C = null, _t = null, te = null, ee = [], xt = null, Zt = !1, et = !1;
|
|
143
143
|
class nt {
|
|
144
144
|
committed = !1;
|
|
145
145
|
/**
|
|
@@ -178,12 +178,12 @@ class nt {
|
|
|
178
178
|
* TODO replace with Promise.withResolvers once supported widely enough
|
|
179
179
|
* @type {{ promise: Promise<void>, resolve: (value?: any) => void, reject: (reason: unknown) => void } | null}
|
|
180
180
|
*/
|
|
181
|
-
#
|
|
181
|
+
#a = null;
|
|
182
182
|
/**
|
|
183
183
|
* Deferred effects (which run after async work has completed) that are DIRTY
|
|
184
184
|
* @type {Set<Effect>}
|
|
185
185
|
*/
|
|
186
|
-
#
|
|
186
|
+
#i = /* @__PURE__ */ new Set();
|
|
187
187
|
/**
|
|
188
188
|
* Deferred effects that are MAYBE_DIRTY
|
|
189
189
|
* @type {Set<Effect>}
|
|
@@ -204,7 +204,7 @@ class nt {
|
|
|
204
204
|
* @param {Effect[]} root_effects
|
|
205
205
|
*/
|
|
206
206
|
process(t) {
|
|
207
|
-
ee = [],
|
|
207
|
+
ee = [], _t = null, this.apply();
|
|
208
208
|
var n = {
|
|
209
209
|
parent: null,
|
|
210
210
|
effect: null,
|
|
@@ -213,7 +213,7 @@ class nt {
|
|
|
213
213
|
};
|
|
214
214
|
for (const r of t)
|
|
215
215
|
this.#l(r, n);
|
|
216
|
-
this.is_fork || this.#
|
|
216
|
+
this.is_fork || this.#c(), this.is_deferred() ? (this.#o(n.effects), this.#o(n.render_effects)) : (_t = this, C = null, gn(n.render_effects), gn(n.effects), _t = null, this.#a?.resolve()), te = null;
|
|
217
217
|
}
|
|
218
218
|
/**
|
|
219
219
|
* Traverse the effect tree, executing effects or stashing
|
|
@@ -224,14 +224,14 @@ class nt {
|
|
|
224
224
|
#l(t, n) {
|
|
225
225
|
t.f ^= q;
|
|
226
226
|
for (var r = t.first; r !== null; ) {
|
|
227
|
-
var
|
|
227
|
+
var a = r.f, i = (a & (ye | Ye)) !== 0, l = i && (a & q) !== 0, s = l || (a & Q) !== 0 || this.skipped_effects.has(r);
|
|
228
228
|
if ((r.f & nn) !== 0 && r.b?.is_pending() && (n = {
|
|
229
229
|
parent: n,
|
|
230
230
|
effect: r,
|
|
231
231
|
effects: [],
|
|
232
232
|
render_effects: []
|
|
233
|
-
}), !
|
|
234
|
-
|
|
233
|
+
}), !s && r.fn !== null) {
|
|
234
|
+
i ? r.f ^= q : (a & Nn) !== 0 ? n.effects.push(r) : Be(r) && ((r.f & me) !== 0 && this.#i.add(r), Ve(r));
|
|
235
235
|
var u = r.first;
|
|
236
236
|
if (u !== null) {
|
|
237
237
|
r = u;
|
|
@@ -249,7 +249,7 @@ class nt {
|
|
|
249
249
|
*/
|
|
250
250
|
#o(t) {
|
|
251
251
|
for (const n of t)
|
|
252
|
-
(n.f & Z) !== 0 ? this.#
|
|
252
|
+
(n.f & Z) !== 0 ? this.#i.add(n) : (n.f & re) !== 0 && this.#s.add(n), this.#u(n.deps), K(n, q);
|
|
253
253
|
}
|
|
254
254
|
/**
|
|
255
255
|
* @param {Value[] | null} deps
|
|
@@ -257,7 +257,7 @@ class nt {
|
|
|
257
257
|
#u(t) {
|
|
258
258
|
if (t !== null)
|
|
259
259
|
for (const n of t)
|
|
260
|
-
(n.f & V) === 0 || (n.f &
|
|
260
|
+
(n.f & V) === 0 || (n.f & Oe) === 0 || (n.f ^= Oe, this.#u(
|
|
261
261
|
/** @type {Derived} */
|
|
262
262
|
n.deps
|
|
263
263
|
));
|
|
@@ -269,17 +269,17 @@ class nt {
|
|
|
269
269
|
* @param {any} value
|
|
270
270
|
*/
|
|
271
271
|
capture(t, n) {
|
|
272
|
-
this.previous.has(t) || this.previous.set(t, n), (t.f &
|
|
272
|
+
this.previous.has(t) || this.previous.set(t, n), (t.f & Pe) === 0 && (this.current.set(t, t.v), te?.set(t, t.v));
|
|
273
273
|
}
|
|
274
274
|
activate() {
|
|
275
|
-
|
|
275
|
+
C = this, this.apply();
|
|
276
276
|
}
|
|
277
277
|
deactivate() {
|
|
278
|
-
|
|
278
|
+
C === this && (C = null, te = null);
|
|
279
279
|
}
|
|
280
280
|
flush() {
|
|
281
281
|
if (this.activate(), ee.length > 0) {
|
|
282
|
-
if (
|
|
282
|
+
if (Hn(), C !== null && C !== this)
|
|
283
283
|
return;
|
|
284
284
|
} else this.#e === 0 && this.process([]);
|
|
285
285
|
this.deactivate();
|
|
@@ -288,15 +288,15 @@ class nt {
|
|
|
288
288
|
for (const t of this.#n) t(this);
|
|
289
289
|
this.#n.clear();
|
|
290
290
|
}
|
|
291
|
-
#
|
|
291
|
+
#c() {
|
|
292
292
|
if (this.#r === 0) {
|
|
293
293
|
for (const t of this.#t) t();
|
|
294
294
|
this.#t.clear();
|
|
295
295
|
}
|
|
296
|
-
this.#e === 0 && this.#
|
|
296
|
+
this.#e === 0 && this.#f();
|
|
297
297
|
}
|
|
298
|
-
#
|
|
299
|
-
if (
|
|
298
|
+
#f() {
|
|
299
|
+
if (dt.size > 1) {
|
|
300
300
|
this.previous.clear();
|
|
301
301
|
var t = te, n = !0, r = {
|
|
302
302
|
parent: null,
|
|
@@ -304,41 +304,41 @@ class nt {
|
|
|
304
304
|
effects: [],
|
|
305
305
|
render_effects: []
|
|
306
306
|
};
|
|
307
|
-
for (const
|
|
308
|
-
if (
|
|
307
|
+
for (const i of dt) {
|
|
308
|
+
if (i === this) {
|
|
309
309
|
n = !1;
|
|
310
310
|
continue;
|
|
311
311
|
}
|
|
312
312
|
const l = [];
|
|
313
313
|
for (const [u, o] of this.current) {
|
|
314
|
-
if (
|
|
315
|
-
if (n && o !==
|
|
316
|
-
|
|
314
|
+
if (i.current.has(u))
|
|
315
|
+
if (n && o !== i.current.get(u))
|
|
316
|
+
i.current.set(u, o);
|
|
317
317
|
else
|
|
318
318
|
continue;
|
|
319
319
|
l.push(u);
|
|
320
320
|
}
|
|
321
321
|
if (l.length === 0)
|
|
322
322
|
continue;
|
|
323
|
-
const
|
|
324
|
-
if (
|
|
325
|
-
var
|
|
323
|
+
const s = [...i.current.keys()].filter((u) => !this.current.has(u));
|
|
324
|
+
if (s.length > 0) {
|
|
325
|
+
var a = ee;
|
|
326
326
|
ee = [];
|
|
327
327
|
const u = /* @__PURE__ */ new Set(), o = /* @__PURE__ */ new Map();
|
|
328
|
-
for (const
|
|
329
|
-
qn(
|
|
328
|
+
for (const c of l)
|
|
329
|
+
qn(c, s, u, o);
|
|
330
330
|
if (ee.length > 0) {
|
|
331
|
-
|
|
332
|
-
for (const
|
|
333
|
-
|
|
334
|
-
|
|
331
|
+
C = i, i.apply();
|
|
332
|
+
for (const c of ee)
|
|
333
|
+
i.#l(c, r);
|
|
334
|
+
i.deactivate();
|
|
335
335
|
}
|
|
336
|
-
ee =
|
|
336
|
+
ee = a;
|
|
337
337
|
}
|
|
338
338
|
}
|
|
339
|
-
|
|
339
|
+
C = null, te = t;
|
|
340
340
|
}
|
|
341
|
-
this.committed = !0,
|
|
341
|
+
this.committed = !0, dt.delete(this);
|
|
342
342
|
}
|
|
343
343
|
/**
|
|
344
344
|
*
|
|
@@ -355,10 +355,10 @@ class nt {
|
|
|
355
355
|
this.#e -= 1, t && (this.#r -= 1), this.revive();
|
|
356
356
|
}
|
|
357
357
|
revive() {
|
|
358
|
-
for (const t of this.#
|
|
359
|
-
this.#s.delete(t),
|
|
358
|
+
for (const t of this.#i)
|
|
359
|
+
this.#s.delete(t), K(t, Z), Ne(t);
|
|
360
360
|
for (const t of this.#s)
|
|
361
|
-
|
|
361
|
+
K(t, re), Ne(t);
|
|
362
362
|
this.flush();
|
|
363
363
|
}
|
|
364
364
|
/** @param {() => void} fn */
|
|
@@ -370,80 +370,80 @@ class nt {
|
|
|
370
370
|
this.#n.add(t);
|
|
371
371
|
}
|
|
372
372
|
settled() {
|
|
373
|
-
return (this.#
|
|
373
|
+
return (this.#a ??= On()).promise;
|
|
374
374
|
}
|
|
375
375
|
static ensure() {
|
|
376
|
-
if (
|
|
377
|
-
const t =
|
|
378
|
-
|
|
379
|
-
|
|
376
|
+
if (C === null) {
|
|
377
|
+
const t = C = new nt();
|
|
378
|
+
dt.add(C), et || nt.enqueue(() => {
|
|
379
|
+
C === t && t.flush();
|
|
380
380
|
});
|
|
381
381
|
}
|
|
382
|
-
return
|
|
382
|
+
return C;
|
|
383
383
|
}
|
|
384
384
|
/** @param {() => void} task */
|
|
385
385
|
static enqueue(t) {
|
|
386
|
-
|
|
386
|
+
zn(t);
|
|
387
387
|
}
|
|
388
388
|
apply() {
|
|
389
389
|
}
|
|
390
390
|
}
|
|
391
|
-
function
|
|
391
|
+
function li(e) {
|
|
392
392
|
var t = et;
|
|
393
393
|
et = !0;
|
|
394
394
|
try {
|
|
395
395
|
for (var n; ; ) {
|
|
396
|
-
if (
|
|
397
|
-
return
|
|
396
|
+
if (si(), ee.length === 0 && (C?.flush(), ee.length === 0))
|
|
397
|
+
return xt = null, /** @type {T} */
|
|
398
398
|
n;
|
|
399
|
-
|
|
399
|
+
Hn();
|
|
400
400
|
}
|
|
401
401
|
} finally {
|
|
402
402
|
et = t;
|
|
403
403
|
}
|
|
404
404
|
}
|
|
405
|
-
function
|
|
406
|
-
var e =
|
|
405
|
+
function Hn() {
|
|
406
|
+
var e = Te;
|
|
407
407
|
Zt = !0;
|
|
408
408
|
var t = null;
|
|
409
409
|
try {
|
|
410
410
|
var n = 0;
|
|
411
|
-
for (
|
|
411
|
+
for (Et(!0); ee.length > 0; ) {
|
|
412
412
|
var r = nt.ensure();
|
|
413
413
|
if (n++ > 1e3) {
|
|
414
|
-
var
|
|
415
|
-
|
|
414
|
+
var a, i;
|
|
415
|
+
ui();
|
|
416
416
|
}
|
|
417
|
-
r.process(ee),
|
|
417
|
+
r.process(ee), Se.clear();
|
|
418
418
|
}
|
|
419
419
|
} finally {
|
|
420
|
-
Zt = !1,
|
|
420
|
+
Zt = !1, Et(e), xt = null;
|
|
421
421
|
}
|
|
422
422
|
}
|
|
423
|
-
function
|
|
423
|
+
function ui() {
|
|
424
424
|
try {
|
|
425
|
-
|
|
425
|
+
ei();
|
|
426
426
|
} catch (e) {
|
|
427
|
-
|
|
427
|
+
yt(e, xt);
|
|
428
428
|
}
|
|
429
429
|
}
|
|
430
430
|
let ve = null;
|
|
431
|
-
function
|
|
431
|
+
function gn(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 & (pe |
|
|
437
|
-
|
|
438
|
-
for (const
|
|
439
|
-
if ((
|
|
440
|
-
const
|
|
441
|
-
let l =
|
|
436
|
+
if ((r.f & (pe | Q)) === 0 && Be(r) && (ve = /* @__PURE__ */ new Set(), Ve(r), r.deps === null && r.first === null && r.nodes === null && (r.teardown === null && r.ac === null ? er(r) : r.fn = null), ve?.size > 0)) {
|
|
437
|
+
Se.clear();
|
|
438
|
+
for (const a of ve) {
|
|
439
|
+
if ((a.f & (pe | Q)) !== 0) continue;
|
|
440
|
+
const i = [a];
|
|
441
|
+
let l = a.parent;
|
|
442
442
|
for (; l !== null; )
|
|
443
|
-
ve.has(l) && (ve.delete(l),
|
|
444
|
-
for (let
|
|
445
|
-
const u =
|
|
446
|
-
(u.f & (pe |
|
|
443
|
+
ve.has(l) && (ve.delete(l), i.push(l)), l = l.parent;
|
|
444
|
+
for (let s = i.length - 1; s >= 0; s--) {
|
|
445
|
+
const u = i[s];
|
|
446
|
+
(u.f & (pe | Q)) === 0 && Ve(u);
|
|
447
447
|
}
|
|
448
448
|
}
|
|
449
449
|
ve.clear();
|
|
@@ -454,103 +454,103 @@ function wn(e) {
|
|
|
454
454
|
}
|
|
455
455
|
function qn(e, t, n, r) {
|
|
456
456
|
if (!n.has(e) && (n.add(e), e.reactions !== null))
|
|
457
|
-
for (const
|
|
458
|
-
const
|
|
459
|
-
(
|
|
457
|
+
for (const a of e.reactions) {
|
|
458
|
+
const i = a.f;
|
|
459
|
+
(i & V) !== 0 ? qn(
|
|
460
460
|
/** @type {Derived} */
|
|
461
|
-
|
|
461
|
+
a,
|
|
462
462
|
t,
|
|
463
463
|
n,
|
|
464
464
|
r
|
|
465
|
-
) : (
|
|
465
|
+
) : (i & (an | me)) !== 0 && (i & Z) === 0 && Kn(a, t, r) && (K(a, Z), Ne(
|
|
466
466
|
/** @type {Effect} */
|
|
467
|
-
|
|
467
|
+
a
|
|
468
468
|
));
|
|
469
469
|
}
|
|
470
470
|
}
|
|
471
|
-
function
|
|
471
|
+
function Kn(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
|
-
for (const
|
|
476
|
-
if (t.includes(
|
|
475
|
+
for (const a of e.deps) {
|
|
476
|
+
if (t.includes(a))
|
|
477
477
|
return !0;
|
|
478
|
-
if ((
|
|
478
|
+
if ((a.f & V) !== 0 && Kn(
|
|
479
479
|
/** @type {Derived} */
|
|
480
|
-
|
|
480
|
+
a,
|
|
481
481
|
t,
|
|
482
482
|
n
|
|
483
483
|
))
|
|
484
484
|
return n.set(
|
|
485
485
|
/** @type {Derived} */
|
|
486
|
-
|
|
486
|
+
a,
|
|
487
487
|
!0
|
|
488
488
|
), !0;
|
|
489
489
|
}
|
|
490
490
|
return n.set(e, !1), !1;
|
|
491
491
|
}
|
|
492
|
-
function
|
|
493
|
-
for (var t =
|
|
492
|
+
function Ne(e) {
|
|
493
|
+
for (var t = xt = e; t.parent !== null; ) {
|
|
494
494
|
t = t.parent;
|
|
495
495
|
var n = t.f;
|
|
496
|
-
if (Zt && t ===
|
|
496
|
+
if (Zt && t === x && (n & me) !== 0 && (n & Dn) === 0)
|
|
497
497
|
return;
|
|
498
|
-
if ((n & (
|
|
498
|
+
if ((n & (Ye | ye)) !== 0) {
|
|
499
499
|
if ((n & q) === 0) return;
|
|
500
500
|
t.f ^= q;
|
|
501
501
|
}
|
|
502
502
|
}
|
|
503
503
|
ee.push(t);
|
|
504
504
|
}
|
|
505
|
-
function
|
|
506
|
-
const
|
|
505
|
+
function ci(e, t, n, r) {
|
|
506
|
+
const a = lt() ? Mt : Tt;
|
|
507
507
|
if (n.length === 0 && e.length === 0) {
|
|
508
|
-
r(t.map(
|
|
508
|
+
r(t.map(a));
|
|
509
509
|
return;
|
|
510
510
|
}
|
|
511
|
-
var
|
|
511
|
+
var i = C, l = (
|
|
512
512
|
/** @type {Effect} */
|
|
513
|
-
|
|
514
|
-
),
|
|
513
|
+
x
|
|
514
|
+
), s = fi();
|
|
515
515
|
function u() {
|
|
516
|
-
Promise.all(n.map((o) => /* @__PURE__ */
|
|
517
|
-
|
|
516
|
+
Promise.all(n.map((o) => /* @__PURE__ */ di(o))).then((o) => {
|
|
517
|
+
s();
|
|
518
518
|
try {
|
|
519
|
-
r([...t.map(
|
|
520
|
-
} catch (
|
|
521
|
-
(l.f & pe) === 0 &&
|
|
519
|
+
r([...t.map(a), ...o]);
|
|
520
|
+
} catch (c) {
|
|
521
|
+
(l.f & pe) === 0 && yt(c, l);
|
|
522
522
|
}
|
|
523
|
-
|
|
523
|
+
i?.deactivate(), bt();
|
|
524
524
|
}).catch((o) => {
|
|
525
|
-
|
|
525
|
+
yt(o, l);
|
|
526
526
|
});
|
|
527
527
|
}
|
|
528
528
|
e.length > 0 ? Promise.all(e).then(() => {
|
|
529
|
-
|
|
529
|
+
s();
|
|
530
530
|
try {
|
|
531
531
|
return u();
|
|
532
532
|
} finally {
|
|
533
|
-
|
|
533
|
+
i?.deactivate(), bt();
|
|
534
534
|
}
|
|
535
535
|
}) : u();
|
|
536
536
|
}
|
|
537
|
-
function
|
|
538
|
-
var e =
|
|
539
|
-
return function(
|
|
540
|
-
ke(e), ue(t),
|
|
537
|
+
function fi() {
|
|
538
|
+
var e = x, t = S, n = H, r = C;
|
|
539
|
+
return function(i = !0) {
|
|
540
|
+
ke(e), ue(t), mt(n), i && r?.activate();
|
|
541
541
|
};
|
|
542
542
|
}
|
|
543
|
-
function
|
|
544
|
-
ke(null), ue(null),
|
|
543
|
+
function bt() {
|
|
544
|
+
ke(null), ue(null), mt(null);
|
|
545
545
|
}
|
|
546
546
|
// @__NO_SIDE_EFFECTS__
|
|
547
|
-
function
|
|
548
|
-
var t = V | Z, n =
|
|
547
|
+
function Mt(e) {
|
|
548
|
+
var t = V | Z, n = S !== null && (S.f & V) !== 0 ? (
|
|
549
549
|
/** @type {Derived} */
|
|
550
|
-
|
|
550
|
+
S
|
|
551
551
|
) : null;
|
|
552
|
-
return
|
|
553
|
-
ctx:
|
|
552
|
+
return x !== null && (x.f |= Rt), {
|
|
553
|
+
ctx: H,
|
|
554
554
|
deps: null,
|
|
555
555
|
effects: null,
|
|
556
556
|
equals: Ln,
|
|
@@ -560,92 +560,92 @@ function At(e) {
|
|
|
560
560
|
rv: 0,
|
|
561
561
|
v: (
|
|
562
562
|
/** @type {V} */
|
|
563
|
-
|
|
563
|
+
Y
|
|
564
564
|
),
|
|
565
565
|
wv: 0,
|
|
566
|
-
parent: n ??
|
|
566
|
+
parent: n ?? x,
|
|
567
567
|
ac: null
|
|
568
568
|
};
|
|
569
569
|
}
|
|
570
570
|
// @__NO_SIDE_EFFECTS__
|
|
571
|
-
function
|
|
571
|
+
function di(e, t) {
|
|
572
572
|
let n = (
|
|
573
573
|
/** @type {Effect | null} */
|
|
574
|
-
|
|
574
|
+
x
|
|
575
575
|
);
|
|
576
576
|
n === null && Jr();
|
|
577
577
|
var r = (
|
|
578
578
|
/** @type {Boundary} */
|
|
579
579
|
n.b
|
|
580
|
-
),
|
|
580
|
+
), a = (
|
|
581
581
|
/** @type {Promise<V>} */
|
|
582
582
|
/** @type {unknown} */
|
|
583
583
|
void 0
|
|
584
|
-
),
|
|
584
|
+
), i = rt(
|
|
585
585
|
/** @type {V} */
|
|
586
|
-
|
|
587
|
-
), l = !
|
|
588
|
-
return
|
|
589
|
-
var u =
|
|
590
|
-
|
|
586
|
+
Y
|
|
587
|
+
), l = !S, s = /* @__PURE__ */ new Map();
|
|
588
|
+
return Pi(() => {
|
|
589
|
+
var u = On();
|
|
590
|
+
a = u.promise;
|
|
591
591
|
try {
|
|
592
592
|
Promise.resolve(e()).then(u.resolve, u.reject).then(() => {
|
|
593
|
-
o ===
|
|
593
|
+
o === C && o.committed && o.deactivate(), bt();
|
|
594
594
|
});
|
|
595
595
|
} catch (p) {
|
|
596
|
-
u.reject(p),
|
|
596
|
+
u.reject(p), bt();
|
|
597
597
|
}
|
|
598
598
|
var o = (
|
|
599
599
|
/** @type {Batch} */
|
|
600
|
-
|
|
600
|
+
C
|
|
601
601
|
);
|
|
602
602
|
if (l) {
|
|
603
|
-
var
|
|
604
|
-
r.update_pending_count(1), o.increment(
|
|
603
|
+
var c = !r.is_pending();
|
|
604
|
+
r.update_pending_count(1), o.increment(c), s.get(o)?.reject(ze), s.delete(o), s.set(o, u);
|
|
605
605
|
}
|
|
606
|
-
const
|
|
607
|
-
if (o.activate(),
|
|
608
|
-
|
|
606
|
+
const d = (p, h = void 0) => {
|
|
607
|
+
if (o.activate(), h)
|
|
608
|
+
h !== ze && (i.f |= Pe, it(i, h));
|
|
609
609
|
else {
|
|
610
|
-
(
|
|
611
|
-
for (const [
|
|
612
|
-
if (
|
|
613
|
-
|
|
610
|
+
(i.f & Pe) !== 0 && (i.f ^= Pe), it(i, p);
|
|
611
|
+
for (const [v, w] of s) {
|
|
612
|
+
if (s.delete(v), v === o) break;
|
|
613
|
+
w.reject(ze);
|
|
614
614
|
}
|
|
615
615
|
}
|
|
616
|
-
l && (r.update_pending_count(-1), o.decrement(
|
|
616
|
+
l && (r.update_pending_count(-1), o.decrement(c));
|
|
617
617
|
};
|
|
618
|
-
u.promise.then(
|
|
618
|
+
u.promise.then(d, (p) => d(null, p || "unknown"));
|
|
619
619
|
}), un(() => {
|
|
620
|
-
for (const u of
|
|
621
|
-
u.reject(
|
|
620
|
+
for (const u of s.values())
|
|
621
|
+
u.reject(ze);
|
|
622
622
|
}), new Promise((u) => {
|
|
623
|
-
function o(
|
|
624
|
-
function
|
|
625
|
-
|
|
623
|
+
function o(c) {
|
|
624
|
+
function d() {
|
|
625
|
+
c === a ? u(i) : o(a);
|
|
626
626
|
}
|
|
627
|
-
|
|
627
|
+
c.then(d, d);
|
|
628
628
|
}
|
|
629
|
-
o(
|
|
629
|
+
o(a);
|
|
630
630
|
});
|
|
631
631
|
}
|
|
632
632
|
// @__NO_SIDE_EFFECTS__
|
|
633
|
-
function
|
|
634
|
-
const t = /* @__PURE__ */
|
|
635
|
-
return t.equals =
|
|
633
|
+
function Tt(e) {
|
|
634
|
+
const t = /* @__PURE__ */ Mt(e);
|
|
635
|
+
return t.equals = Un, t;
|
|
636
636
|
}
|
|
637
637
|
function Vn(e) {
|
|
638
638
|
var t = e.effects;
|
|
639
639
|
if (t !== null) {
|
|
640
640
|
e.effects = null;
|
|
641
641
|
for (var n = 0; n < t.length; n += 1)
|
|
642
|
-
|
|
642
|
+
he(
|
|
643
643
|
/** @type {Effect} */
|
|
644
644
|
t[n]
|
|
645
645
|
);
|
|
646
646
|
}
|
|
647
647
|
}
|
|
648
|
-
function
|
|
648
|
+
function vi(e) {
|
|
649
649
|
for (var t = e.parent; t !== null; ) {
|
|
650
650
|
if ((t.f & V) === 0)
|
|
651
651
|
return (t.f & pe) === 0 ? (
|
|
@@ -657,28 +657,28 @@ function va(e) {
|
|
|
657
657
|
return null;
|
|
658
658
|
}
|
|
659
659
|
function ln(e) {
|
|
660
|
-
var t, n =
|
|
661
|
-
ke(
|
|
660
|
+
var t, n = x;
|
|
661
|
+
ke(vi(e));
|
|
662
662
|
try {
|
|
663
|
-
e.f &= ~
|
|
663
|
+
e.f &= ~Oe, Vn(e), t = sr(e);
|
|
664
664
|
} finally {
|
|
665
665
|
ke(n);
|
|
666
666
|
}
|
|
667
667
|
return t;
|
|
668
668
|
}
|
|
669
|
-
function
|
|
669
|
+
function Yn(e) {
|
|
670
670
|
var t = ln(e);
|
|
671
|
-
if (e.equals(t) || (
|
|
671
|
+
if (e.equals(t) || (C?.is_fork || (e.v = t), e.wv = ir()), !De)
|
|
672
672
|
if (te !== null)
|
|
673
|
-
(
|
|
673
|
+
(wt() || C?.is_fork) && te.set(e, t);
|
|
674
674
|
else {
|
|
675
675
|
var n = (e.f & ne) === 0 ? re : q;
|
|
676
|
-
|
|
676
|
+
K(e, n);
|
|
677
677
|
}
|
|
678
678
|
}
|
|
679
679
|
let Jt = /* @__PURE__ */ new Set();
|
|
680
|
-
const
|
|
681
|
-
let
|
|
680
|
+
const Se = /* @__PURE__ */ new Map();
|
|
681
|
+
let Bn = !1;
|
|
682
682
|
function rt(e, t) {
|
|
683
683
|
var n = {
|
|
684
684
|
f: 0,
|
|
@@ -694,84 +694,84 @@ function rt(e, t) {
|
|
|
694
694
|
// @__NO_SIDE_EFFECTS__
|
|
695
695
|
function be(e, t) {
|
|
696
696
|
const n = rt(e);
|
|
697
|
-
return
|
|
697
|
+
return Ci(n), n;
|
|
698
698
|
}
|
|
699
699
|
// @__NO_SIDE_EFFECTS__
|
|
700
700
|
function Ie(e, t = !1, n = !0) {
|
|
701
701
|
const r = rt(e);
|
|
702
|
-
return t || (r.equals =
|
|
702
|
+
return t || (r.equals = Un), ot && n && H !== null && H.l !== null && (H.l.s ??= []).push(r), r;
|
|
703
703
|
}
|
|
704
|
-
function
|
|
705
|
-
|
|
704
|
+
function z(e, t, n = !1) {
|
|
705
|
+
S !== 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
|
-
(!le || (
|
|
708
|
-
let r = n ?
|
|
709
|
-
return
|
|
707
|
+
(!le || (S.f & bn) !== 0) && lt() && (S.f & (V | me | an | bn)) !== 0 && !_e?.includes(e) && ii();
|
|
708
|
+
let r = n ? He(t) : t;
|
|
709
|
+
return it(e, r);
|
|
710
710
|
}
|
|
711
|
-
function
|
|
711
|
+
function it(e, t) {
|
|
712
712
|
if (!e.equals(t)) {
|
|
713
713
|
var n = e.v;
|
|
714
|
-
De ?
|
|
714
|
+
De ? Se.set(e, t) : Se.set(e, n), e.v = t;
|
|
715
715
|
var r = nt.ensure();
|
|
716
716
|
r.capture(e, n), (e.f & V) !== 0 && ((e.f & Z) !== 0 && ln(
|
|
717
717
|
/** @type {Derived} */
|
|
718
718
|
e
|
|
719
|
-
),
|
|
719
|
+
), K(e, (e.f & ne) !== 0 ? q : re)), e.wv = ir(), Wn(e, Z), lt() && x !== null && (x.f & q) !== 0 && (x.f & (ye | Ye)) === 0 && (X === null ? Ri([e]) : X.push(e)), !r.is_fork && Jt.size > 0 && !Bn && pi();
|
|
720
720
|
}
|
|
721
721
|
return t;
|
|
722
722
|
}
|
|
723
|
-
function
|
|
724
|
-
|
|
725
|
-
var e =
|
|
726
|
-
|
|
723
|
+
function pi() {
|
|
724
|
+
Bn = !1;
|
|
725
|
+
var e = Te;
|
|
726
|
+
Et(!0);
|
|
727
727
|
const t = Array.from(Jt);
|
|
728
728
|
try {
|
|
729
729
|
for (const n of t)
|
|
730
|
-
(n.f & q) !== 0 &&
|
|
730
|
+
(n.f & q) !== 0 && K(n, re), Be(n) && Ve(n);
|
|
731
731
|
} finally {
|
|
732
|
-
|
|
732
|
+
Et(e);
|
|
733
733
|
}
|
|
734
734
|
Jt.clear();
|
|
735
735
|
}
|
|
736
736
|
function qt(e) {
|
|
737
|
-
|
|
737
|
+
z(e, e.v + 1);
|
|
738
738
|
}
|
|
739
|
-
function
|
|
739
|
+
function Wn(e, t) {
|
|
740
740
|
var n = e.reactions;
|
|
741
741
|
if (n !== null)
|
|
742
|
-
for (var r = lt(),
|
|
743
|
-
var l = n[
|
|
744
|
-
if (!(!r && l ===
|
|
745
|
-
var u = (
|
|
746
|
-
if (u &&
|
|
742
|
+
for (var r = lt(), a = n.length, i = 0; i < a; i++) {
|
|
743
|
+
var l = n[i], s = l.f;
|
|
744
|
+
if (!(!r && l === x)) {
|
|
745
|
+
var u = (s & Z) === 0;
|
|
746
|
+
if (u && K(l, t), (s & V) !== 0) {
|
|
747
747
|
var o = (
|
|
748
748
|
/** @type {Derived} */
|
|
749
749
|
l
|
|
750
750
|
);
|
|
751
|
-
te?.delete(o), (
|
|
752
|
-
} else u && ((
|
|
751
|
+
te?.delete(o), (s & Oe) === 0 && (s & ne && (l.f |= Oe), Wn(o, re));
|
|
752
|
+
} else u && ((s & me) !== 0 && ve !== null && ve.add(
|
|
753
753
|
/** @type {Effect} */
|
|
754
754
|
l
|
|
755
|
-
),
|
|
755
|
+
), Ne(
|
|
756
756
|
/** @type {Effect} */
|
|
757
757
|
l
|
|
758
758
|
));
|
|
759
759
|
}
|
|
760
760
|
}
|
|
761
761
|
}
|
|
762
|
-
function
|
|
763
|
-
if (typeof e != "object" || e === null ||
|
|
762
|
+
function He(e) {
|
|
763
|
+
if (typeof e != "object" || e === null || Ke in e)
|
|
764
764
|
return e;
|
|
765
|
-
const t =
|
|
766
|
-
if (t !==
|
|
765
|
+
const t = An(e);
|
|
766
|
+
if (t !== Yr && t !== Br)
|
|
767
767
|
return e;
|
|
768
|
-
var n = /* @__PURE__ */ new Map(), r = Mn(e),
|
|
769
|
-
if (
|
|
770
|
-
return
|
|
771
|
-
var u =
|
|
772
|
-
ue(null),
|
|
773
|
-
var
|
|
774
|
-
return ue(u),
|
|
768
|
+
var n = /* @__PURE__ */ new Map(), r = Mn(e), a = /* @__PURE__ */ be(0), i = Ae, l = (s) => {
|
|
769
|
+
if (Ae === i)
|
|
770
|
+
return s();
|
|
771
|
+
var u = S, o = Ae;
|
|
772
|
+
ue(null), Sn(i);
|
|
773
|
+
var c = s();
|
|
774
|
+
return ue(u), Sn(o), c;
|
|
775
775
|
};
|
|
776
776
|
return r && n.set("length", /* @__PURE__ */ be(
|
|
777
777
|
/** @type {any[]} */
|
|
@@ -780,46 +780,46 @@ function Be(e) {
|
|
|
780
780
|
/** @type {any} */
|
|
781
781
|
e,
|
|
782
782
|
{
|
|
783
|
-
defineProperty(
|
|
784
|
-
(!("value" in o) || o.configurable === !1 || o.enumerable === !1 || o.writable === !1) &&
|
|
785
|
-
var
|
|
786
|
-
return
|
|
787
|
-
var
|
|
788
|
-
return n.set(u,
|
|
789
|
-
}) :
|
|
783
|
+
defineProperty(s, u, o) {
|
|
784
|
+
(!("value" in o) || o.configurable === !1 || o.enumerable === !1 || o.writable === !1) && ni();
|
|
785
|
+
var c = n.get(u);
|
|
786
|
+
return c === void 0 ? c = l(() => {
|
|
787
|
+
var d = /* @__PURE__ */ be(o.value);
|
|
788
|
+
return n.set(u, d), d;
|
|
789
|
+
}) : z(c, o.value, !0), !0;
|
|
790
790
|
},
|
|
791
|
-
deleteProperty(
|
|
791
|
+
deleteProperty(s, u) {
|
|
792
792
|
var o = n.get(u);
|
|
793
793
|
if (o === void 0) {
|
|
794
|
-
if (u in
|
|
795
|
-
const
|
|
796
|
-
n.set(u,
|
|
794
|
+
if (u in s) {
|
|
795
|
+
const c = l(() => /* @__PURE__ */ be(Y));
|
|
796
|
+
n.set(u, c), qt(a);
|
|
797
797
|
}
|
|
798
798
|
} else
|
|
799
|
-
|
|
799
|
+
z(o, Y), qt(a);
|
|
800
800
|
return !0;
|
|
801
801
|
},
|
|
802
|
-
get(
|
|
803
|
-
if (u ===
|
|
802
|
+
get(s, u, o) {
|
|
803
|
+
if (u === Ke)
|
|
804
804
|
return e;
|
|
805
|
-
var
|
|
806
|
-
if (
|
|
807
|
-
var
|
|
808
|
-
return
|
|
809
|
-
}), n.set(u,
|
|
810
|
-
var p = f(
|
|
811
|
-
return p ===
|
|
805
|
+
var c = n.get(u), d = u in s;
|
|
806
|
+
if (c === void 0 && (!d || ht(s, u)?.writable) && (c = l(() => {
|
|
807
|
+
var h = He(d ? s[u] : Y), v = /* @__PURE__ */ be(h);
|
|
808
|
+
return v;
|
|
809
|
+
}), n.set(u, c)), c !== void 0) {
|
|
810
|
+
var p = f(c);
|
|
811
|
+
return p === Y ? void 0 : p;
|
|
812
812
|
}
|
|
813
|
-
return Reflect.get(
|
|
813
|
+
return Reflect.get(s, u, o);
|
|
814
814
|
},
|
|
815
|
-
getOwnPropertyDescriptor(
|
|
816
|
-
var o = Reflect.getOwnPropertyDescriptor(
|
|
815
|
+
getOwnPropertyDescriptor(s, u) {
|
|
816
|
+
var o = Reflect.getOwnPropertyDescriptor(s, u);
|
|
817
817
|
if (o && "value" in o) {
|
|
818
|
-
var
|
|
819
|
-
|
|
818
|
+
var c = n.get(u);
|
|
819
|
+
c && (o.value = f(c));
|
|
820
820
|
} else if (o === void 0) {
|
|
821
|
-
var
|
|
822
|
-
if (
|
|
821
|
+
var d = n.get(u), p = d?.v;
|
|
822
|
+
if (d !== void 0 && p !== Y)
|
|
823
823
|
return {
|
|
824
824
|
enumerable: !0,
|
|
825
825
|
configurable: !0,
|
|
@@ -829,66 +829,66 @@ function Be(e) {
|
|
|
829
829
|
}
|
|
830
830
|
return o;
|
|
831
831
|
},
|
|
832
|
-
has(
|
|
833
|
-
if (u ===
|
|
832
|
+
has(s, u) {
|
|
833
|
+
if (u === Ke)
|
|
834
834
|
return !0;
|
|
835
|
-
var o = n.get(u),
|
|
836
|
-
if (o !== void 0 ||
|
|
835
|
+
var o = n.get(u), c = o !== void 0 && o.v !== Y || Reflect.has(s, u);
|
|
836
|
+
if (o !== void 0 || x !== null && (!c || ht(s, u)?.writable)) {
|
|
837
837
|
o === void 0 && (o = l(() => {
|
|
838
|
-
var p =
|
|
839
|
-
return
|
|
838
|
+
var p = c ? He(s[u]) : Y, h = /* @__PURE__ */ be(p);
|
|
839
|
+
return h;
|
|
840
840
|
}), n.set(u, o));
|
|
841
|
-
var
|
|
842
|
-
if (
|
|
841
|
+
var d = f(o);
|
|
842
|
+
if (d === Y)
|
|
843
843
|
return !1;
|
|
844
844
|
}
|
|
845
|
-
return
|
|
845
|
+
return c;
|
|
846
846
|
},
|
|
847
|
-
set(
|
|
848
|
-
var
|
|
847
|
+
set(s, u, o, c) {
|
|
848
|
+
var d = n.get(u), p = u in s;
|
|
849
849
|
if (r && u === "length")
|
|
850
|
-
for (var
|
|
851
|
-
|
|
852
|
-
var
|
|
853
|
-
|
|
850
|
+
for (var h = o; h < /** @type {Source<number>} */
|
|
851
|
+
d.v; h += 1) {
|
|
852
|
+
var v = n.get(h + "");
|
|
853
|
+
v !== void 0 ? z(v, Y) : h in s && (v = l(() => /* @__PURE__ */ be(Y)), n.set(h + "", v));
|
|
854
854
|
}
|
|
855
|
-
if (
|
|
856
|
-
(!p || ht(
|
|
855
|
+
if (d === void 0)
|
|
856
|
+
(!p || ht(s, u)?.writable) && (d = l(() => /* @__PURE__ */ be(void 0)), z(d, He(o)), n.set(u, d));
|
|
857
857
|
else {
|
|
858
|
-
p =
|
|
859
|
-
var
|
|
860
|
-
|
|
858
|
+
p = d.v !== Y;
|
|
859
|
+
var w = l(() => He(o));
|
|
860
|
+
z(d, w);
|
|
861
861
|
}
|
|
862
|
-
var
|
|
863
|
-
if (
|
|
862
|
+
var g = Reflect.getOwnPropertyDescriptor(s, u);
|
|
863
|
+
if (g?.set && g.set.call(c, o), !p) {
|
|
864
864
|
if (r && typeof u == "string") {
|
|
865
865
|
var E = (
|
|
866
866
|
/** @type {Source<number>} */
|
|
867
867
|
n.get("length")
|
|
868
|
-
),
|
|
869
|
-
Number.isInteger(
|
|
868
|
+
), R = Number(u);
|
|
869
|
+
Number.isInteger(R) && R >= E.v && z(E, R + 1);
|
|
870
870
|
}
|
|
871
|
-
qt(
|
|
871
|
+
qt(a);
|
|
872
872
|
}
|
|
873
873
|
return !0;
|
|
874
874
|
},
|
|
875
|
-
ownKeys(
|
|
876
|
-
f(
|
|
877
|
-
var u = Reflect.ownKeys(
|
|
878
|
-
var p = n.get(
|
|
879
|
-
return p === void 0 || p.v !==
|
|
875
|
+
ownKeys(s) {
|
|
876
|
+
f(a);
|
|
877
|
+
var u = Reflect.ownKeys(s).filter((d) => {
|
|
878
|
+
var p = n.get(d);
|
|
879
|
+
return p === void 0 || p.v !== Y;
|
|
880
880
|
});
|
|
881
|
-
for (var [o,
|
|
882
|
-
|
|
881
|
+
for (var [o, c] of n)
|
|
882
|
+
c.v !== Y && !(o in s) && u.push(o);
|
|
883
883
|
return u;
|
|
884
884
|
},
|
|
885
885
|
setPrototypeOf() {
|
|
886
|
-
|
|
886
|
+
ri();
|
|
887
887
|
}
|
|
888
888
|
}
|
|
889
889
|
);
|
|
890
890
|
}
|
|
891
|
-
var
|
|
891
|
+
var hi, _i, mi;
|
|
892
892
|
function Me(e = "") {
|
|
893
893
|
return document.createTextNode(e);
|
|
894
894
|
}
|
|
@@ -896,20 +896,20 @@ function Me(e = "") {
|
|
|
896
896
|
function gt(e) {
|
|
897
897
|
return (
|
|
898
898
|
/** @type {TemplateNode | null} */
|
|
899
|
-
|
|
899
|
+
_i.call(e)
|
|
900
900
|
);
|
|
901
901
|
}
|
|
902
902
|
// @__NO_SIDE_EFFECTS__
|
|
903
903
|
function ut(e) {
|
|
904
904
|
return (
|
|
905
905
|
/** @type {TemplateNode | null} */
|
|
906
|
-
|
|
906
|
+
mi.call(e)
|
|
907
907
|
);
|
|
908
908
|
}
|
|
909
|
-
function
|
|
909
|
+
function A(e, t) {
|
|
910
910
|
return /* @__PURE__ */ gt(e);
|
|
911
911
|
}
|
|
912
|
-
function
|
|
912
|
+
function Xe(e, t = !1) {
|
|
913
913
|
{
|
|
914
914
|
var n = /* @__PURE__ */ gt(e);
|
|
915
915
|
return n instanceof Comment && n.data === "" ? /* @__PURE__ */ ut(n) : n;
|
|
@@ -922,15 +922,15 @@ function L(e, t = 1, n = !1) {
|
|
|
922
922
|
/* @__PURE__ */ ut(r);
|
|
923
923
|
return r;
|
|
924
924
|
}
|
|
925
|
-
function
|
|
925
|
+
function yi(e) {
|
|
926
926
|
e.textContent = "";
|
|
927
927
|
}
|
|
928
|
-
function
|
|
928
|
+
function Gn() {
|
|
929
929
|
return !1;
|
|
930
930
|
}
|
|
931
|
-
let
|
|
932
|
-
function
|
|
933
|
-
|
|
931
|
+
let wn = !1;
|
|
932
|
+
function bi() {
|
|
933
|
+
wn || (wn = !0, document.addEventListener(
|
|
934
934
|
"reset",
|
|
935
935
|
(e) => {
|
|
936
936
|
Promise.resolve().then(() => {
|
|
@@ -947,8 +947,8 @@ function ba() {
|
|
|
947
947
|
{ capture: !0 }
|
|
948
948
|
));
|
|
949
949
|
}
|
|
950
|
-
function
|
|
951
|
-
var t =
|
|
950
|
+
function At(e) {
|
|
951
|
+
var t = S, n = x;
|
|
952
952
|
ue(null), ke(null);
|
|
953
953
|
try {
|
|
954
954
|
return e();
|
|
@@ -956,25 +956,25 @@ function Nt(e) {
|
|
|
956
956
|
ue(t), ke(n);
|
|
957
957
|
}
|
|
958
958
|
}
|
|
959
|
-
function
|
|
960
|
-
e.addEventListener(t, () =>
|
|
961
|
-
const
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
} : e.__on_r = () => r(!0),
|
|
959
|
+
function gi(e, t, n, r = n) {
|
|
960
|
+
e.addEventListener(t, () => At(n));
|
|
961
|
+
const a = e.__on_r;
|
|
962
|
+
a ? e.__on_r = () => {
|
|
963
|
+
a(), r(!0);
|
|
964
|
+
} : e.__on_r = () => r(!0), bi();
|
|
965
965
|
}
|
|
966
966
|
function Zn(e) {
|
|
967
|
-
|
|
967
|
+
x === null && (S === null && $r(), Xr()), De && Qr();
|
|
968
968
|
}
|
|
969
|
-
function
|
|
969
|
+
function wi(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
|
|
974
|
-
var r =
|
|
975
|
-
r !== null && (r.f &
|
|
976
|
-
var
|
|
977
|
-
ctx:
|
|
973
|
+
function Ce(e, t, n) {
|
|
974
|
+
var r = x;
|
|
975
|
+
r !== null && (r.f & Q) !== 0 && (e |= Q);
|
|
976
|
+
var a = {
|
|
977
|
+
ctx: H,
|
|
978
978
|
deps: null,
|
|
979
979
|
nodes: null,
|
|
980
980
|
f: e | Z | ne,
|
|
@@ -991,135 +991,135 @@ function Re(e, t, n) {
|
|
|
991
991
|
};
|
|
992
992
|
if (n)
|
|
993
993
|
try {
|
|
994
|
-
Ve(
|
|
995
|
-
} catch (
|
|
996
|
-
throw
|
|
994
|
+
Ve(a), a.f |= rn;
|
|
995
|
+
} catch (s) {
|
|
996
|
+
throw he(a), s;
|
|
997
997
|
}
|
|
998
|
-
else t !== null &&
|
|
999
|
-
var
|
|
1000
|
-
if (n &&
|
|
1001
|
-
(
|
|
998
|
+
else t !== null && Ne(a);
|
|
999
|
+
var i = a;
|
|
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 & Rt) === 0 && (i = i.first, (e & me) !== 0 && (e & tt) !== 0 && i !== null && (i.f |= tt)), i !== null && (i.parent = r, r !== null && wi(i, r), S !== null && (S.f & V) !== 0 && (e & Ye) === 0)) {
|
|
1002
1002
|
var l = (
|
|
1003
1003
|
/** @type {Derived} */
|
|
1004
|
-
|
|
1004
|
+
S
|
|
1005
1005
|
);
|
|
1006
|
-
(l.effects ??= []).push(
|
|
1006
|
+
(l.effects ??= []).push(i);
|
|
1007
1007
|
}
|
|
1008
|
-
return
|
|
1008
|
+
return a;
|
|
1009
1009
|
}
|
|
1010
|
-
function
|
|
1011
|
-
return
|
|
1010
|
+
function wt() {
|
|
1011
|
+
return S !== null && !le;
|
|
1012
1012
|
}
|
|
1013
1013
|
function un(e) {
|
|
1014
|
-
const t =
|
|
1015
|
-
return
|
|
1014
|
+
const t = Ce(Ct, null, !1);
|
|
1015
|
+
return K(t, q), t.teardown = e, t;
|
|
1016
1016
|
}
|
|
1017
1017
|
function En(e) {
|
|
1018
1018
|
Zn();
|
|
1019
1019
|
var t = (
|
|
1020
1020
|
/** @type {Effect} */
|
|
1021
|
-
|
|
1022
|
-
), n = !
|
|
1021
|
+
x.f
|
|
1022
|
+
), n = !S && (t & ye) !== 0 && (t & rn) === 0;
|
|
1023
1023
|
if (n) {
|
|
1024
1024
|
var r = (
|
|
1025
1025
|
/** @type {ComponentContext} */
|
|
1026
|
-
|
|
1026
|
+
H
|
|
1027
1027
|
);
|
|
1028
1028
|
(r.e ??= []).push(e);
|
|
1029
1029
|
} else
|
|
1030
1030
|
return Jn(e);
|
|
1031
1031
|
}
|
|
1032
1032
|
function Jn(e) {
|
|
1033
|
-
return
|
|
1033
|
+
return Ce(Nn | Fn, e, !1);
|
|
1034
1034
|
}
|
|
1035
|
-
function
|
|
1036
|
-
return Zn(),
|
|
1035
|
+
function Ei(e) {
|
|
1036
|
+
return Zn(), Ce(Ct | Fn, e, !0);
|
|
1037
1037
|
}
|
|
1038
1038
|
function qe(e, t) {
|
|
1039
1039
|
var n = (
|
|
1040
1040
|
/** @type {ComponentContextLegacy} */
|
|
1041
|
-
|
|
1041
|
+
H
|
|
1042
1042
|
), r = { effect: null, ran: !1, deps: e };
|
|
1043
|
-
n.l.$.push(r), r.effect =
|
|
1044
|
-
e(), !r.ran && (r.ran = !0,
|
|
1043
|
+
n.l.$.push(r), r.effect = fn(() => {
|
|
1044
|
+
e(), !r.ran && (r.ran = !0, P(t));
|
|
1045
1045
|
});
|
|
1046
1046
|
}
|
|
1047
|
-
function
|
|
1047
|
+
function cn() {
|
|
1048
1048
|
var e = (
|
|
1049
1049
|
/** @type {ComponentContextLegacy} */
|
|
1050
|
-
|
|
1050
|
+
H
|
|
1051
1051
|
);
|
|
1052
|
-
|
|
1052
|
+
fn(() => {
|
|
1053
1053
|
for (var t of e.l.$) {
|
|
1054
1054
|
t.deps();
|
|
1055
1055
|
var n = t.effect;
|
|
1056
|
-
(n.f & q) !== 0 &&
|
|
1056
|
+
(n.f & q) !== 0 && K(n, re), Be(n) && Ve(n), t.ran = !1;
|
|
1057
1057
|
}
|
|
1058
1058
|
});
|
|
1059
1059
|
}
|
|
1060
|
-
function
|
|
1061
|
-
return
|
|
1060
|
+
function Pi(e) {
|
|
1061
|
+
return Ce(an | Rt, e, !0);
|
|
1062
1062
|
}
|
|
1063
|
-
function
|
|
1064
|
-
return
|
|
1063
|
+
function fn(e, t = 0) {
|
|
1064
|
+
return Ce(Ct | t, e, !0);
|
|
1065
1065
|
}
|
|
1066
1066
|
function oe(e, t = [], n = [], r = []) {
|
|
1067
|
-
|
|
1068
|
-
|
|
1067
|
+
ci(r, t, n, (a) => {
|
|
1068
|
+
Ce(Ct, () => e(...a.map(f)), !0);
|
|
1069
1069
|
});
|
|
1070
1070
|
}
|
|
1071
|
-
function
|
|
1072
|
-
var n =
|
|
1071
|
+
function Qn(e, t = 0) {
|
|
1072
|
+
var n = Ce(me | t, e, !0);
|
|
1073
1073
|
return n;
|
|
1074
1074
|
}
|
|
1075
|
-
function
|
|
1076
|
-
return
|
|
1075
|
+
function at(e) {
|
|
1076
|
+
return Ce(ye | Rt, e, !0);
|
|
1077
1077
|
}
|
|
1078
|
-
function
|
|
1078
|
+
function Xn(e) {
|
|
1079
1079
|
var t = e.teardown;
|
|
1080
1080
|
if (t !== null) {
|
|
1081
|
-
const n = De, r =
|
|
1082
|
-
|
|
1081
|
+
const n = De, r = S;
|
|
1082
|
+
Pn(!0), ue(null);
|
|
1083
1083
|
try {
|
|
1084
1084
|
t.call(null);
|
|
1085
1085
|
} finally {
|
|
1086
|
-
|
|
1086
|
+
Pn(n), ue(r);
|
|
1087
1087
|
}
|
|
1088
1088
|
}
|
|
1089
1089
|
}
|
|
1090
1090
|
function $n(e, t = !1) {
|
|
1091
1091
|
var n = e.first;
|
|
1092
1092
|
for (e.first = e.last = null; n !== null; ) {
|
|
1093
|
-
const
|
|
1094
|
-
|
|
1095
|
-
|
|
1093
|
+
const a = n.ac;
|
|
1094
|
+
a !== null && At(() => {
|
|
1095
|
+
a.abort(ze);
|
|
1096
1096
|
});
|
|
1097
1097
|
var r = n.next;
|
|
1098
|
-
(n.f &
|
|
1098
|
+
(n.f & Ye) !== 0 ? n.parent = null : he(n, t), n = r;
|
|
1099
1099
|
}
|
|
1100
1100
|
}
|
|
1101
|
-
function
|
|
1101
|
+
function Si(e) {
|
|
1102
1102
|
for (var t = e.first; t !== null; ) {
|
|
1103
1103
|
var n = t.next;
|
|
1104
|
-
(t.f & ye) === 0 &&
|
|
1104
|
+
(t.f & ye) === 0 && he(t), t = n;
|
|
1105
1105
|
}
|
|
1106
1106
|
}
|
|
1107
|
-
function
|
|
1107
|
+
function he(e, t = !0) {
|
|
1108
1108
|
var n = !1;
|
|
1109
|
-
(t || (e.f & Dn) !== 0) && e.nodes !== null && e.nodes.end !== null && (
|
|
1109
|
+
(t || (e.f & Dn) !== 0) && e.nodes !== null && e.nodes.end !== null && (Ii(
|
|
1110
1110
|
e.nodes.start,
|
|
1111
1111
|
/** @type {TemplateNode} */
|
|
1112
1112
|
e.nodes.end
|
|
1113
|
-
), n = !0), $n(e, t && !n), Pt(e, 0),
|
|
1113
|
+
), n = !0), $n(e, t && !n), Pt(e, 0), K(e, pe);
|
|
1114
1114
|
var r = e.nodes && e.nodes.t;
|
|
1115
1115
|
if (r !== null)
|
|
1116
|
-
for (const
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
var
|
|
1120
|
-
|
|
1116
|
+
for (const i of r)
|
|
1117
|
+
i.stop();
|
|
1118
|
+
Xn(e);
|
|
1119
|
+
var a = e.parent;
|
|
1120
|
+
a !== null && a.first !== null && er(e), e.next = e.prev = e.teardown = e.ctx = e.deps = e.fn = e.nodes = e.ac = null;
|
|
1121
1121
|
}
|
|
1122
|
-
function
|
|
1122
|
+
function Ii(e, t) {
|
|
1123
1123
|
for (; e !== null; ) {
|
|
1124
1124
|
var n = e === t ? null : /* @__PURE__ */ ut(e);
|
|
1125
1125
|
e.remove(), e = n;
|
|
@@ -1132,29 +1132,29 @@ function er(e) {
|
|
|
1132
1132
|
function dn(e, t, n = !0) {
|
|
1133
1133
|
var r = [];
|
|
1134
1134
|
tr(e, r, !0);
|
|
1135
|
-
var
|
|
1136
|
-
n &&
|
|
1137
|
-
},
|
|
1138
|
-
if (
|
|
1139
|
-
var l = () => --
|
|
1140
|
-
for (var
|
|
1141
|
-
|
|
1135
|
+
var a = () => {
|
|
1136
|
+
n && he(e), t && t();
|
|
1137
|
+
}, i = r.length;
|
|
1138
|
+
if (i > 0) {
|
|
1139
|
+
var l = () => --i || a();
|
|
1140
|
+
for (var s of r)
|
|
1141
|
+
s.out(l);
|
|
1142
1142
|
} else
|
|
1143
|
-
|
|
1143
|
+
a();
|
|
1144
1144
|
}
|
|
1145
1145
|
function tr(e, t, n) {
|
|
1146
|
-
if ((e.f &
|
|
1147
|
-
e.f ^=
|
|
1146
|
+
if ((e.f & Q) === 0) {
|
|
1147
|
+
e.f ^= Q;
|
|
1148
1148
|
var r = e.nodes && e.nodes.t;
|
|
1149
1149
|
if (r !== null)
|
|
1150
|
-
for (const
|
|
1151
|
-
(
|
|
1152
|
-
for (var
|
|
1153
|
-
var
|
|
1150
|
+
for (const s of r)
|
|
1151
|
+
(s.is_global || n) && t.push(s);
|
|
1152
|
+
for (var a = e.first; a !== null; ) {
|
|
1153
|
+
var i = a.next, l = (a.f & tt) !== 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
|
-
(
|
|
1157
|
-
tr(
|
|
1156
|
+
(a.f & ye) !== 0 && (e.f & me) !== 0;
|
|
1157
|
+
tr(a, t, l ? n : !1), a = i;
|
|
1158
1158
|
}
|
|
1159
1159
|
}
|
|
1160
1160
|
}
|
|
@@ -1162,148 +1162,148 @@ function vn(e) {
|
|
|
1162
1162
|
nr(e, !0);
|
|
1163
1163
|
}
|
|
1164
1164
|
function nr(e, t) {
|
|
1165
|
-
if ((e.f &
|
|
1166
|
-
e.f ^=
|
|
1165
|
+
if ((e.f & Q) !== 0) {
|
|
1166
|
+
e.f ^= Q, (e.f & q) === 0 && (K(e, Z), Ne(e));
|
|
1167
1167
|
for (var n = e.first; n !== null; ) {
|
|
1168
|
-
var r = n.next,
|
|
1169
|
-
nr(n,
|
|
1168
|
+
var r = n.next, a = (n.f & tt) !== 0 || (n.f & ye) !== 0;
|
|
1169
|
+
nr(n, a ? t : !1), n = r;
|
|
1170
1170
|
}
|
|
1171
|
-
var
|
|
1172
|
-
if (
|
|
1173
|
-
for (const l of
|
|
1171
|
+
var i = e.nodes && e.nodes.t;
|
|
1172
|
+
if (i !== null)
|
|
1173
|
+
for (const l of i)
|
|
1174
1174
|
(l.is_global || t) && l.in();
|
|
1175
1175
|
}
|
|
1176
1176
|
}
|
|
1177
|
-
function
|
|
1177
|
+
function ki(e, t) {
|
|
1178
1178
|
if (e.nodes)
|
|
1179
1179
|
for (var n = e.nodes.start, r = e.nodes.end; n !== null; ) {
|
|
1180
|
-
var
|
|
1181
|
-
t.append(n), n =
|
|
1180
|
+
var a = n === r ? null : /* @__PURE__ */ ut(n);
|
|
1181
|
+
t.append(n), n = a;
|
|
1182
1182
|
}
|
|
1183
1183
|
}
|
|
1184
|
-
let
|
|
1185
|
-
function
|
|
1186
|
-
|
|
1184
|
+
let Te = !1;
|
|
1185
|
+
function Et(e) {
|
|
1186
|
+
Te = e;
|
|
1187
1187
|
}
|
|
1188
1188
|
let De = !1;
|
|
1189
|
-
function
|
|
1189
|
+
function Pn(e) {
|
|
1190
1190
|
De = e;
|
|
1191
1191
|
}
|
|
1192
|
-
let
|
|
1192
|
+
let S = null, le = !1;
|
|
1193
1193
|
function ue(e) {
|
|
1194
|
-
|
|
1194
|
+
S = e;
|
|
1195
1195
|
}
|
|
1196
|
-
let
|
|
1196
|
+
let x = null;
|
|
1197
1197
|
function ke(e) {
|
|
1198
|
-
|
|
1198
|
+
x = e;
|
|
1199
1199
|
}
|
|
1200
|
-
let
|
|
1201
|
-
function
|
|
1202
|
-
|
|
1200
|
+
let _e = null;
|
|
1201
|
+
function Ci(e) {
|
|
1202
|
+
S !== null && (_e === null ? _e = [e] : _e.push(e));
|
|
1203
1203
|
}
|
|
1204
|
-
let
|
|
1205
|
-
function
|
|
1206
|
-
|
|
1204
|
+
let G = null, J = 0, X = null;
|
|
1205
|
+
function Ri(e) {
|
|
1206
|
+
X = e;
|
|
1207
1207
|
}
|
|
1208
|
-
let rr = 1, st = 0,
|
|
1209
|
-
function
|
|
1210
|
-
|
|
1208
|
+
let rr = 1, st = 0, Ae = st;
|
|
1209
|
+
function Sn(e) {
|
|
1210
|
+
Ae = e;
|
|
1211
1211
|
}
|
|
1212
|
-
function
|
|
1212
|
+
function ir() {
|
|
1213
1213
|
return ++rr;
|
|
1214
1214
|
}
|
|
1215
|
-
function
|
|
1215
|
+
function Be(e) {
|
|
1216
1216
|
var t = e.f;
|
|
1217
1217
|
if ((t & Z) !== 0)
|
|
1218
1218
|
return !0;
|
|
1219
|
-
if (t & V && (e.f &= ~
|
|
1219
|
+
if (t & V && (e.f &= ~Oe), (t & re) !== 0) {
|
|
1220
1220
|
var n = e.deps;
|
|
1221
1221
|
if (n !== null)
|
|
1222
|
-
for (var r = n.length,
|
|
1223
|
-
var
|
|
1224
|
-
if (
|
|
1222
|
+
for (var r = n.length, a = 0; a < r; a++) {
|
|
1223
|
+
var i = n[a];
|
|
1224
|
+
if (Be(
|
|
1225
1225
|
/** @type {Derived} */
|
|
1226
|
-
|
|
1227
|
-
) &&
|
|
1226
|
+
i
|
|
1227
|
+
) && Yn(
|
|
1228
1228
|
/** @type {Derived} */
|
|
1229
|
-
|
|
1230
|
-
),
|
|
1229
|
+
i
|
|
1230
|
+
), i.wv > e.wv)
|
|
1231
1231
|
return !0;
|
|
1232
1232
|
}
|
|
1233
1233
|
(t & ne) !== 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
|
-
te === null &&
|
|
1235
|
+
te === null && K(e, q);
|
|
1236
1236
|
}
|
|
1237
1237
|
return !1;
|
|
1238
1238
|
}
|
|
1239
|
-
function
|
|
1239
|
+
function ar(e, t, n = !0) {
|
|
1240
1240
|
var r = e.reactions;
|
|
1241
|
-
if (r !== null && !
|
|
1242
|
-
for (var
|
|
1243
|
-
var
|
|
1244
|
-
(
|
|
1241
|
+
if (r !== null && !_e?.includes(e))
|
|
1242
|
+
for (var a = 0; a < r.length; a++) {
|
|
1243
|
+
var i = r[a];
|
|
1244
|
+
(i.f & V) !== 0 ? ar(
|
|
1245
1245
|
/** @type {Derived} */
|
|
1246
|
-
|
|
1246
|
+
i,
|
|
1247
1247
|
t,
|
|
1248
1248
|
!1
|
|
1249
|
-
) : t ===
|
|
1249
|
+
) : t === i && (n ? K(i, Z) : (i.f & q) !== 0 && K(i, re), Ne(
|
|
1250
1250
|
/** @type {Effect} */
|
|
1251
|
-
|
|
1251
|
+
i
|
|
1252
1252
|
));
|
|
1253
1253
|
}
|
|
1254
1254
|
}
|
|
1255
1255
|
function sr(e) {
|
|
1256
|
-
var t =
|
|
1257
|
-
|
|
1258
|
-
null, J = 0,
|
|
1259
|
-
e.ac.abort(
|
|
1256
|
+
var t = G, n = J, r = X, a = S, i = _e, l = H, s = le, u = Ae, o = e.f;
|
|
1257
|
+
G = /** @type {null | Value[]} */
|
|
1258
|
+
null, J = 0, X = null, S = (o & (ye | Ye)) === 0 ? e : null, _e = null, mt(e.ctx), le = !1, Ae = ++st, e.ac !== null && (At(() => {
|
|
1259
|
+
e.ac.abort(ze);
|
|
1260
1260
|
}), e.ac = null);
|
|
1261
1261
|
try {
|
|
1262
|
-
e.f |=
|
|
1263
|
-
var
|
|
1262
|
+
e.f |= Gt;
|
|
1263
|
+
var c = (
|
|
1264
1264
|
/** @type {Function} */
|
|
1265
1265
|
e.fn
|
|
1266
|
-
),
|
|
1267
|
-
if (
|
|
1268
|
-
var
|
|
1266
|
+
), d = c(), p = e.deps;
|
|
1267
|
+
if (G !== null) {
|
|
1268
|
+
var h;
|
|
1269
1269
|
if (Pt(e, J), p !== null && J > 0)
|
|
1270
|
-
for (p.length = J +
|
|
1271
|
-
p[J +
|
|
1270
|
+
for (p.length = J + G.length, h = 0; h < G.length; h++)
|
|
1271
|
+
p[J + h] = G[h];
|
|
1272
1272
|
else
|
|
1273
|
-
e.deps = p =
|
|
1274
|
-
if (
|
|
1275
|
-
for (
|
|
1276
|
-
(p[
|
|
1273
|
+
e.deps = p = G;
|
|
1274
|
+
if (wt() && (e.f & ne) !== 0)
|
|
1275
|
+
for (h = J; h < p.length; h++)
|
|
1276
|
+
(p[h].reactions ??= []).push(e);
|
|
1277
1277
|
} else p !== null && J < p.length && (Pt(e, J), p.length = J);
|
|
1278
|
-
if (lt() &&
|
|
1279
|
-
for (
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1278
|
+
if (lt() && X !== null && !le && p !== null && (e.f & (V | re | Z)) === 0)
|
|
1279
|
+
for (h = 0; h < /** @type {Source[]} */
|
|
1280
|
+
X.length; h++)
|
|
1281
|
+
ar(
|
|
1282
|
+
X[h],
|
|
1283
1283
|
/** @type {Effect} */
|
|
1284
1284
|
e
|
|
1285
1285
|
);
|
|
1286
|
-
return
|
|
1287
|
-
|
|
1288
|
-
} catch (
|
|
1289
|
-
return
|
|
1286
|
+
return a !== null && a !== e && (st++, X !== null && (r === null ? r = X : r.push(.../** @type {Source[]} */
|
|
1287
|
+
X))), (e.f & Pe) !== 0 && (e.f ^= Pe), d;
|
|
1288
|
+
} catch (v) {
|
|
1289
|
+
return oi(v);
|
|
1290
1290
|
} finally {
|
|
1291
|
-
e.f ^=
|
|
1291
|
+
e.f ^= Gt, G = t, J = n, X = r, S = a, _e = i, mt(l), le = s, Ae = u;
|
|
1292
1292
|
}
|
|
1293
1293
|
}
|
|
1294
|
-
function
|
|
1294
|
+
function xi(e, t) {
|
|
1295
1295
|
let n = t.reactions;
|
|
1296
1296
|
if (n !== null) {
|
|
1297
|
-
var r =
|
|
1297
|
+
var r = Kr.call(n, e);
|
|
1298
1298
|
if (r !== -1) {
|
|
1299
|
-
var
|
|
1300
|
-
|
|
1299
|
+
var a = n.length - 1;
|
|
1300
|
+
a === 0 ? n = t.reactions = null : (n[r] = n[a], n.pop());
|
|
1301
1301
|
}
|
|
1302
1302
|
}
|
|
1303
1303
|
n === null && (t.f & V) !== 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
|
-
(
|
|
1306
|
+
(G === null || !G.includes(t)) && (K(t, re), (t.f & ne) !== 0 && (t.f ^= ne, t.f &= ~Oe), Vn(
|
|
1307
1307
|
/** @type {Derived} **/
|
|
1308
1308
|
t
|
|
1309
1309
|
), Pt(
|
|
@@ -1316,58 +1316,58 @@ function Pt(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
|
+
xi(e, n[r]);
|
|
1320
1320
|
}
|
|
1321
1321
|
function Ve(e) {
|
|
1322
1322
|
var t = e.f;
|
|
1323
1323
|
if ((t & pe) === 0) {
|
|
1324
|
-
|
|
1325
|
-
var n =
|
|
1326
|
-
|
|
1324
|
+
K(e, q);
|
|
1325
|
+
var n = x, r = Te;
|
|
1326
|
+
x = e, Te = !0;
|
|
1327
1327
|
try {
|
|
1328
|
-
(t & (me |
|
|
1329
|
-
var
|
|
1330
|
-
e.teardown = typeof
|
|
1331
|
-
var
|
|
1332
|
-
|
|
1328
|
+
(t & (me | Gr)) !== 0 ? Si(e) : $n(e), Xn(e);
|
|
1329
|
+
var a = sr(e);
|
|
1330
|
+
e.teardown = typeof a == "function" ? a : null, e.wv = rr;
|
|
1331
|
+
var i;
|
|
1332
|
+
Yt && Tr && (e.f & Z) !== 0 && e.deps;
|
|
1333
1333
|
} finally {
|
|
1334
|
-
|
|
1334
|
+
Te = r, x = n;
|
|
1335
1335
|
}
|
|
1336
1336
|
}
|
|
1337
1337
|
}
|
|
1338
|
-
async function
|
|
1339
|
-
await Promise.resolve(),
|
|
1338
|
+
async function Mi() {
|
|
1339
|
+
await Promise.resolve(), li();
|
|
1340
1340
|
}
|
|
1341
1341
|
function f(e) {
|
|
1342
1342
|
var t = e.f, n = (t & V) !== 0;
|
|
1343
|
-
if (
|
|
1344
|
-
var r =
|
|
1345
|
-
if (!r && !
|
|
1346
|
-
var
|
|
1347
|
-
if ((
|
|
1348
|
-
e.rv < st && (e.rv = st,
|
|
1343
|
+
if (S !== null && !le) {
|
|
1344
|
+
var r = x !== null && (x.f & pe) !== 0;
|
|
1345
|
+
if (!r && !_e?.includes(e)) {
|
|
1346
|
+
var a = S.deps;
|
|
1347
|
+
if ((S.f & Gt) !== 0)
|
|
1348
|
+
e.rv < st && (e.rv = st, G === null && a !== null && a[J] === e ? J++ : G === null ? G = [e] : G.includes(e) || G.push(e));
|
|
1349
1349
|
else {
|
|
1350
|
-
(
|
|
1351
|
-
var
|
|
1352
|
-
|
|
1350
|
+
(S.deps ??= []).push(e);
|
|
1351
|
+
var i = e.reactions;
|
|
1352
|
+
i === null ? e.reactions = [S] : i.includes(S) || i.push(S);
|
|
1353
1353
|
}
|
|
1354
1354
|
}
|
|
1355
1355
|
}
|
|
1356
1356
|
if (De) {
|
|
1357
|
-
if (
|
|
1358
|
-
return
|
|
1357
|
+
if (Se.has(e))
|
|
1358
|
+
return Se.get(e);
|
|
1359
1359
|
if (n) {
|
|
1360
1360
|
var l = (
|
|
1361
1361
|
/** @type {Derived} */
|
|
1362
1362
|
e
|
|
1363
|
-
),
|
|
1364
|
-
return ((l.f & q) === 0 && l.reactions !== null || lr(l)) && (
|
|
1363
|
+
), s = l.v;
|
|
1364
|
+
return ((l.f & q) === 0 && l.reactions !== null || lr(l)) && (s = ln(l)), Se.set(l, s), s;
|
|
1365
1365
|
}
|
|
1366
|
-
} else n && (!te?.has(e) ||
|
|
1367
|
-
e,
|
|
1366
|
+
} else n && (!te?.has(e) || C?.is_fork && !wt()) && (l = /** @type {Derived} */
|
|
1367
|
+
e, Be(l) && Yn(l), Te && wt() && (l.f & ne) === 0 && or(l));
|
|
1368
1368
|
if (te?.has(e))
|
|
1369
1369
|
return te.get(e);
|
|
1370
|
-
if ((e.f &
|
|
1370
|
+
if ((e.f & Pe) !== 0)
|
|
1371
1371
|
throw e.v;
|
|
1372
1372
|
return e.v;
|
|
1373
1373
|
}
|
|
@@ -1382,17 +1382,17 @@ function or(e) {
|
|
|
1382
1382
|
}
|
|
1383
1383
|
}
|
|
1384
1384
|
function lr(e) {
|
|
1385
|
-
if (e.v ===
|
|
1385
|
+
if (e.v === Y) return !0;
|
|
1386
1386
|
if (e.deps === null) return !1;
|
|
1387
1387
|
for (const t of e.deps)
|
|
1388
|
-
if (
|
|
1388
|
+
if (Se.has(t) || (t.f & V) !== 0 && lr(
|
|
1389
1389
|
/** @type {Derived} */
|
|
1390
1390
|
t
|
|
1391
1391
|
))
|
|
1392
1392
|
return !0;
|
|
1393
1393
|
return !1;
|
|
1394
1394
|
}
|
|
1395
|
-
function
|
|
1395
|
+
function P(e) {
|
|
1396
1396
|
var t = le;
|
|
1397
1397
|
try {
|
|
1398
1398
|
return le = !0, e();
|
|
@@ -1400,180 +1400,180 @@ function S(e) {
|
|
|
1400
1400
|
le = t;
|
|
1401
1401
|
}
|
|
1402
1402
|
}
|
|
1403
|
-
const
|
|
1404
|
-
function
|
|
1405
|
-
e.f = e.f &
|
|
1403
|
+
const Ti = -7169;
|
|
1404
|
+
function K(e, t) {
|
|
1405
|
+
e.f = e.f & Ti | t;
|
|
1406
1406
|
}
|
|
1407
|
-
function
|
|
1407
|
+
function B(e) {
|
|
1408
1408
|
if (!(typeof e != "object" || !e || e instanceof EventTarget)) {
|
|
1409
|
-
if (
|
|
1410
|
-
|
|
1409
|
+
if (Ke in e)
|
|
1410
|
+
Qt(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 &&
|
|
1414
|
+
typeof n == "object" && n && Ke in n && Qt(n);
|
|
1415
1415
|
}
|
|
1416
1416
|
}
|
|
1417
1417
|
}
|
|
1418
|
-
function
|
|
1418
|
+
function Qt(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
|
-
|
|
1424
|
+
Qt(e[r], t);
|
|
1425
1425
|
} catch {
|
|
1426
1426
|
}
|
|
1427
|
-
const n =
|
|
1427
|
+
const n = An(e);
|
|
1428
1428
|
if (n !== Object.prototype && n !== Array.prototype && n !== Map.prototype && n !== Set.prototype && n !== Date.prototype) {
|
|
1429
1429
|
const r = Vr(n);
|
|
1430
|
-
for (let
|
|
1431
|
-
const
|
|
1432
|
-
if (
|
|
1430
|
+
for (let a in r) {
|
|
1431
|
+
const i = r[a].get;
|
|
1432
|
+
if (i)
|
|
1433
1433
|
try {
|
|
1434
|
-
|
|
1434
|
+
i.call(e);
|
|
1435
1435
|
} catch {
|
|
1436
1436
|
}
|
|
1437
1437
|
}
|
|
1438
1438
|
}
|
|
1439
1439
|
}
|
|
1440
1440
|
}
|
|
1441
|
-
function
|
|
1442
|
-
function
|
|
1443
|
-
if (r.capture ||
|
|
1444
|
-
return
|
|
1441
|
+
function Ai(e, t, n, r = {}) {
|
|
1442
|
+
function a(i) {
|
|
1443
|
+
if (r.capture || Oi.call(t, i), !i.cancelBubble)
|
|
1444
|
+
return At(() => n?.call(this, i));
|
|
1445
1445
|
}
|
|
1446
|
-
return e.startsWith("pointer") || e.startsWith("touch") || e === "wheel" ?
|
|
1447
|
-
t.addEventListener(e,
|
|
1448
|
-
}) : t.addEventListener(e,
|
|
1446
|
+
return e.startsWith("pointer") || e.startsWith("touch") || e === "wheel" ? zn(() => {
|
|
1447
|
+
t.addEventListener(e, a, r);
|
|
1448
|
+
}) : t.addEventListener(e, a, r), a;
|
|
1449
1449
|
}
|
|
1450
|
-
function se(e, t, n, r,
|
|
1451
|
-
var
|
|
1450
|
+
function se(e, t, n, r, a) {
|
|
1451
|
+
var i = { capture: r, passive: a }, l = Ai(e, t, n, i);
|
|
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
1455
|
t instanceof HTMLMediaElement) && un(() => {
|
|
1456
|
-
t.removeEventListener(e, l,
|
|
1456
|
+
t.removeEventListener(e, l, i);
|
|
1457
1457
|
});
|
|
1458
1458
|
}
|
|
1459
1459
|
let In = null;
|
|
1460
|
-
function
|
|
1460
|
+
function Oi(e) {
|
|
1461
1461
|
var t = this, n = (
|
|
1462
1462
|
/** @type {Node} */
|
|
1463
1463
|
t.ownerDocument
|
|
1464
|
-
), r = e.type,
|
|
1464
|
+
), r = e.type, a = e.composedPath?.() || [], i = (
|
|
1465
1465
|
/** @type {null | Element} */
|
|
1466
|
-
|
|
1466
|
+
a[0] || e.target
|
|
1467
1467
|
);
|
|
1468
1468
|
In = e;
|
|
1469
|
-
var l = 0,
|
|
1470
|
-
if (
|
|
1471
|
-
var u =
|
|
1469
|
+
var l = 0, s = In === e && e.__root;
|
|
1470
|
+
if (s) {
|
|
1471
|
+
var u = a.indexOf(s);
|
|
1472
1472
|
if (u !== -1 && (t === document || t === /** @type {any} */
|
|
1473
1473
|
window)) {
|
|
1474
1474
|
e.__root = t;
|
|
1475
1475
|
return;
|
|
1476
1476
|
}
|
|
1477
|
-
var o =
|
|
1477
|
+
var o = a.indexOf(t);
|
|
1478
1478
|
if (o === -1)
|
|
1479
1479
|
return;
|
|
1480
1480
|
u <= o && (l = u);
|
|
1481
1481
|
}
|
|
1482
|
-
if (
|
|
1483
|
-
|
|
1484
|
-
|
|
1482
|
+
if (i = /** @type {Element} */
|
|
1483
|
+
a[l] || e.target, i !== t) {
|
|
1484
|
+
Tn(e, "currentTarget", {
|
|
1485
1485
|
configurable: !0,
|
|
1486
1486
|
get() {
|
|
1487
|
-
return
|
|
1487
|
+
return i || n;
|
|
1488
1488
|
}
|
|
1489
1489
|
});
|
|
1490
|
-
var
|
|
1490
|
+
var c = S, d = x;
|
|
1491
1491
|
ue(null), ke(null);
|
|
1492
1492
|
try {
|
|
1493
|
-
for (var p,
|
|
1494
|
-
var
|
|
1495
|
-
|
|
1493
|
+
for (var p, h = []; i !== null; ) {
|
|
1494
|
+
var v = i.assignedSlot || i.parentNode || /** @type {any} */
|
|
1495
|
+
i.host || null;
|
|
1496
1496
|
try {
|
|
1497
|
-
var
|
|
1498
|
-
|
|
1499
|
-
|
|
1497
|
+
var w = i["__" + r];
|
|
1498
|
+
w != null && (!/** @type {any} */
|
|
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 ===
|
|
1502
|
-
} catch (
|
|
1503
|
-
p ?
|
|
1501
|
+
e.target === i) && w.call(i, e);
|
|
1502
|
+
} catch (g) {
|
|
1503
|
+
p ? h.push(g) : p = g;
|
|
1504
1504
|
}
|
|
1505
|
-
if (e.cancelBubble ||
|
|
1505
|
+
if (e.cancelBubble || v === t || v === null)
|
|
1506
1506
|
break;
|
|
1507
|
-
|
|
1507
|
+
i = v;
|
|
1508
1508
|
}
|
|
1509
1509
|
if (p) {
|
|
1510
|
-
for (let
|
|
1510
|
+
for (let g of h)
|
|
1511
1511
|
queueMicrotask(() => {
|
|
1512
|
-
throw
|
|
1512
|
+
throw g;
|
|
1513
1513
|
});
|
|
1514
1514
|
throw p;
|
|
1515
1515
|
}
|
|
1516
1516
|
} finally {
|
|
1517
|
-
e.__root = t, delete e.currentTarget, ue(
|
|
1517
|
+
e.__root = t, delete e.currentTarget, ue(c), ke(d);
|
|
1518
1518
|
}
|
|
1519
1519
|
}
|
|
1520
1520
|
}
|
|
1521
|
-
function
|
|
1521
|
+
function Ni(e) {
|
|
1522
1522
|
var t = document.createElement("template");
|
|
1523
1523
|
return t.innerHTML = e.replaceAll("<!>", "<!---->"), t.content;
|
|
1524
1524
|
}
|
|
1525
|
-
function
|
|
1525
|
+
function St(e, t) {
|
|
1526
1526
|
var n = (
|
|
1527
1527
|
/** @type {Effect} */
|
|
1528
|
-
|
|
1528
|
+
x
|
|
1529
1529
|
);
|
|
1530
1530
|
n.nodes === null && (n.nodes = { start: e, end: t, a: null, t: null });
|
|
1531
1531
|
}
|
|
1532
1532
|
// @__NO_SIDE_EFFECTS__
|
|
1533
|
-
function
|
|
1534
|
-
var n = (t &
|
|
1533
|
+
function O(e, t) {
|
|
1534
|
+
var n = (t & Hr) !== 0, r = (t & qr) !== 0, a, i = !e.startsWith("<!>");
|
|
1535
1535
|
return () => {
|
|
1536
|
-
|
|
1537
|
-
/* @__PURE__ */ gt(
|
|
1536
|
+
a === void 0 && (a = Ni(i ? e : "<!>" + e), n || (a = /** @type {TemplateNode} */
|
|
1537
|
+
/* @__PURE__ */ gt(a)));
|
|
1538
1538
|
var l = (
|
|
1539
1539
|
/** @type {TemplateNode} */
|
|
1540
|
-
r ||
|
|
1540
|
+
r || hi ? document.importNode(a, !0) : a.cloneNode(!0)
|
|
1541
1541
|
);
|
|
1542
1542
|
if (n) {
|
|
1543
|
-
var
|
|
1543
|
+
var s = (
|
|
1544
1544
|
/** @type {TemplateNode} */
|
|
1545
1545
|
/* @__PURE__ */ gt(l)
|
|
1546
1546
|
), u = (
|
|
1547
1547
|
/** @type {TemplateNode} */
|
|
1548
1548
|
l.lastChild
|
|
1549
1549
|
);
|
|
1550
|
-
|
|
1550
|
+
St(s, u);
|
|
1551
1551
|
} else
|
|
1552
|
-
|
|
1552
|
+
St(l, l);
|
|
1553
1553
|
return l;
|
|
1554
1554
|
};
|
|
1555
1555
|
}
|
|
1556
|
-
function
|
|
1556
|
+
function Di(e = "") {
|
|
1557
1557
|
{
|
|
1558
1558
|
var t = Me(e + "");
|
|
1559
|
-
return
|
|
1559
|
+
return St(t, t), t;
|
|
1560
1560
|
}
|
|
1561
1561
|
}
|
|
1562
|
-
function
|
|
1562
|
+
function vt() {
|
|
1563
1563
|
var e = document.createDocumentFragment(), t = document.createComment(""), n = Me();
|
|
1564
|
-
return e.append(t, n),
|
|
1564
|
+
return e.append(t, n), St(t, n), e;
|
|
1565
1565
|
}
|
|
1566
|
-
function
|
|
1566
|
+
function T(e, t) {
|
|
1567
1567
|
e !== null && e.before(
|
|
1568
1568
|
/** @type {Node} */
|
|
1569
1569
|
t
|
|
1570
1570
|
);
|
|
1571
1571
|
}
|
|
1572
|
-
function
|
|
1572
|
+
function xe(e, t) {
|
|
1573
1573
|
var n = t == null ? "" : typeof t == "object" ? t + "" : t;
|
|
1574
1574
|
n !== (e.__t ??= e.nodeValue) && (e.__t = n, e.nodeValue = n + "");
|
|
1575
1575
|
}
|
|
1576
|
-
class
|
|
1576
|
+
class Fi {
|
|
1577
1577
|
/** @type {TemplateNode} */
|
|
1578
1578
|
anchor;
|
|
1579
1579
|
/** @type {Map<Batch, Key>} */
|
|
@@ -1608,18 +1608,18 @@ class Fa {
|
|
|
1608
1608
|
* Whether to pause (i.e. outro) on change, or destroy immediately.
|
|
1609
1609
|
* This is necessary for `<svelte:element>`
|
|
1610
1610
|
*/
|
|
1611
|
-
#
|
|
1611
|
+
#a = !0;
|
|
1612
1612
|
/**
|
|
1613
1613
|
* @param {TemplateNode} anchor
|
|
1614
1614
|
* @param {boolean} transition
|
|
1615
1615
|
*/
|
|
1616
1616
|
constructor(t, n = !0) {
|
|
1617
|
-
this.anchor = t, this.#
|
|
1617
|
+
this.anchor = t, this.#a = n;
|
|
1618
1618
|
}
|
|
1619
|
-
#
|
|
1619
|
+
#i = () => {
|
|
1620
1620
|
var t = (
|
|
1621
1621
|
/** @type {Batch} */
|
|
1622
|
-
|
|
1622
|
+
C
|
|
1623
1623
|
);
|
|
1624
1624
|
if (this.#t.has(t)) {
|
|
1625
1625
|
var n = (
|
|
@@ -1629,26 +1629,26 @@ class Fa {
|
|
|
1629
1629
|
if (r)
|
|
1630
1630
|
vn(r), this.#r.delete(n);
|
|
1631
1631
|
else {
|
|
1632
|
-
var
|
|
1633
|
-
|
|
1632
|
+
var a = this.#e.get(n);
|
|
1633
|
+
a && (this.#n.set(n, a.effect), this.#e.delete(n), a.fragment.lastChild.remove(), this.anchor.before(a.fragment), r = a.effect);
|
|
1634
1634
|
}
|
|
1635
|
-
for (const [
|
|
1636
|
-
if (this.#t.delete(
|
|
1635
|
+
for (const [i, l] of this.#t) {
|
|
1636
|
+
if (this.#t.delete(i), i === t)
|
|
1637
1637
|
break;
|
|
1638
|
-
const
|
|
1639
|
-
|
|
1638
|
+
const s = this.#e.get(l);
|
|
1639
|
+
s && (he(s.effect), this.#e.delete(l));
|
|
1640
1640
|
}
|
|
1641
|
-
for (const [
|
|
1642
|
-
if (
|
|
1643
|
-
const
|
|
1644
|
-
if (Array.from(this.#t.values()).includes(
|
|
1641
|
+
for (const [i, l] of this.#n) {
|
|
1642
|
+
if (i === n || this.#r.has(i)) continue;
|
|
1643
|
+
const s = () => {
|
|
1644
|
+
if (Array.from(this.#t.values()).includes(i)) {
|
|
1645
1645
|
var o = document.createDocumentFragment();
|
|
1646
|
-
|
|
1646
|
+
ki(l, o), o.append(Me()), this.#e.set(i, { effect: l, fragment: o });
|
|
1647
1647
|
} else
|
|
1648
|
-
|
|
1649
|
-
this.#r.delete(
|
|
1648
|
+
he(l);
|
|
1649
|
+
this.#r.delete(i), this.#n.delete(i);
|
|
1650
1650
|
};
|
|
1651
|
-
this.#
|
|
1651
|
+
this.#a || !r ? (this.#r.add(i), dn(l, s, !1)) : s();
|
|
1652
1652
|
}
|
|
1653
1653
|
}
|
|
1654
1654
|
};
|
|
@@ -1658,8 +1658,8 @@ class Fa {
|
|
|
1658
1658
|
#s = (t) => {
|
|
1659
1659
|
this.#t.delete(t);
|
|
1660
1660
|
const n = Array.from(this.#t.values());
|
|
1661
|
-
for (const [r,
|
|
1662
|
-
n.includes(r) || (
|
|
1661
|
+
for (const [r, a] of this.#e)
|
|
1662
|
+
n.includes(r) || (he(a.effect), this.#e.delete(r));
|
|
1663
1663
|
};
|
|
1664
1664
|
/**
|
|
1665
1665
|
*
|
|
@@ -1669,55 +1669,55 @@ class Fa {
|
|
|
1669
1669
|
ensure(t, n) {
|
|
1670
1670
|
var r = (
|
|
1671
1671
|
/** @type {Batch} */
|
|
1672
|
-
|
|
1673
|
-
),
|
|
1672
|
+
C
|
|
1673
|
+
), a = Gn();
|
|
1674
1674
|
if (n && !this.#n.has(t) && !this.#e.has(t))
|
|
1675
|
-
if (
|
|
1676
|
-
var
|
|
1677
|
-
|
|
1678
|
-
effect:
|
|
1679
|
-
fragment:
|
|
1675
|
+
if (a) {
|
|
1676
|
+
var i = document.createDocumentFragment(), l = Me();
|
|
1677
|
+
i.append(l), this.#e.set(t, {
|
|
1678
|
+
effect: at(() => n(l)),
|
|
1679
|
+
fragment: i
|
|
1680
1680
|
});
|
|
1681
1681
|
} else
|
|
1682
1682
|
this.#n.set(
|
|
1683
1683
|
t,
|
|
1684
|
-
|
|
1684
|
+
at(() => n(this.anchor))
|
|
1685
1685
|
);
|
|
1686
|
-
if (this.#t.set(r, t),
|
|
1687
|
-
for (const [
|
|
1688
|
-
|
|
1689
|
-
for (const [
|
|
1690
|
-
|
|
1691
|
-
r.oncommit(this.#
|
|
1686
|
+
if (this.#t.set(r, t), a) {
|
|
1687
|
+
for (const [s, u] of this.#n)
|
|
1688
|
+
s === t ? r.skipped_effects.delete(u) : r.skipped_effects.add(u);
|
|
1689
|
+
for (const [s, u] of this.#e)
|
|
1690
|
+
s === t ? r.skipped_effects.delete(u.effect) : r.skipped_effects.add(u.effect);
|
|
1691
|
+
r.oncommit(this.#i), r.ondiscard(this.#s);
|
|
1692
1692
|
} else
|
|
1693
|
-
this.#
|
|
1693
|
+
this.#i();
|
|
1694
1694
|
}
|
|
1695
1695
|
}
|
|
1696
1696
|
function $(e, t, n = !1) {
|
|
1697
|
-
var r = new
|
|
1698
|
-
function
|
|
1699
|
-
r.ensure(l,
|
|
1697
|
+
var r = new Fi(e), a = n ? tt : 0;
|
|
1698
|
+
function i(l, s) {
|
|
1699
|
+
r.ensure(l, s);
|
|
1700
1700
|
}
|
|
1701
|
-
|
|
1701
|
+
Qn(() => {
|
|
1702
1702
|
var l = !1;
|
|
1703
|
-
t((
|
|
1704
|
-
l = !0,
|
|
1705
|
-
}), l ||
|
|
1706
|
-
},
|
|
1707
|
-
}
|
|
1708
|
-
function
|
|
1709
|
-
for (var r = [],
|
|
1710
|
-
let
|
|
1703
|
+
t((s, u = !0) => {
|
|
1704
|
+
l = !0, i(u, s);
|
|
1705
|
+
}), l || i(!1, null);
|
|
1706
|
+
}, a);
|
|
1707
|
+
}
|
|
1708
|
+
function Li(e, t, n) {
|
|
1709
|
+
for (var r = [], a = t.length, i, l = t.length, s = 0; s < a; s++) {
|
|
1710
|
+
let d = t[s];
|
|
1711
1711
|
dn(
|
|
1712
|
-
|
|
1712
|
+
d,
|
|
1713
1713
|
() => {
|
|
1714
|
-
if (
|
|
1715
|
-
if (
|
|
1714
|
+
if (i) {
|
|
1715
|
+
if (i.pending.delete(d), i.done.add(d), i.pending.size === 0) {
|
|
1716
1716
|
var p = (
|
|
1717
1717
|
/** @type {Set<EachOutroGroup>} */
|
|
1718
1718
|
e.outrogroups
|
|
1719
1719
|
);
|
|
1720
|
-
|
|
1720
|
+
Xt(tn(i.done)), p.delete(i), p.size === 0 && (e.outrogroups = null);
|
|
1721
1721
|
}
|
|
1722
1722
|
} else
|
|
1723
1723
|
l -= 1;
|
|
@@ -1731,26 +1731,26 @@ function La(e, t, n) {
|
|
|
1731
1731
|
var o = (
|
|
1732
1732
|
/** @type {Element} */
|
|
1733
1733
|
n
|
|
1734
|
-
),
|
|
1734
|
+
), c = (
|
|
1735
1735
|
/** @type {Element} */
|
|
1736
1736
|
o.parentNode
|
|
1737
1737
|
);
|
|
1738
|
-
|
|
1738
|
+
yi(c), c.append(o), e.items.clear();
|
|
1739
1739
|
}
|
|
1740
|
-
|
|
1740
|
+
Xt(t, !u);
|
|
1741
1741
|
} else
|
|
1742
|
-
|
|
1742
|
+
i = {
|
|
1743
1743
|
pending: new Set(t),
|
|
1744
1744
|
done: /* @__PURE__ */ new Set()
|
|
1745
|
-
}, (e.outrogroups ??= /* @__PURE__ */ new Set()).add(
|
|
1745
|
+
}, (e.outrogroups ??= /* @__PURE__ */ new Set()).add(i);
|
|
1746
1746
|
}
|
|
1747
|
-
function
|
|
1747
|
+
function Xt(e, t = !0) {
|
|
1748
1748
|
for (var n = 0; n < e.length; n++)
|
|
1749
|
-
|
|
1749
|
+
he(e[n], t);
|
|
1750
1750
|
}
|
|
1751
1751
|
var kn;
|
|
1752
|
-
function ur(e, t, n, r,
|
|
1753
|
-
var l = e,
|
|
1752
|
+
function ur(e, t, n, r, a, i = null) {
|
|
1753
|
+
var l = e, s = /* @__PURE__ */ new Map();
|
|
1754
1754
|
{
|
|
1755
1755
|
var u = (
|
|
1756
1756
|
/** @type {Element} */
|
|
@@ -1758,115 +1758,115 @@ function ur(e, t, n, r, s, a = null) {
|
|
|
1758
1758
|
);
|
|
1759
1759
|
l = u.appendChild(Me());
|
|
1760
1760
|
}
|
|
1761
|
-
var o = null,
|
|
1762
|
-
var
|
|
1763
|
-
return Mn(
|
|
1764
|
-
}),
|
|
1765
|
-
function
|
|
1766
|
-
|
|
1761
|
+
var o = null, c = /* @__PURE__ */ Tt(() => {
|
|
1762
|
+
var g = n();
|
|
1763
|
+
return Mn(g) ? g : g == null ? [] : tn(g);
|
|
1764
|
+
}), d, p = !0;
|
|
1765
|
+
function h() {
|
|
1766
|
+
w.fallback = o, Ui(w, d, l, t, r), o !== null && (d.length === 0 ? (o.f & Ee) === 0 ? vn(o) : (o.f ^= Ee, $e(o, null, l)) : dn(o, () => {
|
|
1767
1767
|
o = null;
|
|
1768
1768
|
}));
|
|
1769
1769
|
}
|
|
1770
|
-
var
|
|
1771
|
-
|
|
1772
|
-
f(
|
|
1773
|
-
for (var
|
|
1770
|
+
var v = Qn(() => {
|
|
1771
|
+
d = /** @type {V[]} */
|
|
1772
|
+
f(c);
|
|
1773
|
+
for (var g = d.length, E = /* @__PURE__ */ new Set(), R = (
|
|
1774
1774
|
/** @type {Batch} */
|
|
1775
|
-
|
|
1776
|
-
), I =
|
|
1777
|
-
var m =
|
|
1778
|
-
M ? (M.v &&
|
|
1779
|
-
|
|
1775
|
+
C
|
|
1776
|
+
), I = Gn(), y = 0; y < g; y += 1) {
|
|
1777
|
+
var m = d[y], k = r(m, y), M = p ? null : s.get(k);
|
|
1778
|
+
M ? (M.v && it(M.v, m), M.i && it(M.i, y), I && R.skipped_effects.delete(M.e)) : (M = ji(
|
|
1779
|
+
s,
|
|
1780
1780
|
p ? l : kn ??= Me(),
|
|
1781
1781
|
m,
|
|
1782
1782
|
k,
|
|
1783
1783
|
y,
|
|
1784
|
-
|
|
1784
|
+
a,
|
|
1785
1785
|
t,
|
|
1786
1786
|
n
|
|
1787
|
-
), p || (M.e.f |= Ee),
|
|
1787
|
+
), p || (M.e.f |= Ee), s.set(k, M)), E.add(k);
|
|
1788
1788
|
}
|
|
1789
|
-
if (
|
|
1789
|
+
if (g === 0 && i && !o && (p ? o = at(() => i(l)) : (o = at(() => i(kn ??= Me())), o.f |= Ee)), !p)
|
|
1790
1790
|
if (I) {
|
|
1791
|
-
for (const [
|
|
1792
|
-
E.has(
|
|
1793
|
-
|
|
1791
|
+
for (const [U, ce] of s)
|
|
1792
|
+
E.has(U) || R.skipped_effects.add(ce.e);
|
|
1793
|
+
R.oncommit(h), R.ondiscard(() => {
|
|
1794
1794
|
});
|
|
1795
1795
|
} else
|
|
1796
|
-
|
|
1797
|
-
f(
|
|
1798
|
-
}),
|
|
1796
|
+
h();
|
|
1797
|
+
f(c);
|
|
1798
|
+
}), w = { effect: v, items: s, outrogroups: null, fallback: o };
|
|
1799
1799
|
p = !1;
|
|
1800
1800
|
}
|
|
1801
|
-
function
|
|
1802
|
-
var
|
|
1803
|
-
for (
|
|
1804
|
-
if (p = t[
|
|
1805
|
-
l.get(
|
|
1806
|
-
for (const
|
|
1807
|
-
|
|
1808
|
-
if ((
|
|
1809
|
-
if (
|
|
1810
|
-
$e(
|
|
1801
|
+
function Ui(e, t, n, r, a) {
|
|
1802
|
+
var i = t.length, l = e.items, s = e.effect.first, u, o = null, c = [], d = [], p, h, v, w;
|
|
1803
|
+
for (w = 0; w < i; w += 1) {
|
|
1804
|
+
if (p = t[w], h = a(p, w), v = /** @type {EachItem} */
|
|
1805
|
+
l.get(h).e, e.outrogroups !== null)
|
|
1806
|
+
for (const U of e.outrogroups)
|
|
1807
|
+
U.pending.delete(v), U.done.delete(v);
|
|
1808
|
+
if ((v.f & Ee) !== 0)
|
|
1809
|
+
if (v.f ^= Ee, v === s)
|
|
1810
|
+
$e(v, null, n);
|
|
1811
1811
|
else {
|
|
1812
|
-
var
|
|
1813
|
-
|
|
1812
|
+
var g = o ? o.next : s;
|
|
1813
|
+
v === e.effect.last && (e.effect.last = v.prev), v.prev && (v.prev.next = v.next), v.next && (v.next.prev = v.prev), ge(e, o, v), ge(e, v, g), $e(v, g, n), o = v, c = [], d = [], s = o.next;
|
|
1814
1814
|
continue;
|
|
1815
1815
|
}
|
|
1816
|
-
if ((
|
|
1817
|
-
if (u !== void 0 && u.has(
|
|
1818
|
-
if (
|
|
1819
|
-
var E =
|
|
1816
|
+
if ((v.f & Q) !== 0 && vn(v), v !== s) {
|
|
1817
|
+
if (u !== void 0 && u.has(v)) {
|
|
1818
|
+
if (c.length < d.length) {
|
|
1819
|
+
var E = d[0], R;
|
|
1820
1820
|
o = E.prev;
|
|
1821
|
-
var I =
|
|
1822
|
-
for (
|
|
1823
|
-
$e(
|
|
1824
|
-
for (
|
|
1825
|
-
u.delete(
|
|
1826
|
-
|
|
1821
|
+
var I = c[0], y = c[c.length - 1];
|
|
1822
|
+
for (R = 0; R < c.length; R += 1)
|
|
1823
|
+
$e(c[R], E, n);
|
|
1824
|
+
for (R = 0; R < d.length; R += 1)
|
|
1825
|
+
u.delete(d[R]);
|
|
1826
|
+
ge(e, I.prev, y.next), ge(e, o, I), ge(e, y, E), s = E, o = y, w -= 1, c = [], d = [];
|
|
1827
1827
|
} else
|
|
1828
|
-
u.delete(
|
|
1828
|
+
u.delete(v), $e(v, s, n), ge(e, v.prev, v.next), ge(e, v, o === null ? e.effect.first : o.next), ge(e, o, v), o = v;
|
|
1829
1829
|
continue;
|
|
1830
1830
|
}
|
|
1831
|
-
for (
|
|
1832
|
-
(u ??= /* @__PURE__ */ new Set()).add(
|
|
1833
|
-
if (
|
|
1831
|
+
for (c = [], d = []; s !== null && s !== v; )
|
|
1832
|
+
(u ??= /* @__PURE__ */ new Set()).add(s), d.push(s), s = s.next;
|
|
1833
|
+
if (s === null)
|
|
1834
1834
|
continue;
|
|
1835
1835
|
}
|
|
1836
|
-
(
|
|
1836
|
+
(v.f & Ee) === 0 && c.push(v), o = v, s = v.next;
|
|
1837
1837
|
}
|
|
1838
1838
|
if (e.outrogroups !== null) {
|
|
1839
|
-
for (const
|
|
1840
|
-
|
|
1839
|
+
for (const U of e.outrogroups)
|
|
1840
|
+
U.pending.size === 0 && (Xt(tn(U.done)), e.outrogroups?.delete(U));
|
|
1841
1841
|
e.outrogroups.size === 0 && (e.outrogroups = null);
|
|
1842
1842
|
}
|
|
1843
|
-
if (
|
|
1843
|
+
if (s !== null || u !== void 0) {
|
|
1844
1844
|
var m = [];
|
|
1845
1845
|
if (u !== void 0)
|
|
1846
|
-
for (
|
|
1847
|
-
(
|
|
1848
|
-
for (;
|
|
1849
|
-
(
|
|
1846
|
+
for (v of u)
|
|
1847
|
+
(v.f & Q) === 0 && m.push(v);
|
|
1848
|
+
for (; s !== null; )
|
|
1849
|
+
(s.f & Q) === 0 && s !== e.fallback && m.push(s), s = s.next;
|
|
1850
1850
|
var k = m.length;
|
|
1851
1851
|
if (k > 0) {
|
|
1852
|
-
var M =
|
|
1853
|
-
|
|
1852
|
+
var M = i === 0 ? n : null;
|
|
1853
|
+
Li(e, m, M);
|
|
1854
1854
|
}
|
|
1855
1855
|
}
|
|
1856
1856
|
}
|
|
1857
|
-
function
|
|
1858
|
-
var u = (l &
|
|
1857
|
+
function ji(e, t, n, r, a, i, l, s) {
|
|
1858
|
+
var u = (l & Or) !== 0 ? (l & Dr) === 0 ? /* @__PURE__ */ Ie(n, !1, !1) : rt(n) : null, o = (l & Nr) !== 0 ? rt(a) : null;
|
|
1859
1859
|
return {
|
|
1860
1860
|
v: u,
|
|
1861
1861
|
i: o,
|
|
1862
|
-
e:
|
|
1862
|
+
e: at(() => (i(t, u ?? n, o ?? a, s), () => {
|
|
1863
1863
|
e.delete(r);
|
|
1864
1864
|
}))
|
|
1865
1865
|
};
|
|
1866
1866
|
}
|
|
1867
1867
|
function $e(e, t, n) {
|
|
1868
1868
|
if (e.nodes)
|
|
1869
|
-
for (var r = e.nodes.start,
|
|
1869
|
+
for (var r = e.nodes.start, a = e.nodes.end, i = t && (t.f & Ee) === 0 ? (
|
|
1870
1870
|
/** @type {EffectNodes} */
|
|
1871
1871
|
t.nodes.start
|
|
1872
1872
|
) : n; r !== null; ) {
|
|
@@ -1874,93 +1874,93 @@ function $e(e, t, n) {
|
|
|
1874
1874
|
/** @type {TemplateNode} */
|
|
1875
1875
|
/* @__PURE__ */ ut(r)
|
|
1876
1876
|
);
|
|
1877
|
-
if (
|
|
1877
|
+
if (i.before(r), r === a)
|
|
1878
1878
|
return;
|
|
1879
1879
|
r = l;
|
|
1880
1880
|
}
|
|
1881
1881
|
}
|
|
1882
|
-
function
|
|
1882
|
+
function ge(e, t, n) {
|
|
1883
1883
|
t === null ? e.effect.first = n : t.next = n, n === null ? e.effect.last = t : n.prev = t;
|
|
1884
1884
|
}
|
|
1885
|
-
function
|
|
1886
|
-
var
|
|
1887
|
-
|
|
1885
|
+
function Cn(e, t, n, r, a) {
|
|
1886
|
+
var i = t.$$slots?.[n], l = !1;
|
|
1887
|
+
i === !0 && (i = t[n === "default" ? "children" : n], l = !0), i === void 0 ? a !== null && a(e) : i(e, l ? () => r : r);
|
|
1888
1888
|
}
|
|
1889
|
-
function
|
|
1889
|
+
function cr(e) {
|
|
1890
1890
|
var t, n, r = "";
|
|
1891
1891
|
if (typeof e == "string" || typeof e == "number") r += e;
|
|
1892
1892
|
else if (typeof e == "object") if (Array.isArray(e)) {
|
|
1893
|
-
var
|
|
1894
|
-
for (t = 0; t <
|
|
1893
|
+
var a = e.length;
|
|
1894
|
+
for (t = 0; t < a; t++) e[t] && (n = cr(e[t])) && (r && (r += " "), r += n);
|
|
1895
1895
|
} else for (n in e) e[n] && (r && (r += " "), r += n);
|
|
1896
1896
|
return r;
|
|
1897
1897
|
}
|
|
1898
|
-
function
|
|
1899
|
-
for (var e, t, n = 0, r = "",
|
|
1898
|
+
function zi() {
|
|
1899
|
+
for (var e, t, n = 0, r = "", a = arguments.length; n < a; n++) (e = arguments[n]) && (t = cr(e)) && (r && (r += " "), r += t);
|
|
1900
1900
|
return r;
|
|
1901
1901
|
}
|
|
1902
|
-
function
|
|
1903
|
-
return typeof e == "object" ?
|
|
1902
|
+
function It(e) {
|
|
1903
|
+
return typeof e == "object" ? zi(e) : e ?? "";
|
|
1904
1904
|
}
|
|
1905
|
-
function
|
|
1905
|
+
function Hi(e, t, n) {
|
|
1906
1906
|
var r = e == null ? "" : "" + e;
|
|
1907
1907
|
return r === "" ? null : r;
|
|
1908
1908
|
}
|
|
1909
|
-
function
|
|
1909
|
+
function qi(e, t) {
|
|
1910
1910
|
return e == null ? null : String(e);
|
|
1911
1911
|
}
|
|
1912
|
-
function
|
|
1912
|
+
function kt(e, t, n, r, a, i) {
|
|
1913
1913
|
var l = e.__className;
|
|
1914
1914
|
if (l !== n || l === void 0) {
|
|
1915
|
-
var
|
|
1916
|
-
|
|
1915
|
+
var s = Hi(n);
|
|
1916
|
+
s == null ? e.removeAttribute("class") : e.className = s, e.__className = n;
|
|
1917
1917
|
}
|
|
1918
|
-
return
|
|
1918
|
+
return i;
|
|
1919
1919
|
}
|
|
1920
|
-
function
|
|
1921
|
-
var
|
|
1922
|
-
if (
|
|
1923
|
-
var
|
|
1924
|
-
|
|
1920
|
+
function fr(e, t, n, r) {
|
|
1921
|
+
var a = e.__style;
|
|
1922
|
+
if (a !== t) {
|
|
1923
|
+
var i = qi(t);
|
|
1924
|
+
i == null ? e.removeAttribute("style") : e.style.cssText = i, e.__style = t;
|
|
1925
1925
|
}
|
|
1926
1926
|
return r;
|
|
1927
1927
|
}
|
|
1928
|
-
function
|
|
1928
|
+
function Ki(e, t, n = t) {
|
|
1929
1929
|
var r = /* @__PURE__ */ new WeakSet();
|
|
1930
|
-
|
|
1931
|
-
var
|
|
1932
|
-
if (
|
|
1933
|
-
var l = e.selectionStart,
|
|
1934
|
-
if (e.value =
|
|
1930
|
+
gi(e, "input", async (a) => {
|
|
1931
|
+
var i = a ? e.defaultValue : e.value;
|
|
1932
|
+
if (i = Kt(e) ? Vt(i) : i, n(i), C !== null && r.add(C), await Mi(), i !== (i = t())) {
|
|
1933
|
+
var l = e.selectionStart, s = e.selectionEnd, u = e.value.length;
|
|
1934
|
+
if (e.value = i ?? "", s !== null) {
|
|
1935
1935
|
var o = e.value.length;
|
|
1936
|
-
l ===
|
|
1936
|
+
l === s && s === u && o > u ? (e.selectionStart = o, e.selectionEnd = o) : (e.selectionStart = l, e.selectionEnd = Math.min(s, o));
|
|
1937
1937
|
}
|
|
1938
1938
|
}
|
|
1939
1939
|
}), // If we are hydrating and the value has since changed,
|
|
1940
1940
|
// then use the updated value from the input instead.
|
|
1941
1941
|
// If defaultValue is set, then value == defaultValue
|
|
1942
1942
|
// TODO Svelte 6: remove input.value check and set to empty string?
|
|
1943
|
-
|
|
1944
|
-
var
|
|
1943
|
+
P(t) == null && e.value && (n(Kt(e) ? Vt(e.value) : e.value), C !== null && r.add(C)), fn(() => {
|
|
1944
|
+
var a = t();
|
|
1945
1945
|
if (e === document.activeElement) {
|
|
1946
|
-
var
|
|
1946
|
+
var i = (
|
|
1947
1947
|
/** @type {Batch} */
|
|
1948
|
-
|
|
1948
|
+
_t ?? C
|
|
1949
1949
|
);
|
|
1950
|
-
if (r.has(
|
|
1950
|
+
if (r.has(i))
|
|
1951
1951
|
return;
|
|
1952
1952
|
}
|
|
1953
|
-
|
|
1953
|
+
Kt(e) && a === Vt(e.value) || e.type === "date" && !a && !e.value || a !== e.value && (e.value = a ?? "");
|
|
1954
1954
|
});
|
|
1955
1955
|
}
|
|
1956
|
-
function
|
|
1956
|
+
function Kt(e) {
|
|
1957
1957
|
var t = e.type;
|
|
1958
1958
|
return t === "number" || t === "range";
|
|
1959
1959
|
}
|
|
1960
1960
|
function Vt(e) {
|
|
1961
1961
|
return e === "" ? null : +e;
|
|
1962
1962
|
}
|
|
1963
|
-
function
|
|
1963
|
+
function Vi(e) {
|
|
1964
1964
|
return function(...t) {
|
|
1965
1965
|
var n = (
|
|
1966
1966
|
/** @type {Event} */
|
|
@@ -1969,7 +1969,7 @@ function Va(e) {
|
|
|
1969
1969
|
n.target === this && e?.apply(this, t);
|
|
1970
1970
|
};
|
|
1971
1971
|
}
|
|
1972
|
-
function
|
|
1972
|
+
function Yi(e) {
|
|
1973
1973
|
return function(...t) {
|
|
1974
1974
|
var n = (
|
|
1975
1975
|
/** @type {Event} */
|
|
@@ -1981,45 +1981,45 @@ function Ha(e) {
|
|
|
1981
1981
|
function pn(e = !1) {
|
|
1982
1982
|
const t = (
|
|
1983
1983
|
/** @type {ComponentContextLegacy} */
|
|
1984
|
-
|
|
1984
|
+
H
|
|
1985
1985
|
), n = t.l.u;
|
|
1986
1986
|
if (!n) return;
|
|
1987
|
-
let r = () =>
|
|
1987
|
+
let r = () => B(t.s);
|
|
1988
1988
|
if (e) {
|
|
1989
|
-
let
|
|
1989
|
+
let a = 0, i = (
|
|
1990
1990
|
/** @type {Record<string, any>} */
|
|
1991
1991
|
{}
|
|
1992
1992
|
);
|
|
1993
|
-
const l = /* @__PURE__ */
|
|
1994
|
-
let
|
|
1993
|
+
const l = /* @__PURE__ */ Mt(() => {
|
|
1994
|
+
let s = !1;
|
|
1995
1995
|
const u = t.s;
|
|
1996
1996
|
for (const o in u)
|
|
1997
|
-
u[o] !==
|
|
1998
|
-
return
|
|
1997
|
+
u[o] !== i[o] && (i[o] = u[o], s = !0);
|
|
1998
|
+
return s && a++, a;
|
|
1999
1999
|
});
|
|
2000
2000
|
r = () => f(l);
|
|
2001
2001
|
}
|
|
2002
|
-
n.b.length &&
|
|
2003
|
-
|
|
2002
|
+
n.b.length && Ei(() => {
|
|
2003
|
+
Rn(t, r), Wt(n.b);
|
|
2004
2004
|
}), En(() => {
|
|
2005
|
-
const
|
|
2005
|
+
const a = P(() => n.m.map(Wr));
|
|
2006
2006
|
return () => {
|
|
2007
|
-
for (const
|
|
2008
|
-
typeof
|
|
2007
|
+
for (const i of a)
|
|
2008
|
+
typeof i == "function" && i();
|
|
2009
2009
|
};
|
|
2010
2010
|
}), n.a.length && En(() => {
|
|
2011
|
-
|
|
2011
|
+
Rn(t, r), Wt(n.a);
|
|
2012
2012
|
});
|
|
2013
2013
|
}
|
|
2014
|
-
function
|
|
2014
|
+
function Rn(e, t) {
|
|
2015
2015
|
if (e.l.s)
|
|
2016
2016
|
for (const n of e.l.s) f(n);
|
|
2017
2017
|
t();
|
|
2018
2018
|
}
|
|
2019
2019
|
function dr(e, t, n) {
|
|
2020
2020
|
if (e == null)
|
|
2021
|
-
return t(void 0),
|
|
2022
|
-
const r =
|
|
2021
|
+
return t(void 0), Bt;
|
|
2022
|
+
const r = P(
|
|
2023
2023
|
() => e.subscribe(
|
|
2024
2024
|
t,
|
|
2025
2025
|
// @ts-expect-error
|
|
@@ -2028,35 +2028,35 @@ function dr(e, t, n) {
|
|
|
2028
2028
|
);
|
|
2029
2029
|
return r.unsubscribe ? () => r.unsubscribe() : r;
|
|
2030
2030
|
}
|
|
2031
|
-
function
|
|
2031
|
+
function Bi(e) {
|
|
2032
2032
|
let t;
|
|
2033
2033
|
return dr(e, (n) => t = n)(), t;
|
|
2034
2034
|
}
|
|
2035
|
-
let
|
|
2036
|
-
function
|
|
2035
|
+
let pt = !1, $t = /* @__PURE__ */ Symbol();
|
|
2036
|
+
function Wi(e, t, n) {
|
|
2037
2037
|
const r = n[t] ??= {
|
|
2038
2038
|
store: null,
|
|
2039
2039
|
source: /* @__PURE__ */ Ie(void 0),
|
|
2040
|
-
unsubscribe:
|
|
2040
|
+
unsubscribe: Bt
|
|
2041
2041
|
};
|
|
2042
2042
|
if (r.store !== e && !($t in n))
|
|
2043
2043
|
if (r.unsubscribe(), r.store = e ?? null, e == null)
|
|
2044
|
-
r.source.v = void 0, r.unsubscribe =
|
|
2044
|
+
r.source.v = void 0, r.unsubscribe = Bt;
|
|
2045
2045
|
else {
|
|
2046
|
-
var
|
|
2047
|
-
r.unsubscribe = dr(e, (
|
|
2048
|
-
|
|
2049
|
-
}),
|
|
2046
|
+
var a = !0;
|
|
2047
|
+
r.unsubscribe = dr(e, (i) => {
|
|
2048
|
+
a ? r.source.v = i : z(r.source, i);
|
|
2049
|
+
}), a = !1;
|
|
2050
2050
|
}
|
|
2051
|
-
return e && $t in n ?
|
|
2051
|
+
return e && $t in n ? Bi(e) : f(r.source);
|
|
2052
2052
|
}
|
|
2053
|
-
function
|
|
2053
|
+
function Gi() {
|
|
2054
2054
|
const e = {};
|
|
2055
2055
|
function t() {
|
|
2056
2056
|
un(() => {
|
|
2057
2057
|
for (var n in e)
|
|
2058
2058
|
e[n].unsubscribe();
|
|
2059
|
-
|
|
2059
|
+
Tn(e, $t, {
|
|
2060
2060
|
enumerable: !1,
|
|
2061
2061
|
value: !0
|
|
2062
2062
|
});
|
|
@@ -2064,82 +2064,82 @@ function Wa() {
|
|
|
2064
2064
|
}
|
|
2065
2065
|
return [e, t];
|
|
2066
2066
|
}
|
|
2067
|
-
function
|
|
2068
|
-
var t =
|
|
2067
|
+
function Zi(e) {
|
|
2068
|
+
var t = pt;
|
|
2069
2069
|
try {
|
|
2070
|
-
return
|
|
2070
|
+
return pt = !1, [e(), pt];
|
|
2071
2071
|
} finally {
|
|
2072
|
-
|
|
2072
|
+
pt = t;
|
|
2073
2073
|
}
|
|
2074
2074
|
}
|
|
2075
|
-
function
|
|
2076
|
-
var
|
|
2075
|
+
function j(e, t, n, r) {
|
|
2076
|
+
var a = !ot || (n & Lr) !== 0, i = (n & jr) !== 0, l = (n & zr) !== 0, s = (
|
|
2077
2077
|
/** @type {V} */
|
|
2078
2078
|
r
|
|
2079
|
-
), u = !0, o = () => (u && (u = !1,
|
|
2079
|
+
), u = !0, o = () => (u && (u = !1, s = l ? P(
|
|
2080
2080
|
/** @type {() => V} */
|
|
2081
2081
|
r
|
|
2082
2082
|
) : (
|
|
2083
2083
|
/** @type {V} */
|
|
2084
2084
|
r
|
|
2085
|
-
)),
|
|
2086
|
-
if (
|
|
2087
|
-
var
|
|
2088
|
-
|
|
2085
|
+
)), s), c;
|
|
2086
|
+
if (i) {
|
|
2087
|
+
var d = Ke in e || Zr in e;
|
|
2088
|
+
c = ht(e, t)?.set ?? (d && t in e ? (I) => e[t] = I : void 0);
|
|
2089
2089
|
}
|
|
2090
|
-
var p,
|
|
2091
|
-
|
|
2090
|
+
var p, h = !1;
|
|
2091
|
+
i ? [p, h] = Zi(() => (
|
|
2092
2092
|
/** @type {V} */
|
|
2093
2093
|
e[t]
|
|
2094
2094
|
)) : p = /** @type {V} */
|
|
2095
|
-
e[t], p === void 0 && r !== void 0 && (p = o(),
|
|
2096
|
-
var
|
|
2097
|
-
if (
|
|
2095
|
+
e[t], p === void 0 && r !== void 0 && (p = o(), c && (a && ti(), c(p)));
|
|
2096
|
+
var v;
|
|
2097
|
+
if (a ? v = () => {
|
|
2098
2098
|
var I = (
|
|
2099
2099
|
/** @type {V} */
|
|
2100
2100
|
e[t]
|
|
2101
2101
|
);
|
|
2102
2102
|
return I === void 0 ? o() : (u = !0, I);
|
|
2103
|
-
} :
|
|
2103
|
+
} : v = () => {
|
|
2104
2104
|
var I = (
|
|
2105
2105
|
/** @type {V} */
|
|
2106
2106
|
e[t]
|
|
2107
2107
|
);
|
|
2108
|
-
return I !== void 0 && (
|
|
2109
|
-
void 0), I === void 0 ?
|
|
2110
|
-
},
|
|
2111
|
-
return
|
|
2112
|
-
if (
|
|
2113
|
-
var
|
|
2108
|
+
return I !== void 0 && (s = /** @type {V} */
|
|
2109
|
+
void 0), I === void 0 ? s : I;
|
|
2110
|
+
}, a && (n & Ur) === 0)
|
|
2111
|
+
return v;
|
|
2112
|
+
if (c) {
|
|
2113
|
+
var w = e.$$legacy;
|
|
2114
2114
|
return (
|
|
2115
2115
|
/** @type {() => V} */
|
|
2116
2116
|
(function(I, y) {
|
|
2117
|
-
return arguments.length > 0 ? ((!
|
|
2117
|
+
return arguments.length > 0 ? ((!a || !y || w || h) && c(y ? v() : I), I) : v();
|
|
2118
2118
|
})
|
|
2119
2119
|
);
|
|
2120
2120
|
}
|
|
2121
|
-
var
|
|
2122
|
-
|
|
2123
|
-
var
|
|
2121
|
+
var g = !1, E = ((n & Fr) !== 0 ? Mt : Tt)(() => (g = !1, v()));
|
|
2122
|
+
i && f(E);
|
|
2123
|
+
var R = (
|
|
2124
2124
|
/** @type {Effect} */
|
|
2125
|
-
|
|
2125
|
+
x
|
|
2126
2126
|
);
|
|
2127
2127
|
return (
|
|
2128
2128
|
/** @type {() => V} */
|
|
2129
2129
|
(function(I, y) {
|
|
2130
2130
|
if (arguments.length > 0) {
|
|
2131
|
-
const m = y ? f(E) :
|
|
2132
|
-
return
|
|
2131
|
+
const m = y ? f(E) : a && i ? He(I) : I;
|
|
2132
|
+
return z(E, m), g = !0, s !== void 0 && (s = m), I;
|
|
2133
2133
|
}
|
|
2134
|
-
return De &&
|
|
2134
|
+
return De && g || (R.f & pe) !== 0 ? E.v : f(E);
|
|
2135
2135
|
})
|
|
2136
2136
|
);
|
|
2137
2137
|
}
|
|
2138
|
-
function
|
|
2138
|
+
function Ji(e) {
|
|
2139
2139
|
const t = e.toLowerCase();
|
|
2140
2140
|
return t.includes("paystack") ? "paystack" : t.includes("hubtel") ? "hubtel" : t.includes("flutterwave") ? "flutterwave" : "paystack";
|
|
2141
2141
|
}
|
|
2142
|
-
function
|
|
2142
|
+
function Qi(e, t) {
|
|
2143
2143
|
return {
|
|
2144
2144
|
id: e.id,
|
|
2145
2145
|
clientSecret: e.client_secret,
|
|
@@ -2147,7 +2147,7 @@ function Xa(e, t) {
|
|
|
2147
2147
|
amount: e.amount,
|
|
2148
2148
|
currency: e.currency,
|
|
2149
2149
|
status: e.status,
|
|
2150
|
-
recommendedPsp:
|
|
2150
|
+
recommendedPsp: Ji(e.provider),
|
|
2151
2151
|
availableMethods: t.paymentMethods || ["card", "mobile_money"],
|
|
2152
2152
|
reference: e.reference || t.reference,
|
|
2153
2153
|
connectionId: e.connection_id,
|
|
@@ -2158,46 +2158,46 @@ function Xa(e, t) {
|
|
|
2158
2158
|
metadata: t.metadata
|
|
2159
2159
|
};
|
|
2160
2160
|
}
|
|
2161
|
-
function
|
|
2162
|
-
const { config: t, onSuccess: n, onError: r, onClose:
|
|
2163
|
-
let
|
|
2164
|
-
t.initialPaymentIntent && (
|
|
2165
|
-
...
|
|
2161
|
+
function Xi(e) {
|
|
2162
|
+
const { config: t, onSuccess: n, onError: r, onClose: a, onStateChange: i, apiBaseUrl: l } = e;
|
|
2163
|
+
let s = Pr();
|
|
2164
|
+
t.initialPaymentIntent && (s = {
|
|
2165
|
+
...s,
|
|
2166
2166
|
status: "ready",
|
|
2167
2167
|
paymentIntent: t.initialPaymentIntent,
|
|
2168
2168
|
selectedMethod: t.initialPaymentIntent.availableMethods?.length === 1 ? t.initialPaymentIntent.availableMethods[0] : null
|
|
2169
2169
|
});
|
|
2170
|
-
const u = /* @__PURE__ */ new Set(), o = new
|
|
2170
|
+
const u = /* @__PURE__ */ new Set(), o = new Sr({
|
|
2171
2171
|
publicKey: t.publicKey,
|
|
2172
2172
|
baseUrl: l
|
|
2173
|
-
}),
|
|
2174
|
-
u.forEach((
|
|
2175
|
-
},
|
|
2176
|
-
const b =
|
|
2177
|
-
|
|
2178
|
-
}, p = (
|
|
2179
|
-
|
|
2173
|
+
}), c = () => {
|
|
2174
|
+
u.forEach((_) => _(s));
|
|
2175
|
+
}, d = (_) => {
|
|
2176
|
+
const b = s.status;
|
|
2177
|
+
s = Cr(s, _), c(), s.status !== b && i?.(s.status);
|
|
2178
|
+
}, p = (_) => (u.add(_), _(s), () => u.delete(_)), h = async (_) => {
|
|
2179
|
+
d({ type: "INIT_START" });
|
|
2180
2180
|
try {
|
|
2181
|
-
const b = t.reference || Ir(), D = kr(t.currency),
|
|
2181
|
+
const b = t.reference || Ir(), D = kr(t.currency), fe = _ || t.paymentMethods?.[0] || "card", { data: F, error: ae } = await o.createPaymentIntent(
|
|
2182
2182
|
{ ...t, reference: b },
|
|
2183
|
-
|
|
2183
|
+
fe,
|
|
2184
2184
|
D
|
|
2185
2185
|
);
|
|
2186
|
-
if (
|
|
2187
|
-
|
|
2186
|
+
if (ae) {
|
|
2187
|
+
d({ type: "INIT_ERROR", payload: ae }), r?.(ae);
|
|
2188
2188
|
return;
|
|
2189
2189
|
}
|
|
2190
2190
|
if (!F) {
|
|
2191
|
-
const
|
|
2191
|
+
const W = {
|
|
2192
2192
|
code: "INIT_FAILED",
|
|
2193
2193
|
message: "No data received from API",
|
|
2194
2194
|
recoverable: !0
|
|
2195
2195
|
};
|
|
2196
|
-
|
|
2196
|
+
d({ type: "INIT_ERROR", payload: W }), r?.(W);
|
|
2197
2197
|
return;
|
|
2198
2198
|
}
|
|
2199
|
-
const
|
|
2200
|
-
|
|
2199
|
+
const We = Qi(F, { ...t, reference: b });
|
|
2200
|
+
d({ type: "INIT_SUCCESS", payload: We });
|
|
2201
2201
|
} catch (b) {
|
|
2202
2202
|
const D = {
|
|
2203
2203
|
code: "INIT_FAILED",
|
|
@@ -2205,45 +2205,45 @@ function Qa(e) {
|
|
|
2205
2205
|
recoverable: !0,
|
|
2206
2206
|
originalError: b
|
|
2207
2207
|
};
|
|
2208
|
-
|
|
2208
|
+
d({ type: "INIT_ERROR", payload: D }), r?.(D);
|
|
2209
2209
|
}
|
|
2210
|
-
},
|
|
2211
|
-
|
|
2212
|
-
},
|
|
2213
|
-
if (!(!
|
|
2214
|
-
|
|
2210
|
+
}, v = (_) => {
|
|
2211
|
+
d({ type: "SELECT_METHOD", payload: _ });
|
|
2212
|
+
}, w = async (_) => {
|
|
2213
|
+
if (!(!s.paymentIntent || !s.selectedMethod)) {
|
|
2214
|
+
d({ type: "PROCESS_START" });
|
|
2215
2215
|
try {
|
|
2216
2216
|
let b;
|
|
2217
|
-
if (
|
|
2218
|
-
const { data:
|
|
2219
|
-
|
|
2220
|
-
|
|
2217
|
+
if (s.paymentIntent.clientSecret) {
|
|
2218
|
+
const { data: fe, error: F } = await o.confirmPaymentIntent(
|
|
2219
|
+
s.paymentIntent.id,
|
|
2220
|
+
s.paymentIntent.clientSecret
|
|
2221
2221
|
);
|
|
2222
2222
|
if (F) {
|
|
2223
|
-
|
|
2223
|
+
d({ type: "PROCESS_ERROR", payload: F }), r?.(F);
|
|
2224
2224
|
return;
|
|
2225
2225
|
}
|
|
2226
|
-
b =
|
|
2226
|
+
b = fe;
|
|
2227
2227
|
} else {
|
|
2228
|
-
const { data:
|
|
2228
|
+
const { data: fe, error: F } = await o.confirmPayment(s.paymentIntent.id);
|
|
2229
2229
|
if (F) {
|
|
2230
|
-
|
|
2230
|
+
d({ type: "PROCESS_ERROR", payload: F }), r?.(F);
|
|
2231
2231
|
return;
|
|
2232
2232
|
}
|
|
2233
|
-
b =
|
|
2233
|
+
b = fe;
|
|
2234
2234
|
}
|
|
2235
2235
|
const D = {
|
|
2236
|
-
paymentId:
|
|
2237
|
-
reference:
|
|
2238
|
-
amount:
|
|
2239
|
-
currency:
|
|
2240
|
-
paymentMethod:
|
|
2241
|
-
psp:
|
|
2242
|
-
pspReference:
|
|
2236
|
+
paymentId: s.paymentIntent.id,
|
|
2237
|
+
reference: _.reference || s.paymentIntent.reference || s.paymentIntent.metadata?.reference || "",
|
|
2238
|
+
amount: s.paymentIntent.amount,
|
|
2239
|
+
currency: s.paymentIntent.currency,
|
|
2240
|
+
paymentMethod: s.selectedMethod,
|
|
2241
|
+
psp: s.paymentIntent.recommendedPsp,
|
|
2242
|
+
pspReference: _.pspReference || b?.provider_ref_id || "",
|
|
2243
2243
|
status: "success",
|
|
2244
|
-
metadata:
|
|
2244
|
+
metadata: _
|
|
2245
2245
|
};
|
|
2246
|
-
|
|
2246
|
+
d({ type: "PROCESS_SUCCESS", payload: D }), n?.(D);
|
|
2247
2247
|
} catch (b) {
|
|
2248
2248
|
const D = {
|
|
2249
2249
|
code: "PAYMENT_FAILED",
|
|
@@ -2251,7 +2251,7 @@ function Qa(e) {
|
|
|
2251
2251
|
recoverable: !0,
|
|
2252
2252
|
originalError: b
|
|
2253
2253
|
};
|
|
2254
|
-
|
|
2254
|
+
d({ type: "PROCESS_ERROR", payload: D }), r?.(D);
|
|
2255
2255
|
}
|
|
2256
2256
|
}
|
|
2257
2257
|
};
|
|
@@ -2259,49 +2259,49 @@ function Qa(e) {
|
|
|
2259
2259
|
// Svelte store contract
|
|
2260
2260
|
subscribe: p,
|
|
2261
2261
|
// Actions
|
|
2262
|
-
initialize:
|
|
2263
|
-
selectMethod:
|
|
2264
|
-
processPayment:
|
|
2265
|
-
handlePspSuccess: async (
|
|
2266
|
-
await
|
|
2262
|
+
initialize: h,
|
|
2263
|
+
selectMethod: v,
|
|
2264
|
+
processPayment: w,
|
|
2265
|
+
handlePspSuccess: async (_) => {
|
|
2266
|
+
await w(_);
|
|
2267
2267
|
},
|
|
2268
|
-
handlePspError: (
|
|
2269
|
-
|
|
2268
|
+
handlePspError: (_) => {
|
|
2269
|
+
d({ type: "PROCESS_ERROR", payload: _ }), r?.(_);
|
|
2270
2270
|
},
|
|
2271
2271
|
reset: () => {
|
|
2272
|
-
|
|
2272
|
+
d({ type: "RESET" });
|
|
2273
2273
|
},
|
|
2274
2274
|
close: async () => {
|
|
2275
|
-
if (
|
|
2275
|
+
if (s.paymentIntent && s.status !== "success")
|
|
2276
2276
|
try {
|
|
2277
|
-
await o.cancelPaymentIntent(
|
|
2277
|
+
await o.cancelPaymentIntent(s.paymentIntent.id);
|
|
2278
2278
|
} catch {
|
|
2279
2279
|
}
|
|
2280
|
-
|
|
2280
|
+
d({ type: "CLOSE" }), a?.();
|
|
2281
2281
|
},
|
|
2282
2282
|
// Getters
|
|
2283
|
-
getStatus: () =>
|
|
2284
|
-
getPaymentIntent: () =>
|
|
2285
|
-
getSelectedMethod: () =>
|
|
2286
|
-
getError: () =>
|
|
2287
|
-
getResult: () =>
|
|
2288
|
-
isLoading: () =>
|
|
2289
|
-
isReady: () =>
|
|
2290
|
-
isComplete: () =>
|
|
2291
|
-
canRetry: () =>
|
|
2283
|
+
getStatus: () => s.status,
|
|
2284
|
+
getPaymentIntent: () => s.paymentIntent,
|
|
2285
|
+
getSelectedMethod: () => s.selectedMethod,
|
|
2286
|
+
getError: () => s.error,
|
|
2287
|
+
getResult: () => s.result,
|
|
2288
|
+
isLoading: () => s.status === "loading" || s.status === "processing",
|
|
2289
|
+
isReady: () => s.status === "ready" || s.status === "method_selected",
|
|
2290
|
+
isComplete: () => s.status === "success",
|
|
2291
|
+
canRetry: () => s.error?.recoverable ?? !1
|
|
2292
2292
|
};
|
|
2293
2293
|
}
|
|
2294
|
-
var $
|
|
2295
|
-
function
|
|
2294
|
+
var $i = /* @__PURE__ */ O('<div class="reevit-radio-inner"></div>'), ea = /* @__PURE__ */ O('<button type="button"><span class="reevit-method-icon"> </span> <div class="reevit-method-info"><span class="reevit-method-name"> </span> <span class="reevit-method-description"> </span></div> <div class="reevit-method-radio"><!></div></button>'), ta = /* @__PURE__ */ O('<div class="reevit-method-selector"><h3 class="reevit-section-title">Select Payment Method</h3> <p class="reevit-amount-display"> </p> <div class="reevit-methods-grid"></div></div>');
|
|
2295
|
+
function na(e, t) {
|
|
2296
2296
|
sn(t, !1);
|
|
2297
2297
|
const n = /* @__PURE__ */ Ie();
|
|
2298
|
-
let r =
|
|
2299
|
-
const
|
|
2300
|
-
function u(
|
|
2301
|
-
|
|
2298
|
+
let r = j(t, "methods", 8), a = j(t, "selected", 8), i = j(t, "amount", 8), l = j(t, "currency", 8);
|
|
2299
|
+
const s = en();
|
|
2300
|
+
function u(h) {
|
|
2301
|
+
s("select", h);
|
|
2302
2302
|
}
|
|
2303
|
-
qe(() =>
|
|
2304
|
-
|
|
2303
|
+
qe(() => B(r()), () => {
|
|
2304
|
+
z(n, [
|
|
2305
2305
|
{
|
|
2306
2306
|
id: "card",
|
|
2307
2307
|
name: "Card",
|
|
@@ -2320,133 +2320,345 @@ function ni(e, t) {
|
|
|
2320
2320
|
description: "Transfer directly from your bank",
|
|
2321
2321
|
icon: "🏦"
|
|
2322
2322
|
}
|
|
2323
|
-
].filter((
|
|
2324
|
-
}),
|
|
2325
|
-
var o =
|
|
2326
|
-
ur(p, 5, () => f(n), (
|
|
2327
|
-
var
|
|
2323
|
+
].filter((h) => r().includes(h.id)));
|
|
2324
|
+
}), cn(), pn();
|
|
2325
|
+
var o = ta(), c = L(A(o), 2), d = A(c), p = L(c, 2);
|
|
2326
|
+
ur(p, 5, () => f(n), (h) => h.id, (h, v) => {
|
|
2327
|
+
var w = ea(), g = A(w), E = A(g), R = L(g, 2), I = A(R), y = A(I), m = L(I, 2), k = A(m), M = L(R, 2), U = A(M);
|
|
2328
2328
|
{
|
|
2329
|
-
var
|
|
2330
|
-
var ct = $
|
|
2331
|
-
|
|
2329
|
+
var ce = (ie) => {
|
|
2330
|
+
var ct = $i();
|
|
2331
|
+
T(ie, ct);
|
|
2332
2332
|
};
|
|
2333
|
-
$(
|
|
2334
|
-
|
|
2333
|
+
$(U, (ie) => {
|
|
2334
|
+
B(a()), f(v), P(() => a() === f(v).id) && ie(ce);
|
|
2335
2335
|
});
|
|
2336
2336
|
}
|
|
2337
2337
|
oe(
|
|
2338
|
-
(
|
|
2339
|
-
|
|
2338
|
+
(ie) => {
|
|
2339
|
+
kt(w, 1, ie), xe(E, (f(v), P(() => f(v).icon))), xe(y, (f(v), P(() => f(v).name))), xe(k, (f(v), P(() => f(v).description)));
|
|
2340
2340
|
},
|
|
2341
2341
|
[
|
|
2342
|
-
() =>
|
|
2342
|
+
() => It((B(we), B(a()), f(v), P(() => we("reevit-method-card", a() === f(v).id && "reevit-method-card--selected"))))
|
|
2343
2343
|
]
|
|
2344
|
-
), se("click",
|
|
2345
|
-
}), oe((
|
|
2346
|
-
() => (
|
|
2347
|
-
]),
|
|
2344
|
+
), se("click", w, () => u(f(v).id)), T(h, w);
|
|
2345
|
+
}), oe((h) => xe(d, `Pay ${h ?? ""}`), [
|
|
2346
|
+
() => (B(yn), B(i()), B(l()), P(() => yn(i(), l())))
|
|
2347
|
+
]), T(e, o), on();
|
|
2348
2348
|
}
|
|
2349
|
-
var
|
|
2350
|
-
function
|
|
2349
|
+
var ra = /* @__PURE__ */ O('<button type="button"><div class="reevit-network-dot"></div> </button>'), ia = /* @__PURE__ */ O('<p class="reevit-error-message"> </p>'), aa = /* @__PURE__ */ O('<span class="reevit-spinner"></span>'), sa = /* @__PURE__ */ O("<span>Continue</span>"), oa = /* @__PURE__ */ O('<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> <!> <button type="submit" class="reevit-submit-btn"><!></button> <p class="reevit-secure-text">🔒 Secure mobile money payment via Reevit</p></form>');
|
|
2350
|
+
function la(e, t) {
|
|
2351
2351
|
sn(t, !1);
|
|
2352
|
-
let n =
|
|
2353
|
-
const
|
|
2354
|
-
let
|
|
2352
|
+
let n = j(t, "initialPhone", 8, ""), r = j(t, "loading", 8, !1);
|
|
2353
|
+
const a = en();
|
|
2354
|
+
let i = /* @__PURE__ */ Ie(n()), l = /* @__PURE__ */ Ie(null), s = /* @__PURE__ */ Ie(null);
|
|
2355
2355
|
function u() {
|
|
2356
|
-
if (!
|
|
2357
|
-
|
|
2356
|
+
if (!Ht(f(i))) {
|
|
2357
|
+
z(s, "Please enter a valid phone number");
|
|
2358
2358
|
return;
|
|
2359
2359
|
}
|
|
2360
2360
|
if (!f(l)) {
|
|
2361
|
-
|
|
2361
|
+
z(s, "Please select your mobile network");
|
|
2362
2362
|
return;
|
|
2363
2363
|
}
|
|
2364
|
-
|
|
2364
|
+
a("submit", { phone: f(i), network: f(l) });
|
|
2365
2365
|
}
|
|
2366
2366
|
const o = [
|
|
2367
2367
|
{ id: "mtn", name: "MTN", color: "#FFCC00" },
|
|
2368
2368
|
{ id: "vodafone", name: "Vodafone", color: "#E60000" },
|
|
2369
2369
|
{ id: "airteltigo", name: "AirtelTigo", color: "#005596" }
|
|
2370
2370
|
];
|
|
2371
|
-
qe(() => (f(
|
|
2372
|
-
const m =
|
|
2373
|
-
m &&
|
|
2374
|
-
}),
|
|
2375
|
-
var
|
|
2376
|
-
ur(
|
|
2377
|
-
var M =
|
|
2371
|
+
qe(() => (f(i), f(s)), () => {
|
|
2372
|
+
const m = Rr(f(i));
|
|
2373
|
+
m && z(l, m), f(s) && z(s, null);
|
|
2374
|
+
}), cn(), pn();
|
|
2375
|
+
var c = oa(), d = A(c), p = L(A(d), 2), h = L(d, 2), v = L(A(h), 2);
|
|
2376
|
+
ur(v, 5, () => o, (m) => m.id, (m, k) => {
|
|
2377
|
+
var M = ra(), U = A(M), ce = L(U);
|
|
2378
2378
|
oe(
|
|
2379
|
-
(
|
|
2380
|
-
|
|
2379
|
+
(ie) => {
|
|
2380
|
+
kt(M, 1, ie), M.disabled = r(), fr(U, `background-color: ${f(k), P(() => f(k).color) ?? ""}`), xe(ce, ` ${f(k), P(() => f(k).name) ?? ""}`);
|
|
2381
2381
|
},
|
|
2382
2382
|
[
|
|
2383
|
-
() =>
|
|
2383
|
+
() => It((B(we), f(l), f(k), P(() => we("reevit-network-btn", f(l) === f(k).id && "reevit-network-btn--selected"))))
|
|
2384
2384
|
]
|
|
2385
|
-
), se("click", M, () =>
|
|
2385
|
+
), se("click", M, () => z(l, f(k).id)), T(m, M);
|
|
2386
2386
|
});
|
|
2387
|
-
var
|
|
2387
|
+
var w = L(h, 2);
|
|
2388
2388
|
{
|
|
2389
|
-
var
|
|
2390
|
-
var k =
|
|
2391
|
-
oe(() =>
|
|
2389
|
+
var g = (m) => {
|
|
2390
|
+
var k = ia(), M = A(k);
|
|
2391
|
+
oe(() => xe(M, f(s))), T(m, k);
|
|
2392
2392
|
};
|
|
2393
|
-
$(
|
|
2394
|
-
f(
|
|
2393
|
+
$(w, (m) => {
|
|
2394
|
+
f(s) && m(g);
|
|
2395
2395
|
});
|
|
2396
2396
|
}
|
|
2397
|
-
var E = L(
|
|
2397
|
+
var E = L(w, 2), R = A(E);
|
|
2398
2398
|
{
|
|
2399
2399
|
var I = (m) => {
|
|
2400
|
-
var k =
|
|
2401
|
-
|
|
2400
|
+
var k = aa();
|
|
2401
|
+
T(m, k);
|
|
2402
2402
|
}, y = (m) => {
|
|
2403
|
-
var k =
|
|
2404
|
-
|
|
2403
|
+
var k = sa();
|
|
2404
|
+
T(m, k);
|
|
2405
2405
|
};
|
|
2406
|
-
$(
|
|
2406
|
+
$(R, (m) => {
|
|
2407
2407
|
r() ? m(I) : m(y, !1);
|
|
2408
2408
|
});
|
|
2409
2409
|
}
|
|
2410
2410
|
oe(
|
|
2411
2411
|
(m) => {
|
|
2412
|
-
|
|
2412
|
+
kt(p, 1, m), p.disabled = r(), E.disabled = r() || !f(i);
|
|
2413
2413
|
},
|
|
2414
2414
|
[
|
|
2415
|
-
() =>
|
|
2415
|
+
() => It((B(we), f(s), B(Ht), f(i), P(() => we("reevit-input", f(s) && !Ht(f(i)) && "reevit-input--error"))))
|
|
2416
2416
|
]
|
|
2417
|
-
),
|
|
2417
|
+
), Ki(p, () => f(i), (m) => z(i, m)), se("submit", c, Yi(u)), T(e, c), on();
|
|
2418
2418
|
}
|
|
2419
|
-
|
|
2420
|
-
|
|
2421
|
-
|
|
2419
|
+
class ua {
|
|
2420
|
+
constructor(t) {
|
|
2421
|
+
this.baseUrl = "https://unified-pay.hubtel.com", this.messageHandler = null, this.stylesInjected = !1, t && (this.baseUrl = t);
|
|
2422
|
+
}
|
|
2423
|
+
/**
|
|
2424
|
+
* Redirects the user to the checkout page with the provided purchase information and configuration.
|
|
2425
|
+
* @param purchaseInfo - The purchase information.
|
|
2426
|
+
* @param config - The configuration.
|
|
2427
|
+
* @throws {Error} If the popup is blocked by the browser.
|
|
2428
|
+
*/
|
|
2429
|
+
redirect({ purchaseInfo: t, config: n }) {
|
|
2430
|
+
const r = this.createCheckoutUrl(t, n), a = window.open(r);
|
|
2431
|
+
if (!a || a.closed || typeof a.closed > "u")
|
|
2432
|
+
throw new Error("Popup was blocked by the browser. Please allow popups for this site.");
|
|
2433
|
+
}
|
|
2434
|
+
/**
|
|
2435
|
+
* Initializes the iframe for the checkout process.
|
|
2436
|
+
*
|
|
2437
|
+
* @param purchaseInfo - The purchase information.
|
|
2438
|
+
* @param callBacks - The callback functions.
|
|
2439
|
+
* @param config - The configuration settings.
|
|
2440
|
+
* @param iframeStyle - The style options for the iframe (optional).
|
|
2441
|
+
* @throws {Error} If the container element with id "hubtel-checkout-iframe" is not found.
|
|
2442
|
+
*/
|
|
2443
|
+
initIframe({ purchaseInfo: t, callBacks: n, config: r, iframeStyle: a }) {
|
|
2444
|
+
var i, l, s;
|
|
2445
|
+
this.registerEvents(n);
|
|
2446
|
+
const u = document.getElementById("hubtel-checkout-iframe");
|
|
2447
|
+
if (!u)
|
|
2448
|
+
throw new Error('Container element with id "hubtel-checkout-iframe" not found in the DOM.');
|
|
2449
|
+
u.innerHTML = "";
|
|
2450
|
+
const o = document.createElement("div");
|
|
2451
|
+
o.textContent = "Loading...", u.appendChild(o);
|
|
2452
|
+
const c = document.createElement("iframe");
|
|
2453
|
+
c.setAttribute("id", "hubtel-iframe-element"), c.src = this.createCheckoutUrl(t, r), c.style.display = "none", c.style.width = (i = a?.width) !== null && i !== void 0 ? i : "100%", c.style.height = (l = a?.height) !== null && l !== void 0 ? l : "100%", c.style.minHeight = a?.minHeight || "400px", c.style.border = (s = a?.border) !== null && s !== void 0 ? s : "none", c.onload = () => {
|
|
2454
|
+
var d;
|
|
2455
|
+
u.removeChild(o), c.style.display = "block", (d = n.onLoad) === null || d === void 0 || d.call(n);
|
|
2456
|
+
}, u.appendChild(c);
|
|
2457
|
+
}
|
|
2458
|
+
openModal({ purchaseInfo: t, callBacks: n, config: r }) {
|
|
2459
|
+
this.injectStyles(), this.createIframe(), this.handleBackButton(), this.registerEvents(n), this.renderWebpageInPopup(this.createCheckoutUrl(t, r), n.onClose, n.onLoad);
|
|
2460
|
+
}
|
|
2461
|
+
createCheckoutUrl(t, n) {
|
|
2462
|
+
const r = Object.assign(Object.assign({}, t), n), a = Object.keys(r).reduce((o, c) => (r[c] !== null && r[c] !== void 0 && (o[c] = r[c]), o), {}), i = Object.keys(a).map((o) => `${o}=${encodeURIComponent(a[o])}`).join("&"), l = this.encodeBase64(i), s = encodeURIComponent(l);
|
|
2463
|
+
return `${a?.branding === "disabled" ? `${this.baseUrl}/pay/direct` : `${this.baseUrl}/pay`}?p=${s}`;
|
|
2464
|
+
}
|
|
2465
|
+
encodeBase64(t) {
|
|
2466
|
+
return btoa(unescape(encodeURIComponent(t)));
|
|
2467
|
+
}
|
|
2468
|
+
handleBackButton() {
|
|
2469
|
+
window.addEventListener("popstate", () => {
|
|
2470
|
+
this.closePopUp();
|
|
2471
|
+
});
|
|
2472
|
+
}
|
|
2473
|
+
createIframe() {
|
|
2474
|
+
const t = document.createElement("div");
|
|
2475
|
+
t.setAttribute("id", "backdrop"), t.classList.add("backdrop");
|
|
2476
|
+
const n = document.createElement("span");
|
|
2477
|
+
n.classList.add("checkout-loader"), t.appendChild(n), document.body.appendChild(t);
|
|
2478
|
+
}
|
|
2479
|
+
registerEvents(t) {
|
|
2480
|
+
this.messageHandler && window.removeEventListener("message", this.messageHandler, !1);
|
|
2481
|
+
const n = (r) => {
|
|
2482
|
+
var a, i, l, s, u, o;
|
|
2483
|
+
if (r.origin !== this.baseUrl)
|
|
2484
|
+
return;
|
|
2485
|
+
const { data: c } = r;
|
|
2486
|
+
if (c.success === !0)
|
|
2487
|
+
(a = t.onPaymentSuccess) === null || a === void 0 || a.call(t, c);
|
|
2488
|
+
else if (c.success === !1)
|
|
2489
|
+
(i = t.onPaymentFailure) === null || i === void 0 || i.call(t, c);
|
|
2490
|
+
else if (c.initialized)
|
|
2491
|
+
(l = t.init) === null || l === void 0 || l.call(t, c), (s = t.onInit) === null || s === void 0 || s.call(t, c);
|
|
2492
|
+
else if (c.feesChanged)
|
|
2493
|
+
(u = t.onFeesChanged) === null || u === void 0 || u.call(t, c.fees);
|
|
2494
|
+
else if (c.resize) {
|
|
2495
|
+
const d = document.getElementById("hubtel-iframe-element");
|
|
2496
|
+
d && (d.style.height = c.height + "px"), (o = t?.onResize) === null || o === void 0 || o.call(t, c);
|
|
2497
|
+
}
|
|
2498
|
+
};
|
|
2499
|
+
this.messageHandler = n, window.addEventListener("message", n, !1);
|
|
2500
|
+
}
|
|
2501
|
+
/**
|
|
2502
|
+
* Removes the message event listener to prevent memory leaks.
|
|
2503
|
+
* Call this method when you're done with the checkout to clean up resources.
|
|
2504
|
+
*/
|
|
2505
|
+
destroy() {
|
|
2506
|
+
this.messageHandler && (window.removeEventListener("message", this.messageHandler, !1), this.messageHandler = null);
|
|
2507
|
+
}
|
|
2508
|
+
renderWebpageInPopup(t, n, r) {
|
|
2509
|
+
const a = document.createElement("div");
|
|
2510
|
+
a.classList.add("checkout-modal");
|
|
2511
|
+
const i = document.createElement("div");
|
|
2512
|
+
i.setAttribute("id", "checkout-close-icon"), i.innerHTML = "×", i.classList.add("close-icon"), i.addEventListener("click", () => {
|
|
2513
|
+
this.closePopUp(), n?.();
|
|
2514
|
+
}), a.appendChild(i);
|
|
2515
|
+
const l = document.createElement("iframe");
|
|
2516
|
+
l.src = t, history.pushState({ modalOpen: !0 }, ""), l.classList.add("iframe"), a.appendChild(l), document.body.appendChild(a), a.style.opacity = "0", l.addEventListener("load", () => {
|
|
2517
|
+
a.style.opacity = "1", r?.();
|
|
2518
|
+
});
|
|
2519
|
+
}
|
|
2520
|
+
closePopUp() {
|
|
2521
|
+
const t = document.querySelector(".backdrop"), n = document.querySelector(".checkout-modal");
|
|
2522
|
+
t && document.body.removeChild(t), n && document.body.removeChild(n), history.replaceState(null, ""), window.removeEventListener("popstate", this.closePopUp);
|
|
2523
|
+
}
|
|
2524
|
+
injectStyles() {
|
|
2525
|
+
if (this.stylesInjected)
|
|
2526
|
+
return;
|
|
2527
|
+
const t = document.createElement("style");
|
|
2528
|
+
t.type = "text/css", t.setAttribute("data-hubtel-checkout", "true"), t.innerHTML = `
|
|
2529
|
+
.backdrop {
|
|
2530
|
+
position: fixed;
|
|
2531
|
+
left: 0;
|
|
2532
|
+
top: 0;
|
|
2533
|
+
width: 100%;
|
|
2534
|
+
height: 100%;
|
|
2535
|
+
background-color: rgba(0, 0, 0, 0.5);
|
|
2536
|
+
z-index: 999998;
|
|
2537
|
+
}
|
|
2538
|
+
|
|
2539
|
+
.loader {
|
|
2540
|
+
position: fixed;
|
|
2541
|
+
top: 50%;
|
|
2542
|
+
left: 50%;
|
|
2543
|
+
transform: translate(-50%, -50%);
|
|
2544
|
+
z-index: 999999;
|
|
2545
|
+
/* Your loader styles */
|
|
2546
|
+
}
|
|
2547
|
+
|
|
2548
|
+
.checkout-modal {
|
|
2549
|
+
position: fixed;
|
|
2550
|
+
top: 50%;
|
|
2551
|
+
left: 50%;
|
|
2552
|
+
transform: translate(-50%, -50%);
|
|
2553
|
+
width: 90%;
|
|
2554
|
+
height: 90%;
|
|
2555
|
+
padding-top: 20px;
|
|
2556
|
+
max-width: 480px;
|
|
2557
|
+
background-color: #fff;
|
|
2558
|
+
border-radius: 10px;
|
|
2559
|
+
z-index: 1000000;
|
|
2560
|
+
transition: opacity 0.5s ease, transform 0.5s ease;
|
|
2561
|
+
opacity: 0;
|
|
2562
|
+
}
|
|
2563
|
+
|
|
2564
|
+
.close-icon {
|
|
2565
|
+
position: absolute;
|
|
2566
|
+
top: 10px;
|
|
2567
|
+
width: 25px;
|
|
2568
|
+
height: 25px;
|
|
2569
|
+
font-size: 20px;
|
|
2570
|
+
right: 10px;
|
|
2571
|
+
cursor: pointer;
|
|
2572
|
+
color: #fff;
|
|
2573
|
+
background-color: #000;
|
|
2574
|
+
text-align: center;
|
|
2575
|
+
border-radius: 50%;
|
|
2576
|
+
}
|
|
2577
|
+
|
|
2578
|
+
.iframe {
|
|
2579
|
+
width: 100%;
|
|
2580
|
+
height: calc(100% - 20px);
|
|
2581
|
+
border: none;
|
|
2582
|
+
}
|
|
2583
|
+
|
|
2584
|
+
.checkout-loader {
|
|
2585
|
+
width: 30px;
|
|
2586
|
+
height: 30px;
|
|
2587
|
+
border: 3px solid #FFF;
|
|
2588
|
+
border-bottom-color: #42b883;
|
|
2589
|
+
border-radius: 50%;
|
|
2590
|
+
display: inline-block;
|
|
2591
|
+
box-sizing: border-box;
|
|
2592
|
+
position : fixed;
|
|
2593
|
+
top : 50%;
|
|
2594
|
+
left : 50%;
|
|
2595
|
+
transform : translate(-50%, -50%);
|
|
2596
|
+
z-index : 999999;
|
|
2597
|
+
animation: rotation 1s linear infinite;
|
|
2598
|
+
}
|
|
2599
|
+
|
|
2600
|
+
@keyframes rotation {
|
|
2601
|
+
0% {
|
|
2602
|
+
transform: rotate(0deg);
|
|
2603
|
+
}
|
|
2604
|
+
100% {
|
|
2605
|
+
transform: rotate(360deg);
|
|
2606
|
+
}
|
|
2607
|
+
}
|
|
2608
|
+
|
|
2609
|
+
@media screen and (max-width: 600px) {
|
|
2610
|
+
.checkout-modal {
|
|
2611
|
+
width: 100%;
|
|
2612
|
+
height: 100%;
|
|
2613
|
+
border-radius: 0;
|
|
2614
|
+
padding-bottom: 0px;
|
|
2615
|
+
padding-top: 0px;
|
|
2616
|
+
}
|
|
2617
|
+
.close-icon{
|
|
2618
|
+
top: 10px;
|
|
2619
|
+
right: 15px;
|
|
2620
|
+
}
|
|
2621
|
+
|
|
2622
|
+
.iframe {
|
|
2623
|
+
|
|
2624
|
+
height: 100%;
|
|
2625
|
+
|
|
2626
|
+
}
|
|
2627
|
+
}
|
|
2628
|
+
`, document.head.appendChild(t), this.stylesInjected = !0;
|
|
2629
|
+
}
|
|
2630
|
+
}
|
|
2631
|
+
const xn = /* @__PURE__ */ new Map();
|
|
2632
|
+
function Ot(e, t) {
|
|
2633
|
+
const n = xn.get(t);
|
|
2422
2634
|
if (n) return n;
|
|
2423
|
-
const r = new Promise((
|
|
2635
|
+
const r = new Promise((a, i) => {
|
|
2424
2636
|
if (document.getElementById(t)) {
|
|
2425
|
-
|
|
2637
|
+
a();
|
|
2426
2638
|
return;
|
|
2427
2639
|
}
|
|
2428
2640
|
const l = document.createElement("script");
|
|
2429
|
-
l.id = t, l.src = e, l.async = !0, l.onload = () =>
|
|
2641
|
+
l.id = t, l.src = e, l.async = !0, l.onload = () => a(), l.onerror = () => i(new Error(`Failed to load ${t} script`)), document.head.appendChild(l);
|
|
2430
2642
|
});
|
|
2431
|
-
return
|
|
2643
|
+
return xn.set(t, r), r;
|
|
2432
2644
|
}
|
|
2433
|
-
function
|
|
2434
|
-
return
|
|
2645
|
+
function ca() {
|
|
2646
|
+
return Ot("https://js.paystack.co/v1/inline.js", "paystack-script");
|
|
2435
2647
|
}
|
|
2436
|
-
function
|
|
2437
|
-
return
|
|
2648
|
+
function Da() {
|
|
2649
|
+
return Promise.resolve();
|
|
2438
2650
|
}
|
|
2439
|
-
function
|
|
2440
|
-
return
|
|
2651
|
+
function fa() {
|
|
2652
|
+
return Ot("https://checkout.flutterwave.com/v3.js", "flutterwave-script");
|
|
2441
2653
|
}
|
|
2442
|
-
function
|
|
2443
|
-
return
|
|
2654
|
+
function da() {
|
|
2655
|
+
return Ot("https://js.stripe.com/v3/", "stripe-script");
|
|
2444
2656
|
}
|
|
2445
|
-
function
|
|
2446
|
-
return
|
|
2657
|
+
function va() {
|
|
2658
|
+
return Ot("https://sdk.monnify.com/plugin/monnify.js", "monnify-script");
|
|
2447
2659
|
}
|
|
2448
|
-
async function
|
|
2449
|
-
if (await
|
|
2660
|
+
async function pa(e) {
|
|
2661
|
+
if (await ca(), !window.PaystackPop)
|
|
2450
2662
|
throw new Error("Paystack script not loaded");
|
|
2451
2663
|
window.PaystackPop.setup({
|
|
2452
2664
|
key: e.key,
|
|
@@ -2459,22 +2671,36 @@ async function pi(e) {
|
|
|
2459
2671
|
onClose: e.onClose
|
|
2460
2672
|
}).openIframe();
|
|
2461
2673
|
}
|
|
2462
|
-
async function
|
|
2463
|
-
|
|
2464
|
-
throw new Error("Hubtel script not loaded");
|
|
2465
|
-
window.HubtelCheckout.initPay({
|
|
2466
|
-
clientId: e.clientId,
|
|
2467
|
-
purchaseDescription: e.purchaseDescription,
|
|
2674
|
+
async function ha(e) {
|
|
2675
|
+
const t = new ua(), n = {
|
|
2468
2676
|
amount: e.amount,
|
|
2469
|
-
|
|
2470
|
-
|
|
2471
|
-
|
|
2472
|
-
|
|
2473
|
-
|
|
2677
|
+
purchaseDescription: e.purchaseDescription,
|
|
2678
|
+
customerPhoneNumber: e.customerPhone || "",
|
|
2679
|
+
clientReference: `hubtel_${Date.now()}`
|
|
2680
|
+
}, r = {
|
|
2681
|
+
branding: "enabled",
|
|
2682
|
+
callbackUrl: e.callbackUrl || (typeof window < "u" ? window.location.href : ""),
|
|
2683
|
+
merchantAccount: typeof e.clientId == "string" ? parseInt(e.clientId, 10) : e.clientId,
|
|
2684
|
+
basicAuth: ""
|
|
2685
|
+
};
|
|
2686
|
+
t.openModal({
|
|
2687
|
+
purchaseInfo: n,
|
|
2688
|
+
config: r,
|
|
2689
|
+
callBacks: {
|
|
2690
|
+
onPaymentSuccess: (a) => {
|
|
2691
|
+
e.onSuccess(a), t.closePopUp();
|
|
2692
|
+
},
|
|
2693
|
+
onPaymentFailure: () => {
|
|
2694
|
+
e.onClose();
|
|
2695
|
+
},
|
|
2696
|
+
onClose: () => {
|
|
2697
|
+
e.onClose();
|
|
2698
|
+
}
|
|
2699
|
+
}
|
|
2474
2700
|
});
|
|
2475
2701
|
}
|
|
2476
|
-
async function
|
|
2477
|
-
if (await
|
|
2702
|
+
async function _a(e) {
|
|
2703
|
+
if (await fa(), !window.FlutterwaveCheckout)
|
|
2478
2704
|
throw new Error("Flutterwave script not loaded");
|
|
2479
2705
|
window.FlutterwaveCheckout({
|
|
2480
2706
|
public_key: e.public_key,
|
|
@@ -2488,13 +2714,13 @@ async function hi(e) {
|
|
|
2488
2714
|
onclose: e.onclose
|
|
2489
2715
|
});
|
|
2490
2716
|
}
|
|
2491
|
-
async function
|
|
2492
|
-
if (await
|
|
2717
|
+
async function ma(e) {
|
|
2718
|
+
if (await da(), !window.Stripe)
|
|
2493
2719
|
throw new Error("Stripe.js not loaded");
|
|
2494
2720
|
return window.Stripe(e);
|
|
2495
2721
|
}
|
|
2496
|
-
async function
|
|
2497
|
-
const n = await (await
|
|
2722
|
+
async function Fa(e) {
|
|
2723
|
+
const n = await (await ma(e.publishableKey)).confirmPayment({
|
|
2498
2724
|
elements: e.elements,
|
|
2499
2725
|
clientSecret: e.clientSecret,
|
|
2500
2726
|
redirect: "if_required"
|
|
@@ -2504,8 +2730,8 @@ async function Di(e) {
|
|
|
2504
2730
|
status: n.paymentIntent.status
|
|
2505
2731
|
});
|
|
2506
2732
|
}
|
|
2507
|
-
async function
|
|
2508
|
-
if (await
|
|
2733
|
+
async function ya(e) {
|
|
2734
|
+
if (await va(), !window.MonnifySDK)
|
|
2509
2735
|
throw new Error("Monnify SDK not loaded");
|
|
2510
2736
|
window.MonnifySDK.initialize({
|
|
2511
2737
|
amount: e.amount,
|
|
@@ -2529,7 +2755,7 @@ async function yi(e) {
|
|
|
2529
2755
|
onClose: e.onClose
|
|
2530
2756
|
});
|
|
2531
2757
|
}
|
|
2532
|
-
async function
|
|
2758
|
+
async function ba(e, t) {
|
|
2533
2759
|
e.onInitiated();
|
|
2534
2760
|
try {
|
|
2535
2761
|
const n = await fetch(t, {
|
|
@@ -2543,8 +2769,8 @@ async function bi(e, t) {
|
|
|
2543
2769
|
})
|
|
2544
2770
|
});
|
|
2545
2771
|
if (!n.ok) {
|
|
2546
|
-
const
|
|
2547
|
-
return e.onError({ message:
|
|
2772
|
+
const i = (await n.json().catch(() => ({}))).message || "Failed to initiate M-Pesa payment";
|
|
2773
|
+
return e.onError({ message: i }), { status: "failed", message: i };
|
|
2548
2774
|
}
|
|
2549
2775
|
const r = await n.json();
|
|
2550
2776
|
return {
|
|
@@ -2557,28 +2783,28 @@ async function bi(e, t) {
|
|
|
2557
2783
|
return e.onError({ message: r }), { status: "failed", message: r };
|
|
2558
2784
|
}
|
|
2559
2785
|
}
|
|
2560
|
-
var
|
|
2561
|
-
function
|
|
2786
|
+
var ga = /* @__PURE__ */ O('<span class="reevit-spinner"></span>'), wa = /* @__PURE__ */ O('<button type="button" class="reevit-pay-button"><!></button>'), Ea = /* @__PURE__ */ O('<div class="reevit-loading-state"><div class="reevit-spinner reevit-spinner--large"></div> <p>Initializing payment...</p></div>'), Pa = /* @__PURE__ */ O('<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>'), Sa = /* @__PURE__ */ O('<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>'), Ia = /* @__PURE__ */ O('<div class="reevit-method-form-container"><!></div>'), ka = /* @__PURE__ */ O('<span class="reevit-spinner"></span>'), Ca = /* @__PURE__ */ O("<span>Proceed to Card Payment</span>"), Ra = /* @__PURE__ */ O('<div class="reevit-card-info"><p class="reevit-info-text">You will be redirected to our secure payment partner to complete your card payment.</p> <button class="reevit-submit-btn"><!></button></div>'), xa = /* @__PURE__ */ O("<!> <!> <!>", 1), Ma = /* @__PURE__ */ O('<div class="reevit-modal-overlay" role="button" tabindex="0"><div><button class="reevit-modal-close" aria-label="Close">×</button> <div class="reevit-modal-header"><img src="https://i.imgur.com/bzUR5Lm.png" alt="Reevit" class="reevit-modal__logo"/></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>'), Ta = /* @__PURE__ */ O('<div class="reevit-sdk-container"><!> <!></div>');
|
|
2787
|
+
function La(e, t) {
|
|
2562
2788
|
sn(t, !1);
|
|
2563
|
-
const n = () =>
|
|
2564
|
-
let u =
|
|
2565
|
-
const y =
|
|
2789
|
+
const n = () => Wi(y, "$store", r), [r, a] = Gi(), i = /* @__PURE__ */ Ie(), l = /* @__PURE__ */ Ie(), s = en();
|
|
2790
|
+
let u = j(t, "publicKey", 8), o = j(t, "amount", 8), c = j(t, "currency", 8), d = j(t, "email", 8, void 0), p = j(t, "phone", 8, void 0), h = j(t, "reference", 8, void 0), v = j(t, "metadata", 8, void 0), w = j(t, "paymentMethods", 24, () => ["card", "mobile_money"]), g = j(t, "theme", 24, () => ({})), E = j(t, "isOpen", 12, !1), R = j(t, "apiBaseUrl", 8, void 0), I = j(t, "initialPaymentIntent", 8, void 0);
|
|
2791
|
+
const y = Xi({
|
|
2566
2792
|
config: {
|
|
2567
2793
|
publicKey: u(),
|
|
2568
2794
|
amount: o(),
|
|
2569
|
-
currency:
|
|
2570
|
-
email:
|
|
2795
|
+
currency: c(),
|
|
2796
|
+
email: d(),
|
|
2571
2797
|
phone: p(),
|
|
2572
|
-
reference:
|
|
2573
|
-
metadata:
|
|
2574
|
-
paymentMethods:
|
|
2798
|
+
reference: h(),
|
|
2799
|
+
metadata: v(),
|
|
2800
|
+
paymentMethods: w(),
|
|
2575
2801
|
initialPaymentIntent: I()
|
|
2576
2802
|
},
|
|
2577
|
-
apiBaseUrl:
|
|
2578
|
-
onSuccess: (
|
|
2579
|
-
onError: (
|
|
2803
|
+
apiBaseUrl: R(),
|
|
2804
|
+
onSuccess: (N) => s("success", N),
|
|
2805
|
+
onError: (N) => s("error", N),
|
|
2580
2806
|
onClose: () => {
|
|
2581
|
-
E(!1),
|
|
2807
|
+
E(!1), s("close");
|
|
2582
2808
|
}
|
|
2583
2809
|
});
|
|
2584
2810
|
function m() {
|
|
@@ -2587,66 +2813,66 @@ function Fi(e, t) {
|
|
|
2587
2813
|
function k() {
|
|
2588
2814
|
E(!1), y.close();
|
|
2589
2815
|
}
|
|
2590
|
-
async function M(
|
|
2591
|
-
if (!f(
|
|
2592
|
-
const
|
|
2816
|
+
async function M(N) {
|
|
2817
|
+
if (!f(i).paymentIntent) return;
|
|
2818
|
+
const _ = f(i).paymentIntent.recommendedPsp;
|
|
2593
2819
|
try {
|
|
2594
|
-
if (
|
|
2595
|
-
await
|
|
2820
|
+
if (_ === "paystack")
|
|
2821
|
+
await pa({
|
|
2596
2822
|
key: u(),
|
|
2597
|
-
email:
|
|
2823
|
+
email: d() || "",
|
|
2598
2824
|
amount: o(),
|
|
2599
|
-
currency:
|
|
2600
|
-
ref: f(
|
|
2825
|
+
currency: c(),
|
|
2826
|
+
ref: f(i).paymentIntent.id,
|
|
2601
2827
|
onSuccess: (b) => y.handlePspSuccess(b),
|
|
2602
2828
|
onClose: () => {
|
|
2603
2829
|
}
|
|
2604
2830
|
});
|
|
2605
|
-
else if (
|
|
2606
|
-
await
|
|
2831
|
+
else if (_ === "hubtel")
|
|
2832
|
+
await ha({
|
|
2607
2833
|
clientId: u(),
|
|
2608
|
-
purchaseDescription: `Payment for ${o()} ${
|
|
2834
|
+
purchaseDescription: `Payment for ${o()} ${c()}`,
|
|
2609
2835
|
amount: o(),
|
|
2610
|
-
customerPhone:
|
|
2611
|
-
customerEmail:
|
|
2836
|
+
customerPhone: N?.phone || p(),
|
|
2837
|
+
customerEmail: d(),
|
|
2612
2838
|
onSuccess: (b) => y.handlePspSuccess(b),
|
|
2613
2839
|
onClose: () => {
|
|
2614
2840
|
}
|
|
2615
2841
|
});
|
|
2616
|
-
else if (
|
|
2617
|
-
await
|
|
2842
|
+
else if (_ === "flutterwave")
|
|
2843
|
+
await _a({
|
|
2618
2844
|
public_key: u(),
|
|
2619
|
-
tx_ref: f(
|
|
2845
|
+
tx_ref: f(i).paymentIntent.id,
|
|
2620
2846
|
amount: o(),
|
|
2621
|
-
currency:
|
|
2622
|
-
customer: { email:
|
|
2847
|
+
currency: c(),
|
|
2848
|
+
customer: { email: d() || "", phone_number: N?.phone || p() },
|
|
2623
2849
|
callback: (b) => y.handlePspSuccess(b),
|
|
2624
2850
|
onclose: () => {
|
|
2625
2851
|
}
|
|
2626
2852
|
});
|
|
2627
|
-
else if (
|
|
2628
|
-
await
|
|
2629
|
-
apiKey: f(
|
|
2630
|
-
contractCode:
|
|
2853
|
+
else if (_ === "monnify")
|
|
2854
|
+
await ya({
|
|
2855
|
+
apiKey: f(i).paymentIntent.pspPublicKey || u(),
|
|
2856
|
+
contractCode: v()?.contract_code || u(),
|
|
2631
2857
|
amount: o(),
|
|
2632
|
-
currency:
|
|
2633
|
-
reference: f(
|
|
2634
|
-
customerName:
|
|
2635
|
-
customerEmail:
|
|
2636
|
-
customerPhone:
|
|
2637
|
-
metadata:
|
|
2858
|
+
currency: c(),
|
|
2859
|
+
reference: f(i).paymentIntent.reference || f(i).paymentIntent.id,
|
|
2860
|
+
customerName: v()?.customer_name || d() || "",
|
|
2861
|
+
customerEmail: d() || "",
|
|
2862
|
+
customerPhone: N?.phone || p(),
|
|
2863
|
+
metadata: v(),
|
|
2638
2864
|
onSuccess: (b) => y.handlePspSuccess(b),
|
|
2639
2865
|
onClose: () => {
|
|
2640
2866
|
}
|
|
2641
2867
|
});
|
|
2642
|
-
else if (
|
|
2643
|
-
const b = `${
|
|
2644
|
-
await
|
|
2868
|
+
else if (_ === "mpesa") {
|
|
2869
|
+
const b = `${R() || "https://api.reevit.io"}/v1/payments/${f(i).paymentIntent.id}/mpesa`;
|
|
2870
|
+
await ba(
|
|
2645
2871
|
{
|
|
2646
|
-
phoneNumber:
|
|
2872
|
+
phoneNumber: N?.phone || p() || "",
|
|
2647
2873
|
amount: o(),
|
|
2648
|
-
reference: f(
|
|
2649
|
-
description: `Payment ${f(
|
|
2874
|
+
reference: f(i).paymentIntent.reference || f(i).paymentIntent.id,
|
|
2875
|
+
description: `Payment ${f(i).paymentIntent.reference || ""}`,
|
|
2650
2876
|
onInitiated: () => {
|
|
2651
2877
|
},
|
|
2652
2878
|
onSuccess: (D) => y.handlePspSuccess(D),
|
|
@@ -2654,12 +2880,12 @@ function Fi(e, t) {
|
|
|
2654
2880
|
},
|
|
2655
2881
|
b
|
|
2656
2882
|
);
|
|
2657
|
-
} else
|
|
2883
|
+
} else _ === "stripe" ? y.handlePspError({
|
|
2658
2884
|
code: "STRIPE_NOT_IMPLEMENTED",
|
|
2659
2885
|
message: "Stripe integration requires custom Elements setup. Please use the React SDK or implement custom Stripe Elements."
|
|
2660
2886
|
}) : y.handlePspError({
|
|
2661
2887
|
code: "UNSUPPORTED_PSP",
|
|
2662
|
-
message: `Payment provider "${
|
|
2888
|
+
message: `Payment provider "${_}" is not supported in this checkout.`
|
|
2663
2889
|
});
|
|
2664
2890
|
} catch (b) {
|
|
2665
2891
|
y.handlePspError({
|
|
@@ -2668,207 +2894,207 @@ function Fi(e, t) {
|
|
|
2668
2894
|
});
|
|
2669
2895
|
}
|
|
2670
2896
|
}
|
|
2671
|
-
|
|
2897
|
+
wr(() => {
|
|
2672
2898
|
E() && y.initialize();
|
|
2673
2899
|
}), Er(() => {
|
|
2674
2900
|
typeof document < "u" && (document.body.style.overflow = "");
|
|
2675
2901
|
}), qe(() => n(), () => {
|
|
2676
|
-
|
|
2677
|
-
}), qe(() =>
|
|
2678
|
-
|
|
2679
|
-
}), qe(() => (
|
|
2680
|
-
E() && f(
|
|
2681
|
-
}), qe(() => (
|
|
2682
|
-
E() ? (document.body.style.overflow = "hidden", !f(
|
|
2683
|
-
}),
|
|
2684
|
-
var
|
|
2685
|
-
|
|
2686
|
-
|
|
2902
|
+
z(i, n());
|
|
2903
|
+
}), qe(() => B(g()), () => {
|
|
2904
|
+
z(l, xr(g()));
|
|
2905
|
+
}), qe(() => (B(E()), f(i)), () => {
|
|
2906
|
+
E() && f(i).paymentIntent && f(i).selectedMethod && f(i).selectedMethod === "card" && M(null);
|
|
2907
|
+
}), qe(() => (B(E()), f(i)), () => {
|
|
2908
|
+
E() ? (document.body.style.overflow = "hidden", !f(i).paymentIntent && f(i).status === "idle" && y.initialize()) : typeof document < "u" && (document.body.style.overflow = "");
|
|
2909
|
+
}), cn(), pn();
|
|
2910
|
+
var U = Ta(), ce = A(U);
|
|
2911
|
+
Cn(
|
|
2912
|
+
ce,
|
|
2687
2913
|
t,
|
|
2688
2914
|
"default",
|
|
2689
2915
|
{
|
|
2690
2916
|
handleOpen: m,
|
|
2691
2917
|
get isLoading() {
|
|
2692
|
-
return f(
|
|
2918
|
+
return f(i), P(() => f(i).status === "loading");
|
|
2693
2919
|
}
|
|
2694
2920
|
},
|
|
2695
|
-
(
|
|
2696
|
-
var
|
|
2921
|
+
(N) => {
|
|
2922
|
+
var _ = wa(), b = A(_);
|
|
2697
2923
|
{
|
|
2698
2924
|
var D = (F) => {
|
|
2699
|
-
var
|
|
2700
|
-
|
|
2701
|
-
},
|
|
2702
|
-
var
|
|
2703
|
-
|
|
2704
|
-
var Fe =
|
|
2705
|
-
|
|
2706
|
-
}),
|
|
2925
|
+
var ae = ga();
|
|
2926
|
+
T(F, ae);
|
|
2927
|
+
}, fe = (F) => {
|
|
2928
|
+
var ae = vt(), We = Xe(ae);
|
|
2929
|
+
Cn(We, t, "button-text", {}, (W) => {
|
|
2930
|
+
var Fe = Di("Pay Now");
|
|
2931
|
+
T(W, Fe);
|
|
2932
|
+
}), T(F, ae);
|
|
2707
2933
|
};
|
|
2708
2934
|
$(b, (F) => {
|
|
2709
|
-
f(
|
|
2935
|
+
f(i), P(() => f(i).status === "loading") ? F(D) : F(fe, !1);
|
|
2710
2936
|
});
|
|
2711
2937
|
}
|
|
2712
|
-
oe(() =>
|
|
2938
|
+
oe(() => _.disabled = (f(i), P(() => f(i).status === "loading"))), se("click", _, m), T(N, _);
|
|
2713
2939
|
}
|
|
2714
2940
|
);
|
|
2715
|
-
var
|
|
2941
|
+
var ie = L(ce, 2);
|
|
2716
2942
|
{
|
|
2717
|
-
var ct = (
|
|
2718
|
-
var
|
|
2943
|
+
var ct = (N) => {
|
|
2944
|
+
var _ = Ma(), b = A(_), D = A(b), fe = L(D, 4), F = A(fe);
|
|
2719
2945
|
{
|
|
2720
|
-
var
|
|
2721
|
-
var Fe =
|
|
2722
|
-
|
|
2723
|
-
},
|
|
2724
|
-
var Fe =
|
|
2946
|
+
var ae = (W) => {
|
|
2947
|
+
var Fe = Ea();
|
|
2948
|
+
T(W, Fe);
|
|
2949
|
+
}, We = (W) => {
|
|
2950
|
+
var Fe = vt(), vr = Xe(Fe);
|
|
2725
2951
|
{
|
|
2726
2952
|
var pr = (Le) => {
|
|
2727
|
-
var
|
|
2728
|
-
oe(() =>
|
|
2729
|
-
},
|
|
2730
|
-
var
|
|
2953
|
+
var Ge = Pa(), ft = L(A(Ge), 4), Nt = A(ft), Dt = L(ft, 2);
|
|
2954
|
+
oe(() => xe(Nt, (f(i), P(() => f(i).error.message)))), se("click", Dt, () => y.initialize()), T(Le, Ge);
|
|
2955
|
+
}, hr = (Le) => {
|
|
2956
|
+
var Ge = vt(), ft = Xe(Ge);
|
|
2731
2957
|
{
|
|
2732
|
-
var
|
|
2733
|
-
var Ze =
|
|
2734
|
-
se("click", Ft, k),
|
|
2735
|
-
}, Dt = (
|
|
2736
|
-
var Ze =
|
|
2958
|
+
var Nt = (Ue) => {
|
|
2959
|
+
var Ze = Sa(), Ft = L(A(Ze), 6);
|
|
2960
|
+
se("click", Ft, k), T(Ue, Ze);
|
|
2961
|
+
}, Dt = (Ue) => {
|
|
2962
|
+
var Ze = vt(), Ft = Xe(Ze);
|
|
2737
2963
|
{
|
|
2738
|
-
var
|
|
2739
|
-
var
|
|
2740
|
-
|
|
2964
|
+
var _r = (Lt) => {
|
|
2965
|
+
var hn = xa(), _n = Xe(hn);
|
|
2966
|
+
na(_n, {
|
|
2741
2967
|
get methods() {
|
|
2742
|
-
return
|
|
2968
|
+
return w();
|
|
2743
2969
|
},
|
|
2744
2970
|
get selected() {
|
|
2745
|
-
return f(
|
|
2971
|
+
return f(i), P(() => f(i).selectedMethod);
|
|
2746
2972
|
},
|
|
2747
2973
|
get amount() {
|
|
2748
2974
|
return o();
|
|
2749
2975
|
},
|
|
2750
2976
|
get currency() {
|
|
2751
|
-
return
|
|
2977
|
+
return c();
|
|
2752
2978
|
},
|
|
2753
2979
|
$$events: { select: (de) => y.selectMethod(de.detail) }
|
|
2754
2980
|
});
|
|
2755
|
-
var mn = L(
|
|
2981
|
+
var mn = L(_n, 2);
|
|
2756
2982
|
{
|
|
2757
2983
|
var mr = (de) => {
|
|
2758
|
-
var Je =
|
|
2984
|
+
var Je = Ia(), Qe = A(Je);
|
|
2759
2985
|
{
|
|
2760
|
-
let
|
|
2761
|
-
|
|
2986
|
+
let Ut = /* @__PURE__ */ Tt(() => (f(i), P(() => f(i).status === "processing")));
|
|
2987
|
+
la(Qe, {
|
|
2762
2988
|
get initialPhone() {
|
|
2763
2989
|
return p();
|
|
2764
2990
|
},
|
|
2765
2991
|
get loading() {
|
|
2766
|
-
return f(
|
|
2992
|
+
return f(Ut);
|
|
2767
2993
|
},
|
|
2768
|
-
$$events: { submit: (
|
|
2994
|
+
$$events: { submit: (jt) => M(jt.detail) }
|
|
2769
2995
|
});
|
|
2770
2996
|
}
|
|
2771
|
-
|
|
2997
|
+
T(de, Je);
|
|
2772
2998
|
};
|
|
2773
2999
|
$(mn, (de) => {
|
|
2774
|
-
f(
|
|
3000
|
+
f(i), P(() => f(i).status === "method_selected" && f(i).selectedMethod === "mobile_money") && de(mr);
|
|
2775
3001
|
});
|
|
2776
3002
|
}
|
|
2777
3003
|
var yr = L(mn, 2);
|
|
2778
3004
|
{
|
|
2779
3005
|
var br = (de) => {
|
|
2780
|
-
var Je =
|
|
3006
|
+
var Je = Ra(), Qe = L(A(Je), 2), Ut = A(Qe);
|
|
2781
3007
|
{
|
|
2782
|
-
var
|
|
2783
|
-
var
|
|
2784
|
-
|
|
2785
|
-
},
|
|
2786
|
-
var
|
|
2787
|
-
|
|
3008
|
+
var jt = (je) => {
|
|
3009
|
+
var zt = ka();
|
|
3010
|
+
T(je, zt);
|
|
3011
|
+
}, gr = (je) => {
|
|
3012
|
+
var zt = Ca();
|
|
3013
|
+
T(je, zt);
|
|
2788
3014
|
};
|
|
2789
|
-
$(
|
|
2790
|
-
f(
|
|
3015
|
+
$(Ut, (je) => {
|
|
3016
|
+
f(i), P(() => f(i).status === "processing") ? je(jt) : je(gr, !1);
|
|
2791
3017
|
});
|
|
2792
3018
|
}
|
|
2793
|
-
oe(() =>
|
|
3019
|
+
oe(() => Qe.disabled = (f(i), P(() => f(i).status === "processing"))), se("click", Qe, () => M(null)), T(de, Je);
|
|
2794
3020
|
};
|
|
2795
3021
|
$(yr, (de) => {
|
|
2796
|
-
f(
|
|
3022
|
+
f(i), P(() => f(i).status === "method_selected" && f(i).selectedMethod === "card") && de(br);
|
|
2797
3023
|
});
|
|
2798
3024
|
}
|
|
2799
|
-
|
|
3025
|
+
T(Lt, hn);
|
|
2800
3026
|
};
|
|
2801
3027
|
$(
|
|
2802
3028
|
Ft,
|
|
2803
3029
|
(Lt) => {
|
|
2804
|
-
f(
|
|
3030
|
+
f(i), P(() => f(i).status === "ready" || f(i).status === "method_selected") && Lt(_r);
|
|
2805
3031
|
},
|
|
2806
3032
|
!0
|
|
2807
3033
|
);
|
|
2808
3034
|
}
|
|
2809
|
-
|
|
3035
|
+
T(Ue, Ze);
|
|
2810
3036
|
};
|
|
2811
3037
|
$(
|
|
2812
|
-
|
|
2813
|
-
(
|
|
2814
|
-
f(
|
|
3038
|
+
ft,
|
|
3039
|
+
(Ue) => {
|
|
3040
|
+
f(i), P(() => f(i).status === "success") ? Ue(Nt) : Ue(Dt, !1);
|
|
2815
3041
|
},
|
|
2816
3042
|
!0
|
|
2817
3043
|
);
|
|
2818
3044
|
}
|
|
2819
|
-
|
|
3045
|
+
T(Le, Ge);
|
|
2820
3046
|
};
|
|
2821
3047
|
$(
|
|
2822
3048
|
vr,
|
|
2823
3049
|
(Le) => {
|
|
2824
|
-
f(
|
|
3050
|
+
f(i), P(() => f(i).status === "failed" && f(i).error) ? Le(pr) : Le(hr, !1);
|
|
2825
3051
|
},
|
|
2826
3052
|
!0
|
|
2827
3053
|
);
|
|
2828
3054
|
}
|
|
2829
|
-
|
|
3055
|
+
T(W, Fe);
|
|
2830
3056
|
};
|
|
2831
|
-
$(F, (
|
|
2832
|
-
f(
|
|
3057
|
+
$(F, (W) => {
|
|
3058
|
+
f(i), P(() => f(i).status === "loading") ? W(ae) : W(We, !1);
|
|
2833
3059
|
});
|
|
2834
3060
|
}
|
|
2835
|
-
oe((
|
|
2836
|
-
() =>
|
|
2837
|
-
]), se("click", D, k), se("click",
|
|
3061
|
+
oe((W) => kt(b, 1, W), [
|
|
3062
|
+
() => It((B(we), B(g()), P(() => we("reevit-modal-content", g().darkMode && "reevit-modal--dark"))))
|
|
3063
|
+
]), se("click", D, k), se("click", _, Vi(k)), se("keydown", _, (W) => W.key === "Escape" && k()), T(N, _);
|
|
2838
3064
|
};
|
|
2839
|
-
$(
|
|
2840
|
-
E() &&
|
|
3065
|
+
$(ie, (N) => {
|
|
3066
|
+
E() && N(ct);
|
|
2841
3067
|
});
|
|
2842
3068
|
}
|
|
2843
|
-
oe((
|
|
2844
|
-
() => (f(l),
|
|
2845
|
-
]),
|
|
3069
|
+
oe((N) => fr(U, N), [
|
|
3070
|
+
() => (f(l), P(() => Object.entries(f(l)).map(([N, _]) => `${N}:${_}`).join(";")))
|
|
3071
|
+
]), T(e, U), on(), a();
|
|
2846
3072
|
}
|
|
2847
3073
|
export {
|
|
2848
|
-
|
|
2849
|
-
|
|
2850
|
-
|
|
2851
|
-
|
|
2852
|
-
|
|
2853
|
-
|
|
2854
|
-
|
|
2855
|
-
|
|
2856
|
-
|
|
2857
|
-
|
|
2858
|
-
|
|
2859
|
-
|
|
2860
|
-
|
|
2861
|
-
|
|
2862
|
-
|
|
2863
|
-
|
|
2864
|
-
|
|
2865
|
-
|
|
2866
|
-
|
|
2867
|
-
|
|
2868
|
-
|
|
2869
|
-
|
|
2870
|
-
|
|
2871
|
-
|
|
2872
|
-
|
|
2873
|
-
|
|
3074
|
+
la as MobileMoneyForm,
|
|
3075
|
+
na as PaymentMethodSelector,
|
|
3076
|
+
za as ReevitAPIClient,
|
|
3077
|
+
La as ReevitCheckout,
|
|
3078
|
+
Ha as cn,
|
|
3079
|
+
Fa as confirmStripePayment,
|
|
3080
|
+
qa as createInitialState,
|
|
3081
|
+
Ka as createReevitClient,
|
|
3082
|
+
Xi as createReevitStore,
|
|
3083
|
+
ma as createStripeInstance,
|
|
3084
|
+
Va as detectCountryFromCurrency,
|
|
3085
|
+
Ya as detectNetwork,
|
|
3086
|
+
Ba as formatAmount,
|
|
3087
|
+
Wa as formatPhone,
|
|
3088
|
+
ba as initiateMPesaSTKPush,
|
|
3089
|
+
fa as loadFlutterwaveScript,
|
|
3090
|
+
Da as loadHubtelScript,
|
|
3091
|
+
va as loadMonnifyScript,
|
|
3092
|
+
ca as loadPaystackScript,
|
|
3093
|
+
da as loadStripeScript,
|
|
3094
|
+
_a as openFlutterwaveModal,
|
|
3095
|
+
ha as openHubtelPopup,
|
|
3096
|
+
ya as openMonnifyModal,
|
|
3097
|
+
pa as openPaystackPopup,
|
|
3098
|
+
Ga as reevitReducer,
|
|
3099
|
+
Za as validatePhone
|
|
2874
3100
|
};
|