@resconet/qp-bridge 1.4.0-alpha.5 → 1.4.0-alpha.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +30 -1
- package/index.js +1 -1
- package/index.mjs +397 -355
- package/lib/qp-bridge-types.d.ts +144 -0
- package/lib/qp-bridge.d.ts +22 -1
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -70,8 +70,8 @@ function Xe() {
|
|
|
70
70
|
t.nextTick = function(k) {
|
|
71
71
|
var E = new Array(arguments.length - 1);
|
|
72
72
|
if (arguments.length > 1)
|
|
73
|
-
for (var
|
|
74
|
-
E[
|
|
73
|
+
for (var z = 1; z < arguments.length; z++)
|
|
74
|
+
E[z - 1] = arguments[z];
|
|
75
75
|
o.push(new Ie(k, E)), o.length === 1 && !d && r(M);
|
|
76
76
|
};
|
|
77
77
|
function Ie(k, E) {
|
|
@@ -95,12 +95,12 @@ function Xe() {
|
|
|
95
95
|
}, pe.exports;
|
|
96
96
|
}
|
|
97
97
|
var Ke = Xe();
|
|
98
|
-
let
|
|
98
|
+
let ie;
|
|
99
99
|
const et = new Uint8Array(16);
|
|
100
100
|
function tt() {
|
|
101
|
-
if (!
|
|
101
|
+
if (!ie && (ie = typeof crypto < "u" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto), !ie))
|
|
102
102
|
throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
|
|
103
|
-
return
|
|
103
|
+
return ie(et);
|
|
104
104
|
}
|
|
105
105
|
const R = [];
|
|
106
106
|
for (let t = 0; t < 256; ++t)
|
|
@@ -108,12 +108,12 @@ for (let t = 0; t < 256; ++t)
|
|
|
108
108
|
function st(t, e = 0) {
|
|
109
109
|
return R[t[e + 0]] + R[t[e + 1]] + R[t[e + 2]] + R[t[e + 3]] + "-" + R[t[e + 4]] + R[t[e + 5]] + "-" + R[t[e + 6]] + R[t[e + 7]] + "-" + R[t[e + 8]] + R[t[e + 9]] + "-" + R[t[e + 10]] + R[t[e + 11]] + R[t[e + 12]] + R[t[e + 13]] + R[t[e + 14]] + R[t[e + 15]];
|
|
110
110
|
}
|
|
111
|
-
const nt = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto),
|
|
111
|
+
const nt = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), Ne = {
|
|
112
112
|
randomUUID: nt
|
|
113
113
|
};
|
|
114
114
|
function ze(t, e, s) {
|
|
115
|
-
if (
|
|
116
|
-
return
|
|
115
|
+
if (Ne.randomUUID && !t)
|
|
116
|
+
return Ne.randomUUID();
|
|
117
117
|
t = t || {};
|
|
118
118
|
const n = t.random || (t.rng || tt)();
|
|
119
119
|
return n[6] = n[6] & 15 | 64, n[8] = n[8] & 63 | 128, st(n);
|
|
@@ -155,14 +155,14 @@ var v;
|
|
|
155
155
|
}
|
|
156
156
|
t.joinValues = n, t.jsonStringifyReplacer = (a, r) => typeof r == "bigint" ? r.toString() : r;
|
|
157
157
|
})(v || (v = {}));
|
|
158
|
-
var
|
|
158
|
+
var Ae;
|
|
159
159
|
(function(t) {
|
|
160
160
|
t.mergeShapes = (e, s) => ({
|
|
161
161
|
...e,
|
|
162
162
|
...s
|
|
163
163
|
// second overwrites first
|
|
164
164
|
});
|
|
165
|
-
})(
|
|
165
|
+
})(Ae || (Ae = {}));
|
|
166
166
|
const f = v.arrayToEnum([
|
|
167
167
|
"string",
|
|
168
168
|
"nan",
|
|
@@ -223,7 +223,7 @@ const f = v.arrayToEnum([
|
|
|
223
223
|
"not_multiple_of",
|
|
224
224
|
"not_finite"
|
|
225
225
|
]);
|
|
226
|
-
class
|
|
226
|
+
class j extends Error {
|
|
227
227
|
get errors() {
|
|
228
228
|
return this.issues;
|
|
229
229
|
}
|
|
@@ -260,7 +260,7 @@ class q extends Error {
|
|
|
260
260
|
return a(this), n;
|
|
261
261
|
}
|
|
262
262
|
static assert(e) {
|
|
263
|
-
if (!(e instanceof
|
|
263
|
+
if (!(e instanceof j))
|
|
264
264
|
throw new Error(`Not a ZodError: ${e}`);
|
|
265
265
|
}
|
|
266
266
|
toString() {
|
|
@@ -286,7 +286,7 @@ class q extends Error {
|
|
|
286
286
|
return this.flatten();
|
|
287
287
|
}
|
|
288
288
|
}
|
|
289
|
-
|
|
289
|
+
j.create = (t) => new j(t);
|
|
290
290
|
const ge = (t, e) => {
|
|
291
291
|
let s;
|
|
292
292
|
switch (t.code) {
|
|
@@ -429,12 +429,12 @@ class T {
|
|
|
429
429
|
}
|
|
430
430
|
const m = Object.freeze({
|
|
431
431
|
status: "aborted"
|
|
432
|
-
}),
|
|
432
|
+
}), K = (t) => ({ status: "dirty", value: t }), I = (t) => ({ status: "valid", value: t }), Oe = (t) => t.status === "aborted", Me = (t) => t.status === "dirty", Q = (t) => t.status === "valid", oe = (t) => typeof Promise < "u" && t instanceof Promise;
|
|
433
433
|
var h;
|
|
434
434
|
(function(t) {
|
|
435
435
|
t.errToObj = (e) => typeof e == "string" ? { message: e } : e || {}, t.toString = (e) => typeof e == "string" ? e : e?.message;
|
|
436
436
|
})(h || (h = {}));
|
|
437
|
-
class
|
|
437
|
+
class A {
|
|
438
438
|
constructor(e, s, n, a) {
|
|
439
439
|
this._cachedPath = [], this.parent = e, this.data = s, this._path = n, this._key = a;
|
|
440
440
|
}
|
|
@@ -443,7 +443,7 @@ class N {
|
|
|
443
443
|
}
|
|
444
444
|
}
|
|
445
445
|
const Ze = (t, e) => {
|
|
446
|
-
if (
|
|
446
|
+
if (Q(e))
|
|
447
447
|
return { success: !0, data: e.value };
|
|
448
448
|
if (!t.common.issues.length)
|
|
449
449
|
throw new Error("Validation failed but no issues detected.");
|
|
@@ -452,7 +452,7 @@ const Ze = (t, e) => {
|
|
|
452
452
|
get error() {
|
|
453
453
|
if (this._error)
|
|
454
454
|
return this._error;
|
|
455
|
-
const s = new
|
|
455
|
+
const s = new j(t.common.issues);
|
|
456
456
|
return this._error = s, this._error;
|
|
457
457
|
}
|
|
458
458
|
};
|
|
@@ -500,7 +500,7 @@ class _ {
|
|
|
500
500
|
}
|
|
501
501
|
_parseSync(e) {
|
|
502
502
|
const s = this._parse(e);
|
|
503
|
-
if (
|
|
503
|
+
if (oe(s))
|
|
504
504
|
throw new Error("Synchronous parse encountered promise.");
|
|
505
505
|
return s;
|
|
506
506
|
}
|
|
@@ -544,7 +544,7 @@ class _ {
|
|
|
544
544
|
if (!this["~standard"].async)
|
|
545
545
|
try {
|
|
546
546
|
const n = this._parseSync({ data: e, path: [], parent: s });
|
|
547
|
-
return
|
|
547
|
+
return Q(n) ? {
|
|
548
548
|
value: n.value
|
|
549
549
|
} : {
|
|
550
550
|
issues: s.common.issues
|
|
@@ -555,7 +555,7 @@ class _ {
|
|
|
555
555
|
async: !0
|
|
556
556
|
};
|
|
557
557
|
}
|
|
558
|
-
return this._parseAsync({ data: e, path: [], parent: s }).then((n) =>
|
|
558
|
+
return this._parseAsync({ data: e, path: [], parent: s }).then((n) => Q(n) ? {
|
|
559
559
|
value: n.value
|
|
560
560
|
} : {
|
|
561
561
|
issues: s.common.issues
|
|
@@ -579,7 +579,7 @@ class _ {
|
|
|
579
579
|
parent: null,
|
|
580
580
|
data: e,
|
|
581
581
|
parsedType: P(e)
|
|
582
|
-
}, a = this._parse({ data: e, path: n.path, parent: n }), r = await (
|
|
582
|
+
}, a = this._parse({ data: e, path: n.path, parent: n }), r = await (oe(a) ? a : Promise.resolve(a));
|
|
583
583
|
return Ze(n, r);
|
|
584
584
|
}
|
|
585
585
|
refine(e, s) {
|
|
@@ -596,7 +596,7 @@ class _ {
|
|
|
596
596
|
return this._refinement((n, a) => e(n) ? !0 : (a.addIssue(typeof s == "function" ? s(n, a) : s), !1));
|
|
597
597
|
}
|
|
598
598
|
_refinement(e) {
|
|
599
|
-
return new
|
|
599
|
+
return new H({
|
|
600
600
|
schema: this,
|
|
601
601
|
typeName: p.ZodEffects,
|
|
602
602
|
effect: { type: "refinement", refinement: e }
|
|
@@ -616,25 +616,25 @@ class _ {
|
|
|
616
616
|
return L.create(this, this._def);
|
|
617
617
|
}
|
|
618
618
|
nullable() {
|
|
619
|
-
return
|
|
619
|
+
return J.create(this, this._def);
|
|
620
620
|
}
|
|
621
621
|
nullish() {
|
|
622
622
|
return this.nullable().optional();
|
|
623
623
|
}
|
|
624
624
|
array() {
|
|
625
|
-
return
|
|
625
|
+
return N.create(this);
|
|
626
626
|
}
|
|
627
627
|
promise() {
|
|
628
|
-
return
|
|
628
|
+
return fe.create(this, this._def);
|
|
629
629
|
}
|
|
630
630
|
or(e) {
|
|
631
|
-
return
|
|
631
|
+
return ue.create([this, e], this._def);
|
|
632
632
|
}
|
|
633
633
|
and(e) {
|
|
634
|
-
return
|
|
634
|
+
return de.create(this, e, this._def);
|
|
635
635
|
}
|
|
636
636
|
transform(e) {
|
|
637
|
-
return new
|
|
637
|
+
return new H({
|
|
638
638
|
...g(this._def),
|
|
639
639
|
schema: this,
|
|
640
640
|
typeName: p.ZodEffects,
|
|
@@ -688,7 +688,7 @@ class _ {
|
|
|
688
688
|
}
|
|
689
689
|
const ot = /^c[^\s-]{8,}$/i, ct = /^[0-9a-z]+$/, ut = /^[0-9A-HJKMNP-TV-Z]{26}$/i, dt = /^[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, lt = /^[a-z0-9_-]{21}$/i, ft = /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/, ht = /^[-+]?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)?)??$/, pt = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, mt = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
|
|
690
690
|
let me;
|
|
691
|
-
const gt = /^(?:(?: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])$/, yt = /^(?:(?: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])\/(3[0-2]|[12]?[0-9])$/, _t = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/, vt = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/, xt = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, bt = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,
|
|
691
|
+
const gt = /^(?:(?: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])$/, yt = /^(?:(?: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])\/(3[0-2]|[12]?[0-9])$/, _t = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/, vt = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/, xt = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, bt = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/, De = "((\\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])))", kt = new RegExp(`^${De}$`);
|
|
692
692
|
function Qe(t) {
|
|
693
693
|
let e = "[0-5]\\d";
|
|
694
694
|
t.precision ? e = `${e}\\.\\d{${t.precision}}` : t.precision == null && (e = `${e}(\\.\\d+)?`);
|
|
@@ -699,7 +699,7 @@ function wt(t) {
|
|
|
699
699
|
return new RegExp(`^${Qe(t)}$`);
|
|
700
700
|
}
|
|
701
701
|
function St(t) {
|
|
702
|
-
let e = `${
|
|
702
|
+
let e = `${De}T${Qe(t)}`;
|
|
703
703
|
const s = [];
|
|
704
704
|
return s.push(t.local ? "Z?" : "Z"), t.offset && s.push("([+-]\\d{2}:?\\d{2})"), e = `${e}(${s.join("|")})`, new RegExp(`^${e}$`);
|
|
705
705
|
}
|
|
@@ -722,7 +722,7 @@ function Tt(t, e) {
|
|
|
722
722
|
function Ct(t, e) {
|
|
723
723
|
return !!((e === "v4" || !e) && yt.test(t) || (e === "v6" || !e) && vt.test(t));
|
|
724
724
|
}
|
|
725
|
-
class
|
|
725
|
+
class q extends _ {
|
|
726
726
|
_parse(e) {
|
|
727
727
|
if (this._def.coerce && (e.data = String(e.data)), this._getType(e) !== f.string) {
|
|
728
728
|
const r = this._getOrReturnCtx(e);
|
|
@@ -885,7 +885,7 @@ class j extends _ {
|
|
|
885
885
|
});
|
|
886
886
|
}
|
|
887
887
|
_addCheck(e) {
|
|
888
|
-
return new
|
|
888
|
+
return new q({
|
|
889
889
|
...this._def,
|
|
890
890
|
checks: [...this._def.checks, e]
|
|
891
891
|
});
|
|
@@ -1021,19 +1021,19 @@ class j extends _ {
|
|
|
1021
1021
|
return this.min(1, h.errToObj(e));
|
|
1022
1022
|
}
|
|
1023
1023
|
trim() {
|
|
1024
|
-
return new
|
|
1024
|
+
return new q({
|
|
1025
1025
|
...this._def,
|
|
1026
1026
|
checks: [...this._def.checks, { kind: "trim" }]
|
|
1027
1027
|
});
|
|
1028
1028
|
}
|
|
1029
1029
|
toLowerCase() {
|
|
1030
|
-
return new
|
|
1030
|
+
return new q({
|
|
1031
1031
|
...this._def,
|
|
1032
1032
|
checks: [...this._def.checks, { kind: "toLowerCase" }]
|
|
1033
1033
|
});
|
|
1034
1034
|
}
|
|
1035
1035
|
toUpperCase() {
|
|
1036
|
-
return new
|
|
1036
|
+
return new q({
|
|
1037
1037
|
...this._def,
|
|
1038
1038
|
checks: [...this._def.checks, { kind: "toUpperCase" }]
|
|
1039
1039
|
});
|
|
@@ -1099,7 +1099,7 @@ class j extends _ {
|
|
|
1099
1099
|
return e;
|
|
1100
1100
|
}
|
|
1101
1101
|
}
|
|
1102
|
-
|
|
1102
|
+
q.create = (t) => new q({
|
|
1103
1103
|
checks: [],
|
|
1104
1104
|
typeName: p.ZodString,
|
|
1105
1105
|
coerce: t?.coerce ?? !1,
|
|
@@ -1109,7 +1109,7 @@ function It(t, e) {
|
|
|
1109
1109
|
const s = (t.toString().split(".")[1] || "").length, n = (e.toString().split(".")[1] || "").length, a = s > n ? s : n, r = Number.parseInt(t.toFixed(a).replace(".", "")), i = Number.parseInt(e.toFixed(a).replace(".", ""));
|
|
1110
1110
|
return r % i / 10 ** a;
|
|
1111
1111
|
}
|
|
1112
|
-
class
|
|
1112
|
+
class F extends _ {
|
|
1113
1113
|
constructor() {
|
|
1114
1114
|
super(...arguments), this.min = this.gte, this.max = this.lte, this.step = this.multipleOf;
|
|
1115
1115
|
}
|
|
@@ -1167,7 +1167,7 @@ class Q extends _ {
|
|
|
1167
1167
|
return this.setLimit("max", e, !1, h.toString(s));
|
|
1168
1168
|
}
|
|
1169
1169
|
setLimit(e, s, n, a) {
|
|
1170
|
-
return new
|
|
1170
|
+
return new F({
|
|
1171
1171
|
...this._def,
|
|
1172
1172
|
checks: [
|
|
1173
1173
|
...this._def.checks,
|
|
@@ -1181,7 +1181,7 @@ class Q extends _ {
|
|
|
1181
1181
|
});
|
|
1182
1182
|
}
|
|
1183
1183
|
_addCheck(e) {
|
|
1184
|
-
return new
|
|
1184
|
+
return new F({
|
|
1185
1185
|
...this._def,
|
|
1186
1186
|
checks: [...this._def.checks, e]
|
|
1187
1187
|
});
|
|
@@ -1275,13 +1275,13 @@ class Q extends _ {
|
|
|
1275
1275
|
return Number.isFinite(s) && Number.isFinite(e);
|
|
1276
1276
|
}
|
|
1277
1277
|
}
|
|
1278
|
-
|
|
1278
|
+
F.create = (t) => new F({
|
|
1279
1279
|
checks: [],
|
|
1280
1280
|
typeName: p.ZodNumber,
|
|
1281
1281
|
coerce: t?.coerce || !1,
|
|
1282
1282
|
...g(t)
|
|
1283
1283
|
});
|
|
1284
|
-
class
|
|
1284
|
+
class ne extends _ {
|
|
1285
1285
|
constructor() {
|
|
1286
1286
|
super(...arguments), this.min = this.gte, this.max = this.lte;
|
|
1287
1287
|
}
|
|
@@ -1337,7 +1337,7 @@ class te extends _ {
|
|
|
1337
1337
|
return this.setLimit("max", e, !1, h.toString(s));
|
|
1338
1338
|
}
|
|
1339
1339
|
setLimit(e, s, n, a) {
|
|
1340
|
-
return new
|
|
1340
|
+
return new ne({
|
|
1341
1341
|
...this._def,
|
|
1342
1342
|
checks: [
|
|
1343
1343
|
...this._def.checks,
|
|
@@ -1351,7 +1351,7 @@ class te extends _ {
|
|
|
1351
1351
|
});
|
|
1352
1352
|
}
|
|
1353
1353
|
_addCheck(e) {
|
|
1354
|
-
return new
|
|
1354
|
+
return new ne({
|
|
1355
1355
|
...this._def,
|
|
1356
1356
|
checks: [...this._def.checks, e]
|
|
1357
1357
|
});
|
|
@@ -1408,7 +1408,7 @@ class te extends _ {
|
|
|
1408
1408
|
return e;
|
|
1409
1409
|
}
|
|
1410
1410
|
}
|
|
1411
|
-
|
|
1411
|
+
ne.create = (t) => new ne({
|
|
1412
1412
|
checks: [],
|
|
1413
1413
|
typeName: p.ZodBigInt,
|
|
1414
1414
|
coerce: t?.coerce ?? !1,
|
|
@@ -1432,7 +1432,7 @@ ye.create = (t) => new ye({
|
|
|
1432
1432
|
coerce: t?.coerce || !1,
|
|
1433
1433
|
...g(t)
|
|
1434
1434
|
});
|
|
1435
|
-
class
|
|
1435
|
+
class ce extends _ {
|
|
1436
1436
|
_parse(e) {
|
|
1437
1437
|
if (this._def.coerce && (e.data = new Date(e.data)), this._getType(e) !== f.date) {
|
|
1438
1438
|
const r = this._getOrReturnCtx(e);
|
|
@@ -1472,7 +1472,7 @@ class oe extends _ {
|
|
|
1472
1472
|
};
|
|
1473
1473
|
}
|
|
1474
1474
|
_addCheck(e) {
|
|
1475
|
-
return new
|
|
1475
|
+
return new ce({
|
|
1476
1476
|
...this._def,
|
|
1477
1477
|
checks: [...this._def.checks, e]
|
|
1478
1478
|
});
|
|
@@ -1504,13 +1504,13 @@ class oe extends _ {
|
|
|
1504
1504
|
return e != null ? new Date(e) : null;
|
|
1505
1505
|
}
|
|
1506
1506
|
}
|
|
1507
|
-
|
|
1507
|
+
ce.create = (t) => new ce({
|
|
1508
1508
|
checks: [],
|
|
1509
1509
|
coerce: t?.coerce || !1,
|
|
1510
1510
|
typeName: p.ZodDate,
|
|
1511
1511
|
...g(t)
|
|
1512
1512
|
});
|
|
1513
|
-
class
|
|
1513
|
+
class qe extends _ {
|
|
1514
1514
|
_parse(e) {
|
|
1515
1515
|
if (this._getType(e) !== f.symbol) {
|
|
1516
1516
|
const n = this._getOrReturnCtx(e);
|
|
@@ -1523,11 +1523,11 @@ class je extends _ {
|
|
|
1523
1523
|
return I(e.data);
|
|
1524
1524
|
}
|
|
1525
1525
|
}
|
|
1526
|
-
|
|
1526
|
+
qe.create = (t) => new qe({
|
|
1527
1527
|
typeName: p.ZodSymbol,
|
|
1528
1528
|
...g(t)
|
|
1529
1529
|
});
|
|
1530
|
-
class
|
|
1530
|
+
class je extends _ {
|
|
1531
1531
|
_parse(e) {
|
|
1532
1532
|
if (this._getType(e) !== f.undefined) {
|
|
1533
1533
|
const n = this._getOrReturnCtx(e);
|
|
@@ -1540,7 +1540,7 @@ class qe extends _ {
|
|
|
1540
1540
|
return I(e.data);
|
|
1541
1541
|
}
|
|
1542
1542
|
}
|
|
1543
|
-
|
|
1543
|
+
je.create = (t) => new je({
|
|
1544
1544
|
typeName: p.ZodUndefined,
|
|
1545
1545
|
...g(t)
|
|
1546
1546
|
});
|
|
@@ -1616,7 +1616,7 @@ $e.create = (t) => new $e({
|
|
|
1616
1616
|
typeName: p.ZodVoid,
|
|
1617
1617
|
...g(t)
|
|
1618
1618
|
});
|
|
1619
|
-
class
|
|
1619
|
+
class N extends _ {
|
|
1620
1620
|
_parse(e) {
|
|
1621
1621
|
const { ctx: s, status: n } = this._processInputParams(e), a = this._def;
|
|
1622
1622
|
if (s.parsedType !== f.array)
|
|
@@ -1652,27 +1652,27 @@ class A extends _ {
|
|
|
1652
1652
|
exact: !1,
|
|
1653
1653
|
message: a.maxLength.message
|
|
1654
1654
|
}), n.dirty()), s.common.async)
|
|
1655
|
-
return Promise.all([...s.data].map((i, o) => a.type._parseAsync(new
|
|
1656
|
-
const r = [...s.data].map((i, o) => a.type._parseSync(new
|
|
1655
|
+
return Promise.all([...s.data].map((i, o) => a.type._parseAsync(new A(s, i, s.path, o)))).then((i) => T.mergeArray(n, i));
|
|
1656
|
+
const r = [...s.data].map((i, o) => a.type._parseSync(new A(s, i, s.path, o)));
|
|
1657
1657
|
return T.mergeArray(n, r);
|
|
1658
1658
|
}
|
|
1659
1659
|
get element() {
|
|
1660
1660
|
return this._def.type;
|
|
1661
1661
|
}
|
|
1662
1662
|
min(e, s) {
|
|
1663
|
-
return new
|
|
1663
|
+
return new N({
|
|
1664
1664
|
...this._def,
|
|
1665
1665
|
minLength: { value: e, message: h.toString(s) }
|
|
1666
1666
|
});
|
|
1667
1667
|
}
|
|
1668
1668
|
max(e, s) {
|
|
1669
|
-
return new
|
|
1669
|
+
return new N({
|
|
1670
1670
|
...this._def,
|
|
1671
1671
|
maxLength: { value: e, message: h.toString(s) }
|
|
1672
1672
|
});
|
|
1673
1673
|
}
|
|
1674
1674
|
length(e, s) {
|
|
1675
|
-
return new
|
|
1675
|
+
return new N({
|
|
1676
1676
|
...this._def,
|
|
1677
1677
|
exactLength: { value: e, message: h.toString(s) }
|
|
1678
1678
|
});
|
|
@@ -1681,7 +1681,7 @@ class A extends _ {
|
|
|
1681
1681
|
return this.min(1, e);
|
|
1682
1682
|
}
|
|
1683
1683
|
}
|
|
1684
|
-
|
|
1684
|
+
N.create = (t, e) => new N({
|
|
1685
1685
|
type: t,
|
|
1686
1686
|
minLength: null,
|
|
1687
1687
|
maxLength: null,
|
|
@@ -1700,10 +1700,10 @@ function D(t) {
|
|
|
1700
1700
|
...t._def,
|
|
1701
1701
|
shape: () => e
|
|
1702
1702
|
});
|
|
1703
|
-
} else return t instanceof
|
|
1703
|
+
} else return t instanceof N ? new N({
|
|
1704
1704
|
...t._def,
|
|
1705
1705
|
type: D(t.element)
|
|
1706
|
-
}) : t instanceof L ? L.create(D(t.unwrap())) : t instanceof
|
|
1706
|
+
}) : t instanceof L ? L.create(D(t.unwrap())) : t instanceof J ? J.create(D(t.unwrap())) : t instanceof U ? U.create(t.items.map((e) => D(e))) : t;
|
|
1707
1707
|
}
|
|
1708
1708
|
class w extends _ {
|
|
1709
1709
|
constructor() {
|
|
@@ -1733,7 +1733,7 @@ class w extends _ {
|
|
|
1733
1733
|
const y = r[l], O = a.data[l];
|
|
1734
1734
|
d.push({
|
|
1735
1735
|
key: { status: "valid", value: l },
|
|
1736
|
-
value: y._parse(new
|
|
1736
|
+
value: y._parse(new A(a, O, a.path, l)),
|
|
1737
1737
|
alwaysSet: l in a.data
|
|
1738
1738
|
});
|
|
1739
1739
|
}
|
|
@@ -1758,7 +1758,7 @@ class w extends _ {
|
|
|
1758
1758
|
d.push({
|
|
1759
1759
|
key: { status: "valid", value: y },
|
|
1760
1760
|
value: l._parse(
|
|
1761
|
-
new
|
|
1761
|
+
new A(a, O, a.path, y)
|
|
1762
1762
|
//, ctx.child(key), value, getParsedType(value)
|
|
1763
1763
|
),
|
|
1764
1764
|
alwaysSet: y in a.data
|
|
@@ -1992,7 +1992,7 @@ w.lazycreate = (t, e) => new w({
|
|
|
1992
1992
|
typeName: p.ZodObject,
|
|
1993
1993
|
...g(e)
|
|
1994
1994
|
});
|
|
1995
|
-
class
|
|
1995
|
+
class ue extends _ {
|
|
1996
1996
|
_parse(e) {
|
|
1997
1997
|
const { ctx: s } = this._processInputParams(e), n = this._def.options;
|
|
1998
1998
|
function a(r) {
|
|
@@ -2002,7 +2002,7 @@ class ce extends _ {
|
|
|
2002
2002
|
for (const o of r)
|
|
2003
2003
|
if (o.result.status === "dirty")
|
|
2004
2004
|
return s.common.issues.push(...o.ctx.common.issues), o.result;
|
|
2005
|
-
const i = r.map((o) => new
|
|
2005
|
+
const i = r.map((o) => new j(o.ctx.common.issues));
|
|
2006
2006
|
return u(s, {
|
|
2007
2007
|
code: c.invalid_union,
|
|
2008
2008
|
unionErrors: i
|
|
@@ -2049,7 +2049,7 @@ class ce extends _ {
|
|
|
2049
2049
|
}
|
|
2050
2050
|
if (r)
|
|
2051
2051
|
return s.common.issues.push(...r.ctx.common.issues), r.result;
|
|
2052
|
-
const o = i.map((d) => new
|
|
2052
|
+
const o = i.map((d) => new j(d));
|
|
2053
2053
|
return u(s, {
|
|
2054
2054
|
code: c.invalid_union,
|
|
2055
2055
|
unionErrors: o
|
|
@@ -2060,7 +2060,7 @@ class ce extends _ {
|
|
|
2060
2060
|
return this._def.options;
|
|
2061
2061
|
}
|
|
2062
2062
|
}
|
|
2063
|
-
|
|
2063
|
+
ue.create = (t, e) => new ue({
|
|
2064
2064
|
options: t,
|
|
2065
2065
|
typeName: p.ZodUnion,
|
|
2066
2066
|
...g(e)
|
|
@@ -2091,7 +2091,7 @@ function ve(t, e) {
|
|
|
2091
2091
|
return { valid: !0, data: a };
|
|
2092
2092
|
} else return s === f.date && n === f.date && +t == +e ? { valid: !0, data: t } : { valid: !1 };
|
|
2093
2093
|
}
|
|
2094
|
-
class
|
|
2094
|
+
class de extends _ {
|
|
2095
2095
|
_parse(e) {
|
|
2096
2096
|
const { status: s, ctx: n } = this._processInputParams(e), a = (r, i) => {
|
|
2097
2097
|
if (Oe(r) || Oe(i))
|
|
@@ -2123,13 +2123,13 @@ class ue extends _ {
|
|
|
2123
2123
|
}));
|
|
2124
2124
|
}
|
|
2125
2125
|
}
|
|
2126
|
-
|
|
2126
|
+
de.create = (t, e, s) => new de({
|
|
2127
2127
|
left: t,
|
|
2128
2128
|
right: e,
|
|
2129
2129
|
typeName: p.ZodIntersection,
|
|
2130
2130
|
...g(s)
|
|
2131
2131
|
});
|
|
2132
|
-
class
|
|
2132
|
+
class U extends _ {
|
|
2133
2133
|
_parse(e) {
|
|
2134
2134
|
const { status: s, ctx: n } = this._processInputParams(e);
|
|
2135
2135
|
if (n.parsedType !== f.array)
|
|
@@ -2155,7 +2155,7 @@ class V extends _ {
|
|
|
2155
2155
|
}), s.dirty());
|
|
2156
2156
|
const r = [...n.data].map((i, o) => {
|
|
2157
2157
|
const d = this._def.items[o] || this._def.rest;
|
|
2158
|
-
return d ? d._parse(new
|
|
2158
|
+
return d ? d._parse(new A(n, i, n.path, o)) : null;
|
|
2159
2159
|
}).filter((i) => !!i);
|
|
2160
2160
|
return n.common.async ? Promise.all(r).then((i) => T.mergeArray(s, i)) : T.mergeArray(s, r);
|
|
2161
2161
|
}
|
|
@@ -2163,23 +2163,23 @@ class V extends _ {
|
|
|
2163
2163
|
return this._def.items;
|
|
2164
2164
|
}
|
|
2165
2165
|
rest(e) {
|
|
2166
|
-
return new
|
|
2166
|
+
return new U({
|
|
2167
2167
|
...this._def,
|
|
2168
2168
|
rest: e
|
|
2169
2169
|
});
|
|
2170
2170
|
}
|
|
2171
2171
|
}
|
|
2172
|
-
|
|
2172
|
+
U.create = (t, e) => {
|
|
2173
2173
|
if (!Array.isArray(t))
|
|
2174
2174
|
throw new Error("You must pass an array of schemas to z.tuple([ ... ])");
|
|
2175
|
-
return new
|
|
2175
|
+
return new U({
|
|
2176
2176
|
items: t,
|
|
2177
2177
|
typeName: p.ZodTuple,
|
|
2178
2178
|
rest: null,
|
|
2179
2179
|
...g(e)
|
|
2180
2180
|
});
|
|
2181
2181
|
};
|
|
2182
|
-
class
|
|
2182
|
+
class le extends _ {
|
|
2183
2183
|
get keySchema() {
|
|
2184
2184
|
return this._def.keyType;
|
|
2185
2185
|
}
|
|
@@ -2197,8 +2197,8 @@ class de extends _ {
|
|
|
2197
2197
|
const a = [], r = this._def.keyType, i = this._def.valueType;
|
|
2198
2198
|
for (const o in n.data)
|
|
2199
2199
|
a.push({
|
|
2200
|
-
key: r._parse(new
|
|
2201
|
-
value: i._parse(new
|
|
2200
|
+
key: r._parse(new A(n, o, n.path, o)),
|
|
2201
|
+
value: i._parse(new A(n, n.data[o], n.path, o)),
|
|
2202
2202
|
alwaysSet: o in n.data
|
|
2203
2203
|
});
|
|
2204
2204
|
return n.common.async ? T.mergeObjectAsync(s, a) : T.mergeObjectSync(s, a);
|
|
@@ -2207,13 +2207,13 @@ class de extends _ {
|
|
|
2207
2207
|
return this._def.valueType;
|
|
2208
2208
|
}
|
|
2209
2209
|
static create(e, s, n) {
|
|
2210
|
-
return s instanceof _ ? new
|
|
2210
|
+
return s instanceof _ ? new le({
|
|
2211
2211
|
keyType: e,
|
|
2212
2212
|
valueType: s,
|
|
2213
2213
|
typeName: p.ZodRecord,
|
|
2214
2214
|
...g(n)
|
|
2215
|
-
}) : new
|
|
2216
|
-
keyType:
|
|
2215
|
+
}) : new le({
|
|
2216
|
+
keyType: q.create(),
|
|
2217
2217
|
valueType: e,
|
|
2218
2218
|
typeName: p.ZodRecord,
|
|
2219
2219
|
...g(s)
|
|
@@ -2236,8 +2236,8 @@ class Ve extends _ {
|
|
|
2236
2236
|
received: n.parsedType
|
|
2237
2237
|
}), m;
|
|
2238
2238
|
const a = this._def.keyType, r = this._def.valueType, i = [...n.data.entries()].map(([o, d], l) => ({
|
|
2239
|
-
key: a._parse(new
|
|
2240
|
-
value: r._parse(new
|
|
2239
|
+
key: a._parse(new A(n, o, n.path, [l, "key"])),
|
|
2240
|
+
value: r._parse(new A(n, d, n.path, [l, "value"]))
|
|
2241
2241
|
}));
|
|
2242
2242
|
if (n.common.async) {
|
|
2243
2243
|
const o = /* @__PURE__ */ new Map();
|
|
@@ -2268,7 +2268,7 @@ Ve.create = (t, e, s) => new Ve({
|
|
|
2268
2268
|
typeName: p.ZodMap,
|
|
2269
2269
|
...g(s)
|
|
2270
2270
|
});
|
|
2271
|
-
class
|
|
2271
|
+
class ae extends _ {
|
|
2272
2272
|
_parse(e) {
|
|
2273
2273
|
const { status: s, ctx: n } = this._processInputParams(e);
|
|
2274
2274
|
if (n.parsedType !== f.set)
|
|
@@ -2303,17 +2303,17 @@ class se extends _ {
|
|
|
2303
2303
|
}
|
|
2304
2304
|
return { status: s.value, value: l };
|
|
2305
2305
|
}
|
|
2306
|
-
const o = [...n.data.values()].map((d, l) => r._parse(new
|
|
2306
|
+
const o = [...n.data.values()].map((d, l) => r._parse(new A(n, d, n.path, l)));
|
|
2307
2307
|
return n.common.async ? Promise.all(o).then((d) => i(d)) : i(o);
|
|
2308
2308
|
}
|
|
2309
2309
|
min(e, s) {
|
|
2310
|
-
return new
|
|
2310
|
+
return new ae({
|
|
2311
2311
|
...this._def,
|
|
2312
2312
|
minSize: { value: e, message: h.toString(s) }
|
|
2313
2313
|
});
|
|
2314
2314
|
}
|
|
2315
2315
|
max(e, s) {
|
|
2316
|
-
return new
|
|
2316
|
+
return new ae({
|
|
2317
2317
|
...this._def,
|
|
2318
2318
|
maxSize: { value: e, message: h.toString(s) }
|
|
2319
2319
|
});
|
|
@@ -2325,7 +2325,7 @@ class se extends _ {
|
|
|
2325
2325
|
return this.min(1, e);
|
|
2326
2326
|
}
|
|
2327
2327
|
}
|
|
2328
|
-
|
|
2328
|
+
ae.create = (t, e) => new ae({
|
|
2329
2329
|
valueType: t,
|
|
2330
2330
|
minSize: null,
|
|
2331
2331
|
maxSize: null,
|
|
@@ -2368,13 +2368,13 @@ xe.create = (t, e) => new xe({
|
|
|
2368
2368
|
...g(e)
|
|
2369
2369
|
});
|
|
2370
2370
|
function Fe(t, e) {
|
|
2371
|
-
return new
|
|
2371
|
+
return new W({
|
|
2372
2372
|
values: t,
|
|
2373
2373
|
typeName: p.ZodEnum,
|
|
2374
2374
|
...g(e)
|
|
2375
2375
|
});
|
|
2376
2376
|
}
|
|
2377
|
-
class
|
|
2377
|
+
class W extends _ {
|
|
2378
2378
|
_parse(e) {
|
|
2379
2379
|
if (typeof e.data != "string") {
|
|
2380
2380
|
const s = this._getOrReturnCtx(e), n = this._def.values;
|
|
@@ -2416,19 +2416,19 @@ class F extends _ {
|
|
|
2416
2416
|
return e;
|
|
2417
2417
|
}
|
|
2418
2418
|
extract(e, s = this._def) {
|
|
2419
|
-
return
|
|
2419
|
+
return W.create(e, {
|
|
2420
2420
|
...this._def,
|
|
2421
2421
|
...s
|
|
2422
2422
|
});
|
|
2423
2423
|
}
|
|
2424
2424
|
exclude(e, s = this._def) {
|
|
2425
|
-
return
|
|
2425
|
+
return W.create(this.options.filter((n) => !e.includes(n)), {
|
|
2426
2426
|
...this._def,
|
|
2427
2427
|
...s
|
|
2428
2428
|
});
|
|
2429
2429
|
}
|
|
2430
2430
|
}
|
|
2431
|
-
|
|
2431
|
+
W.create = Fe;
|
|
2432
2432
|
class Be extends _ {
|
|
2433
2433
|
_parse(e) {
|
|
2434
2434
|
const s = v.getValidEnumValues(this._def.values), n = this._getOrReturnCtx(e);
|
|
@@ -2459,7 +2459,7 @@ Be.create = (t, e) => new Be({
|
|
|
2459
2459
|
typeName: p.ZodNativeEnum,
|
|
2460
2460
|
...g(e)
|
|
2461
2461
|
});
|
|
2462
|
-
class
|
|
2462
|
+
class fe extends _ {
|
|
2463
2463
|
unwrap() {
|
|
2464
2464
|
return this._def.type;
|
|
2465
2465
|
}
|
|
@@ -2478,12 +2478,12 @@ class le extends _ {
|
|
|
2478
2478
|
})));
|
|
2479
2479
|
}
|
|
2480
2480
|
}
|
|
2481
|
-
|
|
2481
|
+
fe.create = (t, e) => new fe({
|
|
2482
2482
|
type: t,
|
|
2483
2483
|
typeName: p.ZodPromise,
|
|
2484
2484
|
...g(e)
|
|
2485
2485
|
});
|
|
2486
|
-
class
|
|
2486
|
+
class H extends _ {
|
|
2487
2487
|
innerType() {
|
|
2488
2488
|
return this._def.schema;
|
|
2489
2489
|
}
|
|
@@ -2510,7 +2510,7 @@ class W extends _ {
|
|
|
2510
2510
|
path: n.path,
|
|
2511
2511
|
parent: n
|
|
2512
2512
|
});
|
|
2513
|
-
return d.status === "aborted" ? m : d.status === "dirty" || s.value === "dirty" ?
|
|
2513
|
+
return d.status === "aborted" ? m : d.status === "dirty" || s.value === "dirty" ? K(d.value) : d;
|
|
2514
2514
|
});
|
|
2515
2515
|
{
|
|
2516
2516
|
if (s.value === "aborted")
|
|
@@ -2520,7 +2520,7 @@ class W extends _ {
|
|
|
2520
2520
|
path: n.path,
|
|
2521
2521
|
parent: n
|
|
2522
2522
|
});
|
|
2523
|
-
return o.status === "aborted" ? m : o.status === "dirty" || s.value === "dirty" ?
|
|
2523
|
+
return o.status === "aborted" ? m : o.status === "dirty" || s.value === "dirty" ? K(o.value) : o;
|
|
2524
2524
|
}
|
|
2525
2525
|
}
|
|
2526
2526
|
if (a.type === "refinement") {
|
|
@@ -2549,27 +2549,27 @@ class W extends _ {
|
|
|
2549
2549
|
path: n.path,
|
|
2550
2550
|
parent: n
|
|
2551
2551
|
});
|
|
2552
|
-
if (!
|
|
2552
|
+
if (!Q(i))
|
|
2553
2553
|
return m;
|
|
2554
2554
|
const o = a.transform(i.value, r);
|
|
2555
2555
|
if (o instanceof Promise)
|
|
2556
2556
|
throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");
|
|
2557
2557
|
return { status: s.value, value: o };
|
|
2558
2558
|
} else
|
|
2559
|
-
return this._def.schema._parseAsync({ data: n.data, path: n.path, parent: n }).then((i) =>
|
|
2559
|
+
return this._def.schema._parseAsync({ data: n.data, path: n.path, parent: n }).then((i) => Q(i) ? Promise.resolve(a.transform(i.value, r)).then((o) => ({
|
|
2560
2560
|
status: s.value,
|
|
2561
2561
|
value: o
|
|
2562
2562
|
})) : m);
|
|
2563
2563
|
v.assertNever(a);
|
|
2564
2564
|
}
|
|
2565
2565
|
}
|
|
2566
|
-
|
|
2566
|
+
H.create = (t, e, s) => new H({
|
|
2567
2567
|
schema: t,
|
|
2568
2568
|
typeName: p.ZodEffects,
|
|
2569
2569
|
effect: e,
|
|
2570
2570
|
...g(s)
|
|
2571
2571
|
});
|
|
2572
|
-
|
|
2572
|
+
H.createWithPreprocess = (t, e, s) => new H({
|
|
2573
2573
|
schema: e,
|
|
2574
2574
|
effect: { type: "preprocess", transform: t },
|
|
2575
2575
|
typeName: p.ZodEffects,
|
|
@@ -2588,7 +2588,7 @@ L.create = (t, e) => new L({
|
|
|
2588
2588
|
typeName: p.ZodOptional,
|
|
2589
2589
|
...g(e)
|
|
2590
2590
|
});
|
|
2591
|
-
class
|
|
2591
|
+
class J extends _ {
|
|
2592
2592
|
_parse(e) {
|
|
2593
2593
|
return this._getType(e) === f.null ? I(null) : this._def.innerType._parse(e);
|
|
2594
2594
|
}
|
|
@@ -2596,7 +2596,7 @@ class H extends _ {
|
|
|
2596
2596
|
return this._def.innerType;
|
|
2597
2597
|
}
|
|
2598
2598
|
}
|
|
2599
|
-
|
|
2599
|
+
J.create = (t, e) => new J({
|
|
2600
2600
|
innerType: t,
|
|
2601
2601
|
typeName: p.ZodNullable,
|
|
2602
2602
|
...g(e)
|
|
@@ -2636,11 +2636,11 @@ class ke extends _ {
|
|
|
2636
2636
|
...n
|
|
2637
2637
|
}
|
|
2638
2638
|
});
|
|
2639
|
-
return
|
|
2639
|
+
return oe(a) ? a.then((r) => ({
|
|
2640
2640
|
status: "valid",
|
|
2641
2641
|
value: r.status === "valid" ? r.value : this._def.catchValue({
|
|
2642
2642
|
get error() {
|
|
2643
|
-
return new
|
|
2643
|
+
return new j(n.common.issues);
|
|
2644
2644
|
},
|
|
2645
2645
|
input: n.data
|
|
2646
2646
|
})
|
|
@@ -2648,7 +2648,7 @@ class ke extends _ {
|
|
|
2648
2648
|
status: "valid",
|
|
2649
2649
|
value: a.status === "valid" ? a.value : this._def.catchValue({
|
|
2650
2650
|
get error() {
|
|
2651
|
-
return new
|
|
2651
|
+
return new j(n.common.issues);
|
|
2652
2652
|
},
|
|
2653
2653
|
input: n.data
|
|
2654
2654
|
})
|
|
@@ -2664,7 +2664,7 @@ ke.create = (t, e) => new ke({
|
|
|
2664
2664
|
catchValue: typeof e.catch == "function" ? e.catch : () => e.catch,
|
|
2665
2665
|
...g(e)
|
|
2666
2666
|
});
|
|
2667
|
-
class
|
|
2667
|
+
class Ge extends _ {
|
|
2668
2668
|
_parse(e) {
|
|
2669
2669
|
if (this._getType(e) !== f.nan) {
|
|
2670
2670
|
const n = this._getOrReturnCtx(e);
|
|
@@ -2677,7 +2677,7 @@ class De extends _ {
|
|
|
2677
2677
|
return { status: "valid", value: e.data };
|
|
2678
2678
|
}
|
|
2679
2679
|
}
|
|
2680
|
-
|
|
2680
|
+
Ge.create = (t) => new Ge({
|
|
2681
2681
|
typeName: p.ZodNaN,
|
|
2682
2682
|
...g(t)
|
|
2683
2683
|
});
|
|
@@ -2704,7 +2704,7 @@ class Re extends _ {
|
|
|
2704
2704
|
path: n.path,
|
|
2705
2705
|
parent: n
|
|
2706
2706
|
});
|
|
2707
|
-
return r.status === "aborted" ? m : r.status === "dirty" ? (s.dirty(),
|
|
2707
|
+
return r.status === "aborted" ? m : r.status === "dirty" ? (s.dirty(), K(r.value)) : this._def.out._parseAsync({
|
|
2708
2708
|
data: r.value,
|
|
2709
2709
|
path: n.path,
|
|
2710
2710
|
parent: n
|
|
@@ -2736,8 +2736,8 @@ class Re extends _ {
|
|
|
2736
2736
|
}
|
|
2737
2737
|
class we extends _ {
|
|
2738
2738
|
_parse(e) {
|
|
2739
|
-
const s = this._def.innerType._parse(e), n = (a) => (
|
|
2740
|
-
return
|
|
2739
|
+
const s = this._def.innerType._parse(e), n = (a) => (Q(a) && (a.value = Object.freeze(a.value)), a);
|
|
2740
|
+
return oe(s) ? s.then((a) => n(a)) : n(s);
|
|
2741
2741
|
}
|
|
2742
2742
|
unwrap() {
|
|
2743
2743
|
return this._def.innerType;
|
|
@@ -2752,215 +2752,235 @@ var p;
|
|
|
2752
2752
|
(function(t) {
|
|
2753
2753
|
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";
|
|
2754
2754
|
})(p || (p = {}));
|
|
2755
|
-
const x =
|
|
2755
|
+
const x = q.create, Te = F.create, V = ye.create, he = _e.create;
|
|
2756
2756
|
$.create;
|
|
2757
|
-
const
|
|
2758
|
-
ce.create;
|
|
2757
|
+
const Nt = N.create, Y = w.create;
|
|
2759
2758
|
ue.create;
|
|
2760
|
-
|
|
2761
|
-
|
|
2762
|
-
|
|
2763
|
-
|
|
2759
|
+
de.create;
|
|
2760
|
+
U.create;
|
|
2761
|
+
const At = le.create, b = xe.create;
|
|
2762
|
+
W.create;
|
|
2763
|
+
fe.create;
|
|
2764
2764
|
L.create;
|
|
2765
|
-
|
|
2766
|
-
const Ot = 1,
|
|
2765
|
+
J.create;
|
|
2766
|
+
const Ot = 1, B = Y({
|
|
2767
2767
|
type: b("qp-bridge"),
|
|
2768
2768
|
id: x().optional(),
|
|
2769
2769
|
instanceId: x().optional()
|
|
2770
|
-
}), S =
|
|
2770
|
+
}), S = B.extend({
|
|
2771
2771
|
featureVersion: Te().optional()
|
|
2772
|
-
}), Mt =
|
|
2772
|
+
}), Mt = B.extend({
|
|
2773
2773
|
status: b("answerChanged"),
|
|
2774
2774
|
question: x(),
|
|
2775
|
-
answer:
|
|
2776
|
-
}), Zt =
|
|
2775
|
+
answer: he()
|
|
2776
|
+
}), Zt = B.extend({
|
|
2777
2777
|
action: b("commandExecuted"),
|
|
2778
2778
|
commandName: x()
|
|
2779
|
-
}),
|
|
2779
|
+
}), qt = B.extend({
|
|
2780
2780
|
action: b("questionnaireLoaded")
|
|
2781
|
-
}),
|
|
2781
|
+
}), G = B.extend({
|
|
2782
2782
|
status: b("success")
|
|
2783
|
-
}),
|
|
2783
|
+
}), jt = B.extend({
|
|
2784
2784
|
status: b("error"),
|
|
2785
2785
|
message: x()
|
|
2786
|
-
}), We =
|
|
2786
|
+
}), We = Y({
|
|
2787
2787
|
semanticColor: x().optional(),
|
|
2788
2788
|
label: x(),
|
|
2789
2789
|
description: x(),
|
|
2790
|
-
disabled:
|
|
2791
|
-
required:
|
|
2792
|
-
hidden:
|
|
2790
|
+
disabled: V(),
|
|
2791
|
+
required: V(),
|
|
2792
|
+
hidden: V(),
|
|
2793
2793
|
errorMessage: x().optional(),
|
|
2794
|
-
answer:
|
|
2795
|
-
}), Pt = We.partial(), Lt =
|
|
2794
|
+
answer: he().optional()
|
|
2795
|
+
}), Pt = We.partial(), Lt = Y({
|
|
2796
2796
|
id: x().uuid(),
|
|
2797
2797
|
name: x(),
|
|
2798
2798
|
mimeType: x(),
|
|
2799
2799
|
blobUrl: x()
|
|
2800
|
-
}), Ce =
|
|
2800
|
+
}), Ce = At(he()), He = Y({
|
|
2801
2801
|
label: x(),
|
|
2802
|
-
hidden:
|
|
2803
|
-
collapsed:
|
|
2804
|
-
}), $t = He.partial(), Vt =
|
|
2802
|
+
hidden: V(),
|
|
2803
|
+
collapsed: V()
|
|
2804
|
+
}), $t = He.partial(), Vt = Y({
|
|
2805
|
+
entityName: x(),
|
|
2806
|
+
id: x(),
|
|
2807
|
+
name: x()
|
|
2808
|
+
}), Ut = Y({
|
|
2809
|
+
isNew: V(),
|
|
2810
|
+
id: x().uuid(),
|
|
2811
|
+
label: x(),
|
|
2812
|
+
description: x().optional(),
|
|
2813
|
+
regarding: Vt.optional()
|
|
2814
|
+
}), Bt = S.extend({
|
|
2805
2815
|
action: b("getQuestion"),
|
|
2806
2816
|
question: x()
|
|
2807
|
-
}),
|
|
2817
|
+
}), Gt = G.extend({
|
|
2808
2818
|
question: We
|
|
2809
|
-
}),
|
|
2819
|
+
}), zt = S.extend({
|
|
2810
2820
|
action: b("setQuestion"),
|
|
2811
2821
|
question: x(),
|
|
2812
2822
|
questionData: Pt
|
|
2813
2823
|
}), Dt = S.extend({
|
|
2814
2824
|
action: b("getGroup"),
|
|
2815
2825
|
group: x()
|
|
2816
|
-
}),
|
|
2826
|
+
}), Qt = G.extend({
|
|
2817
2827
|
group: He
|
|
2818
|
-
}), Gt = J.extend({
|
|
2819
|
-
canSave: z()
|
|
2820
|
-
}), Qt = S.extend({
|
|
2821
|
-
action: b("canSave")
|
|
2822
2828
|
}), Ft = S.extend({
|
|
2829
|
+
action: b("getQuestionnaire")
|
|
2830
|
+
}), Wt = G.extend({
|
|
2831
|
+
questionnaire: Ut
|
|
2832
|
+
}), Ht = G.extend({
|
|
2833
|
+
canSave: V()
|
|
2834
|
+
}), Jt = S.extend({
|
|
2835
|
+
action: b("canSave")
|
|
2836
|
+
}), Yt = S.extend({
|
|
2823
2837
|
action: b("setGroup"),
|
|
2824
2838
|
group: x(),
|
|
2825
2839
|
groupData: $t
|
|
2826
|
-
}),
|
|
2840
|
+
}), Xt = S.extend({
|
|
2827
2841
|
action: b("setAnswer"),
|
|
2828
2842
|
question: x(),
|
|
2829
|
-
answer:
|
|
2830
|
-
}),
|
|
2843
|
+
answer: he()
|
|
2844
|
+
}), Kt = S.extend({
|
|
2831
2845
|
action: b("busyIndicatorStart")
|
|
2832
|
-
}),
|
|
2846
|
+
}), es = S.extend({
|
|
2833
2847
|
action: b("busyIndicatorEnd")
|
|
2834
|
-
}),
|
|
2848
|
+
}), ts = S.extend({
|
|
2835
2849
|
action: b("saveQuestionnaire")
|
|
2836
|
-
}),
|
|
2850
|
+
}), ss = S.extend({
|
|
2837
2851
|
action: b("completeAndCloseQuestionnaire")
|
|
2838
|
-
}),
|
|
2852
|
+
}), ns = S.extend({
|
|
2839
2853
|
action: b("executeCustomCommand"),
|
|
2840
2854
|
commandName: x()
|
|
2841
|
-
}),
|
|
2855
|
+
}), as = S.extend({
|
|
2842
2856
|
action: b("fetchEntities"),
|
|
2843
2857
|
fetchXml: x()
|
|
2844
|
-
}),
|
|
2845
|
-
entities:
|
|
2846
|
-
}),
|
|
2858
|
+
}), rs = G.extend({
|
|
2859
|
+
entities: Nt(Ce)
|
|
2860
|
+
}), is = S.extend({
|
|
2847
2861
|
action: b("getEntityById"),
|
|
2848
2862
|
entityName: x(),
|
|
2849
2863
|
entityId: x()
|
|
2850
|
-
}),
|
|
2864
|
+
}), os = G.extend({
|
|
2851
2865
|
entity: Ce
|
|
2852
|
-
}),
|
|
2866
|
+
}), cs = S.extend({
|
|
2853
2867
|
action: b("saveEntity"),
|
|
2854
2868
|
entity: Ce
|
|
2855
|
-
}),
|
|
2869
|
+
}), us = S.extend({
|
|
2856
2870
|
action: b("repeatGroup"),
|
|
2857
2871
|
parentGroupName: x(),
|
|
2858
2872
|
groupIndex: Te()
|
|
2859
|
-
}),
|
|
2873
|
+
}), ds = S.extend({
|
|
2860
2874
|
action: b("addNewGroup"),
|
|
2861
2875
|
groupName: x()
|
|
2862
|
-
}),
|
|
2876
|
+
}), ls = S.extend({
|
|
2863
2877
|
action: b("deleteGroup"),
|
|
2864
2878
|
parentGroupName: x(),
|
|
2865
2879
|
groupIndex: Te()
|
|
2866
2880
|
});
|
|
2867
|
-
function
|
|
2881
|
+
function Os(t) {
|
|
2868
2882
|
return Lt.safeParse(t).success;
|
|
2869
2883
|
}
|
|
2870
|
-
function
|
|
2884
|
+
function fs(t) {
|
|
2871
2885
|
return Mt.safeParse(t).success;
|
|
2872
2886
|
}
|
|
2873
|
-
function
|
|
2887
|
+
function hs(t) {
|
|
2874
2888
|
return Zt.safeParse(t).success;
|
|
2875
2889
|
}
|
|
2876
|
-
function
|
|
2877
|
-
return
|
|
2890
|
+
function ps(t) {
|
|
2891
|
+
return qt.safeParse(t).success;
|
|
2878
2892
|
}
|
|
2879
2893
|
function Se(t) {
|
|
2880
|
-
return
|
|
2894
|
+
return B.safeParse(t).success;
|
|
2881
2895
|
}
|
|
2882
|
-
function
|
|
2896
|
+
function Ms(t) {
|
|
2883
2897
|
return S.safeParse(t).success;
|
|
2884
2898
|
}
|
|
2885
|
-
function
|
|
2886
|
-
return
|
|
2899
|
+
function ms(t) {
|
|
2900
|
+
return G.safeParse(t).success;
|
|
2887
2901
|
}
|
|
2888
|
-
function
|
|
2889
|
-
return
|
|
2902
|
+
function gs(t) {
|
|
2903
|
+
return jt.safeParse(t).success;
|
|
2890
2904
|
}
|
|
2891
|
-
function
|
|
2892
|
-
return
|
|
2905
|
+
function Zs(t) {
|
|
2906
|
+
return Bt.safeParse(t).success;
|
|
2893
2907
|
}
|
|
2894
|
-
function
|
|
2895
|
-
return
|
|
2908
|
+
function ys(t) {
|
|
2909
|
+
return Gt.safeParse(t).success;
|
|
2896
2910
|
}
|
|
2897
|
-
function
|
|
2898
|
-
return
|
|
2911
|
+
function qs(t) {
|
|
2912
|
+
return Xt.safeParse(t).success;
|
|
2899
2913
|
}
|
|
2900
|
-
function
|
|
2901
|
-
return
|
|
2914
|
+
function js(t) {
|
|
2915
|
+
return zt.safeParse(t).success;
|
|
2902
2916
|
}
|
|
2903
|
-
function
|
|
2904
|
-
return
|
|
2917
|
+
function Ps(t) {
|
|
2918
|
+
return Yt.safeParse(t).success;
|
|
2905
2919
|
}
|
|
2906
|
-
function
|
|
2920
|
+
function Ls(t) {
|
|
2907
2921
|
return Dt.safeParse(t).success;
|
|
2908
2922
|
}
|
|
2909
|
-
function
|
|
2910
|
-
return
|
|
2911
|
-
}
|
|
2912
|
-
function Ms(t) {
|
|
2913
|
-
return Gt.safeParse(t).success;
|
|
2923
|
+
function $s(t) {
|
|
2924
|
+
return Ft.safeParse(t).success;
|
|
2914
2925
|
}
|
|
2915
|
-
function
|
|
2926
|
+
function _s(t) {
|
|
2916
2927
|
return Qt.safeParse(t).success;
|
|
2917
2928
|
}
|
|
2918
|
-
function
|
|
2929
|
+
function vs(t) {
|
|
2930
|
+
return Wt.safeParse(t).success;
|
|
2931
|
+
}
|
|
2932
|
+
function Vs(t) {
|
|
2919
2933
|
return Ht.safeParse(t).success;
|
|
2920
2934
|
}
|
|
2921
|
-
function
|
|
2935
|
+
function xs(t) {
|
|
2922
2936
|
return Jt.safeParse(t).success;
|
|
2923
2937
|
}
|
|
2924
|
-
function
|
|
2925
|
-
return Yt.safeParse(t).success;
|
|
2926
|
-
}
|
|
2927
|
-
function js(t) {
|
|
2928
|
-
return Xt.safeParse(t).success;
|
|
2929
|
-
}
|
|
2930
|
-
function qs(t) {
|
|
2938
|
+
function bs(t) {
|
|
2931
2939
|
return Kt.safeParse(t).success;
|
|
2932
2940
|
}
|
|
2933
|
-
function
|
|
2934
|
-
return gs(t) || ys(t);
|
|
2935
|
-
}
|
|
2936
|
-
function _s(t, e, s) {
|
|
2937
|
-
return !Se(t) || t.id !== e || s !== void 0 && t.instanceId !== s || !("status" in t);
|
|
2938
|
-
}
|
|
2939
|
-
function Ls(t) {
|
|
2941
|
+
function ks(t) {
|
|
2940
2942
|
return es.safeParse(t).success;
|
|
2941
2943
|
}
|
|
2942
|
-
function
|
|
2944
|
+
function Us(t) {
|
|
2943
2945
|
return ts.safeParse(t).success;
|
|
2944
2946
|
}
|
|
2945
|
-
function
|
|
2947
|
+
function Bs(t) {
|
|
2946
2948
|
return ss.safeParse(t).success;
|
|
2947
2949
|
}
|
|
2948
|
-
function
|
|
2950
|
+
function Gs(t) {
|
|
2949
2951
|
return ns.safeParse(t).success;
|
|
2950
2952
|
}
|
|
2951
|
-
function
|
|
2953
|
+
function zs(t) {
|
|
2954
|
+
return bs(t) || ks(t);
|
|
2955
|
+
}
|
|
2956
|
+
function ws(t, e, s) {
|
|
2957
|
+
return !Se(t) || t.id !== e || s !== void 0 && t.instanceId !== s || !("status" in t);
|
|
2958
|
+
}
|
|
2959
|
+
function Ds(t) {
|
|
2952
2960
|
return as.safeParse(t).success;
|
|
2953
2961
|
}
|
|
2954
|
-
function
|
|
2962
|
+
function Ss(t) {
|
|
2955
2963
|
return rs.safeParse(t).success;
|
|
2956
2964
|
}
|
|
2957
|
-
function
|
|
2965
|
+
function Qs(t) {
|
|
2958
2966
|
return is.safeParse(t).success;
|
|
2959
2967
|
}
|
|
2960
|
-
function
|
|
2968
|
+
function Rs(t) {
|
|
2961
2969
|
return os.safeParse(t).success;
|
|
2962
2970
|
}
|
|
2963
|
-
function
|
|
2971
|
+
function Fs(t) {
|
|
2972
|
+
return cs.safeParse(t).success;
|
|
2973
|
+
}
|
|
2974
|
+
function Ws(t) {
|
|
2975
|
+
return us.safeParse(t).success;
|
|
2976
|
+
}
|
|
2977
|
+
function Hs(t) {
|
|
2978
|
+
return ds.safeParse(t).success;
|
|
2979
|
+
}
|
|
2980
|
+
function Js(t) {
|
|
2981
|
+
return ls.safeParse(t).success;
|
|
2982
|
+
}
|
|
2983
|
+
function re(t) {
|
|
2964
2984
|
if (t?.instanceId != null)
|
|
2965
2985
|
return t.instanceId;
|
|
2966
2986
|
const e = globalThis.__RESCO_QP_BRIDGE_INSTANCE_ID;
|
|
@@ -2993,7 +3013,7 @@ function Je(t) {
|
|
|
2993
3013
|
}
|
|
2994
3014
|
throw new Error("Unsupported content type for blobUrl");
|
|
2995
3015
|
}
|
|
2996
|
-
function
|
|
3016
|
+
function Ys(t, e, s, n) {
|
|
2997
3017
|
return {
|
|
2998
3018
|
id: n ?? ze(),
|
|
2999
3019
|
name: t,
|
|
@@ -3001,7 +3021,7 @@ function zs(t, e, s, n) {
|
|
|
3001
3021
|
blobUrl: Je(s)
|
|
3002
3022
|
};
|
|
3003
3023
|
}
|
|
3004
|
-
function
|
|
3024
|
+
function Xs(t, e) {
|
|
3005
3025
|
let s = t.blobUrl;
|
|
3006
3026
|
return e.content !== void 0 && (s = Je(e.content)), {
|
|
3007
3027
|
...t,
|
|
@@ -3009,14 +3029,23 @@ function Gs(t, e) {
|
|
|
3009
3029
|
blobUrl: s
|
|
3010
3030
|
};
|
|
3011
3031
|
}
|
|
3012
|
-
Ke.env?.NODE_ENV !== "test" &&
|
|
3013
|
-
function
|
|
3032
|
+
Ke.env?.NODE_ENV !== "test" && Ts();
|
|
3033
|
+
function Ts() {
|
|
3014
3034
|
window.addEventListener("message", Ye);
|
|
3015
3035
|
}
|
|
3016
|
-
function
|
|
3036
|
+
function Ks() {
|
|
3017
3037
|
window.removeEventListener("message", Ye);
|
|
3018
3038
|
}
|
|
3019
|
-
async function
|
|
3039
|
+
async function en(t) {
|
|
3040
|
+
return await Es(
|
|
3041
|
+
{
|
|
3042
|
+
type: "qp-bridge",
|
|
3043
|
+
action: "getQuestionnaire"
|
|
3044
|
+
},
|
|
3045
|
+
t
|
|
3046
|
+
);
|
|
3047
|
+
}
|
|
3048
|
+
async function tn(t, e, s) {
|
|
3020
3049
|
await C(
|
|
3021
3050
|
{
|
|
3022
3051
|
type: "qp-bridge",
|
|
@@ -3027,8 +3056,8 @@ async function Fs(t, e, s) {
|
|
|
3027
3056
|
s
|
|
3028
3057
|
);
|
|
3029
3058
|
}
|
|
3030
|
-
async function
|
|
3031
|
-
return await
|
|
3059
|
+
async function sn(t, e) {
|
|
3060
|
+
return await Cs(
|
|
3032
3061
|
{
|
|
3033
3062
|
type: "qp-bridge",
|
|
3034
3063
|
action: "getQuestion",
|
|
@@ -3037,7 +3066,7 @@ async function Ws(t, e) {
|
|
|
3037
3066
|
e
|
|
3038
3067
|
);
|
|
3039
3068
|
}
|
|
3040
|
-
async function
|
|
3069
|
+
async function nn(t, e, s) {
|
|
3041
3070
|
await C(
|
|
3042
3071
|
{
|
|
3043
3072
|
type: "qp-bridge",
|
|
@@ -3048,8 +3077,8 @@ async function Hs(t, e, s) {
|
|
|
3048
3077
|
s
|
|
3049
3078
|
);
|
|
3050
3079
|
}
|
|
3051
|
-
async function
|
|
3052
|
-
return await
|
|
3080
|
+
async function an(t, e) {
|
|
3081
|
+
return await Is(
|
|
3053
3082
|
{
|
|
3054
3083
|
type: "qp-bridge",
|
|
3055
3084
|
action: "getGroup",
|
|
@@ -3058,7 +3087,7 @@ async function Js(t, e) {
|
|
|
3058
3087
|
e
|
|
3059
3088
|
);
|
|
3060
3089
|
}
|
|
3061
|
-
async function
|
|
3090
|
+
async function rn(t, e, s) {
|
|
3062
3091
|
await C(
|
|
3063
3092
|
{
|
|
3064
3093
|
type: "qp-bridge",
|
|
@@ -3069,9 +3098,9 @@ async function Ys(t, e, s) {
|
|
|
3069
3098
|
s
|
|
3070
3099
|
);
|
|
3071
3100
|
}
|
|
3072
|
-
function
|
|
3073
|
-
const s =
|
|
3074
|
-
|
|
3101
|
+
function on(t, e) {
|
|
3102
|
+
const s = re(e), n = (a) => {
|
|
3103
|
+
fs(a.data) && a.data.instanceId === s && t(a.data.question, a.data.answer);
|
|
3075
3104
|
};
|
|
3076
3105
|
return window.addEventListener("message", n), {
|
|
3077
3106
|
cancelSubscription: () => {
|
|
@@ -3079,7 +3108,7 @@ function Xs(t, e) {
|
|
|
3079
3108
|
}
|
|
3080
3109
|
};
|
|
3081
3110
|
}
|
|
3082
|
-
async function
|
|
3111
|
+
async function cn(t, e) {
|
|
3083
3112
|
await C(
|
|
3084
3113
|
{
|
|
3085
3114
|
type: "qp-bridge",
|
|
@@ -3099,7 +3128,7 @@ async function Ks(t, e) {
|
|
|
3099
3128
|
);
|
|
3100
3129
|
}
|
|
3101
3130
|
}
|
|
3102
|
-
async function
|
|
3131
|
+
async function un(t) {
|
|
3103
3132
|
await C(
|
|
3104
3133
|
{
|
|
3105
3134
|
type: "qp-bridge",
|
|
@@ -3108,7 +3137,7 @@ async function en(t) {
|
|
|
3108
3137
|
t
|
|
3109
3138
|
);
|
|
3110
3139
|
}
|
|
3111
|
-
async function
|
|
3140
|
+
async function dn(t) {
|
|
3112
3141
|
await C(
|
|
3113
3142
|
{
|
|
3114
3143
|
type: "qp-bridge",
|
|
@@ -3117,7 +3146,7 @@ async function tn(t) {
|
|
|
3117
3146
|
t
|
|
3118
3147
|
);
|
|
3119
3148
|
}
|
|
3120
|
-
async function
|
|
3149
|
+
async function ln(t, e) {
|
|
3121
3150
|
await C(
|
|
3122
3151
|
{
|
|
3123
3152
|
type: "qp-bridge",
|
|
@@ -3127,38 +3156,38 @@ async function sn(t, e) {
|
|
|
3127
3156
|
e
|
|
3128
3157
|
);
|
|
3129
3158
|
}
|
|
3130
|
-
const
|
|
3131
|
-
function
|
|
3132
|
-
const s =
|
|
3133
|
-
return
|
|
3159
|
+
const ee = [], te = [], se = [];
|
|
3160
|
+
function fn(t, e) {
|
|
3161
|
+
const s = re(e);
|
|
3162
|
+
return se.some((n) => n.handler === t && n.instanceId === s) || se.push({ handler: t, instanceId: s }), {
|
|
3134
3163
|
cancelSubscription: () => {
|
|
3135
|
-
const n =
|
|
3136
|
-
n !== -1 &&
|
|
3164
|
+
const n = se.findIndex((a) => a.handler === t && a.instanceId === s);
|
|
3165
|
+
n !== -1 && se.splice(n, 1);
|
|
3137
3166
|
}
|
|
3138
3167
|
};
|
|
3139
3168
|
}
|
|
3140
|
-
function
|
|
3141
|
-
const s =
|
|
3142
|
-
return
|
|
3169
|
+
function hn(t, e) {
|
|
3170
|
+
const s = re(e);
|
|
3171
|
+
return te.some((n) => n.handler === t && n.instanceId === s) || te.push({ handler: t, instanceId: s }), {
|
|
3143
3172
|
cancelSubscription: () => {
|
|
3144
|
-
const n =
|
|
3145
|
-
n !== -1 &&
|
|
3173
|
+
const n = te.findIndex((a) => a.handler === t && a.instanceId === s);
|
|
3174
|
+
n !== -1 && te.splice(n, 1);
|
|
3146
3175
|
}
|
|
3147
3176
|
};
|
|
3148
3177
|
}
|
|
3149
|
-
function
|
|
3150
|
-
const s =
|
|
3151
|
-
return
|
|
3178
|
+
function pn(t, e) {
|
|
3179
|
+
const s = re(e);
|
|
3180
|
+
return ee.some((n) => n.validator === t && n.instanceId === s) || ee.push({ validator: t, instanceId: s }), {
|
|
3152
3181
|
cancelSubscription: () => {
|
|
3153
|
-
const n =
|
|
3154
|
-
n !== -1 &&
|
|
3182
|
+
const n = ee.findIndex((a) => a.validator === t && a.instanceId === s);
|
|
3183
|
+
n !== -1 && ee.splice(n, 1);
|
|
3155
3184
|
}
|
|
3156
3185
|
};
|
|
3157
3186
|
}
|
|
3158
3187
|
async function Ye(t) {
|
|
3159
3188
|
try {
|
|
3160
|
-
if (
|
|
3161
|
-
const e =
|
|
3189
|
+
if (hs(t.data) && te.filter((e) => e.instanceId === t.data.instanceId).forEach((e) => e.handler(t.data.commandName)), ps(t.data) && se.filter((e) => e.instanceId === t.data.instanceId).forEach((e) => e.handler()), xs(t.data)) {
|
|
3190
|
+
const e = ee.filter((a) => a.instanceId === t.data.instanceId), s = await Promise.all(e.map((a) => a.validator())), n = {
|
|
3162
3191
|
type: "qp-bridge",
|
|
3163
3192
|
status: "success",
|
|
3164
3193
|
id: t.data.id,
|
|
@@ -3178,8 +3207,8 @@ async function Ye(t) {
|
|
|
3178
3207
|
window.parent.postMessage(s, "*");
|
|
3179
3208
|
}
|
|
3180
3209
|
}
|
|
3181
|
-
async function
|
|
3182
|
-
return await
|
|
3210
|
+
async function mn(t, e) {
|
|
3211
|
+
return await Ns(
|
|
3183
3212
|
{
|
|
3184
3213
|
type: "qp-bridge",
|
|
3185
3214
|
action: "fetchEntities",
|
|
@@ -3188,8 +3217,8 @@ async function on(t, e) {
|
|
|
3188
3217
|
e
|
|
3189
3218
|
);
|
|
3190
3219
|
}
|
|
3191
|
-
async function
|
|
3192
|
-
return await
|
|
3220
|
+
async function gn(t, e, s) {
|
|
3221
|
+
return await As(
|
|
3193
3222
|
{
|
|
3194
3223
|
type: "qp-bridge",
|
|
3195
3224
|
action: "getEntityById",
|
|
@@ -3199,10 +3228,10 @@ async function cn(t, e, s) {
|
|
|
3199
3228
|
s
|
|
3200
3229
|
);
|
|
3201
3230
|
}
|
|
3202
|
-
function
|
|
3231
|
+
function yn() {
|
|
3203
3232
|
return { isNew: !0 };
|
|
3204
3233
|
}
|
|
3205
|
-
async function
|
|
3234
|
+
async function _n(t, e) {
|
|
3206
3235
|
await C(
|
|
3207
3236
|
{
|
|
3208
3237
|
type: "qp-bridge",
|
|
@@ -3212,7 +3241,7 @@ async function dn(t, e) {
|
|
|
3212
3241
|
e
|
|
3213
3242
|
);
|
|
3214
3243
|
}
|
|
3215
|
-
async function
|
|
3244
|
+
async function vn(t, e, s) {
|
|
3216
3245
|
await C(
|
|
3217
3246
|
{
|
|
3218
3247
|
type: "qp-bridge",
|
|
@@ -3223,7 +3252,7 @@ async function ln(t, e, s) {
|
|
|
3223
3252
|
s
|
|
3224
3253
|
);
|
|
3225
3254
|
}
|
|
3226
|
-
async function
|
|
3255
|
+
async function xn(t, e) {
|
|
3227
3256
|
await C(
|
|
3228
3257
|
{
|
|
3229
3258
|
type: "qp-bridge",
|
|
@@ -3233,7 +3262,7 @@ async function fn(t, e) {
|
|
|
3233
3262
|
e
|
|
3234
3263
|
);
|
|
3235
3264
|
}
|
|
3236
|
-
async function
|
|
3265
|
+
async function bn(t, e, s) {
|
|
3237
3266
|
await C(
|
|
3238
3267
|
{
|
|
3239
3268
|
type: "qp-bridge",
|
|
@@ -3244,143 +3273,156 @@ async function hn(t, e, s) {
|
|
|
3244
3273
|
s
|
|
3245
3274
|
);
|
|
3246
3275
|
}
|
|
3247
|
-
async function
|
|
3276
|
+
async function X(t, e, s) {
|
|
3248
3277
|
return new Promise((n, a) => {
|
|
3249
|
-
const r = ze(), i =
|
|
3250
|
-
if (
|
|
3278
|
+
const r = ze(), i = re(s), o = (d) => {
|
|
3279
|
+
if (ws(d.data, r, i))
|
|
3251
3280
|
return;
|
|
3252
3281
|
const l = e(d.data);
|
|
3253
|
-
l.success ? n(l.data) :
|
|
3282
|
+
l.success ? n(l.data) : gs(d.data) ? a(new Error(d.data.message)) : a(new Error("Unknown message received")), window.removeEventListener("message", o);
|
|
3254
3283
|
};
|
|
3255
3284
|
window.addEventListener("message", o), window.parent.postMessage({ ...t, id: r, instanceId: i, featureVersion: Ot }, "*");
|
|
3256
3285
|
});
|
|
3257
3286
|
}
|
|
3258
|
-
async function
|
|
3259
|
-
return
|
|
3287
|
+
async function Cs(t, e) {
|
|
3288
|
+
return X(
|
|
3289
|
+
t,
|
|
3290
|
+
(s) => ys(s) ? { success: !0, data: s.question } : { success: !1 },
|
|
3291
|
+
e
|
|
3292
|
+
);
|
|
3293
|
+
}
|
|
3294
|
+
async function Is(t, e) {
|
|
3295
|
+
return X(
|
|
3260
3296
|
t,
|
|
3261
|
-
(s) =>
|
|
3297
|
+
(s) => _s(s) ? { success: !0, data: s.group } : { success: !1 },
|
|
3262
3298
|
e
|
|
3263
3299
|
);
|
|
3264
3300
|
}
|
|
3265
|
-
async function
|
|
3266
|
-
return
|
|
3301
|
+
async function Es(t, e) {
|
|
3302
|
+
return X(
|
|
3267
3303
|
t,
|
|
3268
|
-
(s) =>
|
|
3304
|
+
(s) => vs(s) ? { success: !0, data: s.questionnaire } : { success: !1 },
|
|
3269
3305
|
e
|
|
3270
3306
|
);
|
|
3271
3307
|
}
|
|
3272
3308
|
function C(t, e) {
|
|
3273
|
-
return
|
|
3309
|
+
return X(
|
|
3274
3310
|
t,
|
|
3275
|
-
(s) =>
|
|
3311
|
+
(s) => ms(s) ? { success: !0, data: void 0 } : { success: !1 },
|
|
3276
3312
|
e
|
|
3277
3313
|
);
|
|
3278
3314
|
}
|
|
3279
|
-
async function
|
|
3280
|
-
return
|
|
3315
|
+
async function Ns(t, e) {
|
|
3316
|
+
return X(
|
|
3281
3317
|
t,
|
|
3282
|
-
(s) =>
|
|
3318
|
+
(s) => Ss(s) ? { success: !0, data: s.entities } : { success: !1 },
|
|
3283
3319
|
e
|
|
3284
3320
|
);
|
|
3285
3321
|
}
|
|
3286
|
-
async function
|
|
3287
|
-
return
|
|
3322
|
+
async function As(t, e) {
|
|
3323
|
+
return X(
|
|
3288
3324
|
t,
|
|
3289
|
-
(s) =>
|
|
3325
|
+
(s) => Rs(s) ? { success: !0, data: s.entity } : { success: !1 },
|
|
3290
3326
|
e
|
|
3291
3327
|
);
|
|
3292
3328
|
}
|
|
3293
3329
|
export {
|
|
3294
3330
|
Ot as QP_BRIDGE_FEATURE_VERSION,
|
|
3295
|
-
|
|
3296
|
-
|
|
3297
|
-
|
|
3298
|
-
|
|
3299
|
-
|
|
3300
|
-
|
|
3331
|
+
xn as addNewGroup,
|
|
3332
|
+
ds as addNewGroupRequestMessageSchema,
|
|
3333
|
+
es as busyIndicatorEndRequestMessageSchema,
|
|
3334
|
+
Kt as busyIndicatorStartRequestMessageSchema,
|
|
3335
|
+
Jt as canSaveRequestMessageSchema,
|
|
3336
|
+
Ht as canSaveSuccessResponseMessageSchema,
|
|
3301
3337
|
Zt as commandExecutedMessageSchema,
|
|
3302
|
-
|
|
3303
|
-
|
|
3304
|
-
|
|
3305
|
-
|
|
3306
|
-
|
|
3307
|
-
|
|
3338
|
+
dn as completeAndCloseQuestionnaire,
|
|
3339
|
+
ss as completeAndCloseQuestionnaireRequestMessageSchema,
|
|
3340
|
+
Ys as createMediaItem,
|
|
3341
|
+
yn as createNewEntity,
|
|
3342
|
+
bn as deleteGroup,
|
|
3343
|
+
ls as deleteGroupRequestMessageSchema,
|
|
3308
3344
|
Ce as entitySchema,
|
|
3309
|
-
|
|
3310
|
-
|
|
3311
|
-
|
|
3312
|
-
|
|
3313
|
-
|
|
3314
|
-
|
|
3315
|
-
|
|
3316
|
-
|
|
3317
|
-
|
|
3345
|
+
ln as executeCustomCommand,
|
|
3346
|
+
ns as executeCustomCommandRequestMessageSchema,
|
|
3347
|
+
mn as fetchEntities,
|
|
3348
|
+
as as fetchEntitiesRequestMessageSchema,
|
|
3349
|
+
rs as fetchEntitiesSuccessResponseMessageSchema,
|
|
3350
|
+
gn as getEntityById,
|
|
3351
|
+
is as getEntityByIdRequestMessageSchema,
|
|
3352
|
+
os as getEntityByIdSuccessResponseMessageSchema,
|
|
3353
|
+
an as getGroup,
|
|
3318
3354
|
Dt as getGroupRequestMessageSchema,
|
|
3319
|
-
|
|
3320
|
-
|
|
3321
|
-
|
|
3322
|
-
|
|
3355
|
+
Qt as getGroupSuccessResponseMessageSchema,
|
|
3356
|
+
sn as getQuestion,
|
|
3357
|
+
Bt as getQuestionRequestMessageSchema,
|
|
3358
|
+
Gt as getQuestionSuccessResponseMessageSchema,
|
|
3359
|
+
en as getQuestionnaire,
|
|
3360
|
+
Ft as getQuestionnaireRequestMessageSchema,
|
|
3361
|
+
Wt as getQuestionnaireSuccessResponseMessageSchema,
|
|
3323
3362
|
$t as groupOptionalScheme,
|
|
3324
3363
|
He as groupSchema,
|
|
3325
|
-
|
|
3326
|
-
|
|
3327
|
-
|
|
3328
|
-
|
|
3329
|
-
|
|
3330
|
-
|
|
3331
|
-
|
|
3332
|
-
|
|
3333
|
-
|
|
3334
|
-
|
|
3335
|
-
|
|
3336
|
-
|
|
3337
|
-
|
|
3338
|
-
|
|
3339
|
-
|
|
3340
|
-
|
|
3341
|
-
|
|
3342
|
-
|
|
3343
|
-
|
|
3344
|
-
|
|
3345
|
-
|
|
3346
|
-
|
|
3364
|
+
Ts as initOnSaveMessageHandler,
|
|
3365
|
+
Hs as isAddNewGroupRequestMessage,
|
|
3366
|
+
ks as isBusyIndicatorEndRequestMessage,
|
|
3367
|
+
bs as isBusyIndicatorStartRequestMessage,
|
|
3368
|
+
xs as isCanSaveRequestMessage,
|
|
3369
|
+
Vs as isCanSaveSuccessResponseMessage,
|
|
3370
|
+
hs as isCommandExecutedMessage,
|
|
3371
|
+
Bs as isCompleteAndCloseQuestionnaireRequestMessage,
|
|
3372
|
+
Js as isDeleteGroupRequestMessage,
|
|
3373
|
+
gs as isErrorMessage,
|
|
3374
|
+
Gs as isExecuteCustomCommandRequestMessage,
|
|
3375
|
+
Ds as isFetchEntitiesRequestMessage,
|
|
3376
|
+
Ss as isFetchEntitiesSuccessResponseMessage,
|
|
3377
|
+
Qs as isGetEntityByIdRequestMessage,
|
|
3378
|
+
Rs as isGetEntityByIdSuccessResponseMessage,
|
|
3379
|
+
Ls as isGetGroupRequestMessage,
|
|
3380
|
+
_s as isGetGroupSuccessResponseMessage,
|
|
3381
|
+
Zs as isGetQuestionRequestMessage,
|
|
3382
|
+
ys as isGetQuestionSuccessResponseMessage,
|
|
3383
|
+
$s as isGetQuestionnaireRequestMessage,
|
|
3384
|
+
vs as isGetQuestionnaireSuccessResponseMessage,
|
|
3385
|
+
Os as isMediaItem,
|
|
3386
|
+
ws as isNotRelevantMessage,
|
|
3387
|
+
fs as isOnAnswerChangeMessage,
|
|
3347
3388
|
Se as isQpBridgeMessage,
|
|
3348
|
-
|
|
3349
|
-
|
|
3350
|
-
|
|
3351
|
-
|
|
3352
|
-
|
|
3353
|
-
|
|
3354
|
-
|
|
3355
|
-
|
|
3356
|
-
|
|
3357
|
-
|
|
3389
|
+
Ms as isQpBridgeRequestMessage,
|
|
3390
|
+
ps as isQuestionnaireLoadedMessage,
|
|
3391
|
+
Ws as isRepeatGroupRequestMessage,
|
|
3392
|
+
Fs as isSaveEntityRequestMessage,
|
|
3393
|
+
Us as isSaveQuestionnaireRequestMessage,
|
|
3394
|
+
qs as isSetAnswerRequestMessage,
|
|
3395
|
+
Ps as isSetGroupRequestMessage,
|
|
3396
|
+
js as isSetQuestionRequestMessage,
|
|
3397
|
+
ms as isSuccessMessage,
|
|
3398
|
+
zs as isWithBusyIndicatorRequestMessage,
|
|
3358
3399
|
Lt as mediaItemSchema,
|
|
3359
|
-
|
|
3400
|
+
on as onAnswerChange,
|
|
3360
3401
|
Mt as onAnswerChangeMessageSchema,
|
|
3361
|
-
|
|
3362
|
-
|
|
3363
|
-
|
|
3364
|
-
|
|
3402
|
+
hn as onCommandExecuted,
|
|
3403
|
+
fn as onQuestionnaireLoaded,
|
|
3404
|
+
pn as onSave,
|
|
3405
|
+
B as qpBridgeBaseMessageSchema,
|
|
3365
3406
|
S as qpBridgeRequestMessageSchema,
|
|
3366
3407
|
Pt as questionOptionalScheme,
|
|
3367
3408
|
We as questionSchema,
|
|
3368
|
-
|
|
3369
|
-
|
|
3370
|
-
|
|
3371
|
-
|
|
3372
|
-
|
|
3373
|
-
|
|
3374
|
-
|
|
3375
|
-
|
|
3376
|
-
|
|
3377
|
-
|
|
3378
|
-
|
|
3379
|
-
|
|
3380
|
-
|
|
3381
|
-
|
|
3382
|
-
|
|
3383
|
-
|
|
3384
|
-
|
|
3385
|
-
|
|
3409
|
+
qt as questionnaireLoadedMessageSchema,
|
|
3410
|
+
Ut as questionnaireSchema,
|
|
3411
|
+
Ks as removeOnSaveMessageHandler,
|
|
3412
|
+
vn as repeatGroup,
|
|
3413
|
+
us as repeatGroupRequestMessageSchema,
|
|
3414
|
+
jt as responseErrorMessageSchema,
|
|
3415
|
+
G as responseSuccessMessageSchema,
|
|
3416
|
+
_n as saveEntity,
|
|
3417
|
+
cs as saveEntityRequestMessageSchema,
|
|
3418
|
+
un as saveQuestionnaire,
|
|
3419
|
+
ts as saveQuestionnaireRequestMessageSchema,
|
|
3420
|
+
tn as setAnswer,
|
|
3421
|
+
Xt as setAnswerRequestMessageSchema,
|
|
3422
|
+
rn as setGroup,
|
|
3423
|
+
Yt as setGroupRequestMessageSchema,
|
|
3424
|
+
nn as setQuestion,
|
|
3425
|
+
zt as setQuestionRequestMessageSchema,
|
|
3426
|
+
Xs as updateMediaItem,
|
|
3427
|
+
cn as withBusyIndicator
|
|
3386
3428
|
};
|