@8wave/ai-elements 0.98.0-beta.2 → 0.98.0-beta.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ai-elements.es.js +391 -355
- package/dist/ai-elements.es.js.map +1 -1
- package/dist-vue/PkChatbot.js +1 -1
- package/dist-vue/PkChatbotViewChat.js +1 -1
- package/dist-vue/PkChatbotViewConversations.js +1 -1
- package/dist-vue/PkChatbotViewFiles.js +1 -1
- package/dist-vue/PkChatbotViewProfile.js +1 -1
- package/dist-vue/_chunks/{PkChatbot-CneS8fVC.js → PkChatbot-CxpAotKB.js} +6 -6
- package/dist-vue/_chunks/{PkChatbot-CneS8fVC.js.map → PkChatbot-CxpAotKB.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotViewChat-C7Xv2Oer.js → PkChatbotViewChat-QzWSymIg.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotViewChat-C7Xv2Oer.js.map → PkChatbotViewChat-QzWSymIg.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotViewConversations-YbHHc8oD.js → PkChatbotViewConversations-O-wm_nu1.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotViewConversations-YbHHc8oD.js.map → PkChatbotViewConversations-O-wm_nu1.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotViewFiles-BPE0g2Jk.js → PkChatbotViewFiles-RHMwvWUS.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotViewFiles-BPE0g2Jk.js.map → PkChatbotViewFiles-RHMwvWUS.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotViewProfile-B_gWPgVY.js → PkChatbotViewProfile-Bka6CUAa.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotViewProfile-B_gWPgVY.js.map → PkChatbotViewProfile-Bka6CUAa.js.map} +1 -1
- package/dist-vue/_chunks/{useChatbotStore-Cfx-qlC4.js → useChatbotStore-DeHwEN8W.js} +528 -511
- package/dist-vue/_chunks/{useChatbotStore-Cfx-qlC4.js.map → useChatbotStore-DeHwEN8W.js.map} +1 -1
- package/dist-vue/composables.js +1 -1
- package/dist-vue/index.js +12 -11
- package/dist-vue/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -84,19 +84,19 @@ var ye = "AI_InvalidArgumentError", O = `vercel.ai.error.${ye}`, be = Symbol.for
|
|
|
84
84
|
static isInstance(e) {
|
|
85
85
|
return E.hasMarker(e, O);
|
|
86
86
|
}
|
|
87
|
-
}, we = "AI_JSONParseError", k = `vercel.ai.error.${we}`, Te = Symbol.for(k), Ee, De
|
|
87
|
+
}, we = "AI_JSONParseError", k = `vercel.ai.error.${we}`, Te = Symbol.for(k), A, Ee, De = class extends (Ee = E, A = Te, Ee) {
|
|
88
88
|
constructor({ text: e, cause: t }) {
|
|
89
89
|
super({
|
|
90
90
|
name: we,
|
|
91
91
|
message: `JSON parsing failed: Text: ${e}.
|
|
92
92
|
Error message: ${D(t)}`,
|
|
93
93
|
cause: t
|
|
94
|
-
}), this[
|
|
94
|
+
}), this[A] = !0, this.text = e;
|
|
95
95
|
}
|
|
96
96
|
static isInstance(e) {
|
|
97
97
|
return E.hasMarker(e, k);
|
|
98
98
|
}
|
|
99
|
-
},
|
|
99
|
+
}, j = "AI_TypeValidationError", Oe = `vercel.ai.error.${j}`, ke = Symbol.for(Oe), Ae, je, M = class e extends (je = E, Ae = ke, je) {
|
|
100
100
|
constructor({ value: e, cause: t, context: n }) {
|
|
101
101
|
let r = "Type validation failed";
|
|
102
102
|
if (n?.field && (r += ` for ${n.field}`), n?.entityName || n?.entityId) {
|
|
@@ -105,14 +105,14 @@ Error message: ${D(t)}`,
|
|
|
105
105
|
n.entityName && e.push(n.entityName), n.entityId && e.push(`id: "${n.entityId}"`), r += e.join(", "), r += ")";
|
|
106
106
|
}
|
|
107
107
|
super({
|
|
108
|
-
name:
|
|
108
|
+
name: j,
|
|
109
109
|
message: `${r}: Value: ${JSON.stringify(e)}.
|
|
110
110
|
Error message: ${D(t)}`,
|
|
111
111
|
cause: t
|
|
112
|
-
}), this[
|
|
112
|
+
}), this[Ae] = !0, this.value = e, this.context = n;
|
|
113
113
|
}
|
|
114
114
|
static isInstance(e) {
|
|
115
|
-
return E.hasMarker(e,
|
|
115
|
+
return E.hasMarker(e, Oe);
|
|
116
116
|
}
|
|
117
117
|
static wrap({ value: t, cause: n, context: r }) {
|
|
118
118
|
return e.isInstance(n) && n.value === t && n.context?.field === r?.field && n.context?.entityName === r?.entityName && n.context?.entityId === r?.entityId ? n : new e({
|
|
@@ -121,7 +121,7 @@ Error message: ${D(t)}`,
|
|
|
121
121
|
context: r
|
|
122
122
|
});
|
|
123
123
|
}
|
|
124
|
-
},
|
|
124
|
+
}, Me = (e, t) => {
|
|
125
125
|
let n;
|
|
126
126
|
switch (e.code) {
|
|
127
127
|
case y.invalid_type:
|
|
@@ -175,13 +175,13 @@ Error message: ${D(t)}`,
|
|
|
175
175
|
default: n = t.defaultError, _.assertNever(e);
|
|
176
176
|
}
|
|
177
177
|
return { message: n };
|
|
178
|
-
},
|
|
179
|
-
function
|
|
180
|
-
return
|
|
178
|
+
}, Ne = Me;
|
|
179
|
+
function Pe() {
|
|
180
|
+
return Ne;
|
|
181
181
|
}
|
|
182
182
|
//#endregion
|
|
183
183
|
//#region ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v3/helpers/parseUtil.js
|
|
184
|
-
var
|
|
184
|
+
var N = (e) => {
|
|
185
185
|
let { data: t, path: n, errorMaps: r, issueData: i } = e, a = [...n, ...i.path || []], o = {
|
|
186
186
|
...i,
|
|
187
187
|
path: a
|
|
@@ -202,8 +202,8 @@ var M = (e) => {
|
|
|
202
202
|
message: s
|
|
203
203
|
};
|
|
204
204
|
};
|
|
205
|
-
function
|
|
206
|
-
let n =
|
|
205
|
+
function P(e, t) {
|
|
206
|
+
let n = Pe(), r = N({
|
|
207
207
|
issueData: t,
|
|
208
208
|
data: e.data,
|
|
209
209
|
path: e.path,
|
|
@@ -211,12 +211,12 @@ function N(e, t) {
|
|
|
211
211
|
e.common.contextualErrorMap,
|
|
212
212
|
e.schemaErrorMap,
|
|
213
213
|
n,
|
|
214
|
-
n ===
|
|
214
|
+
n === Me ? void 0 : Me
|
|
215
215
|
].filter((e) => !!e)
|
|
216
216
|
});
|
|
217
217
|
e.common.issues.push(r);
|
|
218
218
|
}
|
|
219
|
-
var
|
|
219
|
+
var F = class e {
|
|
220
220
|
constructor() {
|
|
221
221
|
this.value = "valid";
|
|
222
222
|
}
|
|
@@ -229,7 +229,7 @@ var P = class e {
|
|
|
229
229
|
static mergeArray(e, t) {
|
|
230
230
|
let n = [];
|
|
231
231
|
for (let r of t) {
|
|
232
|
-
if (r.status === "aborted") return
|
|
232
|
+
if (r.status === "aborted") return I;
|
|
233
233
|
r.status === "dirty" && e.dirty(), n.push(r.value);
|
|
234
234
|
}
|
|
235
235
|
return {
|
|
@@ -252,7 +252,7 @@ var P = class e {
|
|
|
252
252
|
let n = {};
|
|
253
253
|
for (let r of t) {
|
|
254
254
|
let { key: t, value: i } = r;
|
|
255
|
-
if (t.status === "aborted" || i.status === "aborted") return
|
|
255
|
+
if (t.status === "aborted" || i.status === "aborted") return I;
|
|
256
256
|
t.status === "dirty" && e.dirty(), i.status === "dirty" && e.dirty(), t.value !== "__proto__" && (i.value !== void 0 || r.alwaysSet) && (n[t.value] = i.value);
|
|
257
257
|
}
|
|
258
258
|
return {
|
|
@@ -260,27 +260,27 @@ var P = class e {
|
|
|
260
260
|
value: n
|
|
261
261
|
};
|
|
262
262
|
}
|
|
263
|
-
},
|
|
263
|
+
}, I = Object.freeze({ status: "aborted" }), Fe = (e) => ({
|
|
264
264
|
status: "dirty",
|
|
265
265
|
value: e
|
|
266
|
-
}),
|
|
266
|
+
}), L = (e) => ({
|
|
267
267
|
status: "valid",
|
|
268
268
|
value: e
|
|
269
|
-
}),
|
|
269
|
+
}), Ie = (e) => e.status === "aborted", Le = (e) => e.status === "dirty", Re = (e) => e.status === "valid", ze = (e) => typeof Promise < "u" && e instanceof Promise, R;
|
|
270
270
|
(function(e) {
|
|
271
271
|
e.errToObj = (e) => typeof e == "string" ? { message: e } : e || {}, e.toString = (e) => typeof e == "string" ? e : e?.message;
|
|
272
|
-
})(
|
|
272
|
+
})(R ||= {});
|
|
273
273
|
//#endregion
|
|
274
274
|
//#region ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v3/types.js
|
|
275
|
-
var
|
|
275
|
+
var z = class {
|
|
276
276
|
constructor(e, t, n, r) {
|
|
277
277
|
this._cachedPath = [], this.parent = e, this.data = t, this._path = n, this._key = r;
|
|
278
278
|
}
|
|
279
279
|
get path() {
|
|
280
280
|
return this._cachedPath.length || (Array.isArray(this._key) ? this._cachedPath.push(...this._path, ...this._key) : this._cachedPath.push(...this._path, this._key)), this._cachedPath;
|
|
281
281
|
}
|
|
282
|
-
},
|
|
283
|
-
if (
|
|
282
|
+
}, Be = (e, t) => {
|
|
283
|
+
if (Re(t)) return {
|
|
284
284
|
success: !0,
|
|
285
285
|
data: t.value
|
|
286
286
|
};
|
|
@@ -294,7 +294,7 @@ var R = class {
|
|
|
294
294
|
}
|
|
295
295
|
};
|
|
296
296
|
};
|
|
297
|
-
function
|
|
297
|
+
function B(e) {
|
|
298
298
|
if (!e) return {};
|
|
299
299
|
let { errorMap: t, invalid_type_error: n, required_error: r, description: i } = e;
|
|
300
300
|
if (t && (n || r)) throw Error("Can't use \"invalid_type_error\" or \"required_error\" in conjunction with custom error map.");
|
|
@@ -309,7 +309,7 @@ function z(e) {
|
|
|
309
309
|
description: i
|
|
310
310
|
};
|
|
311
311
|
}
|
|
312
|
-
var
|
|
312
|
+
var V = class {
|
|
313
313
|
get description() {
|
|
314
314
|
return this._def.description;
|
|
315
315
|
}
|
|
@@ -328,7 +328,7 @@ var B = class {
|
|
|
328
328
|
}
|
|
329
329
|
_processInputParams(e) {
|
|
330
330
|
return {
|
|
331
|
-
status: new
|
|
331
|
+
status: new F(),
|
|
332
332
|
ctx: {
|
|
333
333
|
common: e.parent.common,
|
|
334
334
|
data: e.data,
|
|
@@ -341,7 +341,7 @@ var B = class {
|
|
|
341
341
|
}
|
|
342
342
|
_parseSync(e) {
|
|
343
343
|
let t = this._parse(e);
|
|
344
|
-
if (
|
|
344
|
+
if (ze(t)) throw Error("Synchronous parse encountered promise.");
|
|
345
345
|
return t;
|
|
346
346
|
}
|
|
347
347
|
_parseAsync(e) {
|
|
@@ -366,7 +366,7 @@ var B = class {
|
|
|
366
366
|
data: e,
|
|
367
367
|
parsedType: v(e)
|
|
368
368
|
};
|
|
369
|
-
return
|
|
369
|
+
return Be(n, this._parseSync({
|
|
370
370
|
data: e,
|
|
371
371
|
path: n.path,
|
|
372
372
|
parent: n
|
|
@@ -390,7 +390,7 @@ var B = class {
|
|
|
390
390
|
path: [],
|
|
391
391
|
parent: t
|
|
392
392
|
});
|
|
393
|
-
return
|
|
393
|
+
return Re(n) ? { value: n.value } : { issues: t.common.issues };
|
|
394
394
|
} catch (e) {
|
|
395
395
|
e?.message?.toLowerCase()?.includes("encountered") && (this["~standard"].async = !0), t.common = {
|
|
396
396
|
issues: [],
|
|
@@ -401,7 +401,7 @@ var B = class {
|
|
|
401
401
|
data: e,
|
|
402
402
|
path: [],
|
|
403
403
|
parent: t
|
|
404
|
-
}).then((e) =>
|
|
404
|
+
}).then((e) => Re(e) ? { value: e.value } : { issues: t.common.issues });
|
|
405
405
|
}
|
|
406
406
|
async parseAsync(e, t) {
|
|
407
407
|
let n = await this.safeParseAsync(e, t);
|
|
@@ -425,7 +425,7 @@ var B = class {
|
|
|
425
425
|
path: n.path,
|
|
426
426
|
parent: n
|
|
427
427
|
});
|
|
428
|
-
return
|
|
428
|
+
return Be(n, await (ze(r) ? r : Promise.resolve(r)));
|
|
429
429
|
}
|
|
430
430
|
refine(e, t) {
|
|
431
431
|
let n = (e) => typeof t == "string" || t === void 0 ? { message: t } : typeof t == "function" ? t(e) : t;
|
|
@@ -470,20 +470,20 @@ var B = class {
|
|
|
470
470
|
return this.nullable().optional();
|
|
471
471
|
}
|
|
472
472
|
array() {
|
|
473
|
-
return
|
|
473
|
+
return wt.create(this);
|
|
474
474
|
}
|
|
475
475
|
promise() {
|
|
476
476
|
return Vt.create(this, this._def);
|
|
477
477
|
}
|
|
478
478
|
or(e) {
|
|
479
|
-
return
|
|
479
|
+
return Et.create([this, e], this._def);
|
|
480
480
|
}
|
|
481
481
|
and(e) {
|
|
482
482
|
return At.create(this, e, this._def);
|
|
483
483
|
}
|
|
484
484
|
transform(e) {
|
|
485
485
|
return new U({
|
|
486
|
-
...
|
|
486
|
+
...B(this._def),
|
|
487
487
|
schema: this,
|
|
488
488
|
typeName: G.ZodEffects,
|
|
489
489
|
effect: {
|
|
@@ -495,7 +495,7 @@ var B = class {
|
|
|
495
495
|
default(e) {
|
|
496
496
|
let t = typeof e == "function" ? e : () => e;
|
|
497
497
|
return new Ut({
|
|
498
|
-
...
|
|
498
|
+
...B(this._def),
|
|
499
499
|
innerType: this,
|
|
500
500
|
defaultValue: t,
|
|
501
501
|
typeName: G.ZodDefault
|
|
@@ -505,13 +505,13 @@ var B = class {
|
|
|
505
505
|
return new Kt({
|
|
506
506
|
typeName: G.ZodBranded,
|
|
507
507
|
type: this,
|
|
508
|
-
...
|
|
508
|
+
...B(this._def)
|
|
509
509
|
});
|
|
510
510
|
}
|
|
511
511
|
catch(e) {
|
|
512
512
|
let t = typeof e == "function" ? e : () => e;
|
|
513
513
|
return new Wt({
|
|
514
|
-
...
|
|
514
|
+
...B(this._def),
|
|
515
515
|
innerType: this,
|
|
516
516
|
catchValue: t,
|
|
517
517
|
typeName: G.ZodCatch
|
|
@@ -536,25 +536,25 @@ var B = class {
|
|
|
536
536
|
isNullable() {
|
|
537
537
|
return this.safeParse(null).success;
|
|
538
538
|
}
|
|
539
|
-
},
|
|
540
|
-
function
|
|
539
|
+
}, Ve = /^c[^\s-]{8,}$/i, He = /^[0-9a-z]+$/, Ue = /^[0-9A-HJKMNP-TV-Z]{26}$/i, We = /^[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, Ge = /^[a-z0-9_-]{21}$/i, Ke = /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/, qe = /^[-+]?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)?)??$/, Je = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, Ye = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$", Xe, Ze = /^(?:(?: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])$/, Qe = /^(?:(?: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])$/, $e = /^(([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]))$/, et = /^(([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])$/, tt = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, nt = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/, rt = "((\\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])))", it = RegExp(`^${rt}$`);
|
|
540
|
+
function at(e) {
|
|
541
541
|
let t = "[0-5]\\d";
|
|
542
542
|
e.precision ? t = `${t}\\.\\d{${e.precision}}` : e.precision ?? (t = `${t}(\\.\\d+)?`);
|
|
543
543
|
let n = e.precision ? "+" : "?";
|
|
544
544
|
return `([01]\\d|2[0-3]):[0-5]\\d(:${t})${n}`;
|
|
545
545
|
}
|
|
546
|
-
function
|
|
547
|
-
return RegExp(`^${
|
|
546
|
+
function ot(e) {
|
|
547
|
+
return RegExp(`^${at(e)}$`);
|
|
548
548
|
}
|
|
549
|
-
function
|
|
550
|
-
let t = `${
|
|
549
|
+
function st(e) {
|
|
550
|
+
let t = `${rt}T${at(e)}`, n = [];
|
|
551
551
|
return n.push(e.local ? "Z?" : "Z"), e.offset && n.push("([+-]\\d{2}:?\\d{2})"), t = `${t}(${n.join("|")})`, RegExp(`^${t}$`);
|
|
552
552
|
}
|
|
553
|
-
function
|
|
554
|
-
return !!((t === "v4" || !t) &&
|
|
553
|
+
function ct(e, t) {
|
|
554
|
+
return !!((t === "v4" || !t) && Ze.test(e) || (t === "v6" || !t) && $e.test(e));
|
|
555
555
|
}
|
|
556
|
-
function
|
|
557
|
-
if (!
|
|
556
|
+
function lt(e, t) {
|
|
557
|
+
if (!Ke.test(e)) return !1;
|
|
558
558
|
try {
|
|
559
559
|
let [n] = e.split(".");
|
|
560
560
|
if (!n) return !1;
|
|
@@ -564,21 +564,21 @@ function ut(e, t) {
|
|
|
564
564
|
return !1;
|
|
565
565
|
}
|
|
566
566
|
}
|
|
567
|
-
function
|
|
568
|
-
return !!((t === "v4" || !t) &&
|
|
567
|
+
function ut(e, t) {
|
|
568
|
+
return !!((t === "v4" || !t) && Qe.test(e) || (t === "v6" || !t) && et.test(e));
|
|
569
569
|
}
|
|
570
|
-
var
|
|
570
|
+
var dt = class e extends V {
|
|
571
571
|
_parse(e) {
|
|
572
572
|
if (this._def.coerce && (e.data = String(e.data)), this._getType(e) !== b.string) {
|
|
573
573
|
let t = this._getOrReturnCtx(e);
|
|
574
|
-
return
|
|
574
|
+
return P(t, {
|
|
575
575
|
code: y.invalid_type,
|
|
576
576
|
expected: b.string,
|
|
577
577
|
received: t.parsedType
|
|
578
|
-
}),
|
|
578
|
+
}), I;
|
|
579
579
|
}
|
|
580
|
-
let t = new
|
|
581
|
-
for (let r of this._def.checks) if (r.kind === "min") e.data.length < r.value && (n = this._getOrReturnCtx(e, n),
|
|
580
|
+
let t = new F(), n;
|
|
581
|
+
for (let r of this._def.checks) if (r.kind === "min") e.data.length < r.value && (n = this._getOrReturnCtx(e, n), P(n, {
|
|
582
582
|
code: y.too_small,
|
|
583
583
|
minimum: r.value,
|
|
584
584
|
type: "string",
|
|
@@ -586,7 +586,7 @@ var ft = class e extends B {
|
|
|
586
586
|
exact: !1,
|
|
587
587
|
message: r.message
|
|
588
588
|
}), t.dirty());
|
|
589
|
-
else if (r.kind === "max") e.data.length > r.value && (n = this._getOrReturnCtx(e, n),
|
|
589
|
+
else if (r.kind === "max") e.data.length > r.value && (n = this._getOrReturnCtx(e, n), P(n, {
|
|
590
590
|
code: y.too_big,
|
|
591
591
|
maximum: r.value,
|
|
592
592
|
type: "string",
|
|
@@ -596,14 +596,14 @@ var ft = class e extends B {
|
|
|
596
596
|
}), t.dirty());
|
|
597
597
|
else if (r.kind === "length") {
|
|
598
598
|
let i = e.data.length > r.value, a = e.data.length < r.value;
|
|
599
|
-
(i || a) && (n = this._getOrReturnCtx(e, n), i ?
|
|
599
|
+
(i || a) && (n = this._getOrReturnCtx(e, n), i ? P(n, {
|
|
600
600
|
code: y.too_big,
|
|
601
601
|
maximum: r.value,
|
|
602
602
|
type: "string",
|
|
603
603
|
inclusive: !0,
|
|
604
604
|
exact: !0,
|
|
605
605
|
message: r.message
|
|
606
|
-
}) : a &&
|
|
606
|
+
}) : a && P(n, {
|
|
607
607
|
code: y.too_small,
|
|
608
608
|
minimum: r.value,
|
|
609
609
|
type: "string",
|
|
@@ -611,37 +611,37 @@ var ft = class e extends B {
|
|
|
611
611
|
exact: !0,
|
|
612
612
|
message: r.message
|
|
613
613
|
}), t.dirty());
|
|
614
|
-
} else if (r.kind === "email")
|
|
614
|
+
} else if (r.kind === "email") Je.test(e.data) || (n = this._getOrReturnCtx(e, n), P(n, {
|
|
615
615
|
validation: "email",
|
|
616
616
|
code: y.invalid_string,
|
|
617
617
|
message: r.message
|
|
618
618
|
}), t.dirty());
|
|
619
|
-
else if (r.kind === "emoji")
|
|
619
|
+
else if (r.kind === "emoji") Xe ||= new RegExp(Ye, "u"), Xe.test(e.data) || (n = this._getOrReturnCtx(e, n), P(n, {
|
|
620
620
|
validation: "emoji",
|
|
621
621
|
code: y.invalid_string,
|
|
622
622
|
message: r.message
|
|
623
623
|
}), t.dirty());
|
|
624
|
-
else if (r.kind === "uuid")
|
|
624
|
+
else if (r.kind === "uuid") We.test(e.data) || (n = this._getOrReturnCtx(e, n), P(n, {
|
|
625
625
|
validation: "uuid",
|
|
626
626
|
code: y.invalid_string,
|
|
627
627
|
message: r.message
|
|
628
628
|
}), t.dirty());
|
|
629
|
-
else if (r.kind === "nanoid")
|
|
629
|
+
else if (r.kind === "nanoid") Ge.test(e.data) || (n = this._getOrReturnCtx(e, n), P(n, {
|
|
630
630
|
validation: "nanoid",
|
|
631
631
|
code: y.invalid_string,
|
|
632
632
|
message: r.message
|
|
633
633
|
}), t.dirty());
|
|
634
|
-
else if (r.kind === "cuid")
|
|
634
|
+
else if (r.kind === "cuid") Ve.test(e.data) || (n = this._getOrReturnCtx(e, n), P(n, {
|
|
635
635
|
validation: "cuid",
|
|
636
636
|
code: y.invalid_string,
|
|
637
637
|
message: r.message
|
|
638
638
|
}), t.dirty());
|
|
639
|
-
else if (r.kind === "cuid2")
|
|
639
|
+
else if (r.kind === "cuid2") He.test(e.data) || (n = this._getOrReturnCtx(e, n), P(n, {
|
|
640
640
|
validation: "cuid2",
|
|
641
641
|
code: y.invalid_string,
|
|
642
642
|
message: r.message
|
|
643
643
|
}), t.dirty());
|
|
644
|
-
else if (r.kind === "ulid")
|
|
644
|
+
else if (r.kind === "ulid") Ue.test(e.data) || (n = this._getOrReturnCtx(e, n), P(n, {
|
|
645
645
|
validation: "ulid",
|
|
646
646
|
code: y.invalid_string,
|
|
647
647
|
message: r.message
|
|
@@ -649,64 +649,64 @@ var ft = class e extends B {
|
|
|
649
649
|
else if (r.kind === "url") try {
|
|
650
650
|
new URL(e.data);
|
|
651
651
|
} catch {
|
|
652
|
-
n = this._getOrReturnCtx(e, n),
|
|
652
|
+
n = this._getOrReturnCtx(e, n), P(n, {
|
|
653
653
|
validation: "url",
|
|
654
654
|
code: y.invalid_string,
|
|
655
655
|
message: r.message
|
|
656
656
|
}), t.dirty();
|
|
657
657
|
}
|
|
658
|
-
else r.kind === "regex" ? (r.regex.lastIndex = 0, r.regex.test(e.data) || (n = this._getOrReturnCtx(e, n),
|
|
658
|
+
else r.kind === "regex" ? (r.regex.lastIndex = 0, r.regex.test(e.data) || (n = this._getOrReturnCtx(e, n), P(n, {
|
|
659
659
|
validation: "regex",
|
|
660
660
|
code: y.invalid_string,
|
|
661
661
|
message: r.message
|
|
662
|
-
}), t.dirty())) : r.kind === "trim" ? e.data = e.data.trim() : r.kind === "includes" ? e.data.includes(r.value, r.position) || (n = this._getOrReturnCtx(e, n),
|
|
662
|
+
}), t.dirty())) : r.kind === "trim" ? e.data = e.data.trim() : r.kind === "includes" ? e.data.includes(r.value, r.position) || (n = this._getOrReturnCtx(e, n), P(n, {
|
|
663
663
|
code: y.invalid_string,
|
|
664
664
|
validation: {
|
|
665
665
|
includes: r.value,
|
|
666
666
|
position: r.position
|
|
667
667
|
},
|
|
668
668
|
message: r.message
|
|
669
|
-
}), t.dirty()) : r.kind === "toLowerCase" ? e.data = e.data.toLowerCase() : r.kind === "toUpperCase" ? e.data = e.data.toUpperCase() : r.kind === "startsWith" ? e.data.startsWith(r.value) || (n = this._getOrReturnCtx(e, n),
|
|
669
|
+
}), t.dirty()) : r.kind === "toLowerCase" ? e.data = e.data.toLowerCase() : r.kind === "toUpperCase" ? e.data = e.data.toUpperCase() : r.kind === "startsWith" ? e.data.startsWith(r.value) || (n = this._getOrReturnCtx(e, n), P(n, {
|
|
670
670
|
code: y.invalid_string,
|
|
671
671
|
validation: { startsWith: r.value },
|
|
672
672
|
message: r.message
|
|
673
|
-
}), t.dirty()) : r.kind === "endsWith" ? e.data.endsWith(r.value) || (n = this._getOrReturnCtx(e, n),
|
|
673
|
+
}), t.dirty()) : r.kind === "endsWith" ? e.data.endsWith(r.value) || (n = this._getOrReturnCtx(e, n), P(n, {
|
|
674
674
|
code: y.invalid_string,
|
|
675
675
|
validation: { endsWith: r.value },
|
|
676
676
|
message: r.message
|
|
677
|
-
}), t.dirty()) : r.kind === "datetime" ?
|
|
677
|
+
}), t.dirty()) : r.kind === "datetime" ? st(r).test(e.data) || (n = this._getOrReturnCtx(e, n), P(n, {
|
|
678
678
|
code: y.invalid_string,
|
|
679
679
|
validation: "datetime",
|
|
680
680
|
message: r.message
|
|
681
|
-
}), t.dirty()) : r.kind === "date" ?
|
|
681
|
+
}), t.dirty()) : r.kind === "date" ? it.test(e.data) || (n = this._getOrReturnCtx(e, n), P(n, {
|
|
682
682
|
code: y.invalid_string,
|
|
683
683
|
validation: "date",
|
|
684
684
|
message: r.message
|
|
685
|
-
}), t.dirty()) : r.kind === "time" ?
|
|
685
|
+
}), t.dirty()) : r.kind === "time" ? ot(r).test(e.data) || (n = this._getOrReturnCtx(e, n), P(n, {
|
|
686
686
|
code: y.invalid_string,
|
|
687
687
|
validation: "time",
|
|
688
688
|
message: r.message
|
|
689
|
-
}), t.dirty()) : r.kind === "duration" ?
|
|
689
|
+
}), t.dirty()) : r.kind === "duration" ? qe.test(e.data) || (n = this._getOrReturnCtx(e, n), P(n, {
|
|
690
690
|
validation: "duration",
|
|
691
691
|
code: y.invalid_string,
|
|
692
692
|
message: r.message
|
|
693
|
-
}), t.dirty()) : r.kind === "ip" ?
|
|
693
|
+
}), t.dirty()) : r.kind === "ip" ? ct(e.data, r.version) || (n = this._getOrReturnCtx(e, n), P(n, {
|
|
694
694
|
validation: "ip",
|
|
695
695
|
code: y.invalid_string,
|
|
696
696
|
message: r.message
|
|
697
|
-
}), t.dirty()) : r.kind === "jwt" ?
|
|
697
|
+
}), t.dirty()) : r.kind === "jwt" ? lt(e.data, r.alg) || (n = this._getOrReturnCtx(e, n), P(n, {
|
|
698
698
|
validation: "jwt",
|
|
699
699
|
code: y.invalid_string,
|
|
700
700
|
message: r.message
|
|
701
|
-
}), t.dirty()) : r.kind === "cidr" ?
|
|
701
|
+
}), t.dirty()) : r.kind === "cidr" ? ut(e.data, r.version) || (n = this._getOrReturnCtx(e, n), P(n, {
|
|
702
702
|
validation: "cidr",
|
|
703
703
|
code: y.invalid_string,
|
|
704
704
|
message: r.message
|
|
705
|
-
}), t.dirty()) : r.kind === "base64" ?
|
|
705
|
+
}), t.dirty()) : r.kind === "base64" ? tt.test(e.data) || (n = this._getOrReturnCtx(e, n), P(n, {
|
|
706
706
|
validation: "base64",
|
|
707
707
|
code: y.invalid_string,
|
|
708
708
|
message: r.message
|
|
709
|
-
}), t.dirty()) : r.kind === "base64url" ?
|
|
709
|
+
}), t.dirty()) : r.kind === "base64url" ? nt.test(e.data) || (n = this._getOrReturnCtx(e, n), P(n, {
|
|
710
710
|
validation: "base64url",
|
|
711
711
|
code: y.invalid_string,
|
|
712
712
|
message: r.message
|
|
@@ -720,7 +720,7 @@ var ft = class e extends B {
|
|
|
720
720
|
return this.refinement((t) => e.test(t), {
|
|
721
721
|
validation: t,
|
|
722
722
|
code: y.invalid_string,
|
|
723
|
-
...
|
|
723
|
+
...R.errToObj(n)
|
|
724
724
|
});
|
|
725
725
|
}
|
|
726
726
|
_addCheck(t) {
|
|
@@ -732,79 +732,79 @@ var ft = class e extends B {
|
|
|
732
732
|
email(e) {
|
|
733
733
|
return this._addCheck({
|
|
734
734
|
kind: "email",
|
|
735
|
-
...
|
|
735
|
+
...R.errToObj(e)
|
|
736
736
|
});
|
|
737
737
|
}
|
|
738
738
|
url(e) {
|
|
739
739
|
return this._addCheck({
|
|
740
740
|
kind: "url",
|
|
741
|
-
...
|
|
741
|
+
...R.errToObj(e)
|
|
742
742
|
});
|
|
743
743
|
}
|
|
744
744
|
emoji(e) {
|
|
745
745
|
return this._addCheck({
|
|
746
746
|
kind: "emoji",
|
|
747
|
-
...
|
|
747
|
+
...R.errToObj(e)
|
|
748
748
|
});
|
|
749
749
|
}
|
|
750
750
|
uuid(e) {
|
|
751
751
|
return this._addCheck({
|
|
752
752
|
kind: "uuid",
|
|
753
|
-
...
|
|
753
|
+
...R.errToObj(e)
|
|
754
754
|
});
|
|
755
755
|
}
|
|
756
756
|
nanoid(e) {
|
|
757
757
|
return this._addCheck({
|
|
758
758
|
kind: "nanoid",
|
|
759
|
-
...
|
|
759
|
+
...R.errToObj(e)
|
|
760
760
|
});
|
|
761
761
|
}
|
|
762
762
|
cuid(e) {
|
|
763
763
|
return this._addCheck({
|
|
764
764
|
kind: "cuid",
|
|
765
|
-
...
|
|
765
|
+
...R.errToObj(e)
|
|
766
766
|
});
|
|
767
767
|
}
|
|
768
768
|
cuid2(e) {
|
|
769
769
|
return this._addCheck({
|
|
770
770
|
kind: "cuid2",
|
|
771
|
-
...
|
|
771
|
+
...R.errToObj(e)
|
|
772
772
|
});
|
|
773
773
|
}
|
|
774
774
|
ulid(e) {
|
|
775
775
|
return this._addCheck({
|
|
776
776
|
kind: "ulid",
|
|
777
|
-
...
|
|
777
|
+
...R.errToObj(e)
|
|
778
778
|
});
|
|
779
779
|
}
|
|
780
780
|
base64(e) {
|
|
781
781
|
return this._addCheck({
|
|
782
782
|
kind: "base64",
|
|
783
|
-
...
|
|
783
|
+
...R.errToObj(e)
|
|
784
784
|
});
|
|
785
785
|
}
|
|
786
786
|
base64url(e) {
|
|
787
787
|
return this._addCheck({
|
|
788
788
|
kind: "base64url",
|
|
789
|
-
...
|
|
789
|
+
...R.errToObj(e)
|
|
790
790
|
});
|
|
791
791
|
}
|
|
792
792
|
jwt(e) {
|
|
793
793
|
return this._addCheck({
|
|
794
794
|
kind: "jwt",
|
|
795
|
-
...
|
|
795
|
+
...R.errToObj(e)
|
|
796
796
|
});
|
|
797
797
|
}
|
|
798
798
|
ip(e) {
|
|
799
799
|
return this._addCheck({
|
|
800
800
|
kind: "ip",
|
|
801
|
-
...
|
|
801
|
+
...R.errToObj(e)
|
|
802
802
|
});
|
|
803
803
|
}
|
|
804
804
|
cidr(e) {
|
|
805
805
|
return this._addCheck({
|
|
806
806
|
kind: "cidr",
|
|
807
|
-
...
|
|
807
|
+
...R.errToObj(e)
|
|
808
808
|
});
|
|
809
809
|
}
|
|
810
810
|
datetime(e) {
|
|
@@ -819,7 +819,7 @@ var ft = class e extends B {
|
|
|
819
819
|
precision: e?.precision === void 0 ? null : e?.precision,
|
|
820
820
|
offset: e?.offset ?? !1,
|
|
821
821
|
local: e?.local ?? !1,
|
|
822
|
-
...
|
|
822
|
+
...R.errToObj(e?.message)
|
|
823
823
|
});
|
|
824
824
|
}
|
|
825
825
|
date(e) {
|
|
@@ -836,20 +836,20 @@ var ft = class e extends B {
|
|
|
836
836
|
}) : this._addCheck({
|
|
837
837
|
kind: "time",
|
|
838
838
|
precision: e?.precision === void 0 ? null : e?.precision,
|
|
839
|
-
...
|
|
839
|
+
...R.errToObj(e?.message)
|
|
840
840
|
});
|
|
841
841
|
}
|
|
842
842
|
duration(e) {
|
|
843
843
|
return this._addCheck({
|
|
844
844
|
kind: "duration",
|
|
845
|
-
...
|
|
845
|
+
...R.errToObj(e)
|
|
846
846
|
});
|
|
847
847
|
}
|
|
848
848
|
regex(e, t) {
|
|
849
849
|
return this._addCheck({
|
|
850
850
|
kind: "regex",
|
|
851
851
|
regex: e,
|
|
852
|
-
...
|
|
852
|
+
...R.errToObj(t)
|
|
853
853
|
});
|
|
854
854
|
}
|
|
855
855
|
includes(e, t) {
|
|
@@ -857,46 +857,46 @@ var ft = class e extends B {
|
|
|
857
857
|
kind: "includes",
|
|
858
858
|
value: e,
|
|
859
859
|
position: t?.position,
|
|
860
|
-
...
|
|
860
|
+
...R.errToObj(t?.message)
|
|
861
861
|
});
|
|
862
862
|
}
|
|
863
863
|
startsWith(e, t) {
|
|
864
864
|
return this._addCheck({
|
|
865
865
|
kind: "startsWith",
|
|
866
866
|
value: e,
|
|
867
|
-
...
|
|
867
|
+
...R.errToObj(t)
|
|
868
868
|
});
|
|
869
869
|
}
|
|
870
870
|
endsWith(e, t) {
|
|
871
871
|
return this._addCheck({
|
|
872
872
|
kind: "endsWith",
|
|
873
873
|
value: e,
|
|
874
|
-
...
|
|
874
|
+
...R.errToObj(t)
|
|
875
875
|
});
|
|
876
876
|
}
|
|
877
877
|
min(e, t) {
|
|
878
878
|
return this._addCheck({
|
|
879
879
|
kind: "min",
|
|
880
880
|
value: e,
|
|
881
|
-
...
|
|
881
|
+
...R.errToObj(t)
|
|
882
882
|
});
|
|
883
883
|
}
|
|
884
884
|
max(e, t) {
|
|
885
885
|
return this._addCheck({
|
|
886
886
|
kind: "max",
|
|
887
887
|
value: e,
|
|
888
|
-
...
|
|
888
|
+
...R.errToObj(t)
|
|
889
889
|
});
|
|
890
890
|
}
|
|
891
891
|
length(e, t) {
|
|
892
892
|
return this._addCheck({
|
|
893
893
|
kind: "length",
|
|
894
894
|
value: e,
|
|
895
|
-
...
|
|
895
|
+
...R.errToObj(t)
|
|
896
896
|
});
|
|
897
897
|
}
|
|
898
898
|
nonempty(e) {
|
|
899
|
-
return this.min(1,
|
|
899
|
+
return this.min(1, R.errToObj(e));
|
|
900
900
|
}
|
|
901
901
|
trim() {
|
|
902
902
|
return new e({
|
|
@@ -975,54 +975,54 @@ var ft = class e extends B {
|
|
|
975
975
|
return e;
|
|
976
976
|
}
|
|
977
977
|
};
|
|
978
|
-
|
|
978
|
+
dt.create = (e) => new dt({
|
|
979
979
|
checks: [],
|
|
980
980
|
typeName: G.ZodString,
|
|
981
981
|
coerce: e?.coerce ?? !1,
|
|
982
|
-
...
|
|
982
|
+
...B(e)
|
|
983
983
|
});
|
|
984
|
-
function
|
|
984
|
+
function ft(e, t) {
|
|
985
985
|
let n = (e.toString().split(".")[1] || "").length, r = (t.toString().split(".")[1] || "").length, i = n > r ? n : r;
|
|
986
986
|
return Number.parseInt(e.toFixed(i).replace(".", "")) % Number.parseInt(t.toFixed(i).replace(".", "")) / 10 ** i;
|
|
987
987
|
}
|
|
988
|
-
var
|
|
988
|
+
var pt = class e extends V {
|
|
989
989
|
constructor() {
|
|
990
990
|
super(...arguments), this.min = this.gte, this.max = this.lte, this.step = this.multipleOf;
|
|
991
991
|
}
|
|
992
992
|
_parse(e) {
|
|
993
993
|
if (this._def.coerce && (e.data = Number(e.data)), this._getType(e) !== b.number) {
|
|
994
994
|
let t = this._getOrReturnCtx(e);
|
|
995
|
-
return
|
|
995
|
+
return P(t, {
|
|
996
996
|
code: y.invalid_type,
|
|
997
997
|
expected: b.number,
|
|
998
998
|
received: t.parsedType
|
|
999
|
-
}),
|
|
999
|
+
}), I;
|
|
1000
1000
|
}
|
|
1001
|
-
let t, n = new
|
|
1002
|
-
for (let r of this._def.checks) r.kind === "int" ? _.isInteger(e.data) || (t = this._getOrReturnCtx(e, t),
|
|
1001
|
+
let t, n = new F();
|
|
1002
|
+
for (let r of this._def.checks) r.kind === "int" ? _.isInteger(e.data) || (t = this._getOrReturnCtx(e, t), P(t, {
|
|
1003
1003
|
code: y.invalid_type,
|
|
1004
1004
|
expected: "integer",
|
|
1005
1005
|
received: "float",
|
|
1006
1006
|
message: r.message
|
|
1007
|
-
}), n.dirty()) : r.kind === "min" ? (r.inclusive ? e.data < r.value : e.data <= r.value) && (t = this._getOrReturnCtx(e, t),
|
|
1007
|
+
}), n.dirty()) : r.kind === "min" ? (r.inclusive ? e.data < r.value : e.data <= r.value) && (t = this._getOrReturnCtx(e, t), P(t, {
|
|
1008
1008
|
code: y.too_small,
|
|
1009
1009
|
minimum: r.value,
|
|
1010
1010
|
type: "number",
|
|
1011
1011
|
inclusive: r.inclusive,
|
|
1012
1012
|
exact: !1,
|
|
1013
1013
|
message: r.message
|
|
1014
|
-
}), n.dirty()) : r.kind === "max" ? (r.inclusive ? e.data > r.value : e.data >= r.value) && (t = this._getOrReturnCtx(e, t),
|
|
1014
|
+
}), n.dirty()) : r.kind === "max" ? (r.inclusive ? e.data > r.value : e.data >= r.value) && (t = this._getOrReturnCtx(e, t), P(t, {
|
|
1015
1015
|
code: y.too_big,
|
|
1016
1016
|
maximum: r.value,
|
|
1017
1017
|
type: "number",
|
|
1018
1018
|
inclusive: r.inclusive,
|
|
1019
1019
|
exact: !1,
|
|
1020
1020
|
message: r.message
|
|
1021
|
-
}), n.dirty()) : r.kind === "multipleOf" ?
|
|
1021
|
+
}), n.dirty()) : r.kind === "multipleOf" ? ft(e.data, r.value) !== 0 && (t = this._getOrReturnCtx(e, t), P(t, {
|
|
1022
1022
|
code: y.not_multiple_of,
|
|
1023
1023
|
multipleOf: r.value,
|
|
1024
1024
|
message: r.message
|
|
1025
|
-
}), n.dirty()) : r.kind === "finite" ? Number.isFinite(e.data) || (t = this._getOrReturnCtx(e, t),
|
|
1025
|
+
}), n.dirty()) : r.kind === "finite" ? Number.isFinite(e.data) || (t = this._getOrReturnCtx(e, t), P(t, {
|
|
1026
1026
|
code: y.not_finite,
|
|
1027
1027
|
message: r.message
|
|
1028
1028
|
}), n.dirty()) : _.assertNever(r);
|
|
@@ -1032,16 +1032,16 @@ var mt = class e extends B {
|
|
|
1032
1032
|
};
|
|
1033
1033
|
}
|
|
1034
1034
|
gte(e, t) {
|
|
1035
|
-
return this.setLimit("min", e, !0,
|
|
1035
|
+
return this.setLimit("min", e, !0, R.toString(t));
|
|
1036
1036
|
}
|
|
1037
1037
|
gt(e, t) {
|
|
1038
|
-
return this.setLimit("min", e, !1,
|
|
1038
|
+
return this.setLimit("min", e, !1, R.toString(t));
|
|
1039
1039
|
}
|
|
1040
1040
|
lte(e, t) {
|
|
1041
|
-
return this.setLimit("max", e, !0,
|
|
1041
|
+
return this.setLimit("max", e, !0, R.toString(t));
|
|
1042
1042
|
}
|
|
1043
1043
|
lt(e, t) {
|
|
1044
|
-
return this.setLimit("max", e, !1,
|
|
1044
|
+
return this.setLimit("max", e, !1, R.toString(t));
|
|
1045
1045
|
}
|
|
1046
1046
|
setLimit(t, n, r, i) {
|
|
1047
1047
|
return new e({
|
|
@@ -1050,7 +1050,7 @@ var mt = class e extends B {
|
|
|
1050
1050
|
kind: t,
|
|
1051
1051
|
value: n,
|
|
1052
1052
|
inclusive: r,
|
|
1053
|
-
message:
|
|
1053
|
+
message: R.toString(i)
|
|
1054
1054
|
}]
|
|
1055
1055
|
});
|
|
1056
1056
|
}
|
|
@@ -1063,7 +1063,7 @@ var mt = class e extends B {
|
|
|
1063
1063
|
int(e) {
|
|
1064
1064
|
return this._addCheck({
|
|
1065
1065
|
kind: "int",
|
|
1066
|
-
message:
|
|
1066
|
+
message: R.toString(e)
|
|
1067
1067
|
});
|
|
1068
1068
|
}
|
|
1069
1069
|
positive(e) {
|
|
@@ -1071,7 +1071,7 @@ var mt = class e extends B {
|
|
|
1071
1071
|
kind: "min",
|
|
1072
1072
|
value: 0,
|
|
1073
1073
|
inclusive: !1,
|
|
1074
|
-
message:
|
|
1074
|
+
message: R.toString(e)
|
|
1075
1075
|
});
|
|
1076
1076
|
}
|
|
1077
1077
|
negative(e) {
|
|
@@ -1079,7 +1079,7 @@ var mt = class e extends B {
|
|
|
1079
1079
|
kind: "max",
|
|
1080
1080
|
value: 0,
|
|
1081
1081
|
inclusive: !1,
|
|
1082
|
-
message:
|
|
1082
|
+
message: R.toString(e)
|
|
1083
1083
|
});
|
|
1084
1084
|
}
|
|
1085
1085
|
nonpositive(e) {
|
|
@@ -1087,7 +1087,7 @@ var mt = class e extends B {
|
|
|
1087
1087
|
kind: "max",
|
|
1088
1088
|
value: 0,
|
|
1089
1089
|
inclusive: !0,
|
|
1090
|
-
message:
|
|
1090
|
+
message: R.toString(e)
|
|
1091
1091
|
});
|
|
1092
1092
|
}
|
|
1093
1093
|
nonnegative(e) {
|
|
@@ -1095,20 +1095,20 @@ var mt = class e extends B {
|
|
|
1095
1095
|
kind: "min",
|
|
1096
1096
|
value: 0,
|
|
1097
1097
|
inclusive: !0,
|
|
1098
|
-
message:
|
|
1098
|
+
message: R.toString(e)
|
|
1099
1099
|
});
|
|
1100
1100
|
}
|
|
1101
1101
|
multipleOf(e, t) {
|
|
1102
1102
|
return this._addCheck({
|
|
1103
1103
|
kind: "multipleOf",
|
|
1104
1104
|
value: e,
|
|
1105
|
-
message:
|
|
1105
|
+
message: R.toString(t)
|
|
1106
1106
|
});
|
|
1107
1107
|
}
|
|
1108
1108
|
finite(e) {
|
|
1109
1109
|
return this._addCheck({
|
|
1110
1110
|
kind: "finite",
|
|
1111
|
-
message:
|
|
1111
|
+
message: R.toString(e)
|
|
1112
1112
|
});
|
|
1113
1113
|
}
|
|
1114
1114
|
safe(e) {
|
|
@@ -1116,12 +1116,12 @@ var mt = class e extends B {
|
|
|
1116
1116
|
kind: "min",
|
|
1117
1117
|
inclusive: !0,
|
|
1118
1118
|
value: -(2 ** 53 - 1),
|
|
1119
|
-
message:
|
|
1119
|
+
message: R.toString(e)
|
|
1120
1120
|
})._addCheck({
|
|
1121
1121
|
kind: "max",
|
|
1122
1122
|
inclusive: !0,
|
|
1123
1123
|
value: 2 ** 53 - 1,
|
|
1124
|
-
message:
|
|
1124
|
+
message: R.toString(e)
|
|
1125
1125
|
});
|
|
1126
1126
|
}
|
|
1127
1127
|
get minValue() {
|
|
@@ -1144,13 +1144,13 @@ var mt = class e extends B {
|
|
|
1144
1144
|
return Number.isFinite(t) && Number.isFinite(e);
|
|
1145
1145
|
}
|
|
1146
1146
|
};
|
|
1147
|
-
|
|
1147
|
+
pt.create = (e) => new pt({
|
|
1148
1148
|
checks: [],
|
|
1149
1149
|
typeName: G.ZodNumber,
|
|
1150
1150
|
coerce: e?.coerce || !1,
|
|
1151
|
-
...
|
|
1151
|
+
...B(e)
|
|
1152
1152
|
});
|
|
1153
|
-
var
|
|
1153
|
+
var mt = class e extends V {
|
|
1154
1154
|
constructor() {
|
|
1155
1155
|
super(...arguments), this.min = this.gte, this.max = this.lte;
|
|
1156
1156
|
}
|
|
@@ -1161,20 +1161,20 @@ var ht = class e extends B {
|
|
|
1161
1161
|
return this._getInvalidInput(e);
|
|
1162
1162
|
}
|
|
1163
1163
|
if (this._getType(e) !== b.bigint) return this._getInvalidInput(e);
|
|
1164
|
-
let t, n = new
|
|
1165
|
-
for (let r of this._def.checks) r.kind === "min" ? (r.inclusive ? e.data < r.value : e.data <= r.value) && (t = this._getOrReturnCtx(e, t),
|
|
1164
|
+
let t, n = new F();
|
|
1165
|
+
for (let r of this._def.checks) r.kind === "min" ? (r.inclusive ? e.data < r.value : e.data <= r.value) && (t = this._getOrReturnCtx(e, t), P(t, {
|
|
1166
1166
|
code: y.too_small,
|
|
1167
1167
|
type: "bigint",
|
|
1168
1168
|
minimum: r.value,
|
|
1169
1169
|
inclusive: r.inclusive,
|
|
1170
1170
|
message: r.message
|
|
1171
|
-
}), n.dirty()) : r.kind === "max" ? (r.inclusive ? e.data > r.value : e.data >= r.value) && (t = this._getOrReturnCtx(e, t),
|
|
1171
|
+
}), n.dirty()) : r.kind === "max" ? (r.inclusive ? e.data > r.value : e.data >= r.value) && (t = this._getOrReturnCtx(e, t), P(t, {
|
|
1172
1172
|
code: y.too_big,
|
|
1173
1173
|
type: "bigint",
|
|
1174
1174
|
maximum: r.value,
|
|
1175
1175
|
inclusive: r.inclusive,
|
|
1176
1176
|
message: r.message
|
|
1177
|
-
}), n.dirty()) : r.kind === "multipleOf" ? e.data % r.value !== BigInt(0) && (t = this._getOrReturnCtx(e, t),
|
|
1177
|
+
}), n.dirty()) : r.kind === "multipleOf" ? e.data % r.value !== BigInt(0) && (t = this._getOrReturnCtx(e, t), P(t, {
|
|
1178
1178
|
code: y.not_multiple_of,
|
|
1179
1179
|
multipleOf: r.value,
|
|
1180
1180
|
message: r.message
|
|
@@ -1186,23 +1186,23 @@ var ht = class e extends B {
|
|
|
1186
1186
|
}
|
|
1187
1187
|
_getInvalidInput(e) {
|
|
1188
1188
|
let t = this._getOrReturnCtx(e);
|
|
1189
|
-
return
|
|
1189
|
+
return P(t, {
|
|
1190
1190
|
code: y.invalid_type,
|
|
1191
1191
|
expected: b.bigint,
|
|
1192
1192
|
received: t.parsedType
|
|
1193
|
-
}),
|
|
1193
|
+
}), I;
|
|
1194
1194
|
}
|
|
1195
1195
|
gte(e, t) {
|
|
1196
|
-
return this.setLimit("min", e, !0,
|
|
1196
|
+
return this.setLimit("min", e, !0, R.toString(t));
|
|
1197
1197
|
}
|
|
1198
1198
|
gt(e, t) {
|
|
1199
|
-
return this.setLimit("min", e, !1,
|
|
1199
|
+
return this.setLimit("min", e, !1, R.toString(t));
|
|
1200
1200
|
}
|
|
1201
1201
|
lte(e, t) {
|
|
1202
|
-
return this.setLimit("max", e, !0,
|
|
1202
|
+
return this.setLimit("max", e, !0, R.toString(t));
|
|
1203
1203
|
}
|
|
1204
1204
|
lt(e, t) {
|
|
1205
|
-
return this.setLimit("max", e, !1,
|
|
1205
|
+
return this.setLimit("max", e, !1, R.toString(t));
|
|
1206
1206
|
}
|
|
1207
1207
|
setLimit(t, n, r, i) {
|
|
1208
1208
|
return new e({
|
|
@@ -1211,7 +1211,7 @@ var ht = class e extends B {
|
|
|
1211
1211
|
kind: t,
|
|
1212
1212
|
value: n,
|
|
1213
1213
|
inclusive: r,
|
|
1214
|
-
message:
|
|
1214
|
+
message: R.toString(i)
|
|
1215
1215
|
}]
|
|
1216
1216
|
});
|
|
1217
1217
|
}
|
|
@@ -1226,7 +1226,7 @@ var ht = class e extends B {
|
|
|
1226
1226
|
kind: "min",
|
|
1227
1227
|
value: BigInt(0),
|
|
1228
1228
|
inclusive: !1,
|
|
1229
|
-
message:
|
|
1229
|
+
message: R.toString(e)
|
|
1230
1230
|
});
|
|
1231
1231
|
}
|
|
1232
1232
|
negative(e) {
|
|
@@ -1234,7 +1234,7 @@ var ht = class e extends B {
|
|
|
1234
1234
|
kind: "max",
|
|
1235
1235
|
value: BigInt(0),
|
|
1236
1236
|
inclusive: !1,
|
|
1237
|
-
message:
|
|
1237
|
+
message: R.toString(e)
|
|
1238
1238
|
});
|
|
1239
1239
|
}
|
|
1240
1240
|
nonpositive(e) {
|
|
@@ -1242,7 +1242,7 @@ var ht = class e extends B {
|
|
|
1242
1242
|
kind: "max",
|
|
1243
1243
|
value: BigInt(0),
|
|
1244
1244
|
inclusive: !0,
|
|
1245
|
-
message:
|
|
1245
|
+
message: R.toString(e)
|
|
1246
1246
|
});
|
|
1247
1247
|
}
|
|
1248
1248
|
nonnegative(e) {
|
|
@@ -1250,14 +1250,14 @@ var ht = class e extends B {
|
|
|
1250
1250
|
kind: "min",
|
|
1251
1251
|
value: BigInt(0),
|
|
1252
1252
|
inclusive: !0,
|
|
1253
|
-
message:
|
|
1253
|
+
message: R.toString(e)
|
|
1254
1254
|
});
|
|
1255
1255
|
}
|
|
1256
1256
|
multipleOf(e, t) {
|
|
1257
1257
|
return this._addCheck({
|
|
1258
1258
|
kind: "multipleOf",
|
|
1259
1259
|
value: e,
|
|
1260
|
-
message:
|
|
1260
|
+
message: R.toString(t)
|
|
1261
1261
|
});
|
|
1262
1262
|
}
|
|
1263
1263
|
get minValue() {
|
|
@@ -1271,50 +1271,50 @@ var ht = class e extends B {
|
|
|
1271
1271
|
return e;
|
|
1272
1272
|
}
|
|
1273
1273
|
};
|
|
1274
|
-
|
|
1274
|
+
mt.create = (e) => new mt({
|
|
1275
1275
|
checks: [],
|
|
1276
1276
|
typeName: G.ZodBigInt,
|
|
1277
1277
|
coerce: e?.coerce ?? !1,
|
|
1278
|
-
...
|
|
1278
|
+
...B(e)
|
|
1279
1279
|
});
|
|
1280
|
-
var
|
|
1280
|
+
var ht = class extends V {
|
|
1281
1281
|
_parse(e) {
|
|
1282
1282
|
if (this._def.coerce && (e.data = !!e.data), this._getType(e) !== b.boolean) {
|
|
1283
1283
|
let t = this._getOrReturnCtx(e);
|
|
1284
|
-
return
|
|
1284
|
+
return P(t, {
|
|
1285
1285
|
code: y.invalid_type,
|
|
1286
1286
|
expected: b.boolean,
|
|
1287
1287
|
received: t.parsedType
|
|
1288
|
-
}),
|
|
1288
|
+
}), I;
|
|
1289
1289
|
}
|
|
1290
|
-
return
|
|
1290
|
+
return L(e.data);
|
|
1291
1291
|
}
|
|
1292
1292
|
};
|
|
1293
|
-
|
|
1293
|
+
ht.create = (e) => new ht({
|
|
1294
1294
|
typeName: G.ZodBoolean,
|
|
1295
1295
|
coerce: e?.coerce || !1,
|
|
1296
|
-
...
|
|
1296
|
+
...B(e)
|
|
1297
1297
|
});
|
|
1298
|
-
var
|
|
1298
|
+
var gt = class e extends V {
|
|
1299
1299
|
_parse(e) {
|
|
1300
1300
|
if (this._def.coerce && (e.data = new Date(e.data)), this._getType(e) !== b.date) {
|
|
1301
1301
|
let t = this._getOrReturnCtx(e);
|
|
1302
|
-
return
|
|
1302
|
+
return P(t, {
|
|
1303
1303
|
code: y.invalid_type,
|
|
1304
1304
|
expected: b.date,
|
|
1305
1305
|
received: t.parsedType
|
|
1306
|
-
}),
|
|
1306
|
+
}), I;
|
|
1307
1307
|
}
|
|
1308
|
-
if (Number.isNaN(e.data.getTime())) return
|
|
1309
|
-
let t = new
|
|
1310
|
-
for (let r of this._def.checks) r.kind === "min" ? e.data.getTime() < r.value && (n = this._getOrReturnCtx(e, n),
|
|
1308
|
+
if (Number.isNaN(e.data.getTime())) return P(this._getOrReturnCtx(e), { code: y.invalid_date }), I;
|
|
1309
|
+
let t = new F(), n;
|
|
1310
|
+
for (let r of this._def.checks) r.kind === "min" ? e.data.getTime() < r.value && (n = this._getOrReturnCtx(e, n), P(n, {
|
|
1311
1311
|
code: y.too_small,
|
|
1312
1312
|
message: r.message,
|
|
1313
1313
|
inclusive: !0,
|
|
1314
1314
|
exact: !1,
|
|
1315
1315
|
minimum: r.value,
|
|
1316
1316
|
type: "date"
|
|
1317
|
-
}), t.dirty()) : r.kind === "max" ? e.data.getTime() > r.value && (n = this._getOrReturnCtx(e, n),
|
|
1317
|
+
}), t.dirty()) : r.kind === "max" ? e.data.getTime() > r.value && (n = this._getOrReturnCtx(e, n), P(n, {
|
|
1318
1318
|
code: y.too_big,
|
|
1319
1319
|
message: r.message,
|
|
1320
1320
|
inclusive: !0,
|
|
@@ -1337,14 +1337,14 @@ var _t = class e extends B {
|
|
|
1337
1337
|
return this._addCheck({
|
|
1338
1338
|
kind: "min",
|
|
1339
1339
|
value: e.getTime(),
|
|
1340
|
-
message:
|
|
1340
|
+
message: R.toString(t)
|
|
1341
1341
|
});
|
|
1342
1342
|
}
|
|
1343
1343
|
max(e, t) {
|
|
1344
1344
|
return this._addCheck({
|
|
1345
1345
|
kind: "max",
|
|
1346
1346
|
value: e.getTime(),
|
|
1347
|
-
message:
|
|
1347
|
+
message: R.toString(t)
|
|
1348
1348
|
});
|
|
1349
1349
|
}
|
|
1350
1350
|
get minDate() {
|
|
@@ -1358,129 +1358,129 @@ var _t = class e extends B {
|
|
|
1358
1358
|
return e == null ? null : new Date(e);
|
|
1359
1359
|
}
|
|
1360
1360
|
};
|
|
1361
|
-
|
|
1361
|
+
gt.create = (e) => new gt({
|
|
1362
1362
|
checks: [],
|
|
1363
1363
|
coerce: e?.coerce || !1,
|
|
1364
1364
|
typeName: G.ZodDate,
|
|
1365
|
-
...
|
|
1365
|
+
...B(e)
|
|
1366
1366
|
});
|
|
1367
|
-
var
|
|
1367
|
+
var _t = class extends V {
|
|
1368
1368
|
_parse(e) {
|
|
1369
1369
|
if (this._getType(e) !== b.symbol) {
|
|
1370
1370
|
let t = this._getOrReturnCtx(e);
|
|
1371
|
-
return
|
|
1371
|
+
return P(t, {
|
|
1372
1372
|
code: y.invalid_type,
|
|
1373
1373
|
expected: b.symbol,
|
|
1374
1374
|
received: t.parsedType
|
|
1375
|
-
}),
|
|
1375
|
+
}), I;
|
|
1376
1376
|
}
|
|
1377
|
-
return
|
|
1377
|
+
return L(e.data);
|
|
1378
1378
|
}
|
|
1379
1379
|
};
|
|
1380
|
-
|
|
1380
|
+
_t.create = (e) => new _t({
|
|
1381
1381
|
typeName: G.ZodSymbol,
|
|
1382
|
-
...
|
|
1382
|
+
...B(e)
|
|
1383
1383
|
});
|
|
1384
|
-
var
|
|
1384
|
+
var vt = class extends V {
|
|
1385
1385
|
_parse(e) {
|
|
1386
1386
|
if (this._getType(e) !== b.undefined) {
|
|
1387
1387
|
let t = this._getOrReturnCtx(e);
|
|
1388
|
-
return
|
|
1388
|
+
return P(t, {
|
|
1389
1389
|
code: y.invalid_type,
|
|
1390
1390
|
expected: b.undefined,
|
|
1391
1391
|
received: t.parsedType
|
|
1392
|
-
}),
|
|
1392
|
+
}), I;
|
|
1393
1393
|
}
|
|
1394
|
-
return
|
|
1394
|
+
return L(e.data);
|
|
1395
1395
|
}
|
|
1396
1396
|
};
|
|
1397
|
-
|
|
1397
|
+
vt.create = (e) => new vt({
|
|
1398
1398
|
typeName: G.ZodUndefined,
|
|
1399
|
-
...
|
|
1399
|
+
...B(e)
|
|
1400
1400
|
});
|
|
1401
|
-
var
|
|
1401
|
+
var yt = class extends V {
|
|
1402
1402
|
_parse(e) {
|
|
1403
1403
|
if (this._getType(e) !== b.null) {
|
|
1404
1404
|
let t = this._getOrReturnCtx(e);
|
|
1405
|
-
return
|
|
1405
|
+
return P(t, {
|
|
1406
1406
|
code: y.invalid_type,
|
|
1407
1407
|
expected: b.null,
|
|
1408
1408
|
received: t.parsedType
|
|
1409
|
-
}),
|
|
1409
|
+
}), I;
|
|
1410
1410
|
}
|
|
1411
|
-
return
|
|
1411
|
+
return L(e.data);
|
|
1412
1412
|
}
|
|
1413
1413
|
};
|
|
1414
|
-
|
|
1414
|
+
yt.create = (e) => new yt({
|
|
1415
1415
|
typeName: G.ZodNull,
|
|
1416
|
-
...
|
|
1416
|
+
...B(e)
|
|
1417
1417
|
});
|
|
1418
|
-
var
|
|
1418
|
+
var bt = class extends V {
|
|
1419
1419
|
constructor() {
|
|
1420
1420
|
super(...arguments), this._any = !0;
|
|
1421
1421
|
}
|
|
1422
1422
|
_parse(e) {
|
|
1423
|
-
return
|
|
1423
|
+
return L(e.data);
|
|
1424
1424
|
}
|
|
1425
1425
|
};
|
|
1426
|
-
|
|
1426
|
+
bt.create = (e) => new bt({
|
|
1427
1427
|
typeName: G.ZodAny,
|
|
1428
|
-
...
|
|
1428
|
+
...B(e)
|
|
1429
1429
|
});
|
|
1430
|
-
var
|
|
1430
|
+
var xt = class extends V {
|
|
1431
1431
|
constructor() {
|
|
1432
1432
|
super(...arguments), this._unknown = !0;
|
|
1433
1433
|
}
|
|
1434
1434
|
_parse(e) {
|
|
1435
|
-
return
|
|
1435
|
+
return L(e.data);
|
|
1436
1436
|
}
|
|
1437
1437
|
};
|
|
1438
|
-
|
|
1438
|
+
xt.create = (e) => new xt({
|
|
1439
1439
|
typeName: G.ZodUnknown,
|
|
1440
|
-
...
|
|
1440
|
+
...B(e)
|
|
1441
1441
|
});
|
|
1442
|
-
var
|
|
1442
|
+
var St = class extends V {
|
|
1443
1443
|
_parse(e) {
|
|
1444
1444
|
let t = this._getOrReturnCtx(e);
|
|
1445
|
-
return
|
|
1445
|
+
return P(t, {
|
|
1446
1446
|
code: y.invalid_type,
|
|
1447
1447
|
expected: b.never,
|
|
1448
1448
|
received: t.parsedType
|
|
1449
|
-
}),
|
|
1449
|
+
}), I;
|
|
1450
1450
|
}
|
|
1451
1451
|
};
|
|
1452
|
-
|
|
1452
|
+
St.create = (e) => new St({
|
|
1453
1453
|
typeName: G.ZodNever,
|
|
1454
|
-
...
|
|
1454
|
+
...B(e)
|
|
1455
1455
|
});
|
|
1456
|
-
var
|
|
1456
|
+
var Ct = class extends V {
|
|
1457
1457
|
_parse(e) {
|
|
1458
1458
|
if (this._getType(e) !== b.undefined) {
|
|
1459
1459
|
let t = this._getOrReturnCtx(e);
|
|
1460
|
-
return
|
|
1460
|
+
return P(t, {
|
|
1461
1461
|
code: y.invalid_type,
|
|
1462
1462
|
expected: b.void,
|
|
1463
1463
|
received: t.parsedType
|
|
1464
|
-
}),
|
|
1464
|
+
}), I;
|
|
1465
1465
|
}
|
|
1466
|
-
return
|
|
1466
|
+
return L(e.data);
|
|
1467
1467
|
}
|
|
1468
1468
|
};
|
|
1469
|
-
|
|
1469
|
+
Ct.create = (e) => new Ct({
|
|
1470
1470
|
typeName: G.ZodVoid,
|
|
1471
|
-
...
|
|
1471
|
+
...B(e)
|
|
1472
1472
|
});
|
|
1473
|
-
var
|
|
1473
|
+
var wt = class e extends V {
|
|
1474
1474
|
_parse(e) {
|
|
1475
1475
|
let { ctx: t, status: n } = this._processInputParams(e), r = this._def;
|
|
1476
|
-
if (t.parsedType !== b.array) return
|
|
1476
|
+
if (t.parsedType !== b.array) return P(t, {
|
|
1477
1477
|
code: y.invalid_type,
|
|
1478
1478
|
expected: b.array,
|
|
1479
1479
|
received: t.parsedType
|
|
1480
|
-
}),
|
|
1480
|
+
}), I;
|
|
1481
1481
|
if (r.exactLength !== null) {
|
|
1482
1482
|
let e = t.data.length > r.exactLength.value, i = t.data.length < r.exactLength.value;
|
|
1483
|
-
(e || i) && (
|
|
1483
|
+
(e || i) && (P(t, {
|
|
1484
1484
|
code: e ? y.too_big : y.too_small,
|
|
1485
1485
|
minimum: i ? r.exactLength.value : void 0,
|
|
1486
1486
|
maximum: e ? r.exactLength.value : void 0,
|
|
@@ -1490,23 +1490,23 @@ var Tt = class e extends B {
|
|
|
1490
1490
|
message: r.exactLength.message
|
|
1491
1491
|
}), n.dirty());
|
|
1492
1492
|
}
|
|
1493
|
-
if (r.minLength !== null && t.data.length < r.minLength.value && (
|
|
1493
|
+
if (r.minLength !== null && t.data.length < r.minLength.value && (P(t, {
|
|
1494
1494
|
code: y.too_small,
|
|
1495
1495
|
minimum: r.minLength.value,
|
|
1496
1496
|
type: "array",
|
|
1497
1497
|
inclusive: !0,
|
|
1498
1498
|
exact: !1,
|
|
1499
1499
|
message: r.minLength.message
|
|
1500
|
-
}), n.dirty()), r.maxLength !== null && t.data.length > r.maxLength.value && (
|
|
1500
|
+
}), n.dirty()), r.maxLength !== null && t.data.length > r.maxLength.value && (P(t, {
|
|
1501
1501
|
code: y.too_big,
|
|
1502
1502
|
maximum: r.maxLength.value,
|
|
1503
1503
|
type: "array",
|
|
1504
1504
|
inclusive: !0,
|
|
1505
1505
|
exact: !1,
|
|
1506
1506
|
message: r.maxLength.message
|
|
1507
|
-
}), n.dirty()), t.common.async) return Promise.all([...t.data].map((e, n) => r.type._parseAsync(new
|
|
1508
|
-
let i = [...t.data].map((e, n) => r.type._parseSync(new
|
|
1509
|
-
return
|
|
1507
|
+
}), n.dirty()), t.common.async) return Promise.all([...t.data].map((e, n) => r.type._parseAsync(new z(t, e, t.path, n)))).then((e) => F.mergeArray(n, e));
|
|
1508
|
+
let i = [...t.data].map((e, n) => r.type._parseSync(new z(t, e, t.path, n)));
|
|
1509
|
+
return F.mergeArray(n, i);
|
|
1510
1510
|
}
|
|
1511
1511
|
get element() {
|
|
1512
1512
|
return this._def.type;
|
|
@@ -1516,7 +1516,7 @@ var Tt = class e extends B {
|
|
|
1516
1516
|
...this._def,
|
|
1517
1517
|
minLength: {
|
|
1518
1518
|
value: t,
|
|
1519
|
-
message:
|
|
1519
|
+
message: R.toString(n)
|
|
1520
1520
|
}
|
|
1521
1521
|
});
|
|
1522
1522
|
}
|
|
@@ -1525,7 +1525,7 @@ var Tt = class e extends B {
|
|
|
1525
1525
|
...this._def,
|
|
1526
1526
|
maxLength: {
|
|
1527
1527
|
value: t,
|
|
1528
|
-
message:
|
|
1528
|
+
message: R.toString(n)
|
|
1529
1529
|
}
|
|
1530
1530
|
});
|
|
1531
1531
|
}
|
|
@@ -1534,7 +1534,7 @@ var Tt = class e extends B {
|
|
|
1534
1534
|
...this._def,
|
|
1535
1535
|
exactLength: {
|
|
1536
1536
|
value: t,
|
|
1537
|
-
message:
|
|
1537
|
+
message: R.toString(n)
|
|
1538
1538
|
}
|
|
1539
1539
|
});
|
|
1540
1540
|
}
|
|
@@ -1542,35 +1542,35 @@ var Tt = class e extends B {
|
|
|
1542
1542
|
return this.min(1, e);
|
|
1543
1543
|
}
|
|
1544
1544
|
};
|
|
1545
|
-
|
|
1545
|
+
wt.create = (e, t) => new wt({
|
|
1546
1546
|
type: e,
|
|
1547
1547
|
minLength: null,
|
|
1548
1548
|
maxLength: null,
|
|
1549
1549
|
exactLength: null,
|
|
1550
1550
|
typeName: G.ZodArray,
|
|
1551
|
-
...
|
|
1551
|
+
...B(t)
|
|
1552
1552
|
});
|
|
1553
|
-
function
|
|
1554
|
-
if (e instanceof
|
|
1553
|
+
function Tt(e) {
|
|
1554
|
+
if (e instanceof H) {
|
|
1555
1555
|
let t = {};
|
|
1556
1556
|
for (let n in e.shape) {
|
|
1557
1557
|
let r = e.shape[n];
|
|
1558
|
-
t[n] = W.create(
|
|
1558
|
+
t[n] = W.create(Tt(r));
|
|
1559
1559
|
}
|
|
1560
|
-
return new
|
|
1560
|
+
return new H({
|
|
1561
1561
|
...e._def,
|
|
1562
1562
|
shape: () => t
|
|
1563
1563
|
});
|
|
1564
|
-
} else if (e instanceof
|
|
1564
|
+
} else if (e instanceof wt) return new wt({
|
|
1565
1565
|
...e._def,
|
|
1566
|
-
type:
|
|
1566
|
+
type: Tt(e.element)
|
|
1567
1567
|
});
|
|
1568
|
-
else if (e instanceof W) return W.create(
|
|
1569
|
-
else if (e instanceof Ht) return Ht.create(
|
|
1570
|
-
else if (e instanceof jt) return jt.create(e.items.map((e) =>
|
|
1568
|
+
else if (e instanceof W) return W.create(Tt(e.unwrap()));
|
|
1569
|
+
else if (e instanceof Ht) return Ht.create(Tt(e.unwrap()));
|
|
1570
|
+
else if (e instanceof jt) return jt.create(e.items.map((e) => Tt(e)));
|
|
1571
1571
|
else return e;
|
|
1572
1572
|
}
|
|
1573
|
-
var
|
|
1573
|
+
var H = class e extends V {
|
|
1574
1574
|
constructor() {
|
|
1575
1575
|
super(...arguments), this._cached = null, this.nonstrict = this.passthrough, this.augment = this.extend;
|
|
1576
1576
|
}
|
|
@@ -1585,14 +1585,14 @@ var V = class e extends B {
|
|
|
1585
1585
|
_parse(e) {
|
|
1586
1586
|
if (this._getType(e) !== b.object) {
|
|
1587
1587
|
let t = this._getOrReturnCtx(e);
|
|
1588
|
-
return
|
|
1588
|
+
return P(t, {
|
|
1589
1589
|
code: y.invalid_type,
|
|
1590
1590
|
expected: b.object,
|
|
1591
1591
|
received: t.parsedType
|
|
1592
|
-
}),
|
|
1592
|
+
}), I;
|
|
1593
1593
|
}
|
|
1594
1594
|
let { status: t, ctx: n } = this._processInputParams(e), { shape: r, keys: i } = this._getCached(), a = [];
|
|
1595
|
-
if (!(this._def.catchall instanceof
|
|
1595
|
+
if (!(this._def.catchall instanceof St && this._def.unknownKeys === "strip")) for (let e in n.data) i.includes(e) || a.push(e);
|
|
1596
1596
|
let o = [];
|
|
1597
1597
|
for (let e of i) {
|
|
1598
1598
|
let t = r[e], i = n.data[e];
|
|
@@ -1601,11 +1601,11 @@ var V = class e extends B {
|
|
|
1601
1601
|
status: "valid",
|
|
1602
1602
|
value: e
|
|
1603
1603
|
},
|
|
1604
|
-
value: t._parse(new
|
|
1604
|
+
value: t._parse(new z(n, i, n.path, e)),
|
|
1605
1605
|
alwaysSet: e in n.data
|
|
1606
1606
|
});
|
|
1607
1607
|
}
|
|
1608
|
-
if (this._def.catchall instanceof
|
|
1608
|
+
if (this._def.catchall instanceof St) {
|
|
1609
1609
|
let e = this._def.unknownKeys;
|
|
1610
1610
|
if (e === "passthrough") for (let e of a) o.push({
|
|
1611
1611
|
key: {
|
|
@@ -1617,7 +1617,7 @@ var V = class e extends B {
|
|
|
1617
1617
|
value: n.data[e]
|
|
1618
1618
|
}
|
|
1619
1619
|
});
|
|
1620
|
-
else if (e === "strict") a.length > 0 && (
|
|
1620
|
+
else if (e === "strict") a.length > 0 && (P(n, {
|
|
1621
1621
|
code: y.unrecognized_keys,
|
|
1622
1622
|
keys: a
|
|
1623
1623
|
}), t.dirty());
|
|
@@ -1631,7 +1631,7 @@ var V = class e extends B {
|
|
|
1631
1631
|
status: "valid",
|
|
1632
1632
|
value: t
|
|
1633
1633
|
},
|
|
1634
|
-
value: e._parse(new
|
|
1634
|
+
value: e._parse(new z(n, r, n.path, t)),
|
|
1635
1635
|
alwaysSet: t in n.data
|
|
1636
1636
|
});
|
|
1637
1637
|
}
|
|
@@ -1647,18 +1647,18 @@ var V = class e extends B {
|
|
|
1647
1647
|
});
|
|
1648
1648
|
}
|
|
1649
1649
|
return e;
|
|
1650
|
-
}).then((e) =>
|
|
1650
|
+
}).then((e) => F.mergeObjectSync(t, e)) : F.mergeObjectSync(t, o);
|
|
1651
1651
|
}
|
|
1652
1652
|
get shape() {
|
|
1653
1653
|
return this._def.shape();
|
|
1654
1654
|
}
|
|
1655
1655
|
strict(t) {
|
|
1656
|
-
return
|
|
1656
|
+
return R.errToObj, new e({
|
|
1657
1657
|
...this._def,
|
|
1658
1658
|
unknownKeys: "strict",
|
|
1659
1659
|
...t === void 0 ? {} : { errorMap: (e, n) => {
|
|
1660
1660
|
let r = this._def.errorMap?.(e, n).message ?? n.defaultError;
|
|
1661
|
-
return e.code === "unrecognized_keys" ? { message:
|
|
1661
|
+
return e.code === "unrecognized_keys" ? { message: R.errToObj(t).message ?? r } : { message: r };
|
|
1662
1662
|
} }
|
|
1663
1663
|
});
|
|
1664
1664
|
}
|
|
@@ -1720,7 +1720,7 @@ var V = class e extends B {
|
|
|
1720
1720
|
});
|
|
1721
1721
|
}
|
|
1722
1722
|
deepPartial() {
|
|
1723
|
-
return
|
|
1723
|
+
return Tt(this);
|
|
1724
1724
|
}
|
|
1725
1725
|
partial(t) {
|
|
1726
1726
|
let n = {};
|
|
@@ -1750,36 +1750,36 @@ var V = class e extends B {
|
|
|
1750
1750
|
return Rt(_.objectKeys(this.shape));
|
|
1751
1751
|
}
|
|
1752
1752
|
};
|
|
1753
|
-
|
|
1753
|
+
H.create = (e, t) => new H({
|
|
1754
1754
|
shape: () => e,
|
|
1755
1755
|
unknownKeys: "strip",
|
|
1756
|
-
catchall:
|
|
1756
|
+
catchall: St.create(),
|
|
1757
1757
|
typeName: G.ZodObject,
|
|
1758
|
-
...
|
|
1759
|
-
}),
|
|
1758
|
+
...B(t)
|
|
1759
|
+
}), H.strictCreate = (e, t) => new H({
|
|
1760
1760
|
shape: () => e,
|
|
1761
1761
|
unknownKeys: "strict",
|
|
1762
|
-
catchall:
|
|
1762
|
+
catchall: St.create(),
|
|
1763
1763
|
typeName: G.ZodObject,
|
|
1764
|
-
...
|
|
1765
|
-
}),
|
|
1764
|
+
...B(t)
|
|
1765
|
+
}), H.lazycreate = (e, t) => new H({
|
|
1766
1766
|
shape: e,
|
|
1767
1767
|
unknownKeys: "strip",
|
|
1768
|
-
catchall:
|
|
1768
|
+
catchall: St.create(),
|
|
1769
1769
|
typeName: G.ZodObject,
|
|
1770
|
-
...
|
|
1770
|
+
...B(t)
|
|
1771
1771
|
});
|
|
1772
|
-
var
|
|
1772
|
+
var Et = class extends V {
|
|
1773
1773
|
_parse(e) {
|
|
1774
1774
|
let { ctx: t } = this._processInputParams(e), n = this._def.options;
|
|
1775
1775
|
function r(e) {
|
|
1776
1776
|
for (let t of e) if (t.result.status === "valid") return t.result;
|
|
1777
1777
|
for (let n of e) if (n.result.status === "dirty") return t.common.issues.push(...n.ctx.common.issues), n.result;
|
|
1778
1778
|
let n = e.map((e) => new x(e.ctx.common.issues));
|
|
1779
|
-
return
|
|
1779
|
+
return P(t, {
|
|
1780
1780
|
code: y.invalid_union,
|
|
1781
1781
|
unionErrors: n
|
|
1782
|
-
}),
|
|
1782
|
+
}), I;
|
|
1783
1783
|
}
|
|
1784
1784
|
if (t.common.async) return Promise.all(n.map(async (e) => {
|
|
1785
1785
|
let n = {
|
|
@@ -1822,29 +1822,29 @@ var Dt = class extends B {
|
|
|
1822
1822
|
}
|
|
1823
1823
|
if (e) return t.common.issues.push(...e.ctx.common.issues), e.result;
|
|
1824
1824
|
let i = r.map((e) => new x(e));
|
|
1825
|
-
return
|
|
1825
|
+
return P(t, {
|
|
1826
1826
|
code: y.invalid_union,
|
|
1827
1827
|
unionErrors: i
|
|
1828
|
-
}),
|
|
1828
|
+
}), I;
|
|
1829
1829
|
}
|
|
1830
1830
|
}
|
|
1831
1831
|
get options() {
|
|
1832
1832
|
return this._def.options;
|
|
1833
1833
|
}
|
|
1834
1834
|
};
|
|
1835
|
-
|
|
1835
|
+
Et.create = (e, t) => new Et({
|
|
1836
1836
|
options: e,
|
|
1837
1837
|
typeName: G.ZodUnion,
|
|
1838
|
-
...
|
|
1838
|
+
...B(t)
|
|
1839
1839
|
});
|
|
1840
|
-
var
|
|
1840
|
+
var Dt = (e) => e instanceof It ? Dt(e.schema) : e instanceof U ? Dt(e.innerType()) : e instanceof Lt ? [e.value] : e instanceof zt ? e.options : e instanceof Bt ? _.objectValues(e.enum) : e instanceof Ut ? Dt(e._def.innerType) : e instanceof vt ? [void 0] : e instanceof yt ? [null] : e instanceof W ? [void 0, ...Dt(e.unwrap())] : e instanceof Ht ? [null, ...Dt(e.unwrap())] : e instanceof Kt || e instanceof Jt ? Dt(e.unwrap()) : e instanceof Wt ? Dt(e._def.innerType) : [], Ot = class e extends V {
|
|
1841
1841
|
_parse(e) {
|
|
1842
1842
|
let { ctx: t } = this._processInputParams(e);
|
|
1843
|
-
if (t.parsedType !== b.object) return
|
|
1843
|
+
if (t.parsedType !== b.object) return P(t, {
|
|
1844
1844
|
code: y.invalid_type,
|
|
1845
1845
|
expected: b.object,
|
|
1846
1846
|
received: t.parsedType
|
|
1847
|
-
}),
|
|
1847
|
+
}), I;
|
|
1848
1848
|
let n = this.discriminator, r = t.data[n], i = this.optionsMap.get(r);
|
|
1849
1849
|
return i ? t.common.async ? i._parseAsync({
|
|
1850
1850
|
data: t.data,
|
|
@@ -1854,11 +1854,11 @@ var H = (e) => e instanceof It ? H(e.schema) : e instanceof U ? H(e.innerType())
|
|
|
1854
1854
|
data: t.data,
|
|
1855
1855
|
path: t.path,
|
|
1856
1856
|
parent: t
|
|
1857
|
-
}) : (
|
|
1857
|
+
}) : (P(t, {
|
|
1858
1858
|
code: y.invalid_union_discriminator,
|
|
1859
1859
|
options: Array.from(this.optionsMap.keys()),
|
|
1860
1860
|
path: [n]
|
|
1861
|
-
}),
|
|
1861
|
+
}), I);
|
|
1862
1862
|
}
|
|
1863
1863
|
get discriminator() {
|
|
1864
1864
|
return this._def.discriminator;
|
|
@@ -1872,7 +1872,7 @@ var H = (e) => e instanceof It ? H(e.schema) : e instanceof U ? H(e.innerType())
|
|
|
1872
1872
|
static create(t, n, r) {
|
|
1873
1873
|
let i = /* @__PURE__ */ new Map();
|
|
1874
1874
|
for (let e of n) {
|
|
1875
|
-
let n =
|
|
1875
|
+
let n = Dt(e.shape[t]);
|
|
1876
1876
|
if (!n.length) throw Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);
|
|
1877
1877
|
for (let r of n) {
|
|
1878
1878
|
if (i.has(r)) throw Error(`Discriminator property ${String(t)} has duplicate value ${String(r)}`);
|
|
@@ -1884,7 +1884,7 @@ var H = (e) => e instanceof It ? H(e.schema) : e instanceof U ? H(e.innerType())
|
|
|
1884
1884
|
discriminator: t,
|
|
1885
1885
|
options: n,
|
|
1886
1886
|
optionsMap: i,
|
|
1887
|
-
...
|
|
1887
|
+
...B(r)
|
|
1888
1888
|
});
|
|
1889
1889
|
}
|
|
1890
1890
|
};
|
|
@@ -1926,15 +1926,15 @@ function kt(e, t) {
|
|
|
1926
1926
|
};
|
|
1927
1927
|
else return { valid: !1 };
|
|
1928
1928
|
}
|
|
1929
|
-
var At = class extends
|
|
1929
|
+
var At = class extends V {
|
|
1930
1930
|
_parse(e) {
|
|
1931
1931
|
let { status: t, ctx: n } = this._processInputParams(e), r = (e, r) => {
|
|
1932
|
-
if (
|
|
1932
|
+
if (Ie(e) || Ie(r)) return I;
|
|
1933
1933
|
let i = kt(e.value, r.value);
|
|
1934
|
-
return i.valid ? ((
|
|
1934
|
+
return i.valid ? ((Le(e) || Le(r)) && t.dirty(), {
|
|
1935
1935
|
status: t.value,
|
|
1936
1936
|
value: i.data
|
|
1937
|
-
}) : (
|
|
1937
|
+
}) : (P(n, { code: y.invalid_intersection_types }), I);
|
|
1938
1938
|
};
|
|
1939
1939
|
return n.common.async ? Promise.all([this._def.left._parseAsync({
|
|
1940
1940
|
data: n.data,
|
|
@@ -1959,24 +1959,24 @@ At.create = (e, t, n) => new At({
|
|
|
1959
1959
|
left: e,
|
|
1960
1960
|
right: t,
|
|
1961
1961
|
typeName: G.ZodIntersection,
|
|
1962
|
-
...
|
|
1962
|
+
...B(n)
|
|
1963
1963
|
});
|
|
1964
|
-
var jt = class e extends
|
|
1964
|
+
var jt = class e extends V {
|
|
1965
1965
|
_parse(e) {
|
|
1966
1966
|
let { status: t, ctx: n } = this._processInputParams(e);
|
|
1967
|
-
if (n.parsedType !== b.array) return
|
|
1967
|
+
if (n.parsedType !== b.array) return P(n, {
|
|
1968
1968
|
code: y.invalid_type,
|
|
1969
1969
|
expected: b.array,
|
|
1970
1970
|
received: n.parsedType
|
|
1971
|
-
}),
|
|
1972
|
-
if (n.data.length < this._def.items.length) return
|
|
1971
|
+
}), I;
|
|
1972
|
+
if (n.data.length < this._def.items.length) return P(n, {
|
|
1973
1973
|
code: y.too_small,
|
|
1974
1974
|
minimum: this._def.items.length,
|
|
1975
1975
|
inclusive: !0,
|
|
1976
1976
|
exact: !1,
|
|
1977
1977
|
type: "array"
|
|
1978
|
-
}),
|
|
1979
|
-
!this._def.rest && n.data.length > this._def.items.length && (
|
|
1978
|
+
}), I;
|
|
1979
|
+
!this._def.rest && n.data.length > this._def.items.length && (P(n, {
|
|
1980
1980
|
code: y.too_big,
|
|
1981
1981
|
maximum: this._def.items.length,
|
|
1982
1982
|
inclusive: !0,
|
|
@@ -1985,9 +1985,9 @@ var jt = class e extends B {
|
|
|
1985
1985
|
}), t.dirty());
|
|
1986
1986
|
let r = [...n.data].map((e, t) => {
|
|
1987
1987
|
let r = this._def.items[t] || this._def.rest;
|
|
1988
|
-
return r ? r._parse(new
|
|
1988
|
+
return r ? r._parse(new z(n, e, n.path, t)) : null;
|
|
1989
1989
|
}).filter((e) => !!e);
|
|
1990
|
-
return n.common.async ? Promise.all(r).then((e) =>
|
|
1990
|
+
return n.common.async ? Promise.all(r).then((e) => F.mergeArray(t, e)) : F.mergeArray(t, r);
|
|
1991
1991
|
}
|
|
1992
1992
|
get items() {
|
|
1993
1993
|
return this._def.items;
|
|
@@ -2005,10 +2005,10 @@ jt.create = (e, t) => {
|
|
|
2005
2005
|
items: e,
|
|
2006
2006
|
typeName: G.ZodTuple,
|
|
2007
2007
|
rest: null,
|
|
2008
|
-
...
|
|
2008
|
+
...B(t)
|
|
2009
2009
|
});
|
|
2010
2010
|
};
|
|
2011
|
-
var Mt = class e extends
|
|
2011
|
+
var Mt = class e extends V {
|
|
2012
2012
|
get keySchema() {
|
|
2013
2013
|
return this._def.keyType;
|
|
2014
2014
|
}
|
|
@@ -2017,36 +2017,36 @@ var Mt = class e extends B {
|
|
|
2017
2017
|
}
|
|
2018
2018
|
_parse(e) {
|
|
2019
2019
|
let { status: t, ctx: n } = this._processInputParams(e);
|
|
2020
|
-
if (n.parsedType !== b.object) return
|
|
2020
|
+
if (n.parsedType !== b.object) return P(n, {
|
|
2021
2021
|
code: y.invalid_type,
|
|
2022
2022
|
expected: b.object,
|
|
2023
2023
|
received: n.parsedType
|
|
2024
|
-
}),
|
|
2024
|
+
}), I;
|
|
2025
2025
|
let r = [], i = this._def.keyType, a = this._def.valueType;
|
|
2026
2026
|
for (let e in n.data) r.push({
|
|
2027
|
-
key: i._parse(new
|
|
2028
|
-
value: a._parse(new
|
|
2027
|
+
key: i._parse(new z(n, e, n.path, e)),
|
|
2028
|
+
value: a._parse(new z(n, n.data[e], n.path, e)),
|
|
2029
2029
|
alwaysSet: e in n.data
|
|
2030
2030
|
});
|
|
2031
|
-
return n.common.async ?
|
|
2031
|
+
return n.common.async ? F.mergeObjectAsync(t, r) : F.mergeObjectSync(t, r);
|
|
2032
2032
|
}
|
|
2033
2033
|
get element() {
|
|
2034
2034
|
return this._def.valueType;
|
|
2035
2035
|
}
|
|
2036
2036
|
static create(t, n, r) {
|
|
2037
|
-
return n instanceof
|
|
2037
|
+
return n instanceof V ? new e({
|
|
2038
2038
|
keyType: t,
|
|
2039
2039
|
valueType: n,
|
|
2040
2040
|
typeName: G.ZodRecord,
|
|
2041
|
-
...
|
|
2041
|
+
...B(r)
|
|
2042
2042
|
}) : new e({
|
|
2043
|
-
keyType:
|
|
2043
|
+
keyType: dt.create(),
|
|
2044
2044
|
valueType: t,
|
|
2045
2045
|
typeName: G.ZodRecord,
|
|
2046
|
-
...
|
|
2046
|
+
...B(n)
|
|
2047
2047
|
});
|
|
2048
2048
|
}
|
|
2049
|
-
}, Nt = class extends
|
|
2049
|
+
}, Nt = class extends V {
|
|
2050
2050
|
get keySchema() {
|
|
2051
2051
|
return this._def.keyType;
|
|
2052
2052
|
}
|
|
@@ -2055,21 +2055,21 @@ var Mt = class e extends B {
|
|
|
2055
2055
|
}
|
|
2056
2056
|
_parse(e) {
|
|
2057
2057
|
let { status: t, ctx: n } = this._processInputParams(e);
|
|
2058
|
-
if (n.parsedType !== b.map) return
|
|
2058
|
+
if (n.parsedType !== b.map) return P(n, {
|
|
2059
2059
|
code: y.invalid_type,
|
|
2060
2060
|
expected: b.map,
|
|
2061
2061
|
received: n.parsedType
|
|
2062
|
-
}),
|
|
2062
|
+
}), I;
|
|
2063
2063
|
let r = this._def.keyType, i = this._def.valueType, a = [...n.data.entries()].map(([e, t], a) => ({
|
|
2064
|
-
key: r._parse(new
|
|
2065
|
-
value: i._parse(new
|
|
2064
|
+
key: r._parse(new z(n, e, n.path, [a, "key"])),
|
|
2065
|
+
value: i._parse(new z(n, t, n.path, [a, "value"]))
|
|
2066
2066
|
}));
|
|
2067
2067
|
if (n.common.async) {
|
|
2068
2068
|
let e = /* @__PURE__ */ new Map();
|
|
2069
2069
|
return Promise.resolve().then(async () => {
|
|
2070
2070
|
for (let n of a) {
|
|
2071
2071
|
let r = await n.key, i = await n.value;
|
|
2072
|
-
if (r.status === "aborted" || i.status === "aborted") return
|
|
2072
|
+
if (r.status === "aborted" || i.status === "aborted") return I;
|
|
2073
2073
|
(r.status === "dirty" || i.status === "dirty") && t.dirty(), e.set(r.value, i.value);
|
|
2074
2074
|
}
|
|
2075
2075
|
return {
|
|
@@ -2081,7 +2081,7 @@ var Mt = class e extends B {
|
|
|
2081
2081
|
let e = /* @__PURE__ */ new Map();
|
|
2082
2082
|
for (let n of a) {
|
|
2083
2083
|
let r = n.key, i = n.value;
|
|
2084
|
-
if (r.status === "aborted" || i.status === "aborted") return
|
|
2084
|
+
if (r.status === "aborted" || i.status === "aborted") return I;
|
|
2085
2085
|
(r.status === "dirty" || i.status === "dirty") && t.dirty(), e.set(r.value, i.value);
|
|
2086
2086
|
}
|
|
2087
2087
|
return {
|
|
@@ -2095,25 +2095,25 @@ Nt.create = (e, t, n) => new Nt({
|
|
|
2095
2095
|
valueType: t,
|
|
2096
2096
|
keyType: e,
|
|
2097
2097
|
typeName: G.ZodMap,
|
|
2098
|
-
...
|
|
2098
|
+
...B(n)
|
|
2099
2099
|
});
|
|
2100
|
-
var Pt = class e extends
|
|
2100
|
+
var Pt = class e extends V {
|
|
2101
2101
|
_parse(e) {
|
|
2102
2102
|
let { status: t, ctx: n } = this._processInputParams(e);
|
|
2103
|
-
if (n.parsedType !== b.set) return
|
|
2103
|
+
if (n.parsedType !== b.set) return P(n, {
|
|
2104
2104
|
code: y.invalid_type,
|
|
2105
2105
|
expected: b.set,
|
|
2106
2106
|
received: n.parsedType
|
|
2107
|
-
}),
|
|
2107
|
+
}), I;
|
|
2108
2108
|
let r = this._def;
|
|
2109
|
-
r.minSize !== null && n.data.size < r.minSize.value && (
|
|
2109
|
+
r.minSize !== null && n.data.size < r.minSize.value && (P(n, {
|
|
2110
2110
|
code: y.too_small,
|
|
2111
2111
|
minimum: r.minSize.value,
|
|
2112
2112
|
type: "set",
|
|
2113
2113
|
inclusive: !0,
|
|
2114
2114
|
exact: !1,
|
|
2115
2115
|
message: r.minSize.message
|
|
2116
|
-
}), t.dirty()), r.maxSize !== null && n.data.size > r.maxSize.value && (
|
|
2116
|
+
}), t.dirty()), r.maxSize !== null && n.data.size > r.maxSize.value && (P(n, {
|
|
2117
2117
|
code: y.too_big,
|
|
2118
2118
|
maximum: r.maxSize.value,
|
|
2119
2119
|
type: "set",
|
|
@@ -2125,7 +2125,7 @@ var Pt = class e extends B {
|
|
|
2125
2125
|
function a(e) {
|
|
2126
2126
|
let n = /* @__PURE__ */ new Set();
|
|
2127
2127
|
for (let r of e) {
|
|
2128
|
-
if (r.status === "aborted") return
|
|
2128
|
+
if (r.status === "aborted") return I;
|
|
2129
2129
|
r.status === "dirty" && t.dirty(), n.add(r.value);
|
|
2130
2130
|
}
|
|
2131
2131
|
return {
|
|
@@ -2133,7 +2133,7 @@ var Pt = class e extends B {
|
|
|
2133
2133
|
value: n
|
|
2134
2134
|
};
|
|
2135
2135
|
}
|
|
2136
|
-
let o = [...n.data.values()].map((e, t) => i._parse(new
|
|
2136
|
+
let o = [...n.data.values()].map((e, t) => i._parse(new z(n, e, n.path, t)));
|
|
2137
2137
|
return n.common.async ? Promise.all(o).then((e) => a(e)) : a(o);
|
|
2138
2138
|
}
|
|
2139
2139
|
min(t, n) {
|
|
@@ -2141,7 +2141,7 @@ var Pt = class e extends B {
|
|
|
2141
2141
|
...this._def,
|
|
2142
2142
|
minSize: {
|
|
2143
2143
|
value: t,
|
|
2144
|
-
message:
|
|
2144
|
+
message: R.toString(n)
|
|
2145
2145
|
}
|
|
2146
2146
|
});
|
|
2147
2147
|
}
|
|
@@ -2150,7 +2150,7 @@ var Pt = class e extends B {
|
|
|
2150
2150
|
...this._def,
|
|
2151
2151
|
maxSize: {
|
|
2152
2152
|
value: t,
|
|
2153
|
-
message:
|
|
2153
|
+
message: R.toString(n)
|
|
2154
2154
|
}
|
|
2155
2155
|
});
|
|
2156
2156
|
}
|
|
@@ -2166,28 +2166,28 @@ Pt.create = (e, t) => new Pt({
|
|
|
2166
2166
|
minSize: null,
|
|
2167
2167
|
maxSize: null,
|
|
2168
2168
|
typeName: G.ZodSet,
|
|
2169
|
-
...
|
|
2169
|
+
...B(t)
|
|
2170
2170
|
});
|
|
2171
|
-
var Ft = class e extends
|
|
2171
|
+
var Ft = class e extends V {
|
|
2172
2172
|
constructor() {
|
|
2173
2173
|
super(...arguments), this.validate = this.implement;
|
|
2174
2174
|
}
|
|
2175
2175
|
_parse(e) {
|
|
2176
2176
|
let { ctx: t } = this._processInputParams(e);
|
|
2177
|
-
if (t.parsedType !== b.function) return
|
|
2177
|
+
if (t.parsedType !== b.function) return P(t, {
|
|
2178
2178
|
code: y.invalid_type,
|
|
2179
2179
|
expected: b.function,
|
|
2180
2180
|
received: t.parsedType
|
|
2181
|
-
}),
|
|
2181
|
+
}), I;
|
|
2182
2182
|
function n(e, n) {
|
|
2183
|
-
return
|
|
2183
|
+
return N({
|
|
2184
2184
|
data: e,
|
|
2185
2185
|
path: t.path,
|
|
2186
2186
|
errorMaps: [
|
|
2187
2187
|
t.common.contextualErrorMap,
|
|
2188
2188
|
t.schemaErrorMap,
|
|
2189
|
-
|
|
2190
|
-
|
|
2189
|
+
Pe(),
|
|
2190
|
+
Me
|
|
2191
2191
|
].filter((e) => !!e),
|
|
2192
2192
|
issueData: {
|
|
2193
2193
|
code: y.invalid_arguments,
|
|
@@ -2196,14 +2196,14 @@ var Ft = class e extends B {
|
|
|
2196
2196
|
});
|
|
2197
2197
|
}
|
|
2198
2198
|
function r(e, n) {
|
|
2199
|
-
return
|
|
2199
|
+
return N({
|
|
2200
2200
|
data: e,
|
|
2201
2201
|
path: t.path,
|
|
2202
2202
|
errorMaps: [
|
|
2203
2203
|
t.common.contextualErrorMap,
|
|
2204
2204
|
t.schemaErrorMap,
|
|
2205
|
-
|
|
2206
|
-
|
|
2205
|
+
Pe(),
|
|
2206
|
+
Me
|
|
2207
2207
|
].filter((e) => !!e),
|
|
2208
2208
|
issueData: {
|
|
2209
2209
|
code: y.invalid_return_type,
|
|
@@ -2214,7 +2214,7 @@ var Ft = class e extends B {
|
|
|
2214
2214
|
let i = { errorMap: t.common.contextualErrorMap }, a = t.data;
|
|
2215
2215
|
if (this._def.returns instanceof Vt) {
|
|
2216
2216
|
let e = this;
|
|
2217
|
-
return
|
|
2217
|
+
return L(async function(...t) {
|
|
2218
2218
|
let o = new x([]), s = await e._def.args.parseAsync(t, i).catch((e) => {
|
|
2219
2219
|
throw o.addIssue(n(t, e)), o;
|
|
2220
2220
|
}), c = await Reflect.apply(a, this, s);
|
|
@@ -2224,7 +2224,7 @@ var Ft = class e extends B {
|
|
|
2224
2224
|
});
|
|
2225
2225
|
} else {
|
|
2226
2226
|
let e = this;
|
|
2227
|
-
return
|
|
2227
|
+
return L(function(...t) {
|
|
2228
2228
|
let o = e._def.args.safeParse(t, i);
|
|
2229
2229
|
if (!o.success) throw new x([n(t, o.error)]);
|
|
2230
2230
|
let s = Reflect.apply(a, this, o.data), c = e._def.returns.safeParse(s, i);
|
|
@@ -2242,7 +2242,7 @@ var Ft = class e extends B {
|
|
|
2242
2242
|
args(...t) {
|
|
2243
2243
|
return new e({
|
|
2244
2244
|
...this._def,
|
|
2245
|
-
args: jt.create(t).rest(
|
|
2245
|
+
args: jt.create(t).rest(xt.create())
|
|
2246
2246
|
});
|
|
2247
2247
|
}
|
|
2248
2248
|
returns(t) {
|
|
@@ -2259,13 +2259,13 @@ var Ft = class e extends B {
|
|
|
2259
2259
|
}
|
|
2260
2260
|
static create(t, n, r) {
|
|
2261
2261
|
return new e({
|
|
2262
|
-
args: t || jt.create([]).rest(
|
|
2263
|
-
returns: n ||
|
|
2262
|
+
args: t || jt.create([]).rest(xt.create()),
|
|
2263
|
+
returns: n || xt.create(),
|
|
2264
2264
|
typeName: G.ZodFunction,
|
|
2265
|
-
...
|
|
2265
|
+
...B(r)
|
|
2266
2266
|
});
|
|
2267
2267
|
}
|
|
2268
|
-
}, It = class extends
|
|
2268
|
+
}, It = class extends V {
|
|
2269
2269
|
get schema() {
|
|
2270
2270
|
return this._def.getter();
|
|
2271
2271
|
}
|
|
@@ -2281,17 +2281,17 @@ var Ft = class e extends B {
|
|
|
2281
2281
|
It.create = (e, t) => new It({
|
|
2282
2282
|
getter: e,
|
|
2283
2283
|
typeName: G.ZodLazy,
|
|
2284
|
-
...
|
|
2284
|
+
...B(t)
|
|
2285
2285
|
});
|
|
2286
|
-
var Lt = class extends
|
|
2286
|
+
var Lt = class extends V {
|
|
2287
2287
|
_parse(e) {
|
|
2288
2288
|
if (e.data !== this._def.value) {
|
|
2289
2289
|
let t = this._getOrReturnCtx(e);
|
|
2290
|
-
return
|
|
2290
|
+
return P(t, {
|
|
2291
2291
|
received: t.data,
|
|
2292
2292
|
code: y.invalid_literal,
|
|
2293
2293
|
expected: this._def.value
|
|
2294
|
-
}),
|
|
2294
|
+
}), I;
|
|
2295
2295
|
}
|
|
2296
2296
|
return {
|
|
2297
2297
|
status: "valid",
|
|
@@ -2305,34 +2305,34 @@ var Lt = class extends B {
|
|
|
2305
2305
|
Lt.create = (e, t) => new Lt({
|
|
2306
2306
|
value: e,
|
|
2307
2307
|
typeName: G.ZodLiteral,
|
|
2308
|
-
...
|
|
2308
|
+
...B(t)
|
|
2309
2309
|
});
|
|
2310
2310
|
function Rt(e, t) {
|
|
2311
2311
|
return new zt({
|
|
2312
2312
|
values: e,
|
|
2313
2313
|
typeName: G.ZodEnum,
|
|
2314
|
-
...
|
|
2314
|
+
...B(t)
|
|
2315
2315
|
});
|
|
2316
2316
|
}
|
|
2317
|
-
var zt = class e extends
|
|
2317
|
+
var zt = class e extends V {
|
|
2318
2318
|
_parse(e) {
|
|
2319
2319
|
if (typeof e.data != "string") {
|
|
2320
2320
|
let t = this._getOrReturnCtx(e), n = this._def.values;
|
|
2321
|
-
return
|
|
2321
|
+
return P(t, {
|
|
2322
2322
|
expected: _.joinValues(n),
|
|
2323
2323
|
received: t.parsedType,
|
|
2324
2324
|
code: y.invalid_type
|
|
2325
|
-
}),
|
|
2325
|
+
}), I;
|
|
2326
2326
|
}
|
|
2327
2327
|
if (this._cache ||= new Set(this._def.values), !this._cache.has(e.data)) {
|
|
2328
2328
|
let t = this._getOrReturnCtx(e), n = this._def.values;
|
|
2329
|
-
return
|
|
2329
|
+
return P(t, {
|
|
2330
2330
|
received: t.data,
|
|
2331
2331
|
code: y.invalid_enum_value,
|
|
2332
2332
|
options: n
|
|
2333
|
-
}),
|
|
2333
|
+
}), I;
|
|
2334
2334
|
}
|
|
2335
|
-
return
|
|
2335
|
+
return L(e.data);
|
|
2336
2336
|
}
|
|
2337
2337
|
get options() {
|
|
2338
2338
|
return this._def.values;
|
|
@@ -2366,26 +2366,26 @@ var zt = class e extends B {
|
|
|
2366
2366
|
}
|
|
2367
2367
|
};
|
|
2368
2368
|
zt.create = Rt;
|
|
2369
|
-
var Bt = class extends
|
|
2369
|
+
var Bt = class extends V {
|
|
2370
2370
|
_parse(e) {
|
|
2371
2371
|
let t = _.getValidEnumValues(this._def.values), n = this._getOrReturnCtx(e);
|
|
2372
2372
|
if (n.parsedType !== b.string && n.parsedType !== b.number) {
|
|
2373
2373
|
let e = _.objectValues(t);
|
|
2374
|
-
return
|
|
2374
|
+
return P(n, {
|
|
2375
2375
|
expected: _.joinValues(e),
|
|
2376
2376
|
received: n.parsedType,
|
|
2377
2377
|
code: y.invalid_type
|
|
2378
|
-
}),
|
|
2378
|
+
}), I;
|
|
2379
2379
|
}
|
|
2380
2380
|
if (this._cache ||= new Set(_.getValidEnumValues(this._def.values)), !this._cache.has(e.data)) {
|
|
2381
2381
|
let e = _.objectValues(t);
|
|
2382
|
-
return
|
|
2382
|
+
return P(n, {
|
|
2383
2383
|
received: n.data,
|
|
2384
2384
|
code: y.invalid_enum_value,
|
|
2385
2385
|
options: e
|
|
2386
|
-
}),
|
|
2386
|
+
}), I;
|
|
2387
2387
|
}
|
|
2388
|
-
return
|
|
2388
|
+
return L(e.data);
|
|
2389
2389
|
}
|
|
2390
2390
|
get enum() {
|
|
2391
2391
|
return this._def.values;
|
|
@@ -2394,19 +2394,19 @@ var Bt = class extends B {
|
|
|
2394
2394
|
Bt.create = (e, t) => new Bt({
|
|
2395
2395
|
values: e,
|
|
2396
2396
|
typeName: G.ZodNativeEnum,
|
|
2397
|
-
...
|
|
2397
|
+
...B(t)
|
|
2398
2398
|
});
|
|
2399
|
-
var Vt = class extends
|
|
2399
|
+
var Vt = class extends V {
|
|
2400
2400
|
unwrap() {
|
|
2401
2401
|
return this._def.type;
|
|
2402
2402
|
}
|
|
2403
2403
|
_parse(e) {
|
|
2404
2404
|
let { ctx: t } = this._processInputParams(e);
|
|
2405
|
-
return t.parsedType !== b.promise && t.common.async === !1 ? (
|
|
2405
|
+
return t.parsedType !== b.promise && t.common.async === !1 ? (P(t, {
|
|
2406
2406
|
code: y.invalid_type,
|
|
2407
2407
|
expected: b.promise,
|
|
2408
2408
|
received: t.parsedType
|
|
2409
|
-
}),
|
|
2409
|
+
}), I) : L((t.parsedType === b.promise ? t.data : Promise.resolve(t.data)).then((e) => this._def.type.parseAsync(e, {
|
|
2410
2410
|
path: t.path,
|
|
2411
2411
|
errorMap: t.common.contextualErrorMap
|
|
2412
2412
|
})));
|
|
@@ -2415,9 +2415,9 @@ var Vt = class extends B {
|
|
|
2415
2415
|
Vt.create = (e, t) => new Vt({
|
|
2416
2416
|
type: e,
|
|
2417
2417
|
typeName: G.ZodPromise,
|
|
2418
|
-
...
|
|
2418
|
+
...B(t)
|
|
2419
2419
|
});
|
|
2420
|
-
var U = class extends
|
|
2420
|
+
var U = class extends V {
|
|
2421
2421
|
innerType() {
|
|
2422
2422
|
return this._def.schema;
|
|
2423
2423
|
}
|
|
@@ -2427,7 +2427,7 @@ var U = class extends B {
|
|
|
2427
2427
|
_parse(e) {
|
|
2428
2428
|
let { status: t, ctx: n } = this._processInputParams(e), r = this._def.effect || null, i = {
|
|
2429
2429
|
addIssue: (e) => {
|
|
2430
|
-
|
|
2430
|
+
P(n, e), e.fatal ? t.abort() : t.dirty();
|
|
2431
2431
|
},
|
|
2432
2432
|
get path() {
|
|
2433
2433
|
return n.path;
|
|
@@ -2436,22 +2436,22 @@ var U = class extends B {
|
|
|
2436
2436
|
if (i.addIssue = i.addIssue.bind(i), r.type === "preprocess") {
|
|
2437
2437
|
let e = r.transform(n.data, i);
|
|
2438
2438
|
if (n.common.async) return Promise.resolve(e).then(async (e) => {
|
|
2439
|
-
if (t.value === "aborted") return
|
|
2439
|
+
if (t.value === "aborted") return I;
|
|
2440
2440
|
let r = await this._def.schema._parseAsync({
|
|
2441
2441
|
data: e,
|
|
2442
2442
|
path: n.path,
|
|
2443
2443
|
parent: n
|
|
2444
2444
|
});
|
|
2445
|
-
return r.status === "aborted" ?
|
|
2445
|
+
return r.status === "aborted" ? I : r.status === "dirty" || t.value === "dirty" ? Fe(r.value) : r;
|
|
2446
2446
|
});
|
|
2447
2447
|
{
|
|
2448
|
-
if (t.value === "aborted") return
|
|
2448
|
+
if (t.value === "aborted") return I;
|
|
2449
2449
|
let r = this._def.schema._parseSync({
|
|
2450
2450
|
data: e,
|
|
2451
2451
|
path: n.path,
|
|
2452
2452
|
parent: n
|
|
2453
2453
|
});
|
|
2454
|
-
return r.status === "aborted" ?
|
|
2454
|
+
return r.status === "aborted" ? I : r.status === "dirty" || t.value === "dirty" ? Fe(r.value) : r;
|
|
2455
2455
|
}
|
|
2456
2456
|
}
|
|
2457
2457
|
if (r.type === "refinement") {
|
|
@@ -2467,7 +2467,7 @@ var U = class extends B {
|
|
|
2467
2467
|
path: n.path,
|
|
2468
2468
|
parent: n
|
|
2469
2469
|
});
|
|
2470
|
-
return r.status === "aborted" ?
|
|
2470
|
+
return r.status === "aborted" ? I : (r.status === "dirty" && t.dirty(), e(r.value), {
|
|
2471
2471
|
status: t.value,
|
|
2472
2472
|
value: r.value
|
|
2473
2473
|
});
|
|
@@ -2475,7 +2475,7 @@ var U = class extends B {
|
|
|
2475
2475
|
data: n.data,
|
|
2476
2476
|
path: n.path,
|
|
2477
2477
|
parent: n
|
|
2478
|
-
}).then((n) => n.status === "aborted" ?
|
|
2478
|
+
}).then((n) => n.status === "aborted" ? I : (n.status === "dirty" && t.dirty(), e(n.value).then(() => ({
|
|
2479
2479
|
status: t.value,
|
|
2480
2480
|
value: n.value
|
|
2481
2481
|
}))));
|
|
@@ -2486,7 +2486,7 @@ var U = class extends B {
|
|
|
2486
2486
|
path: n.path,
|
|
2487
2487
|
parent: n
|
|
2488
2488
|
});
|
|
2489
|
-
if (!
|
|
2489
|
+
if (!Re(e)) return I;
|
|
2490
2490
|
let a = r.transform(e.value, i);
|
|
2491
2491
|
if (a instanceof Promise) throw Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");
|
|
2492
2492
|
return {
|
|
@@ -2497,10 +2497,10 @@ var U = class extends B {
|
|
|
2497
2497
|
data: n.data,
|
|
2498
2498
|
path: n.path,
|
|
2499
2499
|
parent: n
|
|
2500
|
-
}).then((e) =>
|
|
2500
|
+
}).then((e) => Re(e) ? Promise.resolve(r.transform(e.value, i)).then((e) => ({
|
|
2501
2501
|
status: t.value,
|
|
2502
2502
|
value: e
|
|
2503
|
-
})) :
|
|
2503
|
+
})) : I);
|
|
2504
2504
|
_.assertNever(r);
|
|
2505
2505
|
}
|
|
2506
2506
|
};
|
|
@@ -2508,7 +2508,7 @@ U.create = (e, t, n) => new U({
|
|
|
2508
2508
|
schema: e,
|
|
2509
2509
|
typeName: G.ZodEffects,
|
|
2510
2510
|
effect: t,
|
|
2511
|
-
...
|
|
2511
|
+
...B(n)
|
|
2512
2512
|
}), U.createWithPreprocess = (e, t, n) => new U({
|
|
2513
2513
|
schema: t,
|
|
2514
2514
|
effect: {
|
|
@@ -2516,11 +2516,11 @@ U.create = (e, t, n) => new U({
|
|
|
2516
2516
|
transform: e
|
|
2517
2517
|
},
|
|
2518
2518
|
typeName: G.ZodEffects,
|
|
2519
|
-
...
|
|
2519
|
+
...B(n)
|
|
2520
2520
|
});
|
|
2521
|
-
var W = class extends
|
|
2521
|
+
var W = class extends V {
|
|
2522
2522
|
_parse(e) {
|
|
2523
|
-
return this._getType(e) === b.undefined ?
|
|
2523
|
+
return this._getType(e) === b.undefined ? L(void 0) : this._def.innerType._parse(e);
|
|
2524
2524
|
}
|
|
2525
2525
|
unwrap() {
|
|
2526
2526
|
return this._def.innerType;
|
|
@@ -2529,11 +2529,11 @@ var W = class extends B {
|
|
|
2529
2529
|
W.create = (e, t) => new W({
|
|
2530
2530
|
innerType: e,
|
|
2531
2531
|
typeName: G.ZodOptional,
|
|
2532
|
-
...
|
|
2532
|
+
...B(t)
|
|
2533
2533
|
});
|
|
2534
|
-
var Ht = class extends
|
|
2534
|
+
var Ht = class extends V {
|
|
2535
2535
|
_parse(e) {
|
|
2536
|
-
return this._getType(e) === b.null ?
|
|
2536
|
+
return this._getType(e) === b.null ? L(null) : this._def.innerType._parse(e);
|
|
2537
2537
|
}
|
|
2538
2538
|
unwrap() {
|
|
2539
2539
|
return this._def.innerType;
|
|
@@ -2542,9 +2542,9 @@ var Ht = class extends B {
|
|
|
2542
2542
|
Ht.create = (e, t) => new Ht({
|
|
2543
2543
|
innerType: e,
|
|
2544
2544
|
typeName: G.ZodNullable,
|
|
2545
|
-
...
|
|
2545
|
+
...B(t)
|
|
2546
2546
|
});
|
|
2547
|
-
var Ut = class extends
|
|
2547
|
+
var Ut = class extends V {
|
|
2548
2548
|
_parse(e) {
|
|
2549
2549
|
let { ctx: t } = this._processInputParams(e), n = t.data;
|
|
2550
2550
|
return t.parsedType === b.undefined && (n = this._def.defaultValue()), this._def.innerType._parse({
|
|
@@ -2561,9 +2561,9 @@ Ut.create = (e, t) => new Ut({
|
|
|
2561
2561
|
innerType: e,
|
|
2562
2562
|
typeName: G.ZodDefault,
|
|
2563
2563
|
defaultValue: typeof t.default == "function" ? t.default : () => t.default,
|
|
2564
|
-
...
|
|
2564
|
+
...B(t)
|
|
2565
2565
|
});
|
|
2566
|
-
var Wt = class extends
|
|
2566
|
+
var Wt = class extends V {
|
|
2567
2567
|
_parse(e) {
|
|
2568
2568
|
let { ctx: t } = this._processInputParams(e), n = {
|
|
2569
2569
|
...t,
|
|
@@ -2576,7 +2576,7 @@ var Wt = class extends B {
|
|
|
2576
2576
|
path: n.path,
|
|
2577
2577
|
parent: { ...n }
|
|
2578
2578
|
});
|
|
2579
|
-
return
|
|
2579
|
+
return ze(r) ? r.then((e) => ({
|
|
2580
2580
|
status: "valid",
|
|
2581
2581
|
value: e.status === "valid" ? e.value : this._def.catchValue({
|
|
2582
2582
|
get error() {
|
|
@@ -2602,17 +2602,17 @@ Wt.create = (e, t) => new Wt({
|
|
|
2602
2602
|
innerType: e,
|
|
2603
2603
|
typeName: G.ZodCatch,
|
|
2604
2604
|
catchValue: typeof t.catch == "function" ? t.catch : () => t.catch,
|
|
2605
|
-
...
|
|
2605
|
+
...B(t)
|
|
2606
2606
|
});
|
|
2607
|
-
var Gt = class extends
|
|
2607
|
+
var Gt = class extends V {
|
|
2608
2608
|
_parse(e) {
|
|
2609
2609
|
if (this._getType(e) !== b.nan) {
|
|
2610
2610
|
let t = this._getOrReturnCtx(e);
|
|
2611
|
-
return
|
|
2611
|
+
return P(t, {
|
|
2612
2612
|
code: y.invalid_type,
|
|
2613
2613
|
expected: b.nan,
|
|
2614
2614
|
received: t.parsedType
|
|
2615
|
-
}),
|
|
2615
|
+
}), I;
|
|
2616
2616
|
}
|
|
2617
2617
|
return {
|
|
2618
2618
|
status: "valid",
|
|
@@ -2622,9 +2622,9 @@ var Gt = class extends B {
|
|
|
2622
2622
|
};
|
|
2623
2623
|
Gt.create = (e) => new Gt({
|
|
2624
2624
|
typeName: G.ZodNaN,
|
|
2625
|
-
...
|
|
2625
|
+
...B(e)
|
|
2626
2626
|
});
|
|
2627
|
-
var Kt = class extends
|
|
2627
|
+
var Kt = class extends V {
|
|
2628
2628
|
_parse(e) {
|
|
2629
2629
|
let { ctx: t } = this._processInputParams(e), n = t.data;
|
|
2630
2630
|
return this._def.type._parse({
|
|
@@ -2636,7 +2636,7 @@ var Kt = class extends B {
|
|
|
2636
2636
|
unwrap() {
|
|
2637
2637
|
return this._def.type;
|
|
2638
2638
|
}
|
|
2639
|
-
}, qt = class e extends
|
|
2639
|
+
}, qt = class e extends V {
|
|
2640
2640
|
_parse(e) {
|
|
2641
2641
|
let { status: t, ctx: n } = this._processInputParams(e);
|
|
2642
2642
|
if (n.common.async) return (async () => {
|
|
@@ -2645,7 +2645,7 @@ var Kt = class extends B {
|
|
|
2645
2645
|
path: n.path,
|
|
2646
2646
|
parent: n
|
|
2647
2647
|
});
|
|
2648
|
-
return e.status === "aborted" ?
|
|
2648
|
+
return e.status === "aborted" ? I : e.status === "dirty" ? (t.dirty(), Fe(e.value)) : this._def.out._parseAsync({
|
|
2649
2649
|
data: e.value,
|
|
2650
2650
|
path: n.path,
|
|
2651
2651
|
parent: n
|
|
@@ -2657,7 +2657,7 @@ var Kt = class extends B {
|
|
|
2657
2657
|
path: n.path,
|
|
2658
2658
|
parent: n
|
|
2659
2659
|
});
|
|
2660
|
-
return e.status === "aborted" ?
|
|
2660
|
+
return e.status === "aborted" ? I : e.status === "dirty" ? (t.dirty(), {
|
|
2661
2661
|
status: "dirty",
|
|
2662
2662
|
value: e.value
|
|
2663
2663
|
}) : this._def.out._parseSync({
|
|
@@ -2674,10 +2674,10 @@ var Kt = class extends B {
|
|
|
2674
2674
|
typeName: G.ZodPipeline
|
|
2675
2675
|
});
|
|
2676
2676
|
}
|
|
2677
|
-
}, Jt = class extends
|
|
2677
|
+
}, Jt = class extends V {
|
|
2678
2678
|
_parse(e) {
|
|
2679
|
-
let t = this._def.innerType._parse(e), n = (e) => (
|
|
2680
|
-
return
|
|
2679
|
+
let t = this._def.innerType._parse(e), n = (e) => (Re(e) && (e.value = Object.freeze(e.value)), e);
|
|
2680
|
+
return ze(t) ? t.then((e) => n(e)) : n(t);
|
|
2681
2681
|
}
|
|
2682
2682
|
unwrap() {
|
|
2683
2683
|
return this._def.innerType;
|
|
@@ -2686,12 +2686,12 @@ var Kt = class extends B {
|
|
|
2686
2686
|
Jt.create = (e, t) => new Jt({
|
|
2687
2687
|
innerType: e,
|
|
2688
2688
|
typeName: G.ZodReadonly,
|
|
2689
|
-
...
|
|
2690
|
-
}),
|
|
2689
|
+
...B(t)
|
|
2690
|
+
}), H.lazycreate;
|
|
2691
2691
|
var G;
|
|
2692
2692
|
(function(e) {
|
|
2693
2693
|
e.ZodString = "ZodString", e.ZodNumber = "ZodNumber", e.ZodNaN = "ZodNaN", e.ZodBigInt = "ZodBigInt", e.ZodBoolean = "ZodBoolean", e.ZodDate = "ZodDate", e.ZodSymbol = "ZodSymbol", e.ZodUndefined = "ZodUndefined", e.ZodNull = "ZodNull", e.ZodAny = "ZodAny", e.ZodUnknown = "ZodUnknown", e.ZodNever = "ZodNever", e.ZodVoid = "ZodVoid", e.ZodArray = "ZodArray", e.ZodObject = "ZodObject", e.ZodUnion = "ZodUnion", e.ZodDiscriminatedUnion = "ZodDiscriminatedUnion", e.ZodIntersection = "ZodIntersection", e.ZodTuple = "ZodTuple", e.ZodRecord = "ZodRecord", e.ZodMap = "ZodMap", e.ZodSet = "ZodSet", e.ZodFunction = "ZodFunction", e.ZodLazy = "ZodLazy", e.ZodLiteral = "ZodLiteral", e.ZodEnum = "ZodEnum", e.ZodEffects = "ZodEffects", e.ZodNativeEnum = "ZodNativeEnum", e.ZodOptional = "ZodOptional", e.ZodNullable = "ZodNullable", e.ZodDefault = "ZodDefault", e.ZodCatch = "ZodCatch", e.ZodPromise = "ZodPromise", e.ZodBranded = "ZodBranded", e.ZodPipeline = "ZodPipeline", e.ZodReadonly = "ZodReadonly";
|
|
2694
|
-
})(G ||= {}),
|
|
2694
|
+
})(G ||= {}), dt.create, pt.create, Gt.create, mt.create, ht.create, gt.create, _t.create, vt.create, yt.create, bt.create, xt.create, St.create, Ct.create, wt.create, H.create, H.strictCreate, Et.create, Ot.create, At.create, jt.create, Mt.create, Nt.create, Pt.create, Ft.create, It.create, Lt.create, zt.create, Bt.create, Vt.create, U.create, W.create, Ht.create, U.createWithPreprocess, qt.create;
|
|
2695
2695
|
//#endregion
|
|
2696
2696
|
//#region ../../node_modules/.pnpm/eventsource-parser@3.1.0/node_modules/eventsource-parser/dist/index.js
|
|
2697
2697
|
var Yt = class extends Error {
|
|
@@ -3729,7 +3729,7 @@ function _r(e) {
|
|
|
3729
3729
|
value: n.value
|
|
3730
3730
|
} : {
|
|
3731
3731
|
success: !1,
|
|
3732
|
-
error: new
|
|
3732
|
+
error: new M({
|
|
3733
3733
|
value: t,
|
|
3734
3734
|
cause: n.issues
|
|
3735
3735
|
})
|
|
@@ -3781,7 +3781,7 @@ async function Cr({ value: e, schema: t, context: n }) {
|
|
|
3781
3781
|
schema: t,
|
|
3782
3782
|
context: n
|
|
3783
3783
|
});
|
|
3784
|
-
if (!r.success) throw
|
|
3784
|
+
if (!r.success) throw M.wrap({
|
|
3785
3785
|
value: e,
|
|
3786
3786
|
cause: r.error,
|
|
3787
3787
|
context: n
|
|
@@ -3803,7 +3803,7 @@ async function wr({ value: e, schema: t, context: n }) {
|
|
|
3803
3803
|
rawValue: e
|
|
3804
3804
|
} : {
|
|
3805
3805
|
success: !1,
|
|
3806
|
-
error:
|
|
3806
|
+
error: M.wrap({
|
|
3807
3807
|
value: e,
|
|
3808
3808
|
cause: t.error,
|
|
3809
3809
|
context: n
|
|
@@ -3813,7 +3813,7 @@ async function wr({ value: e, schema: t, context: n }) {
|
|
|
3813
3813
|
} catch (t) {
|
|
3814
3814
|
return {
|
|
3815
3815
|
success: !1,
|
|
3816
|
-
error:
|
|
3816
|
+
error: M.wrap({
|
|
3817
3817
|
value: e,
|
|
3818
3818
|
cause: t,
|
|
3819
3819
|
context: n
|
|
@@ -3836,7 +3836,7 @@ async function Tr({ text: e, schema: t }) {
|
|
|
3836
3836
|
} catch (t) {
|
|
3837
3837
|
return {
|
|
3838
3838
|
success: !1,
|
|
3839
|
-
error:
|
|
3839
|
+
error: De.isInstance(t) ? t : new De({
|
|
3840
3840
|
text: e,
|
|
3841
3841
|
cause: t
|
|
3842
3842
|
}),
|
|
@@ -4447,7 +4447,7 @@ var ai = () => ({
|
|
|
4447
4447
|
let i = n.value;
|
|
4448
4448
|
if (typeof i != "object" || !i || !("elements" in i) || !Array.isArray(i.elements)) throw new Pr({
|
|
4449
4449
|
message: "No object generated: response did not match schema.",
|
|
4450
|
-
cause: new
|
|
4450
|
+
cause: new M({
|
|
4451
4451
|
value: i,
|
|
4452
4452
|
cause: "response must be an object with an elements array"
|
|
4453
4453
|
}),
|
|
@@ -4532,7 +4532,7 @@ var ai = () => ({
|
|
|
4532
4532
|
let i = r.value;
|
|
4533
4533
|
if (typeof i != "object" || !i || !("result" in i) || typeof i.result != "string" || !e.includes(i.result)) throw new Pr({
|
|
4534
4534
|
message: "No object generated: response did not match schema.",
|
|
4535
|
-
cause: new
|
|
4535
|
+
cause: new M({
|
|
4536
4536
|
value: i,
|
|
4537
4537
|
cause: "response must be an object that contains a choice value."
|
|
4538
4538
|
}),
|
|
@@ -6079,7 +6079,7 @@ function Qi(e) {
|
|
|
6079
6079
|
onError: E,
|
|
6080
6080
|
onFinish: () => {
|
|
6081
6081
|
let e = T.value;
|
|
6082
|
-
!C.value && !k.value.some((t) => t.id === e) &&
|
|
6082
|
+
!C.value && !k.value.some((t) => t.id === e) && I(o.value);
|
|
6083
6083
|
}
|
|
6084
6084
|
})), be = S(() => {
|
|
6085
6085
|
let e = u.value?.initialMessage;
|
|
@@ -6114,8 +6114,8 @@ function Qi(e) {
|
|
|
6114
6114
|
}), we = S(() => {
|
|
6115
6115
|
let e = u.value?.messagePlaceholder;
|
|
6116
6116
|
return e?.[r.value] ? e[r.value] : n("placeholder.askAnything") ? t("placeholder.askAnything") : "";
|
|
6117
|
-
}), k = w([]), Te = w(!1),
|
|
6118
|
-
async function
|
|
6117
|
+
}), k = w([]), Te = w(!1), A = w([]), Ee = w(!1), De = w("chat"), j = w([]), Oe = w(), ke = w(!1), Ae = w(!1), je = w(), M = w(!1), Me = w(!1), Ne = w(), Pe = w(""), N = w([]), P = w(""), F = w(0);
|
|
6118
|
+
async function I(e) {
|
|
6119
6119
|
if (C.value) {
|
|
6120
6120
|
k.value = [];
|
|
6121
6121
|
return;
|
|
@@ -6129,80 +6129,80 @@ function Qi(e) {
|
|
|
6129
6129
|
Te.value = !1;
|
|
6130
6130
|
}
|
|
6131
6131
|
}
|
|
6132
|
-
async function
|
|
6132
|
+
async function Fe() {
|
|
6133
6133
|
let e = T.value;
|
|
6134
6134
|
if (!e) {
|
|
6135
|
-
|
|
6135
|
+
A.value = [];
|
|
6136
6136
|
return;
|
|
6137
6137
|
}
|
|
6138
|
-
|
|
6138
|
+
Ee.value = !0;
|
|
6139
6139
|
try {
|
|
6140
|
-
|
|
6140
|
+
A.value = await D.value.getChatFiles(e);
|
|
6141
6141
|
} catch {
|
|
6142
|
-
|
|
6142
|
+
A.value = [];
|
|
6143
6143
|
} finally {
|
|
6144
|
-
|
|
6144
|
+
Ee.value = !1;
|
|
6145
6145
|
}
|
|
6146
6146
|
}
|
|
6147
|
-
function
|
|
6147
|
+
function L(e, t = !1) {
|
|
6148
6148
|
return D.value.getChatFileDownloadUrl(e, t);
|
|
6149
6149
|
}
|
|
6150
|
-
function
|
|
6150
|
+
function Ie(e) {
|
|
6151
6151
|
return D.value.getChatFilePreviewUrl(e);
|
|
6152
6152
|
}
|
|
6153
|
-
async function
|
|
6154
|
-
await D.value.deleteChatFile(e),
|
|
6153
|
+
async function Le(e) {
|
|
6154
|
+
await D.value.deleteChatFile(e), A.value = A.value.filter((t) => t.documentId !== e);
|
|
6155
6155
|
}
|
|
6156
|
-
async function
|
|
6156
|
+
async function Re(e, t) {
|
|
6157
6157
|
if (!C.value) try {
|
|
6158
6158
|
let n = await D.value.getChat(e, t);
|
|
6159
6159
|
if (t !== T.value || O.value.status !== "ready" || O.value.messages.length > 0) return;
|
|
6160
6160
|
n && (O.value.messages = n.messages, ge.value = n.blocked ?? !1);
|
|
6161
6161
|
} catch {}
|
|
6162
6162
|
}
|
|
6163
|
-
async function
|
|
6163
|
+
async function ze(e) {
|
|
6164
6164
|
try {
|
|
6165
|
-
|
|
6165
|
+
j.value = await D.value.getMessageFeedbacks(e);
|
|
6166
6166
|
} catch {
|
|
6167
|
-
|
|
6167
|
+
j.value = [];
|
|
6168
6168
|
}
|
|
6169
6169
|
}
|
|
6170
|
-
function L(e) {
|
|
6171
|
-
let t = ke.value.findIndex((t) => t.messageId === e.messageId);
|
|
6172
|
-
t >= 0 ? ke.value[t] = e : ke.value.push(e);
|
|
6173
|
-
}
|
|
6174
6170
|
function R(e) {
|
|
6171
|
+
let t = j.value.findIndex((t) => t.messageId === e.messageId);
|
|
6172
|
+
t >= 0 ? j.value[t] = e : j.value.push(e);
|
|
6173
|
+
}
|
|
6174
|
+
function z(e) {
|
|
6175
6175
|
let t = Ce.value, n = t.findIndex((t) => t.id === e.id), r = re(e) ?? "";
|
|
6176
6176
|
return {
|
|
6177
6177
|
userQuestion: re(t.slice(0, n).reverse().find((e) => e.role === "user") ?? e) ?? "",
|
|
6178
6178
|
assistantMessage: r
|
|
6179
6179
|
};
|
|
6180
6180
|
}
|
|
6181
|
-
async function
|
|
6181
|
+
async function Be(e, t) {
|
|
6182
6182
|
await Promise.all([
|
|
6183
|
-
|
|
6184
|
-
|
|
6185
|
-
|
|
6183
|
+
Re(e, t),
|
|
6184
|
+
I(e),
|
|
6185
|
+
ze(t)
|
|
6186
6186
|
]), ye.value || me((e, t) => D.value.reverseGeocode(e, t, r.value)).then((e) => {
|
|
6187
6187
|
e && (ye.value = e);
|
|
6188
6188
|
});
|
|
6189
6189
|
}
|
|
6190
|
-
async function
|
|
6191
|
-
let e =
|
|
6190
|
+
async function B() {
|
|
6191
|
+
let e = Pe.value.trim(), t = N.value.filter((e) => e.state === "done" && e.mediaSource !== void 0).map((e) => ({
|
|
6192
6192
|
type: "file",
|
|
6193
6193
|
mediaType: e.mediaSource.mimeType,
|
|
6194
6194
|
url: e.localUrl,
|
|
6195
6195
|
filename: e.mediaSource.name,
|
|
6196
6196
|
providerMetadata: { "8bot": { media: e.mediaSource } }
|
|
6197
6197
|
}));
|
|
6198
|
-
C.value && Ce.value.length > 0 && await
|
|
6198
|
+
C.value && Ce.value.length > 0 && await Ue(), P.value = e, F.value = O.value.messages.length;
|
|
6199
6199
|
let n = O.value.sendMessage;
|
|
6200
6200
|
n({
|
|
6201
6201
|
text: e,
|
|
6202
6202
|
files: t.length > 0 ? t : void 0
|
|
6203
|
-
}),
|
|
6203
|
+
}), Pe.value = "", He();
|
|
6204
6204
|
}
|
|
6205
|
-
function
|
|
6205
|
+
function V(e) {
|
|
6206
6206
|
let t = e.trim();
|
|
6207
6207
|
if (!t) return;
|
|
6208
6208
|
if (O.value.status !== "ready") {
|
|
@@ -6212,24 +6212,24 @@ function Qi(e) {
|
|
|
6212
6212
|
let n = O.value.sendMessage;
|
|
6213
6213
|
n({ text: t });
|
|
6214
6214
|
}
|
|
6215
|
-
async function
|
|
6216
|
-
let e =
|
|
6217
|
-
await O.value.stop(), e && (
|
|
6215
|
+
async function Ve() {
|
|
6216
|
+
let e = P.value.length > 0;
|
|
6217
|
+
await O.value.stop(), e && (Pe.value = P.value, O.value.messages = O.value.messages.slice(0, F.value), P.value = "");
|
|
6218
6218
|
}
|
|
6219
6219
|
le(() => O.value.status, (e) => {
|
|
6220
|
-
e === "ready" &&
|
|
6220
|
+
e === "ready" && P.value.length > 0 && (P.value = "");
|
|
6221
6221
|
});
|
|
6222
|
-
function
|
|
6223
|
-
for (let t of
|
|
6224
|
-
|
|
6222
|
+
function He(e = !1) {
|
|
6223
|
+
for (let t of N.value) (e || t.state !== "done") && URL.revokeObjectURL(t.localUrl);
|
|
6224
|
+
N.value = [], Ze.value = null;
|
|
6225
6225
|
}
|
|
6226
|
-
async function
|
|
6227
|
-
return
|
|
6226
|
+
async function Ue() {
|
|
6227
|
+
return P.value = "", await Ve(), T.value = sn(), O.value.clearError(), he.value = void 0, ge.value = !1, He(!0), ct("chat"), T.value;
|
|
6228
6228
|
}
|
|
6229
|
-
async function
|
|
6230
|
-
O.value.status !== "ready" && (
|
|
6229
|
+
async function We(e) {
|
|
6230
|
+
O.value.status !== "ready" && (P.value = "", await Ve()), await O.value.regenerate(e);
|
|
6231
6231
|
}
|
|
6232
|
-
function
|
|
6232
|
+
function Ge(e) {
|
|
6233
6233
|
if (e.tool === "requestGeolocation") {
|
|
6234
6234
|
let t = e.output;
|
|
6235
6235
|
"latitude" in t && (ye.value = {
|
|
@@ -6241,20 +6241,20 @@ function Qi(e) {
|
|
|
6241
6241
|
}
|
|
6242
6242
|
O.value.addToolOutput(e);
|
|
6243
6243
|
}
|
|
6244
|
-
let
|
|
6245
|
-
|
|
6244
|
+
let Ke = S(() => O.value.messages.reduce((e, t) => e + t.parts.filter((e) => e.type === "file").length, 0)), qe = S(() => g.value?.maxFilesPerMessage ?? 5), Je = S(() => g.value?.maxFilesPerChat ?? 20), Ye = S(() => Math.max(0, Math.min(qe.value - N.value.length, Je.value - Ke.value - N.value.length))), Xe = S(() => Ye.value <= 0), Ze = w(null), Qe = () => {
|
|
6245
|
+
Ze.value = null;
|
|
6246
6246
|
};
|
|
6247
|
-
le(
|
|
6248
|
-
e || (
|
|
6247
|
+
le(Xe, (e) => {
|
|
6248
|
+
e || (Ze.value = null);
|
|
6249
6249
|
});
|
|
6250
|
-
async function
|
|
6251
|
-
if (
|
|
6252
|
-
|
|
6250
|
+
async function $e(e) {
|
|
6251
|
+
if (Xe.value) {
|
|
6252
|
+
Ze.value = Je.value - Ke.value - N.value.length <= qe.value - N.value.length ? {
|
|
6253
6253
|
reason: "per-chat",
|
|
6254
|
-
max:
|
|
6254
|
+
max: Je.value
|
|
6255
6255
|
} : {
|
|
6256
6256
|
reason: "per-message",
|
|
6257
|
-
max:
|
|
6257
|
+
max: qe.value
|
|
6258
6258
|
};
|
|
6259
6259
|
return;
|
|
6260
6260
|
}
|
|
@@ -6264,26 +6264,26 @@ function Qi(e) {
|
|
|
6264
6264
|
localUrl: URL.createObjectURL(e),
|
|
6265
6265
|
state: "uploading"
|
|
6266
6266
|
};
|
|
6267
|
-
|
|
6267
|
+
N.value = [...N.value, n];
|
|
6268
6268
|
try {
|
|
6269
6269
|
let n = await D.value.uploadMedia(o.value, T.value, e);
|
|
6270
|
-
|
|
6270
|
+
N.value = N.value.map((e) => e.id === t ? {
|
|
6271
6271
|
...e,
|
|
6272
6272
|
state: "done",
|
|
6273
6273
|
mediaSource: n
|
|
6274
6274
|
} : e);
|
|
6275
6275
|
} catch (e) {
|
|
6276
6276
|
let n = e instanceof Error ? e.message : "Upload failed";
|
|
6277
|
-
|
|
6277
|
+
N.value = N.value.map((e) => e.id === t ? {
|
|
6278
6278
|
...e,
|
|
6279
6279
|
state: "error",
|
|
6280
6280
|
error: n
|
|
6281
6281
|
} : e);
|
|
6282
6282
|
}
|
|
6283
6283
|
}
|
|
6284
|
-
async function
|
|
6285
|
-
let { userQuestion: n, assistantMessage: r } =
|
|
6286
|
-
|
|
6284
|
+
async function et(e, t) {
|
|
6285
|
+
let { userQuestion: n, assistantMessage: r } = z(e);
|
|
6286
|
+
R(await D.value.submitMessageFeedback({
|
|
6287
6287
|
messageId: e.id,
|
|
6288
6288
|
chatId: T.value,
|
|
6289
6289
|
agentId: o.value,
|
|
@@ -6292,60 +6292,77 @@ function Qi(e) {
|
|
|
6292
6292
|
assistantMessage: r
|
|
6293
6293
|
}));
|
|
6294
6294
|
}
|
|
6295
|
-
async function
|
|
6296
|
-
await
|
|
6295
|
+
async function tt(e) {
|
|
6296
|
+
await et(e, "upvote");
|
|
6297
6297
|
}
|
|
6298
|
-
async function
|
|
6299
|
-
await
|
|
6298
|
+
async function nt(e) {
|
|
6299
|
+
await et(e, "downvote");
|
|
6300
6300
|
}
|
|
6301
|
-
function
|
|
6302
|
-
|
|
6301
|
+
function rt(e) {
|
|
6302
|
+
Ae.value = !1, je.value = void 0, Oe.value = e;
|
|
6303
6303
|
}
|
|
6304
|
-
async function
|
|
6305
|
-
if (
|
|
6306
|
-
|
|
6307
|
-
let { userQuestion: t, assistantMessage: n } =
|
|
6308
|
-
|
|
6309
|
-
messageId:
|
|
6304
|
+
async function it(e) {
|
|
6305
|
+
if (Oe.value) try {
|
|
6306
|
+
ke.value = !0, Ae.value = !1, je.value = void 0;
|
|
6307
|
+
let { userQuestion: t, assistantMessage: n } = z(Oe.value);
|
|
6308
|
+
R(await D.value.submitMessageFeedback({
|
|
6309
|
+
messageId: Oe.value.id,
|
|
6310
6310
|
chatId: T.value,
|
|
6311
6311
|
agentId: o.value,
|
|
6312
6312
|
userQuestion: t,
|
|
6313
6313
|
assistantMessage: n,
|
|
6314
6314
|
comment: e
|
|
6315
|
-
})),
|
|
6315
|
+
})), Ae.value = !0, await ze(T.value);
|
|
6316
6316
|
} catch {
|
|
6317
|
-
|
|
6317
|
+
je.value = n("message.feedbackSubmitError") ? t("message.feedbackSubmitError") : "Failed to submit feedback";
|
|
6318
6318
|
} finally {
|
|
6319
|
-
|
|
6319
|
+
ke.value = !1;
|
|
6320
6320
|
}
|
|
6321
6321
|
}
|
|
6322
|
-
async function
|
|
6322
|
+
async function at(e) {
|
|
6323
6323
|
try {
|
|
6324
|
-
|
|
6324
|
+
Me.value = !0, M.value = !1, Ne.value = void 0, await D.value.submitLead({
|
|
6325
6325
|
agentId: o.value,
|
|
6326
6326
|
chatId: T.value,
|
|
6327
6327
|
...e
|
|
6328
|
-
}),
|
|
6328
|
+
}), M.value = !0;
|
|
6329
6329
|
} catch {
|
|
6330
|
-
|
|
6330
|
+
Ne.value = n("message.leadSubmitError") ? t("message.leadSubmitError") : "Failed to submit lead";
|
|
6331
6331
|
} finally {
|
|
6332
|
-
|
|
6332
|
+
Me.value = !1;
|
|
6333
6333
|
}
|
|
6334
6334
|
}
|
|
6335
|
-
async function
|
|
6335
|
+
async function ot(e, t) {
|
|
6336
6336
|
let n = await D.value.updateChatTitle(o.value, e, t);
|
|
6337
6337
|
k.value = k.value.map((t) => t.id === e ? {
|
|
6338
6338
|
...t,
|
|
6339
6339
|
title: n.title
|
|
6340
6340
|
} : t);
|
|
6341
6341
|
}
|
|
6342
|
-
async function
|
|
6343
|
-
await D.value.deleteChat(o.value, e), k.value = k.value.filter((t) => t.id !== e), T.value === e && await
|
|
6342
|
+
async function st(e) {
|
|
6343
|
+
await D.value.deleteChat(o.value, e), k.value = k.value.filter((t) => t.id !== e), T.value === e && await Ue();
|
|
6344
6344
|
}
|
|
6345
|
-
function
|
|
6346
|
-
|
|
6345
|
+
function ct(e) {
|
|
6346
|
+
De.value = e;
|
|
6347
6347
|
}
|
|
6348
|
-
|
|
6348
|
+
let lt;
|
|
6349
|
+
function ut(e) {
|
|
6350
|
+
let t = () => D.value.getChat(o.value, e).then((e) => e !== null);
|
|
6351
|
+
return t().catch(() => t().catch(() => !1));
|
|
6352
|
+
}
|
|
6353
|
+
return le(l, async (e) => {
|
|
6354
|
+
if (!e || e === lt) return;
|
|
6355
|
+
let t = lt;
|
|
6356
|
+
if (lt = e, t === void 0) return;
|
|
6357
|
+
let n = T.value, r = !C.value && await ut(n);
|
|
6358
|
+
if (!(l.value !== e || T.value !== n)) {
|
|
6359
|
+
if (r) {
|
|
6360
|
+
I(o.value);
|
|
6361
|
+
return;
|
|
6362
|
+
}
|
|
6363
|
+
k.value = [], j.value = [], A.value = [], await Ue(), Pe.value = "";
|
|
6364
|
+
}
|
|
6365
|
+
}), {
|
|
6349
6366
|
apiClient: D,
|
|
6350
6367
|
baseUrl: i,
|
|
6351
6368
|
basePath: a,
|
|
@@ -6372,52 +6389,52 @@ function Qi(e) {
|
|
|
6372
6389
|
messages: Ce,
|
|
6373
6390
|
conversations: k,
|
|
6374
6391
|
isLoadingConversations: Te,
|
|
6375
|
-
chatFiles:
|
|
6376
|
-
isLoadingChatFiles:
|
|
6377
|
-
input:
|
|
6378
|
-
pendingAttachments:
|
|
6379
|
-
isAttachmentLimitReached:
|
|
6380
|
-
fileLimitError:
|
|
6392
|
+
chatFiles: A,
|
|
6393
|
+
isLoadingChatFiles: Ee,
|
|
6394
|
+
input: Pe,
|
|
6395
|
+
pendingAttachments: N,
|
|
6396
|
+
isAttachmentLimitReached: Xe,
|
|
6397
|
+
fileLimitError: Ze,
|
|
6381
6398
|
localChatId: T,
|
|
6382
6399
|
isConversationBlocked: ge,
|
|
6383
6400
|
inputMessagePlaceholder: we,
|
|
6384
6401
|
chatError: he,
|
|
6385
|
-
activeView:
|
|
6386
|
-
messageFeedbacks:
|
|
6387
|
-
feedbackDialogMessage:
|
|
6388
|
-
isFeedbackSubmitting:
|
|
6389
|
-
isFeedbackSubmitted:
|
|
6390
|
-
feedbackSubmitError:
|
|
6391
|
-
isLeadSubmitted:
|
|
6392
|
-
isLoadingSubmitLead:
|
|
6393
|
-
submitLeadError:
|
|
6394
|
-
initialize:
|
|
6395
|
-
loadConversations:
|
|
6396
|
-
loadChatFiles:
|
|
6397
|
-
getChatFileUrl:
|
|
6398
|
-
getChatFilePreviewUrl:
|
|
6399
|
-
deleteChatFile:
|
|
6400
|
-
handleSubmit:
|
|
6401
|
-
sendMessage:
|
|
6402
|
-
stopGeneration:
|
|
6403
|
-
startNewChat:
|
|
6404
|
-
regenerate:
|
|
6405
|
-
addToolOutput:
|
|
6406
|
-
handleFileSelect:
|
|
6407
|
-
clearFileLimitError:
|
|
6408
|
-
clearPendingAttachments:
|
|
6409
|
-
onUpvote:
|
|
6410
|
-
onDownvote:
|
|
6411
|
-
onFeedback:
|
|
6412
|
-
onFeedbackSubmit:
|
|
6413
|
-
onLeadSubmit:
|
|
6414
|
-
navigate:
|
|
6415
|
-
renameChatTitle:
|
|
6416
|
-
deleteChat:
|
|
6402
|
+
activeView: De,
|
|
6403
|
+
messageFeedbacks: j,
|
|
6404
|
+
feedbackDialogMessage: Oe,
|
|
6405
|
+
isFeedbackSubmitting: ke,
|
|
6406
|
+
isFeedbackSubmitted: Ae,
|
|
6407
|
+
feedbackSubmitError: je,
|
|
6408
|
+
isLeadSubmitted: M,
|
|
6409
|
+
isLoadingSubmitLead: Me,
|
|
6410
|
+
submitLeadError: Ne,
|
|
6411
|
+
initialize: Be,
|
|
6412
|
+
loadConversations: I,
|
|
6413
|
+
loadChatFiles: Fe,
|
|
6414
|
+
getChatFileUrl: L,
|
|
6415
|
+
getChatFilePreviewUrl: Ie,
|
|
6416
|
+
deleteChatFile: Le,
|
|
6417
|
+
handleSubmit: B,
|
|
6418
|
+
sendMessage: V,
|
|
6419
|
+
stopGeneration: Ve,
|
|
6420
|
+
startNewChat: Ue,
|
|
6421
|
+
regenerate: We,
|
|
6422
|
+
addToolOutput: Ge,
|
|
6423
|
+
handleFileSelect: $e,
|
|
6424
|
+
clearFileLimitError: Qe,
|
|
6425
|
+
clearPendingAttachments: He,
|
|
6426
|
+
onUpvote: tt,
|
|
6427
|
+
onDownvote: nt,
|
|
6428
|
+
onFeedback: rt,
|
|
6429
|
+
onFeedbackSubmit: it,
|
|
6430
|
+
onLeadSubmit: at,
|
|
6431
|
+
navigate: ct,
|
|
6432
|
+
renameChatTitle: ot,
|
|
6433
|
+
deleteChat: st
|
|
6417
6434
|
};
|
|
6418
6435
|
})();
|
|
6419
6436
|
}
|
|
6420
6437
|
//#endregion
|
|
6421
6438
|
export { sn as i, Zi as n, wi as r, Qi as t };
|
|
6422
6439
|
|
|
6423
|
-
//# sourceMappingURL=useChatbotStore-
|
|
6440
|
+
//# sourceMappingURL=useChatbotStore-DeHwEN8W.js.map
|