@gengage/assistant-fe 0.1.6 → 0.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +100 -0
- package/dist/assistant-fe.css +1 -1
- package/dist/chat/components/ChatDrawer.d.ts +8 -4
- package/dist/chat/components/ChatDrawer.d.ts.map +1 -1
- package/dist/chat/index.d.ts +5 -0
- package/dist/chat/index.d.ts.map +1 -1
- package/dist/chat/types.d.ts +1 -1
- package/dist/chat.cjs +1 -1
- package/dist/chat.iife.js +16 -16
- package/dist/chat.iife.js.map +1 -1
- package/dist/chat.js +2 -2
- package/dist/common/events.d.ts.map +1 -1
- package/dist/common/index.d.ts +2 -0
- package/dist/common/index.d.ts.map +1 -1
- package/dist/common/native-webview.d.ts +61 -0
- package/dist/common/native-webview.d.ts.map +1 -0
- package/dist/common/overlay.d.ts +5 -0
- package/dist/common/overlay.d.ts.map +1 -1
- package/dist/common.cjs +1 -1
- package/dist/common.cjs.map +1 -1
- package/dist/common.js +197 -426
- package/dist/common.js.map +1 -1
- package/dist/index-1yPxOqAw.cjs +13 -0
- package/dist/index-1yPxOqAw.cjs.map +1 -0
- package/dist/index-BH-V2lWn.js +510 -0
- package/dist/index-BH-V2lWn.js.map +1 -0
- package/dist/index-BelS6Vnv.cjs +2 -0
- package/dist/index-BelS6Vnv.cjs.map +1 -0
- package/dist/index-CERWfDdF.js +4571 -0
- package/dist/index-CERWfDdF.js.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +55 -50
- package/dist/index.js.map +1 -1
- package/dist/native/index.d.ts +3 -0
- package/dist/native/index.d.ts.map +1 -0
- package/dist/native.cjs +2 -0
- package/dist/native.cjs.map +1 -0
- package/dist/native.iife.js +97 -0
- package/dist/native.iife.js.map +1 -0
- package/dist/native.js +9 -0
- package/dist/native.js.map +1 -0
- package/dist/qna/components/TextInput.d.ts.map +1 -1
- package/dist/qna/components/renderUISpec.d.ts.map +1 -1
- package/dist/qna/index.d.ts +1 -0
- package/dist/qna/index.d.ts.map +1 -1
- package/dist/qna/types.d.ts +1 -1
- package/dist/qna/types.d.ts.map +1 -1
- package/dist/qna.cjs +1 -1
- package/dist/qna.cjs.map +1 -1
- package/dist/qna.css +1 -1
- package/dist/qna.iife.js +14 -14
- package/dist/qna.iife.js.map +1 -1
- package/dist/qna.js +92 -80
- package/dist/qna.js.map +1 -1
- package/dist/{schemas-DhaO7I0-.cjs → schemas-DHzfUzwA.cjs} +22 -22
- package/dist/schemas-DHzfUzwA.cjs.map +1 -0
- package/dist/{schemas-BlkBmaA5.js → schemas-yF4IOEUi.js} +807 -755
- package/dist/schemas-yF4IOEUi.js.map +1 -0
- package/dist/simrel/components/ProductCard.d.ts.map +1 -1
- package/dist/simrel.cjs +1 -1
- package/dist/simrel.cjs.map +1 -1
- package/dist/simrel.css +1 -1
- package/dist/simrel.iife.js +8 -8
- package/dist/simrel.iife.js.map +1 -1
- package/dist/simrel.js +218 -214
- package/dist/simrel.js.map +1 -1
- package/package.json +9 -2
- package/dist/index-B8EeSm-F.cjs +0 -13
- package/dist/index-B8EeSm-F.cjs.map +0 -1
- package/dist/index-BSpLCzAK.js +0 -4523
- package/dist/index-BSpLCzAK.js.map +0 -1
- package/dist/schemas-BlkBmaA5.js.map +0 -1
- package/dist/schemas-DhaO7I0-.cjs.map +0 -1
|
@@ -8,7 +8,7 @@ const Dt = ({ element: e, renderElement: t }) => {
|
|
|
8
8
|
}
|
|
9
9
|
return n;
|
|
10
10
|
};
|
|
11
|
-
function
|
|
11
|
+
function Fa(e) {
|
|
12
12
|
const t = document.createElement("div");
|
|
13
13
|
if (t.className = e.containerClassName, !e.spec.elements[e.spec.root]) return t;
|
|
14
14
|
const r = e.unknownRenderer ?? Dt, o = (s) => {
|
|
@@ -31,7 +31,7 @@ function Ma(e) {
|
|
|
31
31
|
}, i = o(e.spec.root);
|
|
32
32
|
return i && t.appendChild(i), t;
|
|
33
33
|
}
|
|
34
|
-
function
|
|
34
|
+
function xa(e, t) {
|
|
35
35
|
if (!t) return e;
|
|
36
36
|
const n = { ...e };
|
|
37
37
|
for (const [r, o] of Object.entries(t))
|
|
@@ -51,7 +51,7 @@ function Ja(e, t) {
|
|
|
51
51
|
};
|
|
52
52
|
return e.view_id !== void 0 && (n.view_id = e.view_id), e.user_id !== void 0 && (n.user_id = e.user_id), t.widget !== void 0 && (n.widget = t.widget), e.page_type !== void 0 && (n.page_type = e.page_type), e.sku !== void 0 && (n.sku = e.sku), n;
|
|
53
53
|
}
|
|
54
|
-
function
|
|
54
|
+
function qa(e, t) {
|
|
55
55
|
const n = {
|
|
56
56
|
request_id: t.request_id,
|
|
57
57
|
chunk_index: t.chunk_index
|
|
@@ -66,7 +66,7 @@ function xa(e, t) {
|
|
|
66
66
|
};
|
|
67
67
|
return e.view_id !== void 0 && (r.view_id = e.view_id), e.user_id !== void 0 && (r.user_id = e.user_id), t.widget !== void 0 && (r.widget = t.widget), e.page_type !== void 0 && (r.page_type = e.page_type), e.sku !== void 0 && (r.sku = e.sku), r;
|
|
68
68
|
}
|
|
69
|
-
function
|
|
69
|
+
function Va(e, t) {
|
|
70
70
|
const n = {
|
|
71
71
|
event_name: "stream.ui_spec",
|
|
72
72
|
account_id: e.account_id,
|
|
@@ -80,7 +80,7 @@ function qa(e, t) {
|
|
|
80
80
|
};
|
|
81
81
|
return e.view_id !== void 0 && (n.view_id = e.view_id), e.user_id !== void 0 && (n.user_id = e.user_id), t.widget !== void 0 && (n.widget = t.widget), e.page_type !== void 0 && (n.page_type = e.page_type), e.sku !== void 0 && (n.sku = e.sku), n;
|
|
82
82
|
}
|
|
83
|
-
function
|
|
83
|
+
function Ga(e, t) {
|
|
84
84
|
const n = {
|
|
85
85
|
event_name: "stream.done",
|
|
86
86
|
account_id: e.account_id,
|
|
@@ -94,7 +94,7 @@ function Va(e, t) {
|
|
|
94
94
|
};
|
|
95
95
|
return e.view_id !== void 0 && (n.view_id = e.view_id), e.user_id !== void 0 && (n.user_id = e.user_id), t.widget !== void 0 && (n.widget = t.widget), e.page_type !== void 0 && (n.page_type = e.page_type), e.sku !== void 0 && (n.sku = e.sku), n;
|
|
96
96
|
}
|
|
97
|
-
function
|
|
97
|
+
function Ba(e, t) {
|
|
98
98
|
const n = {
|
|
99
99
|
event_name: "stream.error",
|
|
100
100
|
account_id: e.account_id,
|
|
@@ -108,7 +108,7 @@ function Ga(e, t) {
|
|
|
108
108
|
};
|
|
109
109
|
return e.view_id !== void 0 && (n.view_id = e.view_id), e.user_id !== void 0 && (n.user_id = e.user_id), t.widget !== void 0 && (n.widget = t.widget), e.page_type !== void 0 && (n.page_type = e.page_type), e.sku !== void 0 && (n.sku = e.sku), n;
|
|
110
110
|
}
|
|
111
|
-
function
|
|
111
|
+
function Wa(e, t) {
|
|
112
112
|
const n = {
|
|
113
113
|
model: t.model,
|
|
114
114
|
prompt_tokens: t.prompt_tokens,
|
|
@@ -125,7 +125,7 @@ function Ba(e, t) {
|
|
|
125
125
|
};
|
|
126
126
|
return e.view_id !== void 0 && (r.view_id = e.view_id), e.user_id !== void 0 && (r.user_id = e.user_id), e.page_type !== void 0 && (r.page_type = e.page_type), e.sku !== void 0 && (r.sku = e.sku), r;
|
|
127
127
|
}
|
|
128
|
-
function
|
|
128
|
+
function Ha(e, t) {
|
|
129
129
|
const n = {
|
|
130
130
|
event_name: "metering.increment",
|
|
131
131
|
account_id: e.account_id,
|
|
@@ -153,7 +153,7 @@ function Lt(e, t) {
|
|
|
153
153
|
};
|
|
154
154
|
return e.view_id !== void 0 && (n.view_id = e.view_id), e.user_id !== void 0 && (n.user_id = e.user_id), e.page_type !== void 0 && (n.page_type = e.page_type), e.sku !== void 0 && (n.sku = e.sku), n;
|
|
155
155
|
}
|
|
156
|
-
function
|
|
156
|
+
function Ka(e, t) {
|
|
157
157
|
const n = {
|
|
158
158
|
event_name: "chat.history.snapshot",
|
|
159
159
|
account_id: e.account_id,
|
|
@@ -167,7 +167,7 @@ function Ha(e, t) {
|
|
|
167
167
|
};
|
|
168
168
|
return e.view_id !== void 0 && (n.view_id = e.view_id), e.user_id !== void 0 && (n.user_id = e.user_id), e.page_type !== void 0 && (n.page_type = e.page_type), e.sku !== void 0 && (n.sku = e.sku), n;
|
|
169
169
|
}
|
|
170
|
-
function
|
|
170
|
+
function Ya(e, t) {
|
|
171
171
|
const n = {
|
|
172
172
|
event_name: "widget.history.snapshot",
|
|
173
173
|
account_id: e.account_id,
|
|
@@ -182,7 +182,7 @@ function Ka(e, t) {
|
|
|
182
182
|
};
|
|
183
183
|
return e.view_id !== void 0 && (n.view_id = e.view_id), e.user_id !== void 0 && (n.user_id = e.user_id), e.page_type !== void 0 && (n.page_type = e.page_type), e.sku !== void 0 && (n.sku = e.sku), n;
|
|
184
184
|
}
|
|
185
|
-
function
|
|
185
|
+
function Qa(e, t) {
|
|
186
186
|
const n = {
|
|
187
187
|
event_name: "basket.add",
|
|
188
188
|
account_id: e.account_id,
|
|
@@ -234,7 +234,7 @@ function Mt(e, t) {
|
|
|
234
234
|
};
|
|
235
235
|
return e.view_id !== void 0 && (n.view_id = e.view_id), e.user_id !== void 0 && (n.user_id = e.user_id), e.page_type !== void 0 && (n.page_type = e.page_type), e.sku !== void 0 && (n.sku = e.sku), n;
|
|
236
236
|
}
|
|
237
|
-
function
|
|
237
|
+
function Xa(e, t) {
|
|
238
238
|
window.dispatchEvent(new CustomEvent(e, { detail: t, bubbles: !1 }));
|
|
239
239
|
}
|
|
240
240
|
function ee(e, t) {
|
|
@@ -243,35 +243,87 @@ function ee(e, t) {
|
|
|
243
243
|
};
|
|
244
244
|
return window.addEventListener(e, n), () => window.removeEventListener(e, n);
|
|
245
245
|
}
|
|
246
|
-
function
|
|
246
|
+
function Ft(e) {
|
|
247
|
+
if (e.type !== "user_message" && e.type !== "inputText") return null;
|
|
248
|
+
if (typeof e.payload == "string" && e.payload.trim().length > 0)
|
|
249
|
+
return e.payload.trim();
|
|
250
|
+
if (typeof e.payload == "object" && e.payload !== null && typeof e.payload.text == "string") {
|
|
251
|
+
const t = String(e.payload.text).trim();
|
|
252
|
+
if (t.length > 0) return t;
|
|
253
|
+
}
|
|
254
|
+
return typeof e.title == "string" && e.title.trim().length > 0 ? e.title.trim() : null;
|
|
255
|
+
}
|
|
256
|
+
function ec(e) {
|
|
247
257
|
let t = !1;
|
|
248
|
-
|
|
249
|
-
|
|
258
|
+
const n = [];
|
|
259
|
+
let r = 0, o = null, i = 0;
|
|
260
|
+
const s = 100, a = 5e3;
|
|
261
|
+
function c() {
|
|
262
|
+
return window.gengage?.chat ?? null;
|
|
263
|
+
}
|
|
264
|
+
function u() {
|
|
265
|
+
t || (console.warn(
|
|
250
266
|
"[gengage] QNA tried to open chat, but chat widget is not initialized. Ensure GengageChat is initialized before calling wireQNAToChat()."
|
|
251
|
-
), t = !0), e?.onChatUnavailable?.()
|
|
267
|
+
), t = !0), e?.onChatUnavailable?.();
|
|
268
|
+
}
|
|
269
|
+
function l(m, k) {
|
|
270
|
+
const I = Ft(k);
|
|
271
|
+
if (I && m.sendMessage) {
|
|
272
|
+
m.open?.(), m.sendMessage(I);
|
|
273
|
+
return;
|
|
274
|
+
}
|
|
275
|
+
m.openWithAction?.(k);
|
|
252
276
|
}
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
}
|
|
256
|
-
|
|
277
|
+
function f() {
|
|
278
|
+
o !== null && (window.clearInterval(o), o = null);
|
|
279
|
+
}
|
|
280
|
+
function p() {
|
|
281
|
+
const m = c();
|
|
282
|
+
if (!m) return !1;
|
|
283
|
+
if (r > 0 && (m.open?.(), r = 0), n.length > 0) {
|
|
284
|
+
const k = n.splice(0, n.length);
|
|
285
|
+
for (const I of k)
|
|
286
|
+
l(m, I);
|
|
287
|
+
}
|
|
288
|
+
return f(), !0;
|
|
289
|
+
}
|
|
290
|
+
function g() {
|
|
291
|
+
o === null && (i = Date.now(), o = window.setInterval(() => {
|
|
292
|
+
p() || Date.now() - i >= a && (n.length = 0, r = 0, f());
|
|
293
|
+
}, s));
|
|
294
|
+
}
|
|
295
|
+
const y = ee("gengage:qna:action", (m) => {
|
|
296
|
+
const k = c();
|
|
297
|
+
if (k) {
|
|
298
|
+
l(k, m);
|
|
299
|
+
return;
|
|
300
|
+
}
|
|
301
|
+
u(), n.length >= 20 && n.shift(), n.push(m), g();
|
|
302
|
+
}), _ = ee("gengage:qna:open-chat", () => {
|
|
303
|
+
const m = c();
|
|
304
|
+
if (m) {
|
|
305
|
+
m.open?.();
|
|
306
|
+
return;
|
|
307
|
+
}
|
|
308
|
+
u(), r += 1, g();
|
|
257
309
|
});
|
|
258
310
|
return () => {
|
|
259
|
-
|
|
311
|
+
y(), _(), n.length = 0, r = 0, f();
|
|
260
312
|
};
|
|
261
313
|
}
|
|
262
|
-
function
|
|
314
|
+
function tc() {
|
|
263
315
|
return ee("gengage:similar:product-click", ({ sku: e, url: t, sessionId: n }) => {
|
|
264
316
|
n && window.gengage?.chat?.saveSession(n, e), window.location.href = t;
|
|
265
317
|
});
|
|
266
318
|
}
|
|
267
|
-
function
|
|
319
|
+
function xt() {
|
|
268
320
|
const t = window.__gengageSessionId ?? sessionStorage.getItem("gengage_session_id") ?? null ?? crypto.randomUUID();
|
|
269
321
|
return window.__gengageSessionId = t, sessionStorage.setItem("gengage_session_id", t), window.gengage || (window.gengage = {}), window.gengage.sessionId = t, t;
|
|
270
322
|
}
|
|
271
|
-
function
|
|
323
|
+
function nc() {
|
|
272
324
|
return window.gengage?.pageContext ?? null;
|
|
273
325
|
}
|
|
274
|
-
function
|
|
326
|
+
function rc(e) {
|
|
275
327
|
window.gengage || (window.gengage = {}), window.gengage.pageContext = {
|
|
276
328
|
pageType: "other",
|
|
277
329
|
...window.gengage.pageContext,
|
|
@@ -280,7 +332,7 @@ function nc(e) {
|
|
|
280
332
|
}
|
|
281
333
|
function Jt(e) {
|
|
282
334
|
return {
|
|
283
|
-
sessionId: e?.sessionId ??
|
|
335
|
+
sessionId: e?.sessionId ?? xt(),
|
|
284
336
|
...e
|
|
285
337
|
};
|
|
286
338
|
}
|
|
@@ -298,41 +350,41 @@ const Ee = {
|
|
|
298
350
|
"--gengage-qna-input-radius": "14px",
|
|
299
351
|
"--gengage-simrel-card-radius": "14px"
|
|
300
352
|
};
|
|
301
|
-
function
|
|
353
|
+
function qt(e) {
|
|
302
354
|
return e ? { ...Ee, ...e } : { ...Ee };
|
|
303
355
|
}
|
|
304
|
-
const D = "gengage-global-toast-root", Ze = "gengage-global-toast-style", _e = "gengage-global-toast-root--visible",
|
|
305
|
-
let Te = !1,
|
|
306
|
-
function
|
|
356
|
+
const D = "gengage-global-toast-root", Ze = "gengage-global-toast-style", _e = "gengage-global-toast-root--visible", Vt = 4200, Gt = 1500, Bt = 15e3;
|
|
357
|
+
let Te = !1, J = null;
|
|
358
|
+
function oc(e) {
|
|
307
359
|
return typeof e == "string" && e.toLowerCase().startsWith("tr") ? "Baglanti sorunu olustu. Lutfen tekrar deneyin." : "Connection issue. Please try again.";
|
|
308
360
|
}
|
|
309
|
-
function
|
|
361
|
+
function Wt() {
|
|
310
362
|
Te || typeof window > "u" || typeof document > "u" || (Te = !0, ee("gengage:global:error", (e) => {
|
|
311
|
-
|
|
363
|
+
Ht(e);
|
|
312
364
|
}));
|
|
313
365
|
}
|
|
314
|
-
function
|
|
366
|
+
function Ht(e) {
|
|
315
367
|
if (typeof document > "u") return;
|
|
316
368
|
const t = e.message.trim();
|
|
317
369
|
if (!t) return;
|
|
318
|
-
|
|
319
|
-
const n =
|
|
370
|
+
en();
|
|
371
|
+
const n = Qt();
|
|
320
372
|
n.innerHTML = "";
|
|
321
373
|
const r = document.createElement("section");
|
|
322
374
|
r.className = "gengage-global-toast gengage-global-toast--error", r.setAttribute("role", "status"), r.setAttribute("aria-live", "polite");
|
|
323
375
|
const o = document.createElement("div");
|
|
324
|
-
o.className = "gengage-global-toast-title", o.textContent =
|
|
376
|
+
o.className = "gengage-global-toast-title", o.textContent = Yt(e.source);
|
|
325
377
|
const i = document.createElement("div");
|
|
326
|
-
i.className = "gengage-global-toast-message", i.textContent = t, r.appendChild(o), r.appendChild(i), n.appendChild(r), n.classList.add(_e),
|
|
327
|
-
|
|
328
|
-
},
|
|
378
|
+
i.className = "gengage-global-toast-message", i.textContent = t, r.appendChild(o), r.appendChild(i), n.appendChild(r), n.classList.add(_e), J && (clearTimeout(J), J = null), J = setTimeout(() => {
|
|
379
|
+
Kt();
|
|
380
|
+
}, Xt(e.durationMs));
|
|
329
381
|
}
|
|
330
|
-
function
|
|
382
|
+
function Kt() {
|
|
331
383
|
if (typeof document > "u") return;
|
|
332
384
|
const e = document.getElementById(D);
|
|
333
|
-
e && (e.classList.remove(_e), e.innerHTML = "",
|
|
385
|
+
e && (e.classList.remove(_e), e.innerHTML = "", J && (clearTimeout(J), J = null));
|
|
334
386
|
}
|
|
335
|
-
function
|
|
387
|
+
function Yt(e) {
|
|
336
388
|
switch (e) {
|
|
337
389
|
case "chat":
|
|
338
390
|
return "Chat warning";
|
|
@@ -344,16 +396,16 @@ function Kt(e) {
|
|
|
344
396
|
return "Connection warning";
|
|
345
397
|
}
|
|
346
398
|
}
|
|
347
|
-
function
|
|
399
|
+
function Qt() {
|
|
348
400
|
const e = document.getElementById(D);
|
|
349
401
|
if (e instanceof HTMLElement) return e;
|
|
350
402
|
const t = document.createElement("div");
|
|
351
403
|
return t.id = D, t.className = "gengage-global-toast-root", document.body.appendChild(t), t;
|
|
352
404
|
}
|
|
353
|
-
function
|
|
354
|
-
return typeof e != "number" || !Number.isFinite(e) ?
|
|
405
|
+
function Xt(e) {
|
|
406
|
+
return typeof e != "number" || !Number.isFinite(e) ? Vt : Math.min(Bt, Math.max(Gt, Math.round(e)));
|
|
355
407
|
}
|
|
356
|
-
function
|
|
408
|
+
function en() {
|
|
357
409
|
if (document.getElementById(Ze)) return;
|
|
358
410
|
const e = document.createElement("style");
|
|
359
411
|
e.id = Ze, e.textContent = `
|
|
@@ -403,7 +455,7 @@ function Xt() {
|
|
|
403
455
|
}
|
|
404
456
|
`, document.head.appendChild(e);
|
|
405
457
|
}
|
|
406
|
-
class
|
|
458
|
+
class ic {
|
|
407
459
|
constructor() {
|
|
408
460
|
this.isVisible = !1, this.isInitialised = !1, this._handlers = /* @__PURE__ */ new Map(), this._cleanups = [], this._ownsRoot = !1, this._destroying = !1;
|
|
409
461
|
}
|
|
@@ -415,12 +467,12 @@ class oc {
|
|
|
415
467
|
console.warn("[gengage] Widget already initialised. Call update() instead.");
|
|
416
468
|
return;
|
|
417
469
|
}
|
|
418
|
-
const n =
|
|
470
|
+
const n = qt(t.theme);
|
|
419
471
|
this.config = {
|
|
420
472
|
...t,
|
|
421
473
|
theme: n,
|
|
422
474
|
session: Jt(t.session)
|
|
423
|
-
}, this.root = this._resolveMount(t.mountTarget), this._applyTheme(n),
|
|
475
|
+
}, this.root = this._resolveMount(t.mountTarget), this._applyTheme(n), Wt();
|
|
424
476
|
const r = ee("gengage:context:update", (o) => this.update(o));
|
|
425
477
|
this._cleanups.push(r);
|
|
426
478
|
try {
|
|
@@ -498,19 +550,19 @@ class oc {
|
|
|
498
550
|
if (t) {
|
|
499
551
|
for (const [n, r] of Object.entries(t))
|
|
500
552
|
if (r !== void 0) {
|
|
501
|
-
const o = n.startsWith("--") ? n : `--gengage-${
|
|
553
|
+
const o = n.startsWith("--") ? n : `--gengage-${tn(n)}`;
|
|
502
554
|
this.root.style.setProperty(o, r);
|
|
503
555
|
}
|
|
504
556
|
}
|
|
505
557
|
}
|
|
506
558
|
}
|
|
507
|
-
function
|
|
559
|
+
function tn(e) {
|
|
508
560
|
return e.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
509
561
|
}
|
|
510
562
|
function Ie(e) {
|
|
511
563
|
return typeof e == "object" && e !== null && typeof e.type == "string";
|
|
512
564
|
}
|
|
513
|
-
function
|
|
565
|
+
function nn(e) {
|
|
514
566
|
const t = [];
|
|
515
567
|
let n = 0, r = !1, o = !1, i = 0;
|
|
516
568
|
for (let s = 0; s < e.length; s++) {
|
|
@@ -540,7 +592,7 @@ function Oe(e, t) {
|
|
|
540
592
|
const o = JSON.parse(r);
|
|
541
593
|
return Ie(o) ? (t.onEvent(o), o.type === "done" ? (t.onDone?.(), !0) : !1) : !1;
|
|
542
594
|
} catch {
|
|
543
|
-
const o =
|
|
595
|
+
const o = nn(r);
|
|
544
596
|
if (o.length > 1) {
|
|
545
597
|
for (const i of o)
|
|
546
598
|
try {
|
|
@@ -555,7 +607,7 @@ function Oe(e, t) {
|
|
|
555
607
|
return !1;
|
|
556
608
|
}
|
|
557
609
|
}
|
|
558
|
-
async function
|
|
610
|
+
async function rn(e, t) {
|
|
559
611
|
if (!e.ok) {
|
|
560
612
|
t.onError?.(new Error(`HTTP ${e.status}: ${e.statusText}`));
|
|
561
613
|
return;
|
|
@@ -573,9 +625,9 @@ async function nn(e, t) {
|
|
|
573
625
|
const c = n.read();
|
|
574
626
|
let u;
|
|
575
627
|
const l = await (i > 0 ? Promise.race([
|
|
576
|
-
c.then((
|
|
577
|
-
new Promise((
|
|
578
|
-
u = setTimeout(() =>
|
|
628
|
+
c.then((y) => (clearTimeout(u), y)),
|
|
629
|
+
new Promise((y) => {
|
|
630
|
+
u = setTimeout(() => y(s), i);
|
|
579
631
|
})
|
|
580
632
|
]) : c);
|
|
581
633
|
if (l === s) {
|
|
@@ -588,8 +640,8 @@ async function nn(e, t) {
|
|
|
588
640
|
const g = o.split(`
|
|
589
641
|
`);
|
|
590
642
|
o = g.pop() ?? "";
|
|
591
|
-
for (const
|
|
592
|
-
if (Oe(
|
|
643
|
+
for (const y of g)
|
|
644
|
+
if (Oe(y, t)) return;
|
|
593
645
|
}
|
|
594
646
|
if (o.trim() && Oe(o, t))
|
|
595
647
|
return;
|
|
@@ -601,8 +653,8 @@ async function nn(e, t) {
|
|
|
601
653
|
}
|
|
602
654
|
t.onDone?.();
|
|
603
655
|
}
|
|
604
|
-
function
|
|
605
|
-
const r = new AbortController(), o = n.signal ?
|
|
656
|
+
function sc(e, t, n) {
|
|
657
|
+
const r = new AbortController(), o = n.signal ? on([n.signal, r.signal]) : r.signal;
|
|
606
658
|
return fetch(e, {
|
|
607
659
|
method: "POST",
|
|
608
660
|
headers: {
|
|
@@ -611,11 +663,11 @@ function ic(e, t, n) {
|
|
|
611
663
|
},
|
|
612
664
|
body: JSON.stringify(t),
|
|
613
665
|
signal: o
|
|
614
|
-
}).then((i) =>
|
|
666
|
+
}).then((i) => rn(i, { ...n, signal: o })).catch((i) => {
|
|
615
667
|
i instanceof DOMException && i.name === "AbortError" || n.onError?.(i instanceof Error ? i : new Error(String(i)));
|
|
616
668
|
}), r;
|
|
617
669
|
}
|
|
618
|
-
function
|
|
670
|
+
function on(e) {
|
|
619
671
|
const t = new AbortController(), n = [];
|
|
620
672
|
for (const r of e) {
|
|
621
673
|
if (r.aborted)
|
|
@@ -631,84 +683,84 @@ function rn(e) {
|
|
|
631
683
|
{ once: !0 }
|
|
632
684
|
), t.signal;
|
|
633
685
|
}
|
|
634
|
-
function
|
|
686
|
+
function ac(e) {
|
|
635
687
|
if (typeof e.type != "string") return null;
|
|
636
|
-
if (
|
|
688
|
+
if (sn(e))
|
|
637
689
|
return e;
|
|
638
690
|
const n = e;
|
|
639
691
|
switch (n.type) {
|
|
640
692
|
case "outputText":
|
|
641
|
-
return sn(n);
|
|
642
|
-
case "suggestedActions":
|
|
643
693
|
return an(n);
|
|
644
|
-
case "
|
|
694
|
+
case "suggestedActions":
|
|
645
695
|
return cn(n);
|
|
646
|
-
case "
|
|
696
|
+
case "productList":
|
|
647
697
|
return un(n);
|
|
648
|
-
case "
|
|
698
|
+
case "productDetails":
|
|
649
699
|
return dn(n);
|
|
650
|
-
case "
|
|
700
|
+
case "productDetailsSimilars":
|
|
651
701
|
return ln(n);
|
|
702
|
+
case "comparisonTable":
|
|
703
|
+
return fn(n);
|
|
652
704
|
case "context":
|
|
653
|
-
return
|
|
705
|
+
return mn(n);
|
|
654
706
|
case "chatStreamEnd":
|
|
655
|
-
return
|
|
707
|
+
return _n();
|
|
656
708
|
case "loading":
|
|
657
|
-
return _n(n);
|
|
658
|
-
case "panelLoading":
|
|
659
709
|
return yn(n);
|
|
660
|
-
case "
|
|
710
|
+
case "panelLoading":
|
|
661
711
|
return vn(n);
|
|
662
|
-
case "
|
|
712
|
+
case "similarLoading":
|
|
663
713
|
return wn(n);
|
|
664
|
-
case "
|
|
714
|
+
case "redirect":
|
|
665
715
|
return bn(n);
|
|
716
|
+
case "error":
|
|
717
|
+
return kn(n);
|
|
666
718
|
case "dummy":
|
|
667
|
-
return
|
|
719
|
+
return zn();
|
|
668
720
|
case "launcherAction":
|
|
669
|
-
return
|
|
721
|
+
return $n(n);
|
|
670
722
|
case "text":
|
|
671
723
|
return ye(n);
|
|
672
724
|
case "productItem":
|
|
673
|
-
return
|
|
725
|
+
return Sn(n);
|
|
674
726
|
case "text_image":
|
|
675
727
|
return tt(n);
|
|
676
728
|
case "quick_qna":
|
|
677
729
|
return nt(n);
|
|
678
730
|
case "reviewHighlights":
|
|
679
|
-
return
|
|
731
|
+
return En(n);
|
|
680
732
|
case "aiProductSuggestions":
|
|
681
|
-
return Tn(n);
|
|
682
|
-
case "aiProductGroupings":
|
|
683
733
|
return In(n);
|
|
684
|
-
case "
|
|
734
|
+
case "aiProductGroupings":
|
|
685
735
|
return On(n);
|
|
736
|
+
case "aiSuggestedSearches":
|
|
737
|
+
return Pn(n);
|
|
686
738
|
case "prosAndCons":
|
|
687
|
-
return
|
|
739
|
+
return Zn(n);
|
|
688
740
|
case "getGroundingReview":
|
|
689
|
-
return
|
|
741
|
+
return An(n);
|
|
690
742
|
case "voice":
|
|
691
|
-
return
|
|
743
|
+
return Cn(n);
|
|
692
744
|
case "visitorDataResponse":
|
|
693
|
-
return
|
|
745
|
+
return Tn(n);
|
|
694
746
|
case "productListPreview":
|
|
695
|
-
return
|
|
747
|
+
return Nn();
|
|
696
748
|
case "groupList":
|
|
697
|
-
return
|
|
749
|
+
return Rn(n);
|
|
698
750
|
case "formGetInfo":
|
|
699
751
|
case "formTestDrive":
|
|
700
752
|
case "formServiceRequest":
|
|
701
753
|
case "launchFormPage":
|
|
702
|
-
return
|
|
754
|
+
return jn(n);
|
|
703
755
|
case "launcherContent":
|
|
704
|
-
return
|
|
756
|
+
return Ln(n);
|
|
705
757
|
case "handoff":
|
|
706
|
-
return
|
|
758
|
+
return Dn(n);
|
|
707
759
|
default:
|
|
708
760
|
return null;
|
|
709
761
|
}
|
|
710
762
|
}
|
|
711
|
-
function
|
|
763
|
+
function sn(e) {
|
|
712
764
|
const t = e.type;
|
|
713
765
|
if (typeof t != "string") return !1;
|
|
714
766
|
switch (t) {
|
|
@@ -734,7 +786,7 @@ function on(e) {
|
|
|
734
786
|
return !1;
|
|
735
787
|
}
|
|
736
788
|
}
|
|
737
|
-
function
|
|
789
|
+
function an(e) {
|
|
738
790
|
const t = w(e.payload.text, e.payload.plain_text) ?? "", n = w(e.payload.plain_text, e.payload.text) ?? t;
|
|
739
791
|
if (e.payload.is_error)
|
|
740
792
|
return {
|
|
@@ -755,9 +807,9 @@ function sn(e) {
|
|
|
755
807
|
const s = e.payload.conversation_mode;
|
|
756
808
|
return typeof s == "string" && s && (r.conversationMode = s), r;
|
|
757
809
|
}
|
|
758
|
-
function
|
|
810
|
+
function cn(e) {
|
|
759
811
|
const t = (e.payload.actions ?? []).map((n) => {
|
|
760
|
-
const r = w(n.title) ?? "", o =
|
|
812
|
+
const r = w(n.title) ?? "", o = R(n.requestDetails, r), i = o ? {
|
|
761
813
|
label: r,
|
|
762
814
|
action: o
|
|
763
815
|
} : null;
|
|
@@ -765,13 +817,13 @@ function an(e) {
|
|
|
765
817
|
});
|
|
766
818
|
return rt(t.filter(it), "chat");
|
|
767
819
|
}
|
|
768
|
-
function
|
|
820
|
+
function un(e) {
|
|
769
821
|
const t = ot(e.payload.product_list ?? [], "chat");
|
|
770
822
|
t.panelHint = "panel";
|
|
771
823
|
const n = t.spec.elements[t.spec.root];
|
|
772
824
|
return n && (typeof e.payload.offset == "number" && (n.props = { ...n.props, offset: e.payload.offset }), typeof e.payload.end_of_list == "boolean" && (n.props = { ...n.props, endOfList: e.payload.end_of_list }), typeof e.payload.title == "string" && (n.props = { ...n.props, panelTitle: e.payload.title })), t;
|
|
773
825
|
}
|
|
774
|
-
function
|
|
826
|
+
function dn(e) {
|
|
775
827
|
const t = e.payload.productDetails;
|
|
776
828
|
return t ? {
|
|
777
829
|
type: "ui_spec",
|
|
@@ -786,13 +838,13 @@ function un(e) {
|
|
|
786
838
|
}
|
|
787
839
|
},
|
|
788
840
|
panelHint: "panel"
|
|
789
|
-
} :
|
|
841
|
+
} : Mn("chat");
|
|
790
842
|
}
|
|
791
|
-
function
|
|
843
|
+
function ln(e) {
|
|
792
844
|
const t = ot(e.payload.similarProducts ?? [], "chat"), n = t.spec.elements[t.spec.root];
|
|
793
845
|
return n && (n.props = { ...n.props, similarsAppend: !0 }), { ...t, panelHint: "panel" };
|
|
794
846
|
}
|
|
795
|
-
function
|
|
847
|
+
function fn(e) {
|
|
796
848
|
const t = e.payload.multiple_product_details ?? [], n = e.payload, r = {
|
|
797
849
|
key_differences: n.key_differences,
|
|
798
850
|
recommended_choice: n.recommended_choice,
|
|
@@ -805,33 +857,33 @@ function ln(e) {
|
|
|
805
857
|
winner_hits: n.winner_hits,
|
|
806
858
|
...e.payload.product_comparison_framework ?? {}
|
|
807
859
|
}, o = e.payload.table, i = e.payload.features_list, s = [];
|
|
808
|
-
for (const
|
|
809
|
-
const
|
|
810
|
-
s.push(
|
|
860
|
+
for (const m of t) {
|
|
861
|
+
const k = M(m);
|
|
862
|
+
s.push(k);
|
|
811
863
|
}
|
|
812
|
-
const a =
|
|
864
|
+
const a = pn(o, s, r, i);
|
|
813
865
|
let c;
|
|
814
866
|
r?.recommended_choice_sku ? c = r.recommended_choice_sku : r?.winner_product && r.winner_product.length > 0 && (c = r.winner_product[0]?.product_detail?.sku ?? r.winner_product[0]?.sku);
|
|
815
|
-
const u = c ? s.find((
|
|
867
|
+
const u = c ? s.find((m) => m.sku === c) ?? s[0] : s[0], l = [];
|
|
816
868
|
if (Array.isArray(r?.key_differences))
|
|
817
|
-
for (const
|
|
818
|
-
typeof
|
|
819
|
-
const f =
|
|
820
|
-
for (const
|
|
821
|
-
const
|
|
822
|
-
|
|
823
|
-
title:
|
|
869
|
+
for (const m of r.key_differences)
|
|
870
|
+
typeof m == "string" && l.push(m);
|
|
871
|
+
const f = qn(r?.special_considerations), p = r?.recommended_choice, g = r?.winner_hits, y = {};
|
|
872
|
+
for (const m of s) {
|
|
873
|
+
const k = m.sku;
|
|
874
|
+
k && (y[k] = {
|
|
875
|
+
title: m.name ?? k,
|
|
824
876
|
type: "launchSingleProduct",
|
|
825
|
-
payload: { sku:
|
|
877
|
+
payload: { sku: k }
|
|
826
878
|
});
|
|
827
879
|
}
|
|
828
|
-
const
|
|
880
|
+
const _ = {
|
|
829
881
|
products: s,
|
|
830
882
|
attributes: a,
|
|
831
883
|
highlights: l,
|
|
832
|
-
productActions:
|
|
884
|
+
productActions: y
|
|
833
885
|
};
|
|
834
|
-
return u && (
|
|
886
|
+
return u && (_.recommended = u), f.length > 0 && (_.specialCases = f), p && (_.recommendedText = p), g && (_.winnerHits = g), typeof r?.key_differences == "string" && (_.keyDifferencesHtml = r.key_differences), r?.special_considerations && (_.specialConsiderations = r.special_considerations), {
|
|
835
887
|
type: "ui_spec",
|
|
836
888
|
widget: "chat",
|
|
837
889
|
spec: {
|
|
@@ -839,45 +891,45 @@ function ln(e) {
|
|
|
839
891
|
elements: {
|
|
840
892
|
root: {
|
|
841
893
|
type: "ComparisonTable",
|
|
842
|
-
props:
|
|
894
|
+
props: _
|
|
843
895
|
}
|
|
844
896
|
}
|
|
845
897
|
},
|
|
846
898
|
panelHint: "panel"
|
|
847
899
|
};
|
|
848
900
|
}
|
|
849
|
-
function
|
|
901
|
+
function pn(e, t, n, r) {
|
|
850
902
|
if (!e) return [];
|
|
851
903
|
const o = Object.entries(e);
|
|
852
904
|
if (o.length === 0) return [];
|
|
853
905
|
const i = o[0]?.[1];
|
|
854
906
|
if (Array.isArray(i)) {
|
|
855
|
-
const p = n.criteria_view ?? n.criteria_view_short ?? {}, g = n.compared_field_names ?? Object.keys(e),
|
|
856
|
-
for (const
|
|
857
|
-
const
|
|
858
|
-
if (!
|
|
859
|
-
const
|
|
860
|
-
|
|
907
|
+
const p = n.criteria_view ?? n.criteria_view_short ?? {}, g = n.compared_field_names ?? Object.keys(e), y = [];
|
|
908
|
+
for (const _ of g) {
|
|
909
|
+
const m = e[_];
|
|
910
|
+
if (!m || !Array.isArray(m)) continue;
|
|
911
|
+
const k = p[_] ?? _;
|
|
912
|
+
y.push({ label: k, values: m.map((I) => typeof I == "string" ? I : String(I ?? "")) });
|
|
861
913
|
}
|
|
862
|
-
return
|
|
914
|
+
return y;
|
|
863
915
|
}
|
|
864
|
-
const s = e, a = t.map((p) => String(p.sku ?? "")).filter((p) => p.length > 0), c = n.criteria_view ?? n.criteria_view_short ?? {}, l = (r && r.length > 0 ? r : n.compared_field_names && n.compared_field_names.length > 0 ? n.compared_field_names :
|
|
916
|
+
const s = e, a = t.map((p) => String(p.sku ?? "")).filter((p) => p.length > 0), c = n.criteria_view ?? n.criteria_view_short ?? {}, l = (r && r.length > 0 ? r : n.compared_field_names && n.compared_field_names.length > 0 ? n.compared_field_names : gn(s)).filter(
|
|
865
917
|
(p) => p !== "name" && p !== "name_short" && !p.endsWith("_short")
|
|
866
918
|
), f = [];
|
|
867
919
|
for (const p of l) {
|
|
868
|
-
const g = a.map((
|
|
869
|
-
const
|
|
870
|
-
if (!
|
|
871
|
-
const
|
|
872
|
-
return
|
|
920
|
+
const g = a.map((_) => {
|
|
921
|
+
const m = s[_];
|
|
922
|
+
if (!m || typeof m != "object") return "";
|
|
923
|
+
const k = m[`${p}_short`], I = m[p];
|
|
924
|
+
return hn(k ?? I);
|
|
873
925
|
});
|
|
874
|
-
if (g.every((
|
|
875
|
-
const
|
|
876
|
-
f.push({ label:
|
|
926
|
+
if (g.every((_) => _.length === 0)) continue;
|
|
927
|
+
const y = c[p] ?? p;
|
|
928
|
+
f.push({ label: y, values: g });
|
|
877
929
|
}
|
|
878
930
|
return f;
|
|
879
931
|
}
|
|
880
|
-
function
|
|
932
|
+
function gn(e) {
|
|
881
933
|
const t = [], n = /* @__PURE__ */ new Set();
|
|
882
934
|
for (const r of Object.values(e))
|
|
883
935
|
if (!(!r || typeof r != "object"))
|
|
@@ -885,10 +937,10 @@ function pn(e) {
|
|
|
885
937
|
n.has(o) || (n.add(o), t.push(o));
|
|
886
938
|
return t;
|
|
887
939
|
}
|
|
888
|
-
function
|
|
940
|
+
function hn(e) {
|
|
889
941
|
return typeof e == "string" ? e : typeof e == "number" || typeof e == "boolean" ? String(e) : "";
|
|
890
942
|
}
|
|
891
|
-
function
|
|
943
|
+
function mn(e) {
|
|
892
944
|
return {
|
|
893
945
|
type: "metadata",
|
|
894
946
|
sessionId: "",
|
|
@@ -900,10 +952,10 @@ function hn(e) {
|
|
|
900
952
|
}
|
|
901
953
|
};
|
|
902
954
|
}
|
|
903
|
-
function
|
|
955
|
+
function _n() {
|
|
904
956
|
return { type: "done" };
|
|
905
957
|
}
|
|
906
|
-
function
|
|
958
|
+
function yn(e) {
|
|
907
959
|
return {
|
|
908
960
|
type: "metadata",
|
|
909
961
|
sessionId: "",
|
|
@@ -916,7 +968,7 @@ function _n(e) {
|
|
|
916
968
|
}
|
|
917
969
|
};
|
|
918
970
|
}
|
|
919
|
-
function
|
|
971
|
+
function vn(e) {
|
|
920
972
|
return {
|
|
921
973
|
type: "metadata",
|
|
922
974
|
sessionId: "",
|
|
@@ -929,7 +981,7 @@ function yn(e) {
|
|
|
929
981
|
}
|
|
930
982
|
};
|
|
931
983
|
}
|
|
932
|
-
function
|
|
984
|
+
function wn(e) {
|
|
933
985
|
return {
|
|
934
986
|
type: "metadata",
|
|
935
987
|
sessionId: "",
|
|
@@ -942,7 +994,7 @@ function vn(e) {
|
|
|
942
994
|
}
|
|
943
995
|
};
|
|
944
996
|
}
|
|
945
|
-
function
|
|
997
|
+
function bn(e) {
|
|
946
998
|
const t = w(e.payload.url);
|
|
947
999
|
return t ? {
|
|
948
1000
|
type: "action",
|
|
@@ -961,14 +1013,14 @@ function wn(e) {
|
|
|
961
1013
|
}
|
|
962
1014
|
};
|
|
963
1015
|
}
|
|
964
|
-
function
|
|
1016
|
+
function kn(e) {
|
|
965
1017
|
return {
|
|
966
1018
|
type: "error",
|
|
967
1019
|
code: "BACKEND_ERROR",
|
|
968
1020
|
message: w(e.payload?.text, e.payload?.message, e.payload?.error) ?? "Backend returned an error"
|
|
969
1021
|
};
|
|
970
1022
|
}
|
|
971
|
-
function
|
|
1023
|
+
function zn(e) {
|
|
972
1024
|
return {
|
|
973
1025
|
type: "metadata",
|
|
974
1026
|
sessionId: "",
|
|
@@ -978,7 +1030,7 @@ function kn(e) {
|
|
|
978
1030
|
}
|
|
979
1031
|
};
|
|
980
1032
|
}
|
|
981
|
-
function
|
|
1033
|
+
function $n(e) {
|
|
982
1034
|
const t = e.payload ?? {};
|
|
983
1035
|
if (Array.isArray(t.action_list)) {
|
|
984
1036
|
const i = {
|
|
@@ -1031,11 +1083,11 @@ function ye(e) {
|
|
|
1031
1083
|
}
|
|
1032
1084
|
};
|
|
1033
1085
|
}
|
|
1034
|
-
function
|
|
1035
|
-
return
|
|
1086
|
+
function Sn(e) {
|
|
1087
|
+
return Un(e.payload, "qna");
|
|
1036
1088
|
}
|
|
1037
1089
|
function tt(e) {
|
|
1038
|
-
const t = w(e.payload.text) ?? "", n =
|
|
1090
|
+
const t = w(e.payload.text) ?? "", n = R(e.payload.action, t);
|
|
1039
1091
|
if (n) {
|
|
1040
1092
|
const o = {
|
|
1041
1093
|
label: t || n.title,
|
|
@@ -1064,7 +1116,7 @@ function tt(e) {
|
|
|
1064
1116
|
}
|
|
1065
1117
|
function nt(e) {
|
|
1066
1118
|
const t = (e.payload.action_list ?? []).map((n) => {
|
|
1067
|
-
const r = w(n.title) ?? "", o =
|
|
1119
|
+
const r = w(n.title) ?? "", o = R(n.requestDetails, r), i = o ? {
|
|
1068
1120
|
label: r,
|
|
1069
1121
|
action: o
|
|
1070
1122
|
} : null;
|
|
@@ -1072,7 +1124,7 @@ function nt(e) {
|
|
|
1072
1124
|
});
|
|
1073
1125
|
return rt(t.filter(it), "qna");
|
|
1074
1126
|
}
|
|
1075
|
-
function
|
|
1127
|
+
function En(e) {
|
|
1076
1128
|
const n = { reviews: (e.payload.reviews ?? []).map((r) => {
|
|
1077
1129
|
const o = {};
|
|
1078
1130
|
return typeof r.review_class == "string" && (o.review_class = r.review_class), typeof r.review_text == "string" && (o.review_text = r.review_text), (typeof r.review_rating == "string" || typeof r.review_rating == "number") && (o.review_rating = r.review_rating), typeof r.review_tag == "string" && (o.review_tag = r.review_tag), o;
|
|
@@ -1091,7 +1143,7 @@ function Sn(e) {
|
|
|
1091
1143
|
}
|
|
1092
1144
|
};
|
|
1093
1145
|
}
|
|
1094
|
-
function
|
|
1146
|
+
function Zn(e) {
|
|
1095
1147
|
const t = {};
|
|
1096
1148
|
return Array.isArray(e.payload.pros) && (t.pros = e.payload.pros), Array.isArray(e.payload.cons) && (t.cons = e.payload.cons), typeof e.payload.product_name == "string" && (t.productName = e.payload.product_name), {
|
|
1097
1149
|
type: "ui_spec",
|
|
@@ -1107,7 +1159,7 @@ function En(e) {
|
|
|
1107
1159
|
}
|
|
1108
1160
|
};
|
|
1109
1161
|
}
|
|
1110
|
-
function
|
|
1162
|
+
function Tn(e) {
|
|
1111
1163
|
return {
|
|
1112
1164
|
type: "metadata",
|
|
1113
1165
|
sessionId: "",
|
|
@@ -1117,14 +1169,14 @@ function Zn(e) {
|
|
|
1117
1169
|
}
|
|
1118
1170
|
};
|
|
1119
1171
|
}
|
|
1120
|
-
function
|
|
1172
|
+
function In(e) {
|
|
1121
1173
|
const t = e.payload.product_suggestions ?? [], n = [];
|
|
1122
1174
|
for (let r = 0; r < t.length; r++) {
|
|
1123
1175
|
const o = t[r];
|
|
1124
1176
|
if (!o) continue;
|
|
1125
|
-
const i =
|
|
1177
|
+
const i = Fn(o);
|
|
1126
1178
|
if (!i) continue;
|
|
1127
|
-
const s = { product: i }, a =
|
|
1179
|
+
const s = { product: i }, a = R(o.requestDetails, i.name);
|
|
1128
1180
|
a && (s.action = a), typeof o.role == "string" && (s.role = o.role), typeof o.reason == "string" && (s.reason = o.reason), typeof o.review_highlight == "string" && (s.reviewHighlight = o.review_highlight), Array.isArray(o.labels) && (s.labels = o.labels), typeof o.expert_quality_score == "number" && (s.expertQualityScore = o.expert_quality_score), n.push(s);
|
|
1129
1181
|
}
|
|
1130
1182
|
return n.length === 0 ? {
|
|
@@ -1148,12 +1200,12 @@ function Tn(e) {
|
|
|
1148
1200
|
}
|
|
1149
1201
|
};
|
|
1150
1202
|
}
|
|
1151
|
-
function
|
|
1203
|
+
function On(e) {
|
|
1152
1204
|
const t = e.payload.product_groupings ?? [], n = [];
|
|
1153
1205
|
for (let r = 0; r < t.length; r++) {
|
|
1154
1206
|
const o = t[r];
|
|
1155
1207
|
if (!o) continue;
|
|
1156
|
-
const i = w(o.name) ?? "", s = o.sku && o.sku.length > 0 ? { type: "findSimilar", payload: { sku: o.sku } } : void 0, a =
|
|
1208
|
+
const i = w(o.name) ?? "", s = o.sku && o.sku.length > 0 ? { type: "findSimilar", payload: { sku: o.sku } } : void 0, a = R(o.requestDetails ?? s, i);
|
|
1157
1209
|
if (!a) continue;
|
|
1158
1210
|
const c = { name: i, action: a };
|
|
1159
1211
|
if (Array.isArray(o.labels)) {
|
|
@@ -1183,7 +1235,7 @@ function In(e) {
|
|
|
1183
1235
|
}
|
|
1184
1236
|
};
|
|
1185
1237
|
}
|
|
1186
|
-
function
|
|
1238
|
+
function Pn(e) {
|
|
1187
1239
|
const t = e.payload.suggested_searches ?? [], n = [];
|
|
1188
1240
|
for (let r = 0; r < t.length; r++) {
|
|
1189
1241
|
const o = t[r];
|
|
@@ -1191,15 +1243,15 @@ function On(e) {
|
|
|
1191
1243
|
const i = w(o.short_name, o.chosen_attribute, o.detailed_user_message) ?? `Arama ${r + 1}`, s = {}, a = w(o.detailed_user_message);
|
|
1192
1244
|
a && (s.text = a);
|
|
1193
1245
|
const c = j(o.requestDetails), u = j(c?.payload), l = u?.group_skus;
|
|
1194
|
-
o.group_skus && Array.isArray(o.group_skus) ? s.group_skus = o.group_skus : Array.isArray(l) && (s.group_skus = l.filter((
|
|
1246
|
+
o.group_skus && Array.isArray(o.group_skus) ? s.group_skus = o.group_skus : Array.isArray(l) && (s.group_skus = l.filter((I) => typeof I == "string"));
|
|
1195
1247
|
const f = w(o.sku, o.representative_product_sku, u?.sku);
|
|
1196
1248
|
f && (s.sku = f), s.is_suggested_text = 1;
|
|
1197
|
-
const p = { type: "inputText", payload: s }, g =
|
|
1198
|
-
if (!
|
|
1199
|
-
const
|
|
1200
|
-
|
|
1201
|
-
const
|
|
1202
|
-
|
|
1249
|
+
const p = { type: "inputText", payload: s }, g = R(o.requestDetails, i), y = g?.type === "findSimilar" && typeof s.text == "string" ? R(p, i) : g ?? R(p, i);
|
|
1250
|
+
if (!y) continue;
|
|
1251
|
+
const _ = { shortName: i, action: y }, m = w(o.detailed_user_message);
|
|
1252
|
+
m && m !== i && (_.detailedMessage = m);
|
|
1253
|
+
const k = w(o.why_different);
|
|
1254
|
+
k && (_.whyDifferent = k), typeof o.image == "string" && (_.image = o.image), n.push(_);
|
|
1203
1255
|
}
|
|
1204
1256
|
return n.length === 0 ? {
|
|
1205
1257
|
type: "metadata",
|
|
@@ -1222,8 +1274,8 @@ function On(e) {
|
|
|
1222
1274
|
}
|
|
1223
1275
|
};
|
|
1224
1276
|
}
|
|
1225
|
-
function
|
|
1226
|
-
const t =
|
|
1277
|
+
function An(e) {
|
|
1278
|
+
const t = R(
|
|
1227
1279
|
e.payload.requestDetails,
|
|
1228
1280
|
w(e.payload.review_count, e.payload.text, e.payload.title) ?? "Urun yorumlarini goster"
|
|
1229
1281
|
);
|
|
@@ -1251,7 +1303,7 @@ function Pn(e) {
|
|
|
1251
1303
|
}
|
|
1252
1304
|
};
|
|
1253
1305
|
}
|
|
1254
|
-
function
|
|
1306
|
+
function Nn() {
|
|
1255
1307
|
return {
|
|
1256
1308
|
type: "metadata",
|
|
1257
1309
|
sessionId: "",
|
|
@@ -1261,7 +1313,7 @@ function An() {
|
|
|
1261
1313
|
}
|
|
1262
1314
|
};
|
|
1263
1315
|
}
|
|
1264
|
-
function
|
|
1316
|
+
function Cn(e) {
|
|
1265
1317
|
return {
|
|
1266
1318
|
type: "metadata",
|
|
1267
1319
|
sessionId: "",
|
|
@@ -1271,7 +1323,7 @@ function Nn(e) {
|
|
|
1271
1323
|
}
|
|
1272
1324
|
};
|
|
1273
1325
|
}
|
|
1274
|
-
function
|
|
1326
|
+
function Rn(e) {
|
|
1275
1327
|
const t = e.payload.group_list ?? [], n = [];
|
|
1276
1328
|
for (const o of t) {
|
|
1277
1329
|
const i = o.group_name ?? "", s = (o.product_list ?? []).map(M);
|
|
@@ -1281,7 +1333,7 @@ function Cn(e) {
|
|
|
1281
1333
|
for (const o of e.payload.filter_tags ?? []) {
|
|
1282
1334
|
const i = o.title ?? "";
|
|
1283
1335
|
if (!i) continue;
|
|
1284
|
-
const s =
|
|
1336
|
+
const s = R(o.requestDetails, i), a = { title: i };
|
|
1285
1337
|
s && (a.action = s), r.push(a);
|
|
1286
1338
|
}
|
|
1287
1339
|
return {
|
|
@@ -1299,7 +1351,7 @@ function Cn(e) {
|
|
|
1299
1351
|
panelHint: "panel"
|
|
1300
1352
|
};
|
|
1301
1353
|
}
|
|
1302
|
-
function
|
|
1354
|
+
function jn(e) {
|
|
1303
1355
|
return {
|
|
1304
1356
|
type: "metadata",
|
|
1305
1357
|
sessionId: "",
|
|
@@ -1310,7 +1362,7 @@ function Rn(e) {
|
|
|
1310
1362
|
}
|
|
1311
1363
|
};
|
|
1312
1364
|
}
|
|
1313
|
-
function
|
|
1365
|
+
function Dn(e) {
|
|
1314
1366
|
const t = {};
|
|
1315
1367
|
return typeof e.payload?.summary == "string" && (t.summary = e.payload.summary), Array.isArray(e.payload?.products_discussed) && (t.products_discussed = e.payload.products_discussed), typeof e.payload?.user_sentiment == "string" && (t.user_sentiment = e.payload.user_sentiment), {
|
|
1316
1368
|
type: "ui_spec",
|
|
@@ -1326,7 +1378,7 @@ function jn(e) {
|
|
|
1326
1378
|
}
|
|
1327
1379
|
};
|
|
1328
1380
|
}
|
|
1329
|
-
function
|
|
1381
|
+
function Ln(e) {
|
|
1330
1382
|
return {
|
|
1331
1383
|
type: "metadata",
|
|
1332
1384
|
sessionId: "",
|
|
@@ -1391,7 +1443,7 @@ function ot(e, t) {
|
|
|
1391
1443
|
spec: { root: "root", elements: n }
|
|
1392
1444
|
};
|
|
1393
1445
|
}
|
|
1394
|
-
function
|
|
1446
|
+
function Un(e, t) {
|
|
1395
1447
|
return {
|
|
1396
1448
|
type: "ui_spec",
|
|
1397
1449
|
widget: t,
|
|
@@ -1406,7 +1458,7 @@ function Ln(e, t) {
|
|
|
1406
1458
|
}
|
|
1407
1459
|
};
|
|
1408
1460
|
}
|
|
1409
|
-
function
|
|
1461
|
+
function Mn(e) {
|
|
1410
1462
|
return {
|
|
1411
1463
|
type: "ui_spec",
|
|
1412
1464
|
widget: e,
|
|
@@ -1422,11 +1474,11 @@ function Un(e) {
|
|
|
1422
1474
|
}
|
|
1423
1475
|
};
|
|
1424
1476
|
}
|
|
1425
|
-
function
|
|
1477
|
+
function Fn(e) {
|
|
1426
1478
|
const t = w(e.sku), n = w(e.short_name), r = j(e.product_item) ?? e;
|
|
1427
|
-
return
|
|
1479
|
+
return xn(r, t, n);
|
|
1428
1480
|
}
|
|
1429
|
-
function
|
|
1481
|
+
function xn(e, t, n) {
|
|
1430
1482
|
const r = w(e.sku, t), o = w(e.name, n);
|
|
1431
1483
|
if (!r || !o) return null;
|
|
1432
1484
|
const i = {
|
|
@@ -1440,8 +1492,8 @@ function Fn(e, t, n) {
|
|
|
1440
1492
|
if (c.length > 0)
|
|
1441
1493
|
i.images = c;
|
|
1442
1494
|
else {
|
|
1443
|
-
const
|
|
1444
|
-
|
|
1495
|
+
const y = w(e.image, e.image_url, e.imageUrl);
|
|
1496
|
+
y && (i.images = [y]);
|
|
1445
1497
|
}
|
|
1446
1498
|
const u = Y(e.price_discounted);
|
|
1447
1499
|
u !== void 0 && (i.price_discounted = u);
|
|
@@ -1454,7 +1506,7 @@ function Fn(e, t, n) {
|
|
|
1454
1506
|
const g = w(e.cart_code, e.cartCode);
|
|
1455
1507
|
return g && (i.cart_code = g), typeof e.in_stock == "boolean" && (i.in_stock = e.in_stock), typeof e.inStock == "boolean" && (i.in_stock = e.inStock), M(i);
|
|
1456
1508
|
}
|
|
1457
|
-
function
|
|
1509
|
+
function R(e, t) {
|
|
1458
1510
|
const n = j(e);
|
|
1459
1511
|
if (!n) return null;
|
|
1460
1512
|
const r = n.type;
|
|
@@ -1478,7 +1530,7 @@ function w(...e) {
|
|
|
1478
1530
|
function Jn(e) {
|
|
1479
1531
|
return Array.isArray(e) ? e.filter((t) => typeof t == "string" && t.length > 0) : [];
|
|
1480
1532
|
}
|
|
1481
|
-
function
|
|
1533
|
+
function qn(e) {
|
|
1482
1534
|
if (typeof e == "string") {
|
|
1483
1535
|
const t = e.trim();
|
|
1484
1536
|
return t ? [t] : [];
|
|
@@ -1508,10 +1560,10 @@ function M(e) {
|
|
|
1508
1560
|
}, c = e.images?.[0];
|
|
1509
1561
|
return c && (a.imageUrl = c), e.images && e.images.length > 1 && (a.images = e.images), t != null && (a.price = String(t)), n != null && (a.originalPrice = String(n)), r !== void 0 && (a.discountPercent = r), o !== void 0 && (a.brand = o), e.rating !== void 0 && (a.rating = e.rating), e.review_count !== void 0 && (a.reviewCount = e.review_count), e.cart_code !== void 0 && (a.cartCode = e.cart_code), e.in_stock !== void 0 && (a.inStock = e.in_stock), e.variants && e.variants.length > 0 && (a.variants = e.variants), e.discount_reason !== void 0 && (a.discountReason = e.discount_reason), e.promotions && e.promotions.length > 0 && (a.promotions = e.promotions), a;
|
|
1510
1562
|
}
|
|
1511
|
-
function
|
|
1563
|
+
function cc(e) {
|
|
1512
1564
|
return e.results.map(M);
|
|
1513
1565
|
}
|
|
1514
|
-
function
|
|
1566
|
+
function uc(e) {
|
|
1515
1567
|
return e.product_groupings.map((t) => {
|
|
1516
1568
|
const n = {
|
|
1517
1569
|
name: t.name,
|
|
@@ -1520,117 +1572,117 @@ function cc(e) {
|
|
|
1520
1572
|
return t.highlight !== void 0 && (n.highlight = t.highlight), n;
|
|
1521
1573
|
});
|
|
1522
1574
|
}
|
|
1523
|
-
const
|
|
1575
|
+
const Vn = {
|
|
1524
1576
|
process_action: "/process_action",
|
|
1525
1577
|
launcher_action: "/launcher_action",
|
|
1526
1578
|
similar_products: "/similar_products",
|
|
1527
1579
|
product_groupings: "/product_groupings",
|
|
1528
1580
|
proactive_action: "/proactive_action"
|
|
1529
|
-
},
|
|
1581
|
+
}, Gn = {
|
|
1530
1582
|
process_action: "/message",
|
|
1531
1583
|
launcher_action: "/message"
|
|
1532
1584
|
};
|
|
1533
|
-
function
|
|
1585
|
+
function Bn(e) {
|
|
1534
1586
|
if (e === void 0)
|
|
1535
1587
|
throw new Error("[gengage] middlewareUrl is required. Pass your Gengage backend URL in widget config.");
|
|
1536
1588
|
const t = e.trim();
|
|
1537
1589
|
return t === "" ? "" : t.replace(/\/+$/, "");
|
|
1538
1590
|
}
|
|
1539
|
-
function
|
|
1540
|
-
const n =
|
|
1591
|
+
function dc(e, t) {
|
|
1592
|
+
const n = Bn(t?.middlewareUrl);
|
|
1541
1593
|
if (t.backendType === "acap") {
|
|
1542
|
-
const r = t.accountId ?? "", o =
|
|
1594
|
+
const r = t.accountId ?? "", o = Gn[e];
|
|
1543
1595
|
if (o)
|
|
1544
1596
|
return `${n}/api/chat/${r}${o}`;
|
|
1545
1597
|
}
|
|
1546
|
-
return `${n}/chat${
|
|
1598
|
+
return `${n}/chat${Vn[e]}`;
|
|
1547
1599
|
}
|
|
1548
|
-
function
|
|
1600
|
+
function Wn() {
|
|
1549
1601
|
return typeof window < "u" && Array.isArray(window.dataLayer);
|
|
1550
1602
|
}
|
|
1551
|
-
function
|
|
1603
|
+
function Z(e, t) {
|
|
1552
1604
|
const n = {
|
|
1553
1605
|
event: e,
|
|
1554
1606
|
...t
|
|
1555
1607
|
};
|
|
1556
|
-
|
|
1608
|
+
Wn() && window.dataLayer.push(n);
|
|
1557
1609
|
}
|
|
1558
|
-
function
|
|
1559
|
-
|
|
1610
|
+
function Hn(e) {
|
|
1611
|
+
Z("gengage-on-init", { gengage_widget: e });
|
|
1560
1612
|
}
|
|
1561
1613
|
function Pe(e) {
|
|
1562
|
-
|
|
1614
|
+
Z("gengage-show", { gengage_widget: e });
|
|
1563
1615
|
}
|
|
1564
|
-
function
|
|
1565
|
-
|
|
1616
|
+
function Kn(e) {
|
|
1617
|
+
Z("gengage-hide", { gengage_widget: e });
|
|
1566
1618
|
}
|
|
1567
|
-
function
|
|
1568
|
-
|
|
1619
|
+
function Yn(e, t) {
|
|
1620
|
+
Z("gengage-suggested-question", {
|
|
1569
1621
|
gengage_question_title: e,
|
|
1570
1622
|
gengage_action_type: t
|
|
1571
1623
|
});
|
|
1572
1624
|
}
|
|
1573
|
-
function dc(e) {
|
|
1574
|
-
E("gengage-find-similars", { gengage_sku: e });
|
|
1575
|
-
}
|
|
1576
1625
|
function lc(e) {
|
|
1577
|
-
|
|
1626
|
+
Z("gengage-find-similars", { gengage_sku: e });
|
|
1578
1627
|
}
|
|
1579
1628
|
function fc(e) {
|
|
1580
|
-
|
|
1629
|
+
Z("gengage-compare-preselection", { gengage_sku: e });
|
|
1630
|
+
}
|
|
1631
|
+
function pc(e) {
|
|
1632
|
+
Z("gengage-compare-selected", {
|
|
1581
1633
|
gengage_skus: e,
|
|
1582
1634
|
gengage_product_count: e.length
|
|
1583
1635
|
});
|
|
1584
1636
|
}
|
|
1585
|
-
function
|
|
1586
|
-
|
|
1637
|
+
function gc() {
|
|
1638
|
+
Z("gengage-compare-clear");
|
|
1587
1639
|
}
|
|
1588
|
-
function
|
|
1589
|
-
|
|
1640
|
+
function hc(e) {
|
|
1641
|
+
Z("gengage-compare-received", {
|
|
1590
1642
|
gengage_product_count: e
|
|
1591
1643
|
});
|
|
1592
1644
|
}
|
|
1593
|
-
function
|
|
1594
|
-
|
|
1645
|
+
function mc(e) {
|
|
1646
|
+
Z("gengage-like-product", { gengage_sku: e });
|
|
1595
1647
|
}
|
|
1596
|
-
function
|
|
1597
|
-
|
|
1648
|
+
function _c() {
|
|
1649
|
+
Z("gengage-like-list");
|
|
1598
1650
|
}
|
|
1599
|
-
function
|
|
1600
|
-
|
|
1651
|
+
function yc(e, t) {
|
|
1652
|
+
Z("gengage-search", {
|
|
1601
1653
|
gengage_search_query: e,
|
|
1602
1654
|
gengage_result_count: t
|
|
1603
1655
|
});
|
|
1604
1656
|
}
|
|
1605
|
-
function
|
|
1606
|
-
|
|
1657
|
+
function Qn(e, t) {
|
|
1658
|
+
Z("gengage-product-detail", {
|
|
1607
1659
|
gengage_sku: e,
|
|
1608
1660
|
gengage_product_name: t
|
|
1609
1661
|
});
|
|
1610
1662
|
}
|
|
1611
1663
|
function Ae(e, t) {
|
|
1612
|
-
|
|
1664
|
+
Z("gengage-cart-add", {
|
|
1613
1665
|
gengage_sku: e,
|
|
1614
1666
|
gengage_quantity: t
|
|
1615
1667
|
});
|
|
1616
1668
|
}
|
|
1617
|
-
function yc() {
|
|
1618
|
-
E("gengage-message-sent");
|
|
1619
|
-
}
|
|
1620
1669
|
function vc() {
|
|
1621
|
-
|
|
1670
|
+
Z("gengage-message-sent");
|
|
1622
1671
|
}
|
|
1623
1672
|
function wc() {
|
|
1624
|
-
|
|
1673
|
+
Z("gengage-message-received");
|
|
1625
1674
|
}
|
|
1626
|
-
function
|
|
1627
|
-
|
|
1675
|
+
function bc() {
|
|
1676
|
+
Z("gengage-conversation-start");
|
|
1677
|
+
}
|
|
1678
|
+
function Xn() {
|
|
1679
|
+
Z("gengage-voice-input");
|
|
1628
1680
|
}
|
|
1629
|
-
function
|
|
1630
|
-
|
|
1681
|
+
function er(e, t) {
|
|
1682
|
+
Z("gengage-error", { gengage_widget: e, gengage_error: t });
|
|
1631
1683
|
}
|
|
1632
1684
|
let Q = null;
|
|
1633
|
-
function
|
|
1685
|
+
function kc() {
|
|
1634
1686
|
if (typeof window > "u") return () => {
|
|
1635
1687
|
};
|
|
1636
1688
|
if (Q) return Q;
|
|
@@ -1639,16 +1691,16 @@ function bc() {
|
|
|
1639
1691
|
const o = (i) => r(i.detail);
|
|
1640
1692
|
window.addEventListener(n, o), e.push(() => window.removeEventListener(n, o));
|
|
1641
1693
|
}
|
|
1642
|
-
return t("gengage:chat:open", () => Pe("chat")), t("gengage:chat:close", () =>
|
|
1694
|
+
return t("gengage:chat:open", () => Pe("chat")), t("gengage:chat:close", () => Kn("chat")), t("gengage:chat:ready", () => Hn("chat")), t("gengage:chat:add-to-cart", ({ sku: n, quantity: r }) => {
|
|
1643
1695
|
Ae(n, r);
|
|
1644
1696
|
}), t("gengage:similar:add-to-cart", ({ sku: n, quantity: r }) => {
|
|
1645
1697
|
Ae(n, r);
|
|
1646
1698
|
}), t("gengage:similar:product-click", ({ sku: n }) => {
|
|
1647
|
-
|
|
1699
|
+
Qn(n);
|
|
1648
1700
|
}), t("gengage:qna:action", ({ title: n, type: r }) => {
|
|
1649
|
-
|
|
1650
|
-
}), t("gengage:chat:voice", () =>
|
|
1651
|
-
|
|
1701
|
+
Yn(n, r);
|
|
1702
|
+
}), t("gengage:chat:voice", () => Xn()), t("gengage:qna:open-chat", () => Pe("chat")), t("gengage:global:error", ({ source: n, message: r }) => {
|
|
1703
|
+
er(n, r);
|
|
1652
1704
|
}), Q = () => {
|
|
1653
1705
|
for (const n of e) n();
|
|
1654
1706
|
e.length = 0, Q = null;
|
|
@@ -1726,7 +1778,7 @@ function be(e) {
|
|
|
1726
1778
|
const t = e.startsWith("^") ? 1 : 0, n = e.endsWith("$") ? e.length - 1 : e.length;
|
|
1727
1779
|
return e.slice(t, n);
|
|
1728
1780
|
}
|
|
1729
|
-
function
|
|
1781
|
+
function tr(e, t) {
|
|
1730
1782
|
const n = (e.toString().split(".")[1] || "").length, r = t.toString();
|
|
1731
1783
|
let o = (r.split(".")[1] || "").length;
|
|
1732
1784
|
if (o === 0 && /\d?e-\d?/.test(r)) {
|
|
@@ -1737,7 +1789,7 @@ function er(e, t) {
|
|
|
1737
1789
|
return s % a / 10 ** i;
|
|
1738
1790
|
}
|
|
1739
1791
|
const Ne = /* @__PURE__ */ Symbol("evaluating");
|
|
1740
|
-
function
|
|
1792
|
+
function v(e, t, n) {
|
|
1741
1793
|
let r;
|
|
1742
1794
|
Object.defineProperty(e, t, {
|
|
1743
1795
|
get() {
|
|
@@ -1772,7 +1824,7 @@ function F(...e) {
|
|
|
1772
1824
|
function Ce(e) {
|
|
1773
1825
|
return JSON.stringify(e);
|
|
1774
1826
|
}
|
|
1775
|
-
function
|
|
1827
|
+
function nr(e) {
|
|
1776
1828
|
return e.toLowerCase().trim().replace(/[^\w\s-]/g, "").replace(/[\s_-]+/g, "-").replace(/^-+|-+$/g, "");
|
|
1777
1829
|
}
|
|
1778
1830
|
const ut = "captureStackTrace" in Error ? Error.captureStackTrace : (...e) => {
|
|
@@ -1780,7 +1832,7 @@ const ut = "captureStackTrace" in Error ? Error.captureStackTrace : (...e) => {
|
|
|
1780
1832
|
function ie(e) {
|
|
1781
1833
|
return typeof e == "object" && e !== null && !Array.isArray(e);
|
|
1782
1834
|
}
|
|
1783
|
-
const
|
|
1835
|
+
const rr = ve(() => {
|
|
1784
1836
|
if (typeof navigator < "u" && navigator?.userAgent?.includes("Cloudflare"))
|
|
1785
1837
|
return !1;
|
|
1786
1838
|
try {
|
|
@@ -1802,11 +1854,11 @@ function W(e) {
|
|
|
1802
1854
|
function dt(e) {
|
|
1803
1855
|
return W(e) ? { ...e } : Array.isArray(e) ? [...e] : e;
|
|
1804
1856
|
}
|
|
1805
|
-
const
|
|
1857
|
+
const or = /* @__PURE__ */ new Set(["string", "number", "symbol"]);
|
|
1806
1858
|
function H(e) {
|
|
1807
1859
|
return e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
1808
1860
|
}
|
|
1809
|
-
function
|
|
1861
|
+
function x(e, t, n) {
|
|
1810
1862
|
const r = new e._zod.constr(t ?? e._zod.def);
|
|
1811
1863
|
return (!t || n?.parent) && (r._zod.parent = e), r;
|
|
1812
1864
|
}
|
|
@@ -1823,17 +1875,17 @@ function h(e) {
|
|
|
1823
1875
|
}
|
|
1824
1876
|
return delete t.message, typeof t.error == "string" ? { ...t, error: () => t.error } : t;
|
|
1825
1877
|
}
|
|
1826
|
-
function
|
|
1878
|
+
function ir(e) {
|
|
1827
1879
|
return Object.keys(e).filter((t) => e[t]._zod.optin === "optional" && e[t]._zod.optout === "optional");
|
|
1828
1880
|
}
|
|
1829
|
-
const
|
|
1881
|
+
const sr = {
|
|
1830
1882
|
safeint: [Number.MIN_SAFE_INTEGER, Number.MAX_SAFE_INTEGER],
|
|
1831
1883
|
int32: [-2147483648, 2147483647],
|
|
1832
1884
|
uint32: [0, 4294967295],
|
|
1833
1885
|
float32: [-34028234663852886e22, 34028234663852886e22],
|
|
1834
1886
|
float64: [-Number.MAX_VALUE, Number.MAX_VALUE]
|
|
1835
1887
|
};
|
|
1836
|
-
function
|
|
1888
|
+
function ar(e, t) {
|
|
1837
1889
|
const n = e._zod.def, r = n.checks;
|
|
1838
1890
|
if (r && r.length > 0)
|
|
1839
1891
|
throw new Error(".pick() cannot be used on object schemas containing refinements");
|
|
@@ -1849,9 +1901,9 @@ function sr(e, t) {
|
|
|
1849
1901
|
},
|
|
1850
1902
|
checks: []
|
|
1851
1903
|
});
|
|
1852
|
-
return
|
|
1904
|
+
return x(e, i);
|
|
1853
1905
|
}
|
|
1854
|
-
function
|
|
1906
|
+
function cr(e, t) {
|
|
1855
1907
|
const n = e._zod.def, r = n.checks;
|
|
1856
1908
|
if (r && r.length > 0)
|
|
1857
1909
|
throw new Error(".omit() cannot be used on object schemas containing refinements");
|
|
@@ -1867,9 +1919,9 @@ function ar(e, t) {
|
|
|
1867
1919
|
},
|
|
1868
1920
|
checks: []
|
|
1869
1921
|
});
|
|
1870
|
-
return
|
|
1922
|
+
return x(e, i);
|
|
1871
1923
|
}
|
|
1872
|
-
function
|
|
1924
|
+
function ur(e, t) {
|
|
1873
1925
|
if (!W(t))
|
|
1874
1926
|
throw new Error("Invalid input to extend: expected a plain object");
|
|
1875
1927
|
const n = e._zod.def.checks;
|
|
@@ -1885,9 +1937,9 @@ function cr(e, t) {
|
|
|
1885
1937
|
return q(this, "shape", i), i;
|
|
1886
1938
|
}
|
|
1887
1939
|
});
|
|
1888
|
-
return
|
|
1940
|
+
return x(e, o);
|
|
1889
1941
|
}
|
|
1890
|
-
function
|
|
1942
|
+
function dr(e, t) {
|
|
1891
1943
|
if (!W(t))
|
|
1892
1944
|
throw new Error("Invalid input to safeExtend: expected a plain object");
|
|
1893
1945
|
const n = F(e._zod.def, {
|
|
@@ -1896,9 +1948,9 @@ function ur(e, t) {
|
|
|
1896
1948
|
return q(this, "shape", r), r;
|
|
1897
1949
|
}
|
|
1898
1950
|
});
|
|
1899
|
-
return
|
|
1951
|
+
return x(e, n);
|
|
1900
1952
|
}
|
|
1901
|
-
function
|
|
1953
|
+
function lr(e, t) {
|
|
1902
1954
|
const n = F(e._zod.def, {
|
|
1903
1955
|
get shape() {
|
|
1904
1956
|
const r = { ...e._zod.def.shape, ...t._zod.def.shape };
|
|
@@ -1910,9 +1962,9 @@ function dr(e, t) {
|
|
|
1910
1962
|
checks: []
|
|
1911
1963
|
// delete existing checks
|
|
1912
1964
|
});
|
|
1913
|
-
return
|
|
1965
|
+
return x(e, n);
|
|
1914
1966
|
}
|
|
1915
|
-
function
|
|
1967
|
+
function fr(e, t, n) {
|
|
1916
1968
|
const o = t._zod.def.checks;
|
|
1917
1969
|
if (o && o.length > 0)
|
|
1918
1970
|
throw new Error(".partial() cannot be used on object schemas containing refinements");
|
|
@@ -1938,9 +1990,9 @@ function lr(e, t, n) {
|
|
|
1938
1990
|
},
|
|
1939
1991
|
checks: []
|
|
1940
1992
|
});
|
|
1941
|
-
return
|
|
1993
|
+
return x(t, s);
|
|
1942
1994
|
}
|
|
1943
|
-
function
|
|
1995
|
+
function pr(e, t, n) {
|
|
1944
1996
|
const r = F(t._zod.def, {
|
|
1945
1997
|
get shape() {
|
|
1946
1998
|
const o = t._zod.def.shape, i = { ...o };
|
|
@@ -1962,7 +2014,7 @@ function fr(e, t, n) {
|
|
|
1962
2014
|
return q(this, "shape", i), i;
|
|
1963
2015
|
}
|
|
1964
2016
|
});
|
|
1965
|
-
return
|
|
2017
|
+
return x(t, r);
|
|
1966
2018
|
}
|
|
1967
2019
|
function V(e, t = 0) {
|
|
1968
2020
|
if (e.aborted === !0)
|
|
@@ -2013,13 +2065,13 @@ const lt = (e, t) => {
|
|
|
2013
2065
|
enumerable: !1
|
|
2014
2066
|
});
|
|
2015
2067
|
}, ft = d("$ZodError", lt), pt = d("$ZodError", lt, { Parent: Error });
|
|
2016
|
-
function
|
|
2068
|
+
function gr(e, t = (n) => n.message) {
|
|
2017
2069
|
const n = {}, r = [];
|
|
2018
2070
|
for (const o of e.issues)
|
|
2019
2071
|
o.path.length > 0 ? (n[o.path[0]] = n[o.path[0]] || [], n[o.path[0]].push(t(o))) : r.push(t(o));
|
|
2020
2072
|
return { formErrors: r, fieldErrors: n };
|
|
2021
2073
|
}
|
|
2022
|
-
function
|
|
2074
|
+
function hr(e, t = (n) => n.message) {
|
|
2023
2075
|
const n = { _errors: [] }, r = (o) => {
|
|
2024
2076
|
for (const i of o.issues)
|
|
2025
2077
|
if (i.code === "invalid_union" && i.errors.length)
|
|
@@ -2065,47 +2117,47 @@ const ze = (e) => (t, n, r, o) => {
|
|
|
2065
2117
|
success: !1,
|
|
2066
2118
|
error: new (e ?? ft)(i.issues.map((s) => U(s, o, L())))
|
|
2067
2119
|
} : { success: !0, data: i.value };
|
|
2068
|
-
},
|
|
2120
|
+
}, mr = /* @__PURE__ */ ue(pt), de = (e) => async (t, n, r) => {
|
|
2069
2121
|
const o = r ? Object.assign(r, { async: !0 }) : { async: !0 };
|
|
2070
2122
|
let i = t._zod.run({ value: n, issues: [] }, o);
|
|
2071
2123
|
return i instanceof Promise && (i = await i), i.issues.length ? {
|
|
2072
2124
|
success: !1,
|
|
2073
2125
|
error: new e(i.issues.map((s) => U(s, o, L())))
|
|
2074
2126
|
} : { success: !0, data: i.value };
|
|
2075
|
-
},
|
|
2127
|
+
}, _r = /* @__PURE__ */ de(pt), yr = (e) => (t, n, r) => {
|
|
2076
2128
|
const o = r ? Object.assign(r, { direction: "backward" }) : { direction: "backward" };
|
|
2077
2129
|
return ze(e)(t, n, o);
|
|
2078
|
-
},
|
|
2130
|
+
}, vr = (e) => (t, n, r) => ze(e)(t, n, r), wr = (e) => async (t, n, r) => {
|
|
2079
2131
|
const o = r ? Object.assign(r, { direction: "backward" }) : { direction: "backward" };
|
|
2080
2132
|
return $e(e)(t, n, o);
|
|
2081
|
-
},
|
|
2133
|
+
}, br = (e) => async (t, n, r) => $e(e)(t, n, r), kr = (e) => (t, n, r) => {
|
|
2082
2134
|
const o = r ? Object.assign(r, { direction: "backward" }) : { direction: "backward" };
|
|
2083
2135
|
return ue(e)(t, n, o);
|
|
2084
|
-
},
|
|
2136
|
+
}, zr = (e) => (t, n, r) => ue(e)(t, n, r), $r = (e) => async (t, n, r) => {
|
|
2085
2137
|
const o = r ? Object.assign(r, { direction: "backward" }) : { direction: "backward" };
|
|
2086
2138
|
return de(e)(t, n, o);
|
|
2087
|
-
},
|
|
2088
|
-
function
|
|
2089
|
-
return new RegExp(
|
|
2139
|
+
}, Sr = (e) => async (t, n, r) => de(e)(t, n, r), Er = /^[cC][^\s-]{8,}$/, Zr = /^[0-9a-z]+$/, Tr = /^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/, Ir = /^[0-9a-vA-V]{20}$/, Or = /^[A-Za-z0-9]{27}$/, Pr = /^[a-zA-Z0-9_-]{21}$/, Ar = /^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/, Nr = /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/, Re = (e) => e ? new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`) : /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/, Cr = /^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/, Rr = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
|
|
2140
|
+
function jr() {
|
|
2141
|
+
return new RegExp(Rr, "u");
|
|
2090
2142
|
}
|
|
2091
|
-
const
|
|
2143
|
+
const Dr = /^(?:(?: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])$/, Lr = /^(([0-9a-fA-F]{1,4}:){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}|:))$/, Ur = /^((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])\/([0-9]|[1-2][0-9]|3[0-2])$/, Mr = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/, Fr = /^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/, gt = /^[A-Za-z0-9_-]*$/, xr = /^\+[1-9]\d{6,14}$/, ht = "(?:(?:\\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])))", Jr = /* @__PURE__ */ new RegExp(`^${ht}$`);
|
|
2092
2144
|
function mt(e) {
|
|
2093
2145
|
const t = "(?:[01]\\d|2[0-3]):[0-5]\\d";
|
|
2094
2146
|
return typeof e.precision == "number" ? e.precision === -1 ? `${t}` : e.precision === 0 ? `${t}:[0-5]\\d` : `${t}:[0-5]\\d\\.\\d{${e.precision}}` : `${t}(?::[0-5]\\d(?:\\.\\d+)?)?`;
|
|
2095
2147
|
}
|
|
2096
|
-
function
|
|
2148
|
+
function qr(e) {
|
|
2097
2149
|
return new RegExp(`^${mt(e)}$`);
|
|
2098
2150
|
}
|
|
2099
|
-
function
|
|
2151
|
+
function Vr(e) {
|
|
2100
2152
|
const t = mt({ precision: e.precision }), n = ["Z"];
|
|
2101
2153
|
e.local && n.push(""), e.offset && n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");
|
|
2102
2154
|
const r = `${t}(?:${n.join("|")})`;
|
|
2103
2155
|
return new RegExp(`^${ht}T(?:${r})$`);
|
|
2104
2156
|
}
|
|
2105
|
-
const
|
|
2157
|
+
const Gr = (e) => {
|
|
2106
2158
|
const t = e ? `[\\s\\S]{${e?.minimum ?? 0},${e?.maximum ?? ""}}` : "[\\s\\S]*";
|
|
2107
2159
|
return new RegExp(`^${t}$`);
|
|
2108
|
-
},
|
|
2160
|
+
}, Br = /^-?\d+$/, _t = /^-?\d+(?:\.\d+)?$/, Wr = /^(?:true|false)$/i, Hr = /^[^A-Z]*$/, Kr = /^[^a-z]*$/, P = /* @__PURE__ */ d("$ZodCheck", (e, t) => {
|
|
2109
2161
|
var n;
|
|
2110
2162
|
e._zod ?? (e._zod = {}), e._zod.def = t, (n = e._zod).onattach ?? (n.onattach = []);
|
|
2111
2163
|
}), yt = {
|
|
@@ -2113,7 +2165,7 @@ const Vr = (e) => {
|
|
|
2113
2165
|
bigint: "bigint",
|
|
2114
2166
|
object: "date"
|
|
2115
2167
|
}, vt = /* @__PURE__ */ d("$ZodCheckLessThan", (e, t) => {
|
|
2116
|
-
|
|
2168
|
+
P.init(e, t);
|
|
2117
2169
|
const n = yt[typeof t.value];
|
|
2118
2170
|
e._zod.onattach.push((r) => {
|
|
2119
2171
|
const o = r._zod.bag, i = (t.inclusive ? o.maximum : o.exclusiveMaximum) ?? Number.POSITIVE_INFINITY;
|
|
@@ -2130,7 +2182,7 @@ const Vr = (e) => {
|
|
|
2130
2182
|
});
|
|
2131
2183
|
};
|
|
2132
2184
|
}), wt = /* @__PURE__ */ d("$ZodCheckGreaterThan", (e, t) => {
|
|
2133
|
-
|
|
2185
|
+
P.init(e, t);
|
|
2134
2186
|
const n = yt[typeof t.value];
|
|
2135
2187
|
e._zod.onattach.push((r) => {
|
|
2136
2188
|
const o = r._zod.bag, i = (t.inclusive ? o.minimum : o.exclusiveMinimum) ?? Number.NEGATIVE_INFINITY;
|
|
@@ -2146,14 +2198,14 @@ const Vr = (e) => {
|
|
|
2146
2198
|
continue: !t.abort
|
|
2147
2199
|
});
|
|
2148
2200
|
};
|
|
2149
|
-
}),
|
|
2150
|
-
|
|
2201
|
+
}), Yr = /* @__PURE__ */ d("$ZodCheckMultipleOf", (e, t) => {
|
|
2202
|
+
P.init(e, t), e._zod.onattach.push((n) => {
|
|
2151
2203
|
var r;
|
|
2152
2204
|
(r = n._zod.bag).multipleOf ?? (r.multipleOf = t.value);
|
|
2153
2205
|
}), e._zod.check = (n) => {
|
|
2154
2206
|
if (typeof n.value != typeof t.value)
|
|
2155
2207
|
throw new Error("Cannot mix number and bigint in multiple_of check.");
|
|
2156
|
-
(typeof n.value == "bigint" ? n.value % t.value === BigInt(0) :
|
|
2208
|
+
(typeof n.value == "bigint" ? n.value % t.value === BigInt(0) : tr(n.value, t.value) === 0) || n.issues.push({
|
|
2157
2209
|
origin: typeof n.value,
|
|
2158
2210
|
code: "not_multiple_of",
|
|
2159
2211
|
divisor: t.value,
|
|
@@ -2162,12 +2214,12 @@ const Vr = (e) => {
|
|
|
2162
2214
|
continue: !t.abort
|
|
2163
2215
|
});
|
|
2164
2216
|
};
|
|
2165
|
-
}),
|
|
2166
|
-
|
|
2167
|
-
const n = t.format?.includes("int"), r = n ? "int" : "number", [o, i] =
|
|
2217
|
+
}), Qr = /* @__PURE__ */ d("$ZodCheckNumberFormat", (e, t) => {
|
|
2218
|
+
P.init(e, t), t.format = t.format || "float64";
|
|
2219
|
+
const n = t.format?.includes("int"), r = n ? "int" : "number", [o, i] = sr[t.format];
|
|
2168
2220
|
e._zod.onattach.push((s) => {
|
|
2169
2221
|
const a = s._zod.bag;
|
|
2170
|
-
a.format = t.format, a.minimum = o, a.maximum = i, n && (a.pattern =
|
|
2222
|
+
a.format = t.format, a.minimum = o, a.maximum = i, n && (a.pattern = Br);
|
|
2171
2223
|
}), e._zod.check = (s) => {
|
|
2172
2224
|
const a = s.value;
|
|
2173
2225
|
if (n) {
|
|
@@ -2223,9 +2275,9 @@ const Vr = (e) => {
|
|
|
2223
2275
|
continue: !t.abort
|
|
2224
2276
|
});
|
|
2225
2277
|
};
|
|
2226
|
-
}),
|
|
2278
|
+
}), Xr = /* @__PURE__ */ d("$ZodCheckMaxLength", (e, t) => {
|
|
2227
2279
|
var n;
|
|
2228
|
-
|
|
2280
|
+
P.init(e, t), (n = e._zod.def).when ?? (n.when = (r) => {
|
|
2229
2281
|
const o = r.value;
|
|
2230
2282
|
return !we(o) && o.length !== void 0;
|
|
2231
2283
|
}), e._zod.onattach.push((r) => {
|
|
@@ -2246,9 +2298,9 @@ const Vr = (e) => {
|
|
|
2246
2298
|
continue: !t.abort
|
|
2247
2299
|
});
|
|
2248
2300
|
};
|
|
2249
|
-
}),
|
|
2301
|
+
}), eo = /* @__PURE__ */ d("$ZodCheckMinLength", (e, t) => {
|
|
2250
2302
|
var n;
|
|
2251
|
-
|
|
2303
|
+
P.init(e, t), (n = e._zod.def).when ?? (n.when = (r) => {
|
|
2252
2304
|
const o = r.value;
|
|
2253
2305
|
return !we(o) && o.length !== void 0;
|
|
2254
2306
|
}), e._zod.onattach.push((r) => {
|
|
@@ -2269,9 +2321,9 @@ const Vr = (e) => {
|
|
|
2269
2321
|
continue: !t.abort
|
|
2270
2322
|
});
|
|
2271
2323
|
};
|
|
2272
|
-
}),
|
|
2324
|
+
}), to = /* @__PURE__ */ d("$ZodCheckLengthEquals", (e, t) => {
|
|
2273
2325
|
var n;
|
|
2274
|
-
|
|
2326
|
+
P.init(e, t), (n = e._zod.def).when ?? (n.when = (r) => {
|
|
2275
2327
|
const o = r.value;
|
|
2276
2328
|
return !we(o) && o.length !== void 0;
|
|
2277
2329
|
}), e._zod.onattach.push((r) => {
|
|
@@ -2294,7 +2346,7 @@ const Vr = (e) => {
|
|
|
2294
2346
|
};
|
|
2295
2347
|
}), le = /* @__PURE__ */ d("$ZodCheckStringFormat", (e, t) => {
|
|
2296
2348
|
var n, r;
|
|
2297
|
-
|
|
2349
|
+
P.init(e, t), e._zod.onattach.push((o) => {
|
|
2298
2350
|
const i = o._zod.bag;
|
|
2299
2351
|
i.format = t.format, t.pattern && (i.patterns ?? (i.patterns = /* @__PURE__ */ new Set()), i.patterns.add(t.pattern));
|
|
2300
2352
|
}), t.pattern ? (n = e._zod).check ?? (n.check = (o) => {
|
|
@@ -2309,7 +2361,7 @@ const Vr = (e) => {
|
|
|
2309
2361
|
});
|
|
2310
2362
|
}) : (r = e._zod).check ?? (r.check = () => {
|
|
2311
2363
|
});
|
|
2312
|
-
}),
|
|
2364
|
+
}), no = /* @__PURE__ */ d("$ZodCheckRegex", (e, t) => {
|
|
2313
2365
|
le.init(e, t), e._zod.check = (n) => {
|
|
2314
2366
|
t.pattern.lastIndex = 0, !t.pattern.test(n.value) && n.issues.push({
|
|
2315
2367
|
origin: "string",
|
|
@@ -2321,12 +2373,12 @@ const Vr = (e) => {
|
|
|
2321
2373
|
continue: !t.abort
|
|
2322
2374
|
});
|
|
2323
2375
|
};
|
|
2324
|
-
}),
|
|
2325
|
-
t.pattern ?? (t.pattern = Wr), le.init(e, t);
|
|
2326
|
-
}), ro = /* @__PURE__ */ d("$ZodCheckUpperCase", (e, t) => {
|
|
2376
|
+
}), ro = /* @__PURE__ */ d("$ZodCheckLowerCase", (e, t) => {
|
|
2327
2377
|
t.pattern ?? (t.pattern = Hr), le.init(e, t);
|
|
2328
|
-
}), oo = /* @__PURE__ */ d("$
|
|
2329
|
-
|
|
2378
|
+
}), oo = /* @__PURE__ */ d("$ZodCheckUpperCase", (e, t) => {
|
|
2379
|
+
t.pattern ?? (t.pattern = Kr), le.init(e, t);
|
|
2380
|
+
}), io = /* @__PURE__ */ d("$ZodCheckIncludes", (e, t) => {
|
|
2381
|
+
P.init(e, t);
|
|
2330
2382
|
const n = H(t.includes), r = new RegExp(typeof t.position == "number" ? `^.{${t.position}}${n}` : n);
|
|
2331
2383
|
t.pattern = r, e._zod.onattach.push((o) => {
|
|
2332
2384
|
const i = o._zod.bag;
|
|
@@ -2342,8 +2394,8 @@ const Vr = (e) => {
|
|
|
2342
2394
|
continue: !t.abort
|
|
2343
2395
|
});
|
|
2344
2396
|
};
|
|
2345
|
-
}),
|
|
2346
|
-
|
|
2397
|
+
}), so = /* @__PURE__ */ d("$ZodCheckStartsWith", (e, t) => {
|
|
2398
|
+
P.init(e, t);
|
|
2347
2399
|
const n = new RegExp(`^${H(t.prefix)}.*`);
|
|
2348
2400
|
t.pattern ?? (t.pattern = n), e._zod.onattach.push((r) => {
|
|
2349
2401
|
const o = r._zod.bag;
|
|
@@ -2359,8 +2411,8 @@ const Vr = (e) => {
|
|
|
2359
2411
|
continue: !t.abort
|
|
2360
2412
|
});
|
|
2361
2413
|
};
|
|
2362
|
-
}),
|
|
2363
|
-
|
|
2414
|
+
}), ao = /* @__PURE__ */ d("$ZodCheckEndsWith", (e, t) => {
|
|
2415
|
+
P.init(e, t);
|
|
2364
2416
|
const n = new RegExp(`.*${H(t.suffix)}$`);
|
|
2365
2417
|
t.pattern ?? (t.pattern = n), e._zod.onattach.push((r) => {
|
|
2366
2418
|
const o = r._zod.bag;
|
|
@@ -2376,12 +2428,12 @@ const Vr = (e) => {
|
|
|
2376
2428
|
continue: !t.abort
|
|
2377
2429
|
});
|
|
2378
2430
|
};
|
|
2379
|
-
}),
|
|
2380
|
-
|
|
2431
|
+
}), co = /* @__PURE__ */ d("$ZodCheckOverwrite", (e, t) => {
|
|
2432
|
+
P.init(e, t), e._zod.check = (n) => {
|
|
2381
2433
|
n.value = t.tx(n.value);
|
|
2382
2434
|
};
|
|
2383
2435
|
});
|
|
2384
|
-
class
|
|
2436
|
+
class uo {
|
|
2385
2437
|
constructor(t = []) {
|
|
2386
2438
|
this.content = [], this.indent = 0, this && (this.args = t);
|
|
2387
2439
|
}
|
|
@@ -2404,13 +2456,13 @@ class co {
|
|
|
2404
2456
|
`));
|
|
2405
2457
|
}
|
|
2406
2458
|
}
|
|
2407
|
-
const
|
|
2459
|
+
const lo = {
|
|
2408
2460
|
major: 4,
|
|
2409
2461
|
minor: 3,
|
|
2410
2462
|
patch: 6
|
|
2411
|
-
},
|
|
2463
|
+
}, z = /* @__PURE__ */ d("$ZodType", (e, t) => {
|
|
2412
2464
|
var n;
|
|
2413
|
-
e ?? (e = {}), e._zod.def = t, e._zod.bag = e._zod.bag || {}, e._zod.version =
|
|
2465
|
+
e ?? (e = {}), e._zod.def = t, e._zod.bag = e._zod.bag || {}, e._zod.version = lo;
|
|
2414
2466
|
const r = [...e._zod.def.checks ?? []];
|
|
2415
2467
|
e._zod.traits.has("$ZodCheck") && r.unshift(e);
|
|
2416
2468
|
for (const o of r)
|
|
@@ -2470,20 +2522,20 @@ const uo = {
|
|
|
2470
2522
|
return o(c, r, a);
|
|
2471
2523
|
};
|
|
2472
2524
|
}
|
|
2473
|
-
|
|
2525
|
+
v(e, "~standard", () => ({
|
|
2474
2526
|
validate: (o) => {
|
|
2475
2527
|
try {
|
|
2476
|
-
const i =
|
|
2528
|
+
const i = mr(e, o);
|
|
2477
2529
|
return i.success ? { value: i.data } : { issues: i.error?.issues };
|
|
2478
2530
|
} catch {
|
|
2479
|
-
return
|
|
2531
|
+
return _r(e, o).then((s) => s.success ? { value: s.data } : { issues: s.error?.issues });
|
|
2480
2532
|
}
|
|
2481
2533
|
},
|
|
2482
2534
|
vendor: "zod",
|
|
2483
2535
|
version: 1
|
|
2484
2536
|
}));
|
|
2485
2537
|
}), Se = /* @__PURE__ */ d("$ZodString", (e, t) => {
|
|
2486
|
-
|
|
2538
|
+
z.init(e, t), e._zod.pattern = [...e?._zod.bag?.patterns ?? []].pop() ?? Gr(e._zod.bag), e._zod.parse = (n, r) => {
|
|
2487
2539
|
if (t.coerce)
|
|
2488
2540
|
try {
|
|
2489
2541
|
n.value = String(n.value);
|
|
@@ -2498,9 +2550,9 @@ const uo = {
|
|
|
2498
2550
|
};
|
|
2499
2551
|
}), b = /* @__PURE__ */ d("$ZodStringFormat", (e, t) => {
|
|
2500
2552
|
le.init(e, t), Se.init(e, t);
|
|
2501
|
-
}),
|
|
2502
|
-
t.pattern ?? (t.pattern =
|
|
2503
|
-
}),
|
|
2553
|
+
}), fo = /* @__PURE__ */ d("$ZodGUID", (e, t) => {
|
|
2554
|
+
t.pattern ?? (t.pattern = Nr), b.init(e, t);
|
|
2555
|
+
}), po = /* @__PURE__ */ d("$ZodUUID", (e, t) => {
|
|
2504
2556
|
if (t.version) {
|
|
2505
2557
|
const r = {
|
|
2506
2558
|
v1: 1,
|
|
@@ -2518,9 +2570,9 @@ const uo = {
|
|
|
2518
2570
|
} else
|
|
2519
2571
|
t.pattern ?? (t.pattern = Re());
|
|
2520
2572
|
b.init(e, t);
|
|
2521
|
-
}),
|
|
2522
|
-
t.pattern ?? (t.pattern =
|
|
2523
|
-
}),
|
|
2573
|
+
}), go = /* @__PURE__ */ d("$ZodEmail", (e, t) => {
|
|
2574
|
+
t.pattern ?? (t.pattern = Cr), b.init(e, t);
|
|
2575
|
+
}), ho = /* @__PURE__ */ d("$ZodURL", (e, t) => {
|
|
2524
2576
|
b.init(e, t), e._zod.check = (n) => {
|
|
2525
2577
|
try {
|
|
2526
2578
|
const r = n.value.trim(), o = new URL(r);
|
|
@@ -2552,32 +2604,32 @@ const uo = {
|
|
|
2552
2604
|
});
|
|
2553
2605
|
}
|
|
2554
2606
|
};
|
|
2555
|
-
}),
|
|
2556
|
-
t.pattern ?? (t.pattern =
|
|
2557
|
-
}),
|
|
2558
|
-
t.pattern ?? (t.pattern =
|
|
2559
|
-
}),
|
|
2560
|
-
t.pattern ?? (t.pattern = Sr), b.init(e, t);
|
|
2561
|
-
}), yo = /* @__PURE__ */ d("$ZodCUID2", (e, t) => {
|
|
2607
|
+
}), mo = /* @__PURE__ */ d("$ZodEmoji", (e, t) => {
|
|
2608
|
+
t.pattern ?? (t.pattern = jr()), b.init(e, t);
|
|
2609
|
+
}), _o = /* @__PURE__ */ d("$ZodNanoID", (e, t) => {
|
|
2610
|
+
t.pattern ?? (t.pattern = Pr), b.init(e, t);
|
|
2611
|
+
}), yo = /* @__PURE__ */ d("$ZodCUID", (e, t) => {
|
|
2562
2612
|
t.pattern ?? (t.pattern = Er), b.init(e, t);
|
|
2563
|
-
}), vo = /* @__PURE__ */ d("$
|
|
2613
|
+
}), vo = /* @__PURE__ */ d("$ZodCUID2", (e, t) => {
|
|
2564
2614
|
t.pattern ?? (t.pattern = Zr), b.init(e, t);
|
|
2565
|
-
}), wo = /* @__PURE__ */ d("$
|
|
2615
|
+
}), wo = /* @__PURE__ */ d("$ZodULID", (e, t) => {
|
|
2566
2616
|
t.pattern ?? (t.pattern = Tr), b.init(e, t);
|
|
2567
|
-
}), bo = /* @__PURE__ */ d("$
|
|
2617
|
+
}), bo = /* @__PURE__ */ d("$ZodXID", (e, t) => {
|
|
2568
2618
|
t.pattern ?? (t.pattern = Ir), b.init(e, t);
|
|
2569
|
-
}), ko = /* @__PURE__ */ d("$
|
|
2570
|
-
t.pattern ?? (t.pattern =
|
|
2571
|
-
}), zo = /* @__PURE__ */ d("$
|
|
2619
|
+
}), ko = /* @__PURE__ */ d("$ZodKSUID", (e, t) => {
|
|
2620
|
+
t.pattern ?? (t.pattern = Or), b.init(e, t);
|
|
2621
|
+
}), zo = /* @__PURE__ */ d("$ZodISODateTime", (e, t) => {
|
|
2622
|
+
t.pattern ?? (t.pattern = Vr(t)), b.init(e, t);
|
|
2623
|
+
}), $o = /* @__PURE__ */ d("$ZodISODate", (e, t) => {
|
|
2572
2624
|
t.pattern ?? (t.pattern = Jr), b.init(e, t);
|
|
2573
|
-
}),
|
|
2574
|
-
t.pattern ?? (t.pattern =
|
|
2575
|
-
}),
|
|
2576
|
-
t.pattern ?? (t.pattern =
|
|
2577
|
-
}),
|
|
2578
|
-
t.pattern ?? (t.pattern =
|
|
2579
|
-
}),
|
|
2580
|
-
t.pattern ?? (t.pattern =
|
|
2625
|
+
}), So = /* @__PURE__ */ d("$ZodISOTime", (e, t) => {
|
|
2626
|
+
t.pattern ?? (t.pattern = qr(t)), b.init(e, t);
|
|
2627
|
+
}), Eo = /* @__PURE__ */ d("$ZodISODuration", (e, t) => {
|
|
2628
|
+
t.pattern ?? (t.pattern = Ar), b.init(e, t);
|
|
2629
|
+
}), Zo = /* @__PURE__ */ d("$ZodIPv4", (e, t) => {
|
|
2630
|
+
t.pattern ?? (t.pattern = Dr), b.init(e, t), e._zod.bag.format = "ipv4";
|
|
2631
|
+
}), To = /* @__PURE__ */ d("$ZodIPv6", (e, t) => {
|
|
2632
|
+
t.pattern ?? (t.pattern = Lr), b.init(e, t), e._zod.bag.format = "ipv6", e._zod.check = (n) => {
|
|
2581
2633
|
try {
|
|
2582
2634
|
new URL(`http://[${n.value}]`);
|
|
2583
2635
|
} catch {
|
|
@@ -2590,10 +2642,10 @@ const uo = {
|
|
|
2590
2642
|
});
|
|
2591
2643
|
}
|
|
2592
2644
|
};
|
|
2593
|
-
}),
|
|
2594
|
-
t.pattern ?? (t.pattern =
|
|
2595
|
-
}),
|
|
2596
|
-
t.pattern ?? (t.pattern =
|
|
2645
|
+
}), Io = /* @__PURE__ */ d("$ZodCIDRv4", (e, t) => {
|
|
2646
|
+
t.pattern ?? (t.pattern = Ur), b.init(e, t);
|
|
2647
|
+
}), Oo = /* @__PURE__ */ d("$ZodCIDRv6", (e, t) => {
|
|
2648
|
+
t.pattern ?? (t.pattern = Mr), b.init(e, t), e._zod.check = (n) => {
|
|
2597
2649
|
const r = n.value.split("/");
|
|
2598
2650
|
try {
|
|
2599
2651
|
if (r.length !== 2)
|
|
@@ -2629,8 +2681,8 @@ function bt(e) {
|
|
|
2629
2681
|
return !1;
|
|
2630
2682
|
}
|
|
2631
2683
|
}
|
|
2632
|
-
const
|
|
2633
|
-
t.pattern ?? (t.pattern =
|
|
2684
|
+
const Po = /* @__PURE__ */ d("$ZodBase64", (e, t) => {
|
|
2685
|
+
t.pattern ?? (t.pattern = Fr), b.init(e, t), e._zod.bag.contentEncoding = "base64", e._zod.check = (n) => {
|
|
2634
2686
|
bt(n.value) || n.issues.push({
|
|
2635
2687
|
code: "invalid_format",
|
|
2636
2688
|
format: "base64",
|
|
@@ -2640,15 +2692,15 @@ const Oo = /* @__PURE__ */ d("$ZodBase64", (e, t) => {
|
|
|
2640
2692
|
});
|
|
2641
2693
|
};
|
|
2642
2694
|
});
|
|
2643
|
-
function
|
|
2695
|
+
function Ao(e) {
|
|
2644
2696
|
if (!gt.test(e))
|
|
2645
2697
|
return !1;
|
|
2646
2698
|
const t = e.replace(/[-_]/g, (r) => r === "-" ? "+" : "/"), n = t.padEnd(Math.ceil(t.length / 4) * 4, "=");
|
|
2647
2699
|
return bt(n);
|
|
2648
2700
|
}
|
|
2649
|
-
const
|
|
2701
|
+
const No = /* @__PURE__ */ d("$ZodBase64URL", (e, t) => {
|
|
2650
2702
|
t.pattern ?? (t.pattern = gt), b.init(e, t), e._zod.bag.contentEncoding = "base64url", e._zod.check = (n) => {
|
|
2651
|
-
|
|
2703
|
+
Ao(n.value) || n.issues.push({
|
|
2652
2704
|
code: "invalid_format",
|
|
2653
2705
|
format: "base64url",
|
|
2654
2706
|
input: n.value,
|
|
@@ -2656,10 +2708,10 @@ const Ao = /* @__PURE__ */ d("$ZodBase64URL", (e, t) => {
|
|
|
2656
2708
|
continue: !t.abort
|
|
2657
2709
|
});
|
|
2658
2710
|
};
|
|
2659
|
-
}),
|
|
2660
|
-
t.pattern ?? (t.pattern =
|
|
2711
|
+
}), Co = /* @__PURE__ */ d("$ZodE164", (e, t) => {
|
|
2712
|
+
t.pattern ?? (t.pattern = xr), b.init(e, t);
|
|
2661
2713
|
});
|
|
2662
|
-
function
|
|
2714
|
+
function Ro(e, t = null) {
|
|
2663
2715
|
try {
|
|
2664
2716
|
const n = e.split(".");
|
|
2665
2717
|
if (n.length !== 3)
|
|
@@ -2673,9 +2725,9 @@ function Co(e, t = null) {
|
|
|
2673
2725
|
return !1;
|
|
2674
2726
|
}
|
|
2675
2727
|
}
|
|
2676
|
-
const
|
|
2728
|
+
const jo = /* @__PURE__ */ d("$ZodJWT", (e, t) => {
|
|
2677
2729
|
b.init(e, t), e._zod.check = (n) => {
|
|
2678
|
-
|
|
2730
|
+
Ro(n.value, t.alg) || n.issues.push({
|
|
2679
2731
|
code: "invalid_format",
|
|
2680
2732
|
format: "jwt",
|
|
2681
2733
|
input: n.value,
|
|
@@ -2684,7 +2736,7 @@ const Ro = /* @__PURE__ */ d("$ZodJWT", (e, t) => {
|
|
|
2684
2736
|
});
|
|
2685
2737
|
};
|
|
2686
2738
|
}), kt = /* @__PURE__ */ d("$ZodNumber", (e, t) => {
|
|
2687
|
-
|
|
2739
|
+
z.init(e, t), e._zod.pattern = e._zod.bag.pattern ?? _t, e._zod.parse = (n, r) => {
|
|
2688
2740
|
if (t.coerce)
|
|
2689
2741
|
try {
|
|
2690
2742
|
n.value = Number(n.value);
|
|
@@ -2702,10 +2754,10 @@ const Ro = /* @__PURE__ */ d("$ZodJWT", (e, t) => {
|
|
|
2702
2754
|
...i ? { received: i } : {}
|
|
2703
2755
|
}), n;
|
|
2704
2756
|
};
|
|
2705
|
-
}),
|
|
2706
|
-
|
|
2707
|
-
}),
|
|
2708
|
-
|
|
2757
|
+
}), Do = /* @__PURE__ */ d("$ZodNumberFormat", (e, t) => {
|
|
2758
|
+
Qr.init(e, t), kt.init(e, t);
|
|
2759
|
+
}), Lo = /* @__PURE__ */ d("$ZodBoolean", (e, t) => {
|
|
2760
|
+
z.init(e, t), e._zod.pattern = Wr, e._zod.parse = (n, r) => {
|
|
2709
2761
|
if (t.coerce)
|
|
2710
2762
|
try {
|
|
2711
2763
|
n.value = !!n.value;
|
|
@@ -2719,10 +2771,10 @@ const Ro = /* @__PURE__ */ d("$ZodJWT", (e, t) => {
|
|
|
2719
2771
|
inst: e
|
|
2720
2772
|
}), n;
|
|
2721
2773
|
};
|
|
2722
|
-
}),
|
|
2723
|
-
|
|
2724
|
-
}),
|
|
2725
|
-
|
|
2774
|
+
}), Uo = /* @__PURE__ */ d("$ZodUnknown", (e, t) => {
|
|
2775
|
+
z.init(e, t), e._zod.parse = (n) => n;
|
|
2776
|
+
}), Mo = /* @__PURE__ */ d("$ZodNever", (e, t) => {
|
|
2777
|
+
z.init(e, t), e._zod.parse = (n, r) => (n.issues.push({
|
|
2726
2778
|
expected: "never",
|
|
2727
2779
|
code: "invalid_type",
|
|
2728
2780
|
input: n.value,
|
|
@@ -2732,8 +2784,8 @@ const Ro = /* @__PURE__ */ d("$ZodJWT", (e, t) => {
|
|
|
2732
2784
|
function je(e, t, n) {
|
|
2733
2785
|
e.issues.length && t.issues.push(...G(n, e.issues)), t.value[n] = e.value;
|
|
2734
2786
|
}
|
|
2735
|
-
const
|
|
2736
|
-
|
|
2787
|
+
const Fo = /* @__PURE__ */ d("$ZodArray", (e, t) => {
|
|
2788
|
+
z.init(e, t), e._zod.parse = (n, r) => {
|
|
2737
2789
|
const o = n.value;
|
|
2738
2790
|
if (!Array.isArray(o))
|
|
2739
2791
|
return n.issues.push({
|
|
@@ -2767,7 +2819,7 @@ function zt(e) {
|
|
|
2767
2819
|
for (const r of t)
|
|
2768
2820
|
if (!e.shape?.[r]?._zod?.traits?.has("$ZodType"))
|
|
2769
2821
|
throw new Error(`Invalid element at key "${r}": expected a Zod schema`);
|
|
2770
|
-
const n =
|
|
2822
|
+
const n = ir(e.shape);
|
|
2771
2823
|
return {
|
|
2772
2824
|
...e,
|
|
2773
2825
|
keys: t,
|
|
@@ -2795,8 +2847,8 @@ function $t(e, t, n, r, o, i) {
|
|
|
2795
2847
|
inst: i
|
|
2796
2848
|
}), e.length ? Promise.all(e).then(() => n) : n;
|
|
2797
2849
|
}
|
|
2798
|
-
const
|
|
2799
|
-
if (
|
|
2850
|
+
const xo = /* @__PURE__ */ d("$ZodObject", (e, t) => {
|
|
2851
|
+
if (z.init(e, t), !Object.getOwnPropertyDescriptor(t, "shape")?.get) {
|
|
2800
2852
|
const a = t.shape;
|
|
2801
2853
|
Object.defineProperty(t, "shape", {
|
|
2802
2854
|
get: () => {
|
|
@@ -2808,7 +2860,7 @@ const Fo = /* @__PURE__ */ d("$ZodObject", (e, t) => {
|
|
|
2808
2860
|
});
|
|
2809
2861
|
}
|
|
2810
2862
|
const r = ve(() => zt(t));
|
|
2811
|
-
|
|
2863
|
+
v(e._zod, "propValues", () => {
|
|
2812
2864
|
const a = t.shape, c = {};
|
|
2813
2865
|
for (const u in a) {
|
|
2814
2866
|
const l = a[u]._zod;
|
|
@@ -2835,76 +2887,76 @@ const Fo = /* @__PURE__ */ d("$ZodObject", (e, t) => {
|
|
|
2835
2887
|
a.value = {};
|
|
2836
2888
|
const l = [], f = s.shape;
|
|
2837
2889
|
for (const p of s.keys) {
|
|
2838
|
-
const g = f[p],
|
|
2839
|
-
|
|
2890
|
+
const g = f[p], y = g._zod.optout === "optional", _ = g._zod.run({ value: u[p], issues: [] }, c);
|
|
2891
|
+
_ instanceof Promise ? l.push(_.then((m) => se(m, a, p, u, y))) : se(_, a, p, u, y);
|
|
2840
2892
|
}
|
|
2841
2893
|
return i ? $t(l, u, a, c, r.value, e) : l.length ? Promise.all(l).then(() => a) : a;
|
|
2842
2894
|
};
|
|
2843
2895
|
}), Jo = /* @__PURE__ */ d("$ZodObjectJIT", (e, t) => {
|
|
2844
|
-
|
|
2896
|
+
xo.init(e, t);
|
|
2845
2897
|
const n = e._zod.parse, r = ve(() => zt(t)), o = (p) => {
|
|
2846
|
-
const g = new
|
|
2847
|
-
const
|
|
2848
|
-
return `shape[${
|
|
2898
|
+
const g = new uo(["shape", "payload", "ctx"]), y = r.value, _ = (C) => {
|
|
2899
|
+
const O = Ce(C);
|
|
2900
|
+
return `shape[${O}]._zod.run({ value: input[${O}], issues: [] }, ctx)`;
|
|
2849
2901
|
};
|
|
2850
2902
|
g.write("const input = payload.value;");
|
|
2851
|
-
const
|
|
2852
|
-
let
|
|
2853
|
-
for (const
|
|
2854
|
-
|
|
2903
|
+
const m = /* @__PURE__ */ Object.create(null);
|
|
2904
|
+
let k = 0;
|
|
2905
|
+
for (const C of y.keys)
|
|
2906
|
+
m[C] = `key_${k++}`;
|
|
2855
2907
|
g.write("const newResult = {};");
|
|
2856
|
-
for (const
|
|
2857
|
-
const
|
|
2858
|
-
g.write(`const ${
|
|
2859
|
-
if (${
|
|
2860
|
-
if (${
|
|
2861
|
-
payload.issues = payload.issues.concat(${
|
|
2908
|
+
for (const C of y.keys) {
|
|
2909
|
+
const O = m[C], N = Ce(C), jt = p[C]?._zod?.optout === "optional";
|
|
2910
|
+
g.write(`const ${O} = ${_(C)};`), jt ? g.write(`
|
|
2911
|
+
if (${O}.issues.length) {
|
|
2912
|
+
if (${N} in input) {
|
|
2913
|
+
payload.issues = payload.issues.concat(${O}.issues.map(iss => ({
|
|
2862
2914
|
...iss,
|
|
2863
|
-
path: iss.path ? [${
|
|
2915
|
+
path: iss.path ? [${N}, ...iss.path] : [${N}]
|
|
2864
2916
|
})));
|
|
2865
2917
|
}
|
|
2866
2918
|
}
|
|
2867
2919
|
|
|
2868
|
-
if (${
|
|
2869
|
-
if (${
|
|
2870
|
-
newResult[${
|
|
2920
|
+
if (${O}.value === undefined) {
|
|
2921
|
+
if (${N} in input) {
|
|
2922
|
+
newResult[${N}] = undefined;
|
|
2871
2923
|
}
|
|
2872
2924
|
} else {
|
|
2873
|
-
newResult[${
|
|
2925
|
+
newResult[${N}] = ${O}.value;
|
|
2874
2926
|
}
|
|
2875
2927
|
|
|
2876
2928
|
`) : g.write(`
|
|
2877
|
-
if (${
|
|
2878
|
-
payload.issues = payload.issues.concat(${
|
|
2929
|
+
if (${O}.issues.length) {
|
|
2930
|
+
payload.issues = payload.issues.concat(${O}.issues.map(iss => ({
|
|
2879
2931
|
...iss,
|
|
2880
|
-
path: iss.path ? [${
|
|
2932
|
+
path: iss.path ? [${N}, ...iss.path] : [${N}]
|
|
2881
2933
|
})));
|
|
2882
2934
|
}
|
|
2883
2935
|
|
|
2884
|
-
if (${
|
|
2885
|
-
if (${
|
|
2886
|
-
newResult[${
|
|
2936
|
+
if (${O}.value === undefined) {
|
|
2937
|
+
if (${N} in input) {
|
|
2938
|
+
newResult[${N}] = undefined;
|
|
2887
2939
|
}
|
|
2888
2940
|
} else {
|
|
2889
|
-
newResult[${
|
|
2941
|
+
newResult[${N}] = ${O}.value;
|
|
2890
2942
|
}
|
|
2891
2943
|
|
|
2892
2944
|
`);
|
|
2893
2945
|
}
|
|
2894
2946
|
g.write("payload.value = newResult;"), g.write("return payload;");
|
|
2895
|
-
const
|
|
2896
|
-
return (
|
|
2947
|
+
const I = g.compile();
|
|
2948
|
+
return (C, O) => I(p, C, O);
|
|
2897
2949
|
};
|
|
2898
2950
|
let i;
|
|
2899
|
-
const s = ie, a = !at.jitless, u = a &&
|
|
2951
|
+
const s = ie, a = !at.jitless, u = a && rr.value, l = t.catchall;
|
|
2900
2952
|
let f;
|
|
2901
2953
|
e._zod.parse = (p, g) => {
|
|
2902
2954
|
f ?? (f = r.value);
|
|
2903
|
-
const
|
|
2904
|
-
return s(
|
|
2955
|
+
const y = p.value;
|
|
2956
|
+
return s(y) ? a && u && g?.async === !1 && g.jitless !== !0 ? (i || (i = o(t.shape)), p = i(p, g), l ? $t([], y, p, g, f, e) : p) : n(p, g) : (p.issues.push({
|
|
2905
2957
|
expected: "object",
|
|
2906
2958
|
code: "invalid_type",
|
|
2907
|
-
input:
|
|
2959
|
+
input: y,
|
|
2908
2960
|
inst: e
|
|
2909
2961
|
}), p);
|
|
2910
2962
|
};
|
|
@@ -2921,11 +2973,11 @@ function De(e, t, n, r) {
|
|
|
2921
2973
|
errors: e.map((i) => i.issues.map((s) => U(s, r, L())))
|
|
2922
2974
|
}), t);
|
|
2923
2975
|
}
|
|
2924
|
-
const
|
|
2925
|
-
|
|
2976
|
+
const qo = /* @__PURE__ */ d("$ZodUnion", (e, t) => {
|
|
2977
|
+
z.init(e, t), v(e._zod, "optin", () => t.options.some((o) => o._zod.optin === "optional") ? "optional" : void 0), v(e._zod, "optout", () => t.options.some((o) => o._zod.optout === "optional") ? "optional" : void 0), v(e._zod, "values", () => {
|
|
2926
2978
|
if (t.options.every((o) => o._zod.values))
|
|
2927
2979
|
return new Set(t.options.flatMap((o) => Array.from(o._zod.values)));
|
|
2928
|
-
}),
|
|
2980
|
+
}), v(e._zod, "pattern", () => {
|
|
2929
2981
|
if (t.options.every((o) => o._zod.pattern)) {
|
|
2930
2982
|
const o = t.options.map((i) => i._zod.pattern);
|
|
2931
2983
|
return new RegExp(`^(${o.map((i) => be(i.source)).join("|")})$`);
|
|
@@ -2952,8 +3004,8 @@ const xo = /* @__PURE__ */ d("$ZodUnion", (e, t) => {
|
|
|
2952
3004
|
}
|
|
2953
3005
|
return s ? Promise.all(a).then((c) => De(c, o, e, i)) : De(a, o, e, i);
|
|
2954
3006
|
};
|
|
2955
|
-
}),
|
|
2956
|
-
|
|
3007
|
+
}), Vo = /* @__PURE__ */ d("$ZodIntersection", (e, t) => {
|
|
3008
|
+
z.init(e, t), e._zod.parse = (n, r) => {
|
|
2957
3009
|
const o = n.value, i = t.left._zod.run({ value: o, issues: [] }, r), s = t.right._zod.run({ value: o, issues: [] }, r);
|
|
2958
3010
|
return i instanceof Promise || s instanceof Promise ? Promise.all([i, s]).then(([c, u]) => Le(n, c, u)) : Le(n, i, s);
|
|
2959
3011
|
};
|
|
@@ -3017,8 +3069,8 @@ function Le(e, t, n) {
|
|
|
3017
3069
|
throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(s.mergeErrorPath)}`);
|
|
3018
3070
|
return e.value = s.data, e;
|
|
3019
3071
|
}
|
|
3020
|
-
const
|
|
3021
|
-
|
|
3072
|
+
const Go = /* @__PURE__ */ d("$ZodRecord", (e, t) => {
|
|
3073
|
+
z.init(e, t), e._zod.parse = (n, r) => {
|
|
3022
3074
|
const o = n.value;
|
|
3023
3075
|
if (!W(o))
|
|
3024
3076
|
return n.issues.push({
|
|
@@ -3081,10 +3133,10 @@ const Vo = /* @__PURE__ */ d("$ZodRecord", (e, t) => {
|
|
|
3081
3133
|
}
|
|
3082
3134
|
return i.length ? Promise.all(i).then(() => n) : n;
|
|
3083
3135
|
};
|
|
3084
|
-
}),
|
|
3085
|
-
|
|
3136
|
+
}), Bo = /* @__PURE__ */ d("$ZodEnum", (e, t) => {
|
|
3137
|
+
z.init(e, t);
|
|
3086
3138
|
const n = ct(t.entries), r = new Set(n);
|
|
3087
|
-
e._zod.values = r, e._zod.pattern = new RegExp(`^(${n.filter((o) =>
|
|
3139
|
+
e._zod.values = r, e._zod.pattern = new RegExp(`^(${n.filter((o) => or.has(typeof o)).map((o) => typeof o == "string" ? H(o) : o.toString()).join("|")})$`), e._zod.parse = (o, i) => {
|
|
3088
3140
|
const s = o.value;
|
|
3089
3141
|
return r.has(s) || o.issues.push({
|
|
3090
3142
|
code: "invalid_value",
|
|
@@ -3093,8 +3145,8 @@ const Vo = /* @__PURE__ */ d("$ZodRecord", (e, t) => {
|
|
|
3093
3145
|
inst: e
|
|
3094
3146
|
}), o;
|
|
3095
3147
|
};
|
|
3096
|
-
}),
|
|
3097
|
-
if (
|
|
3148
|
+
}), Wo = /* @__PURE__ */ d("$ZodLiteral", (e, t) => {
|
|
3149
|
+
if (z.init(e, t), t.values.length === 0)
|
|
3098
3150
|
throw new Error("Cannot create literal schema with no valid values");
|
|
3099
3151
|
const n = new Set(t.values);
|
|
3100
3152
|
e._zod.values = n, e._zod.pattern = new RegExp(`^(${t.values.map((r) => typeof r == "string" ? H(r) : r ? H(r.toString()) : String(r)).join("|")})$`), e._zod.parse = (r, o) => {
|
|
@@ -3106,8 +3158,8 @@ const Vo = /* @__PURE__ */ d("$ZodRecord", (e, t) => {
|
|
|
3106
3158
|
inst: e
|
|
3107
3159
|
}), r;
|
|
3108
3160
|
};
|
|
3109
|
-
}),
|
|
3110
|
-
|
|
3161
|
+
}), Ho = /* @__PURE__ */ d("$ZodTransform", (e, t) => {
|
|
3162
|
+
z.init(e, t), e._zod.parse = (n, r) => {
|
|
3111
3163
|
if (r.direction === "backward")
|
|
3112
3164
|
throw new st(e.constructor.name);
|
|
3113
3165
|
const o = t.transform(n.value, n);
|
|
@@ -3122,7 +3174,7 @@ function Ue(e, t) {
|
|
|
3122
3174
|
return e.issues.length && t === void 0 ? { issues: [], value: void 0 } : e;
|
|
3123
3175
|
}
|
|
3124
3176
|
const St = /* @__PURE__ */ d("$ZodOptional", (e, t) => {
|
|
3125
|
-
|
|
3177
|
+
z.init(e, t), e._zod.optin = "optional", e._zod.optout = "optional", v(e._zod, "values", () => t.innerType._zod.values ? /* @__PURE__ */ new Set([...t.innerType._zod.values, void 0]) : void 0), v(e._zod, "pattern", () => {
|
|
3126
3178
|
const n = t.innerType._zod.pattern;
|
|
3127
3179
|
return n ? new RegExp(`^(${be(n.source)})?$`) : void 0;
|
|
3128
3180
|
}), e._zod.parse = (n, r) => {
|
|
@@ -3132,15 +3184,15 @@ const St = /* @__PURE__ */ d("$ZodOptional", (e, t) => {
|
|
|
3132
3184
|
}
|
|
3133
3185
|
return n.value === void 0 ? n : t.innerType._zod.run(n, r);
|
|
3134
3186
|
};
|
|
3135
|
-
}),
|
|
3136
|
-
St.init(e, t),
|
|
3137
|
-
}),
|
|
3138
|
-
|
|
3187
|
+
}), Ko = /* @__PURE__ */ d("$ZodExactOptional", (e, t) => {
|
|
3188
|
+
St.init(e, t), v(e._zod, "values", () => t.innerType._zod.values), v(e._zod, "pattern", () => t.innerType._zod.pattern), e._zod.parse = (n, r) => t.innerType._zod.run(n, r);
|
|
3189
|
+
}), Yo = /* @__PURE__ */ d("$ZodNullable", (e, t) => {
|
|
3190
|
+
z.init(e, t), v(e._zod, "optin", () => t.innerType._zod.optin), v(e._zod, "optout", () => t.innerType._zod.optout), v(e._zod, "pattern", () => {
|
|
3139
3191
|
const n = t.innerType._zod.pattern;
|
|
3140
3192
|
return n ? new RegExp(`^(${be(n.source)}|null)$`) : void 0;
|
|
3141
|
-
}),
|
|
3142
|
-
}),
|
|
3143
|
-
|
|
3193
|
+
}), v(e._zod, "values", () => t.innerType._zod.values ? /* @__PURE__ */ new Set([...t.innerType._zod.values, null]) : void 0), e._zod.parse = (n, r) => n.value === null ? n : t.innerType._zod.run(n, r);
|
|
3194
|
+
}), Qo = /* @__PURE__ */ d("$ZodDefault", (e, t) => {
|
|
3195
|
+
z.init(e, t), e._zod.optin = "optional", v(e._zod, "values", () => t.innerType._zod.values), e._zod.parse = (n, r) => {
|
|
3144
3196
|
if (r.direction === "backward")
|
|
3145
3197
|
return t.innerType._zod.run(n, r);
|
|
3146
3198
|
if (n.value === void 0)
|
|
@@ -3152,10 +3204,10 @@ const St = /* @__PURE__ */ d("$ZodOptional", (e, t) => {
|
|
|
3152
3204
|
function Me(e, t) {
|
|
3153
3205
|
return e.value === void 0 && (e.value = t.defaultValue), e;
|
|
3154
3206
|
}
|
|
3155
|
-
const
|
|
3156
|
-
|
|
3157
|
-
}),
|
|
3158
|
-
|
|
3207
|
+
const Xo = /* @__PURE__ */ d("$ZodPrefault", (e, t) => {
|
|
3208
|
+
z.init(e, t), e._zod.optin = "optional", v(e._zod, "values", () => t.innerType._zod.values), e._zod.parse = (n, r) => (r.direction === "backward" || n.value === void 0 && (n.value = t.defaultValue), t.innerType._zod.run(n, r));
|
|
3209
|
+
}), ei = /* @__PURE__ */ d("$ZodNonOptional", (e, t) => {
|
|
3210
|
+
z.init(e, t), v(e._zod, "values", () => {
|
|
3159
3211
|
const n = t.innerType._zod.values;
|
|
3160
3212
|
return n ? new Set([...n].filter((r) => r !== void 0)) : void 0;
|
|
3161
3213
|
}), e._zod.parse = (n, r) => {
|
|
@@ -3171,8 +3223,8 @@ function Fe(e, t) {
|
|
|
3171
3223
|
inst: t
|
|
3172
3224
|
}), e;
|
|
3173
3225
|
}
|
|
3174
|
-
const
|
|
3175
|
-
|
|
3226
|
+
const ti = /* @__PURE__ */ d("$ZodCatch", (e, t) => {
|
|
3227
|
+
z.init(e, t), v(e._zod, "optin", () => t.innerType._zod.optin), v(e._zod, "optout", () => t.innerType._zod.optout), v(e._zod, "values", () => t.innerType._zod.values), e._zod.parse = (n, r) => {
|
|
3176
3228
|
if (r.direction === "backward")
|
|
3177
3229
|
return t.innerType._zod.run(n, r);
|
|
3178
3230
|
const o = t.innerType._zod.run(n, r);
|
|
@@ -3190,8 +3242,8 @@ const ei = /* @__PURE__ */ d("$ZodCatch", (e, t) => {
|
|
|
3190
3242
|
input: n.value
|
|
3191
3243
|
}), n.issues = []), n);
|
|
3192
3244
|
};
|
|
3193
|
-
}),
|
|
3194
|
-
|
|
3245
|
+
}), ni = /* @__PURE__ */ d("$ZodPipe", (e, t) => {
|
|
3246
|
+
z.init(e, t), v(e._zod, "values", () => t.in._zod.values), v(e._zod, "optin", () => t.in._zod.optin), v(e._zod, "optout", () => t.out._zod.optout), v(e._zod, "propValues", () => t.in._zod.propValues), e._zod.parse = (n, r) => {
|
|
3195
3247
|
if (r.direction === "backward") {
|
|
3196
3248
|
const i = t.out._zod.run(n, r);
|
|
3197
3249
|
return i instanceof Promise ? i.then((s) => re(s, t.in, r)) : re(i, t.in, r);
|
|
@@ -3203,26 +3255,26 @@ const ei = /* @__PURE__ */ d("$ZodCatch", (e, t) => {
|
|
|
3203
3255
|
function re(e, t, n) {
|
|
3204
3256
|
return e.issues.length ? (e.aborted = !0, e) : t._zod.run({ value: e.value, issues: e.issues }, n);
|
|
3205
3257
|
}
|
|
3206
|
-
const
|
|
3207
|
-
|
|
3258
|
+
const ri = /* @__PURE__ */ d("$ZodReadonly", (e, t) => {
|
|
3259
|
+
z.init(e, t), v(e._zod, "propValues", () => t.innerType._zod.propValues), v(e._zod, "values", () => t.innerType._zod.values), v(e._zod, "optin", () => t.innerType?._zod?.optin), v(e._zod, "optout", () => t.innerType?._zod?.optout), e._zod.parse = (n, r) => {
|
|
3208
3260
|
if (r.direction === "backward")
|
|
3209
3261
|
return t.innerType._zod.run(n, r);
|
|
3210
3262
|
const o = t.innerType._zod.run(n, r);
|
|
3211
|
-
return o instanceof Promise ? o.then(
|
|
3263
|
+
return o instanceof Promise ? o.then(xe) : xe(o);
|
|
3212
3264
|
};
|
|
3213
3265
|
});
|
|
3214
|
-
function
|
|
3266
|
+
function xe(e) {
|
|
3215
3267
|
return e.value = Object.freeze(e.value), e;
|
|
3216
3268
|
}
|
|
3217
|
-
const
|
|
3218
|
-
|
|
3269
|
+
const oi = /* @__PURE__ */ d("$ZodCustom", (e, t) => {
|
|
3270
|
+
P.init(e, t), z.init(e, t), e._zod.parse = (n, r) => n, e._zod.check = (n) => {
|
|
3219
3271
|
const r = n.value, o = t.fn(r);
|
|
3220
3272
|
if (o instanceof Promise)
|
|
3221
|
-
return o.then((i) =>
|
|
3222
|
-
|
|
3273
|
+
return o.then((i) => Je(i, n, r, e));
|
|
3274
|
+
Je(o, n, r, e);
|
|
3223
3275
|
};
|
|
3224
3276
|
});
|
|
3225
|
-
function
|
|
3277
|
+
function Je(e, t, n, r) {
|
|
3226
3278
|
if (!e) {
|
|
3227
3279
|
const o = {
|
|
3228
3280
|
code: "custom",
|
|
@@ -3238,7 +3290,7 @@ function xe(e, t, n, r) {
|
|
|
3238
3290
|
}
|
|
3239
3291
|
}
|
|
3240
3292
|
var qe;
|
|
3241
|
-
class
|
|
3293
|
+
class ii {
|
|
3242
3294
|
constructor() {
|
|
3243
3295
|
this._map = /* @__PURE__ */ new WeakMap(), this._idmap = /* @__PURE__ */ new Map();
|
|
3244
3296
|
}
|
|
@@ -3267,20 +3319,20 @@ class oi {
|
|
|
3267
3319
|
return this._map.has(t);
|
|
3268
3320
|
}
|
|
3269
3321
|
}
|
|
3270
|
-
function
|
|
3271
|
-
return new
|
|
3322
|
+
function si() {
|
|
3323
|
+
return new ii();
|
|
3272
3324
|
}
|
|
3273
|
-
(qe = globalThis).__zod_globalRegistry ?? (qe.__zod_globalRegistry =
|
|
3325
|
+
(qe = globalThis).__zod_globalRegistry ?? (qe.__zod_globalRegistry = si());
|
|
3274
3326
|
const X = globalThis.__zod_globalRegistry;
|
|
3275
3327
|
// @__NO_SIDE_EFFECTS__
|
|
3276
|
-
function
|
|
3328
|
+
function ai(e, t) {
|
|
3277
3329
|
return new e({
|
|
3278
3330
|
type: "string",
|
|
3279
3331
|
...h(t)
|
|
3280
3332
|
});
|
|
3281
3333
|
}
|
|
3282
3334
|
// @__NO_SIDE_EFFECTS__
|
|
3283
|
-
function
|
|
3335
|
+
function ci(e, t) {
|
|
3284
3336
|
return new e({
|
|
3285
3337
|
type: "string",
|
|
3286
3338
|
format: "email",
|
|
@@ -3300,7 +3352,7 @@ function Ve(e, t) {
|
|
|
3300
3352
|
});
|
|
3301
3353
|
}
|
|
3302
3354
|
// @__NO_SIDE_EFFECTS__
|
|
3303
|
-
function
|
|
3355
|
+
function ui(e, t) {
|
|
3304
3356
|
return new e({
|
|
3305
3357
|
type: "string",
|
|
3306
3358
|
format: "uuid",
|
|
@@ -3310,7 +3362,7 @@ function ci(e, t) {
|
|
|
3310
3362
|
});
|
|
3311
3363
|
}
|
|
3312
3364
|
// @__NO_SIDE_EFFECTS__
|
|
3313
|
-
function
|
|
3365
|
+
function di(e, t) {
|
|
3314
3366
|
return new e({
|
|
3315
3367
|
type: "string",
|
|
3316
3368
|
format: "uuid",
|
|
@@ -3321,7 +3373,7 @@ function ui(e, t) {
|
|
|
3321
3373
|
});
|
|
3322
3374
|
}
|
|
3323
3375
|
// @__NO_SIDE_EFFECTS__
|
|
3324
|
-
function
|
|
3376
|
+
function li(e, t) {
|
|
3325
3377
|
return new e({
|
|
3326
3378
|
type: "string",
|
|
3327
3379
|
format: "uuid",
|
|
@@ -3332,7 +3384,7 @@ function di(e, t) {
|
|
|
3332
3384
|
});
|
|
3333
3385
|
}
|
|
3334
3386
|
// @__NO_SIDE_EFFECTS__
|
|
3335
|
-
function
|
|
3387
|
+
function fi(e, t) {
|
|
3336
3388
|
return new e({
|
|
3337
3389
|
type: "string",
|
|
3338
3390
|
format: "uuid",
|
|
@@ -3343,7 +3395,7 @@ function li(e, t) {
|
|
|
3343
3395
|
});
|
|
3344
3396
|
}
|
|
3345
3397
|
// @__NO_SIDE_EFFECTS__
|
|
3346
|
-
function
|
|
3398
|
+
function pi(e, t) {
|
|
3347
3399
|
return new e({
|
|
3348
3400
|
type: "string",
|
|
3349
3401
|
format: "url",
|
|
@@ -3353,7 +3405,7 @@ function fi(e, t) {
|
|
|
3353
3405
|
});
|
|
3354
3406
|
}
|
|
3355
3407
|
// @__NO_SIDE_EFFECTS__
|
|
3356
|
-
function
|
|
3408
|
+
function gi(e, t) {
|
|
3357
3409
|
return new e({
|
|
3358
3410
|
type: "string",
|
|
3359
3411
|
format: "emoji",
|
|
@@ -3363,7 +3415,7 @@ function pi(e, t) {
|
|
|
3363
3415
|
});
|
|
3364
3416
|
}
|
|
3365
3417
|
// @__NO_SIDE_EFFECTS__
|
|
3366
|
-
function
|
|
3418
|
+
function hi(e, t) {
|
|
3367
3419
|
return new e({
|
|
3368
3420
|
type: "string",
|
|
3369
3421
|
format: "nanoid",
|
|
@@ -3373,7 +3425,7 @@ function gi(e, t) {
|
|
|
3373
3425
|
});
|
|
3374
3426
|
}
|
|
3375
3427
|
// @__NO_SIDE_EFFECTS__
|
|
3376
|
-
function
|
|
3428
|
+
function mi(e, t) {
|
|
3377
3429
|
return new e({
|
|
3378
3430
|
type: "string",
|
|
3379
3431
|
format: "cuid",
|
|
@@ -3383,7 +3435,7 @@ function hi(e, t) {
|
|
|
3383
3435
|
});
|
|
3384
3436
|
}
|
|
3385
3437
|
// @__NO_SIDE_EFFECTS__
|
|
3386
|
-
function
|
|
3438
|
+
function _i(e, t) {
|
|
3387
3439
|
return new e({
|
|
3388
3440
|
type: "string",
|
|
3389
3441
|
format: "cuid2",
|
|
@@ -3393,7 +3445,7 @@ function mi(e, t) {
|
|
|
3393
3445
|
});
|
|
3394
3446
|
}
|
|
3395
3447
|
// @__NO_SIDE_EFFECTS__
|
|
3396
|
-
function
|
|
3448
|
+
function yi(e, t) {
|
|
3397
3449
|
return new e({
|
|
3398
3450
|
type: "string",
|
|
3399
3451
|
format: "ulid",
|
|
@@ -3403,7 +3455,7 @@ function _i(e, t) {
|
|
|
3403
3455
|
});
|
|
3404
3456
|
}
|
|
3405
3457
|
// @__NO_SIDE_EFFECTS__
|
|
3406
|
-
function
|
|
3458
|
+
function vi(e, t) {
|
|
3407
3459
|
return new e({
|
|
3408
3460
|
type: "string",
|
|
3409
3461
|
format: "xid",
|
|
@@ -3413,7 +3465,7 @@ function yi(e, t) {
|
|
|
3413
3465
|
});
|
|
3414
3466
|
}
|
|
3415
3467
|
// @__NO_SIDE_EFFECTS__
|
|
3416
|
-
function
|
|
3468
|
+
function wi(e, t) {
|
|
3417
3469
|
return new e({
|
|
3418
3470
|
type: "string",
|
|
3419
3471
|
format: "ksuid",
|
|
@@ -3423,7 +3475,7 @@ function vi(e, t) {
|
|
|
3423
3475
|
});
|
|
3424
3476
|
}
|
|
3425
3477
|
// @__NO_SIDE_EFFECTS__
|
|
3426
|
-
function
|
|
3478
|
+
function bi(e, t) {
|
|
3427
3479
|
return new e({
|
|
3428
3480
|
type: "string",
|
|
3429
3481
|
format: "ipv4",
|
|
@@ -3433,7 +3485,7 @@ function wi(e, t) {
|
|
|
3433
3485
|
});
|
|
3434
3486
|
}
|
|
3435
3487
|
// @__NO_SIDE_EFFECTS__
|
|
3436
|
-
function
|
|
3488
|
+
function ki(e, t) {
|
|
3437
3489
|
return new e({
|
|
3438
3490
|
type: "string",
|
|
3439
3491
|
format: "ipv6",
|
|
@@ -3443,7 +3495,7 @@ function bi(e, t) {
|
|
|
3443
3495
|
});
|
|
3444
3496
|
}
|
|
3445
3497
|
// @__NO_SIDE_EFFECTS__
|
|
3446
|
-
function
|
|
3498
|
+
function zi(e, t) {
|
|
3447
3499
|
return new e({
|
|
3448
3500
|
type: "string",
|
|
3449
3501
|
format: "cidrv4",
|
|
@@ -3453,7 +3505,7 @@ function ki(e, t) {
|
|
|
3453
3505
|
});
|
|
3454
3506
|
}
|
|
3455
3507
|
// @__NO_SIDE_EFFECTS__
|
|
3456
|
-
function
|
|
3508
|
+
function $i(e, t) {
|
|
3457
3509
|
return new e({
|
|
3458
3510
|
type: "string",
|
|
3459
3511
|
format: "cidrv6",
|
|
@@ -3463,7 +3515,7 @@ function zi(e, t) {
|
|
|
3463
3515
|
});
|
|
3464
3516
|
}
|
|
3465
3517
|
// @__NO_SIDE_EFFECTS__
|
|
3466
|
-
function
|
|
3518
|
+
function Si(e, t) {
|
|
3467
3519
|
return new e({
|
|
3468
3520
|
type: "string",
|
|
3469
3521
|
format: "base64",
|
|
@@ -3473,7 +3525,7 @@ function $i(e, t) {
|
|
|
3473
3525
|
});
|
|
3474
3526
|
}
|
|
3475
3527
|
// @__NO_SIDE_EFFECTS__
|
|
3476
|
-
function
|
|
3528
|
+
function Ei(e, t) {
|
|
3477
3529
|
return new e({
|
|
3478
3530
|
type: "string",
|
|
3479
3531
|
format: "base64url",
|
|
@@ -3483,7 +3535,7 @@ function Si(e, t) {
|
|
|
3483
3535
|
});
|
|
3484
3536
|
}
|
|
3485
3537
|
// @__NO_SIDE_EFFECTS__
|
|
3486
|
-
function
|
|
3538
|
+
function Zi(e, t) {
|
|
3487
3539
|
return new e({
|
|
3488
3540
|
type: "string",
|
|
3489
3541
|
format: "e164",
|
|
@@ -3493,7 +3545,7 @@ function Ei(e, t) {
|
|
|
3493
3545
|
});
|
|
3494
3546
|
}
|
|
3495
3547
|
// @__NO_SIDE_EFFECTS__
|
|
3496
|
-
function
|
|
3548
|
+
function Ti(e, t) {
|
|
3497
3549
|
return new e({
|
|
3498
3550
|
type: "string",
|
|
3499
3551
|
format: "jwt",
|
|
@@ -3503,7 +3555,7 @@ function Zi(e, t) {
|
|
|
3503
3555
|
});
|
|
3504
3556
|
}
|
|
3505
3557
|
// @__NO_SIDE_EFFECTS__
|
|
3506
|
-
function
|
|
3558
|
+
function Ii(e, t) {
|
|
3507
3559
|
return new e({
|
|
3508
3560
|
type: "string",
|
|
3509
3561
|
format: "datetime",
|
|
@@ -3515,7 +3567,7 @@ function Ti(e, t) {
|
|
|
3515
3567
|
});
|
|
3516
3568
|
}
|
|
3517
3569
|
// @__NO_SIDE_EFFECTS__
|
|
3518
|
-
function
|
|
3570
|
+
function Oi(e, t) {
|
|
3519
3571
|
return new e({
|
|
3520
3572
|
type: "string",
|
|
3521
3573
|
format: "date",
|
|
@@ -3524,7 +3576,7 @@ function Ii(e, t) {
|
|
|
3524
3576
|
});
|
|
3525
3577
|
}
|
|
3526
3578
|
// @__NO_SIDE_EFFECTS__
|
|
3527
|
-
function
|
|
3579
|
+
function Pi(e, t) {
|
|
3528
3580
|
return new e({
|
|
3529
3581
|
type: "string",
|
|
3530
3582
|
format: "time",
|
|
@@ -3534,7 +3586,7 @@ function Oi(e, t) {
|
|
|
3534
3586
|
});
|
|
3535
3587
|
}
|
|
3536
3588
|
// @__NO_SIDE_EFFECTS__
|
|
3537
|
-
function
|
|
3589
|
+
function Ai(e, t) {
|
|
3538
3590
|
return new e({
|
|
3539
3591
|
type: "string",
|
|
3540
3592
|
format: "duration",
|
|
@@ -3543,7 +3595,7 @@ function Pi(e, t) {
|
|
|
3543
3595
|
});
|
|
3544
3596
|
}
|
|
3545
3597
|
// @__NO_SIDE_EFFECTS__
|
|
3546
|
-
function
|
|
3598
|
+
function Ni(e, t) {
|
|
3547
3599
|
return new e({
|
|
3548
3600
|
type: "number",
|
|
3549
3601
|
checks: [],
|
|
@@ -3551,7 +3603,7 @@ function Ai(e, t) {
|
|
|
3551
3603
|
});
|
|
3552
3604
|
}
|
|
3553
3605
|
// @__NO_SIDE_EFFECTS__
|
|
3554
|
-
function
|
|
3606
|
+
function Ci(e, t) {
|
|
3555
3607
|
return new e({
|
|
3556
3608
|
type: "number",
|
|
3557
3609
|
check: "number_format",
|
|
@@ -3561,20 +3613,20 @@ function Ni(e, t) {
|
|
|
3561
3613
|
});
|
|
3562
3614
|
}
|
|
3563
3615
|
// @__NO_SIDE_EFFECTS__
|
|
3564
|
-
function
|
|
3616
|
+
function Ri(e, t) {
|
|
3565
3617
|
return new e({
|
|
3566
3618
|
type: "boolean",
|
|
3567
3619
|
...h(t)
|
|
3568
3620
|
});
|
|
3569
3621
|
}
|
|
3570
3622
|
// @__NO_SIDE_EFFECTS__
|
|
3571
|
-
function
|
|
3623
|
+
function ji(e) {
|
|
3572
3624
|
return new e({
|
|
3573
3625
|
type: "unknown"
|
|
3574
3626
|
});
|
|
3575
3627
|
}
|
|
3576
3628
|
// @__NO_SIDE_EFFECTS__
|
|
3577
|
-
function
|
|
3629
|
+
function Di(e, t) {
|
|
3578
3630
|
return new e({
|
|
3579
3631
|
type: "never",
|
|
3580
3632
|
...h(t)
|
|
@@ -3618,7 +3670,7 @@ function pe(e, t) {
|
|
|
3618
3670
|
}
|
|
3619
3671
|
// @__NO_SIDE_EFFECTS__
|
|
3620
3672
|
function We(e, t) {
|
|
3621
|
-
return new
|
|
3673
|
+
return new Yr({
|
|
3622
3674
|
check: "multiple_of",
|
|
3623
3675
|
...h(t),
|
|
3624
3676
|
value: e
|
|
@@ -3626,7 +3678,7 @@ function We(e, t) {
|
|
|
3626
3678
|
}
|
|
3627
3679
|
// @__NO_SIDE_EFFECTS__
|
|
3628
3680
|
function Et(e, t) {
|
|
3629
|
-
return new
|
|
3681
|
+
return new Xr({
|
|
3630
3682
|
check: "max_length",
|
|
3631
3683
|
...h(t),
|
|
3632
3684
|
maximum: e
|
|
@@ -3634,7 +3686,7 @@ function Et(e, t) {
|
|
|
3634
3686
|
}
|
|
3635
3687
|
// @__NO_SIDE_EFFECTS__
|
|
3636
3688
|
function ae(e, t) {
|
|
3637
|
-
return new
|
|
3689
|
+
return new eo({
|
|
3638
3690
|
check: "min_length",
|
|
3639
3691
|
...h(t),
|
|
3640
3692
|
minimum: e
|
|
@@ -3642,15 +3694,15 @@ function ae(e, t) {
|
|
|
3642
3694
|
}
|
|
3643
3695
|
// @__NO_SIDE_EFFECTS__
|
|
3644
3696
|
function Zt(e, t) {
|
|
3645
|
-
return new
|
|
3697
|
+
return new to({
|
|
3646
3698
|
check: "length_equals",
|
|
3647
3699
|
...h(t),
|
|
3648
3700
|
length: e
|
|
3649
3701
|
});
|
|
3650
3702
|
}
|
|
3651
3703
|
// @__NO_SIDE_EFFECTS__
|
|
3652
|
-
function
|
|
3653
|
-
return new
|
|
3704
|
+
function Li(e, t) {
|
|
3705
|
+
return new no({
|
|
3654
3706
|
check: "string_format",
|
|
3655
3707
|
format: "regex",
|
|
3656
3708
|
...h(t),
|
|
@@ -3658,24 +3710,24 @@ function Di(e, t) {
|
|
|
3658
3710
|
});
|
|
3659
3711
|
}
|
|
3660
3712
|
// @__NO_SIDE_EFFECTS__
|
|
3661
|
-
function
|
|
3662
|
-
return new
|
|
3713
|
+
function Ui(e) {
|
|
3714
|
+
return new ro({
|
|
3663
3715
|
check: "string_format",
|
|
3664
3716
|
format: "lowercase",
|
|
3665
3717
|
...h(e)
|
|
3666
3718
|
});
|
|
3667
3719
|
}
|
|
3668
3720
|
// @__NO_SIDE_EFFECTS__
|
|
3669
|
-
function
|
|
3670
|
-
return new
|
|
3721
|
+
function Mi(e) {
|
|
3722
|
+
return new oo({
|
|
3671
3723
|
check: "string_format",
|
|
3672
3724
|
format: "uppercase",
|
|
3673
3725
|
...h(e)
|
|
3674
3726
|
});
|
|
3675
3727
|
}
|
|
3676
3728
|
// @__NO_SIDE_EFFECTS__
|
|
3677
|
-
function
|
|
3678
|
-
return new
|
|
3729
|
+
function Fi(e, t) {
|
|
3730
|
+
return new io({
|
|
3679
3731
|
check: "string_format",
|
|
3680
3732
|
format: "includes",
|
|
3681
3733
|
...h(t),
|
|
@@ -3683,8 +3735,8 @@ function Mi(e, t) {
|
|
|
3683
3735
|
});
|
|
3684
3736
|
}
|
|
3685
3737
|
// @__NO_SIDE_EFFECTS__
|
|
3686
|
-
function
|
|
3687
|
-
return new
|
|
3738
|
+
function xi(e, t) {
|
|
3739
|
+
return new so({
|
|
3688
3740
|
check: "string_format",
|
|
3689
3741
|
format: "starts_with",
|
|
3690
3742
|
...h(t),
|
|
@@ -3693,7 +3745,7 @@ function Fi(e, t) {
|
|
|
3693
3745
|
}
|
|
3694
3746
|
// @__NO_SIDE_EFFECTS__
|
|
3695
3747
|
function Ji(e, t) {
|
|
3696
|
-
return new
|
|
3748
|
+
return new ao({
|
|
3697
3749
|
check: "string_format",
|
|
3698
3750
|
format: "ends_with",
|
|
3699
3751
|
...h(t),
|
|
@@ -3702,33 +3754,33 @@ function Ji(e, t) {
|
|
|
3702
3754
|
}
|
|
3703
3755
|
// @__NO_SIDE_EFFECTS__
|
|
3704
3756
|
function K(e) {
|
|
3705
|
-
return new
|
|
3757
|
+
return new co({
|
|
3706
3758
|
check: "overwrite",
|
|
3707
3759
|
tx: e
|
|
3708
3760
|
});
|
|
3709
3761
|
}
|
|
3710
3762
|
// @__NO_SIDE_EFFECTS__
|
|
3711
|
-
function
|
|
3763
|
+
function qi(e) {
|
|
3712
3764
|
return /* @__PURE__ */ K((t) => t.normalize(e));
|
|
3713
3765
|
}
|
|
3714
3766
|
// @__NO_SIDE_EFFECTS__
|
|
3715
|
-
function
|
|
3767
|
+
function Vi() {
|
|
3716
3768
|
return /* @__PURE__ */ K((e) => e.trim());
|
|
3717
3769
|
}
|
|
3718
3770
|
// @__NO_SIDE_EFFECTS__
|
|
3719
|
-
function
|
|
3771
|
+
function Gi() {
|
|
3720
3772
|
return /* @__PURE__ */ K((e) => e.toLowerCase());
|
|
3721
3773
|
}
|
|
3722
3774
|
// @__NO_SIDE_EFFECTS__
|
|
3723
|
-
function
|
|
3775
|
+
function Bi() {
|
|
3724
3776
|
return /* @__PURE__ */ K((e) => e.toUpperCase());
|
|
3725
3777
|
}
|
|
3726
3778
|
// @__NO_SIDE_EFFECTS__
|
|
3727
|
-
function
|
|
3728
|
-
return /* @__PURE__ */ K((e) =>
|
|
3779
|
+
function Wi() {
|
|
3780
|
+
return /* @__PURE__ */ K((e) => nr(e));
|
|
3729
3781
|
}
|
|
3730
3782
|
// @__NO_SIDE_EFFECTS__
|
|
3731
|
-
function
|
|
3783
|
+
function Hi(e, t, n) {
|
|
3732
3784
|
return new e({
|
|
3733
3785
|
type: "array",
|
|
3734
3786
|
element: t,
|
|
@@ -3739,7 +3791,7 @@ function Wi(e, t, n) {
|
|
|
3739
3791
|
});
|
|
3740
3792
|
}
|
|
3741
3793
|
// @__NO_SIDE_EFFECTS__
|
|
3742
|
-
function
|
|
3794
|
+
function Ki(e, t, n) {
|
|
3743
3795
|
return new e({
|
|
3744
3796
|
type: "custom",
|
|
3745
3797
|
check: "custom",
|
|
@@ -3748,8 +3800,8 @@ function Hi(e, t, n) {
|
|
|
3748
3800
|
});
|
|
3749
3801
|
}
|
|
3750
3802
|
// @__NO_SIDE_EFFECTS__
|
|
3751
|
-
function
|
|
3752
|
-
const t = /* @__PURE__ */
|
|
3803
|
+
function Yi(e) {
|
|
3804
|
+
const t = /* @__PURE__ */ Qi((n) => (n.addIssue = (r) => {
|
|
3753
3805
|
if (typeof r == "string")
|
|
3754
3806
|
n.issues.push(te(r, n.value, t._zod.def));
|
|
3755
3807
|
else {
|
|
@@ -3760,8 +3812,8 @@ function Ki(e) {
|
|
|
3760
3812
|
return t;
|
|
3761
3813
|
}
|
|
3762
3814
|
// @__NO_SIDE_EFFECTS__
|
|
3763
|
-
function
|
|
3764
|
-
const n = new
|
|
3815
|
+
function Qi(e, t) {
|
|
3816
|
+
const n = new P({
|
|
3765
3817
|
check: "custom",
|
|
3766
3818
|
...h(t)
|
|
3767
3819
|
});
|
|
@@ -3784,7 +3836,7 @@ function Tt(e) {
|
|
|
3784
3836
|
external: e?.external ?? void 0
|
|
3785
3837
|
};
|
|
3786
3838
|
}
|
|
3787
|
-
function
|
|
3839
|
+
function E(e, t, n = { path: [], schemaPath: [] }) {
|
|
3788
3840
|
var r;
|
|
3789
3841
|
const o = e._zod.def, i = t.seen.get(e);
|
|
3790
3842
|
if (i)
|
|
@@ -3809,7 +3861,7 @@ function S(e, t, n = { path: [], schemaPath: [] }) {
|
|
|
3809
3861
|
g(e, t, p, l);
|
|
3810
3862
|
}
|
|
3811
3863
|
const f = e._zod.parent;
|
|
3812
|
-
f && (s.ref || (s.ref = f),
|
|
3864
|
+
f && (s.ref || (s.ref = f), E(f, t, l), t.seen.get(f).isParent = !0);
|
|
3813
3865
|
}
|
|
3814
3866
|
const c = t.metadataRegistry.get(e);
|
|
3815
3867
|
return c && Object.assign(s.schema, c), t.io === "input" && T(e) && (delete s.schema.examples, delete s.schema.default), t.io === "input" && s.schema._prefault && ((r = s.schema).default ?? (r.default = s.schema._prefault)), delete s.schema._prefault, t.seen.get(e).schema;
|
|
@@ -3831,7 +3883,7 @@ function It(e, t) {
|
|
|
3831
3883
|
const o = (s) => {
|
|
3832
3884
|
const a = e.target === "draft-2020-12" ? "$defs" : "definitions";
|
|
3833
3885
|
if (e.external) {
|
|
3834
|
-
const f = e.external.registry.get(s[0])?.id, p = e.external.uri ?? ((
|
|
3886
|
+
const f = e.external.registry.get(s[0])?.id, p = e.external.uri ?? ((y) => y);
|
|
3835
3887
|
if (f)
|
|
3836
3888
|
return { ref: p(f) };
|
|
3837
3889
|
const g = s[1].defId ?? s[1].schema.id ?? `schema${e.counter++}`;
|
|
@@ -3899,11 +3951,11 @@ function Ot(e, t) {
|
|
|
3899
3951
|
r(l);
|
|
3900
3952
|
const p = e.seen.get(l), g = p.schema;
|
|
3901
3953
|
if (g.$ref && (e.target === "draft-07" || e.target === "draft-04" || e.target === "openapi-3.0") ? (c.allOf = c.allOf ?? [], c.allOf.push(g)) : Object.assign(c, g), Object.assign(c, u), s._zod.parent === l)
|
|
3902
|
-
for (const
|
|
3903
|
-
|
|
3954
|
+
for (const _ in c)
|
|
3955
|
+
_ === "$ref" || _ === "allOf" || _ in u || delete c[_];
|
|
3904
3956
|
if (g.$ref && p.def)
|
|
3905
|
-
for (const
|
|
3906
|
-
|
|
3957
|
+
for (const _ in c)
|
|
3958
|
+
_ === "$ref" || _ === "allOf" || _ in p.def && JSON.stringify(c[_]) === JSON.stringify(p.def[_]) && delete c[_];
|
|
3907
3959
|
}
|
|
3908
3960
|
const f = s._zod.parent;
|
|
3909
3961
|
if (f && f !== l) {
|
|
@@ -3994,24 +4046,24 @@ function T(e, t) {
|
|
|
3994
4046
|
}
|
|
3995
4047
|
return !1;
|
|
3996
4048
|
}
|
|
3997
|
-
const
|
|
4049
|
+
const Xi = (e, t = {}) => (n) => {
|
|
3998
4050
|
const r = Tt({ ...n, processors: t });
|
|
3999
|
-
return
|
|
4051
|
+
return E(e, r), It(r, e), Ot(r, e);
|
|
4000
4052
|
}, ce = (e, t, n = {}) => (r) => {
|
|
4001
4053
|
const { libraryOptions: o, target: i } = r ?? {}, s = Tt({ ...o ?? {}, target: i, io: t, processors: n });
|
|
4002
|
-
return
|
|
4003
|
-
},
|
|
4054
|
+
return E(e, s), It(s, e), Ot(s, e);
|
|
4055
|
+
}, es = {
|
|
4004
4056
|
guid: "uuid",
|
|
4005
4057
|
url: "uri",
|
|
4006
4058
|
datetime: "date-time",
|
|
4007
4059
|
json_string: "json-string",
|
|
4008
4060
|
regex: ""
|
|
4009
4061
|
// do not set
|
|
4010
|
-
},
|
|
4062
|
+
}, ts = (e, t, n, r) => {
|
|
4011
4063
|
const o = n;
|
|
4012
4064
|
o.type = "string";
|
|
4013
4065
|
const { minimum: i, maximum: s, format: a, patterns: c, contentEncoding: u } = e._zod.bag;
|
|
4014
|
-
if (typeof i == "number" && (o.minLength = i), typeof s == "number" && (o.maxLength = s), a && (o.format =
|
|
4066
|
+
if (typeof i == "number" && (o.minLength = i), typeof s == "number" && (o.maxLength = s), a && (o.format = es[a] ?? a, o.format === "" && delete o.format, a === "time" && delete o.format), u && (o.contentEncoding = u), c && c.size > 0) {
|
|
4015
4067
|
const l = [...c];
|
|
4016
4068
|
l.length === 1 ? o.pattern = l[0].source : l.length > 1 && (o.allOf = [
|
|
4017
4069
|
...l.map((f) => ({
|
|
@@ -4020,18 +4072,18 @@ const Qi = (e, t = {}) => (n) => {
|
|
|
4020
4072
|
}))
|
|
4021
4073
|
]);
|
|
4022
4074
|
}
|
|
4023
|
-
},
|
|
4075
|
+
}, ns = (e, t, n, r) => {
|
|
4024
4076
|
const o = n, { minimum: i, maximum: s, format: a, multipleOf: c, exclusiveMaximum: u, exclusiveMinimum: l } = e._zod.bag;
|
|
4025
4077
|
typeof a == "string" && a.includes("int") ? o.type = "integer" : o.type = "number", typeof l == "number" && (t.target === "draft-04" || t.target === "openapi-3.0" ? (o.minimum = l, o.exclusiveMinimum = !0) : o.exclusiveMinimum = l), typeof i == "number" && (o.minimum = i, typeof l == "number" && t.target !== "draft-04" && (l >= i ? delete o.minimum : delete o.exclusiveMinimum)), typeof u == "number" && (t.target === "draft-04" || t.target === "openapi-3.0" ? (o.maximum = u, o.exclusiveMaximum = !0) : o.exclusiveMaximum = u), typeof s == "number" && (o.maximum = s, typeof u == "number" && t.target !== "draft-04" && (u <= s ? delete o.maximum : delete o.exclusiveMaximum)), typeof c == "number" && (o.multipleOf = c);
|
|
4026
|
-
}, ns = (e, t, n, r) => {
|
|
4027
|
-
n.type = "boolean";
|
|
4028
4078
|
}, rs = (e, t, n, r) => {
|
|
4029
|
-
n.
|
|
4079
|
+
n.type = "boolean";
|
|
4030
4080
|
}, os = (e, t, n, r) => {
|
|
4081
|
+
n.not = {};
|
|
4031
4082
|
}, is = (e, t, n, r) => {
|
|
4083
|
+
}, ss = (e, t, n, r) => {
|
|
4032
4084
|
const o = e._zod.def, i = ct(o.entries);
|
|
4033
4085
|
i.every((s) => typeof s == "number") && (n.type = "number"), i.every((s) => typeof s == "string") && (n.type = "string"), n.enum = i;
|
|
4034
|
-
},
|
|
4086
|
+
}, as = (e, t, n, r) => {
|
|
4035
4087
|
const o = e._zod.def, i = [];
|
|
4036
4088
|
for (const s of o.values)
|
|
4037
4089
|
if (s === void 0) {
|
|
@@ -4048,21 +4100,21 @@ const Qi = (e, t = {}) => (n) => {
|
|
|
4048
4100
|
n.type = s === null ? "null" : typeof s, t.target === "draft-04" || t.target === "openapi-3.0" ? n.enum = [s] : n.const = s;
|
|
4049
4101
|
} else
|
|
4050
4102
|
i.every((s) => typeof s == "number") && (n.type = "number"), i.every((s) => typeof s == "string") && (n.type = "string"), i.every((s) => typeof s == "boolean") && (n.type = "boolean"), i.every((s) => s === null) && (n.type = "null"), n.enum = i;
|
|
4051
|
-
},
|
|
4103
|
+
}, cs = (e, t, n, r) => {
|
|
4052
4104
|
if (t.unrepresentable === "throw")
|
|
4053
4105
|
throw new Error("Custom types cannot be represented in JSON Schema");
|
|
4054
|
-
},
|
|
4106
|
+
}, us = (e, t, n, r) => {
|
|
4055
4107
|
if (t.unrepresentable === "throw")
|
|
4056
4108
|
throw new Error("Transforms cannot be represented in JSON Schema");
|
|
4057
|
-
}, us = (e, t, n, r) => {
|
|
4058
|
-
const o = n, i = e._zod.def, { minimum: s, maximum: a } = e._zod.bag;
|
|
4059
|
-
typeof s == "number" && (o.minItems = s), typeof a == "number" && (o.maxItems = a), o.type = "array", o.items = S(i.element, t, { ...r, path: [...r.path, "items"] });
|
|
4060
4109
|
}, ds = (e, t, n, r) => {
|
|
4110
|
+
const o = n, i = e._zod.def, { minimum: s, maximum: a } = e._zod.bag;
|
|
4111
|
+
typeof s == "number" && (o.minItems = s), typeof a == "number" && (o.maxItems = a), o.type = "array", o.items = E(i.element, t, { ...r, path: [...r.path, "items"] });
|
|
4112
|
+
}, ls = (e, t, n, r) => {
|
|
4061
4113
|
const o = n, i = e._zod.def;
|
|
4062
4114
|
o.type = "object", o.properties = {};
|
|
4063
4115
|
const s = i.shape;
|
|
4064
4116
|
for (const u in s)
|
|
4065
|
-
o.properties[u] =
|
|
4117
|
+
o.properties[u] = E(s[u], t, {
|
|
4066
4118
|
...r,
|
|
4067
4119
|
path: [...r.path, "properties", u]
|
|
4068
4120
|
});
|
|
@@ -4070,21 +4122,21 @@ const Qi = (e, t = {}) => (n) => {
|
|
|
4070
4122
|
const l = i.shape[u]._zod;
|
|
4071
4123
|
return t.io === "input" ? l.optin === void 0 : l.optout === void 0;
|
|
4072
4124
|
}));
|
|
4073
|
-
c.size > 0 && (o.required = Array.from(c)), i.catchall?._zod.def.type === "never" ? o.additionalProperties = !1 : i.catchall ? i.catchall && (o.additionalProperties =
|
|
4125
|
+
c.size > 0 && (o.required = Array.from(c)), i.catchall?._zod.def.type === "never" ? o.additionalProperties = !1 : i.catchall ? i.catchall && (o.additionalProperties = E(i.catchall, t, {
|
|
4074
4126
|
...r,
|
|
4075
4127
|
path: [...r.path, "additionalProperties"]
|
|
4076
4128
|
})) : t.io === "output" && (o.additionalProperties = !1);
|
|
4077
|
-
},
|
|
4078
|
-
const o = e._zod.def, i = o.inclusive === !1, s = o.options.map((a, c) =>
|
|
4129
|
+
}, fs = (e, t, n, r) => {
|
|
4130
|
+
const o = e._zod.def, i = o.inclusive === !1, s = o.options.map((a, c) => E(a, t, {
|
|
4079
4131
|
...r,
|
|
4080
4132
|
path: [...r.path, i ? "oneOf" : "anyOf", c]
|
|
4081
4133
|
}));
|
|
4082
4134
|
i ? n.oneOf = s : n.anyOf = s;
|
|
4083
|
-
},
|
|
4084
|
-
const o = e._zod.def, i =
|
|
4135
|
+
}, ps = (e, t, n, r) => {
|
|
4136
|
+
const o = e._zod.def, i = E(o.left, t, {
|
|
4085
4137
|
...r,
|
|
4086
4138
|
path: [...r.path, "allOf", 0]
|
|
4087
|
-
}), s =
|
|
4139
|
+
}), s = E(o.right, t, {
|
|
4088
4140
|
...r,
|
|
4089
4141
|
path: [...r.path, "allOf", 1]
|
|
4090
4142
|
}), a = (u) => "allOf" in u && Object.keys(u).length === 1, c = [
|
|
@@ -4092,12 +4144,12 @@ const Qi = (e, t = {}) => (n) => {
|
|
|
4092
4144
|
...a(s) ? s.allOf : [s]
|
|
4093
4145
|
];
|
|
4094
4146
|
n.allOf = c;
|
|
4095
|
-
},
|
|
4147
|
+
}, gs = (e, t, n, r) => {
|
|
4096
4148
|
const o = n, i = e._zod.def;
|
|
4097
4149
|
o.type = "object";
|
|
4098
4150
|
const s = i.keyType, c = s._zod.bag?.patterns;
|
|
4099
4151
|
if (i.mode === "loose" && c && c.size > 0) {
|
|
4100
|
-
const l =
|
|
4152
|
+
const l = E(i.valueType, t, {
|
|
4101
4153
|
...r,
|
|
4102
4154
|
path: [...r.path, "patternProperties", "*"]
|
|
4103
4155
|
});
|
|
@@ -4105,10 +4157,10 @@ const Qi = (e, t = {}) => (n) => {
|
|
|
4105
4157
|
for (const f of c)
|
|
4106
4158
|
o.patternProperties[f.source] = l;
|
|
4107
4159
|
} else
|
|
4108
|
-
(t.target === "draft-07" || t.target === "draft-2020-12") && (o.propertyNames =
|
|
4160
|
+
(t.target === "draft-07" || t.target === "draft-2020-12") && (o.propertyNames = E(i.keyType, t, {
|
|
4109
4161
|
...r,
|
|
4110
4162
|
path: [...r.path, "propertyNames"]
|
|
4111
|
-
})), o.additionalProperties =
|
|
4163
|
+
})), o.additionalProperties = E(i.valueType, t, {
|
|
4112
4164
|
...r,
|
|
4113
4165
|
path: [...r.path, "additionalProperties"]
|
|
4114
4166
|
});
|
|
@@ -4117,27 +4169,27 @@ const Qi = (e, t = {}) => (n) => {
|
|
|
4117
4169
|
const l = [...u].filter((f) => typeof f == "string" || typeof f == "number");
|
|
4118
4170
|
l.length > 0 && (o.required = l);
|
|
4119
4171
|
}
|
|
4120
|
-
}, gs = (e, t, n, r) => {
|
|
4121
|
-
const o = e._zod.def, i = S(o.innerType, t, r), s = t.seen.get(e);
|
|
4122
|
-
t.target === "openapi-3.0" ? (s.ref = o.innerType, n.nullable = !0) : n.anyOf = [i, { type: "null" }];
|
|
4123
4172
|
}, hs = (e, t, n, r) => {
|
|
4173
|
+
const o = e._zod.def, i = E(o.innerType, t, r), s = t.seen.get(e);
|
|
4174
|
+
t.target === "openapi-3.0" ? (s.ref = o.innerType, n.nullable = !0) : n.anyOf = [i, { type: "null" }];
|
|
4175
|
+
}, ms = (e, t, n, r) => {
|
|
4124
4176
|
const o = e._zod.def;
|
|
4125
|
-
|
|
4177
|
+
E(o.innerType, t, r);
|
|
4126
4178
|
const i = t.seen.get(e);
|
|
4127
4179
|
i.ref = o.innerType;
|
|
4128
|
-
},
|
|
4180
|
+
}, _s = (e, t, n, r) => {
|
|
4129
4181
|
const o = e._zod.def;
|
|
4130
|
-
|
|
4182
|
+
E(o.innerType, t, r);
|
|
4131
4183
|
const i = t.seen.get(e);
|
|
4132
4184
|
i.ref = o.innerType, n.default = JSON.parse(JSON.stringify(o.defaultValue));
|
|
4133
|
-
},
|
|
4185
|
+
}, ys = (e, t, n, r) => {
|
|
4134
4186
|
const o = e._zod.def;
|
|
4135
|
-
|
|
4187
|
+
E(o.innerType, t, r);
|
|
4136
4188
|
const i = t.seen.get(e);
|
|
4137
4189
|
i.ref = o.innerType, t.io === "input" && (n._prefault = JSON.parse(JSON.stringify(o.defaultValue)));
|
|
4138
|
-
},
|
|
4190
|
+
}, vs = (e, t, n, r) => {
|
|
4139
4191
|
const o = e._zod.def;
|
|
4140
|
-
|
|
4192
|
+
E(o.innerType, t, r);
|
|
4141
4193
|
const i = t.seen.get(e);
|
|
4142
4194
|
i.ref = o.innerType;
|
|
4143
4195
|
let s;
|
|
@@ -4147,53 +4199,53 @@ const Qi = (e, t = {}) => (n) => {
|
|
|
4147
4199
|
throw new Error("Dynamic catch values are not supported in JSON Schema");
|
|
4148
4200
|
}
|
|
4149
4201
|
n.default = s;
|
|
4150
|
-
},
|
|
4202
|
+
}, ws = (e, t, n, r) => {
|
|
4151
4203
|
const o = e._zod.def, i = t.io === "input" ? o.in._zod.def.type === "transform" ? o.out : o.in : o.out;
|
|
4152
|
-
|
|
4204
|
+
E(i, t, r);
|
|
4153
4205
|
const s = t.seen.get(e);
|
|
4154
4206
|
s.ref = i;
|
|
4155
|
-
},
|
|
4207
|
+
}, bs = (e, t, n, r) => {
|
|
4156
4208
|
const o = e._zod.def;
|
|
4157
|
-
|
|
4209
|
+
E(o.innerType, t, r);
|
|
4158
4210
|
const i = t.seen.get(e);
|
|
4159
4211
|
i.ref = o.innerType, n.readOnly = !0;
|
|
4160
4212
|
}, Pt = (e, t, n, r) => {
|
|
4161
4213
|
const o = e._zod.def;
|
|
4162
|
-
|
|
4214
|
+
E(o.innerType, t, r);
|
|
4163
4215
|
const i = t.seen.get(e);
|
|
4164
4216
|
i.ref = o.innerType;
|
|
4165
|
-
},
|
|
4166
|
-
|
|
4217
|
+
}, ks = /* @__PURE__ */ d("ZodISODateTime", (e, t) => {
|
|
4218
|
+
zo.init(e, t), S.init(e, t);
|
|
4167
4219
|
});
|
|
4168
|
-
function
|
|
4169
|
-
return /* @__PURE__ */
|
|
4220
|
+
function zs(e) {
|
|
4221
|
+
return /* @__PURE__ */ Ii(ks, e);
|
|
4170
4222
|
}
|
|
4171
|
-
const
|
|
4172
|
-
|
|
4223
|
+
const $s = /* @__PURE__ */ d("ZodISODate", (e, t) => {
|
|
4224
|
+
$o.init(e, t), S.init(e, t);
|
|
4173
4225
|
});
|
|
4174
|
-
function
|
|
4175
|
-
return /* @__PURE__ */
|
|
4226
|
+
function Ss(e) {
|
|
4227
|
+
return /* @__PURE__ */ Oi($s, e);
|
|
4176
4228
|
}
|
|
4177
|
-
const
|
|
4178
|
-
|
|
4229
|
+
const Es = /* @__PURE__ */ d("ZodISOTime", (e, t) => {
|
|
4230
|
+
So.init(e, t), S.init(e, t);
|
|
4179
4231
|
});
|
|
4180
|
-
function
|
|
4181
|
-
return /* @__PURE__ */
|
|
4232
|
+
function Zs(e) {
|
|
4233
|
+
return /* @__PURE__ */ Pi(Es, e);
|
|
4182
4234
|
}
|
|
4183
|
-
const
|
|
4184
|
-
|
|
4235
|
+
const Ts = /* @__PURE__ */ d("ZodISODuration", (e, t) => {
|
|
4236
|
+
Eo.init(e, t), S.init(e, t);
|
|
4185
4237
|
});
|
|
4186
|
-
function
|
|
4187
|
-
return /* @__PURE__ */
|
|
4238
|
+
function Is(e) {
|
|
4239
|
+
return /* @__PURE__ */ Ai(Ts, e);
|
|
4188
4240
|
}
|
|
4189
|
-
const
|
|
4241
|
+
const Os = (e, t) => {
|
|
4190
4242
|
ft.init(e, t), e.name = "ZodError", Object.defineProperties(e, {
|
|
4191
4243
|
format: {
|
|
4192
|
-
value: (n) =>
|
|
4244
|
+
value: (n) => hr(e, n)
|
|
4193
4245
|
// enumerable: false,
|
|
4194
4246
|
},
|
|
4195
4247
|
flatten: {
|
|
4196
|
-
value: (n) =>
|
|
4248
|
+
value: (n) => gr(e, n)
|
|
4197
4249
|
// enumerable: false,
|
|
4198
4250
|
},
|
|
4199
4251
|
addIssue: {
|
|
@@ -4215,21 +4267,21 @@ const Is = (e, t) => {
|
|
|
4215
4267
|
// enumerable: false,
|
|
4216
4268
|
}
|
|
4217
4269
|
});
|
|
4218
|
-
},
|
|
4270
|
+
}, A = d("ZodError", Os, {
|
|
4219
4271
|
Parent: Error
|
|
4220
|
-
}),
|
|
4272
|
+
}), Ps = /* @__PURE__ */ ze(A), As = /* @__PURE__ */ $e(A), Ns = /* @__PURE__ */ ue(A), Cs = /* @__PURE__ */ de(A), Rs = /* @__PURE__ */ yr(A), js = /* @__PURE__ */ vr(A), Ds = /* @__PURE__ */ wr(A), Ls = /* @__PURE__ */ br(A), Us = /* @__PURE__ */ kr(A), Ms = /* @__PURE__ */ zr(A), Fs = /* @__PURE__ */ $r(A), xs = /* @__PURE__ */ Sr(A), $ = /* @__PURE__ */ d("ZodType", (e, t) => (z.init(e, t), Object.assign(e["~standard"], {
|
|
4221
4273
|
jsonSchema: {
|
|
4222
4274
|
input: ce(e, "input"),
|
|
4223
4275
|
output: ce(e, "output")
|
|
4224
4276
|
}
|
|
4225
|
-
}), e.toJSONSchema =
|
|
4277
|
+
}), e.toJSONSchema = Xi(e, {}), e.def = t, e.type = t.type, Object.defineProperty(e, "_def", { value: t }), e.check = (...n) => e.clone(F(t, {
|
|
4226
4278
|
checks: [
|
|
4227
4279
|
...t.checks ?? [],
|
|
4228
4280
|
...n.map((r) => typeof r == "function" ? { _zod: { check: r, def: { check: "custom" }, onattach: [] } } : r)
|
|
4229
4281
|
]
|
|
4230
4282
|
}), {
|
|
4231
4283
|
parent: !0
|
|
4232
|
-
}), e.with = e.check, e.clone = (n, r) =>
|
|
4284
|
+
}), e.with = e.check, e.clone = (n, r) => x(e, n, r), e.brand = () => e, e.register = ((n, r) => (n.add(e, r), e)), e.parse = (n, r) => Ps(e, n, r, { callee: e.parse }), e.safeParse = (n, r) => Ns(e, n, r), e.parseAsync = async (n, r) => As(e, n, r, { callee: e.parseAsync }), e.safeParseAsync = async (n, r) => Cs(e, n, r), e.spa = e.safeParseAsync, e.encode = (n, r) => Rs(e, n, r), e.decode = (n, r) => js(e, n, r), e.encodeAsync = async (n, r) => Ds(e, n, r), e.decodeAsync = async (n, r) => Ls(e, n, r), e.safeEncode = (n, r) => Us(e, n, r), e.safeDecode = (n, r) => Ms(e, n, r), e.safeEncodeAsync = async (n, r) => Fs(e, n, r), e.safeDecodeAsync = async (n, r) => xs(e, n, r), e.refine = (n, r) => e.check(La(n, r)), e.superRefine = (n) => e.check(Ua(n)), e.overwrite = (n) => e.check(/* @__PURE__ */ K(n)), e.optional = () => Qe(e), e.exactOptional = () => Sa(e), e.nullable = () => Xe(e), e.nullish = () => Qe(Xe(e)), e.nonoptional = (n) => Pa(e, n), e.array = () => pa(e), e.or = (n) => ma([e, n]), e.and = (n) => ya(e, n), e.transform = (n) => et(e, za(n)), e.default = (n) => Ta(e, n), e.prefault = (n) => Oa(e, n), e.catch = (n) => Na(e, n), e.pipe = (n) => et(e, n), e.readonly = () => ja(e), e.describe = (n) => {
|
|
4233
4285
|
const r = e.clone();
|
|
4234
4286
|
return X.add(r, { description: n }), r;
|
|
4235
4287
|
}, Object.defineProperty(e, "description", {
|
|
@@ -4243,129 +4295,129 @@ const Is = (e, t) => {
|
|
|
4243
4295
|
const r = e.clone();
|
|
4244
4296
|
return X.add(r, n[0]), r;
|
|
4245
4297
|
}, e.isOptional = () => e.safeParse(void 0).success, e.isNullable = () => e.safeParse(null).success, e.apply = (n) => n(e), e)), At = /* @__PURE__ */ d("_ZodString", (e, t) => {
|
|
4246
|
-
Se.init(e, t),
|
|
4298
|
+
Se.init(e, t), $.init(e, t), e._zod.processJSONSchema = (r, o, i) => ts(e, r, o);
|
|
4247
4299
|
const n = e._zod.bag;
|
|
4248
|
-
e.format = n.format ?? null, e.minLength = n.minimum ?? null, e.maxLength = n.maximum ?? null, e.regex = (...r) => e.check(/* @__PURE__ */
|
|
4300
|
+
e.format = n.format ?? null, e.minLength = n.minimum ?? null, e.maxLength = n.maximum ?? null, e.regex = (...r) => e.check(/* @__PURE__ */ Li(...r)), e.includes = (...r) => e.check(/* @__PURE__ */ Fi(...r)), e.startsWith = (...r) => e.check(/* @__PURE__ */ xi(...r)), e.endsWith = (...r) => e.check(/* @__PURE__ */ Ji(...r)), e.min = (...r) => e.check(/* @__PURE__ */ ae(...r)), e.max = (...r) => e.check(/* @__PURE__ */ Et(...r)), e.length = (...r) => e.check(/* @__PURE__ */ Zt(...r)), e.nonempty = (...r) => e.check(/* @__PURE__ */ ae(1, ...r)), e.lowercase = (r) => e.check(/* @__PURE__ */ Ui(r)), e.uppercase = (r) => e.check(/* @__PURE__ */ Mi(r)), e.trim = () => e.check(/* @__PURE__ */ Vi()), e.normalize = (...r) => e.check(/* @__PURE__ */ qi(...r)), e.toLowerCase = () => e.check(/* @__PURE__ */ Gi()), e.toUpperCase = () => e.check(/* @__PURE__ */ Bi()), e.slugify = () => e.check(/* @__PURE__ */ Wi());
|
|
4249
4301
|
}), Js = /* @__PURE__ */ d("ZodString", (e, t) => {
|
|
4250
|
-
Se.init(e, t), At.init(e, t), e.email = (n) => e.check(/* @__PURE__ */
|
|
4302
|
+
Se.init(e, t), At.init(e, t), e.email = (n) => e.check(/* @__PURE__ */ ci(qs, n)), e.url = (n) => e.check(/* @__PURE__ */ pi(Vs, n)), e.jwt = (n) => e.check(/* @__PURE__ */ Ti(sa, n)), e.emoji = (n) => e.check(/* @__PURE__ */ gi(Gs, n)), e.guid = (n) => e.check(/* @__PURE__ */ Ve(He, n)), e.uuid = (n) => e.check(/* @__PURE__ */ ui(oe, n)), e.uuidv4 = (n) => e.check(/* @__PURE__ */ di(oe, n)), e.uuidv6 = (n) => e.check(/* @__PURE__ */ li(oe, n)), e.uuidv7 = (n) => e.check(/* @__PURE__ */ fi(oe, n)), e.nanoid = (n) => e.check(/* @__PURE__ */ hi(Bs, n)), e.guid = (n) => e.check(/* @__PURE__ */ Ve(He, n)), e.cuid = (n) => e.check(/* @__PURE__ */ mi(Ws, n)), e.cuid2 = (n) => e.check(/* @__PURE__ */ _i(Hs, n)), e.ulid = (n) => e.check(/* @__PURE__ */ yi(Ks, n)), e.base64 = (n) => e.check(/* @__PURE__ */ Si(ra, n)), e.base64url = (n) => e.check(/* @__PURE__ */ Ei(oa, n)), e.xid = (n) => e.check(/* @__PURE__ */ vi(Ys, n)), e.ksuid = (n) => e.check(/* @__PURE__ */ wi(Qs, n)), e.ipv4 = (n) => e.check(/* @__PURE__ */ bi(Xs, n)), e.ipv6 = (n) => e.check(/* @__PURE__ */ ki(ea, n)), e.cidrv4 = (n) => e.check(/* @__PURE__ */ zi(ta, n)), e.cidrv6 = (n) => e.check(/* @__PURE__ */ $i(na, n)), e.e164 = (n) => e.check(/* @__PURE__ */ Zi(ia, n)), e.datetime = (n) => e.check(zs(n)), e.date = (n) => e.check(Ss(n)), e.time = (n) => e.check(Zs(n)), e.duration = (n) => e.check(Is(n));
|
|
4251
4303
|
});
|
|
4252
|
-
function
|
|
4253
|
-
return /* @__PURE__ */
|
|
4304
|
+
function zc(e) {
|
|
4305
|
+
return /* @__PURE__ */ ai(Js, e);
|
|
4254
4306
|
}
|
|
4255
|
-
const
|
|
4307
|
+
const S = /* @__PURE__ */ d("ZodStringFormat", (e, t) => {
|
|
4256
4308
|
b.init(e, t), At.init(e, t);
|
|
4257
|
-
}),
|
|
4258
|
-
|
|
4309
|
+
}), qs = /* @__PURE__ */ d("ZodEmail", (e, t) => {
|
|
4310
|
+
go.init(e, t), S.init(e, t);
|
|
4259
4311
|
}), He = /* @__PURE__ */ d("ZodGUID", (e, t) => {
|
|
4260
|
-
|
|
4312
|
+
fo.init(e, t), S.init(e, t);
|
|
4261
4313
|
}), oe = /* @__PURE__ */ d("ZodUUID", (e, t) => {
|
|
4262
|
-
|
|
4263
|
-
}),
|
|
4264
|
-
|
|
4265
|
-
}),
|
|
4266
|
-
|
|
4267
|
-
}),
|
|
4268
|
-
|
|
4269
|
-
}),
|
|
4270
|
-
|
|
4271
|
-
}),
|
|
4272
|
-
|
|
4273
|
-
}),
|
|
4274
|
-
|
|
4275
|
-
}),
|
|
4276
|
-
|
|
4277
|
-
}),
|
|
4278
|
-
|
|
4279
|
-
}),
|
|
4280
|
-
|
|
4281
|
-
}),
|
|
4282
|
-
|
|
4283
|
-
}),
|
|
4284
|
-
|
|
4285
|
-
}),
|
|
4286
|
-
|
|
4287
|
-
}),
|
|
4288
|
-
|
|
4289
|
-
}),
|
|
4290
|
-
|
|
4291
|
-
}),
|
|
4292
|
-
|
|
4293
|
-
}),
|
|
4294
|
-
|
|
4314
|
+
po.init(e, t), S.init(e, t);
|
|
4315
|
+
}), Vs = /* @__PURE__ */ d("ZodURL", (e, t) => {
|
|
4316
|
+
ho.init(e, t), S.init(e, t);
|
|
4317
|
+
}), Gs = /* @__PURE__ */ d("ZodEmoji", (e, t) => {
|
|
4318
|
+
mo.init(e, t), S.init(e, t);
|
|
4319
|
+
}), Bs = /* @__PURE__ */ d("ZodNanoID", (e, t) => {
|
|
4320
|
+
_o.init(e, t), S.init(e, t);
|
|
4321
|
+
}), Ws = /* @__PURE__ */ d("ZodCUID", (e, t) => {
|
|
4322
|
+
yo.init(e, t), S.init(e, t);
|
|
4323
|
+
}), Hs = /* @__PURE__ */ d("ZodCUID2", (e, t) => {
|
|
4324
|
+
vo.init(e, t), S.init(e, t);
|
|
4325
|
+
}), Ks = /* @__PURE__ */ d("ZodULID", (e, t) => {
|
|
4326
|
+
wo.init(e, t), S.init(e, t);
|
|
4327
|
+
}), Ys = /* @__PURE__ */ d("ZodXID", (e, t) => {
|
|
4328
|
+
bo.init(e, t), S.init(e, t);
|
|
4329
|
+
}), Qs = /* @__PURE__ */ d("ZodKSUID", (e, t) => {
|
|
4330
|
+
ko.init(e, t), S.init(e, t);
|
|
4331
|
+
}), Xs = /* @__PURE__ */ d("ZodIPv4", (e, t) => {
|
|
4332
|
+
Zo.init(e, t), S.init(e, t);
|
|
4333
|
+
}), ea = /* @__PURE__ */ d("ZodIPv6", (e, t) => {
|
|
4334
|
+
To.init(e, t), S.init(e, t);
|
|
4335
|
+
}), ta = /* @__PURE__ */ d("ZodCIDRv4", (e, t) => {
|
|
4336
|
+
Io.init(e, t), S.init(e, t);
|
|
4337
|
+
}), na = /* @__PURE__ */ d("ZodCIDRv6", (e, t) => {
|
|
4338
|
+
Oo.init(e, t), S.init(e, t);
|
|
4339
|
+
}), ra = /* @__PURE__ */ d("ZodBase64", (e, t) => {
|
|
4340
|
+
Po.init(e, t), S.init(e, t);
|
|
4341
|
+
}), oa = /* @__PURE__ */ d("ZodBase64URL", (e, t) => {
|
|
4342
|
+
No.init(e, t), S.init(e, t);
|
|
4343
|
+
}), ia = /* @__PURE__ */ d("ZodE164", (e, t) => {
|
|
4344
|
+
Co.init(e, t), S.init(e, t);
|
|
4345
|
+
}), sa = /* @__PURE__ */ d("ZodJWT", (e, t) => {
|
|
4346
|
+
jo.init(e, t), S.init(e, t);
|
|
4295
4347
|
}), Nt = /* @__PURE__ */ d("ZodNumber", (e, t) => {
|
|
4296
|
-
kt.init(e, t),
|
|
4348
|
+
kt.init(e, t), $.init(e, t), e._zod.processJSONSchema = (r, o, i) => ns(e, r, o), e.gt = (r, o) => e.check(/* @__PURE__ */ Be(r, o)), e.gte = (r, o) => e.check(/* @__PURE__ */ pe(r, o)), e.min = (r, o) => e.check(/* @__PURE__ */ pe(r, o)), e.lt = (r, o) => e.check(/* @__PURE__ */ Ge(r, o)), e.lte = (r, o) => e.check(/* @__PURE__ */ fe(r, o)), e.max = (r, o) => e.check(/* @__PURE__ */ fe(r, o)), e.int = (r) => e.check(Ke(r)), e.safe = (r) => e.check(Ke(r)), e.positive = (r) => e.check(/* @__PURE__ */ Be(0, r)), e.nonnegative = (r) => e.check(/* @__PURE__ */ pe(0, r)), e.negative = (r) => e.check(/* @__PURE__ */ Ge(0, r)), e.nonpositive = (r) => e.check(/* @__PURE__ */ fe(0, r)), e.multipleOf = (r, o) => e.check(/* @__PURE__ */ We(r, o)), e.step = (r, o) => e.check(/* @__PURE__ */ We(r, o)), e.finite = () => e;
|
|
4297
4349
|
const n = e._zod.bag;
|
|
4298
4350
|
e.minValue = Math.max(n.minimum ?? Number.NEGATIVE_INFINITY, n.exclusiveMinimum ?? Number.NEGATIVE_INFINITY) ?? null, e.maxValue = Math.min(n.maximum ?? Number.POSITIVE_INFINITY, n.exclusiveMaximum ?? Number.POSITIVE_INFINITY) ?? null, e.isInt = (n.format ?? "").includes("int") || Number.isSafeInteger(n.multipleOf ?? 0.5), e.isFinite = !0, e.format = n.format ?? null;
|
|
4299
4351
|
});
|
|
4300
|
-
function
|
|
4301
|
-
return /* @__PURE__ */
|
|
4352
|
+
function $c(e) {
|
|
4353
|
+
return /* @__PURE__ */ Ni(Nt, e);
|
|
4302
4354
|
}
|
|
4303
|
-
const
|
|
4304
|
-
|
|
4355
|
+
const aa = /* @__PURE__ */ d("ZodNumberFormat", (e, t) => {
|
|
4356
|
+
Do.init(e, t), Nt.init(e, t);
|
|
4305
4357
|
});
|
|
4306
4358
|
function Ke(e) {
|
|
4307
|
-
return /* @__PURE__ */
|
|
4359
|
+
return /* @__PURE__ */ Ci(aa, e);
|
|
4308
4360
|
}
|
|
4309
|
-
const
|
|
4310
|
-
|
|
4361
|
+
const ca = /* @__PURE__ */ d("ZodBoolean", (e, t) => {
|
|
4362
|
+
Lo.init(e, t), $.init(e, t), e._zod.processJSONSchema = (n, r, o) => rs(e, n, r);
|
|
4311
4363
|
});
|
|
4312
|
-
function
|
|
4313
|
-
return /* @__PURE__ */
|
|
4364
|
+
function Sc(e) {
|
|
4365
|
+
return /* @__PURE__ */ Ri(ca, e);
|
|
4314
4366
|
}
|
|
4315
|
-
const
|
|
4316
|
-
|
|
4367
|
+
const ua = /* @__PURE__ */ d("ZodUnknown", (e, t) => {
|
|
4368
|
+
Uo.init(e, t), $.init(e, t), e._zod.processJSONSchema = (n, r, o) => is();
|
|
4317
4369
|
});
|
|
4318
4370
|
function Ye() {
|
|
4319
|
-
return /* @__PURE__ */
|
|
4371
|
+
return /* @__PURE__ */ ji(ua);
|
|
4320
4372
|
}
|
|
4321
|
-
const
|
|
4322
|
-
|
|
4373
|
+
const da = /* @__PURE__ */ d("ZodNever", (e, t) => {
|
|
4374
|
+
Mo.init(e, t), $.init(e, t), e._zod.processJSONSchema = (n, r, o) => os(e, n, r);
|
|
4323
4375
|
});
|
|
4324
|
-
function
|
|
4325
|
-
return /* @__PURE__ */
|
|
4376
|
+
function la(e) {
|
|
4377
|
+
return /* @__PURE__ */ Di(da, e);
|
|
4326
4378
|
}
|
|
4327
|
-
const
|
|
4328
|
-
|
|
4379
|
+
const fa = /* @__PURE__ */ d("ZodArray", (e, t) => {
|
|
4380
|
+
Fo.init(e, t), $.init(e, t), e._zod.processJSONSchema = (n, r, o) => ds(e, n, r, o), e.element = t.element, e.min = (n, r) => e.check(/* @__PURE__ */ ae(n, r)), e.nonempty = (n) => e.check(/* @__PURE__ */ ae(1, n)), e.max = (n, r) => e.check(/* @__PURE__ */ Et(n, r)), e.length = (n, r) => e.check(/* @__PURE__ */ Zt(n, r)), e.unwrap = () => e.element;
|
|
4329
4381
|
});
|
|
4330
|
-
function
|
|
4331
|
-
return /* @__PURE__ */
|
|
4382
|
+
function pa(e, t) {
|
|
4383
|
+
return /* @__PURE__ */ Hi(fa, e, t);
|
|
4332
4384
|
}
|
|
4333
|
-
const
|
|
4334
|
-
Jo.init(e, t),
|
|
4385
|
+
const ga = /* @__PURE__ */ d("ZodObject", (e, t) => {
|
|
4386
|
+
Jo.init(e, t), $.init(e, t), e._zod.processJSONSchema = (n, r, o) => ls(e, n, r, o), v(e, "shape", () => t.shape), e.keyof = () => wa(Object.keys(e._zod.def.shape)), e.catchall = (n) => e.clone({ ...e._zod.def, catchall: n }), e.passthrough = () => e.clone({ ...e._zod.def, catchall: Ye() }), e.loose = () => e.clone({ ...e._zod.def, catchall: Ye() }), e.strict = () => e.clone({ ...e._zod.def, catchall: la() }), e.strip = () => e.clone({ ...e._zod.def, catchall: void 0 }), e.extend = (n) => ur(e, n), e.safeExtend = (n) => dr(e, n), e.merge = (n) => lr(e, n), e.pick = (n) => ar(e, n), e.omit = (n) => cr(e, n), e.partial = (...n) => fr(Ct, e, n[0]), e.required = (...n) => pr(Rt, e, n[0]);
|
|
4335
4387
|
});
|
|
4336
|
-
function
|
|
4388
|
+
function Ec(e, t) {
|
|
4337
4389
|
const n = {
|
|
4338
4390
|
type: "object",
|
|
4339
4391
|
shape: e ?? {},
|
|
4340
4392
|
...h(t)
|
|
4341
4393
|
};
|
|
4342
|
-
return new
|
|
4394
|
+
return new ga(n);
|
|
4343
4395
|
}
|
|
4344
|
-
const
|
|
4345
|
-
|
|
4396
|
+
const ha = /* @__PURE__ */ d("ZodUnion", (e, t) => {
|
|
4397
|
+
qo.init(e, t), $.init(e, t), e._zod.processJSONSchema = (n, r, o) => fs(e, n, r, o), e.options = t.options;
|
|
4346
4398
|
});
|
|
4347
|
-
function
|
|
4348
|
-
return new
|
|
4399
|
+
function ma(e, t) {
|
|
4400
|
+
return new ha({
|
|
4349
4401
|
type: "union",
|
|
4350
4402
|
options: e,
|
|
4351
4403
|
...h(t)
|
|
4352
4404
|
});
|
|
4353
4405
|
}
|
|
4354
|
-
const
|
|
4355
|
-
|
|
4406
|
+
const _a = /* @__PURE__ */ d("ZodIntersection", (e, t) => {
|
|
4407
|
+
Vo.init(e, t), $.init(e, t), e._zod.processJSONSchema = (n, r, o) => ps(e, n, r, o);
|
|
4356
4408
|
});
|
|
4357
|
-
function
|
|
4358
|
-
return new
|
|
4409
|
+
function ya(e, t) {
|
|
4410
|
+
return new _a({
|
|
4359
4411
|
type: "intersection",
|
|
4360
4412
|
left: e,
|
|
4361
4413
|
right: t
|
|
4362
4414
|
});
|
|
4363
4415
|
}
|
|
4364
|
-
const
|
|
4365
|
-
|
|
4416
|
+
const va = /* @__PURE__ */ d("ZodRecord", (e, t) => {
|
|
4417
|
+
Go.init(e, t), $.init(e, t), e._zod.processJSONSchema = (n, r, o) => gs(e, n, r, o), e.keyType = t.keyType, e.valueType = t.valueType;
|
|
4366
4418
|
});
|
|
4367
|
-
function
|
|
4368
|
-
return new
|
|
4419
|
+
function Zc(e, t, n) {
|
|
4420
|
+
return new va({
|
|
4369
4421
|
type: "record",
|
|
4370
4422
|
keyType: e,
|
|
4371
4423
|
valueType: t,
|
|
@@ -4373,7 +4425,7 @@ function Ec(e, t, n) {
|
|
|
4373
4425
|
});
|
|
4374
4426
|
}
|
|
4375
4427
|
const me = /* @__PURE__ */ d("ZodEnum", (e, t) => {
|
|
4376
|
-
|
|
4428
|
+
Bo.init(e, t), $.init(e, t), e._zod.processJSONSchema = (r, o, i) => ss(e, r, o), e.enum = t.entries, e.options = Object.values(t.entries);
|
|
4377
4429
|
const n = new Set(Object.keys(t.entries));
|
|
4378
4430
|
e.extract = (r, o) => {
|
|
4379
4431
|
const i = {};
|
|
@@ -4403,7 +4455,7 @@ const me = /* @__PURE__ */ d("ZodEnum", (e, t) => {
|
|
|
4403
4455
|
});
|
|
4404
4456
|
};
|
|
4405
4457
|
});
|
|
4406
|
-
function
|
|
4458
|
+
function wa(e, t) {
|
|
4407
4459
|
const n = Array.isArray(e) ? Object.fromEntries(e.map((r) => [r, r])) : e;
|
|
4408
4460
|
return new me({
|
|
4409
4461
|
type: "enum",
|
|
@@ -4411,8 +4463,8 @@ function va(e, t) {
|
|
|
4411
4463
|
...h(t)
|
|
4412
4464
|
});
|
|
4413
4465
|
}
|
|
4414
|
-
const
|
|
4415
|
-
|
|
4466
|
+
const ba = /* @__PURE__ */ d("ZodLiteral", (e, t) => {
|
|
4467
|
+
Wo.init(e, t), $.init(e, t), e._zod.processJSONSchema = (n, r, o) => as(e, n, r), e.values = new Set(t.values), Object.defineProperty(e, "value", {
|
|
4416
4468
|
get() {
|
|
4417
4469
|
if (t.values.length > 1)
|
|
4418
4470
|
throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");
|
|
@@ -4420,15 +4472,15 @@ const wa = /* @__PURE__ */ d("ZodLiteral", (e, t) => {
|
|
|
4420
4472
|
}
|
|
4421
4473
|
});
|
|
4422
4474
|
});
|
|
4423
|
-
function
|
|
4424
|
-
return new
|
|
4475
|
+
function Tc(e, t) {
|
|
4476
|
+
return new ba({
|
|
4425
4477
|
type: "literal",
|
|
4426
4478
|
values: Array.isArray(e) ? e : [e],
|
|
4427
4479
|
...h(t)
|
|
4428
4480
|
});
|
|
4429
4481
|
}
|
|
4430
|
-
const
|
|
4431
|
-
|
|
4482
|
+
const ka = /* @__PURE__ */ d("ZodTransform", (e, t) => {
|
|
4483
|
+
Ho.init(e, t), $.init(e, t), e._zod.processJSONSchema = (n, r, o) => us(e, n), e._zod.parse = (n, r) => {
|
|
4432
4484
|
if (r.direction === "backward")
|
|
4433
4485
|
throw new st(e.constructor.name);
|
|
4434
4486
|
n.addIssue = (i) => {
|
|
@@ -4443,14 +4495,14 @@ const ba = /* @__PURE__ */ d("ZodTransform", (e, t) => {
|
|
|
4443
4495
|
return o instanceof Promise ? o.then((i) => (n.value = i, n)) : (n.value = o, n);
|
|
4444
4496
|
};
|
|
4445
4497
|
});
|
|
4446
|
-
function
|
|
4447
|
-
return new
|
|
4498
|
+
function za(e) {
|
|
4499
|
+
return new ka({
|
|
4448
4500
|
type: "transform",
|
|
4449
4501
|
transform: e
|
|
4450
4502
|
});
|
|
4451
4503
|
}
|
|
4452
4504
|
const Ct = /* @__PURE__ */ d("ZodOptional", (e, t) => {
|
|
4453
|
-
St.init(e, t),
|
|
4505
|
+
St.init(e, t), $.init(e, t), e._zod.processJSONSchema = (n, r, o) => Pt(e, n, r, o), e.unwrap = () => e._zod.def.innerType;
|
|
4454
4506
|
});
|
|
4455
4507
|
function Qe(e) {
|
|
4456
4508
|
return new Ct({
|
|
@@ -4458,29 +4510,29 @@ function Qe(e) {
|
|
|
4458
4510
|
innerType: e
|
|
4459
4511
|
});
|
|
4460
4512
|
}
|
|
4461
|
-
const
|
|
4462
|
-
|
|
4513
|
+
const $a = /* @__PURE__ */ d("ZodExactOptional", (e, t) => {
|
|
4514
|
+
Ko.init(e, t), $.init(e, t), e._zod.processJSONSchema = (n, r, o) => Pt(e, n, r, o), e.unwrap = () => e._zod.def.innerType;
|
|
4463
4515
|
});
|
|
4464
|
-
function
|
|
4465
|
-
return new
|
|
4516
|
+
function Sa(e) {
|
|
4517
|
+
return new $a({
|
|
4466
4518
|
type: "optional",
|
|
4467
4519
|
innerType: e
|
|
4468
4520
|
});
|
|
4469
4521
|
}
|
|
4470
|
-
const
|
|
4471
|
-
|
|
4522
|
+
const Ea = /* @__PURE__ */ d("ZodNullable", (e, t) => {
|
|
4523
|
+
Yo.init(e, t), $.init(e, t), e._zod.processJSONSchema = (n, r, o) => hs(e, n, r, o), e.unwrap = () => e._zod.def.innerType;
|
|
4472
4524
|
});
|
|
4473
4525
|
function Xe(e) {
|
|
4474
|
-
return new
|
|
4526
|
+
return new Ea({
|
|
4475
4527
|
type: "nullable",
|
|
4476
4528
|
innerType: e
|
|
4477
4529
|
});
|
|
4478
4530
|
}
|
|
4479
|
-
const
|
|
4480
|
-
|
|
4531
|
+
const Za = /* @__PURE__ */ d("ZodDefault", (e, t) => {
|
|
4532
|
+
Qo.init(e, t), $.init(e, t), e._zod.processJSONSchema = (n, r, o) => _s(e, n, r, o), e.unwrap = () => e._zod.def.innerType, e.removeDefault = e.unwrap;
|
|
4481
4533
|
});
|
|
4482
|
-
function
|
|
4483
|
-
return new
|
|
4534
|
+
function Ta(e, t) {
|
|
4535
|
+
return new Za({
|
|
4484
4536
|
type: "default",
|
|
4485
4537
|
innerType: e,
|
|
4486
4538
|
get defaultValue() {
|
|
@@ -4488,11 +4540,11 @@ function Za(e, t) {
|
|
|
4488
4540
|
}
|
|
4489
4541
|
});
|
|
4490
4542
|
}
|
|
4491
|
-
const
|
|
4492
|
-
|
|
4543
|
+
const Ia = /* @__PURE__ */ d("ZodPrefault", (e, t) => {
|
|
4544
|
+
Xo.init(e, t), $.init(e, t), e._zod.processJSONSchema = (n, r, o) => ys(e, n, r, o), e.unwrap = () => e._zod.def.innerType;
|
|
4493
4545
|
});
|
|
4494
|
-
function
|
|
4495
|
-
return new
|
|
4546
|
+
function Oa(e, t) {
|
|
4547
|
+
return new Ia({
|
|
4496
4548
|
type: "prefault",
|
|
4497
4549
|
innerType: e,
|
|
4498
4550
|
get defaultValue() {
|
|
@@ -4501,121 +4553,121 @@ function Ia(e, t) {
|
|
|
4501
4553
|
});
|
|
4502
4554
|
}
|
|
4503
4555
|
const Rt = /* @__PURE__ */ d("ZodNonOptional", (e, t) => {
|
|
4504
|
-
|
|
4556
|
+
ei.init(e, t), $.init(e, t), e._zod.processJSONSchema = (n, r, o) => ms(e, n, r, o), e.unwrap = () => e._zod.def.innerType;
|
|
4505
4557
|
});
|
|
4506
|
-
function
|
|
4558
|
+
function Pa(e, t) {
|
|
4507
4559
|
return new Rt({
|
|
4508
4560
|
type: "nonoptional",
|
|
4509
4561
|
innerType: e,
|
|
4510
4562
|
...h(t)
|
|
4511
4563
|
});
|
|
4512
4564
|
}
|
|
4513
|
-
const
|
|
4514
|
-
|
|
4565
|
+
const Aa = /* @__PURE__ */ d("ZodCatch", (e, t) => {
|
|
4566
|
+
ti.init(e, t), $.init(e, t), e._zod.processJSONSchema = (n, r, o) => vs(e, n, r, o), e.unwrap = () => e._zod.def.innerType, e.removeCatch = e.unwrap;
|
|
4515
4567
|
});
|
|
4516
|
-
function
|
|
4517
|
-
return new
|
|
4568
|
+
function Na(e, t) {
|
|
4569
|
+
return new Aa({
|
|
4518
4570
|
type: "catch",
|
|
4519
4571
|
innerType: e,
|
|
4520
4572
|
catchValue: typeof t == "function" ? t : () => t
|
|
4521
4573
|
});
|
|
4522
4574
|
}
|
|
4523
|
-
const
|
|
4524
|
-
|
|
4575
|
+
const Ca = /* @__PURE__ */ d("ZodPipe", (e, t) => {
|
|
4576
|
+
ni.init(e, t), $.init(e, t), e._zod.processJSONSchema = (n, r, o) => ws(e, n, r, o), e.in = t.in, e.out = t.out;
|
|
4525
4577
|
});
|
|
4526
4578
|
function et(e, t) {
|
|
4527
|
-
return new
|
|
4579
|
+
return new Ca({
|
|
4528
4580
|
type: "pipe",
|
|
4529
4581
|
in: e,
|
|
4530
4582
|
out: t
|
|
4531
4583
|
// ...util.normalizeParams(params),
|
|
4532
4584
|
});
|
|
4533
4585
|
}
|
|
4534
|
-
const
|
|
4535
|
-
|
|
4586
|
+
const Ra = /* @__PURE__ */ d("ZodReadonly", (e, t) => {
|
|
4587
|
+
ri.init(e, t), $.init(e, t), e._zod.processJSONSchema = (n, r, o) => bs(e, n, r, o), e.unwrap = () => e._zod.def.innerType;
|
|
4536
4588
|
});
|
|
4537
|
-
function
|
|
4538
|
-
return new
|
|
4589
|
+
function ja(e) {
|
|
4590
|
+
return new Ra({
|
|
4539
4591
|
type: "readonly",
|
|
4540
4592
|
innerType: e
|
|
4541
4593
|
});
|
|
4542
4594
|
}
|
|
4543
|
-
const
|
|
4544
|
-
|
|
4595
|
+
const Da = /* @__PURE__ */ d("ZodCustom", (e, t) => {
|
|
4596
|
+
oi.init(e, t), $.init(e, t), e._zod.processJSONSchema = (n, r, o) => cs(e, n);
|
|
4545
4597
|
});
|
|
4546
|
-
function
|
|
4547
|
-
return /* @__PURE__ */
|
|
4598
|
+
function La(e, t = {}) {
|
|
4599
|
+
return /* @__PURE__ */ Ki(Da, e, t);
|
|
4548
4600
|
}
|
|
4549
|
-
function
|
|
4550
|
-
return /* @__PURE__ */
|
|
4601
|
+
function Ua(e) {
|
|
4602
|
+
return /* @__PURE__ */ Yi(e);
|
|
4551
4603
|
}
|
|
4552
4604
|
export {
|
|
4553
4605
|
Ut as $,
|
|
4554
|
-
|
|
4555
|
-
|
|
4556
|
-
|
|
4557
|
-
|
|
4558
|
-
|
|
4559
|
-
|
|
4560
|
-
|
|
4561
|
-
|
|
4562
|
-
|
|
4563
|
-
|
|
4564
|
-
|
|
4565
|
-
|
|
4566
|
-
|
|
4567
|
-
|
|
4568
|
-
|
|
4569
|
-
|
|
4570
|
-
|
|
4571
|
-
|
|
4572
|
-
|
|
4573
|
-
|
|
4574
|
-
|
|
4606
|
+
Bn as A,
|
|
4607
|
+
ic as B,
|
|
4608
|
+
Zc as C,
|
|
4609
|
+
_c as D,
|
|
4610
|
+
vc as E,
|
|
4611
|
+
bc as F,
|
|
4612
|
+
gc as G,
|
|
4613
|
+
fc as H,
|
|
4614
|
+
pc as I,
|
|
4615
|
+
mc as J,
|
|
4616
|
+
lc as K,
|
|
4617
|
+
wc as L,
|
|
4618
|
+
Ha as M,
|
|
4619
|
+
Ka as N,
|
|
4620
|
+
Xn as O,
|
|
4621
|
+
Wa as P,
|
|
4622
|
+
Va as Q,
|
|
4623
|
+
hc as R,
|
|
4624
|
+
yc as S,
|
|
4625
|
+
qa as T,
|
|
4626
|
+
Tc as U,
|
|
4575
4627
|
Jt as V,
|
|
4576
|
-
|
|
4628
|
+
ec as W,
|
|
4577
4629
|
Ee as X,
|
|
4578
|
-
|
|
4630
|
+
xt as Y,
|
|
4579
4631
|
Mt as Z,
|
|
4580
|
-
|
|
4581
|
-
|
|
4632
|
+
wa as _,
|
|
4633
|
+
ac as a,
|
|
4582
4634
|
Dt as a0,
|
|
4583
|
-
|
|
4584
|
-
|
|
4635
|
+
Kt as a1,
|
|
4636
|
+
nc as a2,
|
|
4585
4637
|
ee as a3,
|
|
4586
4638
|
Lt as a4,
|
|
4587
4639
|
M as a5,
|
|
4588
|
-
|
|
4589
|
-
|
|
4590
|
-
|
|
4591
|
-
|
|
4592
|
-
|
|
4593
|
-
|
|
4594
|
-
|
|
4595
|
-
|
|
4596
|
-
|
|
4597
|
-
|
|
4640
|
+
Wt as a6,
|
|
4641
|
+
Ht as a7,
|
|
4642
|
+
sc as a8,
|
|
4643
|
+
rc as a9,
|
|
4644
|
+
kc as aa,
|
|
4645
|
+
tc as ab,
|
|
4646
|
+
qt as ac,
|
|
4647
|
+
dc as b,
|
|
4648
|
+
rn as c,
|
|
4649
|
+
Sc as d,
|
|
4598
4650
|
Ye as e,
|
|
4599
|
-
|
|
4651
|
+
pa as f,
|
|
4600
4652
|
Ja as g,
|
|
4601
|
-
|
|
4653
|
+
Ga as h,
|
|
4602
4654
|
Pe as i,
|
|
4603
|
-
|
|
4604
|
-
|
|
4605
|
-
|
|
4606
|
-
|
|
4607
|
-
|
|
4608
|
-
|
|
4609
|
-
|
|
4610
|
-
|
|
4611
|
-
|
|
4612
|
-
|
|
4613
|
-
|
|
4614
|
-
|
|
4615
|
-
|
|
4616
|
-
|
|
4617
|
-
|
|
4655
|
+
Xa as j,
|
|
4656
|
+
oc as k,
|
|
4657
|
+
Ba as l,
|
|
4658
|
+
xa as m,
|
|
4659
|
+
Yn as n,
|
|
4660
|
+
Ec as o,
|
|
4661
|
+
cc as p,
|
|
4662
|
+
uc as q,
|
|
4663
|
+
Fa as r,
|
|
4664
|
+
zc as s,
|
|
4665
|
+
Hn as t,
|
|
4666
|
+
ma as u,
|
|
4667
|
+
$c as v,
|
|
4668
|
+
Ya as w,
|
|
4669
|
+
Qn as x,
|
|
4618
4670
|
Ae as y,
|
|
4619
|
-
|
|
4671
|
+
Qa as z
|
|
4620
4672
|
};
|
|
4621
|
-
//# sourceMappingURL=schemas-
|
|
4673
|
+
//# sourceMappingURL=schemas-yF4IOEUi.js.map
|