@getopenpay/openpay-js 0.1.0 → 0.1.1-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.es.js +727 -738
- package/dist/index.umd.js +11 -12
- package/package.json +2 -2
package/dist/index.es.js
CHANGED
|
@@ -8,31 +8,31 @@ var N;
|
|
|
8
8
|
throw new Error();
|
|
9
9
|
}
|
|
10
10
|
r.assertNever = t, r.arrayToEnum = (s) => {
|
|
11
|
-
const
|
|
11
|
+
const i = {};
|
|
12
12
|
for (const u of s)
|
|
13
|
-
|
|
14
|
-
return
|
|
13
|
+
i[u] = u;
|
|
14
|
+
return i;
|
|
15
15
|
}, r.getValidEnumValues = (s) => {
|
|
16
|
-
const
|
|
17
|
-
for (const l of
|
|
16
|
+
const i = r.objectKeys(s).filter((l) => typeof s[s[l]] != "number"), u = {};
|
|
17
|
+
for (const l of i)
|
|
18
18
|
u[l] = s[l];
|
|
19
19
|
return r.objectValues(u);
|
|
20
|
-
}, r.objectValues = (s) => r.objectKeys(s).map(function(
|
|
21
|
-
return s[
|
|
20
|
+
}, r.objectValues = (s) => r.objectKeys(s).map(function(i) {
|
|
21
|
+
return s[i];
|
|
22
22
|
}), r.objectKeys = typeof Object.keys == "function" ? (s) => Object.keys(s) : (s) => {
|
|
23
|
-
const
|
|
23
|
+
const i = [];
|
|
24
24
|
for (const u in s)
|
|
25
|
-
Object.prototype.hasOwnProperty.call(s, u) &&
|
|
26
|
-
return
|
|
27
|
-
}, r.find = (s,
|
|
25
|
+
Object.prototype.hasOwnProperty.call(s, u) && i.push(u);
|
|
26
|
+
return i;
|
|
27
|
+
}, r.find = (s, i) => {
|
|
28
28
|
for (const u of s)
|
|
29
|
-
if (
|
|
29
|
+
if (i(u))
|
|
30
30
|
return u;
|
|
31
31
|
}, r.isInteger = typeof Number.isInteger == "function" ? (s) => Number.isInteger(s) : (s) => typeof s == "number" && isFinite(s) && Math.floor(s) === s;
|
|
32
|
-
function n(s,
|
|
33
|
-
return s.map((u) => typeof u == "string" ? `'${u}'` : u).join(
|
|
32
|
+
function n(s, i = " | ") {
|
|
33
|
+
return s.map((u) => typeof u == "string" ? `'${u}'` : u).join(i);
|
|
34
34
|
}
|
|
35
|
-
r.joinValues = n, r.jsonStringifyReplacer = (s,
|
|
35
|
+
r.joinValues = n, r.jsonStringifyReplacer = (s, i) => typeof i == "bigint" ? i.toString() : i;
|
|
36
36
|
})(N || (N = {}));
|
|
37
37
|
var cr;
|
|
38
38
|
(function(r) {
|
|
@@ -116,10 +116,10 @@ class pe extends Error {
|
|
|
116
116
|
return this.issues;
|
|
117
117
|
}
|
|
118
118
|
format(e) {
|
|
119
|
-
const t = e || function(
|
|
120
|
-
return
|
|
121
|
-
}, n = { _errors: [] }, s = (
|
|
122
|
-
for (const u of
|
|
119
|
+
const t = e || function(i) {
|
|
120
|
+
return i.message;
|
|
121
|
+
}, n = { _errors: [] }, s = (i) => {
|
|
122
|
+
for (const u of i.issues)
|
|
123
123
|
if (u.code === "invalid_union")
|
|
124
124
|
u.unionErrors.map(s);
|
|
125
125
|
else if (u.code === "invalid_return_type")
|
|
@@ -226,14 +226,14 @@ function Lt() {
|
|
|
226
226
|
return hn;
|
|
227
227
|
}
|
|
228
228
|
const Zt = (r) => {
|
|
229
|
-
const { data: e, path: t, errorMaps: n, issueData: s } = r,
|
|
229
|
+
const { data: e, path: t, errorMaps: n, issueData: s } = r, i = [...t, ...s.path || []], u = {
|
|
230
230
|
...s,
|
|
231
|
-
path:
|
|
231
|
+
path: i
|
|
232
232
|
};
|
|
233
233
|
if (s.message !== void 0)
|
|
234
234
|
return {
|
|
235
235
|
...s,
|
|
236
|
-
path:
|
|
236
|
+
path: i,
|
|
237
237
|
message: s.message
|
|
238
238
|
};
|
|
239
239
|
let l = "";
|
|
@@ -242,7 +242,7 @@ const Zt = (r) => {
|
|
|
242
242
|
l = m(u, { data: e, defaultError: l }).message;
|
|
243
243
|
return {
|
|
244
244
|
...s,
|
|
245
|
-
path:
|
|
245
|
+
path: i,
|
|
246
246
|
message: l
|
|
247
247
|
};
|
|
248
248
|
}, Ka = [];
|
|
@@ -261,7 +261,7 @@ function b(r, e) {
|
|
|
261
261
|
});
|
|
262
262
|
r.common.issues.push(n);
|
|
263
263
|
}
|
|
264
|
-
class
|
|
264
|
+
class oe {
|
|
265
265
|
constructor() {
|
|
266
266
|
this.value = "valid";
|
|
267
267
|
}
|
|
@@ -283,28 +283,28 @@ class ie {
|
|
|
283
283
|
static async mergeObjectAsync(e, t) {
|
|
284
284
|
const n = [];
|
|
285
285
|
for (const s of t) {
|
|
286
|
-
const
|
|
286
|
+
const i = await s.key, u = await s.value;
|
|
287
287
|
n.push({
|
|
288
|
-
key:
|
|
288
|
+
key: i,
|
|
289
289
|
value: u
|
|
290
290
|
});
|
|
291
291
|
}
|
|
292
|
-
return
|
|
292
|
+
return oe.mergeObjectSync(e, n);
|
|
293
293
|
}
|
|
294
294
|
static mergeObjectSync(e, t) {
|
|
295
295
|
const n = {};
|
|
296
296
|
for (const s of t) {
|
|
297
|
-
const { key:
|
|
298
|
-
if (
|
|
297
|
+
const { key: i, value: u } = s;
|
|
298
|
+
if (i.status === "aborted" || u.status === "aborted")
|
|
299
299
|
return x;
|
|
300
|
-
|
|
300
|
+
i.status === "dirty" && e.dirty(), u.status === "dirty" && e.dirty(), i.value !== "__proto__" && (typeof u.value < "u" || s.alwaysSet) && (n[i.value] = u.value);
|
|
301
301
|
}
|
|
302
302
|
return { status: e.value, value: n };
|
|
303
303
|
}
|
|
304
304
|
}
|
|
305
305
|
const x = Object.freeze({
|
|
306
306
|
status: "aborted"
|
|
307
|
-
}), He = (r) => ({ status: "dirty", value: r }), le = (r) => ({ status: "valid", value: r }), ur = (r) => r.status === "aborted", lr = (r) => r.status === "dirty",
|
|
307
|
+
}), He = (r) => ({ status: "dirty", value: r }), le = (r) => ({ status: "valid", value: r }), ur = (r) => r.status === "aborted", lr = (r) => r.status === "dirty", it = (r) => r.status === "valid", ot = (r) => typeof Promise < "u" && r instanceof Promise;
|
|
308
308
|
function Ut(r, e, t, n) {
|
|
309
309
|
if (typeof e == "function" ? r !== e || !n : !e.has(r)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
310
310
|
return e.get(r);
|
|
@@ -327,7 +327,7 @@ class ke {
|
|
|
327
327
|
}
|
|
328
328
|
}
|
|
329
329
|
const rn = (r, e) => {
|
|
330
|
-
if (
|
|
330
|
+
if (it(e))
|
|
331
331
|
return { success: !0, data: e.value };
|
|
332
332
|
if (!r.common.issues.length)
|
|
333
333
|
throw new Error("Validation failed but no issues detected.");
|
|
@@ -375,7 +375,7 @@ class P {
|
|
|
375
375
|
}
|
|
376
376
|
_processInputParams(e) {
|
|
377
377
|
return {
|
|
378
|
-
status: new
|
|
378
|
+
status: new oe(),
|
|
379
379
|
ctx: {
|
|
380
380
|
common: e.parent.common,
|
|
381
381
|
data: e.data,
|
|
@@ -388,7 +388,7 @@ class P {
|
|
|
388
388
|
}
|
|
389
389
|
_parseSync(e) {
|
|
390
390
|
const t = this._parse(e);
|
|
391
|
-
if (
|
|
391
|
+
if (ot(t))
|
|
392
392
|
throw new Error("Synchronous parse encountered promise.");
|
|
393
393
|
return t;
|
|
394
394
|
}
|
|
@@ -415,8 +415,8 @@ class P {
|
|
|
415
415
|
parent: null,
|
|
416
416
|
data: e,
|
|
417
417
|
parsedType: Oe(e)
|
|
418
|
-
},
|
|
419
|
-
return rn(s,
|
|
418
|
+
}, i = this._parseSync({ data: e, path: s.path, parent: s });
|
|
419
|
+
return rn(s, i);
|
|
420
420
|
}
|
|
421
421
|
async parseAsync(e, t) {
|
|
422
422
|
const n = await this.safeParseAsync(e, t);
|
|
@@ -436,13 +436,13 @@ class P {
|
|
|
436
436
|
parent: null,
|
|
437
437
|
data: e,
|
|
438
438
|
parsedType: Oe(e)
|
|
439
|
-
}, s = this._parse({ data: e, path: n.path, parent: n }),
|
|
440
|
-
return rn(n,
|
|
439
|
+
}, s = this._parse({ data: e, path: n.path, parent: n }), i = await (ot(s) ? s : Promise.resolve(s));
|
|
440
|
+
return rn(n, i);
|
|
441
441
|
}
|
|
442
442
|
refine(e, t) {
|
|
443
443
|
const n = (s) => typeof t == "string" || typeof t > "u" ? { message: t } : typeof t == "function" ? t(s) : t;
|
|
444
|
-
return this._refinement((s,
|
|
445
|
-
const u = e(s), l = () =>
|
|
444
|
+
return this._refinement((s, i) => {
|
|
445
|
+
const u = e(s), l = () => i.addIssue({
|
|
446
446
|
code: y.custom,
|
|
447
447
|
...n(s)
|
|
448
448
|
});
|
|
@@ -475,7 +475,7 @@ class P {
|
|
|
475
475
|
return _e.create(this, this._def);
|
|
476
476
|
}
|
|
477
477
|
promise() {
|
|
478
|
-
return
|
|
478
|
+
return Je.create(this, this._def);
|
|
479
479
|
}
|
|
480
480
|
or(e) {
|
|
481
481
|
return dt.create([this, e], this._def);
|
|
@@ -536,9 +536,9 @@ class P {
|
|
|
536
536
|
return this.safeParse(null).success;
|
|
537
537
|
}
|
|
538
538
|
}
|
|
539
|
-
const
|
|
540
|
-
let
|
|
541
|
-
const as = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/, ss = /^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,
|
|
539
|
+
const Ga = /^c[^\s-]{8,}$/i, Ja = /^[0-9a-z]+$/, Qa = /^[0-9A-HJKMNP-TV-Z]{26}$/, Xa = /^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i, es = /^[a-z0-9_-]{21}$/i, ts = /^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/, rs = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, ns = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
|
|
540
|
+
let ir;
|
|
541
|
+
const as = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/, ss = /^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/, is = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, mn = "((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))", os = new RegExp(`^${mn}$`);
|
|
542
542
|
function yn(r) {
|
|
543
543
|
let e = "([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";
|
|
544
544
|
return r.precision ? e = `${e}\\.\\d{${r.precision}}` : r.precision == null && (e = `${e}(\\.\\d+)?`), e;
|
|
@@ -557,144 +557,144 @@ function us(r, e) {
|
|
|
557
557
|
class ge extends P {
|
|
558
558
|
_parse(e) {
|
|
559
559
|
if (this._def.coerce && (e.data = String(e.data)), this._getType(e) !== E.string) {
|
|
560
|
-
const
|
|
561
|
-
return b(
|
|
560
|
+
const i = this._getOrReturnCtx(e);
|
|
561
|
+
return b(i, {
|
|
562
562
|
code: y.invalid_type,
|
|
563
563
|
expected: E.string,
|
|
564
|
-
received:
|
|
564
|
+
received: i.parsedType
|
|
565
565
|
}), x;
|
|
566
566
|
}
|
|
567
|
-
const n = new
|
|
567
|
+
const n = new oe();
|
|
568
568
|
let s;
|
|
569
|
-
for (const
|
|
570
|
-
if (
|
|
571
|
-
e.data.length <
|
|
569
|
+
for (const i of this._def.checks)
|
|
570
|
+
if (i.kind === "min")
|
|
571
|
+
e.data.length < i.value && (s = this._getOrReturnCtx(e, s), b(s, {
|
|
572
572
|
code: y.too_small,
|
|
573
|
-
minimum:
|
|
573
|
+
minimum: i.value,
|
|
574
574
|
type: "string",
|
|
575
575
|
inclusive: !0,
|
|
576
576
|
exact: !1,
|
|
577
|
-
message:
|
|
577
|
+
message: i.message
|
|
578
578
|
}), n.dirty());
|
|
579
|
-
else if (
|
|
580
|
-
e.data.length >
|
|
579
|
+
else if (i.kind === "max")
|
|
580
|
+
e.data.length > i.value && (s = this._getOrReturnCtx(e, s), b(s, {
|
|
581
581
|
code: y.too_big,
|
|
582
|
-
maximum:
|
|
582
|
+
maximum: i.value,
|
|
583
583
|
type: "string",
|
|
584
584
|
inclusive: !0,
|
|
585
585
|
exact: !1,
|
|
586
|
-
message:
|
|
586
|
+
message: i.message
|
|
587
587
|
}), n.dirty());
|
|
588
|
-
else if (
|
|
589
|
-
const u = e.data.length >
|
|
588
|
+
else if (i.kind === "length") {
|
|
589
|
+
const u = e.data.length > i.value, l = e.data.length < i.value;
|
|
590
590
|
(u || l) && (s = this._getOrReturnCtx(e, s), u ? b(s, {
|
|
591
591
|
code: y.too_big,
|
|
592
|
-
maximum:
|
|
592
|
+
maximum: i.value,
|
|
593
593
|
type: "string",
|
|
594
594
|
inclusive: !0,
|
|
595
595
|
exact: !0,
|
|
596
|
-
message:
|
|
596
|
+
message: i.message
|
|
597
597
|
}) : l && b(s, {
|
|
598
598
|
code: y.too_small,
|
|
599
|
-
minimum:
|
|
599
|
+
minimum: i.value,
|
|
600
600
|
type: "string",
|
|
601
601
|
inclusive: !0,
|
|
602
602
|
exact: !0,
|
|
603
|
-
message:
|
|
603
|
+
message: i.message
|
|
604
604
|
}), n.dirty());
|
|
605
|
-
} else if (
|
|
605
|
+
} else if (i.kind === "email")
|
|
606
606
|
rs.test(e.data) || (s = this._getOrReturnCtx(e, s), b(s, {
|
|
607
607
|
validation: "email",
|
|
608
608
|
code: y.invalid_string,
|
|
609
|
-
message:
|
|
609
|
+
message: i.message
|
|
610
610
|
}), n.dirty());
|
|
611
|
-
else if (
|
|
612
|
-
|
|
611
|
+
else if (i.kind === "emoji")
|
|
612
|
+
ir || (ir = new RegExp(ns, "u")), ir.test(e.data) || (s = this._getOrReturnCtx(e, s), b(s, {
|
|
613
613
|
validation: "emoji",
|
|
614
614
|
code: y.invalid_string,
|
|
615
|
-
message:
|
|
615
|
+
message: i.message
|
|
616
616
|
}), n.dirty());
|
|
617
|
-
else if (
|
|
617
|
+
else if (i.kind === "uuid")
|
|
618
618
|
Xa.test(e.data) || (s = this._getOrReturnCtx(e, s), b(s, {
|
|
619
619
|
validation: "uuid",
|
|
620
620
|
code: y.invalid_string,
|
|
621
|
-
message:
|
|
621
|
+
message: i.message
|
|
622
622
|
}), n.dirty());
|
|
623
|
-
else if (
|
|
623
|
+
else if (i.kind === "nanoid")
|
|
624
624
|
es.test(e.data) || (s = this._getOrReturnCtx(e, s), b(s, {
|
|
625
625
|
validation: "nanoid",
|
|
626
626
|
code: y.invalid_string,
|
|
627
|
-
message:
|
|
627
|
+
message: i.message
|
|
628
628
|
}), n.dirty());
|
|
629
|
-
else if (
|
|
630
|
-
|
|
629
|
+
else if (i.kind === "cuid")
|
|
630
|
+
Ga.test(e.data) || (s = this._getOrReturnCtx(e, s), b(s, {
|
|
631
631
|
validation: "cuid",
|
|
632
632
|
code: y.invalid_string,
|
|
633
|
-
message:
|
|
633
|
+
message: i.message
|
|
634
634
|
}), n.dirty());
|
|
635
|
-
else if (
|
|
636
|
-
|
|
635
|
+
else if (i.kind === "cuid2")
|
|
636
|
+
Ja.test(e.data) || (s = this._getOrReturnCtx(e, s), b(s, {
|
|
637
637
|
validation: "cuid2",
|
|
638
638
|
code: y.invalid_string,
|
|
639
|
-
message:
|
|
639
|
+
message: i.message
|
|
640
640
|
}), n.dirty());
|
|
641
|
-
else if (
|
|
641
|
+
else if (i.kind === "ulid")
|
|
642
642
|
Qa.test(e.data) || (s = this._getOrReturnCtx(e, s), b(s, {
|
|
643
643
|
validation: "ulid",
|
|
644
644
|
code: y.invalid_string,
|
|
645
|
-
message:
|
|
645
|
+
message: i.message
|
|
646
646
|
}), n.dirty());
|
|
647
|
-
else if (
|
|
647
|
+
else if (i.kind === "url")
|
|
648
648
|
try {
|
|
649
649
|
new URL(e.data);
|
|
650
650
|
} catch {
|
|
651
651
|
s = this._getOrReturnCtx(e, s), b(s, {
|
|
652
652
|
validation: "url",
|
|
653
653
|
code: y.invalid_string,
|
|
654
|
-
message:
|
|
654
|
+
message: i.message
|
|
655
655
|
}), n.dirty();
|
|
656
656
|
}
|
|
657
|
-
else
|
|
657
|
+
else i.kind === "regex" ? (i.regex.lastIndex = 0, i.regex.test(e.data) || (s = this._getOrReturnCtx(e, s), b(s, {
|
|
658
658
|
validation: "regex",
|
|
659
659
|
code: y.invalid_string,
|
|
660
|
-
message:
|
|
661
|
-
}), n.dirty())) :
|
|
660
|
+
message: i.message
|
|
661
|
+
}), n.dirty())) : i.kind === "trim" ? e.data = e.data.trim() : i.kind === "includes" ? e.data.includes(i.value, i.position) || (s = this._getOrReturnCtx(e, s), b(s, {
|
|
662
662
|
code: y.invalid_string,
|
|
663
|
-
validation: { includes:
|
|
664
|
-
message:
|
|
665
|
-
}), n.dirty()) :
|
|
663
|
+
validation: { includes: i.value, position: i.position },
|
|
664
|
+
message: i.message
|
|
665
|
+
}), n.dirty()) : i.kind === "toLowerCase" ? e.data = e.data.toLowerCase() : i.kind === "toUpperCase" ? e.data = e.data.toUpperCase() : i.kind === "startsWith" ? e.data.startsWith(i.value) || (s = this._getOrReturnCtx(e, s), b(s, {
|
|
666
666
|
code: y.invalid_string,
|
|
667
|
-
validation: { startsWith:
|
|
668
|
-
message:
|
|
669
|
-
}), n.dirty()) :
|
|
667
|
+
validation: { startsWith: i.value },
|
|
668
|
+
message: i.message
|
|
669
|
+
}), n.dirty()) : i.kind === "endsWith" ? e.data.endsWith(i.value) || (s = this._getOrReturnCtx(e, s), b(s, {
|
|
670
670
|
code: y.invalid_string,
|
|
671
|
-
validation: { endsWith:
|
|
672
|
-
message:
|
|
673
|
-
}), n.dirty()) :
|
|
671
|
+
validation: { endsWith: i.value },
|
|
672
|
+
message: i.message
|
|
673
|
+
}), n.dirty()) : i.kind === "datetime" ? vn(i).test(e.data) || (s = this._getOrReturnCtx(e, s), b(s, {
|
|
674
674
|
code: y.invalid_string,
|
|
675
675
|
validation: "datetime",
|
|
676
|
-
message:
|
|
677
|
-
}), n.dirty()) :
|
|
676
|
+
message: i.message
|
|
677
|
+
}), n.dirty()) : i.kind === "date" ? os.test(e.data) || (s = this._getOrReturnCtx(e, s), b(s, {
|
|
678
678
|
code: y.invalid_string,
|
|
679
679
|
validation: "date",
|
|
680
|
-
message:
|
|
681
|
-
}), n.dirty()) :
|
|
680
|
+
message: i.message
|
|
681
|
+
}), n.dirty()) : i.kind === "time" ? cs(i).test(e.data) || (s = this._getOrReturnCtx(e, s), b(s, {
|
|
682
682
|
code: y.invalid_string,
|
|
683
683
|
validation: "time",
|
|
684
|
-
message:
|
|
685
|
-
}), n.dirty()) :
|
|
684
|
+
message: i.message
|
|
685
|
+
}), n.dirty()) : i.kind === "duration" ? ts.test(e.data) || (s = this._getOrReturnCtx(e, s), b(s, {
|
|
686
686
|
validation: "duration",
|
|
687
687
|
code: y.invalid_string,
|
|
688
|
-
message:
|
|
689
|
-
}), n.dirty()) :
|
|
688
|
+
message: i.message
|
|
689
|
+
}), n.dirty()) : i.kind === "ip" ? us(e.data, i.version) || (s = this._getOrReturnCtx(e, s), b(s, {
|
|
690
690
|
validation: "ip",
|
|
691
691
|
code: y.invalid_string,
|
|
692
|
-
message:
|
|
693
|
-
}), n.dirty()) :
|
|
692
|
+
message: i.message
|
|
693
|
+
}), n.dirty()) : i.kind === "base64" ? is.test(e.data) || (s = this._getOrReturnCtx(e, s), b(s, {
|
|
694
694
|
validation: "base64",
|
|
695
695
|
code: y.invalid_string,
|
|
696
|
-
message:
|
|
697
|
-
}), n.dirty()) : N.assertNever(
|
|
696
|
+
message: i.message
|
|
697
|
+
}), n.dirty()) : N.assertNever(i);
|
|
698
698
|
return { status: n.value, value: e.data };
|
|
699
699
|
}
|
|
700
700
|
_regex(e, t, n) {
|
|
@@ -913,8 +913,8 @@ ge.create = (r) => {
|
|
|
913
913
|
});
|
|
914
914
|
};
|
|
915
915
|
function ls(r, e) {
|
|
916
|
-
const t = (r.toString().split(".")[1] || "").length, n = (e.toString().split(".")[1] || "").length, s = t > n ? t : n,
|
|
917
|
-
return
|
|
916
|
+
const t = (r.toString().split(".")[1] || "").length, n = (e.toString().split(".")[1] || "").length, s = t > n ? t : n, i = parseInt(r.toFixed(s).replace(".", "")), u = parseInt(e.toFixed(s).replace(".", ""));
|
|
917
|
+
return i % u / Math.pow(10, s);
|
|
918
918
|
}
|
|
919
919
|
class Ie extends P {
|
|
920
920
|
constructor() {
|
|
@@ -922,43 +922,43 @@ class Ie extends P {
|
|
|
922
922
|
}
|
|
923
923
|
_parse(e) {
|
|
924
924
|
if (this._def.coerce && (e.data = Number(e.data)), this._getType(e) !== E.number) {
|
|
925
|
-
const
|
|
926
|
-
return b(
|
|
925
|
+
const i = this._getOrReturnCtx(e);
|
|
926
|
+
return b(i, {
|
|
927
927
|
code: y.invalid_type,
|
|
928
928
|
expected: E.number,
|
|
929
|
-
received:
|
|
929
|
+
received: i.parsedType
|
|
930
930
|
}), x;
|
|
931
931
|
}
|
|
932
932
|
let n;
|
|
933
|
-
const s = new
|
|
934
|
-
for (const
|
|
935
|
-
|
|
933
|
+
const s = new oe();
|
|
934
|
+
for (const i of this._def.checks)
|
|
935
|
+
i.kind === "int" ? N.isInteger(e.data) || (n = this._getOrReturnCtx(e, n), b(n, {
|
|
936
936
|
code: y.invalid_type,
|
|
937
937
|
expected: "integer",
|
|
938
938
|
received: "float",
|
|
939
|
-
message:
|
|
940
|
-
}), s.dirty()) :
|
|
939
|
+
message: i.message
|
|
940
|
+
}), s.dirty()) : i.kind === "min" ? (i.inclusive ? e.data < i.value : e.data <= i.value) && (n = this._getOrReturnCtx(e, n), b(n, {
|
|
941
941
|
code: y.too_small,
|
|
942
|
-
minimum:
|
|
942
|
+
minimum: i.value,
|
|
943
943
|
type: "number",
|
|
944
|
-
inclusive:
|
|
944
|
+
inclusive: i.inclusive,
|
|
945
945
|
exact: !1,
|
|
946
|
-
message:
|
|
947
|
-
}), s.dirty()) :
|
|
946
|
+
message: i.message
|
|
947
|
+
}), s.dirty()) : i.kind === "max" ? (i.inclusive ? e.data > i.value : e.data >= i.value) && (n = this._getOrReturnCtx(e, n), b(n, {
|
|
948
948
|
code: y.too_big,
|
|
949
|
-
maximum:
|
|
949
|
+
maximum: i.value,
|
|
950
950
|
type: "number",
|
|
951
|
-
inclusive:
|
|
951
|
+
inclusive: i.inclusive,
|
|
952
952
|
exact: !1,
|
|
953
|
-
message:
|
|
954
|
-
}), s.dirty()) :
|
|
953
|
+
message: i.message
|
|
954
|
+
}), s.dirty()) : i.kind === "multipleOf" ? ls(e.data, i.value) !== 0 && (n = this._getOrReturnCtx(e, n), b(n, {
|
|
955
955
|
code: y.not_multiple_of,
|
|
956
|
-
multipleOf:
|
|
957
|
-
message:
|
|
958
|
-
}), s.dirty()) :
|
|
956
|
+
multipleOf: i.value,
|
|
957
|
+
message: i.message
|
|
958
|
+
}), s.dirty()) : i.kind === "finite" ? Number.isFinite(e.data) || (n = this._getOrReturnCtx(e, n), b(n, {
|
|
959
959
|
code: y.not_finite,
|
|
960
|
-
message:
|
|
961
|
-
}), s.dirty()) : N.assertNever(
|
|
960
|
+
message: i.message
|
|
961
|
+
}), s.dirty()) : N.assertNever(i);
|
|
962
962
|
return { status: s.value, value: e.data };
|
|
963
963
|
}
|
|
964
964
|
gte(e, t) {
|
|
@@ -1094,33 +1094,33 @@ class Pe extends P {
|
|
|
1094
1094
|
}
|
|
1095
1095
|
_parse(e) {
|
|
1096
1096
|
if (this._def.coerce && (e.data = BigInt(e.data)), this._getType(e) !== E.bigint) {
|
|
1097
|
-
const
|
|
1098
|
-
return b(
|
|
1097
|
+
const i = this._getOrReturnCtx(e);
|
|
1098
|
+
return b(i, {
|
|
1099
1099
|
code: y.invalid_type,
|
|
1100
1100
|
expected: E.bigint,
|
|
1101
|
-
received:
|
|
1101
|
+
received: i.parsedType
|
|
1102
1102
|
}), x;
|
|
1103
1103
|
}
|
|
1104
1104
|
let n;
|
|
1105
|
-
const s = new
|
|
1106
|
-
for (const
|
|
1107
|
-
|
|
1105
|
+
const s = new oe();
|
|
1106
|
+
for (const i of this._def.checks)
|
|
1107
|
+
i.kind === "min" ? (i.inclusive ? e.data < i.value : e.data <= i.value) && (n = this._getOrReturnCtx(e, n), b(n, {
|
|
1108
1108
|
code: y.too_small,
|
|
1109
1109
|
type: "bigint",
|
|
1110
|
-
minimum:
|
|
1111
|
-
inclusive:
|
|
1112
|
-
message:
|
|
1113
|
-
}), s.dirty()) :
|
|
1110
|
+
minimum: i.value,
|
|
1111
|
+
inclusive: i.inclusive,
|
|
1112
|
+
message: i.message
|
|
1113
|
+
}), s.dirty()) : i.kind === "max" ? (i.inclusive ? e.data > i.value : e.data >= i.value) && (n = this._getOrReturnCtx(e, n), b(n, {
|
|
1114
1114
|
code: y.too_big,
|
|
1115
1115
|
type: "bigint",
|
|
1116
|
-
maximum:
|
|
1117
|
-
inclusive:
|
|
1118
|
-
message:
|
|
1119
|
-
}), s.dirty()) :
|
|
1116
|
+
maximum: i.value,
|
|
1117
|
+
inclusive: i.inclusive,
|
|
1118
|
+
message: i.message
|
|
1119
|
+
}), s.dirty()) : i.kind === "multipleOf" ? e.data % i.value !== BigInt(0) && (n = this._getOrReturnCtx(e, n), b(n, {
|
|
1120
1120
|
code: y.not_multiple_of,
|
|
1121
|
-
multipleOf:
|
|
1122
|
-
message:
|
|
1123
|
-
}), s.dirty()) : N.assertNever(
|
|
1121
|
+
multipleOf: i.value,
|
|
1122
|
+
message: i.message
|
|
1123
|
+
}), s.dirty()) : N.assertNever(i);
|
|
1124
1124
|
return { status: s.value, value: e.data };
|
|
1125
1125
|
}
|
|
1126
1126
|
gte(e, t) {
|
|
@@ -1237,37 +1237,37 @@ ct.create = (r) => new ct({
|
|
|
1237
1237
|
class Ze extends P {
|
|
1238
1238
|
_parse(e) {
|
|
1239
1239
|
if (this._def.coerce && (e.data = new Date(e.data)), this._getType(e) !== E.date) {
|
|
1240
|
-
const
|
|
1241
|
-
return b(
|
|
1240
|
+
const i = this._getOrReturnCtx(e);
|
|
1241
|
+
return b(i, {
|
|
1242
1242
|
code: y.invalid_type,
|
|
1243
1243
|
expected: E.date,
|
|
1244
|
-
received:
|
|
1244
|
+
received: i.parsedType
|
|
1245
1245
|
}), x;
|
|
1246
1246
|
}
|
|
1247
1247
|
if (isNaN(e.data.getTime())) {
|
|
1248
|
-
const
|
|
1249
|
-
return b(
|
|
1248
|
+
const i = this._getOrReturnCtx(e);
|
|
1249
|
+
return b(i, {
|
|
1250
1250
|
code: y.invalid_date
|
|
1251
1251
|
}), x;
|
|
1252
1252
|
}
|
|
1253
|
-
const n = new
|
|
1253
|
+
const n = new oe();
|
|
1254
1254
|
let s;
|
|
1255
|
-
for (const
|
|
1256
|
-
|
|
1255
|
+
for (const i of this._def.checks)
|
|
1256
|
+
i.kind === "min" ? e.data.getTime() < i.value && (s = this._getOrReturnCtx(e, s), b(s, {
|
|
1257
1257
|
code: y.too_small,
|
|
1258
|
-
message:
|
|
1258
|
+
message: i.message,
|
|
1259
1259
|
inclusive: !0,
|
|
1260
1260
|
exact: !1,
|
|
1261
|
-
minimum:
|
|
1261
|
+
minimum: i.value,
|
|
1262
1262
|
type: "date"
|
|
1263
|
-
}), n.dirty()) :
|
|
1263
|
+
}), n.dirty()) : i.kind === "max" ? e.data.getTime() > i.value && (s = this._getOrReturnCtx(e, s), b(s, {
|
|
1264
1264
|
code: y.too_big,
|
|
1265
|
-
message:
|
|
1265
|
+
message: i.message,
|
|
1266
1266
|
inclusive: !0,
|
|
1267
1267
|
exact: !1,
|
|
1268
|
-
maximum:
|
|
1268
|
+
maximum: i.value,
|
|
1269
1269
|
type: "date"
|
|
1270
|
-
}), n.dirty()) : N.assertNever(
|
|
1270
|
+
}), n.dirty()) : N.assertNever(i);
|
|
1271
1271
|
return {
|
|
1272
1272
|
status: n.value,
|
|
1273
1273
|
value: new Date(e.data.getTime())
|
|
@@ -1363,7 +1363,7 @@ lt.create = (r) => new lt({
|
|
|
1363
1363
|
typeName: C.ZodNull,
|
|
1364
1364
|
...I(r)
|
|
1365
1365
|
});
|
|
1366
|
-
class
|
|
1366
|
+
class Ge extends P {
|
|
1367
1367
|
constructor() {
|
|
1368
1368
|
super(...arguments), this._any = !0;
|
|
1369
1369
|
}
|
|
@@ -1371,7 +1371,7 @@ class Je extends P {
|
|
|
1371
1371
|
return le(e.data);
|
|
1372
1372
|
}
|
|
1373
1373
|
}
|
|
1374
|
-
|
|
1374
|
+
Ge.create = (r) => new Ge({
|
|
1375
1375
|
typeName: C.ZodAny,
|
|
1376
1376
|
...I(r)
|
|
1377
1377
|
});
|
|
@@ -1454,9 +1454,9 @@ class _e extends P {
|
|
|
1454
1454
|
exact: !1,
|
|
1455
1455
|
message: s.maxLength.message
|
|
1456
1456
|
}), n.dirty()), t.common.async)
|
|
1457
|
-
return Promise.all([...t.data].map((u, l) => s.type._parseAsync(new ke(t, u, t.path, l)))).then((u) =>
|
|
1458
|
-
const
|
|
1459
|
-
return
|
|
1457
|
+
return Promise.all([...t.data].map((u, l) => s.type._parseAsync(new ke(t, u, t.path, l)))).then((u) => oe.mergeArray(n, u));
|
|
1458
|
+
const i = [...t.data].map((u, l) => s.type._parseSync(new ke(t, u, t.path, l)));
|
|
1459
|
+
return oe.mergeArray(n, i);
|
|
1460
1460
|
}
|
|
1461
1461
|
get element() {
|
|
1462
1462
|
return this._def.type;
|
|
@@ -1526,13 +1526,13 @@ class K extends P {
|
|
|
1526
1526
|
received: m.parsedType
|
|
1527
1527
|
}), x;
|
|
1528
1528
|
}
|
|
1529
|
-
const { status: n, ctx: s } = this._processInputParams(e), { shape:
|
|
1529
|
+
const { status: n, ctx: s } = this._processInputParams(e), { shape: i, keys: u } = this._getCached(), l = [];
|
|
1530
1530
|
if (!(this._def.catchall instanceof Se && this._def.unknownKeys === "strip"))
|
|
1531
1531
|
for (const m in s.data)
|
|
1532
1532
|
u.includes(m) || l.push(m);
|
|
1533
1533
|
const p = [];
|
|
1534
1534
|
for (const m of u) {
|
|
1535
|
-
const _ =
|
|
1535
|
+
const _ = i[m], O = s.data[m];
|
|
1536
1536
|
p.push({
|
|
1537
1537
|
key: { status: "valid", value: m },
|
|
1538
1538
|
value: _._parse(new ke(s, O, s.path, m)),
|
|
@@ -1578,7 +1578,7 @@ class K extends P {
|
|
|
1578
1578
|
});
|
|
1579
1579
|
}
|
|
1580
1580
|
return m;
|
|
1581
|
-
}).then((m) =>
|
|
1581
|
+
}).then((m) => oe.mergeObjectSync(n, m)) : oe.mergeObjectSync(n, p);
|
|
1582
1582
|
}
|
|
1583
1583
|
get shape() {
|
|
1584
1584
|
return this._def.shape();
|
|
@@ -1589,8 +1589,8 @@ class K extends P {
|
|
|
1589
1589
|
unknownKeys: "strict",
|
|
1590
1590
|
...e !== void 0 ? {
|
|
1591
1591
|
errorMap: (t, n) => {
|
|
1592
|
-
var s,
|
|
1593
|
-
const p = (u = (
|
|
1592
|
+
var s, i, u, l;
|
|
1593
|
+
const p = (u = (i = (s = this._def).errorMap) === null || i === void 0 ? void 0 : i.call(s, t, n).message) !== null && u !== void 0 ? u : n.defaultError;
|
|
1594
1594
|
return t.code === "unrecognized_keys" ? {
|
|
1595
1595
|
message: (l = k.errToObj(e).message) !== null && l !== void 0 ? l : p
|
|
1596
1596
|
} : {
|
|
@@ -1759,10 +1759,10 @@ class K extends P {
|
|
|
1759
1759
|
if (e && !e[n])
|
|
1760
1760
|
t[n] = this.shape[n];
|
|
1761
1761
|
else {
|
|
1762
|
-
let
|
|
1763
|
-
for (;
|
|
1764
|
-
|
|
1765
|
-
t[n] =
|
|
1762
|
+
let i = this.shape[n];
|
|
1763
|
+
for (; i instanceof Ee; )
|
|
1764
|
+
i = i._def.innerType;
|
|
1765
|
+
t[n] = i;
|
|
1766
1766
|
}
|
|
1767
1767
|
}), new K({
|
|
1768
1768
|
...this._def,
|
|
@@ -1797,21 +1797,21 @@ K.lazycreate = (r, e) => new K({
|
|
|
1797
1797
|
class dt extends P {
|
|
1798
1798
|
_parse(e) {
|
|
1799
1799
|
const { ctx: t } = this._processInputParams(e), n = this._def.options;
|
|
1800
|
-
function s(
|
|
1801
|
-
for (const l of
|
|
1800
|
+
function s(i) {
|
|
1801
|
+
for (const l of i)
|
|
1802
1802
|
if (l.result.status === "valid")
|
|
1803
1803
|
return l.result;
|
|
1804
|
-
for (const l of
|
|
1804
|
+
for (const l of i)
|
|
1805
1805
|
if (l.result.status === "dirty")
|
|
1806
1806
|
return t.common.issues.push(...l.ctx.common.issues), l.result;
|
|
1807
|
-
const u =
|
|
1807
|
+
const u = i.map((l) => new pe(l.ctx.common.issues));
|
|
1808
1808
|
return b(t, {
|
|
1809
1809
|
code: y.invalid_union,
|
|
1810
1810
|
unionErrors: u
|
|
1811
1811
|
}), x;
|
|
1812
1812
|
}
|
|
1813
1813
|
if (t.common.async)
|
|
1814
|
-
return Promise.all(n.map(async (
|
|
1814
|
+
return Promise.all(n.map(async (i) => {
|
|
1815
1815
|
const u = {
|
|
1816
1816
|
...t,
|
|
1817
1817
|
common: {
|
|
@@ -1821,7 +1821,7 @@ class dt extends P {
|
|
|
1821
1821
|
parent: null
|
|
1822
1822
|
};
|
|
1823
1823
|
return {
|
|
1824
|
-
result: await
|
|
1824
|
+
result: await i._parseAsync({
|
|
1825
1825
|
data: t.data,
|
|
1826
1826
|
path: t.path,
|
|
1827
1827
|
parent: u
|
|
@@ -1830,7 +1830,7 @@ class dt extends P {
|
|
|
1830
1830
|
};
|
|
1831
1831
|
})).then(s);
|
|
1832
1832
|
{
|
|
1833
|
-
let
|
|
1833
|
+
let i;
|
|
1834
1834
|
const u = [];
|
|
1835
1835
|
for (const p of n) {
|
|
1836
1836
|
const m = {
|
|
@@ -1847,10 +1847,10 @@ class dt extends P {
|
|
|
1847
1847
|
});
|
|
1848
1848
|
if (_.status === "valid")
|
|
1849
1849
|
return _;
|
|
1850
|
-
_.status === "dirty" && !
|
|
1850
|
+
_.status === "dirty" && !i && (i = { result: _, ctx: m }), m.common.issues.length && u.push(m.common.issues);
|
|
1851
1851
|
}
|
|
1852
|
-
if (
|
|
1853
|
-
return t.common.issues.push(...
|
|
1852
|
+
if (i)
|
|
1853
|
+
return t.common.issues.push(...i.ctx.common.issues), i.result;
|
|
1854
1854
|
const l = u.map((p) => new pe(p));
|
|
1855
1855
|
return b(t, {
|
|
1856
1856
|
code: y.invalid_union,
|
|
@@ -1877,12 +1877,12 @@ class Bt extends P {
|
|
|
1877
1877
|
expected: E.object,
|
|
1878
1878
|
received: t.parsedType
|
|
1879
1879
|
}), x;
|
|
1880
|
-
const n = this.discriminator, s = t.data[n],
|
|
1881
|
-
return
|
|
1880
|
+
const n = this.discriminator, s = t.data[n], i = this.optionsMap.get(s);
|
|
1881
|
+
return i ? t.common.async ? i._parseAsync({
|
|
1882
1882
|
data: t.data,
|
|
1883
1883
|
path: t.path,
|
|
1884
1884
|
parent: t
|
|
1885
|
-
}) :
|
|
1885
|
+
}) : i._parseSync({
|
|
1886
1886
|
data: t.data,
|
|
1887
1887
|
path: t.path,
|
|
1888
1888
|
parent: t
|
|
@@ -1911,14 +1911,14 @@ class Bt extends P {
|
|
|
1911
1911
|
*/
|
|
1912
1912
|
static create(e, t, n) {
|
|
1913
1913
|
const s = /* @__PURE__ */ new Map();
|
|
1914
|
-
for (const
|
|
1915
|
-
const u = Ce(
|
|
1914
|
+
for (const i of t) {
|
|
1915
|
+
const u = Ce(i.shape[e]);
|
|
1916
1916
|
if (!u.length)
|
|
1917
1917
|
throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);
|
|
1918
1918
|
for (const l of u) {
|
|
1919
1919
|
if (s.has(l))
|
|
1920
1920
|
throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(l)}`);
|
|
1921
|
-
s.set(l,
|
|
1921
|
+
s.set(l, i);
|
|
1922
1922
|
}
|
|
1923
1923
|
}
|
|
1924
1924
|
return new Bt({
|
|
@@ -1935,8 +1935,8 @@ function dr(r, e) {
|
|
|
1935
1935
|
if (r === e)
|
|
1936
1936
|
return { valid: !0, data: r };
|
|
1937
1937
|
if (t === E.object && n === E.object) {
|
|
1938
|
-
const s = N.objectKeys(e),
|
|
1939
|
-
for (const l of
|
|
1938
|
+
const s = N.objectKeys(e), i = N.objectKeys(r).filter((l) => s.indexOf(l) !== -1), u = { ...r, ...e };
|
|
1939
|
+
for (const l of i) {
|
|
1940
1940
|
const p = dr(r[l], e[l]);
|
|
1941
1941
|
if (!p.valid)
|
|
1942
1942
|
return { valid: !1 };
|
|
@@ -1947,8 +1947,8 @@ function dr(r, e) {
|
|
|
1947
1947
|
if (r.length !== e.length)
|
|
1948
1948
|
return { valid: !1 };
|
|
1949
1949
|
const s = [];
|
|
1950
|
-
for (let
|
|
1951
|
-
const u = r[
|
|
1950
|
+
for (let i = 0; i < r.length; i++) {
|
|
1951
|
+
const u = r[i], l = e[i], p = dr(u, l);
|
|
1952
1952
|
if (!p.valid)
|
|
1953
1953
|
return { valid: !1 };
|
|
1954
1954
|
s.push(p.data);
|
|
@@ -1958,11 +1958,11 @@ function dr(r, e) {
|
|
|
1958
1958
|
}
|
|
1959
1959
|
class ft extends P {
|
|
1960
1960
|
_parse(e) {
|
|
1961
|
-
const { status: t, ctx: n } = this._processInputParams(e), s = (
|
|
1962
|
-
if (ur(
|
|
1961
|
+
const { status: t, ctx: n } = this._processInputParams(e), s = (i, u) => {
|
|
1962
|
+
if (ur(i) || ur(u))
|
|
1963
1963
|
return x;
|
|
1964
|
-
const l = dr(
|
|
1965
|
-
return l.valid ? ((lr(
|
|
1964
|
+
const l = dr(i.value, u.value);
|
|
1965
|
+
return l.valid ? ((lr(i) || lr(u)) && t.dirty(), { status: t.value, value: l.data }) : (b(n, {
|
|
1966
1966
|
code: y.invalid_intersection_types
|
|
1967
1967
|
}), x);
|
|
1968
1968
|
};
|
|
@@ -1977,7 +1977,7 @@ class ft extends P {
|
|
|
1977
1977
|
path: n.path,
|
|
1978
1978
|
parent: n
|
|
1979
1979
|
})
|
|
1980
|
-
]).then(([
|
|
1980
|
+
]).then(([i, u]) => s(i, u)) : s(this._def.left._parseSync({
|
|
1981
1981
|
data: n.data,
|
|
1982
1982
|
path: n.path,
|
|
1983
1983
|
parent: n
|
|
@@ -2018,11 +2018,11 @@ class Te extends P {
|
|
|
2018
2018
|
exact: !1,
|
|
2019
2019
|
type: "array"
|
|
2020
2020
|
}), t.dirty());
|
|
2021
|
-
const
|
|
2021
|
+
const i = [...n.data].map((u, l) => {
|
|
2022
2022
|
const p = this._def.items[l] || this._def.rest;
|
|
2023
2023
|
return p ? p._parse(new ke(n, u, n.path, l)) : null;
|
|
2024
2024
|
}).filter((u) => !!u);
|
|
2025
|
-
return n.common.async ? Promise.all(
|
|
2025
|
+
return n.common.async ? Promise.all(i).then((u) => oe.mergeArray(t, u)) : oe.mergeArray(t, i);
|
|
2026
2026
|
}
|
|
2027
2027
|
get items() {
|
|
2028
2028
|
return this._def.items;
|
|
@@ -2059,14 +2059,14 @@ class ht extends P {
|
|
|
2059
2059
|
expected: E.object,
|
|
2060
2060
|
received: n.parsedType
|
|
2061
2061
|
}), x;
|
|
2062
|
-
const s = [],
|
|
2062
|
+
const s = [], i = this._def.keyType, u = this._def.valueType;
|
|
2063
2063
|
for (const l in n.data)
|
|
2064
2064
|
s.push({
|
|
2065
|
-
key:
|
|
2065
|
+
key: i._parse(new ke(n, l, n.path, l)),
|
|
2066
2066
|
value: u._parse(new ke(n, n.data[l], n.path, l)),
|
|
2067
2067
|
alwaysSet: l in n.data
|
|
2068
2068
|
});
|
|
2069
|
-
return n.common.async ?
|
|
2069
|
+
return n.common.async ? oe.mergeObjectAsync(t, s) : oe.mergeObjectSync(t, s);
|
|
2070
2070
|
}
|
|
2071
2071
|
get element() {
|
|
2072
2072
|
return this._def.valueType;
|
|
@@ -2100,9 +2100,9 @@ class zt extends P {
|
|
|
2100
2100
|
expected: E.map,
|
|
2101
2101
|
received: n.parsedType
|
|
2102
2102
|
}), x;
|
|
2103
|
-
const s = this._def.keyType,
|
|
2103
|
+
const s = this._def.keyType, i = this._def.valueType, u = [...n.data.entries()].map(([l, p], m) => ({
|
|
2104
2104
|
key: s._parse(new ke(n, l, n.path, [m, "key"])),
|
|
2105
|
-
value:
|
|
2105
|
+
value: i._parse(new ke(n, p, n.path, [m, "value"]))
|
|
2106
2106
|
}));
|
|
2107
2107
|
if (n.common.async) {
|
|
2108
2108
|
const l = /* @__PURE__ */ new Map();
|
|
@@ -2158,7 +2158,7 @@ class Ue extends P {
|
|
|
2158
2158
|
exact: !1,
|
|
2159
2159
|
message: s.maxSize.message
|
|
2160
2160
|
}), t.dirty());
|
|
2161
|
-
const
|
|
2161
|
+
const i = this._def.valueType;
|
|
2162
2162
|
function u(p) {
|
|
2163
2163
|
const m = /* @__PURE__ */ new Set();
|
|
2164
2164
|
for (const _ of p) {
|
|
@@ -2168,7 +2168,7 @@ class Ue extends P {
|
|
|
2168
2168
|
}
|
|
2169
2169
|
return { status: t.value, value: m };
|
|
2170
2170
|
}
|
|
2171
|
-
const l = [...n.data.values()].map((p, m) =>
|
|
2171
|
+
const l = [...n.data.values()].map((p, m) => i._parse(new ke(n, p, n.path, m)));
|
|
2172
2172
|
return n.common.async ? Promise.all(l).then((p) => u(p)) : u(l);
|
|
2173
2173
|
}
|
|
2174
2174
|
min(e, t) {
|
|
@@ -2241,24 +2241,24 @@ class Ye extends P {
|
|
|
2241
2241
|
}
|
|
2242
2242
|
});
|
|
2243
2243
|
}
|
|
2244
|
-
const
|
|
2245
|
-
if (this._def.returns instanceof
|
|
2244
|
+
const i = { errorMap: t.common.contextualErrorMap }, u = t.data;
|
|
2245
|
+
if (this._def.returns instanceof Je) {
|
|
2246
2246
|
const l = this;
|
|
2247
2247
|
return le(async function(...p) {
|
|
2248
|
-
const m = new pe([]), _ = await l._def.args.parseAsync(p,
|
|
2248
|
+
const m = new pe([]), _ = await l._def.args.parseAsync(p, i).catch(($) => {
|
|
2249
2249
|
throw m.addIssue(n(p, $)), m;
|
|
2250
2250
|
}), O = await Reflect.apply(u, this, _);
|
|
2251
|
-
return await l._def.returns._def.type.parseAsync(O,
|
|
2251
|
+
return await l._def.returns._def.type.parseAsync(O, i).catch(($) => {
|
|
2252
2252
|
throw m.addIssue(s(O, $)), m;
|
|
2253
2253
|
});
|
|
2254
2254
|
});
|
|
2255
2255
|
} else {
|
|
2256
2256
|
const l = this;
|
|
2257
2257
|
return le(function(...p) {
|
|
2258
|
-
const m = l._def.args.safeParse(p,
|
|
2258
|
+
const m = l._def.args.safeParse(p, i);
|
|
2259
2259
|
if (!m.success)
|
|
2260
2260
|
throw new pe([n(p, m.error)]);
|
|
2261
|
-
const _ = Reflect.apply(u, this, m.data), O = l._def.returns.safeParse(_,
|
|
2261
|
+
const _ = Reflect.apply(u, this, m.data), O = l._def.returns.safeParse(_, i);
|
|
2262
2262
|
if (!O.success)
|
|
2263
2263
|
throw new pe([s(_, O.error)]);
|
|
2264
2264
|
return O.data;
|
|
@@ -2433,7 +2433,7 @@ yt.create = (r, e) => new yt({
|
|
|
2433
2433
|
typeName: C.ZodNativeEnum,
|
|
2434
2434
|
...I(e)
|
|
2435
2435
|
});
|
|
2436
|
-
class
|
|
2436
|
+
class Je extends P {
|
|
2437
2437
|
unwrap() {
|
|
2438
2438
|
return this._def.type;
|
|
2439
2439
|
}
|
|
@@ -2452,7 +2452,7 @@ class Ge extends P {
|
|
|
2452
2452
|
})));
|
|
2453
2453
|
}
|
|
2454
2454
|
}
|
|
2455
|
-
|
|
2455
|
+
Je.create = (r, e) => new Je({
|
|
2456
2456
|
type: r,
|
|
2457
2457
|
typeName: C.ZodPromise,
|
|
2458
2458
|
...I(e)
|
|
@@ -2465,7 +2465,7 @@ class be extends P {
|
|
|
2465
2465
|
return this._def.schema._def.typeName === C.ZodEffects ? this._def.schema.sourceType() : this._def.schema;
|
|
2466
2466
|
}
|
|
2467
2467
|
_parse(e) {
|
|
2468
|
-
const { status: t, ctx: n } = this._processInputParams(e), s = this._def.effect || null,
|
|
2468
|
+
const { status: t, ctx: n } = this._processInputParams(e), s = this._def.effect || null, i = {
|
|
2469
2469
|
addIssue: (u) => {
|
|
2470
2470
|
b(n, u), u.fatal ? t.abort() : t.dirty();
|
|
2471
2471
|
},
|
|
@@ -2473,8 +2473,8 @@ class be extends P {
|
|
|
2473
2473
|
return n.path;
|
|
2474
2474
|
}
|
|
2475
2475
|
};
|
|
2476
|
-
if (
|
|
2477
|
-
const u = s.transform(n.data,
|
|
2476
|
+
if (i.addIssue = i.addIssue.bind(i), s.type === "preprocess") {
|
|
2477
|
+
const u = s.transform(n.data, i);
|
|
2478
2478
|
if (n.common.async)
|
|
2479
2479
|
return Promise.resolve(u).then(async (l) => {
|
|
2480
2480
|
if (t.value === "aborted")
|
|
@@ -2499,7 +2499,7 @@ class be extends P {
|
|
|
2499
2499
|
}
|
|
2500
2500
|
if (s.type === "refinement") {
|
|
2501
2501
|
const u = (l) => {
|
|
2502
|
-
const p = s.refinement(l,
|
|
2502
|
+
const p = s.refinement(l, i);
|
|
2503
2503
|
if (n.common.async)
|
|
2504
2504
|
return Promise.resolve(p);
|
|
2505
2505
|
if (p instanceof Promise)
|
|
@@ -2523,14 +2523,14 @@ class be extends P {
|
|
|
2523
2523
|
path: n.path,
|
|
2524
2524
|
parent: n
|
|
2525
2525
|
});
|
|
2526
|
-
if (!
|
|
2526
|
+
if (!it(u))
|
|
2527
2527
|
return u;
|
|
2528
|
-
const l = s.transform(u.value,
|
|
2528
|
+
const l = s.transform(u.value, i);
|
|
2529
2529
|
if (l instanceof Promise)
|
|
2530
2530
|
throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");
|
|
2531
2531
|
return { status: t.value, value: l };
|
|
2532
2532
|
} else
|
|
2533
|
-
return this._def.schema._parseAsync({ data: n.data, path: n.path, parent: n }).then((u) =>
|
|
2533
|
+
return this._def.schema._parseAsync({ data: n.data, path: n.path, parent: n }).then((u) => it(u) ? Promise.resolve(s.transform(u.value, i)).then((l) => ({ status: t.value, value: l })) : u);
|
|
2534
2534
|
N.assertNever(s);
|
|
2535
2535
|
}
|
|
2536
2536
|
}
|
|
@@ -2607,9 +2607,9 @@ class gt extends P {
|
|
|
2607
2607
|
...n
|
|
2608
2608
|
}
|
|
2609
2609
|
});
|
|
2610
|
-
return
|
|
2610
|
+
return ot(s) ? s.then((i) => ({
|
|
2611
2611
|
status: "valid",
|
|
2612
|
-
value:
|
|
2612
|
+
value: i.status === "valid" ? i.value : this._def.catchValue({
|
|
2613
2613
|
get error() {
|
|
2614
2614
|
return new pe(n.common.issues);
|
|
2615
2615
|
},
|
|
@@ -2671,13 +2671,13 @@ class wt extends P {
|
|
|
2671
2671
|
const { status: t, ctx: n } = this._processInputParams(e);
|
|
2672
2672
|
if (n.common.async)
|
|
2673
2673
|
return (async () => {
|
|
2674
|
-
const
|
|
2674
|
+
const i = await this._def.in._parseAsync({
|
|
2675
2675
|
data: n.data,
|
|
2676
2676
|
path: n.path,
|
|
2677
2677
|
parent: n
|
|
2678
2678
|
});
|
|
2679
|
-
return
|
|
2680
|
-
data:
|
|
2679
|
+
return i.status === "aborted" ? x : i.status === "dirty" ? (t.dirty(), He(i.value)) : this._def.out._parseAsync({
|
|
2680
|
+
data: i.value,
|
|
2681
2681
|
path: n.path,
|
|
2682
2682
|
parent: n
|
|
2683
2683
|
});
|
|
@@ -2708,8 +2708,8 @@ class wt extends P {
|
|
|
2708
2708
|
}
|
|
2709
2709
|
class _t extends P {
|
|
2710
2710
|
_parse(e) {
|
|
2711
|
-
const t = this._def.innerType._parse(e), n = (s) => (
|
|
2712
|
-
return
|
|
2711
|
+
const t = this._def.innerType._parse(e), n = (s) => (it(s) && (s.value = Object.freeze(s.value)), s);
|
|
2712
|
+
return ot(t) ? t.then((s) => n(s)) : n(t);
|
|
2713
2713
|
}
|
|
2714
2714
|
unwrap() {
|
|
2715
2715
|
return this._def.innerType;
|
|
@@ -2721,13 +2721,13 @@ _t.create = (r, e) => new _t({
|
|
|
2721
2721
|
...I(e)
|
|
2722
2722
|
});
|
|
2723
2723
|
function _n(r, e = {}, t) {
|
|
2724
|
-
return r ?
|
|
2725
|
-
var
|
|
2724
|
+
return r ? Ge.create().superRefine((n, s) => {
|
|
2725
|
+
var i, u;
|
|
2726
2726
|
if (!r(n)) {
|
|
2727
|
-
const l = typeof e == "function" ? e(n) : typeof e == "string" ? { message: e } : e, p = (u = (
|
|
2727
|
+
const l = typeof e == "function" ? e(n) : typeof e == "string" ? { message: e } : e, p = (u = (i = l.fatal) !== null && i !== void 0 ? i : t) !== null && u !== void 0 ? u : !0, m = typeof l == "string" ? { message: l } : l;
|
|
2728
2728
|
s.addIssue({ code: "custom", ...m, fatal: p });
|
|
2729
2729
|
}
|
|
2730
|
-
}) :
|
|
2730
|
+
}) : Ge.create();
|
|
2731
2731
|
}
|
|
2732
2732
|
const fs = {
|
|
2733
2733
|
object: K.lazycreate
|
|
@@ -2738,7 +2738,7 @@ var C;
|
|
|
2738
2738
|
})(C || (C = {}));
|
|
2739
2739
|
const hs = (r, e = {
|
|
2740
2740
|
message: `Input not instance of ${r.name}`
|
|
2741
|
-
}) => _n((t) => t instanceof r, e), bn = ge.create, En = Ie.create, ps = qt.create, ms = Pe.create, wn = ct.create, ys = Ze.create, vs = Ft.create, gs = ut.create, _s = lt.create, bs =
|
|
2741
|
+
}) => _n((t) => t instanceof r, e), bn = ge.create, En = Ie.create, ps = qt.create, ms = Pe.create, wn = ct.create, ys = Ze.create, vs = Ft.create, gs = ut.create, _s = lt.create, bs = Ge.create, Es = Le.create, ws = Se.create, ks = Vt.create, Ts = _e.create, Cs = K.create, Ss = K.strictCreate, xs = dt.create, Rs = Bt.create, Os = ft.create, Is = Te.create, Ps = ht.create, As = zt.create, Ms = Ue.create, js = Ye.create, Ns = pt.create, Ds = mt.create, $s = Ae.create, Ls = yt.create, Zs = Je.create, nn = be.create, Us = Ee.create, Fs = Me.create, Vs = be.createWithPreprocess, zs = wt.create, qs = () => bn().optional(), Ws = () => En().optional(), Bs = () => wn().optional(), Hs = {
|
|
2742
2742
|
string: (r) => ge.create({ ...r, coerce: !0 }),
|
|
2743
2743
|
number: (r) => Ie.create({ ...r, coerce: !0 }),
|
|
2744
2744
|
boolean: (r) => ct.create({
|
|
@@ -2756,14 +2756,14 @@ var c = /* @__PURE__ */ Object.freeze({
|
|
|
2756
2756
|
makeIssue: Zt,
|
|
2757
2757
|
EMPTY_PATH: Ka,
|
|
2758
2758
|
addIssueToContext: b,
|
|
2759
|
-
ParseStatus:
|
|
2759
|
+
ParseStatus: oe,
|
|
2760
2760
|
INVALID: x,
|
|
2761
2761
|
DIRTY: He,
|
|
2762
2762
|
OK: le,
|
|
2763
2763
|
isAborted: ur,
|
|
2764
2764
|
isDirty: lr,
|
|
2765
|
-
isValid:
|
|
2766
|
-
isAsync:
|
|
2765
|
+
isValid: it,
|
|
2766
|
+
isAsync: ot,
|
|
2767
2767
|
get util() {
|
|
2768
2768
|
return N;
|
|
2769
2769
|
},
|
|
@@ -2782,7 +2782,7 @@ var c = /* @__PURE__ */ Object.freeze({
|
|
|
2782
2782
|
ZodSymbol: Ft,
|
|
2783
2783
|
ZodUndefined: ut,
|
|
2784
2784
|
ZodNull: lt,
|
|
2785
|
-
ZodAny:
|
|
2785
|
+
ZodAny: Ge,
|
|
2786
2786
|
ZodUnknown: Le,
|
|
2787
2787
|
ZodNever: Se,
|
|
2788
2788
|
ZodVoid: Vt,
|
|
@@ -2800,7 +2800,7 @@ var c = /* @__PURE__ */ Object.freeze({
|
|
|
2800
2800
|
ZodLiteral: mt,
|
|
2801
2801
|
ZodEnum: Ae,
|
|
2802
2802
|
ZodNativeEnum: yt,
|
|
2803
|
-
ZodPromise:
|
|
2803
|
+
ZodPromise: Je,
|
|
2804
2804
|
ZodEffects: be,
|
|
2805
2805
|
ZodTransformer: be,
|
|
2806
2806
|
ZodOptional: Ee,
|
|
@@ -2869,31 +2869,30 @@ const Ks = c.object({
|
|
|
2869
2869
|
loc: c.array(c.string()),
|
|
2870
2870
|
msg: c.string(),
|
|
2871
2871
|
url: c.string()
|
|
2872
|
-
}),
|
|
2872
|
+
}), Gs = c.array(Ks), Js = c.object({
|
|
2873
2873
|
code: c.string(),
|
|
2874
2874
|
message: c.string(),
|
|
2875
2875
|
path: c.array(c.string())
|
|
2876
|
-
}), Qs = c.array(
|
|
2876
|
+
}), Qs = c.array(Js), Xs = {
|
|
2877
2877
|
"failed to fetch": "Connection error: please double check if you are connected to the internet, then try again"
|
|
2878
2878
|
}, fr = (r) => {
|
|
2879
2879
|
const e = r.toLowerCase().trim();
|
|
2880
2880
|
return Xs[e] ?? r;
|
|
2881
|
-
},
|
|
2881
|
+
}, ei = (r) => {
|
|
2882
2882
|
try {
|
|
2883
2883
|
return typeof JSON.parse(r) == "object";
|
|
2884
2884
|
} catch {
|
|
2885
2885
|
return !1;
|
|
2886
2886
|
}
|
|
2887
|
-
},
|
|
2887
|
+
}, ti = (r) => r.length === 1 ? fr(r[0].msg) : `Please fix the following errors:
|
|
2888
2888
|
${r.map((t) => `• ${fr(t.msg)}`).join(`
|
|
2889
|
-
`)}`,
|
|
2889
|
+
`)}`, ri = (r) => `Encountered the following errors:
|
|
2890
2890
|
${r.map((t) => `- ${t.path.join("/")}: ${t.message}`).join(`
|
|
2891
2891
|
`)}`, kn = (r) => {
|
|
2892
2892
|
if (r instanceof Error)
|
|
2893
|
-
if (
|
|
2893
|
+
if (ei(r.message)) {
|
|
2894
2894
|
const e = JSON.parse(r.message);
|
|
2895
|
-
return
|
|
2896
|
-
${r.message}`), r.message);
|
|
2895
|
+
return Gs.safeParse(e).success ? ti(e) : Qs.safeParse(e).success ? ri(e) : r.message;
|
|
2897
2896
|
} else
|
|
2898
2897
|
return fr(r.message);
|
|
2899
2898
|
if (typeof r == "object")
|
|
@@ -2908,11 +2907,11 @@ ${r.message}`), r.message);
|
|
|
2908
2907
|
var bt = /* @__PURE__ */ ((r) => (r.FIRST_NAME = "firstName", r.LAST_NAME = "lastName", r.EMAIL = "email", r.ZIP_CODE = "zipCode", r.CITY = "city", r.STATE = "state", r.COUNTRY = "country", r.ADDRESS = "address", r.PHONE = "phone", r.PROMOTION_CODE = "promotionCode", r))(bt || {});
|
|
2909
2908
|
const Tn = c.nativeEnum(bt);
|
|
2910
2909
|
var Cn = /* @__PURE__ */ ((r) => (r.CARD_NUMBER = "cardNumber", r.CARD_EXPIRY = "cardExpiry", r.CARD_CVC = "cardCvc", r))(Cn || {});
|
|
2911
|
-
const Sn = c.nativeEnum(Cn),
|
|
2910
|
+
const Sn = c.nativeEnum(Cn), ni = c.union([Tn, Sn]), xn = c.object({
|
|
2912
2911
|
provider: c.string(),
|
|
2913
2912
|
processor_name: hr(c.string()),
|
|
2914
2913
|
metadata: hr(c.record(c.string(), c.any()))
|
|
2915
|
-
}),
|
|
2914
|
+
}), ai = c.object({
|
|
2916
2915
|
id: c.string()
|
|
2917
2916
|
});
|
|
2918
2917
|
c.object({
|
|
@@ -2950,69 +2949,69 @@ const te = c.enum([
|
|
|
2950
2949
|
"TOKENIZE",
|
|
2951
2950
|
"CHECKOUT",
|
|
2952
2951
|
"START_PAYMENT_FLOW"
|
|
2953
|
-
]),
|
|
2954
|
-
type:
|
|
2952
|
+
]), si = te.extract(["TOKENIZE_STARTED", "CHECKOUT_STARTED"]), ii = c.object({ type: si }), oi = te.extract(["BLUR", "FOCUS", "CHANGE"]), ci = c.object({
|
|
2953
|
+
type: oi,
|
|
2955
2954
|
elementType: Sn
|
|
2956
|
-
}),
|
|
2957
|
-
type:
|
|
2955
|
+
}), ui = te.extract(["LOAD_ERROR", "TOKENIZE_ERROR", "CHECKOUT_ERROR"]), li = c.object({
|
|
2956
|
+
type: ui,
|
|
2958
2957
|
message: he
|
|
2959
|
-
}),
|
|
2960
|
-
type:
|
|
2961
|
-
elementType:
|
|
2958
|
+
}), di = te.extract(["VALIDATION_ERROR"]), fi = c.object({
|
|
2959
|
+
type: di,
|
|
2960
|
+
elementType: ni,
|
|
2962
2961
|
errors: c.array(c.string())
|
|
2963
|
-
}),
|
|
2962
|
+
}), hi = c.object({
|
|
2964
2963
|
type: c.literal(te.enum.LAYOUT),
|
|
2965
2964
|
height: he
|
|
2966
|
-
}),
|
|
2965
|
+
}), pi = c.object({
|
|
2967
2966
|
type: c.literal(te.enum.LOADED),
|
|
2968
2967
|
sessionId: he,
|
|
2969
2968
|
totalAmountAtoms: c.number(),
|
|
2970
2969
|
currency: de,
|
|
2971
2970
|
checkoutPaymentMethods: c.array(xn)
|
|
2972
|
-
}),
|
|
2971
|
+
}), mi = c.object({
|
|
2973
2972
|
type: c.literal(te.enum.PAYMENT_FLOW_STARTED),
|
|
2974
2973
|
nextActionMetadata: c.record(c.string(), c.any()),
|
|
2975
2974
|
paymentFlowMetadata: c.any().optional(),
|
|
2976
2975
|
startPFMetadata: c.optional(c.record(c.string(), c.any()))
|
|
2977
|
-
}),
|
|
2976
|
+
}), yi = c.object({
|
|
2978
2977
|
type: c.literal(te.enum.SETUP_PAYMENT_METHOD_SUCCESS),
|
|
2979
2978
|
paymentMethodId: c.string()
|
|
2980
|
-
}),
|
|
2979
|
+
}), vi = c.object({
|
|
2981
2980
|
firstName: he,
|
|
2982
2981
|
lastName: he,
|
|
2983
2982
|
email: he,
|
|
2984
2983
|
zipCode: he,
|
|
2985
2984
|
country: he,
|
|
2986
2985
|
promotionCode: de
|
|
2987
|
-
}),
|
|
2988
|
-
type:
|
|
2986
|
+
}), gi = te.extract(["TOKENIZE", "CHECKOUT", "START_PAYMENT_FLOW"]), Rn = c.object({
|
|
2987
|
+
type: gi,
|
|
2989
2988
|
sessionId: he,
|
|
2990
2989
|
checkoutPaymentMethod: xn,
|
|
2991
2990
|
paymentFlowMetadata: c.any().optional(),
|
|
2992
2991
|
doNotUseLegacyCCFlow: c.boolean().optional(),
|
|
2993
2992
|
existingCCPMId: de
|
|
2994
|
-
}).extend(
|
|
2993
|
+
}).extend(vi.shape), _i = c.object({
|
|
2995
2994
|
type: c.literal(te.enum.TOKENIZE_SUCCESS),
|
|
2996
2995
|
isReadyForCheckout: c.boolean()
|
|
2997
|
-
}),
|
|
2996
|
+
}), bi = c.object({
|
|
2998
2997
|
type: c.literal(te.enum.CHECKOUT_SUCCESS),
|
|
2999
2998
|
invoiceUrls: c.array(c.string()),
|
|
3000
2999
|
subscriptionIds: c.array(c.string()),
|
|
3001
3000
|
customerId: c.string()
|
|
3002
|
-
}),
|
|
3003
|
-
|
|
3004
|
-
|
|
3005
|
-
|
|
3006
|
-
|
|
3007
|
-
|
|
3008
|
-
|
|
3001
|
+
}), Ei = c.discriminatedUnion("type", [
|
|
3002
|
+
ii,
|
|
3003
|
+
ci,
|
|
3004
|
+
li,
|
|
3005
|
+
fi,
|
|
3006
|
+
hi,
|
|
3007
|
+
pi,
|
|
3009
3008
|
Rn,
|
|
3010
|
-
|
|
3011
|
-
|
|
3012
|
-
|
|
3013
|
-
|
|
3014
|
-
]),
|
|
3015
|
-
payload:
|
|
3009
|
+
_i,
|
|
3010
|
+
bi,
|
|
3011
|
+
mi,
|
|
3012
|
+
yi
|
|
3013
|
+
]), wi = c.object({
|
|
3014
|
+
payload: Ei,
|
|
3016
3015
|
nonce: he,
|
|
3017
3016
|
formId: he,
|
|
3018
3017
|
elementId: he
|
|
@@ -3029,9 +3028,9 @@ c.object({
|
|
|
3029
3028
|
secure_token: c.string(),
|
|
3030
3029
|
existing_cc_pm_id: hr(c.string())
|
|
3031
3030
|
});
|
|
3032
|
-
const
|
|
3033
|
-
payment_methods: c.array(
|
|
3034
|
-
}),
|
|
3031
|
+
const ki = c.object({
|
|
3032
|
+
payment_methods: c.array(ai)
|
|
3033
|
+
}), Ti = (r) => {
|
|
3035
3034
|
const e = {};
|
|
3036
3035
|
return Object.entries(r).forEach(([t, n]) => {
|
|
3037
3036
|
try {
|
|
@@ -3041,21 +3040,21 @@ const To = c.object({
|
|
|
3041
3040
|
return;
|
|
3042
3041
|
}
|
|
3043
3042
|
}), e;
|
|
3044
|
-
},
|
|
3043
|
+
}, Ci = {
|
|
3045
3044
|
usd: "usd",
|
|
3046
3045
|
brl: "brl"
|
|
3047
3046
|
}, vr = async (r) => {
|
|
3048
3047
|
for (let t = 0; t < 10; t++)
|
|
3049
|
-
an() || await
|
|
3048
|
+
an() || await Si(500);
|
|
3050
3049
|
if (!an())
|
|
3051
|
-
throw
|
|
3050
|
+
throw new Error("Stripe JS not found.");
|
|
3052
3051
|
return new Stripe(r);
|
|
3053
3052
|
}, On = async (r, e, t, n) => {
|
|
3054
|
-
const s = await vr(r),
|
|
3053
|
+
const s = await vr(r), i = Ci[t.toLowerCase().trim()];
|
|
3055
3054
|
return s.paymentRequest({
|
|
3056
3055
|
// TODO: replace this with stripe account country as soon as we support it
|
|
3057
3056
|
country: "US",
|
|
3058
|
-
currency:
|
|
3057
|
+
currency: i,
|
|
3059
3058
|
total: {
|
|
3060
3059
|
label: "Total",
|
|
3061
3060
|
amount: e,
|
|
@@ -3064,9 +3063,9 @@ const To = c.object({
|
|
|
3064
3063
|
requestPayerName: !0,
|
|
3065
3064
|
requestPayerEmail: !0
|
|
3066
3065
|
});
|
|
3067
|
-
},
|
|
3066
|
+
}, Si = (r) => new Promise((e) => {
|
|
3068
3067
|
setTimeout(e, r);
|
|
3069
|
-
}), an = () => "Stripe" in window,
|
|
3068
|
+
}), an = () => "Stripe" in window, xi = async (r) => new Promise((e, t) => {
|
|
3070
3069
|
try {
|
|
3071
3070
|
r.on("paymentmethod", async (n) => {
|
|
3072
3071
|
e(n);
|
|
@@ -3076,12 +3075,12 @@ const To = c.object({
|
|
|
3076
3075
|
} catch (n) {
|
|
3077
3076
|
t(n);
|
|
3078
3077
|
}
|
|
3079
|
-
}),
|
|
3078
|
+
}), Ri = (r) => {
|
|
3080
3079
|
const e = r == null ? void 0 : r.stripe_pk;
|
|
3081
3080
|
if (typeof e != "string")
|
|
3082
3081
|
throw new Error("Invalid: stripe_pk not passed in checkout payment method");
|
|
3083
3082
|
return e;
|
|
3084
|
-
},
|
|
3083
|
+
}, Oi = async (r, e) => {
|
|
3085
3084
|
const t = r.nextActionMetadata;
|
|
3086
3085
|
if (!r.paymentFlowMetadata || !r.paymentFlowMetadata.stripePmId)
|
|
3087
3086
|
throw new Error(`Invalid payment flow metadata format: ${JSON.stringify(r.paymentFlowMetadata)}`);
|
|
@@ -3095,75 +3094,73 @@ const To = c.object({
|
|
|
3095
3094
|
if (s.error)
|
|
3096
3095
|
throw e.complete("fail"), new Error(`Payment failed: ${s.error.message ?? "unknown"}`);
|
|
3097
3096
|
e.complete("success");
|
|
3098
|
-
},
|
|
3099
|
-
var
|
|
3097
|
+
}, Ii = async (r) => {
|
|
3098
|
+
var i, u, l, p;
|
|
3100
3099
|
const e = r.nextActionMetadata, n = await (await vr(e.stripe_pk)).confirmCardSetup(e.client_secret, {
|
|
3101
3100
|
payment_method: e.stripe_pm_id
|
|
3102
|
-
}), s = (
|
|
3103
|
-
if (s
|
|
3104
|
-
console.log("[3DS] CONFIRMING PM:", e.stripe_pm_id), console.log("[3DS] Setup intent created:", n.setupIntent);
|
|
3105
|
-
else throw s === "canceled" ? new Error("Payment cancelled, please click Submit again to pay") : new Error(
|
|
3101
|
+
}), s = (i = n.setupIntent) == null ? void 0 : i.status;
|
|
3102
|
+
if (s !== "succeeded") throw s === "canceled" ? new Error("Payment cancelled, please click Submit again to pay") : new Error(
|
|
3106
3103
|
`${((u = n.error) == null ? void 0 : u.message) ?? ((p = (l = n.setupIntent) == null ? void 0 : l.last_setup_error) == null ? void 0 : p.message) ?? "Payment failed, please click submit again to pay."}`
|
|
3107
3104
|
);
|
|
3108
|
-
},
|
|
3105
|
+
}, Pi = (r) => JSON.stringify(r);
|
|
3109
3106
|
var ae = [];
|
|
3110
|
-
for (var
|
|
3111
|
-
ae.push((
|
|
3112
|
-
function
|
|
3107
|
+
for (var or = 0; or < 256; ++or)
|
|
3108
|
+
ae.push((or + 256).toString(16).slice(1));
|
|
3109
|
+
function Ai(r, e = 0) {
|
|
3113
3110
|
return (ae[r[e + 0]] + ae[r[e + 1]] + ae[r[e + 2]] + ae[r[e + 3]] + "-" + ae[r[e + 4]] + ae[r[e + 5]] + "-" + ae[r[e + 6]] + ae[r[e + 7]] + "-" + ae[r[e + 8]] + ae[r[e + 9]] + "-" + ae[r[e + 10]] + ae[r[e + 11]] + ae[r[e + 12]] + ae[r[e + 13]] + ae[r[e + 14]] + ae[r[e + 15]]).toLowerCase();
|
|
3114
3111
|
}
|
|
3115
|
-
var $t,
|
|
3116
|
-
function
|
|
3112
|
+
var $t, Mi = new Uint8Array(16);
|
|
3113
|
+
function ji() {
|
|
3117
3114
|
if (!$t && ($t = typeof crypto < "u" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto), !$t))
|
|
3118
3115
|
throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
|
|
3119
|
-
return $t(
|
|
3116
|
+
return $t(Mi);
|
|
3120
3117
|
}
|
|
3121
|
-
var
|
|
3118
|
+
var Ni = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto);
|
|
3122
3119
|
const sn = {
|
|
3123
|
-
randomUUID:
|
|
3120
|
+
randomUUID: Ni
|
|
3124
3121
|
};
|
|
3125
|
-
function
|
|
3122
|
+
function Di(r, e, t) {
|
|
3126
3123
|
if (sn.randomUUID && !e && !r)
|
|
3127
3124
|
return sn.randomUUID();
|
|
3128
3125
|
r = r || {};
|
|
3129
|
-
var n = r.random || (r.rng ||
|
|
3130
|
-
return n[6] = n[6] & 15 | 64, n[8] = n[8] & 63 | 128,
|
|
3126
|
+
var n = r.random || (r.rng || ji)();
|
|
3127
|
+
return n[6] = n[6] & 15 | 64, n[8] = n[8] & 63 | 128, Ai(n);
|
|
3131
3128
|
}
|
|
3132
|
-
const In = (r, e) => Array.from(r.querySelectorAll("input[data-opid]") ?? []).reduce((s,
|
|
3133
|
-
const u =
|
|
3134
|
-
return u ? { ...s, [u]:
|
|
3135
|
-
}, e), Wt = (r, e, t, n, s,
|
|
3129
|
+
const In = (r, e) => Array.from(r.querySelectorAll("input[data-opid]") ?? []).reduce((s, i) => {
|
|
3130
|
+
const u = i.getAttribute("data-opid");
|
|
3131
|
+
return u ? { ...s, [u]: i.value } : s;
|
|
3132
|
+
}, e), Wt = (r, e, t, n, s, i, u) => {
|
|
3136
3133
|
const l = In(t, {
|
|
3137
3134
|
type: r,
|
|
3138
3135
|
sessionId: e,
|
|
3139
3136
|
checkoutPaymentMethod: s,
|
|
3140
3137
|
paymentFlowMetadata: u,
|
|
3141
|
-
doNotUseLegacyCCFlow:
|
|
3138
|
+
doNotUseLegacyCCFlow: i
|
|
3142
3139
|
});
|
|
3143
|
-
|
|
3140
|
+
(s.provider === "apple_pay" || s.provider === "google_pay") && (l[bt.ZIP_CODE] || (l[bt.ZIP_CODE] = "00000"));
|
|
3144
3141
|
const p = Rn.safeParse(l);
|
|
3145
3142
|
if (p.success)
|
|
3146
|
-
return
|
|
3143
|
+
return p.data;
|
|
3147
3144
|
{
|
|
3148
|
-
const m = p.error.format(), _ =
|
|
3145
|
+
const m = p.error.format(), _ = Ti(m);
|
|
3149
3146
|
for (const [O, V] of Object.entries(_))
|
|
3150
3147
|
n(O, V, O);
|
|
3151
|
-
return
|
|
3148
|
+
return null;
|
|
3152
3149
|
}
|
|
3153
|
-
},
|
|
3150
|
+
}, $i = (r) => {
|
|
3154
3151
|
try {
|
|
3155
|
-
return
|
|
3152
|
+
return wi.parse(r);
|
|
3156
3153
|
} catch (e) {
|
|
3157
|
-
throw
|
|
3154
|
+
throw e;
|
|
3158
3155
|
}
|
|
3159
3156
|
}, on = (r, e, t, n, s) => {
|
|
3160
|
-
const
|
|
3157
|
+
const i = {
|
|
3161
3158
|
payload: n,
|
|
3162
|
-
nonce:
|
|
3159
|
+
nonce: Di(),
|
|
3163
3160
|
formId: e,
|
|
3164
3161
|
elementId: t
|
|
3165
3162
|
};
|
|
3166
|
-
|
|
3163
|
+
r.postMessage(JSON.stringify(i), s);
|
|
3167
3164
|
};
|
|
3168
3165
|
var we;
|
|
3169
3166
|
(function(r) {
|
|
@@ -3185,44 +3182,43 @@ var je;
|
|
|
3185
3182
|
(function(r) {
|
|
3186
3183
|
r.Message = "message";
|
|
3187
3184
|
})(je || (je = {}));
|
|
3188
|
-
const
|
|
3185
|
+
const Li = (r, e) => {
|
|
3189
3186
|
const t = [];
|
|
3190
3187
|
let n = !1;
|
|
3191
3188
|
return {
|
|
3192
3189
|
destroy(s) {
|
|
3193
|
-
n || (n = !0, e(`${r}: Destroying connection`), t.forEach((
|
|
3194
|
-
|
|
3190
|
+
n || (n = !0, e(`${r}: Destroying connection`), t.forEach((i) => {
|
|
3191
|
+
i(s);
|
|
3195
3192
|
}));
|
|
3196
3193
|
},
|
|
3197
3194
|
onDestroy(s) {
|
|
3198
3195
|
n ? s() : t.push(s);
|
|
3199
3196
|
}
|
|
3200
3197
|
};
|
|
3201
|
-
},
|
|
3202
|
-
|
|
3203
|
-
}, Fo = {
|
|
3198
|
+
}, Zi = (r) => (...e) => {
|
|
3199
|
+
}, Ui = {
|
|
3204
3200
|
"http:": "80",
|
|
3205
3201
|
"https:": "443"
|
|
3206
|
-
},
|
|
3207
|
-
if (r &&
|
|
3202
|
+
}, Fi = /^(https?:)?\/\/([^/:]+)?(:(\d+))?/, Vi = ["file:", "data:"], zi = (r) => {
|
|
3203
|
+
if (r && Vi.find((l) => r.startsWith(l)))
|
|
3208
3204
|
return "null";
|
|
3209
|
-
const e = document.location, t =
|
|
3210
|
-
let n, s,
|
|
3211
|
-
t ? (n = t[1] ? t[1] : e.protocol, s = t[2],
|
|
3212
|
-
const u =
|
|
3205
|
+
const e = document.location, t = Fi.exec(r);
|
|
3206
|
+
let n, s, i;
|
|
3207
|
+
t ? (n = t[1] ? t[1] : e.protocol, s = t[2], i = t[4]) : (n = e.protocol, s = e.hostname, i = e.port);
|
|
3208
|
+
const u = i && i !== Ui[n] ? `:${i}` : "";
|
|
3213
3209
|
return `${n}//${s}${u}`;
|
|
3214
3210
|
}, cn = ({ name: r, message: e, stack: t }) => ({
|
|
3215
3211
|
name: r,
|
|
3216
3212
|
message: e,
|
|
3217
3213
|
stack: t
|
|
3218
|
-
}),
|
|
3214
|
+
}), qi = (r) => {
|
|
3219
3215
|
const e = new Error();
|
|
3220
3216
|
return Object.keys(r).forEach((t) => e[t] = r[t]), e;
|
|
3221
|
-
},
|
|
3222
|
-
const { localName: n, local: s, remote:
|
|
3217
|
+
}, Wi = (r, e, t) => {
|
|
3218
|
+
const { localName: n, local: s, remote: i, originForSending: u, originForReceiving: l } = r;
|
|
3223
3219
|
let p = !1;
|
|
3224
3220
|
const m = (_) => {
|
|
3225
|
-
if (_.source !==
|
|
3221
|
+
if (_.source !== i || _.data.penpal !== we.Call)
|
|
3226
3222
|
return;
|
|
3227
3223
|
if (l !== "*" && _.origin !== l) {
|
|
3228
3224
|
t(`${n} received message from origin ${_.origin} which did not match expected origin ${l}`);
|
|
@@ -3230,7 +3226,7 @@ const Zo = (r, e) => {
|
|
|
3230
3226
|
}
|
|
3231
3227
|
const O = _.data, { methodName: V, args: $, id: ee } = O;
|
|
3232
3228
|
t(`${n}: Received ${V}() call`);
|
|
3233
|
-
const fe = (
|
|
3229
|
+
const fe = (G) => (me) => {
|
|
3234
3230
|
if (t(`${n}: Sending ${V}() reply`), p) {
|
|
3235
3231
|
t(`${n}: Unable to send ${V}() reply due to destroyed connection`);
|
|
3236
3232
|
return;
|
|
@@ -3238,56 +3234,56 @@ const Zo = (r, e) => {
|
|
|
3238
3234
|
const se = {
|
|
3239
3235
|
penpal: we.Reply,
|
|
3240
3236
|
id: ee,
|
|
3241
|
-
resolution:
|
|
3237
|
+
resolution: G,
|
|
3242
3238
|
returnValue: me
|
|
3243
3239
|
};
|
|
3244
|
-
|
|
3240
|
+
G === $e.Rejected && me instanceof Error && (se.returnValue = cn(me), se.returnValueIsError = !0);
|
|
3245
3241
|
try {
|
|
3246
|
-
|
|
3242
|
+
i.postMessage(se, u);
|
|
3247
3243
|
} catch (W) {
|
|
3248
3244
|
if (W.name === pr.DataCloneError) {
|
|
3249
|
-
const
|
|
3245
|
+
const ie = {
|
|
3250
3246
|
penpal: we.Reply,
|
|
3251
3247
|
id: ee,
|
|
3252
3248
|
resolution: $e.Rejected,
|
|
3253
3249
|
returnValue: cn(W),
|
|
3254
3250
|
returnValueIsError: !0
|
|
3255
3251
|
};
|
|
3256
|
-
|
|
3252
|
+
i.postMessage(ie, u);
|
|
3257
3253
|
}
|
|
3258
3254
|
throw W;
|
|
3259
3255
|
}
|
|
3260
3256
|
};
|
|
3261
|
-
new Promise((
|
|
3257
|
+
new Promise((G) => G(e[V].apply(e, $))).then(fe($e.Fulfilled), fe($e.Rejected));
|
|
3262
3258
|
};
|
|
3263
3259
|
return s.addEventListener(je.Message, m), () => {
|
|
3264
3260
|
p = !0, s.removeEventListener(je.Message, m);
|
|
3265
3261
|
};
|
|
3266
3262
|
};
|
|
3267
|
-
let
|
|
3268
|
-
const
|
|
3263
|
+
let Bi = 0;
|
|
3264
|
+
const Hi = () => ++Bi, Pn = ".", An = (r) => r ? r.split(Pn) : [], Yi = (r) => r.join(Pn), Ki = (r, e) => {
|
|
3269
3265
|
const t = An(e || "");
|
|
3270
|
-
return t.push(r),
|
|
3271
|
-
},
|
|
3266
|
+
return t.push(r), Yi(t);
|
|
3267
|
+
}, Gi = (r, e, t) => {
|
|
3272
3268
|
const n = An(e);
|
|
3273
|
-
return n.reduce((s,
|
|
3269
|
+
return n.reduce((s, i, u) => (typeof s[i] > "u" && (s[i] = {}), u === n.length - 1 && (s[i] = t), s[i]), r), r;
|
|
3274
3270
|
}, Mn = (r, e) => {
|
|
3275
3271
|
const t = {};
|
|
3276
3272
|
return Object.keys(r).forEach((n) => {
|
|
3277
|
-
const s = r[n],
|
|
3278
|
-
typeof s == "object" && Object.assign(t, Mn(s,
|
|
3273
|
+
const s = r[n], i = Ki(n, e);
|
|
3274
|
+
typeof s == "object" && Object.assign(t, Mn(s, i)), typeof s == "function" && (t[i] = s);
|
|
3279
3275
|
}), t;
|
|
3280
|
-
},
|
|
3276
|
+
}, Ji = (r) => {
|
|
3281
3277
|
const e = {};
|
|
3282
3278
|
for (const t in r)
|
|
3283
|
-
|
|
3279
|
+
Gi(e, t, r[t]);
|
|
3284
3280
|
return e;
|
|
3285
|
-
},
|
|
3286
|
-
const { localName:
|
|
3281
|
+
}, Qi = (r, e, t, n, s) => {
|
|
3282
|
+
const { localName: i, local: u, remote: l, originForSending: p, originForReceiving: m } = e;
|
|
3287
3283
|
let _ = !1;
|
|
3288
|
-
s(`${
|
|
3284
|
+
s(`${i}: Connecting call sender`);
|
|
3289
3285
|
const O = ($) => (...ee) => {
|
|
3290
|
-
s(`${
|
|
3286
|
+
s(`${i}: Sending ${$}() call`);
|
|
3291
3287
|
let fe;
|
|
3292
3288
|
try {
|
|
3293
3289
|
l.closed && (fe = !0);
|
|
@@ -3295,37 +3291,37 @@ const Yo = () => ++Ho, Pn = ".", An = (r) => r ? r.split(Pn) : [], Ko = (r) => r
|
|
|
3295
3291
|
fe = !0;
|
|
3296
3292
|
}
|
|
3297
3293
|
if (fe && n(), _) {
|
|
3298
|
-
const
|
|
3299
|
-
throw
|
|
3294
|
+
const G = new Error(`Unable to send ${$}() call due to destroyed connection`);
|
|
3295
|
+
throw G.code = Et.ConnectionDestroyed, G;
|
|
3300
3296
|
}
|
|
3301
|
-
return new Promise((
|
|
3302
|
-
const se =
|
|
3297
|
+
return new Promise((G, me) => {
|
|
3298
|
+
const se = Hi(), W = (U) => {
|
|
3303
3299
|
if (U.source !== l || U.data.penpal !== we.Reply || U.data.id !== se)
|
|
3304
3300
|
return;
|
|
3305
3301
|
if (m !== "*" && U.origin !== m) {
|
|
3306
|
-
s(`${
|
|
3302
|
+
s(`${i} received message from origin ${U.origin} which did not match expected origin ${m}`);
|
|
3307
3303
|
return;
|
|
3308
3304
|
}
|
|
3309
3305
|
const re = U.data;
|
|
3310
|
-
s(`${
|
|
3306
|
+
s(`${i}: Received ${$}() reply`), u.removeEventListener(je.Message, W);
|
|
3311
3307
|
let ye = re.returnValue;
|
|
3312
|
-
re.returnValueIsError && (ye =
|
|
3308
|
+
re.returnValueIsError && (ye = qi(ye)), (re.resolution === $e.Fulfilled ? G : me)(ye);
|
|
3313
3309
|
};
|
|
3314
3310
|
u.addEventListener(je.Message, W);
|
|
3315
|
-
const
|
|
3311
|
+
const ie = {
|
|
3316
3312
|
penpal: we.Call,
|
|
3317
3313
|
id: se,
|
|
3318
3314
|
methodName: $,
|
|
3319
3315
|
args: ee
|
|
3320
3316
|
};
|
|
3321
|
-
l.postMessage(
|
|
3317
|
+
l.postMessage(ie, p);
|
|
3322
3318
|
});
|
|
3323
3319
|
}, V = t.reduce(($, ee) => ($[ee] = O(ee), $), {});
|
|
3324
|
-
return Object.assign(r,
|
|
3320
|
+
return Object.assign(r, Ji(V)), () => {
|
|
3325
3321
|
_ = !0;
|
|
3326
3322
|
};
|
|
3327
|
-
},
|
|
3328
|
-
const { destroy:
|
|
3323
|
+
}, Xi = (r, e, t, n, s) => {
|
|
3324
|
+
const { destroy: i, onDestroy: u } = n;
|
|
3329
3325
|
let l, p;
|
|
3330
3326
|
const m = {};
|
|
3331
3327
|
return (_) => {
|
|
@@ -3341,13 +3337,13 @@ const Yo = () => ++Ho, Pn = ".", An = (r) => r ? r.split(Pn) : [], Ko = (r) => r
|
|
|
3341
3337
|
originForSending: t,
|
|
3342
3338
|
originForReceiving: e
|
|
3343
3339
|
};
|
|
3344
|
-
l && l(), l =
|
|
3340
|
+
l && l(), l = Wi(O, r, s), u(l), p && p.forEach(($) => {
|
|
3345
3341
|
delete m[$];
|
|
3346
3342
|
}), p = _.data.methodNames;
|
|
3347
|
-
const V =
|
|
3343
|
+
const V = Qi(m, O, p, i, s);
|
|
3348
3344
|
return u(V), m;
|
|
3349
3345
|
};
|
|
3350
|
-
},
|
|
3346
|
+
}, eo = (r, e, t, n) => (s) => {
|
|
3351
3347
|
if (!s.source)
|
|
3352
3348
|
return;
|
|
3353
3349
|
if (t !== "*" && s.origin !== t) {
|
|
@@ -3355,19 +3351,19 @@ const Yo = () => ++Ho, Pn = ".", An = (r) => r ? r.split(Pn) : [], Ko = (r) => r
|
|
|
3355
3351
|
return;
|
|
3356
3352
|
}
|
|
3357
3353
|
r("Parent: Handshake - Received SYN, responding with SYN-ACK");
|
|
3358
|
-
const
|
|
3354
|
+
const i = {
|
|
3359
3355
|
penpal: we.SynAck,
|
|
3360
3356
|
methodNames: Object.keys(e)
|
|
3361
3357
|
};
|
|
3362
|
-
s.source.postMessage(
|
|
3363
|
-
},
|
|
3358
|
+
s.source.postMessage(i, n);
|
|
3359
|
+
}, to = 6e4, ro = (r, e) => {
|
|
3364
3360
|
const { destroy: t, onDestroy: n } = e, s = setInterval(() => {
|
|
3365
3361
|
r.isConnected || (clearInterval(s), t());
|
|
3366
|
-
},
|
|
3362
|
+
}, to);
|
|
3367
3363
|
n(() => {
|
|
3368
3364
|
clearInterval(s);
|
|
3369
3365
|
});
|
|
3370
|
-
},
|
|
3366
|
+
}, no = (r, e) => {
|
|
3371
3367
|
let t;
|
|
3372
3368
|
return r !== void 0 && (t = window.setTimeout(() => {
|
|
3373
3369
|
const n = new Error(`Connection timed out after ${r}ms`);
|
|
@@ -3375,33 +3371,33 @@ const Yo = () => ++Ho, Pn = ".", An = (r) => r ? r.split(Pn) : [], Ko = (r) => r
|
|
|
3375
3371
|
}, r)), () => {
|
|
3376
3372
|
clearTimeout(t);
|
|
3377
3373
|
};
|
|
3378
|
-
},
|
|
3374
|
+
}, ao = (r) => {
|
|
3379
3375
|
if (!r.src && !r.srcdoc) {
|
|
3380
3376
|
const e = new Error("Iframe must have src or srcdoc property defined.");
|
|
3381
3377
|
throw e.code = Et.NoIframeSrc, e;
|
|
3382
3378
|
}
|
|
3383
|
-
},
|
|
3384
|
-
let { iframe: e, methods: t = {}, childOrigin: n, timeout: s, debug:
|
|
3385
|
-
const u =
|
|
3386
|
-
n || (
|
|
3387
|
-
const _ = n === "null" ? "*" : n, O = Mn(t), V =
|
|
3379
|
+
}, so = (r) => {
|
|
3380
|
+
let { iframe: e, methods: t = {}, childOrigin: n, timeout: s, debug: i = !1 } = r;
|
|
3381
|
+
const u = Zi(i), l = Li("Parent", u), { onDestroy: p, destroy: m } = l;
|
|
3382
|
+
n || (ao(e), n = zi(e.src));
|
|
3383
|
+
const _ = n === "null" ? "*" : n, O = Mn(t), V = eo(u, O, n, _), $ = Xi(O, n, _, l, u);
|
|
3388
3384
|
return {
|
|
3389
|
-
promise: new Promise((fe,
|
|
3390
|
-
const me =
|
|
3385
|
+
promise: new Promise((fe, G) => {
|
|
3386
|
+
const me = no(s, m), se = (W) => {
|
|
3391
3387
|
if (!(W.source !== e.contentWindow || !W.data)) {
|
|
3392
3388
|
if (W.data.penpal === we.Syn) {
|
|
3393
3389
|
V(W);
|
|
3394
3390
|
return;
|
|
3395
3391
|
}
|
|
3396
3392
|
if (W.data.penpal === we.Ack) {
|
|
3397
|
-
const
|
|
3398
|
-
|
|
3393
|
+
const ie = $(W);
|
|
3394
|
+
ie && (me(), fe(ie));
|
|
3399
3395
|
return;
|
|
3400
3396
|
}
|
|
3401
3397
|
}
|
|
3402
3398
|
};
|
|
3403
|
-
window.addEventListener(je.Message, se), u("Parent: Awaiting handshake"),
|
|
3404
|
-
window.removeEventListener(je.Message, se), W &&
|
|
3399
|
+
window.addEventListener(je.Message, se), u("Parent: Awaiting handshake"), ro(e, l), p((W) => {
|
|
3400
|
+
window.removeEventListener(je.Message, se), W && G(W);
|
|
3405
3401
|
});
|
|
3406
3402
|
}),
|
|
3407
3403
|
destroy() {
|
|
@@ -3420,10 +3416,10 @@ var mr = { exports: {} }, A = {};
|
|
|
3420
3416
|
* LICENSE file in the root directory of this source tree.
|
|
3421
3417
|
*/
|
|
3422
3418
|
var un;
|
|
3423
|
-
function
|
|
3419
|
+
function io() {
|
|
3424
3420
|
if (un) return A;
|
|
3425
3421
|
un = 1;
|
|
3426
|
-
var r = Symbol.for("react.element"), e = Symbol.for("react.portal"), t = Symbol.for("react.fragment"), n = Symbol.for("react.strict_mode"), s = Symbol.for("react.profiler"),
|
|
3422
|
+
var r = Symbol.for("react.element"), e = Symbol.for("react.portal"), t = Symbol.for("react.fragment"), n = Symbol.for("react.strict_mode"), s = Symbol.for("react.profiler"), i = Symbol.for("react.provider"), u = Symbol.for("react.context"), l = Symbol.for("react.forward_ref"), p = Symbol.for("react.suspense"), m = Symbol.for("react.memo"), _ = Symbol.for("react.lazy"), O = Symbol.iterator;
|
|
3427
3423
|
function V(d) {
|
|
3428
3424
|
return d === null || typeof d != "object" ? null : (d = O && d[O] || d["@@iterator"], typeof d == "function" ? d : null);
|
|
3429
3425
|
}
|
|
@@ -3433,27 +3429,27 @@ function ii() {
|
|
|
3433
3429
|
}, enqueueReplaceState: function() {
|
|
3434
3430
|
}, enqueueSetState: function() {
|
|
3435
3431
|
} }, ee = Object.assign, fe = {};
|
|
3436
|
-
function
|
|
3432
|
+
function G(d, v, M) {
|
|
3437
3433
|
this.props = d, this.context = v, this.refs = fe, this.updater = M || $;
|
|
3438
3434
|
}
|
|
3439
|
-
|
|
3435
|
+
G.prototype.isReactComponent = {}, G.prototype.setState = function(d, v) {
|
|
3440
3436
|
if (typeof d != "object" && typeof d != "function" && d != null) throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");
|
|
3441
3437
|
this.updater.enqueueSetState(this, d, v, "setState");
|
|
3442
|
-
},
|
|
3438
|
+
}, G.prototype.forceUpdate = function(d) {
|
|
3443
3439
|
this.updater.enqueueForceUpdate(this, d, "forceUpdate");
|
|
3444
3440
|
};
|
|
3445
3441
|
function me() {
|
|
3446
3442
|
}
|
|
3447
|
-
me.prototype =
|
|
3443
|
+
me.prototype = G.prototype;
|
|
3448
3444
|
function se(d, v, M) {
|
|
3449
3445
|
this.props = d, this.context = v, this.refs = fe, this.updater = M || $;
|
|
3450
3446
|
}
|
|
3451
3447
|
var W = se.prototype = new me();
|
|
3452
|
-
W.constructor = se, ee(W,
|
|
3453
|
-
var
|
|
3448
|
+
W.constructor = se, ee(W, G.prototype), W.isPureReactComponent = !0;
|
|
3449
|
+
var ie = Array.isArray, U = Object.prototype.hasOwnProperty, re = { current: null }, ye = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
3454
3450
|
function Ne(d, v, M) {
|
|
3455
|
-
var D, L = {},
|
|
3456
|
-
if (v != null) for (D in v.ref !== void 0 && (B = v.ref), v.key !== void 0 && (
|
|
3451
|
+
var D, L = {}, J = null, B = null;
|
|
3452
|
+
if (v != null) for (D in v.ref !== void 0 && (B = v.ref), v.key !== void 0 && (J = "" + v.key), v) U.call(v, D) && !ye.hasOwnProperty(D) && (L[D] = v[D]);
|
|
3457
3453
|
var H = arguments.length - 2;
|
|
3458
3454
|
if (H === 1) L.children = M;
|
|
3459
3455
|
else if (1 < H) {
|
|
@@ -3461,7 +3457,7 @@ function ii() {
|
|
|
3461
3457
|
L.children = F;
|
|
3462
3458
|
}
|
|
3463
3459
|
if (d && d.defaultProps) for (D in H = d.defaultProps, H) L[D] === void 0 && (L[D] = H[D]);
|
|
3464
|
-
return { $$typeof: r, type: d, key:
|
|
3460
|
+
return { $$typeof: r, type: d, key: J, ref: B, props: L, _owner: re.current };
|
|
3465
3461
|
}
|
|
3466
3462
|
function kt(d, v) {
|
|
3467
3463
|
return { $$typeof: r, type: d.type, key: v, ref: d.ref, props: d.props, _owner: d._owner };
|
|
@@ -3480,11 +3476,11 @@ function ii() {
|
|
|
3480
3476
|
return typeof d == "object" && d !== null && d.key != null ? Ht("" + d.key) : v.toString(36);
|
|
3481
3477
|
}
|
|
3482
3478
|
function Fe(d, v, M, D, L) {
|
|
3483
|
-
var
|
|
3484
|
-
(
|
|
3479
|
+
var J = typeof d;
|
|
3480
|
+
(J === "undefined" || J === "boolean") && (d = null);
|
|
3485
3481
|
var B = !1;
|
|
3486
3482
|
if (d === null) B = !0;
|
|
3487
|
-
else switch (
|
|
3483
|
+
else switch (J) {
|
|
3488
3484
|
case "string":
|
|
3489
3485
|
case "number":
|
|
3490
3486
|
B = !0;
|
|
@@ -3496,23 +3492,23 @@ function ii() {
|
|
|
3496
3492
|
B = !0;
|
|
3497
3493
|
}
|
|
3498
3494
|
}
|
|
3499
|
-
if (B) return B = d, L = L(B), d = D === "" ? "." + Xe(B, 0) : D,
|
|
3495
|
+
if (B) return B = d, L = L(B), d = D === "" ? "." + Xe(B, 0) : D, ie(L) ? (M = "", d != null && (M = d.replace(Tt, "$&/") + "/"), Fe(L, v, M, "", function(ce) {
|
|
3500
3496
|
return ce;
|
|
3501
3497
|
})) : L != null && (Qe(L) && (L = kt(L, M + (!L.key || B && B.key === L.key ? "" : ("" + L.key).replace(Tt, "$&/") + "/") + d)), v.push(L)), 1;
|
|
3502
|
-
if (B = 0, D = D === "" ? "." : D + ":",
|
|
3503
|
-
|
|
3504
|
-
var F = D + Xe(
|
|
3505
|
-
B += Fe(
|
|
3498
|
+
if (B = 0, D = D === "" ? "." : D + ":", ie(d)) for (var H = 0; H < d.length; H++) {
|
|
3499
|
+
J = d[H];
|
|
3500
|
+
var F = D + Xe(J, H);
|
|
3501
|
+
B += Fe(J, v, M, F, L);
|
|
3506
3502
|
}
|
|
3507
|
-
else if (F = V(d), typeof F == "function") for (d = F.call(d), H = 0; !(
|
|
3508
|
-
else if (
|
|
3503
|
+
else if (F = V(d), typeof F == "function") for (d = F.call(d), H = 0; !(J = d.next()).done; ) J = J.value, F = D + Xe(J, H++), B += Fe(J, v, M, F, L);
|
|
3504
|
+
else if (J === "object") throw v = String(d), Error("Objects are not valid as a React child (found: " + (v === "[object Object]" ? "object with keys {" + Object.keys(d).join(", ") + "}" : v) + "). If you meant to render a collection of children, use an array instead.");
|
|
3509
3505
|
return B;
|
|
3510
3506
|
}
|
|
3511
3507
|
function ve(d, v, M) {
|
|
3512
3508
|
if (d == null) return d;
|
|
3513
3509
|
var D = [], L = 0;
|
|
3514
|
-
return Fe(d, D, "", "", function(
|
|
3515
|
-
return v.call(M,
|
|
3510
|
+
return Fe(d, D, "", "", function(J) {
|
|
3511
|
+
return v.call(M, J, L++);
|
|
3516
3512
|
}), D;
|
|
3517
3513
|
}
|
|
3518
3514
|
function xe(d) {
|
|
@@ -3547,11 +3543,11 @@ function ii() {
|
|
|
3547
3543
|
}, only: function(d) {
|
|
3548
3544
|
if (!Qe(d)) throw Error("React.Children.only expected to receive a single React element child.");
|
|
3549
3545
|
return d;
|
|
3550
|
-
} }, A.Component =
|
|
3546
|
+
} }, A.Component = G, A.Fragment = t, A.Profiler = s, A.PureComponent = se, A.StrictMode = n, A.Suspense = p, A.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = Ct, A.act = Ve, A.cloneElement = function(d, v, M) {
|
|
3551
3547
|
if (d == null) throw Error("React.cloneElement(...): The argument must be a React element, but you passed " + d + ".");
|
|
3552
|
-
var D = ee({}, d.props), L = d.key,
|
|
3548
|
+
var D = ee({}, d.props), L = d.key, J = d.ref, B = d._owner;
|
|
3553
3549
|
if (v != null) {
|
|
3554
|
-
if (v.ref !== void 0 && (
|
|
3550
|
+
if (v.ref !== void 0 && (J = v.ref, B = re.current), v.key !== void 0 && (L = "" + v.key), d.type && d.type.defaultProps) var H = d.type.defaultProps;
|
|
3555
3551
|
for (F in v) U.call(v, F) && !ye.hasOwnProperty(F) && (D[F] = v[F] === void 0 && H !== void 0 ? H[F] : v[F]);
|
|
3556
3552
|
}
|
|
3557
3553
|
var F = arguments.length - 2;
|
|
@@ -3561,9 +3557,9 @@ function ii() {
|
|
|
3561
3557
|
for (var ce = 0; ce < F; ce++) H[ce] = arguments[ce + 2];
|
|
3562
3558
|
D.children = H;
|
|
3563
3559
|
}
|
|
3564
|
-
return { $$typeof: r, type: d.type, key: L, ref:
|
|
3560
|
+
return { $$typeof: r, type: d.type, key: L, ref: J, props: D, _owner: B };
|
|
3565
3561
|
}, A.createContext = function(d) {
|
|
3566
|
-
return d = { $$typeof: u, _currentValue: d, _currentValue2: d, _threadCount: 0, Provider: null, Consumer: null, _defaultValue: null, _globalName: null }, d.Provider = { $$typeof:
|
|
3562
|
+
return d = { $$typeof: u, _currentValue: d, _currentValue2: d, _threadCount: 0, Provider: null, Consumer: null, _defaultValue: null, _globalName: null }, d.Provider = { $$typeof: i, _context: d }, d.Consumer = d;
|
|
3567
3563
|
}, A.createElement = Ne, A.createFactory = function(d) {
|
|
3568
3564
|
var v = Ne.bind(null, d);
|
|
3569
3565
|
return v.type = d, v;
|
|
@@ -3626,16 +3622,16 @@ var st = { exports: {} };
|
|
|
3626
3622
|
*/
|
|
3627
3623
|
st.exports;
|
|
3628
3624
|
var ln;
|
|
3629
|
-
function
|
|
3625
|
+
function oo() {
|
|
3630
3626
|
return ln || (ln = 1, function(r, e) {
|
|
3631
3627
|
process.env.NODE_ENV !== "production" && function() {
|
|
3632
3628
|
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());
|
|
3633
|
-
var t = "18.3.1", n = Symbol.for("react.element"), s = Symbol.for("react.portal"),
|
|
3629
|
+
var t = "18.3.1", n = Symbol.for("react.element"), s = Symbol.for("react.portal"), i = Symbol.for("react.fragment"), u = Symbol.for("react.strict_mode"), l = Symbol.for("react.profiler"), p = Symbol.for("react.provider"), m = Symbol.for("react.context"), _ = Symbol.for("react.forward_ref"), O = Symbol.for("react.suspense"), V = Symbol.for("react.suspense_list"), $ = Symbol.for("react.memo"), ee = Symbol.for("react.lazy"), fe = Symbol.for("react.offscreen"), G = Symbol.iterator, me = "@@iterator";
|
|
3634
3630
|
function se(a) {
|
|
3635
3631
|
if (a === null || typeof a != "object")
|
|
3636
3632
|
return null;
|
|
3637
|
-
var
|
|
3638
|
-
return typeof
|
|
3633
|
+
var o = G && a[G] || a[me];
|
|
3634
|
+
return typeof o == "function" ? o : null;
|
|
3639
3635
|
}
|
|
3640
3636
|
var W = {
|
|
3641
3637
|
/**
|
|
@@ -3643,7 +3639,7 @@ function ci() {
|
|
|
3643
3639
|
* @type {ReactComponent}
|
|
3644
3640
|
*/
|
|
3645
3641
|
current: null
|
|
3646
|
-
},
|
|
3642
|
+
}, ie = {
|
|
3647
3643
|
transition: null
|
|
3648
3644
|
}, U = {
|
|
3649
3645
|
current: null,
|
|
@@ -3665,46 +3661,46 @@ function ci() {
|
|
|
3665
3661
|
}, ye.getCurrentStack = null, ye.getStackAddendum = function() {
|
|
3666
3662
|
var a = "";
|
|
3667
3663
|
Ne && (a += Ne);
|
|
3668
|
-
var
|
|
3669
|
-
return
|
|
3664
|
+
var o = ye.getCurrentStack;
|
|
3665
|
+
return o && (a += o() || ""), a;
|
|
3670
3666
|
};
|
|
3671
3667
|
var Qe = !1, Ht = !1, Tt = !1, Xe = !1, Fe = !1, ve = {
|
|
3672
3668
|
ReactCurrentDispatcher: W,
|
|
3673
|
-
ReactCurrentBatchConfig:
|
|
3669
|
+
ReactCurrentBatchConfig: ie,
|
|
3674
3670
|
ReactCurrentOwner: re
|
|
3675
3671
|
};
|
|
3676
3672
|
ve.ReactDebugCurrentFrame = ye, ve.ReactCurrentActQueue = U;
|
|
3677
3673
|
function xe(a) {
|
|
3678
3674
|
{
|
|
3679
|
-
for (var
|
|
3675
|
+
for (var o = arguments.length, f = new Array(o > 1 ? o - 1 : 0), h = 1; h < o; h++)
|
|
3680
3676
|
f[h - 1] = arguments[h];
|
|
3681
3677
|
De("warn", a, f);
|
|
3682
3678
|
}
|
|
3683
3679
|
}
|
|
3684
3680
|
function S(a) {
|
|
3685
3681
|
{
|
|
3686
|
-
for (var
|
|
3682
|
+
for (var o = arguments.length, f = new Array(o > 1 ? o - 1 : 0), h = 1; h < o; h++)
|
|
3687
3683
|
f[h - 1] = arguments[h];
|
|
3688
3684
|
De("error", a, f);
|
|
3689
3685
|
}
|
|
3690
3686
|
}
|
|
3691
|
-
function De(a,
|
|
3687
|
+
function De(a, o, f) {
|
|
3692
3688
|
{
|
|
3693
3689
|
var h = ve.ReactDebugCurrentFrame, g = h.getStackAddendum();
|
|
3694
|
-
g !== "" && (
|
|
3690
|
+
g !== "" && (o += "%s", f = f.concat([g]));
|
|
3695
3691
|
var T = f.map(function(w) {
|
|
3696
3692
|
return String(w);
|
|
3697
3693
|
});
|
|
3698
|
-
T.unshift("Warning: " +
|
|
3694
|
+
T.unshift("Warning: " + o), Function.prototype.apply.call(console[a], console, T);
|
|
3699
3695
|
}
|
|
3700
3696
|
}
|
|
3701
3697
|
var Ct = {};
|
|
3702
|
-
function Ve(a,
|
|
3698
|
+
function Ve(a, o) {
|
|
3703
3699
|
{
|
|
3704
|
-
var f = a.constructor, h = f && (f.displayName || f.name) || "ReactClass", g = h + "." +
|
|
3700
|
+
var f = a.constructor, h = f && (f.displayName || f.name) || "ReactClass", g = h + "." + o;
|
|
3705
3701
|
if (Ct[g])
|
|
3706
3702
|
return;
|
|
3707
|
-
S("Can't call %s on a component that is not yet mounted. This is a no-op, but it might indicate a bug in your application. Instead, assign to `this.state` directly or define a `state = {};` class property with the desired state in the %s component.",
|
|
3703
|
+
S("Can't call %s on a component that is not yet mounted. This is a no-op, but it might indicate a bug in your application. Instead, assign to `this.state` directly or define a `state = {};` class property with the desired state in the %s component.", o, h), Ct[g] = !0;
|
|
3708
3704
|
}
|
|
3709
3705
|
}
|
|
3710
3706
|
var d = {
|
|
@@ -3733,7 +3729,7 @@ function ci() {
|
|
|
3733
3729
|
* @param {?string} callerName name of the calling function in the public API.
|
|
3734
3730
|
* @internal
|
|
3735
3731
|
*/
|
|
3736
|
-
enqueueForceUpdate: function(a,
|
|
3732
|
+
enqueueForceUpdate: function(a, o, f) {
|
|
3737
3733
|
Ve(a, "forceUpdate");
|
|
3738
3734
|
},
|
|
3739
3735
|
/**
|
|
@@ -3749,7 +3745,7 @@ function ci() {
|
|
|
3749
3745
|
* @param {?string} callerName name of the calling function in the public API.
|
|
3750
3746
|
* @internal
|
|
3751
3747
|
*/
|
|
3752
|
-
enqueueReplaceState: function(a,
|
|
3748
|
+
enqueueReplaceState: function(a, o, f, h) {
|
|
3753
3749
|
Ve(a, "replaceState");
|
|
3754
3750
|
},
|
|
3755
3751
|
/**
|
|
@@ -3764,18 +3760,18 @@ function ci() {
|
|
|
3764
3760
|
* @param {?string} Name of the calling function in the public API.
|
|
3765
3761
|
* @internal
|
|
3766
3762
|
*/
|
|
3767
|
-
enqueueSetState: function(a,
|
|
3763
|
+
enqueueSetState: function(a, o, f, h) {
|
|
3768
3764
|
Ve(a, "setState");
|
|
3769
3765
|
}
|
|
3770
3766
|
}, v = Object.assign, M = {};
|
|
3771
3767
|
Object.freeze(M);
|
|
3772
|
-
function D(a,
|
|
3773
|
-
this.props = a, this.context =
|
|
3768
|
+
function D(a, o, f) {
|
|
3769
|
+
this.props = a, this.context = o, this.refs = M, this.updater = f || d;
|
|
3774
3770
|
}
|
|
3775
|
-
D.prototype.isReactComponent = {}, D.prototype.setState = function(a,
|
|
3771
|
+
D.prototype.isReactComponent = {}, D.prototype.setState = function(a, o) {
|
|
3776
3772
|
if (typeof a != "object" && typeof a != "function" && a != null)
|
|
3777
3773
|
throw new Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");
|
|
3778
|
-
this.updater.enqueueSetState(this, a,
|
|
3774
|
+
this.updater.enqueueSetState(this, a, o, "setState");
|
|
3779
3775
|
}, D.prototype.forceUpdate = function(a) {
|
|
3780
3776
|
this.updater.enqueueForceUpdate(this, a, "forceUpdate");
|
|
3781
3777
|
};
|
|
@@ -3783,21 +3779,21 @@ function ci() {
|
|
|
3783
3779
|
var L = {
|
|
3784
3780
|
isMounted: ["isMounted", "Instead, make sure to clean up subscriptions and pending requests in componentWillUnmount to prevent memory leaks."],
|
|
3785
3781
|
replaceState: ["replaceState", "Refactor your code to use setState instead (see https://github.com/facebook/react/issues/3236)."]
|
|
3786
|
-
},
|
|
3782
|
+
}, J = function(a, o) {
|
|
3787
3783
|
Object.defineProperty(D.prototype, a, {
|
|
3788
3784
|
get: function() {
|
|
3789
|
-
xe("%s(...) is deprecated in plain JavaScript React classes. %s",
|
|
3785
|
+
xe("%s(...) is deprecated in plain JavaScript React classes. %s", o[0], o[1]);
|
|
3790
3786
|
}
|
|
3791
3787
|
});
|
|
3792
3788
|
};
|
|
3793
3789
|
for (var B in L)
|
|
3794
|
-
L.hasOwnProperty(B) &&
|
|
3790
|
+
L.hasOwnProperty(B) && J(B, L[B]);
|
|
3795
3791
|
}
|
|
3796
3792
|
function H() {
|
|
3797
3793
|
}
|
|
3798
3794
|
H.prototype = D.prototype;
|
|
3799
|
-
function F(a,
|
|
3800
|
-
this.props = a, this.context =
|
|
3795
|
+
function F(a, o, f) {
|
|
3796
|
+
this.props = a, this.context = o, this.refs = M, this.updater = f || d;
|
|
3801
3797
|
}
|
|
3802
3798
|
var ce = F.prototype = new H();
|
|
3803
3799
|
ce.constructor = F, v(ce, D.prototype), ce.isPureReactComponent = !0;
|
|
@@ -3813,7 +3809,7 @@ function ci() {
|
|
|
3813
3809
|
}
|
|
3814
3810
|
function zn(a) {
|
|
3815
3811
|
{
|
|
3816
|
-
var
|
|
3812
|
+
var o = typeof Symbol == "function" && Symbol.toStringTag, f = o && a[Symbol.toStringTag] || a.constructor.name || "Object";
|
|
3817
3813
|
return f;
|
|
3818
3814
|
}
|
|
3819
3815
|
}
|
|
@@ -3831,11 +3827,11 @@ function ci() {
|
|
|
3831
3827
|
if (qn(a))
|
|
3832
3828
|
return S("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", zn(a)), _r(a);
|
|
3833
3829
|
}
|
|
3834
|
-
function Wn(a,
|
|
3830
|
+
function Wn(a, o, f) {
|
|
3835
3831
|
var h = a.displayName;
|
|
3836
3832
|
if (h)
|
|
3837
3833
|
return h;
|
|
3838
|
-
var g =
|
|
3834
|
+
var g = o.displayName || o.name || "";
|
|
3839
3835
|
return g !== "" ? f + "(" + g + ")" : f;
|
|
3840
3836
|
}
|
|
3841
3837
|
function br(a) {
|
|
@@ -3849,7 +3845,7 @@ function ci() {
|
|
|
3849
3845
|
if (typeof a == "string")
|
|
3850
3846
|
return a;
|
|
3851
3847
|
switch (a) {
|
|
3852
|
-
case
|
|
3848
|
+
case i:
|
|
3853
3849
|
return "Fragment";
|
|
3854
3850
|
case s:
|
|
3855
3851
|
return "Portal";
|
|
@@ -3865,8 +3861,8 @@ function ci() {
|
|
|
3865
3861
|
if (typeof a == "object")
|
|
3866
3862
|
switch (a.$$typeof) {
|
|
3867
3863
|
case m:
|
|
3868
|
-
var
|
|
3869
|
-
return br(
|
|
3864
|
+
var o = a;
|
|
3865
|
+
return br(o) + ".Consumer";
|
|
3870
3866
|
case p:
|
|
3871
3867
|
var f = a;
|
|
3872
3868
|
return br(f._context) + ".Provider";
|
|
@@ -3895,32 +3891,32 @@ function ci() {
|
|
|
3895
3891
|
Yt = {};
|
|
3896
3892
|
function Tr(a) {
|
|
3897
3893
|
if (et.call(a, "ref")) {
|
|
3898
|
-
var
|
|
3899
|
-
if (
|
|
3894
|
+
var o = Object.getOwnPropertyDescriptor(a, "ref").get;
|
|
3895
|
+
if (o && o.isReactWarning)
|
|
3900
3896
|
return !1;
|
|
3901
3897
|
}
|
|
3902
3898
|
return a.ref !== void 0;
|
|
3903
3899
|
}
|
|
3904
3900
|
function Cr(a) {
|
|
3905
3901
|
if (et.call(a, "key")) {
|
|
3906
|
-
var
|
|
3907
|
-
if (
|
|
3902
|
+
var o = Object.getOwnPropertyDescriptor(a, "key").get;
|
|
3903
|
+
if (o && o.isReactWarning)
|
|
3908
3904
|
return !1;
|
|
3909
3905
|
}
|
|
3910
3906
|
return a.key !== void 0;
|
|
3911
3907
|
}
|
|
3912
|
-
function Bn(a,
|
|
3908
|
+
function Bn(a, o) {
|
|
3913
3909
|
var f = function() {
|
|
3914
|
-
wr || (wr = !0, S("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",
|
|
3910
|
+
wr || (wr = !0, S("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", o));
|
|
3915
3911
|
};
|
|
3916
3912
|
f.isReactWarning = !0, Object.defineProperty(a, "key", {
|
|
3917
3913
|
get: f,
|
|
3918
3914
|
configurable: !0
|
|
3919
3915
|
});
|
|
3920
3916
|
}
|
|
3921
|
-
function Hn(a,
|
|
3917
|
+
function Hn(a, o) {
|
|
3922
3918
|
var f = function() {
|
|
3923
|
-
kr || (kr = !0, S("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",
|
|
3919
|
+
kr || (kr = !0, S("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", o));
|
|
3924
3920
|
};
|
|
3925
3921
|
f.isReactWarning = !0, Object.defineProperty(a, "ref", {
|
|
3926
3922
|
get: f,
|
|
@@ -3929,17 +3925,17 @@ function ci() {
|
|
|
3929
3925
|
}
|
|
3930
3926
|
function Yn(a) {
|
|
3931
3927
|
if (typeof a.ref == "string" && re.current && a.__self && re.current.stateNode !== a.__self) {
|
|
3932
|
-
var
|
|
3933
|
-
Yt[
|
|
3928
|
+
var o = Re(re.current.type);
|
|
3929
|
+
Yt[o] || (S('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', o, a.ref), Yt[o] = !0);
|
|
3934
3930
|
}
|
|
3935
3931
|
}
|
|
3936
|
-
var Kt = function(a,
|
|
3932
|
+
var Kt = function(a, o, f, h, g, T, w) {
|
|
3937
3933
|
var R = {
|
|
3938
3934
|
// This tag allows us to uniquely identify this as a React Element
|
|
3939
3935
|
$$typeof: n,
|
|
3940
3936
|
// Built-in properties that belong on the element
|
|
3941
3937
|
type: a,
|
|
3942
|
-
key:
|
|
3938
|
+
key: o,
|
|
3943
3939
|
ref: f,
|
|
3944
3940
|
props: w,
|
|
3945
3941
|
// Record the component responsible for creating this element.
|
|
@@ -3962,12 +3958,12 @@ function ci() {
|
|
|
3962
3958
|
value: g
|
|
3963
3959
|
}), Object.freeze && (Object.freeze(R.props), Object.freeze(R)), R;
|
|
3964
3960
|
};
|
|
3965
|
-
function Kn(a,
|
|
3961
|
+
function Kn(a, o, f) {
|
|
3966
3962
|
var h, g = {}, T = null, w = null, R = null, j = null;
|
|
3967
|
-
if (
|
|
3968
|
-
Tr(
|
|
3969
|
-
for (h in
|
|
3970
|
-
et.call(
|
|
3963
|
+
if (o != null) {
|
|
3964
|
+
Tr(o) && (w = o.ref, Yn(o)), Cr(o) && (xt(o.key), T = "" + o.key), R = o.__self === void 0 ? null : o.__self, j = o.__source === void 0 ? null : o.__source;
|
|
3965
|
+
for (h in o)
|
|
3966
|
+
et.call(o, h) && !Er.hasOwnProperty(h) && (g[h] = o[h]);
|
|
3971
3967
|
}
|
|
3972
3968
|
var Z = arguments.length - 2;
|
|
3973
3969
|
if (Z === 1)
|
|
@@ -3988,20 +3984,20 @@ function ci() {
|
|
|
3988
3984
|
}
|
|
3989
3985
|
return Kt(a, T, w, R, j, re.current, g);
|
|
3990
3986
|
}
|
|
3991
|
-
function
|
|
3992
|
-
var f = Kt(a.type,
|
|
3987
|
+
function Gn(a, o) {
|
|
3988
|
+
var f = Kt(a.type, o, a.ref, a._self, a._source, a._owner, a.props);
|
|
3993
3989
|
return f;
|
|
3994
3990
|
}
|
|
3995
|
-
function
|
|
3991
|
+
function Jn(a, o, f) {
|
|
3996
3992
|
if (a == null)
|
|
3997
3993
|
throw new Error("React.cloneElement(...): The argument must be a React element, but you passed " + a + ".");
|
|
3998
3994
|
var h, g = v({}, a.props), T = a.key, w = a.ref, R = a._self, j = a._source, Z = a._owner;
|
|
3999
|
-
if (
|
|
4000
|
-
Tr(
|
|
3995
|
+
if (o != null) {
|
|
3996
|
+
Tr(o) && (w = o.ref, Z = re.current), Cr(o) && (xt(o.key), T = "" + o.key);
|
|
4001
3997
|
var z;
|
|
4002
3998
|
a.type && a.type.defaultProps && (z = a.type.defaultProps);
|
|
4003
|
-
for (h in
|
|
4004
|
-
et.call(
|
|
3999
|
+
for (h in o)
|
|
4000
|
+
et.call(o, h) && !Er.hasOwnProperty(h) && (o[h] === void 0 && z !== void 0 ? g[h] = z[h] : g[h] = o[h]);
|
|
4005
4001
|
}
|
|
4006
4002
|
var q = arguments.length - 2;
|
|
4007
4003
|
if (q === 1)
|
|
@@ -4018,10 +4014,10 @@ function ci() {
|
|
|
4018
4014
|
}
|
|
4019
4015
|
var Sr = ".", Qn = ":";
|
|
4020
4016
|
function Xn(a) {
|
|
4021
|
-
var
|
|
4017
|
+
var o = /[=:]/g, f = {
|
|
4022
4018
|
"=": "=0",
|
|
4023
4019
|
":": "=2"
|
|
4024
|
-
}, h = a.replace(
|
|
4020
|
+
}, h = a.replace(o, function(g) {
|
|
4025
4021
|
return f[g];
|
|
4026
4022
|
});
|
|
4027
4023
|
return "$" + h;
|
|
@@ -4030,10 +4026,10 @@ function ci() {
|
|
|
4030
4026
|
function Rr(a) {
|
|
4031
4027
|
return a.replace(ea, "$&/");
|
|
4032
4028
|
}
|
|
4033
|
-
function
|
|
4034
|
-
return typeof a == "object" && a !== null && a.key != null ? (xt(a.key), Xn("" + a.key)) :
|
|
4029
|
+
function Gt(a, o) {
|
|
4030
|
+
return typeof a == "object" && a !== null && a.key != null ? (xt(a.key), Xn("" + a.key)) : o.toString(36);
|
|
4035
4031
|
}
|
|
4036
|
-
function Rt(a,
|
|
4032
|
+
function Rt(a, o, f, h, g) {
|
|
4037
4033
|
var T = typeof a;
|
|
4038
4034
|
(T === "undefined" || T === "boolean") && (a = null);
|
|
4039
4035
|
var w = !1;
|
|
@@ -4053,13 +4049,13 @@ function ci() {
|
|
|
4053
4049
|
}
|
|
4054
4050
|
}
|
|
4055
4051
|
if (w) {
|
|
4056
|
-
var R = a, j = g(R), Z = h === "" ? Sr +
|
|
4052
|
+
var R = a, j = g(R), Z = h === "" ? Sr + Gt(R, 0) : h;
|
|
4057
4053
|
if (St(j)) {
|
|
4058
4054
|
var z = "";
|
|
4059
|
-
Z != null && (z = Rr(Z) + "/"), Rt(j,
|
|
4055
|
+
Z != null && (z = Rr(Z) + "/"), Rt(j, o, z, "", function(Ba) {
|
|
4060
4056
|
return Ba;
|
|
4061
4057
|
});
|
|
4062
|
-
} else j != null && (ze(j) && (j.key && (!R || R.key !== j.key) && xt(j.key), j =
|
|
4058
|
+
} else j != null && (ze(j) && (j.key && (!R || R.key !== j.key) && xt(j.key), j = Gn(
|
|
4063
4059
|
j,
|
|
4064
4060
|
// Keep both the (mapped) and old keys if they differ, just as
|
|
4065
4061
|
// traverseAllChildren used to do for objects as children
|
|
@@ -4069,20 +4065,20 @@ function ci() {
|
|
|
4069
4065
|
// eslint-disable-next-line react-internal/safe-string-coercion
|
|
4070
4066
|
Rr("" + j.key) + "/"
|
|
4071
4067
|
) : "") + Z
|
|
4072
|
-
)),
|
|
4068
|
+
)), o.push(j));
|
|
4073
4069
|
return 1;
|
|
4074
4070
|
}
|
|
4075
4071
|
var q, Y, Q = 0, ne = h === "" ? Sr : h + Qn;
|
|
4076
4072
|
if (St(a))
|
|
4077
4073
|
for (var Dt = 0; Dt < a.length; Dt++)
|
|
4078
|
-
q = a[Dt], Y = ne +
|
|
4074
|
+
q = a[Dt], Y = ne + Gt(q, Dt), Q += Rt(q, o, f, Y, g);
|
|
4079
4075
|
else {
|
|
4080
4076
|
var sr = se(a);
|
|
4081
4077
|
if (typeof sr == "function") {
|
|
4082
4078
|
var Xr = a;
|
|
4083
4079
|
sr === Xr.entries && (xr || xe("Using Maps as children is not supported. Use an array of keyed ReactElements instead."), xr = !0);
|
|
4084
4080
|
for (var qa = sr.call(Xr), en, Wa = 0; !(en = qa.next()).done; )
|
|
4085
|
-
q = en.value, Y = ne +
|
|
4081
|
+
q = en.value, Y = ne + Gt(q, Wa++), Q += Rt(q, o, f, Y, g);
|
|
4086
4082
|
} else if (T === "object") {
|
|
4087
4083
|
var tn = String(a);
|
|
4088
4084
|
throw new Error("Objects are not valid as a React child (found: " + (tn === "[object Object]" ? "object with keys {" + Object.keys(a).join(", ") + "}" : tn) + "). If you meant to render a collection of children, use an array instead.");
|
|
@@ -4090,28 +4086,28 @@ function ci() {
|
|
|
4090
4086
|
}
|
|
4091
4087
|
return Q;
|
|
4092
4088
|
}
|
|
4093
|
-
function Ot(a,
|
|
4089
|
+
function Ot(a, o, f) {
|
|
4094
4090
|
if (a == null)
|
|
4095
4091
|
return a;
|
|
4096
4092
|
var h = [], g = 0;
|
|
4097
4093
|
return Rt(a, h, "", "", function(T) {
|
|
4098
|
-
return
|
|
4094
|
+
return o.call(f, T, g++);
|
|
4099
4095
|
}), h;
|
|
4100
4096
|
}
|
|
4101
4097
|
function ta(a) {
|
|
4102
|
-
var
|
|
4098
|
+
var o = 0;
|
|
4103
4099
|
return Ot(a, function() {
|
|
4104
|
-
|
|
4105
|
-
}),
|
|
4100
|
+
o++;
|
|
4101
|
+
}), o;
|
|
4106
4102
|
}
|
|
4107
|
-
function ra(a,
|
|
4103
|
+
function ra(a, o, f) {
|
|
4108
4104
|
Ot(a, function() {
|
|
4109
|
-
|
|
4105
|
+
o.apply(this, arguments);
|
|
4110
4106
|
}, f);
|
|
4111
4107
|
}
|
|
4112
4108
|
function na(a) {
|
|
4113
|
-
return Ot(a, function(
|
|
4114
|
-
return
|
|
4109
|
+
return Ot(a, function(o) {
|
|
4110
|
+
return o;
|
|
4115
4111
|
}) || [];
|
|
4116
4112
|
}
|
|
4117
4113
|
function aa(a) {
|
|
@@ -4120,7 +4116,7 @@ function ci() {
|
|
|
4120
4116
|
return a;
|
|
4121
4117
|
}
|
|
4122
4118
|
function sa(a) {
|
|
4123
|
-
var
|
|
4119
|
+
var o = {
|
|
4124
4120
|
$$typeof: m,
|
|
4125
4121
|
// As a workaround to support multiple concurrent renderers, we categorize
|
|
4126
4122
|
// some renderers as primary and others as secondary. We only expect
|
|
@@ -4139,83 +4135,83 @@ function ci() {
|
|
|
4139
4135
|
_defaultValue: null,
|
|
4140
4136
|
_globalName: null
|
|
4141
4137
|
};
|
|
4142
|
-
|
|
4138
|
+
o.Provider = {
|
|
4143
4139
|
$$typeof: p,
|
|
4144
|
-
_context:
|
|
4140
|
+
_context: o
|
|
4145
4141
|
};
|
|
4146
4142
|
var f = !1, h = !1, g = !1;
|
|
4147
4143
|
{
|
|
4148
4144
|
var T = {
|
|
4149
4145
|
$$typeof: m,
|
|
4150
|
-
_context:
|
|
4146
|
+
_context: o
|
|
4151
4147
|
};
|
|
4152
4148
|
Object.defineProperties(T, {
|
|
4153
4149
|
Provider: {
|
|
4154
4150
|
get: function() {
|
|
4155
|
-
return h || (h = !0, S("Rendering <Context.Consumer.Provider> is not supported and will be removed in a future major release. Did you mean to render <Context.Provider> instead?")),
|
|
4151
|
+
return h || (h = !0, S("Rendering <Context.Consumer.Provider> is not supported and will be removed in a future major release. Did you mean to render <Context.Provider> instead?")), o.Provider;
|
|
4156
4152
|
},
|
|
4157
4153
|
set: function(w) {
|
|
4158
|
-
|
|
4154
|
+
o.Provider = w;
|
|
4159
4155
|
}
|
|
4160
4156
|
},
|
|
4161
4157
|
_currentValue: {
|
|
4162
4158
|
get: function() {
|
|
4163
|
-
return
|
|
4159
|
+
return o._currentValue;
|
|
4164
4160
|
},
|
|
4165
4161
|
set: function(w) {
|
|
4166
|
-
|
|
4162
|
+
o._currentValue = w;
|
|
4167
4163
|
}
|
|
4168
4164
|
},
|
|
4169
4165
|
_currentValue2: {
|
|
4170
4166
|
get: function() {
|
|
4171
|
-
return
|
|
4167
|
+
return o._currentValue2;
|
|
4172
4168
|
},
|
|
4173
4169
|
set: function(w) {
|
|
4174
|
-
|
|
4170
|
+
o._currentValue2 = w;
|
|
4175
4171
|
}
|
|
4176
4172
|
},
|
|
4177
4173
|
_threadCount: {
|
|
4178
4174
|
get: function() {
|
|
4179
|
-
return
|
|
4175
|
+
return o._threadCount;
|
|
4180
4176
|
},
|
|
4181
4177
|
set: function(w) {
|
|
4182
|
-
|
|
4178
|
+
o._threadCount = w;
|
|
4183
4179
|
}
|
|
4184
4180
|
},
|
|
4185
4181
|
Consumer: {
|
|
4186
4182
|
get: function() {
|
|
4187
|
-
return f || (f = !0, S("Rendering <Context.Consumer.Consumer> is not supported and will be removed in a future major release. Did you mean to render <Context.Consumer> instead?")),
|
|
4183
|
+
return f || (f = !0, S("Rendering <Context.Consumer.Consumer> is not supported and will be removed in a future major release. Did you mean to render <Context.Consumer> instead?")), o.Consumer;
|
|
4188
4184
|
}
|
|
4189
4185
|
},
|
|
4190
4186
|
displayName: {
|
|
4191
4187
|
get: function() {
|
|
4192
|
-
return
|
|
4188
|
+
return o.displayName;
|
|
4193
4189
|
},
|
|
4194
4190
|
set: function(w) {
|
|
4195
4191
|
g || (xe("Setting `displayName` on Context.Consumer has no effect. You should set it directly on the context with Context.displayName = '%s'.", w), g = !0);
|
|
4196
4192
|
}
|
|
4197
4193
|
}
|
|
4198
|
-
}),
|
|
4194
|
+
}), o.Consumer = T;
|
|
4199
4195
|
}
|
|
4200
|
-
return
|
|
4196
|
+
return o._currentRenderer = null, o._currentRenderer2 = null, o;
|
|
4201
4197
|
}
|
|
4202
|
-
var tt = -1,
|
|
4203
|
-
function
|
|
4198
|
+
var tt = -1, Jt = 0, Or = 1, ia = 2;
|
|
4199
|
+
function oa(a) {
|
|
4204
4200
|
if (a._status === tt) {
|
|
4205
|
-
var
|
|
4201
|
+
var o = a._result, f = o();
|
|
4206
4202
|
if (f.then(function(T) {
|
|
4207
|
-
if (a._status ===
|
|
4203
|
+
if (a._status === Jt || a._status === tt) {
|
|
4208
4204
|
var w = a;
|
|
4209
4205
|
w._status = Or, w._result = T;
|
|
4210
4206
|
}
|
|
4211
4207
|
}, function(T) {
|
|
4212
|
-
if (a._status ===
|
|
4208
|
+
if (a._status === Jt || a._status === tt) {
|
|
4213
4209
|
var w = a;
|
|
4214
|
-
w._status =
|
|
4210
|
+
w._status = ia, w._result = T;
|
|
4215
4211
|
}
|
|
4216
4212
|
}), a._status === tt) {
|
|
4217
4213
|
var h = a;
|
|
4218
|
-
h._status =
|
|
4214
|
+
h._status = Jt, h._result = f;
|
|
4219
4215
|
}
|
|
4220
4216
|
}
|
|
4221
4217
|
if (a._status === Or) {
|
|
@@ -4233,14 +4229,14 @@ Your code should look like:
|
|
|
4233
4229
|
throw a._result;
|
|
4234
4230
|
}
|
|
4235
4231
|
function ca(a) {
|
|
4236
|
-
var
|
|
4232
|
+
var o = {
|
|
4237
4233
|
// We use these fields to store the result.
|
|
4238
4234
|
_status: tt,
|
|
4239
4235
|
_result: a
|
|
4240
4236
|
}, f = {
|
|
4241
4237
|
$$typeof: ee,
|
|
4242
|
-
_payload:
|
|
4243
|
-
_init:
|
|
4238
|
+
_payload: o,
|
|
4239
|
+
_init: oa
|
|
4244
4240
|
};
|
|
4245
4241
|
{
|
|
4246
4242
|
var h, g;
|
|
@@ -4273,13 +4269,13 @@ Your code should look like:
|
|
|
4273
4269
|
}
|
|
4274
4270
|
function ua(a) {
|
|
4275
4271
|
a != null && a.$$typeof === $ ? S("forwardRef requires a render function but received a `memo` component. Instead of forwardRef(memo(...)), use memo(forwardRef(...)).") : typeof a != "function" ? S("forwardRef requires a render function but was given %s.", a === null ? "null" : typeof a) : a.length !== 0 && a.length !== 2 && S("forwardRef render functions accept exactly two parameters: props and ref. %s", a.length === 1 ? "Did you forget to use the ref parameter?" : "Any additional parameter will be undefined."), a != null && (a.defaultProps != null || a.propTypes != null) && S("forwardRef render functions do not support propTypes or defaultProps. Did you accidentally pass a React component?");
|
|
4276
|
-
var
|
|
4272
|
+
var o = {
|
|
4277
4273
|
$$typeof: _,
|
|
4278
4274
|
render: a
|
|
4279
4275
|
};
|
|
4280
4276
|
{
|
|
4281
4277
|
var f;
|
|
4282
|
-
Object.defineProperty(
|
|
4278
|
+
Object.defineProperty(o, "displayName", {
|
|
4283
4279
|
enumerable: !1,
|
|
4284
4280
|
configurable: !0,
|
|
4285
4281
|
get: function() {
|
|
@@ -4290,23 +4286,23 @@ Your code should look like:
|
|
|
4290
4286
|
}
|
|
4291
4287
|
});
|
|
4292
4288
|
}
|
|
4293
|
-
return
|
|
4289
|
+
return o;
|
|
4294
4290
|
}
|
|
4295
4291
|
var Ir;
|
|
4296
4292
|
Ir = Symbol.for("react.module.reference");
|
|
4297
4293
|
function Pr(a) {
|
|
4298
|
-
return !!(typeof a == "string" || typeof a == "function" || a ===
|
|
4294
|
+
return !!(typeof a == "string" || typeof a == "function" || a === i || a === l || Fe || a === u || a === O || a === V || Xe || a === fe || Qe || Ht || Tt || typeof a == "object" && a !== null && (a.$$typeof === ee || a.$$typeof === $ || a.$$typeof === p || a.$$typeof === m || a.$$typeof === _ || // This needs to include all possible module reference object
|
|
4299
4295
|
// types supported by any Flight configuration anywhere since
|
|
4300
4296
|
// we don't know which Flight build this will end up being used
|
|
4301
4297
|
// with.
|
|
4302
4298
|
a.$$typeof === Ir || a.getModuleId !== void 0));
|
|
4303
4299
|
}
|
|
4304
|
-
function la(a,
|
|
4300
|
+
function la(a, o) {
|
|
4305
4301
|
Pr(a) || S("memo: The first argument must be a component. Instead received: %s", a === null ? "null" : typeof a);
|
|
4306
4302
|
var f = {
|
|
4307
4303
|
$$typeof: $,
|
|
4308
4304
|
type: a,
|
|
4309
|
-
compare:
|
|
4305
|
+
compare: o === void 0 ? null : o
|
|
4310
4306
|
};
|
|
4311
4307
|
{
|
|
4312
4308
|
var h;
|
|
@@ -4332,53 +4328,53 @@ Your code should look like:
|
|
|
4332
4328
|
See https://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem.`), a;
|
|
4333
4329
|
}
|
|
4334
4330
|
function da(a) {
|
|
4335
|
-
var
|
|
4331
|
+
var o = ue();
|
|
4336
4332
|
if (a._context !== void 0) {
|
|
4337
4333
|
var f = a._context;
|
|
4338
4334
|
f.Consumer === a ? S("Calling useContext(Context.Consumer) is not supported, may cause bugs, and will be removed in a future major release. Did you mean to call useContext(Context) instead?") : f.Provider === a && S("Calling useContext(Context.Provider) is not supported. Did you mean to call useContext(Context) instead?");
|
|
4339
4335
|
}
|
|
4340
|
-
return
|
|
4336
|
+
return o.useContext(a);
|
|
4341
4337
|
}
|
|
4342
4338
|
function fa(a) {
|
|
4343
|
-
var
|
|
4344
|
-
return
|
|
4339
|
+
var o = ue();
|
|
4340
|
+
return o.useState(a);
|
|
4345
4341
|
}
|
|
4346
|
-
function ha(a,
|
|
4342
|
+
function ha(a, o, f) {
|
|
4347
4343
|
var h = ue();
|
|
4348
|
-
return h.useReducer(a,
|
|
4344
|
+
return h.useReducer(a, o, f);
|
|
4349
4345
|
}
|
|
4350
4346
|
function pa(a) {
|
|
4351
|
-
var
|
|
4352
|
-
return
|
|
4347
|
+
var o = ue();
|
|
4348
|
+
return o.useRef(a);
|
|
4353
4349
|
}
|
|
4354
|
-
function ma(a,
|
|
4350
|
+
function ma(a, o) {
|
|
4355
4351
|
var f = ue();
|
|
4356
|
-
return f.useEffect(a,
|
|
4352
|
+
return f.useEffect(a, o);
|
|
4357
4353
|
}
|
|
4358
|
-
function ya(a,
|
|
4354
|
+
function ya(a, o) {
|
|
4359
4355
|
var f = ue();
|
|
4360
|
-
return f.useInsertionEffect(a,
|
|
4356
|
+
return f.useInsertionEffect(a, o);
|
|
4361
4357
|
}
|
|
4362
|
-
function va(a,
|
|
4358
|
+
function va(a, o) {
|
|
4363
4359
|
var f = ue();
|
|
4364
|
-
return f.useLayoutEffect(a,
|
|
4360
|
+
return f.useLayoutEffect(a, o);
|
|
4365
4361
|
}
|
|
4366
|
-
function ga(a,
|
|
4362
|
+
function ga(a, o) {
|
|
4367
4363
|
var f = ue();
|
|
4368
|
-
return f.useCallback(a,
|
|
4364
|
+
return f.useCallback(a, o);
|
|
4369
4365
|
}
|
|
4370
|
-
function _a(a,
|
|
4366
|
+
function _a(a, o) {
|
|
4371
4367
|
var f = ue();
|
|
4372
|
-
return f.useMemo(a,
|
|
4368
|
+
return f.useMemo(a, o);
|
|
4373
4369
|
}
|
|
4374
|
-
function ba(a,
|
|
4370
|
+
function ba(a, o, f) {
|
|
4375
4371
|
var h = ue();
|
|
4376
|
-
return h.useImperativeHandle(a,
|
|
4372
|
+
return h.useImperativeHandle(a, o, f);
|
|
4377
4373
|
}
|
|
4378
|
-
function Ea(a,
|
|
4374
|
+
function Ea(a, o) {
|
|
4379
4375
|
{
|
|
4380
4376
|
var f = ue();
|
|
4381
|
-
return f.useDebugValue(a,
|
|
4377
|
+
return f.useDebugValue(a, o);
|
|
4382
4378
|
}
|
|
4383
4379
|
}
|
|
4384
4380
|
function wa() {
|
|
@@ -4386,16 +4382,16 @@ See https://reactjs.org/link/invalid-hook-call for tips about how to debug and f
|
|
|
4386
4382
|
return a.useTransition();
|
|
4387
4383
|
}
|
|
4388
4384
|
function ka(a) {
|
|
4389
|
-
var
|
|
4390
|
-
return
|
|
4385
|
+
var o = ue();
|
|
4386
|
+
return o.useDeferredValue(a);
|
|
4391
4387
|
}
|
|
4392
4388
|
function Ta() {
|
|
4393
4389
|
var a = ue();
|
|
4394
4390
|
return a.useId();
|
|
4395
4391
|
}
|
|
4396
|
-
function Ca(a,
|
|
4392
|
+
function Ca(a, o, f) {
|
|
4397
4393
|
var h = ue();
|
|
4398
|
-
return h.useSyncExternalStore(a,
|
|
4394
|
+
return h.useSyncExternalStore(a, o, f);
|
|
4399
4395
|
}
|
|
4400
4396
|
var rt = 0, Ar, Mr, jr, Nr, Dr, $r, Lr;
|
|
4401
4397
|
function Zr() {
|
|
@@ -4460,7 +4456,7 @@ See https://reactjs.org/link/invalid-hook-call for tips about how to debug and f
|
|
|
4460
4456
|
}
|
|
4461
4457
|
}
|
|
4462
4458
|
var Qt = ve.ReactCurrentDispatcher, Xt;
|
|
4463
|
-
function It(a,
|
|
4459
|
+
function It(a, o, f) {
|
|
4464
4460
|
{
|
|
4465
4461
|
if (Xt === void 0)
|
|
4466
4462
|
try {
|
|
@@ -4478,7 +4474,7 @@ See https://reactjs.org/link/invalid-hook-call for tips about how to debug and f
|
|
|
4478
4474
|
var Ra = typeof WeakMap == "function" ? WeakMap : Map;
|
|
4479
4475
|
Pt = new Ra();
|
|
4480
4476
|
}
|
|
4481
|
-
function Ur(a,
|
|
4477
|
+
function Ur(a, o) {
|
|
4482
4478
|
if (!a || er)
|
|
4483
4479
|
return "";
|
|
4484
4480
|
{
|
|
@@ -4493,7 +4489,7 @@ See https://reactjs.org/link/invalid-hook-call for tips about how to debug and f
|
|
|
4493
4489
|
var T;
|
|
4494
4490
|
T = Qt.current, Qt.current = null, Sa();
|
|
4495
4491
|
try {
|
|
4496
|
-
if (
|
|
4492
|
+
if (o) {
|
|
4497
4493
|
var w = function() {
|
|
4498
4494
|
throw Error();
|
|
4499
4495
|
};
|
|
@@ -4549,14 +4545,14 @@ See https://reactjs.org/link/invalid-hook-call for tips about how to debug and f
|
|
|
4549
4545
|
var Y = a ? a.displayName || a.name : "", Q = Y ? It(Y) : "";
|
|
4550
4546
|
return typeof a == "function" && Pt.set(a, Q), Q;
|
|
4551
4547
|
}
|
|
4552
|
-
function Oa(a,
|
|
4548
|
+
function Oa(a, o, f) {
|
|
4553
4549
|
return Ur(a, !1);
|
|
4554
4550
|
}
|
|
4555
4551
|
function Ia(a) {
|
|
4556
|
-
var
|
|
4557
|
-
return !!(
|
|
4552
|
+
var o = a.prototype;
|
|
4553
|
+
return !!(o && o.isReactComponent);
|
|
4558
4554
|
}
|
|
4559
|
-
function At(a,
|
|
4555
|
+
function At(a, o, f) {
|
|
4560
4556
|
if (a == null)
|
|
4561
4557
|
return "";
|
|
4562
4558
|
if (typeof a == "function")
|
|
@@ -4574,11 +4570,11 @@ See https://reactjs.org/link/invalid-hook-call for tips about how to debug and f
|
|
|
4574
4570
|
case _:
|
|
4575
4571
|
return Oa(a.render);
|
|
4576
4572
|
case $:
|
|
4577
|
-
return At(a.type,
|
|
4573
|
+
return At(a.type, o, f);
|
|
4578
4574
|
case ee: {
|
|
4579
4575
|
var h = a, g = h._payload, T = h._init;
|
|
4580
4576
|
try {
|
|
4581
|
-
return At(T(g),
|
|
4577
|
+
return At(T(g), o, f);
|
|
4582
4578
|
} catch {
|
|
4583
4579
|
}
|
|
4584
4580
|
}
|
|
@@ -4588,12 +4584,12 @@ See https://reactjs.org/link/invalid-hook-call for tips about how to debug and f
|
|
|
4588
4584
|
var Fr = {}, Vr = ve.ReactDebugCurrentFrame;
|
|
4589
4585
|
function Mt(a) {
|
|
4590
4586
|
if (a) {
|
|
4591
|
-
var
|
|
4587
|
+
var o = a._owner, f = At(a.type, a._source, o ? o.type : null);
|
|
4592
4588
|
Vr.setExtraStackFrame(f);
|
|
4593
4589
|
} else
|
|
4594
4590
|
Vr.setExtraStackFrame(null);
|
|
4595
4591
|
}
|
|
4596
|
-
function Pa(a,
|
|
4592
|
+
function Pa(a, o, f, h, g) {
|
|
4597
4593
|
{
|
|
4598
4594
|
var T = Function.call.bind(et);
|
|
4599
4595
|
for (var w in a)
|
|
@@ -4604,7 +4600,7 @@ See https://reactjs.org/link/invalid-hook-call for tips about how to debug and f
|
|
|
4604
4600
|
var j = Error((h || "React class") + ": " + f + " type `" + w + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof a[w] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
|
4605
4601
|
throw j.name = "Invariant Violation", j;
|
|
4606
4602
|
}
|
|
4607
|
-
R = a[w](
|
|
4603
|
+
R = a[w](o, w, h, f, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
4608
4604
|
} catch (Z) {
|
|
4609
4605
|
R = Z;
|
|
4610
4606
|
}
|
|
@@ -4614,7 +4610,7 @@ See https://reactjs.org/link/invalid-hook-call for tips about how to debug and f
|
|
|
4614
4610
|
}
|
|
4615
4611
|
function qe(a) {
|
|
4616
4612
|
if (a) {
|
|
4617
|
-
var
|
|
4613
|
+
var o = a._owner, f = At(a.type, a._source, o ? o.type : null);
|
|
4618
4614
|
kt(f);
|
|
4619
4615
|
} else
|
|
4620
4616
|
kt(null);
|
|
@@ -4633,10 +4629,10 @@ Check the render method of \`` + a + "`.";
|
|
|
4633
4629
|
}
|
|
4634
4630
|
function Aa(a) {
|
|
4635
4631
|
if (a !== void 0) {
|
|
4636
|
-
var
|
|
4632
|
+
var o = a.fileName.replace(/^.*[\\\/]/, ""), f = a.lineNumber;
|
|
4637
4633
|
return `
|
|
4638
4634
|
|
|
4639
|
-
Check your code at ` +
|
|
4635
|
+
Check your code at ` + o + ":" + f + ".";
|
|
4640
4636
|
}
|
|
4641
4637
|
return "";
|
|
4642
4638
|
}
|
|
@@ -4645,19 +4641,19 @@ Check your code at ` + i + ":" + f + ".";
|
|
|
4645
4641
|
}
|
|
4646
4642
|
var qr = {};
|
|
4647
4643
|
function ja(a) {
|
|
4648
|
-
var
|
|
4649
|
-
if (!
|
|
4644
|
+
var o = zr();
|
|
4645
|
+
if (!o) {
|
|
4650
4646
|
var f = typeof a == "string" ? a : a.displayName || a.name;
|
|
4651
|
-
f && (
|
|
4647
|
+
f && (o = `
|
|
4652
4648
|
|
|
4653
4649
|
Check the top-level render call using <` + f + ">.");
|
|
4654
4650
|
}
|
|
4655
|
-
return
|
|
4651
|
+
return o;
|
|
4656
4652
|
}
|
|
4657
|
-
function Wr(a,
|
|
4653
|
+
function Wr(a, o) {
|
|
4658
4654
|
if (!(!a._store || a._store.validated || a.key != null)) {
|
|
4659
4655
|
a._store.validated = !0;
|
|
4660
|
-
var f = ja(
|
|
4656
|
+
var f = ja(o);
|
|
4661
4657
|
if (!qr[f]) {
|
|
4662
4658
|
qr[f] = !0;
|
|
4663
4659
|
var h = "";
|
|
@@ -4665,12 +4661,12 @@ Check the top-level render call using <` + f + ">.");
|
|
|
4665
4661
|
}
|
|
4666
4662
|
}
|
|
4667
4663
|
}
|
|
4668
|
-
function Br(a,
|
|
4664
|
+
function Br(a, o) {
|
|
4669
4665
|
if (typeof a == "object") {
|
|
4670
4666
|
if (St(a))
|
|
4671
4667
|
for (var f = 0; f < a.length; f++) {
|
|
4672
4668
|
var h = a[f];
|
|
4673
|
-
ze(h) && Wr(h,
|
|
4669
|
+
ze(h) && Wr(h, o);
|
|
4674
4670
|
}
|
|
4675
4671
|
else if (ze(a))
|
|
4676
4672
|
a._store && (a._store.validated = !0);
|
|
@@ -4678,39 +4674,39 @@ Check the top-level render call using <` + f + ">.");
|
|
|
4678
4674
|
var g = se(a);
|
|
4679
4675
|
if (typeof g == "function" && g !== a.entries)
|
|
4680
4676
|
for (var T = g.call(a), w; !(w = T.next()).done; )
|
|
4681
|
-
ze(w.value) && Wr(w.value,
|
|
4677
|
+
ze(w.value) && Wr(w.value, o);
|
|
4682
4678
|
}
|
|
4683
4679
|
}
|
|
4684
4680
|
}
|
|
4685
4681
|
function Hr(a) {
|
|
4686
4682
|
{
|
|
4687
|
-
var
|
|
4688
|
-
if (
|
|
4683
|
+
var o = a.type;
|
|
4684
|
+
if (o == null || typeof o == "string")
|
|
4689
4685
|
return;
|
|
4690
4686
|
var f;
|
|
4691
|
-
if (typeof
|
|
4692
|
-
f =
|
|
4693
|
-
else if (typeof
|
|
4687
|
+
if (typeof o == "function")
|
|
4688
|
+
f = o.propTypes;
|
|
4689
|
+
else if (typeof o == "object" && (o.$$typeof === _ || // Note: Memo only checks outer props here.
|
|
4694
4690
|
// Inner props are checked in the reconciler.
|
|
4695
|
-
|
|
4696
|
-
f =
|
|
4691
|
+
o.$$typeof === $))
|
|
4692
|
+
f = o.propTypes;
|
|
4697
4693
|
else
|
|
4698
4694
|
return;
|
|
4699
4695
|
if (f) {
|
|
4700
|
-
var h = Re(
|
|
4696
|
+
var h = Re(o);
|
|
4701
4697
|
Pa(f, a.props, "prop", h, a);
|
|
4702
|
-
} else if (
|
|
4698
|
+
} else if (o.PropTypes !== void 0 && !tr) {
|
|
4703
4699
|
tr = !0;
|
|
4704
|
-
var g = Re(
|
|
4700
|
+
var g = Re(o);
|
|
4705
4701
|
S("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", g || "Unknown");
|
|
4706
4702
|
}
|
|
4707
|
-
typeof
|
|
4703
|
+
typeof o.getDefaultProps == "function" && !o.getDefaultProps.isReactClassApproved && S("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
|
4708
4704
|
}
|
|
4709
4705
|
}
|
|
4710
4706
|
function Na(a) {
|
|
4711
4707
|
{
|
|
4712
|
-
for (var
|
|
4713
|
-
var h =
|
|
4708
|
+
for (var o = Object.keys(a.props), f = 0; f < o.length; f++) {
|
|
4709
|
+
var h = o[f];
|
|
4714
4710
|
if (h !== "children" && h !== "key") {
|
|
4715
4711
|
qe(a), S("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", h), qe(null);
|
|
4716
4712
|
break;
|
|
@@ -4719,12 +4715,12 @@ Check the top-level render call using <` + f + ">.");
|
|
|
4719
4715
|
a.ref !== null && (qe(a), S("Invalid attribute `ref` supplied to `React.Fragment`."), qe(null));
|
|
4720
4716
|
}
|
|
4721
4717
|
}
|
|
4722
|
-
function Yr(a,
|
|
4718
|
+
function Yr(a, o, f) {
|
|
4723
4719
|
var h = Pr(a);
|
|
4724
4720
|
if (!h) {
|
|
4725
4721
|
var g = "";
|
|
4726
4722
|
(a === void 0 || typeof a == "object" && a !== null && Object.keys(a).length === 0) && (g += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
|
|
4727
|
-
var T = Ma(
|
|
4723
|
+
var T = Ma(o);
|
|
4728
4724
|
T ? g += T : g += zr();
|
|
4729
4725
|
var w;
|
|
4730
4726
|
a === null ? w = "null" : St(a) ? w = "array" : a !== void 0 && a.$$typeof === n ? (w = "<" + (Re(a.type) || "Unknown") + " />", g = " Did you accidentally export a JSX literal instead of a component?") : w = typeof a, S("React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", w, g);
|
|
@@ -4735,58 +4731,58 @@ Check the top-level render call using <` + f + ">.");
|
|
|
4735
4731
|
if (h)
|
|
4736
4732
|
for (var j = 2; j < arguments.length; j++)
|
|
4737
4733
|
Br(arguments[j], a);
|
|
4738
|
-
return a ===
|
|
4734
|
+
return a === i ? Na(R) : Hr(R), R;
|
|
4739
4735
|
}
|
|
4740
4736
|
var Kr = !1;
|
|
4741
4737
|
function Da(a) {
|
|
4742
|
-
var
|
|
4743
|
-
return
|
|
4738
|
+
var o = Yr.bind(null, a);
|
|
4739
|
+
return o.type = a, Kr || (Kr = !0, xe("React.createFactory() is deprecated and will be removed in a future major release. Consider using JSX or use React.createElement() directly instead.")), Object.defineProperty(o, "type", {
|
|
4744
4740
|
enumerable: !1,
|
|
4745
4741
|
get: function() {
|
|
4746
4742
|
return xe("Factory.type is deprecated. Access the class directly before passing it to createFactory."), Object.defineProperty(this, "type", {
|
|
4747
4743
|
value: a
|
|
4748
4744
|
}), a;
|
|
4749
4745
|
}
|
|
4750
|
-
}),
|
|
4746
|
+
}), o;
|
|
4751
4747
|
}
|
|
4752
|
-
function $a(a,
|
|
4753
|
-
for (var h =
|
|
4748
|
+
function $a(a, o, f) {
|
|
4749
|
+
for (var h = Jn.apply(this, arguments), g = 2; g < arguments.length; g++)
|
|
4754
4750
|
Br(arguments[g], h.type);
|
|
4755
4751
|
return Hr(h), h;
|
|
4756
4752
|
}
|
|
4757
|
-
function La(a,
|
|
4758
|
-
var f =
|
|
4759
|
-
|
|
4760
|
-
var h =
|
|
4761
|
-
|
|
4753
|
+
function La(a, o) {
|
|
4754
|
+
var f = ie.transition;
|
|
4755
|
+
ie.transition = {};
|
|
4756
|
+
var h = ie.transition;
|
|
4757
|
+
ie.transition._updatedFibers = /* @__PURE__ */ new Set();
|
|
4762
4758
|
try {
|
|
4763
4759
|
a();
|
|
4764
4760
|
} finally {
|
|
4765
|
-
if (
|
|
4761
|
+
if (ie.transition = f, f === null && h._updatedFibers) {
|
|
4766
4762
|
var g = h._updatedFibers.size;
|
|
4767
4763
|
g > 10 && xe("Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table."), h._updatedFibers.clear();
|
|
4768
4764
|
}
|
|
4769
4765
|
}
|
|
4770
4766
|
}
|
|
4771
|
-
var
|
|
4767
|
+
var Gr = !1, jt = null;
|
|
4772
4768
|
function Za(a) {
|
|
4773
4769
|
if (jt === null)
|
|
4774
4770
|
try {
|
|
4775
|
-
var
|
|
4771
|
+
var o = ("require" + Math.random()).slice(0, 7), f = r && r[o];
|
|
4776
4772
|
jt = f.call(r, "timers").setImmediate;
|
|
4777
4773
|
} catch {
|
|
4778
4774
|
jt = function(g) {
|
|
4779
|
-
|
|
4775
|
+
Gr === !1 && (Gr = !0, typeof MessageChannel > "u" && S("This browser does not have a MessageChannel implementation, so enqueuing tasks via await act(async () => ...) will fail. Please file an issue at https://github.com/facebook/react/issues if you encounter this warning."));
|
|
4780
4776
|
var T = new MessageChannel();
|
|
4781
4777
|
T.port1.onmessage = g, T.port2.postMessage(void 0);
|
|
4782
4778
|
};
|
|
4783
4779
|
}
|
|
4784
4780
|
return jt(a);
|
|
4785
4781
|
}
|
|
4786
|
-
var We = 0,
|
|
4782
|
+
var We = 0, Jr = !1;
|
|
4787
4783
|
function Qr(a) {
|
|
4788
4784
|
{
|
|
4789
|
-
var
|
|
4785
|
+
var o = We;
|
|
4790
4786
|
We++, U.current === null && (U.current = []);
|
|
4791
4787
|
var f = U.isBatchingLegacy, h;
|
|
4792
4788
|
try {
|
|
@@ -4795,7 +4791,7 @@ Check the top-level render call using <` + f + ">.");
|
|
|
4795
4791
|
g !== null && (U.didScheduleLegacyUpdate = !1, ar(g));
|
|
4796
4792
|
}
|
|
4797
4793
|
} catch (Y) {
|
|
4798
|
-
throw Nt(
|
|
4794
|
+
throw Nt(o), Y;
|
|
4799
4795
|
} finally {
|
|
4800
4796
|
U.isBatchingLegacy = f;
|
|
4801
4797
|
}
|
|
@@ -4803,19 +4799,19 @@ Check the top-level render call using <` + f + ">.");
|
|
|
4803
4799
|
var T = h, w = !1, R = {
|
|
4804
4800
|
then: function(Y, Q) {
|
|
4805
4801
|
w = !0, T.then(function(ne) {
|
|
4806
|
-
Nt(
|
|
4802
|
+
Nt(o), We === 0 ? rr(ne, Y, Q) : Y(ne);
|
|
4807
4803
|
}, function(ne) {
|
|
4808
|
-
Nt(
|
|
4804
|
+
Nt(o), Q(ne);
|
|
4809
4805
|
});
|
|
4810
4806
|
}
|
|
4811
4807
|
};
|
|
4812
|
-
return !
|
|
4808
|
+
return !Jr && typeof Promise < "u" && Promise.resolve().then(function() {
|
|
4813
4809
|
}).then(function() {
|
|
4814
|
-
w || (
|
|
4810
|
+
w || (Jr = !0, S("You called act(async () => ...) without await. This could lead to unexpected testing behaviour, interleaving multiple act calls and mixing their scopes. You should - await act(async () => ...);"));
|
|
4815
4811
|
}), R;
|
|
4816
4812
|
} else {
|
|
4817
4813
|
var j = h;
|
|
4818
|
-
if (Nt(
|
|
4814
|
+
if (Nt(o), We === 0) {
|
|
4819
4815
|
var Z = U.current;
|
|
4820
4816
|
Z !== null && (ar(Z), U.current = null);
|
|
4821
4817
|
var z = {
|
|
@@ -4838,36 +4834,36 @@ Check the top-level render call using <` + f + ">.");
|
|
|
4838
4834
|
function Nt(a) {
|
|
4839
4835
|
a !== We - 1 && S("You seem to have overlapping act() calls, this is not supported. Be sure to await previous act() calls before making a new one. "), We = a;
|
|
4840
4836
|
}
|
|
4841
|
-
function rr(a,
|
|
4837
|
+
function rr(a, o, f) {
|
|
4842
4838
|
{
|
|
4843
4839
|
var h = U.current;
|
|
4844
4840
|
if (h !== null)
|
|
4845
4841
|
try {
|
|
4846
4842
|
ar(h), Za(function() {
|
|
4847
|
-
h.length === 0 ? (U.current = null,
|
|
4843
|
+
h.length === 0 ? (U.current = null, o(a)) : rr(a, o, f);
|
|
4848
4844
|
});
|
|
4849
4845
|
} catch (g) {
|
|
4850
4846
|
f(g);
|
|
4851
4847
|
}
|
|
4852
4848
|
else
|
|
4853
|
-
|
|
4849
|
+
o(a);
|
|
4854
4850
|
}
|
|
4855
4851
|
}
|
|
4856
4852
|
var nr = !1;
|
|
4857
4853
|
function ar(a) {
|
|
4858
4854
|
if (!nr) {
|
|
4859
4855
|
nr = !0;
|
|
4860
|
-
var
|
|
4856
|
+
var o = 0;
|
|
4861
4857
|
try {
|
|
4862
|
-
for (;
|
|
4863
|
-
var f = a[
|
|
4858
|
+
for (; o < a.length; o++) {
|
|
4859
|
+
var f = a[o];
|
|
4864
4860
|
do
|
|
4865
4861
|
f = f(!0);
|
|
4866
4862
|
while (f !== null);
|
|
4867
4863
|
}
|
|
4868
4864
|
a.length = 0;
|
|
4869
4865
|
} catch (h) {
|
|
4870
|
-
throw a = a.slice(
|
|
4866
|
+
throw a = a.slice(o + 1), h;
|
|
4871
4867
|
} finally {
|
|
4872
4868
|
nr = !1;
|
|
4873
4869
|
}
|
|
@@ -4880,50 +4876,50 @@ Check the top-level render call using <` + f + ">.");
|
|
|
4880
4876
|
toArray: na,
|
|
4881
4877
|
only: aa
|
|
4882
4878
|
};
|
|
4883
|
-
e.Children = za, e.Component = D, e.Fragment =
|
|
4879
|
+
e.Children = za, e.Component = D, e.Fragment = i, e.Profiler = l, e.PureComponent = F, e.StrictMode = u, e.Suspense = O, e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = ve, e.act = Qr, e.cloneElement = Fa, e.createContext = sa, e.createElement = Ua, e.createFactory = Va, e.createRef = Fn, e.forwardRef = ua, e.isValidElement = ze, e.lazy = ca, e.memo = la, e.startTransition = La, e.unstable_act = Qr, e.useCallback = ga, e.useContext = da, e.useDebugValue = Ea, e.useDeferredValue = ka, e.useEffect = ma, e.useId = Ta, e.useImperativeHandle = ba, e.useInsertionEffect = ya, e.useLayoutEffect = va, e.useMemo = _a, e.useReducer = ha, e.useRef = pa, e.useState = fa, e.useSyncExternalStore = Ca, e.useTransition = wa, e.version = t, typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error());
|
|
4884
4880
|
}();
|
|
4885
4881
|
}(st, st.exports)), st.exports;
|
|
4886
4882
|
}
|
|
4887
|
-
process.env.NODE_ENV === "production" ? mr.exports =
|
|
4888
|
-
var
|
|
4883
|
+
process.env.NODE_ENV === "production" ? mr.exports = io() : mr.exports = oo();
|
|
4884
|
+
var co = mr.exports, jn = { exports: {} }, uo = co;
|
|
4889
4885
|
function Nn(r, e, t) {
|
|
4890
4886
|
var n = typeof e == "function";
|
|
4891
|
-
|
|
4892
|
-
var s,
|
|
4893
|
-
return
|
|
4887
|
+
uo.useEffect(function() {
|
|
4888
|
+
var s, i = !0, u = r(function() {
|
|
4889
|
+
return i;
|
|
4894
4890
|
});
|
|
4895
4891
|
return Promise.resolve(u).then(function(l) {
|
|
4896
4892
|
s = l;
|
|
4897
4893
|
}), function() {
|
|
4898
|
-
|
|
4894
|
+
i = !1, n && e(s);
|
|
4899
4895
|
};
|
|
4900
4896
|
}, n ? t : e);
|
|
4901
4897
|
}
|
|
4902
4898
|
jn.exports = Nn;
|
|
4903
4899
|
jn.exports.useAsyncEffect = Nn;
|
|
4904
|
-
const
|
|
4900
|
+
const lo = async (r) => {
|
|
4905
4901
|
if (typeof r != "object" || !r) return !1;
|
|
4906
4902
|
try {
|
|
4907
4903
|
const e = { type: "ping" }, t = await r.send(e);
|
|
4908
4904
|
if (t !== !0)
|
|
4909
4905
|
throw new Error(`Expected 'true' after ping, got ${JSON.stringify(t)}`);
|
|
4910
4906
|
return !0;
|
|
4911
|
-
} catch
|
|
4912
|
-
return
|
|
4907
|
+
} catch {
|
|
4908
|
+
return !1;
|
|
4913
4909
|
}
|
|
4914
|
-
},
|
|
4910
|
+
}, fo = (r, e) => !!r && e, X = (r) => c.nullable(r.optional());
|
|
4915
4911
|
c.string().trim().min(1, { message: "Cannot be blank" });
|
|
4916
|
-
const
|
|
4912
|
+
const ho = c.object({
|
|
4917
4913
|
cde_response_type: c.literal("error"),
|
|
4918
4914
|
message: c.string()
|
|
4919
|
-
}),
|
|
4915
|
+
}), po = c.enum(["usd", "brl"]), Dn = c.object({
|
|
4920
4916
|
name: c.string(),
|
|
4921
4917
|
amount_atom_off: X(c.number()),
|
|
4922
4918
|
percent_off: X(c.number()),
|
|
4923
4919
|
currency: X(c.string()),
|
|
4924
4920
|
duration: c.string(),
|
|
4925
4921
|
duration_in_months: X(c.number())
|
|
4926
|
-
}),
|
|
4922
|
+
}), mo = c.object({
|
|
4927
4923
|
amount_subtotal_atom: c.number().int(),
|
|
4928
4924
|
amount_total_atom: c.number().int(),
|
|
4929
4925
|
currency: c.string(),
|
|
@@ -4932,44 +4928,44 @@ const hi = c.object({
|
|
|
4932
4928
|
billing_interval: X(c.string()),
|
|
4933
4929
|
billing_interval_count: X(c.number().int()),
|
|
4934
4930
|
quantity: c.number().int()
|
|
4935
|
-
}),
|
|
4931
|
+
}), yo = c.record(c.string(), c.any()), vo = c.object({
|
|
4936
4932
|
name: c.string(),
|
|
4937
|
-
settings: X(
|
|
4938
|
-
}),
|
|
4933
|
+
settings: X(yo)
|
|
4934
|
+
}), go = c.object({
|
|
4939
4935
|
provider: c.string(),
|
|
4940
4936
|
processor_name: X(c.string()),
|
|
4941
4937
|
metadata: X(c.record(c.string(), c.any()))
|
|
4942
|
-
}),
|
|
4938
|
+
}), _o = c.object({
|
|
4943
4939
|
quantity: c.number()
|
|
4944
|
-
}),
|
|
4940
|
+
}), bo = c.object({
|
|
4945
4941
|
id: X(c.string()),
|
|
4946
4942
|
billing_interval: X(c.string()),
|
|
4947
4943
|
billing_interval_count: X(c.number().int()),
|
|
4948
|
-
subscription_items: c.array(
|
|
4944
|
+
subscription_items: c.array(_o),
|
|
4949
4945
|
trial_start: X(c.string()),
|
|
4950
4946
|
trial_end: X(c.string())
|
|
4951
4947
|
}), $n = c.object({
|
|
4952
4948
|
amount_atom: c.number()
|
|
4953
|
-
}),
|
|
4949
|
+
}), Eo = c.object({
|
|
4954
4950
|
amount_atom: c.number(),
|
|
4955
4951
|
amount_atom_considering_discount_applied: c.number(),
|
|
4956
4952
|
currency: c.string(),
|
|
4957
4953
|
discount_amount_atoms: c.array($n),
|
|
4958
4954
|
subscription_item_id: c.string()
|
|
4959
|
-
}),
|
|
4955
|
+
}), wo = c.object({
|
|
4960
4956
|
coupon: Dn
|
|
4961
|
-
}),
|
|
4957
|
+
}), ko = c.object({
|
|
4962
4958
|
currency: c.string(),
|
|
4963
|
-
discounts: c.array(
|
|
4959
|
+
discounts: c.array(wo),
|
|
4964
4960
|
hosted_invoice_url: X(c.string()),
|
|
4965
|
-
lines: c.array(
|
|
4961
|
+
lines: c.array(Eo),
|
|
4966
4962
|
remaining_amount_atom: c.number(),
|
|
4967
4963
|
tax_amount_atom: c.number(),
|
|
4968
4964
|
total_amount_atom: c.number(),
|
|
4969
4965
|
total_discount_amount_atoms: c.array($n)
|
|
4970
4966
|
}), dn = c.object({
|
|
4971
|
-
created: c.array(
|
|
4972
|
-
invoices: c.array(
|
|
4967
|
+
created: c.array(bo),
|
|
4968
|
+
invoices: c.array(ko)
|
|
4973
4969
|
}), Ln = c.object({
|
|
4974
4970
|
preview: dn,
|
|
4975
4971
|
preview_post_trial: X(dn),
|
|
@@ -4978,13 +4974,13 @@ const hi = c.object({
|
|
|
4978
4974
|
status: c.literal("open"),
|
|
4979
4975
|
token: c.string(),
|
|
4980
4976
|
email: X(c.string()),
|
|
4981
|
-
line_items: c.array(
|
|
4977
|
+
line_items: c.array(mo),
|
|
4982
4978
|
amount_subtotal_atom: c.number().int(),
|
|
4983
4979
|
amount_total_atom: c.number().int(),
|
|
4984
|
-
brand:
|
|
4980
|
+
brand: vo,
|
|
4985
4981
|
subs_preview: X(Ln),
|
|
4986
4982
|
// Null in setup mode
|
|
4987
|
-
methods_available: c.array(
|
|
4983
|
+
methods_available: c.array(go)
|
|
4988
4984
|
}), Zn = c.discriminatedUnion("mode", [
|
|
4989
4985
|
c.object({
|
|
4990
4986
|
mode: c.literal("setup"),
|
|
@@ -4992,14 +4988,14 @@ const hi = c.object({
|
|
|
4992
4988
|
}).extend(fn.shape),
|
|
4993
4989
|
c.object({
|
|
4994
4990
|
mode: c.enum(["payment", "subscription"]),
|
|
4995
|
-
currency:
|
|
4991
|
+
currency: po
|
|
4996
4992
|
}).extend(fn.shape)
|
|
4997
|
-
]),
|
|
4993
|
+
]), To = c.object({
|
|
4998
4994
|
status: c.literal("complete")
|
|
4999
|
-
}),
|
|
4995
|
+
}), Co = c.object({
|
|
5000
4996
|
status: c.literal("expired")
|
|
5001
4997
|
});
|
|
5002
|
-
c.union([Zn,
|
|
4998
|
+
c.union([Zn, To, Co]);
|
|
5003
4999
|
c.object({
|
|
5004
5000
|
logo: c.string(),
|
|
5005
5001
|
icon: c.string(),
|
|
@@ -5018,13 +5014,13 @@ c.object({
|
|
|
5018
5014
|
id: c.string(),
|
|
5019
5015
|
return_url: c.string()
|
|
5020
5016
|
});
|
|
5021
|
-
const
|
|
5017
|
+
const So = c.object({
|
|
5022
5018
|
type: c.string(),
|
|
5023
5019
|
loc: c.array(c.string()),
|
|
5024
5020
|
msg: c.string(),
|
|
5025
5021
|
url: c.string()
|
|
5026
5022
|
});
|
|
5027
|
-
c.array(
|
|
5023
|
+
c.array(So);
|
|
5028
5024
|
c.object({
|
|
5029
5025
|
required_user_actions: c.array(c.record(c.string(), c.any()))
|
|
5030
5026
|
});
|
|
@@ -5033,17 +5029,16 @@ c.object({
|
|
|
5033
5029
|
cc_pm_id: c.string()
|
|
5034
5030
|
});
|
|
5035
5031
|
const gr = async (r, e, t) => {
|
|
5036
|
-
console.log("[cde-client] Querying CDE with path and connection:", e.type, r);
|
|
5037
5032
|
const n = await r.send(e);
|
|
5038
|
-
if (
|
|
5033
|
+
if (Ro(n))
|
|
5039
5034
|
throw new Error(`[cde-client] Error querying CDE: ${n.message}`);
|
|
5040
|
-
if (
|
|
5035
|
+
if (!xo(n, t)) {
|
|
5041
5036
|
const s = t.safeParse(n);
|
|
5042
|
-
throw s.success ? new Error("Invalid state") :
|
|
5037
|
+
throw s.success ? new Error("Invalid state") : s.error;
|
|
5043
5038
|
}
|
|
5044
5039
|
return n;
|
|
5045
|
-
},
|
|
5046
|
-
class
|
|
5040
|
+
}, xo = (r, e) => e.safeParse(r).success, Ro = (r) => ho.safeParse(r).success, Oo = async (r, e) => await gr(r, { type: "get_checkout_preview", payload: e }, Ln), Un = async (r) => await gr(r, { type: "get_prefill", payload: {} }, Zn), Io = async (r, e) => await gr(r, { type: "confirm_payment_flow", payload: e }, ki);
|
|
5041
|
+
class Po {
|
|
5047
5042
|
constructor(e) {
|
|
5048
5043
|
this.formInstance = e, this.config = e.config, this.formId = e.formId, this.eventTargets = {}, this.nonces = /* @__PURE__ */ new Set(), this.tokenizedData = null, this.tokenized = 0, this.connectionManager = e.getConnectionManager();
|
|
5049
5044
|
}
|
|
@@ -5052,12 +5047,12 @@ class Pi {
|
|
|
5052
5047
|
}
|
|
5053
5048
|
handleMessage(e) {
|
|
5054
5049
|
if (e.origin !== this.formInstance.config.baseUrl || !e.source) return;
|
|
5055
|
-
const t =
|
|
5050
|
+
const t = $i(JSON.parse(e.data));
|
|
5056
5051
|
if (!this.validateEvent(t)) return;
|
|
5057
|
-
const { elementId: s, payload:
|
|
5058
|
-
switch (
|
|
5052
|
+
const { elementId: s, payload: i } = t;
|
|
5053
|
+
switch (i.type) {
|
|
5059
5054
|
case "LAYOUT":
|
|
5060
|
-
this.handleLayoutEvent(
|
|
5055
|
+
this.handleLayoutEvent(i);
|
|
5061
5056
|
break;
|
|
5062
5057
|
case "FOCUS":
|
|
5063
5058
|
this.handleFocusEvent(s);
|
|
@@ -5069,39 +5064,37 @@ class Pi {
|
|
|
5069
5064
|
this.handleChangeEvent(s);
|
|
5070
5065
|
break;
|
|
5071
5066
|
case "LOADED":
|
|
5072
|
-
this.handleLoadedEvent(e.source, s,
|
|
5067
|
+
this.handleLoadedEvent(e.source, s, i);
|
|
5073
5068
|
break;
|
|
5074
5069
|
case "TOKENIZE_STARTED":
|
|
5075
5070
|
this.handleTokenizeStartedEvent();
|
|
5076
5071
|
break;
|
|
5077
5072
|
case "PAYMENT_FLOW_STARTED":
|
|
5078
|
-
this.handlePaymentFlowStartedEvent(
|
|
5073
|
+
this.handlePaymentFlowStartedEvent(i, e.source, s);
|
|
5079
5074
|
break;
|
|
5080
5075
|
case "TOKENIZE_SUCCESS":
|
|
5081
|
-
this.handleTokenizeSuccessEvent(e.source, s,
|
|
5076
|
+
this.handleTokenizeSuccessEvent(e.source, s, i);
|
|
5082
5077
|
break;
|
|
5083
5078
|
case "CHECKOUT_SUCCESS":
|
|
5084
|
-
this.handleCheckoutSuccessEvent(
|
|
5079
|
+
this.handleCheckoutSuccessEvent(i);
|
|
5085
5080
|
break;
|
|
5086
5081
|
case "SETUP_PAYMENT_METHOD_SUCCESS":
|
|
5087
|
-
this.handleSetupPaymentMethodSuccessEvent(
|
|
5082
|
+
this.handleSetupPaymentMethodSuccessEvent(i);
|
|
5088
5083
|
break;
|
|
5089
5084
|
case "LOAD_ERROR":
|
|
5090
|
-
this.handleLoadErrorEvent(
|
|
5085
|
+
this.handleLoadErrorEvent(i);
|
|
5091
5086
|
break;
|
|
5092
5087
|
case "VALIDATION_ERROR":
|
|
5093
|
-
this.handleValidationErrorEvent(
|
|
5088
|
+
this.handleValidationErrorEvent(i, s);
|
|
5094
5089
|
break;
|
|
5095
5090
|
case "TOKENIZE_ERROR":
|
|
5096
5091
|
case "CHECKOUT_ERROR":
|
|
5097
|
-
this.handleErrorEvent(
|
|
5092
|
+
this.handleErrorEvent(i);
|
|
5098
5093
|
break;
|
|
5099
|
-
default:
|
|
5100
|
-
console.warn("[form] Unhandled event type:", u);
|
|
5101
5094
|
}
|
|
5102
5095
|
}
|
|
5103
5096
|
validateEvent(e) {
|
|
5104
|
-
return e.formId !== this.formInstance.formId || !e.elementId
|
|
5097
|
+
return e.formId !== this.formInstance.formId || !e.elementId || this.nonces.has(e.nonce) ? !1 : (this.nonces.add(e.nonce), !0);
|
|
5105
5098
|
}
|
|
5106
5099
|
handleLayoutEvent(e) {
|
|
5107
5100
|
const t = e.height ? `${e.height}px` : "100%";
|
|
@@ -5126,20 +5119,20 @@ class Pi {
|
|
|
5126
5119
|
var u;
|
|
5127
5120
|
if (!this.tokenizedData)
|
|
5128
5121
|
throw new Error("tokenizedData not populated");
|
|
5129
|
-
const s = this.connectionManager.getConnection(),
|
|
5122
|
+
const s = this.connectionManager.getConnection(), i = async () => {
|
|
5130
5123
|
var m;
|
|
5131
5124
|
const l = e.nextActionMetadata.type;
|
|
5132
5125
|
if (l !== void 0) if (l === "stripe_3ds")
|
|
5133
|
-
await
|
|
5126
|
+
await Ii(e);
|
|
5134
5127
|
else if (l === "stripe_payment_request") {
|
|
5135
5128
|
if (!this.formInstance.getStripePm())
|
|
5136
5129
|
throw new Error("Stripe PM not set");
|
|
5137
|
-
await
|
|
5130
|
+
await Oi(e, this.formInstance.getStripePm());
|
|
5138
5131
|
} else
|
|
5139
5132
|
throw new Error(`Unknown next action type: ${l}`);
|
|
5140
5133
|
const p = await Un(s);
|
|
5141
5134
|
if (p.mode === "setup") {
|
|
5142
|
-
const { payment_methods: _ } = await
|
|
5135
|
+
const { payment_methods: _ } = await Io(s, {
|
|
5143
5136
|
secure_token: p.token,
|
|
5144
5137
|
existing_cc_pm_id: (m = this.tokenizedData) == null ? void 0 : m.existingCCPMId
|
|
5145
5138
|
});
|
|
@@ -5154,7 +5147,7 @@ class Pi {
|
|
|
5154
5147
|
};
|
|
5155
5148
|
};
|
|
5156
5149
|
try {
|
|
5157
|
-
const { proceedToCheckout: l } = await
|
|
5150
|
+
const { proceedToCheckout: l } = await i();
|
|
5158
5151
|
if (!l)
|
|
5159
5152
|
return;
|
|
5160
5153
|
let p;
|
|
@@ -5175,8 +5168,8 @@ class Pi {
|
|
|
5175
5168
|
handleTokenizeSuccessEvent(e, t, n) {
|
|
5176
5169
|
if (!this.tokenizedData)
|
|
5177
5170
|
throw new Error("Tokenized data not found");
|
|
5178
|
-
const s = this.tokenized + 1,
|
|
5179
|
-
!this.formInstance.checkoutFired && (
|
|
5171
|
+
const s = this.tokenized + 1, i = s === Object.keys(this.eventTargets).length;
|
|
5172
|
+
!this.formInstance.checkoutFired && (i || n.isReadyForCheckout) ? (this.tokenizedData.type = this.tokenizedData.type === te.enum.TOKENIZE ? te.enum.CHECKOUT : te.enum.START_PAYMENT_FLOW, this.postEventToFrame(e, t, this.tokenizedData), this.tokenizedData = null) : this.tokenized = s;
|
|
5180
5173
|
}
|
|
5181
5174
|
handleCheckoutSuccessEvent(e) {
|
|
5182
5175
|
this.formInstance.config.onCheckoutSuccess && this.formInstance.config.onCheckoutSuccess(e.invoiceUrls, e.subscriptionIds, e.customerId);
|
|
@@ -5196,8 +5189,8 @@ class Pi {
|
|
|
5196
5189
|
const n = (t = this.formInstance.checkoutPaymentMethods) == null ? void 0 : t.find((s) => s.provider === "credit_card");
|
|
5197
5190
|
if (!this.formInstance.sessionId || !this.formInstance.formTarget || !this.config.onValidationError || !n)
|
|
5198
5191
|
return;
|
|
5199
|
-
for (const [s,
|
|
5200
|
-
if (!
|
|
5192
|
+
for (const [s, i] of Object.entries(this.eventTargets)) {
|
|
5193
|
+
if (!i) continue;
|
|
5201
5194
|
const u = Wt(
|
|
5202
5195
|
te.enum.START_PAYMENT_FLOW,
|
|
5203
5196
|
this.formInstance.sessionId,
|
|
@@ -5207,7 +5200,7 @@ class Pi {
|
|
|
5207
5200
|
!1
|
|
5208
5201
|
);
|
|
5209
5202
|
if (u) {
|
|
5210
|
-
this.formInstance.checkoutFired = !0, this.tokenizedData = u, this.postEventToFrame(
|
|
5203
|
+
this.formInstance.checkoutFired = !0, this.tokenizedData = u, this.postEventToFrame(i, s, u);
|
|
5211
5204
|
break;
|
|
5212
5205
|
}
|
|
5213
5206
|
}
|
|
@@ -5231,24 +5224,24 @@ class Pi {
|
|
|
5231
5224
|
);
|
|
5232
5225
|
if (!t)
|
|
5233
5226
|
throw new Error("Error constructing tokenize data");
|
|
5234
|
-
for (const [s,
|
|
5235
|
-
|
|
5227
|
+
for (const [s, i] of Object.entries(this.eventTargets))
|
|
5228
|
+
i && this.postEventToFrame(i, s, t);
|
|
5236
5229
|
this.tokenizedData = t;
|
|
5237
5230
|
}
|
|
5238
5231
|
postEventToFrame(e, t, n) {
|
|
5239
5232
|
on(e, this.formId, t, n, this.config.baseUrl);
|
|
5240
5233
|
}
|
|
5241
5234
|
}
|
|
5242
|
-
async function
|
|
5243
|
-
const t = await
|
|
5235
|
+
async function Ao(r) {
|
|
5236
|
+
const t = await so({
|
|
5244
5237
|
iframe: r,
|
|
5245
5238
|
debug: !0
|
|
5246
|
-
}).promise, n = await
|
|
5247
|
-
if (!
|
|
5239
|
+
}).promise, n = await lo(t);
|
|
5240
|
+
if (!fo(t, n))
|
|
5248
5241
|
throw new Error("Got invalid CDE connection object");
|
|
5249
5242
|
return t;
|
|
5250
5243
|
}
|
|
5251
|
-
class
|
|
5244
|
+
class Mo {
|
|
5252
5245
|
constructor() {
|
|
5253
5246
|
this.connections = /* @__PURE__ */ new Map();
|
|
5254
5247
|
}
|
|
@@ -5262,7 +5255,7 @@ class Mi {
|
|
|
5262
5255
|
return e;
|
|
5263
5256
|
}
|
|
5264
5257
|
}
|
|
5265
|
-
async function
|
|
5258
|
+
async function jo(r, e, t, n, s, i) {
|
|
5266
5259
|
const u = {
|
|
5267
5260
|
apple_pay: { isLoading: !0, isAvailable: !1, startFlow: async () => {
|
|
5268
5261
|
} },
|
|
@@ -5276,11 +5269,11 @@ async function ji(r, e, t, n, s, o) {
|
|
|
5276
5269
|
);
|
|
5277
5270
|
if (!p)
|
|
5278
5271
|
throw new Error(`${l} is not available as a checkout method`);
|
|
5279
|
-
const m =
|
|
5272
|
+
const m = Ri(p.metadata), _ = await No(m, l);
|
|
5280
5273
|
u[l] = {
|
|
5281
5274
|
isLoading: !1,
|
|
5282
5275
|
isAvailable: _,
|
|
5283
|
-
startFlow: (O) =>
|
|
5276
|
+
startFlow: (O) => Do(
|
|
5284
5277
|
t,
|
|
5285
5278
|
r.checkoutSecureToken,
|
|
5286
5279
|
document.querySelector(r.formTarget),
|
|
@@ -5288,46 +5281,45 @@ async function ji(r, e, t, n, s, o) {
|
|
|
5288
5281
|
m,
|
|
5289
5282
|
n,
|
|
5290
5283
|
s,
|
|
5291
|
-
|
|
5284
|
+
i,
|
|
5292
5285
|
O
|
|
5293
5286
|
)
|
|
5294
5287
|
};
|
|
5295
|
-
} catch
|
|
5296
|
-
|
|
5288
|
+
} catch {
|
|
5289
|
+
u[l] = {
|
|
5297
5290
|
isLoading: !1,
|
|
5298
5291
|
isAvailable: !1,
|
|
5299
5292
|
startFlow: async () => {
|
|
5300
|
-
console.error(`${l} is not available.`);
|
|
5301
5293
|
}
|
|
5302
5294
|
};
|
|
5303
5295
|
}
|
|
5304
5296
|
return u;
|
|
5305
5297
|
}
|
|
5306
|
-
async function
|
|
5298
|
+
async function No(r, e) {
|
|
5307
5299
|
const n = await On(r, 1e3, "usd"), s = await n.canMakePayment();
|
|
5308
5300
|
if (n.abort(), !s)
|
|
5309
5301
|
throw new Error(`Cannot make payment with ${e} for this session`);
|
|
5310
5302
|
return s[e === "apple_pay" ? "applePay" : "googlePay"];
|
|
5311
5303
|
}
|
|
5312
|
-
async function
|
|
5304
|
+
async function Do(r, e, t, n, s, i, u, l, p) {
|
|
5313
5305
|
try {
|
|
5314
5306
|
const m = In(t, {});
|
|
5315
|
-
if (!$
|
|
5307
|
+
if (!$o(t, u, n))
|
|
5316
5308
|
return;
|
|
5317
|
-
const O = (await Un(r)).mode === "setup", V = await
|
|
5309
|
+
const O = (await Un(r)).mode === "setup", V = await Lo(O, p, m, r, e), $ = await On(
|
|
5318
5310
|
s,
|
|
5319
5311
|
V.amountAtom,
|
|
5320
5312
|
V.currency,
|
|
5321
5313
|
O
|
|
5322
5314
|
);
|
|
5323
5315
|
await $.canMakePayment(), $.show();
|
|
5324
|
-
const ee = await
|
|
5325
|
-
|
|
5316
|
+
const ee = await xi($);
|
|
5317
|
+
i(ee, n);
|
|
5326
5318
|
} catch (m) {
|
|
5327
|
-
|
|
5319
|
+
l(kn(m));
|
|
5328
5320
|
}
|
|
5329
5321
|
}
|
|
5330
|
-
function $
|
|
5322
|
+
function $o(r, e, t) {
|
|
5331
5323
|
return !!Wt(
|
|
5332
5324
|
te.enum.START_PAYMENT_FLOW,
|
|
5333
5325
|
"dummy",
|
|
@@ -5338,25 +5330,25 @@ function $i(r, e, t) {
|
|
|
5338
5330
|
!1
|
|
5339
5331
|
);
|
|
5340
5332
|
}
|
|
5341
|
-
async function
|
|
5333
|
+
async function Lo(r, e, t, n, s) {
|
|
5342
5334
|
if (r)
|
|
5343
5335
|
return (e == null ? void 0 : e.amountToDisplayForSetupMode) ?? { amountAtom: 0, currency: "usd" };
|
|
5344
|
-
e != null && e.amountToDisplayForSetupMode
|
|
5345
|
-
const
|
|
5346
|
-
if (!
|
|
5347
|
-
throw new Error(`Unknown promo code type: ${
|
|
5348
|
-
const u = await
|
|
5336
|
+
e != null && e.amountToDisplayForSetupMode;
|
|
5337
|
+
const i = de.safeParse(t[bt.PROMOTION_CODE]);
|
|
5338
|
+
if (!i.success)
|
|
5339
|
+
throw new Error(`Unknown promo code type: ${i.error.message}`);
|
|
5340
|
+
const u = await Oo(n, {
|
|
5349
5341
|
secure_token: s,
|
|
5350
|
-
promotion_code:
|
|
5342
|
+
promotion_code: i.data
|
|
5351
5343
|
}), l = new Set(u.preview.invoices.map((_) => _.currency));
|
|
5352
5344
|
if (l.size !== 1)
|
|
5353
5345
|
throw new Error(`Expected exactly one currency, got ${l.size}`);
|
|
5354
5346
|
const p = l.values().next().value;
|
|
5355
5347
|
return { amountAtom: u.preview.invoices.reduce((_, O) => _ + O.remaining_amount_atom, 0), currency: p };
|
|
5356
5348
|
}
|
|
5357
|
-
class
|
|
5349
|
+
class Zo {
|
|
5358
5350
|
constructor(e) {
|
|
5359
|
-
this.config = { ...e, baseUrl: e.baseUrl ?? "https://cde.getopenpay.com" }, this.elements = null, this.formId = `opjs-form-${window.crypto.randomUUID()}`, this.referer = window.location.origin, this.formTarget = e.formTarget ?? "body", this.formProperties = { height: "1px" }, this.sessionId = null, this.checkoutPaymentMethods = [], this.checkoutFired = !1, this.stripePm = void 0, this.paymentRequests = this.initPaymentRequests(), this.connectionManager = new
|
|
5351
|
+
this.config = { ...e, baseUrl: e.baseUrl ?? "https://cde.getopenpay.com" }, this.elements = null, this.formId = `opjs-form-${window.crypto.randomUUID()}`, this.referer = window.location.origin, this.formTarget = e.formTarget ?? "body", this.formProperties = { height: "1px" }, this.sessionId = null, this.checkoutPaymentMethods = [], this.checkoutFired = !1, this.stripePm = void 0, this.paymentRequests = this.initPaymentRequests(), this.connectionManager = new Mo(), this.eventHandler = new Po(this), window.addEventListener("message", this.eventHandler.handleMessage.bind(this.eventHandler));
|
|
5360
5352
|
}
|
|
5361
5353
|
getStripePm() {
|
|
5362
5354
|
return this.stripePm;
|
|
@@ -5381,7 +5373,7 @@ class Zi {
|
|
|
5381
5373
|
if (!this.config) throw new Error("OpenPay form not initialized");
|
|
5382
5374
|
const n = document.createElement("iframe"), s = this.buildQueryString(t);
|
|
5383
5375
|
n.name = `${e}-element`, n.src = `${this.config.baseUrl}/app/v1/${e}-element/?${s.toString()}`, n.style.border = "none", n.style.width = "100%";
|
|
5384
|
-
const
|
|
5376
|
+
const i = {
|
|
5385
5377
|
type: e,
|
|
5386
5378
|
node: n,
|
|
5387
5379
|
mount: (u) => {
|
|
@@ -5389,16 +5381,17 @@ class Zi {
|
|
|
5389
5381
|
return (l = document.querySelector(u)) == null ? void 0 : l.appendChild(n);
|
|
5390
5382
|
}
|
|
5391
5383
|
};
|
|
5392
|
-
return this.elements ? this.elements[e] =
|
|
5384
|
+
return this.elements ? this.elements[e] = i : (this.elements = { [e]: i }, this.connectToElement(i)), i;
|
|
5393
5385
|
}
|
|
5394
5386
|
buildQueryString(e) {
|
|
5395
5387
|
const t = new URLSearchParams();
|
|
5396
|
-
return t.append("referer", this.referer), t.append("formId", this.formId), e.styles && t.append("styles",
|
|
5388
|
+
return t.append("referer", this.referer), t.append("formId", this.formId), e.styles && t.append("styles", Pi(e.styles)), t.append("secureToken", this.config.checkoutSecureToken), t;
|
|
5397
5389
|
}
|
|
5398
5390
|
connectToElement(e) {
|
|
5399
|
-
|
|
5391
|
+
Ao(e.node).then((t) => {
|
|
5400
5392
|
this.connectionManager.addConnection(e.type, t), this.initializePaymentRequests();
|
|
5401
|
-
}).catch((t) =>
|
|
5393
|
+
}).catch((t) => {
|
|
5394
|
+
});
|
|
5402
5395
|
}
|
|
5403
5396
|
submit() {
|
|
5404
5397
|
this.eventHandler.handleFormSubmit();
|
|
@@ -5406,14 +5399,14 @@ class Zi {
|
|
|
5406
5399
|
async onUserCompletePaymentRequestUI(e, t) {
|
|
5407
5400
|
if (!(!this.config.onValidationError || !this.sessionId || !this.checkoutPaymentMethods))
|
|
5408
5401
|
for (const [n, s] of Object.entries(this.eventHandler.eventTargets ?? {})) {
|
|
5409
|
-
const
|
|
5402
|
+
const i = { stripePmId: e.paymentMethod.id }, u = Wt(
|
|
5410
5403
|
te.enum.START_PAYMENT_FLOW,
|
|
5411
5404
|
this.sessionId,
|
|
5412
5405
|
document.querySelector(this.formTarget) ?? document.body,
|
|
5413
5406
|
this.config.onValidationError,
|
|
5414
5407
|
t,
|
|
5415
5408
|
!1,
|
|
5416
|
-
|
|
5409
|
+
i
|
|
5417
5410
|
);
|
|
5418
5411
|
if (u) {
|
|
5419
5412
|
this.stripePm = e, this.checkoutFired = !0, this.eventHandler.setTokenizedData(u), this.eventHandler.postEventToFrame(s, n, u);
|
|
@@ -5422,23 +5415,19 @@ class Zi {
|
|
|
5422
5415
|
}
|
|
5423
5416
|
}
|
|
5424
5417
|
onPaymentRequestError(e) {
|
|
5425
|
-
|
|
5418
|
+
this.checkoutFired = !1, this.config.onCheckoutError && this.config.onCheckoutError(e);
|
|
5426
5419
|
}
|
|
5427
5420
|
async initializePaymentRequests() {
|
|
5428
5421
|
if (!this.config.checkoutSecureToken || !this.checkoutPaymentMethods || !this.formTarget) return;
|
|
5429
5422
|
const e = this.connectionManager.getConnection();
|
|
5430
|
-
|
|
5431
|
-
console.error("[form] CDE connection not established");
|
|
5432
|
-
return;
|
|
5433
|
-
}
|
|
5434
|
-
this.paymentRequests = await ji(
|
|
5423
|
+
e && (this.paymentRequests = await jo(
|
|
5435
5424
|
this.config,
|
|
5436
5425
|
this.checkoutPaymentMethods,
|
|
5437
5426
|
e,
|
|
5438
5427
|
this.onUserCompletePaymentRequestUI.bind(this),
|
|
5439
5428
|
this.config.onValidationError,
|
|
5440
5429
|
this.onPaymentRequestError.bind(this)
|
|
5441
|
-
), this.config.onPaymentRequestLoad && this.config.onPaymentRequestLoad(this.paymentRequests);
|
|
5430
|
+
), this.config.onPaymentRequestLoad && this.config.onPaymentRequestLoad(this.paymentRequests));
|
|
5442
5431
|
}
|
|
5443
5432
|
destroy() {
|
|
5444
5433
|
window.removeEventListener("message", this.eventHandler.handleMessage.bind(this.eventHandler));
|
|
@@ -5446,5 +5435,5 @@ class Zi {
|
|
|
5446
5435
|
}
|
|
5447
5436
|
export {
|
|
5448
5437
|
bt as FieldName,
|
|
5449
|
-
|
|
5438
|
+
Zo as OpenPayForm
|
|
5450
5439
|
};
|