@resconet/qp-bridge 0.0.1-alpha.20 → 0.0.1-alpha.22
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/README.md +85 -2
- package/index.js +1 -1
- package/index.mjs +462 -406
- package/lib/qp-bridge-types.d.ts +64 -0
- package/lib/qp-bridge.d.ts +45 -1
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -11,12 +11,12 @@ for (let t = 0; t < 256; ++t)
|
|
|
11
11
|
function tt(t, e = 0) {
|
|
12
12
|
return k[t[e + 0]] + k[t[e + 1]] + k[t[e + 2]] + k[t[e + 3]] + "-" + k[t[e + 4]] + k[t[e + 5]] + "-" + k[t[e + 6]] + k[t[e + 7]] + "-" + k[t[e + 8]] + k[t[e + 9]] + "-" + k[t[e + 10]] + k[t[e + 11]] + k[t[e + 12]] + k[t[e + 13]] + k[t[e + 14]] + k[t[e + 15]];
|
|
13
13
|
}
|
|
14
|
-
const st = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto),
|
|
14
|
+
const st = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), Ae = {
|
|
15
15
|
randomUUID: st
|
|
16
16
|
};
|
|
17
17
|
function qe(t, e, s) {
|
|
18
|
-
if (
|
|
19
|
-
return
|
|
18
|
+
if (Ae.randomUUID && !e && !t)
|
|
19
|
+
return Ae.randomUUID();
|
|
20
20
|
t = t || {};
|
|
21
21
|
const n = t.random || (t.rng || et)();
|
|
22
22
|
return n[6] = n[6] & 15 | 64, n[8] = n[8] & 63 | 128, tt(n);
|
|
@@ -86,7 +86,7 @@ const f = x.arrayToEnum([
|
|
|
86
86
|
"never",
|
|
87
87
|
"map",
|
|
88
88
|
"set"
|
|
89
|
-
]),
|
|
89
|
+
]), q = (t) => {
|
|
90
90
|
switch (typeof t) {
|
|
91
91
|
case "undefined":
|
|
92
92
|
return f.undefined;
|
|
@@ -152,10 +152,10 @@ class E extends Error {
|
|
|
152
152
|
else if (i.path.length === 0)
|
|
153
153
|
n._errors.push(s(i));
|
|
154
154
|
else {
|
|
155
|
-
let o = n,
|
|
156
|
-
for (;
|
|
157
|
-
const
|
|
158
|
-
|
|
155
|
+
let o = n, u = 0;
|
|
156
|
+
for (; u < i.path.length; ) {
|
|
157
|
+
const d = i.path[u];
|
|
158
|
+
u === i.path.length - 1 ? (o[d] = o[d] || { _errors: [] }, o[d]._errors.push(s(i))) : o[d] = o[d] || { _errors: [] }, o = o[d], u++;
|
|
159
159
|
}
|
|
160
160
|
}
|
|
161
161
|
};
|
|
@@ -260,9 +260,9 @@ const xe = (t) => {
|
|
|
260
260
|
message: r.message
|
|
261
261
|
};
|
|
262
262
|
let o = "";
|
|
263
|
-
const
|
|
264
|
-
for (const
|
|
265
|
-
o =
|
|
263
|
+
const u = n.filter((d) => !!d).slice().reverse();
|
|
264
|
+
for (const d of u)
|
|
265
|
+
o = d(i, { data: e, defaultError: o }).message;
|
|
266
266
|
return {
|
|
267
267
|
...r,
|
|
268
268
|
path: a,
|
|
@@ -327,7 +327,7 @@ class S {
|
|
|
327
327
|
}
|
|
328
328
|
const y = Object.freeze({
|
|
329
329
|
status: "aborted"
|
|
330
|
-
}), W = (t) => ({ status: "dirty", value: t }), T = (t) => ({ status: "valid", value: t }),
|
|
330
|
+
}), W = (t) => ({ status: "dirty", value: t }), T = (t) => ({ status: "valid", value: t }), Ne = (t) => t.status === "aborted", Me = (t) => t.status === "dirty", se = (t) => t.status === "valid", ne = (t) => typeof Promise < "u" && t instanceof Promise;
|
|
331
331
|
function be(t, e, s, n) {
|
|
332
332
|
if (typeof e == "function" ? t !== e || !n : !e.has(t))
|
|
333
333
|
throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
@@ -338,12 +338,12 @@ function Ue(t, e, s, n, r) {
|
|
|
338
338
|
throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
339
339
|
return e.set(t, s), s;
|
|
340
340
|
}
|
|
341
|
-
var
|
|
341
|
+
var p;
|
|
342
342
|
(function(t) {
|
|
343
343
|
t.errToObj = (e) => typeof e == "string" ? { message: e } : e || {}, t.toString = (e) => typeof e == "string" ? e : e == null ? void 0 : e.message;
|
|
344
|
-
})(
|
|
344
|
+
})(p || (p = {}));
|
|
345
345
|
var F, ee;
|
|
346
|
-
class
|
|
346
|
+
class O {
|
|
347
347
|
constructor(e, s, n, r) {
|
|
348
348
|
this._cachedPath = [], this.parent = e, this.data = s, this._path = n, this._key = r;
|
|
349
349
|
}
|
|
@@ -351,7 +351,7 @@ class M {
|
|
|
351
351
|
return this._cachedPath.length || (this._key instanceof Array ? this._cachedPath.push(...this._path, ...this._key) : this._cachedPath.push(...this._path, this._key)), this._cachedPath;
|
|
352
352
|
}
|
|
353
353
|
}
|
|
354
|
-
const
|
|
354
|
+
const je = (t, e) => {
|
|
355
355
|
if (se(e))
|
|
356
356
|
return { success: !0, data: e.value };
|
|
357
357
|
if (!t.common.issues.length)
|
|
@@ -373,9 +373,9 @@ function v(t) {
|
|
|
373
373
|
if (e && (s || n))
|
|
374
374
|
throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);
|
|
375
375
|
return e ? { errorMap: e, description: r } : { errorMap: (i, o) => {
|
|
376
|
-
var
|
|
376
|
+
var u, d;
|
|
377
377
|
const { message: g } = t;
|
|
378
|
-
return i.code === "invalid_enum_value" ? { message: g ?? o.defaultError } : typeof o.data > "u" ? { message: (
|
|
378
|
+
return i.code === "invalid_enum_value" ? { message: g ?? o.defaultError } : typeof o.data > "u" ? { message: (u = g ?? n) !== null && u !== void 0 ? u : o.defaultError } : i.code !== "invalid_type" ? { message: o.defaultError } : { message: (d = g ?? s) !== null && d !== void 0 ? d : o.defaultError };
|
|
379
379
|
}, description: r };
|
|
380
380
|
}
|
|
381
381
|
class _ {
|
|
@@ -386,13 +386,13 @@ class _ {
|
|
|
386
386
|
return this._def.description;
|
|
387
387
|
}
|
|
388
388
|
_getType(e) {
|
|
389
|
-
return
|
|
389
|
+
return q(e.data);
|
|
390
390
|
}
|
|
391
391
|
_getOrReturnCtx(e, s) {
|
|
392
392
|
return s || {
|
|
393
393
|
common: e.parent.common,
|
|
394
394
|
data: e.data,
|
|
395
|
-
parsedType:
|
|
395
|
+
parsedType: q(e.data),
|
|
396
396
|
schemaErrorMap: this._def.errorMap,
|
|
397
397
|
path: e.path,
|
|
398
398
|
parent: e.parent
|
|
@@ -404,7 +404,7 @@ class _ {
|
|
|
404
404
|
ctx: {
|
|
405
405
|
common: e.parent.common,
|
|
406
406
|
data: e.data,
|
|
407
|
-
parsedType:
|
|
407
|
+
parsedType: q(e.data),
|
|
408
408
|
schemaErrorMap: this._def.errorMap,
|
|
409
409
|
path: e.path,
|
|
410
410
|
parent: e.parent
|
|
@@ -439,9 +439,9 @@ class _ {
|
|
|
439
439
|
schemaErrorMap: this._def.errorMap,
|
|
440
440
|
parent: null,
|
|
441
441
|
data: e,
|
|
442
|
-
parsedType:
|
|
442
|
+
parsedType: q(e)
|
|
443
443
|
}, a = this._parseSync({ data: e, path: r.path, parent: r });
|
|
444
|
-
return
|
|
444
|
+
return je(r, a);
|
|
445
445
|
}
|
|
446
446
|
async parseAsync(e, s) {
|
|
447
447
|
const n = await this.safeParseAsync(e, s);
|
|
@@ -460,9 +460,9 @@ class _ {
|
|
|
460
460
|
schemaErrorMap: this._def.errorMap,
|
|
461
461
|
parent: null,
|
|
462
462
|
data: e,
|
|
463
|
-
parsedType:
|
|
463
|
+
parsedType: q(e)
|
|
464
464
|
}, r = this._parse({ data: e, path: n.path, parent: n }), a = await (ne(r) ? r : Promise.resolve(r));
|
|
465
|
-
return
|
|
465
|
+
return je(n, a);
|
|
466
466
|
}
|
|
467
467
|
refine(e, s) {
|
|
468
468
|
const n = (r) => typeof s == "string" || typeof s > "u" ? { message: s } : typeof s == "function" ? s(r) : s;
|
|
@@ -471,14 +471,14 @@ class _ {
|
|
|
471
471
|
code: c.custom,
|
|
472
472
|
...n(r)
|
|
473
473
|
});
|
|
474
|
-
return typeof Promise < "u" && i instanceof Promise ? i.then((
|
|
474
|
+
return typeof Promise < "u" && i instanceof Promise ? i.then((u) => u ? !0 : (o(), !1)) : i ? !0 : (o(), !1);
|
|
475
475
|
});
|
|
476
476
|
}
|
|
477
477
|
refinement(e, s) {
|
|
478
478
|
return this._refinement((n, r) => e(n) ? !0 : (r.addIssue(typeof s == "function" ? s(n, r) : s), !1));
|
|
479
479
|
}
|
|
480
480
|
_refinement(e) {
|
|
481
|
-
return new
|
|
481
|
+
return new N({
|
|
482
482
|
schema: this,
|
|
483
483
|
typeName: m.ZodEffects,
|
|
484
484
|
effect: { type: "refinement", refinement: e }
|
|
@@ -491,7 +491,7 @@ class _ {
|
|
|
491
491
|
return I.create(this, this._def);
|
|
492
492
|
}
|
|
493
493
|
nullable() {
|
|
494
|
-
return
|
|
494
|
+
return V.create(this, this._def);
|
|
495
495
|
}
|
|
496
496
|
nullish() {
|
|
497
497
|
return this.nullable().optional();
|
|
@@ -509,7 +509,7 @@ class _ {
|
|
|
509
509
|
return ce.create(this, e, this._def);
|
|
510
510
|
}
|
|
511
511
|
transform(e) {
|
|
512
|
-
return new
|
|
512
|
+
return new N({
|
|
513
513
|
...v(this._def),
|
|
514
514
|
schema: this,
|
|
515
515
|
typeName: m.ZodEffects,
|
|
@@ -526,7 +526,7 @@ class _ {
|
|
|
526
526
|
});
|
|
527
527
|
}
|
|
528
528
|
brand() {
|
|
529
|
-
return new
|
|
529
|
+
return new Oe({
|
|
530
530
|
typeName: m.ZodBranded,
|
|
531
531
|
type: this,
|
|
532
532
|
...v(this._def)
|
|
@@ -727,7 +727,7 @@ class C extends _ {
|
|
|
727
727
|
return this.refinement((r) => e.test(r), {
|
|
728
728
|
validation: s,
|
|
729
729
|
code: c.invalid_string,
|
|
730
|
-
...
|
|
730
|
+
...p.errToObj(n)
|
|
731
731
|
});
|
|
732
732
|
}
|
|
733
733
|
_addCheck(e) {
|
|
@@ -737,34 +737,34 @@ class C extends _ {
|
|
|
737
737
|
});
|
|
738
738
|
}
|
|
739
739
|
email(e) {
|
|
740
|
-
return this._addCheck({ kind: "email", ...
|
|
740
|
+
return this._addCheck({ kind: "email", ...p.errToObj(e) });
|
|
741
741
|
}
|
|
742
742
|
url(e) {
|
|
743
|
-
return this._addCheck({ kind: "url", ...
|
|
743
|
+
return this._addCheck({ kind: "url", ...p.errToObj(e) });
|
|
744
744
|
}
|
|
745
745
|
emoji(e) {
|
|
746
|
-
return this._addCheck({ kind: "emoji", ...
|
|
746
|
+
return this._addCheck({ kind: "emoji", ...p.errToObj(e) });
|
|
747
747
|
}
|
|
748
748
|
uuid(e) {
|
|
749
|
-
return this._addCheck({ kind: "uuid", ...
|
|
749
|
+
return this._addCheck({ kind: "uuid", ...p.errToObj(e) });
|
|
750
750
|
}
|
|
751
751
|
nanoid(e) {
|
|
752
|
-
return this._addCheck({ kind: "nanoid", ...
|
|
752
|
+
return this._addCheck({ kind: "nanoid", ...p.errToObj(e) });
|
|
753
753
|
}
|
|
754
754
|
cuid(e) {
|
|
755
|
-
return this._addCheck({ kind: "cuid", ...
|
|
755
|
+
return this._addCheck({ kind: "cuid", ...p.errToObj(e) });
|
|
756
756
|
}
|
|
757
757
|
cuid2(e) {
|
|
758
|
-
return this._addCheck({ kind: "cuid2", ...
|
|
758
|
+
return this._addCheck({ kind: "cuid2", ...p.errToObj(e) });
|
|
759
759
|
}
|
|
760
760
|
ulid(e) {
|
|
761
|
-
return this._addCheck({ kind: "ulid", ...
|
|
761
|
+
return this._addCheck({ kind: "ulid", ...p.errToObj(e) });
|
|
762
762
|
}
|
|
763
763
|
base64(e) {
|
|
764
|
-
return this._addCheck({ kind: "base64", ...
|
|
764
|
+
return this._addCheck({ kind: "base64", ...p.errToObj(e) });
|
|
765
765
|
}
|
|
766
766
|
ip(e) {
|
|
767
|
-
return this._addCheck({ kind: "ip", ...
|
|
767
|
+
return this._addCheck({ kind: "ip", ...p.errToObj(e) });
|
|
768
768
|
}
|
|
769
769
|
datetime(e) {
|
|
770
770
|
var s, n;
|
|
@@ -779,7 +779,7 @@ class C extends _ {
|
|
|
779
779
|
precision: typeof (e == null ? void 0 : e.precision) > "u" ? null : e == null ? void 0 : e.precision,
|
|
780
780
|
offset: (s = e == null ? void 0 : e.offset) !== null && s !== void 0 ? s : !1,
|
|
781
781
|
local: (n = e == null ? void 0 : e.local) !== null && n !== void 0 ? n : !1,
|
|
782
|
-
...
|
|
782
|
+
...p.errToObj(e == null ? void 0 : e.message)
|
|
783
783
|
});
|
|
784
784
|
}
|
|
785
785
|
date(e) {
|
|
@@ -793,17 +793,17 @@ class C extends _ {
|
|
|
793
793
|
}) : this._addCheck({
|
|
794
794
|
kind: "time",
|
|
795
795
|
precision: typeof (e == null ? void 0 : e.precision) > "u" ? null : e == null ? void 0 : e.precision,
|
|
796
|
-
...
|
|
796
|
+
...p.errToObj(e == null ? void 0 : e.message)
|
|
797
797
|
});
|
|
798
798
|
}
|
|
799
799
|
duration(e) {
|
|
800
|
-
return this._addCheck({ kind: "duration", ...
|
|
800
|
+
return this._addCheck({ kind: "duration", ...p.errToObj(e) });
|
|
801
801
|
}
|
|
802
802
|
regex(e, s) {
|
|
803
803
|
return this._addCheck({
|
|
804
804
|
kind: "regex",
|
|
805
805
|
regex: e,
|
|
806
|
-
...
|
|
806
|
+
...p.errToObj(s)
|
|
807
807
|
});
|
|
808
808
|
}
|
|
809
809
|
includes(e, s) {
|
|
@@ -811,42 +811,42 @@ class C extends _ {
|
|
|
811
811
|
kind: "includes",
|
|
812
812
|
value: e,
|
|
813
813
|
position: s == null ? void 0 : s.position,
|
|
814
|
-
...
|
|
814
|
+
...p.errToObj(s == null ? void 0 : s.message)
|
|
815
815
|
});
|
|
816
816
|
}
|
|
817
817
|
startsWith(e, s) {
|
|
818
818
|
return this._addCheck({
|
|
819
819
|
kind: "startsWith",
|
|
820
820
|
value: e,
|
|
821
|
-
...
|
|
821
|
+
...p.errToObj(s)
|
|
822
822
|
});
|
|
823
823
|
}
|
|
824
824
|
endsWith(e, s) {
|
|
825
825
|
return this._addCheck({
|
|
826
826
|
kind: "endsWith",
|
|
827
827
|
value: e,
|
|
828
|
-
...
|
|
828
|
+
...p.errToObj(s)
|
|
829
829
|
});
|
|
830
830
|
}
|
|
831
831
|
min(e, s) {
|
|
832
832
|
return this._addCheck({
|
|
833
833
|
kind: "min",
|
|
834
834
|
value: e,
|
|
835
|
-
...
|
|
835
|
+
...p.errToObj(s)
|
|
836
836
|
});
|
|
837
837
|
}
|
|
838
838
|
max(e, s) {
|
|
839
839
|
return this._addCheck({
|
|
840
840
|
kind: "max",
|
|
841
841
|
value: e,
|
|
842
|
-
...
|
|
842
|
+
...p.errToObj(s)
|
|
843
843
|
});
|
|
844
844
|
}
|
|
845
845
|
length(e, s) {
|
|
846
846
|
return this._addCheck({
|
|
847
847
|
kind: "length",
|
|
848
848
|
value: e,
|
|
849
|
-
...
|
|
849
|
+
...p.errToObj(s)
|
|
850
850
|
});
|
|
851
851
|
}
|
|
852
852
|
/**
|
|
@@ -854,7 +854,7 @@ class C extends _ {
|
|
|
854
854
|
* @see {@link ZodString.min}
|
|
855
855
|
*/
|
|
856
856
|
nonempty(e) {
|
|
857
|
-
return this.min(1,
|
|
857
|
+
return this.min(1, p.errToObj(e));
|
|
858
858
|
}
|
|
859
859
|
trim() {
|
|
860
860
|
return new C({
|
|
@@ -942,7 +942,7 @@ function xt(t, e) {
|
|
|
942
942
|
const s = (t.toString().split(".")[1] || "").length, n = (e.toString().split(".")[1] || "").length, r = s > n ? s : n, a = parseInt(t.toFixed(r).replace(".", "")), i = parseInt(e.toFixed(r).replace(".", ""));
|
|
943
943
|
return a % i / Math.pow(10, r);
|
|
944
944
|
}
|
|
945
|
-
class
|
|
945
|
+
class $ extends _ {
|
|
946
946
|
constructor() {
|
|
947
947
|
super(...arguments), this.min = this.gte, this.max = this.lte, this.step = this.multipleOf;
|
|
948
948
|
}
|
|
@@ -988,19 +988,19 @@ class q extends _ {
|
|
|
988
988
|
return { status: r.value, value: e.data };
|
|
989
989
|
}
|
|
990
990
|
gte(e, s) {
|
|
991
|
-
return this.setLimit("min", e, !0,
|
|
991
|
+
return this.setLimit("min", e, !0, p.toString(s));
|
|
992
992
|
}
|
|
993
993
|
gt(e, s) {
|
|
994
|
-
return this.setLimit("min", e, !1,
|
|
994
|
+
return this.setLimit("min", e, !1, p.toString(s));
|
|
995
995
|
}
|
|
996
996
|
lte(e, s) {
|
|
997
|
-
return this.setLimit("max", e, !0,
|
|
997
|
+
return this.setLimit("max", e, !0, p.toString(s));
|
|
998
998
|
}
|
|
999
999
|
lt(e, s) {
|
|
1000
|
-
return this.setLimit("max", e, !1,
|
|
1000
|
+
return this.setLimit("max", e, !1, p.toString(s));
|
|
1001
1001
|
}
|
|
1002
1002
|
setLimit(e, s, n, r) {
|
|
1003
|
-
return new
|
|
1003
|
+
return new $({
|
|
1004
1004
|
...this._def,
|
|
1005
1005
|
checks: [
|
|
1006
1006
|
...this._def.checks,
|
|
@@ -1008,13 +1008,13 @@ class q extends _ {
|
|
|
1008
1008
|
kind: e,
|
|
1009
1009
|
value: s,
|
|
1010
1010
|
inclusive: n,
|
|
1011
|
-
message:
|
|
1011
|
+
message: p.toString(r)
|
|
1012
1012
|
}
|
|
1013
1013
|
]
|
|
1014
1014
|
});
|
|
1015
1015
|
}
|
|
1016
1016
|
_addCheck(e) {
|
|
1017
|
-
return new
|
|
1017
|
+
return new $({
|
|
1018
1018
|
...this._def,
|
|
1019
1019
|
checks: [...this._def.checks, e]
|
|
1020
1020
|
});
|
|
@@ -1022,7 +1022,7 @@ class q extends _ {
|
|
|
1022
1022
|
int(e) {
|
|
1023
1023
|
return this._addCheck({
|
|
1024
1024
|
kind: "int",
|
|
1025
|
-
message:
|
|
1025
|
+
message: p.toString(e)
|
|
1026
1026
|
});
|
|
1027
1027
|
}
|
|
1028
1028
|
positive(e) {
|
|
@@ -1030,7 +1030,7 @@ class q extends _ {
|
|
|
1030
1030
|
kind: "min",
|
|
1031
1031
|
value: 0,
|
|
1032
1032
|
inclusive: !1,
|
|
1033
|
-
message:
|
|
1033
|
+
message: p.toString(e)
|
|
1034
1034
|
});
|
|
1035
1035
|
}
|
|
1036
1036
|
negative(e) {
|
|
@@ -1038,7 +1038,7 @@ class q extends _ {
|
|
|
1038
1038
|
kind: "max",
|
|
1039
1039
|
value: 0,
|
|
1040
1040
|
inclusive: !1,
|
|
1041
|
-
message:
|
|
1041
|
+
message: p.toString(e)
|
|
1042
1042
|
});
|
|
1043
1043
|
}
|
|
1044
1044
|
nonpositive(e) {
|
|
@@ -1046,7 +1046,7 @@ class q extends _ {
|
|
|
1046
1046
|
kind: "max",
|
|
1047
1047
|
value: 0,
|
|
1048
1048
|
inclusive: !0,
|
|
1049
|
-
message:
|
|
1049
|
+
message: p.toString(e)
|
|
1050
1050
|
});
|
|
1051
1051
|
}
|
|
1052
1052
|
nonnegative(e) {
|
|
@@ -1054,20 +1054,20 @@ class q extends _ {
|
|
|
1054
1054
|
kind: "min",
|
|
1055
1055
|
value: 0,
|
|
1056
1056
|
inclusive: !0,
|
|
1057
|
-
message:
|
|
1057
|
+
message: p.toString(e)
|
|
1058
1058
|
});
|
|
1059
1059
|
}
|
|
1060
1060
|
multipleOf(e, s) {
|
|
1061
1061
|
return this._addCheck({
|
|
1062
1062
|
kind: "multipleOf",
|
|
1063
1063
|
value: e,
|
|
1064
|
-
message:
|
|
1064
|
+
message: p.toString(s)
|
|
1065
1065
|
});
|
|
1066
1066
|
}
|
|
1067
1067
|
finite(e) {
|
|
1068
1068
|
return this._addCheck({
|
|
1069
1069
|
kind: "finite",
|
|
1070
|
-
message:
|
|
1070
|
+
message: p.toString(e)
|
|
1071
1071
|
});
|
|
1072
1072
|
}
|
|
1073
1073
|
safe(e) {
|
|
@@ -1075,12 +1075,12 @@ class q extends _ {
|
|
|
1075
1075
|
kind: "min",
|
|
1076
1076
|
inclusive: !0,
|
|
1077
1077
|
value: Number.MIN_SAFE_INTEGER,
|
|
1078
|
-
message:
|
|
1078
|
+
message: p.toString(e)
|
|
1079
1079
|
})._addCheck({
|
|
1080
1080
|
kind: "max",
|
|
1081
1081
|
inclusive: !0,
|
|
1082
1082
|
value: Number.MAX_SAFE_INTEGER,
|
|
1083
|
-
message:
|
|
1083
|
+
message: p.toString(e)
|
|
1084
1084
|
});
|
|
1085
1085
|
}
|
|
1086
1086
|
get minValue() {
|
|
@@ -1108,13 +1108,13 @@ class q extends _ {
|
|
|
1108
1108
|
return Number.isFinite(s) && Number.isFinite(e);
|
|
1109
1109
|
}
|
|
1110
1110
|
}
|
|
1111
|
-
|
|
1111
|
+
$.create = (t) => new $({
|
|
1112
1112
|
checks: [],
|
|
1113
1113
|
typeName: m.ZodNumber,
|
|
1114
1114
|
coerce: (t == null ? void 0 : t.coerce) || !1,
|
|
1115
1115
|
...v(t)
|
|
1116
1116
|
});
|
|
1117
|
-
class
|
|
1117
|
+
class U extends _ {
|
|
1118
1118
|
constructor() {
|
|
1119
1119
|
super(...arguments), this.min = this.gte, this.max = this.lte;
|
|
1120
1120
|
}
|
|
@@ -1150,19 +1150,19 @@ class $ extends _ {
|
|
|
1150
1150
|
return { status: r.value, value: e.data };
|
|
1151
1151
|
}
|
|
1152
1152
|
gte(e, s) {
|
|
1153
|
-
return this.setLimit("min", e, !0,
|
|
1153
|
+
return this.setLimit("min", e, !0, p.toString(s));
|
|
1154
1154
|
}
|
|
1155
1155
|
gt(e, s) {
|
|
1156
|
-
return this.setLimit("min", e, !1,
|
|
1156
|
+
return this.setLimit("min", e, !1, p.toString(s));
|
|
1157
1157
|
}
|
|
1158
1158
|
lte(e, s) {
|
|
1159
|
-
return this.setLimit("max", e, !0,
|
|
1159
|
+
return this.setLimit("max", e, !0, p.toString(s));
|
|
1160
1160
|
}
|
|
1161
1161
|
lt(e, s) {
|
|
1162
|
-
return this.setLimit("max", e, !1,
|
|
1162
|
+
return this.setLimit("max", e, !1, p.toString(s));
|
|
1163
1163
|
}
|
|
1164
1164
|
setLimit(e, s, n, r) {
|
|
1165
|
-
return new
|
|
1165
|
+
return new U({
|
|
1166
1166
|
...this._def,
|
|
1167
1167
|
checks: [
|
|
1168
1168
|
...this._def.checks,
|
|
@@ -1170,13 +1170,13 @@ class $ extends _ {
|
|
|
1170
1170
|
kind: e,
|
|
1171
1171
|
value: s,
|
|
1172
1172
|
inclusive: n,
|
|
1173
|
-
message:
|
|
1173
|
+
message: p.toString(r)
|
|
1174
1174
|
}
|
|
1175
1175
|
]
|
|
1176
1176
|
});
|
|
1177
1177
|
}
|
|
1178
1178
|
_addCheck(e) {
|
|
1179
|
-
return new
|
|
1179
|
+
return new U({
|
|
1180
1180
|
...this._def,
|
|
1181
1181
|
checks: [...this._def.checks, e]
|
|
1182
1182
|
});
|
|
@@ -1186,7 +1186,7 @@ class $ extends _ {
|
|
|
1186
1186
|
kind: "min",
|
|
1187
1187
|
value: BigInt(0),
|
|
1188
1188
|
inclusive: !1,
|
|
1189
|
-
message:
|
|
1189
|
+
message: p.toString(e)
|
|
1190
1190
|
});
|
|
1191
1191
|
}
|
|
1192
1192
|
negative(e) {
|
|
@@ -1194,7 +1194,7 @@ class $ extends _ {
|
|
|
1194
1194
|
kind: "max",
|
|
1195
1195
|
value: BigInt(0),
|
|
1196
1196
|
inclusive: !1,
|
|
1197
|
-
message:
|
|
1197
|
+
message: p.toString(e)
|
|
1198
1198
|
});
|
|
1199
1199
|
}
|
|
1200
1200
|
nonpositive(e) {
|
|
@@ -1202,7 +1202,7 @@ class $ extends _ {
|
|
|
1202
1202
|
kind: "max",
|
|
1203
1203
|
value: BigInt(0),
|
|
1204
1204
|
inclusive: !0,
|
|
1205
|
-
message:
|
|
1205
|
+
message: p.toString(e)
|
|
1206
1206
|
});
|
|
1207
1207
|
}
|
|
1208
1208
|
nonnegative(e) {
|
|
@@ -1210,14 +1210,14 @@ class $ extends _ {
|
|
|
1210
1210
|
kind: "min",
|
|
1211
1211
|
value: BigInt(0),
|
|
1212
1212
|
inclusive: !0,
|
|
1213
|
-
message:
|
|
1213
|
+
message: p.toString(e)
|
|
1214
1214
|
});
|
|
1215
1215
|
}
|
|
1216
1216
|
multipleOf(e, s) {
|
|
1217
1217
|
return this._addCheck({
|
|
1218
1218
|
kind: "multipleOf",
|
|
1219
1219
|
value: e,
|
|
1220
|
-
message:
|
|
1220
|
+
message: p.toString(s)
|
|
1221
1221
|
});
|
|
1222
1222
|
}
|
|
1223
1223
|
get minValue() {
|
|
@@ -1233,9 +1233,9 @@ class $ extends _ {
|
|
|
1233
1233
|
return e;
|
|
1234
1234
|
}
|
|
1235
1235
|
}
|
|
1236
|
-
|
|
1236
|
+
U.create = (t) => {
|
|
1237
1237
|
var e;
|
|
1238
|
-
return new
|
|
1238
|
+
return new U({
|
|
1239
1239
|
checks: [],
|
|
1240
1240
|
typeName: m.ZodBigInt,
|
|
1241
1241
|
coerce: (e = t == null ? void 0 : t.coerce) !== null && e !== void 0 ? e : !1,
|
|
@@ -1309,14 +1309,14 @@ class z extends _ {
|
|
|
1309
1309
|
return this._addCheck({
|
|
1310
1310
|
kind: "min",
|
|
1311
1311
|
value: e.getTime(),
|
|
1312
|
-
message:
|
|
1312
|
+
message: p.toString(s)
|
|
1313
1313
|
});
|
|
1314
1314
|
}
|
|
1315
1315
|
max(e, s) {
|
|
1316
1316
|
return this._addCheck({
|
|
1317
1317
|
kind: "max",
|
|
1318
1318
|
value: e.getTime(),
|
|
1319
|
-
message:
|
|
1319
|
+
message: p.toString(s)
|
|
1320
1320
|
});
|
|
1321
1321
|
}
|
|
1322
1322
|
get minDate() {
|
|
@@ -1338,7 +1338,7 @@ z.create = (t) => new z({
|
|
|
1338
1338
|
typeName: m.ZodDate,
|
|
1339
1339
|
...v(t)
|
|
1340
1340
|
});
|
|
1341
|
-
class
|
|
1341
|
+
class we extends _ {
|
|
1342
1342
|
_parse(e) {
|
|
1343
1343
|
if (this._getType(e) !== f.symbol) {
|
|
1344
1344
|
const n = this._getOrReturnCtx(e);
|
|
@@ -1351,7 +1351,7 @@ class ke extends _ {
|
|
|
1351
1351
|
return T(e.data);
|
|
1352
1352
|
}
|
|
1353
1353
|
}
|
|
1354
|
-
|
|
1354
|
+
we.create = (t) => new we({
|
|
1355
1355
|
typeName: m.ZodSymbol,
|
|
1356
1356
|
...v(t)
|
|
1357
1357
|
});
|
|
@@ -1413,7 +1413,7 @@ B.create = (t) => new B({
|
|
|
1413
1413
|
typeName: m.ZodUnknown,
|
|
1414
1414
|
...v(t)
|
|
1415
1415
|
});
|
|
1416
|
-
class
|
|
1416
|
+
class P extends _ {
|
|
1417
1417
|
_parse(e) {
|
|
1418
1418
|
const s = this._getOrReturnCtx(e);
|
|
1419
1419
|
return l(s, {
|
|
@@ -1423,11 +1423,11 @@ class A extends _ {
|
|
|
1423
1423
|
}), y;
|
|
1424
1424
|
}
|
|
1425
1425
|
}
|
|
1426
|
-
|
|
1426
|
+
P.create = (t) => new P({
|
|
1427
1427
|
typeName: m.ZodNever,
|
|
1428
1428
|
...v(t)
|
|
1429
1429
|
});
|
|
1430
|
-
class
|
|
1430
|
+
class ke extends _ {
|
|
1431
1431
|
_parse(e) {
|
|
1432
1432
|
if (this._getType(e) !== f.undefined) {
|
|
1433
1433
|
const n = this._getOrReturnCtx(e);
|
|
@@ -1440,7 +1440,7 @@ class we extends _ {
|
|
|
1440
1440
|
return T(e.data);
|
|
1441
1441
|
}
|
|
1442
1442
|
}
|
|
1443
|
-
|
|
1443
|
+
ke.create = (t) => new ke({
|
|
1444
1444
|
typeName: m.ZodVoid,
|
|
1445
1445
|
...v(t)
|
|
1446
1446
|
});
|
|
@@ -1480,8 +1480,8 @@ class Z extends _ {
|
|
|
1480
1480
|
exact: !1,
|
|
1481
1481
|
message: r.maxLength.message
|
|
1482
1482
|
}), n.dirty()), s.common.async)
|
|
1483
|
-
return Promise.all([...s.data].map((i, o) => r.type._parseAsync(new
|
|
1484
|
-
const a = [...s.data].map((i, o) => r.type._parseSync(new
|
|
1483
|
+
return Promise.all([...s.data].map((i, o) => r.type._parseAsync(new O(s, i, s.path, o)))).then((i) => S.mergeArray(n, i));
|
|
1484
|
+
const a = [...s.data].map((i, o) => r.type._parseSync(new O(s, i, s.path, o)));
|
|
1485
1485
|
return S.mergeArray(n, a);
|
|
1486
1486
|
}
|
|
1487
1487
|
get element() {
|
|
@@ -1490,19 +1490,19 @@ class Z extends _ {
|
|
|
1490
1490
|
min(e, s) {
|
|
1491
1491
|
return new Z({
|
|
1492
1492
|
...this._def,
|
|
1493
|
-
minLength: { value: e, message:
|
|
1493
|
+
minLength: { value: e, message: p.toString(s) }
|
|
1494
1494
|
});
|
|
1495
1495
|
}
|
|
1496
1496
|
max(e, s) {
|
|
1497
1497
|
return new Z({
|
|
1498
1498
|
...this._def,
|
|
1499
|
-
maxLength: { value: e, message:
|
|
1499
|
+
maxLength: { value: e, message: p.toString(s) }
|
|
1500
1500
|
});
|
|
1501
1501
|
}
|
|
1502
1502
|
length(e, s) {
|
|
1503
1503
|
return new Z({
|
|
1504
1504
|
...this._def,
|
|
1505
|
-
exactLength: { value: e, message:
|
|
1505
|
+
exactLength: { value: e, message: p.toString(s) }
|
|
1506
1506
|
});
|
|
1507
1507
|
}
|
|
1508
1508
|
nonempty(e) {
|
|
@@ -1532,7 +1532,7 @@ function Q(t) {
|
|
|
1532
1532
|
return t instanceof Z ? new Z({
|
|
1533
1533
|
...t._def,
|
|
1534
1534
|
type: Q(t.element)
|
|
1535
|
-
}) : t instanceof I ? I.create(Q(t.unwrap())) : t instanceof
|
|
1535
|
+
}) : t instanceof I ? I.create(Q(t.unwrap())) : t instanceof V ? V.create(Q(t.unwrap())) : t instanceof A ? A.create(t.items.map((e) => Q(e))) : t;
|
|
1536
1536
|
}
|
|
1537
1537
|
class b extends _ {
|
|
1538
1538
|
constructor() {
|
|
@@ -1546,49 +1546,49 @@ class b extends _ {
|
|
|
1546
1546
|
}
|
|
1547
1547
|
_parse(e) {
|
|
1548
1548
|
if (this._getType(e) !== f.object) {
|
|
1549
|
-
const
|
|
1550
|
-
return l(
|
|
1549
|
+
const d = this._getOrReturnCtx(e);
|
|
1550
|
+
return l(d, {
|
|
1551
1551
|
code: c.invalid_type,
|
|
1552
1552
|
expected: f.object,
|
|
1553
|
-
received:
|
|
1553
|
+
received: d.parsedType
|
|
1554
1554
|
}), y;
|
|
1555
1555
|
}
|
|
1556
1556
|
const { status: n, ctx: r } = this._processInputParams(e), { shape: a, keys: i } = this._getCached(), o = [];
|
|
1557
|
-
if (!(this._def.catchall instanceof
|
|
1558
|
-
for (const
|
|
1559
|
-
i.includes(
|
|
1560
|
-
const
|
|
1561
|
-
for (const
|
|
1562
|
-
const g = a[
|
|
1563
|
-
|
|
1564
|
-
key: { status: "valid", value:
|
|
1565
|
-
value: g._parse(new
|
|
1566
|
-
alwaysSet:
|
|
1557
|
+
if (!(this._def.catchall instanceof P && this._def.unknownKeys === "strip"))
|
|
1558
|
+
for (const d in r.data)
|
|
1559
|
+
i.includes(d) || o.push(d);
|
|
1560
|
+
const u = [];
|
|
1561
|
+
for (const d of i) {
|
|
1562
|
+
const g = a[d], R = r.data[d];
|
|
1563
|
+
u.push({
|
|
1564
|
+
key: { status: "valid", value: d },
|
|
1565
|
+
value: g._parse(new O(r, R, r.path, d)),
|
|
1566
|
+
alwaysSet: d in r.data
|
|
1567
1567
|
});
|
|
1568
1568
|
}
|
|
1569
|
-
if (this._def.catchall instanceof
|
|
1570
|
-
const
|
|
1571
|
-
if (
|
|
1569
|
+
if (this._def.catchall instanceof P) {
|
|
1570
|
+
const d = this._def.unknownKeys;
|
|
1571
|
+
if (d === "passthrough")
|
|
1572
1572
|
for (const g of o)
|
|
1573
|
-
|
|
1573
|
+
u.push({
|
|
1574
1574
|
key: { status: "valid", value: g },
|
|
1575
1575
|
value: { status: "valid", value: r.data[g] }
|
|
1576
1576
|
});
|
|
1577
|
-
else if (
|
|
1577
|
+
else if (d === "strict")
|
|
1578
1578
|
o.length > 0 && (l(r, {
|
|
1579
1579
|
code: c.unrecognized_keys,
|
|
1580
1580
|
keys: o
|
|
1581
1581
|
}), n.dirty());
|
|
1582
|
-
else if (
|
|
1582
|
+
else if (d !== "strip")
|
|
1583
1583
|
throw new Error("Internal ZodObject error: invalid unknownKeys value.");
|
|
1584
1584
|
} else {
|
|
1585
|
-
const
|
|
1585
|
+
const d = this._def.catchall;
|
|
1586
1586
|
for (const g of o) {
|
|
1587
1587
|
const R = r.data[g];
|
|
1588
|
-
|
|
1588
|
+
u.push({
|
|
1589
1589
|
key: { status: "valid", value: g },
|
|
1590
|
-
value:
|
|
1591
|
-
new
|
|
1590
|
+
value: d._parse(
|
|
1591
|
+
new O(r, R, r.path, g)
|
|
1592
1592
|
//, ctx.child(key), value, getParsedType(value)
|
|
1593
1593
|
),
|
|
1594
1594
|
alwaysSet: g in r.data
|
|
@@ -1596,33 +1596,33 @@ class b extends _ {
|
|
|
1596
1596
|
}
|
|
1597
1597
|
}
|
|
1598
1598
|
return r.common.async ? Promise.resolve().then(async () => {
|
|
1599
|
-
const
|
|
1600
|
-
for (const g of
|
|
1599
|
+
const d = [];
|
|
1600
|
+
for (const g of u) {
|
|
1601
1601
|
const R = await g.key, D = await g.value;
|
|
1602
|
-
|
|
1602
|
+
d.push({
|
|
1603
1603
|
key: R,
|
|
1604
1604
|
value: D,
|
|
1605
1605
|
alwaysSet: g.alwaysSet
|
|
1606
1606
|
});
|
|
1607
1607
|
}
|
|
1608
|
-
return
|
|
1609
|
-
}).then((
|
|
1608
|
+
return d;
|
|
1609
|
+
}).then((d) => S.mergeObjectSync(n, d)) : S.mergeObjectSync(n, u);
|
|
1610
1610
|
}
|
|
1611
1611
|
get shape() {
|
|
1612
1612
|
return this._def.shape();
|
|
1613
1613
|
}
|
|
1614
1614
|
strict(e) {
|
|
1615
|
-
return
|
|
1615
|
+
return p.errToObj, new b({
|
|
1616
1616
|
...this._def,
|
|
1617
1617
|
unknownKeys: "strict",
|
|
1618
1618
|
...e !== void 0 ? {
|
|
1619
1619
|
errorMap: (s, n) => {
|
|
1620
1620
|
var r, a, i, o;
|
|
1621
|
-
const
|
|
1621
|
+
const u = (i = (a = (r = this._def).errorMap) === null || a === void 0 ? void 0 : a.call(r, s, n).message) !== null && i !== void 0 ? i : n.defaultError;
|
|
1622
1622
|
return s.code === "unrecognized_keys" ? {
|
|
1623
|
-
message: (o =
|
|
1623
|
+
message: (o = p.errToObj(e).message) !== null && o !== void 0 ? o : u
|
|
1624
1624
|
} : {
|
|
1625
|
-
message:
|
|
1625
|
+
message: u
|
|
1626
1626
|
};
|
|
1627
1627
|
}
|
|
1628
1628
|
} : {}
|
|
@@ -1804,21 +1804,21 @@ class b extends _ {
|
|
|
1804
1804
|
b.create = (t, e) => new b({
|
|
1805
1805
|
shape: () => t,
|
|
1806
1806
|
unknownKeys: "strip",
|
|
1807
|
-
catchall:
|
|
1807
|
+
catchall: P.create(),
|
|
1808
1808
|
typeName: m.ZodObject,
|
|
1809
1809
|
...v(e)
|
|
1810
1810
|
});
|
|
1811
1811
|
b.strictCreate = (t, e) => new b({
|
|
1812
1812
|
shape: () => t,
|
|
1813
1813
|
unknownKeys: "strict",
|
|
1814
|
-
catchall:
|
|
1814
|
+
catchall: P.create(),
|
|
1815
1815
|
typeName: m.ZodObject,
|
|
1816
1816
|
...v(e)
|
|
1817
1817
|
});
|
|
1818
1818
|
b.lazycreate = (t, e) => new b({
|
|
1819
1819
|
shape: t,
|
|
1820
1820
|
unknownKeys: "strip",
|
|
1821
|
-
catchall:
|
|
1821
|
+
catchall: P.create(),
|
|
1822
1822
|
typeName: m.ZodObject,
|
|
1823
1823
|
...v(e)
|
|
1824
1824
|
});
|
|
@@ -1860,26 +1860,26 @@ class oe extends _ {
|
|
|
1860
1860
|
{
|
|
1861
1861
|
let a;
|
|
1862
1862
|
const i = [];
|
|
1863
|
-
for (const
|
|
1864
|
-
const
|
|
1863
|
+
for (const u of n) {
|
|
1864
|
+
const d = {
|
|
1865
1865
|
...s,
|
|
1866
1866
|
common: {
|
|
1867
1867
|
...s.common,
|
|
1868
1868
|
issues: []
|
|
1869
1869
|
},
|
|
1870
1870
|
parent: null
|
|
1871
|
-
}, g =
|
|
1871
|
+
}, g = u._parseSync({
|
|
1872
1872
|
data: s.data,
|
|
1873
1873
|
path: s.path,
|
|
1874
|
-
parent:
|
|
1874
|
+
parent: d
|
|
1875
1875
|
});
|
|
1876
1876
|
if (g.status === "valid")
|
|
1877
1877
|
return g;
|
|
1878
|
-
g.status === "dirty" && !a && (a = { result: g, ctx:
|
|
1878
|
+
g.status === "dirty" && !a && (a = { result: g, ctx: d }), d.common.issues.length && i.push(d.common.issues);
|
|
1879
1879
|
}
|
|
1880
1880
|
if (a)
|
|
1881
1881
|
return s.common.issues.push(...a.ctx.common.issues), a.result;
|
|
1882
|
-
const o = i.map((
|
|
1882
|
+
const o = i.map((u) => new E(u));
|
|
1883
1883
|
return l(s, {
|
|
1884
1884
|
code: c.invalid_union,
|
|
1885
1885
|
unionErrors: o
|
|
@@ -1895,7 +1895,7 @@ oe.create = (t, e) => new oe({
|
|
|
1895
1895
|
typeName: m.ZodUnion,
|
|
1896
1896
|
...v(e)
|
|
1897
1897
|
});
|
|
1898
|
-
const j = (t) => t instanceof ue ? j(t.schema) : t instanceof
|
|
1898
|
+
const j = (t) => t instanceof ue ? j(t.schema) : t instanceof N ? j(t.innerType()) : t instanceof le ? [t.value] : t instanceof L ? t.options : t instanceof fe ? x.objectValues(t.enum) : t instanceof he ? j(t._def.innerType) : t instanceof ae ? [void 0] : t instanceof ie ? [null] : t instanceof I ? [void 0, ...j(t.unwrap())] : t instanceof V ? [null, ...j(t.unwrap())] : t instanceof Oe || t instanceof me ? j(t.unwrap()) : t instanceof pe ? j(t._def.innerType) : [];
|
|
1899
1899
|
class Re extends _ {
|
|
1900
1900
|
_parse(e) {
|
|
1901
1901
|
const { ctx: s } = this._processInputParams(e);
|
|
@@ -1958,17 +1958,17 @@ class Re extends _ {
|
|
|
1958
1958
|
});
|
|
1959
1959
|
}
|
|
1960
1960
|
}
|
|
1961
|
-
function
|
|
1962
|
-
const s =
|
|
1961
|
+
function Ie(t, e) {
|
|
1962
|
+
const s = q(t), n = q(e);
|
|
1963
1963
|
if (t === e)
|
|
1964
1964
|
return { valid: !0, data: t };
|
|
1965
1965
|
if (s === f.object && n === f.object) {
|
|
1966
1966
|
const r = x.objectKeys(e), a = x.objectKeys(t).filter((o) => r.indexOf(o) !== -1), i = { ...t, ...e };
|
|
1967
1967
|
for (const o of a) {
|
|
1968
|
-
const
|
|
1969
|
-
if (!
|
|
1968
|
+
const u = Ie(t[o], e[o]);
|
|
1969
|
+
if (!u.valid)
|
|
1970
1970
|
return { valid: !1 };
|
|
1971
|
-
i[o] =
|
|
1971
|
+
i[o] = u.data;
|
|
1972
1972
|
}
|
|
1973
1973
|
return { valid: !0, data: i };
|
|
1974
1974
|
} else if (s === f.array && n === f.array) {
|
|
@@ -1976,10 +1976,10 @@ function Me(t, e) {
|
|
|
1976
1976
|
return { valid: !1 };
|
|
1977
1977
|
const r = [];
|
|
1978
1978
|
for (let a = 0; a < t.length; a++) {
|
|
1979
|
-
const i = t[a], o = e[a],
|
|
1980
|
-
if (!
|
|
1979
|
+
const i = t[a], o = e[a], u = Ie(i, o);
|
|
1980
|
+
if (!u.valid)
|
|
1981
1981
|
return { valid: !1 };
|
|
1982
|
-
r.push(
|
|
1982
|
+
r.push(u.data);
|
|
1983
1983
|
}
|
|
1984
1984
|
return { valid: !0, data: r };
|
|
1985
1985
|
} else
|
|
@@ -1988,10 +1988,10 @@ function Me(t, e) {
|
|
|
1988
1988
|
class ce extends _ {
|
|
1989
1989
|
_parse(e) {
|
|
1990
1990
|
const { status: s, ctx: n } = this._processInputParams(e), r = (a, i) => {
|
|
1991
|
-
if (
|
|
1991
|
+
if (Ne(a) || Ne(i))
|
|
1992
1992
|
return y;
|
|
1993
|
-
const o =
|
|
1994
|
-
return o.valid ? ((
|
|
1993
|
+
const o = Ie(a.value, i.value);
|
|
1994
|
+
return o.valid ? ((Me(a) || Me(i)) && s.dirty(), { status: s.value, value: o.data }) : (l(n, {
|
|
1995
1995
|
code: c.invalid_intersection_types
|
|
1996
1996
|
}), y);
|
|
1997
1997
|
};
|
|
@@ -2023,7 +2023,7 @@ ce.create = (t, e, s) => new ce({
|
|
|
2023
2023
|
typeName: m.ZodIntersection,
|
|
2024
2024
|
...v(s)
|
|
2025
2025
|
});
|
|
2026
|
-
class
|
|
2026
|
+
class A extends _ {
|
|
2027
2027
|
_parse(e) {
|
|
2028
2028
|
const { status: s, ctx: n } = this._processInputParams(e);
|
|
2029
2029
|
if (n.parsedType !== f.array)
|
|
@@ -2048,8 +2048,8 @@ class N extends _ {
|
|
|
2048
2048
|
type: "array"
|
|
2049
2049
|
}), s.dirty());
|
|
2050
2050
|
const a = [...n.data].map((i, o) => {
|
|
2051
|
-
const
|
|
2052
|
-
return
|
|
2051
|
+
const u = this._def.items[o] || this._def.rest;
|
|
2052
|
+
return u ? u._parse(new O(n, i, n.path, o)) : null;
|
|
2053
2053
|
}).filter((i) => !!i);
|
|
2054
2054
|
return n.common.async ? Promise.all(a).then((i) => S.mergeArray(s, i)) : S.mergeArray(s, a);
|
|
2055
2055
|
}
|
|
@@ -2057,16 +2057,16 @@ class N extends _ {
|
|
|
2057
2057
|
return this._def.items;
|
|
2058
2058
|
}
|
|
2059
2059
|
rest(e) {
|
|
2060
|
-
return new
|
|
2060
|
+
return new A({
|
|
2061
2061
|
...this._def,
|
|
2062
2062
|
rest: e
|
|
2063
2063
|
});
|
|
2064
2064
|
}
|
|
2065
2065
|
}
|
|
2066
|
-
|
|
2066
|
+
A.create = (t, e) => {
|
|
2067
2067
|
if (!Array.isArray(t))
|
|
2068
2068
|
throw new Error("You must pass an array of schemas to z.tuple([ ... ])");
|
|
2069
|
-
return new
|
|
2069
|
+
return new A({
|
|
2070
2070
|
items: t,
|
|
2071
2071
|
typeName: m.ZodTuple,
|
|
2072
2072
|
rest: null,
|
|
@@ -2091,8 +2091,8 @@ class de extends _ {
|
|
|
2091
2091
|
const r = [], a = this._def.keyType, i = this._def.valueType;
|
|
2092
2092
|
for (const o in n.data)
|
|
2093
2093
|
r.push({
|
|
2094
|
-
key: a._parse(new
|
|
2095
|
-
value: i._parse(new
|
|
2094
|
+
key: a._parse(new O(n, o, n.path, o)),
|
|
2095
|
+
value: i._parse(new O(n, n.data[o], n.path, o)),
|
|
2096
2096
|
alwaysSet: o in n.data
|
|
2097
2097
|
});
|
|
2098
2098
|
return n.common.async ? S.mergeObjectAsync(s, r) : S.mergeObjectSync(s, r);
|
|
@@ -2129,28 +2129,28 @@ class Se extends _ {
|
|
|
2129
2129
|
expected: f.map,
|
|
2130
2130
|
received: n.parsedType
|
|
2131
2131
|
}), y;
|
|
2132
|
-
const r = this._def.keyType, a = this._def.valueType, i = [...n.data.entries()].map(([o,
|
|
2133
|
-
key: r._parse(new
|
|
2134
|
-
value: a._parse(new
|
|
2132
|
+
const r = this._def.keyType, a = this._def.valueType, i = [...n.data.entries()].map(([o, u], d) => ({
|
|
2133
|
+
key: r._parse(new O(n, o, n.path, [d, "key"])),
|
|
2134
|
+
value: a._parse(new O(n, u, n.path, [d, "value"]))
|
|
2135
2135
|
}));
|
|
2136
2136
|
if (n.common.async) {
|
|
2137
2137
|
const o = /* @__PURE__ */ new Map();
|
|
2138
2138
|
return Promise.resolve().then(async () => {
|
|
2139
|
-
for (const
|
|
2140
|
-
const
|
|
2141
|
-
if (
|
|
2139
|
+
for (const u of i) {
|
|
2140
|
+
const d = await u.key, g = await u.value;
|
|
2141
|
+
if (d.status === "aborted" || g.status === "aborted")
|
|
2142
2142
|
return y;
|
|
2143
|
-
(
|
|
2143
|
+
(d.status === "dirty" || g.status === "dirty") && s.dirty(), o.set(d.value, g.value);
|
|
2144
2144
|
}
|
|
2145
2145
|
return { status: s.value, value: o };
|
|
2146
2146
|
});
|
|
2147
2147
|
} else {
|
|
2148
2148
|
const o = /* @__PURE__ */ new Map();
|
|
2149
|
-
for (const
|
|
2150
|
-
const
|
|
2151
|
-
if (
|
|
2149
|
+
for (const u of i) {
|
|
2150
|
+
const d = u.key, g = u.value;
|
|
2151
|
+
if (d.status === "aborted" || g.status === "aborted")
|
|
2152
2152
|
return y;
|
|
2153
|
-
(
|
|
2153
|
+
(d.status === "dirty" || g.status === "dirty") && s.dirty(), o.set(d.value, g.value);
|
|
2154
2154
|
}
|
|
2155
2155
|
return { status: s.value, value: o };
|
|
2156
2156
|
}
|
|
@@ -2188,28 +2188,28 @@ class G extends _ {
|
|
|
2188
2188
|
message: r.maxSize.message
|
|
2189
2189
|
}), s.dirty());
|
|
2190
2190
|
const a = this._def.valueType;
|
|
2191
|
-
function i(
|
|
2192
|
-
const
|
|
2193
|
-
for (const g of
|
|
2191
|
+
function i(u) {
|
|
2192
|
+
const d = /* @__PURE__ */ new Set();
|
|
2193
|
+
for (const g of u) {
|
|
2194
2194
|
if (g.status === "aborted")
|
|
2195
2195
|
return y;
|
|
2196
|
-
g.status === "dirty" && s.dirty(),
|
|
2196
|
+
g.status === "dirty" && s.dirty(), d.add(g.value);
|
|
2197
2197
|
}
|
|
2198
|
-
return { status: s.value, value:
|
|
2198
|
+
return { status: s.value, value: d };
|
|
2199
2199
|
}
|
|
2200
|
-
const o = [...n.data.values()].map((
|
|
2201
|
-
return n.common.async ? Promise.all(o).then((
|
|
2200
|
+
const o = [...n.data.values()].map((u, d) => a._parse(new O(n, u, n.path, d)));
|
|
2201
|
+
return n.common.async ? Promise.all(o).then((u) => i(u)) : i(o);
|
|
2202
2202
|
}
|
|
2203
2203
|
min(e, s) {
|
|
2204
2204
|
return new G({
|
|
2205
2205
|
...this._def,
|
|
2206
|
-
minSize: { value: e, message:
|
|
2206
|
+
minSize: { value: e, message: p.toString(s) }
|
|
2207
2207
|
});
|
|
2208
2208
|
}
|
|
2209
2209
|
max(e, s) {
|
|
2210
2210
|
return new G({
|
|
2211
2211
|
...this._def,
|
|
2212
|
-
maxSize: { value: e, message:
|
|
2212
|
+
maxSize: { value: e, message: p.toString(s) }
|
|
2213
2213
|
});
|
|
2214
2214
|
}
|
|
2215
2215
|
size(e, s) {
|
|
@@ -2238,7 +2238,7 @@ class H extends _ {
|
|
|
2238
2238
|
expected: f.function,
|
|
2239
2239
|
received: s.parsedType
|
|
2240
2240
|
}), y;
|
|
2241
|
-
function n(o,
|
|
2241
|
+
function n(o, u) {
|
|
2242
2242
|
return xe({
|
|
2243
2243
|
data: o,
|
|
2244
2244
|
path: s.path,
|
|
@@ -2247,14 +2247,14 @@ class H extends _ {
|
|
|
2247
2247
|
s.schemaErrorMap,
|
|
2248
2248
|
_e(),
|
|
2249
2249
|
Y
|
|
2250
|
-
].filter((
|
|
2250
|
+
].filter((d) => !!d),
|
|
2251
2251
|
issueData: {
|
|
2252
2252
|
code: c.invalid_arguments,
|
|
2253
|
-
argumentsError:
|
|
2253
|
+
argumentsError: u
|
|
2254
2254
|
}
|
|
2255
2255
|
});
|
|
2256
2256
|
}
|
|
2257
|
-
function r(o,
|
|
2257
|
+
function r(o, u) {
|
|
2258
2258
|
return xe({
|
|
2259
2259
|
data: o,
|
|
2260
2260
|
path: s.path,
|
|
@@ -2263,31 +2263,31 @@ class H extends _ {
|
|
|
2263
2263
|
s.schemaErrorMap,
|
|
2264
2264
|
_e(),
|
|
2265
2265
|
Y
|
|
2266
|
-
].filter((
|
|
2266
|
+
].filter((d) => !!d),
|
|
2267
2267
|
issueData: {
|
|
2268
2268
|
code: c.invalid_return_type,
|
|
2269
|
-
returnTypeError:
|
|
2269
|
+
returnTypeError: u
|
|
2270
2270
|
}
|
|
2271
2271
|
});
|
|
2272
2272
|
}
|
|
2273
2273
|
const a = { errorMap: s.common.contextualErrorMap }, i = s.data;
|
|
2274
2274
|
if (this._def.returns instanceof X) {
|
|
2275
2275
|
const o = this;
|
|
2276
|
-
return T(async function(...
|
|
2277
|
-
const
|
|
2278
|
-
throw
|
|
2276
|
+
return T(async function(...u) {
|
|
2277
|
+
const d = new E([]), g = await o._def.args.parseAsync(u, a).catch((Ee) => {
|
|
2278
|
+
throw d.addIssue(n(u, Ee)), d;
|
|
2279
2279
|
}), R = await Reflect.apply(i, this, g);
|
|
2280
2280
|
return await o._def.returns._def.type.parseAsync(R, a).catch((Ee) => {
|
|
2281
|
-
throw
|
|
2281
|
+
throw d.addIssue(r(R, Ee)), d;
|
|
2282
2282
|
});
|
|
2283
2283
|
});
|
|
2284
2284
|
} else {
|
|
2285
2285
|
const o = this;
|
|
2286
|
-
return T(function(...
|
|
2287
|
-
const
|
|
2288
|
-
if (!
|
|
2289
|
-
throw new E([n(
|
|
2290
|
-
const g = Reflect.apply(i, this,
|
|
2286
|
+
return T(function(...u) {
|
|
2287
|
+
const d = o._def.args.safeParse(u, a);
|
|
2288
|
+
if (!d.success)
|
|
2289
|
+
throw new E([n(u, d.error)]);
|
|
2290
|
+
const g = Reflect.apply(i, this, d.data), R = o._def.returns.safeParse(g, a);
|
|
2291
2291
|
if (!R.success)
|
|
2292
2292
|
throw new E([r(g, R.error)]);
|
|
2293
2293
|
return R.data;
|
|
@@ -2303,7 +2303,7 @@ class H extends _ {
|
|
|
2303
2303
|
args(...e) {
|
|
2304
2304
|
return new H({
|
|
2305
2305
|
...this._def,
|
|
2306
|
-
args:
|
|
2306
|
+
args: A.create(e).rest(B.create())
|
|
2307
2307
|
});
|
|
2308
2308
|
}
|
|
2309
2309
|
returns(e) {
|
|
@@ -2320,7 +2320,7 @@ class H extends _ {
|
|
|
2320
2320
|
}
|
|
2321
2321
|
static create(e, s, n) {
|
|
2322
2322
|
return new H({
|
|
2323
|
-
args: e ||
|
|
2323
|
+
args: e || A.create([]).rest(B.create()),
|
|
2324
2324
|
returns: s || B.create(),
|
|
2325
2325
|
typeName: m.ZodFunction,
|
|
2326
2326
|
...v(n)
|
|
@@ -2363,13 +2363,13 @@ le.create = (t, e) => new le({
|
|
|
2363
2363
|
...v(e)
|
|
2364
2364
|
});
|
|
2365
2365
|
function Be(t, e) {
|
|
2366
|
-
return new
|
|
2366
|
+
return new L({
|
|
2367
2367
|
values: t,
|
|
2368
2368
|
typeName: m.ZodEnum,
|
|
2369
2369
|
...v(e)
|
|
2370
2370
|
});
|
|
2371
2371
|
}
|
|
2372
|
-
class
|
|
2372
|
+
class L extends _ {
|
|
2373
2373
|
constructor() {
|
|
2374
2374
|
super(...arguments), F.set(this, void 0);
|
|
2375
2375
|
}
|
|
@@ -2414,20 +2414,20 @@ class U extends _ {
|
|
|
2414
2414
|
return e;
|
|
2415
2415
|
}
|
|
2416
2416
|
extract(e, s = this._def) {
|
|
2417
|
-
return
|
|
2417
|
+
return L.create(e, {
|
|
2418
2418
|
...this._def,
|
|
2419
2419
|
...s
|
|
2420
2420
|
});
|
|
2421
2421
|
}
|
|
2422
2422
|
exclude(e, s = this._def) {
|
|
2423
|
-
return
|
|
2423
|
+
return L.create(this.options.filter((n) => !e.includes(n)), {
|
|
2424
2424
|
...this._def,
|
|
2425
2425
|
...s
|
|
2426
2426
|
});
|
|
2427
2427
|
}
|
|
2428
2428
|
}
|
|
2429
2429
|
F = /* @__PURE__ */ new WeakMap();
|
|
2430
|
-
|
|
2430
|
+
L.create = Be;
|
|
2431
2431
|
class fe extends _ {
|
|
2432
2432
|
constructor() {
|
|
2433
2433
|
super(...arguments), ee.set(this, void 0);
|
|
@@ -2486,7 +2486,7 @@ X.create = (t, e) => new X({
|
|
|
2486
2486
|
typeName: m.ZodPromise,
|
|
2487
2487
|
...v(e)
|
|
2488
2488
|
});
|
|
2489
|
-
class
|
|
2489
|
+
class N extends _ {
|
|
2490
2490
|
innerType() {
|
|
2491
2491
|
return this._def.schema;
|
|
2492
2492
|
}
|
|
@@ -2508,12 +2508,12 @@ class O extends _ {
|
|
|
2508
2508
|
return Promise.resolve(i).then(async (o) => {
|
|
2509
2509
|
if (s.value === "aborted")
|
|
2510
2510
|
return y;
|
|
2511
|
-
const
|
|
2511
|
+
const u = await this._def.schema._parseAsync({
|
|
2512
2512
|
data: o,
|
|
2513
2513
|
path: n.path,
|
|
2514
2514
|
parent: n
|
|
2515
2515
|
});
|
|
2516
|
-
return
|
|
2516
|
+
return u.status === "aborted" ? y : u.status === "dirty" || s.value === "dirty" ? W(u.value) : u;
|
|
2517
2517
|
});
|
|
2518
2518
|
{
|
|
2519
2519
|
if (s.value === "aborted")
|
|
@@ -2528,10 +2528,10 @@ class O extends _ {
|
|
|
2528
2528
|
}
|
|
2529
2529
|
if (r.type === "refinement") {
|
|
2530
2530
|
const i = (o) => {
|
|
2531
|
-
const
|
|
2531
|
+
const u = r.refinement(o, a);
|
|
2532
2532
|
if (n.common.async)
|
|
2533
|
-
return Promise.resolve(
|
|
2534
|
-
if (
|
|
2533
|
+
return Promise.resolve(u);
|
|
2534
|
+
if (u instanceof Promise)
|
|
2535
2535
|
throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");
|
|
2536
2536
|
return o;
|
|
2537
2537
|
};
|
|
@@ -2563,13 +2563,13 @@ class O extends _ {
|
|
|
2563
2563
|
x.assertNever(r);
|
|
2564
2564
|
}
|
|
2565
2565
|
}
|
|
2566
|
-
|
|
2566
|
+
N.create = (t, e, s) => new N({
|
|
2567
2567
|
schema: t,
|
|
2568
2568
|
typeName: m.ZodEffects,
|
|
2569
2569
|
effect: e,
|
|
2570
2570
|
...v(s)
|
|
2571
2571
|
});
|
|
2572
|
-
|
|
2572
|
+
N.createWithPreprocess = (t, e, s) => new N({
|
|
2573
2573
|
schema: e,
|
|
2574
2574
|
effect: { type: "preprocess", transform: t },
|
|
2575
2575
|
typeName: m.ZodEffects,
|
|
@@ -2588,7 +2588,7 @@ I.create = (t, e) => new I({
|
|
|
2588
2588
|
typeName: m.ZodOptional,
|
|
2589
2589
|
...v(e)
|
|
2590
2590
|
});
|
|
2591
|
-
class
|
|
2591
|
+
class V extends _ {
|
|
2592
2592
|
_parse(e) {
|
|
2593
2593
|
return this._getType(e) === f.null ? T(null) : this._def.innerType._parse(e);
|
|
2594
2594
|
}
|
|
@@ -2596,7 +2596,7 @@ class L extends _ {
|
|
|
2596
2596
|
return this._def.innerType;
|
|
2597
2597
|
}
|
|
2598
2598
|
}
|
|
2599
|
-
|
|
2599
|
+
V.create = (t, e) => new V({
|
|
2600
2600
|
innerType: t,
|
|
2601
2601
|
typeName: m.ZodNullable,
|
|
2602
2602
|
...v(e)
|
|
@@ -2682,7 +2682,7 @@ Te.create = (t) => new Te({
|
|
|
2682
2682
|
...v(t)
|
|
2683
2683
|
});
|
|
2684
2684
|
const bt = Symbol("zod_brand");
|
|
2685
|
-
class
|
|
2685
|
+
class Oe extends _ {
|
|
2686
2686
|
_parse(e) {
|
|
2687
2687
|
const { ctx: s } = this._processInputParams(e), n = s.data;
|
|
2688
2688
|
return this._def.type._parse({
|
|
@@ -2753,31 +2753,31 @@ function ze(t, e = {}, s) {
|
|
|
2753
2753
|
return t ? J.create().superRefine((n, r) => {
|
|
2754
2754
|
var a, i;
|
|
2755
2755
|
if (!t(n)) {
|
|
2756
|
-
const o = typeof e == "function" ? e(n) : typeof e == "string" ? { message: e } : e,
|
|
2757
|
-
r.addIssue({ code: "custom", ...
|
|
2756
|
+
const o = typeof e == "function" ? e(n) : typeof e == "string" ? { message: e } : e, u = (i = (a = o.fatal) !== null && a !== void 0 ? a : s) !== null && i !== void 0 ? i : !0, d = typeof o == "string" ? { message: o } : o;
|
|
2757
|
+
r.addIssue({ code: "custom", ...d, fatal: u });
|
|
2758
2758
|
}
|
|
2759
2759
|
}) : J.create();
|
|
2760
2760
|
}
|
|
2761
|
-
const
|
|
2761
|
+
const wt = {
|
|
2762
2762
|
object: b.lazycreate
|
|
2763
2763
|
};
|
|
2764
2764
|
var m;
|
|
2765
2765
|
(function(t) {
|
|
2766
2766
|
t.ZodString = "ZodString", t.ZodNumber = "ZodNumber", t.ZodNaN = "ZodNaN", t.ZodBigInt = "ZodBigInt", t.ZodBoolean = "ZodBoolean", t.ZodDate = "ZodDate", t.ZodSymbol = "ZodSymbol", t.ZodUndefined = "ZodUndefined", t.ZodNull = "ZodNull", t.ZodAny = "ZodAny", t.ZodUnknown = "ZodUnknown", t.ZodNever = "ZodNever", t.ZodVoid = "ZodVoid", t.ZodArray = "ZodArray", t.ZodObject = "ZodObject", t.ZodUnion = "ZodUnion", t.ZodDiscriminatedUnion = "ZodDiscriminatedUnion", t.ZodIntersection = "ZodIntersection", t.ZodTuple = "ZodTuple", t.ZodRecord = "ZodRecord", t.ZodMap = "ZodMap", t.ZodSet = "ZodSet", t.ZodFunction = "ZodFunction", t.ZodLazy = "ZodLazy", t.ZodLiteral = "ZodLiteral", t.ZodEnum = "ZodEnum", t.ZodEffects = "ZodEffects", t.ZodNativeEnum = "ZodNativeEnum", t.ZodOptional = "ZodOptional", t.ZodNullable = "ZodNullable", t.ZodDefault = "ZodDefault", t.ZodCatch = "ZodCatch", t.ZodPromise = "ZodPromise", t.ZodBranded = "ZodBranded", t.ZodPipeline = "ZodPipeline", t.ZodReadonly = "ZodReadonly";
|
|
2767
2767
|
})(m || (m = {}));
|
|
2768
|
-
const
|
|
2768
|
+
const kt = (t, e = {
|
|
2769
2769
|
message: `Input not instance of ${t.name}`
|
|
2770
|
-
}) => ze((s) => s instanceof t, e), Ge = C.create, Qe =
|
|
2770
|
+
}) => ze((s) => s instanceof t, e), Ge = C.create, Qe = $.create, St = Te.create, Tt = U.create, We = re.create, Rt = z.create, Et = we.create, Ct = ae.create, Zt = ie.create, Nt = J.create, Mt = B.create, It = P.create, Ot = ke.create, At = Z.create, jt = b.create, Pt = b.strictCreate, qt = oe.create, $t = Re.create, Ut = ce.create, Lt = A.create, Vt = de.create, Dt = Se.create, Bt = G.create, zt = H.create, Gt = ue.create, Qt = le.create, Wt = L.create, Ht = fe.create, Yt = X.create, Pe = N.create, Jt = I.create, Xt = V.create, Kt = N.createWithPreprocess, Ft = ge.create, es = () => Ge().optional(), ts = () => Qe().optional(), ss = () => We().optional(), ns = {
|
|
2771
2771
|
string: (t) => C.create({ ...t, coerce: !0 }),
|
|
2772
|
-
number: (t) =>
|
|
2772
|
+
number: (t) => $.create({ ...t, coerce: !0 }),
|
|
2773
2773
|
boolean: (t) => re.create({
|
|
2774
2774
|
...t,
|
|
2775
2775
|
coerce: !0
|
|
2776
2776
|
}),
|
|
2777
|
-
bigint: (t) =>
|
|
2777
|
+
bigint: (t) => U.create({ ...t, coerce: !0 }),
|
|
2778
2778
|
date: (t) => z.create({ ...t, coerce: !0 })
|
|
2779
2779
|
}, rs = y;
|
|
2780
|
-
var
|
|
2780
|
+
var h = /* @__PURE__ */ Object.freeze({
|
|
2781
2781
|
__proto__: null,
|
|
2782
2782
|
defaultErrorMap: Y,
|
|
2783
2783
|
setErrorMap: rt,
|
|
@@ -2789,8 +2789,8 @@ var p = /* @__PURE__ */ Object.freeze({
|
|
|
2789
2789
|
INVALID: y,
|
|
2790
2790
|
DIRTY: W,
|
|
2791
2791
|
OK: T,
|
|
2792
|
-
isAborted:
|
|
2793
|
-
isDirty:
|
|
2792
|
+
isAborted: Ne,
|
|
2793
|
+
isDirty: Me,
|
|
2794
2794
|
isValid: se,
|
|
2795
2795
|
isAsync: ne,
|
|
2796
2796
|
get util() {
|
|
@@ -2800,57 +2800,57 @@ var p = /* @__PURE__ */ Object.freeze({
|
|
|
2800
2800
|
return Ze;
|
|
2801
2801
|
},
|
|
2802
2802
|
ZodParsedType: f,
|
|
2803
|
-
getParsedType:
|
|
2803
|
+
getParsedType: q,
|
|
2804
2804
|
ZodType: _,
|
|
2805
2805
|
datetimeRegex: De,
|
|
2806
2806
|
ZodString: C,
|
|
2807
|
-
ZodNumber:
|
|
2808
|
-
ZodBigInt:
|
|
2807
|
+
ZodNumber: $,
|
|
2808
|
+
ZodBigInt: U,
|
|
2809
2809
|
ZodBoolean: re,
|
|
2810
2810
|
ZodDate: z,
|
|
2811
|
-
ZodSymbol:
|
|
2811
|
+
ZodSymbol: we,
|
|
2812
2812
|
ZodUndefined: ae,
|
|
2813
2813
|
ZodNull: ie,
|
|
2814
2814
|
ZodAny: J,
|
|
2815
2815
|
ZodUnknown: B,
|
|
2816
|
-
ZodNever:
|
|
2817
|
-
ZodVoid:
|
|
2816
|
+
ZodNever: P,
|
|
2817
|
+
ZodVoid: ke,
|
|
2818
2818
|
ZodArray: Z,
|
|
2819
2819
|
ZodObject: b,
|
|
2820
2820
|
ZodUnion: oe,
|
|
2821
2821
|
ZodDiscriminatedUnion: Re,
|
|
2822
2822
|
ZodIntersection: ce,
|
|
2823
|
-
ZodTuple:
|
|
2823
|
+
ZodTuple: A,
|
|
2824
2824
|
ZodRecord: de,
|
|
2825
2825
|
ZodMap: Se,
|
|
2826
2826
|
ZodSet: G,
|
|
2827
2827
|
ZodFunction: H,
|
|
2828
2828
|
ZodLazy: ue,
|
|
2829
2829
|
ZodLiteral: le,
|
|
2830
|
-
ZodEnum:
|
|
2830
|
+
ZodEnum: L,
|
|
2831
2831
|
ZodNativeEnum: fe,
|
|
2832
2832
|
ZodPromise: X,
|
|
2833
|
-
ZodEffects:
|
|
2834
|
-
ZodTransformer:
|
|
2833
|
+
ZodEffects: N,
|
|
2834
|
+
ZodTransformer: N,
|
|
2835
2835
|
ZodOptional: I,
|
|
2836
|
-
ZodNullable:
|
|
2836
|
+
ZodNullable: V,
|
|
2837
2837
|
ZodDefault: he,
|
|
2838
2838
|
ZodCatch: pe,
|
|
2839
2839
|
ZodNaN: Te,
|
|
2840
2840
|
BRAND: bt,
|
|
2841
|
-
ZodBranded:
|
|
2841
|
+
ZodBranded: Oe,
|
|
2842
2842
|
ZodPipeline: ge,
|
|
2843
2843
|
ZodReadonly: me,
|
|
2844
2844
|
custom: ze,
|
|
2845
2845
|
Schema: _,
|
|
2846
2846
|
ZodSchema: _,
|
|
2847
|
-
late:
|
|
2847
|
+
late: wt,
|
|
2848
2848
|
get ZodFirstPartyTypeKind() {
|
|
2849
2849
|
return m;
|
|
2850
2850
|
},
|
|
2851
2851
|
coerce: ns,
|
|
2852
|
-
any:
|
|
2853
|
-
array:
|
|
2852
|
+
any: Nt,
|
|
2853
|
+
array: At,
|
|
2854
2854
|
bigint: Tt,
|
|
2855
2855
|
boolean: We,
|
|
2856
2856
|
date: Rt,
|
|
@@ -2858,18 +2858,18 @@ var p = /* @__PURE__ */ Object.freeze({
|
|
|
2858
2858
|
effect: Pe,
|
|
2859
2859
|
enum: Wt,
|
|
2860
2860
|
function: zt,
|
|
2861
|
-
instanceof:
|
|
2861
|
+
instanceof: kt,
|
|
2862
2862
|
intersection: Ut,
|
|
2863
2863
|
lazy: Gt,
|
|
2864
2864
|
literal: Qt,
|
|
2865
2865
|
map: Dt,
|
|
2866
2866
|
nan: St,
|
|
2867
2867
|
nativeEnum: Ht,
|
|
2868
|
-
never:
|
|
2868
|
+
never: It,
|
|
2869
2869
|
null: Zt,
|
|
2870
2870
|
nullable: Xt,
|
|
2871
2871
|
number: Qe,
|
|
2872
|
-
object:
|
|
2872
|
+
object: jt,
|
|
2873
2873
|
oboolean: ss,
|
|
2874
2874
|
onumber: ts,
|
|
2875
2875
|
optional: Jt,
|
|
@@ -2886,163 +2886,186 @@ var p = /* @__PURE__ */ Object.freeze({
|
|
|
2886
2886
|
tuple: Lt,
|
|
2887
2887
|
undefined: Ct,
|
|
2888
2888
|
union: qt,
|
|
2889
|
-
unknown:
|
|
2890
|
-
void:
|
|
2889
|
+
unknown: Mt,
|
|
2890
|
+
void: Ot,
|
|
2891
2891
|
NEVER: rs,
|
|
2892
2892
|
ZodIssueCode: c,
|
|
2893
2893
|
quotelessJson: nt,
|
|
2894
2894
|
ZodError: E
|
|
2895
2895
|
});
|
|
2896
|
-
const w =
|
|
2897
|
-
type:
|
|
2898
|
-
id:
|
|
2896
|
+
const w = h.object({
|
|
2897
|
+
type: h.literal("qp-bridge"),
|
|
2898
|
+
id: h.string().optional()
|
|
2899
2899
|
}), as = w.extend({
|
|
2900
|
-
status:
|
|
2901
|
-
question:
|
|
2902
|
-
answer:
|
|
2900
|
+
status: h.literal("answerChanged"),
|
|
2901
|
+
question: h.string(),
|
|
2902
|
+
answer: h.unknown()
|
|
2903
2903
|
}), K = w.extend({
|
|
2904
|
-
status:
|
|
2904
|
+
status: h.literal("success")
|
|
2905
2905
|
}), is = w.extend({
|
|
2906
|
-
status:
|
|
2907
|
-
message:
|
|
2908
|
-
}), He =
|
|
2909
|
-
semanticColor:
|
|
2910
|
-
label:
|
|
2911
|
-
description:
|
|
2912
|
-
disabled:
|
|
2913
|
-
required:
|
|
2914
|
-
hidden:
|
|
2915
|
-
errorMessage:
|
|
2916
|
-
}), os = He.partial(), cs =
|
|
2917
|
-
id:
|
|
2918
|
-
name:
|
|
2919
|
-
mimeType:
|
|
2920
|
-
blobUrl:
|
|
2921
|
-
}), Ye =
|
|
2922
|
-
label:
|
|
2923
|
-
hidden:
|
|
2924
|
-
collapsed:
|
|
2906
|
+
status: h.literal("error"),
|
|
2907
|
+
message: h.string()
|
|
2908
|
+
}), He = h.object({
|
|
2909
|
+
semanticColor: h.string().optional(),
|
|
2910
|
+
label: h.string(),
|
|
2911
|
+
description: h.string(),
|
|
2912
|
+
disabled: h.boolean(),
|
|
2913
|
+
required: h.boolean(),
|
|
2914
|
+
hidden: h.boolean(),
|
|
2915
|
+
errorMessage: h.string().optional()
|
|
2916
|
+
}), os = He.partial(), cs = h.object({
|
|
2917
|
+
id: h.string().uuid(),
|
|
2918
|
+
name: h.string(),
|
|
2919
|
+
mimeType: h.string(),
|
|
2920
|
+
blobUrl: h.string()
|
|
2921
|
+
}), Ye = h.record(h.unknown()), Je = h.object({
|
|
2922
|
+
label: h.string(),
|
|
2923
|
+
hidden: h.boolean(),
|
|
2924
|
+
collapsed: h.boolean()
|
|
2925
2925
|
}), ds = Je.partial(), us = w.extend({
|
|
2926
|
-
action:
|
|
2927
|
-
question:
|
|
2926
|
+
action: h.literal("getQuestion"),
|
|
2927
|
+
question: h.string()
|
|
2928
2928
|
}), ls = K.extend({
|
|
2929
2929
|
question: He
|
|
2930
2930
|
}), fs = w.extend({
|
|
2931
|
-
action:
|
|
2932
|
-
question:
|
|
2931
|
+
action: h.literal("setQuestion"),
|
|
2932
|
+
question: h.string(),
|
|
2933
2933
|
questionData: os
|
|
2934
2934
|
}), hs = w.extend({
|
|
2935
|
-
action:
|
|
2936
|
-
group:
|
|
2935
|
+
action: h.literal("getGroup"),
|
|
2936
|
+
group: h.string()
|
|
2937
2937
|
}), ps = K.extend({
|
|
2938
2938
|
group: Je
|
|
2939
2939
|
}), ms = K.extend({
|
|
2940
|
-
canSave:
|
|
2940
|
+
canSave: h.boolean()
|
|
2941
2941
|
}), gs = w.extend({
|
|
2942
|
-
action:
|
|
2942
|
+
action: h.literal("canSave")
|
|
2943
2943
|
}), ys = w.extend({
|
|
2944
|
-
action:
|
|
2945
|
-
group:
|
|
2944
|
+
action: h.literal("setGroup"),
|
|
2945
|
+
group: h.string(),
|
|
2946
2946
|
groupData: ds
|
|
2947
2947
|
}), vs = w.extend({
|
|
2948
|
-
action:
|
|
2949
|
-
question:
|
|
2950
|
-
answer:
|
|
2948
|
+
action: h.literal("setAnswer"),
|
|
2949
|
+
question: h.string(),
|
|
2950
|
+
answer: h.unknown()
|
|
2951
2951
|
}), _s = w.extend({
|
|
2952
|
-
action:
|
|
2952
|
+
action: h.literal("busyIndicatorStart")
|
|
2953
2953
|
}), xs = w.extend({
|
|
2954
|
-
action:
|
|
2954
|
+
action: h.literal("busyIndicatorEnd")
|
|
2955
2955
|
}), bs = w.extend({
|
|
2956
|
-
action:
|
|
2957
|
-
}), ks = w.extend({
|
|
2958
|
-
action: p.literal("completeAndCloseQuestionnaire")
|
|
2956
|
+
action: h.literal("saveQuestionnaire")
|
|
2959
2957
|
}), ws = w.extend({
|
|
2960
|
-
action:
|
|
2961
|
-
|
|
2958
|
+
action: h.literal("completeAndCloseQuestionnaire")
|
|
2959
|
+
}), ks = w.extend({
|
|
2960
|
+
action: h.literal("executeCustomCommand"),
|
|
2961
|
+
commandName: h.string()
|
|
2962
2962
|
}), Ss = w.extend({
|
|
2963
|
-
action:
|
|
2964
|
-
fetchXml:
|
|
2963
|
+
action: h.literal("fetchEntities"),
|
|
2964
|
+
fetchXml: h.string()
|
|
2965
2965
|
}), Ts = K.extend({
|
|
2966
|
-
entities:
|
|
2966
|
+
entities: h.array(Ye)
|
|
2967
2967
|
}), Rs = w.extend({
|
|
2968
|
-
action:
|
|
2969
|
-
entityName:
|
|
2970
|
-
entityId:
|
|
2968
|
+
action: h.literal("getEntityById"),
|
|
2969
|
+
entityName: h.string(),
|
|
2970
|
+
entityId: h.string()
|
|
2971
2971
|
}), Es = K.extend({
|
|
2972
2972
|
entity: Ye
|
|
2973
|
+
}), Cs = w.extend({
|
|
2974
|
+
action: h.literal("repeatGroup"),
|
|
2975
|
+
parentGroupName: h.string(),
|
|
2976
|
+
groupIndex: h.number()
|
|
2977
|
+
}), Zs = w.extend({
|
|
2978
|
+
action: h.literal("addNewGroup"),
|
|
2979
|
+
groupName: h.string()
|
|
2980
|
+
}), Ns = w.extend({
|
|
2981
|
+
action: h.literal("deleteGroup"),
|
|
2982
|
+
parentGroupName: h.string(),
|
|
2983
|
+
groupIndex: h.number()
|
|
2973
2984
|
});
|
|
2974
|
-
function
|
|
2985
|
+
function Ws(t) {
|
|
2975
2986
|
return cs.safeParse(t).success;
|
|
2976
2987
|
}
|
|
2977
|
-
function
|
|
2988
|
+
function Ms(t) {
|
|
2978
2989
|
return as.safeParse(t).success;
|
|
2979
2990
|
}
|
|
2980
2991
|
function Xe(t) {
|
|
2981
2992
|
return w.safeParse(t).success;
|
|
2982
2993
|
}
|
|
2983
|
-
function
|
|
2994
|
+
function Is(t) {
|
|
2984
2995
|
return K.safeParse(t).success;
|
|
2985
2996
|
}
|
|
2986
2997
|
function Os(t) {
|
|
2987
2998
|
return is.safeParse(t).success;
|
|
2988
2999
|
}
|
|
2989
|
-
function
|
|
3000
|
+
function Hs(t) {
|
|
2990
3001
|
return us.safeParse(t).success;
|
|
2991
3002
|
}
|
|
2992
|
-
function
|
|
3003
|
+
function As(t) {
|
|
2993
3004
|
return ls.safeParse(t).success;
|
|
2994
3005
|
}
|
|
2995
|
-
function
|
|
3006
|
+
function Ys(t) {
|
|
2996
3007
|
return vs.safeParse(t).success;
|
|
2997
3008
|
}
|
|
2998
|
-
function
|
|
3009
|
+
function Js(t) {
|
|
2999
3010
|
return fs.safeParse(t).success;
|
|
3000
3011
|
}
|
|
3001
|
-
function
|
|
3012
|
+
function Xs(t) {
|
|
3002
3013
|
return ys.safeParse(t).success;
|
|
3003
3014
|
}
|
|
3004
|
-
function
|
|
3015
|
+
function Ks(t) {
|
|
3005
3016
|
return hs.safeParse(t).success;
|
|
3006
3017
|
}
|
|
3007
|
-
function
|
|
3018
|
+
function js(t) {
|
|
3008
3019
|
return ps.safeParse(t).success;
|
|
3009
3020
|
}
|
|
3010
|
-
function
|
|
3021
|
+
function Fs(t) {
|
|
3011
3022
|
return ms.safeParse(t).success;
|
|
3012
3023
|
}
|
|
3013
|
-
function
|
|
3024
|
+
function Ps(t) {
|
|
3014
3025
|
return gs.safeParse(t).success;
|
|
3015
3026
|
}
|
|
3016
|
-
function
|
|
3027
|
+
function qs(t) {
|
|
3017
3028
|
return _s.safeParse(t).success;
|
|
3018
3029
|
}
|
|
3019
|
-
function
|
|
3030
|
+
function $s(t) {
|
|
3020
3031
|
return xs.safeParse(t).success;
|
|
3021
3032
|
}
|
|
3022
|
-
function
|
|
3033
|
+
function en(t) {
|
|
3023
3034
|
return bs.safeParse(t).success;
|
|
3024
3035
|
}
|
|
3025
|
-
function
|
|
3036
|
+
function tn(t) {
|
|
3037
|
+
return ws.safeParse(t).success;
|
|
3038
|
+
}
|
|
3039
|
+
function sn(t) {
|
|
3026
3040
|
return ks.safeParse(t).success;
|
|
3027
3041
|
}
|
|
3028
|
-
function
|
|
3029
|
-
return
|
|
3042
|
+
function nn(t) {
|
|
3043
|
+
return qs(t) || $s(t);
|
|
3030
3044
|
}
|
|
3031
|
-
function
|
|
3032
|
-
return
|
|
3045
|
+
function Us(t, e) {
|
|
3046
|
+
return !Xe(t) || t.id !== e || !("status" in t);
|
|
3033
3047
|
}
|
|
3034
|
-
function
|
|
3048
|
+
function rn(t) {
|
|
3035
3049
|
return Ss.safeParse(t).success;
|
|
3036
3050
|
}
|
|
3037
|
-
function
|
|
3051
|
+
function Ls(t) {
|
|
3038
3052
|
return Ts.safeParse(t).success;
|
|
3039
3053
|
}
|
|
3040
|
-
function
|
|
3054
|
+
function an(t) {
|
|
3041
3055
|
return Rs.safeParse(t).success;
|
|
3042
3056
|
}
|
|
3043
|
-
function
|
|
3057
|
+
function Vs(t) {
|
|
3044
3058
|
return Es.safeParse(t).success;
|
|
3045
3059
|
}
|
|
3060
|
+
function on(t) {
|
|
3061
|
+
return Cs.safeParse(t).success;
|
|
3062
|
+
}
|
|
3063
|
+
function cn(t) {
|
|
3064
|
+
return Zs.safeParse(t).success;
|
|
3065
|
+
}
|
|
3066
|
+
function dn(t) {
|
|
3067
|
+
return Ns.safeParse(t).success;
|
|
3068
|
+
}
|
|
3046
3069
|
function Ke(t) {
|
|
3047
3070
|
if (t instanceof File || t instanceof Blob)
|
|
3048
3071
|
return URL.createObjectURL(t);
|
|
@@ -3050,10 +3073,10 @@ function Ke(t) {
|
|
|
3050
3073
|
if (/^data:/.test(t)) {
|
|
3051
3074
|
const a = t.match(/^data:([^;]+);base64,(.*)$/);
|
|
3052
3075
|
if (a) {
|
|
3053
|
-
const i = a[1], o = a[2],
|
|
3054
|
-
for (let D = 0; D <
|
|
3055
|
-
g[D] =
|
|
3056
|
-
const R = new Blob([
|
|
3076
|
+
const i = a[1], o = a[2], u = atob(o), d = new ArrayBuffer(u.length), g = new Uint8Array(d);
|
|
3077
|
+
for (let D = 0; D < u.length; D++)
|
|
3078
|
+
g[D] = u.charCodeAt(D);
|
|
3079
|
+
const R = new Blob([d], { type: i });
|
|
3057
3080
|
return URL.createObjectURL(R);
|
|
3058
3081
|
}
|
|
3059
3082
|
throw new Error("Invalid data URL format. Only base64 data URLs are supported.");
|
|
@@ -3070,7 +3093,7 @@ function Ke(t) {
|
|
|
3070
3093
|
}
|
|
3071
3094
|
throw new Error("Unsupported content type for blobUrl");
|
|
3072
3095
|
}
|
|
3073
|
-
function
|
|
3096
|
+
function un(t, e, s, n) {
|
|
3074
3097
|
return {
|
|
3075
3098
|
id: n ?? qe(),
|
|
3076
3099
|
name: t,
|
|
@@ -3078,7 +3101,7 @@ function sn(t, e, s, n) {
|
|
|
3078
3101
|
blobUrl: Ke(s)
|
|
3079
3102
|
};
|
|
3080
3103
|
}
|
|
3081
|
-
function
|
|
3104
|
+
function ln(t, e) {
|
|
3082
3105
|
let s = t.blobUrl;
|
|
3083
3106
|
return e.content !== void 0 && (s = Ke(e.content)), {
|
|
3084
3107
|
...t,
|
|
@@ -3086,48 +3109,48 @@ function nn(t, e) {
|
|
|
3086
3109
|
blobUrl: s
|
|
3087
3110
|
};
|
|
3088
3111
|
}
|
|
3089
|
-
window.addEventListener("message",
|
|
3090
|
-
async function
|
|
3091
|
-
await
|
|
3112
|
+
window.addEventListener("message", Ds);
|
|
3113
|
+
async function fn(t, e) {
|
|
3114
|
+
await M({
|
|
3092
3115
|
type: "qp-bridge",
|
|
3093
3116
|
action: "setAnswer",
|
|
3094
3117
|
question: t,
|
|
3095
3118
|
answer: e
|
|
3096
3119
|
});
|
|
3097
3120
|
}
|
|
3098
|
-
async function
|
|
3099
|
-
return await
|
|
3121
|
+
async function hn(t) {
|
|
3122
|
+
return await Bs({
|
|
3100
3123
|
type: "qp-bridge",
|
|
3101
3124
|
action: "getQuestion",
|
|
3102
3125
|
question: t
|
|
3103
3126
|
});
|
|
3104
3127
|
}
|
|
3105
|
-
async function
|
|
3106
|
-
await
|
|
3128
|
+
async function pn(t, e) {
|
|
3129
|
+
await M({
|
|
3107
3130
|
type: "qp-bridge",
|
|
3108
3131
|
action: "setQuestion",
|
|
3109
3132
|
question: t,
|
|
3110
3133
|
questionData: e
|
|
3111
3134
|
});
|
|
3112
3135
|
}
|
|
3113
|
-
async function
|
|
3114
|
-
return await
|
|
3136
|
+
async function mn(t) {
|
|
3137
|
+
return await zs({
|
|
3115
3138
|
type: "qp-bridge",
|
|
3116
3139
|
action: "getGroup",
|
|
3117
3140
|
group: t
|
|
3118
3141
|
});
|
|
3119
3142
|
}
|
|
3120
|
-
async function
|
|
3121
|
-
await
|
|
3143
|
+
async function gn(t, e) {
|
|
3144
|
+
await M({
|
|
3122
3145
|
type: "qp-bridge",
|
|
3123
3146
|
action: "setGroup",
|
|
3124
3147
|
group: t,
|
|
3125
3148
|
groupData: e
|
|
3126
3149
|
});
|
|
3127
3150
|
}
|
|
3128
|
-
function
|
|
3151
|
+
function yn(t) {
|
|
3129
3152
|
const e = (s) => {
|
|
3130
|
-
|
|
3153
|
+
Ms(s.data) && t(s.data.question, s.data.answer);
|
|
3131
3154
|
};
|
|
3132
3155
|
return window.addEventListener("message", e), {
|
|
3133
3156
|
cancelSubscription: () => {
|
|
@@ -3135,41 +3158,41 @@ function un(t) {
|
|
|
3135
3158
|
}
|
|
3136
3159
|
};
|
|
3137
3160
|
}
|
|
3138
|
-
async function
|
|
3139
|
-
await
|
|
3161
|
+
async function vn(t) {
|
|
3162
|
+
await M({
|
|
3140
3163
|
type: "qp-bridge",
|
|
3141
3164
|
action: "busyIndicatorStart"
|
|
3142
3165
|
});
|
|
3143
3166
|
try {
|
|
3144
3167
|
return await t();
|
|
3145
3168
|
} finally {
|
|
3146
|
-
await
|
|
3169
|
+
await M({
|
|
3147
3170
|
type: "qp-bridge",
|
|
3148
3171
|
action: "busyIndicatorEnd"
|
|
3149
3172
|
});
|
|
3150
3173
|
}
|
|
3151
3174
|
}
|
|
3152
|
-
async function
|
|
3153
|
-
await
|
|
3175
|
+
async function _n() {
|
|
3176
|
+
await M({
|
|
3154
3177
|
type: "qp-bridge",
|
|
3155
3178
|
action: "saveQuestionnaire"
|
|
3156
3179
|
});
|
|
3157
3180
|
}
|
|
3158
|
-
async function
|
|
3159
|
-
await
|
|
3181
|
+
async function xn() {
|
|
3182
|
+
await M({
|
|
3160
3183
|
type: "qp-bridge",
|
|
3161
3184
|
action: "completeAndCloseQuestionnaire"
|
|
3162
3185
|
});
|
|
3163
3186
|
}
|
|
3164
|
-
async function
|
|
3165
|
-
await
|
|
3187
|
+
async function bn(t) {
|
|
3188
|
+
await M({
|
|
3166
3189
|
type: "qp-bridge",
|
|
3167
3190
|
action: "executeCustomCommand",
|
|
3168
3191
|
commandName: t
|
|
3169
3192
|
});
|
|
3170
3193
|
}
|
|
3171
3194
|
const te = [];
|
|
3172
|
-
function
|
|
3195
|
+
function wn(t) {
|
|
3173
3196
|
return te.includes(t) || te.push(t), {
|
|
3174
3197
|
cancelSubscription: () => {
|
|
3175
3198
|
const e = te.indexOf(t);
|
|
@@ -3177,9 +3200,9 @@ function mn(t) {
|
|
|
3177
3200
|
}
|
|
3178
3201
|
};
|
|
3179
3202
|
}
|
|
3180
|
-
async function
|
|
3203
|
+
async function Ds(t) {
|
|
3181
3204
|
try {
|
|
3182
|
-
if (
|
|
3205
|
+
if (Ps(t.data)) {
|
|
3183
3206
|
const e = await Promise.all(te.map((n) => n())), s = {
|
|
3184
3207
|
type: "qp-bridge",
|
|
3185
3208
|
status: "success",
|
|
@@ -3198,113 +3221,146 @@ async function $s(t) {
|
|
|
3198
3221
|
window.parent.postMessage(s, "*");
|
|
3199
3222
|
}
|
|
3200
3223
|
}
|
|
3201
|
-
async function
|
|
3202
|
-
return await
|
|
3224
|
+
async function kn(t) {
|
|
3225
|
+
return await Gs({
|
|
3203
3226
|
type: "qp-bridge",
|
|
3204
3227
|
action: "fetchEntities",
|
|
3205
3228
|
fetchXml: t
|
|
3206
3229
|
});
|
|
3207
3230
|
}
|
|
3208
|
-
async function
|
|
3209
|
-
return await
|
|
3231
|
+
async function Sn(t, e) {
|
|
3232
|
+
return await Qs({
|
|
3210
3233
|
type: "qp-bridge",
|
|
3211
3234
|
action: "getEntityById",
|
|
3212
3235
|
entityName: t,
|
|
3213
3236
|
entityId: e
|
|
3214
3237
|
});
|
|
3215
3238
|
}
|
|
3239
|
+
async function Tn(t, e) {
|
|
3240
|
+
await M({
|
|
3241
|
+
type: "qp-bridge",
|
|
3242
|
+
action: "repeatGroup",
|
|
3243
|
+
parentGroupName: t,
|
|
3244
|
+
groupIndex: e
|
|
3245
|
+
});
|
|
3246
|
+
}
|
|
3247
|
+
async function Rn(t) {
|
|
3248
|
+
await M({
|
|
3249
|
+
type: "qp-bridge",
|
|
3250
|
+
action: "addNewGroup",
|
|
3251
|
+
groupName: t
|
|
3252
|
+
});
|
|
3253
|
+
}
|
|
3254
|
+
async function En(t, e) {
|
|
3255
|
+
await M({
|
|
3256
|
+
type: "qp-bridge",
|
|
3257
|
+
action: "deleteGroup",
|
|
3258
|
+
parentGroupName: t,
|
|
3259
|
+
groupIndex: e
|
|
3260
|
+
});
|
|
3261
|
+
}
|
|
3216
3262
|
async function ye(t, e) {
|
|
3217
3263
|
return new Promise((s, n) => {
|
|
3218
3264
|
const r = qe(), a = (i) => {
|
|
3219
|
-
if (
|
|
3265
|
+
if (Us(i.data, r))
|
|
3220
3266
|
return;
|
|
3221
|
-
const
|
|
3222
|
-
|
|
3267
|
+
const o = e(i.data);
|
|
3268
|
+
o.success ? s(o.data) : Os(i.data) ? n(new Error(i.data.message)) : n(new Error("Unknown message received")), window.removeEventListener("message", a);
|
|
3223
3269
|
};
|
|
3224
3270
|
window.addEventListener("message", a), window.parent.postMessage({ ...t, id: r }, "*");
|
|
3225
3271
|
});
|
|
3226
3272
|
}
|
|
3227
|
-
async function
|
|
3228
|
-
return ye(t, (e) =>
|
|
3273
|
+
async function Bs(t) {
|
|
3274
|
+
return ye(t, (e) => As(e) ? { success: !0, data: e.question } : { success: !1 });
|
|
3229
3275
|
}
|
|
3230
|
-
async function
|
|
3231
|
-
return ye(t, (e) =>
|
|
3276
|
+
async function zs(t) {
|
|
3277
|
+
return ye(t, (e) => js(e) ? { success: !0, data: e.group } : { success: !1 });
|
|
3232
3278
|
}
|
|
3233
|
-
function
|
|
3234
|
-
return ye(t, (e) =>
|
|
3279
|
+
function M(t) {
|
|
3280
|
+
return ye(t, (e) => Is(e) ? { success: !0, data: void 0 } : { success: !1 });
|
|
3235
3281
|
}
|
|
3236
|
-
async function
|
|
3237
|
-
return ye(t, (e) =>
|
|
3282
|
+
async function Gs(t) {
|
|
3283
|
+
return ye(t, (e) => Ls(e) ? { success: !0, data: e.entities } : { success: !1 });
|
|
3238
3284
|
}
|
|
3239
|
-
async function
|
|
3240
|
-
return ye(t, (e) =>
|
|
3285
|
+
async function Qs(t) {
|
|
3286
|
+
return ye(t, (e) => Vs(e) ? { success: !0, data: e.entity } : { success: !1 });
|
|
3241
3287
|
}
|
|
3242
3288
|
export {
|
|
3289
|
+
Rn as addNewGroup,
|
|
3290
|
+
Zs as addNewGroupRequestMessageSchema,
|
|
3243
3291
|
xs as busyIndicatorEndRequestMessageSchema,
|
|
3244
3292
|
_s as busyIndicatorStartRequestMessageSchema,
|
|
3245
3293
|
gs as canSaveRequestMessageSchema,
|
|
3246
3294
|
ms as canSaveSuccessResponseMessageSchema,
|
|
3247
|
-
|
|
3248
|
-
|
|
3249
|
-
|
|
3295
|
+
xn as completeAndCloseQuestionnaire,
|
|
3296
|
+
ws as completeAndCloseQuestionnaireRequestMessageSchema,
|
|
3297
|
+
un as createMediaItem,
|
|
3298
|
+
En as deleteGroup,
|
|
3299
|
+
Ns as deleteGroupRequestMessageSchema,
|
|
3250
3300
|
Ye as entitySchema,
|
|
3251
|
-
|
|
3252
|
-
|
|
3253
|
-
|
|
3301
|
+
bn as executeCustomCommand,
|
|
3302
|
+
ks as executeCustomCommandRequestMessageSchema,
|
|
3303
|
+
kn as fetchEntities,
|
|
3254
3304
|
Ss as fetchEntitiesRequestMessageSchema,
|
|
3255
3305
|
Ts as fetchEntitiesSuccessResponseMessageSchema,
|
|
3256
|
-
|
|
3306
|
+
Sn as getEntityById,
|
|
3257
3307
|
Rs as getEntityByIdRequestMessageSchema,
|
|
3258
3308
|
Es as getEntityByIdSuccessResponseMessageSchema,
|
|
3259
|
-
|
|
3309
|
+
mn as getGroup,
|
|
3260
3310
|
hs as getGroupRequestMessageSchema,
|
|
3261
3311
|
ps as getGroupSuccessResponseMessageSchema,
|
|
3262
|
-
|
|
3312
|
+
hn as getQuestion,
|
|
3263
3313
|
us as getQuestionRequestMessageSchema,
|
|
3264
3314
|
ls as getQuestionSuccessResponseMessageSchema,
|
|
3265
3315
|
ds as groupOptionalScheme,
|
|
3266
3316
|
Je as groupSchema,
|
|
3267
|
-
|
|
3268
|
-
|
|
3269
|
-
|
|
3270
|
-
|
|
3271
|
-
|
|
3317
|
+
cn as isAddNewGroupRequestMessage,
|
|
3318
|
+
$s as isBusyIndicatorEndRequestMessage,
|
|
3319
|
+
qs as isBusyIndicatorStartRequestMessage,
|
|
3320
|
+
Ps as isCanSaveRequestMessage,
|
|
3321
|
+
Fs as isCanSaveSuccessResponseMessage,
|
|
3322
|
+
tn as isCompleteAndCloseQuestionnaireRequestMessage,
|
|
3323
|
+
dn as isDeleteGroupRequestMessage,
|
|
3272
3324
|
Os as isErrorMessage,
|
|
3273
|
-
|
|
3274
|
-
|
|
3275
|
-
|
|
3276
|
-
|
|
3277
|
-
|
|
3278
|
-
|
|
3279
|
-
|
|
3280
|
-
|
|
3281
|
-
|
|
3282
|
-
|
|
3283
|
-
|
|
3325
|
+
sn as isExecuteCustomCommandRequestMessage,
|
|
3326
|
+
rn as isFetchEntitiesRequestMessage,
|
|
3327
|
+
Ls as isFetchEntitiesSuccessResponseMessage,
|
|
3328
|
+
an as isGetEntityByIdRequestMessage,
|
|
3329
|
+
Vs as isGetEntityByIdSuccessResponseMessage,
|
|
3330
|
+
Ks as isGetGroupRequestMessage,
|
|
3331
|
+
js as isGetGroupSuccessResponseMessage,
|
|
3332
|
+
Hs as isGetQuestionRequestMessage,
|
|
3333
|
+
As as isGetQuestionSuccessResponseMessage,
|
|
3334
|
+
Ws as isMediaItem,
|
|
3335
|
+
Us as isNotRelevantMessage,
|
|
3336
|
+
Ms as isOnAnswerChangeMessage,
|
|
3284
3337
|
Xe as isQpBridgeMessage,
|
|
3285
|
-
|
|
3286
|
-
|
|
3287
|
-
|
|
3288
|
-
|
|
3289
|
-
|
|
3290
|
-
|
|
3338
|
+
on as isRepeatGroupRequestMessage,
|
|
3339
|
+
en as isSaveQuestionnaireRequestMessage,
|
|
3340
|
+
Ys as isSetAnswerRequestMessage,
|
|
3341
|
+
Xs as isSetGroupRequestMessage,
|
|
3342
|
+
Js as isSetQuestionRequestMessage,
|
|
3343
|
+
Is as isSuccessMessage,
|
|
3344
|
+
nn as isWithBusyIndicatorRequestMessage,
|
|
3291
3345
|
cs as mediaItemSchema,
|
|
3292
|
-
|
|
3346
|
+
yn as onAnswerChange,
|
|
3293
3347
|
as as onAnswerChangeMessageSchema,
|
|
3294
|
-
|
|
3348
|
+
wn as onSave,
|
|
3295
3349
|
w as qpBridgeMessageSchema,
|
|
3296
3350
|
os as questionOptionalScheme,
|
|
3297
3351
|
He as questionSchema,
|
|
3352
|
+
Tn as repeatGroup,
|
|
3353
|
+
Cs as repeatGroupRequestMessageSchema,
|
|
3298
3354
|
is as responseErrorMessageSchema,
|
|
3299
3355
|
K as responseSuccessMessageSchema,
|
|
3300
|
-
|
|
3356
|
+
_n as saveQuestionnaire,
|
|
3301
3357
|
bs as saveQuestionnaireRequestMessageSchema,
|
|
3302
|
-
|
|
3358
|
+
fn as setAnswer,
|
|
3303
3359
|
vs as setAnswerRequestMessageSchema,
|
|
3304
|
-
|
|
3360
|
+
gn as setGroup,
|
|
3305
3361
|
ys as setGroupRequestMessageSchema,
|
|
3306
|
-
|
|
3362
|
+
pn as setQuestion,
|
|
3307
3363
|
fs as setQuestionRequestMessageSchema,
|
|
3308
|
-
|
|
3309
|
-
|
|
3364
|
+
ln as updateMediaItem,
|
|
3365
|
+
vn as withBusyIndicator
|
|
3310
3366
|
};
|