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